diff --git a/.htaccess b/.htaccess index 4b7dff9..c938b86 100755 --- a/.htaccess +++ b/.htaccess @@ -1,22 +1,22 @@ - -RewriteEngine on - -## Uncomment "#RewriteBase /" line below (remove "#") if pH2Date is installed in a folder and so add the folder name after the slash "/" -## Example: If pH2Date is installed in "/public_html/ph2date/", then it should be "RewriteBase /ph2date/", however it may depends of your Apache configuration. - -#RewriteBase / - - -# Prevent CI index.php -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule .* index.php/$0 [PT,L] - -# Prevent user access to the CI system folder. -RewriteCond %{REQUEST_URI} ^system.* -RewriteRule ^(.*)$ /index.php?/$1 [L] - -# Prevent user access to the CI application folder -RewriteCond %{REQUEST_URI} ^application.* -RewriteRule ^(.*)$ /index.php?/$1 [L] + +RewriteEngine on + +## Uncomment "#RewriteBase /" line below (remove "#") if pH2Date is installed in a folder and so add the folder name after the slash "/" +## Example: If pH2Date is installed in "/public_html/ph2date/", then it should be "RewriteBase /ph2date/", however it may depends of your Apache configuration. + +#RewriteBase / + + +# Prevent CI index.php +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule .* index.php/$0 [PT,L] + +# Prevent user access to the CI system folder. +RewriteCond %{REQUEST_URI} ^system.* +RewriteRule ^(.*)$ /index.php?/$1 [L] + +# Prevent user access to the CI application folder +RewriteCond %{REQUEST_URI} ^application.* +RewriteRule ^(.*)$ /index.php?/$1 [L] \ No newline at end of file diff --git a/application/cache/index.html b/application/cache/index.html index 065d2da..04e928c 100755 --- a/application/cache/index.html +++ b/application/cache/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/config/autoload.php b/application/config/autoload.php index f7d3d1e..9e26e6a 100755 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -1,116 +1,116 @@ - '', - 'xhtml1-strict' => '', - 'xhtml1-trans' => '', - 'xhtml1-frame' => '', - 'html5' => '', - 'html4-strict' => '', - 'html4-trans' => '', - 'html4-frame' => '' - ); - -/* End of file doctypes.php */ + '', + 'xhtml1-strict' => '', + 'xhtml1-trans' => '', + 'xhtml1-frame' => '', + 'html5' => '', + 'html4-strict' => '', + 'html4-trans' => '', + 'html4-frame' => '' + ); + +/* End of file doctypes.php */ /* Location: ./application/config/doctypes.php */ \ No newline at end of file diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php index 1e62910..8566873 100755 --- a/application/config/foreign_chars.php +++ b/application/config/foreign_chars.php @@ -1,64 +1,64 @@ - 'ae', - '/ö|œ/' => 'oe', - '/ü/' => 'ue', - '/Ä/' => 'Ae', - '/Ü/' => 'Ue', - '/Ö/' => 'Oe', - '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A', - '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', - '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', - '/ç|ć|ĉ|ċ|č/' => 'c', - '/Ð|Ď|Đ/' => 'D', - '/ð|ď|đ/' => 'd', - '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E', - '/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e', - '/Ĝ|Ğ|Ġ|Ģ/' => 'G', - '/ĝ|ğ|ġ|ģ/' => 'g', - '/Ĥ|Ħ/' => 'H', - '/ĥ|ħ/' => 'h', - '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I', - '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i', - '/Ĵ/' => 'J', - '/ĵ/' => 'j', - '/Ķ/' => 'K', - '/ķ/' => 'k', - '/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L', - '/ĺ|ļ|ľ|ŀ|ł/' => 'l', - '/Ñ|Ń|Ņ|Ň/' => 'N', - '/ñ|ń|ņ|ň|ʼn/' => 'n', - '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O', - '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o', - '/Ŕ|Ŗ|Ř/' => 'R', - '/ŕ|ŗ|ř/' => 'r', - '/Ś|Ŝ|Ş|Š/' => 'S', - '/ś|ŝ|ş|š|ſ/' => 's', - '/Ţ|Ť|Ŧ/' => 'T', - '/ţ|ť|ŧ/' => 't', - '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U', - '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u', - '/Ý|Ÿ|Ŷ/' => 'Y', - '/ý|ÿ|ŷ/' => 'y', - '/Ŵ/' => 'W', - '/ŵ/' => 'w', - '/Ź|Ż|Ž/' => 'Z', - '/ź|ż|ž/' => 'z', - '/Æ|Ǽ/' => 'AE', - '/ß/'=> 'ss', - '/IJ/' => 'IJ', - '/ij/' => 'ij', - '/Œ/' => 'OE', - '/ƒ/' => 'f' -); - -/* End of file foreign_chars.php */ + 'ae', + '/ö|œ/' => 'oe', + '/ü/' => 'ue', + '/Ä/' => 'Ae', + '/Ü/' => 'Ue', + '/Ö/' => 'Oe', + '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A', + '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', + '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', + '/ç|ć|ĉ|ċ|č/' => 'c', + '/Ð|Ď|Đ/' => 'D', + '/ð|ď|đ/' => 'd', + '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E', + '/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e', + '/Ĝ|Ğ|Ġ|Ģ/' => 'G', + '/ĝ|ğ|ġ|ģ/' => 'g', + '/Ĥ|Ħ/' => 'H', + '/ĥ|ħ/' => 'h', + '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I', + '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i', + '/Ĵ/' => 'J', + '/ĵ/' => 'j', + '/Ķ/' => 'K', + '/ķ/' => 'k', + '/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L', + '/ĺ|ļ|ľ|ŀ|ł/' => 'l', + '/Ñ|Ń|Ņ|Ň/' => 'N', + '/ñ|ń|ņ|ň|ʼn/' => 'n', + '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O', + '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o', + '/Ŕ|Ŗ|Ř/' => 'R', + '/ŕ|ŗ|ř/' => 'r', + '/Ś|Ŝ|Ş|Š/' => 'S', + '/ś|ŝ|ş|š|ſ/' => 's', + '/Ţ|Ť|Ŧ/' => 'T', + '/ţ|ť|ŧ/' => 't', + '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U', + '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u', + '/Ý|Ÿ|Ŷ/' => 'Y', + '/ý|ÿ|ŷ/' => 'y', + '/Ŵ/' => 'W', + '/ŵ/' => 'w', + '/Ź|Ż|Ž/' => 'Z', + '/ź|ż|ž/' => 'z', + '/Æ|Ǽ/' => 'AE', + '/ß/'=> 'ss', + '/IJ/' => 'IJ', + '/ij/' => 'ij', + '/Œ/' => 'OE', + '/ƒ/' => 'f' +); + +/* End of file foreign_chars.php */ /* Location: ./application/config/foreign_chars.php */ \ No newline at end of file diff --git a/application/config/grocery_crud.php b/application/config/grocery_crud.php index f473f1c..1ee6fc6 100755 --- a/application/config/grocery_crud.php +++ b/application/config/grocery_crud.php @@ -1,29 +1,29 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/config/init.php b/application/config/init.php index 2b86eec..7586d62 100755 --- a/application/config/init.php +++ b/application/config/init.php @@ -1,15 +1,15 @@ -ion_auth->is_max_login_attempts_exceeded(). - | The controller should check this function and act - | appropriately. If this variable set to 0, there is no maximum. - */ -$config['site_title'] = "Example.com"; // Site Title, example.com -$config['admin_email'] = "admin@example.com"; // Admin Email, admin@example.com -$config['default_group'] = 'members'; // Default group, use name -$config['admin_group'] = 'admin'; // Default administrators group, use name -$config['identity'] = 'email'; // A database column which is used to login with -$config['min_password_length'] = 6; // Minimum Required Length of Password -$config['max_password_length'] = 20; // Maximum Allowed Length of Password -$config['email_activation'] = FALSE; // Email Activation for registration -$config['manual_activation'] = FALSE; // Manual Activation for registration -$config['remember_users'] = TRUE; // Allow users to be remembered and enable auto-login -$config['user_expire'] = 86500; // How long to remember the user (seconds). Set to zero for no expiration -$config['user_extend_on_login'] = FALSE; // Extend the users cookies every time they auto-login -$config['track_login_attempts'] = FALSE; // Track the number of failed login attempts for each user or ip. -$config['track_login_ip_address'] = TRUE; // Track login attempts by IP Address, if FALSE will track based on identity. (Default: TRUE) -$config['maximum_login_attempts'] = 3; // The maximum number of failed login attempts. -$config['lockout_time'] = 600; // The number of seconds to lockout an account due to exceeded attempts -$config['forgot_password_expiration'] = 0; // The number of milliseconds after which a forgot password request will expire. If set to 0, forgot password requests will not expire. - -/* - | ------------------------------------------------------------------------- - | Cookie options. - | ------------------------------------------------------------------------- - | remember_cookie_name Default: remember_code - | identity_cookie_name Default: identity - */ -$config['remember_cookie_name'] = 'remember_code'; -$config['identity_cookie_name'] = 'identity'; - -/* - | ------------------------------------------------------------------------- - | Email options. - | ------------------------------------------------------------------------- - | email_config: - | 'file' = Use the default CI config or use from a config file - | array = Manually set your email config settings - */ -$config['use_ci_email'] = FALSE; // Send Email using the builtin CI email class, if false it will return the code and the identity -$config['email_config'] = array( - 'mailtype' => 'html', -); - -/* - | ------------------------------------------------------------------------- - | Email templates. - | ------------------------------------------------------------------------- - | Folder where email templates are stored. - | Default: auth/ - */ -$config['email_templates'] = 'auth/email/'; - -/* - | ------------------------------------------------------------------------- - | Activate Account Email Template - | ------------------------------------------------------------------------- - | Default: activate.tpl.php - */ -$config['email_activate'] = 'activate.tpl.php'; - -/* - | ------------------------------------------------------------------------- - | Forgot Password Email Template - | ------------------------------------------------------------------------- - | Default: forgot_password.tpl.php - */ -$config['email_forgot_password'] = 'forgot_password.tpl.php'; - -/* - | ------------------------------------------------------------------------- - | Forgot Password Complete Email Template - | ------------------------------------------------------------------------- - | Default: new_password.tpl.php - */ -$config['email_forgot_password_complete'] = 'new_password.tpl.php'; - -/* - | ------------------------------------------------------------------------- - | Salt options - | ------------------------------------------------------------------------- - | salt_length Default: 22 - | - | store_salt: Should the salt be stored in the database? - | This will change your password encryption algorithm, - | default password, 'password', changes to - | fbaa5e216d163a02ae630ab1a43372635dd374c0 with default salt. - */ -$config['salt_length'] = 22; -$config['store_salt'] = FALSE; - -/* - | ------------------------------------------------------------------------- - | Message Delimiters. - | ------------------------------------------------------------------------- - */ -$config['delimiters_source'] = 'config'; // "config" = use the settings defined here, "form_validation" = use the settings defined in CI's form validation library -$config['message_start_delimiter'] = '

'; // Message start delimiter -$config['message_end_delimiter'] = '

'; // Message end delimiter -$config['error_start_delimiter'] = '

'; // Error mesage start delimiter -$config['error_end_delimiter'] = '

'; // Error mesage end delimiter - -/* End of file ion_auth.php */ -/* Location: ./application/config/ion_auth.php */ +ion_auth->is_max_login_attempts_exceeded(). + | The controller should check this function and act + | appropriately. If this variable set to 0, there is no maximum. + */ +$config['site_title'] = "Example.com"; // Site Title, example.com +$config['admin_email'] = "admin@example.com"; // Admin Email, admin@example.com +$config['default_group'] = 'members'; // Default group, use name +$config['admin_group'] = 'admin'; // Default administrators group, use name +$config['identity'] = 'email'; // A database column which is used to login with +$config['min_password_length'] = 6; // Minimum Required Length of Password +$config['max_password_length'] = 20; // Maximum Allowed Length of Password +$config['email_activation'] = FALSE; // Email Activation for registration +$config['manual_activation'] = FALSE; // Manual Activation for registration +$config['remember_users'] = TRUE; // Allow users to be remembered and enable auto-login +$config['user_expire'] = 86500; // How long to remember the user (seconds). Set to zero for no expiration +$config['user_extend_on_login'] = FALSE; // Extend the users cookies every time they auto-login +$config['track_login_attempts'] = FALSE; // Track the number of failed login attempts for each user or ip. +$config['track_login_ip_address'] = TRUE; // Track login attempts by IP Address, if FALSE will track based on identity. (Default: TRUE) +$config['maximum_login_attempts'] = 3; // The maximum number of failed login attempts. +$config['lockout_time'] = 600; // The number of seconds to lockout an account due to exceeded attempts +$config['forgot_password_expiration'] = 0; // The number of milliseconds after which a forgot password request will expire. If set to 0, forgot password requests will not expire. + +/* + | ------------------------------------------------------------------------- + | Cookie options. + | ------------------------------------------------------------------------- + | remember_cookie_name Default: remember_code + | identity_cookie_name Default: identity + */ +$config['remember_cookie_name'] = 'remember_code'; +$config['identity_cookie_name'] = 'identity'; + +/* + | ------------------------------------------------------------------------- + | Email options. + | ------------------------------------------------------------------------- + | email_config: + | 'file' = Use the default CI config or use from a config file + | array = Manually set your email config settings + */ +$config['use_ci_email'] = FALSE; // Send Email using the builtin CI email class, if false it will return the code and the identity +$config['email_config'] = array( + 'mailtype' => 'html', +); + +/* + | ------------------------------------------------------------------------- + | Email templates. + | ------------------------------------------------------------------------- + | Folder where email templates are stored. + | Default: auth/ + */ +$config['email_templates'] = 'auth/email/'; + +/* + | ------------------------------------------------------------------------- + | Activate Account Email Template + | ------------------------------------------------------------------------- + | Default: activate.tpl.php + */ +$config['email_activate'] = 'activate.tpl.php'; + +/* + | ------------------------------------------------------------------------- + | Forgot Password Email Template + | ------------------------------------------------------------------------- + | Default: forgot_password.tpl.php + */ +$config['email_forgot_password'] = 'forgot_password.tpl.php'; + +/* + | ------------------------------------------------------------------------- + | Forgot Password Complete Email Template + | ------------------------------------------------------------------------- + | Default: new_password.tpl.php + */ +$config['email_forgot_password_complete'] = 'new_password.tpl.php'; + +/* + | ------------------------------------------------------------------------- + | Salt options + | ------------------------------------------------------------------------- + | salt_length Default: 22 + | + | store_salt: Should the salt be stored in the database? + | This will change your password encryption algorithm, + | default password, 'password', changes to + | fbaa5e216d163a02ae630ab1a43372635dd374c0 with default salt. + */ +$config['salt_length'] = 22; +$config['store_salt'] = FALSE; + +/* + | ------------------------------------------------------------------------- + | Message Delimiters. + | ------------------------------------------------------------------------- + */ +$config['delimiters_source'] = 'config'; // "config" = use the settings defined here, "form_validation" = use the settings defined in CI's form validation library +$config['message_start_delimiter'] = '

'; // Message start delimiter +$config['message_end_delimiter'] = '

'; // Message end delimiter +$config['error_start_delimiter'] = '

'; // Error mesage start delimiter +$config['error_end_delimiter'] = '

'; // Error mesage end delimiter + +/* End of file ion_auth.php */ +/* Location: ./application/config/ion_auth.php */ diff --git a/application/config/migration.php b/application/config/migration.php index afa2645..11446d1 100755 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -1,41 +1,41 @@ -migration->latest() this is the version that schema will -| be upgraded / downgraded to. -| -*/ -$config['migration_version'] = 0; - - -/* -|-------------------------------------------------------------------------- -| Migrations Path -|-------------------------------------------------------------------------- -| -| Path to your migrations folder. -| Typically, it will be within your application path. -| Also, writing permission is required within the migrations path. -| -*/ -$config['migration_path'] = APPPATH . 'migrations/'; - - -/* End of file migration.php */ +migration->latest() this is the version that schema will +| be upgraded / downgraded to. +| +*/ +$config['migration_version'] = 0; + + +/* +|-------------------------------------------------------------------------- +| Migrations Path +|-------------------------------------------------------------------------- +| +| Path to your migrations folder. +| Typically, it will be within your application path. +| Also, writing permission is required within the migrations path. +| +*/ +$config['migration_path'] = APPPATH . 'migrations/'; + + +/* End of file migration.php */ /* Location: ./application/config/migration.php */ \ No newline at end of file diff --git a/application/config/mimes.php b/application/config/mimes.php index c8b9a74..318ecfe 100755 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -1,106 +1,106 @@ - 'application/mac-binhex40', - 'cpt' => 'application/mac-compactpro', - 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), - 'bin' => 'application/macbinary', - 'dms' => 'application/octet-stream', - 'lha' => 'application/octet-stream', - 'lzh' => 'application/octet-stream', - 'exe' => array('application/octet-stream', 'application/x-msdownload'), - 'class' => 'application/octet-stream', - 'psd' => 'application/x-photoshop', - 'so' => 'application/octet-stream', - 'sea' => 'application/octet-stream', - 'dll' => 'application/octet-stream', - 'oda' => 'application/oda', - 'pdf' => array('application/pdf', 'application/x-download'), - 'ai' => 'application/postscript', - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'mif' => 'application/vnd.mif', - 'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'), - 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), - 'wbxml' => 'application/wbxml', - 'wmlc' => 'application/wmlc', - 'dcr' => 'application/x-director', - 'dir' => 'application/x-director', - 'dxr' => 'application/x-director', - 'dvi' => 'application/x-dvi', - 'gtar' => 'application/x-gtar', - 'gz' => 'application/x-gzip', - 'php' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'php3' => 'application/x-httpd-php', - 'phtml' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'js' => 'application/x-javascript', - 'swf' => 'application/x-shockwave-flash', - 'sit' => 'application/x-stuffit', - 'tar' => 'application/x-tar', - 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'), - 'xhtml' => 'application/xhtml+xml', - 'xht' => 'application/xhtml+xml', - 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mpga' => 'audio/mpeg', - 'mp2' => 'audio/mpeg', - 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'), - 'aif' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'ram' => 'audio/x-pn-realaudio', - 'rm' => 'audio/x-pn-realaudio', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'ra' => 'audio/x-realaudio', - 'rv' => 'video/vnd.rn-realvideo', - 'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'), - 'bmp' => array('image/bmp', 'image/x-windows-bmp'), - 'gif' => 'image/gif', - 'jpeg' => array('image/jpeg', 'image/pjpeg'), - 'jpg' => array('image/jpeg', 'image/pjpeg'), - 'jpe' => array('image/jpeg', 'image/pjpeg'), - 'png' => array('image/png', 'image/x-png'), - 'tiff' => 'image/tiff', - 'tif' => 'image/tiff', - 'css' => 'text/css', - 'html' => 'text/html', - 'htm' => 'text/html', - 'shtml' => 'text/html', - 'txt' => 'text/plain', - 'text' => 'text/plain', - 'log' => array('text/plain', 'text/x-log'), - 'rtx' => 'text/richtext', - 'rtf' => 'text/rtf', - 'xml' => 'text/xml', - 'xsl' => 'text/xml', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'qt' => 'video/quicktime', - 'mov' => 'video/quicktime', - 'avi' => 'video/x-msvideo', - 'movie' => 'video/x-sgi-movie', - 'doc' => 'application/msword', - 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'), - 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'), - 'word' => array('application/msword', 'application/octet-stream'), - 'xl' => 'application/excel', - 'eml' => 'message/rfc822', - 'json' => array('application/json', 'text/json') - ); - - -/* End of file mimes.php */ -/* Location: ./application/config/mimes.php */ + 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), + 'bin' => 'application/macbinary', + 'dms' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'exe' => array('application/octet-stream', 'application/x-msdownload'), + 'class' => 'application/octet-stream', + 'psd' => 'application/x-photoshop', + 'so' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => array('application/pdf', 'application/x-download'), + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'), + 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), + 'wbxml' => 'application/wbxml', + 'wmlc' => 'application/wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'gz' => 'application/x-gzip', + 'php' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'js' => 'application/x-javascript', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'), + 'xhtml' => 'application/xhtml+xml', + 'xht' => 'application/xhtml+xml', + 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mpga' => 'audio/mpeg', + 'mp2' => 'audio/mpeg', + 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'), + 'aif' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'rv' => 'video/vnd.rn-realvideo', + 'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'), + 'bmp' => array('image/bmp', 'image/x-windows-bmp'), + 'gif' => 'image/gif', + 'jpeg' => array('image/jpeg', 'image/pjpeg'), + 'jpg' => array('image/jpeg', 'image/pjpeg'), + 'jpe' => array('image/jpeg', 'image/pjpeg'), + 'png' => array('image/png', 'image/x-png'), + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'txt' => 'text/plain', + 'text' => 'text/plain', + 'log' => array('text/plain', 'text/x-log'), + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie', + 'doc' => 'application/msword', + 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'), + 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'), + 'word' => array('application/msword', 'application/octet-stream'), + 'xl' => 'application/excel', + 'eml' => 'message/rfc822', + 'json' => array('application/json', 'text/json') + ); + + +/* End of file mimes.php */ +/* Location: ./application/config/mimes.php */ diff --git a/application/config/profiler.php b/application/config/profiler.php index 9c7a835..271377e 100755 --- a/application/config/profiler.php +++ b/application/config/profiler.php @@ -1,17 +1,17 @@ - array('grin.gif', '19', '19', 'grin'), - ':lol:' => array('lol.gif', '19', '19', 'LOL'), - ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), - ':)' => array('smile.gif', '19', '19', 'smile'), - ';-)' => array('wink.gif', '19', '19', 'wink'), - ';)' => array('wink.gif', '19', '19', 'wink'), - ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), - ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), - ':-S' => array('confused.gif', '19', '19', 'confused'), - ':wow:' => array('surprise.gif', '19', '19', 'surprised'), - ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), - ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), - '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), - ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), - ':P' => array('raspberry.gif', '19', '19', 'raspberry'), - ':blank:' => array('blank.gif', '19', '19', 'blank stare'), - ':long:' => array('longface.gif', '19', '19', 'long face'), - ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), - ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), - ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), - '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), - ':down:' => array('downer.gif', '19', '19', 'downer'), - ':red:' => array('embarrassed.gif', '19', '19', 'red face'), - ':sick:' => array('sick.gif', '19', '19', 'sick'), - ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), - ':-/' => array('hmm.gif', '19', '19', 'hmmm'), - '>:(' => array('mad.gif', '19', '19', 'mad'), - ':mad:' => array('mad.gif', '19', '19', 'mad'), - '>:-(' => array('angry.gif', '19', '19', 'angry'), - ':angry:' => array('angry.gif', '19', '19', 'angry'), - ':zip:' => array('zip.gif', '19', '19', 'zipper'), - ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), - ':ahhh:' => array('shock.gif', '19', '19', 'shock'), - ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), - ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), - ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), - ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), - ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), - ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), - ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), - ':snake:' => array('snake.gif', '19', '19', 'snake'), - ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), - ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item - - ); - -/* End of file smileys.php */ + array('grin.gif', '19', '19', 'grin'), + ':lol:' => array('lol.gif', '19', '19', 'LOL'), + ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), + ':)' => array('smile.gif', '19', '19', 'smile'), + ';-)' => array('wink.gif', '19', '19', 'wink'), + ';)' => array('wink.gif', '19', '19', 'wink'), + ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), + ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), + ':-S' => array('confused.gif', '19', '19', 'confused'), + ':wow:' => array('surprise.gif', '19', '19', 'surprised'), + ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), + ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), + '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), + ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), + ':P' => array('raspberry.gif', '19', '19', 'raspberry'), + ':blank:' => array('blank.gif', '19', '19', 'blank stare'), + ':long:' => array('longface.gif', '19', '19', 'long face'), + ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), + ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), + ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), + '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), + ':down:' => array('downer.gif', '19', '19', 'downer'), + ':red:' => array('embarrassed.gif', '19', '19', 'red face'), + ':sick:' => array('sick.gif', '19', '19', 'sick'), + ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), + ':-/' => array('hmm.gif', '19', '19', 'hmmm'), + '>:(' => array('mad.gif', '19', '19', 'mad'), + ':mad:' => array('mad.gif', '19', '19', 'mad'), + '>:-(' => array('angry.gif', '19', '19', 'angry'), + ':angry:' => array('angry.gif', '19', '19', 'angry'), + ':zip:' => array('zip.gif', '19', '19', 'zipper'), + ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), + ':ahhh:' => array('shock.gif', '19', '19', 'shock'), + ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), + ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), + ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), + ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), + ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), + ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), + ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), + ':snake:' => array('snake.gif', '19', '19', 'snake'), + ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), + ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item + + ); + +/* End of file smileys.php */ /* Location: ./application/config/smileys.php */ \ No newline at end of file diff --git a/application/config/user_agents.php b/application/config/user_agents.php index 4f9cb7e..6ba5355 100755 --- a/application/config/user_agents.php +++ b/application/config/user_agents.php @@ -1,178 +1,178 @@ - 'Windows Longhorn', - 'windows nt 5.2' => 'Windows 2003', - 'windows nt 5.0' => 'Windows 2000', - 'windows nt 5.1' => 'Windows XP', - 'windows nt 4.0' => 'Windows NT 4.0', - 'winnt4.0' => 'Windows NT 4.0', - 'winnt 4.0' => 'Windows NT', - 'winnt' => 'Windows NT', - 'windows 98' => 'Windows 98', - 'win98' => 'Windows 98', - 'windows 95' => 'Windows 95', - 'win95' => 'Windows 95', - 'windows' => 'Unknown Windows OS', - 'os x' => 'Mac OS X', - 'ppc mac' => 'Power PC Mac', - 'freebsd' => 'FreeBSD', - 'ppc' => 'Macintosh', - 'linux' => 'Linux', - 'debian' => 'Debian', - 'sunos' => 'Sun Solaris', - 'beos' => 'BeOS', - 'apachebench' => 'ApacheBench', - 'aix' => 'AIX', - 'irix' => 'Irix', - 'osf' => 'DEC OSF', - 'hp-ux' => 'HP-UX', - 'netbsd' => 'NetBSD', - 'bsdi' => 'BSDi', - 'openbsd' => 'OpenBSD', - 'gnu' => 'GNU/Linux', - 'unix' => 'Unknown Unix OS' - ); - - -// The order of this array should NOT be changed. Many browsers return -// multiple browser types so we want to identify the sub-type first. -$browsers = array( - 'Flock' => 'Flock', - 'Chrome' => 'Chrome', - 'Opera' => 'Opera', - 'MSIE' => 'Internet Explorer', - 'Internet Explorer' => 'Internet Explorer', - 'Shiira' => 'Shiira', - 'Firefox' => 'Firefox', - 'Chimera' => 'Chimera', - 'Phoenix' => 'Phoenix', - 'Firebird' => 'Firebird', - 'Camino' => 'Camino', - 'Netscape' => 'Netscape', - 'OmniWeb' => 'OmniWeb', - 'Safari' => 'Safari', - 'Mozilla' => 'Mozilla', - 'Konqueror' => 'Konqueror', - 'icab' => 'iCab', - 'Lynx' => 'Lynx', - 'Links' => 'Links', - 'hotjava' => 'HotJava', - 'amaya' => 'Amaya', - 'IBrowse' => 'IBrowse' - ); - -$mobiles = array( - // legacy array, old values commented out - 'mobileexplorer' => 'Mobile Explorer', -// 'openwave' => 'Open Wave', -// 'opera mini' => 'Opera Mini', -// 'operamini' => 'Opera Mini', -// 'elaine' => 'Palm', - 'palmsource' => 'Palm', -// 'digital paths' => 'Palm', -// 'avantgo' => 'Avantgo', -// 'xiino' => 'Xiino', - 'palmscape' => 'Palmscape', -// 'nokia' => 'Nokia', -// 'ericsson' => 'Ericsson', -// 'blackberry' => 'BlackBerry', -// 'motorola' => 'Motorola' - - // Phones and Manufacturers - 'motorola' => "Motorola", - 'nokia' => "Nokia", - 'palm' => "Palm", - 'iphone' => "Apple iPhone", - 'ipad' => "iPad", - 'ipod' => "Apple iPod Touch", - 'sony' => "Sony Ericsson", - 'ericsson' => "Sony Ericsson", - 'blackberry' => "BlackBerry", - 'cocoon' => "O2 Cocoon", - 'blazer' => "Treo", - 'lg' => "LG", - 'amoi' => "Amoi", - 'xda' => "XDA", - 'mda' => "MDA", - 'vario' => "Vario", - 'htc' => "HTC", - 'samsung' => "Samsung", - 'sharp' => "Sharp", - 'sie-' => "Siemens", - 'alcatel' => "Alcatel", - 'benq' => "BenQ", - 'ipaq' => "HP iPaq", - 'mot-' => "Motorola", - 'playstation portable' => "PlayStation Portable", - 'hiptop' => "Danger Hiptop", - 'nec-' => "NEC", - 'panasonic' => "Panasonic", - 'philips' => "Philips", - 'sagem' => "Sagem", - 'sanyo' => "Sanyo", - 'spv' => "SPV", - 'zte' => "ZTE", - 'sendo' => "Sendo", - - // Operating Systems - 'symbian' => "Symbian", - 'SymbianOS' => "SymbianOS", - 'elaine' => "Palm", - 'palm' => "Palm", - 'series60' => "Symbian S60", - 'windows ce' => "Windows CE", - - // Browsers - 'obigo' => "Obigo", - 'netfront' => "Netfront Browser", - 'openwave' => "Openwave Browser", - 'mobilexplorer' => "Mobile Explorer", - 'operamini' => "Opera Mini", - 'opera mini' => "Opera Mini", - - // Other - 'digital paths' => "Digital Paths", - 'avantgo' => "AvantGo", - 'xiino' => "Xiino", - 'novarra' => "Novarra Transcoder", - 'vodafone' => "Vodafone", - 'docomo' => "NTT DoCoMo", - 'o2' => "O2", - - // Fallback - 'mobile' => "Generic Mobile", - 'wireless' => "Generic Mobile", - 'j2me' => "Generic Mobile", - 'midp' => "Generic Mobile", - 'cldc' => "Generic Mobile", - 'up.link' => "Generic Mobile", - 'up.browser' => "Generic Mobile", - 'smartphone' => "Generic Mobile", - 'cellphone' => "Generic Mobile" - ); - -// There are hundreds of bots but these are the most common. -$robots = array( - 'googlebot' => 'Googlebot', - 'msnbot' => 'MSNBot', - 'slurp' => 'Inktomi Slurp', - 'yahoo' => 'Yahoo', - 'askjeeves' => 'AskJeeves', - 'fastcrawler' => 'FastCrawler', - 'infoseek' => 'InfoSeek Robot 1.0', - 'lycos' => 'Lycos' - ); - -/* End of file user_agents.php */ + 'Windows Longhorn', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 5.1' => 'Windows XP', + 'windows nt 4.0' => 'Windows NT 4.0', + 'winnt4.0' => 'Windows NT 4.0', + 'winnt 4.0' => 'Windows NT', + 'winnt' => 'Windows NT', + 'windows 98' => 'Windows 98', + 'win98' => 'Windows 98', + 'windows 95' => 'Windows 95', + 'win95' => 'Windows 95', + 'windows' => 'Unknown Windows OS', + 'os x' => 'Mac OS X', + 'ppc mac' => 'Power PC Mac', + 'freebsd' => 'FreeBSD', + 'ppc' => 'Macintosh', + 'linux' => 'Linux', + 'debian' => 'Debian', + 'sunos' => 'Sun Solaris', + 'beos' => 'BeOS', + 'apachebench' => 'ApacheBench', + 'aix' => 'AIX', + 'irix' => 'Irix', + 'osf' => 'DEC OSF', + 'hp-ux' => 'HP-UX', + 'netbsd' => 'NetBSD', + 'bsdi' => 'BSDi', + 'openbsd' => 'OpenBSD', + 'gnu' => 'GNU/Linux', + 'unix' => 'Unknown Unix OS' + ); + + +// The order of this array should NOT be changed. Many browsers return +// multiple browser types so we want to identify the sub-type first. +$browsers = array( + 'Flock' => 'Flock', + 'Chrome' => 'Chrome', + 'Opera' => 'Opera', + 'MSIE' => 'Internet Explorer', + 'Internet Explorer' => 'Internet Explorer', + 'Shiira' => 'Shiira', + 'Firefox' => 'Firefox', + 'Chimera' => 'Chimera', + 'Phoenix' => 'Phoenix', + 'Firebird' => 'Firebird', + 'Camino' => 'Camino', + 'Netscape' => 'Netscape', + 'OmniWeb' => 'OmniWeb', + 'Safari' => 'Safari', + 'Mozilla' => 'Mozilla', + 'Konqueror' => 'Konqueror', + 'icab' => 'iCab', + 'Lynx' => 'Lynx', + 'Links' => 'Links', + 'hotjava' => 'HotJava', + 'amaya' => 'Amaya', + 'IBrowse' => 'IBrowse' + ); + +$mobiles = array( + // legacy array, old values commented out + 'mobileexplorer' => 'Mobile Explorer', +// 'openwave' => 'Open Wave', +// 'opera mini' => 'Opera Mini', +// 'operamini' => 'Opera Mini', +// 'elaine' => 'Palm', + 'palmsource' => 'Palm', +// 'digital paths' => 'Palm', +// 'avantgo' => 'Avantgo', +// 'xiino' => 'Xiino', + 'palmscape' => 'Palmscape', +// 'nokia' => 'Nokia', +// 'ericsson' => 'Ericsson', +// 'blackberry' => 'BlackBerry', +// 'motorola' => 'Motorola' + + // Phones and Manufacturers + 'motorola' => "Motorola", + 'nokia' => "Nokia", + 'palm' => "Palm", + 'iphone' => "Apple iPhone", + 'ipad' => "iPad", + 'ipod' => "Apple iPod Touch", + 'sony' => "Sony Ericsson", + 'ericsson' => "Sony Ericsson", + 'blackberry' => "BlackBerry", + 'cocoon' => "O2 Cocoon", + 'blazer' => "Treo", + 'lg' => "LG", + 'amoi' => "Amoi", + 'xda' => "XDA", + 'mda' => "MDA", + 'vario' => "Vario", + 'htc' => "HTC", + 'samsung' => "Samsung", + 'sharp' => "Sharp", + 'sie-' => "Siemens", + 'alcatel' => "Alcatel", + 'benq' => "BenQ", + 'ipaq' => "HP iPaq", + 'mot-' => "Motorola", + 'playstation portable' => "PlayStation Portable", + 'hiptop' => "Danger Hiptop", + 'nec-' => "NEC", + 'panasonic' => "Panasonic", + 'philips' => "Philips", + 'sagem' => "Sagem", + 'sanyo' => "Sanyo", + 'spv' => "SPV", + 'zte' => "ZTE", + 'sendo' => "Sendo", + + // Operating Systems + 'symbian' => "Symbian", + 'SymbianOS' => "SymbianOS", + 'elaine' => "Palm", + 'palm' => "Palm", + 'series60' => "Symbian S60", + 'windows ce' => "Windows CE", + + // Browsers + 'obigo' => "Obigo", + 'netfront' => "Netfront Browser", + 'openwave' => "Openwave Browser", + 'mobilexplorer' => "Mobile Explorer", + 'operamini' => "Opera Mini", + 'opera mini' => "Opera Mini", + + // Other + 'digital paths' => "Digital Paths", + 'avantgo' => "AvantGo", + 'xiino' => "Xiino", + 'novarra' => "Novarra Transcoder", + 'vodafone' => "Vodafone", + 'docomo' => "NTT DoCoMo", + 'o2' => "O2", + + // Fallback + 'mobile' => "Generic Mobile", + 'wireless' => "Generic Mobile", + 'j2me' => "Generic Mobile", + 'midp' => "Generic Mobile", + 'cldc' => "Generic Mobile", + 'up.link' => "Generic Mobile", + 'up.browser' => "Generic Mobile", + 'smartphone' => "Generic Mobile", + 'cellphone' => "Generic Mobile" + ); + +// There are hundreds of bots but these are the most common. +$robots = array( + 'googlebot' => 'Googlebot', + 'msnbot' => 'MSNBot', + 'slurp' => 'Inktomi Slurp', + 'yahoo' => 'Yahoo', + 'askjeeves' => 'AskJeeves', + 'fastcrawler' => 'FastCrawler', + 'infoseek' => 'InfoSeek Robot 1.0', + 'lycos' => 'Lycos' + ); + +/* End of file user_agents.php */ /* Location: ./application/config/user_agents.php */ \ No newline at end of file diff --git a/application/controllers/admin.php b/application/controllers/admin.php index e306eeb..05b6788 100755 --- a/application/controllers/admin.php +++ b/application/controllers/admin.php @@ -1,183 +1,183 @@ -users(); - } - function users(){ - $crud = new grocery_CRUD(); - $crud->set_table('users'); - //$crud->set_relation('group','groups','name',array('id !=' => '1')); - $crud->columns('profile_photo','first_name','username','email'); - $crud->set_field_upload('profile_photo','assets/uploads/member'); - $crud->fields('first_name','last_name','username','email','phone','sex','prefer_opposite_sex','profile_photo'); -$crud->edit_fields('first_name','last_name','username','email','phone','sex','prefer_opposite_sex','profile_photo','ip_address'); - //$crud->callback_insert(array($this,'register_user')); - $crud->callback_after_insert(array($this, 'update_user_after_insert')); - - $crud->add_fields('first_name','last_name','username','email','phone','password','sex','prefer_opposite_sex','profile_photo'); - $crud->set_subject('users'); - $output = $crud->render(); - $this->_admin_output($output); - } - function setting(){ - $crud = new grocery_CRUD(); - $crud->set_table('setting'); - $crud->unset_texteditor('inject_html_code'); - $crud->unset_add(); - $crud->unset_delete(); - $crud->set_subject('site setting'); - $output = $crud->render(); - $this->_admin_output($output); - } -function update_user_after_insert($post_array,$primary_key) -{ - - -$city_data = $this->_city(); - - $additional_data['country'] = $city_data['country']; - $additional_data['state'] = $city_data['state']; - $additional_data['city'] = $city_data['city']; -$additional_data['password'] = $post_array['password']; -$additional_data['active'] = 1; - - $this->ion_auth->update($primary_key, $additional_data); - return true; -} - - function register_user($post_array) - { - $city_data = $this->_city(); - - $additional_data['first_name'] = $post_array['first_name']; - $additional_data['last_name'] = $post_array['last_name']; - $additional_data['phone'] = $post_array['phone']; - $additional_data['sex'] = $post_array['sex']; - $additional_data['prefer_opposite_sex'] = $post_array['prefer_opposite_sex']; - $additional_data['profile_photo'] = $post_array['profile_photo']; - $additional_data['country'] = $city_data['country']; - $additional_data['state'] = $city_data['state']; - $additional_data['city'] = $city_data['city']; - - $this->ion_auth->register($post_array['username'], $post_array['password'], $post_array['email'], $additional_data, $post_array['group']); - return true; - } - function _city(){ - $data = json_decode(file_get_contents("http://freegeoip.net/json/"),true); - $data['country'] = $data['country_name']; - $data['state'] = $data['region_name']; - $data['city'] = $data['city']; - return $data; - } - - function groups(){ - $crud = new grocery_CRUD(); - $crud->set_table('groups'); - $crud->set_subject('user groups'); - $output = $crud->render(); - $this->_admin_output($output); - } - function page(){ - $crud = new grocery_CRUD(); - $crud->set_table('page'); - $crud->set_subject('page'); - $output = $crud->render(); - - $this->_admin_output($output); - } - function video(){ - $crud = new grocery_CRUD(); - $crud->set_table('video'); - $crud->set_subject('video'); - $crud->set_relation('user_id','users','username'); - $crud->set_field_upload('video_file','assets/uploads/video'); - $crud->set_field_upload('video_img','assets/uploads/video'); - $crud->unset_texteditor('text'); - $output = $crud->render(); - - $this->_admin_output($output); - } - function photo(){ - $crud = new grocery_CRUD(); - $crud->set_table('photo'); - $crud->set_subject('photo'); - $crud->set_relation('user_id','users','username'); - $crud->set_field_upload('url','assets/uploads'); - $crud->unset_texteditor('text'); - $output = $crud->render(); - - $this->_admin_output($output); - } - function likes(){ - $crud = new grocery_CRUD(); - $crud->set_table('user_likes'); - $crud->set_subject('user likes'); - $crud->set_relation('user_id','users','username'); - $crud->set_relation('liked_user_id','users','username'); - $crud->unset_add(); - $crud->unset_edit(); - $output = $crud->render(); - $this->_admin_output($output); - } - function matches(){ - $crud = new grocery_CRUD(); - $crud->set_table('match'); - $crud->set_subject('matched user'); - $crud->set_relation('user_id','users','username'); - $crud->set_relation('matched_user_id','users','username'); - $crud->unset_add(); - $crud->unset_edit(); - $output = $crud->render(); - $this->_admin_output($output); - } - - function login() { - if ($this->ion_auth->logged_in() AND $this->ion_auth->is_admin()) { - redirect('admin/', 'refresh'); - } - $this->form_validation->set_rules('identity', 'Identity', 'required'); - $this->form_validation->set_rules('password', 'Password', 'required'); - - if ($this->form_validation->run() == true) { - $remember = (bool) $this->input->post('remember'); - if ($this->ion_auth->login($this->input->post('identity'), $this->input->post('password'), $remember)) { - $this->session->set_flashdata('message', $this->ion_auth->messages()); - redirect('admin/', 'refresh'); - } else { - $this->session->set_flashdata('message', $this->ion_auth->errors()); - redirect('admin/login', 'refresh'); - } - } else { - - $this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message'); - $this->data['identity'] = array('name' => 'identity', - 'id' => 'identity', - 'type' => 'text', - 'value' => $this->form_validation->set_value('identity'), - ); - $this->data['password'] = array('name' => 'password', - 'id' => 'password', - 'type' => 'password', - ); - - $this->load->view('auth_login', $this->data); - } - } - - function logout() { - $logout = $this->ion_auth->logout(); - $this->session->set_flashdata('message', $this->ion_auth->messages()); - redirect('admin/login', 'refresh'); - } - - public function _admin_output($output = null) { - - $this->load->view('view.php', $output); - } -} -?> +users(); + } + function users(){ + $crud = new grocery_CRUD(); + $crud->set_table('users'); + //$crud->set_relation('group','groups','name',array('id !=' => '1')); + $crud->columns('profile_photo','first_name','username','email'); + $crud->set_field_upload('profile_photo','assets/uploads/member'); + $crud->fields('first_name','last_name','username','email','phone','sex','prefer_opposite_sex','profile_photo'); +$crud->edit_fields('first_name','last_name','username','email','phone','sex','prefer_opposite_sex','profile_photo','ip_address'); + //$crud->callback_insert(array($this,'register_user')); + $crud->callback_after_insert(array($this, 'update_user_after_insert')); + + $crud->add_fields('first_name','last_name','username','email','phone','password','sex','prefer_opposite_sex','profile_photo'); + $crud->set_subject('users'); + $output = $crud->render(); + $this->_admin_output($output); + } + function setting(){ + $crud = new grocery_CRUD(); + $crud->set_table('setting'); + $crud->unset_texteditor('inject_html_code'); + $crud->unset_add(); + $crud->unset_delete(); + $crud->set_subject('site setting'); + $output = $crud->render(); + $this->_admin_output($output); + } +function update_user_after_insert($post_array,$primary_key) +{ + + +$city_data = $this->_city(); + + $additional_data['country'] = $city_data['country']; + $additional_data['state'] = $city_data['state']; + $additional_data['city'] = $city_data['city']; +$additional_data['password'] = $post_array['password']; +$additional_data['active'] = 1; + + $this->ion_auth->update($primary_key, $additional_data); + return true; +} + + function register_user($post_array) + { + $city_data = $this->_city(); + + $additional_data['first_name'] = $post_array['first_name']; + $additional_data['last_name'] = $post_array['last_name']; + $additional_data['phone'] = $post_array['phone']; + $additional_data['sex'] = $post_array['sex']; + $additional_data['prefer_opposite_sex'] = $post_array['prefer_opposite_sex']; + $additional_data['profile_photo'] = $post_array['profile_photo']; + $additional_data['country'] = $city_data['country']; + $additional_data['state'] = $city_data['state']; + $additional_data['city'] = $city_data['city']; + + $this->ion_auth->register($post_array['username'], $post_array['password'], $post_array['email'], $additional_data, $post_array['group']); + return true; + } + function _city(){ + $data = json_decode(file_get_contents("http://freegeoip.net/json/"),true); + $data['country'] = $data['country_name']; + $data['state'] = $data['region_name']; + $data['city'] = $data['city']; + return $data; + } + + function groups(){ + $crud = new grocery_CRUD(); + $crud->set_table('groups'); + $crud->set_subject('user groups'); + $output = $crud->render(); + $this->_admin_output($output); + } + function page(){ + $crud = new grocery_CRUD(); + $crud->set_table('page'); + $crud->set_subject('page'); + $output = $crud->render(); + + $this->_admin_output($output); + } + function video(){ + $crud = new grocery_CRUD(); + $crud->set_table('video'); + $crud->set_subject('video'); + $crud->set_relation('user_id','users','username'); + $crud->set_field_upload('video_file','assets/uploads/video'); + $crud->set_field_upload('video_img','assets/uploads/video'); + $crud->unset_texteditor('text'); + $output = $crud->render(); + + $this->_admin_output($output); + } + function photo(){ + $crud = new grocery_CRUD(); + $crud->set_table('photo'); + $crud->set_subject('photo'); + $crud->set_relation('user_id','users','username'); + $crud->set_field_upload('url','assets/uploads'); + $crud->unset_texteditor('text'); + $output = $crud->render(); + + $this->_admin_output($output); + } + function likes(){ + $crud = new grocery_CRUD(); + $crud->set_table('user_likes'); + $crud->set_subject('user likes'); + $crud->set_relation('user_id','users','username'); + $crud->set_relation('liked_user_id','users','username'); + $crud->unset_add(); + $crud->unset_edit(); + $output = $crud->render(); + $this->_admin_output($output); + } + function matches(){ + $crud = new grocery_CRUD(); + $crud->set_table('match'); + $crud->set_subject('matched user'); + $crud->set_relation('user_id','users','username'); + $crud->set_relation('matched_user_id','users','username'); + $crud->unset_add(); + $crud->unset_edit(); + $output = $crud->render(); + $this->_admin_output($output); + } + + function login() { + if ($this->ion_auth->logged_in() AND $this->ion_auth->is_admin()) { + redirect('admin/', 'refresh'); + } + $this->form_validation->set_rules('identity', 'Identity', 'required'); + $this->form_validation->set_rules('password', 'Password', 'required'); + + if ($this->form_validation->run() == true) { + $remember = (bool) $this->input->post('remember'); + if ($this->ion_auth->login($this->input->post('identity'), $this->input->post('password'), $remember)) { + $this->session->set_flashdata('message', $this->ion_auth->messages()); + redirect('admin/', 'refresh'); + } else { + $this->session->set_flashdata('message', $this->ion_auth->errors()); + redirect('admin/login', 'refresh'); + } + } else { + + $this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message'); + $this->data['identity'] = array('name' => 'identity', + 'id' => 'identity', + 'type' => 'text', + 'value' => $this->form_validation->set_value('identity'), + ); + $this->data['password'] = array('name' => 'password', + 'id' => 'password', + 'type' => 'password', + ); + + $this->load->view('auth_login', $this->data); + } + } + + function logout() { + $logout = $this->ion_auth->logout(); + $this->session->set_flashdata('message', $this->ion_auth->messages()); + redirect('admin/login', 'refresh'); + } + + public function _admin_output($output = null) { + + $this->load->view('view.php', $output); + } +} +?> diff --git a/application/controllers/cron.php b/application/controllers/cron.php index 38a9b7f..d5456de 100755 --- a/application/controllers/cron.php +++ b/application/controllers/cron.php @@ -1,42 +1,42 @@ -convertVideos(); - } - public function convertVideos(){ - - define('ffmpeg', '/usr/bin/ffmpeg'); - define('FFMPEG_BINARY', '/usr/bin/ffmpeg'); - define('FFMPEG_movie', '/usr/bin/ffmpeg_movie'); - define('flvtool2Path', '/usr/bin/flvtool2'); - - $videoDirName=FCPATH."assets/uploads/files/video/video/"; //Folder name where video will save - $videoThumDir=FCPATH."assets/uploads/files/video/thum/"; - - $this->db->select('id, video_file'); - $videos = $this->db->get_where('video',array('converted'=>1))->result(); - - foreach ($videos as $video) { - //$i++; - $fileNameNoExtension = preg_replace("/\.[^.]+$/", "", $video->video_file); - $video_path = FCPATH."assets/uploads/video/$video->video_file"; - - $randomString = $video->id."_".substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10); - - $destinationVideo = $videoDirName."{$randomString}.webm"; - $destinationThum = $videoThumDir."{$randomString}.jpg"; - shell_exec("ffmpeg -i $video_path -vcodec libvpx -acodec libvorbis $destinationVideo 2>&1"); - shell_exec("ffmpeg -i $destinationVideo -f mjpeg -t 0.050 $destinationThum 2>&1"); - $data["converted"] = 1; - $data["converted_name"] = $randomString; - $this->db->update('video', $data, "id = $video->id"); - } - - } -} - -/* End of file welcome.php */ -/* Location: ./application/controllers/welcome.php */ +convertVideos(); + } + public function convertVideos(){ + + define('ffmpeg', '/usr/bin/ffmpeg'); + define('FFMPEG_BINARY', '/usr/bin/ffmpeg'); + define('FFMPEG_movie', '/usr/bin/ffmpeg_movie'); + define('flvtool2Path', '/usr/bin/flvtool2'); + + $videoDirName=FCPATH."assets/uploads/files/video/video/"; //Folder name where video will save + $videoThumDir=FCPATH."assets/uploads/files/video/thum/"; + + $this->db->select('id, video_file'); + $videos = $this->db->get_where('video',array('converted'=>1))->result(); + + foreach ($videos as $video) { + //$i++; + $fileNameNoExtension = preg_replace("/\.[^.]+$/", "", $video->video_file); + $video_path = FCPATH."assets/uploads/video/$video->video_file"; + + $randomString = $video->id."_".substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10); + + $destinationVideo = $videoDirName."{$randomString}.webm"; + $destinationThum = $videoThumDir."{$randomString}.jpg"; + shell_exec("ffmpeg -i $video_path -vcodec libvpx -acodec libvorbis $destinationVideo 2>&1"); + shell_exec("ffmpeg -i $destinationVideo -f mjpeg -t 0.050 $destinationThum 2>&1"); + $data["converted"] = 1; + $data["converted_name"] = $randomString; + $this->db->update('video', $data, "id = $video->id"); + } + + } +} + +/* End of file welcome.php */ +/* Location: ./application/controllers/welcome.php */ diff --git a/application/controllers/examples.php b/application/controllers/examples.php index 60f4dbf..de3f641 100755 --- a/application/controllers/examples.php +++ b/application/controllers/examples.php @@ -2,248 +2,248 @@ class Examples extends CI_Controller { - public function __construct() - { - parent::__construct(); + public function __construct() + { + parent::__construct(); - $this->load->database(); - $this->load->helper('url'); + $this->load->database(); + $this->load->helper('url'); - $this->load->library('grocery_CRUD'); - } + $this->load->library('grocery_CRUD'); + } - public function _example_output($output = null) - { - $this->load->view('example.php',$output); - } + public function _example_output($output = null) + { + $this->load->view('example.php',$output); + } - public function offices() - { - $output = $this->grocery_crud->render(); + public function offices() + { + $output = $this->grocery_crud->render(); - $this->_example_output($output); - } + $this->_example_output($output); + } - public function index() - { - $this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array())); - } + public function index() + { + $this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array())); + } - public function offices_management() - { - try{ - $crud = new grocery_CRUD(); + public function offices_management() + { + try{ + $crud = new grocery_CRUD(); - $crud->set_theme('datatables'); - $crud->set_table('offices'); - $crud->set_subject('Office'); - $crud->required_fields('city'); - $crud->columns('city','country','phone','addressLine1','postalCode'); + $crud->set_theme('datatables'); + $crud->set_table('offices'); + $crud->set_subject('Office'); + $crud->required_fields('city'); + $crud->columns('city','country','phone','addressLine1','postalCode'); - $output = $crud->render(); + $output = $crud->render(); - $this->_example_output($output); + $this->_example_output($output); - }catch(Exception $e){ - show_error($e->getMessage().' --- '.$e->getTraceAsString()); - } - } + }catch(Exception $e){ + show_error($e->getMessage().' --- '.$e->getTraceAsString()); + } + } - public function employees_management() - { - $crud = new grocery_CRUD(); + public function employees_management() + { + $crud = new grocery_CRUD(); - $crud->set_theme('datatables'); - $crud->set_table('employees'); - $crud->set_relation('officeCode','offices','city'); - $crud->display_as('officeCode','Office City'); - $crud->set_subject('Employee'); + $crud->set_theme('datatables'); + $crud->set_table('employees'); + $crud->set_relation('officeCode','offices','city'); + $crud->display_as('officeCode','Office City'); + $crud->set_subject('Employee'); - $crud->required_fields('lastName'); + $crud->required_fields('lastName'); - $crud->set_field_upload('file_url','assets/uploads/files'); + $crud->set_field_upload('file_url','assets/uploads/files'); - $output = $crud->render(); + $output = $crud->render(); - $this->_example_output($output); - } + $this->_example_output($output); + } - public function customers_management() - { - $crud = new grocery_CRUD(); + public function customers_management() + { + $crud = new grocery_CRUD(); - $crud->set_table('customers'); - $crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit'); - $crud->display_as('salesRepEmployeeNumber','from Employeer') - ->display_as('customerName','Name') - ->display_as('contactLastName','Last Name'); - $crud->set_subject('Customer'); - $crud->set_relation('salesRepEmployeeNumber','employees','lastName'); + $crud->set_table('customers'); + $crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit'); + $crud->display_as('salesRepEmployeeNumber','from Employeer') + ->display_as('customerName','Name') + ->display_as('contactLastName','Last Name'); + $crud->set_subject('Customer'); + $crud->set_relation('salesRepEmployeeNumber','employees','lastName'); - $output = $crud->render(); + $output = $crud->render(); - $this->_example_output($output); - } + $this->_example_output($output); + } - public function orders_management() - { - $crud = new grocery_CRUD(); + public function orders_management() + { + $crud = new grocery_CRUD(); - $crud->set_relation('customerNumber','customers','{contactLastName} {contactFirstName}'); - $crud->display_as('customerNumber','Customer'); - $crud->set_table('orders'); - $crud->set_subject('Order'); - $crud->unset_add(); - $crud->unset_delete(); + $crud->set_relation('customerNumber','customers','{contactLastName} {contactFirstName}'); + $crud->display_as('customerNumber','Customer'); + $crud->set_table('orders'); + $crud->set_subject('Order'); + $crud->unset_add(); + $crud->unset_delete(); - $output = $crud->render(); + $output = $crud->render(); - $this->_example_output($output); - } + $this->_example_output($output); + } - public function products_management() - { - $crud = new grocery_CRUD(); + public function products_management() + { + $crud = new grocery_CRUD(); - $crud->set_table('products'); - $crud->set_subject('Product'); - $crud->unset_columns('productDescription'); - $crud->callback_column('buyPrice',array($this,'valueToEuro')); + $crud->set_table('products'); + $crud->set_subject('Product'); + $crud->unset_columns('productDescription'); + $crud->callback_column('buyPrice',array($this,'valueToEuro')); - $output = $crud->render(); + $output = $crud->render(); - $this->_example_output($output); - } + $this->_example_output($output); + } - public function valueToEuro($value, $row) - { - return $value.' €'; - } + public function valueToEuro($value, $row) + { + return $value.' €'; + } - public function film_management() - { - $crud = new grocery_CRUD(); + public function film_management() + { + $crud = new grocery_CRUD(); - $crud->set_table('film'); - $crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority'); - $crud->set_relation_n_n('category', 'film_category', 'category', 'film_id', 'category_id', 'name'); - $crud->unset_columns('special_features','description','actors'); + $crud->set_table('film'); + $crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority'); + $crud->set_relation_n_n('category', 'film_category', 'category', 'film_id', 'category_id', 'name'); + $crud->unset_columns('special_features','description','actors'); - $crud->fields('title', 'description', 'actors' , 'category' ,'release_year', 'rental_duration', 'rental_rate', 'length', 'replacement_cost', 'rating', 'special_features'); + $crud->fields('title', 'description', 'actors' , 'category' ,'release_year', 'rental_duration', 'rental_rate', 'length', 'replacement_cost', 'rating', 'special_features'); - $output = $crud->render(); + $output = $crud->render(); - $this->_example_output($output); - } + $this->_example_output($output); + } - public function film_management_twitter_bootstrap() - { - try{ - $crud = new grocery_CRUD(); + public function film_management_twitter_bootstrap() + { + try{ + $crud = new grocery_CRUD(); - $crud->set_theme('twitter-bootstrap'); - $crud->set_table('film'); - $crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority'); - $crud->set_relation_n_n('category', 'film_category', 'category', 'film_id', 'category_id', 'name'); - $crud->unset_columns('special_features','description','actors'); + $crud->set_theme('twitter-bootstrap'); + $crud->set_table('film'); + $crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority'); + $crud->set_relation_n_n('category', 'film_category', 'category', 'film_id', 'category_id', 'name'); + $crud->unset_columns('special_features','description','actors'); - $crud->fields('title', 'description', 'actors' , 'category' ,'release_year', 'rental_duration', 'rental_rate', 'length', 'replacement_cost', 'rating', 'special_features'); + $crud->fields('title', 'description', 'actors' , 'category' ,'release_year', 'rental_duration', 'rental_rate', 'length', 'replacement_cost', 'rating', 'special_features'); - $output = $crud->render(); - $this->_example_output($output); + $output = $crud->render(); + $this->_example_output($output); - }catch(Exception $e){ - show_error($e->getMessage().' --- '.$e->getTraceAsString()); - } - } + }catch(Exception $e){ + show_error($e->getMessage().' --- '.$e->getTraceAsString()); + } + } - function multigrids() - { - $this->config->load('grocery_crud'); - $this->config->set_item('grocery_crud_dialog_forms',true); - $this->config->set_item('grocery_crud_default_per_page',10); + function multigrids() + { + $this->config->load('grocery_crud'); + $this->config->set_item('grocery_crud_dialog_forms',true); + $this->config->set_item('grocery_crud_default_per_page',10); - $output1 = $this->offices_management2(); + $output1 = $this->offices_management2(); - $output2 = $this->employees_management2(); + $output2 = $this->employees_management2(); - $output3 = $this->customers_management2(); + $output3 = $this->customers_management2(); - $js_files = $output1->js_files + $output2->js_files + $output3->js_files; - $css_files = $output1->css_files + $output2->css_files + $output3->css_files; - $output = "

List 1

".$output1->output."

List 2

".$output2->output."

List 3

".$output3->output; + $js_files = $output1->js_files + $output2->js_files + $output3->js_files; + $css_files = $output1->css_files + $output2->css_files + $output3->css_files; + $output = "

List 1

".$output1->output."

List 2

".$output2->output."

List 3

".$output3->output; - $this->_example_output((object)array( - 'js_files' => $js_files, - 'css_files' => $css_files, - 'output' => $output - )); - } + $this->_example_output((object)array( + 'js_files' => $js_files, + 'css_files' => $css_files, + 'output' => $output + )); + } - public function offices_management2() - { - $crud = new grocery_CRUD(); - $crud->set_table('offices'); - $crud->set_subject('Office'); + public function offices_management2() + { + $crud = new grocery_CRUD(); + $crud->set_table('offices'); + $crud->set_subject('Office'); - $crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids"))); + $crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids"))); - $output = $crud->render(); + $output = $crud->render(); - if($crud->getState() != 'list') { - $this->_example_output($output); - } else { - return $output; - } - } + if($crud->getState() != 'list') { + $this->_example_output($output); + } else { + return $output; + } + } - public function employees_management2() - { - $crud = new grocery_CRUD(); + public function employees_management2() + { + $crud = new grocery_CRUD(); - $crud->set_theme('datatables'); - $crud->set_table('employees'); - $crud->set_relation('officeCode','offices','city'); - $crud->display_as('officeCode','Office City'); - $crud->set_subject('Employee'); + $crud->set_theme('datatables'); + $crud->set_table('employees'); + $crud->set_relation('officeCode','offices','city'); + $crud->display_as('officeCode','Office City'); + $crud->set_subject('Employee'); - $crud->required_fields('lastName'); + $crud->required_fields('lastName'); - $crud->set_field_upload('file_url','assets/uploads/files'); + $crud->set_field_upload('file_url','assets/uploads/files'); - $crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids"))); + $crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids"))); - $output = $crud->render(); + $output = $crud->render(); - if($crud->getState() != 'list') { - $this->_example_output($output); - } else { - return $output; - } - } + if($crud->getState() != 'list') { + $this->_example_output($output); + } else { + return $output; + } + } - public function customers_management2() - { + public function customers_management2() + { - $crud = new grocery_CRUD(); + $crud = new grocery_CRUD(); - $crud->set_table('customers'); - $crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit'); - $crud->display_as('salesRepEmployeeNumber','from Employeer') - ->display_as('customerName','Name') - ->display_as('contactLastName','Last Name'); - $crud->set_subject('Customer'); - $crud->set_relation('salesRepEmployeeNumber','employees','lastName'); + $crud->set_table('customers'); + $crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit'); + $crud->display_as('salesRepEmployeeNumber','from Employeer') + ->display_as('customerName','Name') + ->display_as('contactLastName','Last Name'); + $crud->set_subject('Customer'); + $crud->set_relation('salesRepEmployeeNumber','employees','lastName'); - $crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids"))); + $crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids"))); - $output = $crud->render(); + $output = $crud->render(); - if($crud->getState() != 'list') { - $this->_example_output($output); - } else { - return $output; - } - } + if($crud->getState() != 'list') { + $this->_example_output($output); + } else { + return $output; + } + } } \ No newline at end of file diff --git a/application/controllers/images_examples.php b/application/controllers/images_examples.php index dc81b9a..3b314dd 100755 --- a/application/controllers/images_examples.php +++ b/application/controllers/images_examples.php @@ -2,105 +2,105 @@ class Images_examples extends Website_Controller { - function __construct() - { - parent::__construct(); - - /* Standard Libraries */ - $this->load->database(); - /* ------------------ */ - - $this->load->helper('url'); //Just for the examples, this is not required thought for the library - - $this->load->library('image_CRUD'); - } - - function _example_output($output = null) - { - $this->load->view('example.php',$output); - } - - function index() - { - $this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array())); - } - - function example1() - { - $image_crud = new image_CRUD(); - - $image_crud->set_primary_key_field('id'); - $image_crud->set_url_field('url'); - $image_crud->set_table('example_1') - ->set_image_path('assets/uploads'); - - $output = $image_crud->render(); - - $this->_example_output($output); - } - - function example2() - { - $image_crud = new image_CRUD(); - - $image_crud->set_primary_key_field('id'); - $image_crud->set_url_field('url'); - $image_crud->set_table('example_2') - ->set_ordering_field('priority') - ->set_image_path('assets/uploads'); - - $output = $image_crud->render(); - - $this->_example_output($output); - } - - function example3() - { - $image_crud = new image_CRUD(); - - $image_crud->set_primary_key_field('id'); - $image_crud->set_url_field('url'); - $image_crud->set_table('example_3') - ->set_relation_field('category_id') - ->set_ordering_field('priority') - ->set_image_path('assets/uploads'); - - $output = $image_crud->render(); - - $this->_example_output($output); - } - - function example4() - { - $image_crud = new image_CRUD(); - - $image_crud->set_primary_key_field('id'); - $image_crud->set_url_field('url'); - $image_crud->set_title_field('title'); - $image_crud->set_table('example_4') - ->set_ordering_field('priority') - ->set_image_path('assets/uploads'); - - $output = $image_crud->render(); - - $this->_example_output($output); - } - - function simple_photo_gallery() - { - $image_crud = new image_CRUD(); - - $image_crud->unset_upload(); - $image_crud->unset_delete(); - - $image_crud->set_primary_key_field('id'); - $image_crud->set_url_field('url'); - $image_crud->set_table('example_4'); - $image_crud->set_title_field('title') - ->set_image_path('assets/uploads'); - - $output = $image_crud->render(); - - $this->_example_output($output); - } + function __construct() + { + parent::__construct(); + + /* Standard Libraries */ + $this->load->database(); + /* ------------------ */ + + $this->load->helper('url'); //Just for the examples, this is not required thought for the library + + $this->load->library('image_CRUD'); + } + + function _example_output($output = null) + { + $this->load->view('example.php',$output); + } + + function index() + { + $this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array())); + } + + function example1() + { + $image_crud = new image_CRUD(); + + $image_crud->set_primary_key_field('id'); + $image_crud->set_url_field('url'); + $image_crud->set_table('example_1') + ->set_image_path('assets/uploads'); + + $output = $image_crud->render(); + + $this->_example_output($output); + } + + function example2() + { + $image_crud = new image_CRUD(); + + $image_crud->set_primary_key_field('id'); + $image_crud->set_url_field('url'); + $image_crud->set_table('example_2') + ->set_ordering_field('priority') + ->set_image_path('assets/uploads'); + + $output = $image_crud->render(); + + $this->_example_output($output); + } + + function example3() + { + $image_crud = new image_CRUD(); + + $image_crud->set_primary_key_field('id'); + $image_crud->set_url_field('url'); + $image_crud->set_table('example_3') + ->set_relation_field('category_id') + ->set_ordering_field('priority') + ->set_image_path('assets/uploads'); + + $output = $image_crud->render(); + + $this->_example_output($output); + } + + function example4() + { + $image_crud = new image_CRUD(); + + $image_crud->set_primary_key_field('id'); + $image_crud->set_url_field('url'); + $image_crud->set_title_field('title'); + $image_crud->set_table('example_4') + ->set_ordering_field('priority') + ->set_image_path('assets/uploads'); + + $output = $image_crud->render(); + + $this->_example_output($output); + } + + function simple_photo_gallery() + { + $image_crud = new image_CRUD(); + + $image_crud->unset_upload(); + $image_crud->unset_delete(); + + $image_crud->set_primary_key_field('id'); + $image_crud->set_url_field('url'); + $image_crud->set_table('example_4'); + $image_crud->set_title_field('title') + ->set_image_path('assets/uploads'); + + $output = $image_crud->render(); + + $this->_example_output($output); + } } \ No newline at end of file diff --git a/application/controllers/index.html b/application/controllers/index.html index 065d2da..04e928c 100755 --- a/application/controllers/index.html +++ b/application/controllers/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/controllers/main.php b/application/controllers/main.php index 9919765..5487e72 100755 --- a/application/controllers/main.php +++ b/application/controllers/main.php @@ -1,25 +1,25 @@ -data['page_content'] = $this->db->get_where('page',array('page_url'=>$id))->row() ; - if(empty($this->data['page_content'])) - redirect('user/login'); - }else{ - redirect('user/login'); - } - $this->load->view('page',$this->data); - } - function switchLanguage($language = "") { - $language = ($language != "") ? $language : "english"; - $this->session->set_userdata('site_lang', $language); - redirect(base_url()); - } +data['page_content'] = $this->db->get_where('page',array('page_url'=>$id))->row() ; + if(empty($this->data['page_content'])) + redirect('user/login'); + }else{ + redirect('user/login'); + } + $this->load->view('page',$this->data); + } + function switchLanguage($language = "") { + $language = ($language != "") ? $language : "english"; + $this->session->set_userdata('site_lang', $language); + redirect(base_url()); + } } \ No newline at end of file diff --git a/application/controllers/smiles.php b/application/controllers/smiles.php index fafee80..4efa042 100755 --- a/application/controllers/smiles.php +++ b/application/controllers/smiles.php @@ -1,143 +1,143 @@ -emotions(); - } - public function emotions(){ - -/* space == separator */ - -$emoticons=array(); - -$emoticons[]='0:-) angel.gif'; -$emoticons[]=':) smile.gif'; -$emoticons[]=':( sad.gif'; -$emoticons[]=';) wink.gif'; -$emoticons[]=':P blum3.gif'; -$emoticons[]='8) dirol.gif'; -$emoticons[]='@= bomb.gif'; -$emoticons[]=':diablo: diablo.gif'; -$emoticons[]=':music: music2.gif'; -$emoticons[]='*KISSED* air_kiss.gif'; -$emoticons[]='*TIRED* boredom.gif'; -$emoticons[]='*STOP* stop.gif'; -$emoticons[]='*KISSING* kiss_3.gif'; -$emoticons[]='*GOOD* good.gif'; -$emoticons[]='*DRINK* drinks.gif'; -$emoticons[]='*IN_LOVE* man_in_love.gif'; -$emoticons[]=':WACKO: wacko.gif'; -$emoticons[]='*WASSUP* mamba.gif'; -$emoticons[]='*BRAVO* clapping.gif'; -$emoticons[]='*ROFL* rofl.gif'; -$emoticons[]='*PARDON* pardon.gif'; -$emoticons[]='*NO* nea.gif'; -$emoticons[]='*LOL* lol.gif'; -$emoticons[]='*CRAZY* crazy.gif'; -$emoticons[]='*DONT_KNOW* dntknw.gif'; -$emoticons[]='*SORRY* sorry2.gif'; -$emoticons[]='*YAHOO* yahoo.gif'; -$emoticons[]='*DANCE* dance4.gif'; -$emoticons[]='*db* pleasantry.gif'; -$emoticons[]='*HAPPY* i-m_so_happy.gif'; -$emoticons[]='*HELP* help.gif'; -$emoticons[]='/m/ new_russian.gif'; -$emoticons[]='*OK* ok.gif'; -$emoticons[]='*ACUTE* acute.gif'; -$emoticons[]='*BB* bb.gif'; -$emoticons[]='*BYE* bye.gif'; -$emoticons[]='*HI* hi.gif'; -$emoticons[]='*SCRATCH* scratch_one-s_head.gif'; -$emoticons[]='*YES!* yes2.gif'; -$emoticons[]='*SMOKE* smoke.gif'; -$emoticons[]='*BOSS* big_boss.gif'; -$emoticons[]='*SARCASTIC* sarcastic.gif'; -$emoticons[]='*BOAST* boast.gif'; -$emoticons[]='*HOHO* prankster2.gif'; -$emoticons[]='*SHOUT* shout.gif'; -$emoticons[]='*VAVA* black_eye.gif'; -$emoticons[]='*SEARCH* search.gif'; -$emoticons[]='*BEACH* beach.gif'; -$emoticons[]='*FOCUS* focus.gif'; -$emoticons[]='*HUNTER* hunter.gif'; -$emoticons[]='*GIRL_CRY* girl_cray2.gif'; -$emoticons[]='*GIRL_CRAZY* girl_crazy.gif'; -$emoticons[]='*HOSPITAL* girl_hospital.gif'; -$emoticons[]='*GIRL_IN_LOVE* girl_in_love.gif'; -$emoticons[]='*PINKGLASSES* girl_pinkglassesf.gif'; -$emoticons[]='*HYSTERIC* hysteric.gif'; -$emoticons[]='*TENDER* tender.gif'; -$emoticons[]='*SPRUSE_UP* spruce_up.gif'; -$emoticons[]='*FLIRT* flirt.gif'; -$emoticons[]='*GIVE_HEART* give_heart.gif'; -$emoticons[]='*CURTSEY* curtsey.gif'; -$emoticons[]='*GIRL_DRINK* girl_drink1.gif'; -$emoticons[]='*HAHA* girl_haha.gif'; -$emoticons[]='*IMPOSSIBLE* girl_impossible.gif'; -$emoticons[]='*SIGH* girl_sigh.gif'; -$emoticons[]='*MOIL* moil.gif'; -$emoticons[]='*YES* yes3.gif'; -$emoticons[]='*MEGA_SHOK* swoon2.gif'; -$emoticons[]='*THANK* thank_you.gif'; -$emoticons[]='*KING* king.gif'; -$emoticons[]='*LAZY* lazy.gif'; -$emoticons[]='*FRIEND* friends.gif'; -$emoticons[]='*PUNISH* punish.gif'; -$emoticons[]='*WIZARD* wizard.gif'; -$emoticons[]='*V* victory.gif'; -$emoticons[]='*SPITEFUL* spiteful.gif'; -$emoticons[]='*TEASE* tease.gif'; -$emoticons[]='*SCARE* scare.gif'; -$emoticons[]='*THIS* this.gif'; -$emoticons[]='*PAINT* paint2.gif'; -$emoticons[]='*TRAINING* training1.gif'; -$emoticons[]='*PARTY* party2.gif'; -$emoticons[]='*HELLO* preved.gif'; -$emoticons[]='*MAIL* mail1.gif'; -$emoticons[]='*WALL* dash1.gif'; -$emoticons[]='*VAMPIRE* vampire.gif'; -$emoticons[]='*GAMER* gamer4.gif'; -$emoticons[]='*POPCORN* popcorm1.gif'; -$emoticons[]='*IREFUL* ireful1.gif'; - -$aliases=array(); -$aliases[]=':-) smile.gif'; -$aliases[]=':-( sad.gif'; -$aliases[]=';-) wink.gif'; -$aliases[]=':p blum3.gif'; -$aliases[]=':-P blum3.gif'; -$aliases[]='8-) dirol.gif'; -$aliases[]=':-D biggrin.gif'; -$aliases[]=':-[ blush2.gif'; -$aliases[]='o_o shok.gif'; -$aliases[]=':-* kiss2.gif'; -$aliases[]=';-( cray2.gif'; -$aliases[]=':-X secret.gif'; -$aliases[]=':x secret.gif'; -$aliases[]=':-@ aggressive.gif'; -$aliases[]=':-| fool.gif'; -$aliases[]=':-/ beee.gif'; -$aliases[]='8P mosking.gif'; -$aliases[]=':-! bad.gif'; -$aliases[]='(F) give_rose.gif'; - -foreach ($emoticons AS $emotion){ - $s = explode(" ", $emotion); - $data["word"] = $s[0]; - $data["img"] = $s[1]; - $this->db->insert('emoticons', $data); -} -foreach ($aliases AS $emotion){ - $s = explode(" ", $emotion); - $data["word"] = $s[0]; - $data["img"] = $s[1]; - $this->db->insert('emoticons', $data); -} - - } -} - -/* End of file welcome.php */ -/* Location: ./application/controllers/welcome.php */ +emotions(); + } + public function emotions(){ + +/* space == separator */ + +$emoticons=array(); + +$emoticons[]='0:-) angel.gif'; +$emoticons[]=':) smile.gif'; +$emoticons[]=':( sad.gif'; +$emoticons[]=';) wink.gif'; +$emoticons[]=':P blum3.gif'; +$emoticons[]='8) dirol.gif'; +$emoticons[]='@= bomb.gif'; +$emoticons[]=':diablo: diablo.gif'; +$emoticons[]=':music: music2.gif'; +$emoticons[]='*KISSED* air_kiss.gif'; +$emoticons[]='*TIRED* boredom.gif'; +$emoticons[]='*STOP* stop.gif'; +$emoticons[]='*KISSING* kiss_3.gif'; +$emoticons[]='*GOOD* good.gif'; +$emoticons[]='*DRINK* drinks.gif'; +$emoticons[]='*IN_LOVE* man_in_love.gif'; +$emoticons[]=':WACKO: wacko.gif'; +$emoticons[]='*WASSUP* mamba.gif'; +$emoticons[]='*BRAVO* clapping.gif'; +$emoticons[]='*ROFL* rofl.gif'; +$emoticons[]='*PARDON* pardon.gif'; +$emoticons[]='*NO* nea.gif'; +$emoticons[]='*LOL* lol.gif'; +$emoticons[]='*CRAZY* crazy.gif'; +$emoticons[]='*DONT_KNOW* dntknw.gif'; +$emoticons[]='*SORRY* sorry2.gif'; +$emoticons[]='*YAHOO* yahoo.gif'; +$emoticons[]='*DANCE* dance4.gif'; +$emoticons[]='*db* pleasantry.gif'; +$emoticons[]='*HAPPY* i-m_so_happy.gif'; +$emoticons[]='*HELP* help.gif'; +$emoticons[]='/m/ new_russian.gif'; +$emoticons[]='*OK* ok.gif'; +$emoticons[]='*ACUTE* acute.gif'; +$emoticons[]='*BB* bb.gif'; +$emoticons[]='*BYE* bye.gif'; +$emoticons[]='*HI* hi.gif'; +$emoticons[]='*SCRATCH* scratch_one-s_head.gif'; +$emoticons[]='*YES!* yes2.gif'; +$emoticons[]='*SMOKE* smoke.gif'; +$emoticons[]='*BOSS* big_boss.gif'; +$emoticons[]='*SARCASTIC* sarcastic.gif'; +$emoticons[]='*BOAST* boast.gif'; +$emoticons[]='*HOHO* prankster2.gif'; +$emoticons[]='*SHOUT* shout.gif'; +$emoticons[]='*VAVA* black_eye.gif'; +$emoticons[]='*SEARCH* search.gif'; +$emoticons[]='*BEACH* beach.gif'; +$emoticons[]='*FOCUS* focus.gif'; +$emoticons[]='*HUNTER* hunter.gif'; +$emoticons[]='*GIRL_CRY* girl_cray2.gif'; +$emoticons[]='*GIRL_CRAZY* girl_crazy.gif'; +$emoticons[]='*HOSPITAL* girl_hospital.gif'; +$emoticons[]='*GIRL_IN_LOVE* girl_in_love.gif'; +$emoticons[]='*PINKGLASSES* girl_pinkglassesf.gif'; +$emoticons[]='*HYSTERIC* hysteric.gif'; +$emoticons[]='*TENDER* tender.gif'; +$emoticons[]='*SPRUSE_UP* spruce_up.gif'; +$emoticons[]='*FLIRT* flirt.gif'; +$emoticons[]='*GIVE_HEART* give_heart.gif'; +$emoticons[]='*CURTSEY* curtsey.gif'; +$emoticons[]='*GIRL_DRINK* girl_drink1.gif'; +$emoticons[]='*HAHA* girl_haha.gif'; +$emoticons[]='*IMPOSSIBLE* girl_impossible.gif'; +$emoticons[]='*SIGH* girl_sigh.gif'; +$emoticons[]='*MOIL* moil.gif'; +$emoticons[]='*YES* yes3.gif'; +$emoticons[]='*MEGA_SHOK* swoon2.gif'; +$emoticons[]='*THANK* thank_you.gif'; +$emoticons[]='*KING* king.gif'; +$emoticons[]='*LAZY* lazy.gif'; +$emoticons[]='*FRIEND* friends.gif'; +$emoticons[]='*PUNISH* punish.gif'; +$emoticons[]='*WIZARD* wizard.gif'; +$emoticons[]='*V* victory.gif'; +$emoticons[]='*SPITEFUL* spiteful.gif'; +$emoticons[]='*TEASE* tease.gif'; +$emoticons[]='*SCARE* scare.gif'; +$emoticons[]='*THIS* this.gif'; +$emoticons[]='*PAINT* paint2.gif'; +$emoticons[]='*TRAINING* training1.gif'; +$emoticons[]='*PARTY* party2.gif'; +$emoticons[]='*HELLO* preved.gif'; +$emoticons[]='*MAIL* mail1.gif'; +$emoticons[]='*WALL* dash1.gif'; +$emoticons[]='*VAMPIRE* vampire.gif'; +$emoticons[]='*GAMER* gamer4.gif'; +$emoticons[]='*POPCORN* popcorm1.gif'; +$emoticons[]='*IREFUL* ireful1.gif'; + +$aliases=array(); +$aliases[]=':-) smile.gif'; +$aliases[]=':-( sad.gif'; +$aliases[]=';-) wink.gif'; +$aliases[]=':p blum3.gif'; +$aliases[]=':-P blum3.gif'; +$aliases[]='8-) dirol.gif'; +$aliases[]=':-D biggrin.gif'; +$aliases[]=':-[ blush2.gif'; +$aliases[]='o_o shok.gif'; +$aliases[]=':-* kiss2.gif'; +$aliases[]=';-( cray2.gif'; +$aliases[]=':-X secret.gif'; +$aliases[]=':x secret.gif'; +$aliases[]=':-@ aggressive.gif'; +$aliases[]=':-| fool.gif'; +$aliases[]=':-/ beee.gif'; +$aliases[]='8P mosking.gif'; +$aliases[]=':-! bad.gif'; +$aliases[]='(F) give_rose.gif'; + +foreach ($emoticons AS $emotion){ + $s = explode(" ", $emotion); + $data["word"] = $s[0]; + $data["img"] = $s[1]; + $this->db->insert('emoticons', $data); +} +foreach ($aliases AS $emotion){ + $s = explode(" ", $emotion); + $data["word"] = $s[0]; + $data["img"] = $s[1]; + $this->db->insert('emoticons', $data); +} + + } +} + +/* End of file welcome.php */ +/* Location: ./application/controllers/welcome.php */ diff --git a/application/controllers/test.php b/application/controllers/test.php index a78d756..397a40c 100755 --- a/application/controllers/test.php +++ b/application/controllers/test.php @@ -1,157 +1,157 @@ -'; -$size=getimagesize($source); -//echo $size[0]; -$width=$size[0]; -echo 'width-'.$width; -$height=$size[1]; -$x=0; -$y=0; -/*if($width>$height){ -$x=ceil(($width-$height)/2); -$width=$height; -}if($width<$height){ -$x=ceil(($height-$width)/2); -$height=$width; -}*/ -echo '
'.$thum_width.'--'.$thum_height; -$new_image=imagecreatetruecolor($thum_width,$thum_height)or die('Cannot Initialize new GD image stream'); -$extension=getExtension($source); -echo '
Exten:-'.$extension.'
'; - -if($extension=='jpg'||$extension=='jpeg'){ - -$image=imagecreatefromjpeg($source); -} - -imagecopyresampled($new_image,$image,0,0,$x,$y,$thum_width,$thum_height,$width,$height); - -if($extension=='jpg'||$extension=='jpeg'){ - -imagejpeg($new_image,$destination,40); - -} - -} - -function getExtension($name){ - -return('jpg'); -} - - - -if(move_uploaded_file($_FILES['videoUpload']['tmp_name'],$tempUpload)){ - - -shell_exec("ffmpeg -i $tempUpload -ar 22050 -ab 32 -f flv -s 450×370 $destinationVideo"); - -$img=shell_exec("ffmpeg -i $destinationVideo -f mjpeg -t 0.050 $destinationThum"); - -create_thumbnail($destinationThum,$destinationFirstThum,124,100); - -$mov = new ffmpeg_movie($destinationVideo); -$totTime=ceil($mov->getDuration()); -$fps=$mov->getFrameRate(); -echo '
-Your Video Information
Uploaded Video Length:-'.($totTime/60).'

'; -}else{ -echo 'not uploaded'; -} -} - -if ($_FILES['videoUpload']['error'] > 0) { -echo '

The file could not be uploaded because: '; -switch ($_FILES['videoUpload']['error']) { - -case 1: -echo 'The file exceeds the upload_max_filesize setting in php.ini.'; -break; -case 2: - -echo 'The file exceeds the MAX_FILE_SIZE setting in the HTML form.'; -break; -case 3: - -echo 'The file was only partially uploaded.'; -break; - -case 4: -echo 'No file was uploaded.'; -break; - -case 6: -echo 'No temporary folder was available.'; -break; - -case 7: -echo 'Unable to write to the disk.'; -break; - -case 8: -echo 'File upload stopped.'; -break; - -default: -echo 'A system error occurred.'.$_FILES['videoUpload']['error']; -break; -} -echo '

'; -} -} - +'; +$size=getimagesize($source); +//echo $size[0]; +$width=$size[0]; +echo 'width-'.$width; +$height=$size[1]; +$x=0; +$y=0; +/*if($width>$height){ +$x=ceil(($width-$height)/2); +$width=$height; +}if($width<$height){ +$x=ceil(($height-$width)/2); +$height=$width; +}*/ +echo '
'.$thum_width.'--'.$thum_height; +$new_image=imagecreatetruecolor($thum_width,$thum_height)or die('Cannot Initialize new GD image stream'); +$extension=getExtension($source); +echo '
Exten:-'.$extension.'
'; + +if($extension=='jpg'||$extension=='jpeg'){ + +$image=imagecreatefromjpeg($source); +} + +imagecopyresampled($new_image,$image,0,0,$x,$y,$thum_width,$thum_height,$width,$height); + +if($extension=='jpg'||$extension=='jpeg'){ + +imagejpeg($new_image,$destination,40); + +} + +} + +function getExtension($name){ + +return('jpg'); +} + + + +if(move_uploaded_file($_FILES['videoUpload']['tmp_name'],$tempUpload)){ + + +shell_exec("ffmpeg -i $tempUpload -ar 22050 -ab 32 -f flv -s 450×370 $destinationVideo"); + +$img=shell_exec("ffmpeg -i $destinationVideo -f mjpeg -t 0.050 $destinationThum"); + +create_thumbnail($destinationThum,$destinationFirstThum,124,100); + +$mov = new ffmpeg_movie($destinationVideo); +$totTime=ceil($mov->getDuration()); +$fps=$mov->getFrameRate(); +echo '
+Your Video Information
Uploaded Video Length:-'.($totTime/60).'

'; +}else{ +echo 'not uploaded'; +} +} + +if ($_FILES['videoUpload']['error'] > 0) { +echo '

The file could not be uploaded because: '; +switch ($_FILES['videoUpload']['error']) { + +case 1: +echo 'The file exceeds the upload_max_filesize setting in php.ini.'; +break; +case 2: + +echo 'The file exceeds the MAX_FILE_SIZE setting in the HTML form.'; +break; +case 3: + +echo 'The file was only partially uploaded.'; +break; + +case 4: +echo 'No file was uploaded.'; +break; + +case 6: +echo 'No temporary folder was available.'; +break; + +case 7: +echo 'Unable to write to the disk.'; +break; + +case 8: +echo 'File upload stopped.'; +break; + +default: +echo 'A system error occurred.'.$_FILES['videoUpload']['error']; +break; +} +echo '

'; +} +} + ?> \ No newline at end of file diff --git a/application/controllers/user.php b/application/controllers/user.php index ce51c82..e11a423 100755 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -1,1254 +1,1254 @@ -_logged_in(); - $this->profile(); - - } - - function change_passwords() - { - //$this->_logged_in(); - $data['password'] = 'password'; - $id=1; - //while($id<150){ - $this->ion_auth->update($id, $data); - //$id++; - //} - } - - function message_box($username = null){ - $this->_logged_in(); - $this->form_validation->set_rules('message', 'message', 'required'); - $other_user = $this->data['other_user'] = $this->db->get_where('users',array('username'=>$username))->row(); - if(!empty($other_user)){ - $username = $other_user->username; - $my_user = $this->data['my_user']= $user = $this->ion_auth->user()->row(); - - if ($this->form_validation->run() === TRUE){ - $insert_chat['from'] = $my_user->username; - $insert_chat['to'] = $username; - $insert_chat['message'] = str_replace("\n", "
", $this->input->post('message', true)); - $insert_chat['sent'] = date('Y-m-d H:m:s'); - $this->db->insert('chat',$insert_chat); - } - - - - $this->db->where(array('from'=>$username,'to'=>$my_user->username)); - $message = $this->db->get('chat')->result(); - $this->db->where(array('to'=>$username,'from'=>$my_user->username)); - - $messages = array_merge($message , $this->db->get('chat')->result()); - $new = array(); - $emotions = $this->db->get('emotions')->result(); - foreach($messages AS $message){ - foreach($emotions AS $emotion){ - $word = $emotion->word; - $img = $emotion->img ; - $img = ""; - $message->message = str_replace($word, $img, $message->message); - - } - $new[$message->id] = $message; - } - - $this->data['messages'] = $new; - $this->load->view('message_box',$this->data); - }else{ - redirect('user/messages'); - } - } - - private function _logged_in() - { - if (!$this->ion_auth->logged_in()) - { - redirect('user/login', 'refresh'); - return false; - }else{ - $user = $this->ion_auth->user()->row(); - - $_SESSION['username'] = $user->username; - } - - return true; - } - - function insert_fake_users(){ - $this->_logged_in(); - $data = json_decode(file_get_contents('http://api.randomuser.me/?results=15'),true); - - foreach ($data['results'] as $user) - { - $user = $user['user']; - - $username = $user['username']; - $email = $user['email']; - $password = $user['password']; - $city_data = $this->_city(); - $additional_data = array( - 'first_name' => $user['name']['first'], - 'last_name' => $user['name']['last'], - 'country' => 'United States', - 'state' =>$user['location']['state'], - 'city' => $user['location']['city'], - 'sex' => $user['gender'], - 'phone' => $data['phone'], - 'profile_photo' => basename($user['picture']['medium']), - ); - - - $filenameOut = './assets/uploads/member/' . basename($user['picture']['medium']); - $url_image = file_get_contents($user['picture']['medium']); - $local_image = file_put_contents($filenameOut, $url_image); - - $this->ion_auth->register($username, $password, $email, $additional_data); - - } - } - - function _city() - { - if (!empty($_SERVER['HTTP_CLIENT_IP'])) { - $ip = $_SERVER['HTTP_CLIENT_IP']; - } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { - $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; - } else { - $ip = $_SERVER['REMOTE_ADDR']; - } - $data = json_decode(file_get_contents("http://freegeoip.net/json/$ip"),true); - - $data['country'] = $data['country_name']; - $data['state'] = $data['region_name']; - $data['city'] = $data['city']; - if(!empty($data)){ - $data = array(); - $data['country'] = 'other'; - $data['state'] = 'other'; - $data['city'] = 'other'; - } - return $data; - } - - public function profile($user_id = null) - { - $this->_logged_in(); - if(!empty($user_id)) - { - $user = $this->db->get_where('users',array('username' => $user_id ))->row(); - if(empty($user)) - redirect('user/profile'); - - $this->data['user'] = $this->ion_auth->user($user->id)->row(); - $this->data['profile_owner'] = FALSE; - } - else - { - $this->data['user'] = $this->ion_auth->user()->row(); - $this->data['profile_owner'] = true; - } - - $this->data['liked'] = false; - $this->data['videos'] = $this->db->get_where('video',array('user_id'=>$this->data['user']->user_id))->result(); - $image_crud = new image_CRUD(); - - $image_crud->set_primary_key_field('id'); - $image_crud->set_url_field('url'); - - $image_crud->set_userid($this->data['user']->id); - - $image_crud->set_table('photo'); - $image_crud->unset_upload(); - $image_crud->unset_delete(); - //$image_crud->where('user_id',1); - $image_crud->set_image_path('assets/uploads'); - - $this->data['output'] = $image_crud->render(); - $image = $this->db->get_where('photo',array('user_id'=>$this->data['user']->user_id))->result(); - - if(empty($image)) - $this->data['output'] = null; - - $this->load->view('my_account',$this->data); - } - - public function recommend() - { - $this->_logged_in(); - - $recomend = $this->_get_recommendition(false,false,true); - if(empty($recomend)) - $recomend = $this->_get_recommendition(false,true,false); - if(empty($recomend)) - $recomend = $this->_get_recommendition(true,false,false); - if(empty($recomend)) - $recomend = $this->_get_recommendition(false,false,false); - - if(!empty($recomend)) - $this->profile($recomend->username); - else - $this->load->view('no_recommend',$this->data); - } - - public function search() - { - $this->_logged_in(); - - if ($this->form_validation->run() == false) - { - //setup the input - $this->data['search'] = array('name' => 'searchkw', - 'id' => 'search', - 'required'=>"required", - 'class'=>"form-control", - 'style'=>"width:70%", - ); - - $this->load->view('search_form',$this->data); - } - else - { - $searchkw = $this->input->post('searchkw', true); - if(!empty($searchkw)) - { - $this->db->like('username', $searchkw); - $this->db->or_like('first_name', $searchkw); - $this->db->or_like('last_name', $searchkw); - $this->db->or_like('country', $searchkw); - $this->db->or_like('email', $searchkw); - $this->db->or_like('phone', $searchkw); - $this->db->or_like('state', $searchkw); - $this->db->or_like('city', $searchkw); - - $this->data['users'] = $this->db->get('users')->result(); - $this->load->view('result', $this->data); - } - } - } - - public function delete($confirm=false) - { - $this->_logged_in(); - - if($confirm == 'do') - { - if (PH2DATE_DEMOMODE) // Stop that feature if it is on Demo mode - { - $this->session->set_flashdata('msg_error_right', "During the Demo More, You can't delete your Account!"); - redirect('user/delete', 'refresh'); - } - else - { - $u = $this->ion_auth->user()->row(); - $id = $u->id; - $this->ion_auth->delete_user($id); - $this->db->delete('video', array('user_id' => $id)); - $this->db->delete('photo', array('user_id' => $id)); - $this->db->delete('user_likes', array('user_id' => $id)); - $this->ion_auth->logout(); - $this->session->set_flashdata('msg_success_left', lang('delete_successful')); - redirect('user/login', 'refresh'); - } - } - else - { - $this->load->view('delete',$this->data); - } - } - - private function _get_recommendition($same_country=false,$same_state=false,$same_city=false) - { - $user = $this->ion_auth->user()->row(); - $user_likes = $this->db->get_where('user_likes',array('user_id'=>$user->id))->result_array(); - $pass = array($user->id); - - - if(!empty($user_likes)){ - foreach($user_likes AS $likes){ - $pass[] = $likes['liked_user_id']; - } - } - - $this->db->where('user_id',$user->id); - $this->db->or_where('matched_user_id',$user->id); - $matched_users = $this->db->get('match')->result_array(); - - - $user_list = array(); - if(!empty($matched_users)){ - foreach($matched_users AS $users){ - $pass[] = $users['user_id']; - $pass[] = $users['matched_user_id']; - } - $pass = array_unique($pass); - } - - $this->db->where_not_in('id', $pass); - if($user->prefer_opposite_sex){ - $this->db->where_not_in('sex', array($user->sex)); - } - if($same_city) - $this->db->where('city',$user->city); - if($same_state) - $this->db->where('state',$user->state); - if($same_country) - $this->db->where('country',$user->country); - - $recomend = $this->db->get('users')->row(); - return $recomend ; - } - - public function matched() - { - $this->_logged_in(); - $user = $this->ion_auth->user()->row(); - $this->db->where('user_id',$user->id); - $this->db->or_where('matched_user_id',$user->id); - $matched_users = $this->db->get('match')->result_array(); - - - $user_list = array(); - if(!empty($matched_users)){ - foreach($matched_users AS $users){ - $user_list[] = $users['user_id']; - $user_list[] = $users['matched_user_id']; - } - $user_list = array_unique($user_list); - } - $this->data['users'] = array(); - if(!empty($user_list)){ - $this->db->where_in('id', $user_list); - $this->db->where_not_in('id', $user->id); - $this->data['users'] = $this->db->get('users')->result(); - } - - $this->load->view('matched',$this->data); - } - public function messages() - { - $this->_logged_in(); - - $user = $this->ion_auth->user()->row(); - $this->db->where('from',$user->username); - $this->db->or_where('to',$user->username); - $chat_users = $this->db->get('chat')->result_array(); - $user_list = array(); - if(!empty($chat_users)){ - foreach($chat_users AS $users){ - $user_list[] = $users['from']; - $user_list[] = $users['to']; - } - $user_list = array_unique($user_list); - } - if(!empty($user_list)){ - $this->db->where_in('username', $user_list); - $this->db->where_not_in('id', $user->id); - $this->data['users'] = $this->db->get('users')->result(); - }else{ - $this->data['users'] = array(); - } - - - $this->load->view('messages',$this->data); - } - public function like($id = null) - { - $this->_logged_in(); - if(!$id){ - redirect('user/recommend'); - } - $id = (int) $id; - $this->_operation($id,'like'); - } - public function pass($id = null) - { - $this->_logged_in(); - if(!$id){ - redirect('user/recommend'); - } - $id = (int) $id; - $this->_operation($id,'pass'); - } - function _operation($id,$operation) - { - $user = $this->ion_auth->user()->row(); - $otheruser = $this->ion_auth->user($id)->row(); - if($operation=='like'){ - $data = array(); - $data['user_id'] = $user->id; - $data['liked_user_id'] = $id; - $data['operation'] = 'like'; - $this->db->insert('user_likes',$data); - $this->session->set_flashdata('msg_success_right', "you liked $otheruser->first_name"); - $where['user_id'] = $id; - $where['liked_user_id'] = $user->id; - $liked_user_match = $this->db->get_where('user_likes',$where)->row(); - if(!empty($liked_user_match)){ - $data = array(); - $data['user_id'] = $user->id; - $data['matched_user_id'] = $id; - $this->db->insert('match',$data); - - } - } - if($operation=='pass'){ - $data = array(); - $data['user_id'] = $user->id; - $data['liked_user_id'] = $id; - $data['operation'] = 'pass'; - $this->db->insert('user_likes',$data); - $this->session->set_flashdata('msg_success_right', "you passed $otheruser->first_name"); - } - redirect('user/recommend'); - } - - - public function edit_account() - { - $this->_logged_in(); - $this->form_validation->set_rules('first_name', 'first_name', 'required'); - $this->form_validation->set_rules('last_name', 'last_name', 'required'); - $this->form_validation->set_rules('email', 'email', 'required'); - - $config['upload_path'] = './assets/uploads/member/'; - $config['encrypt_name'] = TRUE; // Encrypt filenames uploaded - $config['allowed_types'] = 'gif|jpg|png'; - $config['max_size'] = '100'; - $config['max_width'] = '1024'; - $config['max_height'] = '768'; - - $this->load->library('upload', $config); - - $user = $this->data['user'] = $this->ion_auth->user()->row(); - - if ($this->form_validation->run() === TRUE) - { - $data = array( - 'first_name' => $this->input->post('first_name', true), - 'last_name' => $this->input->post('last_name', true), - 'email' => $this->input->post('email', true), - 'country' => $this->input->post('country', true), - 'state' => $this->input->post('state', true), - 'city' => $this->input->post('city', true), - 'sex' => $this->input->post('sex', true), - 'prefer_opposite_sex' => $this->input->post('prefer_opposite_sex'), - 'phone' => $this->input->post('phone', true), - - ); - - if($this->upload->do_upload('profile_photo')) - { - $data_img = array('upload_data' => $this->upload->data()); - $data['profile_photo'] = $data_img['upload_data']['file_name']; - } - - $this->ion_auth->update($user->id, $data); - $this->session->set_flashdata('msg_success_right', "your data updated"); - redirect('user/profile'); - } - $this->data['user'] = $this->ion_auth->user()->row(); - - $this->load->view('edit_account',$this->data); - - - } - - function mypic() - { - $this->_logged_in(); - $image_crud = new image_CRUD(); - - $image_crud->set_primary_key_field('id'); - $image_crud->set_url_field('url'); - $image_crud->set_title_field('title'); - $image_crud->set_userid($this->ion_auth->user()->row()->id); - $image_crud->set_table('photo'); - //$image_crud->where('user_id',1); - $image_crud->set_ordering_field('priority') - ->set_image_path('assets/uploads'); - - $this->data['output'] = $image_crud->render(); - - $this->load->view('mypic',$this->data); - } - - public function myvideo() - { - $this->_logged_in(); - - $user = $this->data['user'] = $this->ion_auth->user()->row(); - $this->data['videos'] = $this->db->get_where('video',array('user_id'=>$user->id))->result(); - $this->load->view('myvideo',$this->data); - - - } - - function upload_video(){ - $this->_logged_in(); - $user = $this->data['user'] = $this->ion_auth->user()->row(); - //$this->form_validation->set_rules('video_file', 'video file', 'required'); - $this->form_validation->set_rules('video_name', 'video name', 'required'); - - $config['upload_path'] = './assets/uploads/video/'; - $config['encrypt_name'] = TRUE; // Encrypt filenames uploaded - $config['allowed_types'] = 'flv|mp4|mpeg|3gp|wmv|gif|jpg|png'; - $config['max_size'] = '999999'; - - $this->load->library('upload', $config); - - $user = $this->data['user'] = $this->ion_auth->user()->row(); - if ($this->form_validation->run() === TRUE) - { - $data = array( - 'video_name' => $this->input->post('video_name', true), - 'video_desc' => $this->input->post('video_desc', true), - 'user_id' => $user->id, - ); - if($this->upload->do_upload('video_img')){ - $data_img = array('upload_data' => $this->upload->data()); - $data['video_img'] = $data_img['upload_data']['file_name']; - $info = new splfileinfo($data['video_img']); - if(!in_array($info->getextension(),array('gif','jpg','png') ) ){ - $this->session->set_flashdata('msg_error_right', "image extension not allowed"); - redirect('user/upload_video');} - }else{ - $this->session->set_flashdata('msg_error_right', "Video image required"); - redirect('user/upload_video'); - } - if($this->upload->do_upload('video_file')){ - $data_img = array('upload_data' => $this->upload->data()); - $data['video_file'] = $data_img['upload_data']['file_name']; - $info = new splfileinfo($data['video_file']); - if(!in_array($info->getextension(),array('flv','mp4','mpeg','3gp','wmv') ) ){ - $this->session->set_flashdata('msg_error_right', "Video extension not allowed"); - redirect('user/upload_video');} - }else{ - $this->session->set_flashdata('msg_error_right', "Video file required"); - redirect('user/upload_video'); - } - - - $this->db->insert('video', $data); - $this->session->set_flashdata('msg_success_right', "your video uploaded"); - redirect('user/myvideo'); - } - $upload_err = $this->upload->display_errors(); - if(!empty($upload_err)){ - $this->session->set_flashdata('msg_error_right', $this->upload->display_errors()); - redirect('user/upload_video'); - } - $this->load->view('upload_video',$this->data); - } - function video_edit($id = false) - { - $this->_logged_in(); - $this->form_validation->set_rules('video_name', 'video name', 'required'); - $user = $this->data['user'] = $this->ion_auth->user()->row(); - if ($this->form_validation->run() === TRUE){ - $data = array( - 'video_name' => $this->input->post('video_name', true), - 'video_desc' => $this->input->post('video_desc', true), - ); - $this->db->update('video',$data,array('user_id'=>$user->id,'id'=>$id)); - $this->session->set_flashdata('msg_success_right', "your video updated"); - redirect('user/myvideo'); - } - $this->data['video'] = $this->db->get_where('video',array('id'=>$id,'user_id'=>$user->id))->row(); - if(empty($this->data['video'])) - redirect('user/myvideo'); - $this->load->view('video_edit',$this->data); - } - function video_delete($id = false){ - $this->_logged_in(); - $user = $this->data['user'] = $this->ion_auth->user()->row(); - $this->db->delete('video',array('id'=>$id,'user_id'=>$user->id)); - $this->session->set_flashdata('msg_success_right', "your video Deleted"); - redirect('user/myvideo'); - - } - function video_watch($id = false){ - $this->_logged_in(); - $user = $this->data['user'] = $this->ion_auth->user()->row(); - $video = $this->data['video'] = $this->db->get_where('video',array('id'=>$id,'user_id'=>$user->id))->row(); - if(empty($video)) - redirect('user/myvideo'); - $this->data['videos'] = $this->db->get_where('video',array('user_id'=>$video->user_id))->result(); - - $this->load->view('video_watch',$this->data); - } - - function login() - { - //$this->data['success'] = message_success - $this->data['title'] = "Login"; - $this->form_validation->set_rules('identity', 'Identity', 'required'); - $this->form_validation->set_rules('password', 'Password', 'required'); - if ($this->ion_auth->logged_in()) - { - redirect('user', 'refresh'); - } - if ($this->form_validation->run() == true) - { - $remember = (bool) $this->input->post('remember'); - - if ($this->ion_auth->login($this->input->post('identity'), $this->input->post('password'), $remember)) - { - $this->session->set_flashdata('msg_success_left', $this->ion_auth->messages()); - - redirect('/', 'refresh'); - } - else - { - $this->session->set_flashdata('msg_error_left', $this->ion_auth->errors()); - redirect('user/login', 'refresh'); //use redirects instead of loading views for compatibility with MY_Controller libraries - } - } - else - { - $this->msg_error_left = ( validation_errors() ) ? validation_errors() : $this->session->flashdata('msg_error_left'); - - $this->data['identity'] = array('name' => 'identity', - 'id' => 'identity', - 'type' => 'email', - 'class'=>"form-control", - 'required'=>"required", - 'value' => $this->form_validation->set_value('identity'), - ); - $this->data['password'] = array('name' => 'password', - 'id' => 'password', - 'type' => 'password', - 'required'=>"required", - 'class'=>"form-control", - ); - $this->data['first_name'] = array( - 'name' => 'first_name', - 'id' => 'first_name', - 'type' => 'text', - 'required'=>"required", - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('first_name'), - ); - $this->data['last_name'] = array( - 'name' => 'last_name', - 'id' => 'last_name', - 'type' => 'text', - 'required'=>"required", - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('last_name'), - ); - $this->data['email'] = array( - 'name' => 'email', - 'id' => 'email', - 'type' => 'email', - 'required'=>"required", - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('email'), - ); - - $this->data['phone'] = array( - 'name' => 'phone', - 'id' => 'phone', - 'required'=>"required", - 'type' => 'tel', - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('phone'), - ); - $this->data['password'] = array( - 'name' => 'password', - 'id' => 'password', - 'type' => 'password', - 'required'=>"required", - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('password'), - ); - $this->data['password_confirm'] = array( - 'name' => 'password_confirm', - 'id' => 'password_confirm', - 'type' => 'password', - 'required'=>"required", - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('password_confirm'), - ); - - $this->_render_page('auth/login', $this->data); - } - } - - //log the user out - function logout() - { - $this->_logged_in(); - $this->ion_auth->logout(); - $this->session->set_flashdata('msg_success_left', $this->ion_auth->messages()); - redirect('user/login', 'refresh'); - } - - - - //forgot password - function forgot_password() - { - $this->form_validation->set_rules('email', $this->lang->line('forgot_password_validation_email_label'), 'required|valid_email'); - if ($this->form_validation->run() == false) - { - //setup the input - $this->data['email'] = array('name' => 'email', - 'id' => 'email', - 'required'=>"required", - 'class'=>"form-control", - 'style'=>"width:70%", - ); - - if ( $this->config->item('identity', 'ion_auth') == 'username' ){ - $this->data['identity_label'] = $this->lang->line('forgot_password_username_identity_label'); - } - else - { - $this->data['identity_label'] = $this->lang->line('forgot_password_email_identity_label'); - } - - //set any errors and display the form - $this->msg_error_right = (validation_errors()) ? validation_errors() : $this->session->flashdata('msg_error_right'); - $this->_render_page('auth/forgot_password', $this->data); - } - else - { - // get identity from username or email - if ( $this->config->item('identity', 'ion_auth') == 'username' ){ - $identity = $this->ion_auth->where('username', strtolower($this->input->post('email')))->users()->row(); - } - else - { - $identity = $this->ion_auth->where('email', strtolower($this->input->post('email')))->users()->row(); - } - if(empty($identity)) { - $this->ion_auth->set_message('forgot_password_email_not_found'); - $this->session->set_flashdata('msg_error_right', $this->ion_auth->messages()); - redirect("user/forgot_password", 'refresh'); - } - - //run the forgotten password method to email an activation code to the user - $forgotten = $this->ion_auth->forgotten_password($identity->{$this->config->item('identity', 'ion_auth')}); - - if ($forgotten) - { - //if there were no errors - $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); - redirect("user/login", 'refresh'); //we should display a confirmation page here instead of the login page - } - else - { - $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); - redirect("user/forgot_password", 'refresh'); - } - } - } - - //reset password - final step for forgotten password - public function reset_password($code = NULL) - { - if (!$code) - { - show_404(); - } - - $user = $this->ion_auth->forgotten_password_check($code); - - if ($user) - { - //if the code is valid then display the password reset form - - $this->form_validation->set_rules('new', $this->lang->line('reset_password_validation_new_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[new_confirm]'); - $this->form_validation->set_rules('new_confirm', $this->lang->line('reset_password_validation_new_password_confirm_label'), 'required'); - - if ($this->form_validation->run() == false) - { - //display the form - - //set the flash data error message if there is one - $this->msg_error_right = (validation_errors()) ? validation_errors() : $this->session->flashdata('msg_error_right'); - - $this->data['min_password_length'] = $this->config->item('min_password_length', 'ion_auth'); - $this->data['new_password'] = array( - 'name' => 'new', - 'id' => 'new', - 'type' => 'password', - 'pattern' => '^.{'.$this->data['min_password_length'].'}.*$', - ); - $this->data['new_password_confirm'] = array( - 'name' => 'new_confirm', - 'id' => 'new_confirm', - 'type' => 'password', - 'pattern' => '^.{'.$this->data['min_password_length'].'}.*$', - ); - $this->data['user_id'] = array( - 'name' => 'user_id', - 'id' => 'user_id', - 'type' => 'hidden', - 'value' => $user->id, - ); - $this->data['csrf'] = $this->_get_csrf_nonce(); - $this->data['code'] = $code; - - //render - $this->_render_page('auth/reset_password', $this->data); - } - else - { - // do we have a valid request? - if ($this->_valid_csrf_nonce() === FALSE || $user->id != $this->input->post('user_id')) - { - - //something fishy might be up - $this->ion_auth->clear_forgotten_password_code($code); - - show_error($this->lang->line('error_csrf')); - - } - else - { - // finally change the password - $identity = $user->{$this->config->item('identity', 'ion_auth')}; - - $change = $this->ion_auth->reset_password($identity, $this->input->post('new')); - - if ($change) - { - //if the password was successfully changed - $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); - $this->logout(); - } - else - { - $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); - redirect('user/reset_password/' . $code, 'refresh'); - } - } - } - } - else - { - //if the code is invalid then send them back to the forgot password page - $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); - redirect("auth/forgot_password", 'refresh'); - } - } - - - //activate the user - function activate($id, $code=false) - { - if ($code !== false) - { - $activation = $this->ion_auth->activate($id, $code); - } - else if ($this->ion_auth->is_admin()) - { - $activation = $this->ion_auth->activate($id); - } - - if ($activation) - { - //redirect them to the auth page - $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); - redirect("auth", 'refresh'); - } - else - { - //redirect them to the forgot password page - $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); - redirect("auth/forgot_password", 'refresh'); - } - } - - //deactivate the user - function deactivate($id = NULL) - { - $id = (int) $id; - - $this->load->library('form_validation'); - $this->form_validation->set_rules('confirm', $this->lang->line('deactivate_validation_confirm_label'), 'required'); - $this->form_validation->set_rules('id', $this->lang->line('deactivate_validation_user_id_label'), 'required|alpha_numeric'); - - if ($this->form_validation->run() == FALSE) - { - // insert csrf check - $this->data['csrf'] = $this->_get_csrf_nonce(); - $this->data['user'] = $this->ion_auth->user($id)->row(); - - $this->_render_page('auth/deactivate_user', $this->data); - } - else - { - // do we really want to deactivate? - if ($this->input->post('confirm') == 'yes') - { - // do we have a valid request? - if ($this->_valid_csrf_nonce() === FALSE || $id != $this->input->post('id')) - { - show_error($this->lang->line('error_csrf')); - } - - // do we have the right userlevel? - if ($this->ion_auth->logged_in() && $this->ion_auth->is_admin()) - { - $this->ion_auth->deactivate($id); - } - } - - //redirect them back to the auth page - redirect('user', 'refresh'); - } - } - - - - //create a new user - function register() - { - $this->data['title'] = "Create User"; - - if ($this->ion_auth->logged_in()) - { - redirect('user/profile', 'refresh'); - } - - $tables = $this->config->item('tables','ion_auth'); - - //validate form input - $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required|xss_clean'); - $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required|xss_clean'); - $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique['.$tables['users'].'.email]'); - $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'required|xss_clean'); - $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]'); - $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required'); - - if ($this->form_validation->run() == true) - { - $username = strtolower($this->input->post('first_name', true)) . ' ' . strtolower($this->input->post('last_name', true)); - $email = strtolower($this->input->post('email', true)); - $password = $this->input->post('password'); - $city_data = $this->_city(); - $additional_data = array( - 'first_name' => $this->input->post('first_name', true), - 'last_name' => $this->input->post('last_name', true), - 'country' => $city_data['country'], - 'state' => $city_data['state'], - 'city' => $city_data['city'], - 'sex' => $this->input->post('sex', true), - 'phone' => $this->input->post('phone', true), - ); - - - - } - if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data)) - { - //check to see if we are creating the user - //redirect them back to the admin page - $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); - redirect("user/login", 'refresh'); - } - else - { - //display the create user form - //set the flash data error message if there is one - $this->msg_error_right = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'))); - $this->data['identity'] = array('name' => 'identity', - 'id' => 'identity', - 'type' => 'email', - 'required'=>"required", - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('identity'), - ); - $this->data['first_name'] = array( - 'name' => 'first_name', - 'id' => 'first_name', - 'required'=>"required", - 'type' => 'text', - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('first_name'), - ); - $this->data['last_name'] = array( - 'name' => 'last_name', - 'id' => 'last_name', - 'required'=>"required", - 'type' => 'text', - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('last_name'), - ); - $this->data['email'] = array( - 'name' => 'email', - 'id' => 'email', - 'type' => 'text', - 'required'=>"required", - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('email'), - ); - - $this->data['phone'] = array( - 'name' => 'phone', - 'required'=>"required", - 'id' => 'phone', - 'type' => 'tel', - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('phone'), - ); - $this->data['password'] = array( - 'name' => 'password', - 'required'=>"required", - 'id' => 'password', - 'type' => 'password', - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('password'), - ); - $this->data['password_confirm'] = array( - 'name' => 'password_confirm', - 'required'=>"required", - 'id' => 'password_confirm', - 'type' => 'password', - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('password_confirm'), - ); - - $this->_render_page('auth/login', $this->data); - } - } - - //edit a user - function myinfo() - { - $this->_logged_in(); - - $id = $this->ion_auth->user()->row()->id; - $user = $this->ion_auth->user()->row(); - $groups=$this->ion_auth->groups()->result_array(); - $currentGroups = $this->ion_auth->get_users_groups($id)->result(); - - //validate form input - $this->form_validation->set_rules('first_name', $this->lang->line('edit_user_validation_fname_label'), 'required|xss_clean'); - $this->form_validation->set_rules('last_name', $this->lang->line('edit_user_validation_lname_label'), 'required|xss_clean'); - $this->form_validation->set_rules('phone', $this->lang->line('edit_user_validation_phone_label'), 'required|xss_clean'); - - $this->form_validation->set_rules('groups', $this->lang->line('edit_user_validation_groups_label'), 'xss_clean'); - - if (isset($_POST) && !empty($_POST)) - { - // do we have a valid request? - if ($this->_valid_csrf_nonce() === FALSE || $id != $this->input->post('id')) - { - show_error($this->lang->line('error_csrf')); - } - - $data = array( - 'first_name' => $this->input->post('first_name', true), - 'last_name' => $this->input->post('last_name', true), - 'phone' => $this->input->post('phone', true), - ); - - // Only allow updating groups if user is admin - if ($this->ion_auth->is_admin()) - { - //Update the groups user belongs to - $groupData = $this->input->post('groups', true); - - if (isset($groupData) && !empty($groupData)) { - - $this->ion_auth->remove_from_group('', $id); - - foreach ($groupData as $grp) { - $this->ion_auth->add_to_group($grp, $id); - } - - } - } - - //update the password if it was posted - if ($this->input->post('password')) - { - $this->form_validation->set_rules('password', $this->lang->line('edit_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]'); - $this->form_validation->set_rules('password_confirm', $this->lang->line('edit_user_validation_password_confirm_label'), 'required'); - - $data['password'] = $this->input->post('password'); - } - - if ($this->form_validation->run() === TRUE) - { - $this->ion_auth->update($user->id, $data); - - //check to see if we are creating the user - //redirect them back to the admin page - $this->session->set_flashdata('msg_success_right', 'Info Saved'); - redirect('user', 'refresh'); - } - } - - //display the edit user form - $this->data['csrf'] = $this->_get_csrf_nonce(); - - //set the flash data error message if there is one - $this->msg_error_right = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('msg_error_right'))); - - //pass the user to the view - $this->data['user'] = $user; - $this->data['groups'] = $groups; - $this->data['currentGroups'] = $currentGroups; - - $this->data['first_name'] = array( - 'name' => 'first_name', - 'id' => 'first_name', - 'type' => 'text', - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('first_name', $user->first_name), - ); - $this->data['last_name'] = array( - 'name' => 'last_name', - 'id' => 'last_name', - 'type' => 'text', - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('last_name', $user->last_name), - ); - - $this->data['phone'] = array( - 'name' => 'phone', - 'id' => 'phone', - 'type' => 'text', - 'class'=>"form-control", - 'value' => $this->form_validation->set_value('phone', $user->phone), - ); - - - $this->_render_page('auth/edit_user', $this->data); - } - - public function change_password() - { - $this->_logged_in(); - $this->form_validation->set_rules('old', $this->lang->line('change_password_validation_old_password_label'), 'required'); - $this->form_validation->set_rules('new', $this->lang->line('change_password_validation_new_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[new_confirm]'); - $this->form_validation->set_rules('new_confirm', $this->lang->line('change_password_validation_new_password_confirm_label'), 'required'); - - - - $user = $this->ion_auth->user()->row(); - - if ($this->form_validation->run() == false) - { - //display the form - //set the flash data error message if there is one - $this->msg_error_right = (validation_errors()) ? validation_errors() : $this->session->flashdata('msg_error_right'); - - $this->data['min_password_length'] = $this->config->item('min_password_length', 'ion_auth'); - $this->data['old_password'] = array( - 'name' => 'old', - 'id' => 'old', - 'class'=>"form-control", - 'type' => 'password', - ); - $this->data['new_password'] = array( - 'name' => 'new', - 'id' => 'new', - 'class'=>"form-control", - 'type' => 'password', - 'pattern' => '^.{'.$this->data['min_password_length'].'}.*$', - ); - $this->data['new_password_confirm'] = array( - 'name' => 'new_confirm', - 'id' => 'new_confirm', - 'class'=>"form-control", - 'type' => 'password', - 'pattern' => '^.{'.$this->data['min_password_length'].'}.*$', - ); - $this->data['user_id'] = array( - 'name' => 'user_id', - 'id' => 'user_id', - 'type' => 'hidden', - 'value' => $user->id, - ); - - //render - $this->_render_page('change_password', $this->data); - } - else - { - $identity = $this->session->userdata('identity'); - - if (PH2DATE_DEMOMODE) // Stop that feature if it is on Demo mode - { - $this->session->set_flashdata('msg_error_right', "You can't change the password for the Demo!"); - redirect('user/change_password', 'refresh'); - } - else - { - $change = $this->ion_auth->change_password($identity, $this->input->post('old'), $this->input->post('new')); - - if ($change) - { - //if the password was successfully changed - $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); - $this->logout(); - } - else - { - $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); - redirect('user/change_password', 'refresh'); - } - } - } - } - - - - - function _get_csrf_nonce() - { - $this->load->helper('string'); - $key = random_string('alnum', 8); - $value = random_string('alnum', 20); - $this->session->set_flashdata('csrfkey', $key); - $this->session->set_flashdata('csrfvalue', $value); - - return array($key => $value); - } - - function _valid_csrf_nonce() - { - if ($this->input->post($this->session->flashdata('csrfkey')) !== FALSE && - $this->input->post($this->session->flashdata('csrfkey')) == $this->session->flashdata('csrfvalue')) - { - return TRUE; - } - else - { - return FALSE; - } - } - - function _render_page($view, $data=null, $render=false) - { - - $this->viewdata = (empty($data)) ? $this->data: $data; - - $view_html = $this->load->view($view, $this->viewdata, $render); - - if (!$render) return $view_html; - } - +_logged_in(); + $this->profile(); + + } + + function change_passwords() + { + //$this->_logged_in(); + $data['password'] = 'password'; + $id=1; + //while($id<150){ + $this->ion_auth->update($id, $data); + //$id++; + //} + } + + function message_box($username = null){ + $this->_logged_in(); + $this->form_validation->set_rules('message', 'message', 'required'); + $other_user = $this->data['other_user'] = $this->db->get_where('users',array('username'=>$username))->row(); + if(!empty($other_user)){ + $username = $other_user->username; + $my_user = $this->data['my_user']= $user = $this->ion_auth->user()->row(); + + if ($this->form_validation->run() === TRUE){ + $insert_chat['from'] = $my_user->username; + $insert_chat['to'] = $username; + $insert_chat['message'] = str_replace("\n", "
", $this->input->post('message', true)); + $insert_chat['sent'] = date('Y-m-d H:m:s'); + $this->db->insert('chat',$insert_chat); + } + + + + $this->db->where(array('from'=>$username,'to'=>$my_user->username)); + $message = $this->db->get('chat')->result(); + $this->db->where(array('to'=>$username,'from'=>$my_user->username)); + + $messages = array_merge($message , $this->db->get('chat')->result()); + $new = array(); + $emotions = $this->db->get('emotions')->result(); + foreach($messages AS $message){ + foreach($emotions AS $emotion){ + $word = $emotion->word; + $img = $emotion->img ; + $img = ""; + $message->message = str_replace($word, $img, $message->message); + + } + $new[$message->id] = $message; + } + + $this->data['messages'] = $new; + $this->load->view('message_box',$this->data); + }else{ + redirect('user/messages'); + } + } + + private function _logged_in() + { + if (!$this->ion_auth->logged_in()) + { + redirect('user/login', 'refresh'); + return false; + }else{ + $user = $this->ion_auth->user()->row(); + + $_SESSION['username'] = $user->username; + } + + return true; + } + + function insert_fake_users(){ + $this->_logged_in(); + $data = json_decode(file_get_contents('http://api.randomuser.me/?results=15'),true); + + foreach ($data['results'] as $user) + { + $user = $user['user']; + + $username = $user['username']; + $email = $user['email']; + $password = $user['password']; + $city_data = $this->_city(); + $additional_data = array( + 'first_name' => $user['name']['first'], + 'last_name' => $user['name']['last'], + 'country' => 'United States', + 'state' =>$user['location']['state'], + 'city' => $user['location']['city'], + 'sex' => $user['gender'], + 'phone' => $data['phone'], + 'profile_photo' => basename($user['picture']['medium']), + ); + + + $filenameOut = './assets/uploads/member/' . basename($user['picture']['medium']); + $url_image = file_get_contents($user['picture']['medium']); + $local_image = file_put_contents($filenameOut, $url_image); + + $this->ion_auth->register($username, $password, $email, $additional_data); + + } + } + + function _city() + { + if (!empty($_SERVER['HTTP_CLIENT_IP'])) { + $ip = $_SERVER['HTTP_CLIENT_IP']; + } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; + } else { + $ip = $_SERVER['REMOTE_ADDR']; + } + $data = json_decode(file_get_contents("http://freegeoip.net/json/$ip"),true); + + $data['country'] = $data['country_name']; + $data['state'] = $data['region_name']; + $data['city'] = $data['city']; + if(!empty($data)){ + $data = array(); + $data['country'] = 'other'; + $data['state'] = 'other'; + $data['city'] = 'other'; + } + return $data; + } + + public function profile($user_id = null) + { + $this->_logged_in(); + if(!empty($user_id)) + { + $user = $this->db->get_where('users',array('username' => $user_id ))->row(); + if(empty($user)) + redirect('user/profile'); + + $this->data['user'] = $this->ion_auth->user($user->id)->row(); + $this->data['profile_owner'] = FALSE; + } + else + { + $this->data['user'] = $this->ion_auth->user()->row(); + $this->data['profile_owner'] = true; + } + + $this->data['liked'] = false; + $this->data['videos'] = $this->db->get_where('video',array('user_id'=>$this->data['user']->user_id))->result(); + $image_crud = new image_CRUD(); + + $image_crud->set_primary_key_field('id'); + $image_crud->set_url_field('url'); + + $image_crud->set_userid($this->data['user']->id); + + $image_crud->set_table('photo'); + $image_crud->unset_upload(); + $image_crud->unset_delete(); + //$image_crud->where('user_id',1); + $image_crud->set_image_path('assets/uploads'); + + $this->data['output'] = $image_crud->render(); + $image = $this->db->get_where('photo',array('user_id'=>$this->data['user']->user_id))->result(); + + if(empty($image)) + $this->data['output'] = null; + + $this->load->view('my_account',$this->data); + } + + public function recommend() + { + $this->_logged_in(); + + $recomend = $this->_get_recommendition(false,false,true); + if(empty($recomend)) + $recomend = $this->_get_recommendition(false,true,false); + if(empty($recomend)) + $recomend = $this->_get_recommendition(true,false,false); + if(empty($recomend)) + $recomend = $this->_get_recommendition(false,false,false); + + if(!empty($recomend)) + $this->profile($recomend->username); + else + $this->load->view('no_recommend',$this->data); + } + + public function search() + { + $this->_logged_in(); + + if ($this->form_validation->run() == false) + { + //setup the input + $this->data['search'] = array('name' => 'searchkw', + 'id' => 'search', + 'required'=>"required", + 'class'=>"form-control", + 'style'=>"width:70%", + ); + + $this->load->view('search_form',$this->data); + } + else + { + $searchkw = $this->input->post('searchkw', true); + if(!empty($searchkw)) + { + $this->db->like('username', $searchkw); + $this->db->or_like('first_name', $searchkw); + $this->db->or_like('last_name', $searchkw); + $this->db->or_like('country', $searchkw); + $this->db->or_like('email', $searchkw); + $this->db->or_like('phone', $searchkw); + $this->db->or_like('state', $searchkw); + $this->db->or_like('city', $searchkw); + + $this->data['users'] = $this->db->get('users')->result(); + $this->load->view('result', $this->data); + } + } + } + + public function delete($confirm=false) + { + $this->_logged_in(); + + if($confirm == 'do') + { + if (PH2DATE_DEMOMODE) // Stop that feature if it is on Demo mode + { + $this->session->set_flashdata('msg_error_right', "During the Demo More, You can't delete your Account!"); + redirect('user/delete', 'refresh'); + } + else + { + $u = $this->ion_auth->user()->row(); + $id = $u->id; + $this->ion_auth->delete_user($id); + $this->db->delete('video', array('user_id' => $id)); + $this->db->delete('photo', array('user_id' => $id)); + $this->db->delete('user_likes', array('user_id' => $id)); + $this->ion_auth->logout(); + $this->session->set_flashdata('msg_success_left', lang('delete_successful')); + redirect('user/login', 'refresh'); + } + } + else + { + $this->load->view('delete',$this->data); + } + } + + private function _get_recommendition($same_country=false,$same_state=false,$same_city=false) + { + $user = $this->ion_auth->user()->row(); + $user_likes = $this->db->get_where('user_likes',array('user_id'=>$user->id))->result_array(); + $pass = array($user->id); + + + if(!empty($user_likes)){ + foreach($user_likes AS $likes){ + $pass[] = $likes['liked_user_id']; + } + } + + $this->db->where('user_id',$user->id); + $this->db->or_where('matched_user_id',$user->id); + $matched_users = $this->db->get('match')->result_array(); + + + $user_list = array(); + if(!empty($matched_users)){ + foreach($matched_users AS $users){ + $pass[] = $users['user_id']; + $pass[] = $users['matched_user_id']; + } + $pass = array_unique($pass); + } + + $this->db->where_not_in('id', $pass); + if($user->prefer_opposite_sex){ + $this->db->where_not_in('sex', array($user->sex)); + } + if($same_city) + $this->db->where('city',$user->city); + if($same_state) + $this->db->where('state',$user->state); + if($same_country) + $this->db->where('country',$user->country); + + $recomend = $this->db->get('users')->row(); + return $recomend ; + } + + public function matched() + { + $this->_logged_in(); + $user = $this->ion_auth->user()->row(); + $this->db->where('user_id',$user->id); + $this->db->or_where('matched_user_id',$user->id); + $matched_users = $this->db->get('match')->result_array(); + + + $user_list = array(); + if(!empty($matched_users)){ + foreach($matched_users AS $users){ + $user_list[] = $users['user_id']; + $user_list[] = $users['matched_user_id']; + } + $user_list = array_unique($user_list); + } + $this->data['users'] = array(); + if(!empty($user_list)){ + $this->db->where_in('id', $user_list); + $this->db->where_not_in('id', $user->id); + $this->data['users'] = $this->db->get('users')->result(); + } + + $this->load->view('matched',$this->data); + } + public function messages() + { + $this->_logged_in(); + + $user = $this->ion_auth->user()->row(); + $this->db->where('from',$user->username); + $this->db->or_where('to',$user->username); + $chat_users = $this->db->get('chat')->result_array(); + $user_list = array(); + if(!empty($chat_users)){ + foreach($chat_users AS $users){ + $user_list[] = $users['from']; + $user_list[] = $users['to']; + } + $user_list = array_unique($user_list); + } + if(!empty($user_list)){ + $this->db->where_in('username', $user_list); + $this->db->where_not_in('id', $user->id); + $this->data['users'] = $this->db->get('users')->result(); + }else{ + $this->data['users'] = array(); + } + + + $this->load->view('messages',$this->data); + } + public function like($id = null) + { + $this->_logged_in(); + if(!$id){ + redirect('user/recommend'); + } + $id = (int) $id; + $this->_operation($id,'like'); + } + public function pass($id = null) + { + $this->_logged_in(); + if(!$id){ + redirect('user/recommend'); + } + $id = (int) $id; + $this->_operation($id,'pass'); + } + function _operation($id,$operation) + { + $user = $this->ion_auth->user()->row(); + $otheruser = $this->ion_auth->user($id)->row(); + if($operation=='like'){ + $data = array(); + $data['user_id'] = $user->id; + $data['liked_user_id'] = $id; + $data['operation'] = 'like'; + $this->db->insert('user_likes',$data); + $this->session->set_flashdata('msg_success_right', "you liked $otheruser->first_name"); + $where['user_id'] = $id; + $where['liked_user_id'] = $user->id; + $liked_user_match = $this->db->get_where('user_likes',$where)->row(); + if(!empty($liked_user_match)){ + $data = array(); + $data['user_id'] = $user->id; + $data['matched_user_id'] = $id; + $this->db->insert('match',$data); + + } + } + if($operation=='pass'){ + $data = array(); + $data['user_id'] = $user->id; + $data['liked_user_id'] = $id; + $data['operation'] = 'pass'; + $this->db->insert('user_likes',$data); + $this->session->set_flashdata('msg_success_right', "you passed $otheruser->first_name"); + } + redirect('user/recommend'); + } + + + public function edit_account() + { + $this->_logged_in(); + $this->form_validation->set_rules('first_name', 'first_name', 'required'); + $this->form_validation->set_rules('last_name', 'last_name', 'required'); + $this->form_validation->set_rules('email', 'email', 'required'); + + $config['upload_path'] = './assets/uploads/member/'; + $config['encrypt_name'] = TRUE; // Encrypt filenames uploaded + $config['allowed_types'] = 'gif|jpg|png'; + $config['max_size'] = '100'; + $config['max_width'] = '1024'; + $config['max_height'] = '768'; + + $this->load->library('upload', $config); + + $user = $this->data['user'] = $this->ion_auth->user()->row(); + + if ($this->form_validation->run() === TRUE) + { + $data = array( + 'first_name' => $this->input->post('first_name', true), + 'last_name' => $this->input->post('last_name', true), + 'email' => $this->input->post('email', true), + 'country' => $this->input->post('country', true), + 'state' => $this->input->post('state', true), + 'city' => $this->input->post('city', true), + 'sex' => $this->input->post('sex', true), + 'prefer_opposite_sex' => $this->input->post('prefer_opposite_sex'), + 'phone' => $this->input->post('phone', true), + + ); + + if($this->upload->do_upload('profile_photo')) + { + $data_img = array('upload_data' => $this->upload->data()); + $data['profile_photo'] = $data_img['upload_data']['file_name']; + } + + $this->ion_auth->update($user->id, $data); + $this->session->set_flashdata('msg_success_right', "your data updated"); + redirect('user/profile'); + } + $this->data['user'] = $this->ion_auth->user()->row(); + + $this->load->view('edit_account',$this->data); + + + } + + function mypic() + { + $this->_logged_in(); + $image_crud = new image_CRUD(); + + $image_crud->set_primary_key_field('id'); + $image_crud->set_url_field('url'); + $image_crud->set_title_field('title'); + $image_crud->set_userid($this->ion_auth->user()->row()->id); + $image_crud->set_table('photo'); + //$image_crud->where('user_id',1); + $image_crud->set_ordering_field('priority') + ->set_image_path('assets/uploads'); + + $this->data['output'] = $image_crud->render(); + + $this->load->view('mypic',$this->data); + } + + public function myvideo() + { + $this->_logged_in(); + + $user = $this->data['user'] = $this->ion_auth->user()->row(); + $this->data['videos'] = $this->db->get_where('video',array('user_id'=>$user->id))->result(); + $this->load->view('myvideo',$this->data); + + + } + + function upload_video(){ + $this->_logged_in(); + $user = $this->data['user'] = $this->ion_auth->user()->row(); + //$this->form_validation->set_rules('video_file', 'video file', 'required'); + $this->form_validation->set_rules('video_name', 'video name', 'required'); + + $config['upload_path'] = './assets/uploads/video/'; + $config['encrypt_name'] = TRUE; // Encrypt filenames uploaded + $config['allowed_types'] = 'flv|mp4|mpeg|3gp|wmv|gif|jpg|png'; + $config['max_size'] = '999999'; + + $this->load->library('upload', $config); + + $user = $this->data['user'] = $this->ion_auth->user()->row(); + if ($this->form_validation->run() === TRUE) + { + $data = array( + 'video_name' => $this->input->post('video_name', true), + 'video_desc' => $this->input->post('video_desc', true), + 'user_id' => $user->id, + ); + if($this->upload->do_upload('video_img')){ + $data_img = array('upload_data' => $this->upload->data()); + $data['video_img'] = $data_img['upload_data']['file_name']; + $info = new splfileinfo($data['video_img']); + if(!in_array($info->getextension(),array('gif','jpg','png') ) ){ + $this->session->set_flashdata('msg_error_right', "image extension not allowed"); + redirect('user/upload_video');} + }else{ + $this->session->set_flashdata('msg_error_right', "Video image required"); + redirect('user/upload_video'); + } + if($this->upload->do_upload('video_file')){ + $data_img = array('upload_data' => $this->upload->data()); + $data['video_file'] = $data_img['upload_data']['file_name']; + $info = new splfileinfo($data['video_file']); + if(!in_array($info->getextension(),array('flv','mp4','mpeg','3gp','wmv') ) ){ + $this->session->set_flashdata('msg_error_right', "Video extension not allowed"); + redirect('user/upload_video');} + }else{ + $this->session->set_flashdata('msg_error_right', "Video file required"); + redirect('user/upload_video'); + } + + + $this->db->insert('video', $data); + $this->session->set_flashdata('msg_success_right', "your video uploaded"); + redirect('user/myvideo'); + } + $upload_err = $this->upload->display_errors(); + if(!empty($upload_err)){ + $this->session->set_flashdata('msg_error_right', $this->upload->display_errors()); + redirect('user/upload_video'); + } + $this->load->view('upload_video',$this->data); + } + function video_edit($id = false) + { + $this->_logged_in(); + $this->form_validation->set_rules('video_name', 'video name', 'required'); + $user = $this->data['user'] = $this->ion_auth->user()->row(); + if ($this->form_validation->run() === TRUE){ + $data = array( + 'video_name' => $this->input->post('video_name', true), + 'video_desc' => $this->input->post('video_desc', true), + ); + $this->db->update('video',$data,array('user_id'=>$user->id,'id'=>$id)); + $this->session->set_flashdata('msg_success_right', "your video updated"); + redirect('user/myvideo'); + } + $this->data['video'] = $this->db->get_where('video',array('id'=>$id,'user_id'=>$user->id))->row(); + if(empty($this->data['video'])) + redirect('user/myvideo'); + $this->load->view('video_edit',$this->data); + } + function video_delete($id = false){ + $this->_logged_in(); + $user = $this->data['user'] = $this->ion_auth->user()->row(); + $this->db->delete('video',array('id'=>$id,'user_id'=>$user->id)); + $this->session->set_flashdata('msg_success_right', "your video Deleted"); + redirect('user/myvideo'); + + } + function video_watch($id = false){ + $this->_logged_in(); + $user = $this->data['user'] = $this->ion_auth->user()->row(); + $video = $this->data['video'] = $this->db->get_where('video',array('id'=>$id,'user_id'=>$user->id))->row(); + if(empty($video)) + redirect('user/myvideo'); + $this->data['videos'] = $this->db->get_where('video',array('user_id'=>$video->user_id))->result(); + + $this->load->view('video_watch',$this->data); + } + + function login() + { + //$this->data['success'] = message_success + $this->data['title'] = "Login"; + $this->form_validation->set_rules('identity', 'Identity', 'required'); + $this->form_validation->set_rules('password', 'Password', 'required'); + if ($this->ion_auth->logged_in()) + { + redirect('user', 'refresh'); + } + if ($this->form_validation->run() == true) + { + $remember = (bool) $this->input->post('remember'); + + if ($this->ion_auth->login($this->input->post('identity'), $this->input->post('password'), $remember)) + { + $this->session->set_flashdata('msg_success_left', $this->ion_auth->messages()); + + redirect('/', 'refresh'); + } + else + { + $this->session->set_flashdata('msg_error_left', $this->ion_auth->errors()); + redirect('user/login', 'refresh'); //use redirects instead of loading views for compatibility with MY_Controller libraries + } + } + else + { + $this->msg_error_left = ( validation_errors() ) ? validation_errors() : $this->session->flashdata('msg_error_left'); + + $this->data['identity'] = array('name' => 'identity', + 'id' => 'identity', + 'type' => 'email', + 'class'=>"form-control", + 'required'=>"required", + 'value' => $this->form_validation->set_value('identity'), + ); + $this->data['password'] = array('name' => 'password', + 'id' => 'password', + 'type' => 'password', + 'required'=>"required", + 'class'=>"form-control", + ); + $this->data['first_name'] = array( + 'name' => 'first_name', + 'id' => 'first_name', + 'type' => 'text', + 'required'=>"required", + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('first_name'), + ); + $this->data['last_name'] = array( + 'name' => 'last_name', + 'id' => 'last_name', + 'type' => 'text', + 'required'=>"required", + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('last_name'), + ); + $this->data['email'] = array( + 'name' => 'email', + 'id' => 'email', + 'type' => 'email', + 'required'=>"required", + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('email'), + ); + + $this->data['phone'] = array( + 'name' => 'phone', + 'id' => 'phone', + 'required'=>"required", + 'type' => 'tel', + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('phone'), + ); + $this->data['password'] = array( + 'name' => 'password', + 'id' => 'password', + 'type' => 'password', + 'required'=>"required", + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('password'), + ); + $this->data['password_confirm'] = array( + 'name' => 'password_confirm', + 'id' => 'password_confirm', + 'type' => 'password', + 'required'=>"required", + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('password_confirm'), + ); + + $this->_render_page('auth/login', $this->data); + } + } + + //log the user out + function logout() + { + $this->_logged_in(); + $this->ion_auth->logout(); + $this->session->set_flashdata('msg_success_left', $this->ion_auth->messages()); + redirect('user/login', 'refresh'); + } + + + + //forgot password + function forgot_password() + { + $this->form_validation->set_rules('email', $this->lang->line('forgot_password_validation_email_label'), 'required|valid_email'); + if ($this->form_validation->run() == false) + { + //setup the input + $this->data['email'] = array('name' => 'email', + 'id' => 'email', + 'required'=>"required", + 'class'=>"form-control", + 'style'=>"width:70%", + ); + + if ( $this->config->item('identity', 'ion_auth') == 'username' ){ + $this->data['identity_label'] = $this->lang->line('forgot_password_username_identity_label'); + } + else + { + $this->data['identity_label'] = $this->lang->line('forgot_password_email_identity_label'); + } + + //set any errors and display the form + $this->msg_error_right = (validation_errors()) ? validation_errors() : $this->session->flashdata('msg_error_right'); + $this->_render_page('auth/forgot_password', $this->data); + } + else + { + // get identity from username or email + if ( $this->config->item('identity', 'ion_auth') == 'username' ){ + $identity = $this->ion_auth->where('username', strtolower($this->input->post('email')))->users()->row(); + } + else + { + $identity = $this->ion_auth->where('email', strtolower($this->input->post('email')))->users()->row(); + } + if(empty($identity)) { + $this->ion_auth->set_message('forgot_password_email_not_found'); + $this->session->set_flashdata('msg_error_right', $this->ion_auth->messages()); + redirect("user/forgot_password", 'refresh'); + } + + //run the forgotten password method to email an activation code to the user + $forgotten = $this->ion_auth->forgotten_password($identity->{$this->config->item('identity', 'ion_auth')}); + + if ($forgotten) + { + //if there were no errors + $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); + redirect("user/login", 'refresh'); //we should display a confirmation page here instead of the login page + } + else + { + $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); + redirect("user/forgot_password", 'refresh'); + } + } + } + + //reset password - final step for forgotten password + public function reset_password($code = NULL) + { + if (!$code) + { + show_404(); + } + + $user = $this->ion_auth->forgotten_password_check($code); + + if ($user) + { + //if the code is valid then display the password reset form + + $this->form_validation->set_rules('new', $this->lang->line('reset_password_validation_new_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[new_confirm]'); + $this->form_validation->set_rules('new_confirm', $this->lang->line('reset_password_validation_new_password_confirm_label'), 'required'); + + if ($this->form_validation->run() == false) + { + //display the form + + //set the flash data error message if there is one + $this->msg_error_right = (validation_errors()) ? validation_errors() : $this->session->flashdata('msg_error_right'); + + $this->data['min_password_length'] = $this->config->item('min_password_length', 'ion_auth'); + $this->data['new_password'] = array( + 'name' => 'new', + 'id' => 'new', + 'type' => 'password', + 'pattern' => '^.{'.$this->data['min_password_length'].'}.*$', + ); + $this->data['new_password_confirm'] = array( + 'name' => 'new_confirm', + 'id' => 'new_confirm', + 'type' => 'password', + 'pattern' => '^.{'.$this->data['min_password_length'].'}.*$', + ); + $this->data['user_id'] = array( + 'name' => 'user_id', + 'id' => 'user_id', + 'type' => 'hidden', + 'value' => $user->id, + ); + $this->data['csrf'] = $this->_get_csrf_nonce(); + $this->data['code'] = $code; + + //render + $this->_render_page('auth/reset_password', $this->data); + } + else + { + // do we have a valid request? + if ($this->_valid_csrf_nonce() === FALSE || $user->id != $this->input->post('user_id')) + { + + //something fishy might be up + $this->ion_auth->clear_forgotten_password_code($code); + + show_error($this->lang->line('error_csrf')); + + } + else + { + // finally change the password + $identity = $user->{$this->config->item('identity', 'ion_auth')}; + + $change = $this->ion_auth->reset_password($identity, $this->input->post('new')); + + if ($change) + { + //if the password was successfully changed + $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); + $this->logout(); + } + else + { + $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); + redirect('user/reset_password/' . $code, 'refresh'); + } + } + } + } + else + { + //if the code is invalid then send them back to the forgot password page + $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); + redirect("auth/forgot_password", 'refresh'); + } + } + + + //activate the user + function activate($id, $code=false) + { + if ($code !== false) + { + $activation = $this->ion_auth->activate($id, $code); + } + else if ($this->ion_auth->is_admin()) + { + $activation = $this->ion_auth->activate($id); + } + + if ($activation) + { + //redirect them to the auth page + $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); + redirect("auth", 'refresh'); + } + else + { + //redirect them to the forgot password page + $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); + redirect("auth/forgot_password", 'refresh'); + } + } + + //deactivate the user + function deactivate($id = NULL) + { + $id = (int) $id; + + $this->load->library('form_validation'); + $this->form_validation->set_rules('confirm', $this->lang->line('deactivate_validation_confirm_label'), 'required'); + $this->form_validation->set_rules('id', $this->lang->line('deactivate_validation_user_id_label'), 'required|alpha_numeric'); + + if ($this->form_validation->run() == FALSE) + { + // insert csrf check + $this->data['csrf'] = $this->_get_csrf_nonce(); + $this->data['user'] = $this->ion_auth->user($id)->row(); + + $this->_render_page('auth/deactivate_user', $this->data); + } + else + { + // do we really want to deactivate? + if ($this->input->post('confirm') == 'yes') + { + // do we have a valid request? + if ($this->_valid_csrf_nonce() === FALSE || $id != $this->input->post('id')) + { + show_error($this->lang->line('error_csrf')); + } + + // do we have the right userlevel? + if ($this->ion_auth->logged_in() && $this->ion_auth->is_admin()) + { + $this->ion_auth->deactivate($id); + } + } + + //redirect them back to the auth page + redirect('user', 'refresh'); + } + } + + + + //create a new user + function register() + { + $this->data['title'] = "Create User"; + + if ($this->ion_auth->logged_in()) + { + redirect('user/profile', 'refresh'); + } + + $tables = $this->config->item('tables','ion_auth'); + + //validate form input + $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required|xss_clean'); + $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required|xss_clean'); + $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique['.$tables['users'].'.email]'); + $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'required|xss_clean'); + $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]'); + $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required'); + + if ($this->form_validation->run() == true) + { + $username = strtolower($this->input->post('first_name', true)) . ' ' . strtolower($this->input->post('last_name', true)); + $email = strtolower($this->input->post('email', true)); + $password = $this->input->post('password'); + $city_data = $this->_city(); + $additional_data = array( + 'first_name' => $this->input->post('first_name', true), + 'last_name' => $this->input->post('last_name', true), + 'country' => $city_data['country'], + 'state' => $city_data['state'], + 'city' => $city_data['city'], + 'sex' => $this->input->post('sex', true), + 'phone' => $this->input->post('phone', true), + ); + + + + } + if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data)) + { + //check to see if we are creating the user + //redirect them back to the admin page + $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); + redirect("user/login", 'refresh'); + } + else + { + //display the create user form + //set the flash data error message if there is one + $this->msg_error_right = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'))); + $this->data['identity'] = array('name' => 'identity', + 'id' => 'identity', + 'type' => 'email', + 'required'=>"required", + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('identity'), + ); + $this->data['first_name'] = array( + 'name' => 'first_name', + 'id' => 'first_name', + 'required'=>"required", + 'type' => 'text', + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('first_name'), + ); + $this->data['last_name'] = array( + 'name' => 'last_name', + 'id' => 'last_name', + 'required'=>"required", + 'type' => 'text', + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('last_name'), + ); + $this->data['email'] = array( + 'name' => 'email', + 'id' => 'email', + 'type' => 'text', + 'required'=>"required", + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('email'), + ); + + $this->data['phone'] = array( + 'name' => 'phone', + 'required'=>"required", + 'id' => 'phone', + 'type' => 'tel', + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('phone'), + ); + $this->data['password'] = array( + 'name' => 'password', + 'required'=>"required", + 'id' => 'password', + 'type' => 'password', + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('password'), + ); + $this->data['password_confirm'] = array( + 'name' => 'password_confirm', + 'required'=>"required", + 'id' => 'password_confirm', + 'type' => 'password', + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('password_confirm'), + ); + + $this->_render_page('auth/login', $this->data); + } + } + + //edit a user + function myinfo() + { + $this->_logged_in(); + + $id = $this->ion_auth->user()->row()->id; + $user = $this->ion_auth->user()->row(); + $groups=$this->ion_auth->groups()->result_array(); + $currentGroups = $this->ion_auth->get_users_groups($id)->result(); + + //validate form input + $this->form_validation->set_rules('first_name', $this->lang->line('edit_user_validation_fname_label'), 'required|xss_clean'); + $this->form_validation->set_rules('last_name', $this->lang->line('edit_user_validation_lname_label'), 'required|xss_clean'); + $this->form_validation->set_rules('phone', $this->lang->line('edit_user_validation_phone_label'), 'required|xss_clean'); + + $this->form_validation->set_rules('groups', $this->lang->line('edit_user_validation_groups_label'), 'xss_clean'); + + if (isset($_POST) && !empty($_POST)) + { + // do we have a valid request? + if ($this->_valid_csrf_nonce() === FALSE || $id != $this->input->post('id')) + { + show_error($this->lang->line('error_csrf')); + } + + $data = array( + 'first_name' => $this->input->post('first_name', true), + 'last_name' => $this->input->post('last_name', true), + 'phone' => $this->input->post('phone', true), + ); + + // Only allow updating groups if user is admin + if ($this->ion_auth->is_admin()) + { + //Update the groups user belongs to + $groupData = $this->input->post('groups', true); + + if (isset($groupData) && !empty($groupData)) { + + $this->ion_auth->remove_from_group('', $id); + + foreach ($groupData as $grp) { + $this->ion_auth->add_to_group($grp, $id); + } + + } + } + + //update the password if it was posted + if ($this->input->post('password')) + { + $this->form_validation->set_rules('password', $this->lang->line('edit_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]'); + $this->form_validation->set_rules('password_confirm', $this->lang->line('edit_user_validation_password_confirm_label'), 'required'); + + $data['password'] = $this->input->post('password'); + } + + if ($this->form_validation->run() === TRUE) + { + $this->ion_auth->update($user->id, $data); + + //check to see if we are creating the user + //redirect them back to the admin page + $this->session->set_flashdata('msg_success_right', 'Info Saved'); + redirect('user', 'refresh'); + } + } + + //display the edit user form + $this->data['csrf'] = $this->_get_csrf_nonce(); + + //set the flash data error message if there is one + $this->msg_error_right = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('msg_error_right'))); + + //pass the user to the view + $this->data['user'] = $user; + $this->data['groups'] = $groups; + $this->data['currentGroups'] = $currentGroups; + + $this->data['first_name'] = array( + 'name' => 'first_name', + 'id' => 'first_name', + 'type' => 'text', + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('first_name', $user->first_name), + ); + $this->data['last_name'] = array( + 'name' => 'last_name', + 'id' => 'last_name', + 'type' => 'text', + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('last_name', $user->last_name), + ); + + $this->data['phone'] = array( + 'name' => 'phone', + 'id' => 'phone', + 'type' => 'text', + 'class'=>"form-control", + 'value' => $this->form_validation->set_value('phone', $user->phone), + ); + + + $this->_render_page('auth/edit_user', $this->data); + } + + public function change_password() + { + $this->_logged_in(); + $this->form_validation->set_rules('old', $this->lang->line('change_password_validation_old_password_label'), 'required'); + $this->form_validation->set_rules('new', $this->lang->line('change_password_validation_new_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[new_confirm]'); + $this->form_validation->set_rules('new_confirm', $this->lang->line('change_password_validation_new_password_confirm_label'), 'required'); + + + + $user = $this->ion_auth->user()->row(); + + if ($this->form_validation->run() == false) + { + //display the form + //set the flash data error message if there is one + $this->msg_error_right = (validation_errors()) ? validation_errors() : $this->session->flashdata('msg_error_right'); + + $this->data['min_password_length'] = $this->config->item('min_password_length', 'ion_auth'); + $this->data['old_password'] = array( + 'name' => 'old', + 'id' => 'old', + 'class'=>"form-control", + 'type' => 'password', + ); + $this->data['new_password'] = array( + 'name' => 'new', + 'id' => 'new', + 'class'=>"form-control", + 'type' => 'password', + 'pattern' => '^.{'.$this->data['min_password_length'].'}.*$', + ); + $this->data['new_password_confirm'] = array( + 'name' => 'new_confirm', + 'id' => 'new_confirm', + 'class'=>"form-control", + 'type' => 'password', + 'pattern' => '^.{'.$this->data['min_password_length'].'}.*$', + ); + $this->data['user_id'] = array( + 'name' => 'user_id', + 'id' => 'user_id', + 'type' => 'hidden', + 'value' => $user->id, + ); + + //render + $this->_render_page('change_password', $this->data); + } + else + { + $identity = $this->session->userdata('identity'); + + if (PH2DATE_DEMOMODE) // Stop that feature if it is on Demo mode + { + $this->session->set_flashdata('msg_error_right', "You can't change the password for the Demo!"); + redirect('user/change_password', 'refresh'); + } + else + { + $change = $this->ion_auth->change_password($identity, $this->input->post('old'), $this->input->post('new')); + + if ($change) + { + //if the password was successfully changed + $this->session->set_flashdata('msg_success_right', $this->ion_auth->messages()); + $this->logout(); + } + else + { + $this->session->set_flashdata('msg_error_right', $this->ion_auth->errors()); + redirect('user/change_password', 'refresh'); + } + } + } + } + + + + + function _get_csrf_nonce() + { + $this->load->helper('string'); + $key = random_string('alnum', 8); + $value = random_string('alnum', 20); + $this->session->set_flashdata('csrfkey', $key); + $this->session->set_flashdata('csrfvalue', $value); + + return array($key => $value); + } + + function _valid_csrf_nonce() + { + if ($this->input->post($this->session->flashdata('csrfkey')) !== FALSE && + $this->input->post($this->session->flashdata('csrfkey')) == $this->session->flashdata('csrfvalue')) + { + return TRUE; + } + else + { + return FALSE; + } + } + + function _render_page($view, $data=null, $render=false) + { + + $this->viewdata = (empty($data)) ? $this->data: $data; + + $view_html = $this->load->view($view, $this->viewdata, $render); + + if (!$render) return $view_html; + } + } \ No newline at end of file diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index f57c728..7bf3c66 100755 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -1,75 +1,75 @@ -load->library('ion_auth'); - $this->load->library('form_validation'); - $this->load->helper('url'); - $this->load->library('image_CRUD'); - $this->load->database(); - $this->form_validation->set_error_delimiters($this->config->item('error_start_delimiter', 'ion_auth'), $this->config->item('error_end_delimiter', 'ion_auth')); - $this->load->helper('language'); - $this->data['setting'] = $this->db->get('setting')->row(); - - - } - -} - -class Admin_Controller extends MY_Controller { - - public function __construct() { - - parent::__construct(); - $this->load->library('grocery_CRUD'); - if (!$this->ion_auth->is_admin() AND $this->uri->segment(2) != "login") { - redirect('admin/login', 'refresh'); - } - - $this->load->admin_theme('blue'); - } - -} - -class Website_Controller extends MY_Controller { - - - - public function __construct() { - parent::__construct(); - $site_lang = $this->session->userdata('site_lang'); - if ($site_lang) { - $this->lang->load('website',$this->session->userdata('site_lang')); - $this->lang->load('auth',$this->session->userdata('site_lang')); - } else { - $this->lang->load('website','english'); - $this->lang->load('auth','english'); - } - $this->load->helper('language'); - - $newdata['template_site'] = $this->input->get('theme'); - if ($newdata['template_site']) { - $this->session->set_userdata($newdata); - redirect(current_url()); - } - $current_template= ($this->session->userdata('template_site')) ? $this->session->userdata('template_site') : $this->config->item('website_template'); - - - $this->load->site_theme($current_template); - $this->current_template_url = base_url("templates/website/".$current_template).'/'; - - $this->data['pages'] = $this->db->get('page')->result(); - $this->msg_error_left = $this->session->flashdata('msg_error_left'); - $this->msg_error_right = $this->session->flashdata('msg_error_right'); - $this->msg_success_left = $this->session->flashdata('msg_success_left'); - $this->msg_success_right = $this->session->flashdata('msg_success_right'); - } +load->library('ion_auth'); + $this->load->library('form_validation'); + $this->load->helper('url'); + $this->load->library('image_CRUD'); + $this->load->database(); + $this->form_validation->set_error_delimiters($this->config->item('error_start_delimiter', 'ion_auth'), $this->config->item('error_end_delimiter', 'ion_auth')); + $this->load->helper('language'); + $this->data['setting'] = $this->db->get('setting')->row(); + + + } + +} + +class Admin_Controller extends MY_Controller { + + public function __construct() { + + parent::__construct(); + $this->load->library('grocery_CRUD'); + if (!$this->ion_auth->is_admin() AND $this->uri->segment(2) != "login") { + redirect('admin/login', 'refresh'); + } + + $this->load->admin_theme('blue'); + } + +} + +class Website_Controller extends MY_Controller { + + + + public function __construct() { + parent::__construct(); + $site_lang = $this->session->userdata('site_lang'); + if ($site_lang) { + $this->lang->load('website',$this->session->userdata('site_lang')); + $this->lang->load('auth',$this->session->userdata('site_lang')); + } else { + $this->lang->load('website','english'); + $this->lang->load('auth','english'); + } + $this->load->helper('language'); + + $newdata['template_site'] = $this->input->get('theme'); + if ($newdata['template_site']) { + $this->session->set_userdata($newdata); + redirect(current_url()); + } + $current_template= ($this->session->userdata('template_site')) ? $this->session->userdata('template_site') : $this->config->item('website_template'); + + + $this->load->site_theme($current_template); + $this->current_template_url = base_url("templates/website/".$current_template).'/'; + + $this->data['pages'] = $this->db->get('page')->result(); + $this->msg_error_left = $this->session->flashdata('msg_error_left'); + $this->msg_error_right = $this->session->flashdata('msg_error_right'); + $this->msg_success_left = $this->session->flashdata('msg_success_left'); + $this->msg_success_right = $this->session->flashdata('msg_success_right'); + } } \ No newline at end of file diff --git a/application/core/MY_Loader.php b/application/core/MY_Loader.php index 5eb7c09..24b54b0 100755 --- a/application/core/MY_Loader.php +++ b/application/core/MY_Loader.php @@ -1,40 +1,40 @@ -_ci_view_paths = array(FCPATH.'templates/' => TRUE); - } - - function site_theme($template = '') { - if ($template == '') { - return FALSE; - } else { - $this->template = 'website/' . $template; - return TRUE; - } - } - - function admin_theme($template = '') { - if ($template == '') { - return FALSE; - } else { - $this->template = 'adminpanel/' . $template; - return TRUE; - } - } - - public function view($view, $vars = array(), $return = FALSE) { - if ($this->template != '') { - return $this->_ci_load(array('_ci_view' => $this->template . '/' . $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); - } else { - return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); - } - } +_ci_view_paths = array(FCPATH.'templates/' => TRUE); + } + + function site_theme($template = '') { + if ($template == '') { + return FALSE; + } else { + $this->template = 'website/' . $template; + return TRUE; + } + } + + function admin_theme($template = '') { + if ($template == '') { + return FALSE; + } else { + $this->template = 'adminpanel/' . $template; + return TRUE; + } + } + + public function view($view, $vars = array(), $return = FALSE) { + if ($this->template != '') { + return $this->_ci_load(array('_ci_view' => $this->template . '/' . $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); + } else { + return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); + } + } } \ No newline at end of file diff --git a/application/core/index.html b/application/core/index.html index 065d2da..04e928c 100755 --- a/application/core/index.html +++ b/application/core/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/errors/error_404.php b/application/errors/error_404.php index ca22ddc..83a0136 100755 --- a/application/errors/error_404.php +++ b/application/errors/error_404.php @@ -1,62 +1,62 @@ - - - -404 Page Not Found - - - -
-

- -
- + + + +404 Page Not Found + + + +
+

+ +
+ \ No newline at end of file diff --git a/application/errors/error_db.php b/application/errors/error_db.php index 288196f..d901c0b 100755 --- a/application/errors/error_db.php +++ b/application/errors/error_db.php @@ -1,62 +1,62 @@ - - - -Database Error - - - -
-

- -
- + + + +Database Error + + + +
+

+ +
+ \ No newline at end of file diff --git a/application/errors/error_general.php b/application/errors/error_general.php index 380484c..16b9350 100755 --- a/application/errors/error_general.php +++ b/application/errors/error_general.php @@ -1,62 +1,62 @@ - - - -Error - - - -
-

- -
- + + + +Error + + + +
+

+ +
+ \ No newline at end of file diff --git a/application/errors/error_php.php b/application/errors/error_php.php index f5941c9..f085c20 100755 --- a/application/errors/error_php.php +++ b/application/errors/error_php.php @@ -1,10 +1,10 @@ -
- -

A PHP Error was encountered

- -

Severity:

-

Message:

-

Filename:

-

Line Number:

- +
+ +

A PHP Error was encountered

+ +

Severity:

+

Message:

+

Filename:

+

Line Number:

+
\ No newline at end of file diff --git a/application/errors/index.html b/application/errors/index.html index 065d2da..04e928c 100755 --- a/application/errors/index.html +++ b/application/errors/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/helpers/index.html b/application/helpers/index.html index 065d2da..04e928c 100755 --- a/application/helpers/index.html +++ b/application/helpers/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/hooks/index.html b/application/hooks/index.html index 065d2da..04e928c 100755 --- a/application/hooks/index.html +++ b/application/hooks/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/index.html b/application/index.html index 065d2da..04e928c 100755 --- a/application/index.html +++ b/application/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/language/english/auth_lang.php b/application/language/english/auth_lang.php index 2ea6825..565f4a0 100755 --- a/application/language/english/auth_lang.php +++ b/application/language/english/auth_lang.php @@ -1,148 +1,148 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/language/english/ion_auth_lang.php b/application/language/english/ion_auth_lang.php index c426d47..c887dfd 100755 --- a/application/language/english/ion_auth_lang.php +++ b/application/language/english/ion_auth_lang.php @@ -1,73 +1,73 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/language/french/ion_auth_lang.php b/application/language/french/ion_auth_lang.php index 2995fed..eccc942 100755 --- a/application/language/french/ion_auth_lang.php +++ b/application/language/french/ion_auth_lang.php @@ -1,52 +1,52 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/libraries/Bcrypt.php b/application/libraries/Bcrypt.php index ffd0117..c9797ba 100755 --- a/application/libraries/Bcrypt.php +++ b/application/libraries/Bcrypt.php @@ -1,113 +1,113 @@ -7, 'salt_prefix'=>'$2y$')) { - - if(CRYPT_BLOWFISH != 1) { - throw new Exception("bcrypt not supported in this installation. See http://php.net/crypt"); - } - - $this->rounds = $params['rounds']; - $this->salt_prefix = $params['salt_prefix']; - } - - public function hash($input) { - $hash = crypt($input, $this->getSalt()); - - if(strlen($hash) > 13) - return $hash; - - return false; - } - - public function verify($input, $existingHash) { - $hash = crypt($input, $existingHash); - return $hash === $existingHash; - } - - private function getSalt() { - $salt = sprintf($this->salt_prefix.'%02d$', $this->rounds); - - $bytes = $this->getRandomBytes(16); - - $salt .= $this->encodeBytes($bytes); - - return $salt; - } - - private $randomState; - private function getRandomBytes($count) { - $bytes = ''; - - if(function_exists('openssl_random_pseudo_bytes') && - (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')) { // OpenSSL slow on Win - $bytes = openssl_random_pseudo_bytes($count); - } - - if($bytes === '' && @is_readable('/dev/urandom') && - ($hRand = @fopen('/dev/urandom', 'rb')) !== FALSE) { - $bytes = fread($hRand, $count); - fclose($hRand); - } - - if(strlen($bytes) < $count) { - $bytes = ''; - - if($this->randomState === null) { - $this->randomState = microtime(); - if(function_exists('getmypid')) { - $this->randomState .= getmypid(); - } - } - - for($i = 0; $i < $count; $i += 16) { - $this->randomState = md5(microtime() . $this->randomState); - - if (PHP_VERSION >= '5') { - $bytes .= md5($this->randomState, true); - } else { - $bytes .= pack('H*', md5($this->randomState)); - } - } - - $bytes = substr($bytes, 0, $count); - } - - return $bytes; - } - - private function encodeBytes($input) { - // The following is code from the PHP Password Hashing Framework - $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - - $output = ''; - $i = 0; - do { - $c1 = ord($input[$i++]); - $output .= $itoa64[$c1 >> 2]; - $c1 = ($c1 & 0x03) << 4; - if ($i >= 16) { - $output .= $itoa64[$c1]; - break; - } - - $c2 = ord($input[$i++]); - $c1 |= $c2 >> 4; - $output .= $itoa64[$c1]; - $c1 = ($c2 & 0x0f) << 2; - - $c2 = ord($input[$i++]); - $c1 |= $c2 >> 6; - $output .= $itoa64[$c1]; - $output .= $itoa64[$c2 & 0x3f]; - } while (1); - - return $output; - } -} - - -/***** End of BCrypt.php ***********/ +7, 'salt_prefix'=>'$2y$')) { + + if(CRYPT_BLOWFISH != 1) { + throw new Exception("bcrypt not supported in this installation. See http://php.net/crypt"); + } + + $this->rounds = $params['rounds']; + $this->salt_prefix = $params['salt_prefix']; + } + + public function hash($input) { + $hash = crypt($input, $this->getSalt()); + + if(strlen($hash) > 13) + return $hash; + + return false; + } + + public function verify($input, $existingHash) { + $hash = crypt($input, $existingHash); + return $hash === $existingHash; + } + + private function getSalt() { + $salt = sprintf($this->salt_prefix.'%02d$', $this->rounds); + + $bytes = $this->getRandomBytes(16); + + $salt .= $this->encodeBytes($bytes); + + return $salt; + } + + private $randomState; + private function getRandomBytes($count) { + $bytes = ''; + + if(function_exists('openssl_random_pseudo_bytes') && + (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')) { // OpenSSL slow on Win + $bytes = openssl_random_pseudo_bytes($count); + } + + if($bytes === '' && @is_readable('/dev/urandom') && + ($hRand = @fopen('/dev/urandom', 'rb')) !== FALSE) { + $bytes = fread($hRand, $count); + fclose($hRand); + } + + if(strlen($bytes) < $count) { + $bytes = ''; + + if($this->randomState === null) { + $this->randomState = microtime(); + if(function_exists('getmypid')) { + $this->randomState .= getmypid(); + } + } + + for($i = 0; $i < $count; $i += 16) { + $this->randomState = md5(microtime() . $this->randomState); + + if (PHP_VERSION >= '5') { + $bytes .= md5($this->randomState, true); + } else { + $bytes .= pack('H*', md5($this->randomState)); + } + } + + $bytes = substr($bytes, 0, $count); + } + + return $bytes; + } + + private function encodeBytes($input) { + // The following is code from the PHP Password Hashing Framework + $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + + $output = ''; + $i = 0; + do { + $c1 = ord($input[$i++]); + $output .= $itoa64[$c1 >> 2]; + $c1 = ($c1 & 0x03) << 4; + if ($i >= 16) { + $output .= $itoa64[$c1]; + break; + } + + $c2 = ord($input[$i++]); + $c1 |= $c2 >> 4; + $output .= $itoa64[$c1]; + $c1 = ($c2 & 0x0f) << 2; + + $c2 = ord($input[$i++]); + $c1 |= $c2 >> 6; + $output .= $itoa64[$c1]; + $output .= $itoa64[$c2 & 0x3f]; + } while (1); + + return $output; + } +} + + +/***** End of BCrypt.php ***********/ diff --git a/application/libraries/Grocery_CRUD.php b/application/libraries/Grocery_CRUD.php index 0c2d507..23a5c29 100755 --- a/application/libraries/Grocery_CRUD.php +++ b/application/libraries/Grocery_CRUD.php @@ -1,5364 +1,5364 @@ - - */ - -// ------------------------------------------------------------------------ - -/** - * grocery Field Types - * - * The types of the fields and the default reactions - * - * @package grocery CRUD - * @author John Skoumbourdis - * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt - * @link http://www.grocerycrud.com/documentation - */ -class grocery_CRUD_Field_Types -{ - /** - * Gets the field types of the main table. - * @return array - */ - public function get_field_types() - { - if ($this->field_types !== null) { - return $this->field_types; - } - - $types = array(); - foreach($this->basic_model->get_field_types_basic_table() as $field_info) - { - $field_info->required = !empty($this->required_fields) && in_array($field_info->name,$this->required_fields) ? true : false; - - $field_info->display_as = - isset($this->display_as[$field_info->name]) ? - $this->display_as[$field_info->name] : - ucfirst(str_replace("_"," ",$field_info->name)); - - if($this->change_field_type !== null && isset($this->change_field_type[$field_info->name])) - { - $field_type = $this->change_field_type[$field_info->name]; - - if (isset($this->relation[$field_info->name])) { - $field_info->crud_type = "relation_".$field_type->type; - } - elseif (isset($this->upload_fields[$field_info->name])) { - $field_info->crud_type = "upload_file_".$field_type->type; - } else { - $field_info->crud_type = $field_type->type; - $field_info->extras = $field_type->extras; - } - - $real_type = $field_info->crud_type; - } - elseif(isset($this->relation[$field_info->name])) - { - $real_type = 'relation'; - $field_info->crud_type = 'relation'; - } - elseif(isset($this->upload_fields[$field_info->name])) - { - $real_type = 'upload_file'; - $field_info->crud_type = 'upload_file'; - } - else - { - $real_type = $this->get_type($field_info); - $field_info->crud_type = $real_type; - } - - switch ($real_type) { - case 'text': - if(!empty($this->unset_texteditor) && in_array($field_info->name,$this->unset_texteditor)) - $field_info->extras = false; - else - $field_info->extras = 'text_editor'; - break; - - case 'relation': - case 'relation_readonly': - $field_info->extras = $this->relation[$field_info->name]; - break; - - case 'upload_file': - case 'upload_file_readonly': - $field_info->extras = $this->upload_fields[$field_info->name]; - break; - - default: - if(empty($field_info->extras)) - $field_info->extras = false; - break; - } - - $types[$field_info->name] = $field_info; - } - - if(!empty($this->relation_n_n)) - { - foreach($this->relation_n_n as $field_name => $field_extras) - { - $is_read_only = $this->change_field_type !== null - && isset($this->change_field_type[$field_name]) - && $this->change_field_type[$field_name]->type == 'readonly' - ? true : false; - $field_info = (object)array(); - $field_info->name = $field_name; - $field_info->crud_type = $is_read_only ? 'readonly' : 'relation_n_n'; - $field_info->extras = $field_extras; - $field_info->required = !empty($this->required_fields) && in_array($field_name,$this->required_fields) ? true : false;; - $field_info->display_as = - isset($this->display_as[$field_name]) ? - $this->display_as[$field_name] : - ucfirst(str_replace("_"," ",$field_name)); - - $types[$field_name] = $field_info; - } - } - - if(!empty($this->add_fields)) - foreach($this->add_fields as $field_object) - { - $field_name = isset($field_object->field_name) ? $field_object->field_name : $field_object; - - if(!isset($types[$field_name]))//Doesn't exist in the database? Create it for the CRUD - { - $extras = false; - if($this->change_field_type !== null && isset($this->change_field_type[$field_name])) - { - $field_type = $this->change_field_type[$field_name]; - $extras = $field_type->extras; - } - - $field_info = (object)array( - 'name' => $field_name, - 'crud_type' => $this->change_field_type !== null && isset($this->change_field_type[$field_name]) ? - $this->change_field_type[$field_name]->type : - 'string', - 'display_as' => isset($this->display_as[$field_name]) ? - $this->display_as[$field_name] : - ucfirst(str_replace("_"," ",$field_name)), - 'required' => in_array($field_name,$this->required_fields) ? true : false, - 'extras' => $extras - ); - - $types[$field_name] = $field_info; - } - } - - if(!empty($this->edit_fields)) - foreach($this->edit_fields as $field_object) - { - $field_name = isset($field_object->field_name) ? $field_object->field_name : $field_object; - - if(!isset($types[$field_name]))//Doesn't exist in the database? Create it for the CRUD - { - $extras = false; - if($this->change_field_type !== null && isset($this->change_field_type[$field_name])) - { - $field_type = $this->change_field_type[$field_name]; - $extras = $field_type->extras; - } - - $field_info = (object)array( - 'name' => $field_name, - 'crud_type' => $this->change_field_type !== null && isset($this->change_field_type[$field_name]) ? - $this->change_field_type[$field_name]->type : - 'string', - 'display_as' => isset($this->display_as[$field_name]) ? - $this->display_as[$field_name] : - ucfirst(str_replace("_"," ",$field_name)), - 'required' => in_array($field_name,$this->required_fields) ? true : false, - 'extras' => $extras - ); - - $types[$field_name] = $field_info; - } - } - - $this->field_types = $types; - - return $this->field_types; - } - - public function get_primary_key() - { - return $this->basic_model->get_primary_key(); - } - - /** - * Get the html input for the specific field with the - * current value - * - * @param object $field_info - * @param string $value - * @return object - */ - protected function get_field_input($field_info, $value = null) - { - $real_type = $field_info->crud_type; - - $types_array = array( - 'integer', - 'text', - 'true_false', - 'string', - 'date', - 'datetime', - 'enum', - 'set', - 'relation', - 'relation_readonly', - 'relation_n_n', - 'upload_file', - 'upload_file_readonly', - 'hidden', - 'password', - 'readonly', - 'dropdown', - 'multiselect' - ); - - if (in_array($real_type,$types_array)) { - /* A quick way to go to an internal method of type $this->get_{type}_input . - * For example if the real type is integer then we will use the method - * $this->get_integer_input - * */ - $field_info->input = $this->{"get_".$real_type."_input"}($field_info,$value); - } - else - { - $field_info->input = $this->get_string_input($field_info,$value); - } - - return $field_info; - } - - protected function change_list_value($field_info, $value = null) - { - $real_type = $field_info->crud_type; - - switch ($real_type) { - case 'hidden': - case 'invisible': - case 'integer': - - break; - case 'true_false': - if(is_array($field_info->extras) && array_key_exists($value,$field_info->extras)) { - $value = $field_info->extras[$value]; - } else if(isset($this->default_true_false_text[$value])) { - $value = $this->default_true_false_text[$value]; - } - break; - case 'string': - $value = $this->character_limiter($value,$this->character_limiter,"..."); - break; - case 'text': - $value = $this->character_limiter(strip_tags($value),$this->character_limiter,"..."); - break; - case 'date': - if(!empty($value) && $value != '0000-00-00' && $value != '1970-01-01') - { - list($year,$month,$day) = explode("-",$value); - - $value = date($this->php_date_format, mktime (0, 0, 0, (int)$month , (int)$day , (int)$year)); - } - else - { - $value = ''; - } - break; - case 'datetime': - if(!empty($value) && $value != '0000-00-00 00:00:00' && $value != '1970-01-01 00:00:00') - { - list($year,$month,$day) = explode("-",$value); - list($hours,$minutes) = explode(":",substr($value,11)); - - $value = date($this->php_date_format." - H:i", mktime ((int)$hours , (int)$minutes , 0, (int)$month , (int)$day ,(int)$year)); - } - else - { - $value = ''; - } - break; - case 'enum': - $value = $this->character_limiter($value,$this->character_limiter,"..."); - break; - - case 'multiselect': - $value_as_array = array(); - foreach(explode(",",$value) as $row_value) - { - $value_as_array[] = array_key_exists($row_value,$field_info->extras) ? $field_info->extras[$row_value] : $row_value; - } - $value = implode(",",$value_as_array); - break; - - case 'relation_n_n': - $value = $this->character_limiter(str_replace(',',', ',$value),$this->character_limiter,"..."); - break; - - case 'password': - $value = '******'; - break; - - case 'dropdown': - $value = array_key_exists($value,$field_info->extras) ? $field_info->extras[$value] : $value; - break; - - case 'upload_file': - if(empty($value)) - { - $value = ""; - } - else - { - $is_image = !empty($value) && - ( substr($value,-4) == '.jpg' - || substr($value,-4) == '.png' - || substr($value,-5) == '.jpeg' - || substr($value,-4) == '.gif' - || substr($value,-5) == '.tiff') - ? true : false; - - $file_url = base_url().$field_info->extras->upload_path."/$value"; - - $file_url_anchor = ''; - } - else - { - $file_url_anchor .= ' target="_blank">'.$this->character_limiter($value,$this->character_limiter,'...',true); - } - $file_url_anchor .= ''; - - $value = $file_url_anchor; - } - break; - - default: - $value = $this->character_limiter($value,$this->character_limiter,"..."); - break; - } - - return $value; - } - - /** - * Character Limiter of codeigniter (I just don't want to load the helper ) - * - * Limits the string based on the character count. Preserves complete words - * so the character count may not be exactly as specified. - * - * @access public - * @param string - * @param integer - * @param string the end character. Usually an ellipsis - * @return string - */ - function character_limiter($str, $n = 500, $end_char = '…') - { - if (strlen($str) < $n) - { - return $str; - } - - // a bit complicated, but faster than preg_replace with \s+ - $str = preg_replace('/ {2,}/', ' ', str_replace(array("\r", "\n", "\t", "\x0B", "\x0C"), ' ', $str)); - - if (strlen($str) <= $n) - { - return $str; - } - - $out = ''; - foreach (explode(' ', trim($str)) as $val) - { - $out .= $val.' '; - - if (strlen($out) >= $n) - { - $out = trim($out); - return (strlen($out) === strlen($str)) ? $out : $out.$end_char; - } - } - } - - protected function get_type($db_type) - { - $type = false; - if(!empty($db_type->type)) - { - switch ($db_type->type) { - case '1': - case '3': - case 'int': - case 'tinyint': - case 'mediumint': - case 'longint': - if( $db_type->db_type == 'tinyint' && $db_type->db_max_length == 1) - $type = 'true_false'; - else - $type = 'integer'; - break; - case '254': - case 'string': - case 'enum': - if($db_type->db_type != 'enum') - $type = 'string'; - else - $type = 'enum'; - break; - case 'set': - if($db_type->db_type != 'set') - $type = 'string'; - else - $type = 'set'; - break; - case '252': - case 'blob': - case 'text': - case 'mediumtext': - case 'longtext': - $type = 'text'; - break; - case '10': - case 'date': - $type = 'date'; - break; - case '12': - case 'datetime': - case 'timestamp': - $type = 'datetime'; - break; - } - } - return $type; - } -} - -// ------------------------------------------------------------------------ - -/** - * Grocery Model Driver - * - * Drives the model - I'ts so easy like you drive a bicycle :-) - * - * @package grocery CRUD - * @author John Skoumbourdis - * @version 1.4.1 - * @link http://www.grocerycrud.com/documentation - */ -class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types -{ - /** - * @var grocery_CRUD_Model - */ - public $basic_model = null; - - protected function set_default_Model() - { - $ci = &get_instance(); - $ci->load->model('grocery_CRUD_Model'); - - $this->basic_model = new grocery_CRUD_Model(); - } - - protected function get_total_results() - { - if(!empty($this->where)) - foreach($this->where as $where) - $this->basic_model->where($where[0],$where[1],$where[2]); - - if(!empty($this->or_where)) - foreach($this->or_where as $or_where) - $this->basic_model->or_where($or_where[0],$or_where[1],$or_where[2]); - - if(!empty($this->like)) - foreach($this->like as $like) - $this->basic_model->like($like[0],$like[1],$like[2]); - - if(!empty($this->or_like)) - foreach($this->or_like as $or_like) - $this->basic_model->or_like($or_like[0],$or_like[1],$or_like[2]); - - if(!empty($this->having)) - foreach($this->having as $having) - $this->basic_model->having($having[0],$having[1],$having[2]); - - if(!empty($this->or_having)) - foreach($this->or_having as $or_having) - $this->basic_model->or_having($or_having[0],$or_having[1],$or_having[2]); - - if(!empty($this->relation)) - foreach($this->relation as $relation) - $this->basic_model->join_relation($relation[0],$relation[1],$relation[2]); - - if(!empty($this->relation_n_n)) - { - $columns = $this->get_columns(); - foreach($columns as $column) - { - //Use the relation_n_n ONLY if the column is called . The set_relation_n_n are slow and it will make the table slower without any reason as we don't need those queries. - if(isset($this->relation_n_n[$column->field_name])) - { - $this->basic_model->set_relation_n_n_field($this->relation_n_n[$column->field_name]); - } - } - - } - - return $this->basic_model->get_total_results(); - } - - public function set_model($model_name) - { - $ci = &get_instance(); - $ci->load->model('grocery_CRUD_Model'); - - $ci->load->model($model_name); - - $temp = explode('/',$model_name); - krsort($temp); - foreach($temp as $t) - { - $real_model_name = $t; - break; - } - - $this->basic_model = $ci->$real_model_name; - } - - protected function set_ajax_list_queries($state_info = null) - { - if(!empty($state_info->per_page)) - { - if(empty($state_info->page) || !is_numeric($state_info->page) ) - $this->limit($state_info->per_page); - else - { - $limit_page = ( ($state_info->page-1) * $state_info->per_page ); - $this->limit($state_info->per_page, $limit_page); - } - } - - if(!empty($state_info->order_by)) - { - $this->order_by($state_info->order_by[0],$state_info->order_by[1]); - } - - if(!empty($state_info->search)) - { - if(!empty($this->relation)) - foreach($this->relation as $relation_name => $relation_values) - $temp_relation[$this->_unique_field_name($relation_name)] = $this->_get_field_names_to_search($relation_values); - - if($state_info->search->field !== null) - { - if(isset($temp_relation[$state_info->search->field])) - { - if(is_array($temp_relation[$state_info->search->field])) - foreach($temp_relation[$state_info->search->field] as $search_field) - $this->or_like($search_field , $state_info->search->text); - else - $this->like($temp_relation[$state_info->search->field] , $state_info->search->text); - } - elseif(isset($this->relation_n_n[$state_info->search->field])) - { - $escaped_text = $this->basic_model->escape_str($state_info->search->text); - $this->having($state_info->search->field." LIKE '%".$escaped_text."%'"); - } - else - { - $this->like($state_info->search->field , $state_info->search->text); - } - } - else - { - $columns = $this->get_columns(); - - $search_text = $state_info->search->text; - - if(!empty($this->where)) - foreach($this->where as $where) - $this->basic_model->having($where[0],$where[1],$where[2]); - - foreach($columns as $column) - { - if(isset($temp_relation[$column->field_name])) - { - if(is_array($temp_relation[$column->field_name])) - { - foreach($temp_relation[$column->field_name] as $search_field) - { - $this->or_like($search_field, $search_text); - } - } - else - { - $this->or_like($temp_relation[$column->field_name], $search_text); - } - } - elseif(isset($this->relation_n_n[$column->field_name])) - { - //@todo have a where for the relation_n_n statement - } - else - { - $this->or_like($column->field_name, $search_text); - } - } - } - } - } - - protected function table_exists($table_name = null) - { - if($this->basic_model->db_table_exists($table_name)) - return true; - return false; - } - - protected function get_relation_array($relation_info, $primary_key_value = null, $limit = null) - { - list($field_name , $related_table , $related_field_title, $where_clause, $order_by) = $relation_info; - - if($primary_key_value !== null) - { - $primary_key = $this->basic_model->get_primary_key($related_table); - - //A where clause with the primary key is enough to take the selected key row - $where_clause = array($primary_key => $primary_key_value); - } - - $relation_array = $this->basic_model->get_relation_array($field_name , $related_table , $related_field_title, $where_clause, $order_by, $limit); - - return $relation_array; - } - - protected function get_relation_total_rows($relation_info) - { - list($field_name , $related_table , $related_field_title, $where_clause) = $relation_info; - - $relation_array = $this->basic_model->get_relation_total_rows($field_name , $related_table , $related_field_title, $where_clause); - - return $relation_array; - } - - protected function db_insert_validation() - { - $validation_result = (object)array('success'=>false); - - $field_types = $this->get_field_types(); - $required_fields = $this->required_fields; - $unique_fields = $this->_unique_fields; - $add_fields = $this->get_add_fields(); - - if(!empty($required_fields)) - { - foreach($add_fields as $add_field) - { - $field_name = $add_field->field_name; - if(!isset($this->validation_rules[$field_name]) && in_array( $field_name, $required_fields) ) - { - $this->set_rules( $field_name, $field_types[$field_name]->display_as, 'required'); - } - } - } - - /** Checking for unique fields. If the field value is not unique then - * return a validation error straight away, if not continue... */ - if(!empty($unique_fields)) - { - $form_validation = $this->form_validation(); - - foreach($add_fields as $add_field) - { - $field_name = $add_field->field_name; - if(in_array( $field_name, $unique_fields) ) - { - $form_validation->set_rules( $field_name, - $field_types[$field_name]->display_as, - 'is_unique['.$this->basic_db_table.'.'.$field_name.']'); - } - } - - if(!$form_validation->run()) - { - $validation_result->error_message = $form_validation->error_string(); - $validation_result->error_fields = $form_validation->_error_array; - - return $validation_result; - } - } - - if(!empty($this->validation_rules)) - { - $form_validation = $this->form_validation(); - - $add_fields = $this->get_add_fields(); - - foreach($add_fields as $add_field) - { - $field_name = $add_field->field_name; - if(isset($this->validation_rules[$field_name])) - { - $rule = $this->validation_rules[$field_name]; - $form_validation->set_rules($rule['field'],$rule['label'],$rule['rules']); - } - } - - if($form_validation->run()) - { - $validation_result->success = true; - } - else - { - $validation_result->error_message = $form_validation->error_string(); - $validation_result->error_fields = $form_validation->_error_array; - } - } - else - { - $validation_result->success = true; - } - - return $validation_result; - } - - protected function form_validation() - { - if($this->form_validation === null) - { - $this->form_validation = new grocery_CRUD_Form_validation(); - $ci = &get_instance(); - $ci->load->library('form_validation'); - $ci->form_validation = $this->form_validation; - } - return $this->form_validation; - } - - protected function db_update_validation() - { - $validation_result = (object)array('success'=>false); - - $field_types = $this->get_field_types(); - $required_fields = $this->required_fields; - $unique_fields = $this->_unique_fields; - $edit_fields = $this->get_edit_fields(); - - if(!empty($required_fields)) - { - foreach($edit_fields as $edit_field) - { - $field_name = $edit_field->field_name; - if(!isset($this->validation_rules[$field_name]) && in_array( $field_name, $required_fields) ) - { - $this->set_rules( $field_name, $field_types[$field_name]->display_as, 'required'); - } - } - } - - - /** Checking for unique fields. If the field value is not unique then - * return a validation error straight away, if not continue... */ - if(!empty($unique_fields)) - { - $form_validation = $this->form_validation(); - - $form_validation_check = false; - - foreach($edit_fields as $edit_field) - { - $field_name = $edit_field->field_name; - if(in_array( $field_name, $unique_fields) ) - { - $state_info = $this->getStateInfo(); - $primary_key = $this->get_primary_key(); - $field_name_value = $_POST[$field_name]; - - $this->basic_model->where($primary_key,$state_info->primary_key); - $row = $this->basic_model->get_row(); - - if(!isset($row->$field_name)) { - throw new Exception("The field name doesn't exist in the database. ". - "Please use the unique fields only for fields ". - "that exist in the database"); - } - - $previous_field_name_value = $row->$field_name; - - if(!empty($previous_field_name_value) && $previous_field_name_value != $field_name_value) { - $form_validation->set_rules( $field_name, - $field_types[$field_name]->display_as, - 'is_unique['.$this->basic_db_table.'.'.$field_name.']'); - - $form_validation_check = true; - } - } - } - - if($form_validation_check && !$form_validation->run()) - { - $validation_result->error_message = $form_validation->error_string(); - $validation_result->error_fields = $form_validation->_error_array; - - return $validation_result; - } - } - - if(!empty($this->validation_rules)) - { - $form_validation = $this->form_validation(); - - $edit_fields = $this->get_edit_fields(); - - foreach($edit_fields as $edit_field) - { - $field_name = $edit_field->field_name; - if(isset($this->validation_rules[$field_name])) - { - $rule = $this->validation_rules[$field_name]; - $form_validation->set_rules($rule['field'],$rule['label'],$rule['rules']); - } - } - - if($form_validation->run()) - { - $validation_result->success = true; - } - else - { - $validation_result->error_message = $form_validation->error_string(); - $validation_result->error_fields = $form_validation->_error_array; - } - } - else - { - $validation_result->success = true; - } - - return $validation_result; - } - - protected function db_insert($state_info) - { - $validation_result = $this->db_insert_validation(); - - if($validation_result->success) - { - $post_data = $state_info->unwrapped_data; - - $add_fields = $this->get_add_fields(); - - if($this->callback_insert === null) - { - if($this->callback_before_insert !== null) - { - $callback_return = call_user_func($this->callback_before_insert, $post_data); - - if(!empty($callback_return) && is_array($callback_return)) - $post_data = $callback_return; - elseif($callback_return === false) - return false; - } - - $insert_data = array(); - $types = $this->get_field_types(); - foreach($add_fields as $num_row => $field) - { - /* If the multiselect or the set is empty then the browser doesn't send an empty array. Instead it sends nothing */ - if(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect') && !isset($post_data[$field->field_name])) - { - $post_data[$field->field_name] = array(); - } - - if(isset($post_data[$field->field_name]) && !isset($this->relation_n_n[$field->field_name])) - { - if(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && is_array($post_data[$field->field_name]) && empty($post_data[$field->field_name])) - { - $insert_data[$field->field_name] = null; - } - elseif(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && $post_data[$field->field_name] === '') - { - $insert_data[$field->field_name] = null; - } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'date') - { - $insert_data[$field->field_name] = $this->_convert_date_to_sql_date($post_data[$field->field_name]); - } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'readonly') - { - //This empty if statement is to make sure that a readonly field will never inserted/updated - } - elseif(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect')) - { - $insert_data[$field->field_name] = !empty($post_data[$field->field_name]) ? implode(',',$post_data[$field->field_name]) : ''; - } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'datetime'){ - $insert_data[$field->field_name] = $this->_convert_date_to_sql_date(substr($post_data[$field->field_name],0,10)). - substr($post_data[$field->field_name],10); - } - else - { - $insert_data[$field->field_name] = $post_data[$field->field_name]; - } - } - } - - $insert_result = $this->basic_model->db_insert($insert_data); - - if($insert_result !== false) - { - $insert_primary_key = $insert_result; - } - else - { - return false; - } - - if(!empty($this->relation_n_n)) - { - foreach($this->relation_n_n as $field_name => $field_info) - { - $relation_data = isset( $post_data[$field_name] ) ? $post_data[$field_name] : array() ; - $this->db_relation_n_n_update($field_info, $relation_data ,$insert_primary_key); - } - } - - if($this->callback_after_insert !== null) - { - $callback_return = call_user_func($this->callback_after_insert, $post_data, $insert_primary_key); - - if($callback_return === false) - { - return false; - } - - } - }else - { - $callback_return = call_user_func($this->callback_insert, $post_data); - - if($callback_return === false) - { - return false; - } - } - - if(isset($insert_primary_key)) - return $insert_primary_key; - else - return true; - } - - return false; - - } - - protected function db_update($state_info) - { - $validation_result = $this->db_update_validation(); - - $edit_fields = $this->get_edit_fields(); - - if($validation_result->success) - { - $post_data = $state_info->unwrapped_data; - $primary_key = $state_info->primary_key; - - if($this->callback_update === null) - { - if($this->callback_before_update !== null) - { - $callback_return = call_user_func($this->callback_before_update, $post_data, $primary_key); - - if(!empty($callback_return) && is_array($callback_return)) - { - $post_data = $callback_return; - } - elseif($callback_return === false) - { - return false; - } - - } - - $update_data = array(); - $types = $this->get_field_types(); - foreach($edit_fields as $num_row => $field) - { - /* If the multiselect or the set is empty then the browser doesn't send an empty array. Instead it sends nothing */ - if(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect') && !isset($post_data[$field->field_name])) - { - $post_data[$field->field_name] = array(); - } - - if(isset($post_data[$field->field_name]) && !isset($this->relation_n_n[$field->field_name])) - { - if(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && is_array($post_data[$field->field_name]) && empty($post_data[$field->field_name])) - { - $update_data[$field->field_name] = null; - } - elseif(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && $post_data[$field->field_name] === '') - { - $update_data[$field->field_name] = null; - } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'date') - { - $update_data[$field->field_name] = $this->_convert_date_to_sql_date($post_data[$field->field_name]); - } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'readonly') - { - //This empty if statement is to make sure that a readonly field will never inserted/updated - } - elseif(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect')) - { - $update_data[$field->field_name] = !empty($post_data[$field->field_name]) ? implode(',',$post_data[$field->field_name]) : ''; - } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'datetime'){ - $update_data[$field->field_name] = $this->_convert_date_to_sql_date(substr($post_data[$field->field_name],0,10)). - substr($post_data[$field->field_name],10); - } - else - { - $update_data[$field->field_name] = $post_data[$field->field_name]; - } - } - } - - if($this->basic_model->db_update($update_data, $primary_key) === false) - { - return false; - } - - if(!empty($this->relation_n_n)) - { - foreach($this->relation_n_n as $field_name => $field_info) - { - if ( $this->unset_edit_fields !== null - && is_array($this->unset_edit_fields) - && in_array($field_name,$this->unset_edit_fields) - ) { - continue; - } - - $relation_data = isset( $post_data[$field_name] ) ? $post_data[$field_name] : array() ; - $this->db_relation_n_n_update($field_info, $relation_data ,$primary_key); - } - } - - if($this->callback_after_update !== null) - { - $callback_return = call_user_func($this->callback_after_update, $post_data, $primary_key); - - if($callback_return === false) - { - return false; - } - - } - } - else - { - $callback_return = call_user_func($this->callback_update, $post_data, $primary_key); - - if($callback_return === false) - { - return false; - } - } - - return true; - } - else - { - return false; - } - } - - protected function _convert_date_to_sql_date($date) - { - $date = substr($date,0,10); - if(preg_match('/\d{4}-\d{2}-\d{2}/',$date)) - { - //If it's already a sql-date don't convert it! - return $date; - }elseif(empty($date)) - { - return ''; - } - - $date_array = preg_split( '/[-\.\/ ]/', $date); - if($this->php_date_format == 'd/m/Y') - { - $sql_date = date('Y-m-d',mktime(0,0,0,$date_array[1],$date_array[0],$date_array[2])); - } - elseif($this->php_date_format == 'm/d/Y') - { - $sql_date = date('Y-m-d',mktime(0,0,0,$date_array[0],$date_array[1],$date_array[2])); - } - else - { - $sql_date = $date; - } - - return $sql_date; - } - - protected function _get_field_names_to_search(array $relation_values) - { - if(!strstr($relation_values[2],'{')) - return $this->_unique_join_name($relation_values[0]).'.'.$relation_values[2]; - else - { - $relation_values[2] = ' '.$relation_values[2].' '; - $temp1 = explode('{',$relation_values[2]); - unset($temp1[0]); - - $field_names_array = array(); - foreach($temp1 as $field) - list($field_names_array[]) = explode('}',$field); - - return $field_names_array; - } - } - - protected function _unique_join_name($field_name) - { - return 'j'.substr(md5($field_name),0,8); //This j is because is better for a string to begin with a letter and not a number - } - - protected function _unique_field_name($field_name) - { - return 's'.substr(md5($field_name),0,8); //This s is because is better for a string to begin with a letter and not a number - } - - protected function db_delete($state_info) - { - $primary_key = $state_info->primary_key; - - if($this->callback_delete === null) - { - if($this->callback_before_delete !== null) - { - $callback_return = call_user_func($this->callback_before_delete, $primary_key); - - if($callback_return === false) - { - return false; - } - - } - - if(!empty($this->relation_n_n)) - { - foreach($this->relation_n_n as $field_name => $field_info) - { - $this->db_relation_n_n_delete( $field_info, $primary_key ); - } - } - - $delete_result = $this->basic_model->db_delete($primary_key); - - if($delete_result === false) - { - return false; - } - - if($this->callback_after_delete !== null) - { - $callback_return = call_user_func($this->callback_after_delete, $primary_key); - - if($callback_return === false) - { - return false; - } - - } - } - else - { - $callback_return = call_user_func($this->callback_delete, $primary_key); - - if($callback_return === false) - { - return false; - } - } - - return true; - } - - protected function db_relation_n_n_update($field_info, $post_data , $primary_key_value) - { - $this->basic_model->db_relation_n_n_update($field_info, $post_data , $primary_key_value); - } - - protected function db_relation_n_n_delete($field_info, $primary_key_value) - { - $this->basic_model->db_relation_n_n_delete($field_info, $primary_key_value); - } - - protected function get_list() - { - if(!empty($this->order_by)) - $this->basic_model->order_by($this->order_by[0],$this->order_by[1]); - - if(!empty($this->where)) - foreach($this->where as $where) - $this->basic_model->where($where[0],$where[1],$where[2]); - - if(!empty($this->or_where)) - foreach($this->or_where as $or_where) - $this->basic_model->or_where($or_where[0],$or_where[1],$or_where[2]); - - if(!empty($this->like)) - foreach($this->like as $like) - $this->basic_model->like($like[0],$like[1],$like[2]); - - if(!empty($this->or_like)) - foreach($this->or_like as $or_like) - $this->basic_model->or_like($or_like[0],$or_like[1],$or_like[2]); - - if(!empty($this->having)) - foreach($this->having as $having) - $this->basic_model->having($having[0],$having[1],$having[2]); - - if(!empty($this->or_having)) - foreach($this->or_having as $or_having) - $this->basic_model->or_having($or_having[0],$or_having[1],$or_having[2]); - - if(!empty($this->relation)) - foreach($this->relation as $relation) - $this->basic_model->join_relation($relation[0],$relation[1],$relation[2]); - - if(!empty($this->relation_n_n)) - { - $columns = $this->get_columns(); - foreach($columns as $column) - { - //Use the relation_n_n ONLY if the column is called . The set_relation_n_n are slow and it will make the table slower without any reason as we don't need those queries. - if(isset($this->relation_n_n[$column->field_name])) - { - $this->basic_model->set_relation_n_n_field($this->relation_n_n[$column->field_name]); - } - } - - } - - if($this->theme_config['crud_paging'] === true) - { - if($this->limit === null) - { - $default_per_page = $this->config->default_per_page; - if(is_numeric($default_per_page) && $default_per_page >1) - { - $this->basic_model->limit($default_per_page); - } - else - { - $this->basic_model->limit(10); - } - } - else - { - $this->basic_model->limit($this->limit[0],$this->limit[1]); - } - } - - $results = $this->basic_model->get_list(); - - return $results; - } - - protected function get_edit_values($primary_key_value) - { - $values = $this->basic_model->get_edit_values($primary_key_value); - - if(!empty($this->relation_n_n)) - { - foreach($this->relation_n_n as $field_name => $field_info) - { - $values->$field_name = $this->get_relation_n_n_selection_array($primary_key_value, $field_info); - } - } - - return $values; - } - - protected function get_relation_n_n_selection_array($primary_key_value, $field_info) - { - return $this->basic_model->get_relation_n_n_selection_array($primary_key_value, $field_info); - } - - protected function get_relation_n_n_unselected_array($field_info, $selected_values) - { - return $this->basic_model->get_relation_n_n_unselected_array($field_info, $selected_values); - } - - protected function set_basic_db_table($table_name = null) - { - $this->basic_model->set_basic_table($table_name); - } - - protected function upload_file($state_info) - { - if(isset($this->upload_fields[$state_info->field_name]) ) - { - if($this->callback_upload === null) - { - if($this->callback_before_upload !== null) - { - $callback_before_upload_response = call_user_func($this->callback_before_upload, $_FILES, $this->upload_fields[$state_info->field_name]); - - if($callback_before_upload_response === false) - return false; - elseif(is_string($callback_before_upload_response)) - return $callback_before_upload_response; - } - - $upload_info = $this->upload_fields[$state_info->field_name]; - - header('Pragma: no-cache'); - header('Cache-Control: private, no-cache'); - header('Content-Disposition: inline; filename="files.json"'); - header('X-Content-Type-Options: nosniff'); - header('Access-Control-Allow-Origin: *'); - header('Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE'); - header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size'); - - $allowed_files = $this->config->file_upload_allow_file_types; - $reg_exp = '/(\\.|\\/)('.$allowed_files.')$/i'; - - $max_file_size_ui = $this->config->file_upload_max_file_size; - $max_file_size_bytes = $this->_convert_bytes_ui_to_bytes($max_file_size_ui); - - $options = array( - 'upload_dir' => $upload_info->upload_path.'/', - 'param_name' => $this->_unique_field_name($state_info->field_name), - 'upload_url' => base_url().$upload_info->upload_path.'/', - 'accept_file_types' => $reg_exp, - 'max_file_size' => $max_file_size_bytes - ); - $upload_handler = new UploadHandler($options); - $upload_handler->default_config_path = $this->default_config_path; - $uploader_response = $upload_handler->post(); - - if(is_array($uploader_response)) - { - foreach($uploader_response as &$response) - { - unset($response->delete_url); - unset($response->delete_type); - } - } - - if($this->callback_after_upload !== null) - { - $callback_after_upload_response = call_user_func($this->callback_after_upload, $uploader_response , $this->upload_fields[$state_info->field_name] , $_FILES ); - - if($callback_after_upload_response === false) - return false; - elseif(is_string($callback_after_upload_response)) - return $callback_after_upload_response; - elseif(is_array($callback_after_upload_response)) - $uploader_response = $callback_after_upload_response; - } - - return $uploader_response; - } - else - { - $upload_response = call_user_func($this->callback_upload, $_FILES, $this->upload_fields[$state_info->field_name] ); - - if($upload_response === false) - { - return false; - } - else - { - return $upload_response; - } - } - } - else - { - return false; - } - } - - protected function delete_file($state_info) - { - - if(isset($state_info->field_name) && isset($this->upload_fields[$state_info->field_name])) - { - $upload_info = $this->upload_fields[$state_info->field_name]; - - if(file_exists("{$upload_info->upload_path}/{$state_info->file_name}")) - { - if( unlink("{$upload_info->upload_path}/{$state_info->file_name}") ) - { - $this->basic_model->db_file_delete($state_info->field_name, $state_info->file_name); - - return true; - } - else - { - return false; - } - } - else - { - $this->basic_model->db_file_delete($state_info->field_name, $state_info->file_name); - return true; - } - } - else - { - return false; - } - } - - protected function ajax_relation($state_info) - { - if(!isset($this->relation[$state_info->field_name])) - return false; - - list($field_name, $related_table, $related_field_title, $where_clause, $order_by) = $this->relation[$state_info->field_name]; - - return $this->basic_model->get_ajax_relation_array($state_info->search, $field_name, $related_table, $related_field_title, $where_clause, $order_by); - } -} - - -/** - * PHP grocery CRUD - * - * LICENSE - * - * Grocery CRUD is released with dual licensing, using the GPL v3 (license-gpl3.txt) and the MIT license (license-mit.txt). - * You don't have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. - * Please see the corresponding license file for details of these licenses. - * You are free to use, modify and distribute this software, but all copyright information must remain. - * - * @package grocery CRUD - * @copyright Copyright (c) 2010 through 2012, John Skoumbourdis - * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt - * @author John Skoumbourdis - */ - -// ------------------------------------------------------------------------ - -/** - * PHP grocery Layout - * - * Here you manage all the HTML Layout - * - * @package grocery CRUD - * @author John Skoumbourdis - * @version 1.4.1 - */ -class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver -{ - private $theme_path = null; - private $views_as_string = ''; - private $echo_and_die = false; - protected $theme = null; - protected $default_true_false_text = array('inactive' , 'active'); - - protected $css_files = array(); - protected $js_files = array(); - protected $js_lib_files = array(); - protected $js_config_files = array(); - - protected function set_basic_Layout() - { - if(!file_exists($this->theme_path.$this->theme.'/views/list_template.php')) - { - throw new Exception('The template does not exist. Please check your files and try again.', 12); - die(); - } - } - - protected function showList($ajax = false, $state_info = null) - { - $data = $this->get_common_data(); - - $data->order_by = $this->order_by; - - $data->types = $this->get_field_types(); - - $data->list = $this->get_list(); - $data->list = $this->change_list($data->list , $data->types); - $data->list = $this->change_list_add_actions($data->list); - - $data->total_results = $this->get_total_results(); - - $data->columns = $this->get_columns(); - - $data->success_message = $this->get_success_message_at_list($state_info); - - $data->primary_key = $this->get_primary_key(); - $data->add_url = $this->getAddUrl(); - $data->edit_url = $this->getEditUrl(); - $data->delete_url = $this->getDeleteUrl(); - $data->read_url = $this->getReadUrl(); - $data->ajax_list_url = $this->getAjaxListUrl(); - $data->ajax_list_info_url = $this->getAjaxListInfoUrl(); - $data->export_url = $this->getExportToExcelUrl(); - $data->print_url = $this->getPrintUrl(); - $data->actions = $this->actions; - $data->unique_hash = $this->get_method_hash(); - $data->order_by = $this->order_by; - - $data->unset_add = $this->unset_add; - $data->unset_edit = $this->unset_edit; - $data->unset_read = $this->unset_read; - $data->unset_delete = $this->unset_delete; - $data->unset_export = $this->unset_export; - $data->unset_print = $this->unset_print; - - $default_per_page = $this->config->default_per_page; - $data->paging_options = $this->config->paging_options; - $data->default_per_page = is_numeric($default_per_page) && $default_per_page >1 && in_array($default_per_page,$data->paging_options)? $default_per_page : 25; - - if($data->list === false) - { - throw new Exception('It is impossible to get data. Please check your model and try again.', 13); - $data->list = array(); - } - - foreach($data->list as $num_row => $row) - { - $data->list[$num_row]->edit_url = $data->edit_url.'/'.$row->{$data->primary_key}; - $data->list[$num_row]->delete_url = $data->delete_url.'/'.$row->{$data->primary_key}; - $data->list[$num_row]->read_url = $data->read_url.'/'.$row->{$data->primary_key}; - } - - if(!$ajax) - { - $this->_add_js_vars(array('dialog_forms' => $this->config->dialog_forms)); - - $data->list_view = $this->_theme_view('list.php',$data,true); - $this->_theme_view('list_template.php',$data); - } - else - { - $this->set_echo_and_die(); - $this->_theme_view('list.php',$data); - } - } - - protected function exportToExcel($state_info = null) - { - $data = $this->get_common_data(); - - $data->order_by = $this->order_by; - $data->types = $this->get_field_types(); - - $data->list = $this->get_list(); - $data->list = $this->change_list($data->list , $data->types); - $data->list = $this->change_list_add_actions($data->list); - - $data->total_results = $this->get_total_results(); - - $data->columns = $this->get_columns(); - $data->primary_key = $this->get_primary_key(); - - @ob_end_clean(); - $this->_export_to_excel($data); - } - - protected function _export_to_excel($data) - { - /** - * No need to use an external library here. The only bad thing without using external library is that Microsoft Excel is complaining - * that the file is in a different format than specified by the file extension. If you press "Yes" everything will be just fine. - * */ - - $string_to_export = ""; - foreach($data->columns as $column){ - $string_to_export .= $column->display_as."\t"; - } - $string_to_export .= "\n"; - - foreach($data->list as $num_row => $row){ - foreach($data->columns as $column){ - $string_to_export .= $this->_trim_export_string($row->{$column->field_name})."\t"; - } - $string_to_export .= "\n"; - } - - // Convert to UTF-16LE and Prepend BOM - $string_to_export = "\xFF\xFE" .mb_convert_encoding($string_to_export, 'UTF-16LE', 'UTF-8'); - - $filename = "export-".date("Y-m-d_H:i:s").".xls"; - - header('Content-type: application/vnd.ms-excel;charset=UTF-16LE'); - header('Content-Disposition: attachment; filename='.$filename); - header("Cache-Control: no-cache"); - echo $string_to_export; - die(); - } - - protected function print_webpage($state_info = null) - { - $data = $this->get_common_data(); - - $data->order_by = $this->order_by; - $data->types = $this->get_field_types(); - - $data->list = $this->get_list(); - $data->list = $this->change_list($data->list , $data->types); - $data->list = $this->change_list_add_actions($data->list); - - $data->total_results = $this->get_total_results(); - - $data->columns = $this->get_columns(); - $data->primary_key = $this->get_primary_key(); - - @ob_end_clean(); - $this->_print_webpage($data); - } - - protected function _print_webpage($data) - { - $string_to_print = ""; - $string_to_print .= ""; - - echo $string_to_print; - die(); - } - - protected function _trim_export_string($value) - { - $value = str_replace(array(" ","&",">","<"),array(" ","&",">","<"),$value); - return strip_tags(str_replace(array("\t","\n","\r"),"",$value)); - } - - protected function _trim_print_string($value) - { - $value = str_replace(array(" ","&",">","<"),array(" ","&",">","<"),$value); - - //If the value has only spaces and nothing more then add the whitespace html character - if(str_replace(" ","",$value) == "") - $value = " "; - - return strip_tags($value); - } - - protected function set_echo_and_die() - { - $this->echo_and_die = true; - } - - protected function unset_echo_and_die() - { - $this->echo_and_die = false; - } - - protected function showListInfo() - { - $this->set_echo_and_die(); - - $total_results = (int)$this->get_total_results(); - @ob_end_clean(); - echo json_encode(array('total_results' => $total_results)); - die(); - } - - protected function change_list_add_actions($list) - { - if(empty($this->actions)) - return $list; - - $primary_key = $this->get_primary_key(); - - foreach($list as $num_row => $row) - { - $actions_urls = array(); - foreach($this->actions as $unique_id => $action) - { - if(!empty($action->url_callback)) - { - $actions_urls[$unique_id] = call_user_func($action->url_callback, $row->$primary_key, $row); - } - else - { - $actions_urls[$unique_id] = - $action->url_has_http ? - $action->link_url.$row->$primary_key : - site_url($action->link_url.'/'.$row->$primary_key); - } - } - $row->action_urls = $actions_urls; - } - - return $list; - } - - protected function change_list($list,$types) - { - $primary_key = $this->get_primary_key(); - $has_callbacks = !empty($this->callback_column) ? true : false; - $output_columns = $this->get_columns(); - foreach($list as $num_row => $row) - { - foreach($output_columns as $column) - { - $field_name = $column->field_name; - $field_value = isset( $row->{$column->field_name} ) ? $row->{$column->field_name} : null; - if( $has_callbacks && isset($this->callback_column[$field_name]) ) - $list[$num_row]->$field_name = call_user_func($this->callback_column[$field_name], $field_value, $row); - elseif(isset($types[$field_name])) - $list[$num_row]->$field_name = $this->change_list_value($types[$field_name] , $field_value); - else - $list[$num_row]->$field_name = $field_value; - } - } - - return $list; - } - - protected function showAddForm() - { - $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY); - - $data = $this->get_common_data(); - $data->types = $this->get_field_types(); - - $data->list_url = $this->getListUrl(); - $data->insert_url = $this->getInsertUrl(); - $data->validation_url = $this->getValidationInsertUrl(); - $data->input_fields = $this->get_add_input_fields(); - - $data->fields = $this->get_add_fields(); - $data->hidden_fields = $this->get_add_hidden_fields(); - $data->unset_back_to_list = $this->unset_back_to_list; - $data->unique_hash = $this->get_method_hash(); - $data->is_ajax = $this->_is_ajax(); - - $this->_theme_view('add.php',$data); - $this->_inline_js("var js_date_format = '".$this->js_date_format."';"); - - $this->_get_ajax_results(); - } - - protected function showEditForm($state_info) - { - $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY); - - $data = $this->get_common_data(); - $data->types = $this->get_field_types(); - - $data->field_values = $this->get_edit_values($state_info->primary_key); - - $data->add_url = $this->getAddUrl(); - - $data->list_url = $this->getListUrl(); - $data->update_url = $this->getUpdateUrl($state_info); - $data->delete_url = $this->getDeleteUrl($state_info); - $data->read_url = $this->getReadUrl($state_info->primary_key); - $data->input_fields = $this->get_edit_input_fields($data->field_values); - $data->unique_hash = $this->get_method_hash(); - - $data->fields = $this->get_edit_fields(); - $data->hidden_fields = $this->get_edit_hidden_fields(); - $data->unset_back_to_list = $this->unset_back_to_list; - - $data->validation_url = $this->getValidationUpdateUrl($state_info->primary_key); - $data->is_ajax = $this->_is_ajax(); - - $this->_theme_view('edit.php',$data); - $this->_inline_js("var js_date_format = '".$this->js_date_format."';"); - - $this->_get_ajax_results(); - } - - protected function showReadForm($state_info) - { - $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY); - - $data = $this->get_common_data(); - $data->types = $this->get_field_types(); - - $data->field_values = $this->get_edit_values($state_info->primary_key); - - $data->add_url = $this->getAddUrl(); - - $data->list_url = $this->getListUrl(); - $data->update_url = $this->getUpdateUrl($state_info); - $data->delete_url = $this->getDeleteUrl($state_info); - $data->read_url = $this->getReadUrl($state_info->primary_key); - $data->input_fields = $this->get_read_input_fields($data->field_values); - $data->unique_hash = $this->get_method_hash(); - - $data->fields = $this->get_edit_fields(); - $data->hidden_fields = $this->get_edit_hidden_fields(); - $data->unset_back_to_list = $this->unset_back_to_list; - - $data->validation_url = $this->getValidationUpdateUrl($state_info->primary_key); - $data->is_ajax = $this->_is_ajax(); - - $this->_theme_view('read.php',$data); - $this->_inline_js("var js_date_format = '".$this->js_date_format."';"); - - $this->_get_ajax_results(); - } - - protected function delete_layout($delete_result = true) - { - @ob_end_clean(); - if($delete_result === false) - { - $error_message = '

'.$this->l('delete_error_message').'

'; - - echo json_encode(array('success' => $delete_result ,'error_message' => $error_message)); - } - else - { - $success_message = '

'.$this->l('delete_success_message').'

'; - - echo json_encode(array('success' => true , 'success_message' => $success_message)); - } - $this->set_echo_and_die(); - } - - protected function get_success_message_at_list($field_info = null) - { - if($field_info !== null && isset($field_info->success_message) && $field_info->success_message) - { - if(!empty($field_info->primary_key) && !$this->unset_edit) - { - return $this->l('insert_success_message')." ".$this->l('form_edit')." {$this->subject} "; - } - else - { - return $this->l('insert_success_message'); - } - } - else - { - return null; - } - } - - protected function insert_layout($insert_result = false) - { - @ob_end_clean(); - if($insert_result === false) - { - echo json_encode(array('success' => false)); - } - else - { - $success_message = '

'.$this->l('insert_success_message'); - - if(!$this->unset_back_to_list && !empty($insert_result) && !$this->unset_edit) - { - $success_message .= " ".$this->l('form_edit')." {$this->subject} "; - - if (!$this->_is_ajax()) { - $success_message .= $this->l('form_or'); - } - } - - if(!$this->unset_back_to_list && !$this->_is_ajax()) - { - $success_message .= " ".$this->l('form_go_back_to_list').""; - } - - $success_message .= '

'; - - echo ""; - } - $this->set_echo_and_die(); - } - - protected function validation_layout($validation_result) - { - @ob_end_clean(); - echo ""; - $this->set_echo_and_die(); - } - - protected function upload_layout($upload_result, $field_name) - { - @ob_end_clean(); - if($upload_result !== false && !is_string($upload_result) && empty($upload_result[0]->error)) - { - echo json_encode( - (object)array( - 'success' => true, - 'files' => $upload_result - )); - } - else - { - $result = (object)array('success' => false); - if(is_string($upload_result)) - $result->message = $upload_result; - if(!empty($upload_result[0]->error)) - $result->message = $upload_result[0]->error; - - echo json_encode($result); - } - - $this->set_echo_and_die(); - } - - protected function delete_file_layout($upload_result) - { - @ob_end_clean(); - if($upload_result !== false) - { - echo json_encode( (object)array( 'success' => true ) ); - } - else - { - echo json_encode((object)array('success' => false)); - } - - $this->set_echo_and_die(); - } - - public function set_css($css_file) - { - $this->css_files[sha1($css_file)] = base_url().$css_file; - } - - public function set_js($js_file) - { - $this->js_files[sha1($js_file)] = base_url().$js_file; - } - - public function set_js_lib($js_file) - { - $this->js_lib_files[sha1($js_file)] = base_url().$js_file; - $this->js_files[sha1($js_file)] = base_url().$js_file; - } - - public function set_js_config($js_file) - { - $this->js_config_files[sha1($js_file)] = base_url().$js_file; - $this->js_files[sha1($js_file)] = base_url().$js_file; - } - - public function is_IE7() - { - return isset($_SERVER['HTTP_USER_AGENT']) - && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false) - ? true : false; - } - - public function get_css_files() - { - return $this->css_files; - } - - public function get_js_files() - { - return $this->js_files; - } - - public function get_js_lib_files() - { - return $this->js_lib_files; - } - - public function get_js_config_files() - { - return $this->js_config_files; - } - - /** - * Load Javascripts - **/ - protected function load_js_fancybox() - { - $this->set_css($this->default_css_path.'/jquery_plugins/fancybox/jquery.fancybox.css'); - - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.fancybox-1.3.4.js'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.easing-1.3.pack.js'); - } - - protected function load_js_chosen() - { - $this->set_css($this->default_css_path.'/jquery_plugins/chosen/chosen.css'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.chosen.min.js'); - } - - protected function load_js_jqueryui() - { - $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); - } - - protected function load_js_uploader() - { - $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); - $this->set_css($this->default_css_path.'/jquery_plugins/file_upload/file-uploader.css'); - $this->set_css($this->default_css_path.'/jquery_plugins/file_upload/jquery.fileupload-ui.css'); - - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/tmpl.min.js'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/load-image.min.js'); - - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.iframe-transport.js'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.fileupload.js'); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.fileupload.config.js'); - } - - protected function get_layout() - { - $js_files = $this->get_js_files(); - $css_files = $this->get_css_files(); - - $js_lib_files = $this->get_js_lib_files(); - $js_config_files = $this->get_js_config_files(); - - if ($this->unset_jquery) { - unset($js_files[sha1($this->default_javascript_path.'/'.grocery_CRUD::JQUERY)]); - } - - if ($this->unset_jquery_ui) { - unset($css_files[sha1($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS)]); - unset($js_files[sha1($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS)]); - } - - if ($this->unset_bootstrap) { - unset($js_files[sha1($this->default_theme_path.'/twitter-bootstrap/js/libs/bootstrap/bootstrap.min.js')]); - unset($js_files[sha1($this->default_theme_path.'/twitter-bootstrap/js/libs/bootstrap/application.js')]); - unset($css_files[sha1($this->default_theme_path.'/twitter-bootstrap/css/bootstrap-responsive.min.css')]); - unset($css_files[sha1($this->default_theme_path.'/twitter-bootstrap/css/bootstrap.min.css')]); - } - - if($this->echo_and_die === false) - { - /** Initialize JavaScript variables */ - $js_vars = array( - 'default_javascript_path' => base_url().$this->default_javascript_path, - 'default_css_path' => base_url().$this->default_css_path, - 'default_texteditor_path' => base_url().$this->default_texteditor_path, - 'default_theme_path' => base_url().$this->default_theme_path, - 'base_url' => base_url() - ); - $this->_add_js_vars($js_vars); - - return (object)array( - 'js_files' => $js_files, - 'js_lib_files' => $js_lib_files, - 'js_config_files' => $js_config_files, - 'css_files' => $css_files, - 'output' => $this->views_as_string, - ); - } - elseif($this->echo_and_die === true) - { - echo $this->views_as_string; - die(); - } - } - - protected function update_layout($update_result = false, $state_info = null) - { - @ob_end_clean(); - if($update_result === false) - { - echo json_encode(array('success' => $update_result)); - } - else - { - $success_message = '

'.$this->l('update_success_message'); - if(!$this->unset_back_to_list && !$this->_is_ajax()) - { - $success_message .= " ".$this->l('form_go_back_to_list').""; - } - $success_message .= '

'; - - /* The textarea is only because of a BUG of the jquery form plugin with the combination of multipart forms */ - echo ""; - } - $this->set_echo_and_die(); - } - - protected function get_integer_input($field_info,$value) - { - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.numeric.min.js'); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.numeric.config.js'); - $extra_attributes = ''; - if(!empty($field_info->db_max_length)) - $extra_attributes .= "maxlength='{$field_info->db_max_length}'"; - $input = ""; - return $input; - } - - protected function get_true_false_input($field_info,$value) - { - $this->set_css($this->default_css_path.'/jquery_plugins/uniform/uniform.default.css'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.uniform.min.js'); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.uniform.config.js'); - - $value_is_null = empty($value) && $value !== '0' && $value !== 0 ? true : false; - - $input = "
"; - - $true_string = is_array($field_info->extras) && array_key_exists(1,$field_info->extras) ? $field_info->extras[1] : $this->default_true_false_text[1]; - $checked = $value === '1' || ($value_is_null && $field_info->default === '1') ? "checked = 'checked'" : ""; - $input .= " "; - - $false_string = is_array($field_info->extras) && array_key_exists(0,$field_info->extras) ? $field_info->extras[0] : $this->default_true_false_text[0]; - $checked = $value === '0' || ($value_is_null && $field_info->default === '0') ? "checked = 'checked'" : ""; - $input .= ""; - - $input .= "
"; - - return $input; - } - - protected function get_string_input($field_info,$value) - { - $value = !is_string($value) ? '' : str_replace('"',""",$value); - - $extra_attributes = ''; - if(!empty($field_info->db_max_length)) - $extra_attributes .= "maxlength='{$field_info->db_max_length}'"; - $input = ""; - return $input; - } - - protected function get_text_input($field_info,$value) - { - if($field_info->extras == 'text_editor') - { - $editor = $this->config->default_text_editor; - switch ($editor) { - case 'ckeditor': - $this->set_js_lib($this->default_texteditor_path.'/ckeditor/ckeditor.js'); - $this->set_js_lib($this->default_texteditor_path.'/ckeditor/adapters/jquery.js'); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.ckeditor.config.js'); - break; - - case 'tinymce': - $this->set_js_lib($this->default_texteditor_path.'/tiny_mce/jquery.tinymce.js'); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.tine_mce.config.js'); - break; - - case 'markitup': - $this->set_css($this->default_texteditor_path.'/markitup/skins/markitup/style.css'); - $this->set_css($this->default_texteditor_path.'/markitup/sets/default/style.css'); - - $this->set_js_lib($this->default_texteditor_path.'/markitup/jquery.markitup.js'); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.markitup.config.js'); - break; - } - - $class_name = $this->config->text_editor_type == 'minimal' ? 'mini-texteditor' : 'texteditor'; - - $input = ""; - } - else - { - $input = ""; - } - return $input; - } - - protected function get_datetime_input($field_info,$value) - { - $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); - $this->set_css($this->default_css_path.'/jquery_plugins/jquery.ui.datetime.css'); - $this->set_css($this->default_css_path.'/jquery_plugins/jquery-ui-timepicker-addon.css'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery-ui-timepicker-addon.js'); - - if($this->language !== 'english') - { - include($this->default_config_path.'/language_alias.php'); - if(array_key_exists($this->language, $language_alias)) - { - $i18n_date_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-'.$language_alias[$this->language].'.js'; - if(file_exists($i18n_date_js_file)) - { - $this->set_js_lib($i18n_date_js_file); - } - - $i18n_datetime_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-'.$language_alias[$this->language].'.js'; - if(file_exists($i18n_datetime_js_file)) - { - $this->set_js_lib($i18n_datetime_js_file); - } - } - } - - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery-ui-timepicker-addon.config.js'); - - if(!empty($value) && $value != '0000-00-00 00:00:00' && $value != '1970-01-01 00:00:00'){ - list($year,$month,$day) = explode('-',substr($value,0,10)); - $date = date($this->php_date_format, mktime(0,0,0,$month,$day,$year)); - $datetime = $date.substr($value,10); - } - else - { - $datetime = ''; - } - $input = " - ".$this->l('form_button_clear')." - ({$this->ui_date_format}) hh:mm:ss"; - return $input; - } - - protected function get_hidden_input($field_info,$value) - { - if($field_info->extras !== null && $field_info->extras != false) - $value = $field_info->extras; - $input = ""; - return $input; - } - - protected function get_password_input($field_info,$value) - { - $value = !is_string($value) ? '' : $value; - - $extra_attributes = ''; - if(!empty($field_info->db_max_length)) - $extra_attributes .= "maxlength='{$field_info->db_max_length}'"; - $input = ""; - return $input; - } - - protected function get_date_input($field_info,$value) - { - $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); - - if($this->language !== 'english') - { - include($this->default_config_path.'/language_alias.php'); - if(array_key_exists($this->language, $language_alias)) - { - $i18n_date_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-'.$language_alias[$this->language].'.js'; - if(file_exists($i18n_date_js_file)) - { - $this->set_js_lib($i18n_date_js_file); - } - } - } - - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.datepicker.config.js'); - - if(!empty($value) && $value != '0000-00-00' && $value != '1970-01-01') - { - list($year,$month,$day) = explode('-',substr($value,0,10)); - $date = date($this->php_date_format, mktime(0,0,0,$month,$day,$year)); - } - else - { - $date = ''; - } - - $input = " - ".$this->l('form_button_clear')." (".$this->ui_date_format.")"; - return $input; - } - - protected function get_dropdown_input($field_info,$value) - { - $this->load_js_chosen(); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); - - $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); - - $input = ""; - return $input; - } - - protected function get_enum_input($field_info,$value) - { - $this->load_js_chosen(); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); - - $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); - - $input = ""; - return $input; - } - - protected function get_readonly_input($field_info, $value) - { - $read_only_value = " "; - - if (!empty($value) && !is_array($value)) { - $read_only_value = $value; - } elseif (is_array($value)) { - $all_values = array_values($value); - $read_only_value = implode(", ",$all_values); - } - - return '
'.$read_only_value.'
'; - } - - protected function get_set_input($field_info,$value) - { - $this->load_js_chosen(); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); - - $options_array = $field_info->extras !== false && is_array($field_info->extras)? $field_info->extras : explode("','",substr($field_info->db_max_length,1,-1)); - $selected_values = !empty($value) ? explode(",",$value) : array(); - - $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); - $input = ""; - - return $input; - } - - protected function get_multiselect_input($field_info,$value) - { - $this->load_js_chosen(); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); - - $options_array = $field_info->extras; - $selected_values = !empty($value) ? explode(",",$value) : array(); - - $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); - $input = ""; - - return $input; - } - - protected function get_relation_input($field_info,$value) - { - $this->load_js_chosen(); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); - - $ajax_limitation = 10000; - $total_rows = $this->get_relation_total_rows($field_info->extras); - - - //Check if we will use ajax for our queries or just clien-side javascript - $using_ajax = $total_rows > $ajax_limitation ? true : false; - - //We will not use it for now. It is not ready yet. Probably we will have this functionality at version 1.4 - $using_ajax = false; - - //If total rows are more than the limitation, use the ajax plugin - $ajax_or_not_class = $using_ajax ? 'chosen-select' : 'chosen-select'; - - $this->_inline_js("var ajax_relation_url = '".$this->getAjaxRelationUrl()."';\n"); - - $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); - $input = ""; - return $input; - } - - protected function get_relation_readonly_input($field_info,$value) - { - $options_array = $this->get_relation_array($field_info->extras); - - $value = isset($options_array[$value]) ? $options_array[$value] : ''; - - return $this->get_readonly_input($field_info, $value); - } - - protected function get_upload_file_readonly_input($field_info,$value) - { - $file = $file_url = base_url().$field_info->extras->upload_path.'/'.$value; - - $value = !empty($value) ? ''.$value.'' : ''; - - return $this->get_readonly_input($field_info, $value); - } - - protected function get_relation_n_n_input($field_info_type, $selected_values) - { - $has_priority_field = !empty($field_info_type->extras->priority_field_relation_table) ? true : false; - $is_ie_7 = isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false) ? true : false; - - if($has_priority_field || $is_ie_7) - { - $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); - $this->set_css($this->default_css_path.'/jquery_plugins/ui.multiselect.css'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui.multiselect.min.js'); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.multiselect.js'); - - if($this->language !== 'english') - { - include($this->default_config_path.'/language_alias.php'); - if(array_key_exists($this->language, $language_alias)) - { - $i18n_date_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/multiselect/ui-multiselect-'.$language_alias[$this->language].'.js'; - if(file_exists($i18n_date_js_file)) - { - $this->set_js_lib($i18n_date_js_file); - } - } - } - } - else - { - $this->set_css($this->default_css_path.'/jquery_plugins/chosen/chosen.css'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.chosen.min.js'); - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); - } - - $this->_inline_js("var ajax_relation_url = '".$this->getAjaxRelationUrl()."';\n"); - - $field_info = $this->relation_n_n[$field_info_type->name]; //As we use this function the relation_n_n exists, so don't need to check - $unselected_values = $this->get_relation_n_n_unselected_array($field_info, $selected_values); - - if(empty($unselected_values) && empty($selected_values)) - { - $input = "Please add {$field_info_type->display_as} first"; - } - else - { - $css_class = $has_priority_field || $is_ie_7 ? 'multiselect': 'chosen-multiple-select'; - $width_style = $has_priority_field || $is_ie_7 ? '' : 'width:510px;'; - - $select_title = str_replace('{field_display_as}',$field_info_type->display_as,$this->l('set_relation_title')); - $input = ""; - } - - return $input; - } - - protected function _convert_bytes_ui_to_bytes($bytes_ui) - { - $bytes_ui = str_replace(' ','',$bytes_ui); - if(strstr($bytes_ui,'MB')) - $bytes = (int)(str_replace('MB','',$bytes_ui))*1024*1024; - elseif(strstr($bytes_ui,'KB')) - $bytes = (int)(str_replace('KB','',$bytes_ui))*1024; - elseif(strstr($bytes_ui,'B')) - $bytes = (int)(str_replace('B','',$bytes_ui)); - else - $bytes = (int)($bytes_ui); - - return $bytes; - } - - protected function get_upload_file_input($field_info, $value) - { - $this->load_js_uploader(); - - //Fancybox - $this->load_js_fancybox(); - - $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.fancybox.config.js'); - - $unique = mt_rand(); - - $allowed_files = $this->config->file_upload_allow_file_types; - $allowed_files_ui = '.'.str_replace('|',',.',$allowed_files); - $max_file_size_ui = $this->config->file_upload_max_file_size; - $max_file_size_bytes = $this->_convert_bytes_ui_to_bytes($max_file_size_ui); - - $this->_inline_js(' - var upload_info_'.$unique.' = { - accepted_file_types: /(\\.|\\/)('.$allowed_files.')$/i, - accepted_file_types_ui : "'.$allowed_files_ui.'", - max_file_size: '.$max_file_size_bytes.', - max_file_size_ui: "'.$max_file_size_ui.'" - }; - - var string_upload_file = "'.$this->l('form_upload_a_file').'"; - var string_delete_file = "'.$this->l('string_delete_file').'"; - var string_progress = "'.$this->l('string_progress').'"; - var error_on_uploading = "'.$this->l('error_on_uploading').'"; - var message_prompt_delete_file = "'.$this->l('message_prompt_delete_file').'"; - - var error_max_number_of_files = "'.$this->l('error_max_number_of_files').'"; - var error_accept_file_types = "'.$this->l('error_accept_file_types').'"; - var error_max_file_size = "'.str_replace("{max_file_size}",$max_file_size_ui,$this->l('error_max_file_size')).'"; - var error_min_file_size = "'.$this->l('error_min_file_size').'"; - - var base_url = "'.base_url().'"; - var upload_a_file_string = "'.$this->l('form_upload_a_file').'"; - '); - - $uploader_display_none = empty($value) ? "" : "display:none;"; - $file_display_none = empty($value) ? "display:none;" : ""; - - $is_image = !empty($value) && - ( substr($value,-4) == '.jpg' - || substr($value,-4) == '.png' - || substr($value,-5) == '.jpeg' - || substr($value,-4) == '.gif' - || substr($value,-5) == '.tiff') - ? true : false; - - $image_class = $is_image ? 'image-thumbnail' : ''; - - $input = ' - '.$this->l('form_upload_a_file').' - - - '; - - $this->set_css($this->default_css_path.'/jquery_plugins/file_upload/fileuploader.css'); - - $file_url = base_url().$field_info->extras->upload_path.'/'.$value; - - $input .= "
"; - $input .= "
"; - $input .= ""; - $input .= "
"; - $input .= "
"; - - return $input; - } - - protected function get_add_hidden_fields() - { - return $this->add_hidden_fields; - } - - protected function get_edit_hidden_fields() - { - return $this->edit_hidden_fields; - } - - protected function get_add_input_fields($field_values = null) - { - $fields = $this->get_add_fields(); - $types = $this->get_field_types(); - - $input_fields = array(); - - foreach($fields as $field_num => $field) - { - $field_info = $types[$field->field_name]; - - $field_value = !empty($field_values) && isset($field_values->{$field->field_name}) ? $field_values->{$field->field_name} : null; - - if(!isset($this->callback_add_field[$field->field_name])) - { - $field_input = $this->get_field_input($field_info, $field_value); - } - else - { - $field_input = $field_info; - $field_input->input = call_user_func($this->callback_add_field[$field->field_name], $field_value, null, $field_info); - } - - switch ($field_info->crud_type) { - case 'invisible': - unset($this->add_fields[$field_num]); - unset($fields[$field_num]); - continue; - break; - case 'hidden': - $this->add_hidden_fields[] = $field_input; - unset($this->add_fields[$field_num]); - unset($fields[$field_num]); - continue; - break; - } - - $input_fields[$field->field_name] = $field_input; - } - - return $input_fields; - } - - protected function get_edit_input_fields($field_values = null) - { - $fields = $this->get_edit_fields(); - $types = $this->get_field_types(); - - $input_fields = array(); - - foreach($fields as $field_num => $field) - { - $field_info = $types[$field->field_name]; - - $field_value = !empty($field_values) && isset($field_values->{$field->field_name}) ? $field_values->{$field->field_name} : null; - if(!isset($this->callback_edit_field[$field->field_name])) - { - $field_input = $this->get_field_input($field_info, $field_value); - } - else - { - $primary_key = $this->getStateInfo()->primary_key; - $field_input = $field_info; - $field_input->input = call_user_func($this->callback_edit_field[$field->field_name], $field_value, $primary_key, $field_info, $field_values); - } - - switch ($field_info->crud_type) { - case 'invisible': - unset($this->edit_fields[$field_num]); - unset($fields[$field_num]); - continue; - break; - case 'hidden': - $this->edit_hidden_fields[] = $field_input; - unset($this->edit_fields[$field_num]); - unset($fields[$field_num]); - continue; - break; - } - - $input_fields[$field->field_name] = $field_input; - } - - return $input_fields; - } - - protected function get_read_input_fields($field_values = null) - { - $fields = $this->get_edit_fields(); - $this->field_types = null; - $this->required_fields = null; - - foreach ($fields as $field) { - if (!empty($this->change_field_type) - && isset($this->change_field_type[$field->field_name]) - && $this->change_field_type[$field->field_name]->type == 'hidden') { - continue; - } - $this->field_type($field->field_name, 'readonly'); - } - - return $this->get_edit_input_fields($field_values); - } - - protected function setThemeBasics() - { - $this->theme_path = $this->default_theme_path; - if(substr($this->theme_path,-1) != '/') - $this->theme_path = $this->theme_path.'/'; - - include($this->theme_path.$this->theme.'/config.php'); - - $this->theme_config = $config; - } - - public function set_theme($theme = null) - { - $this->theme = $theme; - - return $this; - } - - protected function _get_ajax_results() - { - //This is a $_POST request rather that $_GET request , because - //Codeigniter doesn't like the $_GET requests so much! - if ($this->_is_ajax()) { - @ob_end_clean(); - $results= (object)array( - 'output' => $this->views_as_string, - 'js_files' => array_values($this->get_js_files()), - 'js_lib_files' => array_values($this->get_js_lib_files()), - 'js_config_files' => array_values($this->get_js_config_files()), - 'css_files' => array_values($this->get_css_files()) - ); - - echo json_encode($results); - die; - } - //else just continue - } - - protected function _is_ajax() - { - return array_key_exists('is_ajax', $_POST) && $_POST['is_ajax'] == 'true' ? true: false; - } - - protected function _theme_view($view, $vars = array(), $return = FALSE) - { - $vars = (is_object($vars)) ? get_object_vars($vars) : $vars; - - $file_exists = FALSE; - - $ext = pathinfo($view, PATHINFO_EXTENSION); - $file = ($ext == '') ? $view.'.php' : $view; - - $view_file = $this->theme_path.$this->theme.'/views/'; - - if (file_exists($view_file.$file)) - { - $path = $view_file.$file; - $file_exists = TRUE; - } - - if ( ! $file_exists) - { - throw new Exception('Unable to load the requested file: '.$file, 16); - } - - extract($vars); - - #region buffering... - ob_start(); - - include($path); - - $buffer = ob_get_contents(); - @ob_end_clean(); - #endregion - - if ($return === TRUE) - { - return $buffer; - } - - $this->views_as_string .= $buffer; - } - - protected function _inline_js($inline_js = '') - { - $this->views_as_string .= "\n"; - } - - protected function _add_js_vars($js_vars = array()) - { - $javascript_as_string = "\n"; - $this->views_as_string .= $javascript_as_string; - } - - protected function get_views_as_string() - { - if(!empty($this->views_as_string)) - return $this->views_as_string; - else - return null; - } -} - - -/** - * PHP grocery CRUD - * - * LICENSE - * - * Grocery CRUD is released with dual licensing, using the GPL v3 (license-gpl3.txt) and the MIT license (license-mit.txt). - * You don't have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. - * Please see the corresponding license file for details of these licenses. - * You are free to use, modify and distribute this software, but all copyright information must remain. - * - * @package grocery CRUD - * @copyright Copyright (c) 2010 through 2012, John Skoumbourdis - * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt - * @author John Skoumbourdis - */ - -// ------------------------------------------------------------------------ - -/** - * PHP grocery States - * - * States of grocery CRUD - * - * @package grocery CRUD - * @author John Skoumbourdis - * @version 1.4.1 - */ -class grocery_CRUD_States extends grocery_CRUD_Layout -{ - protected $states = array( - 0 => 'unknown', - 1 => 'list', - 2 => 'add', - 3 => 'edit', - 4 => 'delete', - 5 => 'insert', - 6 => 'update', - 7 => 'ajax_list', - 8 => 'ajax_list_info', - 9 => 'insert_validation', - 10 => 'update_validation', - 11 => 'upload_file', - 12 => 'delete_file', - 13 => 'ajax_relation', - 14 => 'ajax_relation_n_n', - 15 => 'success', - 16 => 'export', - 17 => 'print', - 18 => 'read' - ); - - protected function getStateCode() - { - $state_string = $this->get_state_info_from_url()->operation; - - if( $state_string != 'unknown' && in_array( $state_string, $this->states ) ) - $state_code = array_search($state_string, $this->states); - else - $state_code = 0; - - return $state_code; - } - - protected function state_url($url = '', $is_list_page = false) - { - //Easy scenario, we had set the crud_url_path - if (!empty($this->crud_url_path)) { - $state_url = !empty($this->list_url_path) && $is_list_page? - $this->list_url_path : - $this->crud_url_path.'/'.$url ; - } else { - //Complicated scenario. The crud_url_path is not specified so we are - //trying to understand what is going on from the URL. - $ci = &get_instance(); - - $segment_object = $this->get_state_info_from_url(); - $method_name = $this->get_method_name(); - $segment_position = $segment_object->segment_position; - - $state_url_array = array(); - - if( sizeof($ci->uri->segments) > 0 ) { - foreach($ci->uri->segments as $num => $value) - { - $state_url_array[$num] = $value; - if($num == ($segment_position - 1)) - break; - } - - if( $method_name == 'index' && !in_array( 'index', $state_url_array ) ) //there is a scenario that you don't have the index to your url - $state_url_array[$num+1] = 'index'; - } - - $state_url = site_url(implode('/',$state_url_array).'/'.$url); - } - - return $state_url; - } - - protected function get_state_info_from_url() - { - $ci = &get_instance(); - - $segment_position = count($ci->uri->segments) + 1; - $operation = 'list'; - - $segements = $ci->uri->segments; - foreach($segements as $num => $value) - { - if($value != 'unknown' && in_array($value, $this->states)) - { - $segment_position = (int)$num; - $operation = $value; //I don't have a "break" here because I want to ensure that is the LAST segment with name that is in the array. - } - } - - $function_name = $this->get_method_name(); - - if($function_name == 'index' && !in_array('index',$ci->uri->segments)) - $segment_position++; - - $first_parameter = isset($segements[$segment_position+1]) ? $segements[$segment_position+1] : null; - $second_parameter = isset($segements[$segment_position+2]) ? $segements[$segment_position+2] : null; - - return (object)array('segment_position' => $segment_position, 'operation' => $operation, 'first_parameter' => $first_parameter, 'second_parameter' => $second_parameter); - } - - protected function get_method_hash() - { - $ci = &get_instance(); - - $state_info = $this->get_state_info_from_url(); - $extra_values = $ci->uri->segment($state_info->segment_position - 1) != $this->get_method_name() ? $ci->uri->segment($state_info->segment_position - 1) : ''; - - return $this->crud_url_path !== null - ? md5($this->crud_url_path) - : md5($this->get_controller_name().$this->get_method_name().$extra_values); - } - - protected function get_method_name() - { - $ci = &get_instance(); - return $ci->router->method; - } - - protected function get_controller_name() - { - $ci = &get_instance(); - return $ci->router->class; - } - - public function getState() - { - return $this->states[$this->getStateCode()]; - } - - protected function getListUrl() - { - return $this->state_url('',true); - } - - protected function getAjaxListUrl() - { - return $this->state_url('ajax_list'); - } - - protected function getExportToExcelUrl() - { - return $this->state_url('export'); - } - - protected function getPrintUrl() - { - return $this->state_url('print'); - } - - protected function getAjaxListInfoUrl() - { - return $this->state_url('ajax_list_info'); - } - - protected function getAddUrl() - { - return $this->state_url('add'); - } - - protected function getInsertUrl() - { - return $this->state_url('insert'); - } - - protected function getValidationInsertUrl() - { - return $this->state_url('insert_validation'); - } - - protected function getValidationUpdateUrl($primary_key = null) - { - if($primary_key === null) - return $this->state_url('update_validation'); - else - return $this->state_url('update_validation/'.$primary_key); - } - - protected function getEditUrl($primary_key = null) - { - if($primary_key === null) - return $this->state_url('edit'); - else - return $this->state_url('edit/'.$primary_key); - } - - protected function getReadUrl($primary_key = null) - { - if($primary_key === null) - return $this->state_url('read'); - else - return $this->state_url('read/'.$primary_key); - } - - protected function getUpdateUrl($state_info) - { - return $this->state_url('update/'.$state_info->primary_key); - } - - protected function getDeleteUrl($state_info = null) - { - if(empty($state_info)) - return $this->state_url('delete'); - else - return $this->state_url('delete/'.$state_info->primary_key); - } - - protected function getListSuccessUrl($primary_key = null) - { - if(empty($primary_key)) - return $this->state_url('success',true); - else - return $this->state_url('success/'.$primary_key,true); - } - - protected function getUploadUrl($field_name) - { - return $this->state_url('upload_file/'.$field_name); - } - - protected function getFileDeleteUrl($field_name) - { - return $this->state_url('delete_file/'.$field_name); - } - - protected function getAjaxRelationUrl() - { - return $this->state_url('ajax_relation'); - } - - protected function getAjaxRelationManytoManyUrl() - { - return $this->state_url('ajax_relation_n_n'); - } - - public function getStateInfo() - { - $state_code = $this->getStateCode(); - $segment_object = $this->get_state_info_from_url(); - - $first_parameter = $segment_object->first_parameter; - $second_parameter = $segment_object->second_parameter; - - $state_info = (object)array(); - - switch ($state_code) { - case 1: - case 2: - - break; - - case 3: - case 18: // read - if($first_parameter !== null) - { - $state_info = (object)array('primary_key' => $first_parameter); - } - else - { - throw new Exception('On the state "edit" the Primary key cannot be null', 6); - die(); - } - break; - - case 4: - if($first_parameter !== null) - { - $state_info = (object)array('primary_key' => $first_parameter); - } - else - { - throw new Exception('On the state "delete" the Primary key cannot be null',7); - die(); - } - break; - - case 5: - if(!empty($_POST)) - { - $state_info = (object)array('unwrapped_data' => $_POST); - } - else - { - throw new Exception('On the state "insert" you must have post data',8); - die(); - } - break; - - case 6: - if(!empty($_POST) && $first_parameter !== null) - { - $state_info = (object)array('primary_key' => $first_parameter,'unwrapped_data' => $_POST); - } - elseif(empty($_POST)) - { - throw new Exception('On the state "update" you must have post data',9); - die(); - } - else - { - throw new Exception('On the state "update" the Primary key cannot be null',10); - die(); - } - break; - - case 7: - case 8: - case 16: //export to excel - case 17: //print - $state_info = (object)array(); - if(!empty($_POST['per_page'])) - { - $state_info->per_page = is_numeric($_POST['per_page']) ? $_POST['per_page'] : null; - } - if(!empty($_POST['page'])) - { - $state_info->page = is_numeric($_POST['page']) ? $_POST['page'] : null; - } - //If we request an export or a print we don't care about what page we are - if($state_code === 16 || $state_code === 17) - { - $state_info->page = 1; - $state_info->per_page = 1000000; //a big number - } - if(!empty($_POST['order_by'][0])) - { - $state_info->order_by = $_POST['order_by']; - } - if(!empty($_POST['search_text'])) - { - if(empty($_POST['search_field'])) - { - - $search_text = strip_tags($_POST['search_field']); - - $state_info->search = (object)array( 'field' => null , 'text' => $_POST['search_text'] ); - - } - else - { - $state_info->search = (object)array( 'field' => strip_tags($_POST['search_field']) , 'text' => $_POST['search_text'] ); - } - } - break; - - case 9: - - break; - - case 10: - if($first_parameter !== null) - { - $state_info = (object)array('primary_key' => $first_parameter); - } - break; - - case 11: - $state_info->field_name = $first_parameter; - break; - - case 12: - $state_info->field_name = $first_parameter; - $state_info->file_name = $second_parameter; - break; - - case 13: - $state_info->field_name = $_POST['field_name']; - $state_info->search = $_POST['term']; - break; - - case 14: - $state_info->field_name = $_POST['field_name']; - $state_info->search = $_POST['term']; - break; - - case 15: - $state_info = (object)array( - 'primary_key' => $first_parameter, - 'success_message' => true - ); - break; - } - - return $state_info; - } -} - - -/** - * PHP grocery CRUD - * - * LICENSE - * - * Grocery CRUD is released with dual licensing, using the GPL v3 (license-gpl3.txt) and the MIT license (license-mit.txt). - * You don't have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. - * Please see the corresponding license file for details of these licenses. - * You are free to use, modify and distribute this software, but all copyright information must remain. - * - * @package grocery CRUD - * @copyright Copyright (c) 2010 through 2012, John Skoumbourdis - * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt - * @version 1.4.1 - * @author John Skoumbourdis - */ - -// ------------------------------------------------------------------------ - -/** - * PHP grocery CRUD - * - * Creates a full functional CRUD with few lines of code. - * - * @package grocery CRUD - * @author John Skoumbourdis - * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt - * @link http://www.grocerycrud.com/documentation - */ -class Grocery_CRUD extends grocery_CRUD_States -{ - /** - * Grocery CRUD version - * - * @var string - */ - const VERSION = "1.4.1"; - - const JQUERY = "jquery-1.10.2.min.js"; - const JQUERY_UI_JS = "jquery-ui-1.10.3.custom.min.js"; - const JQUERY_UI_CSS = "jquery-ui-1.10.1.custom.min.css"; - - protected $state_code = null; - protected $state_info = null; - protected $columns = null; - - private $basic_db_table_checked = false; - private $columns_checked = false; - private $add_fields_checked = false; - private $edit_fields_checked = false; - - protected $default_theme = 'flexigrid'; - protected $language = null; - protected $lang_strings = array(); - protected $php_date_format = null; - protected $js_date_format = null; - protected $ui_date_format = null; - protected $character_limiter = null; - protected $config = null; - - protected $add_fields = null; - protected $edit_fields = null; - protected $add_hidden_fields = array(); - protected $edit_hidden_fields = array(); - protected $field_types = null; - protected $basic_db_table = null; - protected $theme_config = array(); - protected $subject = null; - protected $subject_plural = null; - protected $display_as = array(); - protected $order_by = null; - protected $where = array(); - protected $like = array(); - protected $having = array(); - protected $or_having = array(); - protected $limit = null; - protected $required_fields = array(); - protected $_unique_fields = array(); - protected $validation_rules = array(); - protected $relation = array(); - protected $relation_n_n = array(); - protected $upload_fields = array(); - protected $actions = array(); - - protected $form_validation = null; - protected $change_field_type = null; - protected $primary_keys = array(); - protected $crud_url_path = null; - protected $list_url_path = null; - - /* The unsetters */ - protected $unset_texteditor = array(); - protected $unset_add = false; - protected $unset_edit = false; - protected $unset_delete = false; - protected $unset_read = false; - protected $unset_jquery = false; - protected $unset_jquery_ui = false; - protected $unset_bootstrap = false; - protected $unset_list = false; - protected $unset_export = false; - protected $unset_print = false; - protected $unset_back_to_list = false; - protected $unset_columns = null; - protected $unset_add_fields = null; - protected $unset_edit_fields = null; - - /* Callbacks */ - protected $callback_before_insert = null; - protected $callback_after_insert = null; - protected $callback_insert = null; - protected $callback_before_update = null; - protected $callback_after_update = null; - protected $callback_update = null; - protected $callback_before_delete = null; - protected $callback_after_delete = null; - protected $callback_delete = null; - protected $callback_column = array(); - protected $callback_add_field = array(); - protected $callback_edit_field = array(); - protected $callback_upload = null; - protected $callback_before_upload = null; - protected $callback_after_upload = null; - - protected $default_javascript_path = null; //autogenerate, please do not modify - protected $default_css_path = null; //autogenerate, please do not modify - protected $default_texteditor_path = null; //autogenerate, please do not modify - protected $default_theme_path = null; //autogenerate, please do not modify - protected $default_language_path = 'assets/grocery_crud/languages'; - protected $default_config_path = 'assets/grocery_crud/config'; - protected $default_assets_path = 'assets/grocery_crud'; - - /** - * - * Constructor - * - * @access public - */ - public function __construct() - { - - } - - /** - * The displayed columns that user see - * - * @access public - * @param string - * @param array - * @return void - */ - public function columns() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->columns = $args; - - return $this; - } - - - /** - * Set Validation Rules - * - * Important note: If the $field is an array then no automated crud fields will take apart - * - * @access public - * @param mixed - * @param string - * @return void - */ - function set_rules($field, $label = '', $rules = '') - { - if(is_string($field)) - { - $this->validation_rules[$field] = array('field' => $field, 'label' => $label, 'rules' => $rules); - }elseif(is_array($field)) - { - foreach($field as $num_field => $field_array) - { - $this->validation_rules[$field_array['field']] = $field_array; - } - } - return $this; - } - - /** - * - * Changes the default field type - * @param string $field - * @param string $type - * @param array|string $extras - */ - public function change_field_type($field , $type, $extras = null) - { - $field_type = (object)array('type' => $type); - - $field_type->extras = $extras; - - $this->change_field_type[$field] = $field_type; - - return $this; - } - - /** - * - * Just an alias to the change_field_type method - * @param string $field - * @param string $type - * @param array|string $extras - */ - public function field_type($field , $type, $extras = null) - { - return $this->change_field_type($field , $type, $extras); - } - - /** - * Change the default primary key for a specific table. - * If the $table_name is NULL then the primary key is for the default table name that we added at the set_table method - * - * @param string $primary_key_field - * @param string $table_name - */ - public function set_primary_key($primary_key_field, $table_name = null) - { - $this->primary_keys[] = array('field_name' => $primary_key_field, 'table_name' => $table_name); - - return $this; - } - - /** - * Unsets the texteditor of the selected fields - * - * @access public - * @param string - * @param array - * @return void - */ - public function unset_texteditor() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - foreach($args as $arg) - { - $this->unset_texteditor[] = $arg; - } - - return $this; - } - - /** - * Unsets just the jquery library from the js. This function can be used if there is already a jquery included - * in the main template. This will avoid all jquery conflicts. - * - * @return void - */ - public function unset_jquery() - { - $this->unset_jquery = true; - - return $this; - } - - /** - * Unsets the jquery UI Javascript and CSS. This function is really useful - * when the jquery UI JavaScript and CSS are already included in the main template. - * This will avoid all jquery UI conflicts. - * - * @return void - */ - public function unset_jquery_ui() - { - $this->unset_jquery_ui = true; - - return $this; - } - - /** - * Unsets just the twitter bootstrap libraries from the js and css. This function can be used if there is already twitter bootstrap files included - * in the main template. If you are already using a bootstrap template then it's not necessary to load the files again. - * - * @return void - */ - public function unset_bootstrap() - { - $this->unset_bootstrap = true; - - return $this; - } - - /** - * Unsets the add operation from the list - * - * @return void - */ - public function unset_add() - { - $this->unset_add = true; - - return $this; - } - - /** - * Unsets the edit operation from the list - * - * @return void - */ - public function unset_edit() - { - $this->unset_edit = true; - - return $this; - } - - /** - * Unsets the delete operation from the list - * - * @return void - */ - public function unset_delete() - { - $this->unset_delete = true; - - return $this; - } - - /** - * Unsets the read operation from the list - * - * @return void - */ - public function unset_read() - { - $this->unset_read = true; - - return $this; - } - - /** - * Unsets the export button and functionality from the list - * - * @return void - */ - public function unset_export() - { - $this->unset_export = true; - - return $this; - } - - - /** - * Unsets the print button and functionality from the list - * - * @return void - */ - public function unset_print() - { - $this->unset_print = true; - - return $this; - } - - /** - * Unsets all the operations from the list - * - * @return void - */ - public function unset_operations() - { - $this->unset_add = true; - $this->unset_edit = true; - $this->unset_delete = true; - $this->unset_read = true; - $this->unset_export = true; - $this->unset_print = true; - - return $this; - } - - /** - * Unsets a column from the list - * - * @return void. - */ - public function unset_columns() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->unset_columns = $args; - - return $this; - } - - public function unset_list() - { - $this->unset_list = true; - - return $this; - } - - public function unset_fields() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->unset_add_fields = $args; - $this->unset_edit_fields = $args; - - return $this; - } - - public function unset_add_fields() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->unset_add_fields = $args; - - return $this; - } - - public function unset_edit_fields() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->unset_edit_fields = $args; - - return $this; - } - - - /** - * Unsets everything that has to do with buttons or links with go back to list message - * @access public - * @return void - */ - public function unset_back_to_list() - { - $this->unset_back_to_list = true; - - return $this; - } - - /** - * - * The fields that user will see on add/edit - * - * @access public - * @param string - * @param array - * @return void - */ - public function fields() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->add_fields = $args; - $this->edit_fields = $args; - - return $this; - } - - /** - * - * The fields that user can see . It is only for the add form - */ - public function add_fields() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->add_fields = $args; - - return $this; - } - - /** - * - * The fields that user can see . It is only for the edit form - */ - public function edit_fields() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->edit_fields = $args; - - return $this; - } - - /** - * - * Changes the displaying label of the field - * @param $field_name - * @param $display_as - * @return void - */ - public function display_as($field_name, $display_as = null) - { - if(is_array($field_name)) - { - foreach($field_name as $field => $display_as) - { - $this->display_as[$field] = $display_as; - } - } - elseif($display_as !== null) - { - $this->display_as[$field_name] = $display_as; - } - return $this; - } - - /** - * - * Load the language strings array from the language file - */ - protected function _load_language() - { - if($this->language === null) - { - $this->language = strtolower($this->config->default_language); - } - include($this->default_language_path.'/'.$this->language.'.php'); - - foreach($lang as $handle => $lang_string) - if(!isset($this->lang_strings[$handle])) - $this->lang_strings[$handle] = $lang_string; - - $this->default_true_false_text = array( $this->l('form_inactive') , $this->l('form_active')); - $this->subject = $this->subject === null ? $this->l('list_record') : $this->subject; - - } - - protected function _load_date_format() - { - list($php_day, $php_month, $php_year) = array('d','m','Y'); - list($js_day, $js_month, $js_year) = array('dd','mm','yy'); - list($ui_day, $ui_month, $ui_year) = array('dd','mm','yyyy'); -//@todo ui_day, ui_month, ui_year has to be lang strings - - $date_format = $this->config->date_format; - switch ($date_format) { - case 'uk-date': - $this->php_date_format = "$php_day/$php_month/$php_year"; - $this->js_date_format = "$js_day/$js_month/$js_year"; - $this->ui_date_format = "$ui_day/$ui_month/$ui_year"; - break; - - case 'us-date': - $this->php_date_format = "$php_month/$php_day/$php_year"; - $this->js_date_format = "$js_month/$js_day/$js_year"; - $this->ui_date_format = "$ui_month/$ui_day/$ui_year"; - break; - - case 'sql-date': - default: - $this->php_date_format = "$php_year-$php_month-$php_day"; - $this->js_date_format = "$js_year-$js_month-$js_day"; - $this->ui_date_format = "$ui_year-$ui_month-$ui_day"; - break; - } - } - - /** - * - * Set a language string directly - * @param string $handle - * @param string $string - */ - public function set_lang_string($handle, $lang_string){ - $this->lang_strings[$handle] = $lang_string; - - return $this; - } - - /** - * - * Just an alias to get_lang_string method - * @param string $handle - */ - public function l($handle) - { - return $this->get_lang_string($handle); - } - - /** - * - * Get the language string of the inserted string handle - * @param string $handle - */ - public function get_lang_string($handle) - { - return $this->lang_strings[$handle]; - } - - /** - * - * Simply set the language - * @example english - * @param string $language - */ - public function set_language($language) - { - $this->language = $language; - - return $this; - } - - /** - * - * Enter description here ... - */ - protected function get_columns() - { - if($this->columns_checked === false) - { - $field_types = $this->get_field_types(); - if(empty($this->columns)) - { - $this->columns = array(); - foreach($field_types as $field) - { - if( !isset($field->db_extra) || $field->db_extra != 'auto_increment' ) - $this->columns[] = $field->name; - } - } - - foreach($this->columns as $col_num => $column) - { - - if(isset($this->relation[$column])) - { - - $new_column = $this->_unique_field_name($this->relation[$column][0]); - $this->columns[$col_num] = $new_column; - - if(isset($this->display_as[$column])) - { - $display_as = $this->display_as[$column]; - unset($this->display_as[$column]); - $this->display_as[$new_column] = $display_as; - } - else - { - $this->display_as[$new_column] = ucfirst(str_replace('_',' ',$column)); - } - - $column = $new_column; - $this->columns[$col_num] = $new_column; - } - else - { - if(!empty($this->relation)) - { - $table_name = $this->get_table(); - foreach($this->relation as $relation) - { - if( $relation[2] == $column ) - { - $new_column = $table_name.'.'.$column; - if(isset($this->display_as[$column])) - { - $display_as = $this->display_as[$column]; - unset($this->display_as[$column]); - $this->display_as[$new_column] = $display_as; - } - else - { - $this->display_as[$new_column] = ucfirst(str_replace('_',' ',$column)); - } - - $column = $new_column; - $this->columns[$col_num] = $new_column; - } - } - } - - } - - if(isset($this->display_as[$column])) - $this->columns[$col_num] = (object)array('field_name' => $column, 'display_as' => $this->display_as[$column]); - elseif(isset($field_types[$column])) - $this->columns[$col_num] = (object)array('field_name' => $column, 'display_as' => $field_types[$column]->display_as); - else - $this->columns[$col_num] = (object)array('field_name' => $column, 'display_as' => - ucfirst(str_replace('_',' ',$column))); - - if(!empty($this->unset_columns) && in_array($column,$this->unset_columns)) - { - unset($this->columns[$col_num]); - } - } - - $this->columns_checked = true; - - } - - return $this->columns; - } - - /** - * - * Enter description here ... - */ - protected function get_add_fields() - { - if($this->add_fields_checked === false) - { - $field_types = $this->get_field_types(); - if(!empty($this->add_fields)) - { - foreach($this->add_fields as $field_num => $field) - { - if(isset($this->display_as[$field])) - $this->add_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $this->display_as[$field]); - elseif(isset($field_types[$field]->display_as)) - $this->add_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $field_types[$field]->display_as); - else - $this->add_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => ucfirst(str_replace('_',' ',$field))); - } - } - else - { - $this->add_fields = array(); - foreach($field_types as $field) - { - //Check if an unset_add_field is initialize for this field name - if($this->unset_add_fields !== null && is_array($this->unset_add_fields) && in_array($field->name,$this->unset_add_fields)) - continue; - - if( (!isset($field->db_extra) || $field->db_extra != 'auto_increment') ) - { - if(isset($this->display_as[$field->name])) - $this->add_fields[] = (object)array('field_name' => $field->name, 'display_as' => $this->display_as[$field->name]); - else - $this->add_fields[] = (object)array('field_name' => $field->name, 'display_as' => $field->display_as); - } - } - } - - $this->add_fields_checked = true; - } - return $this->add_fields; - } - - /** - * - * Enter description here ... - */ - protected function get_edit_fields() - { - if($this->edit_fields_checked === false) - { - $field_types = $this->get_field_types(); - if(!empty($this->edit_fields)) - { - foreach($this->edit_fields as $field_num => $field) - { - if(isset($this->display_as[$field])) - $this->edit_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $this->display_as[$field]); - else - $this->edit_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $field_types[$field]->display_as); - } - } - else - { - $this->edit_fields = array(); - foreach($field_types as $field) - { - //Check if an unset_edit_field is initialize for this field name - if($this->unset_edit_fields !== null && is_array($this->unset_edit_fields) && in_array($field->name,$this->unset_edit_fields)) - continue; - - if(!isset($field->db_extra) || $field->db_extra != 'auto_increment') - { - if(isset($this->display_as[$field->name])) - $this->edit_fields[] = (object)array('field_name' => $field->name, 'display_as' => $this->display_as[$field->name]); - else - $this->edit_fields[] = (object)array('field_name' => $field->name, 'display_as' => $field->display_as); - } - } - } - - $this->edit_fields_checked = true; - } - return $this->edit_fields; - } - - public function order_by($order_by, $direction = 'asc') - { - $this->order_by = array($order_by,$direction); - - return $this; - } - - public function where($key, $value = NULL, $escape = TRUE) - { - $this->where[] = array($key,$value,$escape); - - return $this; - } - - public function or_where($key, $value = NULL, $escape = TRUE) - { - $this->or_where[] = array($key,$value,$escape); - - return $this; - } - - public function like($field, $match = '', $side = 'both') - { - $this->like[] = array($field, $match, $side); - - return $this; - } - - protected function having($key, $value = '', $escape = TRUE) - { - $this->having[] = array($key, $value, $escape); - - return $this; - } - - protected function or_having($key, $value = '', $escape = TRUE) - { - $this->or_having[] = array($key, $value, $escape); - - return $this; - } - - public function or_like($field, $match = '', $side = 'both') - { - $this->or_like[] = array($field, $match, $side); - - return $this; - } - - public function limit($limit, $offset = '') - { - $this->limit = array($limit,$offset); - - return $this; - } - - protected function _initialize_helpers() - { - $ci = &get_instance(); - - $ci->load->helper('url'); - $ci->load->helper('form'); - } - - protected function _initialize_variables() - { - $ci = &get_instance(); - $ci->load->config('grocery_crud'); - - $this->config = (object)array(); - - /** Initialize all the config variables into this object */ - $this->config->default_language = $ci->config->item('grocery_crud_default_language'); - $this->config->date_format = $ci->config->item('grocery_crud_date_format'); - $this->config->default_per_page = $ci->config->item('grocery_crud_default_per_page'); - $this->config->file_upload_allow_file_types = $ci->config->item('grocery_crud_file_upload_allow_file_types'); - $this->config->file_upload_max_file_size = $ci->config->item('grocery_crud_file_upload_max_file_size'); - $this->config->default_text_editor = $ci->config->item('grocery_crud_default_text_editor'); - $this->config->text_editor_type = $ci->config->item('grocery_crud_text_editor_type'); - $this->config->character_limiter = $ci->config->item('grocery_crud_character_limiter'); - $this->config->dialog_forms = $ci->config->item('grocery_crud_dialog_forms'); - $this->config->paging_options = $ci->config->item('grocery_crud_paging_options'); - - /** Initialize default paths */ - $this->default_javascript_path = $this->default_assets_path.'/js'; - $this->default_css_path = $this->default_assets_path.'/css'; - $this->default_texteditor_path = $this->default_assets_path.'/texteditor'; - $this->default_theme_path = $this->default_assets_path.'/themes'; - - $this->character_limiter = $this->config->character_limiter; - - if($this->character_limiter === 0 || $this->character_limiter === '0') - { - $this->character_limiter = 1000000; //a big number - } - elseif($this->character_limiter === null || $this->character_limiter === false) - { - $this->character_limiter = 30; //is better to have the number 30 rather than the 0 value - } - } - - protected function _set_primary_keys_to_model() - { - if(!empty($this->primary_keys)) - { - foreach($this->primary_keys as $primary_key) - { - $this->basic_model->set_primary_key($primary_key['field_name'],$primary_key['table_name']); - } - } - } - - /** - * Initialize all the required libraries and variables before rendering - */ - protected function pre_render() - { - $this->_initialize_variables(); - $this->_initialize_helpers(); - $this->_load_language(); - $this->state_code = $this->getStateCode(); - - if($this->basic_model === null) - $this->set_default_Model(); - - $this->set_basic_db_table($this->get_table()); - - $this->_load_date_format(); - - $this->_set_primary_keys_to_model(); - } - - /** - * - * Or else ... make it work! The web application takes decision of what to do and show it to the final user. - * Without this function nothing works. Here is the core of grocery CRUD project. - * - * @access public - */ - public function render() - { - $this->pre_render(); - - if( $this->state_code != 0 ) - { - $this->state_info = $this->getStateInfo(); - } - else - { - throw new Exception('The state is unknown , I don\'t know what I will do with your data!', 4); - die(); - } - - switch ($this->state_code) { - case 15://success - case 1://list - if($this->unset_list) - { - throw new Exception('You don\'t have permissions for this operation', 14); - die(); - } - - if($this->theme === null) - $this->set_theme($this->default_theme); - $this->setThemeBasics(); - - $this->set_basic_Layout(); - - $state_info = $this->getStateInfo(); - - $this->showList(false,$state_info); - - break; - - case 2://add - if($this->unset_add) - { - throw new Exception('You don\'t have permissions for this operation', 14); - die(); - } - - if($this->theme === null) - $this->set_theme($this->default_theme); - $this->setThemeBasics(); - - $this->set_basic_Layout(); - - $this->showAddForm(); - - break; - - case 3://edit - if($this->unset_edit) - { - throw new Exception('You don\'t have permissions for this operation', 14); - die(); - } - - if($this->theme === null) - $this->set_theme($this->default_theme); - $this->setThemeBasics(); - - $this->set_basic_Layout(); - - $state_info = $this->getStateInfo(); - - $this->showEditForm($state_info); - - break; - - case 4://delete - if($this->unset_delete) - { - throw new Exception('This user is not allowed to do this operation', 14); - die(); - } - - $state_info = $this->getStateInfo(); - $delete_result = $this->db_delete($state_info); - - $this->delete_layout( $delete_result ); - break; - - case 5://insert - if($this->unset_add) - { - throw new Exception('This user is not allowed to do this operation', 14); - die(); - } - - $state_info = $this->getStateInfo(); - $insert_result = $this->db_insert($state_info); - - $this->insert_layout($insert_result); - break; - - case 6://update - if($this->unset_edit) - { - throw new Exception('This user is not allowed to do this operation', 14); - die(); - } - - $state_info = $this->getStateInfo(); - $update_result = $this->db_update($state_info); - - $this->update_layout( $update_result,$state_info); - break; - - case 7://ajax_list - - if($this->unset_list) - { - throw new Exception('You don\'t have permissions for this operation', 14); - die(); - } - - if($this->theme === null) - $this->set_theme($this->default_theme); - $this->setThemeBasics(); - - $this->set_basic_Layout(); - - $state_info = $this->getStateInfo(); - $this->set_ajax_list_queries($state_info); - - $this->showList(true); - - break; - - case 8://ajax_list_info - - if($this->theme === null) - $this->set_theme($this->default_theme); - $this->setThemeBasics(); - - $this->set_basic_Layout(); - - $state_info = $this->getStateInfo(); - $this->set_ajax_list_queries($state_info); - - $this->showListInfo(); - break; - - case 9://insert_validation - - $validation_result = $this->db_insert_validation(); - - $this->validation_layout($validation_result); - break; - - case 10://update_validation - - $validation_result = $this->db_update_validation(); - - $this->validation_layout($validation_result); - break; - - case 11://upload_file - - $state_info = $this->getStateInfo(); - - $upload_result = $this->upload_file($state_info); - - $this->upload_layout($upload_result, $state_info->field_name); - break; - - case 12://delete_file - $state_info = $this->getStateInfo(); - - $delete_file_result = $this->delete_file($state_info); - - $this->delete_file_layout($delete_file_result); - break; - /* - case 13: //ajax_relation - $state_info = $this->getStateInfo(); - - $ajax_relation_result = $this->ajax_relation($state_info); - - $ajax_relation_result[""] = ""; - - echo json_encode($ajax_relation_result); - die(); - break; - - case 14: //ajax_relation_n_n - echo json_encode(array("34" => 'Johnny' , "78" => "Test")); - die(); - break; - */ - case 16: //export to excel - //a big number just to ensure that the table characters will not be cutted. - $this->character_limiter = 1000000; - - if($this->unset_export) - { - throw new Exception('You don\'t have permissions for this operation', 15); - die(); - } - - if($this->theme === null) - $this->set_theme($this->default_theme); - $this->setThemeBasics(); - - $this->set_basic_Layout(); - - $state_info = $this->getStateInfo(); - $this->set_ajax_list_queries($state_info); - $this->exportToExcel($state_info); - break; - - case 17: //print - //a big number just to ensure that the table characters will not be cutted. - $this->character_limiter = 1000000; - - if($this->unset_print) - { - throw new Exception('You don\'t have permissions for this operation', 15); - die(); - } - - if($this->theme === null) - $this->set_theme($this->default_theme); - $this->setThemeBasics(); - - $this->set_basic_Layout(); - - $state_info = $this->getStateInfo(); - $this->set_ajax_list_queries($state_info); - $this->print_webpage($state_info); - break; - - case 18: //read - if($this->unset_read) - { - throw new Exception('You don\'t have permissions for this operation', 14); - die(); - } - - if($this->theme === null) - $this->set_theme($this->default_theme); - $this->setThemeBasics(); - - $this->set_basic_Layout(); - - $state_info = $this->getStateInfo(); - - $this->showReadForm($state_info); - break; - - } - - return $this->get_layout(); - } - - protected function get_common_data() - { - $data = (object)array(); - - $data->subject = $this->subject; - $data->subject_plural = $this->subject_plural; - - return $data; - } - - /** - * - * Enter description here ... - */ - public function callback_before_insert($callback = null) - { - $this->callback_before_insert = $callback; - - return $this; - } - - /** - * - * Enter description here ... - */ - public function callback_after_insert($callback = null) - { - $this->callback_after_insert = $callback; - - return $this; - } - - /** - * - * Enter description here ... - */ - public function callback_insert($callback = null) - { - $this->callback_insert = $callback; - - return $this; - } - - - /** - * - * Enter description here ... - */ - public function callback_before_update($callback = null) - { - $this->callback_before_update = $callback; - - return $this; - } - - /** - * - * Enter description here ... - */ - public function callback_after_update($callback = null) - { - $this->callback_after_update = $callback; - - return $this; - } - - - /** - * - * Enter description here ... - * @param mixed $callback - */ - public function callback_update($callback = null) - { - $this->callback_update = $callback; - - return $this; - } - - /** - * - * Enter description here ... - */ - public function callback_before_delete($callback = null) - { - $this->callback_before_delete = $callback; - - return $this; - } - - /** - * - * Enter description here ... - */ - public function callback_after_delete($callback = null) - { - $this->callback_after_delete = $callback; - - return $this; - } - - /** - * - * Enter description here ... - */ - public function callback_delete($callback = null) - { - $this->callback_delete = $callback; - - return $this; - } - - /** - * - * Enter description here ... - * @param string $column - * @param mixed $callback - */ - public function callback_column($column ,$callback = null) - { - $this->callback_column[$column] = $callback; - - return $this; - } - - /** - * - * Enter description here ... - * @param string $field - * @param mixed $callback - */ - public function callback_field($field, $callback = null) - { - $this->callback_add_field[$field] = $callback; - $this->callback_edit_field[$field] = $callback; - - return $this; - } - - /** - * - * Enter description here ... - * @param string $field - * @param mixed $callback - */ - public function callback_add_field($field, $callback = null) - { - $this->callback_add_field[$field] = $callback; - - return $this; - } - - /** - * - * Enter description here ... - * @param string $field - * @param mixed $callback - */ - public function callback_edit_field($field, $callback = null) - { - $this->callback_edit_field[$field] = $callback; - - return $this; - } - - /** - * - * Callback that replace the default auto uploader - * - * @param mixed $callback - * @return grocery_CRUD - */ - public function callback_upload($callback = null) - { - $this->callback_upload = $callback; - - return $this; - } - - /** - * - * A callback that triggered before the upload functionality. This callback is suggested for validation checks - * @param mixed $callback - * @return grocery_CRUD - */ - public function callback_before_upload($callback = null) - { - $this->callback_before_upload = $callback; - - return $this; - } - - /** - * - * A callback that triggered after the upload functionality - * @param mixed $callback - * @return grocery_CRUD - */ - public function callback_after_upload($callback = null) - { - $this->callback_after_upload = $callback; - - return $this; - - } - - /** - * - * Gets the basic database table of our crud. - * @return string - */ - public function get_table() - { - if($this->basic_db_table_checked) - { - return $this->basic_db_table; - } - elseif( $this->basic_db_table !== null ) - { - if(!$this->table_exists($this->basic_db_table)) - { - throw new Exception('The table name does not exist. Please check you database and try again.',11); - die(); - } - $this->basic_db_table_checked = true; - return $this->basic_db_table; - } - else - { - //Last try , try to find the table from your view / function name!!! Not suggested but it works . - $last_chance_table_name = $this->get_method_name(); - if($this->table_exists($last_chance_table_name)) - { - $this->set_table($last_chance_table_name); - } - $this->basic_db_table_checked = true; - return $this->basic_db_table; - - } - - return false; - } - - /** - * - * The field names of the required fields - */ - public function required_fields() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->required_fields = $args; - - return $this; - } - - /** - * Add the fields that they are as UNIQUE in the database structure - * - * @return grocery_CRUD - */ - public function unique_fields() - { - $args = func_get_args(); - - if(isset($args[0]) && is_array($args[0])) - { - $args = $args[0]; - } - - $this->_unique_fields = $args; - - return $this; - } - - /** - * - * Sets the basic database table that we will get our data. - * @param string $table_name - * @return grocery_CRUD - */ - public function set_table($table_name) - { - if(!empty($table_name) && $this->basic_db_table === null) - { - $this->basic_db_table = $table_name; - } - elseif(!empty($table_name)) - { - throw new Exception('You have already insert a table name once...', 1); - } - else - { - throw new Exception('The table name cannot be empty.', 2); - die(); - } - - return $this; - } - - /** - * Set a full URL path to this method. - * - * This method is useful when the path is not specified correctly. - * Especially when we are using routes. - * For example: - * Let's say we have the path http://www.example.com/ however the original url path is - * http://www.example.com/example/index . We have to specify the url so we can have - * all the CRUD operations correctly. - * The url path has to be set from this method like this: - * - * $crud->set_crud_url_path(site_url('example/index')); - * - * - * @param string $crud_url_path - * @param string $list_url_path - * @return grocery_CRUD - */ - public function set_crud_url_path($crud_url_path, $list_url_path = null) - { - $this->crud_url_path = $crud_url_path; - - //If the list_url_path is empty so we are guessing that the list_url_path - //will be the same with crud_url_path - $this->list_url_path = !empty($list_url_path) ? $list_url_path : $crud_url_path; - - return $this; - } - - /** - * - * Set a subject to understand what type of CRUD you use. - * @example In this CRUD we work with the table db_categories. The $subject will be the 'Category' - * @param string $subject - * @param bool $has_plural - * @return grocery_CRUD - */ - public function set_subject( $subject ) - { - $this->subject = $subject; - $this->subject_plural = $subject; - - return $this; - } - - /** - * - * Enter description here ... - * @param $title - * @param $image_url - * @param $url - * @param $css_class - * @param $url_callback - */ - public function add_action( $label, $image_url = '', $link_url = '', $css_class = '', $url_callback = null) - { - $unique_id = substr($label,0,1).substr(md5($label.$link_url),-8); //The unique id is used for class name so it must begin with a string - - $this->actions[$unique_id] = (object)array( - 'label' => $label, - 'image_url' => $image_url, - 'link_url' => $link_url, - 'css_class' => $css_class, - 'url_callback' => $url_callback, - 'url_has_http' => substr($link_url,0,7) == 'http://' || substr($link_url,0,8) == 'https://' ? true : false - ); - - return $this; - } - - /** - * - * Set a simple 1-n foreign key relation - * @param string $field_name - * @param string $related_table - * @param string $related_title_field - * @param mixed $where_clause - * @param string $order_by - */ - public function set_relation($field_name , $related_table, $related_title_field, $where_clause = null, $order_by = null) - { - $this->relation[$field_name] = array($field_name, $related_table,$related_title_field, $where_clause, $order_by); - return $this; - } - - /** - * - * Sets a relation with n-n relationship. - * @param string $field_name - * @param string $relation_table - * @param string $selection_table - * @param string $primary_key_alias_to_this_table - * @param string $primary_key_alias_to_selection_table - * @param string $title_field_selection_table - * @param string $priority_field_relation_table - * @param mixed $where_clause - */ - public function set_relation_n_n($field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table, $primary_key_alias_to_selection_table , $title_field_selection_table , $priority_field_relation_table = null, $where_clause = null) - { - $this->relation_n_n[$field_name] = - (object)array( - 'field_name' => $field_name, - 'relation_table' => $relation_table, - 'selection_table' => $selection_table, - 'primary_key_alias_to_this_table' => $primary_key_alias_to_this_table, - 'primary_key_alias_to_selection_table' => $primary_key_alias_to_selection_table , - 'title_field_selection_table' => $title_field_selection_table , - 'priority_field_relation_table' => $priority_field_relation_table, - 'where_clause' => $where_clause - ); - - return $this; - } - - /** - * - * Transform a field to an upload field - * - * @param string $field_name - * @param string $upload_path - */ - public function set_field_upload($field_name, $upload_dir = '') - { - $upload_dir = !empty($upload_dir) && substr($upload_dir,-1,1) == '/' - ? substr($upload_dir,0,-1) - : $upload_dir; - $upload_dir = !empty($upload_dir) ? $upload_dir : 'assets/uploads/files'; - - /** Check if the upload Url folder exists. If not then throw an exception **/ - if (!is_dir(FCPATH.$upload_dir)) { - throw new Exception("It seems that the folder \"".FCPATH.$upload_dir."\" for the field name - \"".$field_name."\" doesn't exists. Please create the folder and try again."); - } - - $this->upload_fields[$field_name] = (object) array( - 'field_name' => $field_name, - 'upload_path' => $upload_dir, - 'encrypted_field_name' => $this->_unique_field_name($field_name)); - return $this; - } -} - -if(defined('CI_VERSION')) -{ - $ci = &get_instance(); - $ci->load->library('Form_validation'); - - class grocery_CRUD_Form_validation extends CI_Form_validation{ - - public $CI; - public $_field_data = array(); - public $_config_rules = array(); - public $_error_array = array(); - public $_error_messages = array(); - public $_error_prefix = '

'; - public $_error_suffix = '

'; - public $error_string = ''; - public $_safe_form_data = FALSE; - } -} - -/* - * jQuery File Upload Plugin PHP Example 5.5 - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2010, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - */ - -class UploadHandler -{ - private $options; - public $default_config_path = null; - - function __construct($options=null) { - $this->options = array( - 'script_url' => $this->getFullUrl().'/'.basename(__FILE__), - 'upload_dir' => dirname(__FILE__).'/files/', - 'upload_url' => $this->getFullUrl().'/files/', - 'param_name' => 'files', - // The php.ini settings upload_max_filesize and post_max_size - // take precedence over the following max_file_size setting: - 'max_file_size' => null, - 'min_file_size' => 1, - 'accept_file_types' => '/.+$/i', - 'max_number_of_files' => null, - // Set the following option to false to enable non-multipart uploads: - 'discard_aborted_uploads' => true, - // Set to true to rotate images based on EXIF meta data, if available: - 'orient_image' => false, - 'image_versions' => array( - // Uncomment the following version to restrict the size of - // uploaded images. You can also add additional versions with - // their own upload directories: - /* - 'large' => array( - 'upload_dir' => dirname(__FILE__).'/files/', - 'upload_url' => dirname($_SERVER['PHP_SELF']).'/files/', - 'max_width' => 1920, - 'max_height' => 1200 - ), - - 'thumbnail' => array( - 'upload_dir' => dirname(__FILE__).'/thumbnails/', - 'upload_url' => $this->getFullUrl().'/thumbnails/', - 'max_width' => 80, - 'max_height' => 80 - ) - */ - ) - ); - if ($options) { - // Or else for PHP >= 5.3.0 use: $this->options = array_replace_recursive($this->options, $options); - foreach($options as $option_name => $option) - { - $this->options[$option_name] = $option; - } - } - } - - function getFullUrl() { - return - (isset($_SERVER['HTTPS']) ? 'https://' : 'http://'). - (isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : ''). - (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME']. - (isset($_SERVER['HTTPS']) && $_SERVER['SERVER_PORT'] === 443 || - $_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))). - substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/')); - } - - private function get_file_object($file_name) { - $file_path = $this->options['upload_dir'].$file_name; - if (is_file($file_path) && $file_name[0] !== '.') { - $file = new stdClass(); - $file->name = $file_name; - $file->size = filesize($file_path); - $file->url = $this->options['upload_url'].rawurlencode($file->name); - foreach($this->options['image_versions'] as $version => $options) { - if (is_file($options['upload_dir'].$file_name)) { - $file->{$version.'_url'} = $options['upload_url'] - .rawurlencode($file->name); - } - } - $file->delete_url = $this->options['script_url'] - .'?file='.rawurlencode($file->name); - $file->delete_type = 'DELETE'; - return $file; - } - return null; - } - - private function get_file_objects() { - return array_values(array_filter(array_map( - array($this, 'get_file_object'), - scandir($this->options['upload_dir']) - ))); - } - - private function create_scaled_image($file_name, $options) { - $file_path = $this->options['upload_dir'].$file_name; - $new_file_path = $options['upload_dir'].$file_name; - list($img_width, $img_height) = @getimagesize($file_path); - if (!$img_width || !$img_height) { - return false; - } - $scale = min( - $options['max_width'] / $img_width, - $options['max_height'] / $img_height - ); - if ($scale > 1) { - $scale = 1; - } - $new_width = $img_width * $scale; - $new_height = $img_height * $scale; - $new_img = @imagecreatetruecolor($new_width, $new_height); - switch (strtolower(substr(strrchr($file_name, '.'), 1))) { - case 'jpg': - case 'jpeg': - $src_img = @imagecreatefromjpeg($file_path); - $write_image = 'imagejpeg'; - break; - case 'gif': - @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0)); - $src_img = @imagecreatefromgif($file_path); - $write_image = 'imagegif'; - break; - case 'png': - @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0)); - @imagealphablending($new_img, false); - @imagesavealpha($new_img, true); - $src_img = @imagecreatefrompng($file_path); - $write_image = 'imagepng'; - break; - default: - $src_img = $image_method = null; - } - $success = $src_img && @imagecopyresampled( - $new_img, - $src_img, - 0, 0, 0, 0, - $new_width, - $new_height, - $img_width, - $img_height - ) && $write_image($new_img, $new_file_path); - // Free up memory (imagedestroy does not delete files): - @imagedestroy($src_img); - @imagedestroy($new_img); - return $success; - } - - private function has_error($uploaded_file, $file, $error) { - if ($error) { - switch($error) { - case UPLOAD_ERR_INI_SIZE: - return 'The uploaded file exceeds the upload_max_filesize directive in php.ini.'; - break; - case UPLOAD_ERR_PARTIAL: - return 'The uploaded file was only partially uploaded.'; - break; - case UPLOAD_ERR_NO_FILE: - return 'No file was uploaded.'; - break; - case UPLOAD_ERR_CANT_WRITE: - return 'Failed to write file to disk.'; - break; - case UPLOAD_ERR_EXTENSION: - return 'File upload stopped by extension.'; - break; - default: - return $error; - break; - } - } - if (!preg_match($this->options['accept_file_types'], $file->name)) { - return 'acceptFileTypes'; - } - if ($uploaded_file && is_uploaded_file($uploaded_file)) { - $file_size = filesize($uploaded_file); - } else { - $file_size = $_SERVER['CONTENT_LENGTH']; - } - - if ($this->options['max_file_size'] && ( - $file_size > $this->options['max_file_size'] || - $file->size > $this->options['max_file_size']) - ) { - return 'maxFileSize'; - } - if ($this->options['min_file_size'] && - $file_size < $this->options['min_file_size']) { - return 'minFileSize'; - } - if (is_int($this->options['max_number_of_files']) && ( - count($this->get_file_objects()) >= $this->options['max_number_of_files']) - ) { - return 'maxNumberOfFiles'; - } - return $error; - } - - private function trim_file_name($name, $type) { - // Remove path information and dots around the filename, to prevent uploading - // into different directories or replacing hidden system files. - // Also remove control characters and spaces (\x00..\x20) around the filename: - $file_name = trim(basename(stripslashes($name)), ".\x00..\x20"); - // Add missing file extension for known image types: - if (strpos($file_name, '.') === false && - preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) { - $file_name .= '.'.$matches[1]; - } - - //Ensure that we don't have disallowed characters and add a unique id just to ensure that the file name will be unique - $file_name = substr(uniqid(),-5).'-'.$this->_transliterate_characters($file_name); - - //all the characters has to be lowercase - $file_name = strtolower($file_name); - - return $file_name; - } - - private function _transliterate_characters($file_name) - { - include($this->default_config_path.'/translit_chars.php'); - if ( ! isset($translit_characters)) - { - return preg_replace("/([^a-zA-Z0-9\.\-\_]+?){1}/i", '-', $file_name); - } - $transformed_file_name = preg_replace(array_keys($translit_characters), array_values($translit_characters), $file_name); - return str_replace(" ", "-", $transformed_file_name); - } - - private function orient_image($file_path) { - $exif = exif_read_data($file_path); - $orientation = intval(@$exif['Orientation']); - if (!in_array($orientation, array(3, 6, 8))) { - return false; - } - $image = @imagecreatefromjpeg($file_path); - switch ($orientation) { - case 3: - $image = @imagerotate($image, 180, 0); - break; - case 6: - $image = @imagerotate($image, 270, 0); - break; - case 8: - $image = @imagerotate($image, 90, 0); - break; - default: - return false; - } - $success = imagejpeg($image, $file_path); - // Free up memory (imagedestroy does not delete files): - @imagedestroy($image); - return $success; - } - - private function handle_file_upload($uploaded_file, $name, $size, $type, $error) { - $file = new stdClass(); - $file->name = $this->trim_file_name($name, $type); - $file->size = intval($size); - $file->type = $type; - $error = $this->has_error($uploaded_file, $file, $error); - if (!$error && $file->name) { - $file_path = $this->options['upload_dir'].$file->name; - $append_file = !$this->options['discard_aborted_uploads'] && - is_file($file_path) && $file->size > filesize($file_path); - clearstatcache(); - if ($uploaded_file && is_uploaded_file($uploaded_file)) { - // multipart/formdata uploads (POST method uploads) - if ($append_file) { - file_put_contents( - $file_path, - fopen($uploaded_file, 'r'), - FILE_APPEND - ); - } else { - move_uploaded_file($uploaded_file, $file_path); - } - } else { - // Non-multipart uploads (PUT method support) - file_put_contents( - $file_path, - fopen('php://input', 'r'), - $append_file ? FILE_APPEND : 0 - ); - } - $file_size = filesize($file_path); - if ($file_size === $file->size) { - if ($this->options['orient_image']) { - $this->orient_image($file_path); - } - $file->url = $this->options['upload_url'].rawurlencode($file->name); - foreach($this->options['image_versions'] as $version => $options) { - if ($this->create_scaled_image($file->name, $options)) { - $file->{$version.'_url'} = $options['upload_url'] - .rawurlencode($file->name); - } - } - } else if ($this->options['discard_aborted_uploads']) { - unlink($file_path); - $file->error = "It seems that this user doesn't have permissions to upload to this folder"; - } - $file->size = $file_size; - $file->delete_url = $this->options['script_url'] - .'?file='.rawurlencode($file->name); - $file->delete_type = 'DELETE'; - } else { - $file->error = $error; - } - return $file; - } - - public function get() { - $file_name = isset($_REQUEST['file']) ? - basename(stripslashes($_REQUEST['file'])) : null; - if ($file_name) { - $info = $this->get_file_object($file_name); - } else { - $info = $this->get_file_objects(); - } - header('Content-type: application/json'); - echo json_encode($info); - } - - public function post() { - if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { - return $this->delete(); - } - $upload = isset($_FILES[$this->options['param_name']]) ? - $_FILES[$this->options['param_name']] : null; - $info = array(); - if ($upload && is_array($upload['tmp_name'])) { - foreach ($upload['tmp_name'] as $index => $value) { - $info[] = $this->handle_file_upload( - $upload['tmp_name'][$index], - isset($_SERVER['HTTP_X_FILE_NAME']) ? - $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index], - isset($_SERVER['HTTP_X_FILE_SIZE']) ? - $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index], - isset($_SERVER['HTTP_X_FILE_TYPE']) ? - $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index], - $upload['error'][$index] - ); - } - } elseif ($upload || isset($_SERVER['HTTP_X_FILE_NAME'])) { - $info[] = $this->handle_file_upload( - isset($upload['tmp_name']) ? $upload['tmp_name'] : null, - isset($_SERVER['HTTP_X_FILE_NAME']) ? - $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'], - isset($_SERVER['HTTP_X_FILE_SIZE']) ? - $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'], - isset($_SERVER['HTTP_X_FILE_TYPE']) ? - $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'], - isset($upload['error']) ? $upload['error'] : null - ); - } - header('Vary: Accept'); - - $redirect = isset($_REQUEST['redirect']) ? - stripslashes($_REQUEST['redirect']) : null; - if ($redirect) { - header('Location: '.sprintf($redirect, rawurlencode($json))); - return; - } - if (isset($_SERVER['HTTP_ACCEPT']) && - (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) { - header('Content-type: application/json'); - } else { - header('Content-type: text/plain'); - } - return $info; - } - - public function delete() { - $file_name = isset($_REQUEST['file']) ? - basename(stripslashes($_REQUEST['file'])) : null; - $file_path = $this->options['upload_dir'].$file_name; - $success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path); - if ($success) { - foreach($this->options['image_versions'] as $version => $options) { - $file = $options['upload_dir'].$file_name; - if (is_file($file)) { - unlink($file); - } - } - } - header('Content-type: application/json'); - echo json_encode($success); - } - -} + + */ + +// ------------------------------------------------------------------------ + +/** + * grocery Field Types + * + * The types of the fields and the default reactions + * + * @package grocery CRUD + * @author John Skoumbourdis + * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt + * @link http://www.grocerycrud.com/documentation + */ +class grocery_CRUD_Field_Types +{ + /** + * Gets the field types of the main table. + * @return array + */ + public function get_field_types() + { + if ($this->field_types !== null) { + return $this->field_types; + } + + $types = array(); + foreach($this->basic_model->get_field_types_basic_table() as $field_info) + { + $field_info->required = !empty($this->required_fields) && in_array($field_info->name,$this->required_fields) ? true : false; + + $field_info->display_as = + isset($this->display_as[$field_info->name]) ? + $this->display_as[$field_info->name] : + ucfirst(str_replace("_"," ",$field_info->name)); + + if($this->change_field_type !== null && isset($this->change_field_type[$field_info->name])) + { + $field_type = $this->change_field_type[$field_info->name]; + + if (isset($this->relation[$field_info->name])) { + $field_info->crud_type = "relation_".$field_type->type; + } + elseif (isset($this->upload_fields[$field_info->name])) { + $field_info->crud_type = "upload_file_".$field_type->type; + } else { + $field_info->crud_type = $field_type->type; + $field_info->extras = $field_type->extras; + } + + $real_type = $field_info->crud_type; + } + elseif(isset($this->relation[$field_info->name])) + { + $real_type = 'relation'; + $field_info->crud_type = 'relation'; + } + elseif(isset($this->upload_fields[$field_info->name])) + { + $real_type = 'upload_file'; + $field_info->crud_type = 'upload_file'; + } + else + { + $real_type = $this->get_type($field_info); + $field_info->crud_type = $real_type; + } + + switch ($real_type) { + case 'text': + if(!empty($this->unset_texteditor) && in_array($field_info->name,$this->unset_texteditor)) + $field_info->extras = false; + else + $field_info->extras = 'text_editor'; + break; + + case 'relation': + case 'relation_readonly': + $field_info->extras = $this->relation[$field_info->name]; + break; + + case 'upload_file': + case 'upload_file_readonly': + $field_info->extras = $this->upload_fields[$field_info->name]; + break; + + default: + if(empty($field_info->extras)) + $field_info->extras = false; + break; + } + + $types[$field_info->name] = $field_info; + } + + if(!empty($this->relation_n_n)) + { + foreach($this->relation_n_n as $field_name => $field_extras) + { + $is_read_only = $this->change_field_type !== null + && isset($this->change_field_type[$field_name]) + && $this->change_field_type[$field_name]->type == 'readonly' + ? true : false; + $field_info = (object)array(); + $field_info->name = $field_name; + $field_info->crud_type = $is_read_only ? 'readonly' : 'relation_n_n'; + $field_info->extras = $field_extras; + $field_info->required = !empty($this->required_fields) && in_array($field_name,$this->required_fields) ? true : false;; + $field_info->display_as = + isset($this->display_as[$field_name]) ? + $this->display_as[$field_name] : + ucfirst(str_replace("_"," ",$field_name)); + + $types[$field_name] = $field_info; + } + } + + if(!empty($this->add_fields)) + foreach($this->add_fields as $field_object) + { + $field_name = isset($field_object->field_name) ? $field_object->field_name : $field_object; + + if(!isset($types[$field_name]))//Doesn't exist in the database? Create it for the CRUD + { + $extras = false; + if($this->change_field_type !== null && isset($this->change_field_type[$field_name])) + { + $field_type = $this->change_field_type[$field_name]; + $extras = $field_type->extras; + } + + $field_info = (object)array( + 'name' => $field_name, + 'crud_type' => $this->change_field_type !== null && isset($this->change_field_type[$field_name]) ? + $this->change_field_type[$field_name]->type : + 'string', + 'display_as' => isset($this->display_as[$field_name]) ? + $this->display_as[$field_name] : + ucfirst(str_replace("_"," ",$field_name)), + 'required' => in_array($field_name,$this->required_fields) ? true : false, + 'extras' => $extras + ); + + $types[$field_name] = $field_info; + } + } + + if(!empty($this->edit_fields)) + foreach($this->edit_fields as $field_object) + { + $field_name = isset($field_object->field_name) ? $field_object->field_name : $field_object; + + if(!isset($types[$field_name]))//Doesn't exist in the database? Create it for the CRUD + { + $extras = false; + if($this->change_field_type !== null && isset($this->change_field_type[$field_name])) + { + $field_type = $this->change_field_type[$field_name]; + $extras = $field_type->extras; + } + + $field_info = (object)array( + 'name' => $field_name, + 'crud_type' => $this->change_field_type !== null && isset($this->change_field_type[$field_name]) ? + $this->change_field_type[$field_name]->type : + 'string', + 'display_as' => isset($this->display_as[$field_name]) ? + $this->display_as[$field_name] : + ucfirst(str_replace("_"," ",$field_name)), + 'required' => in_array($field_name,$this->required_fields) ? true : false, + 'extras' => $extras + ); + + $types[$field_name] = $field_info; + } + } + + $this->field_types = $types; + + return $this->field_types; + } + + public function get_primary_key() + { + return $this->basic_model->get_primary_key(); + } + + /** + * Get the html input for the specific field with the + * current value + * + * @param object $field_info + * @param string $value + * @return object + */ + protected function get_field_input($field_info, $value = null) + { + $real_type = $field_info->crud_type; + + $types_array = array( + 'integer', + 'text', + 'true_false', + 'string', + 'date', + 'datetime', + 'enum', + 'set', + 'relation', + 'relation_readonly', + 'relation_n_n', + 'upload_file', + 'upload_file_readonly', + 'hidden', + 'password', + 'readonly', + 'dropdown', + 'multiselect' + ); + + if (in_array($real_type,$types_array)) { + /* A quick way to go to an internal method of type $this->get_{type}_input . + * For example if the real type is integer then we will use the method + * $this->get_integer_input + * */ + $field_info->input = $this->{"get_".$real_type."_input"}($field_info,$value); + } + else + { + $field_info->input = $this->get_string_input($field_info,$value); + } + + return $field_info; + } + + protected function change_list_value($field_info, $value = null) + { + $real_type = $field_info->crud_type; + + switch ($real_type) { + case 'hidden': + case 'invisible': + case 'integer': + + break; + case 'true_false': + if(is_array($field_info->extras) && array_key_exists($value,$field_info->extras)) { + $value = $field_info->extras[$value]; + } else if(isset($this->default_true_false_text[$value])) { + $value = $this->default_true_false_text[$value]; + } + break; + case 'string': + $value = $this->character_limiter($value,$this->character_limiter,"..."); + break; + case 'text': + $value = $this->character_limiter(strip_tags($value),$this->character_limiter,"..."); + break; + case 'date': + if(!empty($value) && $value != '0000-00-00' && $value != '1970-01-01') + { + list($year,$month,$day) = explode("-",$value); + + $value = date($this->php_date_format, mktime (0, 0, 0, (int)$month , (int)$day , (int)$year)); + } + else + { + $value = ''; + } + break; + case 'datetime': + if(!empty($value) && $value != '0000-00-00 00:00:00' && $value != '1970-01-01 00:00:00') + { + list($year,$month,$day) = explode("-",$value); + list($hours,$minutes) = explode(":",substr($value,11)); + + $value = date($this->php_date_format." - H:i", mktime ((int)$hours , (int)$minutes , 0, (int)$month , (int)$day ,(int)$year)); + } + else + { + $value = ''; + } + break; + case 'enum': + $value = $this->character_limiter($value,$this->character_limiter,"..."); + break; + + case 'multiselect': + $value_as_array = array(); + foreach(explode(",",$value) as $row_value) + { + $value_as_array[] = array_key_exists($row_value,$field_info->extras) ? $field_info->extras[$row_value] : $row_value; + } + $value = implode(",",$value_as_array); + break; + + case 'relation_n_n': + $value = $this->character_limiter(str_replace(',',', ',$value),$this->character_limiter,"..."); + break; + + case 'password': + $value = '******'; + break; + + case 'dropdown': + $value = array_key_exists($value,$field_info->extras) ? $field_info->extras[$value] : $value; + break; + + case 'upload_file': + if(empty($value)) + { + $value = ""; + } + else + { + $is_image = !empty($value) && + ( substr($value,-4) == '.jpg' + || substr($value,-4) == '.png' + || substr($value,-5) == '.jpeg' + || substr($value,-4) == '.gif' + || substr($value,-5) == '.tiff') + ? true : false; + + $file_url = base_url().$field_info->extras->upload_path."/$value"; + + $file_url_anchor = ''; + } + else + { + $file_url_anchor .= ' target="_blank">'.$this->character_limiter($value,$this->character_limiter,'...',true); + } + $file_url_anchor .= ''; + + $value = $file_url_anchor; + } + break; + + default: + $value = $this->character_limiter($value,$this->character_limiter,"..."); + break; + } + + return $value; + } + + /** + * Character Limiter of codeigniter (I just don't want to load the helper ) + * + * Limits the string based on the character count. Preserves complete words + * so the character count may not be exactly as specified. + * + * @access public + * @param string + * @param integer + * @param string the end character. Usually an ellipsis + * @return string + */ + function character_limiter($str, $n = 500, $end_char = '…') + { + if (strlen($str) < $n) + { + return $str; + } + + // a bit complicated, but faster than preg_replace with \s+ + $str = preg_replace('/ {2,}/', ' ', str_replace(array("\r", "\n", "\t", "\x0B", "\x0C"), ' ', $str)); + + if (strlen($str) <= $n) + { + return $str; + } + + $out = ''; + foreach (explode(' ', trim($str)) as $val) + { + $out .= $val.' '; + + if (strlen($out) >= $n) + { + $out = trim($out); + return (strlen($out) === strlen($str)) ? $out : $out.$end_char; + } + } + } + + protected function get_type($db_type) + { + $type = false; + if(!empty($db_type->type)) + { + switch ($db_type->type) { + case '1': + case '3': + case 'int': + case 'tinyint': + case 'mediumint': + case 'longint': + if( $db_type->db_type == 'tinyint' && $db_type->db_max_length == 1) + $type = 'true_false'; + else + $type = 'integer'; + break; + case '254': + case 'string': + case 'enum': + if($db_type->db_type != 'enum') + $type = 'string'; + else + $type = 'enum'; + break; + case 'set': + if($db_type->db_type != 'set') + $type = 'string'; + else + $type = 'set'; + break; + case '252': + case 'blob': + case 'text': + case 'mediumtext': + case 'longtext': + $type = 'text'; + break; + case '10': + case 'date': + $type = 'date'; + break; + case '12': + case 'datetime': + case 'timestamp': + $type = 'datetime'; + break; + } + } + return $type; + } +} + +// ------------------------------------------------------------------------ + +/** + * Grocery Model Driver + * + * Drives the model - I'ts so easy like you drive a bicycle :-) + * + * @package grocery CRUD + * @author John Skoumbourdis + * @version 1.4.1 + * @link http://www.grocerycrud.com/documentation + */ +class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types +{ + /** + * @var grocery_CRUD_Model + */ + public $basic_model = null; + + protected function set_default_Model() + { + $ci = &get_instance(); + $ci->load->model('grocery_CRUD_Model'); + + $this->basic_model = new grocery_CRUD_Model(); + } + + protected function get_total_results() + { + if(!empty($this->where)) + foreach($this->where as $where) + $this->basic_model->where($where[0],$where[1],$where[2]); + + if(!empty($this->or_where)) + foreach($this->or_where as $or_where) + $this->basic_model->or_where($or_where[0],$or_where[1],$or_where[2]); + + if(!empty($this->like)) + foreach($this->like as $like) + $this->basic_model->like($like[0],$like[1],$like[2]); + + if(!empty($this->or_like)) + foreach($this->or_like as $or_like) + $this->basic_model->or_like($or_like[0],$or_like[1],$or_like[2]); + + if(!empty($this->having)) + foreach($this->having as $having) + $this->basic_model->having($having[0],$having[1],$having[2]); + + if(!empty($this->or_having)) + foreach($this->or_having as $or_having) + $this->basic_model->or_having($or_having[0],$or_having[1],$or_having[2]); + + if(!empty($this->relation)) + foreach($this->relation as $relation) + $this->basic_model->join_relation($relation[0],$relation[1],$relation[2]); + + if(!empty($this->relation_n_n)) + { + $columns = $this->get_columns(); + foreach($columns as $column) + { + //Use the relation_n_n ONLY if the column is called . The set_relation_n_n are slow and it will make the table slower without any reason as we don't need those queries. + if(isset($this->relation_n_n[$column->field_name])) + { + $this->basic_model->set_relation_n_n_field($this->relation_n_n[$column->field_name]); + } + } + + } + + return $this->basic_model->get_total_results(); + } + + public function set_model($model_name) + { + $ci = &get_instance(); + $ci->load->model('grocery_CRUD_Model'); + + $ci->load->model($model_name); + + $temp = explode('/',$model_name); + krsort($temp); + foreach($temp as $t) + { + $real_model_name = $t; + break; + } + + $this->basic_model = $ci->$real_model_name; + } + + protected function set_ajax_list_queries($state_info = null) + { + if(!empty($state_info->per_page)) + { + if(empty($state_info->page) || !is_numeric($state_info->page) ) + $this->limit($state_info->per_page); + else + { + $limit_page = ( ($state_info->page-1) * $state_info->per_page ); + $this->limit($state_info->per_page, $limit_page); + } + } + + if(!empty($state_info->order_by)) + { + $this->order_by($state_info->order_by[0],$state_info->order_by[1]); + } + + if(!empty($state_info->search)) + { + if(!empty($this->relation)) + foreach($this->relation as $relation_name => $relation_values) + $temp_relation[$this->_unique_field_name($relation_name)] = $this->_get_field_names_to_search($relation_values); + + if($state_info->search->field !== null) + { + if(isset($temp_relation[$state_info->search->field])) + { + if(is_array($temp_relation[$state_info->search->field])) + foreach($temp_relation[$state_info->search->field] as $search_field) + $this->or_like($search_field , $state_info->search->text); + else + $this->like($temp_relation[$state_info->search->field] , $state_info->search->text); + } + elseif(isset($this->relation_n_n[$state_info->search->field])) + { + $escaped_text = $this->basic_model->escape_str($state_info->search->text); + $this->having($state_info->search->field." LIKE '%".$escaped_text."%'"); + } + else + { + $this->like($state_info->search->field , $state_info->search->text); + } + } + else + { + $columns = $this->get_columns(); + + $search_text = $state_info->search->text; + + if(!empty($this->where)) + foreach($this->where as $where) + $this->basic_model->having($where[0],$where[1],$where[2]); + + foreach($columns as $column) + { + if(isset($temp_relation[$column->field_name])) + { + if(is_array($temp_relation[$column->field_name])) + { + foreach($temp_relation[$column->field_name] as $search_field) + { + $this->or_like($search_field, $search_text); + } + } + else + { + $this->or_like($temp_relation[$column->field_name], $search_text); + } + } + elseif(isset($this->relation_n_n[$column->field_name])) + { + //@todo have a where for the relation_n_n statement + } + else + { + $this->or_like($column->field_name, $search_text); + } + } + } + } + } + + protected function table_exists($table_name = null) + { + if($this->basic_model->db_table_exists($table_name)) + return true; + return false; + } + + protected function get_relation_array($relation_info, $primary_key_value = null, $limit = null) + { + list($field_name , $related_table , $related_field_title, $where_clause, $order_by) = $relation_info; + + if($primary_key_value !== null) + { + $primary_key = $this->basic_model->get_primary_key($related_table); + + //A where clause with the primary key is enough to take the selected key row + $where_clause = array($primary_key => $primary_key_value); + } + + $relation_array = $this->basic_model->get_relation_array($field_name , $related_table , $related_field_title, $where_clause, $order_by, $limit); + + return $relation_array; + } + + protected function get_relation_total_rows($relation_info) + { + list($field_name , $related_table , $related_field_title, $where_clause) = $relation_info; + + $relation_array = $this->basic_model->get_relation_total_rows($field_name , $related_table , $related_field_title, $where_clause); + + return $relation_array; + } + + protected function db_insert_validation() + { + $validation_result = (object)array('success'=>false); + + $field_types = $this->get_field_types(); + $required_fields = $this->required_fields; + $unique_fields = $this->_unique_fields; + $add_fields = $this->get_add_fields(); + + if(!empty($required_fields)) + { + foreach($add_fields as $add_field) + { + $field_name = $add_field->field_name; + if(!isset($this->validation_rules[$field_name]) && in_array( $field_name, $required_fields) ) + { + $this->set_rules( $field_name, $field_types[$field_name]->display_as, 'required'); + } + } + } + + /** Checking for unique fields. If the field value is not unique then + * return a validation error straight away, if not continue... */ + if(!empty($unique_fields)) + { + $form_validation = $this->form_validation(); + + foreach($add_fields as $add_field) + { + $field_name = $add_field->field_name; + if(in_array( $field_name, $unique_fields) ) + { + $form_validation->set_rules( $field_name, + $field_types[$field_name]->display_as, + 'is_unique['.$this->basic_db_table.'.'.$field_name.']'); + } + } + + if(!$form_validation->run()) + { + $validation_result->error_message = $form_validation->error_string(); + $validation_result->error_fields = $form_validation->_error_array; + + return $validation_result; + } + } + + if(!empty($this->validation_rules)) + { + $form_validation = $this->form_validation(); + + $add_fields = $this->get_add_fields(); + + foreach($add_fields as $add_field) + { + $field_name = $add_field->field_name; + if(isset($this->validation_rules[$field_name])) + { + $rule = $this->validation_rules[$field_name]; + $form_validation->set_rules($rule['field'],$rule['label'],$rule['rules']); + } + } + + if($form_validation->run()) + { + $validation_result->success = true; + } + else + { + $validation_result->error_message = $form_validation->error_string(); + $validation_result->error_fields = $form_validation->_error_array; + } + } + else + { + $validation_result->success = true; + } + + return $validation_result; + } + + protected function form_validation() + { + if($this->form_validation === null) + { + $this->form_validation = new grocery_CRUD_Form_validation(); + $ci = &get_instance(); + $ci->load->library('form_validation'); + $ci->form_validation = $this->form_validation; + } + return $this->form_validation; + } + + protected function db_update_validation() + { + $validation_result = (object)array('success'=>false); + + $field_types = $this->get_field_types(); + $required_fields = $this->required_fields; + $unique_fields = $this->_unique_fields; + $edit_fields = $this->get_edit_fields(); + + if(!empty($required_fields)) + { + foreach($edit_fields as $edit_field) + { + $field_name = $edit_field->field_name; + if(!isset($this->validation_rules[$field_name]) && in_array( $field_name, $required_fields) ) + { + $this->set_rules( $field_name, $field_types[$field_name]->display_as, 'required'); + } + } + } + + + /** Checking for unique fields. If the field value is not unique then + * return a validation error straight away, if not continue... */ + if(!empty($unique_fields)) + { + $form_validation = $this->form_validation(); + + $form_validation_check = false; + + foreach($edit_fields as $edit_field) + { + $field_name = $edit_field->field_name; + if(in_array( $field_name, $unique_fields) ) + { + $state_info = $this->getStateInfo(); + $primary_key = $this->get_primary_key(); + $field_name_value = $_POST[$field_name]; + + $this->basic_model->where($primary_key,$state_info->primary_key); + $row = $this->basic_model->get_row(); + + if(!isset($row->$field_name)) { + throw new Exception("The field name doesn't exist in the database. ". + "Please use the unique fields only for fields ". + "that exist in the database"); + } + + $previous_field_name_value = $row->$field_name; + + if(!empty($previous_field_name_value) && $previous_field_name_value != $field_name_value) { + $form_validation->set_rules( $field_name, + $field_types[$field_name]->display_as, + 'is_unique['.$this->basic_db_table.'.'.$field_name.']'); + + $form_validation_check = true; + } + } + } + + if($form_validation_check && !$form_validation->run()) + { + $validation_result->error_message = $form_validation->error_string(); + $validation_result->error_fields = $form_validation->_error_array; + + return $validation_result; + } + } + + if(!empty($this->validation_rules)) + { + $form_validation = $this->form_validation(); + + $edit_fields = $this->get_edit_fields(); + + foreach($edit_fields as $edit_field) + { + $field_name = $edit_field->field_name; + if(isset($this->validation_rules[$field_name])) + { + $rule = $this->validation_rules[$field_name]; + $form_validation->set_rules($rule['field'],$rule['label'],$rule['rules']); + } + } + + if($form_validation->run()) + { + $validation_result->success = true; + } + else + { + $validation_result->error_message = $form_validation->error_string(); + $validation_result->error_fields = $form_validation->_error_array; + } + } + else + { + $validation_result->success = true; + } + + return $validation_result; + } + + protected function db_insert($state_info) + { + $validation_result = $this->db_insert_validation(); + + if($validation_result->success) + { + $post_data = $state_info->unwrapped_data; + + $add_fields = $this->get_add_fields(); + + if($this->callback_insert === null) + { + if($this->callback_before_insert !== null) + { + $callback_return = call_user_func($this->callback_before_insert, $post_data); + + if(!empty($callback_return) && is_array($callback_return)) + $post_data = $callback_return; + elseif($callback_return === false) + return false; + } + + $insert_data = array(); + $types = $this->get_field_types(); + foreach($add_fields as $num_row => $field) + { + /* If the multiselect or the set is empty then the browser doesn't send an empty array. Instead it sends nothing */ + if(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect') && !isset($post_data[$field->field_name])) + { + $post_data[$field->field_name] = array(); + } + + if(isset($post_data[$field->field_name]) && !isset($this->relation_n_n[$field->field_name])) + { + if(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && is_array($post_data[$field->field_name]) && empty($post_data[$field->field_name])) + { + $insert_data[$field->field_name] = null; + } + elseif(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && $post_data[$field->field_name] === '') + { + $insert_data[$field->field_name] = null; + } + elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'date') + { + $insert_data[$field->field_name] = $this->_convert_date_to_sql_date($post_data[$field->field_name]); + } + elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'readonly') + { + //This empty if statement is to make sure that a readonly field will never inserted/updated + } + elseif(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect')) + { + $insert_data[$field->field_name] = !empty($post_data[$field->field_name]) ? implode(',',$post_data[$field->field_name]) : ''; + } + elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'datetime'){ + $insert_data[$field->field_name] = $this->_convert_date_to_sql_date(substr($post_data[$field->field_name],0,10)). + substr($post_data[$field->field_name],10); + } + else + { + $insert_data[$field->field_name] = $post_data[$field->field_name]; + } + } + } + + $insert_result = $this->basic_model->db_insert($insert_data); + + if($insert_result !== false) + { + $insert_primary_key = $insert_result; + } + else + { + return false; + } + + if(!empty($this->relation_n_n)) + { + foreach($this->relation_n_n as $field_name => $field_info) + { + $relation_data = isset( $post_data[$field_name] ) ? $post_data[$field_name] : array() ; + $this->db_relation_n_n_update($field_info, $relation_data ,$insert_primary_key); + } + } + + if($this->callback_after_insert !== null) + { + $callback_return = call_user_func($this->callback_after_insert, $post_data, $insert_primary_key); + + if($callback_return === false) + { + return false; + } + + } + }else + { + $callback_return = call_user_func($this->callback_insert, $post_data); + + if($callback_return === false) + { + return false; + } + } + + if(isset($insert_primary_key)) + return $insert_primary_key; + else + return true; + } + + return false; + + } + + protected function db_update($state_info) + { + $validation_result = $this->db_update_validation(); + + $edit_fields = $this->get_edit_fields(); + + if($validation_result->success) + { + $post_data = $state_info->unwrapped_data; + $primary_key = $state_info->primary_key; + + if($this->callback_update === null) + { + if($this->callback_before_update !== null) + { + $callback_return = call_user_func($this->callback_before_update, $post_data, $primary_key); + + if(!empty($callback_return) && is_array($callback_return)) + { + $post_data = $callback_return; + } + elseif($callback_return === false) + { + return false; + } + + } + + $update_data = array(); + $types = $this->get_field_types(); + foreach($edit_fields as $num_row => $field) + { + /* If the multiselect or the set is empty then the browser doesn't send an empty array. Instead it sends nothing */ + if(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect') && !isset($post_data[$field->field_name])) + { + $post_data[$field->field_name] = array(); + } + + if(isset($post_data[$field->field_name]) && !isset($this->relation_n_n[$field->field_name])) + { + if(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && is_array($post_data[$field->field_name]) && empty($post_data[$field->field_name])) + { + $update_data[$field->field_name] = null; + } + elseif(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && $post_data[$field->field_name] === '') + { + $update_data[$field->field_name] = null; + } + elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'date') + { + $update_data[$field->field_name] = $this->_convert_date_to_sql_date($post_data[$field->field_name]); + } + elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'readonly') + { + //This empty if statement is to make sure that a readonly field will never inserted/updated + } + elseif(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect')) + { + $update_data[$field->field_name] = !empty($post_data[$field->field_name]) ? implode(',',$post_data[$field->field_name]) : ''; + } + elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'datetime'){ + $update_data[$field->field_name] = $this->_convert_date_to_sql_date(substr($post_data[$field->field_name],0,10)). + substr($post_data[$field->field_name],10); + } + else + { + $update_data[$field->field_name] = $post_data[$field->field_name]; + } + } + } + + if($this->basic_model->db_update($update_data, $primary_key) === false) + { + return false; + } + + if(!empty($this->relation_n_n)) + { + foreach($this->relation_n_n as $field_name => $field_info) + { + if ( $this->unset_edit_fields !== null + && is_array($this->unset_edit_fields) + && in_array($field_name,$this->unset_edit_fields) + ) { + continue; + } + + $relation_data = isset( $post_data[$field_name] ) ? $post_data[$field_name] : array() ; + $this->db_relation_n_n_update($field_info, $relation_data ,$primary_key); + } + } + + if($this->callback_after_update !== null) + { + $callback_return = call_user_func($this->callback_after_update, $post_data, $primary_key); + + if($callback_return === false) + { + return false; + } + + } + } + else + { + $callback_return = call_user_func($this->callback_update, $post_data, $primary_key); + + if($callback_return === false) + { + return false; + } + } + + return true; + } + else + { + return false; + } + } + + protected function _convert_date_to_sql_date($date) + { + $date = substr($date,0,10); + if(preg_match('/\d{4}-\d{2}-\d{2}/',$date)) + { + //If it's already a sql-date don't convert it! + return $date; + }elseif(empty($date)) + { + return ''; + } + + $date_array = preg_split( '/[-\.\/ ]/', $date); + if($this->php_date_format == 'd/m/Y') + { + $sql_date = date('Y-m-d',mktime(0,0,0,$date_array[1],$date_array[0],$date_array[2])); + } + elseif($this->php_date_format == 'm/d/Y') + { + $sql_date = date('Y-m-d',mktime(0,0,0,$date_array[0],$date_array[1],$date_array[2])); + } + else + { + $sql_date = $date; + } + + return $sql_date; + } + + protected function _get_field_names_to_search(array $relation_values) + { + if(!strstr($relation_values[2],'{')) + return $this->_unique_join_name($relation_values[0]).'.'.$relation_values[2]; + else + { + $relation_values[2] = ' '.$relation_values[2].' '; + $temp1 = explode('{',$relation_values[2]); + unset($temp1[0]); + + $field_names_array = array(); + foreach($temp1 as $field) + list($field_names_array[]) = explode('}',$field); + + return $field_names_array; + } + } + + protected function _unique_join_name($field_name) + { + return 'j'.substr(md5($field_name),0,8); //This j is because is better for a string to begin with a letter and not a number + } + + protected function _unique_field_name($field_name) + { + return 's'.substr(md5($field_name),0,8); //This s is because is better for a string to begin with a letter and not a number + } + + protected function db_delete($state_info) + { + $primary_key = $state_info->primary_key; + + if($this->callback_delete === null) + { + if($this->callback_before_delete !== null) + { + $callback_return = call_user_func($this->callback_before_delete, $primary_key); + + if($callback_return === false) + { + return false; + } + + } + + if(!empty($this->relation_n_n)) + { + foreach($this->relation_n_n as $field_name => $field_info) + { + $this->db_relation_n_n_delete( $field_info, $primary_key ); + } + } + + $delete_result = $this->basic_model->db_delete($primary_key); + + if($delete_result === false) + { + return false; + } + + if($this->callback_after_delete !== null) + { + $callback_return = call_user_func($this->callback_after_delete, $primary_key); + + if($callback_return === false) + { + return false; + } + + } + } + else + { + $callback_return = call_user_func($this->callback_delete, $primary_key); + + if($callback_return === false) + { + return false; + } + } + + return true; + } + + protected function db_relation_n_n_update($field_info, $post_data , $primary_key_value) + { + $this->basic_model->db_relation_n_n_update($field_info, $post_data , $primary_key_value); + } + + protected function db_relation_n_n_delete($field_info, $primary_key_value) + { + $this->basic_model->db_relation_n_n_delete($field_info, $primary_key_value); + } + + protected function get_list() + { + if(!empty($this->order_by)) + $this->basic_model->order_by($this->order_by[0],$this->order_by[1]); + + if(!empty($this->where)) + foreach($this->where as $where) + $this->basic_model->where($where[0],$where[1],$where[2]); + + if(!empty($this->or_where)) + foreach($this->or_where as $or_where) + $this->basic_model->or_where($or_where[0],$or_where[1],$or_where[2]); + + if(!empty($this->like)) + foreach($this->like as $like) + $this->basic_model->like($like[0],$like[1],$like[2]); + + if(!empty($this->or_like)) + foreach($this->or_like as $or_like) + $this->basic_model->or_like($or_like[0],$or_like[1],$or_like[2]); + + if(!empty($this->having)) + foreach($this->having as $having) + $this->basic_model->having($having[0],$having[1],$having[2]); + + if(!empty($this->or_having)) + foreach($this->or_having as $or_having) + $this->basic_model->or_having($or_having[0],$or_having[1],$or_having[2]); + + if(!empty($this->relation)) + foreach($this->relation as $relation) + $this->basic_model->join_relation($relation[0],$relation[1],$relation[2]); + + if(!empty($this->relation_n_n)) + { + $columns = $this->get_columns(); + foreach($columns as $column) + { + //Use the relation_n_n ONLY if the column is called . The set_relation_n_n are slow and it will make the table slower without any reason as we don't need those queries. + if(isset($this->relation_n_n[$column->field_name])) + { + $this->basic_model->set_relation_n_n_field($this->relation_n_n[$column->field_name]); + } + } + + } + + if($this->theme_config['crud_paging'] === true) + { + if($this->limit === null) + { + $default_per_page = $this->config->default_per_page; + if(is_numeric($default_per_page) && $default_per_page >1) + { + $this->basic_model->limit($default_per_page); + } + else + { + $this->basic_model->limit(10); + } + } + else + { + $this->basic_model->limit($this->limit[0],$this->limit[1]); + } + } + + $results = $this->basic_model->get_list(); + + return $results; + } + + protected function get_edit_values($primary_key_value) + { + $values = $this->basic_model->get_edit_values($primary_key_value); + + if(!empty($this->relation_n_n)) + { + foreach($this->relation_n_n as $field_name => $field_info) + { + $values->$field_name = $this->get_relation_n_n_selection_array($primary_key_value, $field_info); + } + } + + return $values; + } + + protected function get_relation_n_n_selection_array($primary_key_value, $field_info) + { + return $this->basic_model->get_relation_n_n_selection_array($primary_key_value, $field_info); + } + + protected function get_relation_n_n_unselected_array($field_info, $selected_values) + { + return $this->basic_model->get_relation_n_n_unselected_array($field_info, $selected_values); + } + + protected function set_basic_db_table($table_name = null) + { + $this->basic_model->set_basic_table($table_name); + } + + protected function upload_file($state_info) + { + if(isset($this->upload_fields[$state_info->field_name]) ) + { + if($this->callback_upload === null) + { + if($this->callback_before_upload !== null) + { + $callback_before_upload_response = call_user_func($this->callback_before_upload, $_FILES, $this->upload_fields[$state_info->field_name]); + + if($callback_before_upload_response === false) + return false; + elseif(is_string($callback_before_upload_response)) + return $callback_before_upload_response; + } + + $upload_info = $this->upload_fields[$state_info->field_name]; + + header('Pragma: no-cache'); + header('Cache-Control: private, no-cache'); + header('Content-Disposition: inline; filename="files.json"'); + header('X-Content-Type-Options: nosniff'); + header('Access-Control-Allow-Origin: *'); + header('Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE'); + header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size'); + + $allowed_files = $this->config->file_upload_allow_file_types; + $reg_exp = '/(\\.|\\/)('.$allowed_files.')$/i'; + + $max_file_size_ui = $this->config->file_upload_max_file_size; + $max_file_size_bytes = $this->_convert_bytes_ui_to_bytes($max_file_size_ui); + + $options = array( + 'upload_dir' => $upload_info->upload_path.'/', + 'param_name' => $this->_unique_field_name($state_info->field_name), + 'upload_url' => base_url().$upload_info->upload_path.'/', + 'accept_file_types' => $reg_exp, + 'max_file_size' => $max_file_size_bytes + ); + $upload_handler = new UploadHandler($options); + $upload_handler->default_config_path = $this->default_config_path; + $uploader_response = $upload_handler->post(); + + if(is_array($uploader_response)) + { + foreach($uploader_response as &$response) + { + unset($response->delete_url); + unset($response->delete_type); + } + } + + if($this->callback_after_upload !== null) + { + $callback_after_upload_response = call_user_func($this->callback_after_upload, $uploader_response , $this->upload_fields[$state_info->field_name] , $_FILES ); + + if($callback_after_upload_response === false) + return false; + elseif(is_string($callback_after_upload_response)) + return $callback_after_upload_response; + elseif(is_array($callback_after_upload_response)) + $uploader_response = $callback_after_upload_response; + } + + return $uploader_response; + } + else + { + $upload_response = call_user_func($this->callback_upload, $_FILES, $this->upload_fields[$state_info->field_name] ); + + if($upload_response === false) + { + return false; + } + else + { + return $upload_response; + } + } + } + else + { + return false; + } + } + + protected function delete_file($state_info) + { + + if(isset($state_info->field_name) && isset($this->upload_fields[$state_info->field_name])) + { + $upload_info = $this->upload_fields[$state_info->field_name]; + + if(file_exists("{$upload_info->upload_path}/{$state_info->file_name}")) + { + if( unlink("{$upload_info->upload_path}/{$state_info->file_name}") ) + { + $this->basic_model->db_file_delete($state_info->field_name, $state_info->file_name); + + return true; + } + else + { + return false; + } + } + else + { + $this->basic_model->db_file_delete($state_info->field_name, $state_info->file_name); + return true; + } + } + else + { + return false; + } + } + + protected function ajax_relation($state_info) + { + if(!isset($this->relation[$state_info->field_name])) + return false; + + list($field_name, $related_table, $related_field_title, $where_clause, $order_by) = $this->relation[$state_info->field_name]; + + return $this->basic_model->get_ajax_relation_array($state_info->search, $field_name, $related_table, $related_field_title, $where_clause, $order_by); + } +} + + +/** + * PHP grocery CRUD + * + * LICENSE + * + * Grocery CRUD is released with dual licensing, using the GPL v3 (license-gpl3.txt) and the MIT license (license-mit.txt). + * You don't have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. + * Please see the corresponding license file for details of these licenses. + * You are free to use, modify and distribute this software, but all copyright information must remain. + * + * @package grocery CRUD + * @copyright Copyright (c) 2010 through 2012, John Skoumbourdis + * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt + * @author John Skoumbourdis + */ + +// ------------------------------------------------------------------------ + +/** + * PHP grocery Layout + * + * Here you manage all the HTML Layout + * + * @package grocery CRUD + * @author John Skoumbourdis + * @version 1.4.1 + */ +class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver +{ + private $theme_path = null; + private $views_as_string = ''; + private $echo_and_die = false; + protected $theme = null; + protected $default_true_false_text = array('inactive' , 'active'); + + protected $css_files = array(); + protected $js_files = array(); + protected $js_lib_files = array(); + protected $js_config_files = array(); + + protected function set_basic_Layout() + { + if(!file_exists($this->theme_path.$this->theme.'/views/list_template.php')) + { + throw new Exception('The template does not exist. Please check your files and try again.', 12); + die(); + } + } + + protected function showList($ajax = false, $state_info = null) + { + $data = $this->get_common_data(); + + $data->order_by = $this->order_by; + + $data->types = $this->get_field_types(); + + $data->list = $this->get_list(); + $data->list = $this->change_list($data->list , $data->types); + $data->list = $this->change_list_add_actions($data->list); + + $data->total_results = $this->get_total_results(); + + $data->columns = $this->get_columns(); + + $data->success_message = $this->get_success_message_at_list($state_info); + + $data->primary_key = $this->get_primary_key(); + $data->add_url = $this->getAddUrl(); + $data->edit_url = $this->getEditUrl(); + $data->delete_url = $this->getDeleteUrl(); + $data->read_url = $this->getReadUrl(); + $data->ajax_list_url = $this->getAjaxListUrl(); + $data->ajax_list_info_url = $this->getAjaxListInfoUrl(); + $data->export_url = $this->getExportToExcelUrl(); + $data->print_url = $this->getPrintUrl(); + $data->actions = $this->actions; + $data->unique_hash = $this->get_method_hash(); + $data->order_by = $this->order_by; + + $data->unset_add = $this->unset_add; + $data->unset_edit = $this->unset_edit; + $data->unset_read = $this->unset_read; + $data->unset_delete = $this->unset_delete; + $data->unset_export = $this->unset_export; + $data->unset_print = $this->unset_print; + + $default_per_page = $this->config->default_per_page; + $data->paging_options = $this->config->paging_options; + $data->default_per_page = is_numeric($default_per_page) && $default_per_page >1 && in_array($default_per_page,$data->paging_options)? $default_per_page : 25; + + if($data->list === false) + { + throw new Exception('It is impossible to get data. Please check your model and try again.', 13); + $data->list = array(); + } + + foreach($data->list as $num_row => $row) + { + $data->list[$num_row]->edit_url = $data->edit_url.'/'.$row->{$data->primary_key}; + $data->list[$num_row]->delete_url = $data->delete_url.'/'.$row->{$data->primary_key}; + $data->list[$num_row]->read_url = $data->read_url.'/'.$row->{$data->primary_key}; + } + + if(!$ajax) + { + $this->_add_js_vars(array('dialog_forms' => $this->config->dialog_forms)); + + $data->list_view = $this->_theme_view('list.php',$data,true); + $this->_theme_view('list_template.php',$data); + } + else + { + $this->set_echo_and_die(); + $this->_theme_view('list.php',$data); + } + } + + protected function exportToExcel($state_info = null) + { + $data = $this->get_common_data(); + + $data->order_by = $this->order_by; + $data->types = $this->get_field_types(); + + $data->list = $this->get_list(); + $data->list = $this->change_list($data->list , $data->types); + $data->list = $this->change_list_add_actions($data->list); + + $data->total_results = $this->get_total_results(); + + $data->columns = $this->get_columns(); + $data->primary_key = $this->get_primary_key(); + + @ob_end_clean(); + $this->_export_to_excel($data); + } + + protected function _export_to_excel($data) + { + /** + * No need to use an external library here. The only bad thing without using external library is that Microsoft Excel is complaining + * that the file is in a different format than specified by the file extension. If you press "Yes" everything will be just fine. + * */ + + $string_to_export = ""; + foreach($data->columns as $column){ + $string_to_export .= $column->display_as."\t"; + } + $string_to_export .= "\n"; + + foreach($data->list as $num_row => $row){ + foreach($data->columns as $column){ + $string_to_export .= $this->_trim_export_string($row->{$column->field_name})."\t"; + } + $string_to_export .= "\n"; + } + + // Convert to UTF-16LE and Prepend BOM + $string_to_export = "\xFF\xFE" .mb_convert_encoding($string_to_export, 'UTF-16LE', 'UTF-8'); + + $filename = "export-".date("Y-m-d_H:i:s").".xls"; + + header('Content-type: application/vnd.ms-excel;charset=UTF-16LE'); + header('Content-Disposition: attachment; filename='.$filename); + header("Cache-Control: no-cache"); + echo $string_to_export; + die(); + } + + protected function print_webpage($state_info = null) + { + $data = $this->get_common_data(); + + $data->order_by = $this->order_by; + $data->types = $this->get_field_types(); + + $data->list = $this->get_list(); + $data->list = $this->change_list($data->list , $data->types); + $data->list = $this->change_list_add_actions($data->list); + + $data->total_results = $this->get_total_results(); + + $data->columns = $this->get_columns(); + $data->primary_key = $this->get_primary_key(); + + @ob_end_clean(); + $this->_print_webpage($data); + } + + protected function _print_webpage($data) + { + $string_to_print = ""; + $string_to_print .= ""; + + echo $string_to_print; + die(); + } + + protected function _trim_export_string($value) + { + $value = str_replace(array(" ","&",">","<"),array(" ","&",">","<"),$value); + return strip_tags(str_replace(array("\t","\n","\r"),"",$value)); + } + + protected function _trim_print_string($value) + { + $value = str_replace(array(" ","&",">","<"),array(" ","&",">","<"),$value); + + //If the value has only spaces and nothing more then add the whitespace html character + if(str_replace(" ","",$value) == "") + $value = " "; + + return strip_tags($value); + } + + protected function set_echo_and_die() + { + $this->echo_and_die = true; + } + + protected function unset_echo_and_die() + { + $this->echo_and_die = false; + } + + protected function showListInfo() + { + $this->set_echo_and_die(); + + $total_results = (int)$this->get_total_results(); + @ob_end_clean(); + echo json_encode(array('total_results' => $total_results)); + die(); + } + + protected function change_list_add_actions($list) + { + if(empty($this->actions)) + return $list; + + $primary_key = $this->get_primary_key(); + + foreach($list as $num_row => $row) + { + $actions_urls = array(); + foreach($this->actions as $unique_id => $action) + { + if(!empty($action->url_callback)) + { + $actions_urls[$unique_id] = call_user_func($action->url_callback, $row->$primary_key, $row); + } + else + { + $actions_urls[$unique_id] = + $action->url_has_http ? + $action->link_url.$row->$primary_key : + site_url($action->link_url.'/'.$row->$primary_key); + } + } + $row->action_urls = $actions_urls; + } + + return $list; + } + + protected function change_list($list,$types) + { + $primary_key = $this->get_primary_key(); + $has_callbacks = !empty($this->callback_column) ? true : false; + $output_columns = $this->get_columns(); + foreach($list as $num_row => $row) + { + foreach($output_columns as $column) + { + $field_name = $column->field_name; + $field_value = isset( $row->{$column->field_name} ) ? $row->{$column->field_name} : null; + if( $has_callbacks && isset($this->callback_column[$field_name]) ) + $list[$num_row]->$field_name = call_user_func($this->callback_column[$field_name], $field_value, $row); + elseif(isset($types[$field_name])) + $list[$num_row]->$field_name = $this->change_list_value($types[$field_name] , $field_value); + else + $list[$num_row]->$field_name = $field_value; + } + } + + return $list; + } + + protected function showAddForm() + { + $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY); + + $data = $this->get_common_data(); + $data->types = $this->get_field_types(); + + $data->list_url = $this->getListUrl(); + $data->insert_url = $this->getInsertUrl(); + $data->validation_url = $this->getValidationInsertUrl(); + $data->input_fields = $this->get_add_input_fields(); + + $data->fields = $this->get_add_fields(); + $data->hidden_fields = $this->get_add_hidden_fields(); + $data->unset_back_to_list = $this->unset_back_to_list; + $data->unique_hash = $this->get_method_hash(); + $data->is_ajax = $this->_is_ajax(); + + $this->_theme_view('add.php',$data); + $this->_inline_js("var js_date_format = '".$this->js_date_format."';"); + + $this->_get_ajax_results(); + } + + protected function showEditForm($state_info) + { + $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY); + + $data = $this->get_common_data(); + $data->types = $this->get_field_types(); + + $data->field_values = $this->get_edit_values($state_info->primary_key); + + $data->add_url = $this->getAddUrl(); + + $data->list_url = $this->getListUrl(); + $data->update_url = $this->getUpdateUrl($state_info); + $data->delete_url = $this->getDeleteUrl($state_info); + $data->read_url = $this->getReadUrl($state_info->primary_key); + $data->input_fields = $this->get_edit_input_fields($data->field_values); + $data->unique_hash = $this->get_method_hash(); + + $data->fields = $this->get_edit_fields(); + $data->hidden_fields = $this->get_edit_hidden_fields(); + $data->unset_back_to_list = $this->unset_back_to_list; + + $data->validation_url = $this->getValidationUpdateUrl($state_info->primary_key); + $data->is_ajax = $this->_is_ajax(); + + $this->_theme_view('edit.php',$data); + $this->_inline_js("var js_date_format = '".$this->js_date_format."';"); + + $this->_get_ajax_results(); + } + + protected function showReadForm($state_info) + { + $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY); + + $data = $this->get_common_data(); + $data->types = $this->get_field_types(); + + $data->field_values = $this->get_edit_values($state_info->primary_key); + + $data->add_url = $this->getAddUrl(); + + $data->list_url = $this->getListUrl(); + $data->update_url = $this->getUpdateUrl($state_info); + $data->delete_url = $this->getDeleteUrl($state_info); + $data->read_url = $this->getReadUrl($state_info->primary_key); + $data->input_fields = $this->get_read_input_fields($data->field_values); + $data->unique_hash = $this->get_method_hash(); + + $data->fields = $this->get_edit_fields(); + $data->hidden_fields = $this->get_edit_hidden_fields(); + $data->unset_back_to_list = $this->unset_back_to_list; + + $data->validation_url = $this->getValidationUpdateUrl($state_info->primary_key); + $data->is_ajax = $this->_is_ajax(); + + $this->_theme_view('read.php',$data); + $this->_inline_js("var js_date_format = '".$this->js_date_format."';"); + + $this->_get_ajax_results(); + } + + protected function delete_layout($delete_result = true) + { + @ob_end_clean(); + if($delete_result === false) + { + $error_message = '

'.$this->l('delete_error_message').'

'; + + echo json_encode(array('success' => $delete_result ,'error_message' => $error_message)); + } + else + { + $success_message = '

'.$this->l('delete_success_message').'

'; + + echo json_encode(array('success' => true , 'success_message' => $success_message)); + } + $this->set_echo_and_die(); + } + + protected function get_success_message_at_list($field_info = null) + { + if($field_info !== null && isset($field_info->success_message) && $field_info->success_message) + { + if(!empty($field_info->primary_key) && !$this->unset_edit) + { + return $this->l('insert_success_message')." ".$this->l('form_edit')." {$this->subject} "; + } + else + { + return $this->l('insert_success_message'); + } + } + else + { + return null; + } + } + + protected function insert_layout($insert_result = false) + { + @ob_end_clean(); + if($insert_result === false) + { + echo json_encode(array('success' => false)); + } + else + { + $success_message = '

'.$this->l('insert_success_message'); + + if(!$this->unset_back_to_list && !empty($insert_result) && !$this->unset_edit) + { + $success_message .= " ".$this->l('form_edit')." {$this->subject} "; + + if (!$this->_is_ajax()) { + $success_message .= $this->l('form_or'); + } + } + + if(!$this->unset_back_to_list && !$this->_is_ajax()) + { + $success_message .= " ".$this->l('form_go_back_to_list').""; + } + + $success_message .= '

'; + + echo ""; + } + $this->set_echo_and_die(); + } + + protected function validation_layout($validation_result) + { + @ob_end_clean(); + echo ""; + $this->set_echo_and_die(); + } + + protected function upload_layout($upload_result, $field_name) + { + @ob_end_clean(); + if($upload_result !== false && !is_string($upload_result) && empty($upload_result[0]->error)) + { + echo json_encode( + (object)array( + 'success' => true, + 'files' => $upload_result + )); + } + else + { + $result = (object)array('success' => false); + if(is_string($upload_result)) + $result->message = $upload_result; + if(!empty($upload_result[0]->error)) + $result->message = $upload_result[0]->error; + + echo json_encode($result); + } + + $this->set_echo_and_die(); + } + + protected function delete_file_layout($upload_result) + { + @ob_end_clean(); + if($upload_result !== false) + { + echo json_encode( (object)array( 'success' => true ) ); + } + else + { + echo json_encode((object)array('success' => false)); + } + + $this->set_echo_and_die(); + } + + public function set_css($css_file) + { + $this->css_files[sha1($css_file)] = base_url().$css_file; + } + + public function set_js($js_file) + { + $this->js_files[sha1($js_file)] = base_url().$js_file; + } + + public function set_js_lib($js_file) + { + $this->js_lib_files[sha1($js_file)] = base_url().$js_file; + $this->js_files[sha1($js_file)] = base_url().$js_file; + } + + public function set_js_config($js_file) + { + $this->js_config_files[sha1($js_file)] = base_url().$js_file; + $this->js_files[sha1($js_file)] = base_url().$js_file; + } + + public function is_IE7() + { + return isset($_SERVER['HTTP_USER_AGENT']) + && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false) + ? true : false; + } + + public function get_css_files() + { + return $this->css_files; + } + + public function get_js_files() + { + return $this->js_files; + } + + public function get_js_lib_files() + { + return $this->js_lib_files; + } + + public function get_js_config_files() + { + return $this->js_config_files; + } + + /** + * Load Javascripts + **/ + protected function load_js_fancybox() + { + $this->set_css($this->default_css_path.'/jquery_plugins/fancybox/jquery.fancybox.css'); + + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.fancybox-1.3.4.js'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.easing-1.3.pack.js'); + } + + protected function load_js_chosen() + { + $this->set_css($this->default_css_path.'/jquery_plugins/chosen/chosen.css'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.chosen.min.js'); + } + + protected function load_js_jqueryui() + { + $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); + } + + protected function load_js_uploader() + { + $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); + $this->set_css($this->default_css_path.'/jquery_plugins/file_upload/file-uploader.css'); + $this->set_css($this->default_css_path.'/jquery_plugins/file_upload/jquery.fileupload-ui.css'); + + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/tmpl.min.js'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/load-image.min.js'); + + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.iframe-transport.js'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.fileupload.js'); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.fileupload.config.js'); + } + + protected function get_layout() + { + $js_files = $this->get_js_files(); + $css_files = $this->get_css_files(); + + $js_lib_files = $this->get_js_lib_files(); + $js_config_files = $this->get_js_config_files(); + + if ($this->unset_jquery) { + unset($js_files[sha1($this->default_javascript_path.'/'.grocery_CRUD::JQUERY)]); + } + + if ($this->unset_jquery_ui) { + unset($css_files[sha1($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS)]); + unset($js_files[sha1($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS)]); + } + + if ($this->unset_bootstrap) { + unset($js_files[sha1($this->default_theme_path.'/twitter-bootstrap/js/libs/bootstrap/bootstrap.min.js')]); + unset($js_files[sha1($this->default_theme_path.'/twitter-bootstrap/js/libs/bootstrap/application.js')]); + unset($css_files[sha1($this->default_theme_path.'/twitter-bootstrap/css/bootstrap-responsive.min.css')]); + unset($css_files[sha1($this->default_theme_path.'/twitter-bootstrap/css/bootstrap.min.css')]); + } + + if($this->echo_and_die === false) + { + /** Initialize JavaScript variables */ + $js_vars = array( + 'default_javascript_path' => base_url().$this->default_javascript_path, + 'default_css_path' => base_url().$this->default_css_path, + 'default_texteditor_path' => base_url().$this->default_texteditor_path, + 'default_theme_path' => base_url().$this->default_theme_path, + 'base_url' => base_url() + ); + $this->_add_js_vars($js_vars); + + return (object)array( + 'js_files' => $js_files, + 'js_lib_files' => $js_lib_files, + 'js_config_files' => $js_config_files, + 'css_files' => $css_files, + 'output' => $this->views_as_string, + ); + } + elseif($this->echo_and_die === true) + { + echo $this->views_as_string; + die(); + } + } + + protected function update_layout($update_result = false, $state_info = null) + { + @ob_end_clean(); + if($update_result === false) + { + echo json_encode(array('success' => $update_result)); + } + else + { + $success_message = '

'.$this->l('update_success_message'); + if(!$this->unset_back_to_list && !$this->_is_ajax()) + { + $success_message .= " ".$this->l('form_go_back_to_list').""; + } + $success_message .= '

'; + + /* The textarea is only because of a BUG of the jquery form plugin with the combination of multipart forms */ + echo ""; + } + $this->set_echo_and_die(); + } + + protected function get_integer_input($field_info,$value) + { + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.numeric.min.js'); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.numeric.config.js'); + $extra_attributes = ''; + if(!empty($field_info->db_max_length)) + $extra_attributes .= "maxlength='{$field_info->db_max_length}'"; + $input = ""; + return $input; + } + + protected function get_true_false_input($field_info,$value) + { + $this->set_css($this->default_css_path.'/jquery_plugins/uniform/uniform.default.css'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.uniform.min.js'); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.uniform.config.js'); + + $value_is_null = empty($value) && $value !== '0' && $value !== 0 ? true : false; + + $input = "
"; + + $true_string = is_array($field_info->extras) && array_key_exists(1,$field_info->extras) ? $field_info->extras[1] : $this->default_true_false_text[1]; + $checked = $value === '1' || ($value_is_null && $field_info->default === '1') ? "checked = 'checked'" : ""; + $input .= " "; + + $false_string = is_array($field_info->extras) && array_key_exists(0,$field_info->extras) ? $field_info->extras[0] : $this->default_true_false_text[0]; + $checked = $value === '0' || ($value_is_null && $field_info->default === '0') ? "checked = 'checked'" : ""; + $input .= ""; + + $input .= "
"; + + return $input; + } + + protected function get_string_input($field_info,$value) + { + $value = !is_string($value) ? '' : str_replace('"',""",$value); + + $extra_attributes = ''; + if(!empty($field_info->db_max_length)) + $extra_attributes .= "maxlength='{$field_info->db_max_length}'"; + $input = ""; + return $input; + } + + protected function get_text_input($field_info,$value) + { + if($field_info->extras == 'text_editor') + { + $editor = $this->config->default_text_editor; + switch ($editor) { + case 'ckeditor': + $this->set_js_lib($this->default_texteditor_path.'/ckeditor/ckeditor.js'); + $this->set_js_lib($this->default_texteditor_path.'/ckeditor/adapters/jquery.js'); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.ckeditor.config.js'); + break; + + case 'tinymce': + $this->set_js_lib($this->default_texteditor_path.'/tiny_mce/jquery.tinymce.js'); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.tine_mce.config.js'); + break; + + case 'markitup': + $this->set_css($this->default_texteditor_path.'/markitup/skins/markitup/style.css'); + $this->set_css($this->default_texteditor_path.'/markitup/sets/default/style.css'); + + $this->set_js_lib($this->default_texteditor_path.'/markitup/jquery.markitup.js'); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.markitup.config.js'); + break; + } + + $class_name = $this->config->text_editor_type == 'minimal' ? 'mini-texteditor' : 'texteditor'; + + $input = ""; + } + else + { + $input = ""; + } + return $input; + } + + protected function get_datetime_input($field_info,$value) + { + $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); + $this->set_css($this->default_css_path.'/jquery_plugins/jquery.ui.datetime.css'); + $this->set_css($this->default_css_path.'/jquery_plugins/jquery-ui-timepicker-addon.css'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery-ui-timepicker-addon.js'); + + if($this->language !== 'english') + { + include($this->default_config_path.'/language_alias.php'); + if(array_key_exists($this->language, $language_alias)) + { + $i18n_date_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-'.$language_alias[$this->language].'.js'; + if(file_exists($i18n_date_js_file)) + { + $this->set_js_lib($i18n_date_js_file); + } + + $i18n_datetime_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-'.$language_alias[$this->language].'.js'; + if(file_exists($i18n_datetime_js_file)) + { + $this->set_js_lib($i18n_datetime_js_file); + } + } + } + + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery-ui-timepicker-addon.config.js'); + + if(!empty($value) && $value != '0000-00-00 00:00:00' && $value != '1970-01-01 00:00:00'){ + list($year,$month,$day) = explode('-',substr($value,0,10)); + $date = date($this->php_date_format, mktime(0,0,0,$month,$day,$year)); + $datetime = $date.substr($value,10); + } + else + { + $datetime = ''; + } + $input = " + ".$this->l('form_button_clear')." + ({$this->ui_date_format}) hh:mm:ss"; + return $input; + } + + protected function get_hidden_input($field_info,$value) + { + if($field_info->extras !== null && $field_info->extras != false) + $value = $field_info->extras; + $input = ""; + return $input; + } + + protected function get_password_input($field_info,$value) + { + $value = !is_string($value) ? '' : $value; + + $extra_attributes = ''; + if(!empty($field_info->db_max_length)) + $extra_attributes .= "maxlength='{$field_info->db_max_length}'"; + $input = ""; + return $input; + } + + protected function get_date_input($field_info,$value) + { + $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); + + if($this->language !== 'english') + { + include($this->default_config_path.'/language_alias.php'); + if(array_key_exists($this->language, $language_alias)) + { + $i18n_date_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-'.$language_alias[$this->language].'.js'; + if(file_exists($i18n_date_js_file)) + { + $this->set_js_lib($i18n_date_js_file); + } + } + } + + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.datepicker.config.js'); + + if(!empty($value) && $value != '0000-00-00' && $value != '1970-01-01') + { + list($year,$month,$day) = explode('-',substr($value,0,10)); + $date = date($this->php_date_format, mktime(0,0,0,$month,$day,$year)); + } + else + { + $date = ''; + } + + $input = " + ".$this->l('form_button_clear')." (".$this->ui_date_format.")"; + return $input; + } + + protected function get_dropdown_input($field_info,$value) + { + $this->load_js_chosen(); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); + + $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); + + $input = ""; + return $input; + } + + protected function get_enum_input($field_info,$value) + { + $this->load_js_chosen(); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); + + $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); + + $input = ""; + return $input; + } + + protected function get_readonly_input($field_info, $value) + { + $read_only_value = " "; + + if (!empty($value) && !is_array($value)) { + $read_only_value = $value; + } elseif (is_array($value)) { + $all_values = array_values($value); + $read_only_value = implode(", ",$all_values); + } + + return '
'.$read_only_value.'
'; + } + + protected function get_set_input($field_info,$value) + { + $this->load_js_chosen(); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); + + $options_array = $field_info->extras !== false && is_array($field_info->extras)? $field_info->extras : explode("','",substr($field_info->db_max_length,1,-1)); + $selected_values = !empty($value) ? explode(",",$value) : array(); + + $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); + $input = ""; + + return $input; + } + + protected function get_multiselect_input($field_info,$value) + { + $this->load_js_chosen(); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); + + $options_array = $field_info->extras; + $selected_values = !empty($value) ? explode(",",$value) : array(); + + $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); + $input = ""; + + return $input; + } + + protected function get_relation_input($field_info,$value) + { + $this->load_js_chosen(); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); + + $ajax_limitation = 10000; + $total_rows = $this->get_relation_total_rows($field_info->extras); + + + //Check if we will use ajax for our queries or just clien-side javascript + $using_ajax = $total_rows > $ajax_limitation ? true : false; + + //We will not use it for now. It is not ready yet. Probably we will have this functionality at version 1.4 + $using_ajax = false; + + //If total rows are more than the limitation, use the ajax plugin + $ajax_or_not_class = $using_ajax ? 'chosen-select' : 'chosen-select'; + + $this->_inline_js("var ajax_relation_url = '".$this->getAjaxRelationUrl()."';\n"); + + $select_title = str_replace('{field_display_as}',$field_info->display_as,$this->l('set_relation_title')); + $input = ""; + return $input; + } + + protected function get_relation_readonly_input($field_info,$value) + { + $options_array = $this->get_relation_array($field_info->extras); + + $value = isset($options_array[$value]) ? $options_array[$value] : ''; + + return $this->get_readonly_input($field_info, $value); + } + + protected function get_upload_file_readonly_input($field_info,$value) + { + $file = $file_url = base_url().$field_info->extras->upload_path.'/'.$value; + + $value = !empty($value) ? ''.$value.'' : ''; + + return $this->get_readonly_input($field_info, $value); + } + + protected function get_relation_n_n_input($field_info_type, $selected_values) + { + $has_priority_field = !empty($field_info_type->extras->priority_field_relation_table) ? true : false; + $is_ie_7 = isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false) ? true : false; + + if($has_priority_field || $is_ie_7) + { + $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); + $this->set_css($this->default_css_path.'/jquery_plugins/ui.multiselect.css'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui.multiselect.min.js'); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.multiselect.js'); + + if($this->language !== 'english') + { + include($this->default_config_path.'/language_alias.php'); + if(array_key_exists($this->language, $language_alias)) + { + $i18n_date_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/multiselect/ui-multiselect-'.$language_alias[$this->language].'.js'; + if(file_exists($i18n_date_js_file)) + { + $this->set_js_lib($i18n_date_js_file); + } + } + } + } + else + { + $this->set_css($this->default_css_path.'/jquery_plugins/chosen/chosen.css'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.chosen.min.js'); + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.chosen.config.js'); + } + + $this->_inline_js("var ajax_relation_url = '".$this->getAjaxRelationUrl()."';\n"); + + $field_info = $this->relation_n_n[$field_info_type->name]; //As we use this function the relation_n_n exists, so don't need to check + $unselected_values = $this->get_relation_n_n_unselected_array($field_info, $selected_values); + + if(empty($unselected_values) && empty($selected_values)) + { + $input = "Please add {$field_info_type->display_as} first"; + } + else + { + $css_class = $has_priority_field || $is_ie_7 ? 'multiselect': 'chosen-multiple-select'; + $width_style = $has_priority_field || $is_ie_7 ? '' : 'width:510px;'; + + $select_title = str_replace('{field_display_as}',$field_info_type->display_as,$this->l('set_relation_title')); + $input = ""; + } + + return $input; + } + + protected function _convert_bytes_ui_to_bytes($bytes_ui) + { + $bytes_ui = str_replace(' ','',$bytes_ui); + if(strstr($bytes_ui,'MB')) + $bytes = (int)(str_replace('MB','',$bytes_ui))*1024*1024; + elseif(strstr($bytes_ui,'KB')) + $bytes = (int)(str_replace('KB','',$bytes_ui))*1024; + elseif(strstr($bytes_ui,'B')) + $bytes = (int)(str_replace('B','',$bytes_ui)); + else + $bytes = (int)($bytes_ui); + + return $bytes; + } + + protected function get_upload_file_input($field_info, $value) + { + $this->load_js_uploader(); + + //Fancybox + $this->load_js_fancybox(); + + $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.fancybox.config.js'); + + $unique = mt_rand(); + + $allowed_files = $this->config->file_upload_allow_file_types; + $allowed_files_ui = '.'.str_replace('|',',.',$allowed_files); + $max_file_size_ui = $this->config->file_upload_max_file_size; + $max_file_size_bytes = $this->_convert_bytes_ui_to_bytes($max_file_size_ui); + + $this->_inline_js(' + var upload_info_'.$unique.' = { + accepted_file_types: /(\\.|\\/)('.$allowed_files.')$/i, + accepted_file_types_ui : "'.$allowed_files_ui.'", + max_file_size: '.$max_file_size_bytes.', + max_file_size_ui: "'.$max_file_size_ui.'" + }; + + var string_upload_file = "'.$this->l('form_upload_a_file').'"; + var string_delete_file = "'.$this->l('string_delete_file').'"; + var string_progress = "'.$this->l('string_progress').'"; + var error_on_uploading = "'.$this->l('error_on_uploading').'"; + var message_prompt_delete_file = "'.$this->l('message_prompt_delete_file').'"; + + var error_max_number_of_files = "'.$this->l('error_max_number_of_files').'"; + var error_accept_file_types = "'.$this->l('error_accept_file_types').'"; + var error_max_file_size = "'.str_replace("{max_file_size}",$max_file_size_ui,$this->l('error_max_file_size')).'"; + var error_min_file_size = "'.$this->l('error_min_file_size').'"; + + var base_url = "'.base_url().'"; + var upload_a_file_string = "'.$this->l('form_upload_a_file').'"; + '); + + $uploader_display_none = empty($value) ? "" : "display:none;"; + $file_display_none = empty($value) ? "display:none;" : ""; + + $is_image = !empty($value) && + ( substr($value,-4) == '.jpg' + || substr($value,-4) == '.png' + || substr($value,-5) == '.jpeg' + || substr($value,-4) == '.gif' + || substr($value,-5) == '.tiff') + ? true : false; + + $image_class = $is_image ? 'image-thumbnail' : ''; + + $input = ' + '.$this->l('form_upload_a_file').' + + + '; + + $this->set_css($this->default_css_path.'/jquery_plugins/file_upload/fileuploader.css'); + + $file_url = base_url().$field_info->extras->upload_path.'/'.$value; + + $input .= "
"; + $input .= "
"; + $input .= ""; + $input .= "
"; + $input .= "
"; + + return $input; + } + + protected function get_add_hidden_fields() + { + return $this->add_hidden_fields; + } + + protected function get_edit_hidden_fields() + { + return $this->edit_hidden_fields; + } + + protected function get_add_input_fields($field_values = null) + { + $fields = $this->get_add_fields(); + $types = $this->get_field_types(); + + $input_fields = array(); + + foreach($fields as $field_num => $field) + { + $field_info = $types[$field->field_name]; + + $field_value = !empty($field_values) && isset($field_values->{$field->field_name}) ? $field_values->{$field->field_name} : null; + + if(!isset($this->callback_add_field[$field->field_name])) + { + $field_input = $this->get_field_input($field_info, $field_value); + } + else + { + $field_input = $field_info; + $field_input->input = call_user_func($this->callback_add_field[$field->field_name], $field_value, null, $field_info); + } + + switch ($field_info->crud_type) { + case 'invisible': + unset($this->add_fields[$field_num]); + unset($fields[$field_num]); + continue; + break; + case 'hidden': + $this->add_hidden_fields[] = $field_input; + unset($this->add_fields[$field_num]); + unset($fields[$field_num]); + continue; + break; + } + + $input_fields[$field->field_name] = $field_input; + } + + return $input_fields; + } + + protected function get_edit_input_fields($field_values = null) + { + $fields = $this->get_edit_fields(); + $types = $this->get_field_types(); + + $input_fields = array(); + + foreach($fields as $field_num => $field) + { + $field_info = $types[$field->field_name]; + + $field_value = !empty($field_values) && isset($field_values->{$field->field_name}) ? $field_values->{$field->field_name} : null; + if(!isset($this->callback_edit_field[$field->field_name])) + { + $field_input = $this->get_field_input($field_info, $field_value); + } + else + { + $primary_key = $this->getStateInfo()->primary_key; + $field_input = $field_info; + $field_input->input = call_user_func($this->callback_edit_field[$field->field_name], $field_value, $primary_key, $field_info, $field_values); + } + + switch ($field_info->crud_type) { + case 'invisible': + unset($this->edit_fields[$field_num]); + unset($fields[$field_num]); + continue; + break; + case 'hidden': + $this->edit_hidden_fields[] = $field_input; + unset($this->edit_fields[$field_num]); + unset($fields[$field_num]); + continue; + break; + } + + $input_fields[$field->field_name] = $field_input; + } + + return $input_fields; + } + + protected function get_read_input_fields($field_values = null) + { + $fields = $this->get_edit_fields(); + $this->field_types = null; + $this->required_fields = null; + + foreach ($fields as $field) { + if (!empty($this->change_field_type) + && isset($this->change_field_type[$field->field_name]) + && $this->change_field_type[$field->field_name]->type == 'hidden') { + continue; + } + $this->field_type($field->field_name, 'readonly'); + } + + return $this->get_edit_input_fields($field_values); + } + + protected function setThemeBasics() + { + $this->theme_path = $this->default_theme_path; + if(substr($this->theme_path,-1) != '/') + $this->theme_path = $this->theme_path.'/'; + + include($this->theme_path.$this->theme.'/config.php'); + + $this->theme_config = $config; + } + + public function set_theme($theme = null) + { + $this->theme = $theme; + + return $this; + } + + protected function _get_ajax_results() + { + //This is a $_POST request rather that $_GET request , because + //Codeigniter doesn't like the $_GET requests so much! + if ($this->_is_ajax()) { + @ob_end_clean(); + $results= (object)array( + 'output' => $this->views_as_string, + 'js_files' => array_values($this->get_js_files()), + 'js_lib_files' => array_values($this->get_js_lib_files()), + 'js_config_files' => array_values($this->get_js_config_files()), + 'css_files' => array_values($this->get_css_files()) + ); + + echo json_encode($results); + die; + } + //else just continue + } + + protected function _is_ajax() + { + return array_key_exists('is_ajax', $_POST) && $_POST['is_ajax'] == 'true' ? true: false; + } + + protected function _theme_view($view, $vars = array(), $return = FALSE) + { + $vars = (is_object($vars)) ? get_object_vars($vars) : $vars; + + $file_exists = FALSE; + + $ext = pathinfo($view, PATHINFO_EXTENSION); + $file = ($ext == '') ? $view.'.php' : $view; + + $view_file = $this->theme_path.$this->theme.'/views/'; + + if (file_exists($view_file.$file)) + { + $path = $view_file.$file; + $file_exists = TRUE; + } + + if ( ! $file_exists) + { + throw new Exception('Unable to load the requested file: '.$file, 16); + } + + extract($vars); + + #region buffering... + ob_start(); + + include($path); + + $buffer = ob_get_contents(); + @ob_end_clean(); + #endregion + + if ($return === TRUE) + { + return $buffer; + } + + $this->views_as_string .= $buffer; + } + + protected function _inline_js($inline_js = '') + { + $this->views_as_string .= "\n"; + } + + protected function _add_js_vars($js_vars = array()) + { + $javascript_as_string = "\n"; + $this->views_as_string .= $javascript_as_string; + } + + protected function get_views_as_string() + { + if(!empty($this->views_as_string)) + return $this->views_as_string; + else + return null; + } +} + + +/** + * PHP grocery CRUD + * + * LICENSE + * + * Grocery CRUD is released with dual licensing, using the GPL v3 (license-gpl3.txt) and the MIT license (license-mit.txt). + * You don't have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. + * Please see the corresponding license file for details of these licenses. + * You are free to use, modify and distribute this software, but all copyright information must remain. + * + * @package grocery CRUD + * @copyright Copyright (c) 2010 through 2012, John Skoumbourdis + * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt + * @author John Skoumbourdis + */ + +// ------------------------------------------------------------------------ + +/** + * PHP grocery States + * + * States of grocery CRUD + * + * @package grocery CRUD + * @author John Skoumbourdis + * @version 1.4.1 + */ +class grocery_CRUD_States extends grocery_CRUD_Layout +{ + protected $states = array( + 0 => 'unknown', + 1 => 'list', + 2 => 'add', + 3 => 'edit', + 4 => 'delete', + 5 => 'insert', + 6 => 'update', + 7 => 'ajax_list', + 8 => 'ajax_list_info', + 9 => 'insert_validation', + 10 => 'update_validation', + 11 => 'upload_file', + 12 => 'delete_file', + 13 => 'ajax_relation', + 14 => 'ajax_relation_n_n', + 15 => 'success', + 16 => 'export', + 17 => 'print', + 18 => 'read' + ); + + protected function getStateCode() + { + $state_string = $this->get_state_info_from_url()->operation; + + if( $state_string != 'unknown' && in_array( $state_string, $this->states ) ) + $state_code = array_search($state_string, $this->states); + else + $state_code = 0; + + return $state_code; + } + + protected function state_url($url = '', $is_list_page = false) + { + //Easy scenario, we had set the crud_url_path + if (!empty($this->crud_url_path)) { + $state_url = !empty($this->list_url_path) && $is_list_page? + $this->list_url_path : + $this->crud_url_path.'/'.$url ; + } else { + //Complicated scenario. The crud_url_path is not specified so we are + //trying to understand what is going on from the URL. + $ci = &get_instance(); + + $segment_object = $this->get_state_info_from_url(); + $method_name = $this->get_method_name(); + $segment_position = $segment_object->segment_position; + + $state_url_array = array(); + + if( sizeof($ci->uri->segments) > 0 ) { + foreach($ci->uri->segments as $num => $value) + { + $state_url_array[$num] = $value; + if($num == ($segment_position - 1)) + break; + } + + if( $method_name == 'index' && !in_array( 'index', $state_url_array ) ) //there is a scenario that you don't have the index to your url + $state_url_array[$num+1] = 'index'; + } + + $state_url = site_url(implode('/',$state_url_array).'/'.$url); + } + + return $state_url; + } + + protected function get_state_info_from_url() + { + $ci = &get_instance(); + + $segment_position = count($ci->uri->segments) + 1; + $operation = 'list'; + + $segements = $ci->uri->segments; + foreach($segements as $num => $value) + { + if($value != 'unknown' && in_array($value, $this->states)) + { + $segment_position = (int)$num; + $operation = $value; //I don't have a "break" here because I want to ensure that is the LAST segment with name that is in the array. + } + } + + $function_name = $this->get_method_name(); + + if($function_name == 'index' && !in_array('index',$ci->uri->segments)) + $segment_position++; + + $first_parameter = isset($segements[$segment_position+1]) ? $segements[$segment_position+1] : null; + $second_parameter = isset($segements[$segment_position+2]) ? $segements[$segment_position+2] : null; + + return (object)array('segment_position' => $segment_position, 'operation' => $operation, 'first_parameter' => $first_parameter, 'second_parameter' => $second_parameter); + } + + protected function get_method_hash() + { + $ci = &get_instance(); + + $state_info = $this->get_state_info_from_url(); + $extra_values = $ci->uri->segment($state_info->segment_position - 1) != $this->get_method_name() ? $ci->uri->segment($state_info->segment_position - 1) : ''; + + return $this->crud_url_path !== null + ? md5($this->crud_url_path) + : md5($this->get_controller_name().$this->get_method_name().$extra_values); + } + + protected function get_method_name() + { + $ci = &get_instance(); + return $ci->router->method; + } + + protected function get_controller_name() + { + $ci = &get_instance(); + return $ci->router->class; + } + + public function getState() + { + return $this->states[$this->getStateCode()]; + } + + protected function getListUrl() + { + return $this->state_url('',true); + } + + protected function getAjaxListUrl() + { + return $this->state_url('ajax_list'); + } + + protected function getExportToExcelUrl() + { + return $this->state_url('export'); + } + + protected function getPrintUrl() + { + return $this->state_url('print'); + } + + protected function getAjaxListInfoUrl() + { + return $this->state_url('ajax_list_info'); + } + + protected function getAddUrl() + { + return $this->state_url('add'); + } + + protected function getInsertUrl() + { + return $this->state_url('insert'); + } + + protected function getValidationInsertUrl() + { + return $this->state_url('insert_validation'); + } + + protected function getValidationUpdateUrl($primary_key = null) + { + if($primary_key === null) + return $this->state_url('update_validation'); + else + return $this->state_url('update_validation/'.$primary_key); + } + + protected function getEditUrl($primary_key = null) + { + if($primary_key === null) + return $this->state_url('edit'); + else + return $this->state_url('edit/'.$primary_key); + } + + protected function getReadUrl($primary_key = null) + { + if($primary_key === null) + return $this->state_url('read'); + else + return $this->state_url('read/'.$primary_key); + } + + protected function getUpdateUrl($state_info) + { + return $this->state_url('update/'.$state_info->primary_key); + } + + protected function getDeleteUrl($state_info = null) + { + if(empty($state_info)) + return $this->state_url('delete'); + else + return $this->state_url('delete/'.$state_info->primary_key); + } + + protected function getListSuccessUrl($primary_key = null) + { + if(empty($primary_key)) + return $this->state_url('success',true); + else + return $this->state_url('success/'.$primary_key,true); + } + + protected function getUploadUrl($field_name) + { + return $this->state_url('upload_file/'.$field_name); + } + + protected function getFileDeleteUrl($field_name) + { + return $this->state_url('delete_file/'.$field_name); + } + + protected function getAjaxRelationUrl() + { + return $this->state_url('ajax_relation'); + } + + protected function getAjaxRelationManytoManyUrl() + { + return $this->state_url('ajax_relation_n_n'); + } + + public function getStateInfo() + { + $state_code = $this->getStateCode(); + $segment_object = $this->get_state_info_from_url(); + + $first_parameter = $segment_object->first_parameter; + $second_parameter = $segment_object->second_parameter; + + $state_info = (object)array(); + + switch ($state_code) { + case 1: + case 2: + + break; + + case 3: + case 18: // read + if($first_parameter !== null) + { + $state_info = (object)array('primary_key' => $first_parameter); + } + else + { + throw new Exception('On the state "edit" the Primary key cannot be null', 6); + die(); + } + break; + + case 4: + if($first_parameter !== null) + { + $state_info = (object)array('primary_key' => $first_parameter); + } + else + { + throw new Exception('On the state "delete" the Primary key cannot be null',7); + die(); + } + break; + + case 5: + if(!empty($_POST)) + { + $state_info = (object)array('unwrapped_data' => $_POST); + } + else + { + throw new Exception('On the state "insert" you must have post data',8); + die(); + } + break; + + case 6: + if(!empty($_POST) && $first_parameter !== null) + { + $state_info = (object)array('primary_key' => $first_parameter,'unwrapped_data' => $_POST); + } + elseif(empty($_POST)) + { + throw new Exception('On the state "update" you must have post data',9); + die(); + } + else + { + throw new Exception('On the state "update" the Primary key cannot be null',10); + die(); + } + break; + + case 7: + case 8: + case 16: //export to excel + case 17: //print + $state_info = (object)array(); + if(!empty($_POST['per_page'])) + { + $state_info->per_page = is_numeric($_POST['per_page']) ? $_POST['per_page'] : null; + } + if(!empty($_POST['page'])) + { + $state_info->page = is_numeric($_POST['page']) ? $_POST['page'] : null; + } + //If we request an export or a print we don't care about what page we are + if($state_code === 16 || $state_code === 17) + { + $state_info->page = 1; + $state_info->per_page = 1000000; //a big number + } + if(!empty($_POST['order_by'][0])) + { + $state_info->order_by = $_POST['order_by']; + } + if(!empty($_POST['search_text'])) + { + if(empty($_POST['search_field'])) + { + + $search_text = strip_tags($_POST['search_field']); + + $state_info->search = (object)array( 'field' => null , 'text' => $_POST['search_text'] ); + + } + else + { + $state_info->search = (object)array( 'field' => strip_tags($_POST['search_field']) , 'text' => $_POST['search_text'] ); + } + } + break; + + case 9: + + break; + + case 10: + if($first_parameter !== null) + { + $state_info = (object)array('primary_key' => $first_parameter); + } + break; + + case 11: + $state_info->field_name = $first_parameter; + break; + + case 12: + $state_info->field_name = $first_parameter; + $state_info->file_name = $second_parameter; + break; + + case 13: + $state_info->field_name = $_POST['field_name']; + $state_info->search = $_POST['term']; + break; + + case 14: + $state_info->field_name = $_POST['field_name']; + $state_info->search = $_POST['term']; + break; + + case 15: + $state_info = (object)array( + 'primary_key' => $first_parameter, + 'success_message' => true + ); + break; + } + + return $state_info; + } +} + + +/** + * PHP grocery CRUD + * + * LICENSE + * + * Grocery CRUD is released with dual licensing, using the GPL v3 (license-gpl3.txt) and the MIT license (license-mit.txt). + * You don't have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. + * Please see the corresponding license file for details of these licenses. + * You are free to use, modify and distribute this software, but all copyright information must remain. + * + * @package grocery CRUD + * @copyright Copyright (c) 2010 through 2012, John Skoumbourdis + * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt + * @version 1.4.1 + * @author John Skoumbourdis + */ + +// ------------------------------------------------------------------------ + +/** + * PHP grocery CRUD + * + * Creates a full functional CRUD with few lines of code. + * + * @package grocery CRUD + * @author John Skoumbourdis + * @license https://github.com/scoumbourdis/grocery-crud/blob/master/license-grocery-crud.txt + * @link http://www.grocerycrud.com/documentation + */ +class Grocery_CRUD extends grocery_CRUD_States +{ + /** + * Grocery CRUD version + * + * @var string + */ + const VERSION = "1.4.1"; + + const JQUERY = "jquery-1.10.2.min.js"; + const JQUERY_UI_JS = "jquery-ui-1.10.3.custom.min.js"; + const JQUERY_UI_CSS = "jquery-ui-1.10.1.custom.min.css"; + + protected $state_code = null; + protected $state_info = null; + protected $columns = null; + + private $basic_db_table_checked = false; + private $columns_checked = false; + private $add_fields_checked = false; + private $edit_fields_checked = false; + + protected $default_theme = 'flexigrid'; + protected $language = null; + protected $lang_strings = array(); + protected $php_date_format = null; + protected $js_date_format = null; + protected $ui_date_format = null; + protected $character_limiter = null; + protected $config = null; + + protected $add_fields = null; + protected $edit_fields = null; + protected $add_hidden_fields = array(); + protected $edit_hidden_fields = array(); + protected $field_types = null; + protected $basic_db_table = null; + protected $theme_config = array(); + protected $subject = null; + protected $subject_plural = null; + protected $display_as = array(); + protected $order_by = null; + protected $where = array(); + protected $like = array(); + protected $having = array(); + protected $or_having = array(); + protected $limit = null; + protected $required_fields = array(); + protected $_unique_fields = array(); + protected $validation_rules = array(); + protected $relation = array(); + protected $relation_n_n = array(); + protected $upload_fields = array(); + protected $actions = array(); + + protected $form_validation = null; + protected $change_field_type = null; + protected $primary_keys = array(); + protected $crud_url_path = null; + protected $list_url_path = null; + + /* The unsetters */ + protected $unset_texteditor = array(); + protected $unset_add = false; + protected $unset_edit = false; + protected $unset_delete = false; + protected $unset_read = false; + protected $unset_jquery = false; + protected $unset_jquery_ui = false; + protected $unset_bootstrap = false; + protected $unset_list = false; + protected $unset_export = false; + protected $unset_print = false; + protected $unset_back_to_list = false; + protected $unset_columns = null; + protected $unset_add_fields = null; + protected $unset_edit_fields = null; + + /* Callbacks */ + protected $callback_before_insert = null; + protected $callback_after_insert = null; + protected $callback_insert = null; + protected $callback_before_update = null; + protected $callback_after_update = null; + protected $callback_update = null; + protected $callback_before_delete = null; + protected $callback_after_delete = null; + protected $callback_delete = null; + protected $callback_column = array(); + protected $callback_add_field = array(); + protected $callback_edit_field = array(); + protected $callback_upload = null; + protected $callback_before_upload = null; + protected $callback_after_upload = null; + + protected $default_javascript_path = null; //autogenerate, please do not modify + protected $default_css_path = null; //autogenerate, please do not modify + protected $default_texteditor_path = null; //autogenerate, please do not modify + protected $default_theme_path = null; //autogenerate, please do not modify + protected $default_language_path = 'assets/grocery_crud/languages'; + protected $default_config_path = 'assets/grocery_crud/config'; + protected $default_assets_path = 'assets/grocery_crud'; + + /** + * + * Constructor + * + * @access public + */ + public function __construct() + { + + } + + /** + * The displayed columns that user see + * + * @access public + * @param string + * @param array + * @return void + */ + public function columns() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->columns = $args; + + return $this; + } + + + /** + * Set Validation Rules + * + * Important note: If the $field is an array then no automated crud fields will take apart + * + * @access public + * @param mixed + * @param string + * @return void + */ + function set_rules($field, $label = '', $rules = '') + { + if(is_string($field)) + { + $this->validation_rules[$field] = array('field' => $field, 'label' => $label, 'rules' => $rules); + }elseif(is_array($field)) + { + foreach($field as $num_field => $field_array) + { + $this->validation_rules[$field_array['field']] = $field_array; + } + } + return $this; + } + + /** + * + * Changes the default field type + * @param string $field + * @param string $type + * @param array|string $extras + */ + public function change_field_type($field , $type, $extras = null) + { + $field_type = (object)array('type' => $type); + + $field_type->extras = $extras; + + $this->change_field_type[$field] = $field_type; + + return $this; + } + + /** + * + * Just an alias to the change_field_type method + * @param string $field + * @param string $type + * @param array|string $extras + */ + public function field_type($field , $type, $extras = null) + { + return $this->change_field_type($field , $type, $extras); + } + + /** + * Change the default primary key for a specific table. + * If the $table_name is NULL then the primary key is for the default table name that we added at the set_table method + * + * @param string $primary_key_field + * @param string $table_name + */ + public function set_primary_key($primary_key_field, $table_name = null) + { + $this->primary_keys[] = array('field_name' => $primary_key_field, 'table_name' => $table_name); + + return $this; + } + + /** + * Unsets the texteditor of the selected fields + * + * @access public + * @param string + * @param array + * @return void + */ + public function unset_texteditor() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + foreach($args as $arg) + { + $this->unset_texteditor[] = $arg; + } + + return $this; + } + + /** + * Unsets just the jquery library from the js. This function can be used if there is already a jquery included + * in the main template. This will avoid all jquery conflicts. + * + * @return void + */ + public function unset_jquery() + { + $this->unset_jquery = true; + + return $this; + } + + /** + * Unsets the jquery UI Javascript and CSS. This function is really useful + * when the jquery UI JavaScript and CSS are already included in the main template. + * This will avoid all jquery UI conflicts. + * + * @return void + */ + public function unset_jquery_ui() + { + $this->unset_jquery_ui = true; + + return $this; + } + + /** + * Unsets just the twitter bootstrap libraries from the js and css. This function can be used if there is already twitter bootstrap files included + * in the main template. If you are already using a bootstrap template then it's not necessary to load the files again. + * + * @return void + */ + public function unset_bootstrap() + { + $this->unset_bootstrap = true; + + return $this; + } + + /** + * Unsets the add operation from the list + * + * @return void + */ + public function unset_add() + { + $this->unset_add = true; + + return $this; + } + + /** + * Unsets the edit operation from the list + * + * @return void + */ + public function unset_edit() + { + $this->unset_edit = true; + + return $this; + } + + /** + * Unsets the delete operation from the list + * + * @return void + */ + public function unset_delete() + { + $this->unset_delete = true; + + return $this; + } + + /** + * Unsets the read operation from the list + * + * @return void + */ + public function unset_read() + { + $this->unset_read = true; + + return $this; + } + + /** + * Unsets the export button and functionality from the list + * + * @return void + */ + public function unset_export() + { + $this->unset_export = true; + + return $this; + } + + + /** + * Unsets the print button and functionality from the list + * + * @return void + */ + public function unset_print() + { + $this->unset_print = true; + + return $this; + } + + /** + * Unsets all the operations from the list + * + * @return void + */ + public function unset_operations() + { + $this->unset_add = true; + $this->unset_edit = true; + $this->unset_delete = true; + $this->unset_read = true; + $this->unset_export = true; + $this->unset_print = true; + + return $this; + } + + /** + * Unsets a column from the list + * + * @return void. + */ + public function unset_columns() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->unset_columns = $args; + + return $this; + } + + public function unset_list() + { + $this->unset_list = true; + + return $this; + } + + public function unset_fields() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->unset_add_fields = $args; + $this->unset_edit_fields = $args; + + return $this; + } + + public function unset_add_fields() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->unset_add_fields = $args; + + return $this; + } + + public function unset_edit_fields() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->unset_edit_fields = $args; + + return $this; + } + + + /** + * Unsets everything that has to do with buttons or links with go back to list message + * @access public + * @return void + */ + public function unset_back_to_list() + { + $this->unset_back_to_list = true; + + return $this; + } + + /** + * + * The fields that user will see on add/edit + * + * @access public + * @param string + * @param array + * @return void + */ + public function fields() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->add_fields = $args; + $this->edit_fields = $args; + + return $this; + } + + /** + * + * The fields that user can see . It is only for the add form + */ + public function add_fields() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->add_fields = $args; + + return $this; + } + + /** + * + * The fields that user can see . It is only for the edit form + */ + public function edit_fields() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->edit_fields = $args; + + return $this; + } + + /** + * + * Changes the displaying label of the field + * @param $field_name + * @param $display_as + * @return void + */ + public function display_as($field_name, $display_as = null) + { + if(is_array($field_name)) + { + foreach($field_name as $field => $display_as) + { + $this->display_as[$field] = $display_as; + } + } + elseif($display_as !== null) + { + $this->display_as[$field_name] = $display_as; + } + return $this; + } + + /** + * + * Load the language strings array from the language file + */ + protected function _load_language() + { + if($this->language === null) + { + $this->language = strtolower($this->config->default_language); + } + include($this->default_language_path.'/'.$this->language.'.php'); + + foreach($lang as $handle => $lang_string) + if(!isset($this->lang_strings[$handle])) + $this->lang_strings[$handle] = $lang_string; + + $this->default_true_false_text = array( $this->l('form_inactive') , $this->l('form_active')); + $this->subject = $this->subject === null ? $this->l('list_record') : $this->subject; + + } + + protected function _load_date_format() + { + list($php_day, $php_month, $php_year) = array('d','m','Y'); + list($js_day, $js_month, $js_year) = array('dd','mm','yy'); + list($ui_day, $ui_month, $ui_year) = array('dd','mm','yyyy'); +//@todo ui_day, ui_month, ui_year has to be lang strings + + $date_format = $this->config->date_format; + switch ($date_format) { + case 'uk-date': + $this->php_date_format = "$php_day/$php_month/$php_year"; + $this->js_date_format = "$js_day/$js_month/$js_year"; + $this->ui_date_format = "$ui_day/$ui_month/$ui_year"; + break; + + case 'us-date': + $this->php_date_format = "$php_month/$php_day/$php_year"; + $this->js_date_format = "$js_month/$js_day/$js_year"; + $this->ui_date_format = "$ui_month/$ui_day/$ui_year"; + break; + + case 'sql-date': + default: + $this->php_date_format = "$php_year-$php_month-$php_day"; + $this->js_date_format = "$js_year-$js_month-$js_day"; + $this->ui_date_format = "$ui_year-$ui_month-$ui_day"; + break; + } + } + + /** + * + * Set a language string directly + * @param string $handle + * @param string $string + */ + public function set_lang_string($handle, $lang_string){ + $this->lang_strings[$handle] = $lang_string; + + return $this; + } + + /** + * + * Just an alias to get_lang_string method + * @param string $handle + */ + public function l($handle) + { + return $this->get_lang_string($handle); + } + + /** + * + * Get the language string of the inserted string handle + * @param string $handle + */ + public function get_lang_string($handle) + { + return $this->lang_strings[$handle]; + } + + /** + * + * Simply set the language + * @example english + * @param string $language + */ + public function set_language($language) + { + $this->language = $language; + + return $this; + } + + /** + * + * Enter description here ... + */ + protected function get_columns() + { + if($this->columns_checked === false) + { + $field_types = $this->get_field_types(); + if(empty($this->columns)) + { + $this->columns = array(); + foreach($field_types as $field) + { + if( !isset($field->db_extra) || $field->db_extra != 'auto_increment' ) + $this->columns[] = $field->name; + } + } + + foreach($this->columns as $col_num => $column) + { + + if(isset($this->relation[$column])) + { + + $new_column = $this->_unique_field_name($this->relation[$column][0]); + $this->columns[$col_num] = $new_column; + + if(isset($this->display_as[$column])) + { + $display_as = $this->display_as[$column]; + unset($this->display_as[$column]); + $this->display_as[$new_column] = $display_as; + } + else + { + $this->display_as[$new_column] = ucfirst(str_replace('_',' ',$column)); + } + + $column = $new_column; + $this->columns[$col_num] = $new_column; + } + else + { + if(!empty($this->relation)) + { + $table_name = $this->get_table(); + foreach($this->relation as $relation) + { + if( $relation[2] == $column ) + { + $new_column = $table_name.'.'.$column; + if(isset($this->display_as[$column])) + { + $display_as = $this->display_as[$column]; + unset($this->display_as[$column]); + $this->display_as[$new_column] = $display_as; + } + else + { + $this->display_as[$new_column] = ucfirst(str_replace('_',' ',$column)); + } + + $column = $new_column; + $this->columns[$col_num] = $new_column; + } + } + } + + } + + if(isset($this->display_as[$column])) + $this->columns[$col_num] = (object)array('field_name' => $column, 'display_as' => $this->display_as[$column]); + elseif(isset($field_types[$column])) + $this->columns[$col_num] = (object)array('field_name' => $column, 'display_as' => $field_types[$column]->display_as); + else + $this->columns[$col_num] = (object)array('field_name' => $column, 'display_as' => + ucfirst(str_replace('_',' ',$column))); + + if(!empty($this->unset_columns) && in_array($column,$this->unset_columns)) + { + unset($this->columns[$col_num]); + } + } + + $this->columns_checked = true; + + } + + return $this->columns; + } + + /** + * + * Enter description here ... + */ + protected function get_add_fields() + { + if($this->add_fields_checked === false) + { + $field_types = $this->get_field_types(); + if(!empty($this->add_fields)) + { + foreach($this->add_fields as $field_num => $field) + { + if(isset($this->display_as[$field])) + $this->add_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $this->display_as[$field]); + elseif(isset($field_types[$field]->display_as)) + $this->add_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $field_types[$field]->display_as); + else + $this->add_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => ucfirst(str_replace('_',' ',$field))); + } + } + else + { + $this->add_fields = array(); + foreach($field_types as $field) + { + //Check if an unset_add_field is initialize for this field name + if($this->unset_add_fields !== null && is_array($this->unset_add_fields) && in_array($field->name,$this->unset_add_fields)) + continue; + + if( (!isset($field->db_extra) || $field->db_extra != 'auto_increment') ) + { + if(isset($this->display_as[$field->name])) + $this->add_fields[] = (object)array('field_name' => $field->name, 'display_as' => $this->display_as[$field->name]); + else + $this->add_fields[] = (object)array('field_name' => $field->name, 'display_as' => $field->display_as); + } + } + } + + $this->add_fields_checked = true; + } + return $this->add_fields; + } + + /** + * + * Enter description here ... + */ + protected function get_edit_fields() + { + if($this->edit_fields_checked === false) + { + $field_types = $this->get_field_types(); + if(!empty($this->edit_fields)) + { + foreach($this->edit_fields as $field_num => $field) + { + if(isset($this->display_as[$field])) + $this->edit_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $this->display_as[$field]); + else + $this->edit_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $field_types[$field]->display_as); + } + } + else + { + $this->edit_fields = array(); + foreach($field_types as $field) + { + //Check if an unset_edit_field is initialize for this field name + if($this->unset_edit_fields !== null && is_array($this->unset_edit_fields) && in_array($field->name,$this->unset_edit_fields)) + continue; + + if(!isset($field->db_extra) || $field->db_extra != 'auto_increment') + { + if(isset($this->display_as[$field->name])) + $this->edit_fields[] = (object)array('field_name' => $field->name, 'display_as' => $this->display_as[$field->name]); + else + $this->edit_fields[] = (object)array('field_name' => $field->name, 'display_as' => $field->display_as); + } + } + } + + $this->edit_fields_checked = true; + } + return $this->edit_fields; + } + + public function order_by($order_by, $direction = 'asc') + { + $this->order_by = array($order_by,$direction); + + return $this; + } + + public function where($key, $value = NULL, $escape = TRUE) + { + $this->where[] = array($key,$value,$escape); + + return $this; + } + + public function or_where($key, $value = NULL, $escape = TRUE) + { + $this->or_where[] = array($key,$value,$escape); + + return $this; + } + + public function like($field, $match = '', $side = 'both') + { + $this->like[] = array($field, $match, $side); + + return $this; + } + + protected function having($key, $value = '', $escape = TRUE) + { + $this->having[] = array($key, $value, $escape); + + return $this; + } + + protected function or_having($key, $value = '', $escape = TRUE) + { + $this->or_having[] = array($key, $value, $escape); + + return $this; + } + + public function or_like($field, $match = '', $side = 'both') + { + $this->or_like[] = array($field, $match, $side); + + return $this; + } + + public function limit($limit, $offset = '') + { + $this->limit = array($limit,$offset); + + return $this; + } + + protected function _initialize_helpers() + { + $ci = &get_instance(); + + $ci->load->helper('url'); + $ci->load->helper('form'); + } + + protected function _initialize_variables() + { + $ci = &get_instance(); + $ci->load->config('grocery_crud'); + + $this->config = (object)array(); + + /** Initialize all the config variables into this object */ + $this->config->default_language = $ci->config->item('grocery_crud_default_language'); + $this->config->date_format = $ci->config->item('grocery_crud_date_format'); + $this->config->default_per_page = $ci->config->item('grocery_crud_default_per_page'); + $this->config->file_upload_allow_file_types = $ci->config->item('grocery_crud_file_upload_allow_file_types'); + $this->config->file_upload_max_file_size = $ci->config->item('grocery_crud_file_upload_max_file_size'); + $this->config->default_text_editor = $ci->config->item('grocery_crud_default_text_editor'); + $this->config->text_editor_type = $ci->config->item('grocery_crud_text_editor_type'); + $this->config->character_limiter = $ci->config->item('grocery_crud_character_limiter'); + $this->config->dialog_forms = $ci->config->item('grocery_crud_dialog_forms'); + $this->config->paging_options = $ci->config->item('grocery_crud_paging_options'); + + /** Initialize default paths */ + $this->default_javascript_path = $this->default_assets_path.'/js'; + $this->default_css_path = $this->default_assets_path.'/css'; + $this->default_texteditor_path = $this->default_assets_path.'/texteditor'; + $this->default_theme_path = $this->default_assets_path.'/themes'; + + $this->character_limiter = $this->config->character_limiter; + + if($this->character_limiter === 0 || $this->character_limiter === '0') + { + $this->character_limiter = 1000000; //a big number + } + elseif($this->character_limiter === null || $this->character_limiter === false) + { + $this->character_limiter = 30; //is better to have the number 30 rather than the 0 value + } + } + + protected function _set_primary_keys_to_model() + { + if(!empty($this->primary_keys)) + { + foreach($this->primary_keys as $primary_key) + { + $this->basic_model->set_primary_key($primary_key['field_name'],$primary_key['table_name']); + } + } + } + + /** + * Initialize all the required libraries and variables before rendering + */ + protected function pre_render() + { + $this->_initialize_variables(); + $this->_initialize_helpers(); + $this->_load_language(); + $this->state_code = $this->getStateCode(); + + if($this->basic_model === null) + $this->set_default_Model(); + + $this->set_basic_db_table($this->get_table()); + + $this->_load_date_format(); + + $this->_set_primary_keys_to_model(); + } + + /** + * + * Or else ... make it work! The web application takes decision of what to do and show it to the final user. + * Without this function nothing works. Here is the core of grocery CRUD project. + * + * @access public + */ + public function render() + { + $this->pre_render(); + + if( $this->state_code != 0 ) + { + $this->state_info = $this->getStateInfo(); + } + else + { + throw new Exception('The state is unknown , I don\'t know what I will do with your data!', 4); + die(); + } + + switch ($this->state_code) { + case 15://success + case 1://list + if($this->unset_list) + { + throw new Exception('You don\'t have permissions for this operation', 14); + die(); + } + + if($this->theme === null) + $this->set_theme($this->default_theme); + $this->setThemeBasics(); + + $this->set_basic_Layout(); + + $state_info = $this->getStateInfo(); + + $this->showList(false,$state_info); + + break; + + case 2://add + if($this->unset_add) + { + throw new Exception('You don\'t have permissions for this operation', 14); + die(); + } + + if($this->theme === null) + $this->set_theme($this->default_theme); + $this->setThemeBasics(); + + $this->set_basic_Layout(); + + $this->showAddForm(); + + break; + + case 3://edit + if($this->unset_edit) + { + throw new Exception('You don\'t have permissions for this operation', 14); + die(); + } + + if($this->theme === null) + $this->set_theme($this->default_theme); + $this->setThemeBasics(); + + $this->set_basic_Layout(); + + $state_info = $this->getStateInfo(); + + $this->showEditForm($state_info); + + break; + + case 4://delete + if($this->unset_delete) + { + throw new Exception('This user is not allowed to do this operation', 14); + die(); + } + + $state_info = $this->getStateInfo(); + $delete_result = $this->db_delete($state_info); + + $this->delete_layout( $delete_result ); + break; + + case 5://insert + if($this->unset_add) + { + throw new Exception('This user is not allowed to do this operation', 14); + die(); + } + + $state_info = $this->getStateInfo(); + $insert_result = $this->db_insert($state_info); + + $this->insert_layout($insert_result); + break; + + case 6://update + if($this->unset_edit) + { + throw new Exception('This user is not allowed to do this operation', 14); + die(); + } + + $state_info = $this->getStateInfo(); + $update_result = $this->db_update($state_info); + + $this->update_layout( $update_result,$state_info); + break; + + case 7://ajax_list + + if($this->unset_list) + { + throw new Exception('You don\'t have permissions for this operation', 14); + die(); + } + + if($this->theme === null) + $this->set_theme($this->default_theme); + $this->setThemeBasics(); + + $this->set_basic_Layout(); + + $state_info = $this->getStateInfo(); + $this->set_ajax_list_queries($state_info); + + $this->showList(true); + + break; + + case 8://ajax_list_info + + if($this->theme === null) + $this->set_theme($this->default_theme); + $this->setThemeBasics(); + + $this->set_basic_Layout(); + + $state_info = $this->getStateInfo(); + $this->set_ajax_list_queries($state_info); + + $this->showListInfo(); + break; + + case 9://insert_validation + + $validation_result = $this->db_insert_validation(); + + $this->validation_layout($validation_result); + break; + + case 10://update_validation + + $validation_result = $this->db_update_validation(); + + $this->validation_layout($validation_result); + break; + + case 11://upload_file + + $state_info = $this->getStateInfo(); + + $upload_result = $this->upload_file($state_info); + + $this->upload_layout($upload_result, $state_info->field_name); + break; + + case 12://delete_file + $state_info = $this->getStateInfo(); + + $delete_file_result = $this->delete_file($state_info); + + $this->delete_file_layout($delete_file_result); + break; + /* + case 13: //ajax_relation + $state_info = $this->getStateInfo(); + + $ajax_relation_result = $this->ajax_relation($state_info); + + $ajax_relation_result[""] = ""; + + echo json_encode($ajax_relation_result); + die(); + break; + + case 14: //ajax_relation_n_n + echo json_encode(array("34" => 'Johnny' , "78" => "Test")); + die(); + break; + */ + case 16: //export to excel + //a big number just to ensure that the table characters will not be cutted. + $this->character_limiter = 1000000; + + if($this->unset_export) + { + throw new Exception('You don\'t have permissions for this operation', 15); + die(); + } + + if($this->theme === null) + $this->set_theme($this->default_theme); + $this->setThemeBasics(); + + $this->set_basic_Layout(); + + $state_info = $this->getStateInfo(); + $this->set_ajax_list_queries($state_info); + $this->exportToExcel($state_info); + break; + + case 17: //print + //a big number just to ensure that the table characters will not be cutted. + $this->character_limiter = 1000000; + + if($this->unset_print) + { + throw new Exception('You don\'t have permissions for this operation', 15); + die(); + } + + if($this->theme === null) + $this->set_theme($this->default_theme); + $this->setThemeBasics(); + + $this->set_basic_Layout(); + + $state_info = $this->getStateInfo(); + $this->set_ajax_list_queries($state_info); + $this->print_webpage($state_info); + break; + + case 18: //read + if($this->unset_read) + { + throw new Exception('You don\'t have permissions for this operation', 14); + die(); + } + + if($this->theme === null) + $this->set_theme($this->default_theme); + $this->setThemeBasics(); + + $this->set_basic_Layout(); + + $state_info = $this->getStateInfo(); + + $this->showReadForm($state_info); + break; + + } + + return $this->get_layout(); + } + + protected function get_common_data() + { + $data = (object)array(); + + $data->subject = $this->subject; + $data->subject_plural = $this->subject_plural; + + return $data; + } + + /** + * + * Enter description here ... + */ + public function callback_before_insert($callback = null) + { + $this->callback_before_insert = $callback; + + return $this; + } + + /** + * + * Enter description here ... + */ + public function callback_after_insert($callback = null) + { + $this->callback_after_insert = $callback; + + return $this; + } + + /** + * + * Enter description here ... + */ + public function callback_insert($callback = null) + { + $this->callback_insert = $callback; + + return $this; + } + + + /** + * + * Enter description here ... + */ + public function callback_before_update($callback = null) + { + $this->callback_before_update = $callback; + + return $this; + } + + /** + * + * Enter description here ... + */ + public function callback_after_update($callback = null) + { + $this->callback_after_update = $callback; + + return $this; + } + + + /** + * + * Enter description here ... + * @param mixed $callback + */ + public function callback_update($callback = null) + { + $this->callback_update = $callback; + + return $this; + } + + /** + * + * Enter description here ... + */ + public function callback_before_delete($callback = null) + { + $this->callback_before_delete = $callback; + + return $this; + } + + /** + * + * Enter description here ... + */ + public function callback_after_delete($callback = null) + { + $this->callback_after_delete = $callback; + + return $this; + } + + /** + * + * Enter description here ... + */ + public function callback_delete($callback = null) + { + $this->callback_delete = $callback; + + return $this; + } + + /** + * + * Enter description here ... + * @param string $column + * @param mixed $callback + */ + public function callback_column($column ,$callback = null) + { + $this->callback_column[$column] = $callback; + + return $this; + } + + /** + * + * Enter description here ... + * @param string $field + * @param mixed $callback + */ + public function callback_field($field, $callback = null) + { + $this->callback_add_field[$field] = $callback; + $this->callback_edit_field[$field] = $callback; + + return $this; + } + + /** + * + * Enter description here ... + * @param string $field + * @param mixed $callback + */ + public function callback_add_field($field, $callback = null) + { + $this->callback_add_field[$field] = $callback; + + return $this; + } + + /** + * + * Enter description here ... + * @param string $field + * @param mixed $callback + */ + public function callback_edit_field($field, $callback = null) + { + $this->callback_edit_field[$field] = $callback; + + return $this; + } + + /** + * + * Callback that replace the default auto uploader + * + * @param mixed $callback + * @return grocery_CRUD + */ + public function callback_upload($callback = null) + { + $this->callback_upload = $callback; + + return $this; + } + + /** + * + * A callback that triggered before the upload functionality. This callback is suggested for validation checks + * @param mixed $callback + * @return grocery_CRUD + */ + public function callback_before_upload($callback = null) + { + $this->callback_before_upload = $callback; + + return $this; + } + + /** + * + * A callback that triggered after the upload functionality + * @param mixed $callback + * @return grocery_CRUD + */ + public function callback_after_upload($callback = null) + { + $this->callback_after_upload = $callback; + + return $this; + + } + + /** + * + * Gets the basic database table of our crud. + * @return string + */ + public function get_table() + { + if($this->basic_db_table_checked) + { + return $this->basic_db_table; + } + elseif( $this->basic_db_table !== null ) + { + if(!$this->table_exists($this->basic_db_table)) + { + throw new Exception('The table name does not exist. Please check you database and try again.',11); + die(); + } + $this->basic_db_table_checked = true; + return $this->basic_db_table; + } + else + { + //Last try , try to find the table from your view / function name!!! Not suggested but it works . + $last_chance_table_name = $this->get_method_name(); + if($this->table_exists($last_chance_table_name)) + { + $this->set_table($last_chance_table_name); + } + $this->basic_db_table_checked = true; + return $this->basic_db_table; + + } + + return false; + } + + /** + * + * The field names of the required fields + */ + public function required_fields() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->required_fields = $args; + + return $this; + } + + /** + * Add the fields that they are as UNIQUE in the database structure + * + * @return grocery_CRUD + */ + public function unique_fields() + { + $args = func_get_args(); + + if(isset($args[0]) && is_array($args[0])) + { + $args = $args[0]; + } + + $this->_unique_fields = $args; + + return $this; + } + + /** + * + * Sets the basic database table that we will get our data. + * @param string $table_name + * @return grocery_CRUD + */ + public function set_table($table_name) + { + if(!empty($table_name) && $this->basic_db_table === null) + { + $this->basic_db_table = $table_name; + } + elseif(!empty($table_name)) + { + throw new Exception('You have already insert a table name once...', 1); + } + else + { + throw new Exception('The table name cannot be empty.', 2); + die(); + } + + return $this; + } + + /** + * Set a full URL path to this method. + * + * This method is useful when the path is not specified correctly. + * Especially when we are using routes. + * For example: + * Let's say we have the path http://www.example.com/ however the original url path is + * http://www.example.com/example/index . We have to specify the url so we can have + * all the CRUD operations correctly. + * The url path has to be set from this method like this: + * + * $crud->set_crud_url_path(site_url('example/index')); + * + * + * @param string $crud_url_path + * @param string $list_url_path + * @return grocery_CRUD + */ + public function set_crud_url_path($crud_url_path, $list_url_path = null) + { + $this->crud_url_path = $crud_url_path; + + //If the list_url_path is empty so we are guessing that the list_url_path + //will be the same with crud_url_path + $this->list_url_path = !empty($list_url_path) ? $list_url_path : $crud_url_path; + + return $this; + } + + /** + * + * Set a subject to understand what type of CRUD you use. + * @example In this CRUD we work with the table db_categories. The $subject will be the 'Category' + * @param string $subject + * @param bool $has_plural + * @return grocery_CRUD + */ + public function set_subject( $subject ) + { + $this->subject = $subject; + $this->subject_plural = $subject; + + return $this; + } + + /** + * + * Enter description here ... + * @param $title + * @param $image_url + * @param $url + * @param $css_class + * @param $url_callback + */ + public function add_action( $label, $image_url = '', $link_url = '', $css_class = '', $url_callback = null) + { + $unique_id = substr($label,0,1).substr(md5($label.$link_url),-8); //The unique id is used for class name so it must begin with a string + + $this->actions[$unique_id] = (object)array( + 'label' => $label, + 'image_url' => $image_url, + 'link_url' => $link_url, + 'css_class' => $css_class, + 'url_callback' => $url_callback, + 'url_has_http' => substr($link_url,0,7) == 'http://' || substr($link_url,0,8) == 'https://' ? true : false + ); + + return $this; + } + + /** + * + * Set a simple 1-n foreign key relation + * @param string $field_name + * @param string $related_table + * @param string $related_title_field + * @param mixed $where_clause + * @param string $order_by + */ + public function set_relation($field_name , $related_table, $related_title_field, $where_clause = null, $order_by = null) + { + $this->relation[$field_name] = array($field_name, $related_table,$related_title_field, $where_clause, $order_by); + return $this; + } + + /** + * + * Sets a relation with n-n relationship. + * @param string $field_name + * @param string $relation_table + * @param string $selection_table + * @param string $primary_key_alias_to_this_table + * @param string $primary_key_alias_to_selection_table + * @param string $title_field_selection_table + * @param string $priority_field_relation_table + * @param mixed $where_clause + */ + public function set_relation_n_n($field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table, $primary_key_alias_to_selection_table , $title_field_selection_table , $priority_field_relation_table = null, $where_clause = null) + { + $this->relation_n_n[$field_name] = + (object)array( + 'field_name' => $field_name, + 'relation_table' => $relation_table, + 'selection_table' => $selection_table, + 'primary_key_alias_to_this_table' => $primary_key_alias_to_this_table, + 'primary_key_alias_to_selection_table' => $primary_key_alias_to_selection_table , + 'title_field_selection_table' => $title_field_selection_table , + 'priority_field_relation_table' => $priority_field_relation_table, + 'where_clause' => $where_clause + ); + + return $this; + } + + /** + * + * Transform a field to an upload field + * + * @param string $field_name + * @param string $upload_path + */ + public function set_field_upload($field_name, $upload_dir = '') + { + $upload_dir = !empty($upload_dir) && substr($upload_dir,-1,1) == '/' + ? substr($upload_dir,0,-1) + : $upload_dir; + $upload_dir = !empty($upload_dir) ? $upload_dir : 'assets/uploads/files'; + + /** Check if the upload Url folder exists. If not then throw an exception **/ + if (!is_dir(FCPATH.$upload_dir)) { + throw new Exception("It seems that the folder \"".FCPATH.$upload_dir."\" for the field name + \"".$field_name."\" doesn't exists. Please create the folder and try again."); + } + + $this->upload_fields[$field_name] = (object) array( + 'field_name' => $field_name, + 'upload_path' => $upload_dir, + 'encrypted_field_name' => $this->_unique_field_name($field_name)); + return $this; + } +} + +if(defined('CI_VERSION')) +{ + $ci = &get_instance(); + $ci->load->library('Form_validation'); + + class grocery_CRUD_Form_validation extends CI_Form_validation{ + + public $CI; + public $_field_data = array(); + public $_config_rules = array(); + public $_error_array = array(); + public $_error_messages = array(); + public $_error_prefix = '

'; + public $_error_suffix = '

'; + public $error_string = ''; + public $_safe_form_data = FALSE; + } +} + +/* + * jQuery File Upload Plugin PHP Example 5.5 + * https://github.com/blueimp/jQuery-File-Upload + * + * Copyright 2010, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/MIT + */ + +class UploadHandler +{ + private $options; + public $default_config_path = null; + + function __construct($options=null) { + $this->options = array( + 'script_url' => $this->getFullUrl().'/'.basename(__FILE__), + 'upload_dir' => dirname(__FILE__).'/files/', + 'upload_url' => $this->getFullUrl().'/files/', + 'param_name' => 'files', + // The php.ini settings upload_max_filesize and post_max_size + // take precedence over the following max_file_size setting: + 'max_file_size' => null, + 'min_file_size' => 1, + 'accept_file_types' => '/.+$/i', + 'max_number_of_files' => null, + // Set the following option to false to enable non-multipart uploads: + 'discard_aborted_uploads' => true, + // Set to true to rotate images based on EXIF meta data, if available: + 'orient_image' => false, + 'image_versions' => array( + // Uncomment the following version to restrict the size of + // uploaded images. You can also add additional versions with + // their own upload directories: + /* + 'large' => array( + 'upload_dir' => dirname(__FILE__).'/files/', + 'upload_url' => dirname($_SERVER['PHP_SELF']).'/files/', + 'max_width' => 1920, + 'max_height' => 1200 + ), + + 'thumbnail' => array( + 'upload_dir' => dirname(__FILE__).'/thumbnails/', + 'upload_url' => $this->getFullUrl().'/thumbnails/', + 'max_width' => 80, + 'max_height' => 80 + ) + */ + ) + ); + if ($options) { + // Or else for PHP >= 5.3.0 use: $this->options = array_replace_recursive($this->options, $options); + foreach($options as $option_name => $option) + { + $this->options[$option_name] = $option; + } + } + } + + function getFullUrl() { + return + (isset($_SERVER['HTTPS']) ? 'https://' : 'http://'). + (isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : ''). + (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME']. + (isset($_SERVER['HTTPS']) && $_SERVER['SERVER_PORT'] === 443 || + $_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))). + substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/')); + } + + private function get_file_object($file_name) { + $file_path = $this->options['upload_dir'].$file_name; + if (is_file($file_path) && $file_name[0] !== '.') { + $file = new stdClass(); + $file->name = $file_name; + $file->size = filesize($file_path); + $file->url = $this->options['upload_url'].rawurlencode($file->name); + foreach($this->options['image_versions'] as $version => $options) { + if (is_file($options['upload_dir'].$file_name)) { + $file->{$version.'_url'} = $options['upload_url'] + .rawurlencode($file->name); + } + } + $file->delete_url = $this->options['script_url'] + .'?file='.rawurlencode($file->name); + $file->delete_type = 'DELETE'; + return $file; + } + return null; + } + + private function get_file_objects() { + return array_values(array_filter(array_map( + array($this, 'get_file_object'), + scandir($this->options['upload_dir']) + ))); + } + + private function create_scaled_image($file_name, $options) { + $file_path = $this->options['upload_dir'].$file_name; + $new_file_path = $options['upload_dir'].$file_name; + list($img_width, $img_height) = @getimagesize($file_path); + if (!$img_width || !$img_height) { + return false; + } + $scale = min( + $options['max_width'] / $img_width, + $options['max_height'] / $img_height + ); + if ($scale > 1) { + $scale = 1; + } + $new_width = $img_width * $scale; + $new_height = $img_height * $scale; + $new_img = @imagecreatetruecolor($new_width, $new_height); + switch (strtolower(substr(strrchr($file_name, '.'), 1))) { + case 'jpg': + case 'jpeg': + $src_img = @imagecreatefromjpeg($file_path); + $write_image = 'imagejpeg'; + break; + case 'gif': + @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0)); + $src_img = @imagecreatefromgif($file_path); + $write_image = 'imagegif'; + break; + case 'png': + @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0)); + @imagealphablending($new_img, false); + @imagesavealpha($new_img, true); + $src_img = @imagecreatefrompng($file_path); + $write_image = 'imagepng'; + break; + default: + $src_img = $image_method = null; + } + $success = $src_img && @imagecopyresampled( + $new_img, + $src_img, + 0, 0, 0, 0, + $new_width, + $new_height, + $img_width, + $img_height + ) && $write_image($new_img, $new_file_path); + // Free up memory (imagedestroy does not delete files): + @imagedestroy($src_img); + @imagedestroy($new_img); + return $success; + } + + private function has_error($uploaded_file, $file, $error) { + if ($error) { + switch($error) { + case UPLOAD_ERR_INI_SIZE: + return 'The uploaded file exceeds the upload_max_filesize directive in php.ini.'; + break; + case UPLOAD_ERR_PARTIAL: + return 'The uploaded file was only partially uploaded.'; + break; + case UPLOAD_ERR_NO_FILE: + return 'No file was uploaded.'; + break; + case UPLOAD_ERR_CANT_WRITE: + return 'Failed to write file to disk.'; + break; + case UPLOAD_ERR_EXTENSION: + return 'File upload stopped by extension.'; + break; + default: + return $error; + break; + } + } + if (!preg_match($this->options['accept_file_types'], $file->name)) { + return 'acceptFileTypes'; + } + if ($uploaded_file && is_uploaded_file($uploaded_file)) { + $file_size = filesize($uploaded_file); + } else { + $file_size = $_SERVER['CONTENT_LENGTH']; + } + + if ($this->options['max_file_size'] && ( + $file_size > $this->options['max_file_size'] || + $file->size > $this->options['max_file_size']) + ) { + return 'maxFileSize'; + } + if ($this->options['min_file_size'] && + $file_size < $this->options['min_file_size']) { + return 'minFileSize'; + } + if (is_int($this->options['max_number_of_files']) && ( + count($this->get_file_objects()) >= $this->options['max_number_of_files']) + ) { + return 'maxNumberOfFiles'; + } + return $error; + } + + private function trim_file_name($name, $type) { + // Remove path information and dots around the filename, to prevent uploading + // into different directories or replacing hidden system files. + // Also remove control characters and spaces (\x00..\x20) around the filename: + $file_name = trim(basename(stripslashes($name)), ".\x00..\x20"); + // Add missing file extension for known image types: + if (strpos($file_name, '.') === false && + preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) { + $file_name .= '.'.$matches[1]; + } + + //Ensure that we don't have disallowed characters and add a unique id just to ensure that the file name will be unique + $file_name = substr(uniqid(),-5).'-'.$this->_transliterate_characters($file_name); + + //all the characters has to be lowercase + $file_name = strtolower($file_name); + + return $file_name; + } + + private function _transliterate_characters($file_name) + { + include($this->default_config_path.'/translit_chars.php'); + if ( ! isset($translit_characters)) + { + return preg_replace("/([^a-zA-Z0-9\.\-\_]+?){1}/i", '-', $file_name); + } + $transformed_file_name = preg_replace(array_keys($translit_characters), array_values($translit_characters), $file_name); + return str_replace(" ", "-", $transformed_file_name); + } + + private function orient_image($file_path) { + $exif = exif_read_data($file_path); + $orientation = intval(@$exif['Orientation']); + if (!in_array($orientation, array(3, 6, 8))) { + return false; + } + $image = @imagecreatefromjpeg($file_path); + switch ($orientation) { + case 3: + $image = @imagerotate($image, 180, 0); + break; + case 6: + $image = @imagerotate($image, 270, 0); + break; + case 8: + $image = @imagerotate($image, 90, 0); + break; + default: + return false; + } + $success = imagejpeg($image, $file_path); + // Free up memory (imagedestroy does not delete files): + @imagedestroy($image); + return $success; + } + + private function handle_file_upload($uploaded_file, $name, $size, $type, $error) { + $file = new stdClass(); + $file->name = $this->trim_file_name($name, $type); + $file->size = intval($size); + $file->type = $type; + $error = $this->has_error($uploaded_file, $file, $error); + if (!$error && $file->name) { + $file_path = $this->options['upload_dir'].$file->name; + $append_file = !$this->options['discard_aborted_uploads'] && + is_file($file_path) && $file->size > filesize($file_path); + clearstatcache(); + if ($uploaded_file && is_uploaded_file($uploaded_file)) { + // multipart/formdata uploads (POST method uploads) + if ($append_file) { + file_put_contents( + $file_path, + fopen($uploaded_file, 'r'), + FILE_APPEND + ); + } else { + move_uploaded_file($uploaded_file, $file_path); + } + } else { + // Non-multipart uploads (PUT method support) + file_put_contents( + $file_path, + fopen('php://input', 'r'), + $append_file ? FILE_APPEND : 0 + ); + } + $file_size = filesize($file_path); + if ($file_size === $file->size) { + if ($this->options['orient_image']) { + $this->orient_image($file_path); + } + $file->url = $this->options['upload_url'].rawurlencode($file->name); + foreach($this->options['image_versions'] as $version => $options) { + if ($this->create_scaled_image($file->name, $options)) { + $file->{$version.'_url'} = $options['upload_url'] + .rawurlencode($file->name); + } + } + } else if ($this->options['discard_aborted_uploads']) { + unlink($file_path); + $file->error = "It seems that this user doesn't have permissions to upload to this folder"; + } + $file->size = $file_size; + $file->delete_url = $this->options['script_url'] + .'?file='.rawurlencode($file->name); + $file->delete_type = 'DELETE'; + } else { + $file->error = $error; + } + return $file; + } + + public function get() { + $file_name = isset($_REQUEST['file']) ? + basename(stripslashes($_REQUEST['file'])) : null; + if ($file_name) { + $info = $this->get_file_object($file_name); + } else { + $info = $this->get_file_objects(); + } + header('Content-type: application/json'); + echo json_encode($info); + } + + public function post() { + if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { + return $this->delete(); + } + $upload = isset($_FILES[$this->options['param_name']]) ? + $_FILES[$this->options['param_name']] : null; + $info = array(); + if ($upload && is_array($upload['tmp_name'])) { + foreach ($upload['tmp_name'] as $index => $value) { + $info[] = $this->handle_file_upload( + $upload['tmp_name'][$index], + isset($_SERVER['HTTP_X_FILE_NAME']) ? + $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index], + isset($_SERVER['HTTP_X_FILE_SIZE']) ? + $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index], + isset($_SERVER['HTTP_X_FILE_TYPE']) ? + $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index], + $upload['error'][$index] + ); + } + } elseif ($upload || isset($_SERVER['HTTP_X_FILE_NAME'])) { + $info[] = $this->handle_file_upload( + isset($upload['tmp_name']) ? $upload['tmp_name'] : null, + isset($_SERVER['HTTP_X_FILE_NAME']) ? + $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'], + isset($_SERVER['HTTP_X_FILE_SIZE']) ? + $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'], + isset($_SERVER['HTTP_X_FILE_TYPE']) ? + $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'], + isset($upload['error']) ? $upload['error'] : null + ); + } + header('Vary: Accept'); + + $redirect = isset($_REQUEST['redirect']) ? + stripslashes($_REQUEST['redirect']) : null; + if ($redirect) { + header('Location: '.sprintf($redirect, rawurlencode($json))); + return; + } + if (isset($_SERVER['HTTP_ACCEPT']) && + (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) { + header('Content-type: application/json'); + } else { + header('Content-type: text/plain'); + } + return $info; + } + + public function delete() { + $file_name = isset($_REQUEST['file']) ? + basename(stripslashes($_REQUEST['file'])) : null; + $file_path = $this->options['upload_dir'].$file_name; + $success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path); + if ($success) { + foreach($this->options['image_versions'] as $version => $options) { + $file = $options['upload_dir'].$file_name; + if (is_file($file)) { + unlink($file); + } + } + } + header('Content-type: application/json'); + echo json_encode($success); + } + +} diff --git a/application/libraries/Ion_auth.php b/application/libraries/Ion_auth.php index e372e1b..edaf2a1 100755 --- a/application/libraries/Ion_auth.php +++ b/application/libraries/Ion_auth.php @@ -1,518 +1,518 @@ -load->config('ion_auth', TRUE); - $this->load->library('email'); - $this->lang->load('ion_auth'); - $this->load->helper('cookie'); - $this->load->helper('language'); - $this->load->helper('url'); - - // Load the session, CI2 as a library, CI3 uses it as a driver - if (substr(CI_VERSION, 0, 1) == '2') - { - $this->load->library('session'); - } - else - { - $this->load->driver('session'); - } - - $this->load->model('ion_auth_model'); - - $this->_cache_user_in_group =& $this->ion_auth_model->_cache_user_in_group; - - //auto-login the user if they are remembered - if (!$this->logged_in() && get_cookie($this->config->item('identity_cookie_name', 'ion_auth')) && get_cookie($this->config->item('remember_cookie_name', 'ion_auth'))) - { - $this->ion_auth_model->login_remembered_user(); - } - - $email_config = $this->config->item('email_config', 'ion_auth'); - - if ($this->config->item('use_ci_email', 'ion_auth') && isset($email_config) && is_array($email_config)) - { - $this->email->initialize($email_config); - } - - $this->ion_auth_model->trigger_events('library_constructor'); - } - - /** - * __call - * - * Acts as a simple way to call model methods without loads of stupid alias' - * - **/ - public function __call($method, $arguments) - { - if (!method_exists( $this->ion_auth_model, $method) ) - { - throw new Exception('Undefined method Ion_auth::' . $method . '() called'); - } - - return call_user_func_array( array($this->ion_auth_model, $method), $arguments); - } - - /** - * __get - * - * Enables the use of CI super-global without having to define an extra variable. - * - * I can't remember where I first saw this, so thank you if you are the original author. -Militis - * - * @access public - * @param $var - * @return mixed - */ - public function __get($var) - { - return get_instance()->$var; - } - - - /** - * forgotten password feature - * - * @return mixed boolian / array - * @author Mathew - **/ - public function forgotten_password($identity) //changed $email to $identity - { - if ( $this->ion_auth_model->forgotten_password($identity) ) //changed - { - // Get user information - $user = $this->where($this->config->item('identity', 'ion_auth'), $identity)->where('active', 1)->users()->row(); //changed to get_user_by_identity from email - - if ($user) - { - $data = array( - 'identity' => $user->{$this->config->item('identity', 'ion_auth')}, - 'forgotten_password_code' => $user->forgotten_password_code - ); - - if(!$this->config->item('use_ci_email', 'ion_auth')) - { - $this->set_message('forgot_password_successful'); - return $data; - } - else - { - $message = $this->load->view($this->config->item('email_templates', 'ion_auth').$this->config->item('email_forgot_password', 'ion_auth'), $data, true); - $this->email->clear(); - $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth')); - $this->email->to($user->email); - $this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_forgotten_password_subject')); - $this->email->message($message); - - if ($this->email->send()) - { - $this->set_message('forgot_password_successful'); - return TRUE; - } - else - { - $this->set_error('forgot_password_unsuccessful'); - return FALSE; - } - } - } - else - { - $this->set_error('forgot_password_unsuccessful'); - return FALSE; - } - } - else - { - $this->set_error('forgot_password_unsuccessful'); - return FALSE; - } - } - - /** - * forgotten_password_complete - * - * @return void - * @author Mathew - **/ - public function forgotten_password_complete($code) - { - $this->ion_auth_model->trigger_events('pre_password_change'); - - $identity = $this->config->item('identity', 'ion_auth'); - $profile = $this->where('forgotten_password_code', $code)->users()->row(); //pass the code to profile - - if (!$profile) - { - $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_unsuccessful')); - $this->set_error('password_change_unsuccessful'); - return FALSE; - } - - $new_password = $this->ion_auth_model->forgotten_password_complete($code, $profile->salt); - - if ($new_password) - { - $data = array( - 'identity' => $profile->{$identity}, - 'new_password' => $new_password - ); - if(!$this->config->item('use_ci_email', 'ion_auth')) - { - $this->set_message('password_change_successful'); - $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_successful')); - return $data; - } - else - { - $message = $this->load->view($this->config->item('email_templates', 'ion_auth').$this->config->item('email_forgot_password_complete', 'ion_auth'), $data, true); - - $this->email->clear(); - $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth')); - $this->email->to($profile->email); - $this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_new_password_subject')); - $this->email->message($message); - - if ($this->email->send()) - { - $this->set_message('password_change_successful'); - $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_successful')); - return TRUE; - } - else - { - $this->set_error('password_change_unsuccessful'); - $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_unsuccessful')); - return FALSE; - } - - } - } - - $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_unsuccessful')); - return FALSE; - } - - /** - * forgotten_password_check - * - * @return void - * @author Michael - **/ - public function forgotten_password_check($code) - { - $profile = $this->where('forgotten_password_code', $code)->users()->row(); //pass the code to profile - - if (!is_object($profile)) - { - $this->set_error('password_change_unsuccessful'); - return FALSE; - } - else - { - if ($this->config->item('forgot_password_expiration', 'ion_auth') > 0) { - //Make sure it isn't expired - $expiration = $this->config->item('forgot_password_expiration', 'ion_auth'); - if (time() - $profile->forgotten_password_time > $expiration) { - //it has expired - $this->clear_forgotten_password_code($code); - $this->set_error('password_change_unsuccessful'); - return FALSE; - } - } - return $profile; - } - } - - /** - * register - * - * @return void - * @author Mathew - **/ - public function register($username, $password, $email, $additional_data = array(), $group_ids = array()) //need to test email activation - { - $this->ion_auth_model->trigger_events('pre_account_creation'); - - $email_activation = $this->config->item('email_activation', 'ion_auth'); - - if (!$email_activation) - { - $id = $this->ion_auth_model->register($username, $password, $email, $additional_data, $group_ids); - if ($id !== FALSE) - { - $this->set_message('account_creation_successful'); - $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful')); - return $id; - } - else - { - $this->set_error('account_creation_unsuccessful'); - $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful')); - return FALSE; - } - } - else - { - $id = $this->ion_auth_model->register($username, $password, $email, $additional_data, $group_ids); - - if (!$id) - { - $this->set_error('account_creation_unsuccessful'); - return FALSE; - } - - $deactivate = $this->ion_auth_model->deactivate($id); - - if (!$deactivate) - { - $this->set_error('deactivate_unsuccessful'); - $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful')); - return FALSE; - } - - $activation_code = $this->ion_auth_model->activation_code; - $identity = $this->config->item('identity', 'ion_auth'); - $user = $this->ion_auth_model->user($id)->row(); - - $data = array( - 'identity' => $user->{$identity}, - 'id' => $user->id, - 'email' => $email, - 'activation' => $activation_code, - ); - if(!$this->config->item('use_ci_email', 'ion_auth')) - { - $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful', 'activation_email_successful')); - $this->set_message('activation_email_successful'); - return $data; - } - else - { - $message = $this->load->view($this->config->item('email_templates', 'ion_auth').$this->config->item('email_activate', 'ion_auth'), $data, true); - - $this->email->clear(); - $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth')); - $this->email->to($email); - $this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_activation_subject')); - $this->email->message($message); - - if ($this->email->send() == TRUE) - { - $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful', 'activation_email_successful')); - $this->set_message('activation_email_successful'); - return $id; - } - } - - $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful', 'activation_email_unsuccessful')); - $this->set_error('activation_email_unsuccessful'); - return FALSE; - } - } - - /** - * logout - * - * @return void - * @author Mathew - **/ - public function logout() - { - $this->ion_auth_model->trigger_events('logout'); - - $identity = $this->config->item('identity', 'ion_auth'); - $this->session->unset_userdata( array($identity => '', 'id' => '', 'user_id' => '') ); - - //delete the remember me cookies if they exist - if (get_cookie($this->config->item('identity_cookie_name', 'ion_auth'))) - { - delete_cookie($this->config->item('identity_cookie_name', 'ion_auth')); - } - if (get_cookie($this->config->item('remember_cookie_name', 'ion_auth'))) - { - delete_cookie($this->config->item('remember_cookie_name', 'ion_auth')); - } - - //Destroy the session - $this->session->sess_destroy(); - - //Recreate the session - if (substr(CI_VERSION, 0, 1) == '2') - { - $this->session->sess_create(); - } - else - { - $this->session->sess_regenerate(TRUE); - } - - $this->set_message('logout_successful'); - return TRUE; - } - - /** - * logged_in - * - * @return bool - * @author Mathew - **/ - public function logged_in() - { - $this->ion_auth_model->trigger_events('logged_in'); - - return (bool) $this->session->userdata('identity'); - } - - /** - * logged_in - * - * @return integer - * @author jrmadsen67 - **/ - public function get_user_id() - { - $user_id = $this->session->userdata('user_id'); - if (!empty($user_id)) - { - return $user_id; - } - return null; - } - - - /** - * is_admin - * - * @return bool - * @author Ben Edmunds - **/ - public function is_admin($id=false) - { - $this->ion_auth_model->trigger_events('is_admin'); - - $admin_group = $this->config->item('admin_group', 'ion_auth'); - - return $this->in_group($admin_group, $id); - } - - /** - * in_group - * - * @param mixed group(s) to check - * @param bool user id - * @param bool check if all groups is present, or any of the groups - * - * @return bool - * @author Phil Sturgeon - **/ - public function in_group($check_group, $id=false, $check_all = false) - { - $this->ion_auth_model->trigger_events('in_group'); - - $id || $id = $this->session->userdata('user_id'); - - if (!is_array($check_group)) - { - $check_group = array($check_group); - } - - if (isset($this->_cache_user_in_group[$id])) - { - $groups_array = $this->_cache_user_in_group[$id]; - } - else - { - $users_groups = $this->ion_auth_model->get_users_groups($id)->result(); - $groups_array = array(); - foreach ($users_groups as $group) - { - $groups_array[$group->id] = $group->name; - } - $this->_cache_user_in_group[$id] = $groups_array; - } - foreach ($check_group as $key => $value) - { - $groups = (is_string($value)) ? $groups_array : array_keys($groups_array); - - /** - * if !all (default), in_array - * if all, !in_array - */ - if (in_array($value, $groups) xor $check_all) - { - /** - * if !all (default), true - * if all, false - */ - return !$check_all; - } - } - - /** - * if !all (default), false - * if all, true - */ - return $check_all; - } - -} +load->config('ion_auth', TRUE); + $this->load->library('email'); + $this->lang->load('ion_auth'); + $this->load->helper('cookie'); + $this->load->helper('language'); + $this->load->helper('url'); + + // Load the session, CI2 as a library, CI3 uses it as a driver + if (substr(CI_VERSION, 0, 1) == '2') + { + $this->load->library('session'); + } + else + { + $this->load->driver('session'); + } + + $this->load->model('ion_auth_model'); + + $this->_cache_user_in_group =& $this->ion_auth_model->_cache_user_in_group; + + //auto-login the user if they are remembered + if (!$this->logged_in() && get_cookie($this->config->item('identity_cookie_name', 'ion_auth')) && get_cookie($this->config->item('remember_cookie_name', 'ion_auth'))) + { + $this->ion_auth_model->login_remembered_user(); + } + + $email_config = $this->config->item('email_config', 'ion_auth'); + + if ($this->config->item('use_ci_email', 'ion_auth') && isset($email_config) && is_array($email_config)) + { + $this->email->initialize($email_config); + } + + $this->ion_auth_model->trigger_events('library_constructor'); + } + + /** + * __call + * + * Acts as a simple way to call model methods without loads of stupid alias' + * + **/ + public function __call($method, $arguments) + { + if (!method_exists( $this->ion_auth_model, $method) ) + { + throw new Exception('Undefined method Ion_auth::' . $method . '() called'); + } + + return call_user_func_array( array($this->ion_auth_model, $method), $arguments); + } + + /** + * __get + * + * Enables the use of CI super-global without having to define an extra variable. + * + * I can't remember where I first saw this, so thank you if you are the original author. -Militis + * + * @access public + * @param $var + * @return mixed + */ + public function __get($var) + { + return get_instance()->$var; + } + + + /** + * forgotten password feature + * + * @return mixed boolian / array + * @author Mathew + **/ + public function forgotten_password($identity) //changed $email to $identity + { + if ( $this->ion_auth_model->forgotten_password($identity) ) //changed + { + // Get user information + $user = $this->where($this->config->item('identity', 'ion_auth'), $identity)->where('active', 1)->users()->row(); //changed to get_user_by_identity from email + + if ($user) + { + $data = array( + 'identity' => $user->{$this->config->item('identity', 'ion_auth')}, + 'forgotten_password_code' => $user->forgotten_password_code + ); + + if(!$this->config->item('use_ci_email', 'ion_auth')) + { + $this->set_message('forgot_password_successful'); + return $data; + } + else + { + $message = $this->load->view($this->config->item('email_templates', 'ion_auth').$this->config->item('email_forgot_password', 'ion_auth'), $data, true); + $this->email->clear(); + $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth')); + $this->email->to($user->email); + $this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_forgotten_password_subject')); + $this->email->message($message); + + if ($this->email->send()) + { + $this->set_message('forgot_password_successful'); + return TRUE; + } + else + { + $this->set_error('forgot_password_unsuccessful'); + return FALSE; + } + } + } + else + { + $this->set_error('forgot_password_unsuccessful'); + return FALSE; + } + } + else + { + $this->set_error('forgot_password_unsuccessful'); + return FALSE; + } + } + + /** + * forgotten_password_complete + * + * @return void + * @author Mathew + **/ + public function forgotten_password_complete($code) + { + $this->ion_auth_model->trigger_events('pre_password_change'); + + $identity = $this->config->item('identity', 'ion_auth'); + $profile = $this->where('forgotten_password_code', $code)->users()->row(); //pass the code to profile + + if (!$profile) + { + $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_unsuccessful')); + $this->set_error('password_change_unsuccessful'); + return FALSE; + } + + $new_password = $this->ion_auth_model->forgotten_password_complete($code, $profile->salt); + + if ($new_password) + { + $data = array( + 'identity' => $profile->{$identity}, + 'new_password' => $new_password + ); + if(!$this->config->item('use_ci_email', 'ion_auth')) + { + $this->set_message('password_change_successful'); + $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_successful')); + return $data; + } + else + { + $message = $this->load->view($this->config->item('email_templates', 'ion_auth').$this->config->item('email_forgot_password_complete', 'ion_auth'), $data, true); + + $this->email->clear(); + $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth')); + $this->email->to($profile->email); + $this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_new_password_subject')); + $this->email->message($message); + + if ($this->email->send()) + { + $this->set_message('password_change_successful'); + $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_successful')); + return TRUE; + } + else + { + $this->set_error('password_change_unsuccessful'); + $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_unsuccessful')); + return FALSE; + } + + } + } + + $this->ion_auth_model->trigger_events(array('post_password_change', 'password_change_unsuccessful')); + return FALSE; + } + + /** + * forgotten_password_check + * + * @return void + * @author Michael + **/ + public function forgotten_password_check($code) + { + $profile = $this->where('forgotten_password_code', $code)->users()->row(); //pass the code to profile + + if (!is_object($profile)) + { + $this->set_error('password_change_unsuccessful'); + return FALSE; + } + else + { + if ($this->config->item('forgot_password_expiration', 'ion_auth') > 0) { + //Make sure it isn't expired + $expiration = $this->config->item('forgot_password_expiration', 'ion_auth'); + if (time() - $profile->forgotten_password_time > $expiration) { + //it has expired + $this->clear_forgotten_password_code($code); + $this->set_error('password_change_unsuccessful'); + return FALSE; + } + } + return $profile; + } + } + + /** + * register + * + * @return void + * @author Mathew + **/ + public function register($username, $password, $email, $additional_data = array(), $group_ids = array()) //need to test email activation + { + $this->ion_auth_model->trigger_events('pre_account_creation'); + + $email_activation = $this->config->item('email_activation', 'ion_auth'); + + if (!$email_activation) + { + $id = $this->ion_auth_model->register($username, $password, $email, $additional_data, $group_ids); + if ($id !== FALSE) + { + $this->set_message('account_creation_successful'); + $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful')); + return $id; + } + else + { + $this->set_error('account_creation_unsuccessful'); + $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful')); + return FALSE; + } + } + else + { + $id = $this->ion_auth_model->register($username, $password, $email, $additional_data, $group_ids); + + if (!$id) + { + $this->set_error('account_creation_unsuccessful'); + return FALSE; + } + + $deactivate = $this->ion_auth_model->deactivate($id); + + if (!$deactivate) + { + $this->set_error('deactivate_unsuccessful'); + $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful')); + return FALSE; + } + + $activation_code = $this->ion_auth_model->activation_code; + $identity = $this->config->item('identity', 'ion_auth'); + $user = $this->ion_auth_model->user($id)->row(); + + $data = array( + 'identity' => $user->{$identity}, + 'id' => $user->id, + 'email' => $email, + 'activation' => $activation_code, + ); + if(!$this->config->item('use_ci_email', 'ion_auth')) + { + $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful', 'activation_email_successful')); + $this->set_message('activation_email_successful'); + return $data; + } + else + { + $message = $this->load->view($this->config->item('email_templates', 'ion_auth').$this->config->item('email_activate', 'ion_auth'), $data, true); + + $this->email->clear(); + $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth')); + $this->email->to($email); + $this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_activation_subject')); + $this->email->message($message); + + if ($this->email->send() == TRUE) + { + $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful', 'activation_email_successful')); + $this->set_message('activation_email_successful'); + return $id; + } + } + + $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful', 'activation_email_unsuccessful')); + $this->set_error('activation_email_unsuccessful'); + return FALSE; + } + } + + /** + * logout + * + * @return void + * @author Mathew + **/ + public function logout() + { + $this->ion_auth_model->trigger_events('logout'); + + $identity = $this->config->item('identity', 'ion_auth'); + $this->session->unset_userdata( array($identity => '', 'id' => '', 'user_id' => '') ); + + //delete the remember me cookies if they exist + if (get_cookie($this->config->item('identity_cookie_name', 'ion_auth'))) + { + delete_cookie($this->config->item('identity_cookie_name', 'ion_auth')); + } + if (get_cookie($this->config->item('remember_cookie_name', 'ion_auth'))) + { + delete_cookie($this->config->item('remember_cookie_name', 'ion_auth')); + } + + //Destroy the session + $this->session->sess_destroy(); + + //Recreate the session + if (substr(CI_VERSION, 0, 1) == '2') + { + $this->session->sess_create(); + } + else + { + $this->session->sess_regenerate(TRUE); + } + + $this->set_message('logout_successful'); + return TRUE; + } + + /** + * logged_in + * + * @return bool + * @author Mathew + **/ + public function logged_in() + { + $this->ion_auth_model->trigger_events('logged_in'); + + return (bool) $this->session->userdata('identity'); + } + + /** + * logged_in + * + * @return integer + * @author jrmadsen67 + **/ + public function get_user_id() + { + $user_id = $this->session->userdata('user_id'); + if (!empty($user_id)) + { + return $user_id; + } + return null; + } + + + /** + * is_admin + * + * @return bool + * @author Ben Edmunds + **/ + public function is_admin($id=false) + { + $this->ion_auth_model->trigger_events('is_admin'); + + $admin_group = $this->config->item('admin_group', 'ion_auth'); + + return $this->in_group($admin_group, $id); + } + + /** + * in_group + * + * @param mixed group(s) to check + * @param bool user id + * @param bool check if all groups is present, or any of the groups + * + * @return bool + * @author Phil Sturgeon + **/ + public function in_group($check_group, $id=false, $check_all = false) + { + $this->ion_auth_model->trigger_events('in_group'); + + $id || $id = $this->session->userdata('user_id'); + + if (!is_array($check_group)) + { + $check_group = array($check_group); + } + + if (isset($this->_cache_user_in_group[$id])) + { + $groups_array = $this->_cache_user_in_group[$id]; + } + else + { + $users_groups = $this->ion_auth_model->get_users_groups($id)->result(); + $groups_array = array(); + foreach ($users_groups as $group) + { + $groups_array[$group->id] = $group->name; + } + $this->_cache_user_in_group[$id] = $groups_array; + } + foreach ($check_group as $key => $value) + { + $groups = (is_string($value)) ? $groups_array : array_keys($groups_array); + + /** + * if !all (default), in_array + * if all, !in_array + */ + if (in_array($value, $groups) xor $check_all) + { + /** + * if !all (default), true + * if all, false + */ + return !$check_all; + } + } + + /** + * if !all (default), false + * if all, true + */ + return $check_all; + } + +} diff --git a/application/libraries/image_crud.php b/application/libraries/image_crud.php index 5738d07..077691e 100755 --- a/application/libraries/image_crud.php +++ b/application/libraries/image_crud.php @@ -1,951 +1,951 @@ - - */ -class image_CRUD { - - protected $table_name = null; - protected $priority_field = null; - protected $url_field = 'url'; - protected $title_field = null; - protected $user_id = null; - protected $relation_field = null; - protected $subject = 'Record'; - protected $image_path = ''; - protected $primary_key = 'id'; - protected $ci = null; - protected $thumbnail_prefix = 'thumb__'; - protected $views_as_string = ''; - protected $css_files = array(); - protected $js_files = array(); - - /* Unsetters */ - protected $unset_delete = false; - protected $unset_upload = false; - - protected $language = null; - protected $lang_strings = array(); - protected $default_language_path = 'assets/image_crud/languages'; - - /** - * - * @var Image_moo - */ - private $image_moo = null; - - function __construct() { - $this->ci = &get_instance(); - } - function where($key, $value = NULL, $escape = TRUE) - { - $this->ci->db->where( $key, $value, $escape); - } - - function set_table($table_name) - { - $this->table_name = $table_name; - - return $this; - } - function set_userid($user_id) - { - $this->user_id = $user_id; - - return $this; - } - - function set_relation_field($field_name) - { - $this->relation_field = $field_name; - - return $this; - } - - function set_ordering_field($field_name) - { - $this->priority_field = $field_name; - - return $this; - } - - function set_primary_key_field($field_name) - { - $this->primary_key = $field_name; - } - - function set_subject($subject) - { - $this->subject = $subject; - - return $this; - } - - function set_url_field($url_field) - { - $this->url_field = $url_field; - - return $this; - } - - function set_title_field($title_field) - { - $this->title_field = $title_field; - - return $this; - } - - function set_image_path($image_path) - { - $this->image_path = $image_path; - - return $this; - } - - function set_thumbnail_prefix($prefix) - { - $this->thumbnail_prefix = $prefix; - - return $this; - } - - /** - * Unsets the delete operation from the gallery - * - * @return void - */ - public function unset_delete() - { - $this->unset_delete = true; - - return $this; - } - - /** - * Unsets the upload functionality from the gallery - * - * @return void - */ - public function unset_upload() - { - $this->unset_upload = true; - - return $this; - } - - public function set_css($css_file) - { - $this->css_files[sha1($css_file)] = base_url().$css_file; - } - - public function set_js($js_file) - { - $this->js_files[sha1($js_file)] = base_url().$js_file; - } - - protected function _library_view($view, $vars = array(), $return = FALSE) - { - $vars = (is_object($vars)) ? get_object_vars($vars) : $vars; - - $file_exists = FALSE; - - $ext = pathinfo($view, PATHINFO_EXTENSION); - $file = ($ext == '') ? $view.'.php' : $view; - - $view_file = 'assets/image_crud/views/'; - - if (file_exists($view_file.$file)) - { - $path = $view_file.$file; - $file_exists = TRUE; - } - - if ( ! $file_exists) - { - throw new Exception('Unable to load the requested file: '.$file, 16); - } - - extract($vars); - - #region buffering... - ob_start(); - - include($path); - - $buffer = ob_get_contents(); - @ob_end_clean(); - #endregion - - if ($return === TRUE) - { - return $buffer; - } - - $this->views_as_string .= $buffer; - } - - public function get_css_files() - { - return $this->css_files; - } - - public function get_js_files() - { - return $this->js_files; - } - - /** - * - * Load the language strings array from the language file - */ - private function _load_language() - { - $ci = &get_instance(); - $ci->config->load('image_crud'); - if($this->language === null) - { - $this->language = strtolower($ci->config->item('image_crud_default_language')); - } - include($this->default_language_path.'/'.$this->language.'.php'); - - foreach($lang as $handle => $lang_string) - if(!isset($this->lang_strings[$handle])) - $this->lang_strings[$handle] = $lang_string; - } - - /** - * - * Just an alias to get_lang_string method - * @param string $handle - */ - public function l($handle) - { - return $this->get_lang_string($handle); - } - - /** - * - * Get the language string of the inserted string handle - * @param string $handle - */ - public function get_lang_string($handle) - { - return $this->lang_strings[$handle]; - } - - /** - * - * Simply set the language - * @example english - * @param string $language - */ - public function set_language($language) - { - $this->language = $language; - - return $this; - } - - protected function get_layout() - { - $js_files = $this->get_js_files(); - $css_files = $this->get_css_files(); - - return (object)array('output' => $this->views_as_string, 'js_files' => $js_files, 'css_files' => $css_files); - - } - - protected function _upload_file($upload_dir) { - - $reg_exp = '/(\\.|\\/)(gif|jpeg|jpg|png)$/i'; - - $options = array( - 'upload_dir' => $upload_dir.'/', - 'param_name' => 'qqfile', - 'upload_url' => base_url().$upload_dir.'/', - 'accept_file_types' => $reg_exp - ); - $upload_handler = new ImageUploadHandler($options); - $uploader_response = $upload_handler->post(); - - if(is_array($uploader_response)) - { - foreach($uploader_response as &$response) - { - unset($response->delete_url); - unset($response->delete_type); - } - - $upload_response = $uploader_response[0]; - } else { - $upload_response = false; - } - - if (!empty($upload_response)) { - $ci = &get_instance(); - $ci->load->library('image_moo'); - - $filename = $upload_response->name; - - $path = $upload_dir.'/'.$filename; - - /* Resizing to 1024 x 768 if its required */ - list($width, $height) = getimagesize($path); - if($width > 1024 || $height > 768) - { - $ci->image_moo->load($path)->resize(1024,768)->save($path,true); - } - /* ------------------------------------- */ - - return $filename; - } else { - return false; - } - - } - - protected function _changing_priority($post_array) - { - $counter = 1; - foreach($post_array as $photo_id) - { - $this->ci->db->update($this->table_name, array($this->priority_field => $counter), array($this->primary_key => $photo_id)); - $counter++; - } - } - - protected function _insert_title($primary_key, $value) - { - $this->ci->db->update($this->table_name, array($this->title_field => $value), array($this->primary_key => $primary_key)); - } - - protected function _insert_table($file_name, $relation_id = null) - { - $insert = array($this->url_field => $file_name); - if(!empty($relation_id)) - $insert[$this->relation_field] = $relation_id; - if($this->user_id) - $insert['user_id'] = $this->user_id; - $this->ci->db->insert($this->table_name, $insert); - } - - protected function _delete_file($id) - { - $this->ci->db->where($this->primary_key,$id); - $result = $this->ci->db->get($this->table_name)->row(); - - unlink( $this->image_path.'/'.$result->{$this->url_field} ); - unlink( $this->image_path.'/'.$this->thumbnail_prefix.$result->{$this->url_field} ); - - $this->ci->db->delete($this->table_name, array($this->primary_key => $id)); - } - - protected function _get_delete_url($value) - { - $rsegments_array = $this->ci->uri->rsegment_array(); - return site_url($rsegments_array[1].'/'.$rsegments_array[2].'/delete_file/'.$value); - } - - protected function _get_photos($relation_value = null) - { - if(!empty($this->priority_field)) - { - $this->ci->db->order_by($this->priority_field); - } - if(!empty($this->user_id)) - { - $this->ci->db->where('user_id',$this->user_id); - } - if(!empty($relation_value) AND !empty($this->relation_field)) - { - $this->ci->db->where($this->relation_field, $relation_value); - } - $results = $this->ci->db->get($this->table_name)->result(); - - $thumbnail_url = !empty($this->thumbnail_path) ? $this->thumbnail_path : $this->image_path; - - foreach($results as $num => $row) - { - if (!file_exists($this->image_path.'/'.$this->thumbnail_prefix.$row->{$this->url_field})) { - $this->_create_thumbnail($this->image_path.'/'.$row->{$this->url_field}, $this->image_path.'/'.$this->thumbnail_prefix.$row->{$this->url_field}); - } - - $results[$num]->image_url = base_url().$this->image_path.'/'.$row->{$this->url_field}; - $results[$num]->thumbnail_url = base_url().$this->image_path.'/'.$this->thumbnail_prefix.$row->{$this->url_field}; - $results[$num]->delete_url = $this->_get_delete_url($row->{$this->primary_key}); - } - - return $results; - } - - protected function _convert_foreign_characters($str_i) - { - include('assets/image_crud/config/translit_chars.php'); - if ( ! isset($translit_characters)) - { - return $str_i; - } - return preg_replace(array_keys($translit_characters), array_values($translit_characters), $str_i); - } - - protected function _create_thumbnail($image_path, $thumbnail_path) - { - $this->image_moo - ->load($image_path) - ->resize_crop(90,60) - ->save($thumbnail_path,true); - } - - protected function getState() - { - $rsegments_array = $this->ci->uri->rsegment_array(); - - if(isset($rsegments_array[3]) && is_numeric($rsegments_array[3])) - { - $upload_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/upload_file/'.$rsegments_array[3]); - $ajax_list_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/'.$rsegments_array[3].'/ajax_list'); - $ordering_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/ordering'); - $insert_title_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/insert_title'); - - $state = array( 'name' => 'list', 'upload_url' => $upload_url, 'relation_value' => $rsegments_array[3]); - $state['ajax'] = isset($rsegments_array[4]) && $rsegments_array[4] == 'ajax_list' ? true : false; - $state['ajax_list_url'] = $ajax_list_url; - $state['ordering_url'] = $ordering_url; - $state['insert_title_url'] = $insert_title_url; - - - return (object)$state; - } - elseif( (empty($rsegments_array[3]) && empty($this->relation_field)) || (!empty($rsegments_array[3]) && $rsegments_array[3] == 'ajax_list')) - { - $upload_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/upload_file'); - $ajax_list_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/ajax_list'); - $ordering_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/ordering'); - $insert_title_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/insert_title'); - - $state = array( 'name' => 'list', 'upload_url' => $upload_url); - $state['ajax'] = isset($rsegments_array[3]) && $rsegments_array[3] == 'ajax_list' ? true : false; - $state['ajax_list_url'] = $ajax_list_url; - $state['ordering_url'] = $ordering_url; - $state['insert_title_url'] = $insert_title_url; - - return (object)$state; - } - elseif(isset($rsegments_array[3]) && $rsegments_array[3] == 'upload_file') - { - #region Just rename my file - $new_file_name = ''; - //$old_file_name = $this->_to_greeklish($_GET['qqfile']); - $old_file_name = $this->_convert_foreign_characters($_GET['qqfile']); - $max = strlen($old_file_name); - for($i=0; $i< $max;$i++) - { - $numMatches = preg_match('/^[A-Za-z0-9.-_]+$/', $old_file_name[$i], $matches); - if($numMatches >0) - { - $new_file_name .= strtolower($old_file_name[$i]); - } - else - { - $new_file_name .= '-'; - } - } - $file_name = substr( substr( uniqid(), 9,13).'-'.$new_file_name , 0, 100) ; - #endregion - - $results = array( 'name' => 'upload_file', 'file_name' => $file_name); - if(isset($rsegments_array[4]) && is_numeric($rsegments_array[4])) - { - $results['relation_value'] = $rsegments_array[4]; - } - return (object)$results; - } - elseif(isset($rsegments_array[3]) && isset($rsegments_array[4]) && $rsegments_array[3] == 'delete_file' && is_numeric($rsegments_array[4])) - { - $state = array( 'name' => 'delete_file', 'id' => $rsegments_array[4]); - return (object)$state; - } - elseif(isset($rsegments_array[3]) && $rsegments_array[3] == 'ordering') - { - $state = array( 'name' => 'ordering'); - return (object)$state; - } - elseif(isset($rsegments_array[3]) && $rsegments_array[3] == 'insert_title') - { - $state = array( 'name' => 'insert_title'); - return (object)$state; - } - } - - function render() - { - $ci = &get_instance(); - $this->_load_language(); - $ci->load->helper('url'); - $ci->load->library('Image_moo'); - $this->image_moo = new Image_moo(); - - $state_info = $this->getState(); - - if(!empty($state_info)) - { - switch ($state_info->name) { - case 'list': - $photos = isset($state_info->relation_value) ? $this->_get_photos($state_info->relation_value) : $this->_get_photos(); - $this->_library_view('list.php',array( - 'upload_url' => $state_info->upload_url, - 'insert_title_url' => $state_info->insert_title_url, - 'photos' => $photos, - 'ajax_list_url' => $state_info->ajax_list_url, - 'ordering_url' => $state_info->ordering_url, - 'primary_key' => $this->primary_key, - 'title_field' => $this->title_field, - 'unset_delete' => $this->unset_delete, - 'unset_upload' => $this->unset_upload, - 'has_priority_field' => $this->priority_field !== null ? true : false - )); - - if($state_info->ajax === true) - { - @ob_end_clean(); - echo $this->get_layout()->output; - die(); - } - return $this->get_layout(); - break; - - case 'upload_file': - if($this->unset_upload) - { - throw new Exception('This user is not allowed to do this operation', 1); - die(); - } - - $file_name = $this->_upload_file( $this->image_path); - - if ($file_name !== false) { - $this->_create_thumbnail( $this->image_path.'/'.$file_name , $this->image_path.'/'.$this->thumbnail_prefix.$file_name ); - $this->_insert_table($file_name, $state_info->relation_value); - - $result = true; - } else { - $result = false; - } - - @ob_end_clean(); - echo json_encode((object)array('success' => $result)); - - die(); - break; - - case 'delete_file': - @ob_end_clean(); - if($this->unset_delete) - { - throw new Exception('This user is not allowed to do this operation', 1); - die(); - } - $id = $state_info->id; - - $this->_delete_file($id); - - redirect($_SERVER['HTTP_REFERER']); - break; - - case 'ordering': - @ob_end_clean(); - $this->_changing_priority($_POST['photos']); - die(); - break; - - case 'insert_title': - @ob_end_clean(); - $this->_insert_title($_POST['primary_key'],$_POST['value']); - die(); - break; - } - } - - } - -} - - - -/* - * jQuery File Upload Plugin PHP Example 5.5 -* https://github.com/blueimp/jQuery-File-Upload -* -* Copyright 2010, Sebastian Tschan -* https://blueimp.net -* -* Licensed under the MIT license: -* http://www.opensource.org/licenses/MIT -*/ - -class ImageUploadHandler -{ - private $options; - - function __construct($options=null) { - $this->options = array( - 'script_url' => $this->getFullUrl().'/'.basename(__FILE__), - 'upload_dir' => dirname(__FILE__).'/files/', - 'upload_url' => $this->getFullUrl().'/files/', - 'param_name' => 'files', - // The php.ini settings upload_max_filesize and post_max_size - // take precedence over the following max_file_size setting: - 'max_file_size' => null, - 'min_file_size' => 1, - 'accept_file_types' => '/.+$/i', - 'max_number_of_files' => null, - // Set the following option to false to enable non-multipart uploads: - 'discard_aborted_uploads' => true, - // Set to true to rotate images based on EXIF meta data, if available: - 'orient_image' => false, - 'image_versions' => array( - // Uncomment the following version to restrict the size of - // uploaded images. You can also add additional versions with - // their own upload directories: - /* - 'large' => array( - 'upload_dir' => dirname(__FILE__).'/files/', - 'upload_url' => dirname($_SERVER['PHP_SELF']).'/files/', - 'max_width' => 1920, - 'max_height' => 1200 - ), - - 'thumbnail' => array( - 'upload_dir' => dirname(__FILE__).'/thumbnails/', - 'upload_url' => $this->getFullUrl().'/thumbnails/', - 'max_width' => 80, - 'max_height' => 80 - ) - */ - ) - ); - if ($options) { - // Or else for PHP >= 5.3.0 use: $this->options = array_replace_recursive($this->options, $options); - foreach($options as $option_name => $option) - { - $this->options[$option_name] = $option; - } - } - } - - function getFullUrl() { - return - (isset($_SERVER['HTTPS']) ? 'https://' : 'http://'). - (isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : ''). - (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME']. - (isset($_SERVER['HTTPS']) && $_SERVER['SERVER_PORT'] === 443 || - $_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))). - substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/')); - } - - private function get_file_object($file_name) { - $file_path = $this->options['upload_dir'].$file_name; - if (is_file($file_path) && $file_name[0] !== '.') { - $file = new stdClass(); - $file->name = $file_name; - $file->size = filesize($file_path); - $file->url = $this->options['upload_url'].rawurlencode($file->name); - foreach($this->options['image_versions'] as $version => $options) { - if (is_file($options['upload_dir'].$file_name)) { - $file->{$version.'_url'} = $options['upload_url'] - .rawurlencode($file->name); - } - } - $file->delete_url = $this->options['script_url'] - .'?file='.rawurlencode($file->name); - $file->delete_type = 'DELETE'; - return $file; - } - return null; - } - - private function get_file_objects() { - return array_values(array_filter(array_map( - array($this, 'get_file_object'), - scandir($this->options['upload_dir']) - ))); - } - - private function create_scaled_image($file_name, $options) { - $file_path = $this->options['upload_dir'].$file_name; - $new_file_path = $options['upload_dir'].$file_name; - list($img_width, $img_height) = @getimagesize($file_path); - if (!$img_width || !$img_height) { - return false; - } - $scale = min( - $options['max_width'] / $img_width, - $options['max_height'] / $img_height - ); - if ($scale > 1) { - $scale = 1; - } - $new_width = $img_width * $scale; - $new_height = $img_height * $scale; - $new_img = @imagecreatetruecolor($new_width, $new_height); - switch (strtolower(substr(strrchr($file_name, '.'), 1))) { - case 'jpg': - case 'jpeg': - $src_img = @imagecreatefromjpeg($file_path); - $write_image = 'imagejpeg'; - break; - case 'gif': - @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0)); - $src_img = @imagecreatefromgif($file_path); - $write_image = 'imagegif'; - break; - case 'png': - @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0)); - @imagealphablending($new_img, false); - @imagesavealpha($new_img, true); - $src_img = @imagecreatefrompng($file_path); - $write_image = 'imagepng'; - break; - default: - $src_img = $image_method = null; - } - $success = $src_img && @imagecopyresampled( - $new_img, - $src_img, - 0, 0, 0, 0, - $new_width, - $new_height, - $img_width, - $img_height - ) && $write_image($new_img, $new_file_path); - // Free up memory (imagedestroy does not delete files): - @imagedestroy($src_img); - @imagedestroy($new_img); - return $success; - } - - private function has_error($uploaded_file, $file, $error) { - if ($error) { - return $error; - } - if (!preg_match($this->options['accept_file_types'], $file->name)) { - return 'acceptFileTypes'; - } - if ($uploaded_file && is_uploaded_file($uploaded_file)) { - $file_size = filesize($uploaded_file); - } else { - $file_size = $_SERVER['CONTENT_LENGTH']; - } - - if ($this->options['max_file_size'] && ( - $file_size > $this->options['max_file_size'] || - $file->size > $this->options['max_file_size']) - ) { - return 'maxFileSize'; - } - if ($this->options['min_file_size'] && - $file_size < $this->options['min_file_size']) { - return 'minFileSize'; - } - if (is_int($this->options['max_number_of_files']) && ( - count($this->get_file_objects()) >= $this->options['max_number_of_files']) - ) { - return 'maxNumberOfFiles'; - } - return $error; - } - - private function trim_file_name($name, $type) { - // Remove path information and dots around the filename, to prevent uploading - // into different directories or replacing hidden system files. - // Also remove control characters and spaces (\x00..\x20) around the filename: - $file_name = trim(basename(stripslashes($name)), ".\x00..\x20"); - // Add missing file extension for known image types: - if (strpos($file_name, '.') === false && - preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) { - $file_name .= '.'.$matches[1]; - } - - //Ensure that we don't have disallowed characters and add a unique id just to ensure that the file name will be unique - $file_name = substr(uniqid(),-5).'-'.preg_replace("/([^a-zA-Z0-9\.\-\_]+?){1}/i", '-', $file_name); - - return $file_name; - } - - private function orient_image($file_path) { - $exif = exif_read_data($file_path); - $orientation = intval(@$exif['Orientation']); - if (!in_array($orientation, array(3, 6, 8))) { - return false; - } - $image = @imagecreatefromjpeg($file_path); - switch ($orientation) { - case 3: - $image = @imagerotate($image, 180, 0); - break; - case 6: - $image = @imagerotate($image, 270, 0); - break; - case 8: - $image = @imagerotate($image, 90, 0); - break; - default: - return false; - } - $success = imagejpeg($image, $file_path); - // Free up memory (imagedestroy does not delete files): - @imagedestroy($image); - return $success; - } - - private function handle_file_upload($uploaded_file, $name, $size, $type, $error) { - $file = new stdClass(); - $file->name = $this->trim_file_name($name, $type); - $file->size = intval($size); - $file->type = $type; - $error = $this->has_error($uploaded_file, $file, $error); - if (!$error && $file->name) { - $file_path = $this->options['upload_dir'].$file->name; - $append_file = !$this->options['discard_aborted_uploads'] && - is_file($file_path) && $file->size > filesize($file_path); - clearstatcache(); - if ($uploaded_file && is_uploaded_file($uploaded_file)) { - // multipart/formdata uploads (POST method uploads) - if ($append_file) { - file_put_contents( - $file_path, - fopen($uploaded_file, 'r'), - FILE_APPEND - ); - } else { - move_uploaded_file($uploaded_file, $file_path); - } - } else { - // Non-multipart uploads (PUT method support) - file_put_contents( - $file_path, - fopen('php://input', 'r'), - $append_file ? FILE_APPEND : 0 - ); - } - $file_size = filesize($file_path); - if ($file_size === $file->size) { - if ($this->options['orient_image']) { - $this->orient_image($file_path); - } - $file->url = $this->options['upload_url'].rawurlencode($file->name); - foreach($this->options['image_versions'] as $version => $options) { - if ($this->create_scaled_image($file->name, $options)) { - $file->{$version.'_url'} = $options['upload_url'] - .rawurlencode($file->name); - } - } - } else if ($this->options['discard_aborted_uploads']) { - unlink($file_path); - $file->error = 'abort'; - } - $file->size = $file_size; - $file->delete_url = $this->options['script_url'] - .'?file='.rawurlencode($file->name); - $file->delete_type = 'DELETE'; - } else { - $file->error = $error; - } - return $file; - } - - public function get() { - $file_name = isset($_REQUEST['file']) ? - basename(stripslashes($_REQUEST['file'])) : null; - if ($file_name) { - $info = $this->get_file_object($file_name); - } else { - $info = $this->get_file_objects(); - } - header('Content-type: application/json'); - echo json_encode($info); - } - - public function post() { - if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { - return $this->delete(); - } - $upload = isset($_FILES[$this->options['param_name']]) ? - $_FILES[$this->options['param_name']] : null; - $info = array(); - if ($upload && is_array($upload['tmp_name'])) { - foreach ($upload['tmp_name'] as $index => $value) { - $info[] = $this->handle_file_upload( - $upload['tmp_name'][$index], - isset($_SERVER['HTTP_X_FILE_NAME']) ? - $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index], - isset($_SERVER['HTTP_X_FILE_SIZE']) ? - $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index], - isset($_SERVER['HTTP_X_FILE_TYPE']) ? - $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index], - $upload['error'][$index] - ); - } - } elseif ($upload || isset($_SERVER['HTTP_X_FILE_NAME'])) { - $info[] = $this->handle_file_upload( - isset($upload['tmp_name']) ? $upload['tmp_name'] : null, - isset($_SERVER['HTTP_X_FILE_NAME']) ? - $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'], - isset($_SERVER['HTTP_X_FILE_SIZE']) ? - $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'], - isset($_SERVER['HTTP_X_FILE_TYPE']) ? - $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'], - isset($upload['error']) ? $upload['error'] : null - ); - } - header('Vary: Accept'); - - $redirect = isset($_REQUEST['redirect']) ? - stripslashes($_REQUEST['redirect']) : null; - if ($redirect) { - header('Location: '.sprintf($redirect, rawurlencode($json))); - return; - } - if (isset($_SERVER['HTTP_ACCEPT']) && - (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) { - header('Content-type: application/json'); - } else { - header('Content-type: text/plain'); - } - return $info; - } - - public function delete() { - $file_name = isset($_REQUEST['file']) ? - basename(stripslashes($_REQUEST['file'])) : null; - $file_path = $this->options['upload_dir'].$file_name; - $success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path); - if ($success) { - foreach($this->options['image_versions'] as $version => $options) { - $file = $options['upload_dir'].$file_name; - if (is_file($file)) { - unlink($file); - } - } - } - header('Content-type: application/json'); - echo json_encode($success); - } - -} + + */ +class image_CRUD { + + protected $table_name = null; + protected $priority_field = null; + protected $url_field = 'url'; + protected $title_field = null; + protected $user_id = null; + protected $relation_field = null; + protected $subject = 'Record'; + protected $image_path = ''; + protected $primary_key = 'id'; + protected $ci = null; + protected $thumbnail_prefix = 'thumb__'; + protected $views_as_string = ''; + protected $css_files = array(); + protected $js_files = array(); + + /* Unsetters */ + protected $unset_delete = false; + protected $unset_upload = false; + + protected $language = null; + protected $lang_strings = array(); + protected $default_language_path = 'assets/image_crud/languages'; + + /** + * + * @var Image_moo + */ + private $image_moo = null; + + function __construct() { + $this->ci = &get_instance(); + } + function where($key, $value = NULL, $escape = TRUE) + { + $this->ci->db->where( $key, $value, $escape); + } + + function set_table($table_name) + { + $this->table_name = $table_name; + + return $this; + } + function set_userid($user_id) + { + $this->user_id = $user_id; + + return $this; + } + + function set_relation_field($field_name) + { + $this->relation_field = $field_name; + + return $this; + } + + function set_ordering_field($field_name) + { + $this->priority_field = $field_name; + + return $this; + } + + function set_primary_key_field($field_name) + { + $this->primary_key = $field_name; + } + + function set_subject($subject) + { + $this->subject = $subject; + + return $this; + } + + function set_url_field($url_field) + { + $this->url_field = $url_field; + + return $this; + } + + function set_title_field($title_field) + { + $this->title_field = $title_field; + + return $this; + } + + function set_image_path($image_path) + { + $this->image_path = $image_path; + + return $this; + } + + function set_thumbnail_prefix($prefix) + { + $this->thumbnail_prefix = $prefix; + + return $this; + } + + /** + * Unsets the delete operation from the gallery + * + * @return void + */ + public function unset_delete() + { + $this->unset_delete = true; + + return $this; + } + + /** + * Unsets the upload functionality from the gallery + * + * @return void + */ + public function unset_upload() + { + $this->unset_upload = true; + + return $this; + } + + public function set_css($css_file) + { + $this->css_files[sha1($css_file)] = base_url().$css_file; + } + + public function set_js($js_file) + { + $this->js_files[sha1($js_file)] = base_url().$js_file; + } + + protected function _library_view($view, $vars = array(), $return = FALSE) + { + $vars = (is_object($vars)) ? get_object_vars($vars) : $vars; + + $file_exists = FALSE; + + $ext = pathinfo($view, PATHINFO_EXTENSION); + $file = ($ext == '') ? $view.'.php' : $view; + + $view_file = 'assets/image_crud/views/'; + + if (file_exists($view_file.$file)) + { + $path = $view_file.$file; + $file_exists = TRUE; + } + + if ( ! $file_exists) + { + throw new Exception('Unable to load the requested file: '.$file, 16); + } + + extract($vars); + + #region buffering... + ob_start(); + + include($path); + + $buffer = ob_get_contents(); + @ob_end_clean(); + #endregion + + if ($return === TRUE) + { + return $buffer; + } + + $this->views_as_string .= $buffer; + } + + public function get_css_files() + { + return $this->css_files; + } + + public function get_js_files() + { + return $this->js_files; + } + + /** + * + * Load the language strings array from the language file + */ + private function _load_language() + { + $ci = &get_instance(); + $ci->config->load('image_crud'); + if($this->language === null) + { + $this->language = strtolower($ci->config->item('image_crud_default_language')); + } + include($this->default_language_path.'/'.$this->language.'.php'); + + foreach($lang as $handle => $lang_string) + if(!isset($this->lang_strings[$handle])) + $this->lang_strings[$handle] = $lang_string; + } + + /** + * + * Just an alias to get_lang_string method + * @param string $handle + */ + public function l($handle) + { + return $this->get_lang_string($handle); + } + + /** + * + * Get the language string of the inserted string handle + * @param string $handle + */ + public function get_lang_string($handle) + { + return $this->lang_strings[$handle]; + } + + /** + * + * Simply set the language + * @example english + * @param string $language + */ + public function set_language($language) + { + $this->language = $language; + + return $this; + } + + protected function get_layout() + { + $js_files = $this->get_js_files(); + $css_files = $this->get_css_files(); + + return (object)array('output' => $this->views_as_string, 'js_files' => $js_files, 'css_files' => $css_files); + + } + + protected function _upload_file($upload_dir) { + + $reg_exp = '/(\\.|\\/)(gif|jpeg|jpg|png)$/i'; + + $options = array( + 'upload_dir' => $upload_dir.'/', + 'param_name' => 'qqfile', + 'upload_url' => base_url().$upload_dir.'/', + 'accept_file_types' => $reg_exp + ); + $upload_handler = new ImageUploadHandler($options); + $uploader_response = $upload_handler->post(); + + if(is_array($uploader_response)) + { + foreach($uploader_response as &$response) + { + unset($response->delete_url); + unset($response->delete_type); + } + + $upload_response = $uploader_response[0]; + } else { + $upload_response = false; + } + + if (!empty($upload_response)) { + $ci = &get_instance(); + $ci->load->library('image_moo'); + + $filename = $upload_response->name; + + $path = $upload_dir.'/'.$filename; + + /* Resizing to 1024 x 768 if its required */ + list($width, $height) = getimagesize($path); + if($width > 1024 || $height > 768) + { + $ci->image_moo->load($path)->resize(1024,768)->save($path,true); + } + /* ------------------------------------- */ + + return $filename; + } else { + return false; + } + + } + + protected function _changing_priority($post_array) + { + $counter = 1; + foreach($post_array as $photo_id) + { + $this->ci->db->update($this->table_name, array($this->priority_field => $counter), array($this->primary_key => $photo_id)); + $counter++; + } + } + + protected function _insert_title($primary_key, $value) + { + $this->ci->db->update($this->table_name, array($this->title_field => $value), array($this->primary_key => $primary_key)); + } + + protected function _insert_table($file_name, $relation_id = null) + { + $insert = array($this->url_field => $file_name); + if(!empty($relation_id)) + $insert[$this->relation_field] = $relation_id; + if($this->user_id) + $insert['user_id'] = $this->user_id; + $this->ci->db->insert($this->table_name, $insert); + } + + protected function _delete_file($id) + { + $this->ci->db->where($this->primary_key,$id); + $result = $this->ci->db->get($this->table_name)->row(); + + unlink( $this->image_path.'/'.$result->{$this->url_field} ); + unlink( $this->image_path.'/'.$this->thumbnail_prefix.$result->{$this->url_field} ); + + $this->ci->db->delete($this->table_name, array($this->primary_key => $id)); + } + + protected function _get_delete_url($value) + { + $rsegments_array = $this->ci->uri->rsegment_array(); + return site_url($rsegments_array[1].'/'.$rsegments_array[2].'/delete_file/'.$value); + } + + protected function _get_photos($relation_value = null) + { + if(!empty($this->priority_field)) + { + $this->ci->db->order_by($this->priority_field); + } + if(!empty($this->user_id)) + { + $this->ci->db->where('user_id',$this->user_id); + } + if(!empty($relation_value) AND !empty($this->relation_field)) + { + $this->ci->db->where($this->relation_field, $relation_value); + } + $results = $this->ci->db->get($this->table_name)->result(); + + $thumbnail_url = !empty($this->thumbnail_path) ? $this->thumbnail_path : $this->image_path; + + foreach($results as $num => $row) + { + if (!file_exists($this->image_path.'/'.$this->thumbnail_prefix.$row->{$this->url_field})) { + $this->_create_thumbnail($this->image_path.'/'.$row->{$this->url_field}, $this->image_path.'/'.$this->thumbnail_prefix.$row->{$this->url_field}); + } + + $results[$num]->image_url = base_url().$this->image_path.'/'.$row->{$this->url_field}; + $results[$num]->thumbnail_url = base_url().$this->image_path.'/'.$this->thumbnail_prefix.$row->{$this->url_field}; + $results[$num]->delete_url = $this->_get_delete_url($row->{$this->primary_key}); + } + + return $results; + } + + protected function _convert_foreign_characters($str_i) + { + include('assets/image_crud/config/translit_chars.php'); + if ( ! isset($translit_characters)) + { + return $str_i; + } + return preg_replace(array_keys($translit_characters), array_values($translit_characters), $str_i); + } + + protected function _create_thumbnail($image_path, $thumbnail_path) + { + $this->image_moo + ->load($image_path) + ->resize_crop(90,60) + ->save($thumbnail_path,true); + } + + protected function getState() + { + $rsegments_array = $this->ci->uri->rsegment_array(); + + if(isset($rsegments_array[3]) && is_numeric($rsegments_array[3])) + { + $upload_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/upload_file/'.$rsegments_array[3]); + $ajax_list_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/'.$rsegments_array[3].'/ajax_list'); + $ordering_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/ordering'); + $insert_title_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/insert_title'); + + $state = array( 'name' => 'list', 'upload_url' => $upload_url, 'relation_value' => $rsegments_array[3]); + $state['ajax'] = isset($rsegments_array[4]) && $rsegments_array[4] == 'ajax_list' ? true : false; + $state['ajax_list_url'] = $ajax_list_url; + $state['ordering_url'] = $ordering_url; + $state['insert_title_url'] = $insert_title_url; + + + return (object)$state; + } + elseif( (empty($rsegments_array[3]) && empty($this->relation_field)) || (!empty($rsegments_array[3]) && $rsegments_array[3] == 'ajax_list')) + { + $upload_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/upload_file'); + $ajax_list_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/ajax_list'); + $ordering_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/ordering'); + $insert_title_url = site_url($rsegments_array[1].'/'.$rsegments_array[2].'/insert_title'); + + $state = array( 'name' => 'list', 'upload_url' => $upload_url); + $state['ajax'] = isset($rsegments_array[3]) && $rsegments_array[3] == 'ajax_list' ? true : false; + $state['ajax_list_url'] = $ajax_list_url; + $state['ordering_url'] = $ordering_url; + $state['insert_title_url'] = $insert_title_url; + + return (object)$state; + } + elseif(isset($rsegments_array[3]) && $rsegments_array[3] == 'upload_file') + { + #region Just rename my file + $new_file_name = ''; + //$old_file_name = $this->_to_greeklish($_GET['qqfile']); + $old_file_name = $this->_convert_foreign_characters($_GET['qqfile']); + $max = strlen($old_file_name); + for($i=0; $i< $max;$i++) + { + $numMatches = preg_match('/^[A-Za-z0-9.-_]+$/', $old_file_name[$i], $matches); + if($numMatches >0) + { + $new_file_name .= strtolower($old_file_name[$i]); + } + else + { + $new_file_name .= '-'; + } + } + $file_name = substr( substr( uniqid(), 9,13).'-'.$new_file_name , 0, 100) ; + #endregion + + $results = array( 'name' => 'upload_file', 'file_name' => $file_name); + if(isset($rsegments_array[4]) && is_numeric($rsegments_array[4])) + { + $results['relation_value'] = $rsegments_array[4]; + } + return (object)$results; + } + elseif(isset($rsegments_array[3]) && isset($rsegments_array[4]) && $rsegments_array[3] == 'delete_file' && is_numeric($rsegments_array[4])) + { + $state = array( 'name' => 'delete_file', 'id' => $rsegments_array[4]); + return (object)$state; + } + elseif(isset($rsegments_array[3]) && $rsegments_array[3] == 'ordering') + { + $state = array( 'name' => 'ordering'); + return (object)$state; + } + elseif(isset($rsegments_array[3]) && $rsegments_array[3] == 'insert_title') + { + $state = array( 'name' => 'insert_title'); + return (object)$state; + } + } + + function render() + { + $ci = &get_instance(); + $this->_load_language(); + $ci->load->helper('url'); + $ci->load->library('Image_moo'); + $this->image_moo = new Image_moo(); + + $state_info = $this->getState(); + + if(!empty($state_info)) + { + switch ($state_info->name) { + case 'list': + $photos = isset($state_info->relation_value) ? $this->_get_photos($state_info->relation_value) : $this->_get_photos(); + $this->_library_view('list.php',array( + 'upload_url' => $state_info->upload_url, + 'insert_title_url' => $state_info->insert_title_url, + 'photos' => $photos, + 'ajax_list_url' => $state_info->ajax_list_url, + 'ordering_url' => $state_info->ordering_url, + 'primary_key' => $this->primary_key, + 'title_field' => $this->title_field, + 'unset_delete' => $this->unset_delete, + 'unset_upload' => $this->unset_upload, + 'has_priority_field' => $this->priority_field !== null ? true : false + )); + + if($state_info->ajax === true) + { + @ob_end_clean(); + echo $this->get_layout()->output; + die(); + } + return $this->get_layout(); + break; + + case 'upload_file': + if($this->unset_upload) + { + throw new Exception('This user is not allowed to do this operation', 1); + die(); + } + + $file_name = $this->_upload_file( $this->image_path); + + if ($file_name !== false) { + $this->_create_thumbnail( $this->image_path.'/'.$file_name , $this->image_path.'/'.$this->thumbnail_prefix.$file_name ); + $this->_insert_table($file_name, $state_info->relation_value); + + $result = true; + } else { + $result = false; + } + + @ob_end_clean(); + echo json_encode((object)array('success' => $result)); + + die(); + break; + + case 'delete_file': + @ob_end_clean(); + if($this->unset_delete) + { + throw new Exception('This user is not allowed to do this operation', 1); + die(); + } + $id = $state_info->id; + + $this->_delete_file($id); + + redirect($_SERVER['HTTP_REFERER']); + break; + + case 'ordering': + @ob_end_clean(); + $this->_changing_priority($_POST['photos']); + die(); + break; + + case 'insert_title': + @ob_end_clean(); + $this->_insert_title($_POST['primary_key'],$_POST['value']); + die(); + break; + } + } + + } + +} + + + +/* + * jQuery File Upload Plugin PHP Example 5.5 +* https://github.com/blueimp/jQuery-File-Upload +* +* Copyright 2010, Sebastian Tschan +* https://blueimp.net +* +* Licensed under the MIT license: +* http://www.opensource.org/licenses/MIT +*/ + +class ImageUploadHandler +{ + private $options; + + function __construct($options=null) { + $this->options = array( + 'script_url' => $this->getFullUrl().'/'.basename(__FILE__), + 'upload_dir' => dirname(__FILE__).'/files/', + 'upload_url' => $this->getFullUrl().'/files/', + 'param_name' => 'files', + // The php.ini settings upload_max_filesize and post_max_size + // take precedence over the following max_file_size setting: + 'max_file_size' => null, + 'min_file_size' => 1, + 'accept_file_types' => '/.+$/i', + 'max_number_of_files' => null, + // Set the following option to false to enable non-multipart uploads: + 'discard_aborted_uploads' => true, + // Set to true to rotate images based on EXIF meta data, if available: + 'orient_image' => false, + 'image_versions' => array( + // Uncomment the following version to restrict the size of + // uploaded images. You can also add additional versions with + // their own upload directories: + /* + 'large' => array( + 'upload_dir' => dirname(__FILE__).'/files/', + 'upload_url' => dirname($_SERVER['PHP_SELF']).'/files/', + 'max_width' => 1920, + 'max_height' => 1200 + ), + + 'thumbnail' => array( + 'upload_dir' => dirname(__FILE__).'/thumbnails/', + 'upload_url' => $this->getFullUrl().'/thumbnails/', + 'max_width' => 80, + 'max_height' => 80 + ) + */ + ) + ); + if ($options) { + // Or else for PHP >= 5.3.0 use: $this->options = array_replace_recursive($this->options, $options); + foreach($options as $option_name => $option) + { + $this->options[$option_name] = $option; + } + } + } + + function getFullUrl() { + return + (isset($_SERVER['HTTPS']) ? 'https://' : 'http://'). + (isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : ''). + (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME']. + (isset($_SERVER['HTTPS']) && $_SERVER['SERVER_PORT'] === 443 || + $_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))). + substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/')); + } + + private function get_file_object($file_name) { + $file_path = $this->options['upload_dir'].$file_name; + if (is_file($file_path) && $file_name[0] !== '.') { + $file = new stdClass(); + $file->name = $file_name; + $file->size = filesize($file_path); + $file->url = $this->options['upload_url'].rawurlencode($file->name); + foreach($this->options['image_versions'] as $version => $options) { + if (is_file($options['upload_dir'].$file_name)) { + $file->{$version.'_url'} = $options['upload_url'] + .rawurlencode($file->name); + } + } + $file->delete_url = $this->options['script_url'] + .'?file='.rawurlencode($file->name); + $file->delete_type = 'DELETE'; + return $file; + } + return null; + } + + private function get_file_objects() { + return array_values(array_filter(array_map( + array($this, 'get_file_object'), + scandir($this->options['upload_dir']) + ))); + } + + private function create_scaled_image($file_name, $options) { + $file_path = $this->options['upload_dir'].$file_name; + $new_file_path = $options['upload_dir'].$file_name; + list($img_width, $img_height) = @getimagesize($file_path); + if (!$img_width || !$img_height) { + return false; + } + $scale = min( + $options['max_width'] / $img_width, + $options['max_height'] / $img_height + ); + if ($scale > 1) { + $scale = 1; + } + $new_width = $img_width * $scale; + $new_height = $img_height * $scale; + $new_img = @imagecreatetruecolor($new_width, $new_height); + switch (strtolower(substr(strrchr($file_name, '.'), 1))) { + case 'jpg': + case 'jpeg': + $src_img = @imagecreatefromjpeg($file_path); + $write_image = 'imagejpeg'; + break; + case 'gif': + @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0)); + $src_img = @imagecreatefromgif($file_path); + $write_image = 'imagegif'; + break; + case 'png': + @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0)); + @imagealphablending($new_img, false); + @imagesavealpha($new_img, true); + $src_img = @imagecreatefrompng($file_path); + $write_image = 'imagepng'; + break; + default: + $src_img = $image_method = null; + } + $success = $src_img && @imagecopyresampled( + $new_img, + $src_img, + 0, 0, 0, 0, + $new_width, + $new_height, + $img_width, + $img_height + ) && $write_image($new_img, $new_file_path); + // Free up memory (imagedestroy does not delete files): + @imagedestroy($src_img); + @imagedestroy($new_img); + return $success; + } + + private function has_error($uploaded_file, $file, $error) { + if ($error) { + return $error; + } + if (!preg_match($this->options['accept_file_types'], $file->name)) { + return 'acceptFileTypes'; + } + if ($uploaded_file && is_uploaded_file($uploaded_file)) { + $file_size = filesize($uploaded_file); + } else { + $file_size = $_SERVER['CONTENT_LENGTH']; + } + + if ($this->options['max_file_size'] && ( + $file_size > $this->options['max_file_size'] || + $file->size > $this->options['max_file_size']) + ) { + return 'maxFileSize'; + } + if ($this->options['min_file_size'] && + $file_size < $this->options['min_file_size']) { + return 'minFileSize'; + } + if (is_int($this->options['max_number_of_files']) && ( + count($this->get_file_objects()) >= $this->options['max_number_of_files']) + ) { + return 'maxNumberOfFiles'; + } + return $error; + } + + private function trim_file_name($name, $type) { + // Remove path information and dots around the filename, to prevent uploading + // into different directories or replacing hidden system files. + // Also remove control characters and spaces (\x00..\x20) around the filename: + $file_name = trim(basename(stripslashes($name)), ".\x00..\x20"); + // Add missing file extension for known image types: + if (strpos($file_name, '.') === false && + preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) { + $file_name .= '.'.$matches[1]; + } + + //Ensure that we don't have disallowed characters and add a unique id just to ensure that the file name will be unique + $file_name = substr(uniqid(),-5).'-'.preg_replace("/([^a-zA-Z0-9\.\-\_]+?){1}/i", '-', $file_name); + + return $file_name; + } + + private function orient_image($file_path) { + $exif = exif_read_data($file_path); + $orientation = intval(@$exif['Orientation']); + if (!in_array($orientation, array(3, 6, 8))) { + return false; + } + $image = @imagecreatefromjpeg($file_path); + switch ($orientation) { + case 3: + $image = @imagerotate($image, 180, 0); + break; + case 6: + $image = @imagerotate($image, 270, 0); + break; + case 8: + $image = @imagerotate($image, 90, 0); + break; + default: + return false; + } + $success = imagejpeg($image, $file_path); + // Free up memory (imagedestroy does not delete files): + @imagedestroy($image); + return $success; + } + + private function handle_file_upload($uploaded_file, $name, $size, $type, $error) { + $file = new stdClass(); + $file->name = $this->trim_file_name($name, $type); + $file->size = intval($size); + $file->type = $type; + $error = $this->has_error($uploaded_file, $file, $error); + if (!$error && $file->name) { + $file_path = $this->options['upload_dir'].$file->name; + $append_file = !$this->options['discard_aborted_uploads'] && + is_file($file_path) && $file->size > filesize($file_path); + clearstatcache(); + if ($uploaded_file && is_uploaded_file($uploaded_file)) { + // multipart/formdata uploads (POST method uploads) + if ($append_file) { + file_put_contents( + $file_path, + fopen($uploaded_file, 'r'), + FILE_APPEND + ); + } else { + move_uploaded_file($uploaded_file, $file_path); + } + } else { + // Non-multipart uploads (PUT method support) + file_put_contents( + $file_path, + fopen('php://input', 'r'), + $append_file ? FILE_APPEND : 0 + ); + } + $file_size = filesize($file_path); + if ($file_size === $file->size) { + if ($this->options['orient_image']) { + $this->orient_image($file_path); + } + $file->url = $this->options['upload_url'].rawurlencode($file->name); + foreach($this->options['image_versions'] as $version => $options) { + if ($this->create_scaled_image($file->name, $options)) { + $file->{$version.'_url'} = $options['upload_url'] + .rawurlencode($file->name); + } + } + } else if ($this->options['discard_aborted_uploads']) { + unlink($file_path); + $file->error = 'abort'; + } + $file->size = $file_size; + $file->delete_url = $this->options['script_url'] + .'?file='.rawurlencode($file->name); + $file->delete_type = 'DELETE'; + } else { + $file->error = $error; + } + return $file; + } + + public function get() { + $file_name = isset($_REQUEST['file']) ? + basename(stripslashes($_REQUEST['file'])) : null; + if ($file_name) { + $info = $this->get_file_object($file_name); + } else { + $info = $this->get_file_objects(); + } + header('Content-type: application/json'); + echo json_encode($info); + } + + public function post() { + if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { + return $this->delete(); + } + $upload = isset($_FILES[$this->options['param_name']]) ? + $_FILES[$this->options['param_name']] : null; + $info = array(); + if ($upload && is_array($upload['tmp_name'])) { + foreach ($upload['tmp_name'] as $index => $value) { + $info[] = $this->handle_file_upload( + $upload['tmp_name'][$index], + isset($_SERVER['HTTP_X_FILE_NAME']) ? + $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index], + isset($_SERVER['HTTP_X_FILE_SIZE']) ? + $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index], + isset($_SERVER['HTTP_X_FILE_TYPE']) ? + $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index], + $upload['error'][$index] + ); + } + } elseif ($upload || isset($_SERVER['HTTP_X_FILE_NAME'])) { + $info[] = $this->handle_file_upload( + isset($upload['tmp_name']) ? $upload['tmp_name'] : null, + isset($_SERVER['HTTP_X_FILE_NAME']) ? + $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'], + isset($_SERVER['HTTP_X_FILE_SIZE']) ? + $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'], + isset($_SERVER['HTTP_X_FILE_TYPE']) ? + $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'], + isset($upload['error']) ? $upload['error'] : null + ); + } + header('Vary: Accept'); + + $redirect = isset($_REQUEST['redirect']) ? + stripslashes($_REQUEST['redirect']) : null; + if ($redirect) { + header('Location: '.sprintf($redirect, rawurlencode($json))); + return; + } + if (isset($_SERVER['HTTP_ACCEPT']) && + (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) { + header('Content-type: application/json'); + } else { + header('Content-type: text/plain'); + } + return $info; + } + + public function delete() { + $file_name = isset($_REQUEST['file']) ? + basename(stripslashes($_REQUEST['file'])) : null; + $file_path = $this->options['upload_dir'].$file_name; + $success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path); + if ($success) { + foreach($this->options['image_versions'] as $version => $options) { + $file = $options['upload_dir'].$file_name; + if (is_file($file)) { + unlink($file); + } + } + } + header('Content-type: application/json'); + echo json_encode($success); + } + +} diff --git a/application/libraries/image_moo.php b/application/libraries/image_moo.php index e8000c1..808ba9e 100755 --- a/application/libraries/image_moo.php +++ b/application/libraries/image_moo.php @@ -1,1153 +1,1153 @@ -image_moo->load("file")->resize(64,40)->save("thumb")->resize(640,480)->save("medium"); - * if ($this->image_moo->errors) print $this->image_moo->display_errors(); - * - * COLOURS! - * Any function that can take a colour as a parameter can take "#RGB", "#RRGGBB" or an array(R,G,B) - * - * image manipulation functions - * ----------------------------------------------------------------------------- - * load($x) - Loads an image file specified by $x - JPG, PNG, GIF supported - * save($x) - Saved the manipulated image (if applicable) to file $x - JPG, PNG, GIF supported - * save_pa($prepend="", $append="", $overwrite=FALSE) - Saves using the original image name but with prepend and append text, e.g. load('moo.jpg')->save_pa('pre_','_app') would save as filename pre_moo_app.jpg - * save_dynamic($filename="") - Saves as a stream output, use filename to return png/jpg/gif etc., default is jpeg - * resize($x,$y,$pad=FALSE) - Proportioanlly resize original image using the bounds $x and $y, if padding is set return image is as defined centralised using BG colour - * resize_crop($x,$y) - Proportioanlly resize original image using the bounds $x and $y but cropped to fill dimensions - * stretch($x,$y) - Take the original image and stretch it to fill new dimensions $x $y - * crop($x1,$y1,$x2,$y2) - Crop the original image using Top left, $x1,$y1 to bottom right $x2,y2. New image size =$x2-x1 x $y2-y1 - * rotate($angle) - Rotates the work image by X degrees, normally 90,180,270 can be any angle.Excess filled with background colour - * load_watermark($filename, $transparent_x=0, $transparent_y=0) - Loads the specified file as the watermark file, if using PNG32/24 use x,y to specify direct positions of colour to use as index - * make_watermark_text($text, $fontfile, $size=16, $colour="#ffffff", $angle=0) - Creates a text watermark - * watermark($position, $offset=8, $abs=FALSE) - Use the loaded watermark, or created text to place a watermark. $position works like NUM PAD key layout, e.g. 7=Top left, 3=Bottom right $offset is the padding/indentation, if $abs is true then use $positiona and $offset as direct values to watermark placement - * border($width,$colour="#000") - Draw a border around the output image X pixels wide in colour specified - * border_3d($width,$rot=0,$opacity=30) - Draw a 3d border (opaque) around the current image $width wise in 0-3 rot positions, $opacity allows you to change how much it effects the picture - * filter($function, $arg1=NULL, $arg2=NULL, $arg3=NULL, $arg4=NULL) -Runs the standard imagefilter GD2 command, see http://www.php.net/manual/en/function.imagefilter.php for details - * round($radius,$invert=FALSE,$corners(array[top left, top right, bottom right, bottom left of true or False)="") default is all on and normal rounding - * shadow($size=4, $direction=3, $colour="#444") - Size in pixels, note that the image will increase by this size, so resize(400,400)->shadoe(4) will give an image 404 pixels in size, Direction works on teh keypad basis like the watermark, so 3 is bottom right, $color if the colour of the shadow. - * ----------------------------------------------------------------------------- - * image helper functions - * display_errors($open = '

', $close = '

') - Display errors as Ci standard style - * set_jpeg_quality($x) - quality to wrte jpeg files in for save, default 75 (1-100) - * set_watermark_transparency($x) - the opacity of the watermark 1-100, 1-just about see, 100=solid - * check_gd() - Run to see if you server can use this library - * clear_temp() - Call to clear the temp changes using the master image again - * clear() - Clears all images in memory - * ----------------------------------------------------------------------------- - * - * KNOWN BUGS - * make_watermark_text does not deal with rotation angle correctly, box is cropped - * - * TO DO - * - * THANKS - * Matja for poiting out the save_pa bug (should of tested it!) - * Cahva for posting yet another bug in the save_pa (Man I can be silly sometimes!) - * Cole spotting the resize flaw and providing a fix - * - */ - -class Image_moo -{ - // image vars - private $main_image=""; - private $watermark_image; - private $temp_image; - private $jpeg_quality=75; - private $background_colour="#ffffff"; - private $watermark_method; - - // other - private $filename=""; - - // watermark stuff, opacity - private $watermark_transparency=50; - - // reported errors - public $errors=FALSE; - private $error_msg = array(); - - // image info - public $width=0; - public $height=0; - - function Image_moo() - //---------------------------------------------------------------------------------------------------------- - // create stuff here as needed - //---------------------------------------------------------------------------------------------------------- - { - log_message('debug', "Image Moo Class Initialized"); - } - - private function _clear_errors() - //---------------------------------------------------------------------------------------------------------- - // load a resource - //---------------------------------------------------------------------------------------------------------- - { - $this->error_msg = array(); - } - - private function set_error($msg) - //---------------------------------------------------------------------------------------------------------- - // Set an error message - //---------------------------------------------------------------------------------------------------------- - { - $this->errors = TRUE; - $this->error_msg[] = $msg; - } - - public function display_errors($open = '

', $close = '

') - //---------------------------------------------------------------------------------------------------------- - // returns the errors formatted as needed, same as CI doed - //---------------------------------------------------------------------------------------------------------- - { - $str = ''; - foreach ($this->error_msg as $val) - { - $str .= $open.$val.$close; - } - return $str; - } - - public function check_gd() - //---------------------------------------------------------------------------------------------------------- - // verification util to see if you can use image_moo - //---------------------------------------------------------------------------------------------------------- - { - if ( ! extension_loaded('gd')) - { - if ( ! dl('gd.so')) - { - $this->set_error('GD library does not appear to be loaded'); - return FALSE; - } - } - if (function_exists('gd_info')) - { - $gdarray = @gd_info(); - $versiontxt = ereg_replace('[[:alpha:][:space:]()]+', '', $gdarray['GD Version']); - $versionparts=explode('.',$versiontxt); - if ($versionparts[0]=="2") - { - return TRUE; - } - else - { - $this->set_error('Requires GD2, this reported as '.$versiontxt); - return FALSE; - } - } - else - { - $this->set_error('Could not verify GD version'); - return FALSE; - } - } - - private function _check_image() - //---------------------------------------------------------------------------------------------------------- - // checks that we have an image loaded - //---------------------------------------------------------------------------------------------------------- - { - if (!is_resource($this->main_image)) - { - $this->set_error("No main image loaded!"); - return FALSE; - } - else - { - return TRUE; - } - } - - function save_dynamic($filename="") - //---------------------------------------------------------------------------------------------------------- - // Saves the temp image as a dynamic image - // e.g. direct output to the browser - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // if no operations, copy it for temp save - $this->_copy_to_temp_if_needed(); - - // ok, lets go! - if ($filename=="") $filename=rand(1000,999999).".jpg"; // send as jpeg - $ext = strtoupper(pathinfo($filename, PATHINFO_EXTENSION)); - header("Content-disposition: filename=$filename;"); - header('Content-transfer-Encoding: binary'); - header('Last-modified: '.gmdate('D, d M Y H:i:s')); - switch ($ext) - { - case "GIF" : - header("Content-type: image/gif"); - imagegif($this->temp_image); - return $this; - break; - case "JPG" : - case "JPEG" : - header("Content-type: image/jpeg"); - imagejpeg($this->temp_image, NULL, $this->jpeg_quality); - return $this; - break; - case "PNG" : - header("Content-type: image/png"); - imagepng($this->temp_image); - return $this; - break; - } - $this->set_error('Unable to save, extension not GIF/JPEG/JPG/PNG'); - return $this; - } - - function save_pa($prepend="", $append="", $overwrite=FALSE) - //---------------------------------------------------------------------------------------------------------- - // Saves the temp image as the filename specified, - // overwrite = true of false - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // get current file parts - $parts=pathinfo($this->filename); - - // save - $this->save($parts["dirname"].'/'.$prepend.$parts['filename'].$append.'.'.$parts["extension"], $overwrite); - - return $this; - } - - function save($filename,$overwrite=FALSE) - //---------------------------------------------------------------------------------------------------------- - // Saves the temp image as the filename specified, - // overwrite = true of false - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // if no operations, copy it for temp save - $this->_copy_to_temp_if_needed(); - - // check if it already exists - if (!$overwrite) - { - // don't overwrite, so check for file - if (file_exists($filename)) - { - $this->set_error('File exists, overwrite is FALSE, could not save over file '.$filename); - return $this; - } - } - - // find out the type of file to save - $ext = strtoupper(pathinfo($filename, PATHINFO_EXTENSION)); - switch ($ext) - { - case "GIF" : - imagegif($this->temp_image, $filename); - return $this; - break; - case "JPG" : - case "JPEG" : - imagejpeg($this->temp_image, $filename, $this->jpeg_quality); - return $this; - break; - case "PNG" : - imagepng($this->temp_image, $filename); - return $this; - break; - } - - // invalid filetype?! - $this->set_error('Do no know what '.$ext.' filetype is in filename '.$filename); - return $this; - } - - private function _load_image($filename) - //---------------------------------------------------------------------------------------------------------- - // private function to load a resource - //---------------------------------------------------------------------------------------------------------- - { - // check the request file can be located - if (!file_exists($filename)) - { - $this->set_error('Could not locate file '.$filename); - return FALSE; - } - - // get image info about this file - $image_info=getimagesize($filename); - - // load file depending on mimetype - switch ($image_info["mime"]) - { - case "image/gif" : - return imagecreatefromgif($filename); - break; - case "image/jpeg" : - return imagecreatefromjpeg($filename); - break; - case "image/png" : - return imagecreatefrompng($filename); - break; - } - - // invalid filetype?! - $this->set_error('Unable to load '.$filename.' filetype '.$image_info["mime"].'not recognised'); - return FALSE; - } - - public function load($filename) - //---------------------------------------------------------------------------------------------------------- - // Load an image, public function - //---------------------------------------------------------------------------------------------------------- - { - // new image, reset error messages - $this->_clear_errors(); - - // remove temporary image stored - $this->clear_temp(); - - // save filename - $this->filename=$filename; - - // reset width and height - $this->width = 0; - $this->height = 0; - - // load it - $this->main_image = $this->_load_image($filename); - - // no error, then get the dminesions set - if ($this->main_image <> FALSE) - { - $this->width = imageSX($this->main_image); - $this->height = imageSY($this->main_image); - } - - // return the object - return $this; - } - - public function load_watermark($filename, $transparent_x=NULL, $transparent_y=NULL) - //---------------------------------------------------------------------------------------------------------- - // Load an image, public function - //---------------------------------------------------------------------------------------------------------- - { - if(is_resource($this->watermark_image)) imagedestroy($this->watermark_image); - $this->watermark_image = $this->_load_image($filename); - - if(is_resource($this->watermark_image)) - { - $this->watermark_method = 1; - if(($transparent_x <> NULL) AND ($transparent_y <> NULL)) - { - // get the top left corner colour allocation - $tpcolour = imagecolorat($this->watermark_image, $transparent_x, $transparent_y); - - // set this as the transparent colour - imagecolortransparent($this->watermark_image, $tpcolour); - - // $set diff method - $this->watermark_method = 2; - } - } - - // return this object - return $this; - } - - public function set_watermark_transparency($transparency=50) - //---------------------------------------------------------------------------------------------------------- - // Sets the quality that jpeg will be saved at - //---------------------------------------------------------------------------------------------------------- - { - $this->watermark_transparency = $transparency; - return $this; - } - - public function set_background_colour($colour="#ffffff") - //---------------------------------------------------------------------------------------------------------- - // Sets teh background colour to use on rotation and padding for resize - //---------------------------------------------------------------------------------------------------------- - { - $this->background_colour = $this->_html2rgb($colour); - return $this; - } - - public function set_jpeg_quality($quality=75) - //---------------------------------------------------------------------------------------------------------- - // Sets the quality that jpeg will be saved at - //---------------------------------------------------------------------------------------------------------- - { - $this->jpeg_quality = $quality; - return $this; - } - - private function _copy_to_temp_if_needed() - //---------------------------------------------------------------------------------------------------------- - // If temp image is empty, e.g. not resized or done anything then just copy main image - //---------------------------------------------------------------------------------------------------------- - { - if (!is_resource($this->temp_image)) - { - // create a temp based on new dimensions - $this->temp_image = imagecreatetruecolor($this->width, $this->height); - - // check it - if(!is_resource($this->temp_image)) - { - $this->set_error('Unable to create temp image sized '.$this->width.' x '.$this->height); - return FALSE; - } - - // copy image to temp workspace - imagecopy($this->temp_image, $this->main_image, 0, 0, 0, 0, $this->width, $this->height); - } - } - - public function clear() - //---------------------------------------------------------------------------------------------------------- - // clear everything! - //---------------------------------------------------------------------------------------------------------- - { - if(is_resource($this->main_image)) imagedestroy($this->main_image); - if(is_resource($this->watermark_image)) imagedestroy($this->watermark_image); - if(is_resource($this->temp_image)) imagedestroy($this->temp_image); - return $this; - } - - public function clear_temp() - //---------------------------------------------------------------------------------------------------------- - // you may want to revert back to teh original image to work on, e.g. watermark, this clears temp - //---------------------------------------------------------------------------------------------------------- - { - if(is_resource($this->temp_image)) imagedestroy($this->temp_image); - return $this; - } - - public function resize_crop($mw,$mh) - //---------------------------------------------------------------------------------------------------------- - // take main image and resize to tempimage using EXACT boundaries mw,mh (max width and max height) - // this is proportional and crops the image centrally to fit - //---------------------------------------------------------------------------------------------------------- - { - if (!$this->_check_image()) return $this; - - // clear temp image - $this->clear_temp(); - - // create a temp based on new dimensions - $this->temp_image = imagecreatetruecolor($mw,$mh); - - // check it - if(!is_resource($this->temp_image)) - { - $this->set_error('Unable to create temp image sized '.$mw.' x '.$mh); - return $this; - } - - // work out best positions for copy - $wx=$this->width / $mw; - $wy=$this->height / $mh; - if ($wx >= $wy) - { - // use full height - $sy = 0; - $sy2 = $this->height; - - // calcs - $calc_width = $mw * $wy; - $sx = ($this->width - $calc_width) / 2; - $sx2 = $calc_width; - } - else - { - // use full width - $sx = 0; - $sx2 = $this->width; - - // calcs - $calc_height = $mh * $wx; - $sy = ($this->height - $calc_height) / 2; - $sy2 = $calc_height; - } - - // copy section - imagecopyresampled($this->temp_image, $this->main_image, 0, 0, $sx, $sy, $mw, $mh, $sx2, $sy2); - return $this; - } - - public function resize($mw, $mh, $pad=FALSE) - //---------------------------------------------------------------------------------------------------------- - // take main image and resize to tempimage using boundaries mw,mh (max width or max height) - // this is proportional, pad to true will set it in the middle of area size - //---------------------------------------------------------------------------------------------------------- - { - if (!$this->_check_image()) return $this; - - // calc new dimensions - if( $this->width > $mw || $this->height > $mh ) { -// if( $this->width > $this->height ) { could calc wronf - Cole Thorsen swapped to his suggestion - if( ($this->width / $this->height) > ($mw / $mh) ) { - $tnw = $mw; - $tnh = $tnw * $this->height / $this->width; - } else { - $tnh = $mh; - $tnw = $tnh * $this->width / $this->height; - } - } else { - $tnw = $this->width; - $tnh = $this->height; - } - // clear temp image - $this->clear_temp(); - - // create a temp based on new dimensions - if ($pad) - { - $tx = $mw; - $ty = $mh; - $px = ($mw - $tnw) / 2; - $py = ($mh - $tnh) / 2; - } - else - { - $tx = $tnw; - $ty = $tnh; - $px = 0; - $py = 0; - } - $this->temp_image = imagecreatetruecolor($tx,$ty); - - // check it - if(!is_resource($this->temp_image)) - { - $this->set_error('Unable to create temp image sized '.$tx.' x '.$ty); - return $this; - } - - // if padding, fill background - if ($pad) - { - $col = $this->_html2rgb($this->background_colour); - $bg = imagecolorallocate($this->temp_image, $col[0], $col[1], $col[2]); - imagefilledrectangle($this->temp_image, 0, 0, $tx, $ty, $bg); - } - - // copy resized - imagecopyresampled($this->temp_image, $this->main_image, $px, $py, 0, 0, $tnw, $tnh, $this->width, $this->height); - return $this; - } - - public function stretch($mw,$mh) - //---------------------------------------------------------------------------------------------------------- - // take main image and resize to tempimage using boundaries mw,mh (max width or max height) - // does not retain proportions - //---------------------------------------------------------------------------------------------------------- - { - if (!$this->_check_image()) return $this; - - // clear temp image - $this->clear_temp(); - - // create a temp based on new dimensions - $this->temp_image = imagecreatetruecolor($mw, $mh); - - // check it - if(!is_resource($this->temp_image)) - { - $this->set_error('Unable to create temp image sized '.$mh.' x '.$mw); - return $this; - } - - // copy resized (stethced, proportions not kept); - imagecopyresampled($this->temp_image, $this->main_image, 0, 0, 0, 0, $mw, $mh, $this->width, $this->height); - return $this; - } - - public function crop($x1, $y1, $x2, $y2) - //---------------------------------------------------------------------------------------------------------- - // crop the main image to temp image using coords - //---------------------------------------------------------------------------------------------------------- - { - if (!$this->_check_image()) return $this; - - // clear temp image - $this->clear_temp(); - - // check dimensions - if ($x1 < 0 || $y1 < 0 || $x2 - $x1 > $this->width || $y2 - $y1 > $this->height) - { - $this->set_error('Invalid crop dimensions, either - passed or width/heigh too large '.$x1.'/'.$y1.' x '.$x2.'/'.$y2); - return $this; - } - - // create a temp based on new dimensions - $this->temp_image = imagecreatetruecolor($x2-$x1, $y2-$y1); - - // check it - if(!is_resource($this->temp_image)) - { - $this->set_error('Unable to create temp image sized '.$x2-$x1.' x '.$y2-$y1); - return $this; - } - - // copy cropped portion - imagecopy($this->temp_image, $this->main_image, 0, 0, $x1, $y1, $x2 - $x1, $y2 - $y1); - return $this; - } - - private function _html2rgb($colour) - //---------------------------------------------------------------------------------------------------------- - // convert #aa0011 to a php colour array - //---------------------------------------------------------------------------------------------------------- - { - if (is_array($colour)) - { - if (count($colour)==3) return $colour; // rgb sent as an array so use it - $this->set_error('Colour error, array sent not 3 elements, expected array(r,g,b)'); - return false; - } - if ($colour[0] == '#') - $colour = substr($colour, 1); - - if (strlen($colour) == 6) - { - list($r, $g, $b) = array($colour[0].$colour[1], - $colour[2].$colour[3], - $colour[4].$colour[5]); - } - elseif (strlen($colour) == 3) - { - list($r, $g, $b) = array($colour[0].$colour[0], $colour[1].$colour[1], $colour[2].$colour[2]); - } - else - { - $this->set_error('Colour error, value sent not #RRGGBB or RRGGBB, and not array(r,g,b)'); - return false; - } - - $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); - - return array($r, $g, $b); - } - - public function rotate($angle) - //---------------------------------------------------------------------------------------------------------- - // rotate an image bu 0 / 90 / 180 / 270 degrees - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // if no operations, copy it for temp save - $this->_copy_to_temp_if_needed(); - - // set the colour - $col = $this->_html2rgb($$this->background_colour); - $bg = imagecolorallocate($this->temp_image, $col[0], $col[1], $col[2]); - - // rotate as needed - $this->temp_image = imagerotate($this->temp_image, $angle, $bg); - return $this; - } - - public function make_watermark_text($text, $fontfile, $size=16, $colour="#ffffff", $angle=0) - //---------------------------------------------------------------------------------------------------------- - // create an image from text that can be applied as a watermark - // text is the text to write, $fontile is a ttf file that will be used $size=font size, $colour is the colour of text - //---------------------------------------------------------------------------------------------------------- - { - // check font file can be found - if (!file_exists($fontfile)) - { - $this->set_error('Could not locate font file "'.$fontfile.'"'); - return $this; - } - - // validate we loaded a main image - if (!$this->_check_image()) - { - $remove = TRUE; - // no image loaded so make temp image to use - $this->main_image = imagecreatetruecolor(1000,1000); - } - else - { - $remove = FALSE; - } - - // work out text dimensions - $bbox = imageftbbox($size, $angle, $fontfile, $text); - $bw = abs($bbox[4] - $bbox[0]) + 1; - $bh = abs($bbox[1] - $bbox[5]) + 1; - $bl = $bbox[1]; - - // use this to create watermark image - if(is_resource($this->watermark_image)) imagedestroy($this->watermark_image); - $this->watermark_image = imagecreatetruecolor($bw, $bh); - - // set colours - $col = $this->_html2rgb($colour); - $font_col = imagecolorallocate($this->watermark_image, $col[0], $col[1], $col[2]); - $bg_col = imagecolorallocate($this->watermark_image, 127, 128, 126); - - // set method to use - $this->watermark_method = 2; - - // create bg - imagecolortransparent($this->watermark_image, $bg_col); - imagefilledrectangle($this->watermark_image, 0,0, $bw, $bh, $bg_col); - - // write text to watermark - imagefttext($this->watermark_image, $size, $angle, 0, $bh-$bl, $font_col, $fontfile, $text); - - if ($remove) imagedestroy($this->main_image); - return $this; - } - - public function watermark($position, $offset=8, $abs=FALSE) - //---------------------------------------------------------------------------------------------------------- - // add a watermark to the image - // position works like a keypad e.g. - // 7 8 9 - // 4 5 6 - // 1 2 3 - // offset moves image inwards by x pixels - // if abs is set then $position, $offset = direct placement coords - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // validate we have a watermark - if(!is_resource($this->watermark_image)) - { - $this->set_error("Can't watermark image, no watermark loaded/created"); - return $this; - } - - // if no operations, copy it for temp save - $this->_copy_to_temp_if_needed(); - - // get watermark width - $wm_w = imageSX($this->watermark_image); - $wm_h = imageSY($this->watermark_image); - - // get temp widths - $temp_w = imageSX($this->temp_image); - $temp_h = imageSY($this->temp_image); - - // check watermark will fit! - if ($wm_w > $temp_w || $wm_h > $temp_h) - { - $this->set_error("Watermark is larger than image. WM: $wm_w x $wm_h Temp image: $temp_w x $temp_h"); - return $this; - } - - if ($abs) - { - // direct placement - $dest_x = $position; - $dest_y = $offset; - } - else - { - // do X position - switch ($position) - { - // x left - case "7": - case "4": - case "1": - $dest_x = $offset; - break; - // x middle - case "8": - case "5": - case "2": - $dest_x = ($temp_w - $wm_w) /2 ; - break; - // x right - case "9": - case "6": - case "3": - $dest_x = $temp_w - $offset - $wm_w; - break; - default: - $dest_x = $offset; - $this->set_error("Watermark position $position not in vlaid range 7,8,9 - 4,5,6 - 1,2,3"); - } - // do y position - switch ($position) - { - // y top - case "7": - case "8": - case "9": - $dest_y = $offset; - break; - // y middle - case "4": - case "5": - case "6": - $dest_y = ($temp_h - $wm_h) /2 ; - break; - // y bottom - case "1": - case "2": - case "3": - $dest_y = $temp_h - $offset - $wm_h; - break; - default: - $dest_y = $offset; - $this->set_error("Watermark position $position not in vlaid range 7,8,9 - 4,5,6 - 1,2,3"); - } - - } - - // copy over temp image to desired location - if ($this->watermark_method == 1) - { - // use back methods to do this, taken from php help files - //$this->imagecopymerge_alpha($this->temp_image, $this->watermark_image, $dest_x, $dest_y, 0, 0, $wm_w, $wm_h, $this->watermark_transparency); - - $opacity=$this->watermark_transparency; - - // creating a cut resource - $cut = imagecreatetruecolor($wm_w, $wm_h); - - // copying that section of the background to the cut - imagecopy($cut, $this->temp_image, 0, 0, $dest_x, $dest_y, $wm_w, $wm_h); - - // inverting the opacity - $opacity = 100 - $opacity; - - // placing the watermark now - imagecopy($cut, $this->watermark_image, 0, 0, 0, 0, $wm_w, $wm_h); - imagecopymerge($this->temp_image, $cut, $dest_x, $dest_y, 0, 0, $wm_w, $wm_h, $opacity); - - } - else - { - // use normal with selected transparency colour - imagecopymerge($this->temp_image, $this->watermark_image, $dest_x, $dest_y, 0, 0, $wm_w, $wm_h, $this->watermark_transparency); - } - - return $this; - } - - public function border($width=5,$colour="#000") - //---------------------------------------------------------------------------------------------------------- - // add a solidborder frame, coloured $colour to the image - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // if no operations, copy it for temp save - $this->_copy_to_temp_if_needed(); - - // get colour set for temp image - $col = $this->_html2rgb($colour); - $border_col = imagecolorallocate($this->temp_image, $col[0], $col[1], $col[2]); - - // get temp widths - $temp_w = imageSX($this->temp_image); - $temp_h = imageSY($this->temp_image); - - // do border - for($x=0;$x<$width;$x++) - { - imagerectangle($this->temp_image, $x, $x, $temp_w-$x-1, $temp_h-$x-1, $border_col); - } - - // return object - return $this; - } - - public function border_3d($width=5,$rot=0,$opacity=30) - //---------------------------------------------------------------------------------------------------------- - // overlay a black white border to make it look 3d - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // if no operations, copy it for temp save - $this->_copy_to_temp_if_needed(); - - // get temp widths - $temp_w = imageSX($this->temp_image); - $temp_h = imageSY($this->temp_image); - - // create temp canvas to merge - $border_image = imagecreatetruecolor($temp_w, $temp_h); - - // create colours - $black = imagecolorallocate($border_image, 0, 0, 0); - $white = imagecolorallocate($border_image, 255, 255, 255); - switch ($rot) - { - case 1 : - $cols=array($white,$black,$white,$black); - break; - case 2 : - $cols=array($black,$black,$white,$white); - break; - case 3 : - $cols=array($black,$white,$black,$white); - break; - default : - $cols=array($white,$white,$black,$black); - } - $bg_col = imagecolorallocate($border_image, 127, 128, 126); - - // create bg - imagecolortransparent($border_image, $bg_col); - imagefilledrectangle($border_image, 0,0, $temp_w, $temp_h, $bg_col); - - // do border - for($x=0;$x<$width;$x++) - { - // top - imageline($border_image, $x, $x, $temp_w-$x-1, $x, $cols[0]); - // left - imageline($border_image, $x, $x, $x, $temp_w-$x-1, $cols[1]); - // bottom - imageline($border_image, $x, $temp_h-$x-1, $temp_w-1-$x, $temp_h-$x-1, $cols[3]); - // right - imageline($border_image, $temp_w-$x-1, $x, $temp_w-$x-1, $temp_h-$x-1, $cols[2]); - } - - // merg with temp image - imagecopymerge($this->temp_image, $border_image, 0, 0, 0, 0, $temp_w, $temp_h, $opacity); - - // clean up - imagedestroy($border_image); - - // return object - return $this; - } - - public function shadow($size=4, $direction=3, $colour="#444") - //---------------------------------------------------------------------------------------------------------- - // add a shadow to an image, this will INCREASE the size of the image - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // if no operations, copy it for temp save - $this->_copy_to_temp_if_needed(); - - // get the current size - $sx = imagesx($this->temp_image); - $sy = imagesy($this->temp_image); - - // new image - $bu_image = imagecreatetruecolor($sx, $sy); - - // check it - if(!is_resource($bu_image)) - { - $this->set_error('Unable to create shadow temp image sized '.$this->width.' x '.$this->height); - return FALSE; - } - - // copy the current image to memory - imagecopy($bu_image, $this->temp_image, 0, 0, 0, 0, $sx, $sy); - - imagedestroy($this->temp_image); - $this->temp_image = imagecreatetruecolor($sx+$size, $sy+$size); - - // fill background colour - $col = $this->_html2rgb($this->background_colour); - $bg = imagecolorallocate($this->temp_image, $col[0], $col[1], $col[2]); - imagefilledrectangle($this->temp_image, 0, 0, $sx+$size, $sy+$size, $bg); - - // work out position - // do X position - switch ($direction) - { - // x left - case "7": - case "4": - case "1": - $sh_x = 0; - $pic_x = $size; - break; - // x middle - case "8": - case "5": - case "2": - $sh_x = $size / 2; - $pic_x = $size / 2; - break; - // x right - case "9": - case "6": - case "3": - $sh_x = $size; - $pic_x = 0; - break; - default: - $sh_x = $size; - $pic_x = 0; - $this->set_error("Shadow position $position not in vlaid range 7,8,9 - 4,5,6 - 1,2,3"); - } - // do y position - switch ($direction) - { - // y top - case "7": - case "8": - case "9": - $sh_y = 0; - $pic_y = $size; - break; - // y middle - case "4": - case "5": - case "6": - $sh_y = $size / 2; - $pic_y = $size / 2; - break; - // y bottom - case "1": - case "2": - case "3": - $sh_y = $size; - $pic_y = 0; - break; - default: - $sh_y = $size; - $pic_y = 0; - $this->set_error("Shadow position $position not in vlaid range 7,8,9 - 4,5,6 - 1,2,3"); - } - - // create the shadow - $shadowcolour = $this->_html2rgb($colour); - $shadow = imagecolorallocate($this->temp_image, $shadowcolour[0], $shadowcolour[1], $shadowcolour[2]); - imagefilledrectangle($this->temp_image, $sh_x, $sh_y, $sh_x+$sx-1, $sh_y+$sy-1, $shadow); - - // copy current image to correct location - imagecopy($this->temp_image, $bu_image, $pic_x, $pic_y, 0, 0, $sx, $sy); - - // clean up and desstroy temp image - imagedestroy($bu_image); - - //return object - return $this; - } - - public function filter($function, $arg1=NULL, $arg2=NULL, $arg3=NULL, $arg4=NULL) - //---------------------------------------------------------------------------------------------------------- - // allows you to use the inbulit gd2 image filters - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // if no operations, copy it for temp save - $this->_copy_to_temp_if_needed(); - - if (!imagefilter($this->temp_image, $function, $arg1, $arg2, $arg3, $arg4)) - { - $this->set_error("Filter $function failed"); - } - - // return object - return $this; - } - - public function round($radius=5,$invert=False,$corners="") - //---------------------------------------------------------------------------------------------------------- - // adds rounded corners to the output - // using a quarter and rotating as you can end up with odd roudning if you draw a whole and use parts - //---------------------------------------------------------------------------------------------------------- - { - // validate we loaded a main image - if (!$this->_check_image()) return $this; - - // if no operations, copy it for temp save - $this->_copy_to_temp_if_needed(); - - // check input - if ($corners=="") $corners=array(True,True,True,True); - if (!is_array($corners) || count($corners)<>4) - { - $this->set_error("Round failed, expected an array of 4 items round(radius,tl,tr,br,bl)"); - return $this; - } - - // create corner - $corner = imagecreatetruecolor($radius, $radius); - - // turn on aa make it nicer - imageantialias($corner, true); - $col = $this->_html2rgb($this->background_colour); - - // use bg col for corners - $bg = imagecolorallocate($corner, $col[0], $col[1], $col[2]); - - // create our transparent colour - $xparent = imagecolorallocate($corner, 127, 128, 126); - imagecolortransparent($corner, $xparent); - if ($invert) - { - // fill and clear bits - imagefilledrectangle($corner, 0, 0, $radius, $radius, $xparent); - imagefilledellipse($corner, 0, 0, ($radius * 2)-1, ($radius * 2)-1, $bg); - } - else - { - // fill and clear bits - imagefilledrectangle($corner, 0, 0, $radius, $radius, $bg); - imagefilledellipse($corner, $radius, $radius, ($radius * 2) , ($radius * 2) , $xparent); - } - - // get temp widths - $temp_w = imageSX($this->temp_image); - $temp_h = imageSY($this->temp_image); - - // do corners - if ($corners[0]) imagecopymerge($this->temp_image, $corner, 0, 0, 0, 0, $radius, $radius, 100); - $corner = imagerotate($corner, 270, 0); - if ($corners[1]) imagecopymerge($this->temp_image, $corner, $temp_w-$radius, 0, 0, 0, $radius, $radius, 100); - $corner = imagerotate($corner, 270, 0); - if ($corners[2]) imagecopymerge($this->temp_image, $corner, $temp_w-$radius, $temp_h-$radius, 0, 0, $radius, $radius, 100); - $corner = imagerotate($corner, 270, 0); - if ($corners[3]) imagecopymerge($this->temp_image, $corner, 0, $temp_h-$radius, 0, 0, $radius, $radius, 100); - - // return object - return $this; - } - - -} -/* End of file image_moo.php */ +image_moo->load("file")->resize(64,40)->save("thumb")->resize(640,480)->save("medium"); + * if ($this->image_moo->errors) print $this->image_moo->display_errors(); + * + * COLOURS! + * Any function that can take a colour as a parameter can take "#RGB", "#RRGGBB" or an array(R,G,B) + * + * image manipulation functions + * ----------------------------------------------------------------------------- + * load($x) - Loads an image file specified by $x - JPG, PNG, GIF supported + * save($x) - Saved the manipulated image (if applicable) to file $x - JPG, PNG, GIF supported + * save_pa($prepend="", $append="", $overwrite=FALSE) - Saves using the original image name but with prepend and append text, e.g. load('moo.jpg')->save_pa('pre_','_app') would save as filename pre_moo_app.jpg + * save_dynamic($filename="") - Saves as a stream output, use filename to return png/jpg/gif etc., default is jpeg + * resize($x,$y,$pad=FALSE) - Proportioanlly resize original image using the bounds $x and $y, if padding is set return image is as defined centralised using BG colour + * resize_crop($x,$y) - Proportioanlly resize original image using the bounds $x and $y but cropped to fill dimensions + * stretch($x,$y) - Take the original image and stretch it to fill new dimensions $x $y + * crop($x1,$y1,$x2,$y2) - Crop the original image using Top left, $x1,$y1 to bottom right $x2,y2. New image size =$x2-x1 x $y2-y1 + * rotate($angle) - Rotates the work image by X degrees, normally 90,180,270 can be any angle.Excess filled with background colour + * load_watermark($filename, $transparent_x=0, $transparent_y=0) - Loads the specified file as the watermark file, if using PNG32/24 use x,y to specify direct positions of colour to use as index + * make_watermark_text($text, $fontfile, $size=16, $colour="#ffffff", $angle=0) - Creates a text watermark + * watermark($position, $offset=8, $abs=FALSE) - Use the loaded watermark, or created text to place a watermark. $position works like NUM PAD key layout, e.g. 7=Top left, 3=Bottom right $offset is the padding/indentation, if $abs is true then use $positiona and $offset as direct values to watermark placement + * border($width,$colour="#000") - Draw a border around the output image X pixels wide in colour specified + * border_3d($width,$rot=0,$opacity=30) - Draw a 3d border (opaque) around the current image $width wise in 0-3 rot positions, $opacity allows you to change how much it effects the picture + * filter($function, $arg1=NULL, $arg2=NULL, $arg3=NULL, $arg4=NULL) -Runs the standard imagefilter GD2 command, see http://www.php.net/manual/en/function.imagefilter.php for details + * round($radius,$invert=FALSE,$corners(array[top left, top right, bottom right, bottom left of true or False)="") default is all on and normal rounding + * shadow($size=4, $direction=3, $colour="#444") - Size in pixels, note that the image will increase by this size, so resize(400,400)->shadoe(4) will give an image 404 pixels in size, Direction works on teh keypad basis like the watermark, so 3 is bottom right, $color if the colour of the shadow. + * ----------------------------------------------------------------------------- + * image helper functions + * display_errors($open = '

', $close = '

') - Display errors as Ci standard style + * set_jpeg_quality($x) - quality to wrte jpeg files in for save, default 75 (1-100) + * set_watermark_transparency($x) - the opacity of the watermark 1-100, 1-just about see, 100=solid + * check_gd() - Run to see if you server can use this library + * clear_temp() - Call to clear the temp changes using the master image again + * clear() - Clears all images in memory + * ----------------------------------------------------------------------------- + * + * KNOWN BUGS + * make_watermark_text does not deal with rotation angle correctly, box is cropped + * + * TO DO + * + * THANKS + * Matja for poiting out the save_pa bug (should of tested it!) + * Cahva for posting yet another bug in the save_pa (Man I can be silly sometimes!) + * Cole spotting the resize flaw and providing a fix + * + */ + +class Image_moo +{ + // image vars + private $main_image=""; + private $watermark_image; + private $temp_image; + private $jpeg_quality=75; + private $background_colour="#ffffff"; + private $watermark_method; + + // other + private $filename=""; + + // watermark stuff, opacity + private $watermark_transparency=50; + + // reported errors + public $errors=FALSE; + private $error_msg = array(); + + // image info + public $width=0; + public $height=0; + + function Image_moo() + //---------------------------------------------------------------------------------------------------------- + // create stuff here as needed + //---------------------------------------------------------------------------------------------------------- + { + log_message('debug', "Image Moo Class Initialized"); + } + + private function _clear_errors() + //---------------------------------------------------------------------------------------------------------- + // load a resource + //---------------------------------------------------------------------------------------------------------- + { + $this->error_msg = array(); + } + + private function set_error($msg) + //---------------------------------------------------------------------------------------------------------- + // Set an error message + //---------------------------------------------------------------------------------------------------------- + { + $this->errors = TRUE; + $this->error_msg[] = $msg; + } + + public function display_errors($open = '

', $close = '

') + //---------------------------------------------------------------------------------------------------------- + // returns the errors formatted as needed, same as CI doed + //---------------------------------------------------------------------------------------------------------- + { + $str = ''; + foreach ($this->error_msg as $val) + { + $str .= $open.$val.$close; + } + return $str; + } + + public function check_gd() + //---------------------------------------------------------------------------------------------------------- + // verification util to see if you can use image_moo + //---------------------------------------------------------------------------------------------------------- + { + if ( ! extension_loaded('gd')) + { + if ( ! dl('gd.so')) + { + $this->set_error('GD library does not appear to be loaded'); + return FALSE; + } + } + if (function_exists('gd_info')) + { + $gdarray = @gd_info(); + $versiontxt = ereg_replace('[[:alpha:][:space:]()]+', '', $gdarray['GD Version']); + $versionparts=explode('.',$versiontxt); + if ($versionparts[0]=="2") + { + return TRUE; + } + else + { + $this->set_error('Requires GD2, this reported as '.$versiontxt); + return FALSE; + } + } + else + { + $this->set_error('Could not verify GD version'); + return FALSE; + } + } + + private function _check_image() + //---------------------------------------------------------------------------------------------------------- + // checks that we have an image loaded + //---------------------------------------------------------------------------------------------------------- + { + if (!is_resource($this->main_image)) + { + $this->set_error("No main image loaded!"); + return FALSE; + } + else + { + return TRUE; + } + } + + function save_dynamic($filename="") + //---------------------------------------------------------------------------------------------------------- + // Saves the temp image as a dynamic image + // e.g. direct output to the browser + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // if no operations, copy it for temp save + $this->_copy_to_temp_if_needed(); + + // ok, lets go! + if ($filename=="") $filename=rand(1000,999999).".jpg"; // send as jpeg + $ext = strtoupper(pathinfo($filename, PATHINFO_EXTENSION)); + header("Content-disposition: filename=$filename;"); + header('Content-transfer-Encoding: binary'); + header('Last-modified: '.gmdate('D, d M Y H:i:s')); + switch ($ext) + { + case "GIF" : + header("Content-type: image/gif"); + imagegif($this->temp_image); + return $this; + break; + case "JPG" : + case "JPEG" : + header("Content-type: image/jpeg"); + imagejpeg($this->temp_image, NULL, $this->jpeg_quality); + return $this; + break; + case "PNG" : + header("Content-type: image/png"); + imagepng($this->temp_image); + return $this; + break; + } + $this->set_error('Unable to save, extension not GIF/JPEG/JPG/PNG'); + return $this; + } + + function save_pa($prepend="", $append="", $overwrite=FALSE) + //---------------------------------------------------------------------------------------------------------- + // Saves the temp image as the filename specified, + // overwrite = true of false + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // get current file parts + $parts=pathinfo($this->filename); + + // save + $this->save($parts["dirname"].'/'.$prepend.$parts['filename'].$append.'.'.$parts["extension"], $overwrite); + + return $this; + } + + function save($filename,$overwrite=FALSE) + //---------------------------------------------------------------------------------------------------------- + // Saves the temp image as the filename specified, + // overwrite = true of false + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // if no operations, copy it for temp save + $this->_copy_to_temp_if_needed(); + + // check if it already exists + if (!$overwrite) + { + // don't overwrite, so check for file + if (file_exists($filename)) + { + $this->set_error('File exists, overwrite is FALSE, could not save over file '.$filename); + return $this; + } + } + + // find out the type of file to save + $ext = strtoupper(pathinfo($filename, PATHINFO_EXTENSION)); + switch ($ext) + { + case "GIF" : + imagegif($this->temp_image, $filename); + return $this; + break; + case "JPG" : + case "JPEG" : + imagejpeg($this->temp_image, $filename, $this->jpeg_quality); + return $this; + break; + case "PNG" : + imagepng($this->temp_image, $filename); + return $this; + break; + } + + // invalid filetype?! + $this->set_error('Do no know what '.$ext.' filetype is in filename '.$filename); + return $this; + } + + private function _load_image($filename) + //---------------------------------------------------------------------------------------------------------- + // private function to load a resource + //---------------------------------------------------------------------------------------------------------- + { + // check the request file can be located + if (!file_exists($filename)) + { + $this->set_error('Could not locate file '.$filename); + return FALSE; + } + + // get image info about this file + $image_info=getimagesize($filename); + + // load file depending on mimetype + switch ($image_info["mime"]) + { + case "image/gif" : + return imagecreatefromgif($filename); + break; + case "image/jpeg" : + return imagecreatefromjpeg($filename); + break; + case "image/png" : + return imagecreatefrompng($filename); + break; + } + + // invalid filetype?! + $this->set_error('Unable to load '.$filename.' filetype '.$image_info["mime"].'not recognised'); + return FALSE; + } + + public function load($filename) + //---------------------------------------------------------------------------------------------------------- + // Load an image, public function + //---------------------------------------------------------------------------------------------------------- + { + // new image, reset error messages + $this->_clear_errors(); + + // remove temporary image stored + $this->clear_temp(); + + // save filename + $this->filename=$filename; + + // reset width and height + $this->width = 0; + $this->height = 0; + + // load it + $this->main_image = $this->_load_image($filename); + + // no error, then get the dminesions set + if ($this->main_image <> FALSE) + { + $this->width = imageSX($this->main_image); + $this->height = imageSY($this->main_image); + } + + // return the object + return $this; + } + + public function load_watermark($filename, $transparent_x=NULL, $transparent_y=NULL) + //---------------------------------------------------------------------------------------------------------- + // Load an image, public function + //---------------------------------------------------------------------------------------------------------- + { + if(is_resource($this->watermark_image)) imagedestroy($this->watermark_image); + $this->watermark_image = $this->_load_image($filename); + + if(is_resource($this->watermark_image)) + { + $this->watermark_method = 1; + if(($transparent_x <> NULL) AND ($transparent_y <> NULL)) + { + // get the top left corner colour allocation + $tpcolour = imagecolorat($this->watermark_image, $transparent_x, $transparent_y); + + // set this as the transparent colour + imagecolortransparent($this->watermark_image, $tpcolour); + + // $set diff method + $this->watermark_method = 2; + } + } + + // return this object + return $this; + } + + public function set_watermark_transparency($transparency=50) + //---------------------------------------------------------------------------------------------------------- + // Sets the quality that jpeg will be saved at + //---------------------------------------------------------------------------------------------------------- + { + $this->watermark_transparency = $transparency; + return $this; + } + + public function set_background_colour($colour="#ffffff") + //---------------------------------------------------------------------------------------------------------- + // Sets teh background colour to use on rotation and padding for resize + //---------------------------------------------------------------------------------------------------------- + { + $this->background_colour = $this->_html2rgb($colour); + return $this; + } + + public function set_jpeg_quality($quality=75) + //---------------------------------------------------------------------------------------------------------- + // Sets the quality that jpeg will be saved at + //---------------------------------------------------------------------------------------------------------- + { + $this->jpeg_quality = $quality; + return $this; + } + + private function _copy_to_temp_if_needed() + //---------------------------------------------------------------------------------------------------------- + // If temp image is empty, e.g. not resized or done anything then just copy main image + //---------------------------------------------------------------------------------------------------------- + { + if (!is_resource($this->temp_image)) + { + // create a temp based on new dimensions + $this->temp_image = imagecreatetruecolor($this->width, $this->height); + + // check it + if(!is_resource($this->temp_image)) + { + $this->set_error('Unable to create temp image sized '.$this->width.' x '.$this->height); + return FALSE; + } + + // copy image to temp workspace + imagecopy($this->temp_image, $this->main_image, 0, 0, 0, 0, $this->width, $this->height); + } + } + + public function clear() + //---------------------------------------------------------------------------------------------------------- + // clear everything! + //---------------------------------------------------------------------------------------------------------- + { + if(is_resource($this->main_image)) imagedestroy($this->main_image); + if(is_resource($this->watermark_image)) imagedestroy($this->watermark_image); + if(is_resource($this->temp_image)) imagedestroy($this->temp_image); + return $this; + } + + public function clear_temp() + //---------------------------------------------------------------------------------------------------------- + // you may want to revert back to teh original image to work on, e.g. watermark, this clears temp + //---------------------------------------------------------------------------------------------------------- + { + if(is_resource($this->temp_image)) imagedestroy($this->temp_image); + return $this; + } + + public function resize_crop($mw,$mh) + //---------------------------------------------------------------------------------------------------------- + // take main image and resize to tempimage using EXACT boundaries mw,mh (max width and max height) + // this is proportional and crops the image centrally to fit + //---------------------------------------------------------------------------------------------------------- + { + if (!$this->_check_image()) return $this; + + // clear temp image + $this->clear_temp(); + + // create a temp based on new dimensions + $this->temp_image = imagecreatetruecolor($mw,$mh); + + // check it + if(!is_resource($this->temp_image)) + { + $this->set_error('Unable to create temp image sized '.$mw.' x '.$mh); + return $this; + } + + // work out best positions for copy + $wx=$this->width / $mw; + $wy=$this->height / $mh; + if ($wx >= $wy) + { + // use full height + $sy = 0; + $sy2 = $this->height; + + // calcs + $calc_width = $mw * $wy; + $sx = ($this->width - $calc_width) / 2; + $sx2 = $calc_width; + } + else + { + // use full width + $sx = 0; + $sx2 = $this->width; + + // calcs + $calc_height = $mh * $wx; + $sy = ($this->height - $calc_height) / 2; + $sy2 = $calc_height; + } + + // copy section + imagecopyresampled($this->temp_image, $this->main_image, 0, 0, $sx, $sy, $mw, $mh, $sx2, $sy2); + return $this; + } + + public function resize($mw, $mh, $pad=FALSE) + //---------------------------------------------------------------------------------------------------------- + // take main image and resize to tempimage using boundaries mw,mh (max width or max height) + // this is proportional, pad to true will set it in the middle of area size + //---------------------------------------------------------------------------------------------------------- + { + if (!$this->_check_image()) return $this; + + // calc new dimensions + if( $this->width > $mw || $this->height > $mh ) { +// if( $this->width > $this->height ) { could calc wronf - Cole Thorsen swapped to his suggestion + if( ($this->width / $this->height) > ($mw / $mh) ) { + $tnw = $mw; + $tnh = $tnw * $this->height / $this->width; + } else { + $tnh = $mh; + $tnw = $tnh * $this->width / $this->height; + } + } else { + $tnw = $this->width; + $tnh = $this->height; + } + // clear temp image + $this->clear_temp(); + + // create a temp based on new dimensions + if ($pad) + { + $tx = $mw; + $ty = $mh; + $px = ($mw - $tnw) / 2; + $py = ($mh - $tnh) / 2; + } + else + { + $tx = $tnw; + $ty = $tnh; + $px = 0; + $py = 0; + } + $this->temp_image = imagecreatetruecolor($tx,$ty); + + // check it + if(!is_resource($this->temp_image)) + { + $this->set_error('Unable to create temp image sized '.$tx.' x '.$ty); + return $this; + } + + // if padding, fill background + if ($pad) + { + $col = $this->_html2rgb($this->background_colour); + $bg = imagecolorallocate($this->temp_image, $col[0], $col[1], $col[2]); + imagefilledrectangle($this->temp_image, 0, 0, $tx, $ty, $bg); + } + + // copy resized + imagecopyresampled($this->temp_image, $this->main_image, $px, $py, 0, 0, $tnw, $tnh, $this->width, $this->height); + return $this; + } + + public function stretch($mw,$mh) + //---------------------------------------------------------------------------------------------------------- + // take main image and resize to tempimage using boundaries mw,mh (max width or max height) + // does not retain proportions + //---------------------------------------------------------------------------------------------------------- + { + if (!$this->_check_image()) return $this; + + // clear temp image + $this->clear_temp(); + + // create a temp based on new dimensions + $this->temp_image = imagecreatetruecolor($mw, $mh); + + // check it + if(!is_resource($this->temp_image)) + { + $this->set_error('Unable to create temp image sized '.$mh.' x '.$mw); + return $this; + } + + // copy resized (stethced, proportions not kept); + imagecopyresampled($this->temp_image, $this->main_image, 0, 0, 0, 0, $mw, $mh, $this->width, $this->height); + return $this; + } + + public function crop($x1, $y1, $x2, $y2) + //---------------------------------------------------------------------------------------------------------- + // crop the main image to temp image using coords + //---------------------------------------------------------------------------------------------------------- + { + if (!$this->_check_image()) return $this; + + // clear temp image + $this->clear_temp(); + + // check dimensions + if ($x1 < 0 || $y1 < 0 || $x2 - $x1 > $this->width || $y2 - $y1 > $this->height) + { + $this->set_error('Invalid crop dimensions, either - passed or width/heigh too large '.$x1.'/'.$y1.' x '.$x2.'/'.$y2); + return $this; + } + + // create a temp based on new dimensions + $this->temp_image = imagecreatetruecolor($x2-$x1, $y2-$y1); + + // check it + if(!is_resource($this->temp_image)) + { + $this->set_error('Unable to create temp image sized '.$x2-$x1.' x '.$y2-$y1); + return $this; + } + + // copy cropped portion + imagecopy($this->temp_image, $this->main_image, 0, 0, $x1, $y1, $x2 - $x1, $y2 - $y1); + return $this; + } + + private function _html2rgb($colour) + //---------------------------------------------------------------------------------------------------------- + // convert #aa0011 to a php colour array + //---------------------------------------------------------------------------------------------------------- + { + if (is_array($colour)) + { + if (count($colour)==3) return $colour; // rgb sent as an array so use it + $this->set_error('Colour error, array sent not 3 elements, expected array(r,g,b)'); + return false; + } + if ($colour[0] == '#') + $colour = substr($colour, 1); + + if (strlen($colour) == 6) + { + list($r, $g, $b) = array($colour[0].$colour[1], + $colour[2].$colour[3], + $colour[4].$colour[5]); + } + elseif (strlen($colour) == 3) + { + list($r, $g, $b) = array($colour[0].$colour[0], $colour[1].$colour[1], $colour[2].$colour[2]); + } + else + { + $this->set_error('Colour error, value sent not #RRGGBB or RRGGBB, and not array(r,g,b)'); + return false; + } + + $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); + + return array($r, $g, $b); + } + + public function rotate($angle) + //---------------------------------------------------------------------------------------------------------- + // rotate an image bu 0 / 90 / 180 / 270 degrees + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // if no operations, copy it for temp save + $this->_copy_to_temp_if_needed(); + + // set the colour + $col = $this->_html2rgb($$this->background_colour); + $bg = imagecolorallocate($this->temp_image, $col[0], $col[1], $col[2]); + + // rotate as needed + $this->temp_image = imagerotate($this->temp_image, $angle, $bg); + return $this; + } + + public function make_watermark_text($text, $fontfile, $size=16, $colour="#ffffff", $angle=0) + //---------------------------------------------------------------------------------------------------------- + // create an image from text that can be applied as a watermark + // text is the text to write, $fontile is a ttf file that will be used $size=font size, $colour is the colour of text + //---------------------------------------------------------------------------------------------------------- + { + // check font file can be found + if (!file_exists($fontfile)) + { + $this->set_error('Could not locate font file "'.$fontfile.'"'); + return $this; + } + + // validate we loaded a main image + if (!$this->_check_image()) + { + $remove = TRUE; + // no image loaded so make temp image to use + $this->main_image = imagecreatetruecolor(1000,1000); + } + else + { + $remove = FALSE; + } + + // work out text dimensions + $bbox = imageftbbox($size, $angle, $fontfile, $text); + $bw = abs($bbox[4] - $bbox[0]) + 1; + $bh = abs($bbox[1] - $bbox[5]) + 1; + $bl = $bbox[1]; + + // use this to create watermark image + if(is_resource($this->watermark_image)) imagedestroy($this->watermark_image); + $this->watermark_image = imagecreatetruecolor($bw, $bh); + + // set colours + $col = $this->_html2rgb($colour); + $font_col = imagecolorallocate($this->watermark_image, $col[0], $col[1], $col[2]); + $bg_col = imagecolorallocate($this->watermark_image, 127, 128, 126); + + // set method to use + $this->watermark_method = 2; + + // create bg + imagecolortransparent($this->watermark_image, $bg_col); + imagefilledrectangle($this->watermark_image, 0,0, $bw, $bh, $bg_col); + + // write text to watermark + imagefttext($this->watermark_image, $size, $angle, 0, $bh-$bl, $font_col, $fontfile, $text); + + if ($remove) imagedestroy($this->main_image); + return $this; + } + + public function watermark($position, $offset=8, $abs=FALSE) + //---------------------------------------------------------------------------------------------------------- + // add a watermark to the image + // position works like a keypad e.g. + // 7 8 9 + // 4 5 6 + // 1 2 3 + // offset moves image inwards by x pixels + // if abs is set then $position, $offset = direct placement coords + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // validate we have a watermark + if(!is_resource($this->watermark_image)) + { + $this->set_error("Can't watermark image, no watermark loaded/created"); + return $this; + } + + // if no operations, copy it for temp save + $this->_copy_to_temp_if_needed(); + + // get watermark width + $wm_w = imageSX($this->watermark_image); + $wm_h = imageSY($this->watermark_image); + + // get temp widths + $temp_w = imageSX($this->temp_image); + $temp_h = imageSY($this->temp_image); + + // check watermark will fit! + if ($wm_w > $temp_w || $wm_h > $temp_h) + { + $this->set_error("Watermark is larger than image. WM: $wm_w x $wm_h Temp image: $temp_w x $temp_h"); + return $this; + } + + if ($abs) + { + // direct placement + $dest_x = $position; + $dest_y = $offset; + } + else + { + // do X position + switch ($position) + { + // x left + case "7": + case "4": + case "1": + $dest_x = $offset; + break; + // x middle + case "8": + case "5": + case "2": + $dest_x = ($temp_w - $wm_w) /2 ; + break; + // x right + case "9": + case "6": + case "3": + $dest_x = $temp_w - $offset - $wm_w; + break; + default: + $dest_x = $offset; + $this->set_error("Watermark position $position not in vlaid range 7,8,9 - 4,5,6 - 1,2,3"); + } + // do y position + switch ($position) + { + // y top + case "7": + case "8": + case "9": + $dest_y = $offset; + break; + // y middle + case "4": + case "5": + case "6": + $dest_y = ($temp_h - $wm_h) /2 ; + break; + // y bottom + case "1": + case "2": + case "3": + $dest_y = $temp_h - $offset - $wm_h; + break; + default: + $dest_y = $offset; + $this->set_error("Watermark position $position not in vlaid range 7,8,9 - 4,5,6 - 1,2,3"); + } + + } + + // copy over temp image to desired location + if ($this->watermark_method == 1) + { + // use back methods to do this, taken from php help files + //$this->imagecopymerge_alpha($this->temp_image, $this->watermark_image, $dest_x, $dest_y, 0, 0, $wm_w, $wm_h, $this->watermark_transparency); + + $opacity=$this->watermark_transparency; + + // creating a cut resource + $cut = imagecreatetruecolor($wm_w, $wm_h); + + // copying that section of the background to the cut + imagecopy($cut, $this->temp_image, 0, 0, $dest_x, $dest_y, $wm_w, $wm_h); + + // inverting the opacity + $opacity = 100 - $opacity; + + // placing the watermark now + imagecopy($cut, $this->watermark_image, 0, 0, 0, 0, $wm_w, $wm_h); + imagecopymerge($this->temp_image, $cut, $dest_x, $dest_y, 0, 0, $wm_w, $wm_h, $opacity); + + } + else + { + // use normal with selected transparency colour + imagecopymerge($this->temp_image, $this->watermark_image, $dest_x, $dest_y, 0, 0, $wm_w, $wm_h, $this->watermark_transparency); + } + + return $this; + } + + public function border($width=5,$colour="#000") + //---------------------------------------------------------------------------------------------------------- + // add a solidborder frame, coloured $colour to the image + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // if no operations, copy it for temp save + $this->_copy_to_temp_if_needed(); + + // get colour set for temp image + $col = $this->_html2rgb($colour); + $border_col = imagecolorallocate($this->temp_image, $col[0], $col[1], $col[2]); + + // get temp widths + $temp_w = imageSX($this->temp_image); + $temp_h = imageSY($this->temp_image); + + // do border + for($x=0;$x<$width;$x++) + { + imagerectangle($this->temp_image, $x, $x, $temp_w-$x-1, $temp_h-$x-1, $border_col); + } + + // return object + return $this; + } + + public function border_3d($width=5,$rot=0,$opacity=30) + //---------------------------------------------------------------------------------------------------------- + // overlay a black white border to make it look 3d + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // if no operations, copy it for temp save + $this->_copy_to_temp_if_needed(); + + // get temp widths + $temp_w = imageSX($this->temp_image); + $temp_h = imageSY($this->temp_image); + + // create temp canvas to merge + $border_image = imagecreatetruecolor($temp_w, $temp_h); + + // create colours + $black = imagecolorallocate($border_image, 0, 0, 0); + $white = imagecolorallocate($border_image, 255, 255, 255); + switch ($rot) + { + case 1 : + $cols=array($white,$black,$white,$black); + break; + case 2 : + $cols=array($black,$black,$white,$white); + break; + case 3 : + $cols=array($black,$white,$black,$white); + break; + default : + $cols=array($white,$white,$black,$black); + } + $bg_col = imagecolorallocate($border_image, 127, 128, 126); + + // create bg + imagecolortransparent($border_image, $bg_col); + imagefilledrectangle($border_image, 0,0, $temp_w, $temp_h, $bg_col); + + // do border + for($x=0;$x<$width;$x++) + { + // top + imageline($border_image, $x, $x, $temp_w-$x-1, $x, $cols[0]); + // left + imageline($border_image, $x, $x, $x, $temp_w-$x-1, $cols[1]); + // bottom + imageline($border_image, $x, $temp_h-$x-1, $temp_w-1-$x, $temp_h-$x-1, $cols[3]); + // right + imageline($border_image, $temp_w-$x-1, $x, $temp_w-$x-1, $temp_h-$x-1, $cols[2]); + } + + // merg with temp image + imagecopymerge($this->temp_image, $border_image, 0, 0, 0, 0, $temp_w, $temp_h, $opacity); + + // clean up + imagedestroy($border_image); + + // return object + return $this; + } + + public function shadow($size=4, $direction=3, $colour="#444") + //---------------------------------------------------------------------------------------------------------- + // add a shadow to an image, this will INCREASE the size of the image + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // if no operations, copy it for temp save + $this->_copy_to_temp_if_needed(); + + // get the current size + $sx = imagesx($this->temp_image); + $sy = imagesy($this->temp_image); + + // new image + $bu_image = imagecreatetruecolor($sx, $sy); + + // check it + if(!is_resource($bu_image)) + { + $this->set_error('Unable to create shadow temp image sized '.$this->width.' x '.$this->height); + return FALSE; + } + + // copy the current image to memory + imagecopy($bu_image, $this->temp_image, 0, 0, 0, 0, $sx, $sy); + + imagedestroy($this->temp_image); + $this->temp_image = imagecreatetruecolor($sx+$size, $sy+$size); + + // fill background colour + $col = $this->_html2rgb($this->background_colour); + $bg = imagecolorallocate($this->temp_image, $col[0], $col[1], $col[2]); + imagefilledrectangle($this->temp_image, 0, 0, $sx+$size, $sy+$size, $bg); + + // work out position + // do X position + switch ($direction) + { + // x left + case "7": + case "4": + case "1": + $sh_x = 0; + $pic_x = $size; + break; + // x middle + case "8": + case "5": + case "2": + $sh_x = $size / 2; + $pic_x = $size / 2; + break; + // x right + case "9": + case "6": + case "3": + $sh_x = $size; + $pic_x = 0; + break; + default: + $sh_x = $size; + $pic_x = 0; + $this->set_error("Shadow position $position not in vlaid range 7,8,9 - 4,5,6 - 1,2,3"); + } + // do y position + switch ($direction) + { + // y top + case "7": + case "8": + case "9": + $sh_y = 0; + $pic_y = $size; + break; + // y middle + case "4": + case "5": + case "6": + $sh_y = $size / 2; + $pic_y = $size / 2; + break; + // y bottom + case "1": + case "2": + case "3": + $sh_y = $size; + $pic_y = 0; + break; + default: + $sh_y = $size; + $pic_y = 0; + $this->set_error("Shadow position $position not in vlaid range 7,8,9 - 4,5,6 - 1,2,3"); + } + + // create the shadow + $shadowcolour = $this->_html2rgb($colour); + $shadow = imagecolorallocate($this->temp_image, $shadowcolour[0], $shadowcolour[1], $shadowcolour[2]); + imagefilledrectangle($this->temp_image, $sh_x, $sh_y, $sh_x+$sx-1, $sh_y+$sy-1, $shadow); + + // copy current image to correct location + imagecopy($this->temp_image, $bu_image, $pic_x, $pic_y, 0, 0, $sx, $sy); + + // clean up and desstroy temp image + imagedestroy($bu_image); + + //return object + return $this; + } + + public function filter($function, $arg1=NULL, $arg2=NULL, $arg3=NULL, $arg4=NULL) + //---------------------------------------------------------------------------------------------------------- + // allows you to use the inbulit gd2 image filters + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // if no operations, copy it for temp save + $this->_copy_to_temp_if_needed(); + + if (!imagefilter($this->temp_image, $function, $arg1, $arg2, $arg3, $arg4)) + { + $this->set_error("Filter $function failed"); + } + + // return object + return $this; + } + + public function round($radius=5,$invert=False,$corners="") + //---------------------------------------------------------------------------------------------------------- + // adds rounded corners to the output + // using a quarter and rotating as you can end up with odd roudning if you draw a whole and use parts + //---------------------------------------------------------------------------------------------------------- + { + // validate we loaded a main image + if (!$this->_check_image()) return $this; + + // if no operations, copy it for temp save + $this->_copy_to_temp_if_needed(); + + // check input + if ($corners=="") $corners=array(True,True,True,True); + if (!is_array($corners) || count($corners)<>4) + { + $this->set_error("Round failed, expected an array of 4 items round(radius,tl,tr,br,bl)"); + return $this; + } + + // create corner + $corner = imagecreatetruecolor($radius, $radius); + + // turn on aa make it nicer + imageantialias($corner, true); + $col = $this->_html2rgb($this->background_colour); + + // use bg col for corners + $bg = imagecolorallocate($corner, $col[0], $col[1], $col[2]); + + // create our transparent colour + $xparent = imagecolorallocate($corner, 127, 128, 126); + imagecolortransparent($corner, $xparent); + if ($invert) + { + // fill and clear bits + imagefilledrectangle($corner, 0, 0, $radius, $radius, $xparent); + imagefilledellipse($corner, 0, 0, ($radius * 2)-1, ($radius * 2)-1, $bg); + } + else + { + // fill and clear bits + imagefilledrectangle($corner, 0, 0, $radius, $radius, $bg); + imagefilledellipse($corner, $radius, $radius, ($radius * 2) , ($radius * 2) , $xparent); + } + + // get temp widths + $temp_w = imageSX($this->temp_image); + $temp_h = imageSY($this->temp_image); + + // do corners + if ($corners[0]) imagecopymerge($this->temp_image, $corner, 0, 0, 0, 0, $radius, $radius, 100); + $corner = imagerotate($corner, 270, 0); + if ($corners[1]) imagecopymerge($this->temp_image, $corner, $temp_w-$radius, 0, 0, 0, $radius, $radius, 100); + $corner = imagerotate($corner, 270, 0); + if ($corners[2]) imagecopymerge($this->temp_image, $corner, $temp_w-$radius, $temp_h-$radius, 0, 0, $radius, $radius, 100); + $corner = imagerotate($corner, 270, 0); + if ($corners[3]) imagecopymerge($this->temp_image, $corner, 0, $temp_h-$radius, 0, 0, $radius, $radius, 100); + + // return object + return $this; + } + + +} +/* End of file image_moo.php */ /* Location: .system/application/libraries/image_moo.php */ \ No newline at end of file diff --git a/application/libraries/index.html b/application/libraries/index.html index 065d2da..04e928c 100755 --- a/application/libraries/index.html +++ b/application/libraries/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/logs/index.html b/application/logs/index.html index 065d2da..04e928c 100755 --- a/application/logs/index.html +++ b/application/logs/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/migrations/001_install_ion_auth.php b/application/migrations/001_install_ion_auth.php index 3a55504..7b31c0c 100755 --- a/application/migrations/001_install_ion_auth.php +++ b/application/migrations/001_install_ion_auth.php @@ -1,241 +1,241 @@ -dbforge->drop_table('groups'); - - // Table structure for table 'groups' - $this->dbforge->add_field(array( - 'id' => array( - 'type' => 'MEDIUMINT', - 'constraint' => '8', - 'unsigned' => TRUE, - 'auto_increment' => TRUE - ), - 'name' => array( - 'type' => 'VARCHAR', - 'constraint' => '20', - ), - 'description' => array( - 'type' => 'VARCHAR', - 'constraint' => '100', - ) - )); - $this->dbforge->add_key('id', TRUE); - $this->dbforge->create_table('groups'); - - // Dumping data for table 'groups' - $data = array( - array( - 'id' => '1', - 'name' => 'admin', - 'description' => 'Administrator' - ), - array( - 'id' => '2', - 'name' => 'members', - 'description' => 'General User' - ) - ); - $this->db->insert_batch('groups', $data); - - - // Drop table 'users' if it exists - $this->dbforge->drop_table('users'); - - // Table structure for table 'users' - $this->dbforge->add_field(array( - 'id' => array( - 'type' => 'MEDIUMINT', - 'constraint' => '8', - 'unsigned' => TRUE, - 'auto_increment' => TRUE - ), - 'ip_address' => array( - 'type' => 'VARBINARY', - 'constraint' => '16' - ), - 'username' => array( - 'type' => 'VARCHAR', - 'constraint' => '100', - ), - 'password' => array( - 'type' => 'VARCHAR', - 'constraint' => '80', - ), - 'salt' => array( - 'type' => 'VARCHAR', - 'constraint' => '40' - ), - 'email' => array( - 'type' => 'VARCHAR', - 'constraint' => '100' - ), - 'activation_code' => array( - 'type' => 'VARCHAR', - 'constraint' => '40', - 'null' => TRUE - ), - 'forgotten_password_code' => array( - 'type' => 'VARCHAR', - 'constraint' => '40', - 'null' => TRUE - ), - 'forgotten_password_time' => array( - 'type' => 'INT', - 'constraint' => '11', - 'unsigned' => TRUE, - 'null' => TRUE - ), - 'remember_code' => array( - 'type' => 'VARCHAR', - 'constraint' => '40', - 'null' => TRUE - ), - 'created_on' => array( - 'type' => 'INT', - 'constraint' => '11', - 'unsigned' => TRUE, - ), - 'last_login' => array( - 'type' => 'INT', - 'constraint' => '11', - 'unsigned' => TRUE, - 'null' => TRUE - ), - 'active' => array( - 'type' => 'TINYINT', - 'constraint' => '1', - 'unsigned' => TRUE, - 'null' => TRUE - ), - 'first_name' => array( - 'type' => 'VARCHAR', - 'constraint' => '50', - 'null' => TRUE - ), - 'last_name' => array( - 'type' => 'VARCHAR', - 'constraint' => '50', - 'null' => TRUE - ), - 'company' => array( - 'type' => 'VARCHAR', - 'constraint' => '100', - 'null' => TRUE - ), - 'phone' => array( - 'type' => 'VARCHAR', - 'constraint' => '20', - 'null' => TRUE - ) - - )); - $this->dbforge->add_key('id', TRUE); - $this->dbforge->create_table('users'); - - // Dumping data for table 'users' - $data = array( - 'id' => '1', - 'ip_address' => 0x7f000001, - 'username' => 'administrator', - 'password' => '59beecdf7fc966e2f17fd8f65a4a9aeb09d4a3d4', - 'salt' => '9462e8eee0', - 'email' => 'admin@admin.com', - 'activation_code' => '', - 'forgotten_password_code' => NULL, - 'created_on' => '1268889823', - 'last_login' => '1268889823', - 'active' => '1', - 'first_name' => 'Admin', - 'last_name' => 'istrator', - 'company' => 'ADMIN', - 'phone' => '0', - ); - $this->db->insert('users', $data); - - - // Drop table 'users_groups' if it exists - $this->dbforge->drop_table('users_groups'); - - // Table structure for table 'users_groups' - $this->dbforge->add_field(array( - 'id' => array( - 'type' => 'MEDIUMINT', - 'constraint' => '8', - 'unsigned' => TRUE, - 'auto_increment' => TRUE - ), - 'user_id' => array( - 'type' => 'MEDIUMINT', - 'constraint' => '8', - 'unsigned' => TRUE - ), - 'group_id' => array( - 'type' => 'MEDIUMINT', - 'constraint' => '8', - 'unsigned' => TRUE - ) - )); - $this->dbforge->add_key('id', TRUE); - $this->dbforge->create_table('users_groups'); - - // Dumping data for table 'users_groups' - $data = array( - array( - 'id' => '1', - 'user_id' => '1', - 'group_id' => '1', - ), - array( - 'id' => '2', - 'user_id' => '1', - 'group_id' => '2', - ) - ); - $this->db->insert_batch('users_groups', $data); - - - // Drop table 'login_attempts' if it exists - $this->dbforge->drop_table('login_attempts'); - - // Table structure for table 'login_attempts' - $this->dbforge->add_field(array( - 'id' => array( - 'type' => 'MEDIUMINT', - 'constraint' => '8', - 'unsigned' => TRUE, - 'auto_increment' => TRUE - ), - 'ip_address' => array( - 'type' => 'VARBINARY', - 'constraint' => '16' - ), - 'login' => array( - 'type' => 'VARCHAR', - 'constraint' => '100', - 'null', TRUE - ), - 'time' => array( - 'type' => 'INT', - 'constraint' => '11', - 'unsigned' => TRUE, - 'null' => TRUE - ) - )); - $this->dbforge->add_key('id', TRUE); - $this->dbforge->create_table('login_attempts'); - - } - - public function down() - { - $this->dbforge->drop_table('users'); - $this->dbforge->drop_table('groups'); - $this->dbforge->drop_table('users_groups'); - $this->dbforge->drop_table('login_attempts'); - } -} +dbforge->drop_table('groups'); + + // Table structure for table 'groups' + $this->dbforge->add_field(array( + 'id' => array( + 'type' => 'MEDIUMINT', + 'constraint' => '8', + 'unsigned' => TRUE, + 'auto_increment' => TRUE + ), + 'name' => array( + 'type' => 'VARCHAR', + 'constraint' => '20', + ), + 'description' => array( + 'type' => 'VARCHAR', + 'constraint' => '100', + ) + )); + $this->dbforge->add_key('id', TRUE); + $this->dbforge->create_table('groups'); + + // Dumping data for table 'groups' + $data = array( + array( + 'id' => '1', + 'name' => 'admin', + 'description' => 'Administrator' + ), + array( + 'id' => '2', + 'name' => 'members', + 'description' => 'General User' + ) + ); + $this->db->insert_batch('groups', $data); + + + // Drop table 'users' if it exists + $this->dbforge->drop_table('users'); + + // Table structure for table 'users' + $this->dbforge->add_field(array( + 'id' => array( + 'type' => 'MEDIUMINT', + 'constraint' => '8', + 'unsigned' => TRUE, + 'auto_increment' => TRUE + ), + 'ip_address' => array( + 'type' => 'VARBINARY', + 'constraint' => '16' + ), + 'username' => array( + 'type' => 'VARCHAR', + 'constraint' => '100', + ), + 'password' => array( + 'type' => 'VARCHAR', + 'constraint' => '80', + ), + 'salt' => array( + 'type' => 'VARCHAR', + 'constraint' => '40' + ), + 'email' => array( + 'type' => 'VARCHAR', + 'constraint' => '100' + ), + 'activation_code' => array( + 'type' => 'VARCHAR', + 'constraint' => '40', + 'null' => TRUE + ), + 'forgotten_password_code' => array( + 'type' => 'VARCHAR', + 'constraint' => '40', + 'null' => TRUE + ), + 'forgotten_password_time' => array( + 'type' => 'INT', + 'constraint' => '11', + 'unsigned' => TRUE, + 'null' => TRUE + ), + 'remember_code' => array( + 'type' => 'VARCHAR', + 'constraint' => '40', + 'null' => TRUE + ), + 'created_on' => array( + 'type' => 'INT', + 'constraint' => '11', + 'unsigned' => TRUE, + ), + 'last_login' => array( + 'type' => 'INT', + 'constraint' => '11', + 'unsigned' => TRUE, + 'null' => TRUE + ), + 'active' => array( + 'type' => 'TINYINT', + 'constraint' => '1', + 'unsigned' => TRUE, + 'null' => TRUE + ), + 'first_name' => array( + 'type' => 'VARCHAR', + 'constraint' => '50', + 'null' => TRUE + ), + 'last_name' => array( + 'type' => 'VARCHAR', + 'constraint' => '50', + 'null' => TRUE + ), + 'company' => array( + 'type' => 'VARCHAR', + 'constraint' => '100', + 'null' => TRUE + ), + 'phone' => array( + 'type' => 'VARCHAR', + 'constraint' => '20', + 'null' => TRUE + ) + + )); + $this->dbforge->add_key('id', TRUE); + $this->dbforge->create_table('users'); + + // Dumping data for table 'users' + $data = array( + 'id' => '1', + 'ip_address' => 0x7f000001, + 'username' => 'administrator', + 'password' => '59beecdf7fc966e2f17fd8f65a4a9aeb09d4a3d4', + 'salt' => '9462e8eee0', + 'email' => 'admin@admin.com', + 'activation_code' => '', + 'forgotten_password_code' => NULL, + 'created_on' => '1268889823', + 'last_login' => '1268889823', + 'active' => '1', + 'first_name' => 'Admin', + 'last_name' => 'istrator', + 'company' => 'ADMIN', + 'phone' => '0', + ); + $this->db->insert('users', $data); + + + // Drop table 'users_groups' if it exists + $this->dbforge->drop_table('users_groups'); + + // Table structure for table 'users_groups' + $this->dbforge->add_field(array( + 'id' => array( + 'type' => 'MEDIUMINT', + 'constraint' => '8', + 'unsigned' => TRUE, + 'auto_increment' => TRUE + ), + 'user_id' => array( + 'type' => 'MEDIUMINT', + 'constraint' => '8', + 'unsigned' => TRUE + ), + 'group_id' => array( + 'type' => 'MEDIUMINT', + 'constraint' => '8', + 'unsigned' => TRUE + ) + )); + $this->dbforge->add_key('id', TRUE); + $this->dbforge->create_table('users_groups'); + + // Dumping data for table 'users_groups' + $data = array( + array( + 'id' => '1', + 'user_id' => '1', + 'group_id' => '1', + ), + array( + 'id' => '2', + 'user_id' => '1', + 'group_id' => '2', + ) + ); + $this->db->insert_batch('users_groups', $data); + + + // Drop table 'login_attempts' if it exists + $this->dbforge->drop_table('login_attempts'); + + // Table structure for table 'login_attempts' + $this->dbforge->add_field(array( + 'id' => array( + 'type' => 'MEDIUMINT', + 'constraint' => '8', + 'unsigned' => TRUE, + 'auto_increment' => TRUE + ), + 'ip_address' => array( + 'type' => 'VARBINARY', + 'constraint' => '16' + ), + 'login' => array( + 'type' => 'VARCHAR', + 'constraint' => '100', + 'null', TRUE + ), + 'time' => array( + 'type' => 'INT', + 'constraint' => '11', + 'unsigned' => TRUE, + 'null' => TRUE + ) + )); + $this->dbforge->add_key('id', TRUE); + $this->dbforge->create_table('login_attempts'); + + } + + public function down() + { + $this->dbforge->drop_table('users'); + $this->dbforge->drop_table('groups'); + $this->dbforge->drop_table('users_groups'); + $this->dbforge->drop_table('login_attempts'); + } +} diff --git a/application/models/grocery_crud_model.php b/application/models/grocery_crud_model.php index 412bf11..251c2fb 100755 --- a/application/models/grocery_crud_model.php +++ b/application/models/grocery_crud_model.php @@ -1,585 +1,585 @@ - - */ - -// ------------------------------------------------------------------------ - -/** - * Grocery CRUD Model - * - * - * @package grocery CRUD - * @author John Skoumbourdis - * @version 1.2 - * @link http://www.grocerycrud.com/documentation - */ -class grocery_CRUD_Model extends CI_Model { - - protected $primary_key = null; - protected $table_name = null; - protected $relation = array(); - protected $relation_n_n = array(); - protected $primary_keys = array(); - - function __construct() - { - parent::__construct(); - } - - function db_table_exists($table_name = null) - { - return $this->db->table_exists($table_name); - } - - function get_list() - { - if($this->table_name === null) - return false; - - $select = "`{$this->table_name}`.*"; - - //set_relation special queries - if(!empty($this->relation)) - { - foreach($this->relation as $relation) - { - list($field_name , $related_table , $related_field_title) = $relation; - $unique_join_name = $this->_unique_join_name($field_name); - $unique_field_name = $this->_unique_field_name($field_name); - - if(strstr($related_field_title,'{')) - { - $related_field_title = str_replace(" "," ",$related_field_title); - $select .= ", CONCAT('".str_replace(array('{','}'),array("',COALESCE({$unique_join_name}.",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $unique_field_name"; - } - else - { - $select .= ", $unique_join_name.$related_field_title AS $unique_field_name"; - } - - if($this->field_exists($related_field_title)) - $select .= ", `{$this->table_name}`.$related_field_title AS '{$this->table_name}.$related_field_title'"; - } - } - - //set_relation_n_n special queries. We prefer sub queries from a simple join for the relation_n_n as it is faster and more stable on big tables. - if(!empty($this->relation_n_n)) - { - $select = $this->relation_n_n_queries($select); - } - - $this->db->select($select, false); - - $results = $this->db->get($this->table_name)->result(); - - return $results; - } - - public function get_row($table_name = null) - { - $table_name = $table_name === null ? $this->table_name : $table_name; - - return $this->db->get($table_name)->row(); - } - - public function set_primary_key($field_name, $table_name = null) - { - $table_name = $table_name === null ? $this->table_name : $table_name; - - $this->primary_keys[$table_name] = $field_name; - } - - protected function relation_n_n_queries($select) - { - $this_table_primary_key = $this->get_primary_key(); - foreach($this->relation_n_n as $relation_n_n) - { - list($field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table, - $primary_key_alias_to_selection_table, $title_field_selection_table, $priority_field_relation_table) = array_values((array)$relation_n_n); - - $primary_key_selection_table = $this->get_primary_key($selection_table); - - $field = ""; - $use_template = strpos($title_field_selection_table,'{') !== false; - $field_name_hash = $this->_unique_field_name($title_field_selection_table); - if($use_template) - { - $title_field_selection_table = str_replace(" ", " ", $title_field_selection_table); - $field .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$title_field_selection_table))."')"; - } - else - { - $field .= "$selection_table.$title_field_selection_table"; - } - - //Sorry Codeigniter but you cannot help me with the subquery! - $select .= ", (SELECT GROUP_CONCAT(DISTINCT $field) FROM $selection_table " - ."LEFT JOIN $relation_table ON $relation_table.$primary_key_alias_to_selection_table = $selection_table.$primary_key_selection_table " - ."WHERE $relation_table.$primary_key_alias_to_this_table = `{$this->table_name}`.$this_table_primary_key GROUP BY $relation_table.$primary_key_alias_to_this_table) AS $field_name"; - } - - return $select; - } - - function order_by($order_by , $direction) - { - $this->db->order_by( $order_by , $direction ); - } - - function where($key, $value = NULL, $escape = TRUE) - { - $this->db->where( $key, $value, $escape); - } - - function or_where($key, $value = NULL, $escape = TRUE) - { - $this->db->or_where( $key, $value, $escape); - } - - function having($key, $value = NULL, $escape = TRUE) - { - $this->db->having( $key, $value, $escape); - } - - function or_having($key, $value = NULL, $escape = TRUE) - { - $this->db->or_having( $key, $value, $escape); - } - - function like($field, $match = '', $side = 'both') - { - $this->db->like($field, $match, $side); - } - - function or_like($field, $match = '', $side = 'both') - { - $this->db->or_like($field, $match, $side); - } - - function limit($value, $offset = '') - { - $this->db->limit( $value , $offset ); - } - - function get_total_results() - { - //set_relation_n_n special queries. We prefer sub queries from a simple join for the relation_n_n as it is faster and more stable on big tables. - if(!empty($this->relation_n_n)) - { - $select = "{$this->table_name}.*"; - $select = $this->relation_n_n_queries($select); - - $this->db->select($select,false); - - return $this->db->get($this->table_name)->num_rows(); - } - - return $this->db->count_all_results($this->table_name); - - } - - function set_basic_table($table_name = null) - { - if( !($this->db->table_exists($table_name)) ) - return false; - - $this->table_name = $table_name; - - return true; - } - - function get_edit_values($primary_key_value) - { - $primary_key_field = $this->get_primary_key(); - $this->db->where($primary_key_field,$primary_key_value); - $result = $this->db->get($this->table_name)->row(); - return $result; - } - - function join_relation($field_name , $related_table , $related_field_title) - { - $related_primary_key = $this->get_primary_key($related_table); - - if($related_primary_key !== false) - { - $unique_name = $this->_unique_join_name($field_name); - $this->db->join( $related_table.' as '.$unique_name , "$unique_name.$related_primary_key = {$this->table_name}.$field_name",'left'); - - $this->relation[$field_name] = array($field_name , $related_table , $related_field_title); - - return true; - } - - return false; - } - - function set_relation_n_n_field($field_info) - { - $this->relation_n_n[$field_info->field_name] = $field_info; - } - - protected function _unique_join_name($field_name) - { - return 'j'.substr(md5($field_name),0,8); //This j is because is better for a string to begin with a letter and not with a number - } - - protected function _unique_field_name($field_name) - { - return 's'.substr(md5($field_name),0,8); //This s is because is better for a string to begin with a letter and not with a number - } - - function get_relation_array($field_name , $related_table , $related_field_title, $where_clause, $order_by, $limit = null, $search_like = null) - { - $relation_array = array(); - $field_name_hash = $this->_unique_field_name($field_name); - - $related_primary_key = $this->get_primary_key($related_table); - - $select = "$related_table.$related_primary_key, "; - - if(strstr($related_field_title,'{')) - { - $related_field_title = str_replace(" ", " ", $related_field_title); - $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; - } - else - { - $select .= "$related_table.$related_field_title as $field_name_hash"; - } - - $this->db->select($select,false); - if($where_clause !== null) - $this->db->where($where_clause); - - if($where_clause !== null) - $this->db->where($where_clause); - - if($limit !== null) - $this->db->limit($limit); - - if($search_like !== null) - $this->db->having("$field_name_hash LIKE '%".$this->db->escape_like_str($search_like)."%'"); - - $order_by !== null - ? $this->db->order_by($order_by) - : $this->db->order_by($field_name_hash); - - $results = $this->db->get($related_table)->result(); - - foreach($results as $row) - { - $relation_array[$row->$related_primary_key] = $row->$field_name_hash; - } - - return $relation_array; - } - - function get_ajax_relation_array($search, $field_name , $related_table , $related_field_title, $where_clause, $order_by) - { - return $this->get_relation_array($field_name , $related_table , $related_field_title, $where_clause, $order_by, 10 , $search); - } - - function get_relation_total_rows($field_name , $related_table , $related_field_title, $where_clause) - { - if($where_clause !== null) - $this->db->where($where_clause); - - return $this->db->count_all_results($related_table); - } - - function get_relation_n_n_selection_array($primary_key_value, $field_info) - { - $select = ""; - $related_field_title = $field_info->title_field_selection_table; - $use_template = strpos($related_field_title,'{') !== false;; - $field_name_hash = $this->_unique_field_name($related_field_title); - if($use_template) - { - $related_field_title = str_replace(" ", " ", $related_field_title); - $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; - } - else - { - $select .= "$related_field_title as $field_name_hash"; - } - $this->db->select('*, '.$select,false); - - $selection_primary_key = $this->get_primary_key($field_info->selection_table); - - if(empty($field_info->priority_field_relation_table)) - { - if(!$use_template){ - $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); - } - } - else - { - $this->db->order_by("{$field_info->relation_table}.{$field_info->priority_field_relation_table}"); - } - $this->db->where($field_info->primary_key_alias_to_this_table, $primary_key_value); - $this->db->join( - $field_info->selection_table, - "{$field_info->relation_table}.{$field_info->primary_key_alias_to_selection_table} = {$field_info->selection_table}.{$selection_primary_key}" - ); - $results = $this->db->get($field_info->relation_table)->result(); - - $results_array = array(); - foreach($results as $row) - { - $results_array[$row->{$field_info->primary_key_alias_to_selection_table}] = $row->{$field_name_hash}; - } - - return $results_array; - } - - function get_relation_n_n_unselected_array($field_info, $selected_values) - { - $use_where_clause = !empty($field_info->where_clause); - - $select = ""; - $related_field_title = $field_info->title_field_selection_table; - $use_template = strpos($related_field_title,'{') !== false; - $field_name_hash = $this->_unique_field_name($related_field_title); - - if($use_template) - { - $related_field_title = str_replace(" ", " ", $related_field_title); - $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; - } - else - { - $select .= "$related_field_title as $field_name_hash"; - } - $this->db->select('*, '.$select,false); - - if($use_where_clause){ - $this->db->where($field_info->where_clause); - } - - $selection_primary_key = $this->get_primary_key($field_info->selection_table); - if(!$use_template) - $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); - $results = $this->db->get($field_info->selection_table)->result(); - - $results_array = array(); - foreach($results as $row) - { - if(!isset($selected_values[$row->$selection_primary_key])) - $results_array[$row->$selection_primary_key] = $row->{$field_name_hash}; - } - - return $results_array; - } - - function db_relation_n_n_update($field_info, $post_data ,$main_primary_key) - { - $this->db->where($field_info->primary_key_alias_to_this_table, $main_primary_key); - if(!empty($post_data)) - $this->db->where_not_in($field_info->primary_key_alias_to_selection_table , $post_data); - $this->db->delete($field_info->relation_table); - - $counter = 0; - if(!empty($post_data)) - { - foreach($post_data as $primary_key_value) - { - $where_array = array( - $field_info->primary_key_alias_to_this_table => $main_primary_key, - $field_info->primary_key_alias_to_selection_table => $primary_key_value, - ); - - $this->db->where($where_array); - $count = $this->db->from($field_info->relation_table)->count_all_results(); - - if($count == 0) - { - if(!empty($field_info->priority_field_relation_table)) - $where_array[$field_info->priority_field_relation_table] = $counter; - - $this->db->insert($field_info->relation_table, $where_array); - - }elseif($count >= 1 && !empty($field_info->priority_field_relation_table)) - { - $this->db->update( $field_info->relation_table, array($field_info->priority_field_relation_table => $counter) , $where_array); - } - - $counter++; - } - } - } - - function db_relation_n_n_delete($field_info, $main_primary_key) - { - $this->db->where($field_info->primary_key_alias_to_this_table, $main_primary_key); - $this->db->delete($field_info->relation_table); - } - - function get_field_types_basic_table() - { - $db_field_types = array(); - foreach($this->db->query("SHOW COLUMNS FROM `{$this->table_name}`")->result() as $db_field_type) - { - $type = explode("(",$db_field_type->Type); - $db_type = $type[0]; - - if(isset($type[1])) - { - if(substr($type[1],-1) == ')') - { - $length = substr($type[1],0,-1); - } - else - { - list($length) = explode(" ",$type[1]); - $length = substr($length,0,-1); - } - } - else - { - $length = ''; - } - $db_field_types[$db_field_type->Field]['db_max_length'] = $length; - $db_field_types[$db_field_type->Field]['db_type'] = $db_type; - $db_field_types[$db_field_type->Field]['db_null'] = $db_field_type->Null == 'YES' ? true : false; - $db_field_types[$db_field_type->Field]['db_extra'] = $db_field_type->Extra; - } - - $results = $this->db->field_data($this->table_name); - foreach($results as $num => $row) - { - $row = (array)$row; - $results[$num] = (object)( array_merge($row, $db_field_types[$row['name']]) ); - } - - return $results; - } - - function get_field_types($table_name) - { - $results = $this->db->field_data($table_name); - - return $results; - } - - function db_update($post_array, $primary_key_value) - { - $primary_key_field = $this->get_primary_key(); - return $this->db->update($this->table_name,$post_array, array( $primary_key_field => $primary_key_value)); - } - - function db_insert($post_array) - { - $insert = $this->db->insert($this->table_name,$post_array); - if($insert) - { - return $this->db->insert_id(); - } - return false; - } - - function db_delete($primary_key_value) - { - $primary_key_field = $this->get_primary_key(); - - if($primary_key_field === false) - return false; - - $this->db->limit(1); - $this->db->delete($this->table_name,array( $primary_key_field => $primary_key_value)); - if( $this->db->affected_rows() != 1) - return false; - else - return true; - } - - function db_file_delete($field_name, $filename) - { - if( $this->db->update($this->table_name,array($field_name => ''),array($field_name => $filename)) ) - { - return true; - } - else - { - return false; - } - } - - function field_exists($field,$table_name = null) - { - if(empty($table_name)) - { - $table_name = $this->table_name; - } - return $this->db->field_exists($field,$table_name); - } - - function get_primary_key($table_name = null) - { - if($table_name == null) - { - if(isset($this->primary_keys[$this->table_name])) - { - return $this->primary_keys[$this->table_name]; - } - - if(empty($this->primary_key)) - { - $fields = $this->get_field_types_basic_table(); - - foreach($fields as $field) - { - if($field->primary_key == 1) - { - return $field->name; - } - } - - return false; - } - else - { - return $this->primary_key; - } - } - else - { - if(isset($this->primary_keys[$table_name])) - { - return $this->primary_keys[$table_name]; - } - - $fields = $this->get_field_types($table_name); - - foreach($fields as $field) - { - if($field->primary_key == 1) - { - return $field->name; - } - } - - return false; - } - - } - - function escape_str($value) - { - return $this->db->escape_str($value); - } - -} + + */ + +// ------------------------------------------------------------------------ + +/** + * Grocery CRUD Model + * + * + * @package grocery CRUD + * @author John Skoumbourdis + * @version 1.2 + * @link http://www.grocerycrud.com/documentation + */ +class grocery_CRUD_Model extends CI_Model { + + protected $primary_key = null; + protected $table_name = null; + protected $relation = array(); + protected $relation_n_n = array(); + protected $primary_keys = array(); + + function __construct() + { + parent::__construct(); + } + + function db_table_exists($table_name = null) + { + return $this->db->table_exists($table_name); + } + + function get_list() + { + if($this->table_name === null) + return false; + + $select = "`{$this->table_name}`.*"; + + //set_relation special queries + if(!empty($this->relation)) + { + foreach($this->relation as $relation) + { + list($field_name , $related_table , $related_field_title) = $relation; + $unique_join_name = $this->_unique_join_name($field_name); + $unique_field_name = $this->_unique_field_name($field_name); + + if(strstr($related_field_title,'{')) + { + $related_field_title = str_replace(" "," ",$related_field_title); + $select .= ", CONCAT('".str_replace(array('{','}'),array("',COALESCE({$unique_join_name}.",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $unique_field_name"; + } + else + { + $select .= ", $unique_join_name.$related_field_title AS $unique_field_name"; + } + + if($this->field_exists($related_field_title)) + $select .= ", `{$this->table_name}`.$related_field_title AS '{$this->table_name}.$related_field_title'"; + } + } + + //set_relation_n_n special queries. We prefer sub queries from a simple join for the relation_n_n as it is faster and more stable on big tables. + if(!empty($this->relation_n_n)) + { + $select = $this->relation_n_n_queries($select); + } + + $this->db->select($select, false); + + $results = $this->db->get($this->table_name)->result(); + + return $results; + } + + public function get_row($table_name = null) + { + $table_name = $table_name === null ? $this->table_name : $table_name; + + return $this->db->get($table_name)->row(); + } + + public function set_primary_key($field_name, $table_name = null) + { + $table_name = $table_name === null ? $this->table_name : $table_name; + + $this->primary_keys[$table_name] = $field_name; + } + + protected function relation_n_n_queries($select) + { + $this_table_primary_key = $this->get_primary_key(); + foreach($this->relation_n_n as $relation_n_n) + { + list($field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table, + $primary_key_alias_to_selection_table, $title_field_selection_table, $priority_field_relation_table) = array_values((array)$relation_n_n); + + $primary_key_selection_table = $this->get_primary_key($selection_table); + + $field = ""; + $use_template = strpos($title_field_selection_table,'{') !== false; + $field_name_hash = $this->_unique_field_name($title_field_selection_table); + if($use_template) + { + $title_field_selection_table = str_replace(" ", " ", $title_field_selection_table); + $field .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$title_field_selection_table))."')"; + } + else + { + $field .= "$selection_table.$title_field_selection_table"; + } + + //Sorry Codeigniter but you cannot help me with the subquery! + $select .= ", (SELECT GROUP_CONCAT(DISTINCT $field) FROM $selection_table " + ."LEFT JOIN $relation_table ON $relation_table.$primary_key_alias_to_selection_table = $selection_table.$primary_key_selection_table " + ."WHERE $relation_table.$primary_key_alias_to_this_table = `{$this->table_name}`.$this_table_primary_key GROUP BY $relation_table.$primary_key_alias_to_this_table) AS $field_name"; + } + + return $select; + } + + function order_by($order_by , $direction) + { + $this->db->order_by( $order_by , $direction ); + } + + function where($key, $value = NULL, $escape = TRUE) + { + $this->db->where( $key, $value, $escape); + } + + function or_where($key, $value = NULL, $escape = TRUE) + { + $this->db->or_where( $key, $value, $escape); + } + + function having($key, $value = NULL, $escape = TRUE) + { + $this->db->having( $key, $value, $escape); + } + + function or_having($key, $value = NULL, $escape = TRUE) + { + $this->db->or_having( $key, $value, $escape); + } + + function like($field, $match = '', $side = 'both') + { + $this->db->like($field, $match, $side); + } + + function or_like($field, $match = '', $side = 'both') + { + $this->db->or_like($field, $match, $side); + } + + function limit($value, $offset = '') + { + $this->db->limit( $value , $offset ); + } + + function get_total_results() + { + //set_relation_n_n special queries. We prefer sub queries from a simple join for the relation_n_n as it is faster and more stable on big tables. + if(!empty($this->relation_n_n)) + { + $select = "{$this->table_name}.*"; + $select = $this->relation_n_n_queries($select); + + $this->db->select($select,false); + + return $this->db->get($this->table_name)->num_rows(); + } + + return $this->db->count_all_results($this->table_name); + + } + + function set_basic_table($table_name = null) + { + if( !($this->db->table_exists($table_name)) ) + return false; + + $this->table_name = $table_name; + + return true; + } + + function get_edit_values($primary_key_value) + { + $primary_key_field = $this->get_primary_key(); + $this->db->where($primary_key_field,$primary_key_value); + $result = $this->db->get($this->table_name)->row(); + return $result; + } + + function join_relation($field_name , $related_table , $related_field_title) + { + $related_primary_key = $this->get_primary_key($related_table); + + if($related_primary_key !== false) + { + $unique_name = $this->_unique_join_name($field_name); + $this->db->join( $related_table.' as '.$unique_name , "$unique_name.$related_primary_key = {$this->table_name}.$field_name",'left'); + + $this->relation[$field_name] = array($field_name , $related_table , $related_field_title); + + return true; + } + + return false; + } + + function set_relation_n_n_field($field_info) + { + $this->relation_n_n[$field_info->field_name] = $field_info; + } + + protected function _unique_join_name($field_name) + { + return 'j'.substr(md5($field_name),0,8); //This j is because is better for a string to begin with a letter and not with a number + } + + protected function _unique_field_name($field_name) + { + return 's'.substr(md5($field_name),0,8); //This s is because is better for a string to begin with a letter and not with a number + } + + function get_relation_array($field_name , $related_table , $related_field_title, $where_clause, $order_by, $limit = null, $search_like = null) + { + $relation_array = array(); + $field_name_hash = $this->_unique_field_name($field_name); + + $related_primary_key = $this->get_primary_key($related_table); + + $select = "$related_table.$related_primary_key, "; + + if(strstr($related_field_title,'{')) + { + $related_field_title = str_replace(" ", " ", $related_field_title); + $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; + } + else + { + $select .= "$related_table.$related_field_title as $field_name_hash"; + } + + $this->db->select($select,false); + if($where_clause !== null) + $this->db->where($where_clause); + + if($where_clause !== null) + $this->db->where($where_clause); + + if($limit !== null) + $this->db->limit($limit); + + if($search_like !== null) + $this->db->having("$field_name_hash LIKE '%".$this->db->escape_like_str($search_like)."%'"); + + $order_by !== null + ? $this->db->order_by($order_by) + : $this->db->order_by($field_name_hash); + + $results = $this->db->get($related_table)->result(); + + foreach($results as $row) + { + $relation_array[$row->$related_primary_key] = $row->$field_name_hash; + } + + return $relation_array; + } + + function get_ajax_relation_array($search, $field_name , $related_table , $related_field_title, $where_clause, $order_by) + { + return $this->get_relation_array($field_name , $related_table , $related_field_title, $where_clause, $order_by, 10 , $search); + } + + function get_relation_total_rows($field_name , $related_table , $related_field_title, $where_clause) + { + if($where_clause !== null) + $this->db->where($where_clause); + + return $this->db->count_all_results($related_table); + } + + function get_relation_n_n_selection_array($primary_key_value, $field_info) + { + $select = ""; + $related_field_title = $field_info->title_field_selection_table; + $use_template = strpos($related_field_title,'{') !== false;; + $field_name_hash = $this->_unique_field_name($related_field_title); + if($use_template) + { + $related_field_title = str_replace(" ", " ", $related_field_title); + $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; + } + else + { + $select .= "$related_field_title as $field_name_hash"; + } + $this->db->select('*, '.$select,false); + + $selection_primary_key = $this->get_primary_key($field_info->selection_table); + + if(empty($field_info->priority_field_relation_table)) + { + if(!$use_template){ + $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); + } + } + else + { + $this->db->order_by("{$field_info->relation_table}.{$field_info->priority_field_relation_table}"); + } + $this->db->where($field_info->primary_key_alias_to_this_table, $primary_key_value); + $this->db->join( + $field_info->selection_table, + "{$field_info->relation_table}.{$field_info->primary_key_alias_to_selection_table} = {$field_info->selection_table}.{$selection_primary_key}" + ); + $results = $this->db->get($field_info->relation_table)->result(); + + $results_array = array(); + foreach($results as $row) + { + $results_array[$row->{$field_info->primary_key_alias_to_selection_table}] = $row->{$field_name_hash}; + } + + return $results_array; + } + + function get_relation_n_n_unselected_array($field_info, $selected_values) + { + $use_where_clause = !empty($field_info->where_clause); + + $select = ""; + $related_field_title = $field_info->title_field_selection_table; + $use_template = strpos($related_field_title,'{') !== false; + $field_name_hash = $this->_unique_field_name($related_field_title); + + if($use_template) + { + $related_field_title = str_replace(" ", " ", $related_field_title); + $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; + } + else + { + $select .= "$related_field_title as $field_name_hash"; + } + $this->db->select('*, '.$select,false); + + if($use_where_clause){ + $this->db->where($field_info->where_clause); + } + + $selection_primary_key = $this->get_primary_key($field_info->selection_table); + if(!$use_template) + $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); + $results = $this->db->get($field_info->selection_table)->result(); + + $results_array = array(); + foreach($results as $row) + { + if(!isset($selected_values[$row->$selection_primary_key])) + $results_array[$row->$selection_primary_key] = $row->{$field_name_hash}; + } + + return $results_array; + } + + function db_relation_n_n_update($field_info, $post_data ,$main_primary_key) + { + $this->db->where($field_info->primary_key_alias_to_this_table, $main_primary_key); + if(!empty($post_data)) + $this->db->where_not_in($field_info->primary_key_alias_to_selection_table , $post_data); + $this->db->delete($field_info->relation_table); + + $counter = 0; + if(!empty($post_data)) + { + foreach($post_data as $primary_key_value) + { + $where_array = array( + $field_info->primary_key_alias_to_this_table => $main_primary_key, + $field_info->primary_key_alias_to_selection_table => $primary_key_value, + ); + + $this->db->where($where_array); + $count = $this->db->from($field_info->relation_table)->count_all_results(); + + if($count == 0) + { + if(!empty($field_info->priority_field_relation_table)) + $where_array[$field_info->priority_field_relation_table] = $counter; + + $this->db->insert($field_info->relation_table, $where_array); + + }elseif($count >= 1 && !empty($field_info->priority_field_relation_table)) + { + $this->db->update( $field_info->relation_table, array($field_info->priority_field_relation_table => $counter) , $where_array); + } + + $counter++; + } + } + } + + function db_relation_n_n_delete($field_info, $main_primary_key) + { + $this->db->where($field_info->primary_key_alias_to_this_table, $main_primary_key); + $this->db->delete($field_info->relation_table); + } + + function get_field_types_basic_table() + { + $db_field_types = array(); + foreach($this->db->query("SHOW COLUMNS FROM `{$this->table_name}`")->result() as $db_field_type) + { + $type = explode("(",$db_field_type->Type); + $db_type = $type[0]; + + if(isset($type[1])) + { + if(substr($type[1],-1) == ')') + { + $length = substr($type[1],0,-1); + } + else + { + list($length) = explode(" ",$type[1]); + $length = substr($length,0,-1); + } + } + else + { + $length = ''; + } + $db_field_types[$db_field_type->Field]['db_max_length'] = $length; + $db_field_types[$db_field_type->Field]['db_type'] = $db_type; + $db_field_types[$db_field_type->Field]['db_null'] = $db_field_type->Null == 'YES' ? true : false; + $db_field_types[$db_field_type->Field]['db_extra'] = $db_field_type->Extra; + } + + $results = $this->db->field_data($this->table_name); + foreach($results as $num => $row) + { + $row = (array)$row; + $results[$num] = (object)( array_merge($row, $db_field_types[$row['name']]) ); + } + + return $results; + } + + function get_field_types($table_name) + { + $results = $this->db->field_data($table_name); + + return $results; + } + + function db_update($post_array, $primary_key_value) + { + $primary_key_field = $this->get_primary_key(); + return $this->db->update($this->table_name,$post_array, array( $primary_key_field => $primary_key_value)); + } + + function db_insert($post_array) + { + $insert = $this->db->insert($this->table_name,$post_array); + if($insert) + { + return $this->db->insert_id(); + } + return false; + } + + function db_delete($primary_key_value) + { + $primary_key_field = $this->get_primary_key(); + + if($primary_key_field === false) + return false; + + $this->db->limit(1); + $this->db->delete($this->table_name,array( $primary_key_field => $primary_key_value)); + if( $this->db->affected_rows() != 1) + return false; + else + return true; + } + + function db_file_delete($field_name, $filename) + { + if( $this->db->update($this->table_name,array($field_name => ''),array($field_name => $filename)) ) + { + return true; + } + else + { + return false; + } + } + + function field_exists($field,$table_name = null) + { + if(empty($table_name)) + { + $table_name = $this->table_name; + } + return $this->db->field_exists($field,$table_name); + } + + function get_primary_key($table_name = null) + { + if($table_name == null) + { + if(isset($this->primary_keys[$this->table_name])) + { + return $this->primary_keys[$this->table_name]; + } + + if(empty($this->primary_key)) + { + $fields = $this->get_field_types_basic_table(); + + foreach($fields as $field) + { + if($field->primary_key == 1) + { + return $field->name; + } + } + + return false; + } + else + { + return $this->primary_key; + } + } + else + { + if(isset($this->primary_keys[$table_name])) + { + return $this->primary_keys[$table_name]; + } + + $fields = $this->get_field_types($table_name); + + foreach($fields as $field) + { + if($field->primary_key == 1) + { + return $field->name; + } + } + + return false; + } + + } + + function escape_str($value) + { + return $this->db->escape_str($value); + } + +} diff --git a/application/models/index.html b/application/models/index.html index 065d2da..04e928c 100755 --- a/application/models/index.html +++ b/application/models/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/models/ion_auth_model.php b/application/models/ion_auth_model.php index 5574d91..c5fe639 100755 --- a/application/models/ion_auth_model.php +++ b/application/models/ion_auth_model.php @@ -1,2166 +1,2166 @@ -load->database(); - $this->load->config('ion_auth', TRUE); - $this->load->helper('cookie'); - $this->load->helper('date'); - $this->lang->load('ion_auth'); - - //initialize db tables data - $this->tables = $this->config->item('tables', 'ion_auth'); - - //initialize data - $this->identity_column = $this->config->item('identity', 'ion_auth'); - $this->store_salt = $this->config->item('store_salt', 'ion_auth'); - $this->salt_length = $this->config->item('salt_length', 'ion_auth'); - $this->join = $this->config->item('join', 'ion_auth'); - - - //initialize hash method options (Bcrypt) - $this->hash_method = $this->config->item('hash_method', 'ion_auth'); - $this->default_rounds = $this->config->item('default_rounds', 'ion_auth'); - $this->random_rounds = $this->config->item('random_rounds', 'ion_auth'); - $this->min_rounds = $this->config->item('min_rounds', 'ion_auth'); - $this->max_rounds = $this->config->item('max_rounds', 'ion_auth'); - - - //initialize messages and error - $this->messages = array(); - $this->errors = array(); - $delimiters_source = $this->config->item('delimiters_source', 'ion_auth'); - - //load the error delimeters either from the config file or use what's been supplied to form validation - if ($delimiters_source === 'form_validation') - { - //load in delimiters from form_validation - //to keep this simple we'll load the value using reflection since these properties are protected - $this->load->library('form_validation'); - $form_validation_class = new ReflectionClass("CI_Form_validation"); - - $error_prefix = $form_validation_class->getProperty("_error_prefix"); - $error_prefix->setAccessible(TRUE); - $this->error_start_delimiter = $error_prefix->getValue($this->form_validation); - $this->message_start_delimiter = $this->error_start_delimiter; - - $error_suffix = $form_validation_class->getProperty("_error_suffix"); - $error_suffix->setAccessible(TRUE); - $this->error_end_delimiter = $error_suffix->getValue($this->form_validation); - $this->message_end_delimiter = $this->error_end_delimiter; - } - else - { - //use delimiters from config - $this->message_start_delimiter = $this->config->item('message_start_delimiter', 'ion_auth'); - $this->message_end_delimiter = $this->config->item('message_end_delimiter', 'ion_auth'); - $this->error_start_delimiter = $this->config->item('error_start_delimiter', 'ion_auth'); - $this->error_end_delimiter = $this->config->item('error_end_delimiter', 'ion_auth'); - } - - - //initialize our hooks object - $this->_ion_hooks = new stdClass; - - //load the bcrypt class if needed - if ($this->hash_method == 'bcrypt') { - if ($this->random_rounds) - { - $rand = rand($this->min_rounds,$this->max_rounds); - $params = array('rounds' => $rand); - } - else - { - $params = array('rounds' => $this->default_rounds); - } - - $params['salt_prefix'] = $this->config->item('salt_prefix', 'ion_auth'); - $this->load->library('bcrypt',$params); - } - - $this->trigger_events('model_constructor'); - } - - /** - * Misc functions - * - * Hash password : Hashes the password to be stored in the database. - * Hash password db : This function takes a password and validates it - * against an entry in the users table. - * Salt : Generates a random salt value. - * - * @author Mathew - */ - - /** - * Hashes the password to be stored in the database. - * - * @return void - * @author Mathew - **/ - public function hash_password($password, $salt=false, $use_sha1_override=FALSE) - { - if (empty($password)) - { - return FALSE; - } - - //bcrypt - if ($use_sha1_override === FALSE && $this->hash_method == 'bcrypt') - { - return $this->bcrypt->hash($password); - } - - - if ($this->store_salt && $salt) - { - return sha1($password . $salt); - } - else - { - $salt = $this->salt(); - return $salt . substr(sha1($salt . $password), 0, -$this->salt_length); - } - } - - /** - * This function takes a password and validates it - * against an entry in the users table. - * - * @return void - * @author Mathew - **/ - public function hash_password_db($id, $password, $use_sha1_override=FALSE) - { - if (empty($id) || empty($password)) - { - return FALSE; - } - - $this->trigger_events('extra_where'); - - $query = $this->db->select('password, salt') - ->where('id', $id) - ->limit(1) - ->get($this->tables['users']); - - $hash_password_db = $query->row(); - - if ($query->num_rows() !== 1) - { - return FALSE; - } - - // bcrypt - if ($use_sha1_override === FALSE && $this->hash_method == 'bcrypt') - { - if ($this->bcrypt->verify($password,$hash_password_db->password)) - { - return TRUE; - } - - return FALSE; - } - - // sha1 - if ($this->store_salt) - { - $db_password = sha1($password . $hash_password_db->salt); - } - else - { - $salt = substr($hash_password_db->password, 0, $this->salt_length); - - $db_password = $salt . substr(sha1($salt . $password), 0, -$this->salt_length); - } - - if($db_password == $hash_password_db->password) - { - return TRUE; - } - else - { - return FALSE; - } - } - - /** - * Generates a random salt value for forgotten passwords or any other keys. Uses SHA1. - * - * @return void - * @author Mathew - **/ - public function hash_code($password) - { - return $this->hash_password($password, FALSE, TRUE); - } - - /** - * Generates a random salt value. - * - * Salt generation code taken from https://github.com/ircmaxell/password_compat/blob/master/lib/password.php - * - * @return void - * @author Anthony Ferrera - **/ - public function salt() - { - - $raw_salt_len = 16; - - $buffer = ''; - $buffer_valid = false; - - if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) { - $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM); - if ($buffer) { - $buffer_valid = true; - } - } - - if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) { - $buffer = openssl_random_pseudo_bytes($raw_salt_len); - if ($buffer) { - $buffer_valid = true; - } - } - - if (!$buffer_valid && @is_readable('/dev/urandom')) { - $f = fopen('/dev/urandom', 'r'); - $read = strlen($buffer); - while ($read < $raw_salt_len) { - $buffer .= fread($f, $raw_salt_len - $read); - $read = strlen($buffer); - } - fclose($f); - if ($read >= $raw_salt_len) { - $buffer_valid = true; - } - } - - if (!$buffer_valid || strlen($buffer) < $raw_salt_len) { - $bl = strlen($buffer); - for ($i = 0; $i < $raw_salt_len; $i++) { - if ($i < $bl) { - $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255)); - } else { - $buffer .= chr(mt_rand(0, 255)); - } - } - } - - $salt = $buffer; - - // encode string with the Base64 variant used by crypt - $base64_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - $bcrypt64_digits = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - $base64_string = base64_encode($salt); - $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits); - - $salt = substr($salt, 0, $this->salt_length); - - - return $salt; - - } - - /** - * Activation functions - * - * Activate : Validates and removes activation code. - * Deactivae : Updates a users row with an activation code. - * - * @author Mathew - */ - - /** - * activate - * - * @return void - * @author Mathew - **/ - public function activate($id, $code = false) - { - $this->trigger_events('pre_activate'); - - if ($code !== FALSE) - { - $query = $this->db->select($this->identity_column) - ->where('activation_code', $code) - ->where('id', $id) - ->limit(1) - ->get($this->tables['users']); - - $result = $query->row(); - - if ($query->num_rows() !== 1) - { - $this->trigger_events(array('post_activate', 'post_activate_unsuccessful')); - $this->set_error('activate_unsuccessful'); - return FALSE; - } - - $data = array( - 'activation_code' => NULL, - 'active' => 1 - ); - - $this->trigger_events('extra_where'); - $this->db->update($this->tables['users'], $data, array('id' => $id)); - } - else - { - $data = array( - 'activation_code' => NULL, - 'active' => 1 - ); - - - $this->trigger_events('extra_where'); - $this->db->update($this->tables['users'], $data, array('id' => $id)); - } - - - $return = $this->db->affected_rows() == 1; - if ($return) - { - $this->trigger_events(array('post_activate', 'post_activate_successful')); - $this->set_message('activate_successful'); - } - else - { - $this->trigger_events(array('post_activate', 'post_activate_unsuccessful')); - $this->set_error('activate_unsuccessful'); - } - - - return $return; - } - - - /** - * Deactivate - * - * @return void - * @author Mathew - **/ - public function deactivate($id = NULL) - { - $this->trigger_events('deactivate'); - - if (!isset($id)) - { - $this->set_error('deactivate_unsuccessful'); - return FALSE; - } - - $activation_code = sha1(md5(microtime())); - $this->activation_code = $activation_code; - - $data = array( - 'activation_code' => $activation_code, - 'active' => 0 - ); - - $this->trigger_events('extra_where'); - $this->db->update($this->tables['users'], $data, array('id' => $id)); - - $return = $this->db->affected_rows() == 1; - if ($return) - $this->set_message('deactivate_successful'); - else - $this->set_error('deactivate_unsuccessful'); - - return $return; - } - - public function clear_forgotten_password_code($code) { - - if (empty($code)) - { - return FALSE; - } - - $this->db->where('forgotten_password_code', $code); - - if ($this->db->count_all_results($this->tables['users']) > 0) - { - $data = array( - 'forgotten_password_code' => NULL, - 'forgotten_password_time' => NULL - ); - - $this->db->update($this->tables['users'], $data, array('forgotten_password_code' => $code)); - - return TRUE; - } - - return FALSE; - } - - /** - * reset password - * - * @return bool - * @author Mathew - **/ - public function reset_password($identity, $new) { - $this->trigger_events('pre_change_password'); - - if (!$this->identity_check($identity)) { - $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); - return FALSE; - } - - $this->trigger_events('extra_where'); - - $query = $this->db->select('id, password, salt') - ->where($this->identity_column, $identity) - ->limit(1) - ->get($this->tables['users']); - - if ($query->num_rows() !== 1) - { - $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); - $this->set_error('password_change_unsuccessful'); - return FALSE; - } - - $result = $query->row(); - - $new = $this->hash_password($new, $result->salt); - - //store the new password and reset the remember code so all remembered instances have to re-login - //also clear the forgotten password code - $data = array( - 'password' => $new, - 'remember_code' => NULL, - 'forgotten_password_code' => NULL, - 'forgotten_password_time' => NULL, - ); - - $this->trigger_events('extra_where'); - $this->db->update($this->tables['users'], $data, array($this->identity_column => $identity)); - - $return = $this->db->affected_rows() == 1; - if ($return) - { - $this->trigger_events(array('post_change_password', 'post_change_password_successful')); - $this->set_message('password_change_successful'); - } - else - { - $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); - $this->set_error('password_change_unsuccessful'); - } - - return $return; - } - - /** - * change password - * - * @return bool - * @author Mathew - **/ - public function change_password($identity, $old, $new) - { - $this->trigger_events('pre_change_password'); - - $this->trigger_events('extra_where'); - - $query = $this->db->select('id, password, salt') - ->where($this->identity_column, $identity) - ->limit(1) - ->get($this->tables['users']); - - if ($query->num_rows() !== 1) - { - $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); - $this->set_error('password_change_unsuccessful'); - return FALSE; - } - - $user = $query->row(); - - $old_password_matches = $this->hash_password_db($user->id, $old); - - if ($old_password_matches === TRUE) - { - //store the new password and reset the remember code so all remembered instances have to re-login - $hashed_new_password = $this->hash_password($new, $user->salt); - $data = array( - 'password' => $hashed_new_password, - 'remember_code' => NULL, - ); - - $this->trigger_events('extra_where'); - - $successfully_changed_password_in_db = $this->db->update($this->tables['users'], $data, array($this->identity_column => $identity)); - if ($successfully_changed_password_in_db) - { - $this->trigger_events(array('post_change_password', 'post_change_password_successful')); - $this->set_message('password_change_successful'); - } - else - { - $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); - $this->set_error('password_change_unsuccessful'); - } - - return $successfully_changed_password_in_db; - } - - $this->set_error('password_change_unsuccessful'); - return FALSE; - } - - /** - * Checks username - * - * @return bool - * @author Mathew - **/ - public function username_check($username = '') - { - $this->trigger_events('username_check'); - - if (empty($username)) - { - return FALSE; - } - - $this->trigger_events('extra_where'); - - return $this->db->where('username', $username) - ->count_all_results($this->tables['users']) > 0; - } - - /** - * Checks email - * - * @return bool - * @author Mathew - **/ - public function email_check($email = '') - { - $this->trigger_events('email_check'); - - if (empty($email)) - { - return FALSE; - } - - $this->trigger_events('extra_where'); - - return $this->db->where('email', $email) - ->count_all_results($this->tables['users']) > 0; - } - - /** - * Identity check - * - * @return bool - * @author Mathew - **/ - public function identity_check($identity = '') - { - $this->trigger_events('identity_check'); - - if (empty($identity)) - { - return FALSE; - } - - return $this->db->where($this->identity_column, $identity) - ->count_all_results($this->tables['users']) > 0; - } - - /** - * Insert a forgotten password key. - * - * @return bool - * @author Mathew - * @updated Ryan - * @updated 52aa456eef8b60ad6754b31fbdcc77bb - **/ - public function forgotten_password($identity) - { - if (empty($identity)) - { - $this->trigger_events(array('post_forgotten_password', 'post_forgotten_password_unsuccessful')); - return FALSE; - } - - //All some more randomness - $activation_code_part = ""; - if(function_exists("openssl_random_pseudo_bytes")) { - $activation_code_part = openssl_random_pseudo_bytes(128); - } - - for($i=0;$i<1024;$i++) { - $activation_code_part = sha1($activation_code_part . mt_rand() . microtime()); - } - - $key = $this->hash_code($activation_code_part.$identity); - - // If enable query strings is set, then we need to replace any unsafe characters so that the code can still work - if ($key != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) - { - // preg_quote() in PHP 5.3 escapes -, so the str_replace() and addition of - to preg_quote() is to maintain backwards - // compatibility as many are unaware of how characters in the permitted_uri_chars will be parsed as a regex pattern - if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $key)) - { - $key = preg_replace("/[^".$this->config->item('permitted_uri_chars')."]+/i", "-", $key); - } - } - - $this->forgotten_password_code = $key; - - $this->trigger_events('extra_where'); - - $update = array( - 'forgotten_password_code' => $key, - 'forgotten_password_time' => time() - ); - - $this->db->update($this->tables['users'], $update, array($this->identity_column => $identity)); - - $return = $this->db->affected_rows() == 1; - - if ($return) - $this->trigger_events(array('post_forgotten_password', 'post_forgotten_password_successful')); - else - $this->trigger_events(array('post_forgotten_password', 'post_forgotten_password_unsuccessful')); - - return $return; - } - - /** - * Forgotten Password Complete - * - * @return string - * @author Mathew - **/ - public function forgotten_password_complete($code, $salt=FALSE) - { - $this->trigger_events('pre_forgotten_password_complete'); - - if (empty($code)) - { - $this->trigger_events(array('post_forgotten_password_complete', 'post_forgotten_password_complete_unsuccessful')); - return FALSE; - } - - $profile = $this->where('forgotten_password_code', $code)->users()->row(); //pass the code to profile - - if ($profile) { - - if ($this->config->item('forgot_password_expiration', 'ion_auth') > 0) { - //Make sure it isn't expired - $expiration = $this->config->item('forgot_password_expiration', 'ion_auth'); - if (time() - $profile->forgotten_password_time > $expiration) { - //it has expired - $this->set_error('forgot_password_expired'); - $this->trigger_events(array('post_forgotten_password_complete', 'post_forgotten_password_complete_unsuccessful')); - return FALSE; - } - } - - $password = $this->salt(); - - $data = array( - 'password' => $this->hash_password($password, $salt), - 'forgotten_password_code' => NULL, - 'active' => 1, - ); - - $this->db->update($this->tables['users'], $data, array('forgotten_password_code' => $code)); - - $this->trigger_events(array('post_forgotten_password_complete', 'post_forgotten_password_complete_successful')); - return $password; - } - - $this->trigger_events(array('post_forgotten_password_complete', 'post_forgotten_password_complete_unsuccessful')); - return FALSE; - } - - /** - * register - * - * @return bool - * @author Mathew - **/ - public function register($username, $password, $email, $additional_data = array(), $groups = array()) - { - $this->trigger_events('pre_register'); - - $manual_activation = $this->config->item('manual_activation', 'ion_auth'); - - if ($this->identity_column == 'email' && $this->email_check($email)) - { - $this->set_error('account_creation_duplicate_email'); - return FALSE; - } - elseif ($this->identity_column == 'username' && $this->username_check($username)) - { - $this->set_error('account_creation_duplicate_username'); - return FALSE; - } - - // If username is taken, use username1 or username2, etc. - if ($this->identity_column != 'username') - { - $original_username = $username; - for($i = 0; $this->username_check($username); $i++) - { - if($i > 0) - { - $username = $original_username . $i; - } - } - } - - // IP Address - $ip_address = $this->_prepare_ip($this->input->ip_address()); - $salt = $this->store_salt ? $this->salt() : FALSE; - $password = $this->hash_password($password, $salt); - - // Users table. - $data = array( - 'username' => $username, - 'password' => $password, - 'email' => $email, - 'ip_address' => $ip_address, - 'created_on' => time(), - 'last_login' => time(), - 'active' => ($manual_activation === false ? 1 : 0) - ); - - if ($this->store_salt) - { - $data['salt'] = $salt; - } - - //filter out any data passed that doesnt have a matching column in the users table - //and merge the set user data and the additional data - $user_data = array_merge($this->_filter_data($this->tables['users'], $additional_data), $data); - - $this->trigger_events('extra_set'); - - $this->db->insert($this->tables['users'], $user_data); - - $id = $this->db->insert_id(); - - if (!empty($groups)) - { - //add to groups - foreach ($groups as $group) - { - $this->add_to_group($group, $id); - } - } - - //add to default group if not already set - $default_group = $this->where('name', $this->config->item('default_group', 'ion_auth'))->group()->row(); - if ((isset($default_group->id) && empty($groups)) || (!empty($groups) && !in_array($default_group->id, $groups))) - { - $this->add_to_group($default_group->id, $id); - } - - $this->trigger_events('post_register'); - - return (isset($id)) ? $id : FALSE; - } - - /** - * login - * - * @return bool - * @author Mathew - **/ - public function login($identity, $password, $remember=FALSE) - { - $this->trigger_events('pre_login'); - - if (empty($identity) || empty($password)) - { - $this->set_error('login_unsuccessful'); - return FALSE; - } - - $this->trigger_events('extra_where'); - - $query = $this->db->select($this->identity_column . ', username, email, id, password, active, last_login') - ->where($this->identity_column, $identity) - ->limit(1) - ->get($this->tables['users']); - - if($this->is_time_locked_out($identity)) - { - //Hash something anyway, just to take up time - $this->hash_password($password); - - $this->trigger_events('post_login_unsuccessful'); - $this->set_error('login_timeout'); - - return FALSE; - } - - if ($query->num_rows() === 1) - { - $user = $query->row(); - - $password = $this->hash_password_db($user->id, $password); - - if ($password === TRUE) - { - if ($user->active == 0) - { - $this->trigger_events('post_login_unsuccessful'); - $this->set_error('login_unsuccessful_not_active'); - - return FALSE; - } - - $this->set_session($user); - - $this->update_last_login($user->id); - - $this->clear_login_attempts($identity); - - if ($remember && $this->config->item('remember_users', 'ion_auth')) - { - $this->remember_user($user->id); - } - - $this->trigger_events(array('post_login', 'post_login_successful')); - $this->set_message('login_successful'); - - return TRUE; - } - } - - //Hash something anyway, just to take up time - $this->hash_password($password); - - $this->increase_login_attempts($identity); - - $this->trigger_events('post_login_unsuccessful'); - $this->set_error('login_unsuccessful'); - - return FALSE; - } - - /** - * is_max_login_attempts_exceeded - * Based on code from Tank Auth, by Ilya Konyukhov (https://github.com/ilkon/Tank-Auth) - * - * @param string $identity - * @return boolean - **/ - public function is_max_login_attempts_exceeded($identity) { - if ($this->config->item('track_login_attempts', 'ion_auth')) { - $max_attempts = $this->config->item('maximum_login_attempts', 'ion_auth'); - if ($max_attempts > 0) { - $attempts = $this->get_attempts_num($identity); - return $attempts >= $max_attempts; - } - } - return FALSE; - } - - /** - * Get number of attempts to login occured from given IP-address or identity - * Based on code from Tank Auth, by Ilya Konyukhov (https://github.com/ilkon/Tank-Auth) - * - * @param string $identity - * @return int - */ - function get_attempts_num($identity) - { - if ($this->config->item('track_login_attempts', 'ion_auth')) { - $ip_address = $this->_prepare_ip($this->input->ip_address()); - $this->db->select('1', FALSE); - if ($this->config->item('track_login_ip_address', 'ion_auth')) $this->db->where('ip_address', $ip_address); - else if (strlen($identity) > 0) $this->db->or_where('login', $identity); - $qres = $this->db->get($this->tables['login_attempts']); - return $qres->num_rows(); - } - return 0; - } - - /** - * Get a boolean to determine if an account should be locked out due to - * exceeded login attempts within a given period - * - * @return boolean - */ - public function is_time_locked_out($identity) { - - return $this->is_max_login_attempts_exceeded($identity) && $this->get_last_attempt_time($identity) > time() - $this->config->item('lockout_time', 'ion_auth'); - } - - /** - * Get the time of the last time a login attempt occured from given IP-address or identity - * - * @param string $identity - * @return int - */ - public function get_last_attempt_time($identity) { - if ($this->config->item('track_login_attempts', 'ion_auth')) { - $ip_address = $this->_prepare_ip($this->input->ip_address()); - - $this->db->select_max('time'); - if ($this->config->item('track_login_ip_address', 'ion_auth')) $this->db->where('ip_address', $ip_address); - else if (strlen($identity) > 0) $this->db->or_where('login', $identity); - $qres = $this->db->get($this->tables['login_attempts'], 1); - - if($qres->num_rows() > 0) { - return $qres->row()->time; - } - } - - return 0; - } - - /** - * increase_login_attempts - * Based on code from Tank Auth, by Ilya Konyukhov (https://github.com/ilkon/Tank-Auth) - * - * @param string $identity - **/ - public function increase_login_attempts($identity) { - if ($this->config->item('track_login_attempts', 'ion_auth')) { - $ip_address = $this->_prepare_ip($this->input->ip_address()); - return $this->db->insert($this->tables['login_attempts'], array('ip_address' => $ip_address, 'login' => $identity, 'time' => time())); - } - return FALSE; - } - - /** - * clear_login_attempts - * Based on code from Tank Auth, by Ilya Konyukhov (https://github.com/ilkon/Tank-Auth) - * - * @param string $identity - **/ - public function clear_login_attempts($identity, $expire_period = 86400) { - if ($this->config->item('track_login_attempts', 'ion_auth')) { - $ip_address = $this->_prepare_ip($this->input->ip_address()); - - $this->db->where(array('ip_address' => $ip_address, 'login' => $identity)); - // Purge obsolete login attempts - $this->db->or_where('time <', time() - $expire_period, FALSE); - - return $this->db->delete($this->tables['login_attempts']); - } - return FALSE; - } - - public function limit($limit) - { - $this->trigger_events('limit'); - $this->_ion_limit = $limit; - - return $this; - } - - public function offset($offset) - { - $this->trigger_events('offset'); - $this->_ion_offset = $offset; - - return $this; - } - - public function where($where, $value = NULL) - { - $this->trigger_events('where'); - - if (!is_array($where)) - { - $where = array($where => $value); - } - - array_push($this->_ion_where, $where); - - return $this; - } - - public function like($like, $value = NULL, $position = 'both') - { - $this->trigger_events('like'); - - if (!is_array($like)) - { - $like = array($like => array( - 'value' => $value, - 'position' => $position, - )); - } - - array_push($this->_ion_like, $like); - - return $this; - } - - public function select($select) - { - $this->trigger_events('select'); - - $this->_ion_select[] = $select; - - return $this; - } - - public function order_by($by, $order='desc') - { - $this->trigger_events('order_by'); - - $this->_ion_order_by = $by; - $this->_ion_order = $order; - - return $this; - } - - public function row() - { - $this->trigger_events('row'); - - $row = $this->response->row(); - $this->response->free_result(); - - return $row; - } - - public function row_array() - { - $this->trigger_events(array('row', 'row_array')); - - $row = $this->response->row_array(); - $this->response->free_result(); - - return $row; - } - - public function result() - { - $this->trigger_events('result'); - - $result = $this->response->result(); - $this->response->free_result(); - - return $result; - } - - public function result_array() - { - $this->trigger_events(array('result', 'result_array')); - - $result = $this->response->result_array(); - $this->response->free_result(); - - return $result; - } - - public function num_rows() - { - $this->trigger_events(array('num_rows')); - - $result = $this->response->num_rows(); - $this->response->free_result(); - - return $result; - } - - /** - * users - * - * @return object Users - * @author Ben Edmunds - **/ - public function users($groups = NULL) - { - $this->trigger_events('users'); - - if (isset($this->_ion_select) && !empty($this->_ion_select)) - { - foreach ($this->_ion_select as $select) - { - $this->db->select($select); - } - - $this->_ion_select = array(); - } - else - { - //default selects - $this->db->select(array( - $this->tables['users'].'.*', - $this->tables['users'].'.id as id', - $this->tables['users'].'.id as user_id' - )); - } - - //filter by group id(s) if passed - if (isset($groups)) - { - //build an array if only one group was passed - if (is_numeric($groups)) - { - $groups = Array($groups); - } - - //join and then run a where_in against the group ids - if (isset($groups) && !empty($groups)) - { - $this->db->distinct(); - $this->db->join( - $this->tables['users_groups'], - $this->tables['users_groups'].'.'.$this->join['users'].'='.$this->tables['users'].'.id', - 'inner' - ); - - $this->db->where_in($this->tables['users_groups'].'.'.$this->join['groups'], $groups); - } - } - - $this->trigger_events('extra_where'); - - //run each where that was passed - if (isset($this->_ion_where) && !empty($this->_ion_where)) - { - foreach ($this->_ion_where as $where) - { - $this->db->where($where); - } - - $this->_ion_where = array(); - } - - if (isset($this->_ion_like) && !empty($this->_ion_like)) - { - foreach ($this->_ion_like as $like) - { - $this->db->or_like($like); - } - - $this->_ion_like = array(); - } - - if (isset($this->_ion_limit) && isset($this->_ion_offset)) - { - $this->db->limit($this->_ion_limit, $this->_ion_offset); - - $this->_ion_limit = NULL; - $this->_ion_offset = NULL; - } - else if (isset($this->_ion_limit)) - { - $this->db->limit($this->_ion_limit); - - $this->_ion_limit = NULL; - } - - //set the order - if (isset($this->_ion_order_by) && isset($this->_ion_order)) - { - $this->db->order_by($this->_ion_order_by, $this->_ion_order); - - $this->_ion_order = NULL; - $this->_ion_order_by = NULL; - } - - $this->response = $this->db->get($this->tables['users']); - - return $this; - } - - /** - * user - * - * @return object - * @author Ben Edmunds - **/ - public function user($id = NULL) - { - $this->trigger_events('user'); - - //if no id was passed use the current users id - $id || $id = $this->session->userdata('user_id'); - - $this->limit(1); - $this->where($this->tables['users'].'.id', $id); - - $this->users(); - - return $this; - } - - /** - * get_users_groups - * - * @return array - * @author Ben Edmunds - **/ - public function get_users_groups($id=FALSE) - { - $this->trigger_events('get_users_group'); - - //if no id was passed use the current users id - $id || $id = $this->session->userdata('user_id'); - - return $this->db->select($this->tables['users_groups'].'.'.$this->join['groups'].' as id, '.$this->tables['groups'].'.name, '.$this->tables['groups'].'.description') - ->where($this->tables['users_groups'].'.'.$this->join['users'], $id) - ->join($this->tables['groups'], $this->tables['users_groups'].'.'.$this->join['groups'].'='.$this->tables['groups'].'.id') - ->get($this->tables['users_groups']); - } - - /** - * add_to_group - * - * @return bool - * @author Ben Edmunds - **/ - public function add_to_group($group_id, $user_id=false) - { - $this->trigger_events('add_to_group'); - - //if no id was passed use the current users id - $user_id || $user_id = $this->session->userdata('user_id'); - - //check if unique - num_rows() > 0 means row found - if ($this->db->where(array( $this->join['groups'] => (int)$group_id, $this->join['users'] => (int)$user_id))->get($this->tables['users_groups'])->num_rows()) return false; - - if ($return = $this->db->insert($this->tables['users_groups'], array( $this->join['groups'] => (int)$group_id, $this->join['users'] => (int)$user_id))) - { - if (isset($this->_cache_groups[$group_id])) { - $group_name = $this->_cache_groups[$group_id]; - } - else { - $group = $this->group($group_id)->result(); - $group_name = $group[0]->name; - $this->_cache_groups[$group_id] = $group_name; - } - $this->_cache_user_in_group[$user_id][$group_id] = $group_name; - } - return $return; - } - - /** - * remove_from_group - * - * @return bool - * @author Ben Edmunds - **/ - public function remove_from_group($group_ids=false, $user_id=false) - { - $this->trigger_events('remove_from_group'); - - // user id is required - if(empty($user_id)) - { - return FALSE; - } - - // if group id(s) are passed remove user from the group(s) - if( ! empty($group_ids)) - { - if(!is_array($group_ids)) - { - $group_ids = array($group_ids); - } - - foreach($group_ids as $group_id) - { - $this->db->delete($this->tables['users_groups'], array($this->join['groups'] => (int)$group_id, $this->join['users'] => (int)$user_id)); - if (isset($this->_cache_user_in_group[$user_id]) && isset($this->_cache_user_in_group[$user_id][$group_id])) - { - unset($this->_cache_user_in_group[$user_id][$group_id]); - } - } - - $return = TRUE; - } - // otherwise remove user from all groups - else - { - if ($return = $this->db->delete($this->tables['users_groups'], array($this->join['users'] => (int)$user_id))) { - $this->_cache_user_in_group[$user_id] = array(); - } - } - return $return; - } - - /** - * groups - * - * @return object - * @author Ben Edmunds - **/ - public function groups() - { - $this->trigger_events('groups'); - - //run each where that was passed - if (isset($this->_ion_where) && !empty($this->_ion_where)) - { - foreach ($this->_ion_where as $where) - { - $this->db->where($where); - } - $this->_ion_where = array(); - } - - if (isset($this->_ion_limit) && isset($this->_ion_offset)) - { - $this->db->limit($this->_ion_limit, $this->_ion_offset); - - $this->_ion_limit = NULL; - $this->_ion_offset = NULL; - } - else if (isset($this->_ion_limit)) - { - $this->db->limit($this->_ion_limit); - - $this->_ion_limit = NULL; - } - - //set the order - if (isset($this->_ion_order_by) && isset($this->_ion_order)) - { - $this->db->order_by($this->_ion_order_by, $this->_ion_order); - } - - $this->response = $this->db->get($this->tables['groups']); - - return $this; - } - - /** - * group - * - * @return object - * @author Ben Edmunds - **/ - public function group($id = NULL) - { - $this->trigger_events('group'); - - if (isset($id)) - { - $this->where($this->tables['groups'].'.id', $id); - } - - $this->limit(1); - - return $this->groups(); - } - - /** - * update - * - * @return bool - * @author Phil Sturgeon - **/ - public function update($id, array $data) - { - $this->trigger_events('pre_update_user'); - - $user = $this->user($id)->row(); - - $this->db->trans_begin(); - - if (array_key_exists($this->identity_column, $data) && $this->identity_check($data[$this->identity_column]) && $user->{$this->identity_column} !== $data[$this->identity_column]) - { - $this->db->trans_rollback(); - $this->set_error('account_creation_duplicate_'.$this->identity_column); - - $this->trigger_events(array('post_update_user', 'post_update_user_unsuccessful')); - $this->set_error('update_unsuccessful'); - - return FALSE; - } - - // Filter the data passed - $data = $this->_filter_data($this->tables['users'], $data); - - if (array_key_exists('username', $data) || array_key_exists('password', $data) || array_key_exists('email', $data)) - { - if (array_key_exists('password', $data)) - { - if( ! empty($data['password'])) - { - $data['password'] = $this->hash_password($data['password'], $user->salt); - } - else - { - // unset password so it doesn't effect database entry if no password passed - unset($data['password']); - } - } - } - - $this->trigger_events('extra_where'); - $this->db->update($this->tables['users'], $data, array('id' => $user->id)); - - if ($this->db->trans_status() === FALSE) - { - $this->db->trans_rollback(); - - $this->trigger_events(array('post_update_user', 'post_update_user_unsuccessful')); - $this->set_error('update_unsuccessful'); - return FALSE; - } - - $this->db->trans_commit(); - - $this->trigger_events(array('post_update_user', 'post_update_user_successful')); - $this->set_message('update_successful'); - return TRUE; - } - - /** - * delete_user - * - * @return bool - * @author Phil Sturgeon - **/ - public function delete_user($id) - { - $this->trigger_events('pre_delete_user'); - - $this->db->trans_begin(); - - // remove user from groups - $this->remove_from_group(NULL, $id); - - // delete user from users table should be placed after remove from group - $this->db->delete($this->tables['users'], array('id' => $id)); - - // if user does not exist in database then it returns FALSE else removes the user from groups - if ($this->db->affected_rows() == 0) - { - return FALSE; - } - - if ($this->db->trans_status() === FALSE) - { - $this->db->trans_rollback(); - $this->trigger_events(array('post_delete_user', 'post_delete_user_unsuccessful')); - $this->set_error('delete_unsuccessful'); - return FALSE; - } - - $this->db->trans_commit(); - - $this->trigger_events(array('post_delete_user', 'post_delete_user_successful')); - $this->set_message('delete_successful'); - return TRUE; - } - - /** - * update_last_login - * - * @return bool - * @author Ben Edmunds - **/ - public function update_last_login($id) - { - $this->trigger_events('update_last_login'); - - $this->load->helper('date'); - - $this->trigger_events('extra_where'); - - $this->db->update($this->tables['users'], array('last_login' => time()), array('id' => $id)); - - return $this->db->affected_rows() == 1; - } - - /** - * set_lang - * - * @return bool - * @author Ben Edmunds - **/ - public function set_lang($lang = 'en') - { - $this->trigger_events('set_lang'); - - // if the user_expire is set to zero we'll set the expiration two years from now. - if($this->config->item('user_expire', 'ion_auth') === 0) - { - $expire = (60*60*24*365*2); - } - // otherwise use what is set - else - { - $expire = $this->config->item('user_expire', 'ion_auth'); - } - - set_cookie(array( - 'name' => 'lang_code', - 'value' => $lang, - 'expire' => $expire - )); - - return TRUE; - } - - /** - * set_session - * - * @return bool - * @author jrmadsen67 - **/ - public function set_session($user) - { - - $this->trigger_events('pre_set_session'); - - $session_data = array( - 'identity' => $user->{$this->identity_column}, - 'username' => $user->username, - 'email' => $user->email, - 'user_id' => $user->id, //everyone likes to overwrite id so we'll use user_id - 'old_last_login' => $user->last_login - ); - - $this->session->set_userdata($session_data); - - $this->trigger_events('post_set_session'); - - return TRUE; - } - - /** - * remember_user - * - * @return bool - * @author Ben Edmunds - **/ - public function remember_user($id) - { - $this->trigger_events('pre_remember_user'); - - if (!$id) - { - return FALSE; - } - - $user = $this->user($id)->row(); - - $salt = $this->salt(); - - $this->db->update($this->tables['users'], array('remember_code' => $salt), array('id' => $id)); - - if ($this->db->affected_rows() > -1) - { - // if the user_expire is set to zero we'll set the expiration two years from now. - if($this->config->item('user_expire', 'ion_auth') === 0) - { - $expire = (60*60*24*365*2); - } - // otherwise use what is set - else - { - $expire = $this->config->item('user_expire', 'ion_auth'); - } - - set_cookie(array( - 'name' => $this->config->item('identity_cookie_name', 'ion_auth'), - 'value' => $user->{$this->identity_column}, - 'expire' => $expire - )); - - set_cookie(array( - 'name' => $this->config->item('remember_cookie_name', 'ion_auth'), - 'value' => $salt, - 'expire' => $expire - )); - - $this->trigger_events(array('post_remember_user', 'remember_user_successful')); - return TRUE; - } - - $this->trigger_events(array('post_remember_user', 'remember_user_unsuccessful')); - return FALSE; - } - - /** - * login_remembed_user - * - * @return bool - * @author Ben Edmunds - **/ - public function login_remembered_user() - { - $this->trigger_events('pre_login_remembered_user'); - - //check for valid data - if (!get_cookie($this->config->item('identity_cookie_name', 'ion_auth')) - || !get_cookie($this->config->item('remember_cookie_name', 'ion_auth')) - || !$this->identity_check(get_cookie($this->config->item('identity_cookie_name', 'ion_auth')))) - { - $this->trigger_events(array('post_login_remembered_user', 'post_login_remembered_user_unsuccessful')); - return FALSE; - } - - //get the user - $this->trigger_events('extra_where'); - $query = $this->db->select($this->identity_column.', id, username, email, last_login') - ->where($this->identity_column, get_cookie($this->config->item('identity_cookie_name', 'ion_auth'))) - ->where('remember_code', get_cookie($this->config->item('remember_cookie_name', 'ion_auth'))) - ->limit(1) - ->get($this->tables['users']); - - //if the user was found, sign them in - if ($query->num_rows() == 1) - { - $user = $query->row(); - - $this->update_last_login($user->id); - - $this->set_session($user); - - //extend the users cookies if the option is enabled - if ($this->config->item('user_extend_on_login', 'ion_auth')) - { - $this->remember_user($user->id); - } - - $this->trigger_events(array('post_login_remembered_user', 'post_login_remembered_user_successful')); - return TRUE; - } - - $this->trigger_events(array('post_login_remembered_user', 'post_login_remembered_user_unsuccessful')); - return FALSE; - } - - - /** - * create_group - * - * @author aditya menon - */ - public function create_group($group_name = FALSE, $group_description = '', $additional_data = array()) - { - // bail if the group name was not passed - if(!$group_name) - { - $this->set_error('group_name_required'); - return FALSE; - } - - // bail if the group name already exists - $existing_group = $this->db->get_where($this->tables['groups'], array('name' => $group_name))->num_rows(); - if($existing_group !== 0) - { - $this->set_error('group_already_exists'); - return FALSE; - } - - $data = array('name'=>$group_name,'description'=>$group_description); - - //filter out any data passed that doesnt have a matching column in the groups table - //and merge the set group data and the additional data - if (!empty($additional_data)) $data = array_merge($this->_filter_data($this->tables['groups'], $additional_data), $data); - - $this->trigger_events('extra_group_set'); - - // insert the new group - $this->db->insert($this->tables['groups'], $data); - $group_id = $this->db->insert_id(); - - // report success - $this->set_message('group_creation_successful'); - // return the brand new group id - return $group_id; - } - - /** - * update_group - * - * @return bool - * @author aditya menon - **/ - public function update_group($group_id = FALSE, $group_name = FALSE, $additional_data = array()) - { - if (empty($group_id)) return FALSE; - - $data = array(); - - if (!empty($group_name)) - { - // we are changing the name, so do some checks - - // bail if the group name already exists - $existing_group = $this->db->get_where($this->tables['groups'], array('name' => $group_name))->row(); - if(isset($existing_group->id) && $existing_group->id != $group_id) - { - $this->set_error('group_already_exists'); - return FALSE; - } - - $data['name'] = $group_name; - } - - - // IMPORTANT!! Third parameter was string type $description; this following code is to maintain backward compatibility - // New projects should work with 3rd param as array - if (is_string($additional_data)) $additional_data = array('description' => $additional_data); - - - //filter out any data passed that doesnt have a matching column in the groups table - //and merge the set group data and the additional data - if (!empty($additional_data)) $data = array_merge($this->_filter_data($this->tables['groups'], $additional_data), $data); - - - $this->db->update($this->tables['groups'], $data, array('id' => $group_id)); - - $this->set_message('group_update_successful'); - - return TRUE; - } - - /** - * delete_group - * - * @return bool - * @author aditya menon - **/ - public function delete_group($group_id = FALSE) - { - // bail if mandatory param not set - if(!$group_id || empty($group_id)) - { - return FALSE; - } - - $this->trigger_events('pre_delete_group'); - - $this->db->trans_begin(); - - // remove all users from this group - $this->db->delete($this->tables['users_groups'], array($this->join['groups'] => $group_id)); - // remove the group itself - $this->db->delete($this->tables['groups'], array('id' => $group_id)); - - if ($this->db->trans_status() === FALSE) - { - $this->db->trans_rollback(); - $this->trigger_events(array('post_delete_group', 'post_delete_group_unsuccessful')); - $this->set_error('group_delete_unsuccessful'); - return FALSE; - } - - $this->db->trans_commit(); - - $this->trigger_events(array('post_delete_group', 'post_delete_group_successful')); - $this->set_message('group_delete_successful'); - return TRUE; - } - - public function set_hook($event, $name, $class, $method, $arguments) - { - $this->_ion_hooks->{$event}[$name] = new stdClass; - $this->_ion_hooks->{$event}[$name]->class = $class; - $this->_ion_hooks->{$event}[$name]->method = $method; - $this->_ion_hooks->{$event}[$name]->arguments = $arguments; - } - - public function remove_hook($event, $name) - { - if (isset($this->_ion_hooks->{$event}[$name])) - { - unset($this->_ion_hooks->{$event}[$name]); - } - } - - public function remove_hooks($event) - { - if (isset($this->_ion_hooks->$event)) - { - unset($this->_ion_hooks->$event); - } - } - - protected function _call_hook($event, $name) - { - if (isset($this->_ion_hooks->{$event}[$name]) && method_exists($this->_ion_hooks->{$event}[$name]->class, $this->_ion_hooks->{$event}[$name]->method)) - { - $hook = $this->_ion_hooks->{$event}[$name]; - - return call_user_func_array(array($hook->class, $hook->method), $hook->arguments); - } - - return FALSE; - } - - public function trigger_events($events) - { - if (is_array($events) && !empty($events)) - { - foreach ($events as $event) - { - $this->trigger_events($event); - } - } - else - { - if (isset($this->_ion_hooks->$events) && !empty($this->_ion_hooks->$events)) - { - foreach ($this->_ion_hooks->$events as $name => $hook) - { - $this->_call_hook($events, $name); - } - } - } - } - - /** - * set_message_delimiters - * - * Set the message delimiters - * - * @return void - * @author Ben Edmunds - **/ - public function set_message_delimiters($start_delimiter, $end_delimiter) - { - $this->message_start_delimiter = $start_delimiter; - $this->message_end_delimiter = $end_delimiter; - - return TRUE; - } - - /** - * set_error_delimiters - * - * Set the error delimiters - * - * @return void - * @author Ben Edmunds - **/ - public function set_error_delimiters($start_delimiter, $end_delimiter) - { - $this->error_start_delimiter = $start_delimiter; - $this->error_end_delimiter = $end_delimiter; - - return TRUE; - } - - /** - * set_message - * - * Set a message - * - * @return void - * @author Ben Edmunds - **/ - public function set_message($message) - { - $this->messages[] = $message; - - return $message; - } - - /** - * messages - * - * Get the messages - * - * @return void - * @author Ben Edmunds - **/ - public function messages() - { - $_output = ''; - foreach ($this->messages as $message) - { - $messageLang = $this->lang->line($message) ? $this->lang->line($message) : '##' . $message . '##'; - $_output .= $this->message_start_delimiter . $messageLang . $this->message_end_delimiter; - } - - return $_output; - } - - /** - * messages as array - * - * Get the messages as an array - * - * @return array - * @author Raul Baldner Junior - **/ - public function messages_array($langify = TRUE) - { - if ($langify) - { - $_output = array(); - foreach ($this->messages as $message) - { - $messageLang = $this->lang->line($message) ? $this->lang->line($message) : '##' . $message . '##'; - $_output[] = $this->message_start_delimiter . $messageLang . $this->message_end_delimiter; - } - return $_output; - } - else - { - return $this->messages; - } - } - - /** - * set_error - * - * Set an error message - * - * @return void - * @author Ben Edmunds - **/ - public function set_error($error) - { - $this->errors[] = $error; - - return $error; - } - - /** - * errors - * - * Get the error message - * - * @return void - * @author Ben Edmunds - **/ - public function errors() - { - $_output = ''; - foreach ($this->errors as $error) - { - $errorLang = $this->lang->line($error) ? $this->lang->line($error) : '##' . $error . '##'; - $_output .= $this->error_start_delimiter . $errorLang . $this->error_end_delimiter; - } - - return $_output; - } - - /** - * errors as array - * - * Get the error messages as an array - * - * @return array - * @author Raul Baldner Junior - **/ - public function errors_array($langify = TRUE) - { - if ($langify) - { - $_output = array(); - foreach ($this->errors as $error) - { - $errorLang = $this->lang->line($error) ? $this->lang->line($error) : '##' . $error . '##'; - $_output[] = $this->error_start_delimiter . $errorLang . $this->error_end_delimiter; - } - return $_output; - } - else - { - return $this->errors; - } - } - - protected function _filter_data($table, $data) - { - $filtered_data = array(); - $columns = $this->db->list_fields($table); - - if (is_array($data)) - { - foreach ($columns as $column) - { - if (array_key_exists($column, $data)) - $filtered_data[$column] = $data[$column]; - } - } - - return $filtered_data; - } - - protected function _prepare_ip($ip_address) { - //just return the string IP address now for better compatibility - return $ip_address; - } -} +load->database(); + $this->load->config('ion_auth', TRUE); + $this->load->helper('cookie'); + $this->load->helper('date'); + $this->lang->load('ion_auth'); + + //initialize db tables data + $this->tables = $this->config->item('tables', 'ion_auth'); + + //initialize data + $this->identity_column = $this->config->item('identity', 'ion_auth'); + $this->store_salt = $this->config->item('store_salt', 'ion_auth'); + $this->salt_length = $this->config->item('salt_length', 'ion_auth'); + $this->join = $this->config->item('join', 'ion_auth'); + + + //initialize hash method options (Bcrypt) + $this->hash_method = $this->config->item('hash_method', 'ion_auth'); + $this->default_rounds = $this->config->item('default_rounds', 'ion_auth'); + $this->random_rounds = $this->config->item('random_rounds', 'ion_auth'); + $this->min_rounds = $this->config->item('min_rounds', 'ion_auth'); + $this->max_rounds = $this->config->item('max_rounds', 'ion_auth'); + + + //initialize messages and error + $this->messages = array(); + $this->errors = array(); + $delimiters_source = $this->config->item('delimiters_source', 'ion_auth'); + + //load the error delimeters either from the config file or use what's been supplied to form validation + if ($delimiters_source === 'form_validation') + { + //load in delimiters from form_validation + //to keep this simple we'll load the value using reflection since these properties are protected + $this->load->library('form_validation'); + $form_validation_class = new ReflectionClass("CI_Form_validation"); + + $error_prefix = $form_validation_class->getProperty("_error_prefix"); + $error_prefix->setAccessible(TRUE); + $this->error_start_delimiter = $error_prefix->getValue($this->form_validation); + $this->message_start_delimiter = $this->error_start_delimiter; + + $error_suffix = $form_validation_class->getProperty("_error_suffix"); + $error_suffix->setAccessible(TRUE); + $this->error_end_delimiter = $error_suffix->getValue($this->form_validation); + $this->message_end_delimiter = $this->error_end_delimiter; + } + else + { + //use delimiters from config + $this->message_start_delimiter = $this->config->item('message_start_delimiter', 'ion_auth'); + $this->message_end_delimiter = $this->config->item('message_end_delimiter', 'ion_auth'); + $this->error_start_delimiter = $this->config->item('error_start_delimiter', 'ion_auth'); + $this->error_end_delimiter = $this->config->item('error_end_delimiter', 'ion_auth'); + } + + + //initialize our hooks object + $this->_ion_hooks = new stdClass; + + //load the bcrypt class if needed + if ($this->hash_method == 'bcrypt') { + if ($this->random_rounds) + { + $rand = rand($this->min_rounds,$this->max_rounds); + $params = array('rounds' => $rand); + } + else + { + $params = array('rounds' => $this->default_rounds); + } + + $params['salt_prefix'] = $this->config->item('salt_prefix', 'ion_auth'); + $this->load->library('bcrypt',$params); + } + + $this->trigger_events('model_constructor'); + } + + /** + * Misc functions + * + * Hash password : Hashes the password to be stored in the database. + * Hash password db : This function takes a password and validates it + * against an entry in the users table. + * Salt : Generates a random salt value. + * + * @author Mathew + */ + + /** + * Hashes the password to be stored in the database. + * + * @return void + * @author Mathew + **/ + public function hash_password($password, $salt=false, $use_sha1_override=FALSE) + { + if (empty($password)) + { + return FALSE; + } + + //bcrypt + if ($use_sha1_override === FALSE && $this->hash_method == 'bcrypt') + { + return $this->bcrypt->hash($password); + } + + + if ($this->store_salt && $salt) + { + return sha1($password . $salt); + } + else + { + $salt = $this->salt(); + return $salt . substr(sha1($salt . $password), 0, -$this->salt_length); + } + } + + /** + * This function takes a password and validates it + * against an entry in the users table. + * + * @return void + * @author Mathew + **/ + public function hash_password_db($id, $password, $use_sha1_override=FALSE) + { + if (empty($id) || empty($password)) + { + return FALSE; + } + + $this->trigger_events('extra_where'); + + $query = $this->db->select('password, salt') + ->where('id', $id) + ->limit(1) + ->get($this->tables['users']); + + $hash_password_db = $query->row(); + + if ($query->num_rows() !== 1) + { + return FALSE; + } + + // bcrypt + if ($use_sha1_override === FALSE && $this->hash_method == 'bcrypt') + { + if ($this->bcrypt->verify($password,$hash_password_db->password)) + { + return TRUE; + } + + return FALSE; + } + + // sha1 + if ($this->store_salt) + { + $db_password = sha1($password . $hash_password_db->salt); + } + else + { + $salt = substr($hash_password_db->password, 0, $this->salt_length); + + $db_password = $salt . substr(sha1($salt . $password), 0, -$this->salt_length); + } + + if($db_password == $hash_password_db->password) + { + return TRUE; + } + else + { + return FALSE; + } + } + + /** + * Generates a random salt value for forgotten passwords or any other keys. Uses SHA1. + * + * @return void + * @author Mathew + **/ + public function hash_code($password) + { + return $this->hash_password($password, FALSE, TRUE); + } + + /** + * Generates a random salt value. + * + * Salt generation code taken from https://github.com/ircmaxell/password_compat/blob/master/lib/password.php + * + * @return void + * @author Anthony Ferrera + **/ + public function salt() + { + + $raw_salt_len = 16; + + $buffer = ''; + $buffer_valid = false; + + if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) { + $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM); + if ($buffer) { + $buffer_valid = true; + } + } + + if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) { + $buffer = openssl_random_pseudo_bytes($raw_salt_len); + if ($buffer) { + $buffer_valid = true; + } + } + + if (!$buffer_valid && @is_readable('/dev/urandom')) { + $f = fopen('/dev/urandom', 'r'); + $read = strlen($buffer); + while ($read < $raw_salt_len) { + $buffer .= fread($f, $raw_salt_len - $read); + $read = strlen($buffer); + } + fclose($f); + if ($read >= $raw_salt_len) { + $buffer_valid = true; + } + } + + if (!$buffer_valid || strlen($buffer) < $raw_salt_len) { + $bl = strlen($buffer); + for ($i = 0; $i < $raw_salt_len; $i++) { + if ($i < $bl) { + $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255)); + } else { + $buffer .= chr(mt_rand(0, 255)); + } + } + } + + $salt = $buffer; + + // encode string with the Base64 variant used by crypt + $base64_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + $bcrypt64_digits = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + $base64_string = base64_encode($salt); + $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits); + + $salt = substr($salt, 0, $this->salt_length); + + + return $salt; + + } + + /** + * Activation functions + * + * Activate : Validates and removes activation code. + * Deactivae : Updates a users row with an activation code. + * + * @author Mathew + */ + + /** + * activate + * + * @return void + * @author Mathew + **/ + public function activate($id, $code = false) + { + $this->trigger_events('pre_activate'); + + if ($code !== FALSE) + { + $query = $this->db->select($this->identity_column) + ->where('activation_code', $code) + ->where('id', $id) + ->limit(1) + ->get($this->tables['users']); + + $result = $query->row(); + + if ($query->num_rows() !== 1) + { + $this->trigger_events(array('post_activate', 'post_activate_unsuccessful')); + $this->set_error('activate_unsuccessful'); + return FALSE; + } + + $data = array( + 'activation_code' => NULL, + 'active' => 1 + ); + + $this->trigger_events('extra_where'); + $this->db->update($this->tables['users'], $data, array('id' => $id)); + } + else + { + $data = array( + 'activation_code' => NULL, + 'active' => 1 + ); + + + $this->trigger_events('extra_where'); + $this->db->update($this->tables['users'], $data, array('id' => $id)); + } + + + $return = $this->db->affected_rows() == 1; + if ($return) + { + $this->trigger_events(array('post_activate', 'post_activate_successful')); + $this->set_message('activate_successful'); + } + else + { + $this->trigger_events(array('post_activate', 'post_activate_unsuccessful')); + $this->set_error('activate_unsuccessful'); + } + + + return $return; + } + + + /** + * Deactivate + * + * @return void + * @author Mathew + **/ + public function deactivate($id = NULL) + { + $this->trigger_events('deactivate'); + + if (!isset($id)) + { + $this->set_error('deactivate_unsuccessful'); + return FALSE; + } + + $activation_code = sha1(md5(microtime())); + $this->activation_code = $activation_code; + + $data = array( + 'activation_code' => $activation_code, + 'active' => 0 + ); + + $this->trigger_events('extra_where'); + $this->db->update($this->tables['users'], $data, array('id' => $id)); + + $return = $this->db->affected_rows() == 1; + if ($return) + $this->set_message('deactivate_successful'); + else + $this->set_error('deactivate_unsuccessful'); + + return $return; + } + + public function clear_forgotten_password_code($code) { + + if (empty($code)) + { + return FALSE; + } + + $this->db->where('forgotten_password_code', $code); + + if ($this->db->count_all_results($this->tables['users']) > 0) + { + $data = array( + 'forgotten_password_code' => NULL, + 'forgotten_password_time' => NULL + ); + + $this->db->update($this->tables['users'], $data, array('forgotten_password_code' => $code)); + + return TRUE; + } + + return FALSE; + } + + /** + * reset password + * + * @return bool + * @author Mathew + **/ + public function reset_password($identity, $new) { + $this->trigger_events('pre_change_password'); + + if (!$this->identity_check($identity)) { + $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); + return FALSE; + } + + $this->trigger_events('extra_where'); + + $query = $this->db->select('id, password, salt') + ->where($this->identity_column, $identity) + ->limit(1) + ->get($this->tables['users']); + + if ($query->num_rows() !== 1) + { + $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); + $this->set_error('password_change_unsuccessful'); + return FALSE; + } + + $result = $query->row(); + + $new = $this->hash_password($new, $result->salt); + + //store the new password and reset the remember code so all remembered instances have to re-login + //also clear the forgotten password code + $data = array( + 'password' => $new, + 'remember_code' => NULL, + 'forgotten_password_code' => NULL, + 'forgotten_password_time' => NULL, + ); + + $this->trigger_events('extra_where'); + $this->db->update($this->tables['users'], $data, array($this->identity_column => $identity)); + + $return = $this->db->affected_rows() == 1; + if ($return) + { + $this->trigger_events(array('post_change_password', 'post_change_password_successful')); + $this->set_message('password_change_successful'); + } + else + { + $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); + $this->set_error('password_change_unsuccessful'); + } + + return $return; + } + + /** + * change password + * + * @return bool + * @author Mathew + **/ + public function change_password($identity, $old, $new) + { + $this->trigger_events('pre_change_password'); + + $this->trigger_events('extra_where'); + + $query = $this->db->select('id, password, salt') + ->where($this->identity_column, $identity) + ->limit(1) + ->get($this->tables['users']); + + if ($query->num_rows() !== 1) + { + $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); + $this->set_error('password_change_unsuccessful'); + return FALSE; + } + + $user = $query->row(); + + $old_password_matches = $this->hash_password_db($user->id, $old); + + if ($old_password_matches === TRUE) + { + //store the new password and reset the remember code so all remembered instances have to re-login + $hashed_new_password = $this->hash_password($new, $user->salt); + $data = array( + 'password' => $hashed_new_password, + 'remember_code' => NULL, + ); + + $this->trigger_events('extra_where'); + + $successfully_changed_password_in_db = $this->db->update($this->tables['users'], $data, array($this->identity_column => $identity)); + if ($successfully_changed_password_in_db) + { + $this->trigger_events(array('post_change_password', 'post_change_password_successful')); + $this->set_message('password_change_successful'); + } + else + { + $this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful')); + $this->set_error('password_change_unsuccessful'); + } + + return $successfully_changed_password_in_db; + } + + $this->set_error('password_change_unsuccessful'); + return FALSE; + } + + /** + * Checks username + * + * @return bool + * @author Mathew + **/ + public function username_check($username = '') + { + $this->trigger_events('username_check'); + + if (empty($username)) + { + return FALSE; + } + + $this->trigger_events('extra_where'); + + return $this->db->where('username', $username) + ->count_all_results($this->tables['users']) > 0; + } + + /** + * Checks email + * + * @return bool + * @author Mathew + **/ + public function email_check($email = '') + { + $this->trigger_events('email_check'); + + if (empty($email)) + { + return FALSE; + } + + $this->trigger_events('extra_where'); + + return $this->db->where('email', $email) + ->count_all_results($this->tables['users']) > 0; + } + + /** + * Identity check + * + * @return bool + * @author Mathew + **/ + public function identity_check($identity = '') + { + $this->trigger_events('identity_check'); + + if (empty($identity)) + { + return FALSE; + } + + return $this->db->where($this->identity_column, $identity) + ->count_all_results($this->tables['users']) > 0; + } + + /** + * Insert a forgotten password key. + * + * @return bool + * @author Mathew + * @updated Ryan + * @updated 52aa456eef8b60ad6754b31fbdcc77bb + **/ + public function forgotten_password($identity) + { + if (empty($identity)) + { + $this->trigger_events(array('post_forgotten_password', 'post_forgotten_password_unsuccessful')); + return FALSE; + } + + //All some more randomness + $activation_code_part = ""; + if(function_exists("openssl_random_pseudo_bytes")) { + $activation_code_part = openssl_random_pseudo_bytes(128); + } + + for($i=0;$i<1024;$i++) { + $activation_code_part = sha1($activation_code_part . mt_rand() . microtime()); + } + + $key = $this->hash_code($activation_code_part.$identity); + + // If enable query strings is set, then we need to replace any unsafe characters so that the code can still work + if ($key != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) + { + // preg_quote() in PHP 5.3 escapes -, so the str_replace() and addition of - to preg_quote() is to maintain backwards + // compatibility as many are unaware of how characters in the permitted_uri_chars will be parsed as a regex pattern + if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $key)) + { + $key = preg_replace("/[^".$this->config->item('permitted_uri_chars')."]+/i", "-", $key); + } + } + + $this->forgotten_password_code = $key; + + $this->trigger_events('extra_where'); + + $update = array( + 'forgotten_password_code' => $key, + 'forgotten_password_time' => time() + ); + + $this->db->update($this->tables['users'], $update, array($this->identity_column => $identity)); + + $return = $this->db->affected_rows() == 1; + + if ($return) + $this->trigger_events(array('post_forgotten_password', 'post_forgotten_password_successful')); + else + $this->trigger_events(array('post_forgotten_password', 'post_forgotten_password_unsuccessful')); + + return $return; + } + + /** + * Forgotten Password Complete + * + * @return string + * @author Mathew + **/ + public function forgotten_password_complete($code, $salt=FALSE) + { + $this->trigger_events('pre_forgotten_password_complete'); + + if (empty($code)) + { + $this->trigger_events(array('post_forgotten_password_complete', 'post_forgotten_password_complete_unsuccessful')); + return FALSE; + } + + $profile = $this->where('forgotten_password_code', $code)->users()->row(); //pass the code to profile + + if ($profile) { + + if ($this->config->item('forgot_password_expiration', 'ion_auth') > 0) { + //Make sure it isn't expired + $expiration = $this->config->item('forgot_password_expiration', 'ion_auth'); + if (time() - $profile->forgotten_password_time > $expiration) { + //it has expired + $this->set_error('forgot_password_expired'); + $this->trigger_events(array('post_forgotten_password_complete', 'post_forgotten_password_complete_unsuccessful')); + return FALSE; + } + } + + $password = $this->salt(); + + $data = array( + 'password' => $this->hash_password($password, $salt), + 'forgotten_password_code' => NULL, + 'active' => 1, + ); + + $this->db->update($this->tables['users'], $data, array('forgotten_password_code' => $code)); + + $this->trigger_events(array('post_forgotten_password_complete', 'post_forgotten_password_complete_successful')); + return $password; + } + + $this->trigger_events(array('post_forgotten_password_complete', 'post_forgotten_password_complete_unsuccessful')); + return FALSE; + } + + /** + * register + * + * @return bool + * @author Mathew + **/ + public function register($username, $password, $email, $additional_data = array(), $groups = array()) + { + $this->trigger_events('pre_register'); + + $manual_activation = $this->config->item('manual_activation', 'ion_auth'); + + if ($this->identity_column == 'email' && $this->email_check($email)) + { + $this->set_error('account_creation_duplicate_email'); + return FALSE; + } + elseif ($this->identity_column == 'username' && $this->username_check($username)) + { + $this->set_error('account_creation_duplicate_username'); + return FALSE; + } + + // If username is taken, use username1 or username2, etc. + if ($this->identity_column != 'username') + { + $original_username = $username; + for($i = 0; $this->username_check($username); $i++) + { + if($i > 0) + { + $username = $original_username . $i; + } + } + } + + // IP Address + $ip_address = $this->_prepare_ip($this->input->ip_address()); + $salt = $this->store_salt ? $this->salt() : FALSE; + $password = $this->hash_password($password, $salt); + + // Users table. + $data = array( + 'username' => $username, + 'password' => $password, + 'email' => $email, + 'ip_address' => $ip_address, + 'created_on' => time(), + 'last_login' => time(), + 'active' => ($manual_activation === false ? 1 : 0) + ); + + if ($this->store_salt) + { + $data['salt'] = $salt; + } + + //filter out any data passed that doesnt have a matching column in the users table + //and merge the set user data and the additional data + $user_data = array_merge($this->_filter_data($this->tables['users'], $additional_data), $data); + + $this->trigger_events('extra_set'); + + $this->db->insert($this->tables['users'], $user_data); + + $id = $this->db->insert_id(); + + if (!empty($groups)) + { + //add to groups + foreach ($groups as $group) + { + $this->add_to_group($group, $id); + } + } + + //add to default group if not already set + $default_group = $this->where('name', $this->config->item('default_group', 'ion_auth'))->group()->row(); + if ((isset($default_group->id) && empty($groups)) || (!empty($groups) && !in_array($default_group->id, $groups))) + { + $this->add_to_group($default_group->id, $id); + } + + $this->trigger_events('post_register'); + + return (isset($id)) ? $id : FALSE; + } + + /** + * login + * + * @return bool + * @author Mathew + **/ + public function login($identity, $password, $remember=FALSE) + { + $this->trigger_events('pre_login'); + + if (empty($identity) || empty($password)) + { + $this->set_error('login_unsuccessful'); + return FALSE; + } + + $this->trigger_events('extra_where'); + + $query = $this->db->select($this->identity_column . ', username, email, id, password, active, last_login') + ->where($this->identity_column, $identity) + ->limit(1) + ->get($this->tables['users']); + + if($this->is_time_locked_out($identity)) + { + //Hash something anyway, just to take up time + $this->hash_password($password); + + $this->trigger_events('post_login_unsuccessful'); + $this->set_error('login_timeout'); + + return FALSE; + } + + if ($query->num_rows() === 1) + { + $user = $query->row(); + + $password = $this->hash_password_db($user->id, $password); + + if ($password === TRUE) + { + if ($user->active == 0) + { + $this->trigger_events('post_login_unsuccessful'); + $this->set_error('login_unsuccessful_not_active'); + + return FALSE; + } + + $this->set_session($user); + + $this->update_last_login($user->id); + + $this->clear_login_attempts($identity); + + if ($remember && $this->config->item('remember_users', 'ion_auth')) + { + $this->remember_user($user->id); + } + + $this->trigger_events(array('post_login', 'post_login_successful')); + $this->set_message('login_successful'); + + return TRUE; + } + } + + //Hash something anyway, just to take up time + $this->hash_password($password); + + $this->increase_login_attempts($identity); + + $this->trigger_events('post_login_unsuccessful'); + $this->set_error('login_unsuccessful'); + + return FALSE; + } + + /** + * is_max_login_attempts_exceeded + * Based on code from Tank Auth, by Ilya Konyukhov (https://github.com/ilkon/Tank-Auth) + * + * @param string $identity + * @return boolean + **/ + public function is_max_login_attempts_exceeded($identity) { + if ($this->config->item('track_login_attempts', 'ion_auth')) { + $max_attempts = $this->config->item('maximum_login_attempts', 'ion_auth'); + if ($max_attempts > 0) { + $attempts = $this->get_attempts_num($identity); + return $attempts >= $max_attempts; + } + } + return FALSE; + } + + /** + * Get number of attempts to login occured from given IP-address or identity + * Based on code from Tank Auth, by Ilya Konyukhov (https://github.com/ilkon/Tank-Auth) + * + * @param string $identity + * @return int + */ + function get_attempts_num($identity) + { + if ($this->config->item('track_login_attempts', 'ion_auth')) { + $ip_address = $this->_prepare_ip($this->input->ip_address()); + $this->db->select('1', FALSE); + if ($this->config->item('track_login_ip_address', 'ion_auth')) $this->db->where('ip_address', $ip_address); + else if (strlen($identity) > 0) $this->db->or_where('login', $identity); + $qres = $this->db->get($this->tables['login_attempts']); + return $qres->num_rows(); + } + return 0; + } + + /** + * Get a boolean to determine if an account should be locked out due to + * exceeded login attempts within a given period + * + * @return boolean + */ + public function is_time_locked_out($identity) { + + return $this->is_max_login_attempts_exceeded($identity) && $this->get_last_attempt_time($identity) > time() - $this->config->item('lockout_time', 'ion_auth'); + } + + /** + * Get the time of the last time a login attempt occured from given IP-address or identity + * + * @param string $identity + * @return int + */ + public function get_last_attempt_time($identity) { + if ($this->config->item('track_login_attempts', 'ion_auth')) { + $ip_address = $this->_prepare_ip($this->input->ip_address()); + + $this->db->select_max('time'); + if ($this->config->item('track_login_ip_address', 'ion_auth')) $this->db->where('ip_address', $ip_address); + else if (strlen($identity) > 0) $this->db->or_where('login', $identity); + $qres = $this->db->get($this->tables['login_attempts'], 1); + + if($qres->num_rows() > 0) { + return $qres->row()->time; + } + } + + return 0; + } + + /** + * increase_login_attempts + * Based on code from Tank Auth, by Ilya Konyukhov (https://github.com/ilkon/Tank-Auth) + * + * @param string $identity + **/ + public function increase_login_attempts($identity) { + if ($this->config->item('track_login_attempts', 'ion_auth')) { + $ip_address = $this->_prepare_ip($this->input->ip_address()); + return $this->db->insert($this->tables['login_attempts'], array('ip_address' => $ip_address, 'login' => $identity, 'time' => time())); + } + return FALSE; + } + + /** + * clear_login_attempts + * Based on code from Tank Auth, by Ilya Konyukhov (https://github.com/ilkon/Tank-Auth) + * + * @param string $identity + **/ + public function clear_login_attempts($identity, $expire_period = 86400) { + if ($this->config->item('track_login_attempts', 'ion_auth')) { + $ip_address = $this->_prepare_ip($this->input->ip_address()); + + $this->db->where(array('ip_address' => $ip_address, 'login' => $identity)); + // Purge obsolete login attempts + $this->db->or_where('time <', time() - $expire_period, FALSE); + + return $this->db->delete($this->tables['login_attempts']); + } + return FALSE; + } + + public function limit($limit) + { + $this->trigger_events('limit'); + $this->_ion_limit = $limit; + + return $this; + } + + public function offset($offset) + { + $this->trigger_events('offset'); + $this->_ion_offset = $offset; + + return $this; + } + + public function where($where, $value = NULL) + { + $this->trigger_events('where'); + + if (!is_array($where)) + { + $where = array($where => $value); + } + + array_push($this->_ion_where, $where); + + return $this; + } + + public function like($like, $value = NULL, $position = 'both') + { + $this->trigger_events('like'); + + if (!is_array($like)) + { + $like = array($like => array( + 'value' => $value, + 'position' => $position, + )); + } + + array_push($this->_ion_like, $like); + + return $this; + } + + public function select($select) + { + $this->trigger_events('select'); + + $this->_ion_select[] = $select; + + return $this; + } + + public function order_by($by, $order='desc') + { + $this->trigger_events('order_by'); + + $this->_ion_order_by = $by; + $this->_ion_order = $order; + + return $this; + } + + public function row() + { + $this->trigger_events('row'); + + $row = $this->response->row(); + $this->response->free_result(); + + return $row; + } + + public function row_array() + { + $this->trigger_events(array('row', 'row_array')); + + $row = $this->response->row_array(); + $this->response->free_result(); + + return $row; + } + + public function result() + { + $this->trigger_events('result'); + + $result = $this->response->result(); + $this->response->free_result(); + + return $result; + } + + public function result_array() + { + $this->trigger_events(array('result', 'result_array')); + + $result = $this->response->result_array(); + $this->response->free_result(); + + return $result; + } + + public function num_rows() + { + $this->trigger_events(array('num_rows')); + + $result = $this->response->num_rows(); + $this->response->free_result(); + + return $result; + } + + /** + * users + * + * @return object Users + * @author Ben Edmunds + **/ + public function users($groups = NULL) + { + $this->trigger_events('users'); + + if (isset($this->_ion_select) && !empty($this->_ion_select)) + { + foreach ($this->_ion_select as $select) + { + $this->db->select($select); + } + + $this->_ion_select = array(); + } + else + { + //default selects + $this->db->select(array( + $this->tables['users'].'.*', + $this->tables['users'].'.id as id', + $this->tables['users'].'.id as user_id' + )); + } + + //filter by group id(s) if passed + if (isset($groups)) + { + //build an array if only one group was passed + if (is_numeric($groups)) + { + $groups = Array($groups); + } + + //join and then run a where_in against the group ids + if (isset($groups) && !empty($groups)) + { + $this->db->distinct(); + $this->db->join( + $this->tables['users_groups'], + $this->tables['users_groups'].'.'.$this->join['users'].'='.$this->tables['users'].'.id', + 'inner' + ); + + $this->db->where_in($this->tables['users_groups'].'.'.$this->join['groups'], $groups); + } + } + + $this->trigger_events('extra_where'); + + //run each where that was passed + if (isset($this->_ion_where) && !empty($this->_ion_where)) + { + foreach ($this->_ion_where as $where) + { + $this->db->where($where); + } + + $this->_ion_where = array(); + } + + if (isset($this->_ion_like) && !empty($this->_ion_like)) + { + foreach ($this->_ion_like as $like) + { + $this->db->or_like($like); + } + + $this->_ion_like = array(); + } + + if (isset($this->_ion_limit) && isset($this->_ion_offset)) + { + $this->db->limit($this->_ion_limit, $this->_ion_offset); + + $this->_ion_limit = NULL; + $this->_ion_offset = NULL; + } + else if (isset($this->_ion_limit)) + { + $this->db->limit($this->_ion_limit); + + $this->_ion_limit = NULL; + } + + //set the order + if (isset($this->_ion_order_by) && isset($this->_ion_order)) + { + $this->db->order_by($this->_ion_order_by, $this->_ion_order); + + $this->_ion_order = NULL; + $this->_ion_order_by = NULL; + } + + $this->response = $this->db->get($this->tables['users']); + + return $this; + } + + /** + * user + * + * @return object + * @author Ben Edmunds + **/ + public function user($id = NULL) + { + $this->trigger_events('user'); + + //if no id was passed use the current users id + $id || $id = $this->session->userdata('user_id'); + + $this->limit(1); + $this->where($this->tables['users'].'.id', $id); + + $this->users(); + + return $this; + } + + /** + * get_users_groups + * + * @return array + * @author Ben Edmunds + **/ + public function get_users_groups($id=FALSE) + { + $this->trigger_events('get_users_group'); + + //if no id was passed use the current users id + $id || $id = $this->session->userdata('user_id'); + + return $this->db->select($this->tables['users_groups'].'.'.$this->join['groups'].' as id, '.$this->tables['groups'].'.name, '.$this->tables['groups'].'.description') + ->where($this->tables['users_groups'].'.'.$this->join['users'], $id) + ->join($this->tables['groups'], $this->tables['users_groups'].'.'.$this->join['groups'].'='.$this->tables['groups'].'.id') + ->get($this->tables['users_groups']); + } + + /** + * add_to_group + * + * @return bool + * @author Ben Edmunds + **/ + public function add_to_group($group_id, $user_id=false) + { + $this->trigger_events('add_to_group'); + + //if no id was passed use the current users id + $user_id || $user_id = $this->session->userdata('user_id'); + + //check if unique - num_rows() > 0 means row found + if ($this->db->where(array( $this->join['groups'] => (int)$group_id, $this->join['users'] => (int)$user_id))->get($this->tables['users_groups'])->num_rows()) return false; + + if ($return = $this->db->insert($this->tables['users_groups'], array( $this->join['groups'] => (int)$group_id, $this->join['users'] => (int)$user_id))) + { + if (isset($this->_cache_groups[$group_id])) { + $group_name = $this->_cache_groups[$group_id]; + } + else { + $group = $this->group($group_id)->result(); + $group_name = $group[0]->name; + $this->_cache_groups[$group_id] = $group_name; + } + $this->_cache_user_in_group[$user_id][$group_id] = $group_name; + } + return $return; + } + + /** + * remove_from_group + * + * @return bool + * @author Ben Edmunds + **/ + public function remove_from_group($group_ids=false, $user_id=false) + { + $this->trigger_events('remove_from_group'); + + // user id is required + if(empty($user_id)) + { + return FALSE; + } + + // if group id(s) are passed remove user from the group(s) + if( ! empty($group_ids)) + { + if(!is_array($group_ids)) + { + $group_ids = array($group_ids); + } + + foreach($group_ids as $group_id) + { + $this->db->delete($this->tables['users_groups'], array($this->join['groups'] => (int)$group_id, $this->join['users'] => (int)$user_id)); + if (isset($this->_cache_user_in_group[$user_id]) && isset($this->_cache_user_in_group[$user_id][$group_id])) + { + unset($this->_cache_user_in_group[$user_id][$group_id]); + } + } + + $return = TRUE; + } + // otherwise remove user from all groups + else + { + if ($return = $this->db->delete($this->tables['users_groups'], array($this->join['users'] => (int)$user_id))) { + $this->_cache_user_in_group[$user_id] = array(); + } + } + return $return; + } + + /** + * groups + * + * @return object + * @author Ben Edmunds + **/ + public function groups() + { + $this->trigger_events('groups'); + + //run each where that was passed + if (isset($this->_ion_where) && !empty($this->_ion_where)) + { + foreach ($this->_ion_where as $where) + { + $this->db->where($where); + } + $this->_ion_where = array(); + } + + if (isset($this->_ion_limit) && isset($this->_ion_offset)) + { + $this->db->limit($this->_ion_limit, $this->_ion_offset); + + $this->_ion_limit = NULL; + $this->_ion_offset = NULL; + } + else if (isset($this->_ion_limit)) + { + $this->db->limit($this->_ion_limit); + + $this->_ion_limit = NULL; + } + + //set the order + if (isset($this->_ion_order_by) && isset($this->_ion_order)) + { + $this->db->order_by($this->_ion_order_by, $this->_ion_order); + } + + $this->response = $this->db->get($this->tables['groups']); + + return $this; + } + + /** + * group + * + * @return object + * @author Ben Edmunds + **/ + public function group($id = NULL) + { + $this->trigger_events('group'); + + if (isset($id)) + { + $this->where($this->tables['groups'].'.id', $id); + } + + $this->limit(1); + + return $this->groups(); + } + + /** + * update + * + * @return bool + * @author Phil Sturgeon + **/ + public function update($id, array $data) + { + $this->trigger_events('pre_update_user'); + + $user = $this->user($id)->row(); + + $this->db->trans_begin(); + + if (array_key_exists($this->identity_column, $data) && $this->identity_check($data[$this->identity_column]) && $user->{$this->identity_column} !== $data[$this->identity_column]) + { + $this->db->trans_rollback(); + $this->set_error('account_creation_duplicate_'.$this->identity_column); + + $this->trigger_events(array('post_update_user', 'post_update_user_unsuccessful')); + $this->set_error('update_unsuccessful'); + + return FALSE; + } + + // Filter the data passed + $data = $this->_filter_data($this->tables['users'], $data); + + if (array_key_exists('username', $data) || array_key_exists('password', $data) || array_key_exists('email', $data)) + { + if (array_key_exists('password', $data)) + { + if( ! empty($data['password'])) + { + $data['password'] = $this->hash_password($data['password'], $user->salt); + } + else + { + // unset password so it doesn't effect database entry if no password passed + unset($data['password']); + } + } + } + + $this->trigger_events('extra_where'); + $this->db->update($this->tables['users'], $data, array('id' => $user->id)); + + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + + $this->trigger_events(array('post_update_user', 'post_update_user_unsuccessful')); + $this->set_error('update_unsuccessful'); + return FALSE; + } + + $this->db->trans_commit(); + + $this->trigger_events(array('post_update_user', 'post_update_user_successful')); + $this->set_message('update_successful'); + return TRUE; + } + + /** + * delete_user + * + * @return bool + * @author Phil Sturgeon + **/ + public function delete_user($id) + { + $this->trigger_events('pre_delete_user'); + + $this->db->trans_begin(); + + // remove user from groups + $this->remove_from_group(NULL, $id); + + // delete user from users table should be placed after remove from group + $this->db->delete($this->tables['users'], array('id' => $id)); + + // if user does not exist in database then it returns FALSE else removes the user from groups + if ($this->db->affected_rows() == 0) + { + return FALSE; + } + + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + $this->trigger_events(array('post_delete_user', 'post_delete_user_unsuccessful')); + $this->set_error('delete_unsuccessful'); + return FALSE; + } + + $this->db->trans_commit(); + + $this->trigger_events(array('post_delete_user', 'post_delete_user_successful')); + $this->set_message('delete_successful'); + return TRUE; + } + + /** + * update_last_login + * + * @return bool + * @author Ben Edmunds + **/ + public function update_last_login($id) + { + $this->trigger_events('update_last_login'); + + $this->load->helper('date'); + + $this->trigger_events('extra_where'); + + $this->db->update($this->tables['users'], array('last_login' => time()), array('id' => $id)); + + return $this->db->affected_rows() == 1; + } + + /** + * set_lang + * + * @return bool + * @author Ben Edmunds + **/ + public function set_lang($lang = 'en') + { + $this->trigger_events('set_lang'); + + // if the user_expire is set to zero we'll set the expiration two years from now. + if($this->config->item('user_expire', 'ion_auth') === 0) + { + $expire = (60*60*24*365*2); + } + // otherwise use what is set + else + { + $expire = $this->config->item('user_expire', 'ion_auth'); + } + + set_cookie(array( + 'name' => 'lang_code', + 'value' => $lang, + 'expire' => $expire + )); + + return TRUE; + } + + /** + * set_session + * + * @return bool + * @author jrmadsen67 + **/ + public function set_session($user) + { + + $this->trigger_events('pre_set_session'); + + $session_data = array( + 'identity' => $user->{$this->identity_column}, + 'username' => $user->username, + 'email' => $user->email, + 'user_id' => $user->id, //everyone likes to overwrite id so we'll use user_id + 'old_last_login' => $user->last_login + ); + + $this->session->set_userdata($session_data); + + $this->trigger_events('post_set_session'); + + return TRUE; + } + + /** + * remember_user + * + * @return bool + * @author Ben Edmunds + **/ + public function remember_user($id) + { + $this->trigger_events('pre_remember_user'); + + if (!$id) + { + return FALSE; + } + + $user = $this->user($id)->row(); + + $salt = $this->salt(); + + $this->db->update($this->tables['users'], array('remember_code' => $salt), array('id' => $id)); + + if ($this->db->affected_rows() > -1) + { + // if the user_expire is set to zero we'll set the expiration two years from now. + if($this->config->item('user_expire', 'ion_auth') === 0) + { + $expire = (60*60*24*365*2); + } + // otherwise use what is set + else + { + $expire = $this->config->item('user_expire', 'ion_auth'); + } + + set_cookie(array( + 'name' => $this->config->item('identity_cookie_name', 'ion_auth'), + 'value' => $user->{$this->identity_column}, + 'expire' => $expire + )); + + set_cookie(array( + 'name' => $this->config->item('remember_cookie_name', 'ion_auth'), + 'value' => $salt, + 'expire' => $expire + )); + + $this->trigger_events(array('post_remember_user', 'remember_user_successful')); + return TRUE; + } + + $this->trigger_events(array('post_remember_user', 'remember_user_unsuccessful')); + return FALSE; + } + + /** + * login_remembed_user + * + * @return bool + * @author Ben Edmunds + **/ + public function login_remembered_user() + { + $this->trigger_events('pre_login_remembered_user'); + + //check for valid data + if (!get_cookie($this->config->item('identity_cookie_name', 'ion_auth')) + || !get_cookie($this->config->item('remember_cookie_name', 'ion_auth')) + || !$this->identity_check(get_cookie($this->config->item('identity_cookie_name', 'ion_auth')))) + { + $this->trigger_events(array('post_login_remembered_user', 'post_login_remembered_user_unsuccessful')); + return FALSE; + } + + //get the user + $this->trigger_events('extra_where'); + $query = $this->db->select($this->identity_column.', id, username, email, last_login') + ->where($this->identity_column, get_cookie($this->config->item('identity_cookie_name', 'ion_auth'))) + ->where('remember_code', get_cookie($this->config->item('remember_cookie_name', 'ion_auth'))) + ->limit(1) + ->get($this->tables['users']); + + //if the user was found, sign them in + if ($query->num_rows() == 1) + { + $user = $query->row(); + + $this->update_last_login($user->id); + + $this->set_session($user); + + //extend the users cookies if the option is enabled + if ($this->config->item('user_extend_on_login', 'ion_auth')) + { + $this->remember_user($user->id); + } + + $this->trigger_events(array('post_login_remembered_user', 'post_login_remembered_user_successful')); + return TRUE; + } + + $this->trigger_events(array('post_login_remembered_user', 'post_login_remembered_user_unsuccessful')); + return FALSE; + } + + + /** + * create_group + * + * @author aditya menon + */ + public function create_group($group_name = FALSE, $group_description = '', $additional_data = array()) + { + // bail if the group name was not passed + if(!$group_name) + { + $this->set_error('group_name_required'); + return FALSE; + } + + // bail if the group name already exists + $existing_group = $this->db->get_where($this->tables['groups'], array('name' => $group_name))->num_rows(); + if($existing_group !== 0) + { + $this->set_error('group_already_exists'); + return FALSE; + } + + $data = array('name'=>$group_name,'description'=>$group_description); + + //filter out any data passed that doesnt have a matching column in the groups table + //and merge the set group data and the additional data + if (!empty($additional_data)) $data = array_merge($this->_filter_data($this->tables['groups'], $additional_data), $data); + + $this->trigger_events('extra_group_set'); + + // insert the new group + $this->db->insert($this->tables['groups'], $data); + $group_id = $this->db->insert_id(); + + // report success + $this->set_message('group_creation_successful'); + // return the brand new group id + return $group_id; + } + + /** + * update_group + * + * @return bool + * @author aditya menon + **/ + public function update_group($group_id = FALSE, $group_name = FALSE, $additional_data = array()) + { + if (empty($group_id)) return FALSE; + + $data = array(); + + if (!empty($group_name)) + { + // we are changing the name, so do some checks + + // bail if the group name already exists + $existing_group = $this->db->get_where($this->tables['groups'], array('name' => $group_name))->row(); + if(isset($existing_group->id) && $existing_group->id != $group_id) + { + $this->set_error('group_already_exists'); + return FALSE; + } + + $data['name'] = $group_name; + } + + + // IMPORTANT!! Third parameter was string type $description; this following code is to maintain backward compatibility + // New projects should work with 3rd param as array + if (is_string($additional_data)) $additional_data = array('description' => $additional_data); + + + //filter out any data passed that doesnt have a matching column in the groups table + //and merge the set group data and the additional data + if (!empty($additional_data)) $data = array_merge($this->_filter_data($this->tables['groups'], $additional_data), $data); + + + $this->db->update($this->tables['groups'], $data, array('id' => $group_id)); + + $this->set_message('group_update_successful'); + + return TRUE; + } + + /** + * delete_group + * + * @return bool + * @author aditya menon + **/ + public function delete_group($group_id = FALSE) + { + // bail if mandatory param not set + if(!$group_id || empty($group_id)) + { + return FALSE; + } + + $this->trigger_events('pre_delete_group'); + + $this->db->trans_begin(); + + // remove all users from this group + $this->db->delete($this->tables['users_groups'], array($this->join['groups'] => $group_id)); + // remove the group itself + $this->db->delete($this->tables['groups'], array('id' => $group_id)); + + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + $this->trigger_events(array('post_delete_group', 'post_delete_group_unsuccessful')); + $this->set_error('group_delete_unsuccessful'); + return FALSE; + } + + $this->db->trans_commit(); + + $this->trigger_events(array('post_delete_group', 'post_delete_group_successful')); + $this->set_message('group_delete_successful'); + return TRUE; + } + + public function set_hook($event, $name, $class, $method, $arguments) + { + $this->_ion_hooks->{$event}[$name] = new stdClass; + $this->_ion_hooks->{$event}[$name]->class = $class; + $this->_ion_hooks->{$event}[$name]->method = $method; + $this->_ion_hooks->{$event}[$name]->arguments = $arguments; + } + + public function remove_hook($event, $name) + { + if (isset($this->_ion_hooks->{$event}[$name])) + { + unset($this->_ion_hooks->{$event}[$name]); + } + } + + public function remove_hooks($event) + { + if (isset($this->_ion_hooks->$event)) + { + unset($this->_ion_hooks->$event); + } + } + + protected function _call_hook($event, $name) + { + if (isset($this->_ion_hooks->{$event}[$name]) && method_exists($this->_ion_hooks->{$event}[$name]->class, $this->_ion_hooks->{$event}[$name]->method)) + { + $hook = $this->_ion_hooks->{$event}[$name]; + + return call_user_func_array(array($hook->class, $hook->method), $hook->arguments); + } + + return FALSE; + } + + public function trigger_events($events) + { + if (is_array($events) && !empty($events)) + { + foreach ($events as $event) + { + $this->trigger_events($event); + } + } + else + { + if (isset($this->_ion_hooks->$events) && !empty($this->_ion_hooks->$events)) + { + foreach ($this->_ion_hooks->$events as $name => $hook) + { + $this->_call_hook($events, $name); + } + } + } + } + + /** + * set_message_delimiters + * + * Set the message delimiters + * + * @return void + * @author Ben Edmunds + **/ + public function set_message_delimiters($start_delimiter, $end_delimiter) + { + $this->message_start_delimiter = $start_delimiter; + $this->message_end_delimiter = $end_delimiter; + + return TRUE; + } + + /** + * set_error_delimiters + * + * Set the error delimiters + * + * @return void + * @author Ben Edmunds + **/ + public function set_error_delimiters($start_delimiter, $end_delimiter) + { + $this->error_start_delimiter = $start_delimiter; + $this->error_end_delimiter = $end_delimiter; + + return TRUE; + } + + /** + * set_message + * + * Set a message + * + * @return void + * @author Ben Edmunds + **/ + public function set_message($message) + { + $this->messages[] = $message; + + return $message; + } + + /** + * messages + * + * Get the messages + * + * @return void + * @author Ben Edmunds + **/ + public function messages() + { + $_output = ''; + foreach ($this->messages as $message) + { + $messageLang = $this->lang->line($message) ? $this->lang->line($message) : '##' . $message . '##'; + $_output .= $this->message_start_delimiter . $messageLang . $this->message_end_delimiter; + } + + return $_output; + } + + /** + * messages as array + * + * Get the messages as an array + * + * @return array + * @author Raul Baldner Junior + **/ + public function messages_array($langify = TRUE) + { + if ($langify) + { + $_output = array(); + foreach ($this->messages as $message) + { + $messageLang = $this->lang->line($message) ? $this->lang->line($message) : '##' . $message . '##'; + $_output[] = $this->message_start_delimiter . $messageLang . $this->message_end_delimiter; + } + return $_output; + } + else + { + return $this->messages; + } + } + + /** + * set_error + * + * Set an error message + * + * @return void + * @author Ben Edmunds + **/ + public function set_error($error) + { + $this->errors[] = $error; + + return $error; + } + + /** + * errors + * + * Get the error message + * + * @return void + * @author Ben Edmunds + **/ + public function errors() + { + $_output = ''; + foreach ($this->errors as $error) + { + $errorLang = $this->lang->line($error) ? $this->lang->line($error) : '##' . $error . '##'; + $_output .= $this->error_start_delimiter . $errorLang . $this->error_end_delimiter; + } + + return $_output; + } + + /** + * errors as array + * + * Get the error messages as an array + * + * @return array + * @author Raul Baldner Junior + **/ + public function errors_array($langify = TRUE) + { + if ($langify) + { + $_output = array(); + foreach ($this->errors as $error) + { + $errorLang = $this->lang->line($error) ? $this->lang->line($error) : '##' . $error . '##'; + $_output[] = $this->error_start_delimiter . $errorLang . $this->error_end_delimiter; + } + return $_output; + } + else + { + return $this->errors; + } + } + + protected function _filter_data($table, $data) + { + $filtered_data = array(); + $columns = $this->db->list_fields($table); + + if (is_array($data)) + { + foreach ($columns as $column) + { + if (array_key_exists($column, $data)) + $filtered_data[$column] = $data[$column]; + } + } + + return $filtered_data; + } + + protected function _prepare_ip($ip_address) { + //just return the string IP address now for better compatibility + return $ip_address; + } +} diff --git a/application/third_party/index.html b/application/third_party/index.html index 065d2da..04e928c 100755 --- a/application/third_party/index.html +++ b/application/third_party/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/views/auth/change_password.php b/application/views/auth/change_password.php index 2408c1e..f8ce60b 100755 --- a/application/views/auth/change_password.php +++ b/application/views/auth/change_password.php @@ -1,25 +1,25 @@ -

- -
- - - -

-
- -

- -

-
- -

- -

-
- -

- - -

- - +

+ +
+ + + +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ + +

+ + diff --git a/application/views/auth/create_group.php b/application/views/auth/create_group.php index b6917ed..86b07e9 100755 --- a/application/views/auth/create_group.php +++ b/application/views/auth/create_group.php @@ -1,20 +1,20 @@ -

-

- -
- - - -

-
- -

- -

-
- -

- -

- +

+

+ +
+ + + +

+
+ +

+ +

+
+ +

+ +

+ \ No newline at end of file diff --git a/application/views/auth/create_user.php b/application/views/auth/create_user.php index 1fa5e8c..2e043f2 100755 --- a/application/views/auth/create_user.php +++ b/application/views/auth/create_user.php @@ -1,46 +1,46 @@ -

-

- -
- - - -

-
- -

- -

-
- -

- -

-
- -

- -

-
- -

- -

-
- -

- -

-
- -

- -

-
- -

- - -

- - +

+

+ +
+ + + +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ + +

+ + diff --git a/application/views/auth/deactivate_user.php b/application/views/auth/deactivate_user.php index 6e1915a..ba97259 100755 --- a/application/views/auth/deactivate_user.php +++ b/application/views/auth/deactivate_user.php @@ -1,18 +1,18 @@ -

-

username);?>

- -id);?> - -

- - - - -

- - - $user->id)); ?> - -

- +

+

username);?>

+ +id);?> + +

+ + + + +

+ + + $user->id)); ?> + +

+ \ No newline at end of file diff --git a/application/views/auth/edit_group.php b/application/views/auth/edit_group.php index 57fb592..080dad7 100755 --- a/application/views/auth/edit_group.php +++ b/application/views/auth/edit_group.php @@ -1,20 +1,20 @@ -

-

- -
- - - -

-
- -

- -

-
- -

- -

- +

+

+ +
+ + + +

+
+ +

+ +

+
+ +

+ +

+ \ No newline at end of file diff --git a/application/views/auth/edit_user.php b/application/views/auth/edit_user.php index 34fbeba..aaceb18 100755 --- a/application/views/auth/edit_user.php +++ b/application/views/auth/edit_user.php @@ -1,66 +1,66 @@ -

-

- -
- - - -

-
- -

- -

-
- -

- -

-
- -

- -

-
- -

- -

-
- -

- -

-
- -

- - ion_auth->is_admin()): ?> - -

- - - - - - - id);?> - - -

- - +

+

+ +
+ + + +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ + ion_auth->is_admin()): ?> + +

+ + + + + + + id);?> + + +

+ + diff --git a/application/views/auth/email/activate.tpl.php b/application/views/auth/email/activate.tpl.php index a63b067..3fb9460 100755 --- a/application/views/auth/email/activate.tpl.php +++ b/application/views/auth/email/activate.tpl.php @@ -1,6 +1,6 @@ - - -

-

- + + +

+

+ \ No newline at end of file diff --git a/application/views/auth/email/forgot_password.tpl.php b/application/views/auth/email/forgot_password.tpl.php index a58af6c..62cf64b 100755 --- a/application/views/auth/email/forgot_password.tpl.php +++ b/application/views/auth/email/forgot_password.tpl.php @@ -1,6 +1,6 @@ - - -

-

- + + +

+

+ \ No newline at end of file diff --git a/application/views/auth/email/new_password.tpl.php b/application/views/auth/email/new_password.tpl.php index a1c15e0..7638388 100755 --- a/application/views/auth/email/new_password.tpl.php +++ b/application/views/auth/email/new_password.tpl.php @@ -1,7 +1,7 @@ - - -

- -

- + + +

+ +

+ \ No newline at end of file diff --git a/application/views/auth/forgot_password.php b/application/views/auth/forgot_password.php index fafcdf2..ebef02d 100755 --- a/application/views/auth/forgot_password.php +++ b/application/views/auth/forgot_password.php @@ -1,15 +1,15 @@ -

-

- -
- - - -

-
- -

- -

- +

+

+ +
+ + + +

+
+ +

+ +

+ \ No newline at end of file diff --git a/application/views/auth/index.php b/application/views/auth/index.php index cd2200b..a56d915 100755 --- a/application/views/auth/index.php +++ b/application/views/auth/index.php @@ -1,31 +1,31 @@ -

-

- -
- - - - - - - - - - - - - - - - - - - - -
first_name;?>last_name;?>email;?> - groups as $group):?> - id, $group->name) ;?>
- -
active) ? anchor("auth/deactivate/".$user->id, lang('index_active_link')) : anchor("auth/activate/". $user->id, lang('index_inactive_link'));?>id, 'Edit') ;?>
- +

+

+ +
+ + + + + + + + + + + + + + + + + + + + +
first_name;?>last_name;?>email;?> + groups as $group):?> + id, $group->name) ;?>
+ +
active) ? anchor("auth/deactivate/".$user->id, lang('index_active_link')) : anchor("auth/activate/". $user->id, lang('index_inactive_link'));?>id, 'Edit') ;?>
+

|

\ No newline at end of file diff --git a/application/views/auth/login.php b/application/views/auth/login.php index b495fdd..58ff16d 100755 --- a/application/views/auth/login.php +++ b/application/views/auth/login.php @@ -1,28 +1,28 @@ -

-

- -
- - - -

- - -

- -

- - -

- -

- - -

- - -

- - - +

+

+ +
+ + + +

+ + +

+ +

+ + +

+ +

+ + +

+ + +

+ + +

\ No newline at end of file diff --git a/application/views/auth/reset_password.php b/application/views/auth/reset_password.php index c790deb..78d59e8 100755 --- a/application/views/auth/reset_password.php +++ b/application/views/auth/reset_password.php @@ -1,22 +1,22 @@ -

- -
- - - -

-
- -

- -

-
- -

- - - - -

- +

+ +
+ + + +

+
+ +

+ +

+
+ +

+ + + + +

+ \ No newline at end of file diff --git a/application/views/example.php b/application/views/example.php index 6cd8567..54d36c8 100755 --- a/application/views/example.php +++ b/application/views/example.php @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - -
-
- -
- - + + + + + + + + + + + + + + +
+
+ +
+ + diff --git a/application/views/index.html b/application/views/index.html index 065d2da..04e928c 100755 --- a/application/views/index.html +++ b/application/views/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php index d979cf6..79e0af9 100755 --- a/application/views/welcome_message.php +++ b/application/views/welcome_message.php @@ -1,88 +1,88 @@ - - - - - Welcome to CodeIgniter - - - - - -
-

Welcome to CodeIgniter!

- -
-

The page you are looking at is being generated dynamically by CodeIgniter.

- -

If you would like to edit this page you'll find it located at:

- application/views/welcome_message.php - -

The corresponding controller for this page is found at:

- application/controllers/welcome.php - -

If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

-
- - -
- - + + + + + Welcome to CodeIgniter + + + + + +
+

Welcome to CodeIgniter!

+ +
+

The page you are looking at is being generated dynamically by CodeIgniter.

+ +

If you would like to edit this page you'll find it located at:

+ application/views/welcome_message.php + +

The corresponding controller for this page is found at:

+ application/controllers/welcome.php + +

If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

+
+ + +
+ + \ No newline at end of file diff --git a/assets/grocery_crud/config/index.html b/assets/grocery_crud/config/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/config/index.html +++ b/assets/grocery_crud/config/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/config/language_alias.php b/assets/grocery_crud/config/language_alias.php index b70f8ca..4656400 100755 --- a/assets/grocery_crud/config/language_alias.php +++ b/assets/grocery_crud/config/language_alias.php @@ -1,33 +1,33 @@ - 'af', - 'arabic' => 'ar', - 'bengali' => 'bn', // Timepicker is not avaliable yet - 'bulgarian' => 'bg', - 'chinese' => 'zh-cn', - 'czech' => 'cs', - 'danish' => 'da', // Timepicker is not avaliable yet - 'dutch' => 'nl', - 'french' => 'fr', - 'german' => 'de', - 'greek' => 'el', - 'hungarian' => 'hu', - 'indonesian' => 'id', - 'italian' => 'it', - 'japanese' => 'ja', - 'korean' => 'ko', - 'norwegian' => 'no', - 'persian' => 'fa', // Timepicker is not avaliable yet - 'polish' => 'pl', - 'pt-br.portuguese' => 'pt-br', - 'pt-pt.portuguese' => 'pt', - 'romanian' => 'ro', - 'russian' => 'ru', - 'slovak' => 'sk', - 'spanish' => 'es', - 'thai' => 'th', // Timepicker is not avaliable yet - 'turkish' => 'tr', - 'ukrainian' => 'uk', - 'vietnamese' => 'vi' -); + 'af', + 'arabic' => 'ar', + 'bengali' => 'bn', // Timepicker is not avaliable yet + 'bulgarian' => 'bg', + 'chinese' => 'zh-cn', + 'czech' => 'cs', + 'danish' => 'da', // Timepicker is not avaliable yet + 'dutch' => 'nl', + 'french' => 'fr', + 'german' => 'de', + 'greek' => 'el', + 'hungarian' => 'hu', + 'indonesian' => 'id', + 'italian' => 'it', + 'japanese' => 'ja', + 'korean' => 'ko', + 'norwegian' => 'no', + 'persian' => 'fa', // Timepicker is not avaliable yet + 'polish' => 'pl', + 'pt-br.portuguese' => 'pt-br', + 'pt-pt.portuguese' => 'pt', + 'romanian' => 'ro', + 'russian' => 'ru', + 'slovak' => 'sk', + 'spanish' => 'es', + 'thai' => 'th', // Timepicker is not avaliable yet + 'turkish' => 'tr', + 'ukrainian' => 'uk', + 'vietnamese' => 'vi' +); diff --git a/assets/grocery_crud/config/translit_chars.php b/assets/grocery_crud/config/translit_chars.php index 4e83429..b84d7a3 100755 --- a/assets/grocery_crud/config/translit_chars.php +++ b/assets/grocery_crud/config/translit_chars.php @@ -1,169 +1,169 @@ - 'A', - '/α|ά|а|à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', - - // Bb - '/Β|Б/' => 'B', - '/β|б/' => 'b', - - // Cc - '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', - '/ç|ć|ĉ|ċ|č/' => 'c', - - // Dd - '/Δ|Д|Ð|Ď|Đ/' => 'D', - '/δ|д|ð|ď|đ/' => 'd', - - // Ee - '/Ε|Έ|Е|Э|Є|È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E', - '/ε|έ|е|э|є|è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e', - - // Ff - '/Φ|Ф/' => 'F', - '/φ|ф|ƒ/' => 'f', - - // Gg - '/Γ|Г|Ĝ|Ğ|Ġ|Ģ/' => 'G', - '/γ|г|ĝ|ğ|ġ|ģ/' => 'g', - - // Hh - '/Х|Ĥ|Ħ/' => 'H', - '/х|ĥ|ħ/' => 'h', - - // Ii - '/Η|Ή|Ι|Ί|И|Ы|І|Ї|Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I', - '/η|ή|ι|ί|и|ы|і|ї|ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i', - - // Jj - '/Ĵ/' => 'J', - '/ĵ/' => 'j', - - // Kk - '/Κ|К|Ķ/' => 'K', - '/κ|к|ķ/' => 'k', - - // Ll - '/Λ|Л|Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L', - '/λ|л|ĺ|ļ|ľ|ŀ|ł/' => 'l', - - // Mm - '/Μ|М/' => 'M', - '/μ|м/' => 'm', - - // Nn - '/Ν|Н|Ñ|Ń|Ņ|Ň/' => 'N', - '/ν|н|ñ|ń|ņ|ň|ʼn/' => 'n', - - // Oo - '/Ο|Ό|О|Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O', - '/ο|ό|о|ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o', - - // Pp - '/Π|П/' => 'P', - '/π|п/' => 'p', - - // Qq - // '//' => 'Q', - // '//' => 'q', - - // Rr - '/Ρ|Р|Ŕ|Ŗ|Ř/' => 'R', - '/ρ|р|ŕ|ŗ|ř/' => 'r', - - // Ss - '/Σ|С|Ś|Ŝ|Ş|Š/' => 'S', - '/σ|ς|с|ś|ŝ|ş|š|ſ/' => 's', - - // Tt - '/Τ|Т|Ţ|Ť|Ŧ/' => 'T', - '/τ|т|ţ|ť|ŧ/' => 't', - - // Uu - '/У|Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U', - '/у|ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u', - - // Vv - '/В/' => 'V', - '/в/' => 'v', - - // Ww - '/Ω|Ώ|Ŵ/' => 'W', - '/ω|ώ|ŵ/' => 'w', - - // Xx - '/Χ/' => 'X', - '/χ/' => 'x', - - // Yy - '/Υ|Ύ|Ψ|Й|Ý|Ÿ|Ŷ/' => 'Y', - '/υ|ύ|ψ|й|ý|ÿ|ŷ/' => 'y', - - // Zz - '/Ζ|З|Ź|Ż|Ž/' => 'Z', - '/ζ|з|ź|ż|ž/' => 'z', - - '/Θ/' => 'Th', - '/θ/' => 'th', - - '/Ξ/' => 'Ks', - '/ξ/' => 'ks', - - '/Ё/' => 'Yo', - '/ё/' => 'yo', - - '/Ж/' => 'Zh', - '/ж/' => 'zh', - - '/Ц/' => 'Ts', - '/ц/' => 'ts', - - '/Ч/' => 'Ch', - '/ч/' => 'ch', - - '/Ш/' => 'Sh', - '/ш/' => 'sh', - - '/Щ/' => 'Sch', - '/щ/' => 'sch', - - '/Ь|Ъ/' => '', - '/ь|ъ/' => '', - - '/Ю/' => 'Yu', - '/ю/' => 'yu', - - '/Я/' => 'Ya', - '/я/' => 'ya', - - '/Æ|Ǽ/' => 'AE', - '/Ä/' => 'Ae', - '/ä|æ|ǽ/' => 'ae', - - '/Œ/' => 'OE', - '/Ö/' => 'Oe', - '/ö|œ/' => 'oe', - - '/Ü/' => 'Ue', - '/ü/' => 'ue', - - '/IJ/' => 'IJ', - '/ij/' => 'ij', - - '/ß/'=> 'ss', - -); - -/* End of file translit_chars.php */ + 'A', + '/α|ά|а|à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', + + // Bb + '/Β|Б/' => 'B', + '/β|б/' => 'b', + + // Cc + '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', + '/ç|ć|ĉ|ċ|č/' => 'c', + + // Dd + '/Δ|Д|Ð|Ď|Đ/' => 'D', + '/δ|д|ð|ď|đ/' => 'd', + + // Ee + '/Ε|Έ|Е|Э|Є|È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E', + '/ε|έ|е|э|є|è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e', + + // Ff + '/Φ|Ф/' => 'F', + '/φ|ф|ƒ/' => 'f', + + // Gg + '/Γ|Г|Ĝ|Ğ|Ġ|Ģ/' => 'G', + '/γ|г|ĝ|ğ|ġ|ģ/' => 'g', + + // Hh + '/Х|Ĥ|Ħ/' => 'H', + '/х|ĥ|ħ/' => 'h', + + // Ii + '/Η|Ή|Ι|Ί|И|Ы|І|Ї|Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I', + '/η|ή|ι|ί|и|ы|і|ї|ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i', + + // Jj + '/Ĵ/' => 'J', + '/ĵ/' => 'j', + + // Kk + '/Κ|К|Ķ/' => 'K', + '/κ|к|ķ/' => 'k', + + // Ll + '/Λ|Л|Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L', + '/λ|л|ĺ|ļ|ľ|ŀ|ł/' => 'l', + + // Mm + '/Μ|М/' => 'M', + '/μ|м/' => 'm', + + // Nn + '/Ν|Н|Ñ|Ń|Ņ|Ň/' => 'N', + '/ν|н|ñ|ń|ņ|ň|ʼn/' => 'n', + + // Oo + '/Ο|Ό|О|Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O', + '/ο|ό|о|ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o', + + // Pp + '/Π|П/' => 'P', + '/π|п/' => 'p', + + // Qq + // '//' => 'Q', + // '//' => 'q', + + // Rr + '/Ρ|Р|Ŕ|Ŗ|Ř/' => 'R', + '/ρ|р|ŕ|ŗ|ř/' => 'r', + + // Ss + '/Σ|С|Ś|Ŝ|Ş|Š/' => 'S', + '/σ|ς|с|ś|ŝ|ş|š|ſ/' => 's', + + // Tt + '/Τ|Т|Ţ|Ť|Ŧ/' => 'T', + '/τ|т|ţ|ť|ŧ/' => 't', + + // Uu + '/У|Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U', + '/у|ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u', + + // Vv + '/В/' => 'V', + '/в/' => 'v', + + // Ww + '/Ω|Ώ|Ŵ/' => 'W', + '/ω|ώ|ŵ/' => 'w', + + // Xx + '/Χ/' => 'X', + '/χ/' => 'x', + + // Yy + '/Υ|Ύ|Ψ|Й|Ý|Ÿ|Ŷ/' => 'Y', + '/υ|ύ|ψ|й|ý|ÿ|ŷ/' => 'y', + + // Zz + '/Ζ|З|Ź|Ż|Ž/' => 'Z', + '/ζ|з|ź|ż|ž/' => 'z', + + '/Θ/' => 'Th', + '/θ/' => 'th', + + '/Ξ/' => 'Ks', + '/ξ/' => 'ks', + + '/Ё/' => 'Yo', + '/ё/' => 'yo', + + '/Ж/' => 'Zh', + '/ж/' => 'zh', + + '/Ц/' => 'Ts', + '/ц/' => 'ts', + + '/Ч/' => 'Ch', + '/ч/' => 'ch', + + '/Ш/' => 'Sh', + '/ш/' => 'sh', + + '/Щ/' => 'Sch', + '/щ/' => 'sch', + + '/Ь|Ъ/' => '', + '/ь|ъ/' => '', + + '/Ю/' => 'Yu', + '/ю/' => 'yu', + + '/Я/' => 'Ya', + '/я/' => 'ya', + + '/Æ|Ǽ/' => 'AE', + '/Ä/' => 'Ae', + '/ä|æ|ǽ/' => 'ae', + + '/Œ/' => 'OE', + '/Ö/' => 'Oe', + '/ö|œ/' => 'oe', + + '/Ü/' => 'Ue', + '/ü/' => 'ue', + + '/IJ/' => 'IJ', + '/ij/' => 'ij', + + '/ß/'=> 'ss', + +); + +/* End of file translit_chars.php */ /* Location: ./assets/grocery_crud/translit_chars.php */ \ No newline at end of file diff --git a/assets/grocery_crud/css/index.html b/assets/grocery_crud/css/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/css/index.html +++ b/assets/grocery_crud/css/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/css/jquery_plugins/chosen/chosen.css b/assets/grocery_crud/css/jquery_plugins/chosen/chosen.css index 49f1e47..ce4ef2f 100755 --- a/assets/grocery_crud/css/jquery_plugins/chosen/chosen.css +++ b/assets/grocery_crud/css/jquery_plugins/chosen/chosen.css @@ -1,392 +1,392 @@ -/* @group Base */ -.chzn-container { - font-size: 13px; - position: relative; - display: inline-block; - zoom: 1; - *display: inline; -} -.chzn-container .chzn-drop { - background: #fff; - border: 1px solid #aaa; - border-top: 0; - position: absolute; - top: 29px; - left: 0; - -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15); - -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15); - -o-box-shadow : 0 4px 5px rgba(0,0,0,.15); - box-shadow : 0 4px 5px rgba(0,0,0,.15); - z-index: 999; -} -/* @end */ - -/* @group Single Chosen */ -.chzn-container-single .chzn-single { - background-color: #ffffff; - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 ); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4)); - background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); - background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); - background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); - background-image: -ms-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); - background-image: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); - -webkit-border-radius: 5px; - -moz-border-radius : 5px; - border-radius : 5px; - -moz-background-clip : padding; - -webkit-background-clip: padding-box; - background-clip : padding-box; - border: 1px solid #aaaaaa; - -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1); - -moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1); - box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1); - display: block; - overflow: hidden; - white-space: nowrap; - position: relative; - height: 23px; - line-height: 24px; - padding: 0 0 0 8px; - color: #444444; - text-decoration: none; -} -.chzn-container-single .chzn-default { - color: #999; -} -.chzn-container-single .chzn-single span { - margin-right: 26px; - display: block; - overflow: hidden; - white-space: nowrap; - -o-text-overflow: ellipsis; - -ms-text-overflow: ellipsis; - text-overflow: ellipsis; -} -.chzn-container-single .chzn-single abbr { - display: block; - position: absolute; - right: 26px; - top: 6px; - width: 12px; - height: 13px; - font-size: 1px; - background: url(chosen-sprite.png) right top no-repeat; -} -.chzn-container-single .chzn-single abbr:hover { - background-position: right -11px; -} -.chzn-container-single .chzn-single div { - position: absolute; - right: 0; - top: 0; - display: block; - height: 100%; - width: 18px; -} -.chzn-container-single .chzn-single div b { - background: url('chosen-sprite.png') no-repeat 0 0; - display: block; - width: 100%; - height: 100%; -} -.chzn-container-single .chzn-search { - padding: 3px 4px; - position: relative; - margin: 0; - white-space: nowrap; - z-index: 1010; -} -.chzn-container-single .chzn-search input { - background: #fff url('chosen-sprite.png') no-repeat 100% -22px; - background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); - background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(top, #eeeeee 1%, #ffffff 15%); - margin: 1px 0; - padding: 4px 20px 4px 5px; - outline: 0; - border: 1px solid #aaa; - font-family: sans-serif; - font-size: 1em; -} -.chzn-container-single .chzn-drop { - -webkit-border-radius: 0 0 4px 4px; - -moz-border-radius : 0 0 4px 4px; - border-radius : 0 0 4px 4px; - -moz-background-clip : padding; - -webkit-background-clip: padding-box; - background-clip : padding-box; -} -/* @end */ - -.chzn-container-single-nosearch .chzn-search input { - position: absolute; - left: -9000px; -} - -/* @group Multi Chosen */ -.chzn-container-multi .chzn-choices { - background-color: #fff; - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); - background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%); - border: 1px solid #aaa; - margin: 0; - padding: 0; - cursor: text; - overflow: hidden; - height: auto !important; - height: 1%; - position: relative; -} -.chzn-container-multi .chzn-choices li { - float: left; - list-style: none; -} -.chzn-container-multi .chzn-choices .search-field { - white-space: nowrap; - margin: 0; - padding: 0; -} -.chzn-container-multi .chzn-choices .search-field input { - color: #666; - background: transparent !important; - border: 0 !important; - font-family: sans-serif; - font-size: 100%; - height: 15px; - padding: 5px; - margin: 1px 0; - outline: 0; - -webkit-box-shadow: none; - -moz-box-shadow : none; - -o-box-shadow : none; - box-shadow : none; -} -.chzn-container-multi .chzn-choices .search-field .default { - color: #999; -} -.chzn-container-multi .chzn-choices .search-choice { - -webkit-border-radius: 3px; - -moz-border-radius : 3px; - border-radius : 3px; - -moz-background-clip : padding; - -webkit-background-clip: padding-box; - background-clip : padding-box; - background-color: #e4e4e4; - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 ); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee)); - background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); - -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); - box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); - color: #333; - border: 1px solid #aaaaaa; - line-height: 13px; - padding: 3px 20px 3px 5px; - margin: 3px 0 3px 5px; - position: relative; - cursor: default; -} -.chzn-container-multi .chzn-choices .search-choice-focus { - background: #d4d4d4; -} -.chzn-container-multi .chzn-choices .search-choice .search-choice-close { - display: block; - position: absolute; - right: 3px; - top: 4px; - width: 12px; - height: 13px; - font-size: 1px; - background: url(chosen-sprite.png) right top no-repeat; -} -.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover { - background-position: right -11px; -} -.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close { - background-position: right -11px; -} -/* @end */ - -/* @group Results */ -.chzn-container .chzn-results { - margin: 0 4px 4px 0; - max-height: 240px; - padding: 0 0 0 4px; - position: relative; - overflow-x: hidden; - overflow-y: auto; -} -.chzn-container-multi .chzn-results { - margin: -1px 0 0; - padding: 0; -} -.chzn-container .chzn-results li { - display: none; - line-height: 15px; - padding: 5px 6px; - margin: 0; - list-style: none; -} -.chzn-container .chzn-results .active-result { - cursor: pointer; - display: list-item; -} -.chzn-container .chzn-results .highlighted { - background-color: #3875d7; - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 ); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc)); - background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%); - background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%); - background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%); - background-image: -ms-linear-gradient(top, #3875d7 20%, #2a62bc 90%); - background-image: linear-gradient(top, #3875d7 20%, #2a62bc 90%); - color: #fff; -} -.chzn-container .chzn-results li em { - background: #feffde; - font-style: normal; -} -.chzn-container .chzn-results .highlighted em { - background: transparent; -} -.chzn-container .chzn-results .no-results { - background: #f4f4f4; - display: list-item; -} -.chzn-container .chzn-results .group-result { - cursor: default; - color: #999; - font-weight: bold; -} -.chzn-container .chzn-results .group-option { - padding-left: 15px; -} -.chzn-container-multi .chzn-drop .result-selected { - display: none; -} -.chzn-container .chzn-results-scroll { - background: white; - margin: 0 4px; - position: absolute; - text-align: center; - width: 321px; /* This should by dynamic with js */ - z-index: 1; -} -.chzn-container .chzn-results-scroll span { - display: inline-block; - height: 17px; - text-indent: -5000px; - width: 9px; -} -.chzn-container .chzn-results-scroll-down { - bottom: 0; -} -.chzn-container .chzn-results-scroll-down span { - background: url('chosen-sprite.png') no-repeat -4px -3px; -} -.chzn-container .chzn-results-scroll-up span { - background: url('chosen-sprite.png') no-repeat -22px -3px; -} -/* @end */ - -/* @group Active */ -.chzn-container-active .chzn-single { - -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); - -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); - -o-box-shadow : 0 0 5px rgba(0,0,0,.3); - box-shadow : 0 0 5px rgba(0,0,0,.3); - border: 1px solid #5897fb; -} -.chzn-container-active .chzn-single-with-drop { - border: 1px solid #aaa; - -webkit-box-shadow: 0 1px 0 #fff inset; - -moz-box-shadow : 0 1px 0 #fff inset; - -o-box-shadow : 0 1px 0 #fff inset; - box-shadow : 0 1px 0 #fff inset; - background-color: #eee; - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 ); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff)); - background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%); - background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%); - background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%); - background-image: -ms-linear-gradient(top, #eeeeee 20%, #ffffff 80%); - background-image: linear-gradient(top, #eeeeee 20%, #ffffff 80%); - -webkit-border-bottom-left-radius : 0; - -webkit-border-bottom-right-radius: 0; - -moz-border-radius-bottomleft : 0; - -moz-border-radius-bottomright: 0; - border-bottom-left-radius : 0; - border-bottom-right-radius: 0; -} -.chzn-container-active .chzn-single-with-drop div { - background: transparent; - border-left: none; -} -.chzn-container-active .chzn-single-with-drop div b { - background-position: -18px 1px; -} -.chzn-container-active .chzn-choices { - -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); - -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); - -o-box-shadow : 0 0 5px rgba(0,0,0,.3); - box-shadow : 0 0 5px rgba(0,0,0,.3); - border: 1px solid #5897fb; -} -.chzn-container-active .chzn-choices .search-field input { - color: #111 !important; -} -/* @end */ - -/* @group Disabled Support */ -.chzn-disabled { - cursor: default; - opacity:0.5 !important; -} -.chzn-disabled .chzn-single { - cursor: default; -} -.chzn-disabled .chzn-choices .search-choice .search-choice-close { - cursor: default; -} - -/* @group Right to Left */ -.chzn-rtl { text-align: right; } -.chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; } -.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; } - -.chzn-rtl .chzn-single div { left: 3px; right: auto; } -.chzn-rtl .chzn-single abbr { - left: 26px; - right: auto; -} -.chzn-rtl .chzn-choices .search-field input { direction: rtl; } -.chzn-rtl .chzn-choices li { float: right; } -.chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; } -.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; background-position: right top;} -.chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; } -.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; } -.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; } -.chzn-rtl .chzn-search input { - background: #fff url('chosen-sprite.png') no-repeat -38px -22px; - background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); - background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(top, #eeeeee 1%, #ffffff 15%); - padding: 4px 5px 4px 20px; - direction: rtl; -} -/* @end */ +/* @group Base */ +.chzn-container { + font-size: 13px; + position: relative; + display: inline-block; + zoom: 1; + *display: inline; +} +.chzn-container .chzn-drop { + background: #fff; + border: 1px solid #aaa; + border-top: 0; + position: absolute; + top: 29px; + left: 0; + -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15); + -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15); + -o-box-shadow : 0 4px 5px rgba(0,0,0,.15); + box-shadow : 0 4px 5px rgba(0,0,0,.15); + z-index: 999; +} +/* @end */ + +/* @group Single Chosen */ +.chzn-container-single .chzn-single { + background-color: #ffffff; + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 ); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4)); + background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); + background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); + background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); + background-image: -ms-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); + background-image: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); + -webkit-border-radius: 5px; + -moz-border-radius : 5px; + border-radius : 5px; + -moz-background-clip : padding; + -webkit-background-clip: padding-box; + background-clip : padding-box; + border: 1px solid #aaaaaa; + -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1); + -moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1); + box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1); + display: block; + overflow: hidden; + white-space: nowrap; + position: relative; + height: 23px; + line-height: 24px; + padding: 0 0 0 8px; + color: #444444; + text-decoration: none; +} +.chzn-container-single .chzn-default { + color: #999; +} +.chzn-container-single .chzn-single span { + margin-right: 26px; + display: block; + overflow: hidden; + white-space: nowrap; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; + text-overflow: ellipsis; +} +.chzn-container-single .chzn-single abbr { + display: block; + position: absolute; + right: 26px; + top: 6px; + width: 12px; + height: 13px; + font-size: 1px; + background: url(chosen-sprite.png) right top no-repeat; +} +.chzn-container-single .chzn-single abbr:hover { + background-position: right -11px; +} +.chzn-container-single .chzn-single div { + position: absolute; + right: 0; + top: 0; + display: block; + height: 100%; + width: 18px; +} +.chzn-container-single .chzn-single div b { + background: url('chosen-sprite.png') no-repeat 0 0; + display: block; + width: 100%; + height: 100%; +} +.chzn-container-single .chzn-search { + padding: 3px 4px; + position: relative; + margin: 0; + white-space: nowrap; + z-index: 1010; +} +.chzn-container-single .chzn-search input { + background: #fff url('chosen-sprite.png') no-repeat 100% -22px; + background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); + background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(top, #eeeeee 1%, #ffffff 15%); + margin: 1px 0; + padding: 4px 20px 4px 5px; + outline: 0; + border: 1px solid #aaa; + font-family: sans-serif; + font-size: 1em; +} +.chzn-container-single .chzn-drop { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius : 0 0 4px 4px; + border-radius : 0 0 4px 4px; + -moz-background-clip : padding; + -webkit-background-clip: padding-box; + background-clip : padding-box; +} +/* @end */ + +.chzn-container-single-nosearch .chzn-search input { + position: absolute; + left: -9000px; +} + +/* @group Multi Chosen */ +.chzn-container-multi .chzn-choices { + background-color: #fff; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); + background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%); + border: 1px solid #aaa; + margin: 0; + padding: 0; + cursor: text; + overflow: hidden; + height: auto !important; + height: 1%; + position: relative; +} +.chzn-container-multi .chzn-choices li { + float: left; + list-style: none; +} +.chzn-container-multi .chzn-choices .search-field { + white-space: nowrap; + margin: 0; + padding: 0; +} +.chzn-container-multi .chzn-choices .search-field input { + color: #666; + background: transparent !important; + border: 0 !important; + font-family: sans-serif; + font-size: 100%; + height: 15px; + padding: 5px; + margin: 1px 0; + outline: 0; + -webkit-box-shadow: none; + -moz-box-shadow : none; + -o-box-shadow : none; + box-shadow : none; +} +.chzn-container-multi .chzn-choices .search-field .default { + color: #999; +} +.chzn-container-multi .chzn-choices .search-choice { + -webkit-border-radius: 3px; + -moz-border-radius : 3px; + border-radius : 3px; + -moz-background-clip : padding; + -webkit-background-clip: padding-box; + background-clip : padding-box; + background-color: #e4e4e4; + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 ); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee)); + background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + color: #333; + border: 1px solid #aaaaaa; + line-height: 13px; + padding: 3px 20px 3px 5px; + margin: 3px 0 3px 5px; + position: relative; + cursor: default; +} +.chzn-container-multi .chzn-choices .search-choice-focus { + background: #d4d4d4; +} +.chzn-container-multi .chzn-choices .search-choice .search-choice-close { + display: block; + position: absolute; + right: 3px; + top: 4px; + width: 12px; + height: 13px; + font-size: 1px; + background: url(chosen-sprite.png) right top no-repeat; +} +.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover { + background-position: right -11px; +} +.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close { + background-position: right -11px; +} +/* @end */ + +/* @group Results */ +.chzn-container .chzn-results { + margin: 0 4px 4px 0; + max-height: 240px; + padding: 0 0 0 4px; + position: relative; + overflow-x: hidden; + overflow-y: auto; +} +.chzn-container-multi .chzn-results { + margin: -1px 0 0; + padding: 0; +} +.chzn-container .chzn-results li { + display: none; + line-height: 15px; + padding: 5px 6px; + margin: 0; + list-style: none; +} +.chzn-container .chzn-results .active-result { + cursor: pointer; + display: list-item; +} +.chzn-container .chzn-results .highlighted { + background-color: #3875d7; + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 ); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc)); + background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%); + background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%); + background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%); + background-image: -ms-linear-gradient(top, #3875d7 20%, #2a62bc 90%); + background-image: linear-gradient(top, #3875d7 20%, #2a62bc 90%); + color: #fff; +} +.chzn-container .chzn-results li em { + background: #feffde; + font-style: normal; +} +.chzn-container .chzn-results .highlighted em { + background: transparent; +} +.chzn-container .chzn-results .no-results { + background: #f4f4f4; + display: list-item; +} +.chzn-container .chzn-results .group-result { + cursor: default; + color: #999; + font-weight: bold; +} +.chzn-container .chzn-results .group-option { + padding-left: 15px; +} +.chzn-container-multi .chzn-drop .result-selected { + display: none; +} +.chzn-container .chzn-results-scroll { + background: white; + margin: 0 4px; + position: absolute; + text-align: center; + width: 321px; /* This should by dynamic with js */ + z-index: 1; +} +.chzn-container .chzn-results-scroll span { + display: inline-block; + height: 17px; + text-indent: -5000px; + width: 9px; +} +.chzn-container .chzn-results-scroll-down { + bottom: 0; +} +.chzn-container .chzn-results-scroll-down span { + background: url('chosen-sprite.png') no-repeat -4px -3px; +} +.chzn-container .chzn-results-scroll-up span { + background: url('chosen-sprite.png') no-repeat -22px -3px; +} +/* @end */ + +/* @group Active */ +.chzn-container-active .chzn-single { + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); + -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); + -o-box-shadow : 0 0 5px rgba(0,0,0,.3); + box-shadow : 0 0 5px rgba(0,0,0,.3); + border: 1px solid #5897fb; +} +.chzn-container-active .chzn-single-with-drop { + border: 1px solid #aaa; + -webkit-box-shadow: 0 1px 0 #fff inset; + -moz-box-shadow : 0 1px 0 #fff inset; + -o-box-shadow : 0 1px 0 #fff inset; + box-shadow : 0 1px 0 #fff inset; + background-color: #eee; + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 ); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff)); + background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%); + background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%); + background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%); + background-image: -ms-linear-gradient(top, #eeeeee 20%, #ffffff 80%); + background-image: linear-gradient(top, #eeeeee 20%, #ffffff 80%); + -webkit-border-bottom-left-radius : 0; + -webkit-border-bottom-right-radius: 0; + -moz-border-radius-bottomleft : 0; + -moz-border-radius-bottomright: 0; + border-bottom-left-radius : 0; + border-bottom-right-radius: 0; +} +.chzn-container-active .chzn-single-with-drop div { + background: transparent; + border-left: none; +} +.chzn-container-active .chzn-single-with-drop div b { + background-position: -18px 1px; +} +.chzn-container-active .chzn-choices { + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); + -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); + -o-box-shadow : 0 0 5px rgba(0,0,0,.3); + box-shadow : 0 0 5px rgba(0,0,0,.3); + border: 1px solid #5897fb; +} +.chzn-container-active .chzn-choices .search-field input { + color: #111 !important; +} +/* @end */ + +/* @group Disabled Support */ +.chzn-disabled { + cursor: default; + opacity:0.5 !important; +} +.chzn-disabled .chzn-single { + cursor: default; +} +.chzn-disabled .chzn-choices .search-choice .search-choice-close { + cursor: default; +} + +/* @group Right to Left */ +.chzn-rtl { text-align: right; } +.chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; } +.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; } + +.chzn-rtl .chzn-single div { left: 3px; right: auto; } +.chzn-rtl .chzn-single abbr { + left: 26px; + right: auto; +} +.chzn-rtl .chzn-choices .search-field input { direction: rtl; } +.chzn-rtl .chzn-choices li { float: right; } +.chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; } +.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; background-position: right top;} +.chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; } +.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; } +.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; } +.chzn-rtl .chzn-search input { + background: #fff url('chosen-sprite.png') no-repeat -38px -22px; + background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); + background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(top, #eeeeee 1%, #ffffff 15%); + padding: 4px 5px 4px 20px; + direction: rtl; +} +/* @end */ diff --git a/assets/grocery_crud/css/jquery_plugins/chosen/index.html b/assets/grocery_crud/css/jquery_plugins/chosen/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/css/jquery_plugins/chosen/index.html +++ b/assets/grocery_crud/css/jquery_plugins/chosen/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/css/jquery_plugins/fancybox/jquery.fancybox.css b/assets/grocery_crud/css/jquery_plugins/fancybox/jquery.fancybox.css index 6f53d8f..1032a9a 100755 --- a/assets/grocery_crud/css/jquery_plugins/fancybox/jquery.fancybox.css +++ b/assets/grocery_crud/css/jquery_plugins/fancybox/jquery.fancybox.css @@ -1,359 +1,359 @@ -/* - * FancyBox - jQuery Plugin - * Simple and fancy lightbox alternative - * - * Examples and documentation at: http://fancybox.net - * - * Copyright (c) 2008 - 2010 Janis Skarnelis - * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. - * - * Version: 1.3.4 (11/11/2010) - * Requires: jQuery v1.3+ - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ - -#fancybox-loading { - position: fixed; - top: 50%; - left: 50%; - width: 40px; - height: 40px; - margin-top: -20px; - margin-left: -20px; - cursor: pointer; - overflow: hidden; - z-index: 1104; - display: none; -} - -#fancybox-loading div { - position: absolute; - top: 0; - left: 0; - width: 40px; - height: 480px; - background-image: url('fancybox.png'); -} - -#fancybox-overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - z-index: 1100; - display: none; -} - -#fancybox-tmp { - padding: 0; - margin: 0; - border: 0; - overflow: auto; - display: none; -} - -#fancybox-wrap { - position: absolute; - top: 0; - left: 0; - padding: 20px; - z-index: 1101; - outline: none; - display: none; -} - -#fancybox-outer { - position: relative; - width: 100%; - height: 100%; - background: #fff; -} - -#fancybox-content { - width: 0; - height: 0; - padding: 0; - outline: none; - position: relative; - overflow: hidden; - z-index: 1102; - border: 0px solid #fff; -} - -#fancybox-hide-sel-frame { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: transparent; - z-index: 1101; -} - -#fancybox-close { - position: absolute; - top: -15px; - right: -15px; - width: 30px; - height: 30px; - background: transparent url('fancybox.png') -40px 0px; - cursor: pointer; - z-index: 1103; - display: none; -} - -#fancybox-error { - color: #444; - font: normal 12px/20px Arial; - padding: 14px; - margin: 0; -} - -#fancybox-img { - width: 100%; - height: 100%; - padding: 0; - margin: 0; - border: none; - outline: none; - line-height: 0; - vertical-align: top; -} - -#fancybox-frame { - width: 100%; - height: 100%; - border: none; - display: block; -} - -#fancybox-left, #fancybox-right { - position: absolute; - bottom: 0px; - height: 100%; - width: 35%; - cursor: pointer; - outline: none; - background: transparent url('blank.gif'); - z-index: 1102; - display: none; -} - -#fancybox-left { - left: 0px; -} - -#fancybox-right { - right: 0px; -} - -#fancybox-left-ico, #fancybox-right-ico { - position: absolute; - top: 50%; - left: -9999px; - width: 30px; - height: 30px; - margin-top: -15px; - cursor: pointer; - z-index: 1102; - display: block; -} - -#fancybox-left-ico { - background-image: url('fancybox.png'); - background-position: -40px -30px; -} - -#fancybox-right-ico { - background-image: url('fancybox.png'); - background-position: -40px -60px; -} - -#fancybox-left:hover, #fancybox-right:hover { - visibility: visible; /* IE6 */ -} - -#fancybox-left:hover span { - left: 20px; -} - -#fancybox-right:hover span { - left: auto; - right: 20px; -} - -.fancybox-bg { - position: absolute; - padding: 0; - margin: 0; - border: 0; - width: 20px; - height: 20px; - z-index: 1001; -} - -#fancybox-bg-n { - top: -20px; - left: 0; - width: 100%; - background-image: url('fancybox-x.png'); -} - -#fancybox-bg-ne { - top: -20px; - right: -20px; - background-image: url('fancybox.png'); - background-position: -40px -162px; -} - -#fancybox-bg-e { - top: 0; - right: -20px; - height: 100%; - background-image: url('fancybox-y.png'); - background-position: -20px 0px; -} - -#fancybox-bg-se { - bottom: -20px; - right: -20px; - background-image: url('fancybox.png'); - background-position: -40px -182px; -} - -#fancybox-bg-s { - bottom: -20px; - left: 0; - width: 100%; - background-image: url('fancybox-x.png'); - background-position: 0px -20px; -} - -#fancybox-bg-sw { - bottom: -20px; - left: -20px; - background-image: url('fancybox.png'); - background-position: -40px -142px; -} - -#fancybox-bg-w { - top: 0; - left: -20px; - height: 100%; - background-image: url('fancybox-y.png'); -} - -#fancybox-bg-nw { - top: -20px; - left: -20px; - background-image: url('fancybox.png'); - background-position: -40px -122px; -} - -#fancybox-title { - font-family: Helvetica; - font-size: 12px; - z-index: 1102; -} - -.fancybox-title-inside { - padding-bottom: 10px; - text-align: center; - color: #333; - background: #fff; - position: relative; -} - -.fancybox-title-outside { - padding-top: 10px; - color: #fff; -} - -.fancybox-title-over { - position: absolute; - bottom: 0; - left: 0; - color: #FFF; - text-align: left; -} - -#fancybox-title-over { - padding: 10px; - background-image: url('fancy_title_over.png'); - display: block; -} - -.fancybox-title-float { - position: absolute; - left: 0; - bottom: -20px; - height: 32px; -} - -#fancybox-title-float-wrap { - border: none; - border-collapse: collapse; - width: auto; -} - -#fancybox-title-float-wrap td { - border: none; - white-space: nowrap; -} - -#fancybox-title-float-left { - padding: 0 0 0 15px; - background: url('fancybox.png') -40px -90px no-repeat; -} - -#fancybox-title-float-main { - color: #FFF; - line-height: 29px; - font-weight: bold; - padding: 0 0 3px 0; - background: url('fancybox-x.png') 0px -40px; -} - -#fancybox-title-float-right { - padding: 0 0 0 15px; - background: url('fancybox.png') -55px -90px no-repeat; -} - -/* IE6 */ - -.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); } - -.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); } - -.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } -.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); } - -.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { - height: expression(this.parentNode.clientHeight + "px"); -} - -#fancybox-loading.fancybox-ie6 { - position: absolute; margin-top: 0; - top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); -} - -#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); } - -/* IE6, IE7, IE8 */ - -.fancybox-ie .fancybox-bg { background: transparent !important; } - -.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); } +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + width: 40px; + height: 40px; + margin-top: -20px; + margin-left: -20px; + cursor: pointer; + overflow: hidden; + z-index: 1104; + display: none; +} + +#fancybox-loading div { + position: absolute; + top: 0; + left: 0; + width: 40px; + height: 480px; + background-image: url('fancybox.png'); +} + +#fancybox-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 1100; + display: none; +} + +#fancybox-tmp { + padding: 0; + margin: 0; + border: 0; + overflow: auto; + display: none; +} + +#fancybox-wrap { + position: absolute; + top: 0; + left: 0; + padding: 20px; + z-index: 1101; + outline: none; + display: none; +} + +#fancybox-outer { + position: relative; + width: 100%; + height: 100%; + background: #fff; +} + +#fancybox-content { + width: 0; + height: 0; + padding: 0; + outline: none; + position: relative; + overflow: hidden; + z-index: 1102; + border: 0px solid #fff; +} + +#fancybox-hide-sel-frame { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: transparent; + z-index: 1101; +} + +#fancybox-close { + position: absolute; + top: -15px; + right: -15px; + width: 30px; + height: 30px; + background: transparent url('fancybox.png') -40px 0px; + cursor: pointer; + z-index: 1103; + display: none; +} + +#fancybox-error { + color: #444; + font: normal 12px/20px Arial; + padding: 14px; + margin: 0; +} + +#fancybox-img { + width: 100%; + height: 100%; + padding: 0; + margin: 0; + border: none; + outline: none; + line-height: 0; + vertical-align: top; +} + +#fancybox-frame { + width: 100%; + height: 100%; + border: none; + display: block; +} + +#fancybox-left, #fancybox-right { + position: absolute; + bottom: 0px; + height: 100%; + width: 35%; + cursor: pointer; + outline: none; + background: transparent url('blank.gif'); + z-index: 1102; + display: none; +} + +#fancybox-left { + left: 0px; +} + +#fancybox-right { + right: 0px; +} + +#fancybox-left-ico, #fancybox-right-ico { + position: absolute; + top: 50%; + left: -9999px; + width: 30px; + height: 30px; + margin-top: -15px; + cursor: pointer; + z-index: 1102; + display: block; +} + +#fancybox-left-ico { + background-image: url('fancybox.png'); + background-position: -40px -30px; +} + +#fancybox-right-ico { + background-image: url('fancybox.png'); + background-position: -40px -60px; +} + +#fancybox-left:hover, #fancybox-right:hover { + visibility: visible; /* IE6 */ +} + +#fancybox-left:hover span { + left: 20px; +} + +#fancybox-right:hover span { + left: auto; + right: 20px; +} + +.fancybox-bg { + position: absolute; + padding: 0; + margin: 0; + border: 0; + width: 20px; + height: 20px; + z-index: 1001; +} + +#fancybox-bg-n { + top: -20px; + left: 0; + width: 100%; + background-image: url('fancybox-x.png'); +} + +#fancybox-bg-ne { + top: -20px; + right: -20px; + background-image: url('fancybox.png'); + background-position: -40px -162px; +} + +#fancybox-bg-e { + top: 0; + right: -20px; + height: 100%; + background-image: url('fancybox-y.png'); + background-position: -20px 0px; +} + +#fancybox-bg-se { + bottom: -20px; + right: -20px; + background-image: url('fancybox.png'); + background-position: -40px -182px; +} + +#fancybox-bg-s { + bottom: -20px; + left: 0; + width: 100%; + background-image: url('fancybox-x.png'); + background-position: 0px -20px; +} + +#fancybox-bg-sw { + bottom: -20px; + left: -20px; + background-image: url('fancybox.png'); + background-position: -40px -142px; +} + +#fancybox-bg-w { + top: 0; + left: -20px; + height: 100%; + background-image: url('fancybox-y.png'); +} + +#fancybox-bg-nw { + top: -20px; + left: -20px; + background-image: url('fancybox.png'); + background-position: -40px -122px; +} + +#fancybox-title { + font-family: Helvetica; + font-size: 12px; + z-index: 1102; +} + +.fancybox-title-inside { + padding-bottom: 10px; + text-align: center; + color: #333; + background: #fff; + position: relative; +} + +.fancybox-title-outside { + padding-top: 10px; + color: #fff; +} + +.fancybox-title-over { + position: absolute; + bottom: 0; + left: 0; + color: #FFF; + text-align: left; +} + +#fancybox-title-over { + padding: 10px; + background-image: url('fancy_title_over.png'); + display: block; +} + +.fancybox-title-float { + position: absolute; + left: 0; + bottom: -20px; + height: 32px; +} + +#fancybox-title-float-wrap { + border: none; + border-collapse: collapse; + width: auto; +} + +#fancybox-title-float-wrap td { + border: none; + white-space: nowrap; +} + +#fancybox-title-float-left { + padding: 0 0 0 15px; + background: url('fancybox.png') -40px -90px no-repeat; +} + +#fancybox-title-float-main { + color: #FFF; + line-height: 29px; + font-weight: bold; + padding: 0 0 3px 0; + background: url('fancybox-x.png') 0px -40px; +} + +#fancybox-title-float-right { + padding: 0 0 0 15px; + background: url('fancybox.png') -55px -90px no-repeat; +} + +/* IE6 */ + +.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } +.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { + height: expression(this.parentNode.clientHeight + "px"); +} + +#fancybox-loading.fancybox-ie6 { + position: absolute; margin-top: 0; + top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); +} + +#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); } + +/* IE6, IE7, IE8 */ + +.fancybox-ie .fancybox-bg { background: transparent !important; } + +.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); } .fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } \ No newline at end of file diff --git a/assets/grocery_crud/css/jquery_plugins/file_upload/bootstrap.min.css b/assets/grocery_crud/css/jquery_plugins/file_upload/bootstrap.min.css index 843d6b9..22b3ecc 100755 --- a/assets/grocery_crud/css/jquery_plugins/file_upload/bootstrap.min.css +++ b/assets/grocery_crud/css/jquery_plugins/file_upload/bootstrap.min.css @@ -1,360 +1,360 @@ -html,body{margin:0;padding:0;} -h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite,code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var,dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;} -table{border-collapse:collapse;border-spacing:0;} -ol,ul{list-style:none;} -q:before,q:after,blockquote:before,blockquote:after{content:"";} -html{overflow-y:scroll;font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} -a:focus{outline:thin dotted;} -a:hover,a:active{outline:0;} -article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} -audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} -audio:not([controls]){display:none;} -sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;} -sup{top:-0.5em;} -sub{bottom:-0.25em;} -img{border:0;-ms-interpolation-mode:bicubic;} -button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;} -button,input{line-height:normal;*overflow:visible;} -button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;} -button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;} -input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;} -input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;} -textarea{overflow:auto;vertical-align:top;} -body{background-color:#ffffff;margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:18px;color:#404040;} -.container{width:940px;margin-left:auto;margin-right:auto;zoom:1;}.container:before,.container:after{display:table;content:"";zoom:1;} -.container:after{clear:both;} -.container-fluid{position:relative;min-width:940px;padding-left:20px;padding-right:20px;zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";zoom:1;} -.container-fluid:after{clear:both;} -.container-fluid>.sidebar{position:absolute;top:0;left:20px;width:220px;} -.container-fluid>.content{margin-left:240px;} -a{color:#0069d6;text-decoration:none;line-height:inherit;font-weight:inherit;}a:hover{color:#00438a;text-decoration:underline;} -.pull-right{float:right;} -.pull-left{float:left;} -.hide{display:none;} -.show{display:block;} -.row{zoom:1;margin-left:-20px;}.row:before,.row:after{display:table;content:"";zoom:1;} -.row:after{clear:both;} -.row>[class*="span"]{display:inline;float:left;margin-left:20px;} -.span1{width:40px;} -.span2{width:100px;} -.span3{width:160px;} -.span4{width:220px;} -.span5{width:280px;} -.span6{width:340px;} -.span7{width:400px;} -.span8{width:460px;} -.span9{width:520px;} -.span10{width:580px;} -.span11{width:640px;} -.span12{width:700px;} -.span13{width:760px;} -.span14{width:820px;} -.span15{width:880px;} -.span16{width:940px;} -.span17{width:1000px;} -.span18{width:1060px;} -.span19{width:1120px;} -.span20{width:1180px;} -.span21{width:1240px;} -.span22{width:1300px;} -.span23{width:1360px;} -.span24{width:1420px;} -.row>.offset1{margin-left:80px;} -.row>.offset2{margin-left:140px;} -.row>.offset3{margin-left:200px;} -.row>.offset4{margin-left:260px;} -.row>.offset5{margin-left:320px;} -.row>.offset6{margin-left:380px;} -.row>.offset7{margin-left:440px;} -.row>.offset8{margin-left:500px;} -.row>.offset9{margin-left:560px;} -.row>.offset10{margin-left:620px;} -.row>.offset11{margin-left:680px;} -.row>.offset12{margin-left:740px;} -.span-one-third{width:300px;} -.span-two-thirds{width:620px;} -.row>.offset-one-third{margin-left:340px;} -.row>.offset-two-thirds{margin-left:660px;} -p{font-size:13px;font-weight:normal;line-height:18px;margin-bottom:9px;}p small{font-size:11px;color:#bfbfbf;} -h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;} -h1{margin-bottom:18px;font-size:30px;line-height:36px;}h1 small{font-size:18px;} -h2{font-size:24px;line-height:36px;}h2 small{font-size:14px;} -h3,h4,h5,h6{line-height:36px;} -h3{font-size:18px;}h3 small{font-size:14px;} -h4{font-size:16px;}h4 small{font-size:12px;} -h5{font-size:14px;} -h6{font-size:13px;color:#bfbfbf;text-transform:uppercase;} -ul,ol{margin:0 0 18px 25px;} -ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} -ul{list-style:disc;} -ol{list-style:decimal;} -li{line-height:18px;color:#808080;} -ul.unstyled{list-style:none;margin-left:0;} -dl{margin-bottom:18px;}dl dt,dl dd{line-height:18px;} -dl dt{font-weight:bold;} -dl dd{margin-left:9px;} -hr{margin:20px 0 19px;border:0;border-bottom:1px solid #eee;} -strong{font-style:inherit;font-weight:bold;} -em{font-style:italic;font-weight:inherit;line-height:inherit;} -.muted{color:#bfbfbf;} -blockquote{margin-bottom:18px;border-left:5px solid #eee;padding-left:15px;}blockquote p{font-size:14px;font-weight:300;line-height:18px;margin-bottom:0;} -blockquote small{display:block;font-size:12px;font-weight:300;line-height:18px;color:#bfbfbf;}blockquote small:before{content:'\2014 \00A0';} -address{display:block;line-height:18px;margin-bottom:18px;} -code,pre{padding:0 3px 2px;font-family:Monaco, Andale Mono, Courier New, monospace;font-size:12px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} -code{background-color:#fee9cc;color:rgba(0, 0, 0, 0.75);padding:1px 3px;} -pre{background-color:#f5f5f5;display:block;padding:8.5px;margin:0 0 18px;line-height:18px;font-size:12px;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;white-space:pre;white-space:pre-wrap;word-wrap:break-word;} -form{margin-bottom:18px;} -fieldset{margin-bottom:18px;padding-top:18px;}fieldset legend{display:block;padding-left:150px;font-size:19.5px;line-height:1;color:#404040;*padding:0 0 5px 145px;*line-height:1.5;} -form .clearfix{margin-bottom:18px;zoom:1;}form .clearfix:before,form .clearfix:after{display:table;content:"";zoom:1;} -form .clearfix:after{clear:both;} -label,input,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:normal;} -label{padding-top:6px;font-size:13px;line-height:18px;float:left;width:130px;text-align:right;color:#404040;} -form .input{margin-left:150px;} -input[type=checkbox],input[type=radio]{cursor:pointer;} -input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;font-size:13px;line-height:18px;color:#808080;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} -select{padding:initial;} -input[type=checkbox],input[type=radio]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;border:none;} -input[type=file]{background-color:#ffffff;padding:initial;border:initial;line-height:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} -input[type=button],input[type=reset],input[type=submit]{width:auto;height:auto;} -select,input[type=file]{height:27px;*height:auto;line-height:27px;*margin-top:4px;} -select[multiple]{height:inherit;background-color:#ffffff;} -textarea{height:auto;} -.uneditable-input{background-color:#ffffff;display:block;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;} -:-moz-placeholder{color:#bfbfbf;} -::-webkit-input-placeholder{color:#bfbfbf;} -input,textarea{-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);} -input:focus,textarea:focus{outline:0;border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);} -input[type=file]:focus,input[type=checkbox]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:1px dotted #666;} -form .clearfix.error>label,form .clearfix.error .help-block,form .clearfix.error .help-inline{color:#b94a48;} -form .clearfix.error input,form .clearfix.error textarea{color:#b94a48;border-color:#ee5f5b;}form .clearfix.error input:focus,form .clearfix.error textarea:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;} -form .clearfix.error .input-prepend .add-on,form .clearfix.error .input-append .add-on{color:#b94a48;background-color:#fce6e6;border-color:#b94a48;} -form .clearfix.warning>label,form .clearfix.warning .help-block,form .clearfix.warning .help-inline{color:#c09853;} -form .clearfix.warning input,form .clearfix.warning textarea{color:#c09853;border-color:#ccae64;}form .clearfix.warning input:focus,form .clearfix.warning textarea:focus{border-color:#be9a3f;-webkit-box-shadow:0 0 6px #e5d6b1;-moz-box-shadow:0 0 6px #e5d6b1;box-shadow:0 0 6px #e5d6b1;} -form .clearfix.warning .input-prepend .add-on,form .clearfix.warning .input-append .add-on{color:#c09853;background-color:#d2b877;border-color:#c09853;} -form .clearfix.success>label,form .clearfix.success .help-block,form .clearfix.success .help-inline{color:#468847;} -form .clearfix.success input,form .clearfix.success textarea{color:#468847;border-color:#57a957;}form .clearfix.success input:focus,form .clearfix.success textarea:focus{border-color:#458845;-webkit-box-shadow:0 0 6px #9acc9a;-moz-box-shadow:0 0 6px #9acc9a;box-shadow:0 0 6px #9acc9a;} -form .clearfix.success .input-prepend .add-on,form .clearfix.success .input-append .add-on{color:#468847;background-color:#bcddbc;border-color:#468847;} -.input-mini,input.mini,textarea.mini,select.mini{width:60px;} -.input-small,input.small,textarea.small,select.small{width:90px;} -.input-medium,input.medium,textarea.medium,select.medium{width:150px;} -.input-large,input.large,textarea.large,select.large{width:210px;} -.input-xlarge,input.xlarge,textarea.xlarge,select.xlarge{width:270px;} -.input-xxlarge,input.xxlarge,textarea.xxlarge,select.xxlarge{width:530px;} -textarea.xxlarge{overflow-y:auto;} -input.span1,textarea.span1{display:inline-block;float:none;width:30px;margin-left:0;} -input.span2,textarea.span2{display:inline-block;float:none;width:90px;margin-left:0;} -input.span3,textarea.span3{display:inline-block;float:none;width:150px;margin-left:0;} -input.span4,textarea.span4{display:inline-block;float:none;width:210px;margin-left:0;} -input.span5,textarea.span5{display:inline-block;float:none;width:270px;margin-left:0;} -input.span6,textarea.span6{display:inline-block;float:none;width:330px;margin-left:0;} -input.span7,textarea.span7{display:inline-block;float:none;width:390px;margin-left:0;} -input.span8,textarea.span8{display:inline-block;float:none;width:450px;margin-left:0;} -input.span9,textarea.span9{display:inline-block;float:none;width:510px;margin-left:0;} -input.span10,textarea.span10{display:inline-block;float:none;width:570px;margin-left:0;} -input.span11,textarea.span11{display:inline-block;float:none;width:630px;margin-left:0;} -input.span12,textarea.span12{display:inline-block;float:none;width:690px;margin-left:0;} -input.span13,textarea.span13{display:inline-block;float:none;width:750px;margin-left:0;} -input.span14,textarea.span14{display:inline-block;float:none;width:810px;margin-left:0;} -input.span15,textarea.span15{display:inline-block;float:none;width:870px;margin-left:0;} -input.span16,textarea.span16{display:inline-block;float:none;width:930px;margin-left:0;} -input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#f5f5f5;border-color:#ddd;cursor:not-allowed;} -.actions{background:#f5f5f5;margin-top:18px;margin-bottom:18px;padding:17px 20px 18px 150px;border-top:1px solid #ddd;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;}.actions .secondary-action{float:right;}.actions .secondary-action a{line-height:30px;}.actions .secondary-action a:hover{text-decoration:underline;} -.help-inline,.help-block{font-size:13px;line-height:18px;color:#bfbfbf;} -.help-inline{padding-left:5px;*position:relative;*top:-5px;} -.help-block{display:block;max-width:600px;} -.inline-inputs{color:#808080;}.inline-inputs span{padding:0 2px 0 1px;} -.input-prepend input,.input-append input{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} -.input-prepend .add-on,.input-append .add-on{position:relative;background:#f5f5f5;border:1px solid #ccc;z-index:2;float:left;display:block;width:auto;min-width:16px;height:18px;padding:4px 4px 4px 5px;margin-right:-1px;font-weight:normal;line-height:18px;color:#bfbfbf;text-align:center;text-shadow:0 1px 0 #ffffff;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} -.input-prepend .active,.input-append .active{background:#a9dba9;border-color:#46a546;} -.input-prepend .add-on{*margin-top:1px;} -.input-append input{float:left;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} -.input-append .add-on{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;margin-right:0;margin-left:-1px;} -.inputs-list{margin:0 0 5px;width:100%;}.inputs-list li{display:block;padding:0;width:100%;} -.inputs-list label{display:block;float:none;width:auto;padding:0;margin-left:20px;line-height:18px;text-align:left;white-space:normal;}.inputs-list label strong{color:#808080;} -.inputs-list label small{font-size:11px;font-weight:normal;} -.inputs-list .inputs-list{margin-left:25px;margin-bottom:10px;padding-top:0;} -.inputs-list:first-child{padding-top:6px;} -.inputs-list li+li{padding-top:2px;} -.inputs-list input[type=radio],.inputs-list input[type=checkbox]{margin-bottom:0;margin-left:-20px;float:left;} -.form-stacked{padding-left:20px;}.form-stacked fieldset{padding-top:9px;} -.form-stacked legend{padding-left:0;} -.form-stacked label{display:block;float:none;width:auto;font-weight:bold;text-align:left;line-height:20px;padding-top:0;} -.form-stacked .clearfix{margin-bottom:9px;}.form-stacked .clearfix div.input{margin-left:0;} -.form-stacked .inputs-list{margin-bottom:0;}.form-stacked .inputs-list li{padding-top:0;}.form-stacked .inputs-list li label{font-weight:normal;padding-top:0;} -.form-stacked div.clearfix.error{padding-top:10px;padding-bottom:10px;padding-left:10px;margin-top:0;margin-left:-10px;} -.form-stacked .actions{margin-left:-20px;padding-left:20px;} -table{width:100%;margin-bottom:18px;padding:0;font-size:13px;border-collapse:collapse;}table th,table td{padding:10px 10px 9px;line-height:18px;text-align:left;} -table th{padding-top:9px;font-weight:bold;vertical-align:middle;} -table td{vertical-align:top;border-top:1px solid #ddd;} -table tbody th{border-top:1px solid #ddd;vertical-align:top;} -.condensed-table th,.condensed-table td{padding:5px 5px 4px;} -.bordered-table{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.bordered-table th+th,.bordered-table td+td,.bordered-table th+td{border-left:1px solid #ddd;} -.bordered-table thead tr:first-child th:first-child,.bordered-table tbody tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;} -.bordered-table thead tr:first-child th:last-child,.bordered-table tbody tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;} -.bordered-table tbody tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;} -.bordered-table tbody tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;} -table .span1{width:20px;} -table .span2{width:60px;} -table .span3{width:100px;} -table .span4{width:140px;} -table .span5{width:180px;} -table .span6{width:220px;} -table .span7{width:260px;} -table .span8{width:300px;} -table .span9{width:340px;} -table .span10{width:380px;} -table .span11{width:420px;} -table .span12{width:460px;} -table .span13{width:500px;} -table .span14{width:540px;} -table .span15{width:580px;} -table .span16{width:620px;} -.zebra-striped tbody tr:nth-child(odd) td,.zebra-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;} -.zebra-striped tbody tr:hover td,.zebra-striped tbody tr:hover th{background-color:#f5f5f5;} -table .header{cursor:pointer;}table .header:after{content:"";float:right;margin-top:7px;border-width:0 4px 4px;border-style:solid;border-color:#000 transparent;visibility:hidden;} -table .headerSortUp,table .headerSortDown{background-color:rgba(141, 192, 219, 0.25);text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);} -table .header:hover:after{visibility:visible;} -table .headerSortDown:after,table .headerSortDown:hover:after{visibility:visible;filter:alpha(opacity=60);-khtml-opacity:0.6;-moz-opacity:0.6;opacity:0.6;} -table .headerSortUp:after{border-bottom:none;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;visibility:visible;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:alpha(opacity=60);-khtml-opacity:0.6;-moz-opacity:0.6;opacity:0.6;} -table .blue{color:#049cdb;border-bottom-color:#049cdb;} -table .headerSortUp.blue,table .headerSortDown.blue{background-color:#ade6fe;} -table .green{color:#46a546;border-bottom-color:#46a546;} -table .headerSortUp.green,table .headerSortDown.green{background-color:#cdeacd;} -table .red{color:#9d261d;border-bottom-color:#9d261d;} -table .headerSortUp.red,table .headerSortDown.red{background-color:#f4c8c5;} -table .yellow{color:#ffc40d;border-bottom-color:#ffc40d;} -table .headerSortUp.yellow,table .headerSortDown.yellow{background-color:#fff6d9;} -table .orange{color:#f89406;border-bottom-color:#f89406;} -table .headerSortUp.orange,table .headerSortDown.orange{background-color:#fee9cc;} -table .purple{color:#7a43b6;border-bottom-color:#7a43b6;} -table .headerSortUp.purple,table .headerSortDown.purple{background-color:#e2d5f0;} -.topbar{height:40px;position:fixed;top:0;left:0;right:0;z-index:10000;overflow:visible;}.topbar a{color:#bfbfbf;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);} -.topbar h3 a:hover,.topbar .brand:hover,.topbar ul .active>a{background-color:#333;background-color:rgba(255, 255, 255, 0.05);color:#ffffff;text-decoration:none;} -.topbar h3{position:relative;} -.topbar h3 a,.topbar .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;color:#ffffff;font-size:20px;font-weight:200;line-height:1;} -.topbar p{margin:0;line-height:40px;}.topbar p a:hover{background-color:transparent;color:#ffffff;} -.topbar form{float:left;margin:5px 0 0 0;position:relative;filter:alpha(opacity=100);-khtml-opacity:1;-moz-opacity:1;opacity:1;} -.topbar form.pull-right{float:right;} -.topbar input{background-color:#444;background-color:rgba(255, 255, 255, 0.3);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:normal;font-weight:13px;line-height:1;padding:4px 9px;color:#ffffff;color:rgba(255, 255, 255, 0.75);border:1px solid #111;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.25);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.25);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.25);-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;}.topbar input:-moz-placeholder{color:#e6e6e6;} -.topbar input::-webkit-input-placeholder{color:#e6e6e6;} -.topbar input:hover{background-color:#bfbfbf;background-color:rgba(255, 255, 255, 0.5);color:#ffffff;} -.topbar input:focus,.topbar input.focused{outline:0;background-color:#ffffff;color:#404040;text-shadow:0 1px 0 #ffffff;border:0;padding:5px 10px;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);} -.topbar-inner,.topbar .fill{background-color:#222;background-color:#222222;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222));background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);} -.topbar div>ul,.nav{display:block;float:left;margin:0 10px 0 0;position:relative;left:0;}.topbar div>ul>li,.nav>li{display:block;float:left;} -.topbar div>ul a,.nav a{display:block;float:none;padding:10px 10px 11px;line-height:19px;text-decoration:none;}.topbar div>ul a:hover,.nav a:hover{color:#ffffff;text-decoration:none;} -.topbar div>ul .active>a,.nav .active>a{background-color:#222;background-color:rgba(0, 0, 0, 0.5);} -.topbar div>ul.secondary-nav,.nav.secondary-nav{float:right;margin-left:10px;margin-right:0;}.topbar div>ul.secondary-nav .menu-dropdown,.nav.secondary-nav .menu-dropdown,.topbar div>ul.secondary-nav .dropdown-menu,.nav.secondary-nav .dropdown-menu{right:0;border:0;} -.topbar div>ul a.menu:hover,.nav a.menu:hover,.topbar div>ul li.open .menu,.nav li.open .menu,.topbar div>ul .dropdown-toggle:hover,.nav .dropdown-toggle:hover,.topbar div>ul .dropdown.open .dropdown-toggle,.nav .dropdown.open .dropdown-toggle{background:#444;background:rgba(255, 255, 255, 0.05);} -.topbar div>ul .menu-dropdown,.nav .menu-dropdown,.topbar div>ul .dropdown-menu,.nav .dropdown-menu{background-color:#333;}.topbar div>ul .menu-dropdown a.menu,.nav .menu-dropdown a.menu,.topbar div>ul .dropdown-menu a.menu,.nav .dropdown-menu a.menu,.topbar div>ul .menu-dropdown .dropdown-toggle,.nav .menu-dropdown .dropdown-toggle,.topbar div>ul .dropdown-menu .dropdown-toggle,.nav .dropdown-menu .dropdown-toggle{color:#ffffff;}.topbar div>ul .menu-dropdown a.menu.open,.nav .menu-dropdown a.menu.open,.topbar div>ul .dropdown-menu a.menu.open,.nav .dropdown-menu a.menu.open,.topbar div>ul .menu-dropdown .dropdown-toggle.open,.nav .menu-dropdown .dropdown-toggle.open,.topbar div>ul .dropdown-menu .dropdown-toggle.open,.nav .dropdown-menu .dropdown-toggle.open{background:#444;background:rgba(255, 255, 255, 0.05);} -.topbar div>ul .menu-dropdown li a,.nav .menu-dropdown li a,.topbar div>ul .dropdown-menu li a,.nav .dropdown-menu li a{color:#999;text-shadow:0 1px 0 rgba(0, 0, 0, 0.5);}.topbar div>ul .menu-dropdown li a:hover,.nav .menu-dropdown li a:hover,.topbar div>ul .dropdown-menu li a:hover,.nav .dropdown-menu li a:hover{background-color:#191919;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#292929), to(#191919));background-image:-moz-linear-gradient(top, #292929, #191919);background-image:-ms-linear-gradient(top, #292929, #191919);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #292929), color-stop(100%, #191919));background-image:-webkit-linear-gradient(top, #292929, #191919);background-image:-o-linear-gradient(top, #292929, #191919);background-image:linear-gradient(top, #292929, #191919);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#292929', endColorstr='#191919', GradientType=0);color:#ffffff;} -.topbar div>ul .menu-dropdown .active a,.nav .menu-dropdown .active a,.topbar div>ul .dropdown-menu .active a,.nav .dropdown-menu .active a{color:#ffffff;} -.topbar div>ul .menu-dropdown .divider,.nav .menu-dropdown .divider,.topbar div>ul .dropdown-menu .divider,.nav .dropdown-menu .divider{background-color:#222;border-color:#444;} -.topbar ul .menu-dropdown li a,.topbar ul .dropdown-menu li a{padding:4px 15px;} -li.menu,.dropdown{position:relative;} -a.menu:after,.dropdown-toggle:after{width:0;height:0;display:inline-block;content:"↓";text-indent:-99999px;vertical-align:top;margin-top:8px;margin-left:4px;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #ffffff;filter:alpha(opacity=50);-khtml-opacity:0.5;-moz-opacity:0.5;opacity:0.5;} -.menu-dropdown,.dropdown-menu{background-color:#ffffff;float:left;display:none;position:absolute;top:40px;z-index:900;min-width:160px;max-width:220px;_width:160px;margin-left:0;margin-right:0;padding:6px 0;zoom:1;border-color:#999;border-color:rgba(0, 0, 0, 0.2);border-style:solid;border-width:0 1px 1px;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.menu-dropdown li,.dropdown-menu li{float:none;display:block;background-color:none;} -.menu-dropdown .divider,.dropdown-menu .divider{height:1px;margin:5px 0;overflow:hidden;background-color:#eee;border-bottom:1px solid #ffffff;} -.topbar .dropdown-menu a,.dropdown-menu a{display:block;padding:4px 15px;clear:both;font-weight:normal;line-height:18px;color:#808080;text-shadow:0 1px 0 #ffffff;}.topbar .dropdown-menu a:hover,.dropdown-menu a:hover,.topbar .dropdown-menu a.hover,.dropdown-menu a.hover{background-color:#dddddd;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#eeeeee), to(#dddddd));background-image:-moz-linear-gradient(top, #eeeeee, #dddddd);background-image:-ms-linear-gradient(top, #eeeeee, #dddddd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100%, #dddddd));background-image:-webkit-linear-gradient(top, #eeeeee, #dddddd);background-image:-o-linear-gradient(top, #eeeeee, #dddddd);background-image:linear-gradient(top, #eeeeee, #dddddd);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#dddddd', GradientType=0);color:#404040;text-decoration:none;-webkit-box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.025),inset 0 -1px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.025),inset 0 -1px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.025),inset 0 -1px rgba(0, 0, 0, 0.025);} -.open .menu,.dropdown.open .menu,.open .dropdown-toggle,.dropdown.open .dropdown-toggle{color:#ffffff;background:#ccc;background:rgba(0, 0, 0, 0.3);} -.open .menu-dropdown,.dropdown.open .menu-dropdown,.open .dropdown-menu,.dropdown.open .dropdown-menu{display:block;} -.tabs,.pills{margin:0 0 18px;padding:0;list-style:none;zoom:1;}.tabs:before,.pills:before,.tabs:after,.pills:after{display:table;content:"";zoom:1;} -.tabs:after,.pills:after{clear:both;} -.tabs>li,.pills>li{float:left;}.tabs>li>a,.pills>li>a{display:block;} -.tabs{border-color:#ddd;border-style:solid;border-width:0 0 1px;}.tabs>li{position:relative;margin-bottom:-1px;}.tabs>li>a{padding:0 15px;margin-right:2px;line-height:34px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.tabs>li>a:hover{text-decoration:none;background-color:#eee;border-color:#eee #eee #ddd;} -.tabs .active>a,.tabs .active>a:hover{color:#808080;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;} -.tabs .menu-dropdown,.tabs .dropdown-menu{top:35px;border-width:1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} -.tabs a.menu:after,.tabs .dropdown-toggle:after{border-top-color:#999;margin-top:15px;margin-left:5px;} -.tabs li.open.menu .menu,.tabs .open.dropdown .dropdown-toggle{border-color:#999;} -.tabs li.open a.menu:after,.tabs .dropdown.open .dropdown-toggle:after{border-top-color:#555;} -.pills a{margin:5px 3px 5px 0;padding:0 15px;line-height:30px;text-shadow:0 1px 1px #ffffff;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;}.pills a:hover{color:#ffffff;text-decoration:none;text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);background-color:#00438a;} -.pills .active a{color:#ffffff;text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);background-color:#0069d6;} -.pills-vertical>li{float:none;} -.tab-content>.tab-pane,.pill-content>.pill-pane,.tab-content>div,.pill-content>div{display:none;} -.tab-content>.active,.pill-content>.active{display:block;} -.breadcrumb{padding:7px 14px;margin:0 0 18px;background-color:#f5f5f5;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#ffffff), to(#f5f5f5));background-image:-moz-linear-gradient(top, #ffffff, #f5f5f5);background-image:-ms-linear-gradient(top, #ffffff, #f5f5f5);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f5f5f5));background-image:-webkit-linear-gradient(top, #ffffff, #f5f5f5);background-image:-o-linear-gradient(top, #ffffff, #f5f5f5);background-image:linear-gradient(top, #ffffff, #f5f5f5);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;}.breadcrumb li{display:inline;text-shadow:0 1px 0 #ffffff;} -.breadcrumb .divider{padding:0 5px;color:#bfbfbf;} -.breadcrumb .active a{color:#404040;} -.hero-unit{background-color:#f5f5f5;margin-bottom:30px;padding:60px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;} -.hero-unit p{font-size:18px;font-weight:200;line-height:27px;} -footer{margin-top:17px;padding-top:17px;border-top:1px solid #eee;} -.page-header{margin-bottom:17px;border-bottom:1px solid #ddd;-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);-moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);}.page-header h1{margin-bottom:8px;} -.btn.danger,.alert-message.danger,.btn.danger:hover,.alert-message.danger:hover,.btn.error,.alert-message.error,.btn.error:hover,.alert-message.error:hover,.btn.success,.alert-message.success,.btn.success:hover,.alert-message.success:hover,.btn.info,.alert-message.info,.btn.info:hover,.alert-message.info:hover{color:#ffffff;} -.btn .close,.alert-message .close{font-family:Arial,sans-serif;line-height:18px;} -.btn.danger,.alert-message.danger,.btn.error,.alert-message.error{background-color:#c43c35;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-ms-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(top, #ee5f5b, #c43c35);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#c43c35 #c43c35 #882a25;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} -.btn.success,.alert-message.success{background-color:#57a957;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#62c462), to(#57a957));background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-ms-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(top, #62c462, #57a957);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#57a957 #57a957 #3d773d;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} -.btn.info,.alert-message.info{background-color:#339bb9;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#5bc0de), to(#339bb9));background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-ms-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de), color-stop(100%, #339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(top, #5bc0de, #339bb9);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#339bb9 #339bb9 #22697d;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} -.btn{cursor:pointer;display:inline-block;background-color:#e6e6e6;background-repeat:no-repeat;background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);background-image:-ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);padding:5px 14px 6px;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);color:#333;font-size:13px;line-height:normal;border:1px solid #ccc;border-bottom-color:#bbb;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-webkit-transition:0.1s linear all;-moz-transition:0.1s linear all;-ms-transition:0.1s linear all;-o-transition:0.1s linear all;transition:0.1s linear all;}.btn:hover{background-position:0 -15px;color:#333;text-decoration:none;} -.btn:focus{outline:1px dotted #666;} -.btn.primary{color:#ffffff;background-color:#0064cd;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));background-image:-moz-linear-gradient(top, #049cdb, #0064cd);background-image:-ms-linear-gradient(top, #049cdb, #0064cd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));background-image:-webkit-linear-gradient(top, #049cdb, #0064cd);background-image:-o-linear-gradient(top, #049cdb, #0064cd);background-image:linear-gradient(top, #049cdb, #0064cd);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#0064cd #0064cd #003f81;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} -.btn.active,.btn:active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);} -.btn.disabled{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} -.btn[disabled]{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} -.btn.large{font-size:15px;line-height:normal;padding:9px 14px 9px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} -.btn.small{padding:7px 9px 7px;font-size:11px;} -:root .alert-message,:root .btn{border-radius:0 \0;} -button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0;border:0;} -.close{float:right;color:#000000;font-size:20px;font-weight:bold;line-height:13.5px;text-shadow:0 1px 0 #ffffff;filter:alpha(opacity=25);-khtml-opacity:0.25;-moz-opacity:0.25;opacity:0.25;}.close:hover{color:#000000;text-decoration:none;filter:alpha(opacity=40);-khtml-opacity:0.4;-moz-opacity:0.4;opacity:0.4;} -.alert-message{position:relative;padding:7px 15px;margin-bottom:18px;color:#404040;background-color:#eedc94;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94));background-image:-moz-linear-gradient(top, #fceec1, #eedc94);background-image:-ms-linear-gradient(top, #fceec1, #eedc94);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94));background-image:-webkit-linear-gradient(top, #fceec1, #eedc94);background-image:-o-linear-gradient(top, #fceec1, #eedc94);background-image:linear-gradient(top, #fceec1, #eedc94);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#eedc94 #eedc94 #e4c652;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);border-width:1px;border-style:solid;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);}.alert-message .close{margin-top:1px;*margin-top:0;} -.alert-message a{font-weight:bold;color:#404040;} -.alert-message.danger p a,.alert-message.error p a,.alert-message.success p a,.alert-message.info p a{color:#ffffff;} -.alert-message h5{line-height:18px;} -.alert-message p{margin-bottom:0;} -.alert-message div{margin-top:5px;margin-bottom:2px;line-height:28px;} -.alert-message .btn{-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.25);-moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.25);box-shadow:0 1px 0 rgba(255, 255, 255, 0.25);} -.alert-message.block-message{background-image:none;background-color:#fdf5d9;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);padding:14px;border-color:#fceec1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}.alert-message.block-message ul,.alert-message.block-message p{margin-right:30px;} -.alert-message.block-message ul{margin-bottom:0;} -.alert-message.block-message li{color:#404040;} -.alert-message.block-message .alert-actions{margin-top:5px;} -.alert-message.block-message.error,.alert-message.block-message.success,.alert-message.block-message.info{color:#404040;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);} -.alert-message.block-message.error{background-color:#fddfde;border-color:#fbc7c6;} -.alert-message.block-message.success{background-color:#d1eed1;border-color:#bfe7bf;} -.alert-message.block-message.info{background-color:#ddf4fb;border-color:#c6edf9;} -.alert-message.block-message.danger p a,.alert-message.block-message.error p a,.alert-message.block-message.success p a,.alert-message.block-message.info p a{color:#404040;} -.pagination{height:36px;margin:18px 0;}.pagination ul{float:left;margin:0;border:1px solid #ddd;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);} -.pagination li{display:inline;} -.pagination a{float:left;padding:0 14px;line-height:34px;border-right:1px solid;border-right-color:#ddd;border-right-color:rgba(0, 0, 0, 0.15);*border-right-color:#ddd;text-decoration:none;} -.pagination a:hover,.pagination .active a{background-color:#c7eefe;} -.pagination .disabled a,.pagination .disabled a:hover{background-color:transparent;color:#bfbfbf;} -.pagination .next a{border:0;} -.well{background-color:#f5f5f5;margin-bottom:20px;padding:19px;min-height:20px;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);} -.modal-backdrop{background-color:#000000;position:fixed;top:0;left:0;right:0;bottom:0;z-index:10000;}.modal-backdrop.fade{opacity:0;} -.modal-backdrop,.modal-backdrop.fade.in{filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;} -.modal{position:fixed;top:50%;left:50%;z-index:11000;width:560px;margin:-250px 0 0 -280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal .close{margin-top:7px;} -.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;} -.modal.fade.in{top:50%;} -.modal-header{border-bottom:1px solid #eee;padding:5px 15px;} -.modal-body{padding:15px;} -.modal-body form{margin-bottom:0;} -.modal-footer{background-color:#f5f5f5;padding:14px 15px 15px;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;zoom:1;margin-bottom:0;}.modal-footer:before,.modal-footer:after{display:table;content:"";zoom:1;} -.modal-footer:after{clear:both;} -.modal-footer .btn{float:right;margin-left:5px;} -.modal .popover,.modal .twipsy{z-index:12000;} -.twipsy{display:block;position:absolute;visibility:visible;padding:5px;font-size:11px;z-index:1000;filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;}.twipsy.fade.in{filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;} -.twipsy.above .twipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} -.twipsy.left .twipsy-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} -.twipsy.below .twipsy-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} -.twipsy.right .twipsy-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} -.twipsy-inner{padding:3px 8px;background-color:#000000;color:white;text-align:center;max-width:200px;text-decoration:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} -.twipsy-arrow{position:absolute;width:0;height:0;} -.popover{position:absolute;top:0;left:0;z-index:1000;padding:5px;display:none;}.popover.above .arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} -.popover.right .arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} -.popover.below .arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} -.popover.left .arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} -.popover .arrow{position:absolute;width:0;height:0;} -.popover .inner{background:#000000;background:rgba(0, 0, 0, 0.8);padding:3px;overflow:hidden;width:280px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);} -.popover .title{background-color:#f5f5f5;padding:9px 15px;line-height:1;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;border-bottom:1px solid #eee;} -.popover .content{background-color:#ffffff;padding:14px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.popover .content p,.popover .content ul,.popover .content ol{margin-bottom:0;} -.fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;} -.label{padding:1px 3px 2px;font-size:9.75px;font-weight:bold;color:#ffffff;text-transform:uppercase;white-space:nowrap;background-color:#bfbfbf;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.label.important{background-color:#c43c35;} -.label.warning{background-color:#f89406;} -.label.success{background-color:#46a546;} -.label.notice{background-color:#62cffc;} -.media-grid{margin-left:-20px;margin-bottom:0;zoom:1;}.media-grid:before,.media-grid:after{display:table;content:"";zoom:1;} -.media-grid:after{clear:both;} -.media-grid li{display:inline;} -.media-grid a{float:left;padding:4px;margin:0 0 18px 20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);}.media-grid a img{display:block;} -.media-grid a:hover{border-color:#0069d6;-webkit-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);-moz-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);} - -/* grocery CRUD extra */ -input,textarea,select,.uneditable-input{color:#444444;} -/* ------------------ */ +html,body{margin:0;padding:0;} +h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite,code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var,dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;} +table{border-collapse:collapse;border-spacing:0;} +ol,ul{list-style:none;} +q:before,q:after,blockquote:before,blockquote:after{content:"";} +html{overflow-y:scroll;font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} +a:focus{outline:thin dotted;} +a:hover,a:active{outline:0;} +article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} +audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} +audio:not([controls]){display:none;} +sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;} +sup{top:-0.5em;} +sub{bottom:-0.25em;} +img{border:0;-ms-interpolation-mode:bicubic;} +button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;} +button,input{line-height:normal;*overflow:visible;} +button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;} +button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;} +input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;} +input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;} +textarea{overflow:auto;vertical-align:top;} +body{background-color:#ffffff;margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:18px;color:#404040;} +.container{width:940px;margin-left:auto;margin-right:auto;zoom:1;}.container:before,.container:after{display:table;content:"";zoom:1;} +.container:after{clear:both;} +.container-fluid{position:relative;min-width:940px;padding-left:20px;padding-right:20px;zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";zoom:1;} +.container-fluid:after{clear:both;} +.container-fluid>.sidebar{position:absolute;top:0;left:20px;width:220px;} +.container-fluid>.content{margin-left:240px;} +a{color:#0069d6;text-decoration:none;line-height:inherit;font-weight:inherit;}a:hover{color:#00438a;text-decoration:underline;} +.pull-right{float:right;} +.pull-left{float:left;} +.hide{display:none;} +.show{display:block;} +.row{zoom:1;margin-left:-20px;}.row:before,.row:after{display:table;content:"";zoom:1;} +.row:after{clear:both;} +.row>[class*="span"]{display:inline;float:left;margin-left:20px;} +.span1{width:40px;} +.span2{width:100px;} +.span3{width:160px;} +.span4{width:220px;} +.span5{width:280px;} +.span6{width:340px;} +.span7{width:400px;} +.span8{width:460px;} +.span9{width:520px;} +.span10{width:580px;} +.span11{width:640px;} +.span12{width:700px;} +.span13{width:760px;} +.span14{width:820px;} +.span15{width:880px;} +.span16{width:940px;} +.span17{width:1000px;} +.span18{width:1060px;} +.span19{width:1120px;} +.span20{width:1180px;} +.span21{width:1240px;} +.span22{width:1300px;} +.span23{width:1360px;} +.span24{width:1420px;} +.row>.offset1{margin-left:80px;} +.row>.offset2{margin-left:140px;} +.row>.offset3{margin-left:200px;} +.row>.offset4{margin-left:260px;} +.row>.offset5{margin-left:320px;} +.row>.offset6{margin-left:380px;} +.row>.offset7{margin-left:440px;} +.row>.offset8{margin-left:500px;} +.row>.offset9{margin-left:560px;} +.row>.offset10{margin-left:620px;} +.row>.offset11{margin-left:680px;} +.row>.offset12{margin-left:740px;} +.span-one-third{width:300px;} +.span-two-thirds{width:620px;} +.row>.offset-one-third{margin-left:340px;} +.row>.offset-two-thirds{margin-left:660px;} +p{font-size:13px;font-weight:normal;line-height:18px;margin-bottom:9px;}p small{font-size:11px;color:#bfbfbf;} +h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;} +h1{margin-bottom:18px;font-size:30px;line-height:36px;}h1 small{font-size:18px;} +h2{font-size:24px;line-height:36px;}h2 small{font-size:14px;} +h3,h4,h5,h6{line-height:36px;} +h3{font-size:18px;}h3 small{font-size:14px;} +h4{font-size:16px;}h4 small{font-size:12px;} +h5{font-size:14px;} +h6{font-size:13px;color:#bfbfbf;text-transform:uppercase;} +ul,ol{margin:0 0 18px 25px;} +ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} +ul{list-style:disc;} +ol{list-style:decimal;} +li{line-height:18px;color:#808080;} +ul.unstyled{list-style:none;margin-left:0;} +dl{margin-bottom:18px;}dl dt,dl dd{line-height:18px;} +dl dt{font-weight:bold;} +dl dd{margin-left:9px;} +hr{margin:20px 0 19px;border:0;border-bottom:1px solid #eee;} +strong{font-style:inherit;font-weight:bold;} +em{font-style:italic;font-weight:inherit;line-height:inherit;} +.muted{color:#bfbfbf;} +blockquote{margin-bottom:18px;border-left:5px solid #eee;padding-left:15px;}blockquote p{font-size:14px;font-weight:300;line-height:18px;margin-bottom:0;} +blockquote small{display:block;font-size:12px;font-weight:300;line-height:18px;color:#bfbfbf;}blockquote small:before{content:'\2014 \00A0';} +address{display:block;line-height:18px;margin-bottom:18px;} +code,pre{padding:0 3px 2px;font-family:Monaco, Andale Mono, Courier New, monospace;font-size:12px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +code{background-color:#fee9cc;color:rgba(0, 0, 0, 0.75);padding:1px 3px;} +pre{background-color:#f5f5f5;display:block;padding:8.5px;margin:0 0 18px;line-height:18px;font-size:12px;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;white-space:pre;white-space:pre-wrap;word-wrap:break-word;} +form{margin-bottom:18px;} +fieldset{margin-bottom:18px;padding-top:18px;}fieldset legend{display:block;padding-left:150px;font-size:19.5px;line-height:1;color:#404040;*padding:0 0 5px 145px;*line-height:1.5;} +form .clearfix{margin-bottom:18px;zoom:1;}form .clearfix:before,form .clearfix:after{display:table;content:"";zoom:1;} +form .clearfix:after{clear:both;} +label,input,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:normal;} +label{padding-top:6px;font-size:13px;line-height:18px;float:left;width:130px;text-align:right;color:#404040;} +form .input{margin-left:150px;} +input[type=checkbox],input[type=radio]{cursor:pointer;} +input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;font-size:13px;line-height:18px;color:#808080;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +select{padding:initial;} +input[type=checkbox],input[type=radio]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;border:none;} +input[type=file]{background-color:#ffffff;padding:initial;border:initial;line-height:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +input[type=button],input[type=reset],input[type=submit]{width:auto;height:auto;} +select,input[type=file]{height:27px;*height:auto;line-height:27px;*margin-top:4px;} +select[multiple]{height:inherit;background-color:#ffffff;} +textarea{height:auto;} +.uneditable-input{background-color:#ffffff;display:block;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;} +:-moz-placeholder{color:#bfbfbf;} +::-webkit-input-placeholder{color:#bfbfbf;} +input,textarea{-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);} +input:focus,textarea:focus{outline:0;border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);} +input[type=file]:focus,input[type=checkbox]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:1px dotted #666;} +form .clearfix.error>label,form .clearfix.error .help-block,form .clearfix.error .help-inline{color:#b94a48;} +form .clearfix.error input,form .clearfix.error textarea{color:#b94a48;border-color:#ee5f5b;}form .clearfix.error input:focus,form .clearfix.error textarea:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;} +form .clearfix.error .input-prepend .add-on,form .clearfix.error .input-append .add-on{color:#b94a48;background-color:#fce6e6;border-color:#b94a48;} +form .clearfix.warning>label,form .clearfix.warning .help-block,form .clearfix.warning .help-inline{color:#c09853;} +form .clearfix.warning input,form .clearfix.warning textarea{color:#c09853;border-color:#ccae64;}form .clearfix.warning input:focus,form .clearfix.warning textarea:focus{border-color:#be9a3f;-webkit-box-shadow:0 0 6px #e5d6b1;-moz-box-shadow:0 0 6px #e5d6b1;box-shadow:0 0 6px #e5d6b1;} +form .clearfix.warning .input-prepend .add-on,form .clearfix.warning .input-append .add-on{color:#c09853;background-color:#d2b877;border-color:#c09853;} +form .clearfix.success>label,form .clearfix.success .help-block,form .clearfix.success .help-inline{color:#468847;} +form .clearfix.success input,form .clearfix.success textarea{color:#468847;border-color:#57a957;}form .clearfix.success input:focus,form .clearfix.success textarea:focus{border-color:#458845;-webkit-box-shadow:0 0 6px #9acc9a;-moz-box-shadow:0 0 6px #9acc9a;box-shadow:0 0 6px #9acc9a;} +form .clearfix.success .input-prepend .add-on,form .clearfix.success .input-append .add-on{color:#468847;background-color:#bcddbc;border-color:#468847;} +.input-mini,input.mini,textarea.mini,select.mini{width:60px;} +.input-small,input.small,textarea.small,select.small{width:90px;} +.input-medium,input.medium,textarea.medium,select.medium{width:150px;} +.input-large,input.large,textarea.large,select.large{width:210px;} +.input-xlarge,input.xlarge,textarea.xlarge,select.xlarge{width:270px;} +.input-xxlarge,input.xxlarge,textarea.xxlarge,select.xxlarge{width:530px;} +textarea.xxlarge{overflow-y:auto;} +input.span1,textarea.span1{display:inline-block;float:none;width:30px;margin-left:0;} +input.span2,textarea.span2{display:inline-block;float:none;width:90px;margin-left:0;} +input.span3,textarea.span3{display:inline-block;float:none;width:150px;margin-left:0;} +input.span4,textarea.span4{display:inline-block;float:none;width:210px;margin-left:0;} +input.span5,textarea.span5{display:inline-block;float:none;width:270px;margin-left:0;} +input.span6,textarea.span6{display:inline-block;float:none;width:330px;margin-left:0;} +input.span7,textarea.span7{display:inline-block;float:none;width:390px;margin-left:0;} +input.span8,textarea.span8{display:inline-block;float:none;width:450px;margin-left:0;} +input.span9,textarea.span9{display:inline-block;float:none;width:510px;margin-left:0;} +input.span10,textarea.span10{display:inline-block;float:none;width:570px;margin-left:0;} +input.span11,textarea.span11{display:inline-block;float:none;width:630px;margin-left:0;} +input.span12,textarea.span12{display:inline-block;float:none;width:690px;margin-left:0;} +input.span13,textarea.span13{display:inline-block;float:none;width:750px;margin-left:0;} +input.span14,textarea.span14{display:inline-block;float:none;width:810px;margin-left:0;} +input.span15,textarea.span15{display:inline-block;float:none;width:870px;margin-left:0;} +input.span16,textarea.span16{display:inline-block;float:none;width:930px;margin-left:0;} +input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#f5f5f5;border-color:#ddd;cursor:not-allowed;} +.actions{background:#f5f5f5;margin-top:18px;margin-bottom:18px;padding:17px 20px 18px 150px;border-top:1px solid #ddd;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;}.actions .secondary-action{float:right;}.actions .secondary-action a{line-height:30px;}.actions .secondary-action a:hover{text-decoration:underline;} +.help-inline,.help-block{font-size:13px;line-height:18px;color:#bfbfbf;} +.help-inline{padding-left:5px;*position:relative;*top:-5px;} +.help-block{display:block;max-width:600px;} +.inline-inputs{color:#808080;}.inline-inputs span{padding:0 2px 0 1px;} +.input-prepend input,.input-append input{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.input-prepend .add-on,.input-append .add-on{position:relative;background:#f5f5f5;border:1px solid #ccc;z-index:2;float:left;display:block;width:auto;min-width:16px;height:18px;padding:4px 4px 4px 5px;margin-right:-1px;font-weight:normal;line-height:18px;color:#bfbfbf;text-align:center;text-shadow:0 1px 0 #ffffff;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-prepend .active,.input-append .active{background:#a9dba9;border-color:#46a546;} +.input-prepend .add-on{*margin-top:1px;} +.input-append input{float:left;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-append .add-on{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;margin-right:0;margin-left:-1px;} +.inputs-list{margin:0 0 5px;width:100%;}.inputs-list li{display:block;padding:0;width:100%;} +.inputs-list label{display:block;float:none;width:auto;padding:0;margin-left:20px;line-height:18px;text-align:left;white-space:normal;}.inputs-list label strong{color:#808080;} +.inputs-list label small{font-size:11px;font-weight:normal;} +.inputs-list .inputs-list{margin-left:25px;margin-bottom:10px;padding-top:0;} +.inputs-list:first-child{padding-top:6px;} +.inputs-list li+li{padding-top:2px;} +.inputs-list input[type=radio],.inputs-list input[type=checkbox]{margin-bottom:0;margin-left:-20px;float:left;} +.form-stacked{padding-left:20px;}.form-stacked fieldset{padding-top:9px;} +.form-stacked legend{padding-left:0;} +.form-stacked label{display:block;float:none;width:auto;font-weight:bold;text-align:left;line-height:20px;padding-top:0;} +.form-stacked .clearfix{margin-bottom:9px;}.form-stacked .clearfix div.input{margin-left:0;} +.form-stacked .inputs-list{margin-bottom:0;}.form-stacked .inputs-list li{padding-top:0;}.form-stacked .inputs-list li label{font-weight:normal;padding-top:0;} +.form-stacked div.clearfix.error{padding-top:10px;padding-bottom:10px;padding-left:10px;margin-top:0;margin-left:-10px;} +.form-stacked .actions{margin-left:-20px;padding-left:20px;} +table{width:100%;margin-bottom:18px;padding:0;font-size:13px;border-collapse:collapse;}table th,table td{padding:10px 10px 9px;line-height:18px;text-align:left;} +table th{padding-top:9px;font-weight:bold;vertical-align:middle;} +table td{vertical-align:top;border-top:1px solid #ddd;} +table tbody th{border-top:1px solid #ddd;vertical-align:top;} +.condensed-table th,.condensed-table td{padding:5px 5px 4px;} +.bordered-table{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.bordered-table th+th,.bordered-table td+td,.bordered-table th+td{border-left:1px solid #ddd;} +.bordered-table thead tr:first-child th:first-child,.bordered-table tbody tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;} +.bordered-table thead tr:first-child th:last-child,.bordered-table tbody tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;} +.bordered-table tbody tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;} +.bordered-table tbody tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;} +table .span1{width:20px;} +table .span2{width:60px;} +table .span3{width:100px;} +table .span4{width:140px;} +table .span5{width:180px;} +table .span6{width:220px;} +table .span7{width:260px;} +table .span8{width:300px;} +table .span9{width:340px;} +table .span10{width:380px;} +table .span11{width:420px;} +table .span12{width:460px;} +table .span13{width:500px;} +table .span14{width:540px;} +table .span15{width:580px;} +table .span16{width:620px;} +.zebra-striped tbody tr:nth-child(odd) td,.zebra-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;} +.zebra-striped tbody tr:hover td,.zebra-striped tbody tr:hover th{background-color:#f5f5f5;} +table .header{cursor:pointer;}table .header:after{content:"";float:right;margin-top:7px;border-width:0 4px 4px;border-style:solid;border-color:#000 transparent;visibility:hidden;} +table .headerSortUp,table .headerSortDown{background-color:rgba(141, 192, 219, 0.25);text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);} +table .header:hover:after{visibility:visible;} +table .headerSortDown:after,table .headerSortDown:hover:after{visibility:visible;filter:alpha(opacity=60);-khtml-opacity:0.6;-moz-opacity:0.6;opacity:0.6;} +table .headerSortUp:after{border-bottom:none;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;visibility:visible;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:alpha(opacity=60);-khtml-opacity:0.6;-moz-opacity:0.6;opacity:0.6;} +table .blue{color:#049cdb;border-bottom-color:#049cdb;} +table .headerSortUp.blue,table .headerSortDown.blue{background-color:#ade6fe;} +table .green{color:#46a546;border-bottom-color:#46a546;} +table .headerSortUp.green,table .headerSortDown.green{background-color:#cdeacd;} +table .red{color:#9d261d;border-bottom-color:#9d261d;} +table .headerSortUp.red,table .headerSortDown.red{background-color:#f4c8c5;} +table .yellow{color:#ffc40d;border-bottom-color:#ffc40d;} +table .headerSortUp.yellow,table .headerSortDown.yellow{background-color:#fff6d9;} +table .orange{color:#f89406;border-bottom-color:#f89406;} +table .headerSortUp.orange,table .headerSortDown.orange{background-color:#fee9cc;} +table .purple{color:#7a43b6;border-bottom-color:#7a43b6;} +table .headerSortUp.purple,table .headerSortDown.purple{background-color:#e2d5f0;} +.topbar{height:40px;position:fixed;top:0;left:0;right:0;z-index:10000;overflow:visible;}.topbar a{color:#bfbfbf;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);} +.topbar h3 a:hover,.topbar .brand:hover,.topbar ul .active>a{background-color:#333;background-color:rgba(255, 255, 255, 0.05);color:#ffffff;text-decoration:none;} +.topbar h3{position:relative;} +.topbar h3 a,.topbar .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;color:#ffffff;font-size:20px;font-weight:200;line-height:1;} +.topbar p{margin:0;line-height:40px;}.topbar p a:hover{background-color:transparent;color:#ffffff;} +.topbar form{float:left;margin:5px 0 0 0;position:relative;filter:alpha(opacity=100);-khtml-opacity:1;-moz-opacity:1;opacity:1;} +.topbar form.pull-right{float:right;} +.topbar input{background-color:#444;background-color:rgba(255, 255, 255, 0.3);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:normal;font-weight:13px;line-height:1;padding:4px 9px;color:#ffffff;color:rgba(255, 255, 255, 0.75);border:1px solid #111;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.25);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.25);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.25);-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;}.topbar input:-moz-placeholder{color:#e6e6e6;} +.topbar input::-webkit-input-placeholder{color:#e6e6e6;} +.topbar input:hover{background-color:#bfbfbf;background-color:rgba(255, 255, 255, 0.5);color:#ffffff;} +.topbar input:focus,.topbar input.focused{outline:0;background-color:#ffffff;color:#404040;text-shadow:0 1px 0 #ffffff;border:0;padding:5px 10px;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);} +.topbar-inner,.topbar .fill{background-color:#222;background-color:#222222;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222));background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);} +.topbar div>ul,.nav{display:block;float:left;margin:0 10px 0 0;position:relative;left:0;}.topbar div>ul>li,.nav>li{display:block;float:left;} +.topbar div>ul a,.nav a{display:block;float:none;padding:10px 10px 11px;line-height:19px;text-decoration:none;}.topbar div>ul a:hover,.nav a:hover{color:#ffffff;text-decoration:none;} +.topbar div>ul .active>a,.nav .active>a{background-color:#222;background-color:rgba(0, 0, 0, 0.5);} +.topbar div>ul.secondary-nav,.nav.secondary-nav{float:right;margin-left:10px;margin-right:0;}.topbar div>ul.secondary-nav .menu-dropdown,.nav.secondary-nav .menu-dropdown,.topbar div>ul.secondary-nav .dropdown-menu,.nav.secondary-nav .dropdown-menu{right:0;border:0;} +.topbar div>ul a.menu:hover,.nav a.menu:hover,.topbar div>ul li.open .menu,.nav li.open .menu,.topbar div>ul .dropdown-toggle:hover,.nav .dropdown-toggle:hover,.topbar div>ul .dropdown.open .dropdown-toggle,.nav .dropdown.open .dropdown-toggle{background:#444;background:rgba(255, 255, 255, 0.05);} +.topbar div>ul .menu-dropdown,.nav .menu-dropdown,.topbar div>ul .dropdown-menu,.nav .dropdown-menu{background-color:#333;}.topbar div>ul .menu-dropdown a.menu,.nav .menu-dropdown a.menu,.topbar div>ul .dropdown-menu a.menu,.nav .dropdown-menu a.menu,.topbar div>ul .menu-dropdown .dropdown-toggle,.nav .menu-dropdown .dropdown-toggle,.topbar div>ul .dropdown-menu .dropdown-toggle,.nav .dropdown-menu .dropdown-toggle{color:#ffffff;}.topbar div>ul .menu-dropdown a.menu.open,.nav .menu-dropdown a.menu.open,.topbar div>ul .dropdown-menu a.menu.open,.nav .dropdown-menu a.menu.open,.topbar div>ul .menu-dropdown .dropdown-toggle.open,.nav .menu-dropdown .dropdown-toggle.open,.topbar div>ul .dropdown-menu .dropdown-toggle.open,.nav .dropdown-menu .dropdown-toggle.open{background:#444;background:rgba(255, 255, 255, 0.05);} +.topbar div>ul .menu-dropdown li a,.nav .menu-dropdown li a,.topbar div>ul .dropdown-menu li a,.nav .dropdown-menu li a{color:#999;text-shadow:0 1px 0 rgba(0, 0, 0, 0.5);}.topbar div>ul .menu-dropdown li a:hover,.nav .menu-dropdown li a:hover,.topbar div>ul .dropdown-menu li a:hover,.nav .dropdown-menu li a:hover{background-color:#191919;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#292929), to(#191919));background-image:-moz-linear-gradient(top, #292929, #191919);background-image:-ms-linear-gradient(top, #292929, #191919);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #292929), color-stop(100%, #191919));background-image:-webkit-linear-gradient(top, #292929, #191919);background-image:-o-linear-gradient(top, #292929, #191919);background-image:linear-gradient(top, #292929, #191919);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#292929', endColorstr='#191919', GradientType=0);color:#ffffff;} +.topbar div>ul .menu-dropdown .active a,.nav .menu-dropdown .active a,.topbar div>ul .dropdown-menu .active a,.nav .dropdown-menu .active a{color:#ffffff;} +.topbar div>ul .menu-dropdown .divider,.nav .menu-dropdown .divider,.topbar div>ul .dropdown-menu .divider,.nav .dropdown-menu .divider{background-color:#222;border-color:#444;} +.topbar ul .menu-dropdown li a,.topbar ul .dropdown-menu li a{padding:4px 15px;} +li.menu,.dropdown{position:relative;} +a.menu:after,.dropdown-toggle:after{width:0;height:0;display:inline-block;content:"↓";text-indent:-99999px;vertical-align:top;margin-top:8px;margin-left:4px;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #ffffff;filter:alpha(opacity=50);-khtml-opacity:0.5;-moz-opacity:0.5;opacity:0.5;} +.menu-dropdown,.dropdown-menu{background-color:#ffffff;float:left;display:none;position:absolute;top:40px;z-index:900;min-width:160px;max-width:220px;_width:160px;margin-left:0;margin-right:0;padding:6px 0;zoom:1;border-color:#999;border-color:rgba(0, 0, 0, 0.2);border-style:solid;border-width:0 1px 1px;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.menu-dropdown li,.dropdown-menu li{float:none;display:block;background-color:none;} +.menu-dropdown .divider,.dropdown-menu .divider{height:1px;margin:5px 0;overflow:hidden;background-color:#eee;border-bottom:1px solid #ffffff;} +.topbar .dropdown-menu a,.dropdown-menu a{display:block;padding:4px 15px;clear:both;font-weight:normal;line-height:18px;color:#808080;text-shadow:0 1px 0 #ffffff;}.topbar .dropdown-menu a:hover,.dropdown-menu a:hover,.topbar .dropdown-menu a.hover,.dropdown-menu a.hover{background-color:#dddddd;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#eeeeee), to(#dddddd));background-image:-moz-linear-gradient(top, #eeeeee, #dddddd);background-image:-ms-linear-gradient(top, #eeeeee, #dddddd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100%, #dddddd));background-image:-webkit-linear-gradient(top, #eeeeee, #dddddd);background-image:-o-linear-gradient(top, #eeeeee, #dddddd);background-image:linear-gradient(top, #eeeeee, #dddddd);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#dddddd', GradientType=0);color:#404040;text-decoration:none;-webkit-box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.025),inset 0 -1px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.025),inset 0 -1px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.025),inset 0 -1px rgba(0, 0, 0, 0.025);} +.open .menu,.dropdown.open .menu,.open .dropdown-toggle,.dropdown.open .dropdown-toggle{color:#ffffff;background:#ccc;background:rgba(0, 0, 0, 0.3);} +.open .menu-dropdown,.dropdown.open .menu-dropdown,.open .dropdown-menu,.dropdown.open .dropdown-menu{display:block;} +.tabs,.pills{margin:0 0 18px;padding:0;list-style:none;zoom:1;}.tabs:before,.pills:before,.tabs:after,.pills:after{display:table;content:"";zoom:1;} +.tabs:after,.pills:after{clear:both;} +.tabs>li,.pills>li{float:left;}.tabs>li>a,.pills>li>a{display:block;} +.tabs{border-color:#ddd;border-style:solid;border-width:0 0 1px;}.tabs>li{position:relative;margin-bottom:-1px;}.tabs>li>a{padding:0 15px;margin-right:2px;line-height:34px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.tabs>li>a:hover{text-decoration:none;background-color:#eee;border-color:#eee #eee #ddd;} +.tabs .active>a,.tabs .active>a:hover{color:#808080;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;} +.tabs .menu-dropdown,.tabs .dropdown-menu{top:35px;border-width:1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} +.tabs a.menu:after,.tabs .dropdown-toggle:after{border-top-color:#999;margin-top:15px;margin-left:5px;} +.tabs li.open.menu .menu,.tabs .open.dropdown .dropdown-toggle{border-color:#999;} +.tabs li.open a.menu:after,.tabs .dropdown.open .dropdown-toggle:after{border-top-color:#555;} +.pills a{margin:5px 3px 5px 0;padding:0 15px;line-height:30px;text-shadow:0 1px 1px #ffffff;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;}.pills a:hover{color:#ffffff;text-decoration:none;text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);background-color:#00438a;} +.pills .active a{color:#ffffff;text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);background-color:#0069d6;} +.pills-vertical>li{float:none;} +.tab-content>.tab-pane,.pill-content>.pill-pane,.tab-content>div,.pill-content>div{display:none;} +.tab-content>.active,.pill-content>.active{display:block;} +.breadcrumb{padding:7px 14px;margin:0 0 18px;background-color:#f5f5f5;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#ffffff), to(#f5f5f5));background-image:-moz-linear-gradient(top, #ffffff, #f5f5f5);background-image:-ms-linear-gradient(top, #ffffff, #f5f5f5);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f5f5f5));background-image:-webkit-linear-gradient(top, #ffffff, #f5f5f5);background-image:-o-linear-gradient(top, #ffffff, #f5f5f5);background-image:linear-gradient(top, #ffffff, #f5f5f5);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;}.breadcrumb li{display:inline;text-shadow:0 1px 0 #ffffff;} +.breadcrumb .divider{padding:0 5px;color:#bfbfbf;} +.breadcrumb .active a{color:#404040;} +.hero-unit{background-color:#f5f5f5;margin-bottom:30px;padding:60px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;} +.hero-unit p{font-size:18px;font-weight:200;line-height:27px;} +footer{margin-top:17px;padding-top:17px;border-top:1px solid #eee;} +.page-header{margin-bottom:17px;border-bottom:1px solid #ddd;-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);-moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);}.page-header h1{margin-bottom:8px;} +.btn.danger,.alert-message.danger,.btn.danger:hover,.alert-message.danger:hover,.btn.error,.alert-message.error,.btn.error:hover,.alert-message.error:hover,.btn.success,.alert-message.success,.btn.success:hover,.alert-message.success:hover,.btn.info,.alert-message.info,.btn.info:hover,.alert-message.info:hover{color:#ffffff;} +.btn .close,.alert-message .close{font-family:Arial,sans-serif;line-height:18px;} +.btn.danger,.alert-message.danger,.btn.error,.alert-message.error{background-color:#c43c35;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-ms-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(top, #ee5f5b, #c43c35);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#c43c35 #c43c35 #882a25;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} +.btn.success,.alert-message.success{background-color:#57a957;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#62c462), to(#57a957));background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-ms-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(top, #62c462, #57a957);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#57a957 #57a957 #3d773d;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} +.btn.info,.alert-message.info{background-color:#339bb9;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#5bc0de), to(#339bb9));background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-ms-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de), color-stop(100%, #339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(top, #5bc0de, #339bb9);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#339bb9 #339bb9 #22697d;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} +.btn{cursor:pointer;display:inline-block;background-color:#e6e6e6;background-repeat:no-repeat;background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);background-image:-ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);padding:5px 14px 6px;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);color:#333;font-size:13px;line-height:normal;border:1px solid #ccc;border-bottom-color:#bbb;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-webkit-transition:0.1s linear all;-moz-transition:0.1s linear all;-ms-transition:0.1s linear all;-o-transition:0.1s linear all;transition:0.1s linear all;}.btn:hover{background-position:0 -15px;color:#333;text-decoration:none;} +.btn:focus{outline:1px dotted #666;} +.btn.primary{color:#ffffff;background-color:#0064cd;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));background-image:-moz-linear-gradient(top, #049cdb, #0064cd);background-image:-ms-linear-gradient(top, #049cdb, #0064cd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));background-image:-webkit-linear-gradient(top, #049cdb, #0064cd);background-image:-o-linear-gradient(top, #049cdb, #0064cd);background-image:linear-gradient(top, #049cdb, #0064cd);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#0064cd #0064cd #003f81;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} +.btn.active,.btn:active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);} +.btn.disabled{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +.btn[disabled]{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +.btn.large{font-size:15px;line-height:normal;padding:9px 14px 9px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} +.btn.small{padding:7px 9px 7px;font-size:11px;} +:root .alert-message,:root .btn{border-radius:0 \0;} +button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0;border:0;} +.close{float:right;color:#000000;font-size:20px;font-weight:bold;line-height:13.5px;text-shadow:0 1px 0 #ffffff;filter:alpha(opacity=25);-khtml-opacity:0.25;-moz-opacity:0.25;opacity:0.25;}.close:hover{color:#000000;text-decoration:none;filter:alpha(opacity=40);-khtml-opacity:0.4;-moz-opacity:0.4;opacity:0.4;} +.alert-message{position:relative;padding:7px 15px;margin-bottom:18px;color:#404040;background-color:#eedc94;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94));background-image:-moz-linear-gradient(top, #fceec1, #eedc94);background-image:-ms-linear-gradient(top, #fceec1, #eedc94);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94));background-image:-webkit-linear-gradient(top, #fceec1, #eedc94);background-image:-o-linear-gradient(top, #fceec1, #eedc94);background-image:linear-gradient(top, #fceec1, #eedc94);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#eedc94 #eedc94 #e4c652;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);border-width:1px;border-style:solid;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);}.alert-message .close{margin-top:1px;*margin-top:0;} +.alert-message a{font-weight:bold;color:#404040;} +.alert-message.danger p a,.alert-message.error p a,.alert-message.success p a,.alert-message.info p a{color:#ffffff;} +.alert-message h5{line-height:18px;} +.alert-message p{margin-bottom:0;} +.alert-message div{margin-top:5px;margin-bottom:2px;line-height:28px;} +.alert-message .btn{-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.25);-moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.25);box-shadow:0 1px 0 rgba(255, 255, 255, 0.25);} +.alert-message.block-message{background-image:none;background-color:#fdf5d9;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);padding:14px;border-color:#fceec1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}.alert-message.block-message ul,.alert-message.block-message p{margin-right:30px;} +.alert-message.block-message ul{margin-bottom:0;} +.alert-message.block-message li{color:#404040;} +.alert-message.block-message .alert-actions{margin-top:5px;} +.alert-message.block-message.error,.alert-message.block-message.success,.alert-message.block-message.info{color:#404040;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);} +.alert-message.block-message.error{background-color:#fddfde;border-color:#fbc7c6;} +.alert-message.block-message.success{background-color:#d1eed1;border-color:#bfe7bf;} +.alert-message.block-message.info{background-color:#ddf4fb;border-color:#c6edf9;} +.alert-message.block-message.danger p a,.alert-message.block-message.error p a,.alert-message.block-message.success p a,.alert-message.block-message.info p a{color:#404040;} +.pagination{height:36px;margin:18px 0;}.pagination ul{float:left;margin:0;border:1px solid #ddd;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);} +.pagination li{display:inline;} +.pagination a{float:left;padding:0 14px;line-height:34px;border-right:1px solid;border-right-color:#ddd;border-right-color:rgba(0, 0, 0, 0.15);*border-right-color:#ddd;text-decoration:none;} +.pagination a:hover,.pagination .active a{background-color:#c7eefe;} +.pagination .disabled a,.pagination .disabled a:hover{background-color:transparent;color:#bfbfbf;} +.pagination .next a{border:0;} +.well{background-color:#f5f5f5;margin-bottom:20px;padding:19px;min-height:20px;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);} +.modal-backdrop{background-color:#000000;position:fixed;top:0;left:0;right:0;bottom:0;z-index:10000;}.modal-backdrop.fade{opacity:0;} +.modal-backdrop,.modal-backdrop.fade.in{filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;} +.modal{position:fixed;top:50%;left:50%;z-index:11000;width:560px;margin:-250px 0 0 -280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal .close{margin-top:7px;} +.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;} +.modal.fade.in{top:50%;} +.modal-header{border-bottom:1px solid #eee;padding:5px 15px;} +.modal-body{padding:15px;} +.modal-body form{margin-bottom:0;} +.modal-footer{background-color:#f5f5f5;padding:14px 15px 15px;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;zoom:1;margin-bottom:0;}.modal-footer:before,.modal-footer:after{display:table;content:"";zoom:1;} +.modal-footer:after{clear:both;} +.modal-footer .btn{float:right;margin-left:5px;} +.modal .popover,.modal .twipsy{z-index:12000;} +.twipsy{display:block;position:absolute;visibility:visible;padding:5px;font-size:11px;z-index:1000;filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;}.twipsy.fade.in{filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;} +.twipsy.above .twipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.twipsy.left .twipsy-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} +.twipsy.below .twipsy-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} +.twipsy.right .twipsy-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} +.twipsy-inner{padding:3px 8px;background-color:#000000;color:white;text-align:center;max-width:200px;text-decoration:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.twipsy-arrow{position:absolute;width:0;height:0;} +.popover{position:absolute;top:0;left:0;z-index:1000;padding:5px;display:none;}.popover.above .arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.popover.right .arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} +.popover.below .arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} +.popover.left .arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} +.popover .arrow{position:absolute;width:0;height:0;} +.popover .inner{background:#000000;background:rgba(0, 0, 0, 0.8);padding:3px;overflow:hidden;width:280px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);} +.popover .title{background-color:#f5f5f5;padding:9px 15px;line-height:1;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;border-bottom:1px solid #eee;} +.popover .content{background-color:#ffffff;padding:14px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.popover .content p,.popover .content ul,.popover .content ol{margin-bottom:0;} +.fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;} +.label{padding:1px 3px 2px;font-size:9.75px;font-weight:bold;color:#ffffff;text-transform:uppercase;white-space:nowrap;background-color:#bfbfbf;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.label.important{background-color:#c43c35;} +.label.warning{background-color:#f89406;} +.label.success{background-color:#46a546;} +.label.notice{background-color:#62cffc;} +.media-grid{margin-left:-20px;margin-bottom:0;zoom:1;}.media-grid:before,.media-grid:after{display:table;content:"";zoom:1;} +.media-grid:after{clear:both;} +.media-grid li{display:inline;} +.media-grid a{float:left;padding:4px;margin:0 0 18px 20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);}.media-grid a img{display:block;} +.media-grid a:hover{border-color:#0069d6;-webkit-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);-moz-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);} + +/* grocery CRUD extra */ +input,textarea,select,.uneditable-input{color:#444444;} +/* ------------------ */ diff --git a/assets/grocery_crud/css/jquery_plugins/file_upload/file-uploader.css b/assets/grocery_crud/css/jquery_plugins/file_upload/file-uploader.css index 46276fc..62067d4 100755 --- a/assets/grocery_crud/css/jquery_plugins/file_upload/file-uploader.css +++ b/assets/grocery_crud/css/jquery_plugins/file_upload/file-uploader.css @@ -1,29 +1,29 @@ -.qq-upload-button { - display:block; /* or inline-block */ - padding: 7px 15px; - text-align:center; - border:1px solid #AAA; - color: #555555; - border-radius: 5px; - float:left; - - background: #ccc; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee)); - background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%); - background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%); - background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%); - background-image: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 60%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 ); - background-image: linear-gradient(top, #cccccc 0%,#eeeeee 60%); -} -.qq-upload-button:hover { - background: #bbb; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #bbb), color-stop(0.6, #ddd)); - background-image: -webkit-linear-gradient(center bottom, #bbb 0%, #ddd 60%); - background-image: -moz-linear-gradient(center bottom, #bbb 0%, #ddd 60%); - background-image: -o-linear-gradient(bottom, #bbb 0%, #ddd 60%); - background-image: -ms-linear-gradient(top, #bbbbbb 0%,#dddddd 60%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bbbbbb', endColorstr='#dddddd',GradientType=0 ); - background-image: linear-gradient(top, #bbbbbb 0%,#dddddd 60%); -} +.qq-upload-button { + display:block; /* or inline-block */ + padding: 7px 15px; + text-align:center; + border:1px solid #AAA; + color: #555555; + border-radius: 5px; + float:left; + + background: #ccc; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee)); + background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%); + background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%); + background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%); + background-image: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 60%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 ); + background-image: linear-gradient(top, #cccccc 0%,#eeeeee 60%); +} +.qq-upload-button:hover { + background: #bbb; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #bbb), color-stop(0.6, #ddd)); + background-image: -webkit-linear-gradient(center bottom, #bbb 0%, #ddd 60%); + background-image: -moz-linear-gradient(center bottom, #bbb 0%, #ddd 60%); + background-image: -o-linear-gradient(bottom, #bbb 0%, #ddd 60%); + background-image: -ms-linear-gradient(top, #bbbbbb 0%,#dddddd 60%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bbbbbb', endColorstr='#dddddd',GradientType=0 ); + background-image: linear-gradient(top, #bbbbbb 0%,#dddddd 60%); +} .qq-upload-button:focus {outline:1px dotted black;} \ No newline at end of file diff --git a/assets/grocery_crud/css/jquery_plugins/file_upload/fileuploader.css b/assets/grocery_crud/css/jquery_plugins/file_upload/fileuploader.css index 2836e70..d47817b 100755 --- a/assets/grocery_crud/css/jquery_plugins/file_upload/fileuploader.css +++ b/assets/grocery_crud/css/jquery_plugins/file_upload/fileuploader.css @@ -1,71 +1,71 @@ -.qq-uploader { position:relative; width: 100%;} - -.qq-upload-button { - display:block; /* or inline-block */ - padding: 7px 15px; - text-align:center; - border:1px solid #AAA; - color: #555555; - border-radius: 5px; - float:left; -} -.qq-upload-button-hover { - -} -.qq-upload-button-focus {outline:1px dotted black;} - -.qq-upload-drop-area { - position:absolute; top:0; left:0; width: 510px; height: 35px; z-index:2; - background:#FF9797; text-align:center; -} -.qq-upload-drop-area span { - display:block; position:absolute; top: 50%; width:100%; margin-top:-8px; font-size:16px; -} -.qq-upload-drop-area-active {background:#FF7171;} - -.qq-upload-list {margin: 10px 5px 0px 10px; padding:0; list-style: none; float:left;} -.qq-upload-list li { margin:0; padding:0; line-height:15px; font-size:12px; float:left;} -.qq-upload-file, .qq-upload-spinner, .qq-upload-size, .qq-upload-cancel, .qq-upload-failed-text { - margin-right: 7px; -} -.qq-upload-file {} -.qq-upload-spinner {display:inline-block; background: url("loading.gif"); width:15px; height:15px; vertical-align:text-bottom;} -.qq-upload-size,.qq-upload-cancel {font-size:11px;} - -.qq-upload-failed-text {display:none;} -.qq-upload-fail .qq-upload-failed-text {display:inline;} - -a.qq-upload-cancel -{ - color: red !important; -} - -/* Grocery CRUD extras */ -a.open-file -{ - color: #000; - font-weight: bold; - text-decoration: none; -} -a.open-file:hover -{ - text-decoration: underline; -} -a.delete-anchor -{ - color: red !important; -} -.image-thumbnail img -{ - cursor: -moz-zoom-in; - cursor: -webkit-zoom-in; -} -.form-field-box.even .image-thumbnail img -{ - border: 4px solid #fff; -} -.form-field-box.odd .image-thumbnail img -{ - border: 4px solid #ddd; -} +.qq-uploader { position:relative; width: 100%;} + +.qq-upload-button { + display:block; /* or inline-block */ + padding: 7px 15px; + text-align:center; + border:1px solid #AAA; + color: #555555; + border-radius: 5px; + float:left; +} +.qq-upload-button-hover { + +} +.qq-upload-button-focus {outline:1px dotted black;} + +.qq-upload-drop-area { + position:absolute; top:0; left:0; width: 510px; height: 35px; z-index:2; + background:#FF9797; text-align:center; +} +.qq-upload-drop-area span { + display:block; position:absolute; top: 50%; width:100%; margin-top:-8px; font-size:16px; +} +.qq-upload-drop-area-active {background:#FF7171;} + +.qq-upload-list {margin: 10px 5px 0px 10px; padding:0; list-style: none; float:left;} +.qq-upload-list li { margin:0; padding:0; line-height:15px; font-size:12px; float:left;} +.qq-upload-file, .qq-upload-spinner, .qq-upload-size, .qq-upload-cancel, .qq-upload-failed-text { + margin-right: 7px; +} +.qq-upload-file {} +.qq-upload-spinner {display:inline-block; background: url("loading.gif"); width:15px; height:15px; vertical-align:text-bottom;} +.qq-upload-size,.qq-upload-cancel {font-size:11px;} + +.qq-upload-failed-text {display:none;} +.qq-upload-fail .qq-upload-failed-text {display:inline;} + +a.qq-upload-cancel +{ + color: red !important; +} + +/* Grocery CRUD extras */ +a.open-file +{ + color: #000; + font-weight: bold; + text-decoration: none; +} +a.open-file:hover +{ + text-decoration: underline; +} +a.delete-anchor +{ + color: red !important; +} +.image-thumbnail img +{ + cursor: -moz-zoom-in; + cursor: -webkit-zoom-in; +} +.form-field-box.even .image-thumbnail img +{ + border: 4px solid #fff; +} +.form-field-box.odd .image-thumbnail img +{ + border: 4px solid #ddd; +} /* ------------------- */ \ No newline at end of file diff --git a/assets/grocery_crud/css/jquery_plugins/file_upload/jquery.fileupload-ui.css b/assets/grocery_crud/css/jquery_plugins/file_upload/jquery.fileupload-ui.css index 90899dd..edb196f 100755 --- a/assets/grocery_crud/css/jquery_plugins/file_upload/jquery.fileupload-ui.css +++ b/assets/grocery_crud/css/jquery_plugins/file_upload/jquery.fileupload-ui.css @@ -1,56 +1,56 @@ -@charset 'UTF-8'; -/* - * jQuery File Upload UI Plugin CSS 6.0 - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2010, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - */ - -.fileinput-button input { - position: absolute; - top: 0; - right: 0; - margin: 0; - border: solid transparent; - border-width: 0 0 100px 200px; - opacity: 0; - filter: alpha(opacity=0); - -moz-transform: translate(-300px, 0) scale(4); - direction: ltr; - cursor: pointer; -} - -.fileinput-button { - position: relative; - overflow: hidden; - float: left; - margin-right: 4px; -} - -.progressbar, -.progressbar div { - width: 200px; - height: 20px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.3); - -moz-box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.3); - box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.3); - background: #fff; -} - -.progressbar div { - width: auto; - background: url(progressbar.gif); -} - -.fileupload-progressbar { - float: right; - width: 400px; - margin-top: 4px; -} +@charset 'UTF-8'; +/* + * jQuery File Upload UI Plugin CSS 6.0 + * https://github.com/blueimp/jQuery-File-Upload + * + * Copyright 2010, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/MIT + */ + +.fileinput-button input { + position: absolute; + top: 0; + right: 0; + margin: 0; + border: solid transparent; + border-width: 0 0 100px 200px; + opacity: 0; + filter: alpha(opacity=0); + -moz-transform: translate(-300px, 0) scale(4); + direction: ltr; + cursor: pointer; +} + +.fileinput-button { + position: relative; + overflow: hidden; + float: left; + margin-right: 4px; +} + +.progressbar, +.progressbar div { + width: 200px; + height: 20px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.3); + -moz-box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.3); + box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.3); + background: #fff; +} + +.progressbar div { + width: auto; + background: url(progressbar.gif); +} + +.fileupload-progressbar { + float: right; + width: 400px; + margin-top: 4px; +} diff --git a/assets/grocery_crud/css/jquery_plugins/index.html b/assets/grocery_crud/css/jquery_plugins/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/css/jquery_plugins/index.html +++ b/assets/grocery_crud/css/jquery_plugins/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/css/jquery_plugins/jquery-ui-timepicker-addon.css b/assets/grocery_crud/css/jquery_plugins/jquery-ui-timepicker-addon.css index 993b4fd..b93a85f 100755 --- a/assets/grocery_crud/css/jquery_plugins/jquery-ui-timepicker-addon.css +++ b/assets/grocery_crud/css/jquery_plugins/jquery-ui-timepicker-addon.css @@ -1,10 +1,10 @@ -.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } -.ui-timepicker-div dl { text-align: left; } -.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } -.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; } -.ui-timepicker-div td { font-size: 90%; } -.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } - -.ui-timepicker-rtl{ direction: rtl; } -.ui-timepicker-rtl dl { text-align: right; } +.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } +.ui-timepicker-div dl { text-align: left; } +.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } +.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; } +.ui-timepicker-div td { font-size: 90%; } +.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } + +.ui-timepicker-rtl{ direction: rtl; } +.ui-timepicker-rtl dl { text-align: right; } .ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; } \ No newline at end of file diff --git a/assets/grocery_crud/css/jquery_plugins/jquery.ui.datetime.css b/assets/grocery_crud/css/jquery_plugins/jquery.ui.datetime.css index 2549f05..64c37c7 100755 --- a/assets/grocery_crud/css/jquery_plugins/jquery.ui.datetime.css +++ b/assets/grocery_crud/css/jquery_plugins/jquery.ui.datetime.css @@ -1,116 +1,116 @@ -@CHARSET "UTF-8"; - - /*demo page css*/ - - - .demoHeaders { - margin-top: 2em; - } - - #dialog_link { - padding: .4em 1em .4em 20px; - text-decoration: none; - position: relative; - } - - #dialog_link span.ui-icon { - margin: 0 5px 0 0; - position: absolute; - left: .2em; - top: 50%; - margin-top: -8px; - } - - ul#icons { - margin: 0; - padding: 0; - } - - ul#icons li { - margin: 2px; - position: relative; - padding: 4px 0; - cursor: pointer; - float: left; - list-style: none; - } - - ul#icons span.ui-icon { - float: left; - margin: 0 4px; - } - - - .selHrs, .selMins { - width:2.5em; - } - .selHrs { - margin-left:5px; - } - .dayPeriod { - display:inline-block; - width:20px; - } - .slider { - height:120px; - float:left; - margin:10px - } - - #tpSelectedTime { - margin-bottom:0; - border-bottom:1px solid #aaa; - padding:5px; - color:#000; - background:#fff; - text-transform:none; - - } - #tpSelectedTime span { - fon-weight:bold; - } - #datepicker { - - } - #pickerplug { - overflow:hidden; - display:none; - position:absolute; - top:200px; - left:300px; - padding:0; - margin:0; - z-index:500; - } - #pickerplug li { - display:block; - float:left; - } - #timepicker { - border:1px solid #aaa; - background:#fff; - } - #timepicker ul { - overflow:hidden; - padding:5px; - } - #timepicker ul li { - position:relative; - display:block; - float:left; - width:50px; - - } - #timepicker ul li h4 { - width:100%; - background:transparent; - color:#000; - text-align:center; - } - #timepicker ul li .slider { - position:relative; - left:10px; - - /* background:#FBF9EE url(images/ui-bg_glass_55_fbf9ee_1x400.png) repeat-x scroll 50% 50%; - border:1px solid #FCEFA1;*/ - } \ No newline at end of file +@CHARSET "UTF-8"; + + /*demo page css*/ + + + .demoHeaders { + margin-top: 2em; + } + + #dialog_link { + padding: .4em 1em .4em 20px; + text-decoration: none; + position: relative; + } + + #dialog_link span.ui-icon { + margin: 0 5px 0 0; + position: absolute; + left: .2em; + top: 50%; + margin-top: -8px; + } + + ul#icons { + margin: 0; + padding: 0; + } + + ul#icons li { + margin: 2px; + position: relative; + padding: 4px 0; + cursor: pointer; + float: left; + list-style: none; + } + + ul#icons span.ui-icon { + float: left; + margin: 0 4px; + } + + + .selHrs, .selMins { + width:2.5em; + } + .selHrs { + margin-left:5px; + } + .dayPeriod { + display:inline-block; + width:20px; + } + .slider { + height:120px; + float:left; + margin:10px + } + + #tpSelectedTime { + margin-bottom:0; + border-bottom:1px solid #aaa; + padding:5px; + color:#000; + background:#fff; + text-transform:none; + + } + #tpSelectedTime span { + fon-weight:bold; + } + #datepicker { + + } + #pickerplug { + overflow:hidden; + display:none; + position:absolute; + top:200px; + left:300px; + padding:0; + margin:0; + z-index:500; + } + #pickerplug li { + display:block; + float:left; + } + #timepicker { + border:1px solid #aaa; + background:#fff; + } + #timepicker ul { + overflow:hidden; + padding:5px; + } + #timepicker ul li { + position:relative; + display:block; + float:left; + width:50px; + + } + #timepicker ul li h4 { + width:100%; + background:transparent; + color:#000; + text-align:center; + } + #timepicker ul li .slider { + position:relative; + left:10px; + + /* background:#FBF9EE url(images/ui-bg_glass_55_fbf9ee_1x400.png) repeat-x scroll 50% 50%; + border:1px solid #FCEFA1;*/ + } \ No newline at end of file diff --git a/assets/grocery_crud/css/jquery_plugins/ui.multiselect.css b/assets/grocery_crud/css/jquery_plugins/ui.multiselect.css index 5033ced..4dafc78 100755 --- a/assets/grocery_crud/css/jquery_plugins/ui.multiselect.css +++ b/assets/grocery_crud/css/jquery_plugins/ui.multiselect.css @@ -1,32 +1,32 @@ -/* Multiselect -----------------------------------*/ - -.ui-multiselect { border: solid 1px; font-size: 0.8em; } -.ui-multiselect ul { -moz-user-select: none; } -.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; } -.ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;} -.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; } - -.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; } -.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; } -.ui-multiselect ul.selected li { } - -.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; } -.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; } -.ui-multiselect ul.available li { padding-left: 10px; } - -.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;} -.ui-multiselect .ui-state-hover { border: none; } -.ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;} - -.ui-multiselect .add-all { float: right; padding: 10px 7px 10px 0; font-size: 11px; } -.ui-multiselect .remove-all { float: right; padding: 10px 7px 11px 0; font-size: 11px; } -.ui-multiselect .search { float: left; padding:0;} -.ui-multiselect .count { float: left; padding: 10px 7px;} - -.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; } -.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; } - -.ui-multiselect input.search { height: 20px !important; padding: 2px !important; opacity: 0.5 !important; margin: 4px !important; width: 150px !important; } - +/* Multiselect +----------------------------------*/ + +.ui-multiselect { border: solid 1px; font-size: 0.8em; } +.ui-multiselect ul { -moz-user-select: none; } +.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; } +.ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;} +.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; } + +.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; } +.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; } +.ui-multiselect ul.selected li { } + +.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; } +.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; } +.ui-multiselect ul.available li { padding-left: 10px; } + +.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;} +.ui-multiselect .ui-state-hover { border: none; } +.ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;} + +.ui-multiselect .add-all { float: right; padding: 10px 7px 10px 0; font-size: 11px; } +.ui-multiselect .remove-all { float: right; padding: 10px 7px 11px 0; font-size: 11px; } +.ui-multiselect .search { float: left; padding:0;} +.ui-multiselect .count { float: left; padding: 10px 7px;} + +.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; } +.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; } + +.ui-multiselect input.search { height: 20px !important; padding: 2px !important; opacity: 0.5 !important; margin: 4px !important; width: 150px !important; } + select.multiselect{ width:704px; } \ No newline at end of file diff --git a/assets/grocery_crud/css/jquery_plugins/uniform/uniform.default.css b/assets/grocery_crud/css/jquery_plugins/uniform/uniform.default.css index e556e99..82ae636 100755 --- a/assets/grocery_crud/css/jquery_plugins/uniform/uniform.default.css +++ b/assets/grocery_crud/css/jquery_plugins/uniform/uniform.default.css @@ -1,644 +1,644 @@ -/* - -Uniform Theme: Uniform Default -Version: 1.8 -By: Josh Pyles -License: MIT License ---- -For use with the Uniform plugin: -http://pixelmatrixdesign.com/uniform/ ---- -Generated by Uniform Theme Generator: -http://pixelmatrixdesign.com/uniform/themer.html - -*/ - -/* Global Declaration */ - -div.selector, -div.selector span, -div.checker span, -div.radio span, -div.uploader, -div.uploader span.action, -div.button, -div.button span { - background-image: url(images/sprite.png); - background-repeat: no-repeat; - -webkit-font-smoothing: antialiased; -} - -.selector, -.radio, -.checker, -.uploader, -.button, -.selector *, -.radio *, -.checker *, -.uploader *, -.button *{ - margin: 0; - padding: 0; -} - -/* INPUT & TEXTAREA */ - -input.text, -input.email, -input.search, -input.tel, -input.url, -input.datetime, -input.date, -input.month, -input.week, -input.time, -input.datetime-local, -input.number, -input.color, -input.password, -select.uniform-multiselect, -textarea.uniform { - font-size: 12px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-weight: normal; - padding: 3px; - color: #777; - background: url('images/bg-input-focus.png') repeat-x 0px 0px; - background: url('images/bg-input.png') repeat-x 0px 0px; - border-top: solid 1px #aaa; - border-left: solid 1px #aaa; - border-bottom: solid 1px #ccc; - border-right: solid 1px #ccc; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - outline: 0; -} - -/* remove default webkit and possible mozilla .search styles */ -input.search, input.search:active { - -moz-appearance: none; - -webkit-appearance: none; -} - -input.text:focus, -input.email:focus, -input.search:focus, -input.tel:focus, -input.url:focus, -input.datetime:focus, -input.date:focus, -input.month:focus, -input.week:focus, -input.time:focus, -input.datetime-local:focus, -input.number:focus, -input.color:focus, -input.password:focus, -select.uniform-multiselect:focus, -textarea.uniform:focus { - -webkit-box-shadow: 0px 0px 4px rgba(0,0,0,0.3); - -moz-box-shadow: 0px 0px 4px rgba(0,0,0,0.3); - box-shadow: 0px 0px 4px rgba(0,0,0,0.3); - border-color: #999; - background: url('images/bg-input-focus.png') repeat-x 0px 0px; -} - -/* SPRITES */ - -/* Select */ - -div.selector { - background-position: -483px -130px; - line-height: 26px; - height: 26px; -} - -div.selector span { - background-position: right 0px; - height: 26px; - line-height: 26px; -} - -div.selector select { - /* change these to adjust positioning of select element */ - top: 0px; - left: 0px; -} - -div.selector:active, -div.selector.active { - background-position: -483px -156px; -} - -div.selector:active span, -div.selector.active span { - background-position: right -26px; -} - -div.selector.focus, div.selector.hover, div.selector:hover { - background-position: -483px -182px; -} - -div.selector.focus span, div.selector.hover span, div.selector:hover span { - background-position: right -52px; -} - -div.selector.focus:active, -div.selector.focus.active, -div.selector:hover:active, -div.selector.active:hover { - background-position: -483px -208px; -} - -div.selector.focus:active span, -div.selector:hover:active span, -div.selector.active:hover span, -div.selector.focus.active span { - background-position: right -78px; -} - -div.selector.disabled { - background-position: -483px -234px; -} - -div.selector.disabled span { - background-position: right -104px; -} - -/* Checkbox */ - -div.checker { - width: 19px; - height: 19px; -} - -div.checker input { - width: 19px; - height: 19px; -} - -div.checker span { - background-position: 0px -260px; - height: 19px; - width: 19px; -} - -div.checker:active span, -div.checker.active span { - background-position: -19px -260px; -} - -div.checker.focus span, -div.checker:hover span { - background-position: -38px -260px; -} - -div.checker.focus:active span, -div.checker:active:hover span, -div.checker.active:hover span, -div.checker.focus.active span { - background-position: -57px -260px; -} - -div.checker span.checked { - background-position: -76px -260px; -} - -div.checker:active span.checked, -div.checker.active span.checked { - background-position: -95px -260px; -} - -div.checker.focus span.checked, -div.checker:hover span.checked { - background-position: -114px -260px; -} - -div.checker.focus:active span.checked, -div.checker:hover:active span.checked, -div.checker.active:hover span.checked, -div.checker.active.focus span.checked { - background-position: -133px -260px; -} - -div.checker.disabled span, -div.checker.disabled:active span, -div.checker.disabled.active span { - background-position: -152px -260px; -} - -div.checker.disabled span.checked, -div.checker.disabled:active span.checked, -div.checker.disabled.active span.checked { - background-position: -171px -260px; -} - -/* Radio */ - -div.radio { - width: 18px; - height: 18px; -} - -div.radio input { - width: 18px; - height: 18px; -} - -div.radio span { - height: 18px; - width: 18px; - background-position: 0px -279px; -} - -div.radio:active span, -div.radio.active span { - background-position: -18px -279px; -} - -div.radio.focus span, -div.radio:hover span { - background-position: -36px -279px; -} - -div.radio.focus:active span, -div.radio:active:hover span, -div.radio.active:hover span, -div.radio.active.focus span { - background-position: -54px -279px; -} - -div.radio span.checked { - background-position: -72px -279px; -} - -div.radio:active span.checked, -div.radio.active span.checked { - background-position: -90px -279px; -} - -div.radio.focus span.checked, div.radio:hover span.checked { - background-position: -108px -279px; -} - -div.radio.focus:active span.checked, -div.radio:hover:active span.checked, -div.radio.focus.active span.checked, -div.radio.active:hover span.checked { - background-position: -126px -279px; -} - -div.radio.disabled span, -div.radio.disabled:active span, -div.radio.disabled.active span { - background-position: -144px -279px; -} - -div.radio.disabled span.checked, -div.radio.disabled:active span.checked, -div.radio.disabled.active span.checked { - background-position: -162px -279px; -} - -/* Uploader */ - -div.uploader { - background-position: 0px -297px; - height: 28px; -} - -div.uploader span.action { - background-position: right -409px; - height: 24px; - line-height: 24px; -} - -div.uploader span.filename { - height: 24px; - /* change this line to adjust positioning of filename area */ - margin: 2px 0px 2px 2px; - line-height: 24px; -} - -div.uploader.focus, -div.uploader.hover, -div.uploader:hover { - background-position: 0px -353px; -} - -div.uploader.focus span.action, -div.uploader.hover span.action, -div.uploader:hover span.action { - background-position: right -437px; -} - -div.uploader.active span.action, -div.uploader:active span.action { - background-position: right -465px; -} - -div.uploader.focus.active span.action, -div.uploader:focus.active span.action, -div.uploader.focus:active span.action, -div.uploader:focus:active span.action { - background-position: right -493px; -} - -div.uploader.disabled { - background-position: 0px -325px; -} - -div.uploader.disabled span.action { - background-position: right -381px; -} - -div.button { - background-position: 0px -523px; -} - -div.button span { - background-position: right -643px; -} - -div.button.focus, -div.button:focus, -div.button:hover, -div.button.hover { - background-position: 0px -553px; -} - -div.button.focus span, -div.button:focus span, -div.button:hover span, -div.button.hover span { - background-position: right -673px; -} - -div.button.active, -div.button:active { - background-position: 0px -583px; -} - -div.button.active span, -div.button:active span { - background-position: right -703px; - color: #555; -} - -div.button.disabled, -div.button:disabled { - background-position: 0px -613px; -} - -div.button.disabled span, -div.button:disabled span { - background-position: right -733px; - color: #bbb; - cursor: default; -} - -/* PRESENTATION */ - -/* Button */ - -div.button { - height: 30px; -} - -div.button span { - margin-left: 13px; - height: 22px; - padding-top: 8px; - font-weight: bold; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 12px; - letter-spacing: 1px; - text-transform: uppercase; - padding-left: 2px; - padding-right: 15px; -} - -/* Select */ -div.selector { - width: 190px; - font-size: 12px; -} - -div.selector select { - min-width: 190px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 12px; - border: solid 1px #fff; -} - -div.selector span { - padding: 0px 25px 0px 2px; - cursor: pointer; -} - -div.selector span { - color: #666; - width: 158px; - text-shadow: 0 1px 0 #fff; -} - -div.selector.disabled span { - color: #bbb; -} - -/* Checker */ -div.checker { - margin-right: 5px; -} - -/* Radio */ -div.radio { - margin-right: 3px; -} - -/* Uploader */ -div.uploader { - width: 190px; - cursor: pointer; -} - -div.uploader span.action { - width: 85px; - text-align: center; - text-shadow: #fff 0px 1px 0px; - background-color: #fff; - font-size: 11px; - font-weight: bold; -} - -div.uploader span.filename { - color: #777; - width: 82px; - border-right: solid 1px #bbb; - font-size: 11px; -} - -div.uploader input { - width: 190px; -} - -div.uploader.disabled span.action { - color: #aaa; -} - -div.uploader.disabled span.filename { - border-color: #ddd; - color: #aaa; -} -/* - -CORE FUNCTIONALITY - -Not advised to edit stuff below this line ------------------------------------------------------ -*/ - -.selector, -.checker, -.button, -.radio, -.uploader { - display: -moz-inline-box; - display: inline-block; - vertical-align: middle; - zoom: 1; - *display: inline; -} - -.selector select:focus, .radio input:focus, .checker input:focus, .uploader input:focus { - outline: 0; -} - -/* Button */ - -div.button a, -div.button button, -div.button input { - position: absolute; -} - -div.button { - cursor: pointer; - position: relative; -} - -div.button span { - display: -moz-inline-box; - display: inline-block; - line-height: 1; - text-align: center; -} - -/* Select */ - -div.selector { - position: relative; - padding-left: 10px; - overflow: hidden; -} - -div.selector span { - display: block; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -div.selector select { - position: absolute; - opacity: 0; - filter: alpha(opacity=0); - -moz-opacity: 0; - height: 25px; - border: none; - background: none; -} - -/* Checker */ - -div.checker { - position: relative; -} - -div.checker span { - display: -moz-inline-box; - display: inline-block; - text-align: center; -} - -div.checker input { - opacity: 0; - filter: alpha(opacity=0); - -moz-opacity: 0; - display: inline-block; - background: none; -} - -/* Radio */ - -div.radio { - position: relative; -} - -div.radio span { - display: -moz-inline-box; - display: inline-block; - text-align: center; -} - -div.radio input { - opacity: 0; - filter: alpha(opacity=0); - -moz-opacity: 0; - text-align: center; - display: inline-block; - background: none; -} - -/* Uploader */ - -div.uploader { - position: relative; - overflow: hidden; - cursor: default; -} - -div.uploader span.action { - float: left; - display: inline; - padding: 2px 0px; - overflow: hidden; - cursor: pointer; -} - -div.uploader span.filename { - padding: 0px 10px; - float: left; - display: block; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; -} - -div.uploader input { - opacity: 0; - filter: alpha(opacity=0); - -moz-opacity: 0; - position: absolute; - top: 0; - right: 0; - bottom: 0; - float: right; - height: 25px; - border: none; - cursor: default; -} +/* + +Uniform Theme: Uniform Default +Version: 1.8 +By: Josh Pyles +License: MIT License +--- +For use with the Uniform plugin: +http://pixelmatrixdesign.com/uniform/ +--- +Generated by Uniform Theme Generator: +http://pixelmatrixdesign.com/uniform/themer.html + +*/ + +/* Global Declaration */ + +div.selector, +div.selector span, +div.checker span, +div.radio span, +div.uploader, +div.uploader span.action, +div.button, +div.button span { + background-image: url(images/sprite.png); + background-repeat: no-repeat; + -webkit-font-smoothing: antialiased; +} + +.selector, +.radio, +.checker, +.uploader, +.button, +.selector *, +.radio *, +.checker *, +.uploader *, +.button *{ + margin: 0; + padding: 0; +} + +/* INPUT & TEXTAREA */ + +input.text, +input.email, +input.search, +input.tel, +input.url, +input.datetime, +input.date, +input.month, +input.week, +input.time, +input.datetime-local, +input.number, +input.color, +input.password, +select.uniform-multiselect, +textarea.uniform { + font-size: 12px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: normal; + padding: 3px; + color: #777; + background: url('images/bg-input-focus.png') repeat-x 0px 0px; + background: url('images/bg-input.png') repeat-x 0px 0px; + border-top: solid 1px #aaa; + border-left: solid 1px #aaa; + border-bottom: solid 1px #ccc; + border-right: solid 1px #ccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + outline: 0; +} + +/* remove default webkit and possible mozilla .search styles */ +input.search, input.search:active { + -moz-appearance: none; + -webkit-appearance: none; +} + +input.text:focus, +input.email:focus, +input.search:focus, +input.tel:focus, +input.url:focus, +input.datetime:focus, +input.date:focus, +input.month:focus, +input.week:focus, +input.time:focus, +input.datetime-local:focus, +input.number:focus, +input.color:focus, +input.password:focus, +select.uniform-multiselect:focus, +textarea.uniform:focus { + -webkit-box-shadow: 0px 0px 4px rgba(0,0,0,0.3); + -moz-box-shadow: 0px 0px 4px rgba(0,0,0,0.3); + box-shadow: 0px 0px 4px rgba(0,0,0,0.3); + border-color: #999; + background: url('images/bg-input-focus.png') repeat-x 0px 0px; +} + +/* SPRITES */ + +/* Select */ + +div.selector { + background-position: -483px -130px; + line-height: 26px; + height: 26px; +} + +div.selector span { + background-position: right 0px; + height: 26px; + line-height: 26px; +} + +div.selector select { + /* change these to adjust positioning of select element */ + top: 0px; + left: 0px; +} + +div.selector:active, +div.selector.active { + background-position: -483px -156px; +} + +div.selector:active span, +div.selector.active span { + background-position: right -26px; +} + +div.selector.focus, div.selector.hover, div.selector:hover { + background-position: -483px -182px; +} + +div.selector.focus span, div.selector.hover span, div.selector:hover span { + background-position: right -52px; +} + +div.selector.focus:active, +div.selector.focus.active, +div.selector:hover:active, +div.selector.active:hover { + background-position: -483px -208px; +} + +div.selector.focus:active span, +div.selector:hover:active span, +div.selector.active:hover span, +div.selector.focus.active span { + background-position: right -78px; +} + +div.selector.disabled { + background-position: -483px -234px; +} + +div.selector.disabled span { + background-position: right -104px; +} + +/* Checkbox */ + +div.checker { + width: 19px; + height: 19px; +} + +div.checker input { + width: 19px; + height: 19px; +} + +div.checker span { + background-position: 0px -260px; + height: 19px; + width: 19px; +} + +div.checker:active span, +div.checker.active span { + background-position: -19px -260px; +} + +div.checker.focus span, +div.checker:hover span { + background-position: -38px -260px; +} + +div.checker.focus:active span, +div.checker:active:hover span, +div.checker.active:hover span, +div.checker.focus.active span { + background-position: -57px -260px; +} + +div.checker span.checked { + background-position: -76px -260px; +} + +div.checker:active span.checked, +div.checker.active span.checked { + background-position: -95px -260px; +} + +div.checker.focus span.checked, +div.checker:hover span.checked { + background-position: -114px -260px; +} + +div.checker.focus:active span.checked, +div.checker:hover:active span.checked, +div.checker.active:hover span.checked, +div.checker.active.focus span.checked { + background-position: -133px -260px; +} + +div.checker.disabled span, +div.checker.disabled:active span, +div.checker.disabled.active span { + background-position: -152px -260px; +} + +div.checker.disabled span.checked, +div.checker.disabled:active span.checked, +div.checker.disabled.active span.checked { + background-position: -171px -260px; +} + +/* Radio */ + +div.radio { + width: 18px; + height: 18px; +} + +div.radio input { + width: 18px; + height: 18px; +} + +div.radio span { + height: 18px; + width: 18px; + background-position: 0px -279px; +} + +div.radio:active span, +div.radio.active span { + background-position: -18px -279px; +} + +div.radio.focus span, +div.radio:hover span { + background-position: -36px -279px; +} + +div.radio.focus:active span, +div.radio:active:hover span, +div.radio.active:hover span, +div.radio.active.focus span { + background-position: -54px -279px; +} + +div.radio span.checked { + background-position: -72px -279px; +} + +div.radio:active span.checked, +div.radio.active span.checked { + background-position: -90px -279px; +} + +div.radio.focus span.checked, div.radio:hover span.checked { + background-position: -108px -279px; +} + +div.radio.focus:active span.checked, +div.radio:hover:active span.checked, +div.radio.focus.active span.checked, +div.radio.active:hover span.checked { + background-position: -126px -279px; +} + +div.radio.disabled span, +div.radio.disabled:active span, +div.radio.disabled.active span { + background-position: -144px -279px; +} + +div.radio.disabled span.checked, +div.radio.disabled:active span.checked, +div.radio.disabled.active span.checked { + background-position: -162px -279px; +} + +/* Uploader */ + +div.uploader { + background-position: 0px -297px; + height: 28px; +} + +div.uploader span.action { + background-position: right -409px; + height: 24px; + line-height: 24px; +} + +div.uploader span.filename { + height: 24px; + /* change this line to adjust positioning of filename area */ + margin: 2px 0px 2px 2px; + line-height: 24px; +} + +div.uploader.focus, +div.uploader.hover, +div.uploader:hover { + background-position: 0px -353px; +} + +div.uploader.focus span.action, +div.uploader.hover span.action, +div.uploader:hover span.action { + background-position: right -437px; +} + +div.uploader.active span.action, +div.uploader:active span.action { + background-position: right -465px; +} + +div.uploader.focus.active span.action, +div.uploader:focus.active span.action, +div.uploader.focus:active span.action, +div.uploader:focus:active span.action { + background-position: right -493px; +} + +div.uploader.disabled { + background-position: 0px -325px; +} + +div.uploader.disabled span.action { + background-position: right -381px; +} + +div.button { + background-position: 0px -523px; +} + +div.button span { + background-position: right -643px; +} + +div.button.focus, +div.button:focus, +div.button:hover, +div.button.hover { + background-position: 0px -553px; +} + +div.button.focus span, +div.button:focus span, +div.button:hover span, +div.button.hover span { + background-position: right -673px; +} + +div.button.active, +div.button:active { + background-position: 0px -583px; +} + +div.button.active span, +div.button:active span { + background-position: right -703px; + color: #555; +} + +div.button.disabled, +div.button:disabled { + background-position: 0px -613px; +} + +div.button.disabled span, +div.button:disabled span { + background-position: right -733px; + color: #bbb; + cursor: default; +} + +/* PRESENTATION */ + +/* Button */ + +div.button { + height: 30px; +} + +div.button span { + margin-left: 13px; + height: 22px; + padding-top: 8px; + font-weight: bold; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + letter-spacing: 1px; + text-transform: uppercase; + padding-left: 2px; + padding-right: 15px; +} + +/* Select */ +div.selector { + width: 190px; + font-size: 12px; +} + +div.selector select { + min-width: 190px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + border: solid 1px #fff; +} + +div.selector span { + padding: 0px 25px 0px 2px; + cursor: pointer; +} + +div.selector span { + color: #666; + width: 158px; + text-shadow: 0 1px 0 #fff; +} + +div.selector.disabled span { + color: #bbb; +} + +/* Checker */ +div.checker { + margin-right: 5px; +} + +/* Radio */ +div.radio { + margin-right: 3px; +} + +/* Uploader */ +div.uploader { + width: 190px; + cursor: pointer; +} + +div.uploader span.action { + width: 85px; + text-align: center; + text-shadow: #fff 0px 1px 0px; + background-color: #fff; + font-size: 11px; + font-weight: bold; +} + +div.uploader span.filename { + color: #777; + width: 82px; + border-right: solid 1px #bbb; + font-size: 11px; +} + +div.uploader input { + width: 190px; +} + +div.uploader.disabled span.action { + color: #aaa; +} + +div.uploader.disabled span.filename { + border-color: #ddd; + color: #aaa; +} +/* + +CORE FUNCTIONALITY + +Not advised to edit stuff below this line +----------------------------------------------------- +*/ + +.selector, +.checker, +.button, +.radio, +.uploader { + display: -moz-inline-box; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} + +.selector select:focus, .radio input:focus, .checker input:focus, .uploader input:focus { + outline: 0; +} + +/* Button */ + +div.button a, +div.button button, +div.button input { + position: absolute; +} + +div.button { + cursor: pointer; + position: relative; +} + +div.button span { + display: -moz-inline-box; + display: inline-block; + line-height: 1; + text-align: center; +} + +/* Select */ + +div.selector { + position: relative; + padding-left: 10px; + overflow: hidden; +} + +div.selector span { + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +div.selector select { + position: absolute; + opacity: 0; + filter: alpha(opacity=0); + -moz-opacity: 0; + height: 25px; + border: none; + background: none; +} + +/* Checker */ + +div.checker { + position: relative; +} + +div.checker span { + display: -moz-inline-box; + display: inline-block; + text-align: center; +} + +div.checker input { + opacity: 0; + filter: alpha(opacity=0); + -moz-opacity: 0; + display: inline-block; + background: none; +} + +/* Radio */ + +div.radio { + position: relative; +} + +div.radio span { + display: -moz-inline-box; + display: inline-block; + text-align: center; +} + +div.radio input { + opacity: 0; + filter: alpha(opacity=0); + -moz-opacity: 0; + text-align: center; + display: inline-block; + background: none; +} + +/* Uploader */ + +div.uploader { + position: relative; + overflow: hidden; + cursor: default; +} + +div.uploader span.action { + float: left; + display: inline; + padding: 2px 0px; + overflow: hidden; + cursor: pointer; +} + +div.uploader span.filename { + padding: 0px 10px; + float: left; + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: default; +} + +div.uploader input { + opacity: 0; + filter: alpha(opacity=0); + -moz-opacity: 0; + position: absolute; + top: 0; + right: 0; + bottom: 0; + float: right; + height: 25px; + border: none; + cursor: default; +} diff --git a/assets/grocery_crud/css/ui/index.html b/assets/grocery_crud/css/ui/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/css/ui/index.html +++ b/assets/grocery_crud/css/ui/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/css/ui/simple/index.html b/assets/grocery_crud/css/ui/simple/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/css/ui/simple/index.html +++ b/assets/grocery_crud/css/ui/simple/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/css/ui/simple/jquery-ui-1.10.1.custom.min.css b/assets/grocery_crud/css/ui/simple/jquery-ui-1.10.1.custom.min.css index d869c7b..aa671e0 100755 --- a/assets/grocery_crud/css/ui/simple/jquery-ui-1.10.1.custom.min.css +++ b/assets/grocery_crud/css/ui/simple/jquery-ui-1.10.1.custom.min.css @@ -1,5 +1,5 @@ -/*! jQuery UI - v1.10.1 - 2013-02-19 -* http://jqueryui.com -* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=%23cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=%23aaaaaa&fcHeader=%23222222&iconColorHeader=%23222222&bgColorContent=%23ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23aaaaaa&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=%23d3d3d3&fcDefault=%23555555&iconColorDefault=%23333333&bgColorHover=%23dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=%23999999&fcHover=%23212121&iconColorHover=%23454545&bgColorActive=%23ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=%23aaaaaa&fcActive=%23212121&iconColorActive=%23454545&bgColorHighlight=%23fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=%23fcefa1&fcHighlight=%23363636&iconColorHighlight=%232e83ff&bgColorError=%23fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=%23cd0a0a&fcError=%23cd0a0a&iconColorError=%23cd0a0a&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +/*! jQuery UI - v1.10.1 - 2013-02-19 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=%23cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=%23aaaaaa&fcHeader=%23222222&iconColorHeader=%23222222&bgColorContent=%23ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23aaaaaa&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=%23d3d3d3&fcDefault=%23555555&iconColorDefault=%23333333&bgColorHover=%23dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=%23999999&fcHover=%23212121&iconColorHover=%23454545&bgColorActive=%23ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=%23aaaaaa&fcActive=%23212121&iconColorActive=%23454545&bgColorHighlight=%23fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=%23fcefa1&fcHighlight=%23363636&iconColorHighlight=%232e83ff&bgColorError=%23fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=%23cd0a0a&fcError=%23cd0a0a&iconColorError=%23cd0a0a&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px * Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("images/animated-overlay.gif");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px;background-position:16px 16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_333333_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} \ No newline at end of file diff --git a/assets/grocery_crud/index.html b/assets/grocery_crud/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/index.html +++ b/assets/grocery_crud/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/js/common/lazyload-min.js b/assets/grocery_crud/js/common/lazyload-min.js index 6121fc8..53a13a5 100755 --- a/assets/grocery_crud/js/common/lazyload-min.js +++ b/assets/grocery_crud/js/common/lazyload-min.js @@ -1,7 +1,7 @@ -/* -Copyright (c) 2008 Ryan Grove . All rights reserved. -Licensed under the BSD License: -http://www.opensource.org/licenses/bsd-license.html -Version: 1.0.4 -*/ +/* +Copyright (c) 2008 Ryan Grove . All rights reserved. +Licensed under the BSD License: +http://www.opensource.org/licenses/bsd-license.html +Version: 1.0.4 +*/ var LazyLoad=function(){var E=document,D=null,A=[],C;function B(){if(C){return }var G=navigator.userAgent,F;C={gecko:0,ie:0,webkit:0};F=G.match(/AppleWebKit\/(\S*)/);if(F&&F[1]){C.webkit=parseFloat(F[1])}else{F=G.match(/MSIE\s([^;]*)/);if(F&&F[1]){C.ie=parseFloat(F[1])}else{if((/Gecko\/(\S*)/).test(G)){C.gecko=1;F=G.match(/rv:([^\s\)]*)/);if(F&&F[1]){C.gecko=parseFloat(F[1])}}}}}return{load:function(K,L,J,I){var H=E.getElementsByTagName("head")[0],G,F;if(K){K=K.constructor===Array?K:[K];for(G=0;G=420){F.onload=LazyLoad.requestComplete;F.onerror=LazyLoad.requestComplete}}H.appendChild(F);if(!C.ie&&!C.gecko&&!(C.webkit>=420)){F=E.createElement("script");F.appendChild(E.createTextNode("LazyLoad.requestComplete();"));H.appendChild(F)}},loadOnce:function(N,O,L,P,G){var H=[],I=E.getElementsByTagName("script"),M,J,K,F;N=N.constructor===Array?N:[N];for(M=0;M0){LazyLoad.load(H,O,L,P)}else{if(G){if(L){if(P){O.call(L)}else{O.call(window,L)}}else{O.call()}}}},requestComplete:function(){if(D.callback){if(D.obj){if(D.scope){D.callback.call(D.obj)}else{D.callback.call(window,D.obj)}}else{D.callback.call()}}D=null;if(A.length){LazyLoad.load()}}}}(); \ No newline at end of file diff --git a/assets/grocery_crud/js/common/list.js b/assets/grocery_crud/js/common/list.js index be7cba1..821f93f 100755 --- a/assets/grocery_crud/js/common/list.js +++ b/assets/grocery_crud/js/common/list.js @@ -1,80 +1,80 @@ -var js_libraries = []; - -var fnOpenEditForm = function(this_element){ - - var href_url = this_element.attr("href"); - - var dialog_height = $(window).height() - 80; - - //Close all - $(".ui-dialog-content").dialog("close"); - - $.ajax({ - url: href_url, - data: { - is_ajax: 'true' - }, - type: 'post', - dataType: 'json', - beforeSend: function() { - this_element.closest('.flexigrid').addClass('loading-opacity'); - }, - complete: function(){ - this_element.closest('.flexigrid').removeClass('loading-opacity'); - }, - success: function (data) { - if (typeof CKEDITOR !== 'undefined' && typeof CKEDITOR.instances !== 'undefined') { - $.each(CKEDITOR.instances,function(index){ - delete CKEDITOR.instances[index]; - }); - } - - LazyLoad.loadOnce(data.js_lib_files); - LazyLoad.load(data.js_config_files); - - $.each(data.css_files,function(index,css_file){ - load_css_file(css_file); - }); - - $("
").html(data.output).dialog({ - width: 910, - modal: true, - height: dialog_height, - close: function(){ - $(this).remove(); - }, - open: function(){ - var this_dialog = $(this); - - $('#cancel-button').click(function(){ - this_dialog.dialog("close"); - }); - - } - }); - } - }); -}; - -var add_edit_button_listener = function () { - - //If dialog AJAX forms is turned on from grocery CRUD config - if (dialog_forms) { - - $('.edit_button,.add_button').unbind('click'); - $('.edit_button,.add_button').click(function(){ - - fnOpenEditForm($(this)); - - return false; - }); - - } -} - -var load_css_file = function(css_file) { - if ($('head').find('link[href="'+css_file+'"]').length == 0) { - $('head').append($('').attr("type","text/css") - .attr("rel","stylesheet").attr("href",css_file)); - } -}; +var js_libraries = []; + +var fnOpenEditForm = function(this_element){ + + var href_url = this_element.attr("href"); + + var dialog_height = $(window).height() - 80; + + //Close all + $(".ui-dialog-content").dialog("close"); + + $.ajax({ + url: href_url, + data: { + is_ajax: 'true' + }, + type: 'post', + dataType: 'json', + beforeSend: function() { + this_element.closest('.flexigrid').addClass('loading-opacity'); + }, + complete: function(){ + this_element.closest('.flexigrid').removeClass('loading-opacity'); + }, + success: function (data) { + if (typeof CKEDITOR !== 'undefined' && typeof CKEDITOR.instances !== 'undefined') { + $.each(CKEDITOR.instances,function(index){ + delete CKEDITOR.instances[index]; + }); + } + + LazyLoad.loadOnce(data.js_lib_files); + LazyLoad.load(data.js_config_files); + + $.each(data.css_files,function(index,css_file){ + load_css_file(css_file); + }); + + $("
").html(data.output).dialog({ + width: 910, + modal: true, + height: dialog_height, + close: function(){ + $(this).remove(); + }, + open: function(){ + var this_dialog = $(this); + + $('#cancel-button').click(function(){ + this_dialog.dialog("close"); + }); + + } + }); + } + }); +}; + +var add_edit_button_listener = function () { + + //If dialog AJAX forms is turned on from grocery CRUD config + if (dialog_forms) { + + $('.edit_button,.add_button').unbind('click'); + $('.edit_button,.add_button').click(function(){ + + fnOpenEditForm($(this)); + + return false; + }); + + } +} + +var load_css_file = function(css_file) { + if ($('head').find('link[href="'+css_file+'"]').length == 0) { + $('head').append($('').attr("type","text/css") + .attr("rel","stylesheet").attr("href",css_file)); + } +}; diff --git a/assets/grocery_crud/js/index.html b/assets/grocery_crud/js/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/js/index.html +++ b/assets/grocery_crud/js/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery-1.10.2.min.js b/assets/grocery_crud/js/jquery-1.10.2.min.js index f451412..cdcd81e 100755 --- a/assets/grocery_crud/js/jquery-1.10.2.min.js +++ b/assets/grocery_crud/js/jquery-1.10.2.min.js @@ -1,9 +1,9 @@ -/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license -//@ sourceMappingURL=jquery-1.10.2.min.map -*/ -(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
t
",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t -}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); -u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("').appendTo(content); - } - - wrap.show(); - - busy = false; - - $.fancybox.center(); - - currentOpts.onComplete(currentArray, currentIndex, currentOpts); - - _preload_images(); - }, - - _preload_images = function() { - var href, - objNext; - - if ((currentArray.length -1) > currentIndex) { - href = currentArray[ currentIndex + 1 ].href; - - if (typeof href !== 'undefined' && href.match(imgRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - - if (currentIndex > 0) { - href = currentArray[ currentIndex - 1 ].href; - - if (typeof href !== 'undefined' && href.match(imgRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - }, - - _draw = function(pos) { - var dim = { - width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), - height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), - - top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), - left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) - }; - - if (typeof final_pos.opacity !== 'undefined') { - dim.opacity = pos < 0.5 ? 0.5 : pos; - } - - wrap.css(dim); - - content.css({ - 'width' : dim.width - currentOpts.padding * 2, - 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 - }); - }, - - _get_viewport = function() { - return [ - $(window).width() - (currentOpts.margin * 2), - $(window).height() - (currentOpts.margin * 2), - $(document).scrollLeft() + currentOpts.margin, - $(document).scrollTop() + currentOpts.margin - ]; - }, - - _get_zoom_to = function () { - var view = _get_viewport(), - to = {}, - resize = currentOpts.autoScale, - double_padding = currentOpts.padding * 2, - ratio; - - if (currentOpts.width.toString().indexOf('%') > -1) { - to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); - } else { - to.width = currentOpts.width + double_padding; - } - - if (currentOpts.height.toString().indexOf('%') > -1) { - to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); - } else { - to.height = currentOpts.height + double_padding; - } - - if (resize && (to.width > view[0] || to.height > view[1])) { - if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { - ratio = (currentOpts.width ) / (currentOpts.height ); - - if ((to.width ) > view[0]) { - to.width = view[0]; - to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); - } - - if ((to.height) > view[1]) { - to.height = view[1]; - to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); - } - - } else { - to.width = Math.min(to.width, view[0]); - to.height = Math.min(to.height, view[1]); - } - } - - to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); - to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); - - return to; - }, - - _get_obj_pos = function(obj) { - var pos = obj.offset(); - - pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; - pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; - - pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; - pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; - - pos.width = obj.width(); - pos.height = obj.height(); - - return pos; - }, - - _get_zoom_from = function() { - var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, - from = {}, - pos, - view; - - if (orig && orig.length) { - pos = _get_obj_pos(orig); - - from = { - width : pos.width + (currentOpts.padding * 2), - height : pos.height + (currentOpts.padding * 2), - top : pos.top - currentOpts.padding - 20, - left : pos.left - currentOpts.padding - 20 - }; - - } else { - view = _get_viewport(); - - from = { - width : currentOpts.padding * 2, - height : currentOpts.padding * 2, - top : parseInt(view[3] + view[1] * 0.5, 10), - left : parseInt(view[2] + view[0] * 0.5, 10) - }; - } - - return from; - }, - - _animate_loading = function() { - if (!loading.is(':visible')){ - clearInterval(loadingTimer); - return; - } - - $('div', loading).css('top', (loadingFrame * -40) + 'px'); - - loadingFrame = (loadingFrame + 1) % 12; - }; - - /* - * Public methods - */ - - $.fn.fancybox = function(options) { - if (!$(this).length) { - return this; - } - - $(this) - .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) - .unbind('click.fb') - .bind('click.fb', function(e) { - e.preventDefault(); - - if (busy) { - return; - } - - busy = true; - - $(this).blur(); - - selectedArray = []; - selectedIndex = 0; - - var rel = $(this).attr('rel') || ''; - - if (!rel || rel == '' || rel === 'nofollow') { - selectedArray.push(this); - - } else { - selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); - selectedIndex = selectedArray.index( this ); - } - - _start(); - - return; - }); - - return this; - }; - - $.fancybox = function(obj) { - var opts; - - if (busy) { - return; - } - - busy = true; - opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; - - selectedArray = []; - selectedIndex = parseInt(opts.index, 10) || 0; - - if ($.isArray(obj)) { - for (var i = 0, j = obj.length; i < j; i++) { - if (typeof obj[i] == 'object') { - $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); - } else { - obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); - } - } - - selectedArray = jQuery.merge(selectedArray, obj); - - } else { - if (typeof obj == 'object') { - $(obj).data('fancybox', $.extend({}, opts, obj)); - } else { - obj = $({}).data('fancybox', $.extend({content : obj}, opts)); - } - - selectedArray.push(obj); - } - - if (selectedIndex > selectedArray.length || selectedIndex < 0) { - selectedIndex = 0; - } - - _start(); - }; - - $.fancybox.showActivity = function() { - clearInterval(loadingTimer); - - loading.show(); - loadingTimer = setInterval(_animate_loading, 66); - }; - - $.fancybox.hideActivity = function() { - loading.hide(); - }; - - $.fancybox.next = function() { - return $.fancybox.pos( currentIndex + 1); - }; - - $.fancybox.prev = function() { - return $.fancybox.pos( currentIndex - 1); - }; - - $.fancybox.pos = function(pos) { - if (busy) { - return; - } - - pos = parseInt(pos); - - selectedArray = currentArray; - - if (pos > -1 && pos < currentArray.length) { - selectedIndex = pos; - _start(); - - } else if (currentOpts.cyclic && currentArray.length > 1) { - selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; - _start(); - } - - return; - }; - - $.fancybox.cancel = function() { - if (busy) { - return; - } - - busy = true; - - $.event.trigger('fancybox-cancel'); - - _abort(); - - selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); - - busy = false; - }; - - // Note: within an iframe use - parent.$.fancybox.close(); - $.fancybox.close = function() { - if (busy || wrap.is(':hidden')) { - return; - } - - busy = true; - - if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { - busy = false; - return; - } - - _abort(); - - $(close.add( nav_left ).add( nav_right )).hide(); - - $(content.add( overlay )).unbind(); - - $(window).unbind("resize.fb scroll.fb"); - $(document).unbind('keydown.fb'); - - content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); - - if (currentOpts.titlePosition !== 'inside') { - title.empty(); - } - - wrap.stop(); - - function _cleanup() { - overlay.fadeOut('fast'); - - title.empty().hide(); - wrap.hide(); - - $.event.trigger('fancybox-cleanup'); - - content.empty(); - - currentOpts.onClosed(currentArray, currentIndex, currentOpts); - - currentArray = selectedOpts = []; - currentIndex = selectedIndex = 0; - currentOpts = selectedOpts = {}; - - busy = false; - } - - if (currentOpts.transitionOut == 'elastic') { - start_pos = _get_zoom_from(); - - var pos = wrap.position(); - - final_pos = { - top : pos.top , - left : pos.left, - width : wrap.width(), - height : wrap.height() - }; - - if (currentOpts.opacity) { - final_pos.opacity = 1; - } - - title.empty().hide(); - - fx.prop = 1; - - $(fx).animate({ prop: 0 }, { - duration : currentOpts.speedOut, - easing : currentOpts.easingOut, - step : _draw, - complete : _cleanup - }); - - } else { - wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); - } - }; - - $.fancybox.resize = function() { - if (overlay.is(':visible')) { - overlay.css('height', $(document).height()); - } - - $.fancybox.center(true); - }; - - $.fancybox.center = function() { - var view, align; - - if (busy) { - return; - } - - align = arguments[0] === true ? 1 : 0; - view = _get_viewport(); - - if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { - return; - } - - wrap - .stop() - .animate({ - 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), - 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) - }, typeof arguments[0] == 'number' ? arguments[0] : 200); - }; - - $.fancybox.init = function() { - if ($("#fancybox-wrap").length) { - return; - } - - $('body').append( - tmp = $('
'), - loading = $('
'), - overlay = $('
'), - wrap = $('
') - ); - - outer = $('
') - .append('
') - .appendTo( wrap ); - - outer.append( - content = $('
'), - close = $(''), - title = $('
'), - - nav_left = $(''), - nav_right = $('') - ); - - close.click($.fancybox.close); - loading.click($.fancybox.cancel); - - nav_left.click(function(e) { - e.preventDefault(); - $.fancybox.prev(); - }); - - nav_right.click(function(e) { - e.preventDefault(); - $.fancybox.next(); - }); - - if ($.fn.mousewheel) { - wrap.bind('mousewheel.fb', function(e, delta) { - if (busy) { - e.preventDefault(); - - } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { - e.preventDefault(); - $.fancybox[ delta > 0 ? 'prev' : 'next'](); - } - }); - } - - if (!$.support.opacity) { - wrap.addClass('fancybox-ie'); - } - - if (isIE6) { - loading.addClass('fancybox-ie6'); - wrap.addClass('fancybox-ie6'); - - $('').prependTo(outer); - } - }; - - $.fn.fancybox.defaults = { - padding : 10, - margin : 40, - opacity : false, - modal : false, - cyclic : false, - scrolling : 'auto', // 'auto', 'yes' or 'no' - - width : 560, - height : 340, - - autoScale : true, - autoDimensions : true, - centerOnScroll : false, - - ajax : {}, - swf : { wmode: 'transparent' }, - - hideOnOverlayClick : true, - hideOnContentClick : false, - - overlayShow : true, - overlayOpacity : 0.7, - overlayColor : '#777', - - titleShow : true, - titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' - titleFormat : null, - titleFromAlt : false, - - transitionIn : 'fade', // 'elastic', 'fade' or 'none' - transitionOut : 'fade', // 'elastic', 'fade' or 'none' - - speedIn : 300, - speedOut : 300, - - changeSpeed : 300, - changeFade : 'fast', - - easingIn : 'swing', - easingOut : 'swing', - - showCloseButton : true, - showNavArrows : true, - enableEscapeButton : true, - enableKeyboardNav : true, - - onStart : function(){}, - onCancel : function(){}, - onComplete : function(){}, - onCleanup : function(){}, - onClosed : function(){}, - onError : function(){} - }; - - $(document).ready(function() { - $.fancybox.init(); - }); - +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +;(function($) { + var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, + + selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], + + ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, + + loadingTimer, loadingFrame = 1, + + titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('
')[0], { prop: 0 }), + + isIE6 = navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6/) && !window.XMLHttpRequest, + + /* + * Private methods + */ + + _abort = function() { + loading.hide(); + + imgPreloader.onerror = imgPreloader.onload = null; + + if (ajaxLoader) { + ajaxLoader.abort(); + } + + tmp.empty(); + }, + + _error = function() { + if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { + loading.hide(); + busy = false; + return; + } + + selectedOpts.titleShow = false; + + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + + tmp.html( '

The requested content cannot be loaded.
Please try again later.

' ); + + _process_inline(); + }, + + _start = function() { + var obj = selectedArray[ selectedIndex ], + href, + type, + title, + str, + emb, + ret; + + _abort(); + + selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); + + ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); + + if (ret === false) { + busy = false; + return; + } else if (typeof ret == 'object') { + selectedOpts = $.extend(selectedOpts, ret); + } + + title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; + + if (obj.nodeName && !selectedOpts.orig) { + selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); + } + + if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { + title = selectedOpts.orig.attr('alt'); + } + + href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; + + if ((/^(?:javascript)/i).test(href) || href == '#') { + href = null; + } + + if (selectedOpts.type) { + type = selectedOpts.type; + + if (!href) { + href = selectedOpts.content; + } + + } else if (selectedOpts.content) { + type = 'html'; + + } else if (href) { + if (href.match(imgRegExp)) { + type = 'image'; + + } else if (href.match(swfRegExp)) { + type = 'swf'; + + } else if ($(obj).hasClass("iframe")) { + type = 'iframe'; + + } else if (href.indexOf("#") === 0) { + type = 'inline'; + + } else { + type = 'ajax'; + } + } + + if (!type) { + _error(); + return; + } + + if (type == 'inline') { + obj = href.substr(href.indexOf("#")); + type = $(obj).length > 0 ? 'inline' : 'ajax'; + } + + selectedOpts.type = type; + selectedOpts.href = href; + selectedOpts.title = title; + + if (selectedOpts.autoDimensions) { + if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + } else { + selectedOpts.autoDimensions = false; + } + } + + if (selectedOpts.modal) { + selectedOpts.overlayShow = true; + selectedOpts.hideOnOverlayClick = false; + selectedOpts.hideOnContentClick = false; + selectedOpts.enableEscapeButton = false; + selectedOpts.showCloseButton = false; + } + + selectedOpts.padding = parseInt(selectedOpts.padding, 10); + selectedOpts.margin = parseInt(selectedOpts.margin, 10); + + tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); + + $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { + $(this).replaceWith(content.children()); + }); + + switch (type) { + case 'html' : + tmp.html( selectedOpts.content ); + _process_inline(); + break; + + case 'inline' : + if ( $(obj).parent().is('#fancybox-content') === true) { + busy = false; + return; + } + + $('
') + .hide() + .insertBefore( $(obj) ) + .bind('fancybox-cleanup', function() { + $(this).replaceWith(content.children()); + }).bind('fancybox-cancel', function() { + $(this).replaceWith(tmp.children()); + }); + + $(obj).appendTo(tmp); + + _process_inline(); + break; + + case 'image': + busy = false; + + $.fancybox.showActivity(); + + imgPreloader = new Image(); + + imgPreloader.onerror = function() { + _error(); + }; + + imgPreloader.onload = function() { + busy = true; + + imgPreloader.onerror = imgPreloader.onload = null; + + _process_image(); + }; + + imgPreloader.src = href; + break; + + case 'swf': + selectedOpts.scrolling = 'no'; + + str = ''; + emb = ''; + + $.each(selectedOpts.swf, function(name, val) { + str += ''; + emb += ' ' + name + '="' + val + '"'; + }); + + str += ''; + + tmp.html(str); + + _process_inline(); + break; + + case 'ajax': + busy = false; + + $.fancybox.showActivity(); + + selectedOpts.ajax.win = selectedOpts.ajax.success; + + ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { + url : href, + data : selectedOpts.ajax.data || {}, + error : function(XMLHttpRequest, textStatus, errorThrown) { + if ( XMLHttpRequest.status > 0 ) { + _error(); + } + }, + success : function(data, textStatus, XMLHttpRequest) { + var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; + if (o.status == 200) { + if ( typeof selectedOpts.ajax.win == 'function' ) { + ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); + + if (ret === false) { + loading.hide(); + return; + } else if (typeof ret == 'string' || typeof ret == 'object') { + data = ret; + } + } + + tmp.html( data ); + _process_inline(); + } + } + })); + + break; + + case 'iframe': + _show(); + break; + } + }, + + _process_inline = function() { + var + w = selectedOpts.width, + h = selectedOpts.height; + + if (w.toString().indexOf('%') > -1) { + w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; + + } else { + w = w == 'auto' ? 'auto' : w + 'px'; + } + + if (h.toString().indexOf('%') > -1) { + h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; + + } else { + h = h == 'auto' ? 'auto' : h + 'px'; + } + + tmp.wrapInner('
'); + + selectedOpts.width = tmp.width(); + selectedOpts.height = tmp.height(); + + _show(); + }, + + _process_image = function() { + selectedOpts.width = imgPreloader.width; + selectedOpts.height = imgPreloader.height; + + $("").attr({ + 'id' : 'fancybox-img', + 'src' : imgPreloader.src, + 'alt' : selectedOpts.title + }).appendTo( tmp ); + + _show(); + }, + + _show = function() { + var pos, equal; + + loading.hide(); + + if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + $.event.trigger('fancybox-cancel'); + + busy = false; + return; + } + + busy = true; + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { + wrap.css('height', wrap.height()); + } + + currentArray = selectedArray; + currentIndex = selectedIndex; + currentOpts = selectedOpts; + + if (currentOpts.overlayShow) { + overlay.css({ + 'background-color' : currentOpts.overlayColor, + 'opacity' : currentOpts.overlayOpacity, + 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', + 'height' : $(document).height() + }); + + if (!overlay.is(':visible')) { + if (isIE6) { + $('select:not(#fancybox-tmp select)').filter(function() { + return this.style.visibility !== 'hidden'; + }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { + this.style.visibility = 'inherit'; + }); + } + + overlay.show(); + } + } else { + overlay.hide(); + } + + final_pos = _get_zoom_to(); + + _process_title(); + + if (wrap.is(":visible")) { + $( close.add( nav_left ).add( nav_right ) ).hide(); + + pos = wrap.position(), + + start_pos = { + top : pos.top, + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); + + content.fadeTo(currentOpts.changeFade, 0.3, function() { + var finish_resizing = function() { + content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); + }; + + $.event.trigger('fancybox-change'); + + content + .empty() + .removeAttr('filter') + .css({ + 'border-width' : currentOpts.padding, + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }); + + if (equal) { + finish_resizing(); + + } else { + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.changeSpeed, + easing : currentOpts.easingChange, + step : _draw, + complete : finish_resizing + }); + } + }); + + return; + } + + wrap.removeAttr("style"); + + content.css('border-width', currentOpts.padding); + + if (currentOpts.transitionIn == 'elastic') { + start_pos = _get_zoom_from(); + + content.html( tmp.contents() ); + + wrap.show(); + + if (currentOpts.opacity) { + final_pos.opacity = 0; + } + + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.speedIn, + easing : currentOpts.easingIn, + step : _draw, + complete : _finish + }); + + return; + } + + if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { + title.show(); + } + + content + .css({ + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }) + .html( tmp.contents() ); + + wrap + .css(final_pos) + .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); + }, + + _format_title = function(title) { + if (title && title.length) { + if (currentOpts.titlePosition == 'float') { + return '
' + title + '
'; + } + + return '
' + title + '
'; + } + + return false; + }, + + _process_title = function() { + titleStr = currentOpts.title || ''; + titleHeight = 0; + + title + .empty() + .removeAttr('style') + .removeClass(); + + if (currentOpts.titleShow === false) { + title.hide(); + return; + } + + titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); + + if (!titleStr || titleStr === '') { + title.hide(); + return; + } + + title + .addClass('fancybox-title-' + currentOpts.titlePosition) + .html( titleStr ) + .appendTo( 'body' ) + .show(); + + switch (currentOpts.titlePosition) { + case 'inside': + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'marginLeft' : currentOpts.padding, + 'marginRight' : currentOpts.padding + }); + + titleHeight = title.outerHeight(true); + + title.appendTo( outer ); + + final_pos.height += titleHeight; + break; + + case 'over': + title + .css({ + 'marginLeft' : currentOpts.padding, + 'width' : final_pos.width - (currentOpts.padding * 2), + 'bottom' : currentOpts.padding + }) + .appendTo( outer ); + break; + + case 'float': + title + .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) + .appendTo( wrap ); + break; + + default: + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'paddingLeft' : currentOpts.padding, + 'paddingRight' : currentOpts.padding + }) + .appendTo( wrap ); + break; + } + + title.hide(); + }, + + _set_navigation = function() { + if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { + $(document).bind('keydown.fb', function(e) { + if (e.keyCode == 27 && currentOpts.enableEscapeButton) { + e.preventDefault(); + $.fancybox.close(); + + } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { + e.preventDefault(); + $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); + } + }); + } + + if (!currentOpts.showNavArrows) { + nav_left.hide(); + nav_right.hide(); + return; + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { + nav_left.show(); + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { + nav_right.show(); + } + }, + + _finish = function () { + if (!$.support.opacity) { + content.get(0).style.removeAttribute('filter'); + wrap.get(0).style.removeAttribute('filter'); + } + + if (selectedOpts.autoDimensions) { + content.css('height', 'auto'); + } + + wrap.css('height', 'auto'); + + if (titleStr && titleStr.length) { + title.show(); + } + + if (currentOpts.showCloseButton) { + close.show(); + } + + _set_navigation(); + + if (currentOpts.hideOnContentClick) { + content.bind('click', $.fancybox.close); + } + + if (currentOpts.hideOnOverlayClick) { + overlay.bind('click', $.fancybox.close); + } + + $(window).bind("resize.fb", $.fancybox.resize); + + if (currentOpts.centerOnScroll) { + $(window).bind("scroll.fb", $.fancybox.center); + } + + if (currentOpts.type == 'iframe') { + $('').appendTo(content); + } + + wrap.show(); + + busy = false; + + $.fancybox.center(); + + currentOpts.onComplete(currentArray, currentIndex, currentOpts); + + _preload_images(); + }, + + _preload_images = function() { + var href, + objNext; + + if ((currentArray.length -1) > currentIndex) { + href = currentArray[ currentIndex + 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + + if (currentIndex > 0) { + href = currentArray[ currentIndex - 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + }, + + _draw = function(pos) { + var dim = { + width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), + height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), + + top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), + left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) + }; + + if (typeof final_pos.opacity !== 'undefined') { + dim.opacity = pos < 0.5 ? 0.5 : pos; + } + + wrap.css(dim); + + content.css({ + 'width' : dim.width - currentOpts.padding * 2, + 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 + }); + }, + + _get_viewport = function() { + return [ + $(window).width() - (currentOpts.margin * 2), + $(window).height() - (currentOpts.margin * 2), + $(document).scrollLeft() + currentOpts.margin, + $(document).scrollTop() + currentOpts.margin + ]; + }, + + _get_zoom_to = function () { + var view = _get_viewport(), + to = {}, + resize = currentOpts.autoScale, + double_padding = currentOpts.padding * 2, + ratio; + + if (currentOpts.width.toString().indexOf('%') > -1) { + to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); + } else { + to.width = currentOpts.width + double_padding; + } + + if (currentOpts.height.toString().indexOf('%') > -1) { + to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); + } else { + to.height = currentOpts.height + double_padding; + } + + if (resize && (to.width > view[0] || to.height > view[1])) { + if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { + ratio = (currentOpts.width ) / (currentOpts.height ); + + if ((to.width ) > view[0]) { + to.width = view[0]; + to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); + } + + if ((to.height) > view[1]) { + to.height = view[1]; + to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); + } + + } else { + to.width = Math.min(to.width, view[0]); + to.height = Math.min(to.height, view[1]); + } + } + + to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); + to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); + + return to; + }, + + _get_obj_pos = function(obj) { + var pos = obj.offset(); + + pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; + pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; + + pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; + pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; + + pos.width = obj.width(); + pos.height = obj.height(); + + return pos; + }, + + _get_zoom_from = function() { + var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, + from = {}, + pos, + view; + + if (orig && orig.length) { + pos = _get_obj_pos(orig); + + from = { + width : pos.width + (currentOpts.padding * 2), + height : pos.height + (currentOpts.padding * 2), + top : pos.top - currentOpts.padding - 20, + left : pos.left - currentOpts.padding - 20 + }; + + } else { + view = _get_viewport(); + + from = { + width : currentOpts.padding * 2, + height : currentOpts.padding * 2, + top : parseInt(view[3] + view[1] * 0.5, 10), + left : parseInt(view[2] + view[0] * 0.5, 10) + }; + } + + return from; + }, + + _animate_loading = function() { + if (!loading.is(':visible')){ + clearInterval(loadingTimer); + return; + } + + $('div', loading).css('top', (loadingFrame * -40) + 'px'); + + loadingFrame = (loadingFrame + 1) % 12; + }; + + /* + * Public methods + */ + + $.fn.fancybox = function(options) { + if (!$(this).length) { + return this; + } + + $(this) + .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) + .unbind('click.fb') + .bind('click.fb', function(e) { + e.preventDefault(); + + if (busy) { + return; + } + + busy = true; + + $(this).blur(); + + selectedArray = []; + selectedIndex = 0; + + var rel = $(this).attr('rel') || ''; + + if (!rel || rel == '' || rel === 'nofollow') { + selectedArray.push(this); + + } else { + selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); + selectedIndex = selectedArray.index( this ); + } + + _start(); + + return; + }); + + return this; + }; + + $.fancybox = function(obj) { + var opts; + + if (busy) { + return; + } + + busy = true; + opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; + + selectedArray = []; + selectedIndex = parseInt(opts.index, 10) || 0; + + if ($.isArray(obj)) { + for (var i = 0, j = obj.length; i < j; i++) { + if (typeof obj[i] == 'object') { + $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); + } else { + obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); + } + } + + selectedArray = jQuery.merge(selectedArray, obj); + + } else { + if (typeof obj == 'object') { + $(obj).data('fancybox', $.extend({}, opts, obj)); + } else { + obj = $({}).data('fancybox', $.extend({content : obj}, opts)); + } + + selectedArray.push(obj); + } + + if (selectedIndex > selectedArray.length || selectedIndex < 0) { + selectedIndex = 0; + } + + _start(); + }; + + $.fancybox.showActivity = function() { + clearInterval(loadingTimer); + + loading.show(); + loadingTimer = setInterval(_animate_loading, 66); + }; + + $.fancybox.hideActivity = function() { + loading.hide(); + }; + + $.fancybox.next = function() { + return $.fancybox.pos( currentIndex + 1); + }; + + $.fancybox.prev = function() { + return $.fancybox.pos( currentIndex - 1); + }; + + $.fancybox.pos = function(pos) { + if (busy) { + return; + } + + pos = parseInt(pos); + + selectedArray = currentArray; + + if (pos > -1 && pos < currentArray.length) { + selectedIndex = pos; + _start(); + + } else if (currentOpts.cyclic && currentArray.length > 1) { + selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; + _start(); + } + + return; + }; + + $.fancybox.cancel = function() { + if (busy) { + return; + } + + busy = true; + + $.event.trigger('fancybox-cancel'); + + _abort(); + + selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); + + busy = false; + }; + + // Note: within an iframe use - parent.$.fancybox.close(); + $.fancybox.close = function() { + if (busy || wrap.is(':hidden')) { + return; + } + + busy = true; + + if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + busy = false; + return; + } + + _abort(); + + $(close.add( nav_left ).add( nav_right )).hide(); + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); + + if (currentOpts.titlePosition !== 'inside') { + title.empty(); + } + + wrap.stop(); + + function _cleanup() { + overlay.fadeOut('fast'); + + title.empty().hide(); + wrap.hide(); + + $.event.trigger('fancybox-cleanup'); + + content.empty(); + + currentOpts.onClosed(currentArray, currentIndex, currentOpts); + + currentArray = selectedOpts = []; + currentIndex = selectedIndex = 0; + currentOpts = selectedOpts = {}; + + busy = false; + } + + if (currentOpts.transitionOut == 'elastic') { + start_pos = _get_zoom_from(); + + var pos = wrap.position(); + + final_pos = { + top : pos.top , + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + if (currentOpts.opacity) { + final_pos.opacity = 1; + } + + title.empty().hide(); + + fx.prop = 1; + + $(fx).animate({ prop: 0 }, { + duration : currentOpts.speedOut, + easing : currentOpts.easingOut, + step : _draw, + complete : _cleanup + }); + + } else { + wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); + } + }; + + $.fancybox.resize = function() { + if (overlay.is(':visible')) { + overlay.css('height', $(document).height()); + } + + $.fancybox.center(true); + }; + + $.fancybox.center = function() { + var view, align; + + if (busy) { + return; + } + + align = arguments[0] === true ? 1 : 0; + view = _get_viewport(); + + if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { + return; + } + + wrap + .stop() + .animate({ + 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), + 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) + }, typeof arguments[0] == 'number' ? arguments[0] : 200); + }; + + $.fancybox.init = function() { + if ($("#fancybox-wrap").length) { + return; + } + + $('body').append( + tmp = $('
'), + loading = $('
'), + overlay = $('
'), + wrap = $('
') + ); + + outer = $('
') + .append('
') + .appendTo( wrap ); + + outer.append( + content = $('
'), + close = $(''), + title = $('
'), + + nav_left = $(''), + nav_right = $('') + ); + + close.click($.fancybox.close); + loading.click($.fancybox.cancel); + + nav_left.click(function(e) { + e.preventDefault(); + $.fancybox.prev(); + }); + + nav_right.click(function(e) { + e.preventDefault(); + $.fancybox.next(); + }); + + if ($.fn.mousewheel) { + wrap.bind('mousewheel.fb', function(e, delta) { + if (busy) { + e.preventDefault(); + + } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { + e.preventDefault(); + $.fancybox[ delta > 0 ? 'prev' : 'next'](); + } + }); + } + + if (!$.support.opacity) { + wrap.addClass('fancybox-ie'); + } + + if (isIE6) { + loading.addClass('fancybox-ie6'); + wrap.addClass('fancybox-ie6'); + + $('').prependTo(outer); + } + }; + + $.fn.fancybox.defaults = { + padding : 10, + margin : 40, + opacity : false, + modal : false, + cyclic : false, + scrolling : 'auto', // 'auto', 'yes' or 'no' + + width : 560, + height : 340, + + autoScale : true, + autoDimensions : true, + centerOnScroll : false, + + ajax : {}, + swf : { wmode: 'transparent' }, + + hideOnOverlayClick : true, + hideOnContentClick : false, + + overlayShow : true, + overlayOpacity : 0.7, + overlayColor : '#777', + + titleShow : true, + titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' + titleFormat : null, + titleFromAlt : false, + + transitionIn : 'fade', // 'elastic', 'fade' or 'none' + transitionOut : 'fade', // 'elastic', 'fade' or 'none' + + speedIn : 300, + speedOut : 300, + + changeSpeed : 300, + changeFade : 'fast', + + easingIn : 'swing', + easingOut : 'swing', + + showCloseButton : true, + showNavArrows : true, + enableEscapeButton : true, + enableKeyboardNav : true, + + onStart : function(){}, + onCancel : function(){}, + onComplete : function(){}, + onCleanup : function(){}, + onClosed : function(){}, + onError : function(){} + }; + + $(document).ready(function() { + $.fancybox.init(); + }); + })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.js b/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.js index be77275..d59ca32 100755 --- a/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.js +++ b/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.js @@ -1,1156 +1,1156 @@ -/* - * FancyBox - jQuery Plugin - * Simple and fancy lightbox alternative - * - * Examples and documentation at: http://fancybox.net - * - * Copyright (c) 2008 - 2010 Janis Skarnelis - * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. - * - * Version: 1.3.4 (11/11/2010) - * Requires: jQuery v1.3+ - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ - -;(function($) { - var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, - - selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], - - ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, - - loadingTimer, loadingFrame = 1, - - titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('
')[0], { prop: 0 }), - - isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest, - - /* - * Private methods - */ - - _abort = function() { - loading.hide(); - - imgPreloader.onerror = imgPreloader.onload = null; - - if (ajaxLoader) { - ajaxLoader.abort(); - } - - tmp.empty(); - }, - - _error = function() { - if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { - loading.hide(); - busy = false; - return; - } - - selectedOpts.titleShow = false; - - selectedOpts.width = 'auto'; - selectedOpts.height = 'auto'; - - tmp.html( '

The requested content cannot be loaded.
Please try again later.

' ); - - _process_inline(); - }, - - _start = function() { - var obj = selectedArray[ selectedIndex ], - href, - type, - title, - str, - emb, - ret; - - _abort(); - - selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); - - ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); - - if (ret === false) { - busy = false; - return; - } else if (typeof ret == 'object') { - selectedOpts = $.extend(selectedOpts, ret); - } - - title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; - - if (obj.nodeName && !selectedOpts.orig) { - selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); - } - - if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { - title = selectedOpts.orig.attr('alt'); - } - - href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; - - if ((/^(?:javascript)/i).test(href) || href == '#') { - href = null; - } - - if (selectedOpts.type) { - type = selectedOpts.type; - - if (!href) { - href = selectedOpts.content; - } - - } else if (selectedOpts.content) { - type = 'html'; - - } else if (href) { - if (href.match(imgRegExp)) { - type = 'image'; - - } else if (href.match(swfRegExp)) { - type = 'swf'; - - } else if ($(obj).hasClass("iframe")) { - type = 'iframe'; - - } else if (href.indexOf("#") === 0) { - type = 'inline'; - - } else { - type = 'ajax'; - } - } - - if (!type) { - _error(); - return; - } - - if (type == 'inline') { - obj = href.substr(href.indexOf("#")); - type = $(obj).length > 0 ? 'inline' : 'ajax'; - } - - selectedOpts.type = type; - selectedOpts.href = href; - selectedOpts.title = title; - - if (selectedOpts.autoDimensions) { - if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { - selectedOpts.width = 'auto'; - selectedOpts.height = 'auto'; - } else { - selectedOpts.autoDimensions = false; - } - } - - if (selectedOpts.modal) { - selectedOpts.overlayShow = true; - selectedOpts.hideOnOverlayClick = false; - selectedOpts.hideOnContentClick = false; - selectedOpts.enableEscapeButton = false; - selectedOpts.showCloseButton = false; - } - - selectedOpts.padding = parseInt(selectedOpts.padding, 10); - selectedOpts.margin = parseInt(selectedOpts.margin, 10); - - tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); - - $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { - $(this).replaceWith(content.children()); - }); - - switch (type) { - case 'html' : - tmp.html( selectedOpts.content ); - _process_inline(); - break; - - case 'inline' : - if ( $(obj).parent().is('#fancybox-content') === true) { - busy = false; - return; - } - - $('
') - .hide() - .insertBefore( $(obj) ) - .bind('fancybox-cleanup', function() { - $(this).replaceWith(content.children()); - }).bind('fancybox-cancel', function() { - $(this).replaceWith(tmp.children()); - }); - - $(obj).appendTo(tmp); - - _process_inline(); - break; - - case 'image': - busy = false; - - $.fancybox.showActivity(); - - imgPreloader = new Image(); - - imgPreloader.onerror = function() { - _error(); - }; - - imgPreloader.onload = function() { - busy = true; - - imgPreloader.onerror = imgPreloader.onload = null; - - _process_image(); - }; - - imgPreloader.src = href; - break; - - case 'swf': - selectedOpts.scrolling = 'no'; - - str = ''; - emb = ''; - - $.each(selectedOpts.swf, function(name, val) { - str += ''; - emb += ' ' + name + '="' + val + '"'; - }); - - str += ''; - - tmp.html(str); - - _process_inline(); - break; - - case 'ajax': - busy = false; - - $.fancybox.showActivity(); - - selectedOpts.ajax.win = selectedOpts.ajax.success; - - ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { - url : href, - data : selectedOpts.ajax.data || {}, - error : function(XMLHttpRequest, textStatus, errorThrown) { - if ( XMLHttpRequest.status > 0 ) { - _error(); - } - }, - success : function(data, textStatus, XMLHttpRequest) { - var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; - if (o.status == 200) { - if ( typeof selectedOpts.ajax.win == 'function' ) { - ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); - - if (ret === false) { - loading.hide(); - return; - } else if (typeof ret == 'string' || typeof ret == 'object') { - data = ret; - } - } - - tmp.html( data ); - _process_inline(); - } - } - })); - - break; - - case 'iframe': - _show(); - break; - } - }, - - _process_inline = function() { - var - w = selectedOpts.width, - h = selectedOpts.height; - - if (w.toString().indexOf('%') > -1) { - w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; - - } else { - w = w == 'auto' ? 'auto' : w + 'px'; - } - - if (h.toString().indexOf('%') > -1) { - h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; - - } else { - h = h == 'auto' ? 'auto' : h + 'px'; - } - - tmp.wrapInner('
'); - - selectedOpts.width = tmp.width(); - selectedOpts.height = tmp.height(); - - _show(); - }, - - _process_image = function() { - selectedOpts.width = imgPreloader.width; - selectedOpts.height = imgPreloader.height; - - $("").attr({ - 'id' : 'fancybox-img', - 'src' : imgPreloader.src, - 'alt' : selectedOpts.title - }).appendTo( tmp ); - - _show(); - }, - - _show = function() { - var pos, equal; - - loading.hide(); - - if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { - $.event.trigger('fancybox-cancel'); - - busy = false; - return; - } - - busy = true; - - $(content.add( overlay )).unbind(); - - $(window).unbind("resize.fb scroll.fb"); - $(document).unbind('keydown.fb'); - - if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { - wrap.css('height', wrap.height()); - } - - currentArray = selectedArray; - currentIndex = selectedIndex; - currentOpts = selectedOpts; - - if (currentOpts.overlayShow) { - overlay.css({ - 'background-color' : currentOpts.overlayColor, - 'opacity' : currentOpts.overlayOpacity, - 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', - 'height' : $(document).height() - }); - - if (!overlay.is(':visible')) { - if (isIE6) { - $('select:not(#fancybox-tmp select)').filter(function() { - return this.style.visibility !== 'hidden'; - }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { - this.style.visibility = 'inherit'; - }); - } - - overlay.show(); - } - } else { - overlay.hide(); - } - - final_pos = _get_zoom_to(); - - _process_title(); - - if (wrap.is(":visible")) { - $( close.add( nav_left ).add( nav_right ) ).hide(); - - pos = wrap.position(), - - start_pos = { - top : pos.top, - left : pos.left, - width : wrap.width(), - height : wrap.height() - }; - - equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); - - content.fadeTo(currentOpts.changeFade, 0.3, function() { - var finish_resizing = function() { - content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); - }; - - $.event.trigger('fancybox-change'); - - content - .empty() - .removeAttr('filter') - .css({ - 'border-width' : currentOpts.padding, - 'width' : final_pos.width - currentOpts.padding * 2, - 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 - }); - - if (equal) { - finish_resizing(); - - } else { - fx.prop = 0; - - $(fx).animate({prop: 1}, { - duration : currentOpts.changeSpeed, - easing : currentOpts.easingChange, - step : _draw, - complete : finish_resizing - }); - } - }); - - return; - } - - wrap.removeAttr("style"); - - content.css('border-width', currentOpts.padding); - - if (currentOpts.transitionIn == 'elastic') { - start_pos = _get_zoom_from(); - - content.html( tmp.contents() ); - - wrap.show(); - - if (currentOpts.opacity) { - final_pos.opacity = 0; - } - - fx.prop = 0; - - $(fx).animate({prop: 1}, { - duration : currentOpts.speedIn, - easing : currentOpts.easingIn, - step : _draw, - complete : _finish - }); - - return; - } - - if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { - title.show(); - } - - content - .css({ - 'width' : final_pos.width - currentOpts.padding * 2, - 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 - }) - .html( tmp.contents() ); - - wrap - .css(final_pos) - .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); - }, - - _format_title = function(title) { - if (title && title.length) { - if (currentOpts.titlePosition == 'float') { - return '
' + title + '
'; - } - - return '
' + title + '
'; - } - - return false; - }, - - _process_title = function() { - titleStr = currentOpts.title || ''; - titleHeight = 0; - - title - .empty() - .removeAttr('style') - .removeClass(); - - if (currentOpts.titleShow === false) { - title.hide(); - return; - } - - titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); - - if (!titleStr || titleStr === '') { - title.hide(); - return; - } - - title - .addClass('fancybox-title-' + currentOpts.titlePosition) - .html( titleStr ) - .appendTo( 'body' ) - .show(); - - switch (currentOpts.titlePosition) { - case 'inside': - title - .css({ - 'width' : final_pos.width - (currentOpts.padding * 2), - 'marginLeft' : currentOpts.padding, - 'marginRight' : currentOpts.padding - }); - - titleHeight = title.outerHeight(true); - - title.appendTo( outer ); - - final_pos.height += titleHeight; - break; - - case 'over': - title - .css({ - 'marginLeft' : currentOpts.padding, - 'width' : final_pos.width - (currentOpts.padding * 2), - 'bottom' : currentOpts.padding - }) - .appendTo( outer ); - break; - - case 'float': - title - .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) - .appendTo( wrap ); - break; - - default: - title - .css({ - 'width' : final_pos.width - (currentOpts.padding * 2), - 'paddingLeft' : currentOpts.padding, - 'paddingRight' : currentOpts.padding - }) - .appendTo( wrap ); - break; - } - - title.hide(); - }, - - _set_navigation = function() { - if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { - $(document).bind('keydown.fb', function(e) { - if (e.keyCode == 27 && currentOpts.enableEscapeButton) { - e.preventDefault(); - $.fancybox.close(); - - } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { - e.preventDefault(); - $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); - } - }); - } - - if (!currentOpts.showNavArrows) { - nav_left.hide(); - nav_right.hide(); - return; - } - - if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { - nav_left.show(); - } - - if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { - nav_right.show(); - } - }, - - _finish = function () { - if (!$.support.opacity) { - content.get(0).style.removeAttribute('filter'); - wrap.get(0).style.removeAttribute('filter'); - } - - if (selectedOpts.autoDimensions) { - content.css('height', 'auto'); - } - - wrap.css('height', 'auto'); - - if (titleStr && titleStr.length) { - title.show(); - } - - if (currentOpts.showCloseButton) { - close.show(); - } - - _set_navigation(); - - if (currentOpts.hideOnContentClick) { - content.bind('click', $.fancybox.close); - } - - if (currentOpts.hideOnOverlayClick) { - overlay.bind('click', $.fancybox.close); - } - - $(window).bind("resize.fb", $.fancybox.resize); - - if (currentOpts.centerOnScroll) { - $(window).bind("scroll.fb", $.fancybox.center); - } - - if (currentOpts.type == 'iframe') { - $('').appendTo(content); - } - - wrap.show(); - - busy = false; - - $.fancybox.center(); - - currentOpts.onComplete(currentArray, currentIndex, currentOpts); - - _preload_images(); - }, - - _preload_images = function() { - var href, - objNext; - - if ((currentArray.length -1) > currentIndex) { - href = currentArray[ currentIndex + 1 ].href; - - if (typeof href !== 'undefined' && href.match(imgRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - - if (currentIndex > 0) { - href = currentArray[ currentIndex - 1 ].href; - - if (typeof href !== 'undefined' && href.match(imgRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - }, - - _draw = function(pos) { - var dim = { - width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), - height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), - - top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), - left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) - }; - - if (typeof final_pos.opacity !== 'undefined') { - dim.opacity = pos < 0.5 ? 0.5 : pos; - } - - wrap.css(dim); - - content.css({ - 'width' : dim.width - currentOpts.padding * 2, - 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 - }); - }, - - _get_viewport = function() { - return [ - $(window).width() - (currentOpts.margin * 2), - $(window).height() - (currentOpts.margin * 2), - $(document).scrollLeft() + currentOpts.margin, - $(document).scrollTop() + currentOpts.margin - ]; - }, - - _get_zoom_to = function () { - var view = _get_viewport(), - to = {}, - resize = currentOpts.autoScale, - double_padding = currentOpts.padding * 2, - ratio; - - if (currentOpts.width.toString().indexOf('%') > -1) { - to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); - } else { - to.width = currentOpts.width + double_padding; - } - - if (currentOpts.height.toString().indexOf('%') > -1) { - to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); - } else { - to.height = currentOpts.height + double_padding; - } - - if (resize && (to.width > view[0] || to.height > view[1])) { - if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { - ratio = (currentOpts.width ) / (currentOpts.height ); - - if ((to.width ) > view[0]) { - to.width = view[0]; - to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); - } - - if ((to.height) > view[1]) { - to.height = view[1]; - to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); - } - - } else { - to.width = Math.min(to.width, view[0]); - to.height = Math.min(to.height, view[1]); - } - } - - to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); - to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); - - return to; - }, - - _get_obj_pos = function(obj) { - var pos = obj.offset(); - - pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; - pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; - - pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; - pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; - - pos.width = obj.width(); - pos.height = obj.height(); - - return pos; - }, - - _get_zoom_from = function() { - var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, - from = {}, - pos, - view; - - if (orig && orig.length) { - pos = _get_obj_pos(orig); - - from = { - width : pos.width + (currentOpts.padding * 2), - height : pos.height + (currentOpts.padding * 2), - top : pos.top - currentOpts.padding - 20, - left : pos.left - currentOpts.padding - 20 - }; - - } else { - view = _get_viewport(); - - from = { - width : currentOpts.padding * 2, - height : currentOpts.padding * 2, - top : parseInt(view[3] + view[1] * 0.5, 10), - left : parseInt(view[2] + view[0] * 0.5, 10) - }; - } - - return from; - }, - - _animate_loading = function() { - if (!loading.is(':visible')){ - clearInterval(loadingTimer); - return; - } - - $('div', loading).css('top', (loadingFrame * -40) + 'px'); - - loadingFrame = (loadingFrame + 1) % 12; - }; - - /* - * Public methods - */ - - $.fn.fancybox = function(options) { - if (!$(this).length) { - return this; - } - - $(this) - .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) - .unbind('click.fb') - .bind('click.fb', function(e) { - e.preventDefault(); - - if (busy) { - return; - } - - busy = true; - - $(this).blur(); - - selectedArray = []; - selectedIndex = 0; - - var rel = $(this).attr('rel') || ''; - - if (!rel || rel == '' || rel === 'nofollow') { - selectedArray.push(this); - - } else { - selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); - selectedIndex = selectedArray.index( this ); - } - - _start(); - - return; - }); - - return this; - }; - - $.fancybox = function(obj) { - var opts; - - if (busy) { - return; - } - - busy = true; - opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; - - selectedArray = []; - selectedIndex = parseInt(opts.index, 10) || 0; - - if ($.isArray(obj)) { - for (var i = 0, j = obj.length; i < j; i++) { - if (typeof obj[i] == 'object') { - $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); - } else { - obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); - } - } - - selectedArray = jQuery.merge(selectedArray, obj); - - } else { - if (typeof obj == 'object') { - $(obj).data('fancybox', $.extend({}, opts, obj)); - } else { - obj = $({}).data('fancybox', $.extend({content : obj}, opts)); - } - - selectedArray.push(obj); - } - - if (selectedIndex > selectedArray.length || selectedIndex < 0) { - selectedIndex = 0; - } - - _start(); - }; - - $.fancybox.showActivity = function() { - clearInterval(loadingTimer); - - loading.show(); - loadingTimer = setInterval(_animate_loading, 66); - }; - - $.fancybox.hideActivity = function() { - loading.hide(); - }; - - $.fancybox.next = function() { - return $.fancybox.pos( currentIndex + 1); - }; - - $.fancybox.prev = function() { - return $.fancybox.pos( currentIndex - 1); - }; - - $.fancybox.pos = function(pos) { - if (busy) { - return; - } - - pos = parseInt(pos); - - selectedArray = currentArray; - - if (pos > -1 && pos < currentArray.length) { - selectedIndex = pos; - _start(); - - } else if (currentOpts.cyclic && currentArray.length > 1) { - selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; - _start(); - } - - return; - }; - - $.fancybox.cancel = function() { - if (busy) { - return; - } - - busy = true; - - $.event.trigger('fancybox-cancel'); - - _abort(); - - selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); - - busy = false; - }; - - // Note: within an iframe use - parent.$.fancybox.close(); - $.fancybox.close = function() { - if (busy || wrap.is(':hidden')) { - return; - } - - busy = true; - - if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { - busy = false; - return; - } - - _abort(); - - $(close.add( nav_left ).add( nav_right )).hide(); - - $(content.add( overlay )).unbind(); - - $(window).unbind("resize.fb scroll.fb"); - $(document).unbind('keydown.fb'); - - content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); - - if (currentOpts.titlePosition !== 'inside') { - title.empty(); - } - - wrap.stop(); - - function _cleanup() { - overlay.fadeOut('fast'); - - title.empty().hide(); - wrap.hide(); - - $.event.trigger('fancybox-cleanup'); - - content.empty(); - - currentOpts.onClosed(currentArray, currentIndex, currentOpts); - - currentArray = selectedOpts = []; - currentIndex = selectedIndex = 0; - currentOpts = selectedOpts = {}; - - busy = false; - } - - if (currentOpts.transitionOut == 'elastic') { - start_pos = _get_zoom_from(); - - var pos = wrap.position(); - - final_pos = { - top : pos.top , - left : pos.left, - width : wrap.width(), - height : wrap.height() - }; - - if (currentOpts.opacity) { - final_pos.opacity = 1; - } - - title.empty().hide(); - - fx.prop = 1; - - $(fx).animate({ prop: 0 }, { - duration : currentOpts.speedOut, - easing : currentOpts.easingOut, - step : _draw, - complete : _cleanup - }); - - } else { - wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); - } - }; - - $.fancybox.resize = function() { - if (overlay.is(':visible')) { - overlay.css('height', $(document).height()); - } - - $.fancybox.center(true); - }; - - $.fancybox.center = function() { - var view, align; - - if (busy) { - return; - } - - align = arguments[0] === true ? 1 : 0; - view = _get_viewport(); - - if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { - return; - } - - wrap - .stop() - .animate({ - 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), - 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) - }, typeof arguments[0] == 'number' ? arguments[0] : 200); - }; - - $.fancybox.init = function() { - if ($("#fancybox-wrap").length) { - return; - } - - $('body').append( - tmp = $('
'), - loading = $('
'), - overlay = $('
'), - wrap = $('
') - ); - - outer = $('
') - .append('
') - .appendTo( wrap ); - - outer.append( - content = $('
'), - close = $(''), - title = $('
'), - - nav_left = $(''), - nav_right = $('') - ); - - close.click($.fancybox.close); - loading.click($.fancybox.cancel); - - nav_left.click(function(e) { - e.preventDefault(); - $.fancybox.prev(); - }); - - nav_right.click(function(e) { - e.preventDefault(); - $.fancybox.next(); - }); - - if ($.fn.mousewheel) { - wrap.bind('mousewheel.fb', function(e, delta) { - if (busy) { - e.preventDefault(); - - } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { - e.preventDefault(); - $.fancybox[ delta > 0 ? 'prev' : 'next'](); - } - }); - } - - if (!$.support.opacity) { - wrap.addClass('fancybox-ie'); - } - - if (isIE6) { - loading.addClass('fancybox-ie6'); - wrap.addClass('fancybox-ie6'); - - $('').prependTo(outer); - } - }; - - $.fn.fancybox.defaults = { - padding : 10, - margin : 40, - opacity : false, - modal : false, - cyclic : false, - scrolling : 'auto', // 'auto', 'yes' or 'no' - - width : 560, - height : 340, - - autoScale : true, - autoDimensions : true, - centerOnScroll : false, - - ajax : {}, - swf : { wmode: 'transparent' }, - - hideOnOverlayClick : true, - hideOnContentClick : false, - - overlayShow : true, - overlayOpacity : 0.7, - overlayColor : '#777', - - titleShow : true, - titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' - titleFormat : null, - titleFromAlt : false, - - transitionIn : 'fade', // 'elastic', 'fade' or 'none' - transitionOut : 'fade', // 'elastic', 'fade' or 'none' - - speedIn : 300, - speedOut : 300, - - changeSpeed : 300, - changeFade : 'fast', - - easingIn : 'swing', - easingOut : 'swing', - - showCloseButton : true, - showNavArrows : true, - enableEscapeButton : true, - enableKeyboardNav : true, - - onStart : function(){}, - onCancel : function(){}, - onComplete : function(){}, - onCleanup : function(){}, - onClosed : function(){}, - onError : function(){} - }; - - $(document).ready(function() { - $.fancybox.init(); - }); - +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +;(function($) { + var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, + + selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], + + ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, + + loadingTimer, loadingFrame = 1, + + titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('
')[0], { prop: 0 }), + + isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest, + + /* + * Private methods + */ + + _abort = function() { + loading.hide(); + + imgPreloader.onerror = imgPreloader.onload = null; + + if (ajaxLoader) { + ajaxLoader.abort(); + } + + tmp.empty(); + }, + + _error = function() { + if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { + loading.hide(); + busy = false; + return; + } + + selectedOpts.titleShow = false; + + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + + tmp.html( '

The requested content cannot be loaded.
Please try again later.

' ); + + _process_inline(); + }, + + _start = function() { + var obj = selectedArray[ selectedIndex ], + href, + type, + title, + str, + emb, + ret; + + _abort(); + + selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); + + ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); + + if (ret === false) { + busy = false; + return; + } else if (typeof ret == 'object') { + selectedOpts = $.extend(selectedOpts, ret); + } + + title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; + + if (obj.nodeName && !selectedOpts.orig) { + selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); + } + + if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { + title = selectedOpts.orig.attr('alt'); + } + + href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; + + if ((/^(?:javascript)/i).test(href) || href == '#') { + href = null; + } + + if (selectedOpts.type) { + type = selectedOpts.type; + + if (!href) { + href = selectedOpts.content; + } + + } else if (selectedOpts.content) { + type = 'html'; + + } else if (href) { + if (href.match(imgRegExp)) { + type = 'image'; + + } else if (href.match(swfRegExp)) { + type = 'swf'; + + } else if ($(obj).hasClass("iframe")) { + type = 'iframe'; + + } else if (href.indexOf("#") === 0) { + type = 'inline'; + + } else { + type = 'ajax'; + } + } + + if (!type) { + _error(); + return; + } + + if (type == 'inline') { + obj = href.substr(href.indexOf("#")); + type = $(obj).length > 0 ? 'inline' : 'ajax'; + } + + selectedOpts.type = type; + selectedOpts.href = href; + selectedOpts.title = title; + + if (selectedOpts.autoDimensions) { + if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + } else { + selectedOpts.autoDimensions = false; + } + } + + if (selectedOpts.modal) { + selectedOpts.overlayShow = true; + selectedOpts.hideOnOverlayClick = false; + selectedOpts.hideOnContentClick = false; + selectedOpts.enableEscapeButton = false; + selectedOpts.showCloseButton = false; + } + + selectedOpts.padding = parseInt(selectedOpts.padding, 10); + selectedOpts.margin = parseInt(selectedOpts.margin, 10); + + tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); + + $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { + $(this).replaceWith(content.children()); + }); + + switch (type) { + case 'html' : + tmp.html( selectedOpts.content ); + _process_inline(); + break; + + case 'inline' : + if ( $(obj).parent().is('#fancybox-content') === true) { + busy = false; + return; + } + + $('
') + .hide() + .insertBefore( $(obj) ) + .bind('fancybox-cleanup', function() { + $(this).replaceWith(content.children()); + }).bind('fancybox-cancel', function() { + $(this).replaceWith(tmp.children()); + }); + + $(obj).appendTo(tmp); + + _process_inline(); + break; + + case 'image': + busy = false; + + $.fancybox.showActivity(); + + imgPreloader = new Image(); + + imgPreloader.onerror = function() { + _error(); + }; + + imgPreloader.onload = function() { + busy = true; + + imgPreloader.onerror = imgPreloader.onload = null; + + _process_image(); + }; + + imgPreloader.src = href; + break; + + case 'swf': + selectedOpts.scrolling = 'no'; + + str = ''; + emb = ''; + + $.each(selectedOpts.swf, function(name, val) { + str += ''; + emb += ' ' + name + '="' + val + '"'; + }); + + str += ''; + + tmp.html(str); + + _process_inline(); + break; + + case 'ajax': + busy = false; + + $.fancybox.showActivity(); + + selectedOpts.ajax.win = selectedOpts.ajax.success; + + ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { + url : href, + data : selectedOpts.ajax.data || {}, + error : function(XMLHttpRequest, textStatus, errorThrown) { + if ( XMLHttpRequest.status > 0 ) { + _error(); + } + }, + success : function(data, textStatus, XMLHttpRequest) { + var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; + if (o.status == 200) { + if ( typeof selectedOpts.ajax.win == 'function' ) { + ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); + + if (ret === false) { + loading.hide(); + return; + } else if (typeof ret == 'string' || typeof ret == 'object') { + data = ret; + } + } + + tmp.html( data ); + _process_inline(); + } + } + })); + + break; + + case 'iframe': + _show(); + break; + } + }, + + _process_inline = function() { + var + w = selectedOpts.width, + h = selectedOpts.height; + + if (w.toString().indexOf('%') > -1) { + w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; + + } else { + w = w == 'auto' ? 'auto' : w + 'px'; + } + + if (h.toString().indexOf('%') > -1) { + h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; + + } else { + h = h == 'auto' ? 'auto' : h + 'px'; + } + + tmp.wrapInner('
'); + + selectedOpts.width = tmp.width(); + selectedOpts.height = tmp.height(); + + _show(); + }, + + _process_image = function() { + selectedOpts.width = imgPreloader.width; + selectedOpts.height = imgPreloader.height; + + $("").attr({ + 'id' : 'fancybox-img', + 'src' : imgPreloader.src, + 'alt' : selectedOpts.title + }).appendTo( tmp ); + + _show(); + }, + + _show = function() { + var pos, equal; + + loading.hide(); + + if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + $.event.trigger('fancybox-cancel'); + + busy = false; + return; + } + + busy = true; + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { + wrap.css('height', wrap.height()); + } + + currentArray = selectedArray; + currentIndex = selectedIndex; + currentOpts = selectedOpts; + + if (currentOpts.overlayShow) { + overlay.css({ + 'background-color' : currentOpts.overlayColor, + 'opacity' : currentOpts.overlayOpacity, + 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', + 'height' : $(document).height() + }); + + if (!overlay.is(':visible')) { + if (isIE6) { + $('select:not(#fancybox-tmp select)').filter(function() { + return this.style.visibility !== 'hidden'; + }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { + this.style.visibility = 'inherit'; + }); + } + + overlay.show(); + } + } else { + overlay.hide(); + } + + final_pos = _get_zoom_to(); + + _process_title(); + + if (wrap.is(":visible")) { + $( close.add( nav_left ).add( nav_right ) ).hide(); + + pos = wrap.position(), + + start_pos = { + top : pos.top, + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); + + content.fadeTo(currentOpts.changeFade, 0.3, function() { + var finish_resizing = function() { + content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); + }; + + $.event.trigger('fancybox-change'); + + content + .empty() + .removeAttr('filter') + .css({ + 'border-width' : currentOpts.padding, + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }); + + if (equal) { + finish_resizing(); + + } else { + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.changeSpeed, + easing : currentOpts.easingChange, + step : _draw, + complete : finish_resizing + }); + } + }); + + return; + } + + wrap.removeAttr("style"); + + content.css('border-width', currentOpts.padding); + + if (currentOpts.transitionIn == 'elastic') { + start_pos = _get_zoom_from(); + + content.html( tmp.contents() ); + + wrap.show(); + + if (currentOpts.opacity) { + final_pos.opacity = 0; + } + + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.speedIn, + easing : currentOpts.easingIn, + step : _draw, + complete : _finish + }); + + return; + } + + if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { + title.show(); + } + + content + .css({ + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }) + .html( tmp.contents() ); + + wrap + .css(final_pos) + .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); + }, + + _format_title = function(title) { + if (title && title.length) { + if (currentOpts.titlePosition == 'float') { + return '
' + title + '
'; + } + + return '
' + title + '
'; + } + + return false; + }, + + _process_title = function() { + titleStr = currentOpts.title || ''; + titleHeight = 0; + + title + .empty() + .removeAttr('style') + .removeClass(); + + if (currentOpts.titleShow === false) { + title.hide(); + return; + } + + titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); + + if (!titleStr || titleStr === '') { + title.hide(); + return; + } + + title + .addClass('fancybox-title-' + currentOpts.titlePosition) + .html( titleStr ) + .appendTo( 'body' ) + .show(); + + switch (currentOpts.titlePosition) { + case 'inside': + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'marginLeft' : currentOpts.padding, + 'marginRight' : currentOpts.padding + }); + + titleHeight = title.outerHeight(true); + + title.appendTo( outer ); + + final_pos.height += titleHeight; + break; + + case 'over': + title + .css({ + 'marginLeft' : currentOpts.padding, + 'width' : final_pos.width - (currentOpts.padding * 2), + 'bottom' : currentOpts.padding + }) + .appendTo( outer ); + break; + + case 'float': + title + .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) + .appendTo( wrap ); + break; + + default: + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'paddingLeft' : currentOpts.padding, + 'paddingRight' : currentOpts.padding + }) + .appendTo( wrap ); + break; + } + + title.hide(); + }, + + _set_navigation = function() { + if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { + $(document).bind('keydown.fb', function(e) { + if (e.keyCode == 27 && currentOpts.enableEscapeButton) { + e.preventDefault(); + $.fancybox.close(); + + } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { + e.preventDefault(); + $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); + } + }); + } + + if (!currentOpts.showNavArrows) { + nav_left.hide(); + nav_right.hide(); + return; + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { + nav_left.show(); + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { + nav_right.show(); + } + }, + + _finish = function () { + if (!$.support.opacity) { + content.get(0).style.removeAttribute('filter'); + wrap.get(0).style.removeAttribute('filter'); + } + + if (selectedOpts.autoDimensions) { + content.css('height', 'auto'); + } + + wrap.css('height', 'auto'); + + if (titleStr && titleStr.length) { + title.show(); + } + + if (currentOpts.showCloseButton) { + close.show(); + } + + _set_navigation(); + + if (currentOpts.hideOnContentClick) { + content.bind('click', $.fancybox.close); + } + + if (currentOpts.hideOnOverlayClick) { + overlay.bind('click', $.fancybox.close); + } + + $(window).bind("resize.fb", $.fancybox.resize); + + if (currentOpts.centerOnScroll) { + $(window).bind("scroll.fb", $.fancybox.center); + } + + if (currentOpts.type == 'iframe') { + $('').appendTo(content); + } + + wrap.show(); + + busy = false; + + $.fancybox.center(); + + currentOpts.onComplete(currentArray, currentIndex, currentOpts); + + _preload_images(); + }, + + _preload_images = function() { + var href, + objNext; + + if ((currentArray.length -1) > currentIndex) { + href = currentArray[ currentIndex + 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + + if (currentIndex > 0) { + href = currentArray[ currentIndex - 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + }, + + _draw = function(pos) { + var dim = { + width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), + height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), + + top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), + left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) + }; + + if (typeof final_pos.opacity !== 'undefined') { + dim.opacity = pos < 0.5 ? 0.5 : pos; + } + + wrap.css(dim); + + content.css({ + 'width' : dim.width - currentOpts.padding * 2, + 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 + }); + }, + + _get_viewport = function() { + return [ + $(window).width() - (currentOpts.margin * 2), + $(window).height() - (currentOpts.margin * 2), + $(document).scrollLeft() + currentOpts.margin, + $(document).scrollTop() + currentOpts.margin + ]; + }, + + _get_zoom_to = function () { + var view = _get_viewport(), + to = {}, + resize = currentOpts.autoScale, + double_padding = currentOpts.padding * 2, + ratio; + + if (currentOpts.width.toString().indexOf('%') > -1) { + to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); + } else { + to.width = currentOpts.width + double_padding; + } + + if (currentOpts.height.toString().indexOf('%') > -1) { + to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); + } else { + to.height = currentOpts.height + double_padding; + } + + if (resize && (to.width > view[0] || to.height > view[1])) { + if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { + ratio = (currentOpts.width ) / (currentOpts.height ); + + if ((to.width ) > view[0]) { + to.width = view[0]; + to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); + } + + if ((to.height) > view[1]) { + to.height = view[1]; + to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); + } + + } else { + to.width = Math.min(to.width, view[0]); + to.height = Math.min(to.height, view[1]); + } + } + + to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); + to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); + + return to; + }, + + _get_obj_pos = function(obj) { + var pos = obj.offset(); + + pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; + pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; + + pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; + pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; + + pos.width = obj.width(); + pos.height = obj.height(); + + return pos; + }, + + _get_zoom_from = function() { + var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, + from = {}, + pos, + view; + + if (orig && orig.length) { + pos = _get_obj_pos(orig); + + from = { + width : pos.width + (currentOpts.padding * 2), + height : pos.height + (currentOpts.padding * 2), + top : pos.top - currentOpts.padding - 20, + left : pos.left - currentOpts.padding - 20 + }; + + } else { + view = _get_viewport(); + + from = { + width : currentOpts.padding * 2, + height : currentOpts.padding * 2, + top : parseInt(view[3] + view[1] * 0.5, 10), + left : parseInt(view[2] + view[0] * 0.5, 10) + }; + } + + return from; + }, + + _animate_loading = function() { + if (!loading.is(':visible')){ + clearInterval(loadingTimer); + return; + } + + $('div', loading).css('top', (loadingFrame * -40) + 'px'); + + loadingFrame = (loadingFrame + 1) % 12; + }; + + /* + * Public methods + */ + + $.fn.fancybox = function(options) { + if (!$(this).length) { + return this; + } + + $(this) + .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) + .unbind('click.fb') + .bind('click.fb', function(e) { + e.preventDefault(); + + if (busy) { + return; + } + + busy = true; + + $(this).blur(); + + selectedArray = []; + selectedIndex = 0; + + var rel = $(this).attr('rel') || ''; + + if (!rel || rel == '' || rel === 'nofollow') { + selectedArray.push(this); + + } else { + selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); + selectedIndex = selectedArray.index( this ); + } + + _start(); + + return; + }); + + return this; + }; + + $.fancybox = function(obj) { + var opts; + + if (busy) { + return; + } + + busy = true; + opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; + + selectedArray = []; + selectedIndex = parseInt(opts.index, 10) || 0; + + if ($.isArray(obj)) { + for (var i = 0, j = obj.length; i < j; i++) { + if (typeof obj[i] == 'object') { + $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); + } else { + obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); + } + } + + selectedArray = jQuery.merge(selectedArray, obj); + + } else { + if (typeof obj == 'object') { + $(obj).data('fancybox', $.extend({}, opts, obj)); + } else { + obj = $({}).data('fancybox', $.extend({content : obj}, opts)); + } + + selectedArray.push(obj); + } + + if (selectedIndex > selectedArray.length || selectedIndex < 0) { + selectedIndex = 0; + } + + _start(); + }; + + $.fancybox.showActivity = function() { + clearInterval(loadingTimer); + + loading.show(); + loadingTimer = setInterval(_animate_loading, 66); + }; + + $.fancybox.hideActivity = function() { + loading.hide(); + }; + + $.fancybox.next = function() { + return $.fancybox.pos( currentIndex + 1); + }; + + $.fancybox.prev = function() { + return $.fancybox.pos( currentIndex - 1); + }; + + $.fancybox.pos = function(pos) { + if (busy) { + return; + } + + pos = parseInt(pos); + + selectedArray = currentArray; + + if (pos > -1 && pos < currentArray.length) { + selectedIndex = pos; + _start(); + + } else if (currentOpts.cyclic && currentArray.length > 1) { + selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; + _start(); + } + + return; + }; + + $.fancybox.cancel = function() { + if (busy) { + return; + } + + busy = true; + + $.event.trigger('fancybox-cancel'); + + _abort(); + + selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); + + busy = false; + }; + + // Note: within an iframe use - parent.$.fancybox.close(); + $.fancybox.close = function() { + if (busy || wrap.is(':hidden')) { + return; + } + + busy = true; + + if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + busy = false; + return; + } + + _abort(); + + $(close.add( nav_left ).add( nav_right )).hide(); + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); + + if (currentOpts.titlePosition !== 'inside') { + title.empty(); + } + + wrap.stop(); + + function _cleanup() { + overlay.fadeOut('fast'); + + title.empty().hide(); + wrap.hide(); + + $.event.trigger('fancybox-cleanup'); + + content.empty(); + + currentOpts.onClosed(currentArray, currentIndex, currentOpts); + + currentArray = selectedOpts = []; + currentIndex = selectedIndex = 0; + currentOpts = selectedOpts = {}; + + busy = false; + } + + if (currentOpts.transitionOut == 'elastic') { + start_pos = _get_zoom_from(); + + var pos = wrap.position(); + + final_pos = { + top : pos.top , + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + if (currentOpts.opacity) { + final_pos.opacity = 1; + } + + title.empty().hide(); + + fx.prop = 1; + + $(fx).animate({ prop: 0 }, { + duration : currentOpts.speedOut, + easing : currentOpts.easingOut, + step : _draw, + complete : _cleanup + }); + + } else { + wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); + } + }; + + $.fancybox.resize = function() { + if (overlay.is(':visible')) { + overlay.css('height', $(document).height()); + } + + $.fancybox.center(true); + }; + + $.fancybox.center = function() { + var view, align; + + if (busy) { + return; + } + + align = arguments[0] === true ? 1 : 0; + view = _get_viewport(); + + if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { + return; + } + + wrap + .stop() + .animate({ + 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), + 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) + }, typeof arguments[0] == 'number' ? arguments[0] : 200); + }; + + $.fancybox.init = function() { + if ($("#fancybox-wrap").length) { + return; + } + + $('body').append( + tmp = $('
'), + loading = $('
'), + overlay = $('
'), + wrap = $('
') + ); + + outer = $('
') + .append('
') + .appendTo( wrap ); + + outer.append( + content = $('
'), + close = $(''), + title = $('
'), + + nav_left = $(''), + nav_right = $('') + ); + + close.click($.fancybox.close); + loading.click($.fancybox.cancel); + + nav_left.click(function(e) { + e.preventDefault(); + $.fancybox.prev(); + }); + + nav_right.click(function(e) { + e.preventDefault(); + $.fancybox.next(); + }); + + if ($.fn.mousewheel) { + wrap.bind('mousewheel.fb', function(e, delta) { + if (busy) { + e.preventDefault(); + + } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { + e.preventDefault(); + $.fancybox[ delta > 0 ? 'prev' : 'next'](); + } + }); + } + + if (!$.support.opacity) { + wrap.addClass('fancybox-ie'); + } + + if (isIE6) { + loading.addClass('fancybox-ie6'); + wrap.addClass('fancybox-ie6'); + + $('').prependTo(outer); + } + }; + + $.fn.fancybox.defaults = { + padding : 10, + margin : 40, + opacity : false, + modal : false, + cyclic : false, + scrolling : 'auto', // 'auto', 'yes' or 'no' + + width : 560, + height : 340, + + autoScale : true, + autoDimensions : true, + centerOnScroll : false, + + ajax : {}, + swf : { wmode: 'transparent' }, + + hideOnOverlayClick : true, + hideOnContentClick : false, + + overlayShow : true, + overlayOpacity : 0.7, + overlayColor : '#777', + + titleShow : true, + titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' + titleFormat : null, + titleFromAlt : false, + + transitionIn : 'fade', // 'elastic', 'fade' or 'none' + transitionOut : 'fade', // 'elastic', 'fade' or 'none' + + speedIn : 300, + speedOut : 300, + + changeSpeed : 300, + changeFade : 'fast', + + easingIn : 'swing', + easingOut : 'swing', + + showCloseButton : true, + showNavArrows : true, + enableEscapeButton : true, + enableKeyboardNav : true, + + onStart : function(){}, + onCancel : function(){}, + onComplete : function(){}, + onCleanup : function(){}, + onClosed : function(){}, + onError : function(){} + }; + + $(document).ready(function() { + $.fancybox.init(); + }); + })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.pack.js b/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.pack.js index 3efef77..b97e31e 100755 --- a/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.pack.js +++ b/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.pack.js @@ -1,46 +1,46 @@ -/* - * FancyBox - jQuery Plugin - * Simple and fancy lightbox alternative - * - * Examples and documentation at: http://fancybox.net - * - * Copyright (c) 2008 - 2010 Janis Skarnelis - * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. - * - * Version: 1.3.4 (11/11/2010) - * Requires: jQuery v1.3+ - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ - -;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("
")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('

The requested content cannot be loaded.
Please try again later.

'); -F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)|| -c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick= -false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('
').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel", -function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='';P="";b.each(e.swf,function(x,H){C+='';P+=" "+x+'="'+H+'"'});C+='";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win== -"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('
');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor, -opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length? -d.titlePosition=="float"?'
'+s+'
':'
'+s+"
":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding}); -y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height== -i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents()); -f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode== -37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto"); -s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('').appendTo(j); -f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c); -j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type== -"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"), -10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)}; -b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k= -0,C=a.length;ko.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+ -1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h= -true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1; -b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5- -d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('
'),t=b('
'),u=b('
'),f=b('
'));D=b('
').append('
').appendTo(f); -D.append(j=b('
'),E=b(''),n=b('
'),z=b(''),A=b(''));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()}); -b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('').prependTo(D)}}}; -b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing", +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("
")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('

The requested content cannot be loaded.
Please try again later.

'); +F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)|| +c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick= +false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('
').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel", +function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='';P="";b.each(e.swf,function(x,H){C+='';P+=" "+x+'="'+H+'"'});C+='";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win== +"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('
');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor, +opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length? +d.titlePosition=="float"?'
'+s+'
':'
'+s+"
":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding}); +y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height== +i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents()); +f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode== +37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto"); +s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('').appendTo(j); +f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c); +j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type== +"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"), +10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)}; +b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k= +0,C=a.length;ko.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+ +1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h= +true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1; +b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5- +d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('
'),t=b('
'),u=b('
'),f=b('
'));D=b('
').append('
').appendTo(f); +D.append(j=b('
'),E=b(''),n=b('
'),z=b(''),A=b(''));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()}); +b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('').prependTo(D)}}}; +b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing", easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/jquery.fileupload.js b/assets/grocery_crud/js/jquery_plugins/jquery.fileupload.js index a7117ba..ed9708f 100755 --- a/assets/grocery_crud/js/jquery_plugins/jquery.fileupload.js +++ b/assets/grocery_crud/js/jquery_plugins/jquery.fileupload.js @@ -1,840 +1,840 @@ -/* - * jQuery File Upload Plugin 5.6 - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2010, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - */ - -/*jslint nomen: true, unparam: true, regexp: true */ -/*global define, window, document, XMLHttpRequestUpload, Blob, File, FormData, location */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define(['jquery', './vendor/jquery.ui.widget', './jquery.iframe-transport'], factory); - } else { - // Browser globals: - factory(window.jQuery); - } -}(function ($) { - 'use strict'; - - // The fileupload widget listens for change events on file input fields defined - // via fileInput setting and paste or drop events of the given dropZone. - // In addition to the default jQuery Widget methods, the fileupload widget - // exposes the "add" and "send" methods, to add or directly send files using - // the fileupload API. - // By default, files added via file input selection, paste, drag & drop or - // "add" method are uploaded immediately, but it is possible to override - // the "add" callback option to queue file uploads. - $.widget('blueimp.fileupload', { - - options: { - // The namespace used for event handler binding on the dropZone and - // fileInput collections. - // If not set, the name of the widget ("fileupload") is used. - namespace: undefined, - // The drop target collection, by the default the complete document. - // Set to null or an empty collection to disable drag & drop support: - dropZone: $(document), - // The file input field collection, that is listened for change events. - // If undefined, it is set to the file input fields inside - // of the widget element on plugin initialization. - // Set to null or an empty collection to disable the change listener. - fileInput: undefined, - // By default, the file input field is replaced with a clone after - // each input field change event. This is required for iframe transport - // queues and allows change events to be fired for the same file - // selection, but can be disabled by setting the following option to false: - replaceFileInput: true, - // The parameter name for the file form data (the request argument name). - // If undefined or empty, the name property of the file input field is - // used, or "files[]" if the file input name property is also empty: - paramName: undefined, - // By default, each file of a selection is uploaded using an individual - // request for XHR type uploads. Set to false to upload file - // selections in one request each: - singleFileUploads: true, - // To limit the number of files uploaded with one XHR request, - // set the following option to an integer greater than 0: - limitMultiFileUploads: undefined, - // Set the following option to true to issue all file upload requests - // in a sequential order: - sequentialUploads: false, - // To limit the number of concurrent uploads, - // set the following option to an integer greater than 0: - limitConcurrentUploads: undefined, - // Set the following option to true to force iframe transport uploads: - forceIframeTransport: false, - // Set the following option to the location of a postMessage window, - // to enable postMessage transport uploads: - postMessage: undefined, - // By default, XHR file uploads are sent as multipart/form-data. - // The iframe transport is always using multipart/form-data. - // Set to false to enable non-multipart XHR uploads: - multipart: true, - // To upload large files in smaller chunks, set the following option - // to a preferred maximum chunk size. If set to 0, null or undefined, - // or the browser does not support the required Blob API, files will - // be uploaded as a whole. - maxChunkSize: undefined, - // When a non-multipart upload or a chunked multipart upload has been - // aborted, this option can be used to resume the upload by setting - // it to the size of the already uploaded bytes. This option is most - // useful when modifying the options object inside of the "add" or - // "send" callbacks, as the options are cloned for each file upload. - uploadedBytes: undefined, - // By default, failed (abort or error) file uploads are removed from the - // global progress calculation. Set the following option to false to - // prevent recalculating the global progress data: - recalculateProgress: true, - - // Additional form data to be sent along with the file uploads can be set - // using this option, which accepts an array of objects with name and - // value properties, a function returning such an array, a FormData - // object (for XHR file uploads), or a simple object. - // The form of the first fileInput is given as parameter to the function: - formData: function (form) { - return form.serializeArray(); - }, - - // The add callback is invoked as soon as files are added to the fileupload - // widget (via file input selection, drag & drop, paste or add API call). - // If the singleFileUploads option is enabled, this callback will be - // called once for each file in the selection for XHR file uplaods, else - // once for each file selection. - // The upload starts when the submit method is invoked on the data parameter. - // The data object contains a files property holding the added files - // and allows to override plugin options as well as define ajax settings. - // Listeners for this callback can also be bound the following way: - // .bind('fileuploadadd', func); - // data.submit() returns a Promise object and allows to attach additional - // handlers using jQuery's Deferred callbacks: - // data.submit().done(func).fail(func).always(func); - add: function (e, data) { - data.submit(); - }, - - // Other callbacks: - // Callback for the submit event of each file upload: - // submit: function (e, data) {}, // .bind('fileuploadsubmit', func); - // Callback for the start of each file upload request: - // send: function (e, data) {}, // .bind('fileuploadsend', func); - // Callback for successful uploads: - // done: function (e, data) {}, // .bind('fileuploaddone', func); - // Callback for failed (abort or error) uploads: - // fail: function (e, data) {}, // .bind('fileuploadfail', func); - // Callback for completed (success, abort or error) requests: - // always: function (e, data) {}, // .bind('fileuploadalways', func); - // Callback for upload progress events: - // progress: function (e, data) {}, // .bind('fileuploadprogress', func); - // Callback for global upload progress events: - // progressall: function (e, data) {}, // .bind('fileuploadprogressall', func); - // Callback for uploads start, equivalent to the global ajaxStart event: - // start: function (e) {}, // .bind('fileuploadstart', func); - // Callback for uploads stop, equivalent to the global ajaxStop event: - // stop: function (e) {}, // .bind('fileuploadstop', func); - // Callback for change events of the fileInput collection: - // change: function (e, data) {}, // .bind('fileuploadchange', func); - // Callback for paste events to the dropZone collection: - // paste: function (e, data) {}, // .bind('fileuploadpaste', func); - // Callback for drop events of the dropZone collection: - // drop: function (e, data) {}, // .bind('fileuploaddrop', func); - // Callback for dragover events of the dropZone collection: - // dragover: function (e) {}, // .bind('fileuploaddragover', func); - - // The plugin options are used as settings object for the ajax calls. - // The following are jQuery ajax settings required for the file uploads: - processData: false, - contentType: false, - cache: false - }, - - // A list of options that require a refresh after assigning a new value: - _refreshOptionsList: ['namespace', 'dropZone', 'fileInput'], - - _isXHRUpload: function (options) { - var undef = 'undefined'; - return !options.forceIframeTransport && - typeof XMLHttpRequestUpload !== undef && typeof File !== undef && - (!options.multipart || typeof FormData !== undef); - }, - - _getFormData: function (options) { - var formData; - if (typeof options.formData === 'function') { - return options.formData(options.form); - } else if ($.isArray(options.formData)) { - return options.formData; - } else if (options.formData) { - formData = []; - $.each(options.formData, function (name, value) { - formData.push({name: name, value: value}); - }); - return formData; - } - return []; - }, - - _getTotal: function (files) { - var total = 0; - $.each(files, function (index, file) { - total += file.size || 1; - }); - return total; - }, - - _onProgress: function (e, data) { - if (e.lengthComputable) { - var total = data.total || this._getTotal(data.files), - loaded = parseInt( - e.loaded / e.total * (data.chunkSize || total), - 10 - ) + (data.uploadedBytes || 0); - this._loaded += loaded - (data.loaded || data.uploadedBytes || 0); - data.lengthComputable = true; - data.loaded = loaded; - data.total = total; - // Trigger a custom progress event with a total data property set - // to the file size(s) of the current upload and a loaded data - // property calculated accordingly: - this._trigger('progress', e, data); - // Trigger a global progress event for all current file uploads, - // including ajax calls queued for sequential file uploads: - this._trigger('progressall', e, { - lengthComputable: true, - loaded: this._loaded, - total: this._total - }); - } - }, - - _initProgressListener: function (options) { - var that = this, - xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr(); - // Accesss to the native XHR object is required to add event listeners - // for the upload progress event: - if (xhr.upload) { - $(xhr.upload).bind('progress', function (e) { - var oe = e.originalEvent; - // Make sure the progress event properties get copied over: - e.lengthComputable = oe.lengthComputable; - e.loaded = oe.loaded; - e.total = oe.total; - that._onProgress(e, options); - }); - options.xhr = function () { - return xhr; - }; - } - }, - - _initXHRData: function (options) { - var formData, - file = options.files[0]; - if (!options.multipart || options.blob) { - // For non-multipart uploads and chunked uploads, - // file meta data is not part of the request body, - // so we transmit this data as part of the HTTP headers. - // For cross domain requests, these headers must be allowed - // via Access-Control-Allow-Headers or removed using - // the beforeSend callback: - options.headers = $.extend(options.headers, { - 'X-File-Name': file.name, - 'X-File-Type': file.type, - 'X-File-Size': file.size - }); - if (!options.blob) { - // Non-chunked non-multipart upload: - options.contentType = file.type; - options.data = file; - } else if (!options.multipart) { - // Chunked non-multipart upload: - options.contentType = 'application/octet-stream'; - options.data = options.blob; - } - } - if (options.multipart && typeof FormData !== 'undefined') { - if (options.postMessage) { - // window.postMessage does not allow sending FormData - // objects, so we just add the File/Blob objects to - // the formData array and let the postMessage window - // create the FormData object out of this array: - formData = this._getFormData(options); - if (options.blob) { - formData.push({ - name: options.paramName, - value: options.blob - }); - } else { - $.each(options.files, function (index, file) { - formData.push({ - name: options.paramName, - value: file - }); - }); - } - } else { - if (options.formData instanceof FormData) { - formData = options.formData; - } else { - formData = new FormData(); - $.each(this._getFormData(options), function (index, field) { - formData.append(field.name, field.value); - }); - } - if (options.blob) { - formData.append(options.paramName, options.blob); - } else { - $.each(options.files, function (index, file) { - // File objects are also Blob instances. - // This check allows the tests to run with - // dummy objects: - if (file instanceof Blob) { - formData.append(options.paramName, file); - } - }); - } - } - options.data = formData; - } - // Blob reference is not needed anymore, free memory: - options.blob = null; - }, - - _initIframeSettings: function (options) { - // Setting the dataType to iframe enables the iframe transport: - options.dataType = 'iframe ' + (options.dataType || ''); - // The iframe transport accepts a serialized array as form data: - options.formData = this._getFormData(options); - }, - - _initDataSettings: function (options) { - if (this._isXHRUpload(options)) { - if (!this._chunkedUpload(options, true)) { - if (!options.data) { - this._initXHRData(options); - } - this._initProgressListener(options); - } - if (options.postMessage) { - // Setting the dataType to postmessage enables the - // postMessage transport: - options.dataType = 'postmessage ' + (options.dataType || ''); - } - } else { - this._initIframeSettings(options, 'iframe'); - } - }, - - _initFormSettings: function (options) { - // Retrieve missing options from the input field and the - // associated form, if available: - if (!options.form || !options.form.length) { - options.form = $(options.fileInput.prop('form')); - } - if (!options.paramName) { - options.paramName = options.fileInput.prop('name') || - 'files[]'; - } - if (!options.url) { - options.url = options.form.prop('action') || location.href; - } - // The HTTP request method must be "POST" or "PUT": - options.type = (options.type || options.form.prop('method') || '') - .toUpperCase(); - if (options.type !== 'POST' && options.type !== 'PUT') { - options.type = 'POST'; - } - }, - - _getAJAXSettings: function (data) { - var options = $.extend({}, this.options, data); - this._initFormSettings(options); - this._initDataSettings(options); - return options; - }, - - // Maps jqXHR callbacks to the equivalent - // methods of the given Promise object: - _enhancePromise: function (promise) { - promise.success = promise.done; - promise.error = promise.fail; - promise.complete = promise.always; - return promise; - }, - - // Creates and returns a Promise object enhanced with - // the jqXHR methods abort, success, error and complete: - _getXHRPromise: function (resolveOrReject, context, args) { - var dfd = $.Deferred(), - promise = dfd.promise(); - context = context || this.options.context || promise; - if (resolveOrReject === true) { - dfd.resolveWith(context, args); - } else if (resolveOrReject === false) { - dfd.rejectWith(context, args); - } - promise.abort = dfd.promise; - return this._enhancePromise(promise); - }, - - // Uploads a file in multiple, sequential requests - // by splitting the file up in multiple blob chunks. - // If the second parameter is true, only tests if the file - // should be uploaded in chunks, but does not invoke any - // upload requests: - _chunkedUpload: function (options, testOnly) { - var that = this, - file = options.files[0], - fs = file.size, - ub = options.uploadedBytes = options.uploadedBytes || 0, - mcs = options.maxChunkSize || fs, - // Use the Blob methods with the slice implementation - // according to the W3C Blob API specification: - slice = file.webkitSlice || file.mozSlice || file.slice, - upload, - n, - jqXHR, - pipe; - if (!(this._isXHRUpload(options) && slice && (ub || mcs < fs)) || - options.data) { - return false; - } - if (testOnly) { - return true; - } - if (ub >= fs) { - file.error = 'uploadedBytes'; - return this._getXHRPromise( - false, - options.context, - [null, 'error', file.error] - ); - } - // n is the number of blobs to upload, - // calculated via filesize, uploaded bytes and max chunk size: - n = Math.ceil((fs - ub) / mcs); - // The chunk upload method accepting the chunk number as parameter: - upload = function (i) { - if (!i) { - return that._getXHRPromise(true, options.context); - } - // Upload the blobs in sequential order: - return upload(i -= 1).pipe(function () { - // Clone the options object for each chunk upload: - var o = $.extend({}, options); - o.blob = slice.call( - file, - ub + i * mcs, - ub + (i + 1) * mcs - ); - // Store the current chunk size, as the blob itself - // will be dereferenced after data processing: - o.chunkSize = o.blob.size; - // Process the upload data (the blob and potential form data): - that._initXHRData(o); - // Add progress listeners for this chunk upload: - that._initProgressListener(o); - jqXHR = ($.ajax(o) || that._getXHRPromise(false, o.context)) - .done(function () { - // Create a progress event if upload is done and - // no progress event has been invoked for this chunk: - if (!o.loaded) { - that._onProgress($.Event('progress', { - lengthComputable: true, - loaded: o.chunkSize, - total: o.chunkSize - }), o); - } - options.uploadedBytes = o.uploadedBytes += - o.chunkSize; - }); - return jqXHR; - }); - }; - // Return the piped Promise object, enhanced with an abort method, - // which is delegated to the jqXHR object of the current upload, - // and jqXHR callbacks mapped to the equivalent Promise methods: - pipe = upload(n); - pipe.abort = function () { - return jqXHR.abort(); - }; - return this._enhancePromise(pipe); - }, - - _beforeSend: function (e, data) { - if (this._active === 0) { - // the start callback is triggered when an upload starts - // and no other uploads are currently running, - // equivalent to the global ajaxStart event: - this._trigger('start'); - } - this._active += 1; - // Initialize the global progress values: - this._loaded += data.uploadedBytes || 0; - this._total += this._getTotal(data.files); - }, - - _onDone: function (result, textStatus, jqXHR, options) { - if (!this._isXHRUpload(options)) { - // Create a progress event for each iframe load: - this._onProgress($.Event('progress', { - lengthComputable: true, - loaded: 1, - total: 1 - }), options); - } - options.result = result; - options.textStatus = textStatus; - options.jqXHR = jqXHR; - this._trigger('done', null, options); - }, - - _onFail: function (jqXHR, textStatus, errorThrown, options) { - options.jqXHR = jqXHR; - options.textStatus = textStatus; - options.errorThrown = errorThrown; - this._trigger('fail', null, options); - if (options.recalculateProgress) { - // Remove the failed (error or abort) file upload from - // the global progress calculation: - this._loaded -= options.loaded || options.uploadedBytes || 0; - this._total -= options.total || this._getTotal(options.files); - } - }, - - _onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) { - this._active -= 1; - options.textStatus = textStatus; - if (jqXHRorError && jqXHRorError.always) { - options.jqXHR = jqXHRorError; - options.result = jqXHRorResult; - } else { - options.jqXHR = jqXHRorResult; - options.errorThrown = jqXHRorError; - } - this._trigger('always', null, options); - if (this._active === 0) { - // The stop callback is triggered when all uploads have - // been completed, equivalent to the global ajaxStop event: - this._trigger('stop'); - // Reset the global progress values: - this._loaded = this._total = 0; - } - }, - - _onSend: function (e, data) { - var that = this, - jqXHR, - slot, - pipe, - options = that._getAJAXSettings(data), - send = function (resolve, args) { - that._sending += 1; - jqXHR = jqXHR || ( - (resolve !== false && - that._trigger('send', e, options) !== false && - (that._chunkedUpload(options) || $.ajax(options))) || - that._getXHRPromise(false, options.context, args) - ).done(function (result, textStatus, jqXHR) { - that._onDone(result, textStatus, jqXHR, options); - }).fail(function (jqXHR, textStatus, errorThrown) { - that._onFail(jqXHR, textStatus, errorThrown, options); - }).always(function (jqXHRorResult, textStatus, jqXHRorError) { - that._sending -= 1; - that._onAlways( - jqXHRorResult, - textStatus, - jqXHRorError, - options - ); - if (options.limitConcurrentUploads && - options.limitConcurrentUploads > that._sending) { - // Start the next queued upload, - // that has not been aborted: - var nextSlot = that._slots.shift(); - while (nextSlot) { - if (!nextSlot.isRejected()) { - nextSlot.resolve(); - break; - } - nextSlot = that._slots.shift(); - } - } - }); - return jqXHR; - }; - this._beforeSend(e, options); - if (this.options.sequentialUploads || - (this.options.limitConcurrentUploads && - this.options.limitConcurrentUploads <= this._sending)) { - if (this.options.limitConcurrentUploads > 1) { - slot = $.Deferred(); - this._slots.push(slot); - pipe = slot.pipe(send); - } else { - pipe = (this._sequence = this._sequence.pipe(send, send)); - } - // Return the piped Promise object, enhanced with an abort method, - // which is delegated to the jqXHR object of the current upload, - // and jqXHR callbacks mapped to the equivalent Promise methods: - pipe.abort = function () { - var args = [undefined, 'abort', 'abort']; - if (!jqXHR) { - if (slot) { - slot.rejectWith(args); - } - return send(false, args); - } - return jqXHR.abort(); - }; - return this._enhancePromise(pipe); - } - return send(); - }, - - _onAdd: function (e, data) { - var that = this, - result = true, - options = $.extend({}, this.options, data), - limit = options.limitMultiFileUploads, - fileSet, - i; - if (!(options.singleFileUploads || limit) || - !this._isXHRUpload(options)) { - fileSet = [data.files]; - } else if (!options.singleFileUploads && limit) { - fileSet = []; - for (i = 0; i < data.files.length; i += limit) { - fileSet.push(data.files.slice(i, i + limit)); - } - } - data.originalFiles = data.files; - $.each(fileSet || data.files, function (index, element) { - var files = fileSet ? element : [element], - newData = $.extend({}, data, {files: files}); - newData.submit = function () { - newData.jqXHR = this.jqXHR = - (that._trigger('submit', e, this) !== false) && - that._onSend(e, this); - return this.jqXHR; - }; - return (result = that._trigger('add', e, newData)); - }); - return result; - }, - - // File Normalization for Gecko 1.9.1 (Firefox 3.5) support: - _normalizeFile: function (index, file) { - if (file.name === undefined && file.size === undefined) { - file.name = file.fileName; - file.size = file.fileSize; - } - }, - - _replaceFileInput: function (input) { - var inputClone = input.clone(true); - $('
').append(inputClone)[0].reset(); - // Detaching allows to insert the fileInput on another form - // without loosing the file input value: - input.after(inputClone).detach(); - // Avoid memory leaks with the detached file input: - $.cleanData(input.unbind('remove')); - // Replace the original file input element in the fileInput - // collection with the clone, which has been copied including - // event handlers: - this.options.fileInput = this.options.fileInput.map(function (i, el) { - if (el === input[0]) { - return inputClone[0]; - } - return el; - }); - // If the widget has been initialized on the file input itself, - // override this.element with the file input clone: - if (input[0] === this.element[0]) { - this.element = inputClone; - } - }, - - _onChange: function (e) { - var that = e.data.fileupload, - data = { - files: $.each($.makeArray(e.target.files), that._normalizeFile), - fileInput: $(e.target), - form: $(e.target.form) - }; - if (!data.files.length) { - // If the files property is not available, the browser does not - // support the File API and we add a pseudo File object with - // the input value as name with path information removed: - data.files = [{name: e.target.value.replace(/^.*\\/, '')}]; - } - if (that.options.replaceFileInput) { - that._replaceFileInput(data.fileInput); - } - if (that._trigger('change', e, data) === false || - that._onAdd(e, data) === false) { - return false; - } - }, - - _onPaste: function (e) { - var that = e.data.fileupload, - cbd = e.originalEvent.clipboardData, - items = (cbd && cbd.items) || [], - data = {files: []}; - $.each(items, function (index, item) { - var file = item.getAsFile && item.getAsFile(); - if (file) { - data.files.push(file); - } - }); - if (that._trigger('paste', e, data) === false || - that._onAdd(e, data) === false) { - return false; - } - }, - - _onDrop: function (e) { - var that = e.data.fileupload, - dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer, - data = { - files: $.each( - $.makeArray(dataTransfer && dataTransfer.files), - that._normalizeFile - ) - }; - if (that._trigger('drop', e, data) === false || - that._onAdd(e, data) === false) { - return false; - } - e.preventDefault(); - }, - - _onDragOver: function (e) { - var that = e.data.fileupload, - dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer; - if (that._trigger('dragover', e) === false) { - return false; - } - if (dataTransfer) { - dataTransfer.dropEffect = dataTransfer.effectAllowed = 'copy'; - } - e.preventDefault(); - }, - - _initEventHandlers: function () { - var ns = this.options.namespace; - this.options.dropZone - .bind('dragover.' + ns, {fileupload: this}, this._onDragOver) - .bind('drop.' + ns, {fileupload: this}, this._onDrop) - .bind('paste.' + ns, {fileupload: this}, this._onPaste); - this.options.fileInput - .bind('change.' + ns, {fileupload: this}, this._onChange); - }, - - _destroyEventHandlers: function () { - var ns = this.options.namespace; - this.options.dropZone - .unbind('dragover.' + ns, this._onDragOver) - .unbind('drop.' + ns, this._onDrop) - .unbind('paste.' + ns, this._onPaste); - this.options.fileInput - .unbind('change.' + ns, this._onChange); - }, - - _beforeSetOption: function (key, value) { - this._destroyEventHandlers(); - }, - - _afterSetOption: function (key, value) { - var options = this.options; - if (!options.fileInput) { - options.fileInput = $(); - } - if (!options.dropZone) { - options.dropZone = $(); - } - this._initEventHandlers(); - }, - - _setOption: function (key, value) { - var refresh = $.inArray(key, this._refreshOptionsList) !== -1; - if (refresh) { - this._beforeSetOption(key, value); - } - $.Widget.prototype._setOption.call(this, key, value); - if (refresh) { - this._afterSetOption(key, value); - } - }, - - _create: function () { - var options = this.options; - options.namespace = options.namespace || this.widgetName; - if (options.fileInput === undefined) { - options.fileInput = this.element.is('input:file') ? - this.element : this.element.find('input:file'); - } else if (!options.fileInput) { - options.fileInput = $(); - } - if (!options.dropZone) { - options.dropZone = $(); - } - this._slots = []; - this._sequence = this._getXHRPromise(true); - this._sending = this._active = this._loaded = this._total = 0; - this._initEventHandlers(); - }, - - destroy: function () { - this._destroyEventHandlers(); - $.Widget.prototype.destroy.call(this); - }, - - enable: function () { - $.Widget.prototype.enable.call(this); - this._initEventHandlers(); - }, - - disable: function () { - this._destroyEventHandlers(); - $.Widget.prototype.disable.call(this); - }, - - // This method is exposed to the widget API and allows adding files - // using the fileupload API. The data parameter accepts an object which - // must have a files property and can contain additional options: - // .fileupload('add', {files: filesList}); - add: function (data) { - if (!data || this.options.disabled) { - return; - } - data.files = $.each($.makeArray(data.files), this._normalizeFile); - this._onAdd(null, data); - }, - - // This method is exposed to the widget API and allows sending files - // using the fileupload API. The data parameter accepts an object which - // must have a files property and can contain additional options: - // .fileupload('send', {files: filesList}); - // The method returns a Promise object for the file upload call. - send: function (data) { - if (data && !this.options.disabled) { - data.files = $.each($.makeArray(data.files), this._normalizeFile); - if (data.files.length) { - return this._onSend(null, data); - } - } - return this._getXHRPromise(false, data && data.context); - } - - }); - -})); +/* + * jQuery File Upload Plugin 5.6 + * https://github.com/blueimp/jQuery-File-Upload + * + * Copyright 2010, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/MIT + */ + +/*jslint nomen: true, unparam: true, regexp: true */ +/*global define, window, document, XMLHttpRequestUpload, Blob, File, FormData, location */ + +(function (factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // Register as an anonymous AMD module: + define(['jquery', './vendor/jquery.ui.widget', './jquery.iframe-transport'], factory); + } else { + // Browser globals: + factory(window.jQuery); + } +}(function ($) { + 'use strict'; + + // The fileupload widget listens for change events on file input fields defined + // via fileInput setting and paste or drop events of the given dropZone. + // In addition to the default jQuery Widget methods, the fileupload widget + // exposes the "add" and "send" methods, to add or directly send files using + // the fileupload API. + // By default, files added via file input selection, paste, drag & drop or + // "add" method are uploaded immediately, but it is possible to override + // the "add" callback option to queue file uploads. + $.widget('blueimp.fileupload', { + + options: { + // The namespace used for event handler binding on the dropZone and + // fileInput collections. + // If not set, the name of the widget ("fileupload") is used. + namespace: undefined, + // The drop target collection, by the default the complete document. + // Set to null or an empty collection to disable drag & drop support: + dropZone: $(document), + // The file input field collection, that is listened for change events. + // If undefined, it is set to the file input fields inside + // of the widget element on plugin initialization. + // Set to null or an empty collection to disable the change listener. + fileInput: undefined, + // By default, the file input field is replaced with a clone after + // each input field change event. This is required for iframe transport + // queues and allows change events to be fired for the same file + // selection, but can be disabled by setting the following option to false: + replaceFileInput: true, + // The parameter name for the file form data (the request argument name). + // If undefined or empty, the name property of the file input field is + // used, or "files[]" if the file input name property is also empty: + paramName: undefined, + // By default, each file of a selection is uploaded using an individual + // request for XHR type uploads. Set to false to upload file + // selections in one request each: + singleFileUploads: true, + // To limit the number of files uploaded with one XHR request, + // set the following option to an integer greater than 0: + limitMultiFileUploads: undefined, + // Set the following option to true to issue all file upload requests + // in a sequential order: + sequentialUploads: false, + // To limit the number of concurrent uploads, + // set the following option to an integer greater than 0: + limitConcurrentUploads: undefined, + // Set the following option to true to force iframe transport uploads: + forceIframeTransport: false, + // Set the following option to the location of a postMessage window, + // to enable postMessage transport uploads: + postMessage: undefined, + // By default, XHR file uploads are sent as multipart/form-data. + // The iframe transport is always using multipart/form-data. + // Set to false to enable non-multipart XHR uploads: + multipart: true, + // To upload large files in smaller chunks, set the following option + // to a preferred maximum chunk size. If set to 0, null or undefined, + // or the browser does not support the required Blob API, files will + // be uploaded as a whole. + maxChunkSize: undefined, + // When a non-multipart upload or a chunked multipart upload has been + // aborted, this option can be used to resume the upload by setting + // it to the size of the already uploaded bytes. This option is most + // useful when modifying the options object inside of the "add" or + // "send" callbacks, as the options are cloned for each file upload. + uploadedBytes: undefined, + // By default, failed (abort or error) file uploads are removed from the + // global progress calculation. Set the following option to false to + // prevent recalculating the global progress data: + recalculateProgress: true, + + // Additional form data to be sent along with the file uploads can be set + // using this option, which accepts an array of objects with name and + // value properties, a function returning such an array, a FormData + // object (for XHR file uploads), or a simple object. + // The form of the first fileInput is given as parameter to the function: + formData: function (form) { + return form.serializeArray(); + }, + + // The add callback is invoked as soon as files are added to the fileupload + // widget (via file input selection, drag & drop, paste or add API call). + // If the singleFileUploads option is enabled, this callback will be + // called once for each file in the selection for XHR file uplaods, else + // once for each file selection. + // The upload starts when the submit method is invoked on the data parameter. + // The data object contains a files property holding the added files + // and allows to override plugin options as well as define ajax settings. + // Listeners for this callback can also be bound the following way: + // .bind('fileuploadadd', func); + // data.submit() returns a Promise object and allows to attach additional + // handlers using jQuery's Deferred callbacks: + // data.submit().done(func).fail(func).always(func); + add: function (e, data) { + data.submit(); + }, + + // Other callbacks: + // Callback for the submit event of each file upload: + // submit: function (e, data) {}, // .bind('fileuploadsubmit', func); + // Callback for the start of each file upload request: + // send: function (e, data) {}, // .bind('fileuploadsend', func); + // Callback for successful uploads: + // done: function (e, data) {}, // .bind('fileuploaddone', func); + // Callback for failed (abort or error) uploads: + // fail: function (e, data) {}, // .bind('fileuploadfail', func); + // Callback for completed (success, abort or error) requests: + // always: function (e, data) {}, // .bind('fileuploadalways', func); + // Callback for upload progress events: + // progress: function (e, data) {}, // .bind('fileuploadprogress', func); + // Callback for global upload progress events: + // progressall: function (e, data) {}, // .bind('fileuploadprogressall', func); + // Callback for uploads start, equivalent to the global ajaxStart event: + // start: function (e) {}, // .bind('fileuploadstart', func); + // Callback for uploads stop, equivalent to the global ajaxStop event: + // stop: function (e) {}, // .bind('fileuploadstop', func); + // Callback for change events of the fileInput collection: + // change: function (e, data) {}, // .bind('fileuploadchange', func); + // Callback for paste events to the dropZone collection: + // paste: function (e, data) {}, // .bind('fileuploadpaste', func); + // Callback for drop events of the dropZone collection: + // drop: function (e, data) {}, // .bind('fileuploaddrop', func); + // Callback for dragover events of the dropZone collection: + // dragover: function (e) {}, // .bind('fileuploaddragover', func); + + // The plugin options are used as settings object for the ajax calls. + // The following are jQuery ajax settings required for the file uploads: + processData: false, + contentType: false, + cache: false + }, + + // A list of options that require a refresh after assigning a new value: + _refreshOptionsList: ['namespace', 'dropZone', 'fileInput'], + + _isXHRUpload: function (options) { + var undef = 'undefined'; + return !options.forceIframeTransport && + typeof XMLHttpRequestUpload !== undef && typeof File !== undef && + (!options.multipart || typeof FormData !== undef); + }, + + _getFormData: function (options) { + var formData; + if (typeof options.formData === 'function') { + return options.formData(options.form); + } else if ($.isArray(options.formData)) { + return options.formData; + } else if (options.formData) { + formData = []; + $.each(options.formData, function (name, value) { + formData.push({name: name, value: value}); + }); + return formData; + } + return []; + }, + + _getTotal: function (files) { + var total = 0; + $.each(files, function (index, file) { + total += file.size || 1; + }); + return total; + }, + + _onProgress: function (e, data) { + if (e.lengthComputable) { + var total = data.total || this._getTotal(data.files), + loaded = parseInt( + e.loaded / e.total * (data.chunkSize || total), + 10 + ) + (data.uploadedBytes || 0); + this._loaded += loaded - (data.loaded || data.uploadedBytes || 0); + data.lengthComputable = true; + data.loaded = loaded; + data.total = total; + // Trigger a custom progress event with a total data property set + // to the file size(s) of the current upload and a loaded data + // property calculated accordingly: + this._trigger('progress', e, data); + // Trigger a global progress event for all current file uploads, + // including ajax calls queued for sequential file uploads: + this._trigger('progressall', e, { + lengthComputable: true, + loaded: this._loaded, + total: this._total + }); + } + }, + + _initProgressListener: function (options) { + var that = this, + xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr(); + // Accesss to the native XHR object is required to add event listeners + // for the upload progress event: + if (xhr.upload) { + $(xhr.upload).bind('progress', function (e) { + var oe = e.originalEvent; + // Make sure the progress event properties get copied over: + e.lengthComputable = oe.lengthComputable; + e.loaded = oe.loaded; + e.total = oe.total; + that._onProgress(e, options); + }); + options.xhr = function () { + return xhr; + }; + } + }, + + _initXHRData: function (options) { + var formData, + file = options.files[0]; + if (!options.multipart || options.blob) { + // For non-multipart uploads and chunked uploads, + // file meta data is not part of the request body, + // so we transmit this data as part of the HTTP headers. + // For cross domain requests, these headers must be allowed + // via Access-Control-Allow-Headers or removed using + // the beforeSend callback: + options.headers = $.extend(options.headers, { + 'X-File-Name': file.name, + 'X-File-Type': file.type, + 'X-File-Size': file.size + }); + if (!options.blob) { + // Non-chunked non-multipart upload: + options.contentType = file.type; + options.data = file; + } else if (!options.multipart) { + // Chunked non-multipart upload: + options.contentType = 'application/octet-stream'; + options.data = options.blob; + } + } + if (options.multipart && typeof FormData !== 'undefined') { + if (options.postMessage) { + // window.postMessage does not allow sending FormData + // objects, so we just add the File/Blob objects to + // the formData array and let the postMessage window + // create the FormData object out of this array: + formData = this._getFormData(options); + if (options.blob) { + formData.push({ + name: options.paramName, + value: options.blob + }); + } else { + $.each(options.files, function (index, file) { + formData.push({ + name: options.paramName, + value: file + }); + }); + } + } else { + if (options.formData instanceof FormData) { + formData = options.formData; + } else { + formData = new FormData(); + $.each(this._getFormData(options), function (index, field) { + formData.append(field.name, field.value); + }); + } + if (options.blob) { + formData.append(options.paramName, options.blob); + } else { + $.each(options.files, function (index, file) { + // File objects are also Blob instances. + // This check allows the tests to run with + // dummy objects: + if (file instanceof Blob) { + formData.append(options.paramName, file); + } + }); + } + } + options.data = formData; + } + // Blob reference is not needed anymore, free memory: + options.blob = null; + }, + + _initIframeSettings: function (options) { + // Setting the dataType to iframe enables the iframe transport: + options.dataType = 'iframe ' + (options.dataType || ''); + // The iframe transport accepts a serialized array as form data: + options.formData = this._getFormData(options); + }, + + _initDataSettings: function (options) { + if (this._isXHRUpload(options)) { + if (!this._chunkedUpload(options, true)) { + if (!options.data) { + this._initXHRData(options); + } + this._initProgressListener(options); + } + if (options.postMessage) { + // Setting the dataType to postmessage enables the + // postMessage transport: + options.dataType = 'postmessage ' + (options.dataType || ''); + } + } else { + this._initIframeSettings(options, 'iframe'); + } + }, + + _initFormSettings: function (options) { + // Retrieve missing options from the input field and the + // associated form, if available: + if (!options.form || !options.form.length) { + options.form = $(options.fileInput.prop('form')); + } + if (!options.paramName) { + options.paramName = options.fileInput.prop('name') || + 'files[]'; + } + if (!options.url) { + options.url = options.form.prop('action') || location.href; + } + // The HTTP request method must be "POST" or "PUT": + options.type = (options.type || options.form.prop('method') || '') + .toUpperCase(); + if (options.type !== 'POST' && options.type !== 'PUT') { + options.type = 'POST'; + } + }, + + _getAJAXSettings: function (data) { + var options = $.extend({}, this.options, data); + this._initFormSettings(options); + this._initDataSettings(options); + return options; + }, + + // Maps jqXHR callbacks to the equivalent + // methods of the given Promise object: + _enhancePromise: function (promise) { + promise.success = promise.done; + promise.error = promise.fail; + promise.complete = promise.always; + return promise; + }, + + // Creates and returns a Promise object enhanced with + // the jqXHR methods abort, success, error and complete: + _getXHRPromise: function (resolveOrReject, context, args) { + var dfd = $.Deferred(), + promise = dfd.promise(); + context = context || this.options.context || promise; + if (resolveOrReject === true) { + dfd.resolveWith(context, args); + } else if (resolveOrReject === false) { + dfd.rejectWith(context, args); + } + promise.abort = dfd.promise; + return this._enhancePromise(promise); + }, + + // Uploads a file in multiple, sequential requests + // by splitting the file up in multiple blob chunks. + // If the second parameter is true, only tests if the file + // should be uploaded in chunks, but does not invoke any + // upload requests: + _chunkedUpload: function (options, testOnly) { + var that = this, + file = options.files[0], + fs = file.size, + ub = options.uploadedBytes = options.uploadedBytes || 0, + mcs = options.maxChunkSize || fs, + // Use the Blob methods with the slice implementation + // according to the W3C Blob API specification: + slice = file.webkitSlice || file.mozSlice || file.slice, + upload, + n, + jqXHR, + pipe; + if (!(this._isXHRUpload(options) && slice && (ub || mcs < fs)) || + options.data) { + return false; + } + if (testOnly) { + return true; + } + if (ub >= fs) { + file.error = 'uploadedBytes'; + return this._getXHRPromise( + false, + options.context, + [null, 'error', file.error] + ); + } + // n is the number of blobs to upload, + // calculated via filesize, uploaded bytes and max chunk size: + n = Math.ceil((fs - ub) / mcs); + // The chunk upload method accepting the chunk number as parameter: + upload = function (i) { + if (!i) { + return that._getXHRPromise(true, options.context); + } + // Upload the blobs in sequential order: + return upload(i -= 1).pipe(function () { + // Clone the options object for each chunk upload: + var o = $.extend({}, options); + o.blob = slice.call( + file, + ub + i * mcs, + ub + (i + 1) * mcs + ); + // Store the current chunk size, as the blob itself + // will be dereferenced after data processing: + o.chunkSize = o.blob.size; + // Process the upload data (the blob and potential form data): + that._initXHRData(o); + // Add progress listeners for this chunk upload: + that._initProgressListener(o); + jqXHR = ($.ajax(o) || that._getXHRPromise(false, o.context)) + .done(function () { + // Create a progress event if upload is done and + // no progress event has been invoked for this chunk: + if (!o.loaded) { + that._onProgress($.Event('progress', { + lengthComputable: true, + loaded: o.chunkSize, + total: o.chunkSize + }), o); + } + options.uploadedBytes = o.uploadedBytes += + o.chunkSize; + }); + return jqXHR; + }); + }; + // Return the piped Promise object, enhanced with an abort method, + // which is delegated to the jqXHR object of the current upload, + // and jqXHR callbacks mapped to the equivalent Promise methods: + pipe = upload(n); + pipe.abort = function () { + return jqXHR.abort(); + }; + return this._enhancePromise(pipe); + }, + + _beforeSend: function (e, data) { + if (this._active === 0) { + // the start callback is triggered when an upload starts + // and no other uploads are currently running, + // equivalent to the global ajaxStart event: + this._trigger('start'); + } + this._active += 1; + // Initialize the global progress values: + this._loaded += data.uploadedBytes || 0; + this._total += this._getTotal(data.files); + }, + + _onDone: function (result, textStatus, jqXHR, options) { + if (!this._isXHRUpload(options)) { + // Create a progress event for each iframe load: + this._onProgress($.Event('progress', { + lengthComputable: true, + loaded: 1, + total: 1 + }), options); + } + options.result = result; + options.textStatus = textStatus; + options.jqXHR = jqXHR; + this._trigger('done', null, options); + }, + + _onFail: function (jqXHR, textStatus, errorThrown, options) { + options.jqXHR = jqXHR; + options.textStatus = textStatus; + options.errorThrown = errorThrown; + this._trigger('fail', null, options); + if (options.recalculateProgress) { + // Remove the failed (error or abort) file upload from + // the global progress calculation: + this._loaded -= options.loaded || options.uploadedBytes || 0; + this._total -= options.total || this._getTotal(options.files); + } + }, + + _onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) { + this._active -= 1; + options.textStatus = textStatus; + if (jqXHRorError && jqXHRorError.always) { + options.jqXHR = jqXHRorError; + options.result = jqXHRorResult; + } else { + options.jqXHR = jqXHRorResult; + options.errorThrown = jqXHRorError; + } + this._trigger('always', null, options); + if (this._active === 0) { + // The stop callback is triggered when all uploads have + // been completed, equivalent to the global ajaxStop event: + this._trigger('stop'); + // Reset the global progress values: + this._loaded = this._total = 0; + } + }, + + _onSend: function (e, data) { + var that = this, + jqXHR, + slot, + pipe, + options = that._getAJAXSettings(data), + send = function (resolve, args) { + that._sending += 1; + jqXHR = jqXHR || ( + (resolve !== false && + that._trigger('send', e, options) !== false && + (that._chunkedUpload(options) || $.ajax(options))) || + that._getXHRPromise(false, options.context, args) + ).done(function (result, textStatus, jqXHR) { + that._onDone(result, textStatus, jqXHR, options); + }).fail(function (jqXHR, textStatus, errorThrown) { + that._onFail(jqXHR, textStatus, errorThrown, options); + }).always(function (jqXHRorResult, textStatus, jqXHRorError) { + that._sending -= 1; + that._onAlways( + jqXHRorResult, + textStatus, + jqXHRorError, + options + ); + if (options.limitConcurrentUploads && + options.limitConcurrentUploads > that._sending) { + // Start the next queued upload, + // that has not been aborted: + var nextSlot = that._slots.shift(); + while (nextSlot) { + if (!nextSlot.isRejected()) { + nextSlot.resolve(); + break; + } + nextSlot = that._slots.shift(); + } + } + }); + return jqXHR; + }; + this._beforeSend(e, options); + if (this.options.sequentialUploads || + (this.options.limitConcurrentUploads && + this.options.limitConcurrentUploads <= this._sending)) { + if (this.options.limitConcurrentUploads > 1) { + slot = $.Deferred(); + this._slots.push(slot); + pipe = slot.pipe(send); + } else { + pipe = (this._sequence = this._sequence.pipe(send, send)); + } + // Return the piped Promise object, enhanced with an abort method, + // which is delegated to the jqXHR object of the current upload, + // and jqXHR callbacks mapped to the equivalent Promise methods: + pipe.abort = function () { + var args = [undefined, 'abort', 'abort']; + if (!jqXHR) { + if (slot) { + slot.rejectWith(args); + } + return send(false, args); + } + return jqXHR.abort(); + }; + return this._enhancePromise(pipe); + } + return send(); + }, + + _onAdd: function (e, data) { + var that = this, + result = true, + options = $.extend({}, this.options, data), + limit = options.limitMultiFileUploads, + fileSet, + i; + if (!(options.singleFileUploads || limit) || + !this._isXHRUpload(options)) { + fileSet = [data.files]; + } else if (!options.singleFileUploads && limit) { + fileSet = []; + for (i = 0; i < data.files.length; i += limit) { + fileSet.push(data.files.slice(i, i + limit)); + } + } + data.originalFiles = data.files; + $.each(fileSet || data.files, function (index, element) { + var files = fileSet ? element : [element], + newData = $.extend({}, data, {files: files}); + newData.submit = function () { + newData.jqXHR = this.jqXHR = + (that._trigger('submit', e, this) !== false) && + that._onSend(e, this); + return this.jqXHR; + }; + return (result = that._trigger('add', e, newData)); + }); + return result; + }, + + // File Normalization for Gecko 1.9.1 (Firefox 3.5) support: + _normalizeFile: function (index, file) { + if (file.name === undefined && file.size === undefined) { + file.name = file.fileName; + file.size = file.fileSize; + } + }, + + _replaceFileInput: function (input) { + var inputClone = input.clone(true); + $('
').append(inputClone)[0].reset(); + // Detaching allows to insert the fileInput on another form + // without loosing the file input value: + input.after(inputClone).detach(); + // Avoid memory leaks with the detached file input: + $.cleanData(input.unbind('remove')); + // Replace the original file input element in the fileInput + // collection with the clone, which has been copied including + // event handlers: + this.options.fileInput = this.options.fileInput.map(function (i, el) { + if (el === input[0]) { + return inputClone[0]; + } + return el; + }); + // If the widget has been initialized on the file input itself, + // override this.element with the file input clone: + if (input[0] === this.element[0]) { + this.element = inputClone; + } + }, + + _onChange: function (e) { + var that = e.data.fileupload, + data = { + files: $.each($.makeArray(e.target.files), that._normalizeFile), + fileInput: $(e.target), + form: $(e.target.form) + }; + if (!data.files.length) { + // If the files property is not available, the browser does not + // support the File API and we add a pseudo File object with + // the input value as name with path information removed: + data.files = [{name: e.target.value.replace(/^.*\\/, '')}]; + } + if (that.options.replaceFileInput) { + that._replaceFileInput(data.fileInput); + } + if (that._trigger('change', e, data) === false || + that._onAdd(e, data) === false) { + return false; + } + }, + + _onPaste: function (e) { + var that = e.data.fileupload, + cbd = e.originalEvent.clipboardData, + items = (cbd && cbd.items) || [], + data = {files: []}; + $.each(items, function (index, item) { + var file = item.getAsFile && item.getAsFile(); + if (file) { + data.files.push(file); + } + }); + if (that._trigger('paste', e, data) === false || + that._onAdd(e, data) === false) { + return false; + } + }, + + _onDrop: function (e) { + var that = e.data.fileupload, + dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer, + data = { + files: $.each( + $.makeArray(dataTransfer && dataTransfer.files), + that._normalizeFile + ) + }; + if (that._trigger('drop', e, data) === false || + that._onAdd(e, data) === false) { + return false; + } + e.preventDefault(); + }, + + _onDragOver: function (e) { + var that = e.data.fileupload, + dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer; + if (that._trigger('dragover', e) === false) { + return false; + } + if (dataTransfer) { + dataTransfer.dropEffect = dataTransfer.effectAllowed = 'copy'; + } + e.preventDefault(); + }, + + _initEventHandlers: function () { + var ns = this.options.namespace; + this.options.dropZone + .bind('dragover.' + ns, {fileupload: this}, this._onDragOver) + .bind('drop.' + ns, {fileupload: this}, this._onDrop) + .bind('paste.' + ns, {fileupload: this}, this._onPaste); + this.options.fileInput + .bind('change.' + ns, {fileupload: this}, this._onChange); + }, + + _destroyEventHandlers: function () { + var ns = this.options.namespace; + this.options.dropZone + .unbind('dragover.' + ns, this._onDragOver) + .unbind('drop.' + ns, this._onDrop) + .unbind('paste.' + ns, this._onPaste); + this.options.fileInput + .unbind('change.' + ns, this._onChange); + }, + + _beforeSetOption: function (key, value) { + this._destroyEventHandlers(); + }, + + _afterSetOption: function (key, value) { + var options = this.options; + if (!options.fileInput) { + options.fileInput = $(); + } + if (!options.dropZone) { + options.dropZone = $(); + } + this._initEventHandlers(); + }, + + _setOption: function (key, value) { + var refresh = $.inArray(key, this._refreshOptionsList) !== -1; + if (refresh) { + this._beforeSetOption(key, value); + } + $.Widget.prototype._setOption.call(this, key, value); + if (refresh) { + this._afterSetOption(key, value); + } + }, + + _create: function () { + var options = this.options; + options.namespace = options.namespace || this.widgetName; + if (options.fileInput === undefined) { + options.fileInput = this.element.is('input:file') ? + this.element : this.element.find('input:file'); + } else if (!options.fileInput) { + options.fileInput = $(); + } + if (!options.dropZone) { + options.dropZone = $(); + } + this._slots = []; + this._sequence = this._getXHRPromise(true); + this._sending = this._active = this._loaded = this._total = 0; + this._initEventHandlers(); + }, + + destroy: function () { + this._destroyEventHandlers(); + $.Widget.prototype.destroy.call(this); + }, + + enable: function () { + $.Widget.prototype.enable.call(this); + this._initEventHandlers(); + }, + + disable: function () { + this._destroyEventHandlers(); + $.Widget.prototype.disable.call(this); + }, + + // This method is exposed to the widget API and allows adding files + // using the fileupload API. The data parameter accepts an object which + // must have a files property and can contain additional options: + // .fileupload('add', {files: filesList}); + add: function (data) { + if (!data || this.options.disabled) { + return; + } + data.files = $.each($.makeArray(data.files), this._normalizeFile); + this._onAdd(null, data); + }, + + // This method is exposed to the widget API and allows sending files + // using the fileupload API. The data parameter accepts an object which + // must have a files property and can contain additional options: + // .fileupload('send', {files: filesList}); + // The method returns a Promise object for the file upload call. + send: function (data) { + if (data && !this.options.disabled) { + data.files = $.each($.makeArray(data.files), this._normalizeFile); + if (data.files.length) { + return this._onSend(null, data); + } + } + return this._getXHRPromise(false, data && data.context); + } + + }); + +})); diff --git a/assets/grocery_crud/js/jquery_plugins/jquery.iframe-transport.js b/assets/grocery_crud/js/jquery_plugins/jquery.iframe-transport.js index 5bbbeef..d85c0c1 100755 --- a/assets/grocery_crud/js/jquery_plugins/jquery.iframe-transport.js +++ b/assets/grocery_crud/js/jquery_plugins/jquery.iframe-transport.js @@ -1,165 +1,165 @@ -/* - * jQuery Iframe Transport Plugin 1.3 - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2011, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - */ - -/*jslint unparam: true, nomen: true */ -/*global define, window, document */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define(['jquery'], factory); - } else { - // Browser globals: - factory(window.jQuery); - } -}(function ($) { - 'use strict'; - - // Helper variable to create unique names for the transport iframes: - var counter = 0; - - // The iframe transport accepts three additional options: - // options.fileInput: a jQuery collection of file input fields - // options.paramName: the parameter name for the file form data, - // overrides the name property of the file input field(s) - // options.formData: an array of objects with name and value properties, - // equivalent to the return data of .serializeArray(), e.g.: - // [{name: 'a', value: 1}, {name: 'b', value: 2}] - $.ajaxTransport('iframe', function (options) { - if (options.async && (options.type === 'POST' || options.type === 'GET')) { - var form, - iframe; - return { - send: function (_, completeCallback) { - form = $('
'); - // javascript:false as initial iframe src - // prevents warning popups on HTTPS in IE6. - // IE versions below IE8 cannot set the name property of - // elements that have already been added to the DOM, - // so we set the name along with the iframe HTML markup: - iframe = $( - '' - ).bind('load', function () { - var fileInputClones; - iframe - .unbind('load') - .bind('load', function () { - var response; - // Wrap in a try/catch block to catch exceptions thrown - // when trying to access cross-domain iframe contents: - try { - response = iframe.contents(); - // Google Chrome and Firefox do not throw an - // exception when calling iframe.contents() on - // cross-domain requests, so we unify the response: - if (!response.length || !response[0].firstChild) { - throw new Error(); - } - } catch (e) { - response = undefined; - } - // The complete callback returns the - // iframe content document as response object: - completeCallback( - 200, - 'success', - {'iframe': response} - ); - // Fix for IE endless progress bar activity bug - // (happens on form submits to iframe targets): - $('') - .appendTo(form); - form.remove(); - }); - form - .prop('target', iframe.prop('name')) - .prop('action', options.url) - .prop('method', options.type); - if (options.formData) { - $.each(options.formData, function (index, field) { - $('') - .prop('name', field.name) - .val(field.value) - .appendTo(form); - }); - } - if (options.fileInput && options.fileInput.length && - options.type === 'POST') { - fileInputClones = options.fileInput.clone(); - // Insert a clone for each file input field: - options.fileInput.after(function (index) { - return fileInputClones[index]; - }); - if (options.paramName) { - options.fileInput.each(function () { - $(this).prop('name', options.paramName); - }); - } - // Appending the file input fields to the hidden form - // removes them from their original location: - form - .append(options.fileInput) - .prop('enctype', 'multipart/form-data') - // enctype must be set as encoding for IE: - .prop('encoding', 'multipart/form-data'); - } - form.submit(); - // Insert the file input fields at their original location - // by replacing the clones with the originals: - if (fileInputClones && fileInputClones.length) { - options.fileInput.each(function (index, input) { - var clone = $(fileInputClones[index]); - $(input).prop('name', clone.prop('name')); - clone.replaceWith(input); - }); - } - }); - form.append(iframe).appendTo(document.body); - }, - abort: function () { - if (iframe) { - // javascript:false as iframe src aborts the request - // and prevents warning popups on HTTPS in IE6. - // concat is used to avoid the "Script URL" JSLint error: - iframe - .unbind('load') - .prop('src', 'javascript'.concat(':false;')); - } - if (form) { - form.remove(); - } - } - }; - } - }); - - // The iframe transport returns the iframe content document as response. - // The following adds converters from iframe to text, json, html, and script: - $.ajaxSetup({ - converters: { - 'iframe text': function (iframe) { - return $(iframe[0].body).text(); - }, - 'iframe json': function (iframe) { - return $.parseJSON($(iframe[0].body).text()); - }, - 'iframe html': function (iframe) { - return $(iframe[0].body).html(); - }, - 'iframe script': function (iframe) { - return $.globalEval($(iframe[0].body).text()); - } - } - }); - -})); +/* + * jQuery Iframe Transport Plugin 1.3 + * https://github.com/blueimp/jQuery-File-Upload + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/MIT + */ + +/*jslint unparam: true, nomen: true */ +/*global define, window, document */ + +(function (factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // Register as an anonymous AMD module: + define(['jquery'], factory); + } else { + // Browser globals: + factory(window.jQuery); + } +}(function ($) { + 'use strict'; + + // Helper variable to create unique names for the transport iframes: + var counter = 0; + + // The iframe transport accepts three additional options: + // options.fileInput: a jQuery collection of file input fields + // options.paramName: the parameter name for the file form data, + // overrides the name property of the file input field(s) + // options.formData: an array of objects with name and value properties, + // equivalent to the return data of .serializeArray(), e.g.: + // [{name: 'a', value: 1}, {name: 'b', value: 2}] + $.ajaxTransport('iframe', function (options) { + if (options.async && (options.type === 'POST' || options.type === 'GET')) { + var form, + iframe; + return { + send: function (_, completeCallback) { + form = $('
'); + // javascript:false as initial iframe src + // prevents warning popups on HTTPS in IE6. + // IE versions below IE8 cannot set the name property of + // elements that have already been added to the DOM, + // so we set the name along with the iframe HTML markup: + iframe = $( + '' + ).bind('load', function () { + var fileInputClones; + iframe + .unbind('load') + .bind('load', function () { + var response; + // Wrap in a try/catch block to catch exceptions thrown + // when trying to access cross-domain iframe contents: + try { + response = iframe.contents(); + // Google Chrome and Firefox do not throw an + // exception when calling iframe.contents() on + // cross-domain requests, so we unify the response: + if (!response.length || !response[0].firstChild) { + throw new Error(); + } + } catch (e) { + response = undefined; + } + // The complete callback returns the + // iframe content document as response object: + completeCallback( + 200, + 'success', + {'iframe': response} + ); + // Fix for IE endless progress bar activity bug + // (happens on form submits to iframe targets): + $('') + .appendTo(form); + form.remove(); + }); + form + .prop('target', iframe.prop('name')) + .prop('action', options.url) + .prop('method', options.type); + if (options.formData) { + $.each(options.formData, function (index, field) { + $('') + .prop('name', field.name) + .val(field.value) + .appendTo(form); + }); + } + if (options.fileInput && options.fileInput.length && + options.type === 'POST') { + fileInputClones = options.fileInput.clone(); + // Insert a clone for each file input field: + options.fileInput.after(function (index) { + return fileInputClones[index]; + }); + if (options.paramName) { + options.fileInput.each(function () { + $(this).prop('name', options.paramName); + }); + } + // Appending the file input fields to the hidden form + // removes them from their original location: + form + .append(options.fileInput) + .prop('enctype', 'multipart/form-data') + // enctype must be set as encoding for IE: + .prop('encoding', 'multipart/form-data'); + } + form.submit(); + // Insert the file input fields at their original location + // by replacing the clones with the originals: + if (fileInputClones && fileInputClones.length) { + options.fileInput.each(function (index, input) { + var clone = $(fileInputClones[index]); + $(input).prop('name', clone.prop('name')); + clone.replaceWith(input); + }); + } + }); + form.append(iframe).appendTo(document.body); + }, + abort: function () { + if (iframe) { + // javascript:false as iframe src aborts the request + // and prevents warning popups on HTTPS in IE6. + // concat is used to avoid the "Script URL" JSLint error: + iframe + .unbind('load') + .prop('src', 'javascript'.concat(':false;')); + } + if (form) { + form.remove(); + } + } + }; + } + }); + + // The iframe transport returns the iframe content document as response. + // The following adds converters from iframe to text, json, html, and script: + $.ajaxSetup({ + converters: { + 'iframe text': function (iframe) { + return $(iframe[0].body).text(); + }, + 'iframe json': function (iframe) { + return $.parseJSON($(iframe[0].body).text()); + }, + 'iframe html': function (iframe) { + return $(iframe[0].body).html(); + }, + 'iframe script': function (iframe) { + return $.globalEval($(iframe[0].body).text()); + } + } + }); + +})); diff --git a/assets/grocery_crud/js/jquery_plugins/jquery.noty.js b/assets/grocery_crud/js/jquery_plugins/jquery.noty.js index 753afbf..4078c5a 100755 --- a/assets/grocery_crud/js/jquery_plugins/jquery.noty.js +++ b/assets/grocery_crud/js/jquery_plugins/jquery.noty.js @@ -1,667 +1,667 @@ -/** -* noty - jQuery Notification Plugin v2.0.3 -* Contributors: https://github.com/needim/noty/graphs/contributors -* -* Examples and Documentation - http://needim.github.com/noty/ -* -* Licensed under the MIT licenses: -* http://www.opensource.org/licenses/mit-license.php -* -**/ - -if (typeof Object.create !== 'function') { - Object.create = function (o) { - function F() {}; - F.prototype = o; - return new F(); - }; -}; - -;(function($) { - - var NotyObject = { - - init: function(options) { - - // Mix in the passed in options with the default options - this.options = $.extend({}, $.noty.defaults, options); - - this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout]; - this.options.theme = $.noty.themes[this.options.theme]; - - delete options.layout, delete options.theme; - - this.options = $.extend({}, this.options, this.options.layout.options); - this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random()* 1000000)); - - this.options = $.extend({}, this.options, options); - - // Build the noty dom initial structure - this._build(); - - // return this so we can chain/use the bridge with less code. - return this; - }, // end init - - _build: function() { - - // Generating noty bar - var $bar = $('
').attr('id', this.options.id); - $bar.append(this.options.template).find('.noty_text').html(this.options.text); - - this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar; - - // Set buttons if available - if (this.options.buttons) { - - // If we have button disable closeWith & timeout options - this.options.closeWith = [], this.options.timeout = false; - - var $buttons = $('
').addClass('noty_buttons'); - - (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons); - - var self = this; - - $.each(this.options.buttons, function(i, button) { - var $button = $(''; - htmlins += ''; - htmlins += ''; - $('body').append(htmlins); - - $('#datepicker').datepicker(); - $(document).mousedown(closePickPlug); - $('#pickerplug .ui-datepicker-close').click(closePickPlug); - - // Slider - $('#hourSlider').slider({ - orientation: "vertical", - range: 'min', - min: 0, - max: 23, - step: 1, - slide: function(event, ui) { - writeDate(writeTime(ui.value,'hour'),'time'); - - }, - change: function(event, ui) { - $('#tpSelectedTime .selHrs').effect('highlight', 1000); - } - }); - // Slider - $('#minuteSlider').slider({ - orientation: "vertical", - range: 'min', - min: 0, - max: 55, - step: 5, - slide: function(event, ui) { - writeDate(writeTime(ui.value,'minute'),'time'); - }, - change: function(event, ui) { - $('#tpSelectedTime .selMins').effect('highlight', 1000); - } - }); - - //Inline editor bind - $('#tpSelectedTime .selHrs').keyup(function(e){ - if((e.which <= 57 && e.which >= 48) && ($(this).text() >=1 && $(this).text() <=12 ) ){ - //console.log("Which: "+e.which); - $('#hourSlider').slider('value', parseInt($(this).text())); - //console.log("Val: "+parseInt($(this).val())) - }else{ - $(this).val($(this).text().slice(0, -1)); - } - //if($(this).val() < 1){ - // $(this).val(1); - //} - }); - - //Inline editor bind - $('#tpSelectedTime .selMins').keyup(function(e){ - if((e.which <= 57 && e.which >= 48) && ($(this).text() >=0 && $(this).text() <=59 ) ){ - //console.log("Which: "+e.which); - $('#minuteSlider').slider('value', parseInt($(this).text())); - //console.log("Val: "+parseInt($(this).val())) - }else{ - $(this).text($(this).text().slice(0, -1)); - } - //if($(this).val() < 1){ - // $(this).val(1); - //} - }); - } - - $('.dayPeriod').toggle(!b24Hour); - $('#text_time').text(loadedLang['time']); - $('#text_hour').text(loadedLang['hour']); - $('#text_minute').text(loadedLang['minute']); - $('#text_close').text(loadedLang['close']); - - $('#pickerplug').data('userLang',lang_); - $('#pickerplug').data('b24Hour',b24Hour_); - } - - $(this).bind('focus',function(){ - - var top = $(this).offset().top+$(this).outerHeight(); - var left = $(this).offset().left; - - if ($(this).data('userLang') != $('#pickerplug').data('userLang') || - $(this).data('b24Hour') != $('#pickerplug').data('userLang') ) { - renderPickerPlug($(this).data('b24Hour'),$(this).data('userLang')); - } - - $('#pickerplug').css({ - left: left+'px', - top: top+'px' - }).show('normal'); - - if ($(this).data('userLang')!='en' && lang[$(this).data('userLang')]) { - $('#datepicker').datepicker('option', $.extend({}, - $.datepicker.regional[$(this).data('userLang')])); - $('#datepicker').datepicker('option', $.extend($(this).data('sets'))); - } else { - $('#datepicker').datepicker('option', $.extend({}, - $.datepicker.regional[''])); - $('#datepicker').datepicker('option', $.extend($(this).data('sets'))); - } - - parseTime(this); - - if ($('#pickerplug').css('display') == 'none') { - $('#pickerplug').show('normal'); - } - - $(this).bind('keyup',parseTime); - //$(this).bind('slider',writeTime); - - $(this).addClass(markerClass); - - $('#pickerplug').data('inputfield',this); - }); - - function parseTime (obj) { - if($(obj).val() != '') - var time = ($(obj).val() || $(this).val()).split(" "); - else - var time = ['00-00-00','00:00:00']; - - if (time.length < 2) { - time = ['00-00-00','00:00:00']; - } - - $('#pickerplug').data('lastdate',time[0]); //lastdate = time[0]; - $('#pickerplug').data('lasttime',time[1]); //lasttime = time[1]; - time = time[1].split(":"); - - if (time.length < 2) { - time = ['00','00','00']; - } - - var hour = time[0] || '00'; - var minute = time[1] || '00'; - - writeTime(hour,'hour'); - writeTime(minute,'minute'); - - $('#hourSlider').slider('option', 'value', hour); - $('#minuteSlider').slider('option', 'value', minute); - - var zero_string = "0"; - - if( $('#pickerplug').data('lastdate').charAt(0) != zero_string.charAt(0) ) - { - $('#datepicker').datepicker( 'setDate', - $.datepicker.parseDate( - datepicker_def['dateFormat'], - $('#pickerplug').data('lastdate') - ) - ); - } - else - { - $('#datepicker').datepicker( 'setDate', - $.datepicker.parseDate( - datepicker_def['dateFormat'], - '' - ) - ); - } - } - - function writeTime(fragment,type) { - var time = ''; - - switch (type) { - case 'hour': - var hours = parseInt(fragment,10); - - if (!$('#pickerplug').data('b24Hour') && hours > 11) { - hours -= 12; - $('.dayPeriod').text('pm'); - - } else if (!$('#pickerplug').data('b24Hour')) { - $('.dayPeriod').text('am'); - } - - if (hours < 10) { - hours = '0'.concat(hours); - } - if (fragment < 10) { - fragment = '0'.concat(parseInt(fragment)); - } - - $('#tpSelectedTime .selHrs').text(hours); - - time = fragment+':'+$('#tpSelectedTime .selMins').text(); - break; - case 'minute': - minutes = ((fragment < 10) ? '0' :'') + parseInt(fragment,10); - $('#tpSelectedTime .selMins').text(minutes); - - time = $('#hourSlider').slider('option', 'value')+':'+minutes; - break; - } - return time; - } - - function writeDate (text,type) { - - switch (type) { - case 'time': - $('#pickerplug').data('lasttime',text+':00'); - break; - default: - $('#pickerplug').data('lastdate',text); - } - $($('#pickerplug').data('inputfield')).val( - $('#pickerplug').data('lastdate')+' '+$('#pickerplug').data('lasttime') - ); - } - - function closePickPlug (event) { - - if (($(event.target).parents('#pickerplug').length || - $(event.target).hasClass(markerClass)) && - !$(event.target).hasClass('ui-datepicker-close')) { - return; - } - - $('#pickerplug').hide('normal'); - $(this).unbind('click',closePickPlug); - $(this).unbind('keyup',parseTime); - $(this).removeClass(markerClass); - } - - }); - - } +// änderungen / 090521: +// OK beim einlesen im american mode zeit umrechnen +// OK datum einlesen +// OK beim ändern des input feldes widget anpassen / neu einlesen +// OK >> wenn keine stunde/minute angegeben ist 00 angeben +// OK sprache datepicker +// OK sprache durch parameter reingeben +// OK mehrere felder bedienen +// OK datepicker als klickbar machen + +/** fixes / 090521: + - convert widget time to am/pm if american mode is on + - show correct date from input + - on change at input field modify widget + - if there is no hour/minute given in input, show 00 + - start datepicker in given language + - new parameter for language + - able to work on many fields + - write date from datepicker +*/ +jQuery.fn.datetime = function() { + + var userLang = arguments[0]['userLang'] || 'en'; + var b24Hour = !(arguments[0]['americanMode'] || false); + var markerClass = 'hasDateTime'; + + return this.each(function(){ + + var datepicker_def = { + changeMonth: true, + changeYear: true, + dateFormat: js_date_format, + showButtonPanel: true, + onSelect: writeDate + }; + + var lang = {}; + + lang['en'] = { + time: 'Time', + hour: 'Hour', + minute: 'Minute', + close: 'Close' + }; + + lang['de'] = { + time: 'Zeit', + hour: 'Stunde', + minute: 'Minute', + close: 'Schließen' + }; + + $(this).data('sets',datepicker_def); + $(this).data('userLang',userLang); + $(this).data('b24Hour',b24Hour); + + function renderPickerPlug(b24Hour_,lang_) { + var loadedLang = lang[lang_] || lang['en']; + + if (!$('#pickerplug').length) { + + var htmlins = '
    '; + htmlins += '
  • '; + htmlins += '
    '; + htmlins += '
  • '; + htmlins += '
  • '; + htmlins += '
    '; + htmlins += '

    '; + htmlins += ' '; + htmlins += ' 00'; + htmlins += ' :'; + htmlins += ' 00'; + htmlins += ' am'; + htmlins += '

    '; + htmlins += '
      '; + htmlins += '
    • '; + htmlins += '

      '; + htmlins += '
      '; + htmlins += '
    • '; + htmlins += '
    • '; + htmlins += '

      '; + htmlins += '
      '; + htmlins += '
    • '; + htmlins += '
    '; + htmlins += '
    '; + htmlins += ''; + htmlins += '
  • '; + htmlins += '
'; + $('body').append(htmlins); + + $('#datepicker').datepicker(); + $(document).mousedown(closePickPlug); + $('#pickerplug .ui-datepicker-close').click(closePickPlug); + + // Slider + $('#hourSlider').slider({ + orientation: "vertical", + range: 'min', + min: 0, + max: 23, + step: 1, + slide: function(event, ui) { + writeDate(writeTime(ui.value,'hour'),'time'); + + }, + change: function(event, ui) { + $('#tpSelectedTime .selHrs').effect('highlight', 1000); + } + }); + // Slider + $('#minuteSlider').slider({ + orientation: "vertical", + range: 'min', + min: 0, + max: 55, + step: 5, + slide: function(event, ui) { + writeDate(writeTime(ui.value,'minute'),'time'); + }, + change: function(event, ui) { + $('#tpSelectedTime .selMins').effect('highlight', 1000); + } + }); + + //Inline editor bind + $('#tpSelectedTime .selHrs').keyup(function(e){ + if((e.which <= 57 && e.which >= 48) && ($(this).text() >=1 && $(this).text() <=12 ) ){ + //console.log("Which: "+e.which); + $('#hourSlider').slider('value', parseInt($(this).text())); + //console.log("Val: "+parseInt($(this).val())) + }else{ + $(this).val($(this).text().slice(0, -1)); + } + //if($(this).val() < 1){ + // $(this).val(1); + //} + }); + + //Inline editor bind + $('#tpSelectedTime .selMins').keyup(function(e){ + if((e.which <= 57 && e.which >= 48) && ($(this).text() >=0 && $(this).text() <=59 ) ){ + //console.log("Which: "+e.which); + $('#minuteSlider').slider('value', parseInt($(this).text())); + //console.log("Val: "+parseInt($(this).val())) + }else{ + $(this).text($(this).text().slice(0, -1)); + } + //if($(this).val() < 1){ + // $(this).val(1); + //} + }); + } + + $('.dayPeriod').toggle(!b24Hour); + $('#text_time').text(loadedLang['time']); + $('#text_hour').text(loadedLang['hour']); + $('#text_minute').text(loadedLang['minute']); + $('#text_close').text(loadedLang['close']); + + $('#pickerplug').data('userLang',lang_); + $('#pickerplug').data('b24Hour',b24Hour_); + } + + $(this).bind('focus',function(){ + + var top = $(this).offset().top+$(this).outerHeight(); + var left = $(this).offset().left; + + if ($(this).data('userLang') != $('#pickerplug').data('userLang') || + $(this).data('b24Hour') != $('#pickerplug').data('userLang') ) { + renderPickerPlug($(this).data('b24Hour'),$(this).data('userLang')); + } + + $('#pickerplug').css({ + left: left+'px', + top: top+'px' + }).show('normal'); + + if ($(this).data('userLang')!='en' && lang[$(this).data('userLang')]) { + $('#datepicker').datepicker('option', $.extend({}, + $.datepicker.regional[$(this).data('userLang')])); + $('#datepicker').datepicker('option', $.extend($(this).data('sets'))); + } else { + $('#datepicker').datepicker('option', $.extend({}, + $.datepicker.regional[''])); + $('#datepicker').datepicker('option', $.extend($(this).data('sets'))); + } + + parseTime(this); + + if ($('#pickerplug').css('display') == 'none') { + $('#pickerplug').show('normal'); + } + + $(this).bind('keyup',parseTime); + //$(this).bind('slider',writeTime); + + $(this).addClass(markerClass); + + $('#pickerplug').data('inputfield',this); + }); + + function parseTime (obj) { + if($(obj).val() != '') + var time = ($(obj).val() || $(this).val()).split(" "); + else + var time = ['00-00-00','00:00:00']; + + if (time.length < 2) { + time = ['00-00-00','00:00:00']; + } + + $('#pickerplug').data('lastdate',time[0]); //lastdate = time[0]; + $('#pickerplug').data('lasttime',time[1]); //lasttime = time[1]; + time = time[1].split(":"); + + if (time.length < 2) { + time = ['00','00','00']; + } + + var hour = time[0] || '00'; + var minute = time[1] || '00'; + + writeTime(hour,'hour'); + writeTime(minute,'minute'); + + $('#hourSlider').slider('option', 'value', hour); + $('#minuteSlider').slider('option', 'value', minute); + + var zero_string = "0"; + + if( $('#pickerplug').data('lastdate').charAt(0) != zero_string.charAt(0) ) + { + $('#datepicker').datepicker( 'setDate', + $.datepicker.parseDate( + datepicker_def['dateFormat'], + $('#pickerplug').data('lastdate') + ) + ); + } + else + { + $('#datepicker').datepicker( 'setDate', + $.datepicker.parseDate( + datepicker_def['dateFormat'], + '' + ) + ); + } + } + + function writeTime(fragment,type) { + var time = ''; + + switch (type) { + case 'hour': + var hours = parseInt(fragment,10); + + if (!$('#pickerplug').data('b24Hour') && hours > 11) { + hours -= 12; + $('.dayPeriod').text('pm'); + + } else if (!$('#pickerplug').data('b24Hour')) { + $('.dayPeriod').text('am'); + } + + if (hours < 10) { + hours = '0'.concat(hours); + } + if (fragment < 10) { + fragment = '0'.concat(parseInt(fragment)); + } + + $('#tpSelectedTime .selHrs').text(hours); + + time = fragment+':'+$('#tpSelectedTime .selMins').text(); + break; + case 'minute': + minutes = ((fragment < 10) ? '0' :'') + parseInt(fragment,10); + $('#tpSelectedTime .selMins').text(minutes); + + time = $('#hourSlider').slider('option', 'value')+':'+minutes; + break; + } + return time; + } + + function writeDate (text,type) { + + switch (type) { + case 'time': + $('#pickerplug').data('lasttime',text+':00'); + break; + default: + $('#pickerplug').data('lastdate',text); + } + $($('#pickerplug').data('inputfield')).val( + $('#pickerplug').data('lastdate')+' '+$('#pickerplug').data('lasttime') + ); + } + + function closePickPlug (event) { + + if (($(event.target).parents('#pickerplug').length || + $(event.target).hasClass(markerClass)) && + !$(event.target).hasClass('ui-datepicker-close')) { + return; + } + + $('#pickerplug').hide('normal'); + $(this).unbind('click',closePickPlug); + $(this).unbind('keyup',parseTime); + $(this).removeClass(markerClass); + } + + }); + + } diff --git a/assets/grocery_crud/js/jquery_plugins/jquery.uniform.js b/assets/grocery_crud/js/jquery_plugins/jquery.uniform.js index 60a6e2e..da0d85f 100755 --- a/assets/grocery_crud/js/jquery_plugins/jquery.uniform.js +++ b/assets/grocery_crud/js/jquery_plugins/jquery.uniform.js @@ -1,967 +1,967 @@ -/* - -Uniform v2.0.0 -Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC -http://pixelmatrixdesign.com - -Requires jQuery 1.3 or newer - -Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on -this. - -Disabling text selection is made possible by Mathias Bynens - and his noSelect plugin. -, which is embedded. - -Also, thanks to David Kaneda and Eugene Bond for their contributions to the -plugin. - -Tyler Akins has also rewritten chunks of the plugin, helped close many issues, -and ensured version 2 got out the door. - -License: -MIT License - http://www.opensource.org/licenses/mit-license.php - -Enjoy! - -*/ -/*global jQuery, window, document*/ - -(function ($, undef) { - "use strict"; - - /** - * Use .prop() if jQuery supports it, otherwise fall back to .attr() - * - * @param jQuery $el jQuery'd element on which we're calling attr/prop - * @param ... All other parameters are passed to jQuery's function - * @return The result from jQuery - */ - function attrOrProp($el) { - var args = Array.prototype.slice.call(arguments, 1); - - if ($el.prop) { - // jQuery 1.6+ - return $el.prop.apply($el, args); - } - - // jQuery 1.5 and below - return $el.attr.apply($el, args); - } - - /** - * For backwards compatibility with older jQuery libraries, only bind - * one thing at a time. Also, this function adds our namespace to - * events in one consistent location, shrinking the minified code. - * - * The properties on the events object are the names of the events - * that we are supposed to add to. It can be a space separated list. - * The namespace will be added automatically. - * - * @param jQuery $el - * @param Object options Uniform options for this element - * @param Object events Events to bind, properties are event names - */ - function bindMany($el, options, events) { - var name, namespaced; - - for (name in events) { - if (events.hasOwnProperty(name)) { - namespaced = name.replace(/ |$/g, options.eventNamespace); - $el.bind(name, events[name]); - } - } - } - - /** - * Bind the hover, active, focus, and blur UI updates - * - * @param jQuery $el Original element - * @param jQuery $target Target for the events (our div/span) - * @param Object options Uniform options for the element $target - */ - function bindUi($el, $target, options) { - bindMany($el, options, { - focus: function () { - $target.addClass(options.focusClass); - }, - blur: function () { - $target.removeClass(options.focusClass); - $target.removeClass(options.activeClass); - }, - mouseenter: function () { - $target.addClass(options.hoverClass); - }, - mouseleave: function () { - $target.removeClass(options.hoverClass); - $target.removeClass(options.activeClass); - }, - "mousedown touchbegin": function () { - if (!$el.is(":disabled")) { - $target.addClass(options.activeClass); - } - }, - "mouseup touchend": function () { - $target.removeClass(options.activeClass); - } - }); - } - - /** - * Remove the hover, focus, active classes. - * - * @param jQuery $el Element with classes - * @param Object options Uniform options for the element - */ - function classClearStandard($el, options) { - $el.removeClass(options.hoverClass + " " + options.focusClass + " " + options.activeClass); - } - - /** - * Add or remove a class, depending on if it's "enabled" - * - * @param jQuery $el Element that has the class added/removed - * @param String className Class or classes to add/remove - * @param Boolean enabled True to add the class, false to remove - */ - function classUpdate($el, className, enabled) { - if (enabled) { - $el.addClass(className); - } else { - $el.removeClass(className); - } - } - - /** - * Updating the "checked" property can be a little tricky. This - * changed in jQuery 1.6 and now we can pass booleans to .prop(). - * Prior to that, one either adds an attribute ("checked=checked") or - * removes the attribute. - * - * @param jQuery $tag Our Uniform span/div - * @param jQuery $el Original form element - * @param Object options Uniform options for this element - */ - function classUpdateChecked($tag, $el, options) { - var c = "checked", - isChecked = $el.is(":" + c); - - if ($el.prop) { - // jQuery 1.6+ - $el.prop(c, isChecked); - } else { - // jQuery 1.5 and below - if (isChecked) { - $el.attr(c, c); - } else { - $el.removeAttr(c); - } - } - - classUpdate($tag, options.checkedClass, isChecked); - } - - /** - * Set or remove the "disabled" class for disabled elements, based on - * if the - * - * @param jQuery $tag Our Uniform span/div - * @param jQuery $el Original form element - * @param Object options Uniform options for this element - */ - function classUpdateDisabled($tag, $el, options) { - classUpdate($tag, options.disabledClass, $el.is(":disabled")); - } - - /** - * Wrap an element inside of a container or put the container next - * to the element. See the code for examples of the different methods. - * - * Returns the container that was added to the HTML. - * - * @param jQuery $el Element to wrap - * @param jQuery $container Add this new container around/near $el - * @param String method One of "after", "before" or "wrap" - * @return $container after it has been cloned for adding to $el - */ - function divSpanWrap($el, $container, method) { - switch (method) { - case "after": - // Result: - $el.after($container); - return $el.next(); - case "before": - // Result: - $el.before($container); - return $el.prev(); - case "wrap": - // Result: - $el.wrap($container); - return $el.parent(); - } - - return null; - } - - /** - * Create a div/span combo for uniforming an element - * - * @param jQuery $el Element to wrap - * @param Object options Options for the element, set by the user - * @param Object divSpanConfig Options for how we wrap the div/span - * @return Object Contains the div and span as properties - */ - function divSpan($el, options, divSpanConfig) { - var $div, $span, id; - - if (!divSpanConfig) { - divSpanConfig = {}; - } - - divSpanConfig = $.extend({ - bind: {}, - divClass: null, - divWrap: "wrap", - spanClass: null, - spanHtml: null, - spanWrap: "wrap" - }, divSpanConfig); - - $div = $('
'); - $span = $(''); - - // Automatically hide this div/span if the element is hidden. - // Do not hide if the element is hidden because a parent is hidden. - if (options.autoHide && $el.is(':hidden') && $el.css('display') === 'none') { - $div.hide(); - } - - if (divSpanConfig.divClass) { - $div.addClass(divSpanConfig.divClass); - } - - if (divSpanConfig.spanClass) { - $span.addClass(divSpanConfig.spanClass); - } - - id = attrOrProp($el, 'id'); - - if (options.useID && id) { - attrOrProp($div, 'id', options.idPrefix + '-' + id); - } - - if (divSpanConfig.spanHtml) { - $span.html(divSpanConfig.spanHtml); - } - - $div = divSpanWrap($el, $div, divSpanConfig.divWrap); - $span = divSpanWrap($el, $span, divSpanConfig.spanWrap); - classUpdateDisabled($div, $el, options); - return { - div: $div, - span: $span - }; - } - - - /** - * Test if high contrast mode is enabled. - * - * In high contrast mode, background images can not be set and - * they are always returned as 'none'. - * - * @return boolean True if in high contrast mode - */ - function highContrast() { - var c, $div, el, rgb; - - // High contrast mode deals with white and black - rgb = 'rgb(120,2,153)'; - $div = $('
'); - $('body').append($div); - el = $div.get(0); - - // $div.css() will get the style definition, not - // the actually displaying style - if (window.getComputedStyle) { - c = window.getComputedStyle(el, '').color; - } else { - c = (el.currentStyle || el.style || {}).color; - } - - $div.remove(); - return c.replace(/ /g, '') !== rgb; - } - - - /** - * Change text into safe HTML - * - * @param String text - * @return String HTML version - */ - function htmlify(text) { - if (!text) { - return ""; - } - - return $('').text(text).html(); - } - - /** - * Test if the element is a multiselect - * - * @param jQuery $el Element - * @return boolean true/false - */ - function isMultiselect($el) { - var elSize; - - if ($el[0].multiple) { - return true; - } - - elSize = attrOrProp($el, "size"); - - if (!elSize || elSize <= 1) { - return false; - } - - return true; - } - - /** - * Meaningless utility function. Used mostly for improving minification. - * - * @return false - */ - function returnFalse() { - return false; - } - - /** - * noSelect plugin, very slightly modified - * http://mths.be/noselect v1.0.3 - * - * @param jQuery $elem Element that we don't want to select - * @param Object options Uniform options for the element - */ - function noSelect($elem, options) { - var none = 'none'; - bindMany($elem, options, { - 'selectstart dragstart mousedown': returnFalse - }); - - $elem.css({ - MozUserSelect: none, - msUserSelect: none, - webkitUserSelect: none, - userSelect: none - }); - } - - /** - * Updates the filename tag based on the value of the real input - * element. - * - * @param jQuery $el Actual form element - * @param jQuery $filenameTag Span/div to update - * @param Object options Uniform options for this element - */ - function setFilename($el, $filenameTag, options) { - var filename = $el.val(); - - if (filename === "") { - filename = options.fileDefaultHtml; - } else { - filename = filename.split(/[\/\\]+/); - filename = filename[(filename.length - 1)]; - } - - $filenameTag.text(filename); - } - - - /** - * Function from jQuery to swap some CSS values, run a callback, - * then restore the CSS. Modified to pass JSLint and handle undefined - * values with 'use strict'. - * - * @param jQuery $el Element - * @param object newCss CSS values to swap out - * @param Function callback Function to run - */ - function swap($el, newCss, callback) { - var restore, item; - - restore = []; - - $el.each(function () { - var name; - - for (name in newCss) { - if (Object.prototype.hasOwnProperty.call(newCss, name)) { - restore.push({ - el: this, - name: name, - old: this.style[name] - }); - - this.style[name] = newCss[name]; - } - } - }); - - callback(); - - while (restore.length) { - item = restore.pop(); - item.el.style[item.name] = item.old; - } - } - - - /** - * The browser doesn't provide sizes of elements that are not visible. - * This will clone an element and add it to the DOM for calculations. - * - * @param jQuery $el - * @param String method - */ - function sizingInvisible($el, callback) { - swap($el.parents().andSelf().not(':visible'), { - visibility: "hidden", - display: "block", - position: "absolute" - }, callback); - } - - - /** - * Standard way to unwrap the div/span combination from an element - * - * @param jQuery $el Element that we wish to preserve - * @param Object options Uniform options for the element - * @return Function This generated function will perform the given work - */ - function unwrapUnwrapUnbindFunction($el, options) { - return function () { - $el.unwrap().unwrap().unbind(options.eventNamespace); - }; - } - - var allowStyling = true, // False if IE6 or other unsupported browsers - highContrastTest = false, // Was the high contrast test ran? - uniformHandlers = [ // Objects that take care of "unification" - { - // Buttons - match: function ($el) { - return $el.is("a, button, :submit, :reset, input[type='button']"); - }, - apply: function ($el, options) { - var $div, defaultSpanHtml, ds, getHtml, doingClickEvent; - defaultSpanHtml = options.submitDefaultHtml; - - if ($el.is(":reset")) { - defaultSpanHtml = options.resetDefaultHtml; - } - - if ($el.is("a, button")) { - // Use the HTML inside the tag - getHtml = function () { - return $el.html() || defaultSpanHtml; - }; - } else { - // Use the value property of the element - getHtml = function () { - return htmlify(attrOrProp($el, "value")) || defaultSpanHtml; - }; - } - - ds = divSpan($el, options, { - divClass: options.buttonClass, - spanHtml: getHtml() - }); - $div = ds.div; - bindUi($el, $div, options); - doingClickEvent = false; - bindMany($div, options, { - "click touchend": function () { - var ev, res, target, href; - - if (doingClickEvent) { - return; - } - - doingClickEvent = true; - - if ($el[0].dispatchEvent) { - ev = document.createEvent("MouseEvents"); - ev.initEvent("click", true, true); - res = $el[0].dispatchEvent(ev); - - // What about Chrome and Opera? - // Should the browser check be removed? - if ((jQuery.browser.msie || jQuery.browser.mozilla) && $el.is('a') && res) { - target = attrOrProp($el, 'target'); - href = attrOrProp($el, 'href'); - - if (!target || target === '_self') { - document.location.href = href; - } else { - window.open(href, target); - } - } - } else { - $el.click(); - } - - doingClickEvent = false; - } - }); - noSelect($div, options); - return { - remove: function () { - // Move $el out - $div.after($el); - - // Remove div and span - $div.remove(); - - // Unbind events - $el.unbind(options.eventNamespace); - return $el; - }, - update: function () { - classClearStandard($div, options); - classUpdateDisabled($div, $el, options); - ds.span.html(getHtml()); - } - }; - } - }, - { - // Checkboxes - match: function ($el) { - return $el.is(":checkbox"); - }, - apply: function ($el, options) { - var ds, $div, $span; - ds = divSpan($el, options, { - divClass: options.checkboxClass - }); - $div = ds.div; - $span = ds.span; - - // Add focus classes, toggling, active, etc. - bindUi($el, $div, options); - bindMany($el, options, { - "click touchend": function () { - classUpdateChecked($span, $el, options); - } - }); - classUpdateChecked($span, $el, options); - return { - remove: unwrapUnwrapUnbindFunction($el, options), - update: function () { - classClearStandard($div, options); - $span.removeClass(options.checkedClass); - classUpdateChecked($span, $el, options); - classUpdateDisabled($div, $el, options); - } - }; - } - }, - { - // File selection / uploads - match: function ($el) { - return $el.is(":file"); - }, - apply: function ($el, options) { - var ds, $div, $filename, $button; - - // The "span" is the button - ds = divSpan($el, options, { - divClass: options.fileClass, - spanClass: options.fileButtonClass, - spanHtml: options.fileButtonHtml, - spanWrap: "after" - }); - $div = ds.div; - $button = ds.span; - $filename = $("").html(options.fileDefaultHtml); - $filename.addClass(options.filenameClass); - $filename = divSpanWrap($el, $filename, "after"); - - // Set the size - if (!attrOrProp($el, "size")) { - attrOrProp($el, "size", $div.width() / 10); - } - - // Actions - function filenameUpdate() { - setFilename($el, $filename, options); - } - - bindUi($el, $div, options); - - // Account for input saved across refreshes - filenameUpdate(); - - // IE7 doesn't fire onChange until blur or second fire. - if ($.browser.msie) { - // IE considers browser chrome blocking I/O, so it - // suspends tiemouts until after the file has - // been selected. - bindMany($el, options, { - click: function () { - $el.trigger("change"); - setTimeout(filenameUpdate, 0); - } - }); - } else { - // All other browsers behave properly - bindMany($el, options, { - change: filenameUpdate - }); - } - - noSelect($filename, options); - noSelect($button, options); - return { - remove: function () { - // Remove filename and button - $filename.remove(); - $button.remove(); - - // Unwrap parent div, remove events - return $el.unwrap().unbind(options.eventNamespace); - }, - update: function () { - classClearStandard($div, options); - setFilename($el, $filename, options); - classUpdateDisabled($div, $el, options); - } - }; - } - }, - { - // Input fields (text) - match: function ($el) { - if ($el.is("input")) { - var t = (" " + attrOrProp($el, "type") + " ").toLowerCase(), - allowed = " color date datetime datetime-local email month number password search tel text time url week "; - return allowed.indexOf(t) >= 0; - } - - return false; - }, - apply: function ($el) { - var elType = attrOrProp($el, "type"); - $el.addClass(elType); - return { - remove: function () { - $el.removeClass(elType); - }, - update: returnFalse - }; - } - }, - { - // Radio buttons - match: function ($el) { - return $el.is(":radio"); - }, - apply: function ($el, options) { - var ds, $div, $span; - ds = divSpan($el, options, { - divClass: options.radioClass - }); - $div = ds.div; - $span = ds.span; - - // Add classes for focus, handle active, checked - bindUi($el, $div, options); - bindMany($el, options, { - "click touchend": function () { - // Find all radios with the same name, then update - // them with $.uniform.update() so the right - // per-element options are used - $.uniform.update($(':radio[name="' + attrOrProp($el, "name") + '"]')); - } - }); - classUpdateChecked($span, $el, options); - return { - remove: unwrapUnwrapUnbindFunction($el, options), - update: function () { - classClearStandard($div, options); - classUpdateChecked($span, $el, options); - classUpdateDisabled($div, $el, options); - } - }; - } - }, - { - // Select lists, but do not style multiselects here - match: function ($el) { - if ($el.is("select") && !isMultiselect($el)) { - return true; - } - - return false; - }, - apply: function ($el, options) { - var ds, $div, $span, origElemWidth; - - if (options.selectAutoWidth) { - sizingInvisible($el, function () { - origElemWidth = $el.width(); - }); - } - - ds = divSpan($el, options, { - divClass: options.selectClass, - spanHtml: ($el.find(":selected:first") || $el.find("option:first")).html(), - spanWrap: "before" - }); - $div = ds.div; - $span = ds.span; - - if (options.selectAutoWidth) { - // Use the width of the select and adjust the - // span and div accordingly - sizingInvisible($el, function () { - var spanPad; - spanPad = $span.outerWidth() - $span.width(); - $div.width(origElemWidth + spanPad); - $span.width(origElemWidth); - }); - } else { - // Force the select to fill the size of the div - $div.addClass('fixedWidth'); - } - - // Take care of events - bindUi($el, $div, options); - bindMany($el, options, { - change: function () { - $span.html($el.find(":selected").html()); - $div.removeClass(options.activeClass); - }, - "click touchend": function () { - // IE7 and IE8 may not update the value right - // until after click event - issue #238 - var selHtml = $el.find(":selected").html(); - - if ($span.html() !== selHtml) { - // Change was detected - // Fire the change event on the select tag - $el.trigger('change'); - } - }, - keyup: function () { - $span.html($el.find(":selected").html()); - } - }); - noSelect($span, options); - return { - remove: function () { - // Remove sibling span - $span.remove(); - - // Unwrap parent div - $el.unwrap().unbind(options.eventNamespace); - return $el; - }, - update: function () { - if (options.selectAutoWidth) { - // Easier to remove and reapply formatting - $.uniform.restore($el); - $el.uniform(options); - } else { - classClearStandard($div, options); - - // Reset current selected text - $span.html($el.find(":selected").html()); - classUpdateDisabled($div, $el, options); - } - } - }; - } - }, - { - // Select lists - multiselect lists only - match: function ($el) { - if ($el.is("select") && isMultiselect($el)) { - return true; - } - - return false; - }, - apply: function ($el, options) { - $el.addClass(options.selectMultiClass); - return { - remove: function () { - $el.removeClass(options.selectMultiClass); - }, - update: returnFalse - }; - } - }, - { - // Textareas - match: function ($el) { - return $el.is("textarea"); - }, - apply: function ($el, options) { - $el.addClass(options.textareaClass); - return { - remove: function () { - $el.removeClass(options.textareaClass); - }, - update: returnFalse - }; - } - } - ]; - - // IE6 can't be styled - can't set opacity on select - if ($.browser.msie && $.browser.version < 7) { - allowStyling = false; - } - - $.uniform = { - // Default options that can be overridden globally or when uniformed - // globally: $.uniform.defaults.fileButtonHtml = "Pick A File"; - // on uniform: $('input').uniform({fileButtonHtml: "Pick a File"}); - defaults: { - activeClass: "active", - autoHide: true, - buttonClass: "button", - checkboxClass: "checker", - checkedClass: "checked", - disabledClass: "disabled", - eventNamespace: ".uniform", - fileButtonClass: "action", - fileButtonHtml: "Choose File", - fileClass: "uploader", - fileDefaultHtml: "No file selected", - filenameClass: "filename", - focusClass: "focus", - hoverClass: "hover", - idPrefix: "uniform", - radioClass: "radio", - resetDefaultHtml: "Reset", - resetSelector: false, // We'll use our own function when you don't specify one - selectAutoWidth: true, - selectClass: "selector", - selectMultiClass: "uniform-multiselect", - submitDefaultHtml: "Submit", // Only text allowed - textareaClass: "uniform", - useID: true - }, - - // All uniformed elements - DOM objects - elements: [] - }; - - $.fn.uniform = function (options) { - var el = this; - options = $.extend({}, $.uniform.defaults, options); - - // If we are in high contrast mode, do not allow styling - if (!highContrastTest) { - highContrastTest = true; - - if (highContrast()) { - allowStyling = false; - } - } - - // Only uniform on browsers that work - if (!allowStyling) { - return this; - } - - // Code for specifying a reset button - if (options.resetSelector) { - $(options.resetSelector).mouseup(function () { - window.setTimeout(function () { - $.uniform.update(el); - }, 10); - }); - } - - return this.each(function () { - var $el = $(this), i, handler, callbacks; - - // Avoid uniforming elements already uniformed - just update - if ($el.data("uniformed")) { - $.uniform.update($el); - return; - } - - // See if we have any handler for this type of element - for (i = 0; i < uniformHandlers.length; i = i + 1) { - handler = uniformHandlers[i]; - - if (handler.match($el, options)) { - callbacks = handler.apply($el, options); - $el.data("uniformed", callbacks); - - // Store element in our global array - $.uniform.elements.push($el.get(0)); - return; - } - } - - // Could not style this element - }); - }; - - $.uniform.restore = $.fn.uniform.restore = function (elem) { - if (elem === undef) { - elem = $.uniform.elements; - } - - $(elem).each(function () { - var $el = $(this), index, elementData; - elementData = $el.data("uniformed"); - - // Skip elements that are not uniformed - if (!elementData) { - return; - } - - // Unbind events, remove additional markup that was added - elementData.remove(); - - // Remove item from list of uniformed elements - index = $.inArray(this, $.uniform.elements); - - if (index >= 0) { - $.uniform.elements.splice(index, 1); - } - - $el.removeData("uniformed"); - }); - }; - - $.uniform.update = $.fn.uniform.update = function (elem) { - if (elem === undef) { - elem = $.uniform.elements; - } - - $(elem).each(function () { - var $el = $(this), elementData; - elementData = $el.data("uniformed"); - - // Skip elements that are not uniformed - if (!elementData) { - return; - } - - elementData.update($el, elementData.options); - }); - }; -}(jQuery)); +/* + +Uniform v2.0.0 +Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC +http://pixelmatrixdesign.com + +Requires jQuery 1.3 or newer + +Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on +this. + +Disabling text selection is made possible by Mathias Bynens + and his noSelect plugin. +, which is embedded. + +Also, thanks to David Kaneda and Eugene Bond for their contributions to the +plugin. + +Tyler Akins has also rewritten chunks of the plugin, helped close many issues, +and ensured version 2 got out the door. + +License: +MIT License - http://www.opensource.org/licenses/mit-license.php + +Enjoy! + +*/ +/*global jQuery, window, document*/ + +(function ($, undef) { + "use strict"; + + /** + * Use .prop() if jQuery supports it, otherwise fall back to .attr() + * + * @param jQuery $el jQuery'd element on which we're calling attr/prop + * @param ... All other parameters are passed to jQuery's function + * @return The result from jQuery + */ + function attrOrProp($el) { + var args = Array.prototype.slice.call(arguments, 1); + + if ($el.prop) { + // jQuery 1.6+ + return $el.prop.apply($el, args); + } + + // jQuery 1.5 and below + return $el.attr.apply($el, args); + } + + /** + * For backwards compatibility with older jQuery libraries, only bind + * one thing at a time. Also, this function adds our namespace to + * events in one consistent location, shrinking the minified code. + * + * The properties on the events object are the names of the events + * that we are supposed to add to. It can be a space separated list. + * The namespace will be added automatically. + * + * @param jQuery $el + * @param Object options Uniform options for this element + * @param Object events Events to bind, properties are event names + */ + function bindMany($el, options, events) { + var name, namespaced; + + for (name in events) { + if (events.hasOwnProperty(name)) { + namespaced = name.replace(/ |$/g, options.eventNamespace); + $el.bind(name, events[name]); + } + } + } + + /** + * Bind the hover, active, focus, and blur UI updates + * + * @param jQuery $el Original element + * @param jQuery $target Target for the events (our div/span) + * @param Object options Uniform options for the element $target + */ + function bindUi($el, $target, options) { + bindMany($el, options, { + focus: function () { + $target.addClass(options.focusClass); + }, + blur: function () { + $target.removeClass(options.focusClass); + $target.removeClass(options.activeClass); + }, + mouseenter: function () { + $target.addClass(options.hoverClass); + }, + mouseleave: function () { + $target.removeClass(options.hoverClass); + $target.removeClass(options.activeClass); + }, + "mousedown touchbegin": function () { + if (!$el.is(":disabled")) { + $target.addClass(options.activeClass); + } + }, + "mouseup touchend": function () { + $target.removeClass(options.activeClass); + } + }); + } + + /** + * Remove the hover, focus, active classes. + * + * @param jQuery $el Element with classes + * @param Object options Uniform options for the element + */ + function classClearStandard($el, options) { + $el.removeClass(options.hoverClass + " " + options.focusClass + " " + options.activeClass); + } + + /** + * Add or remove a class, depending on if it's "enabled" + * + * @param jQuery $el Element that has the class added/removed + * @param String className Class or classes to add/remove + * @param Boolean enabled True to add the class, false to remove + */ + function classUpdate($el, className, enabled) { + if (enabled) { + $el.addClass(className); + } else { + $el.removeClass(className); + } + } + + /** + * Updating the "checked" property can be a little tricky. This + * changed in jQuery 1.6 and now we can pass booleans to .prop(). + * Prior to that, one either adds an attribute ("checked=checked") or + * removes the attribute. + * + * @param jQuery $tag Our Uniform span/div + * @param jQuery $el Original form element + * @param Object options Uniform options for this element + */ + function classUpdateChecked($tag, $el, options) { + var c = "checked", + isChecked = $el.is(":" + c); + + if ($el.prop) { + // jQuery 1.6+ + $el.prop(c, isChecked); + } else { + // jQuery 1.5 and below + if (isChecked) { + $el.attr(c, c); + } else { + $el.removeAttr(c); + } + } + + classUpdate($tag, options.checkedClass, isChecked); + } + + /** + * Set or remove the "disabled" class for disabled elements, based on + * if the + * + * @param jQuery $tag Our Uniform span/div + * @param jQuery $el Original form element + * @param Object options Uniform options for this element + */ + function classUpdateDisabled($tag, $el, options) { + classUpdate($tag, options.disabledClass, $el.is(":disabled")); + } + + /** + * Wrap an element inside of a container or put the container next + * to the element. See the code for examples of the different methods. + * + * Returns the container that was added to the HTML. + * + * @param jQuery $el Element to wrap + * @param jQuery $container Add this new container around/near $el + * @param String method One of "after", "before" or "wrap" + * @return $container after it has been cloned for adding to $el + */ + function divSpanWrap($el, $container, method) { + switch (method) { + case "after": + // Result: + $el.after($container); + return $el.next(); + case "before": + // Result: + $el.before($container); + return $el.prev(); + case "wrap": + // Result: + $el.wrap($container); + return $el.parent(); + } + + return null; + } + + /** + * Create a div/span combo for uniforming an element + * + * @param jQuery $el Element to wrap + * @param Object options Options for the element, set by the user + * @param Object divSpanConfig Options for how we wrap the div/span + * @return Object Contains the div and span as properties + */ + function divSpan($el, options, divSpanConfig) { + var $div, $span, id; + + if (!divSpanConfig) { + divSpanConfig = {}; + } + + divSpanConfig = $.extend({ + bind: {}, + divClass: null, + divWrap: "wrap", + spanClass: null, + spanHtml: null, + spanWrap: "wrap" + }, divSpanConfig); + + $div = $('
'); + $span = $(''); + + // Automatically hide this div/span if the element is hidden. + // Do not hide if the element is hidden because a parent is hidden. + if (options.autoHide && $el.is(':hidden') && $el.css('display') === 'none') { + $div.hide(); + } + + if (divSpanConfig.divClass) { + $div.addClass(divSpanConfig.divClass); + } + + if (divSpanConfig.spanClass) { + $span.addClass(divSpanConfig.spanClass); + } + + id = attrOrProp($el, 'id'); + + if (options.useID && id) { + attrOrProp($div, 'id', options.idPrefix + '-' + id); + } + + if (divSpanConfig.spanHtml) { + $span.html(divSpanConfig.spanHtml); + } + + $div = divSpanWrap($el, $div, divSpanConfig.divWrap); + $span = divSpanWrap($el, $span, divSpanConfig.spanWrap); + classUpdateDisabled($div, $el, options); + return { + div: $div, + span: $span + }; + } + + + /** + * Test if high contrast mode is enabled. + * + * In high contrast mode, background images can not be set and + * they are always returned as 'none'. + * + * @return boolean True if in high contrast mode + */ + function highContrast() { + var c, $div, el, rgb; + + // High contrast mode deals with white and black + rgb = 'rgb(120,2,153)'; + $div = $('
'); + $('body').append($div); + el = $div.get(0); + + // $div.css() will get the style definition, not + // the actually displaying style + if (window.getComputedStyle) { + c = window.getComputedStyle(el, '').color; + } else { + c = (el.currentStyle || el.style || {}).color; + } + + $div.remove(); + return c.replace(/ /g, '') !== rgb; + } + + + /** + * Change text into safe HTML + * + * @param String text + * @return String HTML version + */ + function htmlify(text) { + if (!text) { + return ""; + } + + return $('').text(text).html(); + } + + /** + * Test if the element is a multiselect + * + * @param jQuery $el Element + * @return boolean true/false + */ + function isMultiselect($el) { + var elSize; + + if ($el[0].multiple) { + return true; + } + + elSize = attrOrProp($el, "size"); + + if (!elSize || elSize <= 1) { + return false; + } + + return true; + } + + /** + * Meaningless utility function. Used mostly for improving minification. + * + * @return false + */ + function returnFalse() { + return false; + } + + /** + * noSelect plugin, very slightly modified + * http://mths.be/noselect v1.0.3 + * + * @param jQuery $elem Element that we don't want to select + * @param Object options Uniform options for the element + */ + function noSelect($elem, options) { + var none = 'none'; + bindMany($elem, options, { + 'selectstart dragstart mousedown': returnFalse + }); + + $elem.css({ + MozUserSelect: none, + msUserSelect: none, + webkitUserSelect: none, + userSelect: none + }); + } + + /** + * Updates the filename tag based on the value of the real input + * element. + * + * @param jQuery $el Actual form element + * @param jQuery $filenameTag Span/div to update + * @param Object options Uniform options for this element + */ + function setFilename($el, $filenameTag, options) { + var filename = $el.val(); + + if (filename === "") { + filename = options.fileDefaultHtml; + } else { + filename = filename.split(/[\/\\]+/); + filename = filename[(filename.length - 1)]; + } + + $filenameTag.text(filename); + } + + + /** + * Function from jQuery to swap some CSS values, run a callback, + * then restore the CSS. Modified to pass JSLint and handle undefined + * values with 'use strict'. + * + * @param jQuery $el Element + * @param object newCss CSS values to swap out + * @param Function callback Function to run + */ + function swap($el, newCss, callback) { + var restore, item; + + restore = []; + + $el.each(function () { + var name; + + for (name in newCss) { + if (Object.prototype.hasOwnProperty.call(newCss, name)) { + restore.push({ + el: this, + name: name, + old: this.style[name] + }); + + this.style[name] = newCss[name]; + } + } + }); + + callback(); + + while (restore.length) { + item = restore.pop(); + item.el.style[item.name] = item.old; + } + } + + + /** + * The browser doesn't provide sizes of elements that are not visible. + * This will clone an element and add it to the DOM for calculations. + * + * @param jQuery $el + * @param String method + */ + function sizingInvisible($el, callback) { + swap($el.parents().andSelf().not(':visible'), { + visibility: "hidden", + display: "block", + position: "absolute" + }, callback); + } + + + /** + * Standard way to unwrap the div/span combination from an element + * + * @param jQuery $el Element that we wish to preserve + * @param Object options Uniform options for the element + * @return Function This generated function will perform the given work + */ + function unwrapUnwrapUnbindFunction($el, options) { + return function () { + $el.unwrap().unwrap().unbind(options.eventNamespace); + }; + } + + var allowStyling = true, // False if IE6 or other unsupported browsers + highContrastTest = false, // Was the high contrast test ran? + uniformHandlers = [ // Objects that take care of "unification" + { + // Buttons + match: function ($el) { + return $el.is("a, button, :submit, :reset, input[type='button']"); + }, + apply: function ($el, options) { + var $div, defaultSpanHtml, ds, getHtml, doingClickEvent; + defaultSpanHtml = options.submitDefaultHtml; + + if ($el.is(":reset")) { + defaultSpanHtml = options.resetDefaultHtml; + } + + if ($el.is("a, button")) { + // Use the HTML inside the tag + getHtml = function () { + return $el.html() || defaultSpanHtml; + }; + } else { + // Use the value property of the element + getHtml = function () { + return htmlify(attrOrProp($el, "value")) || defaultSpanHtml; + }; + } + + ds = divSpan($el, options, { + divClass: options.buttonClass, + spanHtml: getHtml() + }); + $div = ds.div; + bindUi($el, $div, options); + doingClickEvent = false; + bindMany($div, options, { + "click touchend": function () { + var ev, res, target, href; + + if (doingClickEvent) { + return; + } + + doingClickEvent = true; + + if ($el[0].dispatchEvent) { + ev = document.createEvent("MouseEvents"); + ev.initEvent("click", true, true); + res = $el[0].dispatchEvent(ev); + + // What about Chrome and Opera? + // Should the browser check be removed? + if ((jQuery.browser.msie || jQuery.browser.mozilla) && $el.is('a') && res) { + target = attrOrProp($el, 'target'); + href = attrOrProp($el, 'href'); + + if (!target || target === '_self') { + document.location.href = href; + } else { + window.open(href, target); + } + } + } else { + $el.click(); + } + + doingClickEvent = false; + } + }); + noSelect($div, options); + return { + remove: function () { + // Move $el out + $div.after($el); + + // Remove div and span + $div.remove(); + + // Unbind events + $el.unbind(options.eventNamespace); + return $el; + }, + update: function () { + classClearStandard($div, options); + classUpdateDisabled($div, $el, options); + ds.span.html(getHtml()); + } + }; + } + }, + { + // Checkboxes + match: function ($el) { + return $el.is(":checkbox"); + }, + apply: function ($el, options) { + var ds, $div, $span; + ds = divSpan($el, options, { + divClass: options.checkboxClass + }); + $div = ds.div; + $span = ds.span; + + // Add focus classes, toggling, active, etc. + bindUi($el, $div, options); + bindMany($el, options, { + "click touchend": function () { + classUpdateChecked($span, $el, options); + } + }); + classUpdateChecked($span, $el, options); + return { + remove: unwrapUnwrapUnbindFunction($el, options), + update: function () { + classClearStandard($div, options); + $span.removeClass(options.checkedClass); + classUpdateChecked($span, $el, options); + classUpdateDisabled($div, $el, options); + } + }; + } + }, + { + // File selection / uploads + match: function ($el) { + return $el.is(":file"); + }, + apply: function ($el, options) { + var ds, $div, $filename, $button; + + // The "span" is the button + ds = divSpan($el, options, { + divClass: options.fileClass, + spanClass: options.fileButtonClass, + spanHtml: options.fileButtonHtml, + spanWrap: "after" + }); + $div = ds.div; + $button = ds.span; + $filename = $("").html(options.fileDefaultHtml); + $filename.addClass(options.filenameClass); + $filename = divSpanWrap($el, $filename, "after"); + + // Set the size + if (!attrOrProp($el, "size")) { + attrOrProp($el, "size", $div.width() / 10); + } + + // Actions + function filenameUpdate() { + setFilename($el, $filename, options); + } + + bindUi($el, $div, options); + + // Account for input saved across refreshes + filenameUpdate(); + + // IE7 doesn't fire onChange until blur or second fire. + if ($.browser.msie) { + // IE considers browser chrome blocking I/O, so it + // suspends tiemouts until after the file has + // been selected. + bindMany($el, options, { + click: function () { + $el.trigger("change"); + setTimeout(filenameUpdate, 0); + } + }); + } else { + // All other browsers behave properly + bindMany($el, options, { + change: filenameUpdate + }); + } + + noSelect($filename, options); + noSelect($button, options); + return { + remove: function () { + // Remove filename and button + $filename.remove(); + $button.remove(); + + // Unwrap parent div, remove events + return $el.unwrap().unbind(options.eventNamespace); + }, + update: function () { + classClearStandard($div, options); + setFilename($el, $filename, options); + classUpdateDisabled($div, $el, options); + } + }; + } + }, + { + // Input fields (text) + match: function ($el) { + if ($el.is("input")) { + var t = (" " + attrOrProp($el, "type") + " ").toLowerCase(), + allowed = " color date datetime datetime-local email month number password search tel text time url week "; + return allowed.indexOf(t) >= 0; + } + + return false; + }, + apply: function ($el) { + var elType = attrOrProp($el, "type"); + $el.addClass(elType); + return { + remove: function () { + $el.removeClass(elType); + }, + update: returnFalse + }; + } + }, + { + // Radio buttons + match: function ($el) { + return $el.is(":radio"); + }, + apply: function ($el, options) { + var ds, $div, $span; + ds = divSpan($el, options, { + divClass: options.radioClass + }); + $div = ds.div; + $span = ds.span; + + // Add classes for focus, handle active, checked + bindUi($el, $div, options); + bindMany($el, options, { + "click touchend": function () { + // Find all radios with the same name, then update + // them with $.uniform.update() so the right + // per-element options are used + $.uniform.update($(':radio[name="' + attrOrProp($el, "name") + '"]')); + } + }); + classUpdateChecked($span, $el, options); + return { + remove: unwrapUnwrapUnbindFunction($el, options), + update: function () { + classClearStandard($div, options); + classUpdateChecked($span, $el, options); + classUpdateDisabled($div, $el, options); + } + }; + } + }, + { + // Select lists, but do not style multiselects here + match: function ($el) { + if ($el.is("select") && !isMultiselect($el)) { + return true; + } + + return false; + }, + apply: function ($el, options) { + var ds, $div, $span, origElemWidth; + + if (options.selectAutoWidth) { + sizingInvisible($el, function () { + origElemWidth = $el.width(); + }); + } + + ds = divSpan($el, options, { + divClass: options.selectClass, + spanHtml: ($el.find(":selected:first") || $el.find("option:first")).html(), + spanWrap: "before" + }); + $div = ds.div; + $span = ds.span; + + if (options.selectAutoWidth) { + // Use the width of the select and adjust the + // span and div accordingly + sizingInvisible($el, function () { + var spanPad; + spanPad = $span.outerWidth() - $span.width(); + $div.width(origElemWidth + spanPad); + $span.width(origElemWidth); + }); + } else { + // Force the select to fill the size of the div + $div.addClass('fixedWidth'); + } + + // Take care of events + bindUi($el, $div, options); + bindMany($el, options, { + change: function () { + $span.html($el.find(":selected").html()); + $div.removeClass(options.activeClass); + }, + "click touchend": function () { + // IE7 and IE8 may not update the value right + // until after click event - issue #238 + var selHtml = $el.find(":selected").html(); + + if ($span.html() !== selHtml) { + // Change was detected + // Fire the change event on the select tag + $el.trigger('change'); + } + }, + keyup: function () { + $span.html($el.find(":selected").html()); + } + }); + noSelect($span, options); + return { + remove: function () { + // Remove sibling span + $span.remove(); + + // Unwrap parent div + $el.unwrap().unbind(options.eventNamespace); + return $el; + }, + update: function () { + if (options.selectAutoWidth) { + // Easier to remove and reapply formatting + $.uniform.restore($el); + $el.uniform(options); + } else { + classClearStandard($div, options); + + // Reset current selected text + $span.html($el.find(":selected").html()); + classUpdateDisabled($div, $el, options); + } + } + }; + } + }, + { + // Select lists - multiselect lists only + match: function ($el) { + if ($el.is("select") && isMultiselect($el)) { + return true; + } + + return false; + }, + apply: function ($el, options) { + $el.addClass(options.selectMultiClass); + return { + remove: function () { + $el.removeClass(options.selectMultiClass); + }, + update: returnFalse + }; + } + }, + { + // Textareas + match: function ($el) { + return $el.is("textarea"); + }, + apply: function ($el, options) { + $el.addClass(options.textareaClass); + return { + remove: function () { + $el.removeClass(options.textareaClass); + }, + update: returnFalse + }; + } + } + ]; + + // IE6 can't be styled - can't set opacity on select + if ($.browser.msie && $.browser.version < 7) { + allowStyling = false; + } + + $.uniform = { + // Default options that can be overridden globally or when uniformed + // globally: $.uniform.defaults.fileButtonHtml = "Pick A File"; + // on uniform: $('input').uniform({fileButtonHtml: "Pick a File"}); + defaults: { + activeClass: "active", + autoHide: true, + buttonClass: "button", + checkboxClass: "checker", + checkedClass: "checked", + disabledClass: "disabled", + eventNamespace: ".uniform", + fileButtonClass: "action", + fileButtonHtml: "Choose File", + fileClass: "uploader", + fileDefaultHtml: "No file selected", + filenameClass: "filename", + focusClass: "focus", + hoverClass: "hover", + idPrefix: "uniform", + radioClass: "radio", + resetDefaultHtml: "Reset", + resetSelector: false, // We'll use our own function when you don't specify one + selectAutoWidth: true, + selectClass: "selector", + selectMultiClass: "uniform-multiselect", + submitDefaultHtml: "Submit", // Only text allowed + textareaClass: "uniform", + useID: true + }, + + // All uniformed elements - DOM objects + elements: [] + }; + + $.fn.uniform = function (options) { + var el = this; + options = $.extend({}, $.uniform.defaults, options); + + // If we are in high contrast mode, do not allow styling + if (!highContrastTest) { + highContrastTest = true; + + if (highContrast()) { + allowStyling = false; + } + } + + // Only uniform on browsers that work + if (!allowStyling) { + return this; + } + + // Code for specifying a reset button + if (options.resetSelector) { + $(options.resetSelector).mouseup(function () { + window.setTimeout(function () { + $.uniform.update(el); + }, 10); + }); + } + + return this.each(function () { + var $el = $(this), i, handler, callbacks; + + // Avoid uniforming elements already uniformed - just update + if ($el.data("uniformed")) { + $.uniform.update($el); + return; + } + + // See if we have any handler for this type of element + for (i = 0; i < uniformHandlers.length; i = i + 1) { + handler = uniformHandlers[i]; + + if (handler.match($el, options)) { + callbacks = handler.apply($el, options); + $el.data("uniformed", callbacks); + + // Store element in our global array + $.uniform.elements.push($el.get(0)); + return; + } + } + + // Could not style this element + }); + }; + + $.uniform.restore = $.fn.uniform.restore = function (elem) { + if (elem === undef) { + elem = $.uniform.elements; + } + + $(elem).each(function () { + var $el = $(this), index, elementData; + elementData = $el.data("uniformed"); + + // Skip elements that are not uniformed + if (!elementData) { + return; + } + + // Unbind events, remove additional markup that was added + elementData.remove(); + + // Remove item from list of uniformed elements + index = $.inArray(this, $.uniform.elements); + + if (index >= 0) { + $.uniform.elements.splice(index, 1); + } + + $el.removeData("uniformed"); + }); + }; + + $.uniform.update = $.fn.uniform.update = function (elem) { + if (elem === undef) { + elem = $.uniform.elements; + } + + $(elem).each(function () { + var $el = $(this), elementData; + elementData = $el.data("uniformed"); + + // Skip elements that are not uniformed + if (!elementData) { + return; + } + + elementData.update($el, elementData.options); + }); + }; +}(jQuery)); diff --git a/assets/grocery_crud/js/jquery_plugins/load-image.min.js b/assets/grocery_crud/js/jquery_plugins/load-image.min.js index 9b4d8b5..9edd707 100755 --- a/assets/grocery_crud/js/jquery_plugins/load-image.min.js +++ b/assets/grocery_crud/js/jquery_plugins/load-image.min.js @@ -1,3 +1,3 @@ -(function(h){var e=function(a,c,d){var b=document.createElement("img"),f,g;b.onerror=c;b.onload=function(){g&&e.revokeObjectURL(g);c(e.scale(b,d))};return(f=window.Blob&&a instanceof Blob||window.File&&a instanceof File?g=e.createObjectURL(a):a)?(b.src=f,b):e.readFile(a,function(a){b.src=a})},f=window.createObjectURL&&window||window.URL&&URL||window.webkitURL&&webkitURL;e.scale=function(a,c){var c=c||{},d=document.createElement("canvas"),b=Math.max((c.minWidth||a.width)/a.width,(c.minHeight||a.height)/ -a.height);if(1b)a.width=parseInt(a.width*b,10),a.height=parseInt(a.height*b,10);if(!c.canvas||!d.getContext)return a;d.width=a.width;d.height=a.height;d.getContext("2d").drawImage(a,0,0,a.width,a.height);return d};e.createObjectURL=function(a){return f?f.createObjectURL(a):!1};e.revokeObjectURL=function(a){return f?f.revokeObjectURL(a):!1};e.readFile=function(a, +(function(h){var e=function(a,c,d){var b=document.createElement("img"),f,g;b.onerror=c;b.onload=function(){g&&e.revokeObjectURL(g);c(e.scale(b,d))};return(f=window.Blob&&a instanceof Blob||window.File&&a instanceof File?g=e.createObjectURL(a):a)?(b.src=f,b):e.readFile(a,function(a){b.src=a})},f=window.createObjectURL&&window||window.URL&&URL||window.webkitURL&&webkitURL;e.scale=function(a,c){var c=c||{},d=document.createElement("canvas"),b=Math.max((c.minWidth||a.width)/a.width,(c.minHeight||a.height)/ +a.height);if(1b)a.width=parseInt(a.width*b,10),a.height=parseInt(a.height*b,10);if(!c.canvas||!d.getContext)return a;d.width=a.width;d.height=a.height;d.getContext("2d").drawImage(a,0,0,a.width,a.height);return d};e.createObjectURL=function(a){return f?f.createObjectURL(a):!1};e.revokeObjectURL=function(a){return f?f.revokeObjectURL(a):!1};e.readFile=function(a, c){if(window.FileReader&&FileReader.prototype.readAsDataURL){var d=new FileReader;d.onload=function(a){c(a.target.result)};d.readAsDataURL(a);return d}return!1};"undefined"!==typeof define&&define.amd?define("loadImage",function(){return e}):h.loadImage=e})(this); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/tmpl.min.js b/assets/grocery_crud/js/jquery_plugins/tmpl.min.js index c45f577..5314697 100755 --- a/assets/grocery_crud/js/jquery_plugins/tmpl.min.js +++ b/assets/grocery_crud/js/jquery_plugins/tmpl.min.js @@ -1,2 +1,2 @@ -(function(e){var a=function(b,d){var c=!/[^\-\w]/.test(b)?a.cache[b]=a.cache[b]||a(a.load(b)):new Function(a.arg,("var _s=''"+a.helper+";_s+='"+b.replace(a.regexp,a.func)+"';return _s;").split("_s+='';").join(""));c.tmpl=c.tmpl||a;return d?c(d):c};a.cache={};a.load=function(a){return document.getElementById(a).innerHTML};a.regexp=/(\s+)|('|\\)(?![^%]*%\})|(?:\{%(=|#)(.+?)%\})|(\{%)|(%\})/g;a.func=function(a,d,c,f,g,e,i,h,j){if(d)return h&&h+a.length!==j.length?" ":"";if(c)return"\\"+a;if(f)return"="=== +(function(e){var a=function(b,d){var c=!/[^\-\w]/.test(b)?a.cache[b]=a.cache[b]||a(a.load(b)):new Function(a.arg,("var _s=''"+a.helper+";_s+='"+b.replace(a.regexp,a.func)+"';return _s;").split("_s+='';").join(""));c.tmpl=c.tmpl||a;return d?c(d):c};a.cache={};a.load=function(a){return document.getElementById(a).innerHTML};a.regexp=/(\s+)|('|\\)(?![^%]*%\})|(?:\{%(=|#)(.+?)%\})|(\{%)|(%\})/g;a.func=function(a,d,c,f,g,e,i,h,j){if(d)return h&&h+a.length!==j.length?" ":"";if(c)return"\\"+a;if(f)return"="=== f?"'+_e("+g+")+'":"'+("+g+"||'')+'";if(e)return"';";if(i)return"_s+='"};a.encReg=/[<>&"\x00]/g;a.encMap={"<":"<",">":">","&":"&",'"':""","\x00":""};a.encode=function(b){return(""+(b||"")).replace(a.encReg,function(b){return a.encMap[b]})};a.arg="o";a.helper=",_t=arguments.callee.tmpl,_e=_t.encode,print=function(s,e){_s+=e&&(s||'')||_e(s);},include=function(s,d){_s+=_t(s,d);}";"function"===typeof define&&define.amd?define("tmpl",function(){return a}):e.tmpl=a})(this); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui.multiselect.min.js b/assets/grocery_crud/js/jquery_plugins/ui.multiselect.min.js index 02159c6..cae69b6 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui.multiselect.min.js +++ b/assets/grocery_crud/js/jquery_plugins/ui.multiselect.min.js @@ -1,2 +1,2 @@ -/* jQuery UI Multiselect | https://github.com/michael/multiselect */ +/* jQuery UI Multiselect | https://github.com/michael/multiselect */ (function(b){b.widget("ui.multiselect",{options:{sortable:!0,searchable:!0,doubleClickable:!0,animated:"fast",show:"slideDown",hide:"slideUp",dividerLocation:0.6,availableFirst:!1,nodeComparator:function(a,b){var d=a.text(),e=b.text();return d==e?0:d
').insertAfter(this.element);this.count=0;this.selectedContainer=b('
').appendTo(this.container);this.availableContainer=b('
')[this.options.availableFirst?"prependTo":"appendTo"](this.container);this.selectedActions=b('
0 '+b.ui.multiselect.locale.itemsCount+''+b.ui.multiselect.locale.removeAll+"
").appendTo(this.selectedContainer);this.availableActions=b('").appendTo(this.availableContainer);this.selectedList=b('
').bind("selectstart",function(){return!1}).appendTo(this.selectedContainer);this.availableList=b('
').bind("selectstart",function(){return!1}).appendTo(this.availableContainer);var a=this;this.container.width(this.element.width()+1);this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));this.options.animated||(this.options.show="show",this.options.hide="hide");this._populateLists(this.element.find("option"));this.options.sortable&&this.selectedList.sortable({placeholder:"ui-state-highlight",axis:"y",update:function(){a.selectedList.find("li").each(function(){b(this).data("optionLink")&&b(this).data("optionLink").remove().appendTo(a.element)})},receive:function(c,d){d.item.data("optionLink").attr("selected",!0);a.count+=1;a._updateCount();a.selectedList.children(".ui-draggable").each(function(){b(this).removeClass("ui-draggable");b(this).data("optionLink",d.item.data("optionLink"));b(this).data("idx",d.item.data("idx"));a._applyItemState(b(this),!0)});setTimeout(function(){d.item.remove()},1)}});this.options.searchable?this._registerSearchEvents(this.availableContainer.find("input.search")):b(".search").hide();this.container.find(".remove-all").click(function(){a._populateLists(a.element.find("option").removeAttr("selected"));return!1});this.container.find(".add-all").click(function(){var c=a.element.find("option").not(":selected");1'+a.text()+'').hide();c.data("optionLink",a);return c},_cloneWithData:function(a){var b=a.clone(!1,!1);b.data("optionLink",a.data("optionLink"));b.data("idx",a.data("idx"));return b},_setSelected:function(a,c){a.data("optionLink").attr("selected",c);if(c){var d=this._cloneWithData(a);a[this.options.hide](this.options.animated,function(){b(this).remove()});d.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);this._applyItemState(d,!0);return d}var e=this.availableList.find("li"),g=this.options.nodeComparator,d=null,f=a.data("idx"),h=g(a,b(e[f]));if(h)for(;0<=f&&f - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-af.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-af.js index ae789ca..0e45e01 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-af.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-af.js @@ -1,23 +1,23 @@ -/* Afrikaans initialisation for the jQuery UI date picker plugin. */ -/* Written by Renier Pretorius. */ -jQuery(function($){ - $.datepicker.regional['af'] = { - closeText: 'Selekteer', - prevText: 'Vorige', - nextText: 'Volgende', - currentText: 'Vandag', - monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie', - 'Julie','Augustus','September','Oktober','November','Desember'], - monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', - 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], - dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], - dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'], - dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'], - weekHeader: 'Wk', - dateFormat: 'dd/mm/yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['af']); +/* Afrikaans initialisation for the jQuery UI date picker plugin. */ +/* Written by Renier Pretorius. */ +jQuery(function($){ + $.datepicker.regional['af'] = { + closeText: 'Selekteer', + prevText: 'Vorige', + nextText: 'Volgende', + currentText: 'Vandag', + monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie', + 'Julie','Augustus','September','Oktober','November','Desember'], + monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', + 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], + dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], + dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'], + dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['af']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ar.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ar.js index e41af3e..b58cf95 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ar.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ar.js @@ -1,23 +1,23 @@ -/* Arabic Translation for jQuery UI date picker plugin. */ -/* Ashraf Kaabi -- mail@kaabi.info */ - -jQuery(function($){ - $.datepicker.regional['ar'] = { - closeText: 'إغلاق', - prevText: '<السابق', - nextText: 'التالي>', - currentText: 'اليوم', - monthNames: ['يناير','فبراير','مارس','ابريل','مايو','يونيو', - 'يوليو','اغطسس','سبتمبر','اكتوبر','نوفمبر','ديسمبر'], - monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], - dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - weekHeader: 'أسبوع', - dateFormat: 'dd/mm/yy', - firstDay: 6, - isRTL: true, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['ar']); -}); +/* Arabic Translation for jQuery UI date picker plugin. */ +/* Ashraf Kaabi -- mail@kaabi.info */ + +jQuery(function($){ + $.datepicker.regional['ar'] = { + closeText: 'إغلاق', + prevText: '<السابق', + nextText: 'التالي>', + currentText: 'اليوم', + monthNames: ['يناير','فبراير','مارس','ابريل','مايو','يونيو', + 'يوليو','اغطسس','سبتمبر','اكتوبر','نوفمبر','ديسمبر'], + monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], + dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + weekHeader: 'أسبوع', + dateFormat: 'dd/mm/yy', + firstDay: 6, + isRTL: true, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ar']); +}); diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-bg.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-bg.js index f4e80d1..10a4a04 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-bg.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-bg.js @@ -1,24 +1,24 @@ -/* Bulgarian initialisation for the jQuery UI date picker plugin. */ -/* Written by Stoyan Kyosev (http://svest.org). */ -jQuery(function($){ - $.datepicker.regional['bg'] = { - closeText: 'затвори', - prevText: '<назад', - nextText: 'напред>', - nextBigText: '>>', - currentText: 'днес', - monthNames: ['Януари','Февруари','Март','Април','Май','Юни', - 'Юли','Август','Септември','Октомври','Ноември','Декември'], - monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни', - 'Юли','Авг','Сеп','Окт','Нов','Дек'], - dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'], - dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'], - dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'], - weekHeader: 'Wk', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['bg']); +/* Bulgarian initialisation for the jQuery UI date picker plugin. */ +/* Written by Stoyan Kyosev (http://svest.org). */ +jQuery(function($){ + $.datepicker.regional['bg'] = { + closeText: 'затвори', + prevText: '<назад', + nextText: 'напред>', + nextBigText: '>>', + currentText: 'днес', + monthNames: ['Януари','Февруари','Март','Април','Май','Юни', + 'Юли','Август','Септември','Октомври','Ноември','Декември'], + monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни', + 'Юли','Авг','Сеп','Окт','Нов','Дек'], + dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'], + dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'], + dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'], + weekHeader: 'Wk', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['bg']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-bn.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-bn.js index 7e7c86f..2520f1c 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-bn.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-bn.js @@ -1,21 +1,21 @@ -/* Bengali initialisation for the jQuery UI date picker plugin. */ -/* Written by Rajib, Utpol and Shishir | http://github.com/rajibahmed */ -jQuery(function($){ - $.datepicker.regional['bn'] = { - closeText: 'সমাপ্ত', - prevText: 'পূর্ববর্তী', - nextText: 'পরবর্তী', - currentText: 'আজ', - monthNames: ['জানুয়ারী','ফেব্রুয়ারী','মার্চ','এপ্রিল','মে','জুন','জুলাই','আগস্ট','সেপ্টেম্বর','অক্টোবর','নভেম্বর','ডিসেম্বর'], - monthNamesShort: ['জানু', 'ফেব্রু', 'মার্চ', 'এপ্রি', 'মে', 'জুন','জুলা', 'আগ', 'সেপ', 'অক্টো', 'নভে', 'ডিসে'], - dayNames: ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], - dayNamesShort: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], - dayNamesMin: ['র','সো','ম','বু','বৃ','শু','শ'], - weekHeader: 'সপ্তা', - dateFormat: 'দিিন/মাস/সাল্', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['bn']); +/* Bengali initialisation for the jQuery UI date picker plugin. */ +/* Written by Rajib, Utpol and Shishir | http://github.com/rajibahmed */ +jQuery(function($){ + $.datepicker.regional['bn'] = { + closeText: 'সমাপ্ত', + prevText: 'পূর্ববর্তী', + nextText: 'পরবর্তী', + currentText: 'আজ', + monthNames: ['জানুয়ারী','ফেব্রুয়ারী','মার্চ','এপ্রিল','মে','জুন','জুলাই','আগস্ট','সেপ্টেম্বর','অক্টোবর','নভেম্বর','ডিসেম্বর'], + monthNamesShort: ['জানু', 'ফেব্রু', 'মার্চ', 'এপ্রি', 'মে', 'জুন','জুলা', 'আগ', 'সেপ', 'অক্টো', 'নভে', 'ডিসে'], + dayNames: ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], + dayNamesShort: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], + dayNamesMin: ['র','সো','ম','বু','বৃ','শু','শ'], + weekHeader: 'সপ্তা', + dateFormat: 'দিিন/মাস/সাল্', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['bn']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-cs.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-cs.js index e83fad4..2e273a2 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-cs.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-cs.js @@ -1,23 +1,23 @@ -/* Czech initialisation for the jQuery UI date picker plugin. */ -/* Written by Tomas Muller (tomas@tomas-muller.net). */ -jQuery(function($){ - $.datepicker.regional['cs'] = { - closeText: 'Zavřít', - prevText: '<Dříve', - nextText: 'Později>', - currentText: 'Nyní', - monthNames: ['leden','únor','březen','duben','květen','červen', - 'červenec','srpen','září','říjen','listopad','prosinec'], - monthNamesShort: ['led','úno','bře','dub','kvě','čer', - 'čvc','srp','zář','říj','lis','pro'], - dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], - dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], - dayNamesMin: ['ne','po','út','st','čt','pá','so'], - weekHeader: 'Týd', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['cs']); +/* Czech initialisation for the jQuery UI date picker plugin. */ +/* Written by Tomas Muller (tomas@tomas-muller.net). */ +jQuery(function($){ + $.datepicker.regional['cs'] = { + closeText: 'Zavřít', + prevText: '<Dříve', + nextText: 'Později>', + currentText: 'Nyní', + monthNames: ['leden','únor','březen','duben','květen','červen', + 'červenec','srpen','září','říjen','listopad','prosinec'], + monthNamesShort: ['led','úno','bře','dub','kvě','čer', + 'čvc','srp','zář','říj','lis','pro'], + dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], + dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], + dayNamesMin: ['ne','po','út','st','čt','pá','so'], + weekHeader: 'Týd', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['cs']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-da.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-da.js index 5ee0be8..0b74c19 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-da.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-da.js @@ -1,23 +1,23 @@ -/* Danish initialisation for the jQuery UI date picker plugin. */ -/* Written by Jan Christensen ( deletestuff@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['da'] = { - closeText: 'Luk', - prevText: '<Forrige', - nextText: 'Næste>', - currentText: 'Idag', - monthNames: ['Januar','Februar','Marts','April','Maj','Juni', - 'Juli','August','September','Oktober','November','December'], - monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', - 'Jul','Aug','Sep','Okt','Nov','Dec'], - dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], - dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], - dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], - weekHeader: 'Uge', - dateFormat: 'dd-mm-yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['da']); +/* Danish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jan Christensen ( deletestuff@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['da'] = { + closeText: 'Luk', + prevText: '<Forrige', + nextText: 'Næste>', + currentText: 'Idag', + monthNames: ['Januar','Februar','Marts','April','Maj','Juni', + 'Juli','August','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], + dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], + dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], + weekHeader: 'Uge', + dateFormat: 'dd-mm-yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['da']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-de.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-de.js index 819f818..39c23fa 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-de.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-de.js @@ -1,23 +1,23 @@ -/* German initialisation for the jQuery UI date picker plugin. */ -/* Written by Milian Wolff (mail@milianw.de). */ -jQuery(function($){ - $.datepicker.regional['de'] = { - closeText: 'schließen', - prevText: '<zurück', - nextText: 'Vor>', - currentText: 'heute', - monthNames: ['Januar','Februar','März','April','Mai','Juni', - 'Juli','August','September','Oktober','November','Dezember'], - monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', - 'Jul','Aug','Sep','Okt','Nov','Dez'], - dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], - dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], - dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], - weekHeader: 'KW', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['de']); +/* German initialisation for the jQuery UI date picker plugin. */ +/* Written by Milian Wolff (mail@milianw.de). */ +jQuery(function($){ + $.datepicker.regional['de'] = { + closeText: 'schließen', + prevText: '<zurück', + nextText: 'Vor>', + currentText: 'heute', + monthNames: ['Januar','Februar','März','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Dezember'], + monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dez'], + dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], + dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], + weekHeader: 'KW', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['de']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-el.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-el.js index 818877f..5c9f8f3 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-el.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-el.js @@ -1,23 +1,23 @@ -/* Greek (el) initialisation for the jQuery UI date picker plugin. */ -/* Written by Alex Cicovic (http://www.alexcicovic.com) */ -jQuery(function($){ - $.datepicker.regional['el'] = { - closeText: 'Κλείσιμο', - prevText: 'Προηγούμενος', - nextText: 'Επόμενος', - currentText: 'Τρέχων Μήνας', - monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος', - 'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'], - monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν', - 'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'], - dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'], - dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'], - dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'], - weekHeader: 'Εβδ', - dateFormat: 'dd/mm/yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['el']); +/* Greek (el) initialisation for the jQuery UI date picker plugin. */ +/* Written by Alex Cicovic (http://www.alexcicovic.com) */ +jQuery(function($){ + $.datepicker.regional['el'] = { + closeText: 'Κλείσιμο', + prevText: 'Προηγούμενος', + nextText: 'Επόμενος', + currentText: 'Τρέχων Μήνας', + monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος', + 'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'], + monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν', + 'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'], + dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'], + dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'], + dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'], + weekHeader: 'Εβδ', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['el']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-es.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-es.js index 07fc5b7..2e3630c 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-es.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-es.js @@ -1,23 +1,23 @@ -/* Inicialización en español para la extensión 'UI date picker' para jQuery. */ -/* Traducido por Vester (xvester@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['es'] = { - closeText: 'Cerrar', - prevText: '<Ant', - nextText: 'Sig>', - currentText: 'Hoy', - monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', - 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], - monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', - 'Jul','Ago','Sep','Oct','Nov','Dic'], - dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'], - dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], - dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'], - weekHeader: 'Sm', - dateFormat: 'dd/mm/yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['es']); +/* Inicialización en español para la extensión 'UI date picker' para jQuery. */ +/* Traducido por Vester (xvester@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['es'] = { + closeText: 'Cerrar', + prevText: '<Ant', + nextText: 'Sig>', + currentText: 'Hoy', + monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', + 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], + monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', + 'Jul','Ago','Sep','Oct','Nov','Dic'], + dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'], + dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], + dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'], + weekHeader: 'Sm', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['es']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-fa.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-fa.js index 841243a..ebdabe8 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-fa.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-fa.js @@ -1,59 +1,59 @@ -/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */ -/* Javad Mowlanezhad -- jmowla@gmail.com */ -/* Jalali calendar should supported soon! (Its implemented but I have to test it) */ -jQuery(function($) { - $.datepicker.regional['fa'] = { - closeText: 'بستن', - prevText: '<قبلی', - nextText: 'بعدی>', - currentText: 'امروز', - monthNames: [ - 'فروردين', - 'ارديبهشت', - 'خرداد', - 'تير', - 'مرداد', - 'شهريور', - 'مهر', - 'آبان', - 'آذر', - 'دی', - 'بهمن', - 'اسفند' - ], - monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], - dayNames: [ - 'يکشنبه', - 'دوشنبه', - 'سه‌شنبه', - 'چهارشنبه', - 'پنجشنبه', - 'جمعه', - 'شنبه' - ], - dayNamesShort: [ - 'ی', - 'د', - 'س', - 'چ', - 'پ', - 'ج', - 'ش' - ], - dayNamesMin: [ - 'ی', - 'د', - 'س', - 'چ', - 'پ', - 'ج', - 'ش' - ], - weekHeader: 'هف', - dateFormat: 'yy/mm/dd', - firstDay: 6, - isRTL: true, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['fa']); +/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */ +/* Javad Mowlanezhad -- jmowla@gmail.com */ +/* Jalali calendar should supported soon! (Its implemented but I have to test it) */ +jQuery(function($) { + $.datepicker.regional['fa'] = { + closeText: 'بستن', + prevText: '<قبلی', + nextText: 'بعدی>', + currentText: 'امروز', + monthNames: [ + 'فروردين', + 'ارديبهشت', + 'خرداد', + 'تير', + 'مرداد', + 'شهريور', + 'مهر', + 'آبان', + 'آذر', + 'دی', + 'بهمن', + 'اسفند' + ], + monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], + dayNames: [ + 'يکشنبه', + 'دوشنبه', + 'سه‌شنبه', + 'چهارشنبه', + 'پنجشنبه', + 'جمعه', + 'شنبه' + ], + dayNamesShort: [ + 'ی', + 'د', + 'س', + 'چ', + 'پ', + 'ج', + 'ش' + ], + dayNamesMin: [ + 'ی', + 'د', + 'س', + 'چ', + 'پ', + 'ج', + 'ش' + ], + weekHeader: 'هف', + dateFormat: 'yy/mm/dd', + firstDay: 6, + isRTL: true, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['fa']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-fr.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-fr.js index d86c7ea..4163916 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-fr.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-fr.js @@ -1,25 +1,25 @@ -/* French initialisation for the jQuery UI date picker plugin. */ -/* Written by Keith Wood (kbwood{at}iinet.com.au), - Stéphane Nahmani (sholby@sholby.net), - Stéphane Raimbault */ -jQuery(function($){ - $.datepicker.regional['fr'] = { - closeText: 'Fermer', - prevText: 'Précédent', - nextText: 'Suivant', - currentText: 'Aujourd\'hui', - monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', - 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], - monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin', - 'Juil.','Août','Sept.','Oct.','Nov.','Déc.'], - dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], - dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'], - dayNamesMin: ['D','L','M','M','J','V','S'], - weekHeader: 'Sem.', - dateFormat: 'dd/mm/yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['fr']); +/* French initialisation for the jQuery UI date picker plugin. */ +/* Written by Keith Wood (kbwood{at}iinet.com.au), + Stéphane Nahmani (sholby@sholby.net), + Stéphane Raimbault */ +jQuery(function($){ + $.datepicker.regional['fr'] = { + closeText: 'Fermer', + prevText: 'Précédent', + nextText: 'Suivant', + currentText: 'Aujourd\'hui', + monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', + 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], + monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin', + 'Juil.','Août','Sept.','Oct.','Nov.','Déc.'], + dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], + dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'], + dayNamesMin: ['D','L','M','M','J','V','S'], + weekHeader: 'Sem.', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['fr']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-hu.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-hu.js index f61b6e2..4597128 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-hu.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-hu.js @@ -1,23 +1,23 @@ -/* Hungarian initialisation for the jQuery UI date picker plugin. */ -/* Written by Istvan Karaszi (jquery@spam.raszi.hu). */ -jQuery(function($){ - $.datepicker.regional['hu'] = { - closeText: 'bezár', - prevText: 'vissza', - nextText: 'előre', - currentText: 'ma', - monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', - 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], - monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', - 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], - dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], - dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'], - dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'], - weekHeader: 'Hét', - dateFormat: 'yy.mm.dd.', - firstDay: 1, - isRTL: false, - showMonthAfterYear: true, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['hu']); +/* Hungarian initialisation for the jQuery UI date picker plugin. */ +/* Written by Istvan Karaszi (jquery@spam.raszi.hu). */ +jQuery(function($){ + $.datepicker.regional['hu'] = { + closeText: 'bezár', + prevText: 'vissza', + nextText: 'előre', + currentText: 'ma', + monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', + 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], + monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', + 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], + dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], + dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'], + dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'], + weekHeader: 'Hét', + dateFormat: 'yy.mm.dd.', + firstDay: 1, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['hu']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-id.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-id.js index d435810..35e97b8 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-id.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-id.js @@ -1,23 +1,23 @@ -/* Indonesian initialisation for the jQuery UI date picker plugin. */ -/* Written by Deden Fathurahman (dedenf@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['id'] = { - closeText: 'Tutup', - prevText: '<mundur', - nextText: 'maju>', - currentText: 'hari ini', - monthNames: ['Januari','Februari','Maret','April','Mei','Juni', - 'Juli','Agustus','September','Oktober','Nopember','Desember'], - monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', - 'Jul','Agus','Sep','Okt','Nop','Des'], - dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'], - dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'], - dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'], - weekHeader: 'Mg', - dateFormat: 'dd/mm/yy', - firstDay: 0, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['id']); +/* Indonesian initialisation for the jQuery UI date picker plugin. */ +/* Written by Deden Fathurahman (dedenf@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['id'] = { + closeText: 'Tutup', + prevText: '<mundur', + nextText: 'maju>', + currentText: 'hari ini', + monthNames: ['Januari','Februari','Maret','April','Mei','Juni', + 'Juli','Agustus','September','Oktober','Nopember','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', + 'Jul','Agus','Sep','Okt','Nop','Des'], + dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'], + dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'], + dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'], + weekHeader: 'Mg', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['id']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-it.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-it.js index 45c55bc..d316952 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-it.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-it.js @@ -1,23 +1,23 @@ -/* Italian initialisation for the jQuery UI date picker plugin. */ -/* Written by Antonello Pasella (antonello.pasella@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['it'] = { - closeText: 'Chiudi', - prevText: '<Prec', - nextText: 'Succ>', - currentText: 'Oggi', - monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', - 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], - monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', - 'Lug','Ago','Set','Ott','Nov','Dic'], - dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'], - dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], - dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'], - weekHeader: 'Sm', - dateFormat: 'dd/mm/yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['it']); +/* Italian initialisation for the jQuery UI date picker plugin. */ +/* Written by Antonello Pasella (antonello.pasella@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['it'] = { + closeText: 'Chiudi', + prevText: '<Prec', + nextText: 'Succ>', + currentText: 'Oggi', + monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', + 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], + monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', + 'Lug','Ago','Set','Ott','Nov','Dic'], + dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'], + dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], + dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'], + weekHeader: 'Sm', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['it']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ja.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ja.js index dfab49a..ebcc98b 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ja.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ja.js @@ -1,23 +1,23 @@ -/* Japanese initialisation for the jQuery UI date picker plugin. */ -/* Written by Kentaro SATO (kentaro@ranvis.com). */ -jQuery(function($){ - $.datepicker.regional['ja'] = { - closeText: '閉じる', - prevText: '<前', - nextText: '次>', - currentText: '今日', - monthNames: ['1月','2月','3月','4月','5月','6月', - '7月','8月','9月','10月','11月','12月'], - monthNamesShort: ['1月','2月','3月','4月','5月','6月', - '7月','8月','9月','10月','11月','12月'], - dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'], - dayNamesShort: ['日','月','火','水','木','金','土'], - dayNamesMin: ['日','月','火','水','木','金','土'], - weekHeader: '週', - dateFormat: 'yy/mm/dd', - firstDay: 0, - isRTL: false, - showMonthAfterYear: true, - yearSuffix: '年'}; - $.datepicker.setDefaults($.datepicker.regional['ja']); +/* Japanese initialisation for the jQuery UI date picker plugin. */ +/* Written by Kentaro SATO (kentaro@ranvis.com). */ +jQuery(function($){ + $.datepicker.regional['ja'] = { + closeText: '閉じる', + prevText: '<前', + nextText: '次>', + currentText: '今日', + monthNames: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + monthNamesShort: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'], + dayNamesShort: ['日','月','火','水','木','金','土'], + dayNamesMin: ['日','月','火','水','木','金','土'], + weekHeader: '週', + dateFormat: 'yy/mm/dd', + firstDay: 0, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: '年'}; + $.datepicker.setDefaults($.datepicker.regional['ja']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ko.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ko.js index 4e0138e..0b29ec8 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ko.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ko.js @@ -1,23 +1,23 @@ -/* Korean initialisation for the jQuery calendar extension. */ -/* Written by DaeKwon Kang (ncrash.dk@gmail.com), Edited by Genie. */ -jQuery(function($){ - $.datepicker.regional['ko'] = { - closeText: '닫기', - prevText: '이전달', - nextText: '다음달', - currentText: '오늘', - monthNames: ['1월','2월','3월','4월','5월','6월', - '7월','8월','9월','10월','11월','12월'], - monthNamesShort: ['1월','2월','3월','4월','5월','6월', - '7월','8월','9월','10월','11월','12월'], - dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'], - dayNamesShort: ['일','월','화','수','목','금','토'], - dayNamesMin: ['일','월','화','수','목','금','토'], - weekHeader: 'Wk', - dateFormat: 'yy-mm-dd', - firstDay: 0, - isRTL: false, - showMonthAfterYear: true, - yearSuffix: '년'}; - $.datepicker.setDefaults($.datepicker.regional['ko']); +/* Korean initialisation for the jQuery calendar extension. */ +/* Written by DaeKwon Kang (ncrash.dk@gmail.com), Edited by Genie. */ +jQuery(function($){ + $.datepicker.regional['ko'] = { + closeText: '닫기', + prevText: '이전달', + nextText: '다음달', + currentText: '오늘', + monthNames: ['1월','2월','3월','4월','5월','6월', + '7월','8월','9월','10월','11월','12월'], + monthNamesShort: ['1월','2월','3월','4월','5월','6월', + '7월','8월','9월','10월','11월','12월'], + dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'], + dayNamesShort: ['일','월','화','수','목','금','토'], + dayNamesMin: ['일','월','화','수','목','금','토'], + weekHeader: 'Wk', + dateFormat: 'yy-mm-dd', + firstDay: 0, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: '년'}; + $.datepicker.setDefaults($.datepicker.regional['ko']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-nl.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-nl.js index 14ce0b0..f0ee1ec 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-nl.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-nl.js @@ -1,23 +1,23 @@ -/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ -/* Written by Mathias Bynens */ -jQuery(function($){ - $.datepicker.regional.nl = { - closeText: 'Sluiten', - prevText: '←', - nextText: '→', - currentText: 'Vandaag', - monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', - 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], - monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', - 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], - dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], - dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], - dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], - weekHeader: 'Wk', - dateFormat: 'dd-mm-yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional.nl); +/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Mathias Bynens */ +jQuery(function($){ + $.datepicker.regional.nl = { + closeText: 'Sluiten', + prevText: '←', + nextText: '→', + currentText: 'Vandaag', + monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', + 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], + monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', + 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], + dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], + dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + weekHeader: 'Wk', + dateFormat: 'dd-mm-yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional.nl); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-no.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-no.js index 1bb5a01..f41143e 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-no.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-no.js @@ -1,23 +1,23 @@ -/* Norwegian initialisation for the jQuery UI date picker plugin. */ -/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ - -jQuery(function($){ - $.datepicker.regional['no'] = { - closeText: 'Lukk', - prevText: '«Forrige', - nextText: 'Neste»', - currentText: 'I dag', - monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'], - monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'], - dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'], - dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'], - dayNamesMin: ['sø','ma','ti','on','to','fr','lø'], - weekHeader: 'Uke', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: '' - }; - $.datepicker.setDefaults($.datepicker.regional['no']); +/* Norwegian initialisation for the jQuery UI date picker plugin. */ +/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ + +jQuery(function($){ + $.datepicker.regional['no'] = { + closeText: 'Lukk', + prevText: '«Forrige', + nextText: 'Neste»', + currentText: 'I dag', + monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'], + monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'], + dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'], + dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'], + dayNamesMin: ['sø','ma','ti','on','to','fr','lø'], + weekHeader: 'Uke', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: '' + }; + $.datepicker.setDefaults($.datepicker.regional['no']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pl.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pl.js index fd9ff66..07b390d 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pl.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pl.js @@ -1,23 +1,23 @@ -/* Polish initialisation for the jQuery UI date picker plugin. */ -/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['pl'] = { - closeText: 'Zamknij', - prevText: '<Poprzedni', - nextText: 'Następny>', - currentText: 'Dziś', - monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', - 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], - monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', - 'Lip','Sie','Wrz','Pa','Lis','Gru'], - dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'], - dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], - dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], - weekHeader: 'Tydz', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['pl']); +/* Polish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pl'] = { + closeText: 'Zamknij', + prevText: '<Poprzedni', + nextText: 'Następny>', + currentText: 'Dziś', + monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', + 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], + monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', + 'Lip','Sie','Wrz','Pa','Lis','Gru'], + dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'], + dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], + dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], + weekHeader: 'Tydz', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['pl']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pt-br.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pt-br.js index b642278..8cc746e 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pt-br.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pt-br.js @@ -1,23 +1,23 @@ -/* Brazilian initialisation for the jQuery UI date picker plugin. */ -/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['pt-BR'] = { - closeText: 'Fechar', - prevText: '<Anterior', - nextText: 'Próximo>', - currentText: 'Hoje', - monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', - 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], - monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', - 'Jul','Ago','Set','Out','Nov','Dez'], - dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], - dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], - dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], - weekHeader: 'Sm', - dateFormat: 'dd/mm/yy', - firstDay: 0, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['pt-BR']); +/* Brazilian initialisation for the jQuery UI date picker plugin. */ +/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pt-BR'] = { + closeText: 'Fechar', + prevText: '<Anterior', + nextText: 'Próximo>', + currentText: 'Hoje', + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Out','Nov','Dez'], + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + weekHeader: 'Sm', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['pt-BR']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pt.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pt.js index 4bef3b3..fdecf90 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pt.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-pt.js @@ -1,22 +1,22 @@ -/* Portuguese initialisation for the jQuery UI date picker plugin. */ -jQuery(function($){ - $.datepicker.regional['pt'] = { - closeText: 'Fechar', - prevText: '<Anterior', - nextText: 'Seguinte', - currentText: 'Hoje', - monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', - 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], - monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', - 'Jul','Ago','Set','Out','Nov','Dez'], - dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], - dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], - dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], - weekHeader: 'Sem', - dateFormat: 'dd/mm/yy', - firstDay: 0, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['pt']); +/* Portuguese initialisation for the jQuery UI date picker plugin. */ +jQuery(function($){ + $.datepicker.regional['pt'] = { + closeText: 'Fechar', + prevText: '<Anterior', + nextText: 'Seguinte', + currentText: 'Hoje', + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Out','Nov','Dez'], + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + weekHeader: 'Sem', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['pt']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ro.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ro.js index db60e65..8da7dee 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ro.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ro.js @@ -1,26 +1,26 @@ -/* Romanian initialisation for the jQuery UI date picker plugin. - * - * Written by Edmond L. (ll_edmond@walla.com) - * and Ionut G. Stan (ionut.g.stan@gmail.com) - */ -jQuery(function($){ - $.datepicker.regional['ro'] = { - closeText: 'Închide', - prevText: '« Luna precedentă', - nextText: 'Luna următoare »', - currentText: 'Azi', - monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie', - 'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'], - monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', - 'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'], - dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], - dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'], - weekHeader: 'Săpt', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['ro']); +/* Romanian initialisation for the jQuery UI date picker plugin. + * + * Written by Edmond L. (ll_edmond@walla.com) + * and Ionut G. Stan (ionut.g.stan@gmail.com) + */ +jQuery(function($){ + $.datepicker.regional['ro'] = { + closeText: 'Închide', + prevText: '« Luna precedentă', + nextText: 'Luna următoare »', + currentText: 'Azi', + monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie', + 'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'], + monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', + 'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'], + dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], + dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'], + weekHeader: 'Săpt', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ro']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ru.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ru.js index 86780b9..fd802f1 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ru.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-ru.js @@ -1,23 +1,23 @@ -/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ -/* Written by Andrew Stromnov (stromnov@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['ru'] = { - closeText: 'Закрыть', - prevText: '<Пред', - nextText: 'След>', - currentText: 'Сегодня', - monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', - 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], - monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', - 'Июл','Авг','Сен','Окт','Ноя','Дек'], - dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], - dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], - dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], - weekHeader: 'Нед', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['ru']); +/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Andrew Stromnov (stromnov@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ru'] = { + closeText: 'Закрыть', + prevText: '<Пред', + nextText: 'След>', + currentText: 'Сегодня', + monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', + 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', + 'Июл','Авг','Сен','Окт','Ноя','Дек'], + dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], + dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], + dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], + weekHeader: 'Нед', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ru']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-sk.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-sk.js index 95f0107..98d349b 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-sk.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-sk.js @@ -1,23 +1,23 @@ -/* Slovak initialisation for the jQuery UI date picker plugin. */ -/* Written by Vojtech Rinik (vojto@hmm.sk). */ -jQuery(function($){ - $.datepicker.regional['sk'] = { - closeText: 'Zavrieť', - prevText: '<Predchádzajúci', - nextText: 'Nasledujúci>', - currentText: 'Dnes', - monthNames: ['Január','Február','Marec','Apríl','Máj','Jún', - 'Júl','August','September','Október','November','December'], - monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', - 'Júl','Aug','Sep','Okt','Nov','Dec'], - dayNames: ['Nedeľa','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'], - dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], - dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'], - weekHeader: 'Ty', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['sk']); +/* Slovak initialisation for the jQuery UI date picker plugin. */ +/* Written by Vojtech Rinik (vojto@hmm.sk). */ +jQuery(function($){ + $.datepicker.regional['sk'] = { + closeText: 'Zavrieť', + prevText: '<Predchádzajúci', + nextText: 'Nasledujúci>', + currentText: 'Dnes', + monthNames: ['Január','Február','Marec','Apríl','Máj','Jún', + 'Júl','August','September','Október','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', + 'Júl','Aug','Sep','Okt','Nov','Dec'], + dayNames: ['Nedeľa','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'], + dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], + dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'], + weekHeader: 'Ty', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['sk']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-th.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-th.js index fa129f8..907ec7d 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-th.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-th.js @@ -1,23 +1,23 @@ -/* Thai initialisation for the jQuery UI date picker plugin. */ -/* Written by pipo (pipo@sixhead.com). */ -jQuery(function($){ - $.datepicker.regional['th'] = { - closeText: 'ปิด', - prevText: '« ย้อน', - nextText: 'ถัดไป »', - currentText: 'วันนี้', - monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', - 'กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], - monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', - 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], - dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], - dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], - dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], - weekHeader: 'Wk', - dateFormat: 'dd/mm/yy', - firstDay: 0, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['th']); +/* Thai initialisation for the jQuery UI date picker plugin. */ +/* Written by pipo (pipo@sixhead.com). */ +jQuery(function($){ + $.datepicker.regional['th'] = { + closeText: 'ปิด', + prevText: '« ย้อน', + nextText: 'ถัดไป »', + currentText: 'วันนี้', + monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', + 'กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], + monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', + 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], + dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], + dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['th']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-tr.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-tr.js index a2c4e92..2c3b3c3 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-tr.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-tr.js @@ -1,23 +1,23 @@ -/* Turkish initialisation for the jQuery UI date picker plugin. */ -/* Written by Izzet Emre Erkan (kara@karalamalar.net). */ -jQuery(function($){ - $.datepicker.regional['tr'] = { - closeText: 'kapat', - prevText: '<geri', - nextText: 'ileri>', - currentText: 'bugün', - monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', - 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], - monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', - 'Tem','Ağu','Eyl','Eki','Kas','Ara'], - dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], - dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], - dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], - weekHeader: 'Hf', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['tr']); +/* Turkish initialisation for the jQuery UI date picker plugin. */ +/* Written by Izzet Emre Erkan (kara@karalamalar.net). */ +jQuery(function($){ + $.datepicker.regional['tr'] = { + closeText: 'kapat', + prevText: '<geri', + nextText: 'ileri>', + currentText: 'bugün', + monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', + 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], + monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', + 'Tem','Ağu','Eyl','Eki','Kas','Ara'], + dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], + dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + weekHeader: 'Hf', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['tr']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-uk.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-uk.js index 226c74d..fc582ea 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-uk.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-uk.js @@ -1,24 +1,24 @@ -/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ -/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ -/* Corrected by Igor Milla (igor.fsp.milla@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['uk'] = { - closeText: 'Закрити', - prevText: '<', - nextText: '>', - currentText: 'Сьогодні', - monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', - 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], - monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', - 'Лип','Сер','Вер','Жов','Лис','Гру'], - dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'], - dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], - dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], - weekHeader: 'Тиж', - dateFormat: 'dd/mm/yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['uk']); +/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ +/* Corrected by Igor Milla (igor.fsp.milla@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['uk'] = { + closeText: 'Закрити', + prevText: '<', + nextText: '>', + currentText: 'Сьогодні', + monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', + 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], + monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', + 'Лип','Сер','Вер','Жов','Лис','Гру'], + dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'], + dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], + dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], + weekHeader: 'Тиж', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['uk']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-vi.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-vi.js index 0d3ab5f..bc18d02 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-vi.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-vi.js @@ -1,23 +1,23 @@ -/* Vietnamese initialisation for the jQuery UI date picker plugin. */ -/* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */ -jQuery(function($){ - $.datepicker.regional['vi'] = { - closeText: 'Đóng', - prevText: '<Trước', - nextText: 'Tiếp>', - currentText: 'Hôm nay', - monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu', - 'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'], - monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', - 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'], - dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'], - dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], - dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], - weekHeader: 'Tu', - dateFormat: 'dd/mm/yy', - firstDay: 0, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['vi']); +/* Vietnamese initialisation for the jQuery UI date picker plugin. */ +/* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */ +jQuery(function($){ + $.datepicker.regional['vi'] = { + closeText: 'Đóng', + prevText: '<Trước', + nextText: 'Tiếp>', + currentText: 'Hôm nay', + monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu', + 'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'], + monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', + 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'], + dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'], + dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], + dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], + weekHeader: 'Tu', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['vi']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-zh-cn.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-zh-cn.js index 2b5a8b5..d7f8415 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-zh-cn.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-zh-cn.js @@ -1,23 +1,23 @@ -/* Chinese initialisation for the jQuery UI date picker plugin. */ -/* Written by Cloudream (cloudream@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['zh-CN'] = { - closeText: '关闭', - prevText: '<上月', - nextText: '下月>', - currentText: '今天', - monthNames: ['一月','二月','三月','四月','五月','六月', - '七月','八月','九月','十月','十一月','十二月'], - monthNamesShort: ['一月','二月','三月','四月','五月','六月', - '七月','八月','九月','十月','十一月','十二月'], - dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], - dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], - dayNamesMin: ['日','一','二','三','四','五','六'], - weekHeader: '周', - dateFormat: 'yy-mm-dd', - firstDay: 1, - isRTL: false, - showMonthAfterYear: true, - yearSuffix: '年'}; - $.datepicker.setDefaults($.datepicker.regional['zh-CN']); +/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Cloudream (cloudream@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-CN'] = { + closeText: '关闭', + prevText: '<上月', + nextText: '下月>', + currentText: '今天', + monthNames: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + monthNamesShort: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], + dayNamesMin: ['日','一','二','三','四','五','六'], + weekHeader: '周', + dateFormat: 'yy-mm-dd', + firstDay: 1, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: '年'}; + $.datepicker.setDefaults($.datepicker.regional['zh-CN']); }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/index.html b/assets/grocery_crud/js/jquery_plugins/ui/i18n/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/index.html +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/index.html b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/index.html +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ar.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ar.js index 83491a9..eb5d743 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ar.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ar.js @@ -1,12 +1,12 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale ar, ar-eg - */ -/* Ashraf Kaabi -- mail@kaabi.info */ - -$.extend($.ui.multiselect.locale, { - addAll:'اضافة الكل', - removeAll:'حذف الكل', - itemsCount:'الاختيارات المحددة' -}); +/** + * Localization strings for the UI Multiselect widget + * + * @locale ar, ar-eg + */ +/* Ashraf Kaabi -- mail@kaabi.info */ + +$.extend($.ui.multiselect.locale, { + addAll:'اضافة الكل', + removeAll:'حذف الكل', + itemsCount:'الاختيارات المحددة' +}); diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-de.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-de.js index ad8e9fb..7081dbf 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-de.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-de.js @@ -1,11 +1,11 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale de, de-DE, de-AT, de-CH - */ - -$.extend($.ui.multiselect.locale, { - addAll:'Alle hinzufügen', - removeAll:'Alle entfernen', - itemsCount:'Einträge ausgewählt' +/** + * Localization strings for the UI Multiselect widget + * + * @locale de, de-DE, de-AT, de-CH + */ + +$.extend($.ui.multiselect.locale, { + addAll:'Alle hinzufügen', + removeAll:'Alle entfernen', + itemsCount:'Einträge ausgewählt' }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-el.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-el.js index 596a641..c9070d9 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-el.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-el.js @@ -1,11 +1,11 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale el, GR - */ - -$.extend($.ui.multiselect.locale, { - addAll:'Επιλογή όλων', - removeAll:'Αφαίρεση όλων', - itemsCount:'επιλεγμένα στοιχεία' +/** + * Localization strings for the UI Multiselect widget + * + * @locale el, GR + */ + +$.extend($.ui.multiselect.locale, { + addAll:'Επιλογή όλων', + removeAll:'Αφαίρεση όλων', + itemsCount:'επιλεγμένα στοιχεία' }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-en.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-en.js index 4e9e452..1246620 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-en.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-en.js @@ -1,11 +1,11 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale en, en-US - */ - -$.extend($.ui.multiselect.locale, { - addAll:'Add all', - removeAll:'Remove all', - itemsCount:'items selected' +/** + * Localization strings for the UI Multiselect widget + * + * @locale en, en-US + */ + +$.extend($.ui.multiselect.locale, { + addAll:'Add all', + removeAll:'Remove all', + itemsCount:'items selected' }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-es.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-es.js index 3cde265..1e5b50c 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-es.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-es.js @@ -1,11 +1,11 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale es, es-ES - */ - -$.extend($.ui.multiselect.locale, { - addAll:'Agregar todos', - removeAll:'Remover todos', - itemsCount:'Objetos seleccionados' +/** + * Localization strings for the UI Multiselect widget + * + * @locale es, es-ES + */ + +$.extend($.ui.multiselect.locale, { + addAll:'Agregar todos', + removeAll:'Remover todos', + itemsCount:'Objetos seleccionados' }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-fr.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-fr.js index 43bb3e0..ea290f9 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-fr.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-fr.js @@ -1,11 +1,11 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale fr, fr-FR, fr-CA - */ - -$.extend($.ui.multiselect.locale, { - addAll:'Ajouter tout', - removeAll:'Supprimer tout', - itemsCount:'items sélectionnés' +/** + * Localization strings for the UI Multiselect widget + * + * @locale fr, fr-FR, fr-CA + */ + +$.extend($.ui.multiselect.locale, { + addAll:'Ajouter tout', + removeAll:'Supprimer tout', + itemsCount:'items sélectionnés' }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-it.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-it.js index 20b062d..b9a6470 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-it.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-it.js @@ -1,13 +1,13 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale it, it-IT - */ - -$.extend($.ui.multiselect, { - locale: { - addAll:'Aggiungi tutti', - removeAll:'Rimuovi tutti', - itemsCount:'elementi selezionati' - } +/** + * Localization strings for the UI Multiselect widget + * + * @locale it, it-IT + */ + +$.extend($.ui.multiselect, { + locale: { + addAll:'Aggiungi tutti', + removeAll:'Rimuovi tutti', + itemsCount:'elementi selezionati' + } }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ja.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ja.js index d3cbf97..b98b861 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ja.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ja.js @@ -1,11 +1,11 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale ja, ja-JP - */ - -$.extend($.ui.multiselect.locale, { - addAll:'すべて選択', - removeAll:'すべて削除', - itemsCount:'個選択' +/** + * Localization strings for the UI Multiselect widget + * + * @locale ja, ja-JP + */ + +$.extend($.ui.multiselect.locale, { + addAll:'すべて選択', + removeAll:'すべて削除', + itemsCount:'個選択' }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-pt-br.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-pt-br.js index f13539d..6144477 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-pt-br.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-pt-br.js @@ -1,11 +1,11 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale pt, pt-BR - */ - -$.extend($.ui.multiselect.locale, { - addAll:'Adicionar todos', - removeAll:'Remover todos', - itemsCount:'Itens selecionados' +/** + * Localization strings for the UI Multiselect widget + * + * @locale pt, pt-BR + */ + +$.extend($.ui.multiselect.locale, { + addAll:'Adicionar todos', + removeAll:'Remover todos', + itemsCount:'Itens selecionados' }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ru.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ru.js index 66a3a80..a364993 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ru.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-ru.js @@ -1,11 +1,11 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale ru, ru-RU - */ - -$.extend($.ui.multiselect.locale, { - addAll:'Добавить все', - removeAll:'Удалить все', - itemsCount:'элементов выбрано' +/** + * Localization strings for the UI Multiselect widget + * + * @locale ru, ru-RU + */ + +$.extend($.ui.multiselect.locale, { + addAll:'Добавить все', + removeAll:'Удалить все', + itemsCount:'элементов выбрано' }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-uk.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-uk.js index b64295f..3ecddcf 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-uk.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/multiselect/ui-multiselect-uk.js @@ -1,11 +1,11 @@ -/** - * Localization strings for the UI Multiselect widget - * - * @locale uk, uk-UK - */ - -$.extend($.ui.multiselect.locale, { - addAll:'Додати все', - removeAll:'Видалити все', - itemsCount:'елементів обрано' +/** + * Localization strings for the UI Multiselect widget + * + * @locale uk, uk-UK + */ + +$.extend($.ui.multiselect.locale, { + addAll:'Додати все', + removeAll:'Видалити все', + itemsCount:'елементів обрано' }); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/index.html b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/index.html +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-af.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-af.js index 8d4dfa0..baa9ecc 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-af.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-af.js @@ -1,21 +1,21 @@ -/* Afrikaans translation for the jQuery Timepicker Addon */ -/* Written by Deon Heyns */ -(function($) { - $.timepicker.regional['af'] = { - timeOnlyTitle: 'Kies Tyd', - timeText: 'Tyd ', - hourText: 'Ure ', - minuteText: 'Minute', - secondText: 'Sekondes', - millisecText: 'Millisekondes', - timezoneText: 'Tydsone', - currentText: 'Huidige Tyd', - closeText: 'Klaar', - timeFormat: 'hh:mm tt', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['af']); +/* Afrikaans translation for the jQuery Timepicker Addon */ +/* Written by Deon Heyns */ +(function($) { + $.timepicker.regional['af'] = { + timeOnlyTitle: 'Kies Tyd', + timeText: 'Tyd ', + hourText: 'Ure ', + minuteText: 'Minute', + secondText: 'Sekondes', + millisecText: 'Millisekondes', + timezoneText: 'Tydsone', + currentText: 'Huidige Tyd', + closeText: 'Klaar', + timeFormat: 'hh:mm tt', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['af']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ar.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ar.js index cd33c80..6e561b0 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ar.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ar.js @@ -1,21 +1,21 @@ -/* Arabic translation for the jQuery Timepicker Addon */ -/* Written by Ashraf Kaabi */ -(function($) { - $.timepicker.regional['ar'] = { - timeOnlyTitle: 'اختار الساعة', - timeText: 'الساعة', - hourText: 'الساعات', - minuteText: 'الدقائق', - secondText: 'الثواني', - millisecText: 'ميلي ثانية', - timezoneText: 'توقيت', - currentText: 'الآن', - closeText: 'الانتهاء', - timeFormat: 'hh:mm', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['ar']); -})(jQuery); +/* Arabic translation for the jQuery Timepicker Addon */ +/* Written by Ashraf Kaabi */ +(function($) { + $.timepicker.regional['ar'] = { + timeOnlyTitle: 'اختار الساعة', + timeText: 'الساعة', + hourText: 'الساعات', + minuteText: 'الدقائق', + secondText: 'الثواني', + millisecText: 'ميلي ثانية', + timezoneText: 'توقيت', + currentText: 'الآن', + closeText: 'الانتهاء', + timeFormat: 'hh:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ar']); +})(jQuery); diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-bg.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-bg.js index b825864..dd106ea 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-bg.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-bg.js @@ -1,21 +1,21 @@ -/* Bulgarian translation for the jQuery Timepicker Addon */ -/* Written by Plamen Kovandjiev */ -(function($) { - $.timepicker.regional['bg'] = { - timeOnlyTitle: 'Изберете време', - timeText: 'Време', - hourText: 'Час', - minuteText: 'Минути', - secondText: 'Секунди', - millisecText: 'Милисекунди', - timezoneText: 'Часови пояс', - currentText: 'Сега', - closeText: 'Затвори', - timeFormat: 'hh:mm tt', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['bg']); +/* Bulgarian translation for the jQuery Timepicker Addon */ +/* Written by Plamen Kovandjiev */ +(function($) { + $.timepicker.regional['bg'] = { + timeOnlyTitle: 'Изберете време', + timeText: 'Време', + hourText: 'Час', + minuteText: 'Минути', + secondText: 'Секунди', + millisecText: 'Милисекунди', + timezoneText: 'Часови пояс', + currentText: 'Сега', + closeText: 'Затвори', + timeFormat: 'hh:mm tt', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['bg']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-cs.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-cs.js index e3d805b..17b92e6 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-cs.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-cs.js @@ -1,21 +1,21 @@ -/* Czech translation for the jQuery Timepicker Addon */ -/* Written by Ondřej Vodáček */ -(function($) { - $.timepicker.regional['cs'] = { - timeOnlyTitle: 'Vyberte čas', - timeText: 'Čas', - hourText: 'Hodiny', - minuteText: 'Minuty', - secondText: 'Vteřiny', - millisecText: 'Milisekundy', - timezoneText: 'Časové pásmo', - currentText: 'Nyní', - closeText: 'Zavřít', - timeFormat: 'h:m', - amNames: ['dop.', 'AM', 'A'], - pmNames: ['odp.', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['cs']); +/* Czech translation for the jQuery Timepicker Addon */ +/* Written by Ondřej Vodáček */ +(function($) { + $.timepicker.regional['cs'] = { + timeOnlyTitle: 'Vyberte čas', + timeText: 'Čas', + hourText: 'Hodiny', + minuteText: 'Minuty', + secondText: 'Vteřiny', + millisecText: 'Milisekundy', + timezoneText: 'Časové pásmo', + currentText: 'Nyní', + closeText: 'Zavřít', + timeFormat: 'h:m', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['odp.', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['cs']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-de.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-de.js index 7d75661..efdffd3 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-de.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-de.js @@ -1,21 +1,21 @@ -/* German translation for the jQuery Timepicker Addon */ -/* Written by Marvin */ -(function($) { - $.timepicker.regional['de'] = { - timeOnlyTitle: 'Zeit Wählen', - timeText: 'Zeit', - hourText: 'Stunde', - minuteText: 'Minute', - secondText: 'Sekunde', - millisecText: 'Millisekunde', - timezoneText: 'Zeitzone', - currentText: 'Jetzt', - closeText: 'Fertig', - timeFormat: 'hh:mm tt', - amNames: ['vorm.', 'AM', 'A'], - pmNames: ['nachm.', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['de']); +/* German translation for the jQuery Timepicker Addon */ +/* Written by Marvin */ +(function($) { + $.timepicker.regional['de'] = { + timeOnlyTitle: 'Zeit Wählen', + timeText: 'Zeit', + hourText: 'Stunde', + minuteText: 'Minute', + secondText: 'Sekunde', + millisecText: 'Millisekunde', + timezoneText: 'Zeitzone', + currentText: 'Jetzt', + closeText: 'Fertig', + timeFormat: 'hh:mm tt', + amNames: ['vorm.', 'AM', 'A'], + pmNames: ['nachm.', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['de']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-el.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-el.js index fa8e1be..ca96915 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-el.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-el.js @@ -1,21 +1,21 @@ -/* Hellenic translation for the jQuery Timepicker Addon */ -/* Written by Christos Pontikis */ -(function($) { - $.timepicker.regional['el'] = { - timeOnlyTitle: 'Επιλογή ώρας', - timeText: 'Ώρα', - hourText: 'Ώρες', - minuteText: 'Λεπτά', - secondText: 'Δευτερόλεπτα', - millisecText: 'μιλιδευτερόλεπτο', - timezoneText: 'Ζώνη ώρας', - currentText: 'Τώρα', - closeText: 'Κλείσιμο', - timeFormat: 'hh:mm', - amNames: ['π.μ.', 'AM', 'A'], - pmNames: ['μ.μ.', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['el']); +/* Hellenic translation for the jQuery Timepicker Addon */ +/* Written by Christos Pontikis */ +(function($) { + $.timepicker.regional['el'] = { + timeOnlyTitle: 'Επιλογή ώρας', + timeText: 'Ώρα', + hourText: 'Ώρες', + minuteText: 'Λεπτά', + secondText: 'Δευτερόλεπτα', + millisecText: 'μιλιδευτερόλεπτο', + timezoneText: 'Ζώνη ώρας', + currentText: 'Τώρα', + closeText: 'Κλείσιμο', + timeFormat: 'hh:mm', + amNames: ['π.μ.', 'AM', 'A'], + pmNames: ['μ.μ.', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['el']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-es.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-es.js index 03c8eae..ad7e885 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-es.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-es.js @@ -1,21 +1,21 @@ -/* Spanish translation for the jQuery Timepicker Addon */ -/* Written by Ianaré Sévi */ -(function($) { - $.timepicker.regional['es'] = { - timeOnlyTitle: 'Elegir una hora', - timeText: 'Hora', - hourText: 'Horas', - minuteText: 'Minutos', - secondText: 'Segundos', - millisecText: 'Milisegundos', - timezoneText: 'Huso horario', - currentText: 'Ahora', - closeText: 'Cerrar', - timeFormat: 'hh:mm', - amNames: ['a.m.', 'AM', 'A'], - pmNames: ['p.m.', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['es']); +/* Spanish translation for the jQuery Timepicker Addon */ +/* Written by Ianaré Sévi */ +(function($) { + $.timepicker.regional['es'] = { + timeOnlyTitle: 'Elegir una hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milisegundos', + timezoneText: 'Huso horario', + currentText: 'Ahora', + closeText: 'Cerrar', + timeFormat: 'hh:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['es']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-fr.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-fr.js index da10b9e..26e0cf5 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-fr.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-fr.js @@ -1,21 +1,21 @@ -/* French translation for the jQuery Timepicker Addon */ -/* Written by Thomas Lété */ -(function($) { - $.timepicker.regional['fr'] = { - timeOnlyTitle: 'Choisir une heure', - timeText: 'Heure', - hourText: 'Heures', - minuteText: 'Minutes', - secondText: 'Secondes', - millisecText: 'Millisecondes', - timezoneText: 'Fuseau horaire', - currentText: 'Maintenant', - closeText: 'Terminé', - timeFormat: 'hh:mm', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['fr']); +/* French translation for the jQuery Timepicker Addon */ +/* Written by Thomas Lété */ +(function($) { + $.timepicker.regional['fr'] = { + timeOnlyTitle: 'Choisir une heure', + timeText: 'Heure', + hourText: 'Heures', + minuteText: 'Minutes', + secondText: 'Secondes', + millisecText: 'Millisecondes', + timezoneText: 'Fuseau horaire', + currentText: 'Maintenant', + closeText: 'Terminé', + timeFormat: 'hh:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['fr']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-hu.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-hu.js index 2d38cc4..253870b 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-hu.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-hu.js @@ -1,21 +1,21 @@ -/* Hungarian translation for the jQuery Timepicker Addon */ -/* Written by Vas Gábor */ -(function($) { - $.timepicker.regional['hu'] = { - timeOnlyTitle: 'Válasszon időpontot', - timeText: 'Idő', - hourText: 'Óra', - minuteText: 'Perc', - secondText: 'Másodperc', - millisecText: 'Milliszekundumos', - timezoneText: 'Időzóna', - currentText: 'Most', - closeText: 'Kész', - timeFormat: 'hh:mm tt', - amNames: ['de.', 'AM', 'A'], - pmNames: ['du.', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['hu']); +/* Hungarian translation for the jQuery Timepicker Addon */ +/* Written by Vas Gábor */ +(function($) { + $.timepicker.regional['hu'] = { + timeOnlyTitle: 'Válasszon időpontot', + timeText: 'Idő', + hourText: 'Óra', + minuteText: 'Perc', + secondText: 'Másodperc', + millisecText: 'Milliszekundumos', + timezoneText: 'Időzóna', + currentText: 'Most', + closeText: 'Kész', + timeFormat: 'hh:mm tt', + amNames: ['de.', 'AM', 'A'], + pmNames: ['du.', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['hu']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-id.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-id.js index 10f7b9e..908f68c 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-id.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-id.js @@ -1,21 +1,21 @@ -/* Indonesian translation for the jQuery Timepicker Addon */ -/* Written by Nia */ -(function($) { - $.timepicker.regional['id'] = { - timeOnlyTitle: 'Pilih Waktu', - timeText: 'Waktu', - hourText: 'Pukul', - minuteText: 'Menit', - secondText: 'Detik', - millisecText: 'Milidetik', - timezoneText: 'Zona Waktu', - currentText: 'Sekarang', - closeText: 'OK', - timeFormat: 'hh:mm tt', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['id']); +/* Indonesian translation for the jQuery Timepicker Addon */ +/* Written by Nia */ +(function($) { + $.timepicker.regional['id'] = { + timeOnlyTitle: 'Pilih Waktu', + timeText: 'Waktu', + hourText: 'Pukul', + minuteText: 'Menit', + secondText: 'Detik', + millisecText: 'Milidetik', + timezoneText: 'Zona Waktu', + currentText: 'Sekarang', + closeText: 'OK', + timeFormat: 'hh:mm tt', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['id']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-it.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-it.js index 5ce47eb..b0d84ef 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-it.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-it.js @@ -1,21 +1,21 @@ -/* Italian translation for the jQuery Timepicker Addon */ -/* Written by Marco "logicoder" Del Tongo */ -(function($) { - $.timepicker.regional['it'] = { - timeOnlyTitle: 'Scegli orario', - timeText: 'Orario', - hourText: 'Ora', - minuteText: 'Minuto', - secondText: 'Secondo', - millisecText: 'Millisecondo', - timezoneText: 'Fuso orario', - currentText: 'Adesso', - closeText: 'Chiudi', - timeFormat: 'hh:mm', - amNames: ['m.', 'AM', 'A'], - pmNames: ['p.', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['it']); +/* Italian translation for the jQuery Timepicker Addon */ +/* Written by Marco "logicoder" Del Tongo */ +(function($) { + $.timepicker.regional['it'] = { + timeOnlyTitle: 'Scegli orario', + timeText: 'Orario', + hourText: 'Ora', + minuteText: 'Minuto', + secondText: 'Secondo', + millisecText: 'Millisecondo', + timezoneText: 'Fuso orario', + currentText: 'Adesso', + closeText: 'Chiudi', + timeFormat: 'hh:mm', + amNames: ['m.', 'AM', 'A'], + pmNames: ['p.', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['it']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ja.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ja.js index 910e6c8..9b52156 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ja.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ja.js @@ -1,21 +1,21 @@ -/* Japanese translation for the jQuery Timepicker Addon */ -/* Written by Jun Omae */ -(function($) { - $.timepicker.regional['ja'] = { - timeOnlyTitle: '時間を選択', - timeText: '時間', - hourText: '時', - minuteText: '分', - secondText: '秒', - millisecText: 'ミリ秒', - timezoneText: 'タイムゾーン', - currentText: '現時刻', - closeText: '閉じる', - timeFormat: 'hh:mm tt', - amNames: ['午前', 'AM', 'A'], - pmNames: ['午後', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['ja']); +/* Japanese translation for the jQuery Timepicker Addon */ +/* Written by Jun Omae */ +(function($) { + $.timepicker.regional['ja'] = { + timeOnlyTitle: '時間を選択', + timeText: '時間', + hourText: '時', + minuteText: '分', + secondText: '秒', + millisecText: 'ミリ秒', + timezoneText: 'タイムゾーン', + currentText: '現時刻', + closeText: '閉じる', + timeFormat: 'hh:mm tt', + amNames: ['午前', 'AM', 'A'], + pmNames: ['午後', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ja']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ko.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ko.js index 69ce6eb..2a278ba 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ko.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ko.js @@ -1,21 +1,21 @@ -/* Korean translation for the jQuery Timepicker Addon */ -/* Written by Genie */ -(function($) { - $.timepicker.regional['ko'] = { - timeOnlyTitle: '시간 선택', - timeText: '시간', - hourText: '시', - minuteText: '분', - secondText: '초', - millisecText: '밀리초', - timezoneText: '표준 시간대', - currentText: '현재 시각', - closeText: '닫기', - timeFormat: 'tt h:mm', - amNames: ['오전', 'AM', 'A'], - pmNames: ['오후', 'PM', 'P'], - ampm: true, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['ko']); -})(jQuery); +/* Korean translation for the jQuery Timepicker Addon */ +/* Written by Genie */ +(function($) { + $.timepicker.regional['ko'] = { + timeOnlyTitle: '시간 선택', + timeText: '시간', + hourText: '시', + minuteText: '분', + secondText: '초', + millisecText: '밀리초', + timezoneText: '표준 시간대', + currentText: '현재 시각', + closeText: '닫기', + timeFormat: 'tt h:mm', + amNames: ['오전', 'AM', 'A'], + pmNames: ['오후', 'PM', 'P'], + ampm: true, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ko']); +})(jQuery); diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-nl.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-nl.js index 54a1c7f..23ee8ad 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-nl.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-nl.js @@ -1,21 +1,21 @@ -/* Dutch translation for the jQuery Timepicker Addon */ -/* Written by Martijn van der Lee */ -(function($) { - $.timepicker.regional['nl'] = { - timeOnlyTitle: 'Tijdstip', - timeText: 'Tijd', - hourText: 'Uur', - minuteText: 'Minuut', - secondText: 'Seconde', - millisecText: 'Milliseconde', - timezoneText: 'Tijdzone', - currentText: 'Vandaag', - closeText: 'Sluiten', - timeFormat: 'hh:mm tt', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['nl']); +/* Dutch translation for the jQuery Timepicker Addon */ +/* Written by Martijn van der Lee */ +(function($) { + $.timepicker.regional['nl'] = { + timeOnlyTitle: 'Tijdstip', + timeText: 'Tijd', + hourText: 'Uur', + minuteText: 'Minuut', + secondText: 'Seconde', + millisecText: 'Milliseconde', + timezoneText: 'Tijdzone', + currentText: 'Vandaag', + closeText: 'Sluiten', + timeFormat: 'hh:mm tt', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['nl']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-no.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-no.js index e75e804..4f24e57 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-no.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-no.js @@ -1,20 +1,20 @@ -/* Norwegian translation for the jQuery Timepicker Addon */ -/* Written by Morten Hauan (http://hauan.me) */ -(function($) { - $.timepicker.regional['no'] = { - timeOnlyTitle: 'Velg tid', - timeText: 'Tid', - hourText: 'Time', - minuteText: 'Minutt', - secondText: 'Sekund', - millisecText: 'Millisekund', - timezoneText: 'Tidssone', - currentText: 'Nå', - closeText: 'Lukk', - timeFormat: 'HH:mm', - amNames: ['am', 'AM', 'A'], - pmNames: ['pm', 'PM', 'P'], - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['no']); +/* Norwegian translation for the jQuery Timepicker Addon */ +/* Written by Morten Hauan (http://hauan.me) */ +(function($) { + $.timepicker.regional['no'] = { + timeOnlyTitle: 'Velg tid', + timeText: 'Tid', + hourText: 'Time', + minuteText: 'Minutt', + secondText: 'Sekund', + millisecText: 'Millisekund', + timezoneText: 'Tidssone', + currentText: 'Nå', + closeText: 'Lukk', + timeFormat: 'HH:mm', + amNames: ['am', 'AM', 'A'], + pmNames: ['pm', 'PM', 'P'], + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['no']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pl.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pl.js index ded85b2..7c5e80f 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pl.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pl.js @@ -1,21 +1,21 @@ -/* Polish translation for the jQuery Timepicker Addon */ -/* Written by Michał Pena */ -(function($) { - $.timepicker.regional['pl'] = { - timeOnlyTitle: 'Wybierz godzinę', - timeText: 'Czas', - hourText: 'Godzina', - minuteText: 'Minuta', - secondText: 'Sekunda', - millisecText: 'Milisekunda', - timezoneText: 'Strefa czasowa', - currentText: 'Teraz', - closeText: 'Gotowe', - timeFormat: 'hh:mm tt', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['pl']); +/* Polish translation for the jQuery Timepicker Addon */ +/* Written by Michał Pena */ +(function($) { + $.timepicker.regional['pl'] = { + timeOnlyTitle: 'Wybierz godzinę', + timeText: 'Czas', + hourText: 'Godzina', + minuteText: 'Minuta', + secondText: 'Sekunda', + millisecText: 'Milisekunda', + timezoneText: 'Strefa czasowa', + currentText: 'Teraz', + closeText: 'Gotowe', + timeFormat: 'hh:mm tt', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['pl']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pt-br.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pt-br.js index 48dfb7a..d707700 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pt-br.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pt-br.js @@ -1,21 +1,21 @@ -/* Brazilian Portuguese translation for the jQuery Timepicker Addon */ -/* Written by Diogo Damiani (diogodamiani@gmail.com) */ -(function($) { - $.timepicker.regional['pt-BR'] = { - timeOnlyTitle: 'Escolha a horário', - timeText: 'Horário', - hourText: 'Hora', - minuteText: 'Minutos', - secondText: 'Segundos', - millisecText: 'Milissegundos', - timezoneText: 'Fuso horário', - currentText: 'Agora', - closeText: 'Fechar', - timeFormat: 'hh:mm', - amNames: ['a.m.', 'AM', 'A'], - pmNames: ['p.m.', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['pt-BR']); +/* Brazilian Portuguese translation for the jQuery Timepicker Addon */ +/* Written by Diogo Damiani (diogodamiani@gmail.com) */ +(function($) { + $.timepicker.regional['pt-BR'] = { + timeOnlyTitle: 'Escolha a horário', + timeText: 'Horário', + hourText: 'Hora', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milissegundos', + timezoneText: 'Fuso horário', + currentText: 'Agora', + closeText: 'Fechar', + timeFormat: 'hh:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['pt-BR']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pt.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pt.js index 60788a5..3efb7d7 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pt.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-pt.js @@ -1,21 +1,21 @@ -/* Portuguese translation for the jQuery Timepicker Addon */ -/* Written by Luan Almeida */ -(function($) { - $.timepicker.regional['pt'] = { - timeOnlyTitle: 'Escolha uma hora', - timeText: 'Hora', - hourText: 'Horas', - minuteText: 'Minutos', - secondText: 'Segundos', - millisecText: 'Milissegundos', - timezoneText: 'Fuso horário', - currentText: 'Agora', - closeText: 'Fechar', - timeFormat: 'hh:mm', - amNames: ['a.m.', 'AM', 'A'], - pmNames: ['p.m.', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['pt']); +/* Portuguese translation for the jQuery Timepicker Addon */ +/* Written by Luan Almeida */ +(function($) { + $.timepicker.regional['pt'] = { + timeOnlyTitle: 'Escolha uma hora', + timeText: 'Hora', + hourText: 'Horas', + minuteText: 'Minutos', + secondText: 'Segundos', + millisecText: 'Milissegundos', + timezoneText: 'Fuso horário', + currentText: 'Agora', + closeText: 'Fechar', + timeFormat: 'hh:mm', + amNames: ['a.m.', 'AM', 'A'], + pmNames: ['p.m.', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['pt']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ro.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ro.js index 26e8e93..083aa78 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ro.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ro.js @@ -1,21 +1,21 @@ -/* Romanian translation for the jQuery Timepicker Addon */ -/* Written by Romeo Adrian Cioaba */ -(function($) { - $.timepicker.regional['ro'] = { - timeOnlyTitle: 'Alegeţi o oră', - timeText: 'Timp', - hourText: 'Ore', - minuteText: 'Minute', - secondText: 'Secunde', - millisecText: 'Milisecunde', - timezoneText: 'Fus orar', - currentText: 'Acum', - closeText: 'Închide', - timeFormat: 'hh:mm', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['ro']); +/* Romanian translation for the jQuery Timepicker Addon */ +/* Written by Romeo Adrian Cioaba */ +(function($) { + $.timepicker.regional['ro'] = { + timeOnlyTitle: 'Alegeţi o oră', + timeText: 'Timp', + hourText: 'Ore', + minuteText: 'Minute', + secondText: 'Secunde', + millisecText: 'Milisecunde', + timezoneText: 'Fus orar', + currentText: 'Acum', + closeText: 'Închide', + timeFormat: 'hh:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ro']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ru.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ru.js index eb94ef4..ef0f713 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ru.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-ru.js @@ -1,21 +1,21 @@ -/* Russian translation for the jQuery Timepicker Addon */ -/* Written by Trent Richardson */ -(function($) { - $.timepicker.regional['ru'] = { - timeOnlyTitle: 'Выберите время', - timeText: 'Время', - hourText: 'Часы', - minuteText: 'Минуты', - secondText: 'Секунды', - millisecText: 'Миллисекунды', - timezoneText: 'Часовой пояс', - currentText: 'Сейчас', - closeText: 'Закрыть', - timeFormat: 'hh:mm tt', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['ru']); +/* Russian translation for the jQuery Timepicker Addon */ +/* Written by Trent Richardson */ +(function($) { + $.timepicker.regional['ru'] = { + timeOnlyTitle: 'Выберите время', + timeText: 'Время', + hourText: 'Часы', + minuteText: 'Минуты', + secondText: 'Секунды', + millisecText: 'Миллисекунды', + timezoneText: 'Часовой пояс', + currentText: 'Сейчас', + closeText: 'Закрыть', + timeFormat: 'hh:mm tt', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['ru']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-sk.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-sk.js index 87a42fd..dedde06 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-sk.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-sk.js @@ -1,21 +1,21 @@ -/* Slovak translation for the jQuery Timepicker Addon */ -/* Written by David Vallner */ -(function($) { - $.timepicker.regional['sk'] = { - timeOnlyTitle: 'Zvoľte čas', - timeText: 'Čas', - hourText: 'Hodiny', - minuteText: 'Minúty', - secondText: 'Sekundy', - millisecText: 'Milisekundy', - timezoneText: 'Časové pásmo', - currentText: 'Teraz', - closeText: 'Zavrieť', - timeFormat: 'h:m', - amNames: ['dop.', 'AM', 'A'], - pmNames: ['pop.', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['sk']); +/* Slovak translation for the jQuery Timepicker Addon */ +/* Written by David Vallner */ +(function($) { + $.timepicker.regional['sk'] = { + timeOnlyTitle: 'Zvoľte čas', + timeText: 'Čas', + hourText: 'Hodiny', + minuteText: 'Minúty', + secondText: 'Sekundy', + millisecText: 'Milisekundy', + timezoneText: 'Časové pásmo', + currentText: 'Teraz', + closeText: 'Zavrieť', + timeFormat: 'h:m', + amNames: ['dop.', 'AM', 'A'], + pmNames: ['pop.', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['sk']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-tr.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-tr.js index 7b3c02f..2b1c005 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-tr.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-tr.js @@ -1,21 +1,21 @@ -/* Turkish translation for the jQuery Timepicker Addon */ -/* Written by Fehmi Can Saglam, Edited by Goktug Ozturk */ -(function($) { - $.timepicker.regional['tr'] = { - timeOnlyTitle: 'Zaman Seçiniz', - timeText: 'Zaman', - hourText: 'Saat', - minuteText: 'Dakika', - secondText: 'Saniye', - millisecText: 'Milisaniye', - timezoneText: 'Zaman Dilimi', - currentText: 'Şu an', - closeText: 'Tamam', - timeFormat: 'hh:mm', - amNames: ['ÖÖ', 'Ö'], - pmNames: ['ÖS', 'S'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['tr']); +/* Turkish translation for the jQuery Timepicker Addon */ +/* Written by Fehmi Can Saglam, Edited by Goktug Ozturk */ +(function($) { + $.timepicker.regional['tr'] = { + timeOnlyTitle: 'Zaman Seçiniz', + timeText: 'Zaman', + hourText: 'Saat', + minuteText: 'Dakika', + secondText: 'Saniye', + millisecText: 'Milisaniye', + timezoneText: 'Zaman Dilimi', + currentText: 'Şu an', + closeText: 'Tamam', + timeFormat: 'hh:mm', + amNames: ['ÖÖ', 'Ö'], + pmNames: ['ÖS', 'S'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['tr']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-uk.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-uk.js index 5cfb23a..51e412a 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-uk.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-uk.js @@ -1,21 +1,21 @@ -/* Ukrainian translation for the jQuery Timepicker Addon */ -/* Written by Sergey Noskov */ -(function($) { - $.timepicker.regional['uk'] = { - timeOnlyTitle: 'Виберіть час', - timeText: 'Час', - hourText: 'Години', - minuteText: 'Хвилини', - secondText: 'Секунди', - millisecText: 'Мілісекунди', - timezoneText: 'Часовий пояс', - currentText: 'Зараз', - closeText: 'Закрити', - timeFormat: 'hh:mm tt', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['uk']); +/* Ukrainian translation for the jQuery Timepicker Addon */ +/* Written by Sergey Noskov */ +(function($) { + $.timepicker.regional['uk'] = { + timeOnlyTitle: 'Виберіть час', + timeText: 'Час', + hourText: 'Години', + minuteText: 'Хвилини', + secondText: 'Секунди', + millisecText: 'Мілісекунди', + timezoneText: 'Часовий пояс', + currentText: 'Зараз', + closeText: 'Закрити', + timeFormat: 'hh:mm tt', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['uk']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-vi.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-vi.js index 120083b..272f4ea 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-vi.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-vi.js @@ -1,21 +1,21 @@ -/* Vietnamese translation for the jQuery Timepicker Addon */ -/* Written by Nguyen Dinh Trung */ -(function($) { - $.timepicker.regional['vi'] = { - timeOnlyTitle: 'Chọn giờ', - timeText: 'Thời gian', - hourText: 'Giờ', - minuteText: 'Phút', - secondText: 'Giây', - millisecText: 'Phần nghìn giây', - timezoneText: 'Múi giờ', - currentText: 'Hiện thời', - closeText: 'Đóng', - timeFormat: 'h:m', - amNames: ['SA', 'AM', 'A'], - pmNames: ['CH', 'PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['vi']); +/* Vietnamese translation for the jQuery Timepicker Addon */ +/* Written by Nguyen Dinh Trung */ +(function($) { + $.timepicker.regional['vi'] = { + timeOnlyTitle: 'Chọn giờ', + timeText: 'Thời gian', + hourText: 'Giờ', + minuteText: 'Phút', + secondText: 'Giây', + millisecText: 'Phần nghìn giây', + timezoneText: 'Múi giờ', + currentText: 'Hiện thời', + closeText: 'Đóng', + timeFormat: 'h:m', + amNames: ['SA', 'AM', 'A'], + pmNames: ['CH', 'PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['vi']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-zh-cn.js b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-zh-cn.js index 6911111..54a6858 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-zh-cn.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-zh-cn.js @@ -1,21 +1,21 @@ -/* Simplified Chinese translation for the jQuery Timepicker Addon / -/ Written by Will Lu */ -(function($) { - $.timepicker.regional['zh-CN'] = { - timeOnlyTitle: '选择时间', - timeText: '时间', - hourText: '小时', - minuteText: '分钟', - secondText: '秒钟', - millisecText: '微秒', - timezoneText: '时区', - currentText: '现在时间', - closeText: '关闭', - timeFormat: 'hh:mm', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - ampm: false, - isRTL: false - }; - $.timepicker.setDefaults($.timepicker.regional['zh-CN']); +/* Simplified Chinese translation for the jQuery Timepicker Addon / +/ Written by Will Lu */ +(function($) { + $.timepicker.regional['zh-CN'] = { + timeOnlyTitle: '选择时间', + timeText: '时间', + hourText: '小时', + minuteText: '分钟', + secondText: '秒钟', + millisecText: '微秒', + timezoneText: '时区', + currentText: '现在时间', + closeText: '关闭', + timeFormat: 'hh:mm', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + ampm: false, + isRTL: false + }; + $.timepicker.setDefaults($.timepicker.regional['zh-CN']); })(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/index.html b/assets/grocery_crud/js/jquery_plugins/ui/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/index.html +++ b/assets/grocery_crud/js/jquery_plugins/ui/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/js/jquery_plugins/ui/jquery-ui-1.10.3.custom.min.js b/assets/grocery_crud/js/jquery_plugins/ui/jquery-ui-1.10.3.custom.min.js index 83bc848..df25d36 100755 --- a/assets/grocery_crud/js/jquery_plugins/ui/jquery-ui-1.10.3.custom.min.js +++ b/assets/grocery_crud/js/jquery_plugins/ui/jquery-ui-1.10.3.custom.min.js @@ -1,7 +1,7 @@ -/*! jQuery UI - v1.10.3 - 2013-06-10 -* http://jqueryui.com -* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js -* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ - -(function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=!1;return t[s]>0?!0:(t[s]=1,a=t[s]>0,t[s]=0,a)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("
"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widths?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>m&&m>r(n+a)&&(h.vertical="middle"),h.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(C,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-o-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-o-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-o-a,t.top+p+f+m>c&&(0>s||r(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,t.top+p+f+m>u&&(i>0||u>r(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("
").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||e.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(t){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=t.pageX,l=t.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var s=e(this).data("ui-draggable"),n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var s=e(this).data("ui-draggable"),n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i){var s=e(this).data("ui-draggable"),n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY=0;c--)r=p.snapElements[c].left,h=r+p.snapElements[c].width,l=p.snapElements[c].top,u=l+p.snapElements[c].height,r-m>v||g>h+m||l-m>y||b>u+m||!e.contains(p.snapElements[c].item.ownerDocument,p.snapElements[c].item)?(p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(s=m>=Math.abs(l-y),n=m>=Math.abs(u-b),a=m>=Math.abs(r-v),o=m>=Math.abs(h-g),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||a||o,"outer"!==f.snapMode&&(s=m>=Math.abs(l-b),n=m>=Math.abs(u-y),a=m>=Math.abs(r-g),o=m>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=s||n||a||o||d)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,s=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(t=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(e){function t(e,t,i){return e>t&&t+i>e}e.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];i.length>t;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===s.options.scope&&t.accept.call(t.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,i,s){if(!i.offset)return!1;var n,a,o=(e.positionAbs||e.position.absolute).left,r=o+e.helperProportions.width,h=(e.positionAbs||e.position.absolute).top,l=h+e.helperProportions.height,u=i.offset.left,c=u+i.proportions.width,d=i.offset.top,p=d+i.proportions.height;switch(s){case"fit":return o>=u&&c>=r&&h>=d&&p>=l;case"intersect":return o+e.helperProportions.width/2>u&&c>r-e.helperProportions.width/2&&h+e.helperProportions.height/2>d&&p>l-e.helperProportions.height/2;case"pointer":return n=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,a=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(a,d,i.proportions.height)&&t(n,u,i.proportions.width);case"touch":return(h>=d&&p>=h||l>=d&&p>=l||d>h&&l>p)&&(o>=u&&c>=o||r>=u&&c>=r||u>o&&r>c);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions.height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions={width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight})}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===n}),a.length&&(s=e.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}})(jQuery);(function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("
"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=t(this.helper.css("left")),n=t(this.helper.css("top")),o.containment&&(s+=e(o.containment).scrollLeft()||0,n+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-a.left||0,d=t.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==u&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,n=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,n=i(e.width)&&t.maxWidth&&t.maxWidthe.width,r=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return o&&(e.width=t.minWidth),r&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),o&&u&&(e.left=h-t.minWidth),n&&u&&(e.left=h-t.maxWidth),r&&c&&(e.top=l-t.minHeight),a&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&e.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,n){s[e]=t(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=e.ui.hasScroll(p,"left")?p.scrollWidth:o,h=e.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(t){var i,s,n,a,o=e(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,c={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-c.left),u&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=o.parentData.left),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,c=Math.round((s.height-n.height)/l)*l,d=n.width+u,p=n.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.top=a.top-c):/^(sw)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.left=a.left-u):(t.size.width=d,t.size.height=p,t.position.top=a.top-c,t.position.left=a.left-u)}})})(jQuery);(function(e){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.3",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("
")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,a.widgetName+"-item")===a?(s=t(this),!1):undefined}),t.data(e.target,a.widgetName+"-item")===a&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=t("").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=t.left,o=a+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>a&&o>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return n?this.floating?o&&"right"===o||"down"===a?2:1:a&&("down"===a?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&s||"left"===a&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,n,a,o=[],r=[],h=this._connectWith();if(h&&e)for(i=h.length-1;i>=0;i--)for(n=t(h[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&r.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(function(){o.push(this)});return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(u.push([t.isFunction(a.options.items)?a.options.items.call(a.element[0],e,{item:this.currentItem}):t(a.options.items,a.element),a]),this.containers.push(a));for(i=u.length-1;i>=0;i--)for(o=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",o),c.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t(" ",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,a,o,r,h,l,c,u,d,p,f=null,m=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],m=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],a=this.items.length-1;a>=0;a--)t.contains(this.containers[m].element[0],this.items[a].item[0])&&this.items[a].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[a].top,this.items[a].height))&&(u=this.items[a].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[a][l]-c)&&(d=!0,u+=this.items[a][l]),o>Math.abs(u-c)&&(o=Math.abs(u-c),r=this.items[a],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[m].element,!0),this._trigger("change",s,this._uiHash()),this.containers[m]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,a=e.pageX,o=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)e||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.3",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),a=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(t(e.target).attr("tabIndex",-1),t(a).attr("tabIndex",0),a.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,a=this.element.parent(),o=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),a=n.attr("id");s||(s=o+"-header-"+e,i.attr("id",s)),a||(a=o+"-panel-"+e,n.attr("id",a)),i.attr("aria-controls",a),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=a.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?t():n,newPanel:r};e.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-expanded":"false","aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,n){var a,o,r,h=this,l=0,c=t.length&&(!e.length||t.index()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,undefined;e=!1,s=!1,i=!1;var a=t.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:e=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case a.UP:e=!0,this._keyEvent("previous",n);break;case a.DOWN:e=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),undefined):(this._searchTimeout(t),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(t),this._change(t),undefined)}}),this._initSource(),this.menu=t("
');if(o.config.toolbarCanCollapse){var K=e.addFunction(function(){o.execCommand('toolbarCollapse');});o.on('destroy',function(){e.removeFunction(K);});var L=e.getNextId();o.addCommand('toolbarCollapse',{readOnly:1,exec:function(M){var N=a.document.getById(L),O=N.getPrevious(),P=M.getThemeSpace('contents'),Q=O.getParent(),R=parseInt(P.$.style.height,10),S=Q.$.offsetHeight,T=!O.isVisible();if(!T){O.hide();N.addClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarExpand);}else{O.show();N.removeClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarCollapse);}N.getFirst().setText(T?'▲':'◀');var U=Q.$.offsetHeight-S;P.setStyle('height',R-U+'px');M.fire('resize');},modes:{wysiwyg:1,source:1}});t.push('','','');}r.data.html+=t.join('');}});o.on('destroy',function(){var r,s=0,t,u,v;r=this.toolbox.toolbars;for(;s
');return{};}};}});}});})();a.UI_SEPARATOR='separator';i.toolbarLocation='top';i.toolbar_Basic=[['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','About']];i.toolbar_Full=[{name:'document',items:['Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates']},{name:'clipboard',items:['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']},{name:'editing',items:['Find','Replace','-','SelectAll','-','SpellChecker','Scayt']},{name:'forms',items:['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField']},'/',{name:'basicstyles',items:['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']},{name:'paragraph',items:['NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl']},{name:'links',items:['Link','Unlink','Anchor']},{name:'insert',items:['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe']},'/',{name:'styles',items:['Styles','Format','Font','FontSize']},{name:'colors',items:['TextColor','BGColor']},{name:'tools',items:['Maximize','ShowBlocks','-','About']}]; +i.toolbar='Full';i.toolbarCanCollapse=true;(function(){j.add('undo',{requires:['selection','wysiwygarea'],init:function(s){var t=new o(s),u=s.addCommand('undo',{exec:function(){if(t.undo()){s.selectionChange();this.fire('afterUndo');}},state:0,canUndo:false}),v=s.addCommand('redo',{exec:function(){if(t.redo()){s.selectionChange();this.fire('afterRedo');}},state:0,canUndo:false});t.onChange=function(){u.setState(t.undoable()?2:0);v.setState(t.redoable()?2:0);};function w(x){if(t.enabled&&x.data.command.canUndo!==false)t.save();};s.on('beforeCommandExec',w);s.on('afterCommandExec',w);s.on('saveSnapshot',function(x){t.save(x.data&&x.data.contentOnly);});s.on('contentDom',function(){s.document.on('keydown',function(x){if(!x.data.$.ctrlKey&&!x.data.$.metaKey)t.type(x);});});s.on('beforeModeUnload',function(){s.mode=='wysiwyg'&&t.save(true);});s.on('mode',function(){t.enabled=s.readOnly?false:s.mode=='wysiwyg';t.onChange();});s.ui.addButton('Undo',{label:s.lang.undo,command:'undo'});s.ui.addButton('Redo',{label:s.lang.redo,command:'redo'});s.resetUndo=function(){t.reset();s.fire('saveSnapshot');};s.on('updateSnapshot',function(){if(t.currentImage)t.update();});}});j.undo={};var m=j.undo.Image=function(s){this.editor=s;s.fire('beforeUndoImage');var t=s.getSnapshot(),u=t&&s.getSelection();c&&t&&(t=t.replace(/\s+data-cke-expando=".*?"/g,''));this.contents=t;this.bookmarks=u&&u.createBookmarks2(true);s.fire('afterUndoImage');},n=/\b(?:href|src|name)="[^"]*?"/gi;m.prototype={equals:function(s,t){var u=this.contents,v=s.contents;if(c&&(b.ie7Compat||b.ie6Compat)){u=u.replace(n,'');v=v.replace(n,'');}if(u!=v)return false;if(t)return true;var w=this.bookmarks,x=s.bookmarks;if(w||x){if(!w||!x||w.length!=x.length)return false;for(var y=0;y25){this.save(false,null,false);this.modifiersCount=1;}}else if(!y){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save(false,null,false);this.typesCount=1;}}},reset:function(){var s=this;s.lastKeystroke=0;s.snapshots=[];s.index=-1;s.limit=s.editor.config.undoStackSize||20;s.currentImage=null;s.hasUndo=false;s.hasRedo=false;s.resetType();},resetType:function(){var s=this;s.typing=false;delete s.lastKeystroke;s.typesCount=0;s.modifiersCount=0;},fireChange:function(){var s=this;s.hasUndo=!!s.getNextImage(true);s.hasRedo=!!s.getNextImage(false);s.resetType();s.onChange();},save:function(s,t,u){var w=this;var v=w.snapshots;if(!t)t=new m(w.editor);if(t.contents===false)return false;if(w.currentImage&&t.equals(w.currentImage,s))return false;v.splice(w.index+1,v.length-w.index-1);if(v.length==w.limit)v.shift();w.index=v.push(t)-1;w.currentImage=t;if(u!==false)w.fireChange();return true;},restoreImage:function(s){var w=this;var t=w.editor,u;if(s.bookmarks){t.focus();u=t.getSelection();}w.editor.loadSnapshot(s.contents);if(s.bookmarks)u.selectBookmarks(s.bookmarks);else if(c){var v=w.editor.document.getBody().$.createTextRange();v.collapse(true);v.select();}w.index=s.index;w.update();w.fireChange();},getNextImage:function(s){var x=this;var t=x.snapshots,u=x.currentImage,v,w;if(u)if(s)for(w=x.index-1;w>=0;w--){v=t[w];if(!u.equals(v,true)){v.index=w;return v;}}else for(w=x.index+1;w]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,n=d.walker.whitespaces(true),o=d.walker.bogus(true),p=function(E){return n(E)&&o(E);};function q(E){return E.isBlockBoundary()&&f.$empty[E.getName()];};function r(E){return function(F){if(this.mode=='wysiwyg'){this.focus(); +var G=this.getSelection(),H=G.isLocked;H&&G.unlock();this.fire('saveSnapshot');E.call(this,F.data);H&&this.getSelection().lock();var I=this;setTimeout(function(){try{I.fire('saveSnapshot');}catch(J){setTimeout(function(){I.fire('saveSnapshot');},200);}},0);}};};function s(E){var N=this;if(N.dataProcessor)E=N.dataProcessor.toHtml(E);if(!E)return;var F=N.getSelection(),G=F.getRanges()[0];if(G.checkReadOnly())return;if(b.opera){var H=new d.elementPath(G.startContainer);if(H.block){var I=a.htmlParser.fragment.fromHtml(E,false).children;for(var J=0,K=I.length;J'+Q+'';});I=I.replace(/\n/g,'
');if(!(H||c))I=I.replace(new RegExp('
(?=)'),function(O){return e.repeat(O,2);});if(b.gecko||b.webkit){var K=new d.elementPath(F.getStartElement()),L=[];for(var M=0;M/));else if(N in f.$block)break;}I=L.join('')+I;}s.call(this,I);};function u(E){var F=this.getSelection(),G=F.getRanges(),H=E.getName(),I=f.$block[H],J=F.isLocked;if(J)F.unlock();var K,L,M,N;for(var O=G.length-1;O>=0;O--){K=G[O];if(!K.checkReadOnly()){K.deleteContents(1);L=!O&&E||E.clone(1);var P,Q;if(I)while((P=K.getCommonAncestor(0,1))&&(Q=f[P.getName()])&&!(Q&&Q[H])){if(P.getName() in f.span)K.splitElement(P);else if(K.checkStartOfBlock()&&K.checkEndOfBlock()){K.setStartBefore(P);K.collapse(true);P.remove();}else K.splitBlock();}K.insertNode(L); +if(!M)M=L;}}if(M){K.moveToPosition(M,4);if(I){var R=M.getNext(p),S=R&&R.type==1&&R.getName();if(S&&f.$block[S]){if(f[S]['#'])K.moveToElementEditStart(R);else K.moveToElementEditEnd(M);}else if(!R){R=K.fixBlock(true,this.config.enterMode==3?'div':'p');K.moveToElementEditStart(R);}}}F.selectRanges([K]);if(J)this.getSelection().lock();};function v(E){if(!E.checkDirty())setTimeout(function(){E.resetDirty();},0);};var w=d.walker.whitespaces(true),x=d.walker.bookmark(false,true);function y(E){return w(E)&&x(E);};function z(E){return E.type==3&&e.trim(E.getText()).match(/^(?: |\xa0)$/);};function A(E){if(E.isLocked){E.unlock();setTimeout(function(){E.lock();},0);}};function B(E){return E.getOuterHtml().match(m);};w=d.walker.whitespaces(true);function C(E){var F=E.window,G=E.document,H=E.document.getBody(),I=H.getFirst(),J=H.getChildren().count();if(!J||J==1&&I.type==1&&I.hasAttribute('_moz_editor_bogus_node')){v(E);var K=E.element.getDocument(),L=K.getDocumentElement(),M=L.$.scrollTop,N=L.$.scrollLeft,O=G.$.createEvent('KeyEvents');O.initKeyEvent('keypress',true,true,F.$,false,false,false,false,0,32);G.$.dispatchEvent(O);if(M!=L.$.scrollTop||N!=L.$.scrollLeft)K.getWindow().$.scrollTo(N,M);J&&H.getFirst().remove();G.getBody().appendBogus();var P=new d.range(G);P.setStartAt(H,1);P.select();}};function D(E){var F=E.editor,G=E.data.path,H=G.blockLimit,I=E.data.selection,J=I.getRanges()[0],K=F.document.getBody(),L=F.config.enterMode;if(b.gecko){var M=G.block||G.blockLimit,N=M&&M.getLast(y);if(M&&M.isBlockBoundary()&&!(N&&N.type==1&&N.isBlockBoundary())&&!M.is('pre')&&!M.getBogus())M.appendBogus();}if(F.config.autoParagraph!==false&&L!=2&&J.collapsed&&H.getName()=='body'&&!G.block){var O=J.fixBlock(true,F.config.enterMode==3?'div':'p');if(c){var P=O.getFirst(y);P&&z(P)&&P.remove();}if(B(O)){var Q=O.getNext(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditStart(Q);O.remove();}else{Q=O.getPrevious(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditEnd(Q);O.remove();}}}J.select();E.cancel();}var R=new d.range(F.document);R.moveToElementEditEnd(F.document.getBody());var S=new d.elementPath(R.startContainer);if(!S.blockLimit.is('body')){var T;if(L!=2)T=K.append(F.document.createElement(L==1?'p':'div'));else T=K;if(!c)T.appendBogus();}};j.add('wysiwygarea',{requires:['editingblock'],init:function(E){var F=E.config.enterMode!=2&&E.config.autoParagraph!==false?E.config.enterMode==3?'div':'p':false,G=E.lang.editorTitle.replace('%1',E.name),H=E.lang.editorHelp;if(c)G+=', '+H;var I=a.document.getWindow(),J; +E.on('editingBlockReady',function(){var M,N,O,P,Q,R,S,T=b.isCustomDomain(),U=function(X){if(N)N.remove();var Y='document.open();'+(T?'document.domain="'+document.domain+'";':'')+'document.close();';Y=b.air?'javascript:void(0)':c?'javascript:void(function(){'+encodeURIComponent(Y)+'}())':'';var Z=e.getNextId();N=h.createFromHtml('');if(document.location.protocol=='chrome:')a.event.useCapture=true;N.on('load',function(aa){Q=1;aa.removeListener();var ab=N.getFrameDocument();ab.write(X);b.air&&W(ab.getWindow().$);});if(document.location.protocol=='chrome:')a.event.useCapture=false;M.append(h.createFromHtml(''+H+''));M.append(N);if(b.webkit){S=function(){M.setStyle('width','100%');N.hide();N.setSize('width',M.getSize('width'));M.removeStyle('width');N.show();};I.on('resize',S);}};J=e.addFunction(W);var V='';function W(X){if(!Q)return;Q=0;E.fire('ariaWidget',N);var Y=X.document,Z=Y.body,aa=Y.getElementById('cke_actscrpt');aa&&aa.parentNode.removeChild(aa);Z.spellcheck=!E.config.disableNativeSpellChecker;var ab=!E.readOnly;if(c){Z.hideFocus=true;Z.disabled=true;Z.contentEditable=ab;Z.removeAttribute('disabled');}else setTimeout(function(){if(b.gecko&&b.version>=10900||b.opera)Y.$.body.contentEditable=ab;else if(b.webkit)Y.$.body.parentNode.contentEditable=ab;else Y.$.designMode=ab?'off':'on';},0);ab&&b.gecko&&e.setTimeout(C,0,null,E);X=E.window=new d.window(X);Y=E.document=new g(Y);ab&&Y.on('dblclick',function(ag){var ah=ag.data.getTarget(),ai={element:ah,dialog:''};E.fire('doubleclick',ai);ai.dialog&&E.openDialog(ai.dialog);});c&&Y.on('click',function(ag){var ah=ag.data.getTarget();if(ah.is('input')){var ai=ah.getAttribute('type');if(ai=='submit'||ai=='reset')ag.data.preventDefault();}});if(!(c||b.opera))Y.on('mousedown',function(ag){var ah=ag.data.getTarget();if(ah.is('img','hr','input','textarea','select'))E.getSelection().selectElement(ah);});if(b.gecko)Y.on('mouseup',function(ag){if(ag.data.$.button==2){var ah=ag.data.getTarget();if(!ah.getOuterHtml().replace(m,'')){var ai=new d.range(Y);ai.moveToElementEditStart(ah);ai.select(true);}}}); +Y.on('click',function(ag){ag=ag.data;if(ag.getTarget().is('a')&&ag.$.button!=2)ag.preventDefault();});if(b.webkit){Y.on('mousedown',function(){ad=1;});Y.on('click',function(ag){if(ag.data.getTarget().is('input','select'))ag.data.preventDefault();});Y.on('mouseup',function(ag){if(ag.data.getTarget().is('input','textarea'))ag.data.preventDefault();});}var ac=c?N:X;ac.on('blur',function(){E.focusManager.blur();});var ad;ac.on('focus',function(){var ag=E.document;if(b.gecko||b.opera)ag.getBody().focus();else if(b.webkit)if(!ad){E.document.getDocumentElement().focus();ad=1;}E.focusManager.focus();});var ae=E.keystrokeHandler;ae.blockedKeystrokes[8]=!ab;ae.attach(Y);Y.getDocumentElement().addClass(Y.$.compatMode);E.on('key',function(ag){if(E.mode!='wysiwyg')return;var ah=ag.data.keyCode;if(ah in {8:1,46:1}){var ai=E.getSelection(),aj=ai.getSelectedElement(),ak=ai.getRanges()[0],al=new d.elementPath(ak.startContainer),am,an,ao,ap=ah==8;if(aj){E.fire('saveSnapshot');ak.moveToPosition(aj,3);aj.remove();ak.select();E.fire('saveSnapshot');ag.cancel();}else if(ak.collapsed)if((am=al.block)&&ak[ap?'checkStartOfBlock':'checkEndOfBlock']()&&(ao=am[ap?'getPrevious':'getNext'](n))&&ao.is('table')){E.fire('saveSnapshot');if(ak[ap?'checkEndOfBlock':'checkStartOfBlock']())am.remove();ak['moveToElementEdit'+(ap?'End':'Start')](ao);ak.select();E.fire('saveSnapshot');ag.cancel();}else if(al.blockLimit.is('td')&&(an=al.blockLimit.getAscendant('table'))&&ak.checkBoundaryOfElement(an,ap?1:2)&&(ao=an[ap?'getPrevious':'getNext'](n))){E.fire('saveSnapshot');ak['moveToElementEdit'+(ap?'End':'Start')](ao);if(ak.checkStartOfBlock()&&ak.checkEndOfBlock())ao.remove();else ak.select();E.fire('saveSnapshot');ag.cancel();}}if(ah==33||ah==34)if(b.gecko){var aq=Y.getBody();if(X.$.innerHeight>aq.$.offsetHeight){ak=new d.range(Y);ak[ah==33?'moveToElementEditStart':'moveToElementEditEnd'](aq);ak.select();ag.cancel();}}});if(c&&Y.$.compatMode=='CSS1Compat'){var af={33:1,34:1};Y.on('keydown',function(ag){if(ag.data.getKeystroke() in af)setTimeout(function(){E.getSelection().scrollIntoView();},0);});}if(c&&E.config.enterMode!=1)Y.on('selectionchange',function(){var ag=Y.getBody(),ah=E.getSelection(),ai=ah&&ah.getRanges()[0];if(ai&&ag.getHtml().match(/^

 <\/p>$/i)&&ai.startContainer.equals(ag))setTimeout(function(){ai=E.getSelection().getRanges()[0];if(!ai.startContainer.equals('body')){ag.getFirst().remove(1);ai.moveToElementEditEnd(ag);ai.select(1);}},0);});if(E.contextMenu)E.contextMenu.addTarget(Y,E.config.browserContextMenuOnCtrl!==false); +setTimeout(function(){E.fire('contentDom');if(R){E.mode='wysiwyg';E.fire('mode',{previousMode:E._.previousMode});R=false;}O=false;if(P){E.focus();P=false;}setTimeout(function(){E.fire('dataReady');},0);try{E.document.$.execCommand('2D-position',false,true);}catch(ag){}try{E.document.$.execCommand('enableInlineTableEditing',false,!E.config.disableNativeTableHandles);}catch(ah){}if(E.config.disableObjectResizing)try{E.document.$.execCommand('enableObjectResizing',false,false);}catch(ai){E.document.getBody().on(c?'resizestart':'resize',function(aj){aj.data.preventDefault();});}if(c)setTimeout(function(){if(E.document){var aj=E.document.$.body;aj.runtimeStyle.marginBottom='0px';aj.runtimeStyle.marginBottom='';}},1000);},0);};E.addMode('wysiwyg',{load:function(X,Y,Z){M=X;if(c&&b.quirks)X.setStyle('position','relative');E.mayBeDirty=true;R=true;if(Z)this.loadSnapshotData(Y);else this.loadData(Y);},loadData:function(X){O=true;E._.dataStore={id:1};var Y=E.config,Z=Y.fullPage,aa=Y.docType,ab='';!Z&&(ab=e.buildStyleHtml(E.config.contentsCss)+ab);var ac=Y.baseHref?'':'';if(Z)X=X.replace(/]*>/i,function(ad){E.docType=aa=ad;return '';}).replace(/<\?xml\s[^\?]*\?>/i,function(ad){E.xmlDeclaration=ad;return '';});if(E.dataProcessor)X=E.dataProcessor.toHtml(X,F);if(Z){if(!/]/.test(X))X=''+X;if(!/]/.test(X))X=''+X+'';if(!/]/.test(X))X=X.replace(/]*>/,'$&');else if(!/]/.test(X))X=X.replace(/]*>/,'$&');ac&&(X=X.replace(//,'$&'+ac));X=X.replace(/<\/head\s*>/,ab+'$&');X=aa+X;}else X=Y.docType+''+''+''+G+''+ac+ab+''+''+X+'';if(b.gecko)X=X.replace(/
(?=\s*<\/(:?html|body)>)/,'$&
');X+=V;this.onDispose();U(X);},getData:function(){var X=E.config,Y=X.fullPage,Z=Y&&E.docType,aa=Y&&E.xmlDeclaration,ab=N.getFrameDocument(),ac=Y?ab.getDocumentElement().getOuterHtml():ab.getBody().getHtml();if(b.gecko)ac=ac.replace(/
(?=\s*(:?$|<\/body>))/,'');if(E.dataProcessor)ac=E.dataProcessor.toDataFormat(ac,F);if(X.ignoreEmptyParagraph)ac=ac.replace(m,function(ad,ae){return ae;});if(aa)ac=aa+'\n'+ac;if(Z)ac=Z+'\n'+ac; +return ac;},getSnapshotData:function(){return N.getFrameDocument().getBody().getHtml();},loadSnapshotData:function(X){N.getFrameDocument().getBody().setHtml(X);},onDispose:function(){if(!E.document)return;E.document.getDocumentElement().clearCustomData();E.document.getBody().clearCustomData();E.window.clearCustomData();E.document.clearCustomData();N.clearCustomData();N.remove();},unload:function(X){this.onDispose();if(S)I.removeListener('resize',S);E.window=E.document=N=M=P=null;E.fire('contentDomUnload');},focus:function(){var X=E.window;if(O)P=true;else if(X){var Y=E.getSelection(),Z=Y&&Y.getNative();if(Z&&Z.type=='Control')return;b.air?setTimeout(function(){X.focus();},0):X.focus();E.selectionChange();}}});E.on('insertHtml',r(s),null,null,20);E.on('insertElement',r(u),null,null,20);E.on('insertText',r(t),null,null,20);E.on('selectionChange',function(X){if(E.readOnly)return;var Y=E.getSelection();if(Y&&!Y.isLocked){var Z=E.checkDirty();E.fire('saveSnapshot',{contentOnly:1});D.call(this,X);E.fire('updateSnapshot');!Z&&E.resetDirty();}},null,null,1);});E.on('contentDom',function(){var M=E.document.getElementsByTag('title').getItem(0);M.data('cke-title',E.document.$.title);c&&(E.document.$.title=G);});E.on('readOnly',function(){if(E.mode=='wysiwyg'){var M=E.getMode();M.loadData(M.getData());}});if(a.document.$.documentMode>=8){E.addCss('html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}');var K=[];for(var L in f.$removeEmpty)K.push('html.CSS1Compat '+L+'[contenteditable=false]');E.addCss(K.join(',')+'{ display:inline-block;}');}else if(b.gecko){E.addCss('html { height: 100% !important; }');E.addCss('img:-moz-broken { -moz-force-broken-image-icon : 1;\tmin-width : 24px; min-height : 24px; }');}E.addCss('html {\t_overflow-y: scroll; cursor: text;\t*cursor:auto;}');E.addCss('img, input, textarea { cursor: default;}');E.on('insertElement',function(M){var N=M.data;if(N.type==1&&(N.is('input')||N.is('textarea'))){var O=N.getAttribute('contenteditable')=='false';if(!O){N.data('cke-editable',N.hasAttribute('contenteditable')?'true':'1');N.setAttribute('contenteditable',false);}}});}});if(b.gecko)(function(){var E=document.body;if(!E)window.addEventListener('load',arguments.callee,false);else{var F=E.getAttribute('onpageshow');E.setAttribute('onpageshow',(F?F+';':'')+'event.persisted && (function(){'+'var allInstances = CKEDITOR.instances, editor, doc;'+'for ( var i in allInstances )'+'{'+'\teditor = allInstances[ i ];'+'\tdoc = editor.document;'+'\tif ( doc )'+'\t{'+'\t\tdoc.$.designMode = "off";'+'\t\tdoc.$.designMode = "on";'+'\t}'+'}'+'})();'); +}})();})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add('wsc',{requires:['dialog'],init:function(m){var n='checkspell',o=m.addCommand(n,new a.dialogCommand(n));o.modes={wysiwyg:!b.opera&&!b.air&&document.domain==window.location.hostname};m.ui.addButton('SpellChecker',{label:m.lang.spellCheck.toolbar,command:n});a.dialog.add(n,this.path+'dialogs/wsc.js');}});i.wsc_customerId=i.wsc_customerId||'1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';i.wsc_customLoaderScript=i.wsc_customLoaderScript||null;a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){var m=e.cssLength;function n(R){return!!this._.tabs[R][0].$.offsetHeight;};function o(){var V=this;var R=V._.currentTabId,S=V._.tabIdList.length,T=e.indexOf(V._.tabIdList,R)+S;for(var U=T-1;U>T-S;U--){if(n.call(V,V._.tabIdList[U%S]))return V._.tabIdList[U%S];}return null;};function p(){var V=this;var R=V._.currentTabId,S=V._.tabIdList.length,T=e.indexOf(V._.tabIdList,R);for(var U=T+1;U1){ah._.tabBarMode=true; +ah._.tabs[ah._.currentTabId][0].focus();Z=1;}else if((as==37||as==39)&&ah._.tabBarMode){aw=as==(at?39:37)?o.call(ah):p.call(ah);ah.selectPage(aw);ah._.tabs[aw][0].focus();Z=1;}else if((as==13||as==32)&&ah._.tabBarMode){ay.selectPage(ay._.currentTabId);ay._.tabBarMode=false;ay._.currentFocusIndex=-1;ak(1);Z=1;}else if(as==13){var ax=ar.data.getTarget();if(!ax.is('a','button','select','textarea')&&(!ax.is('input')||ax.$.type!='button')){au=ay.getButton('ok');au&&e.setTimeout(au.click,0,au);Z=1;}aa=1;}else if(as==27){au=ay.getButton('cancel');if(au)e.setTimeout(au.click,0,au);else if(ay.fire('cancel',{hide:true}).hide!==false)ay.hide();aa=1;}else return;am(ar);};function am(ar){if(Z)ar.data.preventDefault(1);else if(aa)ar.data.stopPropagation();};var an=this._.element;this.on('show',function(){an.on('keydown',al,this);if(b.opera||b.gecko)an.on('keypress',am,this);});this.on('hide',function(){an.removeListener('keydown',al);if(b.opera||b.gecko)an.removeListener('keypress',am);ai(function(ar){s.apply(ar);});});this.on('iframeAdded',function(ar){var as=new g(ar.data.iframe.$.contentWindow.document);as.on('keydown',al,this,null,0);});this.on('show',function(){var av=this;aj();if(R.config.dialog_startupFocusTab&&ah._.pageCount>1){ah._.tabBarMode=true;ah._.tabs[ah._.currentTabId][0].focus();}else if(!av._.hasFocus){av._.currentFocusIndex=-1;if(T.onFocus){var ar=T.onFocus.call(av);ar&&ar.focus();}else ak(1);if(av._.editor.mode=='wysiwyg'&&c){var as=R.document.$.selection,at=as.createRange();if(at)if(at.parentElement&&at.parentElement().ownerDocument==R.document.$||at.item&&at.item(0).ownerDocument==R.document.$){var au=document.body.createTextRange();au.moveToElementText(av.getElement().getFirst().$);au.collapse(true);au.select();}}}},this,null,4294967295);if(b.ie6Compat)this.on('load',function(ar){var as=this.getElement(),at=as.getFirst();at.remove();at.appendTo(as);},this);B(this);C(this);new d.text(T.title,a.document).appendTo(this.parts.title);for(Y=0;Y0?S:0)+'px'};aa[V?'right':'left']=(R>0?R:0)+'px';U.setStyles(aa);T&&(ab._.moved=1);},getPosition:function(){return e.extend({},this._.position);},show:function(){var R=this._.element,S=this.definition;if(!(R.getParent()&&R.getParent().equals(a.document.getBody())))R.appendTo(a.document.getBody());else R.setStyle('display','block');if(b.gecko&&b.version<10900){var T=this.parts.dialog;T.setStyle('position','absolute');setTimeout(function(){T.setStyle('position','fixed');},0);}this.resize(this._.contentSize&&this._.contentSize.width||S.width||S.minWidth,this._.contentSize&&this._.contentSize.height||S.height||S.minHeight);this.reset();this.selectPage(this.definition.contents[0].id);if(a.dialog._.currentZIndex===null)a.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex; +this._.element.getFirst().setStyle('z-index',a.dialog._.currentZIndex+=10);if(a.dialog._.currentTop===null){a.dialog._.currentTop=this;this._.parentDialog=null;H(this._.editor);}else{this._.parentDialog=a.dialog._.currentTop;var U=this._.parentDialog.getElement().getFirst();U.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);a.dialog._.currentTop=this;}R.on('keydown',L);R.on(b.opera?'keypress':'keyup',M);this._.hasFocus=false;e.setTimeout(function(){this.layout();u(this);this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});k.fire('ready',this);this.fire('show',{});this._.editor.fire('dialogShow',this);this.foreach(function(V){V.setInitValue&&V.setInitValue();});},100,this);},layout:function(){var X=this;var R=X.parts.dialog,S=X.getSize(),T=a.document.getWindow(),U=T.getViewPaneSize(),V=(U.width-S.width)/2,W=(U.height-S.height)/2;if(!b.ie6Compat)if(S.height+(W>0?W:0)>U.height||S.width+(V>0?V:0)>U.width)R.setStyle('position','absolute');else R.setStyle('position','fixed');X.move(X._.moved?X._.position.x:V,X._.moved?X._.position.y:W);},foreach:function(R){var U=this;for(var S in U._.contents)for(var T in U._.contents[S])R.call(U,U._.contents[S][T]);return U;},reset:(function(){var R=function(S){if(S.reset)S.reset(1);};return function(){this.foreach(R);return this;};})(),setupContent:function(){var R=arguments;this.foreach(function(S){if(S.setup)S.setup.apply(S,R);});},commitContent:function(){var R=arguments;this.foreach(function(S){if(c&&this._.currentFocusIndex==S.focusIndex)S.getInputElement().$.blur();if(S.commit)S.commit.apply(S,R);});},hide:function(){if(!this.parts.dialog.isVisible())return;this.fire('hide',{});this._.editor.fire('dialogHide',this);this.selectPage(this._.tabIdList[0]);var R=this._.element;R.setStyle('display','none');this.parts.dialog.setStyle('visibility','hidden');O(this);while(a.dialog._.currentTop!=this)a.dialog._.currentTop.hide();if(!this._.parentDialog)I();else{var S=this._.parentDialog.getElement().getFirst();S.setStyle('z-index',parseInt(S.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;R.removeListener('keydown',L);R.removeListener(b.opera?'keypress':'keyup',M);var T=this._.editor;T.focus();if(T.mode=='wysiwyg'&&c){var U=T.getSelection();U&&U.unlock(true);}}else a.dialog._.currentZIndex-=10;delete this._.parentDialog;this.foreach(function(V){V.resetInitValue&&V.resetInitValue(); +});},addPage:function(R){var ad=this;var S=[],T=R.label?' title="'+e.htmlEncode(R.label)+'"':'',U=R.elements,V=a.dialog._.uiElementBuilders.vbox.build(ad,{type:'vbox',className:'cke_dialog_page_contents',children:R.elements,expand:!!R.expand,padding:R.padding,style:R.style||'width: 100%;height:100%'},S),W=h.createFromHtml(S.join(''));W.setAttribute('role','tabpanel');var X=b,Y='cke_'+R.id+'_'+e.getNextNumber(),Z=h.createFromHtml(['0?' cke_last':'cke_first',T,!!R.hidden?' style="display:none"':'',' id="',Y,'"',X.gecko&&X.version>=10900&&!X.hc?'':' href="javascript:void(0)"',' tabIndex="-1"',' hidefocus="true"',' role="tab">',R.label,''].join(''));W.setAttribute('aria-labelledby',Y);ad._.tabs[R.id]=[Z,W];ad._.tabIdList.push(R.id);!R.hidden&&ad._.pageCount++;ad._.lastTab=Z;ad.updateStyle();var aa=ad._.contents[R.id]={},ab,ac=V.getChild();while(ab=ac.shift()){aa[ab.id]=ab;if(typeof ab.getChild=='function')ac.push.apply(ac,ab.getChild());}W.setAttribute('name',R.id);W.appendTo(ad.parts.contents);Z.unselectable();ad.parts.tabs.append(Z);if(R.accessKey){N(ad,ad,'CTRL+'+R.accessKey,Q,P);ad._.accessKeyMap['CTRL+'+R.accessKey]=R.id;}},selectPage:function(R){if(this._.currentTabId==R)return;if(this.fire('selectPage',{page:R,currentPage:this._.currentTabId})===true)return;for(var S in this._.tabs){var T=this._.tabs[S][0],U=this._.tabs[S][1];if(S!=R){T.removeClass('cke_dialog_tab_selected');U.hide();}U.setAttribute('aria-hidden',S!=R);}var V=this._.tabs[R];V[0].addClass('cke_dialog_tab_selected');if(b.ie6Compat||b.ie7Compat){q(V[1]);V[1].show();setTimeout(function(){q(V[1],1);},0);}else V[1].show();this._.currentTabId=R;this._.currentTabIndex=e.indexOf(this._.tabIdList,R);},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?'add':'remove')+'Class']('cke_single_page');},hidePage:function(R){var T=this;var S=T._.tabs[R]&&T._.tabs[R][0];if(!S||T._.pageCount==1||!S.isVisible())return;else if(R==T._.currentTabId)T.selectPage(o.call(T));S.hide();T._.pageCount--;T.updateStyle();},showPage:function(R){var T=this;var S=T._.tabs[R]&&T._.tabs[R][0];if(!S)return;S.show();T._.pageCount++;T.updateStyle();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(R,S){var T=this._.contents[R];return T&&T[S];},getValueOf:function(R,S){return this.getContentElement(R,S).getValue();},setValueOf:function(R,S,T){return this.getContentElement(R,S).setValue(T);},getButton:function(R){return this._.buttons[R]; +},click:function(R){return this._.buttons[R].click();},disableButton:function(R){return this._.buttons[R].disable();},enableButton:function(R){return this._.buttons[R].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(R,S){var U=this;if(typeof S=='undefined'){S=U._.focusList.length;U._.focusList.push(new t(U,R,S));}else{U._.focusList.splice(S,0,new t(U,R,S));for(var T=S+1;Tac.width-ab.width-W)ah=ac.width-ab.width+(V.lang.dir=='rtl'?0:X[1]);else ah=T.x;if(T.y+X[0]ac.height-ab.height-W)ai=ac.height-ab.height+X[2];else ai=T.y;R.move(ah,ai,1);aa.data.preventDefault();};function Z(aa){a.document.removeListener('mousemove',Y);a.document.removeListener('mouseup',Z);if(b.ie6Compat){var ab=F.getChild(0).getFrameDocument();ab.removeListener('mousemove',Y);ab.removeListener('mouseup',Z);}};R.parts.title.on('mousedown',function(aa){S={x:aa.data.$.screenX,y:aa.data.$.screenY};a.document.on('mousemove',Y);a.document.on('mouseup',Z);T=R.getPosition();if(b.ie6Compat){var ab=F.getChild(0).getFrameDocument();ab.on('mousemove',Y);ab.on('mouseup',Z);}aa.data.preventDefault();},R);};function C(R){var S=R.definition,T=S.resizable;if(T==0)return;var U=R.getParentEditor(),V,W,X,Y,Z,aa,ab=e.addFunction(function(ae){Z=R.getSize();var af=R.parts.contents,ag=af.$.getElementsByTagName('iframe').length;if(ag){aa=h.createFromHtml('

');af.append(aa);}W=Z.height-R.parts.contents.getSize('height',!(b.gecko||b.opera||c&&b.quirks));V=Z.width-R.parts.contents.getSize('width',1);Y={x:ae.screenX,y:ae.screenY};X=a.document.getWindow().getViewPaneSize();a.document.on('mousemove',ac);a.document.on('mouseup',ad);if(b.ie6Compat){var ah=F.getChild(0).getFrameDocument();ah.on('mousemove',ac);ah.on('mouseup',ad);}ae.preventDefault&&ae.preventDefault();});R.on('load',function(){var ae='';if(T==1)ae=' cke_resizer_horizontal';else if(T==2)ae=' cke_resizer_vertical';var af=h.createFromHtml('
'); +R.parts.footer.append(af,1);});U.on('destroy',function(){e.removeFunction(ab);});function ac(ae){var af=U.lang.dir=='rtl',ag=(ae.data.$.screenX-Y.x)*(af?-1:1),ah=ae.data.$.screenY-Y.y,ai=Z.width,aj=Z.height,ak=ai+ag*(R._.moved?1:2),al=aj+ah*(R._.moved?1:2),am=R._.element.getFirst(),an=af&&am.getComputedStyle('right'),ao=R.getPosition();if(ao.y+al>X.height)al=X.height-ao.y;if((af?an:ao.x)+ak>X.width)ak=X.width-(af?an:ao.x);if(T==1||T==3)ai=Math.max(S.minWidth||0,ak-V);if(T==2||T==3)aj=Math.max(S.minHeight||0,al-W);R.resize(ai,aj);if(!R._.moved)R.layout();ae.data.preventDefault();};function ad(){a.document.removeListener('mouseup',ad);a.document.removeListener('mousemove',ac);if(aa){aa.remove();aa=null;}if(b.ie6Compat){var ae=F.getChild(0).getFrameDocument();ae.removeListener('mouseup',ad);ae.removeListener('mousemove',ac);}};};var D,E={},F;function G(R){R.data.preventDefault(1);};function H(R){var S=a.document.getWindow(),T=R.config,U=T.dialog_backgroundCoverColor||'white',V=T.dialog_backgroundCoverOpacity,W=T.baseFloatZIndex,X=e.genKey(U,V,W),Y=E[X];if(!Y){var Z=['
'];if(b.ie6Compat){var aa=b.isCustomDomain(),ab="";Z.push('');}Z.push('
');Y=h.createFromHtml(Z.join(''));Y.setOpacity(V!=undefined?V:0.5);Y.on('keydown',G);Y.on('keypress',G);Y.on('keyup',G);Y.appendTo(a.document.getBody());E[X]=Y;}else Y.show();F=Y;var ac=function(){var af=S.getViewPaneSize();Y.setStyles({width:af.width+'px',height:af.height+'px'});},ad=function(){var af=S.getScrollPosition(),ag=a.dialog._.currentTop;Y.setStyles({left:af.x+'px',top:af.y+'px'});if(ag)do{var ah=ag.getPosition();ag.move(ah.x,ah.y);}while(ag=ag._.parentDialog)};D=ac;S.on('resize',ac);ac();if(!(b.mac&&b.webkit))Y.focus();if(b.ie6Compat){var ae=function(){ad();arguments.callee.prevScrollHandler.apply(this,arguments);};S.$.setTimeout(function(){ae.prevScrollHandler=window.onscroll||(function(){}); +window.onscroll=ae;},0);ad();}};function I(){if(!F)return;var R=a.document.getWindow();F.hide();R.removeListener('resize',D);if(b.ie6Compat)R.$.setTimeout(function(){var S=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=S||null;},0);D=null;};function J(){for(var R in E)E[R].remove();E={};};var K={},L=function(R){var S=R.data.$.ctrlKey||R.data.$.metaKey,T=R.data.$.altKey,U=R.data.$.shiftKey,V=String.fromCharCode(R.data.$.keyCode),W=K[(S?'CTRL+':'')+(T?'ALT+':'')+(U?'SHIFT+':'')+V];if(!W||!W.length)return;W=W[W.length-1];W.keydown&&W.keydown.call(W.uiElement,W.dialog,W.key);R.data.preventDefault();},M=function(R){var S=R.data.$.ctrlKey||R.data.$.metaKey,T=R.data.$.altKey,U=R.data.$.shiftKey,V=String.fromCharCode(R.data.$.keyCode),W=K[(S?'CTRL+':'')+(T?'ALT+':'')+(U?'SHIFT+':'')+V];if(!W||!W.length)return;W=W[W.length-1];if(W.keyup){W.keyup.call(W.uiElement,W.dialog,W.key);R.data.preventDefault();}},N=function(R,S,T,U,V){var W=K[T]||(K[T]=[]);W.push({uiElement:R,dialog:S,key:T,keyup:V||R.accessKeyUp,keydown:U||R.accessKeyDown});},O=function(R){for(var S in K){var T=K[S];for(var U=T.length-1;U>=0;U--){if(T[U].dialog==R||T[U].uiElement==R)T.splice(U,1);}if(T.length===0)delete K[S];}},P=function(R,S){if(R._.accessKeyMap[S])R.selectPage(R._.accessKeyMap[S]);},Q=function(R,S){};(function(){k.dialog={uiElement:function(R,S,T,U,V,W,X){if(arguments.length<4)return;var Y=(U.call?U(S):U)||'div',Z=['<',Y,' '],aa=(V&&V.call?V(S):V)||{},ab=(W&&W.call?W(S):W)||{},ac=(X&&X.call?X.call(this,R,S):X)||'',ad=this.domId=ab.id||e.getNextId()+'_uiElement',ae=this.id=S.id,af;ab.id=ad;var ag={};if(S.type)ag['cke_dialog_ui_'+S.type]=1;if(S.className)ag[S.className]=1;if(S.disabled)ag.cke_disabled=1;var ah=ab['class']&&ab['class'].split?ab['class'].split(' '):[];for(af=0;af=0;af--){if(aj[af]==='')aj.splice(af,1);}if(aj.length>0)ab.style=(ab.style?ab.style+'; ':'')+aj.join('; ');for(af in ab)Z.push(af+'="'+e.htmlEncode(ab[af])+'" ');Z.push('>',ac,'');T.push(Z.join(''));(this._||(this._={})).dialog=R;if(typeof S.isChanged=='boolean')this.isChanged=function(){return S.isChanged;};if(typeof S.isChanged=='function')this.isChanged=S.isChanged; +if(typeof S.setValue=='function')this.setValue=e.override(this.setValue,function(am){return function(an){am.call(this,S.setValue.call(this,an));};});if(typeof S.getValue=='function')this.getValue=e.override(this.getValue,function(am){return function(){return S.getValue.call(this,am.call(this));};});a.event.implementOn(this);this.registerEvents(S);if(this.accessKeyUp&&this.accessKeyDown&&S.accessKey)N(this,R,'CTRL+'+S.accessKey);var al=this;R.on('load',function(){var am=al.getInputElement();if(am){var an=al.type in {checkbox:1,ratio:1}&&c&&b.version<8?'cke_dialog_ui_focused':'';am.on('focus',function(){R._.tabBarMode=false;R._.hasFocus=true;al.fire('focus');an&&this.addClass(an);});am.on('blur',function(){al.fire('blur');an&&this.removeClass(an);});}});if(this.keyboardFocusable){this.tabIndex=S.tabIndex||0;this.focusIndex=R._.focusList.push(this)-1;this.on('focus',function(){R._.currentFocusIndex=al.focusIndex;});}e.extend(this,S);},hbox:function(R,S,T,U,V){if(arguments.length<4)return;this._||(this._={});var W=this._.children=S,X=V&&V.widths||null,Y=V&&V.height||null,Z={},aa,ab=function(){var ad=[''];for(aa=0;aa0)ad.push('style="'+af.join('; ')+'" ');ad.push('>',T[aa],'');}ad.push('');return ad.join('');},ac={role:'presentation'};V&&V.align&&(ac.align=V.align);k.dialog.uiElement.call(this,R,V||{type:'hbox'},U,'table',Z,ac,ab);},vbox:function(R,S,T,U,V){if(arguments.length<3)return;this._||(this._={});var W=this._.children=S,X=V&&V.width||null,Y=V&&V.heights||null,Z=function(){var aa=['');for(var ab=0;ab');}aa.push('
0)aa.push('style="',ac.join('; '),'" ');aa.push(' class="cke_dialog_ui_vbox_child">',T[ab],'
');return aa.join('');};k.dialog.uiElement.call(this,R,V||{type:'vbox'},U,'div',null,{role:'presentation'},Z);}};})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(R,S){this.getInputElement().setValue(R);!S&&this.fire('change',{value:R});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var U=this;var R=U.getInputElement(),S=R,T;while((S=S.getParent())&&S.$.className.search('cke_dialog_page_contents')==-1){}if(!S)return U;T=S.getAttribute('name');if(U._.dialog._.currentTabId!=T)U._.dialog.selectPage(T);return U;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(R){var S=/^on([A-Z]\w+)/,T,U=function(W,X,Y,Z){X.on('load',function(){W.getInputElement().on(Y,Z,W);});};for(var V in R){if(!(T=V.match(S)))continue;if(this.eventProcessors[V])this.eventProcessors[V].call(this,this._.dialog,R[V]);else U(this,this._.dialog,T[1].toLowerCase(),R[V]);}return this;},eventProcessors:{onLoad:function(R,S){R.on('load',S,this);},onShow:function(R,S){R.on('show',S,this);},onHide:function(R,S){R.on('hide',S,this);}},accessKeyDown:function(R,S){this.focus();},accessKeyUp:function(R,S){},disable:function(){var R=this.getElement(),S=this.getInputElement();S.setAttribute('disabled','true');R.addClass('cke_disabled');},enable:function(){var R=this.getElement(),S=this.getInputElement();S.removeAttribute('disabled');R.removeClass('cke_disabled');},isEnabled:function(){return!this.getElement().hasClass('cke_disabled');},isVisible:function(){return this.getInputElement().isVisible();},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};k.dialog.hbox.prototype=e.extend(new k.dialog.uiElement(),{getChild:function(R){var S=this;if(arguments.length<1)return S._.children.concat();if(!R.splice)R=[R];if(R.length<2)return S._.children[R[0]];else return S._.children[R[0]]&&S._.children[R[0]].getChild?S._.children[R[0]].getChild(R.slice(1,R.length)):null;}},true);k.dialog.vbox.prototype=new k.dialog.hbox(); +(function(){var R={build:function(S,T,U){var V=T.children,W,X=[],Y=[];for(var Z=0;Z',T||U.name,'');return V.join('');}};a.style.getStyleText=function(T){var U=T._ST;if(U)return U;U=T.styles;var V=T.attributes&&T.attributes.style||'',W='';if(V.length)V=V.replace(o,';');for(var X in U){var Y=U[X],Z=(X+':'+Y).replace(o,';');if(Y=='inherit')W+=Z;else V+=Z;}if(V.length)V=P(V);V+=W;return T._ST=V;};function s(T){var U,V;while(T=T.getParent()){if(T.getName()=='body')break;if(T.getAttribute('data-nostyle'))U=T;else if(!V){var W=T.getAttribute('contentEditable');if(W=='false')U=T;else if(W=='true')V=1;}}return U;};function t(T){var ay=this;var U=T.document;if(T.collapsed){var V=J(ay,U);T.insertNode(V);T.moveToPosition(V,2);return;}var W=ay.element,X=ay._.definition,Y,Z=X.ignoreReadonly,aa=Z||X.includeReadonly;if(aa==undefined)aa=U.getCustomData('cke_includeReadonly');var ab=f[W]||(Y=true,f.span);T.enlarge(1,1);T.trim();var ac=T.createBookmark(),ad=ac.startNode,ae=ac.endNode,af=ad,ag;if(!Z){var ah=s(ad),ai=s(ae);if(ah)af=ah.getNextSourceNode(true);if(ai)ae=ai;}if(af.getPosition(ae)==2)af=0;while(af){var aj=false;if(af.equals(ae)){af=null;aj=true;}else{var ak=af.type,al=ak==1?af.getName():null,am=al&&af.getAttribute('contentEditable')=='false',an=al&&af.getAttribute('data-nostyle');if(al&&af.data('cke-bookmark')){af=af.getNextSourceNode(true);continue;}if(!al||ab[al]&&!an&&(!am||aa)&&(af.getPosition(ae)|4|0|8)==4+0+8&&(!X.childRule||X.childRule(af))){var ao=af.getParent(); +if(ao&&((ao.getDtd()||f.span)[W]||Y)&&(!X.parentRule||X.parentRule(ao))){if(!ag&&(!al||!f.$removeEmpty[al]||(af.getPosition(ae)|4|0|8)==4+0+8)){ag=new d.range(U);ag.setStartBefore(af);}if(ak==3||am||ak==1&&!af.getChildCount()){var ap=af,aq;while((aj=!ap.getNext(q))&&(aq=ap.getParent(),ab[aq.getName()])&&(aq.getPosition(ad)|2|0|8)==2+0+8&&(!X.childRule||X.childRule(aq)))ap=aq;ag.setEndAfter(ap);}}else aj=true;}else aj=true;af=af.getNextSourceNode(an||am);}if(aj&&ag&&!ag.collapsed){var ar=J(ay,U),as=ar.hasAttributes(),at=ag.getCommonAncestor(),au={styles:{},attrs:{},blockedStyles:{},blockedAttrs:{}},av,aw,ax;while(ar&&at){if(at.getName()==W){for(av in X.attributes){if(au.blockedAttrs[av]||!(ax=at.getAttribute(aw)))continue;if(ar.getAttribute(av)==ax)au.attrs[av]=1;else au.blockedAttrs[av]=1;}for(aw in X.styles){if(au.blockedStyles[aw]||!(ax=at.getStyle(aw)))continue;if(ar.getStyle(aw)==ax)au.styles[aw]=1;else au.blockedStyles[aw]=1;}}at=at.getParent();}for(av in au.attrs)ar.removeAttribute(av);for(aw in au.styles)ar.removeStyle(aw);if(as&&!ar.hasAttributes())ar=null;if(ar){ag.extractContents().appendTo(ar);G(ay,ar);ag.insertNode(ar);ar.mergeSiblings();if(!c)ar.$.normalize();}else{ar=new h('span');ag.extractContents().appendTo(ar);ag.insertNode(ar);G(ay,ar);ar.remove(true);}ag=null;}}T.moveToBookmark(ac);T.shrink(2);};function u(T){T.enlarge(1,1);var U=T.createBookmark(),V=U.startNode;if(T.collapsed){var W=new d.elementPath(V.getParent()),X;for(var Y=0,Z;Y'+V+'';else T.setHtml(V);U.remove();};function B(T){var U=/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,V=T.getName(),W=C(T.getOuterHtml(),U,function(Y,Z,aa){return Z+''+aa+'
';}),X=[];W.replace(/([\s\S]*?)<\/pre>/gi,function(Y,Z){X.push(Z);});return X;};function C(T,U,V){var W='',X='';T=T.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi,function(Y,Z,aa){Z&&(W=Z);aa&&(X=aa);return '';});return W+T.replace(U,V)+X;};function D(T,U){var V;if(T.length>1)V=new d.documentFragment(U.getDocument());for(var W=0;W');X=X.replace(/[ \t]{2,}/g,function(Z){return e.repeat(' ',Z.length-1)+' ';});if(V){var Y=U.clone();Y.setHtml(X);V.append(Y);}else U.setHtml(X);}return V||U;};function E(T,U){var V=T.getBogus();V&&V.remove();var W=T.getHtml();W=C(W,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');W=W.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'$1');W=W.replace(/([ \t\n\r]+| )/g,' ');W=W.replace(/]*>/gi,'\n');if(c){var X=T.getDocument().createElement('div');X.append(U);U.$.outerHTML='
'+W+'
';U.copyAttributes(X.getFirst());U=X.getFirst().remove();}else U.setHtml(W);return U;};function F(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T)[U.getName()],Z=e.isEmpty(W)&&e.isEmpty(X);for(var aa in W){if((aa=='class'||T._.definition.fullMatch)&&U.getAttribute(aa)!=O(aa,W[aa]))continue;Z=U.hasAttribute(aa);U.removeAttribute(aa);}for(var ab in X){if(T._.definition.fullMatch&&U.getStyle(ab)!=O(ab,X[ab],true))continue;Z=Z||!!U.getStyle(ab);U.removeStyle(ab);}H(U,Y,m[U.getName()]);if(Z)!f.$block[U.getName()]||T._.enterMode==2&&!U.hasAttributes()?I(U):U.renameNode(T._.enterMode==1?'p':'div');};function G(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T),Z=U.getElementsByTag(T.element);for(var aa=Z.count();--aa>=0;)F(T,Z.getItem(aa));for(var ab in Y){if(ab!=T.element){Z=U.getElementsByTag(ab);for(aa=Z.count()-1;aa>=0;aa--){var ac=Z.getItem(aa);H(ac,Y[ab]);}}}};function H(T,U,V){var W=U&&U.attributes;if(W)for(var X=0;X0)H+=(F.$.offsetWidth||0)-(F.$.clientWidth||0)+3;H+=4;F.setStyle('width',H+'px');v.element.addClass('cke_frameLoaded');var I=v.element.$.scrollHeight;if(c&&b.quirks&&I>0)I+=(F.$.offsetHeight||0)-(F.$.clientHeight||0)+3;F.setStyle('height',I+'px');u._.currentBlock.element.setStyle('display','none').removeStyle('display');}else F.removeStyle('height');if(A)B-=w.$.offsetWidth;w.setStyle('left',B+'px');var J=u.element,K=J.getWindow(),L=w.$.getBoundingClientRect(),M=K.getViewPaneSize(),N=L.width||L.right-L.left,O=L.height||L.bottom-L.top,P=A?L.right:M.width-L.left,Q=A?M.width-L.right:L.left;if(A){if(PN)B+=N;else if(M.width>N)B-=L.left;else B=B-L.right+M.width;}else if(PN)B-=N;else if(M.width>N)B=B-L.right+M.width;else B-=L.left; +var R=M.height-L.top,S=L.top;if(RO)C-=O;else if(M.height>O)C=C-L.bottom+M.height;else C-=L.top;if(c){var T=new h(w.$.offsetParent),U=T;if(U.getName()=='html')U=U.getDocument().getBody();if(U.getComputedStyle('direction')=='rtl')if(b.ie8Compat)B-=w.getDocument().getDocumentElement().$.scrollLeft*2;else B-=T.$.scrollWidth-T.$.clientWidth;}var V=w.getFirst(),W;if(W=V.getCustomData('activePanel'))W.onHide&&W.onHide.call(this,1);V.setCustomData('activePanel',this);w.setStyles({top:C+'px',left:B+'px'});w.setOpacity(1);},this);u.isLoaded?E():u.onLoad=E;e.setTimeout(function(){x.$.contentWindow.focus();this.allowBlur(true);},0,this);},b.air?200:0,this);this.visible=1;if(this.onShow)this.onShow.call(this);n=0;},hide:function(p){var r=this;if(r.visible&&(!r.onHide||r.onHide.call(r)!==true)){r.hideChild();b.gecko&&r._.iframe.getFrameDocument().$.activeElement.blur();r.element.setStyle('display','none');r.visible=0;r.element.getFirst().removeCustomData('activePanel');var q=p!==false&&r._.returnFocus;if(q){if(b.webkit&&q.type)q.getWindow().$.focus();q.focus();}}},allowBlur:function(p){var q=this._.panel;if(p!=undefined)q.allowBlur=p;return q.allowBlur;},showAsChild:function(p,q,r,s,t,u){if(this._.activeChild==p&&p._.panel._.offsetParentId==r.getId())return;this.hideChild();p.onHide=e.bind(function(){e.setTimeout(function(){if(!this._.focused)this.hide();},0,this);},this);this._.activeChild=p;this._.focused=false;p.showBlock(q,r,s,t,u);if(b.ie7Compat||b.ie8&&b.ie6Compat)setTimeout(function(){p.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var p=this._.activeChild;if(p){delete p.onHide;delete p._.returnFocus;delete this._.activeChild;p.hide();}}}});a.on('instanceDestroyed',function(){var p=e.isEmpty(a.instances);for(var q in m){var r=m[q];if(p)r.destroy();else r.element.hide();}p&&(m={});});})();j.add('menu',{beforeInit:function(m){var n=m.config.menu_groups.split(','),o=m._.menuGroups={},p=m._.menuItems={};for(var q=0;q'],B=r.length,C=B&&r[0].group;for(var D=0;D
');C=E.group;}E.render(this,D,A);}A.push('
');u.setHtml(A.join(''));k.fire('ready',this);if(this.parent)this.parent._.panel.showAsChild(t,this.id,n,o,p,q);else t.showBlock(this.id,n,o,p,q);s.fire('menuShow',[t]);},addListener:function(n){this._.listeners.push(n);},hide:function(n){var o=this;o._.onHide&&o._.onHide();o._.panel&&o._.panel.hide(n);}}});function m(n){n.sort(function(o,p){if(o.groupp.group)return 1;return o.orderp.order?1:0;});};a.menuItem=e.createClass({$:function(n,o,p){var q=this;e.extend(q,p,{order:0,className:'cke_button_'+o});q.group=n._.menuGroups[q.group];q.editor=n;q.name=o;},proto:{render:function(n,o,p){var w=this;var q=n.id+String(o),r=typeof w.state=='undefined'?2:w.state,s=' cke_'+(r==1?'on':r==0?'disabled':'off'),t=w.label;if(w.className)s+=' '+w.className;var u=w.getItems;p.push(''+''+'');if(u)p.push('','&#',w.editor.lang.dir=='rtl'?'9668':'9658',';','');p.push(t,'');}}});})();i.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div'; +(function(){var m;j.add('editingblock',{init:function(n){if(!n.config.editingBlock)return;n.on('themeSpace',function(o){if(o.data.space=='contents')o.data.html+='
';});n.on('themeLoaded',function(){n.fireOnce('editingBlockReady');});n.on('uiReady',function(){n.setMode(n.config.startupMode);});n.on('afterSetData',function(){if(!m){function o(){m=true;n.getMode().loadData(n.getData());m=false;};if(n.mode)o();else n.on('mode',function(){if(n.mode){o();n.removeListener('mode',arguments.callee);}});}});n.on('beforeGetData',function(){if(!m&&n.mode){m=true;n.setData(n.getMode().getData(),null,1);m=false;}});n.on('getSnapshot',function(o){if(n.mode)o.data=n.getMode().getSnapshotData();});n.on('loadSnapshot',function(o){if(n.mode)n.getMode().loadSnapshotData(o.data);});n.on('mode',function(o){o.removeListener();b.webkit&&n.container.on('focus',function(){n.focus();});if(n.config.startupFocus)n.focus();setTimeout(function(){n.fireOnce('instanceReady');a.fire('instanceReady',null,n);},0);});n.on('destroy',function(){var o=this;if(o.mode)o._.modes[o.mode].unload(o.getThemeSpace('contents'));});}});a.editor.prototype.mode='';a.editor.prototype.addMode=function(n,o){o.name=n;(this._.modes||(this._.modes={}))[n]=o;};a.editor.prototype.setMode=function(n){this.fire('beforeSetMode',{newMode:n});var o,p=this.getThemeSpace('contents'),q=this.checkDirty();if(this.mode){if(n==this.mode)return;this._.previousMode=this.mode;this.fire('beforeModeUnload');var r=this.getMode();o=r.getData();r.unload(p);this.mode='';}p.setHtml('');var s=this.getMode(n);if(!s)throw '[CKEDITOR.editor.setMode] Unknown mode "'+n+'".';if(!q)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});s.load(p,typeof o!='string'?this.getData():o);};a.editor.prototype.getMode=function(n){return this._.modes&&this._.modes[n||this.mode];};a.editor.prototype.focus=function(){this.forceNextSelectionCheck();var n=this.getMode();if(n)n.focus();};})();i.startupMode='wysiwyg';i.editingBlock=true;(function(){function m(){var G=this;try{var D=G.getSelection();if(!D||!D.document.getWindow().$)return;var E=D.getStartElement(),F=new d.elementPath(E);if(!F.compare(G._.selectionPreviousPath)){G._.selectionPreviousPath=F;G.fire('selectionChange',{selection:D,path:F,element:E});}}catch(H){}};var n,o;function p(){o=true;if(n)return;q.call(this);n=e.setTimeout(q,200,this);};function q(){n=null;if(o){e.setTimeout(m,0,this);o=false;}};function r(D){function E(I,J){if(!I||I.type==3)return false; +var K=D.clone();return K['moveToElementEdit'+(J?'End':'Start')](I);};var F=D.startContainer,G=D.getPreviousNode(A,null,F),H=D.getNextNode(A,null,F);if(E(G)||E(H,1))return true;if(!(G||H)&&!(F.type==1&&F.isBlockBoundary()&&F.getBogus()))return true;return false;};var s={modes:{wysiwyg:1,source:1},readOnly:c||b.webkit,exec:function(D){switch(D.mode){case 'wysiwyg':D.document.$.execCommand('SelectAll',false,null);D.forceNextSelectionCheck();D.selectionChange();break;case 'source':var E=D.textarea.$;if(c)E.createTextRange().execCommand('SelectAll');else{E.selectionStart=0;E.selectionEnd=E.value.length;}E.focus();}},canUndo:false};function t(D){w(D);var E=D.createText('​');D.setCustomData('cke-fillingChar',E);return E;};function u(D){return D&&D.getCustomData('cke-fillingChar');};function v(D){var E=D&&u(D);if(E)if(E.getCustomData('ready'))w(D);else E.setCustomData('ready',1);};function w(D){var E=D&&D.removeCustomData('cke-fillingChar');if(E){var F,G=D.getSelection().getNative(),H=G&&G.type!='None'&&G.getRangeAt(0);if(E.getLength()>1&&H&&H.intersectsNode(E.$)){F=[G.anchorOffset,G.focusOffset];var I=G.anchorNode==E.$&&G.anchorOffset>0,J=G.focusNode==E.$&&G.focusOffset>0;I&&F[0]--;J&&F[1]--;x(G)&&F.unshift(F.pop());}E.setText(E.getText().replace(/\u200B/g,''));if(F){var K=G.getRangeAt(0);K.setStart(K.startContainer,F[0]);K.setEnd(K.startContainer,F[1]);G.removeAllRanges();G.addRange(K);}}};function x(D){if(!D.isCollapsed){var E=D.getRangeAt(0);E.setStart(D.anchorNode,D.anchorOffset);E.setEnd(D.focusNode,D.focusOffset);return E.collapsed;}};j.add('selection',{init:function(D){if(b.webkit){D.on('selectionChange',function(){v(D.document);});D.on('beforeSetMode',function(){w(D.document);});var E,F;function G(){var I=D.document,J=u(I);if(J){var K=I.$.defaultView.getSelection();if(K.type=='Caret'&&K.anchorNode==J.$)F=1;E=J.getText();J.setText(E.replace(/\u200B/g,''));}};function H(){var I=D.document,J=u(I);if(J){J.setText(E);if(F){I.$.defaultView.getSelection().setPosition(J.$,J.getLength());F=0;}}};D.on('beforeUndoImage',G);D.on('afterUndoImage',H);D.on('beforeGetData',G,null,null,0);D.on('getData',H);}D.on('contentDom',function(){var I=D.document,J=a.document,K=I.getBody(),L=I.getDocumentElement();if(c){var M,N,O=1;K.on('focusin',function(V){if(V.data.$.srcElement.nodeName!='BODY')return;var W=I.getCustomData('cke_locked_selection');if(W){W.unlock(1);W.lock();}else if(M&&O){try{M.select();}catch(X){}M=null;}});K.on('focus',function(){N=1;U();});K.on('beforedeactivate',function(V){if(V.data.$.toElement)return; +N=0;O=1;});c&&D.on('blur',function(){try{I.$.selection.empty();}catch(V){}});L.on('mousedown',function(){O=0;});L.on('mouseup',function(){O=1;});var P;K.on('mousedown',function(V){if(V.data.$.button==2){var W=D.document.$.selection;if(W.type=='None')P=D.window.getScrollPosition();}T();});K.on('mouseup',function(V){if(V.data.$.button==2&&P){D.document.$.documentElement.scrollLeft=P.x;D.document.$.documentElement.scrollTop=P.y;}P=null;N=1;setTimeout(function(){U(true);},0);});K.on('keydown',T);K.on('keyup',function(){N=1;U();});if(I.$.compatMode!='BackCompat'){if(b.ie7Compat||b.ie6Compat){function Q(V,W,X){try{V.moveToPoint(W,X);}catch(Y){}};L.on('mousedown',function(V){function W(ab){ab=ab.data.$;if(Z){var ac=K.$.createTextRange();Q(ac,ab.x,ab.y);Z.setEndPoint(aa.compareEndPoints('StartToStart',ac)<0?'EndToEnd':'StartToStart',ac);Z.select();}};function X(){J.removeListener('mouseup',Y);L.removeListener('mouseup',Y);};function Y(){L.removeListener('mousemove',W);X();Z.select();};V=V.data;if(V.getTarget().is('html')&&V.$.x0)P=Q-1;else if(R<0)O=Q+1;else if(b.ie9Compat&&L.tagName=='BR'){var U=J.defaultView.getSelection();return{container:U[H?'anchorNode':'focusNode'],offset:U[H?'anchorOffset':'focusOffset']};}else return{container:I,offset:E(L)};}if(Q==-1||Q==K.length-1&&R<0){N.moveToElementText(I);N.setEndPoint('StartToStart',G);S=N.text.replace(/(\r\n|\r)/g,'\n').length;K=I.childNodes;if(!S){L=K[K.length-1];if(L.nodeType!=3)return{container:I,offset:K.length};else return{container:L,offset:L.nodeValue.length};}var V=K.length; +while(S>0&&V>0){M=K[--V];if(M.nodeType==3){T=M;S-=M.nodeValue.length;}}return{container:T,offset:-S};}else{N.collapse(R>0?true:false);N.setEndPoint(R>0?'StartToStart':'EndToStart',G);S=N.text.replace(/(\r\n|\r)/g,'\n').length;if(!S)return{container:I,offset:E(L)+(R>0?0:1)};while(S>0)try{M=L[R>0?'previousSibling':'nextSibling'];if(M.nodeType==3){S-=M.nodeValue.length;T=M;}L=M;}catch(W){return{container:I,offset:E(L)};}return{container:T,offset:R>0?-S:T.nodeValue.length+S};}};return function(){var Q=this;var G=Q.getNative(),H=G&&G.createRange(),I=Q.getType(),J;if(!G)return[];if(I==2){J=new d.range(Q.document);var K=F(H,true);J.setStart(new d.node(K.container),K.offset);K=F(H);J.setEnd(new d.node(K.container),K.offset);if(J.endContainer.getPosition(J.startContainer)&4&&J.endOffset<=J.startContainer.getIndex())J.collapse();return[J];}else if(I==3){var L=[];for(var M=0;M=L.getLength())P.setStartAfter(L);else P.setStartBefore(L);if(M&&M.type==3)if(!O)P.setEndBefore(M);else P.setEndAfter(M);var Q=new d.walker(P);Q.evaluator=function(R){if(R.type==1&&R.isReadOnly()){var S=I.clone();I.setEndBefore(R);if(I.collapsed)G.splice(H--,1);if(!(R.getPosition(P.endContainer)&16)){S.setStartAfter(R);if(!S.collapsed)G.splice(H+1,0,S);}return true;}return false;};Q.next();}}return F.ranges;};})(),getStartElement:function(){var K=this;var D=K._.cache;if(D.startElement!==undefined)return D.startElement; +var E,F=K.getNative();switch(K.getType()){case 3:return K.getSelectedElement();case 2:var G=K.getRanges()[0];if(G){if(!G.collapsed){G.optimize();while(1){var H=G.startContainer,I=G.startOffset;if(I==(H.getChildCount?H.getChildCount():H.getLength())&&!H.isBlockBoundary())G.setStartAfter(H);else break;}E=G.startContainer;if(E.type!=1)return E.getParent();E=E.getChild(G.startOffset);if(!E||E.type!=1)E=G.startContainer;else{var J=E.getFirst();while(J&&J.type==1){E=J;J=J.getFirst();}}}else{E=G.startContainer;if(E.type!=1)E=E.getParent();}E=E.$;}}return D.startElement=E?new h(E):null;},getSelectedElement:function(){var D=this._.cache;if(D.selectedElement!==undefined)return D.selectedElement;var E=this,F=e.tryThese(function(){return E.getNative().createRange().item(0);},function(){var G,H,I=E.getRanges()[0],J=I.getCommonAncestor(1,1),K={table:1,ul:1,ol:1,dl:1};for(var L in K){if(G=J.getAscendant(L,1))break;}if(G){var M=new d.range(this.document);M.setStartAt(G,1);M.setEnd(I.startContainer,I.startOffset);var N=e.extend(K,f.$listItem,f.$tableContent),O=new d.walker(M),P=function(Q,R){return function(S,T){if(S.type==3&&(!e.trim(S.getText())||S.getParent().data('cke-bookmark')))return true;var U;if(S.type==1){U=S.getName();if(U=='br'&&R&&S.equals(S.getParent().getBogus()))return true;if(T&&U in N||U in f.$removeEmpty)return true;}Q.halted=1;return false;};};O.guard=P(O);if(O.checkBackward()&&!O.halted){O=new d.walker(M);M.setStart(I.endContainer,I.endOffset);M.setEndAt(G,2);O.guard=P(O,1);if(O.checkForward()&&!O.halted)H=G.$;}}if(!H)throw 0;return H;},function(){var G=E.getRanges()[0],H,I;for(var J=2;J&&!((H=G.getEnclosedNode())&&H.type==1&&y[H.getName()]&&(I=H));J--)G.shrink(1);return I.$;});return D.selectedElement=F?new h(F):null;},getSelectedText:function(){var D=this._.cache;if(D.selectedText!==undefined)return D.selectedText;var E='',F=this.getNative();if(this.getType()==2)E=c?F.createRange().text:F.toString();return D.selectedText=E;},lock:function(){var D=this;D.getRanges();D.getStartElement();D.getSelectedElement();D.getSelectedText();D._.cache.nativeSel={};D.isLocked=1;D.document.setCustomData('cke_locked_selection',D);},unlock:function(D){var I=this;var E=I.document,F=E.getCustomData('cke_locked_selection');if(F){E.setCustomData('cke_locked_selection',null);if(D){var G=F.getSelectedElement(),H=!G&&F.getRanges();I.isLocked=0;I.reset();if(G)I.selectElement(G);else I.selectRanges(H);}}if(!F||!D){I.isLocked=0;I.reset();}},reset:function(){this._.cache={};},selectElement:function(D){var F=this; +if(F.isLocked){var E=new d.range(F.document);E.setStartBefore(D);E.setEndAfter(D);F._.cache.selectedElement=D;F._.cache.startElement=D;F._.cache.ranges=new d.rangeList(E);F._.cache.type=3;return;}E=new d.range(D.getDocument());E.setStartBefore(D);E.setEndAfter(D);E.select();F.document.fire('selectionchange');F.reset();},selectRanges:function(D){var R=this;if(R.isLocked){R._.cache.selectedElement=null;R._.cache.startElement=D[0]&&D[0].getTouchedStartNode();R._.cache.ranges=new d.rangeList(D);R._.cache.type=2;return;}if(c){if(D.length>1){var E=D[D.length-1];D[0].setEnd(E.endContainer,E.endOffset);D.length=1;}if(D[0])D[0].select();R.reset();}else{var F=R.getNative();if(!F)return;if(D.length){F.removeAllRanges();b.webkit&&w(R.document);}for(var G=0;G=0){M.collapse(1);N.setEnd(M.endContainer.$,M.endOffset);}else throw S;}F.addRange(N);}R.document.fire('selectionchange');R.reset();}},createBookmarks:function(D){return this.getRanges().createBookmarks(D);},createBookmarks2:function(D){return this.getRanges().createBookmarks2(D);},selectBookmarks:function(D){var E=[];for(var F=0;F','','',this.label,'','=10900&&!o.hc?'':" href=\"javascript:void('"+this.label+"')\"",' role="button" aria-labelledby="',p,'_label" aria-describedby="',p,'_text" aria-haspopup="true"'); +if(b.opera||b.gecko&&b.mac)n.push(' onkeypress="return false;"');if(b.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');n.push(' onkeydown="CKEDITOR.tools.callFunction( ',t,', event, this );" onfocus="return CKEDITOR.tools.callFunction(',u,', event);" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',q,', this); return false;">'+this.label+''+''+''+(b.hc?'▼':b.air?' ':'')+''+''+''+'
');if(this.onRender)this.onRender();return r;},createPanel:function(m){if(this._.panel)return;var n=this._.panelDefinition,o=this._.panelDefinition.block,p=n.parent||a.document.getBody(),q=new k.floatPanel(m,p,n),r=q.addListBlock(this.id,o),s=this;q.onShow=function(){if(s.className)this.element.getFirst().addClass(s.className+'_panel');s.setState(1);r.focus(!s.multiSelect&&s.getValue());s._.on=1;if(s.onOpen)s.onOpen();};q.onHide=function(t){if(s.className)this.element.getFirst().removeClass(s.className+'_panel');s.setState(s.modes&&s.modes[m.mode]?2:0);s._.on=0;if(!t&&s.onClose)s.onClose();};q.onEscape=function(){q.hide();};r.onClick=function(t,u){s.document.getWindow().focus();if(s.onClick)s.onClick.call(s,t,u);if(u)s.setValue(t,s._.items[t]);else s.setValue('');q.hide(false);};this._.panel=q;this._.list=r;q.getBlock(this.id).onHide=function(){s._.on=0;s.setState(2);};if(this.init)this.init();},setValue:function(m,n){var p=this;p._.value=m;var o=p.document.getById('cke_'+p.id+'_text');if(o){if(!(m||n)){n=p.label;o.addClass('cke_inline_label');}else o.removeClass('cke_inline_label');o.setHtml(typeof n!='undefined'?n:m);}},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(m){this._.list.mark(m);},hideItem:function(m){this._.list.hideItem(m);},hideGroup:function(m){this._.list.hideGroup(m);},showAll:function(){this._.list.showAll();},add:function(m,n,o){this._.items[m]=o||m;this._.list.add(m,n,o);},startGroup:function(m){this._.list.startGroup(m);},commit:function(){var m=this;if(!m._.committed){m._.list.commit();m._.committed=1;k.fire('ready',m);}m._.committed=1;},setState:function(m){var n=this;if(n._.state==m)return;n.document.getById('cke_'+n.id).setState(m);n._.state=m;}}});k.prototype.addRichCombo=function(m,n){this.add(m,'richcombo',n);};j.add('htmlwriter');a.htmlWriter=e.createClass({base:a.htmlParser.basicWriter,$:function(){var o=this; +o.base();o.indentationChars='\t';o.selfClosingEnd=' />';o.lineBreakChars='\n';o.forceSimpleAmpersand=0;o.sortAttributes=1;o._.indent=0;o._.indentation='';o._.inPre=0;o._.rules={};var m=f;for(var n in e.extend({},m.$nonBodyContent,m.$block,m.$listItem,m.$tableContent))o.setRules(n,{indent:1,breakBeforeOpen:1,breakAfterOpen:1,breakBeforeClose:!m[n]['#'],breakAfterClose:1});o.setRules('br',{breakAfterOpen:1});o.setRules('title',{indent:0,breakAfterOpen:0});o.setRules('style',{indent:0,breakBeforeClose:1});o.setRules('pre',{indent:0});},proto:{openTag:function(m,n){var p=this;var o=p._.rules[m];if(p._.indent)p.indentation();else if(o&&o.breakBeforeOpen){p.lineBreak();p.indentation();}p._.output.push('<',m);},openTagClose:function(m,n){var p=this;var o=p._.rules[m];if(n)p._.output.push(p.selfClosingEnd);else{p._.output.push('>');if(o&&o.indent)p._.indentation+=p.indentationChars;}if(o&&o.breakAfterOpen)p.lineBreak();m=='pre'&&(p._.inPre=1);},attribute:function(m,n){if(typeof n=='string'){this.forceSimpleAmpersand&&(n=n.replace(/&/g,'&'));n=e.htmlEncodeAttr(n);}this._.output.push(' ',m,'="',n,'"');},closeTag:function(m){var o=this;var n=o._.rules[m];if(n&&n.indent)o._.indentation=o._.indentation.substr(o.indentationChars.length);if(o._.indent)o.indentation();else if(n&&n.breakBeforeClose){o.lineBreak();o.indentation();}o._.output.push('');m=='pre'&&(o._.inPre=0);if(n&&n.breakAfterClose)o.lineBreak();},text:function(m){var n=this;if(n._.indent){n.indentation();!n._.inPre&&(m=e.ltrim(m));}n._.output.push(m);},comment:function(m){if(this._.indent)this.indentation();this._.output.push('');},lineBreak:function(){var m=this;if(!m._.inPre&&m._.output.length>0)m._.output.push(m.lineBreakChars);m._.indent=1;},indentation:function(){var m=this;if(!m._.inPre)m._.output.push(m._.indentation);m._.indent=0;},setRules:function(m,n){var o=this._.rules[m];if(o)e.extend(o,n,true);else this._.rules[m]=n;}}});j.add('menubutton',{requires:['button','menu'],beforeInit:function(m){m.ui.addHandler('menubutton',k.menuButton.handler);}});a.UI_MENUBUTTON='menubutton';(function(){var m=function(n){var o=this._;if(o.state===0)return;o.previousState=o.state;var p=o.menu;if(!p){p=o.menu=new a.menu(n,{panel:{className:n.skinClass+' cke_contextmenu',attributes:{'aria-label':n.lang.common.options}}});p.onHide=e.bind(function(){this.setState(this.modes&&this.modes[n.mode]?o.previousState:0);},this);if(this.onMenu)p.addListener(this.onMenu);}if(o.on){p.hide();return;}this.setState(1); +p.show(a.document.getById(this._.id),4);};k.menuButton=e.createClass({base:k.button,$:function(n){var o=n.panel;delete n.panel;this.base(n);this.hasArrow=true;this.click=m;},statics:{handler:{create:function(n){return new k.menuButton(n);}}}});})();j.add('dialogui');(function(){var m=function(u){var x=this;x._||(x._={});x._['default']=x._.initValue=u['default']||'';x._.required=u.required||false;var v=[x._];for(var w=1;w',v.label,'','');else{var D={type:'hbox',widths:v.widths,padding:0,children:[{type:'html',html:'
');return o;},getHolderElement:function(){var m=this._.holder;if(!m){if(this.forceIFrame||this.css.length){var n=this.document.getById(this.id+'_frame'),o=n.getParent(),p=o.getAttribute('dir'),q=o.getParent().getAttribute('class'),r=o.getParent().getAttribute('lang'),s=n.getFrameDocument();b.iOS&&o.setStyles({overflow:'scroll','-webkit-overflow-scrolling':'touch'});var t=e.addFunction(e.bind(function(w){this.isLoaded=true;if(this.onLoad)this.onLoad();},this)),u=''+''+''+e.buildStyleHtml(this.css)+''+''+''; +s.write(u);var v=s.getWindow();v.$.CKEDITOR=a;s.on('key'+(b.opera?'press':'down'),function(w){var z=this;var x=w.data.getKeystroke(),y=z.document.getById(z.id).getAttribute('dir');if(z._.onKeyDown&&z._.onKeyDown(x)===false){w.data.preventDefault();return;}if(x==27||x==(y=='rtl'?39:37))if(z.onEscape&&z.onEscape(x)===false)w.data.preventDefault();},this);m=s.getBody();m.unselectable();b.air&&e.callFunction(t);}else m=this.document.getById(this.id);this._.holder=m;}return m;},addBlock:function(m,n){var o=this;n=o._.blocks[m]=n instanceof k.panel.block?n:new k.panel.block(o.getHolderElement(),n);if(!o._.currentBlock)o.showBlock(m);return n;},getBlock:function(m){return this._.blocks[m];},showBlock:function(m){var r=this;var n=r._.blocks,o=n[m],p=r._.currentBlock,q=!r.forceIFrame||c?r._.holder:r.document.getById(r.id+'_frame');if(p){q.removeAttributes(p.attributes);p.hide();}r._.currentBlock=o;q.setAttributes(o.attributes);a.fire('ariaWidget',q);o._.focusIndex=-1;r._.onKeyDown=o.onKeyDown&&e.bind(o.onKeyDown,o);o.show();return o;},destroy:function(){this.element&&this.element.remove();}};k.panel.block=e.createClass({$:function(m,n){var o=this;o.element=m.append(m.getDocument().createElement('div',{attributes:{tabIndex:-1,'class':'cke_panel_block',role:'presentation'},styles:{display:'none'}}));if(n)e.extend(o,n);if(!o.attributes.title)o.attributes.title=o.attributes['aria-label'];o.keys={};o._.focusIndex=-1;o.element.disableContextMenu();},_:{markItem:function(m){var p=this;if(m==-1)return;var n=p.element.getElementsByTag('a'),o=n.getItem(p._.focusIndex=m);if(b.webkit||b.opera)o.getDocument().getWindow().focus();o.focus();p.onMark&&p.onMark(o);}},proto:{show:function(){this.element.setStyle('display','');},hide:function(){var m=this;if(!m.onHide||m.onHide.call(m)!==true)m.element.setStyle('display','none');},onKeyDown:function(m){var r=this;var n=r.keys[m];switch(n){case 'next':var o=r._.focusIndex,p=r.element.getElementsByTag('a'),q;while(q=p.getItem(++o)){if(q.getAttribute('_cke_focus')&&q.$.offsetWidth){r._.focusIndex=o;q.focus();break;}}return false;case 'prev':o=r._.focusIndex;p=r.element.getElementsByTag('a');while(o>0&&(q=p.getItem(--o))){if(q.getAttribute('_cke_focus')&&q.$.offsetWidth){r._.focusIndex=o;q.focus();break;}}return false;case 'click':case 'mouseup':o=r._.focusIndex;q=o>=0&&r.element.getElementsByTag('a').getItem(o);if(q)q.$[n]?q.$[n]():q.$['on'+n]();return false;}return true;}}});j.add('listblock',{requires:['panel'],onLoad:function(){k.panel.prototype.addListBlock=function(m,n){return this.addBlock(m,new k.listBlock(this.getHolderElement(),n)); +};k.listBlock=e.createClass({base:k.panel.block,$:function(m,n){var q=this;n=n||{};var o=n.attributes||(n.attributes={});(q.multiSelect=!!n.multiSelect)&&(o['aria-multiselectable']=true);!o.role&&(o.role='listbox');q.base.apply(q,arguments);var p=q.keys;p[40]='next';p[9]='next';p[38]='prev';p[2228224+9]='prev';p[32]=c?'mouseup':'click';c&&(p[13]='mouseup');q._.pendingHtml=[];q._.items={};q._.groups={};},_:{close:function(){if(this._.started){this._.pendingHtml.push('');delete this._.started;}},getClick:function(){if(!this._.click)this._.click=e.addFunction(function(m){var o=this;var n=true;if(o.multiSelect)n=o.toggle(m);else o.mark(m);if(o.onClick)o.onClick(m,n);},this);return this._.click;}},proto:{add:function(m,n,o){var r=this;var p=r._.pendingHtml,q=e.getNextId();if(!r._.started){p.push('
'+'',j=a.config.wsc_customLoaderScript||g+'//loader.webspellchecker.net/sproxy_fck/sproxy.php'+'?plugin=fck2'+'&customerid='+a.config.wsc_customerId+'&cmd=script&doc=wsc&schema=22';if(a.config.wsc_customLoaderScript)h+='

'+a.lang.spellCheck.errorLoading.replace(/%s/g,a.config.wsc_customLoaderScript)+'

';function k(m,n){var o=0;return function(){if(typeof window.doSpell=='function'){if(typeof f!='undefined')window.clearInterval(f);l(m);}else if(o++==180)window._cancelOnError(n);};};window._cancelOnError=function(m){if(typeof window.WSC_Error=='undefined'){CKEDITOR.document.getById(c).setStyle('display','none');var n=CKEDITOR.document.getById(e);n.setStyle('display','block');n.setHtml(m||a.lang.spellCheck.notAvailable);}};function l(m){var n=new window._SP_FCK_LangCompare(),o=CKEDITOR.getUrl(a.plugins.wsc.path+'dialogs/'),p=o+'tmpFrameset.html';window.gFCKPluginName='wsc';n.setDefaulLangCode(a.config.defaultLanguage);window.doSpell({ctrl:d,lang:a.config.wsc_lang||n.getSPLangCode(a.langCode),intLang:a.config.wsc_uiLang||n.getSPLangCode(a.langCode),winType:c,onCancel:function(){m.hide();},onFinish:function(q){a.focus();m.getParentEditor().setData(q.value);m.hide();},staticFrame:p,framesetPath:p,iframePath:o+'ciframe.html',schemaURI:o+'wsc.css',userDictionaryName:a.config.wsc_userDictionaryName,customDictionaryName:a.config.wsc_customDictionaryIds&&a.config.wsc_customDictionaryIds.split(','),domainName:a.config.wsc_domainName});CKEDITOR.document.getById(e).setStyle('display','none');CKEDITOR.document.getById(c).setStyle('display','block');};return{title:a.config.wsc_dialogTitle||a.lang.spellCheck.title,minWidth:485,minHeight:380,buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var m=this.getContentElement('general','content').getElement();m.setHtml(i);m.getChild(2).setStyle('height',this._.contentSize.height+'px'); -if(typeof window.doSpell!='function')CKEDITOR.document.getHead().append(CKEDITOR.document.createElement('script',{attributes:{type:'text/javascript',src:j}}));var n=a.getData();CKEDITOR.document.getById(d).setValue(n);f=window.setInterval(k(this,h),250);},onHide:function(){window.ooo=undefined;window.int_framsetLoaded=undefined;window.framesetLoaded=undefined;window.is_window_opened=false;},contents:[{id:'general',label:a.config.wsc_dialogTitle||a.lang.spellCheck.title,padding:0,elements:[{type:'html',id:'content',html:''}]}]};});CKEDITOR.dialog.on('resize',function(a){var b=a.data,c=b.dialog;if(c._.name=='checkspell'){var d=c.getContentElement('general','content').getElement(),e=d&&d.getChild(2);e&&e.setSize('height',b.height);e&&e.setSize('width',b.width);}}); +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.dialog.add('checkspell',function(a){var b=CKEDITOR.tools.getNextNumber(),c='cke_frame_'+b,d='cke_data_'+b,e='cke_error_'+b,f,g=document.location.protocol||'http:',h=a.lang.spellCheck.notAvailable,i='
'+'',j=a.config.wsc_customLoaderScript||g+'//loader.webspellchecker.net/sproxy_fck/sproxy.php'+'?plugin=fck2'+'&customerid='+a.config.wsc_customerId+'&cmd=script&doc=wsc&schema=22';if(a.config.wsc_customLoaderScript)h+='

'+a.lang.spellCheck.errorLoading.replace(/%s/g,a.config.wsc_customLoaderScript)+'

';function k(m,n){var o=0;return function(){if(typeof window.doSpell=='function'){if(typeof f!='undefined')window.clearInterval(f);l(m);}else if(o++==180)window._cancelOnError(n);};};window._cancelOnError=function(m){if(typeof window.WSC_Error=='undefined'){CKEDITOR.document.getById(c).setStyle('display','none');var n=CKEDITOR.document.getById(e);n.setStyle('display','block');n.setHtml(m||a.lang.spellCheck.notAvailable);}};function l(m){var n=new window._SP_FCK_LangCompare(),o=CKEDITOR.getUrl(a.plugins.wsc.path+'dialogs/'),p=o+'tmpFrameset.html';window.gFCKPluginName='wsc';n.setDefaulLangCode(a.config.defaultLanguage);window.doSpell({ctrl:d,lang:a.config.wsc_lang||n.getSPLangCode(a.langCode),intLang:a.config.wsc_uiLang||n.getSPLangCode(a.langCode),winType:c,onCancel:function(){m.hide();},onFinish:function(q){a.focus();m.getParentEditor().setData(q.value);m.hide();},staticFrame:p,framesetPath:p,iframePath:o+'ciframe.html',schemaURI:o+'wsc.css',userDictionaryName:a.config.wsc_userDictionaryName,customDictionaryName:a.config.wsc_customDictionaryIds&&a.config.wsc_customDictionaryIds.split(','),domainName:a.config.wsc_domainName});CKEDITOR.document.getById(e).setStyle('display','none');CKEDITOR.document.getById(c).setStyle('display','block');};return{title:a.config.wsc_dialogTitle||a.lang.spellCheck.title,minWidth:485,minHeight:380,buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var m=this.getContentElement('general','content').getElement();m.setHtml(i);m.getChild(2).setStyle('height',this._.contentSize.height+'px'); +if(typeof window.doSpell!='function')CKEDITOR.document.getHead().append(CKEDITOR.document.createElement('script',{attributes:{type:'text/javascript',src:j}}));var n=a.getData();CKEDITOR.document.getById(d).setValue(n);f=window.setInterval(k(this,h),250);},onHide:function(){window.ooo=undefined;window.int_framsetLoaded=undefined;window.framesetLoaded=undefined;window.is_window_opened=false;},contents:[{id:'general',label:a.config.wsc_dialogTitle||a.lang.spellCheck.title,padding:0,elements:[{type:'html',id:'content',html:''}]}]};});CKEDITOR.dialog.on('resize',function(a){var b=a.data,c=b.dialog;if(c._.name=='checkspell'){var d=c.getContentElement('general','content').getElement(),e=d&&d.getChild(2);e&&e.setSize('height',b.height);e&&e.setSize('width',b.width);}}); diff --git a/assets/grocery_crud/texteditor/ckeditor/plugins/xml/plugin.js b/assets/grocery_crud/texteditor/ckeditor/plugins/xml/plugin.js index d1dc6a2..e27371d 100755 --- a/assets/grocery_crud/texteditor/ckeditor/plugins/xml/plugin.js +++ b/assets/grocery_crud/texteditor/ckeditor/plugins/xml/plugin.js @@ -1,6 +1,6 @@ -/* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -(function(){CKEDITOR.plugins.add('xml',{});CKEDITOR.xml=function(a){var b=null;if(typeof a=='object')b=a;else{var c=(a||'').replace(/ /g,'\xa0');if(window.DOMParser)b=new DOMParser().parseFromString(c,'text/xml');else if(window.ActiveXObject){try{b=new ActiveXObject('MSXML2.DOMDocument');}catch(d){try{b=new ActiveXObject('Microsoft.XmlDom');}catch(d){}}if(b){b.async=false;b.resolveExternals=false;b.validateOnParse=false;b.loadXML(c);}}}this.baseXml=b;};CKEDITOR.xml.prototype={selectSingleNode:function(a,b){var c=this.baseXml;if(b||(b=c))if(CKEDITOR.env.ie||b.selectSingleNode)return b.selectSingleNode(a);else if(c.evaluate){var d=c.evaluate(a,b,null,9,null);return d&&d.singleNodeValue||null;}return null;},selectNodes:function(a,b){var c=this.baseXml,d=[];if(b||(b=c))if(CKEDITOR.env.ie||b.selectNodes)return b.selectNodes(a);else if(c.evaluate){var e=c.evaluate(a,b,null,5,null);if(e){var f;while(f=e.iterateNext())d.push(f);}}return d;},getInnerXml:function(a,b){var c=this.selectSingleNode(a,b),d=[];if(c){c=c.firstChild;while(c){if(c.xml)d.push(c.xml);else if(window.XMLSerializer)d.push(new XMLSerializer().serializeToString(c));c=c.nextSibling;}}return d.length?d.join(''):null;}};})(); +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function(){CKEDITOR.plugins.add('xml',{});CKEDITOR.xml=function(a){var b=null;if(typeof a=='object')b=a;else{var c=(a||'').replace(/ /g,'\xa0');if(window.DOMParser)b=new DOMParser().parseFromString(c,'text/xml');else if(window.ActiveXObject){try{b=new ActiveXObject('MSXML2.DOMDocument');}catch(d){try{b=new ActiveXObject('Microsoft.XmlDom');}catch(d){}}if(b){b.async=false;b.resolveExternals=false;b.validateOnParse=false;b.loadXML(c);}}}this.baseXml=b;};CKEDITOR.xml.prototype={selectSingleNode:function(a,b){var c=this.baseXml;if(b||(b=c))if(CKEDITOR.env.ie||b.selectSingleNode)return b.selectSingleNode(a);else if(c.evaluate){var d=c.evaluate(a,b,null,9,null);return d&&d.singleNodeValue||null;}return null;},selectNodes:function(a,b){var c=this.baseXml,d=[];if(b||(b=c))if(CKEDITOR.env.ie||b.selectNodes)return b.selectNodes(a);else if(c.evaluate){var e=c.evaluate(a,b,null,5,null);if(e){var f;while(f=e.iterateNext())d.push(f);}}return d;},getInnerXml:function(a,b){var c=this.selectSingleNode(a,b),d=[];if(c){c=c.firstChild;while(c){if(c.xml)d.push(c.xml);else if(window.XMLSerializer)d.push(new XMLSerializer().serializeToString(c));c=c.nextSibling;}}return d.length?d.join(''):null;}};})(); diff --git a/assets/grocery_crud/texteditor/ckeditor/skins/kama/dialog.css b/assets/grocery_crud/texteditor/ckeditor/skins/kama/dialog.css index 0ce353e..eabc7a5 100755 --- a/assets/grocery_crud/texteditor/ckeditor/skins/kama/dialog.css +++ b/assets/grocery_crud/texteditor/ckeditor/skins/kama/dialog.css @@ -1,10 +1,10 @@ -/* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -body .cke_dialog{visibility:visible;}.cke_skin_kama table.cke_dialog.cke_browser_gecko{display:block;}.cke_skin_kama .cke_dialog_body{z-index:1;border:solid 1px #ddd;padding:5px;background-color:#fff;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;_position:static;}.cke_skin_kama .cke_dialog_tl,.cke_skin_kama .cke_dialog_tr,.cke_skin_kama .cke_dialog_tc,.cke_skin_kama .cke_dialog_bl,.cke_skin_kama .cke_dialog_br,.cke_skin_kama .cke_dialog_bc,.cke_skin_kama .cke_dialog_ml,.cke_skin_kama .cke_dialog_mr{display:none;}.cke_skin_kama .cke_dialog_title{font-weight:bold;font-size:14px;padding:3px 3px 8px;cursor:move;position:relative;border-bottom:1px solid #eee;}.cke_skin_kama .cke_browser_iequirks .cke_dialog_title,.cke_skin_kama .cke_browser_ie6 .cke_dialog_title,.cke_skin_kama .cke_browser_ie7 .cke_dialog_title{margin-bottom:22px;}.cke_skin_kama .cke_browser_iequirks.cke_single_page .cke_dialog_title,.cke_skin_kama .cke_browser_ie6.cke_single_page .cke_dialog_title,.cke_skin_kama .cke_browser_ie7.cke_single_page .cke_dialog_title{margin-bottom:10px;}.cke_skin_kama .cke_dialog_contents{background-color:#ebebeb;border:solid 1px #fff;border-bottom:none;overflow:auto;padding:17px 10px 5px 10px;-moz-border-radius-topleft:5px;-moz-border-radius-topright:5px;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;border-top-left-radius:5px;border-top-right-radius:5px;margin-top:22px;}.cke_skin_kama .cke_dialog_footer{text-align:right;background-color:#ebebeb;border:solid 1px #fff;border-bottom:none;-moz-border-radius-bottomleft:5px;-moz-border-radius-bottomright:5px;-webkit-border-bottom-left-radius:5px;-webkit-border-bottom-right-radius:5px;border-bottom-left-radius:5px;border-bottom-right-radius:5px;}.cke_skin_kama .cke_rtl .cke_dialog_footer{text-align:left;}.cke_skin_kama .cke_dialog_footer .cke_resizer{margin-top:20px;}.cke_skin_kama .cke_browser_iequirks .cke_dialog_footer .cke_resizer,.cke_skin_kama .cke_browser_ie6 .cke_dialog_footer .cke_resizer{margin-top:27px;}.cke_skin_kama .cke_dialog_tabs{height:23px;display:inline-block;_display:block;margin-left:10px;margin-right:10px;margin-top:11px;position:absolute;z-index:2;}.cke_skin_kama .cke_browser_iequirks .cke_dialog_tabs,.cke_skin_kama .cke_browser_ie6 .cke_dialog_tabs,.cke_skin_kama .cke_browser_ie7 .cke_dialog_tabs{top:33px;}.cke_skin_kama .cke_rtl .cke_dialog_tabs{right:10px;}.cke_skin_kama a.cke_dialog_tab,.cke_skin_kama a:link.cke_dialog_tab,.cke_skin_kama a:active.cke_dialog_tab,.cke_skin_kama a:hover.cke_dialog_tab,.cke_skin_kama a:visited.cke_dialog_tab{background-image:url(images/sprites.png);background-repeat:repeat-x;background-position:0 -1323px;background-color:#ebebeb;height:14px;padding:4px 8px;display:inline-block;cursor:pointer;}.cke_skin_kama .cke_browser_gecko18 a.cke_dialog_tab,.cke_skin_kama .cke_browser_gecko18 a:link.cke_dialog_tab,.cke_skin_kama .cke_browser_gecko18 a:active.cke_dialog_tab,.cke_skin_kama .cke_browser_gecko18 a:hover.cke_dialog_tab,.cke_skin_kama .cke_browser_gecko18 a:visited.cke_dialog_tab{display:inline;position:relative;top:6px;}.cke_skin_kama a:hover.cke_dialog_tab{background-color:#f1f1e3;}.cke_skin_kama .cke_hc a:hover.cke_dialog_tab{padding:2px 6px!important;border-width:3px;}.cke_skin_kama a.cke_dialog_tab_selected,.cke_skin_kama a:link.cke_dialog_tab_selected,.cke_skin_kama a:active.cke_dialog_tab_selected,.cke_skin_kama a:hover.cke_dialog_tab_selected,.cke_skin_kama a:visited.cke_dialog_tab_selected{background-position:0 -1279px;cursor:default;}.cke_skin_kama .cke_hc a.cke_dialog_tab_selected,.cke_skin_kama .cke_hc a:link.cke_dialog_tab_selected,.cke_skin_kama .cke_hc a:active.cke_dialog_tab_selected,.cke_skin_kama .cke_hc a:hover.cke_dialog_tab_selected,.cke_skin_kama .cke_hc a:visited.cke_dialog_tab_selected{padding:2px 6px!important;border-width:3px;}.cke_skin_kama .cke_single_page .cke_dialog_tabs{display:none;}.cke_skin_kama .cke_single_page .cke_dialog_contents{padding-top:5px;margin-top:10px;}.cke_skin_kama .cke_dialog_ui_vbox table,.cke_skin_kama .cke_dialog_ui_hbox table{margin:auto;} -.cke_skin_kama .cke_dialog_ui_vbox_child{padding:5px 0;}.cke_skin_kama input.cke_dialog_ui_input_text,.cke_skin_kama input.cke_dialog_ui_input_password{background-color:white;border:none;padding:0;width:100%;height:14px;}.cke_skin_kama div.cke_dialog_ui_input_text,.cke_skin_kama div.cke_dialog_ui_input_password{background-color:white;border:1px solid #a0a0a0;padding:1px 0;_width:99.9%;}.cke_skin_kama .cke_browser_ie7 input.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_ie7 input.cke_dialog_ui_input_password{position:absolute;}.cke_skin_kama .cke_browser_ie7 div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_ie7 div.cke_dialog_ui_input_password{height:14px;position:relative;}.cke_skin_kama .cke_browser_ie.cke_rtl input.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_opera.cke_rtl input.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_ie.cke_rtl input.cke_dialog_ui_input_password,.cke_skin_kama .cke_browser_opera.cke_rtl input.cke_dialog_ui_input_password{padding-right:2px;}.cke_skin_kama .cke_browser_ie.cke_rtl div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_opera.cke_rtl div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_ie.cke_rtl div.cke_dialog_ui_input_password,.cke_skin_kama .cke_browser_opera.cke_rtl div.cke_dialog_ui_input_password{padding-left:2px;}.cke_skin_kama .cke_browser_ie.cke_rtl .cke_dialog_ui_vbox_child,.cke_skin_kama .cke_browser_ie.cke_rtl .cke_dialog_ui_hbox_child,.cke_skin_kama .cke_browser_ie.cke_rtl .cke_dialog_ui_hbox_first,.cke_skin_kama .cke_browser_ie.cke_rtl .cke_dialog_ui_hbox_last{padding-right:2px!important;}.cke_skin_kama .cke_browser_ie.cke_rtl div.cke_dialog_ui_input_text{padding-right:1px;}.cke_skin_kama .cke_browser_gecko.cke_hc div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_gecko.cke_hc div.cke_dialog_ui_input_password{border-width:0;}.cke_skin_kama .cke_browser_gecko18.cke_hc div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_gecko18.cke_hc div.cke_dialog_ui_input_password{border-width:1px;}.cke_skin_kama textarea.cke_dialog_ui_input_textarea{background-color:white;border:none;padding:0;width:100%;_width:99%;overflow:auto;resize:none;}.cke_skin_kama div.cke_dialog_ui_input_textarea{background-color:white;border:1px solid #a0a0a0;padding:1px 0;}.cke_skin_kama div.cke_disabled .cke_dialog_ui_labeled_content *{background-color:#a0a0a0;cursor:default;}.cke_skin_kama .cke_rtl .cke_dialog_ui_labeled_content{_width:95%;}.cke_skin_kama .cke_dialog_ui_hbox{width:100%;}.cke_skin_kama .cke_dialog_ui_hbox_first,.cke_skin_kama .cke_dialog_ui_hbox_child,.cke_skin_kama .cke_dialog_ui_hbox_last{vertical-align:top;}.cke_skin_kama .cke_ltr .cke_dialog_ui_hbox_first,.cke_skin_kama .cke_ltr .cke_dialog_ui_hbox_child{padding-right:10px;}.cke_skin_kama .cke_rtl .cke_dialog_ui_hbox_first,.cke_skin_kama .cke_rtl .cke_dialog_ui_hbox_child{padding-left:10px;}.cke_skin_kama a.cke_dialog_ui_button{border-collapse:separate;cursor:default;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;background:transparent url(images/sprites.png) repeat-x scroll 0 -1069px;_background:none;padding:5px 0;text-align:center;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button{padding:0;}.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button span{width:70px;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button span{width:100px;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button span{padding:5px 15px;text-align:center;color:#3b3b1f;background:#53D9F0 none;display:inline-block;cursor:default;}.cke_skin_kama .cke_browser_webkit a.cke_dialog_ui_button span.cke_dialog_ui_button{margin:0;}.cke_skin_kama .cke_browser_webkit a.cke_dialog_ui_button{display:inline-block;padding-top:3px;padding-bottom:2px;margin:2px 0;}.cke_skin_kama a.cke_dialog_ui_button_ok span,.cke_skin_kama a.cke_dialog_ui_button_cancel span{width:60px;padding-right:20px;padding-left:20px;}.cke_skin_kama a.cke_dialog_ui_button_ok{background-position:0 -1143px;} -.cke_skin_kama a.cke_dialog_ui_button_ok span{background:transparent url(images/sprites.png) no-repeat scroll right -1219px;}.cke_skin_kama .cke_rtl a.cke_dialog_ui_button_ok span{background-position:left -1219px;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button_ok span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button_ok span{background-color:#B8E834;margin-right:0;}.cke_skin_kama a.cke_dialog_ui_button_cancel{background-position:0 -1104px;}.cke_skin_kama a.cke_dialog_ui_button_cancel span{background:transparent url(images/sprites.png) no-repeat scroll right -1245px;}.cke_skin_kama .cke_rtl a.cke_dialog_ui_button_cancel span{background-position:left -1245px;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button_cancel span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button_cancel span{background-color:#F65D20;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button_cancel span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button_cancel span,.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button_ok span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button_ok span{background-image:none;}.cke_skin_kama span.cke_dialog_ui_button{padding:2px 10px;text-align:center;color:#222;display:inline-block;cursor:default;min-width:60px;+margin:2px 0;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons span.cke_dialog_ui_button{display:block;}.cke_skin_kama a.cke_dialog_ui_button span.cke_disabled{border:#898980 1px solid;color:#5e5e55;background-color:#c5c5b3;}.cke_skin_kama a:hover.cke_dialog_ui_button,.cke_skin_kama a:focus.cke_dialog_ui_button,.cke_skin_kama a:active.cke_dialog_ui_button{background-position:0 -1180px;}.cke_skin_kama .cke_hc a:hover.cke_dialog_ui_button,.cke_skin_kama .cke_hc a:focus.cke_dialog_ui_button,.cke_skin_kama .cke_hc a:active.cke_dialog_ui_button{border-width:2px;}.cke_skin_kama .cke_browser_iequirks a:hover.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_iequirks a:focus.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_iequirks a:active.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_ie6 a:hover.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_ie6 a:focus.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_ie6 a:active.cke_dialog_ui_button span{background-image:none;background:#F7A922;}.cke_skin_kama .cke_dialog_footer_buttons{display:inline-table;margin-right:12px;margin-left:12px;width:auto;position:relative;}.cke_skin_kama .cke_browser_ie7 .cke_dialog_footer_buttons{position:static;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons{display:inline;}.cke_skin_kama .cke_dialog_footer_buttons span.cke_dialog_ui_button{margin:7px 0;text-align:center;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons a.cke_dialog_ui_button{display:block;padding:0;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons span.cke_dialog_ui_button{padding-bottom:5px;padding-top:6px;margin-bottom:0;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons .cke_dialog_ui_button_ok .cke_dialog_ui_button{background-position:right -1214px;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons .cke_dialog_ui_button_cancel .cke_dialog_ui_button{background-position:right -1242px;}.cke_skin_kama .cke_browser_ie9.cke_rtl .cke_dialog_footer_buttons td{padding-left:2px;}.cke_skin_kama strong{font-weight:bold;}.cke_skin_kama .cke_dialog .cke_dialog_body .cke_dialog_close_button{background-image:url(images/sprites.png);background-repeat:no-repeat;background-position:0 -1022px;position:absolute;cursor:pointer;text-align:center;height:20px;width:20px;top:5px;_background-image:url(images/sprites_ie6.png);}.cke_skin_kama .cke_dialog_close_button span{display:none;}.cke_skin_kama .cke_dialog_close_button:hover{background-position:0 -1045px;}.cke_skin_kama .cke_ltr .cke_dialog_close_button{right:10px;}.cke_skin_kama .cke_browser_ie8.cke_rtl .cke_dialog_close_button{left:8px;}.cke_skin_kama .cke_rtl .cke_dialog_close_button{left:10px;}.cke_skin_kama .cke_browser_ie7.cke_rtl .cke_dialog_close_button{left:16px;top:0;}.cke_skin_kama .cke_browser_ie7.cke_rtl .cke_dialog_close_button{position:absolute;left:10px;top:5px;} -.cke_skin_kama .cke_browser_ie7.cke_single_page .cke_dialog_footer{margin-top:22px;}.cke_skin_kama .cke_browser_ie6 .cke_dialog_close_button,.cke_skin_kama .cke_browser_iequirks .cke_dialog_close_button{top:7px;}.cke_skin_kama .cke_browser_ie7.cke_ltr .cke_dialog_close_button{margin-top:0;}.cke_skin_kama .cke_dialog_ui_input_select{border:1px solid #a0a0a0;background-color:white;}.cke_skin_kama .cke_dialog_ui_input_file{width:100%;height:25px;}.cke_skin_kama .cke_dialog .cke_dark_background{background-color:#eaead1;}.cke_skin_kama .cke_dialog .cke_hand{cursor:pointer;}.cke_skin_kama .cke_dialog .cke_centered{text-align:center;}.cke_skin_kama .cke_dialog a.cke_btn_reset{float:right;background-position:0 -32px;background-image:url(images/mini.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px;}.cke_skin_kama .cke_rtl .cke_dialog a.cke_btn_reset{float:left;}.cke_skin_kama .cke_dialog a.cke_btn_locked,.cke_skin_kama .cke_dialog a.cke_btn_unlocked{float:left;background-position:0 0;background-image:url(images/mini.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px;}.cke_skin_kama .cke_dialog a.cke_btn_locked .cke_icon{display:none;}.cke_skin_kama .cke_rtl .cke_dialog a.cke_btn_locked,.cke_skin_kama .cke_rtl .cke_dialog a.cke_btn_unlocked{float:right;}.cke_skin_kama .cke_dialog a.cke_btn_unlocked{background-position:0 -16px;background-image:url(images/mini.gif);}.cke_skin_kama .cke_dialog .cke_btn_over{border:outset 1px;cursor:pointer;}.cke_skin_kama .cke_dialog .ImagePreviewBox{border:2px ridge black;overflow:scroll;height:200px;width:300px;padding:2px;background-color:white;}.cke_skin_kama .cke_dialog .ImagePreviewBox table td{white-space:normal;}.cke_skin_kama .cke_browser_iequirks .cke_dialog_page_contents{_position:absolute;}.cke_skin_kama .cke_dialog .ImagePreviewLoader{position:absolute;white-space:normal;overflow:hidden;height:160px;width:230px;margin:2px;padding:2px;opacity:.9;filter:alpha(opacity=90);background-color:#e4e4e4;}.cke_skin_kama .cke_dialog .FlashPreviewBox{white-space:normal;border:2px ridge black;overflow:auto;height:160px;width:390px;padding:2px;background-color:white;}.cke_skin_kama .cke_dialog .cke_pastetext{width:346px;height:170px;}.cke_skin_kama .cke_dialog .cke_pastetext textarea{width:340px;height:170px;resize:none;}.cke_skin_kama .cke_dialog iframe.cke_pasteframe{width:346px;height:130px;background-color:white;border:1px solid black;}.cke_skin_kama .cke_dialog .cke_dark_background{text-align:center;background-color:#eaead1;font-size:14px;}.cke_skin_kama .cke_dialog .cke_light_background{text-align:center;background-color:#ffffbe;}.cke_skin_kama .cke_dialog .cke_hand{cursor:pointer;}.cke_skin_kama .cke_disabled{color:#a0a0a0;}.cke_skin_kama .cke_hc .cke_dialog_title,.cke_skin_kama .cke_hc .cke_dialog_tabs,.cke_skin_kama .cke_hc .cke_dialog_contents,.cke_skin_kama .cke_hc .cke_dialog_footer{border-left:1px solid;border-right:1px solid;}.cke_skin_kama .cke_hc .cke_dialog_title{border-top:1px solid;}.cke_skin_kama .cke_hc .cke_dialog_footer{border-bottom:1px solid;}.cke_skin_kama .cke_hc .cke_dialog_close_button span{display:inline;cursor:pointer;font-weight:bold;position:relative;top:3px;}.cke_skin_kama .cke_dialog_body .cke_label{display:none;}.cke_skin_kama .cke_dialog_body label.cke_required{font-weight:bold;}.cke_skin_kama .cke_hc .cke_dialog_body .cke_label{display:inline;cursor:inherit;}.cke_skin_kama .cke_hc a.cke_btn_locked,.cke_skin_kama .cke_hc a.cke_btn_unlocked,.cke_skin_kama .cke_hc a.cke_btn_reset{border-style:solid;float:left;width:auto;height:auto;padding:0 2px;}.cke_skin_kama .cke_rtl.cke_hc a.cke_btn_locked,.cke_skin_kama .cke_rtl.cke_hc a.cke_btn_unlocked,.cke_skin_kama .cke_rtl.cke_hc a.cke_btn_reset{float:right;}.cke_skin_kama .cke_hc a.cke_btn_locked .cke_icon{display:inline;}.cke_skin_kama a.cke_smile img{border:2px solid #eaead1;}.cke_skin_kama a.cke_smile:focus img,.cke_skin_kama a.cke_smile:active img,.cke_skin_kama a.cke_smile:hover img{border-color:#C7C78F;}.cke_skin_kama .cke_hc .cke_dialog_tabs a,.cke_skin_kama .cke_hc .cke_dialog_footer a{opacity:1.0;filter:alpha(opacity=100);border:1px solid white;} -.cke_skin_kama .cke_hc .ImagePreviewBox{width:260px;}.cke_skin_kama .cke_dialog_contents a.colorChooser{display:block;margin-top:6px;margin-left:10px;width:80px;}.cke_skin_kama .cke_rtl .cke_dialog_contents a.colorChooser{margin-right:10px;}.cke_skin_kama .cke_browser_gecko .cke_dialog_ui_checkbox_input:focus,.cke_skin_kama .cke_browser_gecko .cke_dialog_ui_radio_input:focus,.cke_skin_kama .cke_browser_opera .cke_dialog_ui_checkbox_input:focus,.cke_skin_kama .cke_browser_opera .cke_dialog_ui_radio_input:focus,.cke_skin_kama .cke_browser_gecko .cke_dialog_ui_input_select:focus,.cke_skin_kama .cke_browser_gecko .cke_btn_over,.cke_skin_kama .cke_browser_opera .cke_btn_over,.cke_skin_kama .cke_browser_ie .cke_btn_over{outline:1px dotted #696969;}.cke_skin_kama .cke_browser_ie .cke_dialog_ui_checkbox_input,.cke_skin_kama .cke_browser_ie .cke_dialog_ui_ratio_input,.cke_skin_kama .cke_browser_ie .cke_btn_reset,.cke_skin_kama .cke_browser_ie .cke_btn_locked,.cke_skin_kama .cke_browser_ie .cke_btn_unlocked{*border:1px solid transparent!important;-border:1px solid red!important;-filter:chroma(color=red);}.cke_skin_kama .cke_browser_ie .cke_dialog_ui_focused,.cke_skin_kama .cke_browser_ie .cke_btn_over{*border:1px dotted #696969!important;}.cke_skin_kama .cke_iframe_shim{display:block;position:absolute;top:0;left:0;z-index:-1;filter:alpha(opacity=0);width:100%;height:100%;}.cke_dialog label{display:inline;margin-bottom:auto;cursor:default;} +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +body .cke_dialog{visibility:visible;}.cke_skin_kama table.cke_dialog.cke_browser_gecko{display:block;}.cke_skin_kama .cke_dialog_body{z-index:1;border:solid 1px #ddd;padding:5px;background-color:#fff;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;_position:static;}.cke_skin_kama .cke_dialog_tl,.cke_skin_kama .cke_dialog_tr,.cke_skin_kama .cke_dialog_tc,.cke_skin_kama .cke_dialog_bl,.cke_skin_kama .cke_dialog_br,.cke_skin_kama .cke_dialog_bc,.cke_skin_kama .cke_dialog_ml,.cke_skin_kama .cke_dialog_mr{display:none;}.cke_skin_kama .cke_dialog_title{font-weight:bold;font-size:14px;padding:3px 3px 8px;cursor:move;position:relative;border-bottom:1px solid #eee;}.cke_skin_kama .cke_browser_iequirks .cke_dialog_title,.cke_skin_kama .cke_browser_ie6 .cke_dialog_title,.cke_skin_kama .cke_browser_ie7 .cke_dialog_title{margin-bottom:22px;}.cke_skin_kama .cke_browser_iequirks.cke_single_page .cke_dialog_title,.cke_skin_kama .cke_browser_ie6.cke_single_page .cke_dialog_title,.cke_skin_kama .cke_browser_ie7.cke_single_page .cke_dialog_title{margin-bottom:10px;}.cke_skin_kama .cke_dialog_contents{background-color:#ebebeb;border:solid 1px #fff;border-bottom:none;overflow:auto;padding:17px 10px 5px 10px;-moz-border-radius-topleft:5px;-moz-border-radius-topright:5px;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;border-top-left-radius:5px;border-top-right-radius:5px;margin-top:22px;}.cke_skin_kama .cke_dialog_footer{text-align:right;background-color:#ebebeb;border:solid 1px #fff;border-bottom:none;-moz-border-radius-bottomleft:5px;-moz-border-radius-bottomright:5px;-webkit-border-bottom-left-radius:5px;-webkit-border-bottom-right-radius:5px;border-bottom-left-radius:5px;border-bottom-right-radius:5px;}.cke_skin_kama .cke_rtl .cke_dialog_footer{text-align:left;}.cke_skin_kama .cke_dialog_footer .cke_resizer{margin-top:20px;}.cke_skin_kama .cke_browser_iequirks .cke_dialog_footer .cke_resizer,.cke_skin_kama .cke_browser_ie6 .cke_dialog_footer .cke_resizer{margin-top:27px;}.cke_skin_kama .cke_dialog_tabs{height:23px;display:inline-block;_display:block;margin-left:10px;margin-right:10px;margin-top:11px;position:absolute;z-index:2;}.cke_skin_kama .cke_browser_iequirks .cke_dialog_tabs,.cke_skin_kama .cke_browser_ie6 .cke_dialog_tabs,.cke_skin_kama .cke_browser_ie7 .cke_dialog_tabs{top:33px;}.cke_skin_kama .cke_rtl .cke_dialog_tabs{right:10px;}.cke_skin_kama a.cke_dialog_tab,.cke_skin_kama a:link.cke_dialog_tab,.cke_skin_kama a:active.cke_dialog_tab,.cke_skin_kama a:hover.cke_dialog_tab,.cke_skin_kama a:visited.cke_dialog_tab{background-image:url(images/sprites.png);background-repeat:repeat-x;background-position:0 -1323px;background-color:#ebebeb;height:14px;padding:4px 8px;display:inline-block;cursor:pointer;}.cke_skin_kama .cke_browser_gecko18 a.cke_dialog_tab,.cke_skin_kama .cke_browser_gecko18 a:link.cke_dialog_tab,.cke_skin_kama .cke_browser_gecko18 a:active.cke_dialog_tab,.cke_skin_kama .cke_browser_gecko18 a:hover.cke_dialog_tab,.cke_skin_kama .cke_browser_gecko18 a:visited.cke_dialog_tab{display:inline;position:relative;top:6px;}.cke_skin_kama a:hover.cke_dialog_tab{background-color:#f1f1e3;}.cke_skin_kama .cke_hc a:hover.cke_dialog_tab{padding:2px 6px!important;border-width:3px;}.cke_skin_kama a.cke_dialog_tab_selected,.cke_skin_kama a:link.cke_dialog_tab_selected,.cke_skin_kama a:active.cke_dialog_tab_selected,.cke_skin_kama a:hover.cke_dialog_tab_selected,.cke_skin_kama a:visited.cke_dialog_tab_selected{background-position:0 -1279px;cursor:default;}.cke_skin_kama .cke_hc a.cke_dialog_tab_selected,.cke_skin_kama .cke_hc a:link.cke_dialog_tab_selected,.cke_skin_kama .cke_hc a:active.cke_dialog_tab_selected,.cke_skin_kama .cke_hc a:hover.cke_dialog_tab_selected,.cke_skin_kama .cke_hc a:visited.cke_dialog_tab_selected{padding:2px 6px!important;border-width:3px;}.cke_skin_kama .cke_single_page .cke_dialog_tabs{display:none;}.cke_skin_kama .cke_single_page .cke_dialog_contents{padding-top:5px;margin-top:10px;}.cke_skin_kama .cke_dialog_ui_vbox table,.cke_skin_kama .cke_dialog_ui_hbox table{margin:auto;} +.cke_skin_kama .cke_dialog_ui_vbox_child{padding:5px 0;}.cke_skin_kama input.cke_dialog_ui_input_text,.cke_skin_kama input.cke_dialog_ui_input_password{background-color:white;border:none;padding:0;width:100%;height:14px;}.cke_skin_kama div.cke_dialog_ui_input_text,.cke_skin_kama div.cke_dialog_ui_input_password{background-color:white;border:1px solid #a0a0a0;padding:1px 0;_width:99.9%;}.cke_skin_kama .cke_browser_ie7 input.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_ie7 input.cke_dialog_ui_input_password{position:absolute;}.cke_skin_kama .cke_browser_ie7 div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_ie7 div.cke_dialog_ui_input_password{height:14px;position:relative;}.cke_skin_kama .cke_browser_ie.cke_rtl input.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_opera.cke_rtl input.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_ie.cke_rtl input.cke_dialog_ui_input_password,.cke_skin_kama .cke_browser_opera.cke_rtl input.cke_dialog_ui_input_password{padding-right:2px;}.cke_skin_kama .cke_browser_ie.cke_rtl div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_opera.cke_rtl div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_ie.cke_rtl div.cke_dialog_ui_input_password,.cke_skin_kama .cke_browser_opera.cke_rtl div.cke_dialog_ui_input_password{padding-left:2px;}.cke_skin_kama .cke_browser_ie.cke_rtl .cke_dialog_ui_vbox_child,.cke_skin_kama .cke_browser_ie.cke_rtl .cke_dialog_ui_hbox_child,.cke_skin_kama .cke_browser_ie.cke_rtl .cke_dialog_ui_hbox_first,.cke_skin_kama .cke_browser_ie.cke_rtl .cke_dialog_ui_hbox_last{padding-right:2px!important;}.cke_skin_kama .cke_browser_ie.cke_rtl div.cke_dialog_ui_input_text{padding-right:1px;}.cke_skin_kama .cke_browser_gecko.cke_hc div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_gecko.cke_hc div.cke_dialog_ui_input_password{border-width:0;}.cke_skin_kama .cke_browser_gecko18.cke_hc div.cke_dialog_ui_input_text,.cke_skin_kama .cke_browser_gecko18.cke_hc div.cke_dialog_ui_input_password{border-width:1px;}.cke_skin_kama textarea.cke_dialog_ui_input_textarea{background-color:white;border:none;padding:0;width:100%;_width:99%;overflow:auto;resize:none;}.cke_skin_kama div.cke_dialog_ui_input_textarea{background-color:white;border:1px solid #a0a0a0;padding:1px 0;}.cke_skin_kama div.cke_disabled .cke_dialog_ui_labeled_content *{background-color:#a0a0a0;cursor:default;}.cke_skin_kama .cke_rtl .cke_dialog_ui_labeled_content{_width:95%;}.cke_skin_kama .cke_dialog_ui_hbox{width:100%;}.cke_skin_kama .cke_dialog_ui_hbox_first,.cke_skin_kama .cke_dialog_ui_hbox_child,.cke_skin_kama .cke_dialog_ui_hbox_last{vertical-align:top;}.cke_skin_kama .cke_ltr .cke_dialog_ui_hbox_first,.cke_skin_kama .cke_ltr .cke_dialog_ui_hbox_child{padding-right:10px;}.cke_skin_kama .cke_rtl .cke_dialog_ui_hbox_first,.cke_skin_kama .cke_rtl .cke_dialog_ui_hbox_child{padding-left:10px;}.cke_skin_kama a.cke_dialog_ui_button{border-collapse:separate;cursor:default;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;background:transparent url(images/sprites.png) repeat-x scroll 0 -1069px;_background:none;padding:5px 0;text-align:center;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button{padding:0;}.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button span{width:70px;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button span{width:100px;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button span{padding:5px 15px;text-align:center;color:#3b3b1f;background:#53D9F0 none;display:inline-block;cursor:default;}.cke_skin_kama .cke_browser_webkit a.cke_dialog_ui_button span.cke_dialog_ui_button{margin:0;}.cke_skin_kama .cke_browser_webkit a.cke_dialog_ui_button{display:inline-block;padding-top:3px;padding-bottom:2px;margin:2px 0;}.cke_skin_kama a.cke_dialog_ui_button_ok span,.cke_skin_kama a.cke_dialog_ui_button_cancel span{width:60px;padding-right:20px;padding-left:20px;}.cke_skin_kama a.cke_dialog_ui_button_ok{background-position:0 -1143px;} +.cke_skin_kama a.cke_dialog_ui_button_ok span{background:transparent url(images/sprites.png) no-repeat scroll right -1219px;}.cke_skin_kama .cke_rtl a.cke_dialog_ui_button_ok span{background-position:left -1219px;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button_ok span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button_ok span{background-color:#B8E834;margin-right:0;}.cke_skin_kama a.cke_dialog_ui_button_cancel{background-position:0 -1104px;}.cke_skin_kama a.cke_dialog_ui_button_cancel span{background:transparent url(images/sprites.png) no-repeat scroll right -1245px;}.cke_skin_kama .cke_rtl a.cke_dialog_ui_button_cancel span{background-position:left -1245px;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button_cancel span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button_cancel span{background-color:#F65D20;}.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button_cancel span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button_cancel span,.cke_skin_kama .cke_browser_iequirks a.cke_dialog_ui_button_ok span,.cke_skin_kama .cke_browser_ie6 a.cke_dialog_ui_button_ok span{background-image:none;}.cke_skin_kama span.cke_dialog_ui_button{padding:2px 10px;text-align:center;color:#222;display:inline-block;cursor:default;min-width:60px;+margin:2px 0;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons span.cke_dialog_ui_button{display:block;}.cke_skin_kama a.cke_dialog_ui_button span.cke_disabled{border:#898980 1px solid;color:#5e5e55;background-color:#c5c5b3;}.cke_skin_kama a:hover.cke_dialog_ui_button,.cke_skin_kama a:focus.cke_dialog_ui_button,.cke_skin_kama a:active.cke_dialog_ui_button{background-position:0 -1180px;}.cke_skin_kama .cke_hc a:hover.cke_dialog_ui_button,.cke_skin_kama .cke_hc a:focus.cke_dialog_ui_button,.cke_skin_kama .cke_hc a:active.cke_dialog_ui_button{border-width:2px;}.cke_skin_kama .cke_browser_iequirks a:hover.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_iequirks a:focus.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_iequirks a:active.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_ie6 a:hover.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_ie6 a:focus.cke_dialog_ui_button span,.cke_skin_kama .cke_browser_ie6 a:active.cke_dialog_ui_button span{background-image:none;background:#F7A922;}.cke_skin_kama .cke_dialog_footer_buttons{display:inline-table;margin-right:12px;margin-left:12px;width:auto;position:relative;}.cke_skin_kama .cke_browser_ie7 .cke_dialog_footer_buttons{position:static;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons{display:inline;}.cke_skin_kama .cke_dialog_footer_buttons span.cke_dialog_ui_button{margin:7px 0;text-align:center;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons a.cke_dialog_ui_button{display:block;padding:0;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons span.cke_dialog_ui_button{padding-bottom:5px;padding-top:6px;margin-bottom:0;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons .cke_dialog_ui_button_ok .cke_dialog_ui_button{background-position:right -1214px;}.cke_skin_kama .cke_browser_gecko18 .cke_dialog_footer_buttons .cke_dialog_ui_button_cancel .cke_dialog_ui_button{background-position:right -1242px;}.cke_skin_kama .cke_browser_ie9.cke_rtl .cke_dialog_footer_buttons td{padding-left:2px;}.cke_skin_kama strong{font-weight:bold;}.cke_skin_kama .cke_dialog .cke_dialog_body .cke_dialog_close_button{background-image:url(images/sprites.png);background-repeat:no-repeat;background-position:0 -1022px;position:absolute;cursor:pointer;text-align:center;height:20px;width:20px;top:5px;_background-image:url(images/sprites_ie6.png);}.cke_skin_kama .cke_dialog_close_button span{display:none;}.cke_skin_kama .cke_dialog_close_button:hover{background-position:0 -1045px;}.cke_skin_kama .cke_ltr .cke_dialog_close_button{right:10px;}.cke_skin_kama .cke_browser_ie8.cke_rtl .cke_dialog_close_button{left:8px;}.cke_skin_kama .cke_rtl .cke_dialog_close_button{left:10px;}.cke_skin_kama .cke_browser_ie7.cke_rtl .cke_dialog_close_button{left:16px;top:0;}.cke_skin_kama .cke_browser_ie7.cke_rtl .cke_dialog_close_button{position:absolute;left:10px;top:5px;} +.cke_skin_kama .cke_browser_ie7.cke_single_page .cke_dialog_footer{margin-top:22px;}.cke_skin_kama .cke_browser_ie6 .cke_dialog_close_button,.cke_skin_kama .cke_browser_iequirks .cke_dialog_close_button{top:7px;}.cke_skin_kama .cke_browser_ie7.cke_ltr .cke_dialog_close_button{margin-top:0;}.cke_skin_kama .cke_dialog_ui_input_select{border:1px solid #a0a0a0;background-color:white;}.cke_skin_kama .cke_dialog_ui_input_file{width:100%;height:25px;}.cke_skin_kama .cke_dialog .cke_dark_background{background-color:#eaead1;}.cke_skin_kama .cke_dialog .cke_hand{cursor:pointer;}.cke_skin_kama .cke_dialog .cke_centered{text-align:center;}.cke_skin_kama .cke_dialog a.cke_btn_reset{float:right;background-position:0 -32px;background-image:url(images/mini.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px;}.cke_skin_kama .cke_rtl .cke_dialog a.cke_btn_reset{float:left;}.cke_skin_kama .cke_dialog a.cke_btn_locked,.cke_skin_kama .cke_dialog a.cke_btn_unlocked{float:left;background-position:0 0;background-image:url(images/mini.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px;}.cke_skin_kama .cke_dialog a.cke_btn_locked .cke_icon{display:none;}.cke_skin_kama .cke_rtl .cke_dialog a.cke_btn_locked,.cke_skin_kama .cke_rtl .cke_dialog a.cke_btn_unlocked{float:right;}.cke_skin_kama .cke_dialog a.cke_btn_unlocked{background-position:0 -16px;background-image:url(images/mini.gif);}.cke_skin_kama .cke_dialog .cke_btn_over{border:outset 1px;cursor:pointer;}.cke_skin_kama .cke_dialog .ImagePreviewBox{border:2px ridge black;overflow:scroll;height:200px;width:300px;padding:2px;background-color:white;}.cke_skin_kama .cke_dialog .ImagePreviewBox table td{white-space:normal;}.cke_skin_kama .cke_browser_iequirks .cke_dialog_page_contents{_position:absolute;}.cke_skin_kama .cke_dialog .ImagePreviewLoader{position:absolute;white-space:normal;overflow:hidden;height:160px;width:230px;margin:2px;padding:2px;opacity:.9;filter:alpha(opacity=90);background-color:#e4e4e4;}.cke_skin_kama .cke_dialog .FlashPreviewBox{white-space:normal;border:2px ridge black;overflow:auto;height:160px;width:390px;padding:2px;background-color:white;}.cke_skin_kama .cke_dialog .cke_pastetext{width:346px;height:170px;}.cke_skin_kama .cke_dialog .cke_pastetext textarea{width:340px;height:170px;resize:none;}.cke_skin_kama .cke_dialog iframe.cke_pasteframe{width:346px;height:130px;background-color:white;border:1px solid black;}.cke_skin_kama .cke_dialog .cke_dark_background{text-align:center;background-color:#eaead1;font-size:14px;}.cke_skin_kama .cke_dialog .cke_light_background{text-align:center;background-color:#ffffbe;}.cke_skin_kama .cke_dialog .cke_hand{cursor:pointer;}.cke_skin_kama .cke_disabled{color:#a0a0a0;}.cke_skin_kama .cke_hc .cke_dialog_title,.cke_skin_kama .cke_hc .cke_dialog_tabs,.cke_skin_kama .cke_hc .cke_dialog_contents,.cke_skin_kama .cke_hc .cke_dialog_footer{border-left:1px solid;border-right:1px solid;}.cke_skin_kama .cke_hc .cke_dialog_title{border-top:1px solid;}.cke_skin_kama .cke_hc .cke_dialog_footer{border-bottom:1px solid;}.cke_skin_kama .cke_hc .cke_dialog_close_button span{display:inline;cursor:pointer;font-weight:bold;position:relative;top:3px;}.cke_skin_kama .cke_dialog_body .cke_label{display:none;}.cke_skin_kama .cke_dialog_body label.cke_required{font-weight:bold;}.cke_skin_kama .cke_hc .cke_dialog_body .cke_label{display:inline;cursor:inherit;}.cke_skin_kama .cke_hc a.cke_btn_locked,.cke_skin_kama .cke_hc a.cke_btn_unlocked,.cke_skin_kama .cke_hc a.cke_btn_reset{border-style:solid;float:left;width:auto;height:auto;padding:0 2px;}.cke_skin_kama .cke_rtl.cke_hc a.cke_btn_locked,.cke_skin_kama .cke_rtl.cke_hc a.cke_btn_unlocked,.cke_skin_kama .cke_rtl.cke_hc a.cke_btn_reset{float:right;}.cke_skin_kama .cke_hc a.cke_btn_locked .cke_icon{display:inline;}.cke_skin_kama a.cke_smile img{border:2px solid #eaead1;}.cke_skin_kama a.cke_smile:focus img,.cke_skin_kama a.cke_smile:active img,.cke_skin_kama a.cke_smile:hover img{border-color:#C7C78F;}.cke_skin_kama .cke_hc .cke_dialog_tabs a,.cke_skin_kama .cke_hc .cke_dialog_footer a{opacity:1.0;filter:alpha(opacity=100);border:1px solid white;} +.cke_skin_kama .cke_hc .ImagePreviewBox{width:260px;}.cke_skin_kama .cke_dialog_contents a.colorChooser{display:block;margin-top:6px;margin-left:10px;width:80px;}.cke_skin_kama .cke_rtl .cke_dialog_contents a.colorChooser{margin-right:10px;}.cke_skin_kama .cke_browser_gecko .cke_dialog_ui_checkbox_input:focus,.cke_skin_kama .cke_browser_gecko .cke_dialog_ui_radio_input:focus,.cke_skin_kama .cke_browser_opera .cke_dialog_ui_checkbox_input:focus,.cke_skin_kama .cke_browser_opera .cke_dialog_ui_radio_input:focus,.cke_skin_kama .cke_browser_gecko .cke_dialog_ui_input_select:focus,.cke_skin_kama .cke_browser_gecko .cke_btn_over,.cke_skin_kama .cke_browser_opera .cke_btn_over,.cke_skin_kama .cke_browser_ie .cke_btn_over{outline:1px dotted #696969;}.cke_skin_kama .cke_browser_ie .cke_dialog_ui_checkbox_input,.cke_skin_kama .cke_browser_ie .cke_dialog_ui_ratio_input,.cke_skin_kama .cke_browser_ie .cke_btn_reset,.cke_skin_kama .cke_browser_ie .cke_btn_locked,.cke_skin_kama .cke_browser_ie .cke_btn_unlocked{*border:1px solid transparent!important;-border:1px solid red!important;-filter:chroma(color=red);}.cke_skin_kama .cke_browser_ie .cke_dialog_ui_focused,.cke_skin_kama .cke_browser_ie .cke_btn_over{*border:1px dotted #696969!important;}.cke_skin_kama .cke_iframe_shim{display:block;position:absolute;top:0;left:0;z-index:-1;filter:alpha(opacity=0);width:100%;height:100%;}.cke_dialog label{display:inline;margin-bottom:auto;cursor:default;} diff --git a/assets/grocery_crud/texteditor/ckeditor/skins/kama/editor.css b/assets/grocery_crud/texteditor/ckeditor/skins/kama/editor.css index 71d3499..9580e92 100755 --- a/assets/grocery_crud/texteditor/ckeditor/skins/kama/editor.css +++ b/assets/grocery_crud/texteditor/ckeditor/skins/kama/editor.css @@ -1,13 +1,13 @@ -/* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -.cke_skin_kama *,.cke_skin_kama a:hover,.cke_skin_kama a:link,.cke_skin_kama a:visited,.cke_skin_kama a:active{margin:0;padding:0;border:0;background:transparent;text-decoration:none;font:normal normal normal 100% Sans-Serif;width:auto;height:auto;border-collapse:collapse;text-align:left;vertical-align:baseline;white-space:nowrap;cursor:auto;color:#000;float:none;font-size:12px;font-family:Arial,Helvetica,Tahoma,Verdana,Sans-Serif;}.cke_skin_kama .cke_rtl *,.cke_skin_kama .cke_rtl a:hover,.cke_skin_kama .cke_rtl a:link,.cke_skin_kama .cke_rtl a:visited,.cke_skin_kama .cke_rtl a:active,.cke_rtl .cke_skin_kama *,.cke_rtl .cke_skin_kama a:hover,.cke_rtl .cke_skin_kama a:link,.cke_rtl .cke_skin_kama a:visited,.cke_rtl .cke_skin_kama a:active{text-align:right;}.cke_skin_kama iframe{vertical-align:inherit;}.cke_skin_kama textarea{white-space:pre;}.cke_skin_kama .cke_browser_gecko textarea{cursor:text;}.cke_skin_kama .cke_browser_gecko textarea[disabled]{cursor:default;}.cke_skin_kama input[type="text"],.cke_skin_kama input[type="password"]{cursor:text;}.cke_skin_kama input[type="text"][disabled],.cke_skin_kama input[type="password"][disabled]{cursor:default;}.cke_skin_kama fieldset{padding:10px;border:2px groove #E0DFE3;}.cke_skin_kama{display:block;}span.cke_skin_kama{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border:1px solid #D3D3D3;padding:5px;}.cke_skin_kama span.cke_browser_webkit,.cke_skin_kama span.cke_browser_gecko18{display:block;}.cke_skin_kama .cke_wrapper{-moz-border-radius:5px;-webkit-border-radius:5px;-webkit-touch-callout:none;border-radius:5px;background-color:#d3d3d3;background-image:url(images/sprites.png);background-repeat:repeat-x;background-position:0 -1950px;display:block;_display:inline-block;padding:5px;}.cke_shared .cke_skin_kama .cke_wrapper{padding-bottom:0;}.cke_skin_kama .cke_browser_ie6 .cke_wrapper,.cke_skin_kama .cke_browser_iequirks .cke_wrapper{background-image:none;}.cke_skin_kama .cke_editor{display:inline-table;width:100%;}.cke_skin_kama .cke_browser_ie .cke_editor,.cke_skin_kama .cke_browser_webkit .cke_editor{display:table;}.cke_skin_kama .ltr .cke_browser_ie iframe{margin-right:-10px;}.cke_skin_kama .rtl .cke_browser_ie iframe{margin-left:-10px;}.cke_skin_kama .cke_browser_opera .cke_editor.cke_skin_kama .cke_resizer{display:table;}.cke_skin_kama .cke_contents{margin:5px;}.cke_skin_kama .cke_hc .cke_contents{border:1px solid black;}.cke_skin_kama .cke_contents iframe{background-color:#fff;}.cke_skin_kama .cke_focus{outline:auto 5px -webkit-focus-ring-color;}.cke_skin_kama textarea.cke_source{font-family:'Courier New',Monospace;font-size:small;background-color:#fff;white-space:pre;}.cke_skin_kama .cke_browser_iequirks textarea.cke_source{_white-space:normal;}.cke_skin_kama .cke_resizer{width:12px;height:12px;margin-top:9px;display:block;float:right;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:0 -1428px;background-repeat:no-repeat;cursor:se-resize;}.cke_skin_kama .cke_browser_air .cke_resizer,.cke_skin_kama .cke_browser_air .cke_rtl .cke_resizer{cursor:move;}.cke_skin_kama .cke_resizer_rtl{cursor:sw-resize;background-position:0 -1455px;float:left;}.cke_skin_kama .cke_resizer_horizontal,.cke_skin_kama .cke_rtl .cke_resizer_horizontal{cursor:e-resize;}.cke_skin_kama .cke_resizer_vertical,.cke_skin_kama .cke_rtl .cke_resizer_vertical{cursor:n-resize;}.cke_skin_kama .cke_maximized .cke_resizer{display:none;}.cke_skin_kama .cke_browser_ie6 .cke_contents textarea,.cke_skin_kama .cke_browser_ie7 .cke_contents textarea{position:absolute;}.cke_skin_kama .cke_browser_ie.cke_browser_quirks .cke_contents iframe{position:absolute;top:0;}.cke_skin_kama .cke_browser_ie6 .cke_editor,.cke_skin_kama .cke_browser_ie7 .cke_editor{display:inline-block;}.cke_skin_kama .cke_browser_ie6 .cke_editor,.cke_shared .cke_skin_kama .cke_browser_ie7 .cke_wrapper{padding-bottom:5px;}.cke_skin_kama .cke_voice_label{display:none;}.cke_skin_kama legend.cke_voice_label{display:none;}.cke_skin_kama .cke_browser_ie legend.cke_voice_label{position:absolute;display:block;width:0;height:0;overflow:hidden;} -.cke_skin_kama .cke_panel{border:1px solid #8f8f73;background-color:#fff;width:120px;height:100px;overflow:hidden;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.cke_skin_kama .cke_contextmenu{margin:0;}.cke_skin_kama .cke_panel iframe{width:100%;height:100%;}html.cke_skin_kama_container{overflow:auto;overflow-x:hidden;}body.cke_panel_frame{overflow:auto;}.cke_panel_frame .cke_label{display:none;}ul.cke_panel_list{list-style-type:none;margin:3px;padding:0;white-space:nowrap;}li.cke_panel_listItem{margin:0;}.cke_panel_listItem a{padding:2px;display:block;border:1px solid #fff;color:inherit!important;text-decoration:none;overflow:hidden;text-overflow:ellipsis;}* html .cke_panel_listItem a{width:100%;color:#000;}*:first-child+html .cke_panel_listItem a{color:#000;}.cke_panel_listItem.cke_selected a{border:1px solid #ccc;background-color:#e9f5ff;}.cke_panel_listItem a:hover,.cke_panel_listItem a:focus,.cke_panel_listItem a:active{border-color:#316ac5;background-color:#dff1ff;}.cke_hc .cke_panel_listItem.cke_selected a,.cke_hc .cke_panel_listItem a:hover,.cke_hc .cke_panel_listItem a:focus,.cke_hc .cke_panel_listItem a:active{border-width:3px;padding:0;}.cke_panel_grouptitle{font-size:11px;font-family:'Microsoft Sans Serif',Tahoma,Arial,Verdana,Sans-Serif;font-weight:bold;white-space:nowrap;background-color:#dcdcdc;color:#000;margin:0;padding:3px;}.cke_panel_listItem p,.cke_panel_listItem h1,.cke_panel_listItem h2,.cke_panel_listItem h3,.cke_panel_listItem h4,.cke_panel_listItem h5,.cke_panel_listItem h6,.cke_panel_listItem pre{margin-top:3px;margin-bottom:3px;}.cke_skin_kama .cke_button_textcolor_panel,.cke_skin_kama .cke_button_bgcolor_panel{width:150px;height:135px;}.cke_colorblock{padding:3px;font-size:11px;font-family:'Microsoft Sans Serif',Tahoma,Arial,Verdana,Sans-Serif;}.cke_colorblock,.cke_colorblock a{text-decoration:none;color:#000;}span.cke_colorbox{width:10px;height:10px;border:#808080 1px solid;float:left;}.cke_rtl span.cke_colorbox{float:right;}a.cke_colorbox{border:#fff 1px solid;padding:2px;float:left;}.cke_rtl a.cke_colorbox{float:right;}a:hover.cke_colorbox,a:focus.cke_colorbox,a:active.cke_colorbox{border:#316ac5 1px solid;background-color:#dff1ff;}a.cke_colorauto,a.cke_colormore{border:#fff 1px solid;padding:2px;display:block;cursor:pointer;}a:hover.cke_colorauto,a:hover.cke_colormore,a:focus.cke_colorauto,a:focus.cke_colormore,a:active.cke_colorauto,a:active.cke_colormore{border:#316ac5 1px solid;background-color:#dff1ff;}@media print{.cke_skin_kama .cke_toolbox{display:none;}}.cke_skin_kama .cke_browser_webkit .cke_toolbox,.cke_skin_kama .cke_browser_webkit .cke_toolbox>span{white-space:normal;}.cke_skin_kama .cke_toolbox{clear:both;padding-bottom:1px;}.cke_skin_kama a.cke_toolbox_collapser,.cke_skin_kama a:hover.cke_toolbox_collapser{background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:3px -1366px;background-repeat:no-repeat;width:11px;height:11px;float:right;border:1px outset #D3D3D3;margin:11px 0 2px;cursor:pointer;}.cke_skin_kama .cke_rtl a.cke_toolbox_collapser,.cke_skin_kama .cke_rtl a:hover.cke_toolbox_collapser{float:left;}.cke_skin_kama a.cke_toolbox_collapser span{display:none;}.cke_skin_kama .cke_hc a.cke_toolbox_collapser span{font-size:10px;font-weight:bold;font-family:Arial;display:inline;}.cke_skin_kama a.cke_toolbox_collapser_min,.cke_skin_kama a:hover.cke_toolbox_collapser_min{background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:4px -1387px;background-repeat:no-repeat;margin:2px 4px;}.cke_skin_kama .cke_rtl a.cke_toolbox_collapser_min,.cke_skin_kama .cke_rtl a:hover.cke_toolbox_collapser_min{background-position:4px -1408px;}.cke_skin_kama .cke_separator{display:inline-block;border-left:solid 1px #D3D3D3;margin:3px 2px 0;height:16px;vertical-align:top;}.cke_skin_kama .cke_break{font-size:0;clear:left;}.cke_skin_kama .cke_rtl .cke_break{clear:right;}.cke_skin_kama .cke_toolbar_start{display:none;}.cke_skin_kama .cke_toolgroup{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-repeat:repeat-x;background-position:0 -500px;float:left;margin-right:6px;margin-bottom:5px;padding:2px;display:inline;} -.cke_skin_kama .cke_rtl .cke_toolgroup{float:right;margin-right:0;margin-left:6px;}.cke_skin_kama .cke_button a,.cke_skin_kama .cke_button a:hover,.cke_skin_kama .cke_button a:focus,.cke_skin_kama .cke_button a:active,.cke_skin_kama .cke_button a.cke_off{border-radius:3px;outline:none;padding:2px 4px;height:18px;display:inline-block;cursor:default;}.cke_skin_kama .cke_button a,.cke_skin_kama .cke_button a.cke_off{filter:alpha(opacity=70);opacity:.70;-moz-border-radius:3px;-webkit-border-radius:3px;}.cke_skin_kama .cke_hc .cke_button a,.cke_skin_kama .cke_hc .cke_button a.cke_off{opacity:1.0;filter:alpha(opacity=100);border:1px solid white;}.cke_skin_kama .cke_button a.cke_on{background-color:#a3d7ff;filter:alpha(opacity=100);opacity:1;padding:2px 4px;}.cke_skin_kama .cke_hc .cke_button a.cke_on{padding:0 2px!important;border-width:3px;}.cke_skin_kama .cke_button a.cke_disabled *{filter:alpha(opacity=30);opacity:.3;}.cke_skin_kama .cke_browser_ie .cke_button a.cke_disabled *,.cke_skin_kama .cke_browser_ie a:hover.cke_button .cke_disabled *{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale'), alpha(opacity=30);}.cke_skin_kama .cke_browser_ie .cke_rtl .cke_button a.cke_disabled *,.cke_skin_kama .cke_browser_ie .cke_rtl a:hover.cke_button .cke_disabled *{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale'), alpha(opacity=30);}.cke_skin_kama .cke_browser_ie6 .cke_button a.cke_disabled *,.cke_skin_kama .cke_browser_ie6 a:hover.cke_button .cke_disabled *,.cke_skin_kama .cke_browser_ie .cke_button.cke_noalphafix a.cke_disabled *{filter:alpha(opacity=30);}.cke_skin_kama .cke_hc .cke_button a.cke_disabled *,.cke_skin_kama .cke_browser_ie.cke_hc a:hover.cke_button .cke_disabled *{filter:alpha(opacity=60);opacity:.6;}.cke_skin_kama .cke_button a:hover.cke_on,.cke_skin_kama .cke_button a:focus.cke_on,.cke_skin_kama .cke_button a:active.cke_on,.cke_skin_kama .cke_button a:hover.cke_off,.cke_skin_kama .cke_button a:focus.cke_off,.cke_skin_kama .cke_button a:active.cke_off{filter:alpha(opacity=100);opacity:1;padding:2px 4px;}.cke_skin_kama .cke_button a:hover,.cke_skin_kama .cke_button a:focus,.cke_skin_kama .cke_button a:active{background-color:#dff1ff;}.cke_skin_kama .cke_button a:hover.cke_on,.cke_skin_kama .cke_button a:focus.cke_on,.cke_skin_kama .cke_button a:active.cke_on{background-color:#86caff;}.cke_skin_kama .cke_hc .cke_button a:hover,.cke_skin_kama .cke_hc .cke_button a:focus,.cke_skin_kama .cke_hc .cke_button a:active{padding:0 2px!important;border-width:3px;}.cke_skin_kama .cke_button .cke_icon{background-image:url(icons.png);background-position:100px;background-repeat:no-repeat;margin-top:1px;width:16px;height:16px;display:inline-block;cursor:default;}.cke_skin_kama .cke_rtl .cke_button .cke_icon{background-image:url(icons_rtl.png);}.cke_skin_kama .cke_browser_ie .cke_button .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_skin_kama .cke_browser_ie .cke_rtl .cke_button .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_skin_kama .cke_browser_ie6 .cke_button .cke_icon,.cke_skin_kama .cke_browser_ie6 .cke_rtl .cke_button .cke_icon,.cke_skin_kama .cke_browser_ie .cke_button.cke_noalphafix .cke_icon,.cke_skin_kama .cke_browser_ie .cke_rtl .cke_button.cke_noalphafix .cke_icon{filter:;}.cke_skin_kama .cke_button .cke_label{cursor:default;display:none;padding-left:3px;line-height:18px;vertical-align:middle;}.cke_skin_kama .cke_hc .cke_button .cke_label{padding:0;display:inline-block;}.cke_skin_kama .cke_hc .cke_button .cke_icon{display:none;}.cke_skin_kama .cke_accessibility{position:absolute;display:block;width:0;height:0;overflow:hidden;}.cke_skin_kama .cke_button .cke_buttonarrow{display:inline-block;height:17px;width:8px;background-position:2px -1469px;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-repeat:no-repeat;cursor:default;}.cke_skin_kama .cke_browser_ie .cke_button .cke_buttonarrow{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');} -.cke_skin_kama .cke_browser_ie6 .cke_button .cke_buttonarrow{filter:;}.cke_skin_kama .cke_browser_gecko .cke_toolbar,.cke_skin_kama .cke_browser_gecko .cke_button a,.cke_skin_kama .cke_browser_gecko .cke_button a.cke_off,.cke_skin_kama .cke_browser_gecko .cke_button .cke_icon,.cke_skin_kama .cke_browser_gecko .cke_button .cke_buttonarrow,.cke_skin_kama .cke_browser_gecko .cke_separator,.cke_skin_kama .cke_browser_gecko .cke_toolbar_start{display:block;float:left;}.cke_skin_kama .cke_browser_gecko.cke_hc .cke_button .cke_icon{display:none;}.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_toolbar,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_button a,.cke_skin_kama .cke_browser_gecko .cke_rtl.cke_button a.cke_off,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_button .cke_icon,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_button .cke_buttonarrow,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_separator,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_toolbar_start{float:right;}.cke_skin_kama .cke_browser_gecko .cke_button .cke_label,.cke_skin_kama .cke_browser_gecko .cke_break{float:left;}.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_button .cke_label,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_break{float:right;}.cke_skin_kama .cke_browser_webkit .cke_toolbar{float:left;}.cke_skin_kama .cke_browser_webkit .cke_rtl .cke_toolbar{float:right;}.cke_skin_kama .cke_browser_ie .cke_button .cke_label{line-height:16px;}.cke_skin_kama .cke_browser_ie .cke_rcombo,.cke_skin_kama .cke_browser_ie .cke_rcombo *{cursor:default;}.cke_skin_kama .cke_browser_ie .cke_toolbox{padding-bottom:5px;_padding-bottom:6px;}.cke_shared .cke_skin_kama .cke_browser_ie .cke_toolbox{padding-bottom:0;}.cke_skin_kama .cke_contextmenu{padding:2px;}.cke_skin_kama .cke_menuitem a{display:block;}.cke_skin_kama .cke_menuitem span{cursor:default;}.cke_skin_kama .cke_menuitem a:hover,.cke_skin_kama .cke_menuitem a:focus,.cke_skin_kama .cke_menuitem a:active{background-color:#D3D3D3;display:block;}.cke_hc .cke_menuitem a:hover,.cke_hc .cke_menuitem a:focus,.cke_hc .cke_menuitem a:active{border:2px solid;}.cke_skin_kama .cke_menuitem .cke_icon{background-image:url(icons.png);background-position:100px;background-repeat:no-repeat;background-color:transparent;width:16px;height:16px;float:left;}.cke_rtl .cke_skin_kama .cke_menuitem .cke_icon{background-image:url(icons_rtl.png);}.cke_browser_ie .cke_skin_kama .cke_menuitem .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_browser_ie.cke_rtl .cke_skin_kama .cke_menuitem .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_browser_ie6 .cke_skin_kama .cke_menuitem .cke_icon,.cke_browser_ie .cke_skin_kama .cke_menuitem.cke_noalphafix .cke_icon{filter:;}.cke_skin_kama .cke_menuitem .cke_disabled .cke_icon{filter:alpha(opacity=70);opacity:.70;}.cke_browser_ie .cke_skin_kama .cke_menuitem .cke_disabled .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_browser_ie.cke_rtl .cke_skin_kama .cke_menuitem .cke_disabled .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_browser_ie6 .cke_skin_kama .cke_menuitem .cke_disabled .cke_icon,.cke_browser_ie .cke_skin_kama .cke_menuitem.cke_noalphafix .cke_disabled .cke_icon{filter:;}.cke_skin_kama .cke_menuitem .cke_icon_wrapper{background-color:#D3D3D3;border:solid 4px #D3D3D3;width:16px;height:16px;float:left;filter:alpha(opacity=70);opacity:.70;clear:both;}.cke_rtl .cke_skin_kama .cke_menuitem .cke_icon_wrapper{float:right;}.cke_skin_kama .cke_menuitem a:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active .cke_icon_wrapper{background-color:#9d9d9d;border:solid 4px #9d9d9d;filter:alpha(opacity=70);opacity:.70;}.cke_skin_kama .cke_menuitem a:hover.cke_disabled .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus.cke_disabled .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active.cke_disabled .cke_icon_wrapper{background-color:#D3D3D3;border:solid 4px #D3D3D3;} -.cke_skin_kama .cke_menuitem .cke_label{display:block;padding-right:3px;padding-top:5px;padding-left:4px;height:19px;margin-left:24px;background-color:#fff;}.cke_skin_kama .cke_frameLoaded .cke_menuitem .cke_label{filter:alpha(opacity=70);opacity:.70;}.cke_rtl .cke_skin_kama .cke_menuitem .cke_label{padding-right:0;margin-left:0;padding-left:3px;margin-right:28px;}.cke_skin_kama .cke_menuitem a.cke_disabled .cke_label{filter:alpha(opacity=30);opacity:.30;}.cke_skin_kama .cke_menuitem a:hover .cke_label,.cke_skin_kama .cke_menuitem a:focus .cke_label,.cke_skin_kama .cke_menuitem a:active .cke_label{background-color:#D3D3D3;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_label{background-color:transparent;}.cke_skin_kama .cke_menuseparator{background-color:#D3D3D3;height:2px;filter:alpha(opacity=70);opacity:.70;_font-size:0;}.cke_skin_kama .cke_menuarrow{background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:0 -1411px;background-repeat:no-repeat;height:5px;width:3px;float:right;margin-right:2px;margin-top:3px;}.cke_rtl .cke_skin_kama .cke_menuarrow{float:left;margin-right:0;margin-left:2px;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:0 -1390px;background-repeat:no-repeat;}.cke_skin_kama .cke_menuarrow span{display:none;}.cke_hc .cke_skin_kama .cke_menuarrow{width:auto;margin-top:0;}.cke_hc .cke_skin_kama .cke_menuarrow span{display:inline;}.cke_browser_ie.cke_ltr .cke_skin_kama .cke_menuarrow{position:absolute;right:2px;}.cke_browser_ie.cke_rtl .cke_skin_kama .cke_menuarrow{position:absolute;left:2px;}.cke_skin_kama .cke_rcombo{display:inline;}.cke_skin_kama .cke_rcombopanel{border:1px solid #8F8F73;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;height:auto;_height:100px;}.cke_skin_kama .cke_rcombo a,.cke_skin_kama .cke_rcombo a:active,.cke_skin_kama .cke_rcombo a:hover{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-repeat:repeat-x;background-position:0 -100px;border-bottom:1px solid #DAD9D9;border-right:1px solid #DAD9D9;float:left;padding:2px;height:21px;margin-right:6px;margin-bottom:5px;}.cke_skin_kama .cke_rtl .cke_rcombo a,.cke_skin_kama .cke_rtl .cke_rcombo a:active,.cke_skin_kama .cke_rtl .cke_rcombo a:hover{float:right;margin-right:0;margin-left:6px;}.cke_skin_kama .cke_hc .cke_rcombo a{filter:alpha(opacity=100);opacity:1.0;}.cke_skin_kama .cke_rcombo .cke_label{display:none;line-height:26px;vertical-align:top;margin-right:5px;filter:alpha(opacity=70);opacity:.70;}.cke_skin_kama .cke_rtl .cke_rcombo .cke_label{margin-right:0;margin-left:5px;}.cke_skin_kama .cke_rcombo .cke_inline_label{line-height:21px;font-style:italic;color:#666;}.cke_skin_kama .cke_hc .cke_rcombo .cke_openbutton{vertical-align:top;}.cke_skin_kama .cke_hc .cke_rcombo .cke_label{filter:alpha(opacity=100);opacity:1.0;}.cke_skin_kama .cke_rcombo .cke_text{filter:alpha(opacity=70);opacity:.70;height:21px;line-height:21px;width:60px;text-overflow:ellipsis;overflow:hidden;display:inline-block;margin:0 2px 0 4px;cursor:default;}.cke_skin_kama .cke_rtl .cke_rcombo .cke_text{margin:0 4px 0 2px;}.cke_skin_kama .cke_rcombo .cke_openbutton{display:inline-block;}.cke_skin_kama .cke_rcombo .cke_openbutton .cke_icon{display:inline-block;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:0 -68px;background-repeat:no-repeat;width:17px;height:19px;margin:1px 2px;}.cke_skin_kama .cke_hc .cke_rcombo .cke_openbutton .cke_icon{background:none;}.cke_skin_kama .cke_browser_iequirks .cke_rcombo .cke_openbutton{margin-bottom:0;}.cke_skin_kama .cke_rcombo .cke_off a:hover .cke_text,.cke_skin_kama .cke_rcombo .cke_off a:focus .cke_text,.cke_skin_kama .cke_rcombo .cke_off a:active .cke_text,.cke_skin_kama .cke_rcombo .cke_on .cke_text{border-color:#316ac5;filter:alpha(opacity=100);opacity:1;} -.cke_skin_kama .cke_rcombo .cke_off a:hover .cke_openbutton,.cke_skin_kama .cke_rcombo .cke_off a:focus .cke_openbutton,.cke_skin_kama .cke_rcombo .cke_off a:active .cke_openbutton,.cke_skin_kama .cke_rcombo .cke_on .cke_openbutton{border-color:#316ac5;background-color:#dff1ff;}.cke_skin_kama .cke_rcombo .cke_on .cke_text{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;}.cke_skin_kama .cke_rcombo .cke_on .cke_openbutton{-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;}.cke_skin_kama .cke_rcombo .cke_disabled .cke_label{filter:alpha(opacity=30);opacity:.3;}.cke_skin_kama .cke_hc .cke_rcombo .cke_disabled .cke_label{filter:alpha(opacity=70);opacity:.7;}.cke_skin_kama .cke_rcombo .cke_disabled .cke_text,.cke_skin_kama .cke_rcombo .cke_disabled .cke_openbutton{filter:alpha(opacity=50);opacity:.5;}.cke_skin_kama .cke_browser_ie .cke_rcombo .cke_disabled .cke_openbutton{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale'), alpha(opacity=50);}.cke_skin_kama .cke_browser_ie6 .cke_rcombo .cke_disabled .cke_openbutton{filter:alpha(opacity=50);}.cke_skin_kama .cke_hc .cke_rcombo .cke_disabled .cke_text,.cke_skin_kama .cke_hc .cke_rcombo .cke_disabled .cke_openbutton{filter:alpha(opacity=80);opacity:.8;}.cke_skin_kama .cke_rcombo .cke_disabled .cke_text{color:#fff;}.cke_skin_kama .cke_browser_gecko .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_gecko .cke_rcombo .cke_openbutton,.cke_skin_kama .cke_browser_webkit .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_webkit .cke_rcombo .cke_openbutton{display:block;float:left;}.cke_skin_kama .cke_browser_gecko .cke_rcombo .cke_label,.cke_skin_kama .cke_browser_webkit .cke_rcombo .cke_label{float:left;}.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_rcombo .cke_label,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_rcombo .cke_openbutton,.cke_skin_kama .cke_browser_webkit .cke_rtl .cke_rcombo .cke_label,.cke_skin_kama .cke_browser_webkit .cke_rtl .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_webkit .cke_rtl .cke_rcombo .cke_openbutton{float:right;}.cke_skin_kama .cke_browser_ie7 .cke_rcombo .cke_text{line-height:18px;}.cke_skin_kama .cke_browser_ie6 .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_iequirks .cke_rcombo .cke_text{height:auto;line-height:17px;}.cke_skin_kama .cke_rtl .cke_rcombo .cke_font .cke_text,.cke_skin_kama .cke_rtl .cke_rcombo .cke_fontSize .cke_text{direction:ltr;}@media print{.cke_path{display:none;}}.cke_skin_kama .cke_path{display:inline-block;float:left;margin-top:5px;}.cke_skin_kama .cke_rtl .cke_path{float:right;}.cke_shared .cke_skin_kama .cke_path{_width:100%;margin:0 0 5px;}.cke_skin_kama .cke_path a,.cke_skin_kama .cke_path .cke_empty{display:inline-block;float:left;padding:1px 4px 0;color:#60676a;cursor:default;}.cke_skin_kama .cke_path .cke_empty{visibility:hidden;}.cke_skin_kama .cke_rtl .cke_path a,.cke_skin_kama .cke_rtl .cke_path cke_empty{float:right;}.cke_skin_kama .cke_path a:hover,.cke_skin_kama .cke_path a:focus,.cke_skin_kama .cke_path a:active{background-color:#dff1ff;padding:1px 4px 0;outline:none;color:#000;}.cke_skin_kama .cke_browser_ie .cke_rtl .cke_path a,.cke_skin_kama .cke_browser_ie .cke_rtl .cke_path .cke_empty{float:none;}.cke_skin_kama .cke_path .cke_label{display:none;}.cke_skin_kama .cke_button_source .cke_icon{background-position:0 0;}.cke_skin_kama .cke_button_docProps .cke_icon{background-position:0 -16px;}.cke_skin_kama .cke_button_newpage .cke_icon{background-position:0 -48px;}.cke_skin_kama .cke_button_preview .cke_icon{background-position:0 -64px;}.cke_skin_kama .cke_button_cut .cke_icon{background-position:0 -96px;}.cke_skin_kama .cke_button_copy .cke_icon{background-position:0 -112px;}.cke_skin_kama .cke_button_paste .cke_icon{background-position:0 -128px;}.cke_skin_kama .cke_button_pastetext .cke_icon{background-position:0 -144px;}.cke_skin_kama .cke_button_find .cke_icon{background-position:0 -240px;}.cke_skin_kama .cke_button_replace .cke_icon{background-position:0 -256px;} -.cke_skin_kama .cke_button_selectAll .cke_icon{background-position:0 -272px;}.cke_skin_kama .cke_button_removeFormat .cke_icon{background-position:0 -288px;}.cke_skin_kama .cke_button_bold .cke_icon{background-position:0 -304px;}.cke_skin_kama .cke_button_italic .cke_icon{background-position:0 -320px;}.cke_skin_kama .cke_button_underline .cke_icon{background-position:0 -336px;}.cke_skin_kama .cke_button_strike .cke_icon{background-position:0 -352px;}.cke_skin_kama .cke_button_subscript .cke_icon{background-position:0 -368px;}.cke_skin_kama .cke_button_superscript .cke_icon{background-position:0 -384px;}.cke_skin_kama .cke_button_table .cke_icon{background-position:0 -608px;}.cke_skin_kama .cke_button_horizontalrule .cke_icon{background-position:0 -624px;}.cke_skin_kama .cke_button_smiley .cke_icon{background-position:0 -640px;}.cke_skin_kama .cke_button_link .cke_icon{background-position:0 -528px;}.cke_skin_kama .cke_button_unlink .cke_icon{background-position:0 -544px;}.cke_skin_kama .cke_button_anchor .cke_icon{background-position:0 -560px;}.cke_skin_kama .cke_button_image .cke_icon{background-position:0 -576px;}.cke_skin_kama .cke_button_flash .cke_icon{background-position:0 -592px;}.cke_skin_kama .cke_button_specialchar .cke_icon{background-position:0 -656px;}.cke_skin_kama .cke_button_pagebreak .cke_icon{background-position:0 -672px;}.cke_skin_kama .cke_button_print .cke_icon{background-position:0 -176px;}.cke_skin_kama .cke_button_checkspell .cke_icon,.cke_skin_kama .cke_button_scayt .cke_icon{background-position:0 -192px;}.cke_skin_kama .cke_button_pagebreak .cke_icon{background-position:0 -672px;}.cke_skin_kama .cke_button_textcolor .cke_icon{background-position:0 -704px;}.cke_skin_kama .cke_button_bgcolor .cke_icon{background-position:0 -720px;}.cke_skin_kama .cke_button_form .cke_icon{background-position:0 -752px;}.cke_skin_kama .cke_button_checkbox .cke_icon{background-position:0 -768px;}.cke_skin_kama .cke_button_radio .cke_icon{background-position:0 -784px;}.cke_skin_kama .cke_button_textfield .cke_icon{background-position:0 -800px;}.cke_skin_kama .cke_button_textarea .cke_icon{background-position:0 -816px;}.cke_skin_kama .cke_button_showblocks .cke_icon{background-position:0 -1136px;}.cke_skin_kama .cke_button_select .cke_icon{background-position:0 -832px;}.cke_skin_kama .cke_button_button .cke_icon{background-position:0 -848px;}.cke_skin_kama .cke_button_imagebutton .cke_icon{background-position:0 -864px;}.cke_skin_kama .cke_button_hiddenfield .cke_icon{background-position:0 -880px;}.cke_skin_kama .cke_button_undo .cke_icon{background-position:0 -208px;}.cke_skin_kama .cke_rtl .cke_button_undo .cke_icon{background-position:0 -224px;}.cke_skin_kama .cke_button_redo .cke_icon{background-position:0 -224px;}.cke_skin_kama .cke_rtl .cke_button_redo .cke_icon{background-position:0 -208px;}.cke_skin_kama .cke_button_templates .cke_icon{background-position:0 -80px;}.cke_skin_kama .cke_button_numberedlist .cke_icon{background-position:0 -400px;}.cke_skin_kama .cke_button_bulletedlist .cke_icon{background-position:0 -416px;}.cke_skin_kama .cke_mixed_dir_content .cke_button_numberedlist .cke_icon{background-position:0 -1217px;}.cke_skin_kama .cke_mixed_dir_content .cke_button_bulletedlist .cke_icon{background-position:0 -1233px;}.cke_skin_kama .cke_button_outdent .cke_icon{background-position:0 -432px;}.cke_skin_kama .cke_button_indent .cke_icon{background-position:0 -448px;}.cke_skin_kama .cke_mixed_dir_content .cke_button_indent .cke_icon{background-position:0 -1265px;}.cke_skin_kama .cke_mixed_dir_content .cke_button_outdent .cke_icon{background-position:0 -1249px;}.cke_skin_kama .cke_button_justifyleft .cke_icon{background-position:0 -464px;}.cke_skin_kama .cke_button_justifycenter .cke_icon{background-position:0 -480px;}.cke_skin_kama .cke_button_justifyright .cke_icon{background-position:0 -496px;}.cke_skin_kama .cke_button_justifyblock .cke_icon{background-position:0 -512px;}.cke_skin_kama .cke_button_blockquote .cke_icon{background-position:0 -1152px;}.cke_skin_kama .cke_button_creatediv .cke_icon{background-position:0 -1168px;} -.cke_skin_kama .cke_button_editdiv .cke_icon{background-position:0 -1184px;}.cke_skin_kama .cke_button_removediv .cke_icon{background-position:0 -1200px;}.cke_skin_kama .cke_button_flash .cke_icon{background-position:0 -592px;}.cke_skin_kama .cke_button_pastefromword .cke_icon{background-position:0 -160px;}.cke_skin_kama .cke_button_save .cke_icon{background-position:0 -32px;}.cke_skin_kama .cke_button_about .cke_icon{background-position:0 -736px;}.cke_skin_kama .cke_button_maximize .cke_icon{background-position:0 -1040px;}.cke_skin_kama .cke_button_editdiv .cke_icon{background-position:0 -1184px;}.cke_skin_kama .cke_button_bidirtl .cke_icon{background-position:0 -1072px;}.cke_skin_kama .cke_button_bidiltr .cke_icon{background-position:0 -1056px;}.cke_skin_kama .cke_button_iframe .cke_icon{background-position:0 -1279px;}.cke_skin_kama .cke_button_source .cke_label{display:inline;}.cke_skin_kama .cke_styles_panel{width:150px;height:170px;}.cke_skin_kama .cke_format_panel{width:150px;height:170px;}.cke_skin_kama .cke_font_panel{width:150px;height:170px;}.cke_skin_kama .cke_fontSize_panel{height:170px;}.cke_skin_kama .cke_fontSize .cke_text{width:25px;}.cke_skin_kama .cke_browser_iequirks .cke_fontSize .cke_text{width:32px;}html .cke_skin_kama{visibility:inherit;}html.cke_skin_kama_container{visibility:visible;} +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +.cke_skin_kama *,.cke_skin_kama a:hover,.cke_skin_kama a:link,.cke_skin_kama a:visited,.cke_skin_kama a:active{margin:0;padding:0;border:0;background:transparent;text-decoration:none;font:normal normal normal 100% Sans-Serif;width:auto;height:auto;border-collapse:collapse;text-align:left;vertical-align:baseline;white-space:nowrap;cursor:auto;color:#000;float:none;font-size:12px;font-family:Arial,Helvetica,Tahoma,Verdana,Sans-Serif;}.cke_skin_kama .cke_rtl *,.cke_skin_kama .cke_rtl a:hover,.cke_skin_kama .cke_rtl a:link,.cke_skin_kama .cke_rtl a:visited,.cke_skin_kama .cke_rtl a:active,.cke_rtl .cke_skin_kama *,.cke_rtl .cke_skin_kama a:hover,.cke_rtl .cke_skin_kama a:link,.cke_rtl .cke_skin_kama a:visited,.cke_rtl .cke_skin_kama a:active{text-align:right;}.cke_skin_kama iframe{vertical-align:inherit;}.cke_skin_kama textarea{white-space:pre;}.cke_skin_kama .cke_browser_gecko textarea{cursor:text;}.cke_skin_kama .cke_browser_gecko textarea[disabled]{cursor:default;}.cke_skin_kama input[type="text"],.cke_skin_kama input[type="password"]{cursor:text;}.cke_skin_kama input[type="text"][disabled],.cke_skin_kama input[type="password"][disabled]{cursor:default;}.cke_skin_kama fieldset{padding:10px;border:2px groove #E0DFE3;}.cke_skin_kama{display:block;}span.cke_skin_kama{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border:1px solid #D3D3D3;padding:5px;}.cke_skin_kama span.cke_browser_webkit,.cke_skin_kama span.cke_browser_gecko18{display:block;}.cke_skin_kama .cke_wrapper{-moz-border-radius:5px;-webkit-border-radius:5px;-webkit-touch-callout:none;border-radius:5px;background-color:#d3d3d3;background-image:url(images/sprites.png);background-repeat:repeat-x;background-position:0 -1950px;display:block;_display:inline-block;padding:5px;}.cke_shared .cke_skin_kama .cke_wrapper{padding-bottom:0;}.cke_skin_kama .cke_browser_ie6 .cke_wrapper,.cke_skin_kama .cke_browser_iequirks .cke_wrapper{background-image:none;}.cke_skin_kama .cke_editor{display:inline-table;width:100%;}.cke_skin_kama .cke_browser_ie .cke_editor,.cke_skin_kama .cke_browser_webkit .cke_editor{display:table;}.cke_skin_kama .ltr .cke_browser_ie iframe{margin-right:-10px;}.cke_skin_kama .rtl .cke_browser_ie iframe{margin-left:-10px;}.cke_skin_kama .cke_browser_opera .cke_editor.cke_skin_kama .cke_resizer{display:table;}.cke_skin_kama .cke_contents{margin:5px;}.cke_skin_kama .cke_hc .cke_contents{border:1px solid black;}.cke_skin_kama .cke_contents iframe{background-color:#fff;}.cke_skin_kama .cke_focus{outline:auto 5px -webkit-focus-ring-color;}.cke_skin_kama textarea.cke_source{font-family:'Courier New',Monospace;font-size:small;background-color:#fff;white-space:pre;}.cke_skin_kama .cke_browser_iequirks textarea.cke_source{_white-space:normal;}.cke_skin_kama .cke_resizer{width:12px;height:12px;margin-top:9px;display:block;float:right;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:0 -1428px;background-repeat:no-repeat;cursor:se-resize;}.cke_skin_kama .cke_browser_air .cke_resizer,.cke_skin_kama .cke_browser_air .cke_rtl .cke_resizer{cursor:move;}.cke_skin_kama .cke_resizer_rtl{cursor:sw-resize;background-position:0 -1455px;float:left;}.cke_skin_kama .cke_resizer_horizontal,.cke_skin_kama .cke_rtl .cke_resizer_horizontal{cursor:e-resize;}.cke_skin_kama .cke_resizer_vertical,.cke_skin_kama .cke_rtl .cke_resizer_vertical{cursor:n-resize;}.cke_skin_kama .cke_maximized .cke_resizer{display:none;}.cke_skin_kama .cke_browser_ie6 .cke_contents textarea,.cke_skin_kama .cke_browser_ie7 .cke_contents textarea{position:absolute;}.cke_skin_kama .cke_browser_ie.cke_browser_quirks .cke_contents iframe{position:absolute;top:0;}.cke_skin_kama .cke_browser_ie6 .cke_editor,.cke_skin_kama .cke_browser_ie7 .cke_editor{display:inline-block;}.cke_skin_kama .cke_browser_ie6 .cke_editor,.cke_shared .cke_skin_kama .cke_browser_ie7 .cke_wrapper{padding-bottom:5px;}.cke_skin_kama .cke_voice_label{display:none;}.cke_skin_kama legend.cke_voice_label{display:none;}.cke_skin_kama .cke_browser_ie legend.cke_voice_label{position:absolute;display:block;width:0;height:0;overflow:hidden;} +.cke_skin_kama .cke_panel{border:1px solid #8f8f73;background-color:#fff;width:120px;height:100px;overflow:hidden;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.cke_skin_kama .cke_contextmenu{margin:0;}.cke_skin_kama .cke_panel iframe{width:100%;height:100%;}html.cke_skin_kama_container{overflow:auto;overflow-x:hidden;}body.cke_panel_frame{overflow:auto;}.cke_panel_frame .cke_label{display:none;}ul.cke_panel_list{list-style-type:none;margin:3px;padding:0;white-space:nowrap;}li.cke_panel_listItem{margin:0;}.cke_panel_listItem a{padding:2px;display:block;border:1px solid #fff;color:inherit!important;text-decoration:none;overflow:hidden;text-overflow:ellipsis;}* html .cke_panel_listItem a{width:100%;color:#000;}*:first-child+html .cke_panel_listItem a{color:#000;}.cke_panel_listItem.cke_selected a{border:1px solid #ccc;background-color:#e9f5ff;}.cke_panel_listItem a:hover,.cke_panel_listItem a:focus,.cke_panel_listItem a:active{border-color:#316ac5;background-color:#dff1ff;}.cke_hc .cke_panel_listItem.cke_selected a,.cke_hc .cke_panel_listItem a:hover,.cke_hc .cke_panel_listItem a:focus,.cke_hc .cke_panel_listItem a:active{border-width:3px;padding:0;}.cke_panel_grouptitle{font-size:11px;font-family:'Microsoft Sans Serif',Tahoma,Arial,Verdana,Sans-Serif;font-weight:bold;white-space:nowrap;background-color:#dcdcdc;color:#000;margin:0;padding:3px;}.cke_panel_listItem p,.cke_panel_listItem h1,.cke_panel_listItem h2,.cke_panel_listItem h3,.cke_panel_listItem h4,.cke_panel_listItem h5,.cke_panel_listItem h6,.cke_panel_listItem pre{margin-top:3px;margin-bottom:3px;}.cke_skin_kama .cke_button_textcolor_panel,.cke_skin_kama .cke_button_bgcolor_panel{width:150px;height:135px;}.cke_colorblock{padding:3px;font-size:11px;font-family:'Microsoft Sans Serif',Tahoma,Arial,Verdana,Sans-Serif;}.cke_colorblock,.cke_colorblock a{text-decoration:none;color:#000;}span.cke_colorbox{width:10px;height:10px;border:#808080 1px solid;float:left;}.cke_rtl span.cke_colorbox{float:right;}a.cke_colorbox{border:#fff 1px solid;padding:2px;float:left;}.cke_rtl a.cke_colorbox{float:right;}a:hover.cke_colorbox,a:focus.cke_colorbox,a:active.cke_colorbox{border:#316ac5 1px solid;background-color:#dff1ff;}a.cke_colorauto,a.cke_colormore{border:#fff 1px solid;padding:2px;display:block;cursor:pointer;}a:hover.cke_colorauto,a:hover.cke_colormore,a:focus.cke_colorauto,a:focus.cke_colormore,a:active.cke_colorauto,a:active.cke_colormore{border:#316ac5 1px solid;background-color:#dff1ff;}@media print{.cke_skin_kama .cke_toolbox{display:none;}}.cke_skin_kama .cke_browser_webkit .cke_toolbox,.cke_skin_kama .cke_browser_webkit .cke_toolbox>span{white-space:normal;}.cke_skin_kama .cke_toolbox{clear:both;padding-bottom:1px;}.cke_skin_kama a.cke_toolbox_collapser,.cke_skin_kama a:hover.cke_toolbox_collapser{background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:3px -1366px;background-repeat:no-repeat;width:11px;height:11px;float:right;border:1px outset #D3D3D3;margin:11px 0 2px;cursor:pointer;}.cke_skin_kama .cke_rtl a.cke_toolbox_collapser,.cke_skin_kama .cke_rtl a:hover.cke_toolbox_collapser{float:left;}.cke_skin_kama a.cke_toolbox_collapser span{display:none;}.cke_skin_kama .cke_hc a.cke_toolbox_collapser span{font-size:10px;font-weight:bold;font-family:Arial;display:inline;}.cke_skin_kama a.cke_toolbox_collapser_min,.cke_skin_kama a:hover.cke_toolbox_collapser_min{background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:4px -1387px;background-repeat:no-repeat;margin:2px 4px;}.cke_skin_kama .cke_rtl a.cke_toolbox_collapser_min,.cke_skin_kama .cke_rtl a:hover.cke_toolbox_collapser_min{background-position:4px -1408px;}.cke_skin_kama .cke_separator{display:inline-block;border-left:solid 1px #D3D3D3;margin:3px 2px 0;height:16px;vertical-align:top;}.cke_skin_kama .cke_break{font-size:0;clear:left;}.cke_skin_kama .cke_rtl .cke_break{clear:right;}.cke_skin_kama .cke_toolbar_start{display:none;}.cke_skin_kama .cke_toolgroup{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-repeat:repeat-x;background-position:0 -500px;float:left;margin-right:6px;margin-bottom:5px;padding:2px;display:inline;} +.cke_skin_kama .cke_rtl .cke_toolgroup{float:right;margin-right:0;margin-left:6px;}.cke_skin_kama .cke_button a,.cke_skin_kama .cke_button a:hover,.cke_skin_kama .cke_button a:focus,.cke_skin_kama .cke_button a:active,.cke_skin_kama .cke_button a.cke_off{border-radius:3px;outline:none;padding:2px 4px;height:18px;display:inline-block;cursor:default;}.cke_skin_kama .cke_button a,.cke_skin_kama .cke_button a.cke_off{filter:alpha(opacity=70);opacity:.70;-moz-border-radius:3px;-webkit-border-radius:3px;}.cke_skin_kama .cke_hc .cke_button a,.cke_skin_kama .cke_hc .cke_button a.cke_off{opacity:1.0;filter:alpha(opacity=100);border:1px solid white;}.cke_skin_kama .cke_button a.cke_on{background-color:#a3d7ff;filter:alpha(opacity=100);opacity:1;padding:2px 4px;}.cke_skin_kama .cke_hc .cke_button a.cke_on{padding:0 2px!important;border-width:3px;}.cke_skin_kama .cke_button a.cke_disabled *{filter:alpha(opacity=30);opacity:.3;}.cke_skin_kama .cke_browser_ie .cke_button a.cke_disabled *,.cke_skin_kama .cke_browser_ie a:hover.cke_button .cke_disabled *{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale'), alpha(opacity=30);}.cke_skin_kama .cke_browser_ie .cke_rtl .cke_button a.cke_disabled *,.cke_skin_kama .cke_browser_ie .cke_rtl a:hover.cke_button .cke_disabled *{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale'), alpha(opacity=30);}.cke_skin_kama .cke_browser_ie6 .cke_button a.cke_disabled *,.cke_skin_kama .cke_browser_ie6 a:hover.cke_button .cke_disabled *,.cke_skin_kama .cke_browser_ie .cke_button.cke_noalphafix a.cke_disabled *{filter:alpha(opacity=30);}.cke_skin_kama .cke_hc .cke_button a.cke_disabled *,.cke_skin_kama .cke_browser_ie.cke_hc a:hover.cke_button .cke_disabled *{filter:alpha(opacity=60);opacity:.6;}.cke_skin_kama .cke_button a:hover.cke_on,.cke_skin_kama .cke_button a:focus.cke_on,.cke_skin_kama .cke_button a:active.cke_on,.cke_skin_kama .cke_button a:hover.cke_off,.cke_skin_kama .cke_button a:focus.cke_off,.cke_skin_kama .cke_button a:active.cke_off{filter:alpha(opacity=100);opacity:1;padding:2px 4px;}.cke_skin_kama .cke_button a:hover,.cke_skin_kama .cke_button a:focus,.cke_skin_kama .cke_button a:active{background-color:#dff1ff;}.cke_skin_kama .cke_button a:hover.cke_on,.cke_skin_kama .cke_button a:focus.cke_on,.cke_skin_kama .cke_button a:active.cke_on{background-color:#86caff;}.cke_skin_kama .cke_hc .cke_button a:hover,.cke_skin_kama .cke_hc .cke_button a:focus,.cke_skin_kama .cke_hc .cke_button a:active{padding:0 2px!important;border-width:3px;}.cke_skin_kama .cke_button .cke_icon{background-image:url(icons.png);background-position:100px;background-repeat:no-repeat;margin-top:1px;width:16px;height:16px;display:inline-block;cursor:default;}.cke_skin_kama .cke_rtl .cke_button .cke_icon{background-image:url(icons_rtl.png);}.cke_skin_kama .cke_browser_ie .cke_button .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_skin_kama .cke_browser_ie .cke_rtl .cke_button .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_skin_kama .cke_browser_ie6 .cke_button .cke_icon,.cke_skin_kama .cke_browser_ie6 .cke_rtl .cke_button .cke_icon,.cke_skin_kama .cke_browser_ie .cke_button.cke_noalphafix .cke_icon,.cke_skin_kama .cke_browser_ie .cke_rtl .cke_button.cke_noalphafix .cke_icon{filter:;}.cke_skin_kama .cke_button .cke_label{cursor:default;display:none;padding-left:3px;line-height:18px;vertical-align:middle;}.cke_skin_kama .cke_hc .cke_button .cke_label{padding:0;display:inline-block;}.cke_skin_kama .cke_hc .cke_button .cke_icon{display:none;}.cke_skin_kama .cke_accessibility{position:absolute;display:block;width:0;height:0;overflow:hidden;}.cke_skin_kama .cke_button .cke_buttonarrow{display:inline-block;height:17px;width:8px;background-position:2px -1469px;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-repeat:no-repeat;cursor:default;}.cke_skin_kama .cke_browser_ie .cke_button .cke_buttonarrow{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');} +.cke_skin_kama .cke_browser_ie6 .cke_button .cke_buttonarrow{filter:;}.cke_skin_kama .cke_browser_gecko .cke_toolbar,.cke_skin_kama .cke_browser_gecko .cke_button a,.cke_skin_kama .cke_browser_gecko .cke_button a.cke_off,.cke_skin_kama .cke_browser_gecko .cke_button .cke_icon,.cke_skin_kama .cke_browser_gecko .cke_button .cke_buttonarrow,.cke_skin_kama .cke_browser_gecko .cke_separator,.cke_skin_kama .cke_browser_gecko .cke_toolbar_start{display:block;float:left;}.cke_skin_kama .cke_browser_gecko.cke_hc .cke_button .cke_icon{display:none;}.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_toolbar,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_button a,.cke_skin_kama .cke_browser_gecko .cke_rtl.cke_button a.cke_off,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_button .cke_icon,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_button .cke_buttonarrow,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_separator,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_toolbar_start{float:right;}.cke_skin_kama .cke_browser_gecko .cke_button .cke_label,.cke_skin_kama .cke_browser_gecko .cke_break{float:left;}.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_button .cke_label,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_break{float:right;}.cke_skin_kama .cke_browser_webkit .cke_toolbar{float:left;}.cke_skin_kama .cke_browser_webkit .cke_rtl .cke_toolbar{float:right;}.cke_skin_kama .cke_browser_ie .cke_button .cke_label{line-height:16px;}.cke_skin_kama .cke_browser_ie .cke_rcombo,.cke_skin_kama .cke_browser_ie .cke_rcombo *{cursor:default;}.cke_skin_kama .cke_browser_ie .cke_toolbox{padding-bottom:5px;_padding-bottom:6px;}.cke_shared .cke_skin_kama .cke_browser_ie .cke_toolbox{padding-bottom:0;}.cke_skin_kama .cke_contextmenu{padding:2px;}.cke_skin_kama .cke_menuitem a{display:block;}.cke_skin_kama .cke_menuitem span{cursor:default;}.cke_skin_kama .cke_menuitem a:hover,.cke_skin_kama .cke_menuitem a:focus,.cke_skin_kama .cke_menuitem a:active{background-color:#D3D3D3;display:block;}.cke_hc .cke_menuitem a:hover,.cke_hc .cke_menuitem a:focus,.cke_hc .cke_menuitem a:active{border:2px solid;}.cke_skin_kama .cke_menuitem .cke_icon{background-image:url(icons.png);background-position:100px;background-repeat:no-repeat;background-color:transparent;width:16px;height:16px;float:left;}.cke_rtl .cke_skin_kama .cke_menuitem .cke_icon{background-image:url(icons_rtl.png);}.cke_browser_ie .cke_skin_kama .cke_menuitem .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_browser_ie.cke_rtl .cke_skin_kama .cke_menuitem .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_browser_ie6 .cke_skin_kama .cke_menuitem .cke_icon,.cke_browser_ie .cke_skin_kama .cke_menuitem.cke_noalphafix .cke_icon{filter:;}.cke_skin_kama .cke_menuitem .cke_disabled .cke_icon{filter:alpha(opacity=70);opacity:.70;}.cke_browser_ie .cke_skin_kama .cke_menuitem .cke_disabled .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_browser_ie.cke_rtl .cke_skin_kama .cke_menuitem .cke_disabled .cke_icon{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale');}.cke_browser_ie6 .cke_skin_kama .cke_menuitem .cke_disabled .cke_icon,.cke_browser_ie .cke_skin_kama .cke_menuitem.cke_noalphafix .cke_disabled .cke_icon{filter:;}.cke_skin_kama .cke_menuitem .cke_icon_wrapper{background-color:#D3D3D3;border:solid 4px #D3D3D3;width:16px;height:16px;float:left;filter:alpha(opacity=70);opacity:.70;clear:both;}.cke_rtl .cke_skin_kama .cke_menuitem .cke_icon_wrapper{float:right;}.cke_skin_kama .cke_menuitem a:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active .cke_icon_wrapper{background-color:#9d9d9d;border:solid 4px #9d9d9d;filter:alpha(opacity=70);opacity:.70;}.cke_skin_kama .cke_menuitem a:hover.cke_disabled .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus.cke_disabled .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active.cke_disabled .cke_icon_wrapper{background-color:#D3D3D3;border:solid 4px #D3D3D3;} +.cke_skin_kama .cke_menuitem .cke_label{display:block;padding-right:3px;padding-top:5px;padding-left:4px;height:19px;margin-left:24px;background-color:#fff;}.cke_skin_kama .cke_frameLoaded .cke_menuitem .cke_label{filter:alpha(opacity=70);opacity:.70;}.cke_rtl .cke_skin_kama .cke_menuitem .cke_label{padding-right:0;margin-left:0;padding-left:3px;margin-right:28px;}.cke_skin_kama .cke_menuitem a.cke_disabled .cke_label{filter:alpha(opacity=30);opacity:.30;}.cke_skin_kama .cke_menuitem a:hover .cke_label,.cke_skin_kama .cke_menuitem a:focus .cke_label,.cke_skin_kama .cke_menuitem a:active .cke_label{background-color:#D3D3D3;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_label{background-color:transparent;}.cke_skin_kama .cke_menuseparator{background-color:#D3D3D3;height:2px;filter:alpha(opacity=70);opacity:.70;_font-size:0;}.cke_skin_kama .cke_menuarrow{background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:0 -1411px;background-repeat:no-repeat;height:5px;width:3px;float:right;margin-right:2px;margin-top:3px;}.cke_rtl .cke_skin_kama .cke_menuarrow{float:left;margin-right:0;margin-left:2px;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:0 -1390px;background-repeat:no-repeat;}.cke_skin_kama .cke_menuarrow span{display:none;}.cke_hc .cke_skin_kama .cke_menuarrow{width:auto;margin-top:0;}.cke_hc .cke_skin_kama .cke_menuarrow span{display:inline;}.cke_browser_ie.cke_ltr .cke_skin_kama .cke_menuarrow{position:absolute;right:2px;}.cke_browser_ie.cke_rtl .cke_skin_kama .cke_menuarrow{position:absolute;left:2px;}.cke_skin_kama .cke_rcombo{display:inline;}.cke_skin_kama .cke_rcombopanel{border:1px solid #8F8F73;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;height:auto;_height:100px;}.cke_skin_kama .cke_rcombo a,.cke_skin_kama .cke_rcombo a:active,.cke_skin_kama .cke_rcombo a:hover{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-repeat:repeat-x;background-position:0 -100px;border-bottom:1px solid #DAD9D9;border-right:1px solid #DAD9D9;float:left;padding:2px;height:21px;margin-right:6px;margin-bottom:5px;}.cke_skin_kama .cke_rtl .cke_rcombo a,.cke_skin_kama .cke_rtl .cke_rcombo a:active,.cke_skin_kama .cke_rtl .cke_rcombo a:hover{float:right;margin-right:0;margin-left:6px;}.cke_skin_kama .cke_hc .cke_rcombo a{filter:alpha(opacity=100);opacity:1.0;}.cke_skin_kama .cke_rcombo .cke_label{display:none;line-height:26px;vertical-align:top;margin-right:5px;filter:alpha(opacity=70);opacity:.70;}.cke_skin_kama .cke_rtl .cke_rcombo .cke_label{margin-right:0;margin-left:5px;}.cke_skin_kama .cke_rcombo .cke_inline_label{line-height:21px;font-style:italic;color:#666;}.cke_skin_kama .cke_hc .cke_rcombo .cke_openbutton{vertical-align:top;}.cke_skin_kama .cke_hc .cke_rcombo .cke_label{filter:alpha(opacity=100);opacity:1.0;}.cke_skin_kama .cke_rcombo .cke_text{filter:alpha(opacity=70);opacity:.70;height:21px;line-height:21px;width:60px;text-overflow:ellipsis;overflow:hidden;display:inline-block;margin:0 2px 0 4px;cursor:default;}.cke_skin_kama .cke_rtl .cke_rcombo .cke_text{margin:0 4px 0 2px;}.cke_skin_kama .cke_rcombo .cke_openbutton{display:inline-block;}.cke_skin_kama .cke_rcombo .cke_openbutton .cke_icon{display:inline-block;background-image:url(images/sprites.png);_background-image:url(images/sprites_ie6.png);background-position:0 -68px;background-repeat:no-repeat;width:17px;height:19px;margin:1px 2px;}.cke_skin_kama .cke_hc .cke_rcombo .cke_openbutton .cke_icon{background:none;}.cke_skin_kama .cke_browser_iequirks .cke_rcombo .cke_openbutton{margin-bottom:0;}.cke_skin_kama .cke_rcombo .cke_off a:hover .cke_text,.cke_skin_kama .cke_rcombo .cke_off a:focus .cke_text,.cke_skin_kama .cke_rcombo .cke_off a:active .cke_text,.cke_skin_kama .cke_rcombo .cke_on .cke_text{border-color:#316ac5;filter:alpha(opacity=100);opacity:1;} +.cke_skin_kama .cke_rcombo .cke_off a:hover .cke_openbutton,.cke_skin_kama .cke_rcombo .cke_off a:focus .cke_openbutton,.cke_skin_kama .cke_rcombo .cke_off a:active .cke_openbutton,.cke_skin_kama .cke_rcombo .cke_on .cke_openbutton{border-color:#316ac5;background-color:#dff1ff;}.cke_skin_kama .cke_rcombo .cke_on .cke_text{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;}.cke_skin_kama .cke_rcombo .cke_on .cke_openbutton{-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;}.cke_skin_kama .cke_rcombo .cke_disabled .cke_label{filter:alpha(opacity=30);opacity:.3;}.cke_skin_kama .cke_hc .cke_rcombo .cke_disabled .cke_label{filter:alpha(opacity=70);opacity:.7;}.cke_skin_kama .cke_rcombo .cke_disabled .cke_text,.cke_skin_kama .cke_rcombo .cke_disabled .cke_openbutton{filter:alpha(opacity=50);opacity:.5;}.cke_skin_kama .cke_browser_ie .cke_rcombo .cke_disabled .cke_openbutton{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale'), alpha(opacity=50);}.cke_skin_kama .cke_browser_ie6 .cke_rcombo .cke_disabled .cke_openbutton{filter:alpha(opacity=50);}.cke_skin_kama .cke_hc .cke_rcombo .cke_disabled .cke_text,.cke_skin_kama .cke_hc .cke_rcombo .cke_disabled .cke_openbutton{filter:alpha(opacity=80);opacity:.8;}.cke_skin_kama .cke_rcombo .cke_disabled .cke_text{color:#fff;}.cke_skin_kama .cke_browser_gecko .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_gecko .cke_rcombo .cke_openbutton,.cke_skin_kama .cke_browser_webkit .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_webkit .cke_rcombo .cke_openbutton{display:block;float:left;}.cke_skin_kama .cke_browser_gecko .cke_rcombo .cke_label,.cke_skin_kama .cke_browser_webkit .cke_rcombo .cke_label{float:left;}.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_rcombo .cke_label,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_gecko .cke_rtl .cke_rcombo .cke_openbutton,.cke_skin_kama .cke_browser_webkit .cke_rtl .cke_rcombo .cke_label,.cke_skin_kama .cke_browser_webkit .cke_rtl .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_webkit .cke_rtl .cke_rcombo .cke_openbutton{float:right;}.cke_skin_kama .cke_browser_ie7 .cke_rcombo .cke_text{line-height:18px;}.cke_skin_kama .cke_browser_ie6 .cke_rcombo .cke_text,.cke_skin_kama .cke_browser_iequirks .cke_rcombo .cke_text{height:auto;line-height:17px;}.cke_skin_kama .cke_rtl .cke_rcombo .cke_font .cke_text,.cke_skin_kama .cke_rtl .cke_rcombo .cke_fontSize .cke_text{direction:ltr;}@media print{.cke_path{display:none;}}.cke_skin_kama .cke_path{display:inline-block;float:left;margin-top:5px;}.cke_skin_kama .cke_rtl .cke_path{float:right;}.cke_shared .cke_skin_kama .cke_path{_width:100%;margin:0 0 5px;}.cke_skin_kama .cke_path a,.cke_skin_kama .cke_path .cke_empty{display:inline-block;float:left;padding:1px 4px 0;color:#60676a;cursor:default;}.cke_skin_kama .cke_path .cke_empty{visibility:hidden;}.cke_skin_kama .cke_rtl .cke_path a,.cke_skin_kama .cke_rtl .cke_path cke_empty{float:right;}.cke_skin_kama .cke_path a:hover,.cke_skin_kama .cke_path a:focus,.cke_skin_kama .cke_path a:active{background-color:#dff1ff;padding:1px 4px 0;outline:none;color:#000;}.cke_skin_kama .cke_browser_ie .cke_rtl .cke_path a,.cke_skin_kama .cke_browser_ie .cke_rtl .cke_path .cke_empty{float:none;}.cke_skin_kama .cke_path .cke_label{display:none;}.cke_skin_kama .cke_button_source .cke_icon{background-position:0 0;}.cke_skin_kama .cke_button_docProps .cke_icon{background-position:0 -16px;}.cke_skin_kama .cke_button_newpage .cke_icon{background-position:0 -48px;}.cke_skin_kama .cke_button_preview .cke_icon{background-position:0 -64px;}.cke_skin_kama .cke_button_cut .cke_icon{background-position:0 -96px;}.cke_skin_kama .cke_button_copy .cke_icon{background-position:0 -112px;}.cke_skin_kama .cke_button_paste .cke_icon{background-position:0 -128px;}.cke_skin_kama .cke_button_pastetext .cke_icon{background-position:0 -144px;}.cke_skin_kama .cke_button_find .cke_icon{background-position:0 -240px;}.cke_skin_kama .cke_button_replace .cke_icon{background-position:0 -256px;} +.cke_skin_kama .cke_button_selectAll .cke_icon{background-position:0 -272px;}.cke_skin_kama .cke_button_removeFormat .cke_icon{background-position:0 -288px;}.cke_skin_kama .cke_button_bold .cke_icon{background-position:0 -304px;}.cke_skin_kama .cke_button_italic .cke_icon{background-position:0 -320px;}.cke_skin_kama .cke_button_underline .cke_icon{background-position:0 -336px;}.cke_skin_kama .cke_button_strike .cke_icon{background-position:0 -352px;}.cke_skin_kama .cke_button_subscript .cke_icon{background-position:0 -368px;}.cke_skin_kama .cke_button_superscript .cke_icon{background-position:0 -384px;}.cke_skin_kama .cke_button_table .cke_icon{background-position:0 -608px;}.cke_skin_kama .cke_button_horizontalrule .cke_icon{background-position:0 -624px;}.cke_skin_kama .cke_button_smiley .cke_icon{background-position:0 -640px;}.cke_skin_kama .cke_button_link .cke_icon{background-position:0 -528px;}.cke_skin_kama .cke_button_unlink .cke_icon{background-position:0 -544px;}.cke_skin_kama .cke_button_anchor .cke_icon{background-position:0 -560px;}.cke_skin_kama .cke_button_image .cke_icon{background-position:0 -576px;}.cke_skin_kama .cke_button_flash .cke_icon{background-position:0 -592px;}.cke_skin_kama .cke_button_specialchar .cke_icon{background-position:0 -656px;}.cke_skin_kama .cke_button_pagebreak .cke_icon{background-position:0 -672px;}.cke_skin_kama .cke_button_print .cke_icon{background-position:0 -176px;}.cke_skin_kama .cke_button_checkspell .cke_icon,.cke_skin_kama .cke_button_scayt .cke_icon{background-position:0 -192px;}.cke_skin_kama .cke_button_pagebreak .cke_icon{background-position:0 -672px;}.cke_skin_kama .cke_button_textcolor .cke_icon{background-position:0 -704px;}.cke_skin_kama .cke_button_bgcolor .cke_icon{background-position:0 -720px;}.cke_skin_kama .cke_button_form .cke_icon{background-position:0 -752px;}.cke_skin_kama .cke_button_checkbox .cke_icon{background-position:0 -768px;}.cke_skin_kama .cke_button_radio .cke_icon{background-position:0 -784px;}.cke_skin_kama .cke_button_textfield .cke_icon{background-position:0 -800px;}.cke_skin_kama .cke_button_textarea .cke_icon{background-position:0 -816px;}.cke_skin_kama .cke_button_showblocks .cke_icon{background-position:0 -1136px;}.cke_skin_kama .cke_button_select .cke_icon{background-position:0 -832px;}.cke_skin_kama .cke_button_button .cke_icon{background-position:0 -848px;}.cke_skin_kama .cke_button_imagebutton .cke_icon{background-position:0 -864px;}.cke_skin_kama .cke_button_hiddenfield .cke_icon{background-position:0 -880px;}.cke_skin_kama .cke_button_undo .cke_icon{background-position:0 -208px;}.cke_skin_kama .cke_rtl .cke_button_undo .cke_icon{background-position:0 -224px;}.cke_skin_kama .cke_button_redo .cke_icon{background-position:0 -224px;}.cke_skin_kama .cke_rtl .cke_button_redo .cke_icon{background-position:0 -208px;}.cke_skin_kama .cke_button_templates .cke_icon{background-position:0 -80px;}.cke_skin_kama .cke_button_numberedlist .cke_icon{background-position:0 -400px;}.cke_skin_kama .cke_button_bulletedlist .cke_icon{background-position:0 -416px;}.cke_skin_kama .cke_mixed_dir_content .cke_button_numberedlist .cke_icon{background-position:0 -1217px;}.cke_skin_kama .cke_mixed_dir_content .cke_button_bulletedlist .cke_icon{background-position:0 -1233px;}.cke_skin_kama .cke_button_outdent .cke_icon{background-position:0 -432px;}.cke_skin_kama .cke_button_indent .cke_icon{background-position:0 -448px;}.cke_skin_kama .cke_mixed_dir_content .cke_button_indent .cke_icon{background-position:0 -1265px;}.cke_skin_kama .cke_mixed_dir_content .cke_button_outdent .cke_icon{background-position:0 -1249px;}.cke_skin_kama .cke_button_justifyleft .cke_icon{background-position:0 -464px;}.cke_skin_kama .cke_button_justifycenter .cke_icon{background-position:0 -480px;}.cke_skin_kama .cke_button_justifyright .cke_icon{background-position:0 -496px;}.cke_skin_kama .cke_button_justifyblock .cke_icon{background-position:0 -512px;}.cke_skin_kama .cke_button_blockquote .cke_icon{background-position:0 -1152px;}.cke_skin_kama .cke_button_creatediv .cke_icon{background-position:0 -1168px;} +.cke_skin_kama .cke_button_editdiv .cke_icon{background-position:0 -1184px;}.cke_skin_kama .cke_button_removediv .cke_icon{background-position:0 -1200px;}.cke_skin_kama .cke_button_flash .cke_icon{background-position:0 -592px;}.cke_skin_kama .cke_button_pastefromword .cke_icon{background-position:0 -160px;}.cke_skin_kama .cke_button_save .cke_icon{background-position:0 -32px;}.cke_skin_kama .cke_button_about .cke_icon{background-position:0 -736px;}.cke_skin_kama .cke_button_maximize .cke_icon{background-position:0 -1040px;}.cke_skin_kama .cke_button_editdiv .cke_icon{background-position:0 -1184px;}.cke_skin_kama .cke_button_bidirtl .cke_icon{background-position:0 -1072px;}.cke_skin_kama .cke_button_bidiltr .cke_icon{background-position:0 -1056px;}.cke_skin_kama .cke_button_iframe .cke_icon{background-position:0 -1279px;}.cke_skin_kama .cke_button_source .cke_label{display:inline;}.cke_skin_kama .cke_styles_panel{width:150px;height:170px;}.cke_skin_kama .cke_format_panel{width:150px;height:170px;}.cke_skin_kama .cke_font_panel{width:150px;height:170px;}.cke_skin_kama .cke_fontSize_panel{height:170px;}.cke_skin_kama .cke_fontSize .cke_text{width:25px;}.cke_skin_kama .cke_browser_iequirks .cke_fontSize .cke_text{width:32px;}html .cke_skin_kama{visibility:inherit;}html.cke_skin_kama_container{visibility:visible;} diff --git a/assets/grocery_crud/texteditor/ckeditor/skins/kama/skin.js b/assets/grocery_crud/texteditor/ckeditor/skins/kama/skin.js index b675094..d4d43cc 100755 --- a/assets/grocery_crud/texteditor/ckeditor/skins/kama/skin.js +++ b/assets/grocery_crud/texteditor/ckeditor/skins/kama/skin.js @@ -1,7 +1,7 @@ -/* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -CKEDITOR.skins.add('kama',(function(){var a='cke_ui_color';return{editor:{css:['editor.css']},dialog:{css:['dialog.css']},richcombo:{canGroup:false},templates:{css:['templates.css']},margins:[0,0,0,0],init:function(b){if(b.config.width&&!isNaN(b.config.width))b.config.width-=12;var c=[],d=/\$color/g,e='/* UI Color Support */.cke_skin_kama .cke_menuitem .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_label,.cke_skin_kama .cke_menuitem a:focus .cke_label,.cke_skin_kama .cke_menuitem a:active .cke_label{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_label{\tbackground-color: transparent !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuseparator{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover,.cke_skin_kama .cke_menuitem a:focus,.cke_skin_kama .cke_menuitem a:active{\tbackground-color: $color !important;}';if(CKEDITOR.env.webkit){e=e.split('}').slice(0,-1);for(var f=0;f'+''+''+''+''+'
'+'
',h=f.append(CKEDITOR.dom.element.createFromHtml(g,f.getDocument()));if(f.getCustomData('cke_hasshared'))h.hide();else f.setCustomData('cke_hasshared',1);e=h.getChild([0,0,0,0]);!c.sharedSpaces&&(c.sharedSpaces={});c.sharedSpaces[d]=e;c.on('focus',function(){for(var i=0,j,k=f.getChildren();j=k.getItem(i);i++){if(j.type==CKEDITOR.NODE_ELEMENT&&!j.equals(h)&&j.hasClass('cke_shared'))j.hide();}h.show();});c.on('destroy',function(){h.remove();});}return e;};return{build:function(c,d){var e=c.name,f=c.element,g=c.elementMode;if(!f||g==CKEDITOR.ELEMENT_MODE_NONE)return;if(g==CKEDITOR.ELEMENT_MODE_REPLACE)f.hide();var h=c.fire('themeSpace',{space:'top',html:''}).html,i=c.fire('themeSpace',{space:'contents',html:''}).html,j=c.fireOnce('themeSpace',{space:'bottom',html:''}).html,k=i&&c.config.height,l=c.config.tabIndex||c.element.getAttribute('tabindex')||0;if(!i)k='auto';else if(!isNaN(k))k+='px';var m='',n=c.config.width;if(n){if(!isNaN(n))n+='px';m+='width: '+n+';';}var o=h&&b(c,'top'),p=b(c,'bottom');o&&(o.setHtml(h),h='');p&&(p.setHtml(j),j='');var q='';if(a[c.skinClass])q='';else a[c.skinClass]=1;var r=CKEDITOR.dom.element.createFromHtml([''+''+c.lang.editor+''+''+q+''+''+''].join('')); -r.getChild([1,0,0,0,0]).unselectable();r.getChild([1,0,0,0,2]).unselectable();if(g==CKEDITOR.ELEMENT_MODE_REPLACE)r.insertAfter(f);else f.append(r);c.container=r;r.disableContextMenu();c.on('contentDirChanged',function(s){var t=(c.lang.dir!=s.data?'add':'remove')+'Class';r.getChild(1)[t]('cke_mixed_dir_content');var u=this.sharedSpaces&&this.sharedSpaces[this.config.toolbarLocation];u&&u.getParent().getParent()[t]('cke_mixed_dir_content');});c.fireOnce('themeLoaded');c.fireOnce('uiReady');},buildDialog:function(c){var d=CKEDITOR.tools.getNextNumber(),e=CKEDITOR.dom.element.createFromHtml([''].join('').replace(/#/g,'_'+d).replace(/%/g,'cke_dialog_')),f=e.getChild([0,0,0,0,0]),g=f.getChild(0),h=f.getChild(1);if(CKEDITOR.env.ie&&!CKEDITOR.env.ie6Compat){var i=CKEDITOR.env.isCustomDomain(),j='javascript:void(function(){'+encodeURIComponent('document.open();'+(i?'document.domain="'+document.domain+'";':'')+'document.close();')+'}())',k=CKEDITOR.dom.element.createFromHtml('');k.appendTo(f.getParent());}g.unselectable();h.unselectable();return{element:e,parts:{dialog:e.getChild(0),title:g,close:h,tabs:f.getChild(2),contents:f.getChild([3,0,0,0]),footer:f.getChild([3,0,1,0])}}; -},destroy:function(c){var d=c.container,e=c.element;if(d){d.clearCustomData();d.remove();}if(e){e.clearCustomData();c.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&e.show();delete c.element;}}};})());CKEDITOR.editor.prototype.getThemeSpace=function(a){var b='cke_'+a,c=this._[b]||(this._[b]=CKEDITOR.document.getById(b+'_'+this.name));return c;};CKEDITOR.editor.prototype.resize=function(a,b,c,d){var j=this;var e=j.container,f=CKEDITOR.document.getById('cke_contents_'+j.name),g=CKEDITOR.env.webkit&&j.document&&j.document.getWindow().$.frameElement,h=d?e.getChild(1):e;h.setSize('width',a,true);g&&(g.style.width='1%');var i=c?0:(h.$.offsetHeight||0)-(f.$.clientHeight||0);f.setStyle('height',Math.max(b-i,0)+'px');g&&(g.style.width='100%');j.fire('resize');};CKEDITOR.editor.prototype.getResizable=function(a){return a?CKEDITOR.document.getById('cke_contents_'+this.name):this.container;}; +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.themes.add('default',(function(){var a={};function b(c,d){var e,f;f=c.config.sharedSpaces;f=f&&f[d];f=f&&CKEDITOR.document.getById(f);if(f){var g=''+''+''+''+''+'
'+'
',h=f.append(CKEDITOR.dom.element.createFromHtml(g,f.getDocument()));if(f.getCustomData('cke_hasshared'))h.hide();else f.setCustomData('cke_hasshared',1);e=h.getChild([0,0,0,0]);!c.sharedSpaces&&(c.sharedSpaces={});c.sharedSpaces[d]=e;c.on('focus',function(){for(var i=0,j,k=f.getChildren();j=k.getItem(i);i++){if(j.type==CKEDITOR.NODE_ELEMENT&&!j.equals(h)&&j.hasClass('cke_shared'))j.hide();}h.show();});c.on('destroy',function(){h.remove();});}return e;};return{build:function(c,d){var e=c.name,f=c.element,g=c.elementMode;if(!f||g==CKEDITOR.ELEMENT_MODE_NONE)return;if(g==CKEDITOR.ELEMENT_MODE_REPLACE)f.hide();var h=c.fire('themeSpace',{space:'top',html:''}).html,i=c.fire('themeSpace',{space:'contents',html:''}).html,j=c.fireOnce('themeSpace',{space:'bottom',html:''}).html,k=i&&c.config.height,l=c.config.tabIndex||c.element.getAttribute('tabindex')||0;if(!i)k='auto';else if(!isNaN(k))k+='px';var m='',n=c.config.width;if(n){if(!isNaN(n))n+='px';m+='width: '+n+';';}var o=h&&b(c,'top'),p=b(c,'bottom');o&&(o.setHtml(h),h='');p&&(p.setHtml(j),j='');var q='';if(a[c.skinClass])q='';else a[c.skinClass]=1;var r=CKEDITOR.dom.element.createFromHtml([''+''+c.lang.editor+''+''+q+''+''+''].join('')); +r.getChild([1,0,0,0,0]).unselectable();r.getChild([1,0,0,0,2]).unselectable();if(g==CKEDITOR.ELEMENT_MODE_REPLACE)r.insertAfter(f);else f.append(r);c.container=r;r.disableContextMenu();c.on('contentDirChanged',function(s){var t=(c.lang.dir!=s.data?'add':'remove')+'Class';r.getChild(1)[t]('cke_mixed_dir_content');var u=this.sharedSpaces&&this.sharedSpaces[this.config.toolbarLocation];u&&u.getParent().getParent()[t]('cke_mixed_dir_content');});c.fireOnce('themeLoaded');c.fireOnce('uiReady');},buildDialog:function(c){var d=CKEDITOR.tools.getNextNumber(),e=CKEDITOR.dom.element.createFromHtml([''].join('').replace(/#/g,'_'+d).replace(/%/g,'cke_dialog_')),f=e.getChild([0,0,0,0,0]),g=f.getChild(0),h=f.getChild(1);if(CKEDITOR.env.ie&&!CKEDITOR.env.ie6Compat){var i=CKEDITOR.env.isCustomDomain(),j='javascript:void(function(){'+encodeURIComponent('document.open();'+(i?'document.domain="'+document.domain+'";':'')+'document.close();')+'}())',k=CKEDITOR.dom.element.createFromHtml('');k.appendTo(f.getParent());}g.unselectable();h.unselectable();return{element:e,parts:{dialog:e.getChild(0),title:g,close:h,tabs:f.getChild(2),contents:f.getChild([3,0,0,0]),footer:f.getChild([3,0,1,0])}}; +},destroy:function(c){var d=c.container,e=c.element;if(d){d.clearCustomData();d.remove();}if(e){e.clearCustomData();c.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&e.show();delete c.element;}}};})());CKEDITOR.editor.prototype.getThemeSpace=function(a){var b='cke_'+a,c=this._[b]||(this._[b]=CKEDITOR.document.getById(b+'_'+this.name));return c;};CKEDITOR.editor.prototype.resize=function(a,b,c,d){var j=this;var e=j.container,f=CKEDITOR.document.getById('cke_contents_'+j.name),g=CKEDITOR.env.webkit&&j.document&&j.document.getWindow().$.frameElement,h=d?e.getChild(1):e;h.setSize('width',a,true);g&&(g.style.width='1%');var i=c?0:(h.$.offsetHeight||0)-(f.$.clientHeight||0);f.setStyle('height',Math.max(b-i,0)+'px');g&&(g.style.width='100%');j.fire('resize');};CKEDITOR.editor.prototype.getResizable=function(a){return a?CKEDITOR.document.getById('cke_contents_'+this.name):this.container;}; diff --git a/assets/grocery_crud/texteditor/markitup/index.html b/assets/grocery_crud/texteditor/markitup/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/texteditor/markitup/index.html +++ b/assets/grocery_crud/texteditor/markitup/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

Directory access is forbidden.

- - + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/markitup/jquery.markitup.js b/assets/grocery_crud/texteditor/markitup/jquery.markitup.js index 430c7aa..5d14f80 100755 --- a/assets/grocery_crud/texteditor/markitup/jquery.markitup.js +++ b/assets/grocery_crud/texteditor/markitup/jquery.markitup.js @@ -1,593 +1,593 @@ -// ---------------------------------------------------------------------------- -// markItUp! Universal MarkUp Engine, JQuery plugin -// v 1.1.x -// Dual licensed under the MIT and GPL licenses. -// ---------------------------------------------------------------------------- -// Copyright (C) 2007-2011 Jay Salvat -// http://markitup.jaysalvat.com/ -// ---------------------------------------------------------------------------- -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// ---------------------------------------------------------------------------- -(function($) { - $.fn.markItUp = function(settings, extraSettings) { - var options, ctrlKey, shiftKey, altKey; - ctrlKey = shiftKey = altKey = false; - - options = { id: '', - nameSpace: '', - root: '', - previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes' - previewAutoRefresh: true, - previewPosition: 'after', - previewTemplatePath: '~/templates/preview.html', - previewParser: false, - previewParserPath: '', - previewParserVar: 'data', - resizeHandle: true, - beforeInsert: '', - afterInsert: '', - onEnter: {}, - onShiftEnter: {}, - onCtrlEnter: {}, - onTab: {}, - markupSet: [ { /* set */ } ] - }; - $.extend(options, settings, extraSettings); - - // compute markItUp! path - if (!options.root) { - $('script').each(function(a, tag) { - miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/); - if (miuScript !== null) { - options.root = miuScript[1]; - } - }); - } - - return this.each(function() { - var $$, textarea, levels, scrollPosition, caretPosition, caretOffset, - clicked, hash, header, footer, previewWindow, template, iFrame, abort; - $$ = $(this); - textarea = this; - levels = []; - abort = false; - scrollPosition = caretPosition = 0; - caretOffset = -1; - - options.previewParserPath = localize(options.previewParserPath); - options.previewTemplatePath = localize(options.previewTemplatePath); - - // apply the computed path to ~/ - function localize(data, inText) { - if (inText) { - return data.replace(/("|')~\//g, "$1"+options.root); - } - return data.replace(/^~\//, options.root); - } - - // init and build editor - function init() { - id = ''; nameSpace = ''; - if (options.id) { - id = 'id="'+options.id+'"'; - } else if ($$.attr("id")) { - id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"'; - - } - if (options.nameSpace) { - nameSpace = 'class="'+options.nameSpace+'"'; - } - $$.wrap('
'); - $$.wrap('
'); - $$.wrap('
'); - $$.addClass("markItUpEditor"); - - // add the header before the textarea - header = $('
').insertBefore($$); - $(dropMenus(options.markupSet)).appendTo(header); - - // add the footer after the textarea - footer = $('
').insertAfter($$); - - // add the resize handle after textarea - if (options.resizeHandle === true && $.browser.safari !== true) { - resizeHandle = $('
') - .insertAfter($$) - .bind("mousedown", function(e) { - var h = $$.height(), y = e.clientY, mouseMove, mouseUp; - mouseMove = function(e) { - $$.css("height", Math.max(20, e.clientY+h-y)+"px"); - return false; - }; - mouseUp = function(e) { - $("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp); - return false; - }; - $("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp); - }); - footer.append(resizeHandle); - } - - // listen key events - $$.keydown(keyPressed).keyup(keyPressed); - - // bind an event to catch external calls - $$.bind("insertion", function(e, settings) { - if (settings.target !== false) { - get(); - } - if (textarea === $.markItUp.focused) { - markup(settings); - } - }); - - // remember the last focus - $$.focus(function() { - $.markItUp.focused = this; - }); - } - - // recursively build header with dropMenus from markupset - function dropMenus(markupSet) { - var ul = $('
    '), i = 0; - $('li:hover > ul', ul).css('display', 'block'); - $.each(markupSet, function() { - var button = this, t = '', title, li, j; - title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||''); - key = (button.key) ? 'accesskey="'+button.key+'"' : ''; - if (button.separator) { - li = $('
  • '+(button.separator||'')+'
  • ').appendTo(ul); - } else { - i++; - for (j = levels.length -1; j >= 0; j--) { - t += levels[j]+"-"; - } - li = $('
  • '+(button.name||'')+'
  • ') - .bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click - return false; - }).click(function() { - return false; - }).bind("focusin", function(){ - $$.focus(); - }).mouseup(function() { - if (button.call) { - eval(button.call)(); - } - setTimeout(function() { markup(button) },1); - return false; - }).hover(function() { - $('> ul', this).show(); - $(document).one('click', function() { // close dropmenu if click outside - $('ul ul', header).hide(); - } - ); - }, function() { - $('> ul', this).hide(); - } - ).appendTo(ul); - if (button.dropMenu) { - levels.push(i); - $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu)); - } - } - }); - levels.pop(); - return ul; - } - - // markItUp! markups - function magicMarkups(string) { - if (string) { - string = string.toString(); - string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g, - function(x, a) { - var b = a.split('|!|'); - if (altKey === true) { - return (b[1] !== undefined) ? b[1] : b[0]; - } else { - return (b[1] === undefined) ? "" : b[0]; - } - } - ); - // [![prompt]!], [![prompt:!:value]!] - string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g, - function(x, a) { - var b = a.split(':!:'); - if (abort === true) { - return false; - } - value = prompt(b[0], (b[1]) ? b[1] : ''); - if (value === null) { - abort = true; - } - return value; - } - ); - return string; - } - return ""; - } - - // prepare action - function prepare(action) { - if ($.isFunction(action)) { - action = action(hash); - } - return magicMarkups(action); - } - - // build block to insert - function build(string) { - var openWith = prepare(clicked.openWith); - var placeHolder = prepare(clicked.placeHolder); - var replaceWith = prepare(clicked.replaceWith); - var closeWith = prepare(clicked.closeWith); - var openBlockWith = prepare(clicked.openBlockWith); - var closeBlockWith = prepare(clicked.closeBlockWith); - var multiline = clicked.multiline; - - if (replaceWith !== "") { - block = openWith + replaceWith + closeWith; - } else if (selection === '' && placeHolder !== '') { - block = openWith + placeHolder + closeWith; - } else { - string = string || selection; - - var lines = selection.split(/\r?\n/), blocks = []; - - for (var l=0; l < lines.length; l++) { - line = lines[l]; - var trailingSpaces; - if (trailingSpaces = line.match(/ *$/)) { - blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces); - } else { - blocks.push(openWith + line + closeWith); - } - } - - block = blocks.join("\n"); - } - - block = openBlockWith + block + closeBlockWith; - - return { block:block, - openWith:openWith, - replaceWith:replaceWith, - placeHolder:placeHolder, - closeWith:closeWith - }; - } - - // define markup to insert - function markup(button) { - var len, j, n, i; - hash = clicked = button; - get(); - $.extend(hash, { line:"", - root:options.root, - textarea:textarea, - selection:(selection||''), - caretPosition:caretPosition, - ctrlKey:ctrlKey, - shiftKey:shiftKey, - altKey:altKey - } - ); - // callbacks before insertion - prepare(options.beforeInsert); - prepare(clicked.beforeInsert); - if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { - prepare(clicked.beforeMultiInsert); - } - $.extend(hash, { line:1 }); - - if ((ctrlKey === true && shiftKey === true)) { - lines = selection.split(/\r?\n/); - for (j = 0, n = lines.length, i = 0; i < n; i++) { - if ($.trim(lines[i]) !== '') { - $.extend(hash, { line:++j, selection:lines[i] } ); - lines[i] = build(lines[i]).block; - } else { - lines[i] = ""; - } - } - string = { block:lines.join('\n')}; - start = caretPosition; - len = string.block.length + (($.browser.opera) ? n-1 : 0); - } else if (ctrlKey === true) { - string = build(selection); - start = caretPosition + string.openWith.length; - len = string.block.length - string.openWith.length - string.closeWith.length; - len = len - (string.block.match(/ $/) ? 1 : 0); - len -= fixIeBug(string.block); - } else if (shiftKey === true) { - string = build(selection); - start = caretPosition; - len = string.block.length; - len -= fixIeBug(string.block); - } else { - string = build(selection); - start = caretPosition + string.block.length ; - len = 0; - start -= fixIeBug(string.block); - } - if ((selection === '' && string.replaceWith === '')) { - caretOffset += fixOperaBug(string.block); - - start = caretPosition + string.openWith.length; - len = string.block.length - string.openWith.length - string.closeWith.length; - - caretOffset = $$.val().substring(caretPosition, $$.val().length).length; - caretOffset -= fixOperaBug($$.val().substring(0, caretPosition)); - } - $.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } ); - - if (string.block !== selection && abort === false) { - insert(string.block); - set(start, len); - } else { - caretOffset = -1; - } - get(); - - $.extend(hash, { line:'', selection:selection }); - - // callbacks after insertion - if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { - prepare(clicked.afterMultiInsert); - } - prepare(clicked.afterInsert); - prepare(options.afterInsert); - - // refresh preview if opened - if (previewWindow && options.previewAutoRefresh) { - refreshPreview(); - } - - // reinit keyevent - shiftKey = altKey = ctrlKey = abort = false; - } - - // Substract linefeed in Opera - function fixOperaBug(string) { - if ($.browser.opera) { - return string.length - string.replace(/\n*/g, '').length; - } - return 0; - } - // Substract linefeed in IE - function fixIeBug(string) { - if ($.browser.msie) { - return string.length - string.replace(/\r*/g, '').length; - } - return 0; - } - - // add markup - function insert(block) { - if (document.selection) { - var newSelection = document.selection.createRange(); - newSelection.text = block; - } else { - textarea.value = textarea.value.substring(0, caretPosition) + block + textarea.value.substring(caretPosition + selection.length, textarea.value.length); - } - } - - // set a selection - function set(start, len) { - if (textarea.createTextRange){ - // quick fix to make it work on Opera 9.5 - if ($.browser.opera && $.browser.version >= 9.5 && len == 0) { - return false; - } - range = textarea.createTextRange(); - range.collapse(true); - range.moveStart('character', start); - range.moveEnd('character', len); - range.select(); - } else if (textarea.setSelectionRange ){ - textarea.setSelectionRange(start, start + len); - } - textarea.scrollTop = scrollPosition; - textarea.focus(); - } - - // get the selection - function get() { - textarea.focus(); - - scrollPosition = textarea.scrollTop; - if (document.selection) { - selection = document.selection.createRange().text; - if ($.browser.msie) { // ie - var range = document.selection.createRange(), rangeCopy = range.duplicate(); - rangeCopy.moveToElementText(textarea); - caretPosition = -1; - while(rangeCopy.inRange(range)) { - rangeCopy.moveStart('character'); - caretPosition ++; - } - } else { // opera - caretPosition = textarea.selectionStart; - } - } else { // gecko & webkit - caretPosition = textarea.selectionStart; - - selection = textarea.value.substring(caretPosition, textarea.selectionEnd); - } - return selection; - } - - // open preview window - function preview() { - if (!previewWindow || previewWindow.closed) { - if (options.previewInWindow) { - previewWindow = window.open('', 'preview', options.previewInWindow); - $(window).unload(function() { - previewWindow.close(); - }); - } else { - iFrame = $(''); - if (options.previewPosition == 'after') { - iFrame.insertAfter(footer); - } else { - iFrame.insertBefore(header); - } - previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1]; - } - } else if (altKey === true) { - if (iFrame) { - iFrame.remove(); - } else { - previewWindow.close(); - } - previewWindow = iFrame = false; - } - if (!options.previewAutoRefresh) { - refreshPreview(); - } - if (options.previewInWindow) { - previewWindow.focus(); - } - } - - // refresh Preview window - function refreshPreview() { - renderPreview(); - } - - function renderPreview() { - var phtml; - if (options.previewParser && typeof options.previewParser === 'function') { - var data = options.previewParser( $$.val() ); - writeInPreview( localize(data, 1) ); - } else if (options.previewParserPath !== '') { - $.ajax({ - type: 'POST', - dataType: 'text', - global: false, - url: options.previewParserPath, - data: options.previewParserVar+'='+encodeURIComponent($$.val()), - success: function(data) { - writeInPreview( localize(data, 1) ); - } - }); - } else { - if (!template) { - $.ajax({ - url: options.previewTemplatePath, - dataType: 'text', - global: false, - success: function(data) { - writeInPreview( localize(data, 1).replace(//g, $$.val()) ); - } - }); - } - } - return false; - } - - function writeInPreview(data) { - if (previewWindow.document) { - try { - sp = previewWindow.document.documentElement.scrollTop - } catch(e) { - sp = 0; - } - previewWindow.document.open(); - previewWindow.document.write(data); - previewWindow.document.close(); - previewWindow.document.documentElement.scrollTop = sp; - } - } - - // set keys pressed - function keyPressed(e) { - shiftKey = e.shiftKey; - altKey = e.altKey; - ctrlKey = (!(e.altKey && e.ctrlKey)) ? (e.ctrlKey || e.metaKey) : false; - - if (e.type === 'keydown') { - if (ctrlKey === true) { - li = $('a[accesskey="'+String.fromCharCode(e.keyCode)+'"]', header).parent('li'); - if (li.length !== 0) { - ctrlKey = false; - setTimeout(function() { - li.triggerHandler('mouseup'); - },1); - return false; - } - } - if (e.keyCode === 13 || e.keyCode === 10) { // Enter key - if (ctrlKey === true) { // Enter + Ctrl - ctrlKey = false; - markup(options.onCtrlEnter); - return options.onCtrlEnter.keepDefault; - } else if (shiftKey === true) { // Enter + Shift - shiftKey = false; - markup(options.onShiftEnter); - return options.onShiftEnter.keepDefault; - } else { // only Enter - markup(options.onEnter); - return options.onEnter.keepDefault; - } - } - if (e.keyCode === 9) { // Tab key - if (shiftKey == true || ctrlKey == true || altKey == true) { - return false; - } - if (caretOffset !== -1) { - get(); - caretOffset = $$.val().length - caretOffset; - set(caretOffset, 0); - caretOffset = -1; - return false; - } else { - markup(options.onTab); - return options.onTab.keepDefault; - } - } - } - } - - init(); - }); - }; - - $.fn.markItUpRemove = function() { - return this.each(function() { - var $$ = $(this).unbind().removeClass('markItUpEditor'); - $$.parent('div').parent('div.markItUp').parent('div').replaceWith($$); - } - ); - }; - - $.markItUp = function(settings) { - var options = { target:false }; - $.extend(options, settings); - if (options.target) { - return $(options.target).each(function() { - $(this).focus(); - $(this).trigger('insertion', [options]); - }); - } else { - $('textarea').trigger('insertion', [options]); - } - }; -})(jQuery); +// ---------------------------------------------------------------------------- +// markItUp! Universal MarkUp Engine, JQuery plugin +// v 1.1.x +// Dual licensed under the MIT and GPL licenses. +// ---------------------------------------------------------------------------- +// Copyright (C) 2007-2011 Jay Salvat +// http://markitup.jaysalvat.com/ +// ---------------------------------------------------------------------------- +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// ---------------------------------------------------------------------------- +(function($) { + $.fn.markItUp = function(settings, extraSettings) { + var options, ctrlKey, shiftKey, altKey; + ctrlKey = shiftKey = altKey = false; + + options = { id: '', + nameSpace: '', + root: '', + previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes' + previewAutoRefresh: true, + previewPosition: 'after', + previewTemplatePath: '~/templates/preview.html', + previewParser: false, + previewParserPath: '', + previewParserVar: 'data', + resizeHandle: true, + beforeInsert: '', + afterInsert: '', + onEnter: {}, + onShiftEnter: {}, + onCtrlEnter: {}, + onTab: {}, + markupSet: [ { /* set */ } ] + }; + $.extend(options, settings, extraSettings); + + // compute markItUp! path + if (!options.root) { + $('script').each(function(a, tag) { + miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/); + if (miuScript !== null) { + options.root = miuScript[1]; + } + }); + } + + return this.each(function() { + var $$, textarea, levels, scrollPosition, caretPosition, caretOffset, + clicked, hash, header, footer, previewWindow, template, iFrame, abort; + $$ = $(this); + textarea = this; + levels = []; + abort = false; + scrollPosition = caretPosition = 0; + caretOffset = -1; + + options.previewParserPath = localize(options.previewParserPath); + options.previewTemplatePath = localize(options.previewTemplatePath); + + // apply the computed path to ~/ + function localize(data, inText) { + if (inText) { + return data.replace(/("|')~\//g, "$1"+options.root); + } + return data.replace(/^~\//, options.root); + } + + // init and build editor + function init() { + id = ''; nameSpace = ''; + if (options.id) { + id = 'id="'+options.id+'"'; + } else if ($$.attr("id")) { + id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"'; + + } + if (options.nameSpace) { + nameSpace = 'class="'+options.nameSpace+'"'; + } + $$.wrap('
    '); + $$.wrap('
    '); + $$.wrap('
    '); + $$.addClass("markItUpEditor"); + + // add the header before the textarea + header = $('
    ').insertBefore($$); + $(dropMenus(options.markupSet)).appendTo(header); + + // add the footer after the textarea + footer = $('
    ').insertAfter($$); + + // add the resize handle after textarea + if (options.resizeHandle === true && $.browser.safari !== true) { + resizeHandle = $('
    ') + .insertAfter($$) + .bind("mousedown", function(e) { + var h = $$.height(), y = e.clientY, mouseMove, mouseUp; + mouseMove = function(e) { + $$.css("height", Math.max(20, e.clientY+h-y)+"px"); + return false; + }; + mouseUp = function(e) { + $("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp); + return false; + }; + $("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp); + }); + footer.append(resizeHandle); + } + + // listen key events + $$.keydown(keyPressed).keyup(keyPressed); + + // bind an event to catch external calls + $$.bind("insertion", function(e, settings) { + if (settings.target !== false) { + get(); + } + if (textarea === $.markItUp.focused) { + markup(settings); + } + }); + + // remember the last focus + $$.focus(function() { + $.markItUp.focused = this; + }); + } + + // recursively build header with dropMenus from markupset + function dropMenus(markupSet) { + var ul = $('
      '), i = 0; + $('li:hover > ul', ul).css('display', 'block'); + $.each(markupSet, function() { + var button = this, t = '', title, li, j; + title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||''); + key = (button.key) ? 'accesskey="'+button.key+'"' : ''; + if (button.separator) { + li = $('
    • '+(button.separator||'')+'
    • ').appendTo(ul); + } else { + i++; + for (j = levels.length -1; j >= 0; j--) { + t += levels[j]+"-"; + } + li = $('
    • '+(button.name||'')+'
    • ') + .bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click + return false; + }).click(function() { + return false; + }).bind("focusin", function(){ + $$.focus(); + }).mouseup(function() { + if (button.call) { + eval(button.call)(); + } + setTimeout(function() { markup(button) },1); + return false; + }).hover(function() { + $('> ul', this).show(); + $(document).one('click', function() { // close dropmenu if click outside + $('ul ul', header).hide(); + } + ); + }, function() { + $('> ul', this).hide(); + } + ).appendTo(ul); + if (button.dropMenu) { + levels.push(i); + $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu)); + } + } + }); + levels.pop(); + return ul; + } + + // markItUp! markups + function magicMarkups(string) { + if (string) { + string = string.toString(); + string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g, + function(x, a) { + var b = a.split('|!|'); + if (altKey === true) { + return (b[1] !== undefined) ? b[1] : b[0]; + } else { + return (b[1] === undefined) ? "" : b[0]; + } + } + ); + // [![prompt]!], [![prompt:!:value]!] + string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g, + function(x, a) { + var b = a.split(':!:'); + if (abort === true) { + return false; + } + value = prompt(b[0], (b[1]) ? b[1] : ''); + if (value === null) { + abort = true; + } + return value; + } + ); + return string; + } + return ""; + } + + // prepare action + function prepare(action) { + if ($.isFunction(action)) { + action = action(hash); + } + return magicMarkups(action); + } + + // build block to insert + function build(string) { + var openWith = prepare(clicked.openWith); + var placeHolder = prepare(clicked.placeHolder); + var replaceWith = prepare(clicked.replaceWith); + var closeWith = prepare(clicked.closeWith); + var openBlockWith = prepare(clicked.openBlockWith); + var closeBlockWith = prepare(clicked.closeBlockWith); + var multiline = clicked.multiline; + + if (replaceWith !== "") { + block = openWith + replaceWith + closeWith; + } else if (selection === '' && placeHolder !== '') { + block = openWith + placeHolder + closeWith; + } else { + string = string || selection; + + var lines = selection.split(/\r?\n/), blocks = []; + + for (var l=0; l < lines.length; l++) { + line = lines[l]; + var trailingSpaces; + if (trailingSpaces = line.match(/ *$/)) { + blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces); + } else { + blocks.push(openWith + line + closeWith); + } + } + + block = blocks.join("\n"); + } + + block = openBlockWith + block + closeBlockWith; + + return { block:block, + openWith:openWith, + replaceWith:replaceWith, + placeHolder:placeHolder, + closeWith:closeWith + }; + } + + // define markup to insert + function markup(button) { + var len, j, n, i; + hash = clicked = button; + get(); + $.extend(hash, { line:"", + root:options.root, + textarea:textarea, + selection:(selection||''), + caretPosition:caretPosition, + ctrlKey:ctrlKey, + shiftKey:shiftKey, + altKey:altKey + } + ); + // callbacks before insertion + prepare(options.beforeInsert); + prepare(clicked.beforeInsert); + if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { + prepare(clicked.beforeMultiInsert); + } + $.extend(hash, { line:1 }); + + if ((ctrlKey === true && shiftKey === true)) { + lines = selection.split(/\r?\n/); + for (j = 0, n = lines.length, i = 0; i < n; i++) { + if ($.trim(lines[i]) !== '') { + $.extend(hash, { line:++j, selection:lines[i] } ); + lines[i] = build(lines[i]).block; + } else { + lines[i] = ""; + } + } + string = { block:lines.join('\n')}; + start = caretPosition; + len = string.block.length + (($.browser.opera) ? n-1 : 0); + } else if (ctrlKey === true) { + string = build(selection); + start = caretPosition + string.openWith.length; + len = string.block.length - string.openWith.length - string.closeWith.length; + len = len - (string.block.match(/ $/) ? 1 : 0); + len -= fixIeBug(string.block); + } else if (shiftKey === true) { + string = build(selection); + start = caretPosition; + len = string.block.length; + len -= fixIeBug(string.block); + } else { + string = build(selection); + start = caretPosition + string.block.length ; + len = 0; + start -= fixIeBug(string.block); + } + if ((selection === '' && string.replaceWith === '')) { + caretOffset += fixOperaBug(string.block); + + start = caretPosition + string.openWith.length; + len = string.block.length - string.openWith.length - string.closeWith.length; + + caretOffset = $$.val().substring(caretPosition, $$.val().length).length; + caretOffset -= fixOperaBug($$.val().substring(0, caretPosition)); + } + $.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } ); + + if (string.block !== selection && abort === false) { + insert(string.block); + set(start, len); + } else { + caretOffset = -1; + } + get(); + + $.extend(hash, { line:'', selection:selection }); + + // callbacks after insertion + if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { + prepare(clicked.afterMultiInsert); + } + prepare(clicked.afterInsert); + prepare(options.afterInsert); + + // refresh preview if opened + if (previewWindow && options.previewAutoRefresh) { + refreshPreview(); + } + + // reinit keyevent + shiftKey = altKey = ctrlKey = abort = false; + } + + // Substract linefeed in Opera + function fixOperaBug(string) { + if ($.browser.opera) { + return string.length - string.replace(/\n*/g, '').length; + } + return 0; + } + // Substract linefeed in IE + function fixIeBug(string) { + if ($.browser.msie) { + return string.length - string.replace(/\r*/g, '').length; + } + return 0; + } + + // add markup + function insert(block) { + if (document.selection) { + var newSelection = document.selection.createRange(); + newSelection.text = block; + } else { + textarea.value = textarea.value.substring(0, caretPosition) + block + textarea.value.substring(caretPosition + selection.length, textarea.value.length); + } + } + + // set a selection + function set(start, len) { + if (textarea.createTextRange){ + // quick fix to make it work on Opera 9.5 + if ($.browser.opera && $.browser.version >= 9.5 && len == 0) { + return false; + } + range = textarea.createTextRange(); + range.collapse(true); + range.moveStart('character', start); + range.moveEnd('character', len); + range.select(); + } else if (textarea.setSelectionRange ){ + textarea.setSelectionRange(start, start + len); + } + textarea.scrollTop = scrollPosition; + textarea.focus(); + } + + // get the selection + function get() { + textarea.focus(); + + scrollPosition = textarea.scrollTop; + if (document.selection) { + selection = document.selection.createRange().text; + if ($.browser.msie) { // ie + var range = document.selection.createRange(), rangeCopy = range.duplicate(); + rangeCopy.moveToElementText(textarea); + caretPosition = -1; + while(rangeCopy.inRange(range)) { + rangeCopy.moveStart('character'); + caretPosition ++; + } + } else { // opera + caretPosition = textarea.selectionStart; + } + } else { // gecko & webkit + caretPosition = textarea.selectionStart; + + selection = textarea.value.substring(caretPosition, textarea.selectionEnd); + } + return selection; + } + + // open preview window + function preview() { + if (!previewWindow || previewWindow.closed) { + if (options.previewInWindow) { + previewWindow = window.open('', 'preview', options.previewInWindow); + $(window).unload(function() { + previewWindow.close(); + }); + } else { + iFrame = $(''); + if (options.previewPosition == 'after') { + iFrame.insertAfter(footer); + } else { + iFrame.insertBefore(header); + } + previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1]; + } + } else if (altKey === true) { + if (iFrame) { + iFrame.remove(); + } else { + previewWindow.close(); + } + previewWindow = iFrame = false; + } + if (!options.previewAutoRefresh) { + refreshPreview(); + } + if (options.previewInWindow) { + previewWindow.focus(); + } + } + + // refresh Preview window + function refreshPreview() { + renderPreview(); + } + + function renderPreview() { + var phtml; + if (options.previewParser && typeof options.previewParser === 'function') { + var data = options.previewParser( $$.val() ); + writeInPreview( localize(data, 1) ); + } else if (options.previewParserPath !== '') { + $.ajax({ + type: 'POST', + dataType: 'text', + global: false, + url: options.previewParserPath, + data: options.previewParserVar+'='+encodeURIComponent($$.val()), + success: function(data) { + writeInPreview( localize(data, 1) ); + } + }); + } else { + if (!template) { + $.ajax({ + url: options.previewTemplatePath, + dataType: 'text', + global: false, + success: function(data) { + writeInPreview( localize(data, 1).replace(//g, $$.val()) ); + } + }); + } + } + return false; + } + + function writeInPreview(data) { + if (previewWindow.document) { + try { + sp = previewWindow.document.documentElement.scrollTop + } catch(e) { + sp = 0; + } + previewWindow.document.open(); + previewWindow.document.write(data); + previewWindow.document.close(); + previewWindow.document.documentElement.scrollTop = sp; + } + } + + // set keys pressed + function keyPressed(e) { + shiftKey = e.shiftKey; + altKey = e.altKey; + ctrlKey = (!(e.altKey && e.ctrlKey)) ? (e.ctrlKey || e.metaKey) : false; + + if (e.type === 'keydown') { + if (ctrlKey === true) { + li = $('a[accesskey="'+String.fromCharCode(e.keyCode)+'"]', header).parent('li'); + if (li.length !== 0) { + ctrlKey = false; + setTimeout(function() { + li.triggerHandler('mouseup'); + },1); + return false; + } + } + if (e.keyCode === 13 || e.keyCode === 10) { // Enter key + if (ctrlKey === true) { // Enter + Ctrl + ctrlKey = false; + markup(options.onCtrlEnter); + return options.onCtrlEnter.keepDefault; + } else if (shiftKey === true) { // Enter + Shift + shiftKey = false; + markup(options.onShiftEnter); + return options.onShiftEnter.keepDefault; + } else { // only Enter + markup(options.onEnter); + return options.onEnter.keepDefault; + } + } + if (e.keyCode === 9) { // Tab key + if (shiftKey == true || ctrlKey == true || altKey == true) { + return false; + } + if (caretOffset !== -1) { + get(); + caretOffset = $$.val().length - caretOffset; + set(caretOffset, 0); + caretOffset = -1; + return false; + } else { + markup(options.onTab); + return options.onTab.keepDefault; + } + } + } + } + + init(); + }); + }; + + $.fn.markItUpRemove = function() { + return this.each(function() { + var $$ = $(this).unbind().removeClass('markItUpEditor'); + $$.parent('div').parent('div.markItUp').parent('div').replaceWith($$); + } + ); + }; + + $.markItUp = function(settings) { + var options = { target:false }; + $.extend(options, settings); + if (options.target) { + return $(options.target).each(function() { + $(this).focus(); + $(this).trigger('insertion', [options]); + }); + } else { + $('textarea').trigger('insertion', [options]); + } + }; +})(jQuery); diff --git a/assets/grocery_crud/texteditor/markitup/sets/default/style.css b/assets/grocery_crud/texteditor/markitup/sets/default/style.css index b1d20d6..8a0d84d 100755 --- a/assets/grocery_crud/texteditor/markitup/sets/default/style.css +++ b/assets/grocery_crud/texteditor/markitup/sets/default/style.css @@ -1,34 +1,34 @@ -/* ------------------------------------------------------------------- -// markItUp! -// By Jay Salvat - http://markitup.jaysalvat.com/ -// ------------------------------------------------------------------*/ -.markItUp .markItUpButton1 a { - background-image:url(images/bold.png); -} -.markItUp .markItUpButton2 a { - background-image:url(images/italic.png); -} -.markItUp .markItUpButton3 a { - background-image:url(images/stroke.png); -} - -.markItUp .markItUpButton4 a { - background-image:url(images/list-bullet.png); -} -.markItUp .markItUpButton5 a { - background-image:url(images/list-numeric.png); -} - -.markItUp .markItUpButton6 a { - background-image:url(images/picture.png); -} -.markItUp .markItUpButton7 a { - background-image:url(images/link.png); -} - -.markItUp .markItUpButton8 a { - background-image:url(images/clean.png); -} -.markItUp .preview a { - background-image:url(images/preview.png); -} +/* ------------------------------------------------------------------- +// markItUp! +// By Jay Salvat - http://markitup.jaysalvat.com/ +// ------------------------------------------------------------------*/ +.markItUp .markItUpButton1 a { + background-image:url(images/bold.png); +} +.markItUp .markItUpButton2 a { + background-image:url(images/italic.png); +} +.markItUp .markItUpButton3 a { + background-image:url(images/stroke.png); +} + +.markItUp .markItUpButton4 a { + background-image:url(images/list-bullet.png); +} +.markItUp .markItUpButton5 a { + background-image:url(images/list-numeric.png); +} + +.markItUp .markItUpButton6 a { + background-image:url(images/picture.png); +} +.markItUp .markItUpButton7 a { + background-image:url(images/link.png); +} + +.markItUp .markItUpButton8 a { + background-image:url(images/clean.png); +} +.markItUp .preview a { + background-image:url(images/preview.png); +} diff --git a/assets/grocery_crud/texteditor/markitup/skins/markitup/style.css b/assets/grocery_crud/texteditor/markitup/skins/markitup/style.css index dba6462..4704048 100755 --- a/assets/grocery_crud/texteditor/markitup/skins/markitup/style.css +++ b/assets/grocery_crud/texteditor/markitup/skins/markitup/style.css @@ -1,147 +1,147 @@ -/* ------------------------------------------------------------------- -// markItUp! Universal MarkUp Engine, JQuery plugin -// By Jay Salvat - http://markitup.jaysalvat.com/ -// ------------------------------------------------------------------*/ -.markItUp * { - margin:0px; padding:0px; - outline:none; -} -.markItUp a:link, -.markItUp a:visited { - color:#000; - text-decoration:none; -} -.markItUp { - width:700px; - margin:5px 0 5px 0; - border:5px solid #F5F5F5; -} -.markItUpContainer { - border:1px solid #3C769D; - background:#FFF url(images/bg-container.png) repeat-x top left; - padding:5px 5px 2px 5px; - font:11px Verdana, Arial, Helvetica, sans-serif; -} -.markItUpEditor { - font:12px 'Courier New', Courier, monospace; - padding:5px 5px 5px 5px; - border:3px solid #3C769D; - width: 98% !important; - height:320px; - background:#FFF url(images/bg-editor.png) no-repeat; - clear:both; - line-height:18px; - overflow:auto; -} -.markItUpPreviewFrame { - overflow:auto; - background-color:#FFFFFF; - border:1px solid #3C769D; - width:99.9%; - height:300px; - margin:5px 0; -} -.markItUpFooter { - width:100%; - cursor:n-resize; -} -.markItUpResizeHandle { - overflow:hidden; - width:22px; height:5px; - margin-left:auto; - margin-right:auto; - background-image:url(images/handle.png); - cursor:n-resize; -} -/***************************************************************************************/ -/* first row of buttons */ -.markItUpHeader ul li { - list-style:none; - float:left; - position:relative; -} -.markItUpHeader ul li ul{ - display:none; -} -.markItUpHeader ul li:hover > ul{ - display:block; -} -.markItUpHeader ul .markItUpDropMenu { - background:transparent url(images/menu.png) no-repeat 115% 50%; - margin-right:5px; -} -.markItUpHeader ul .markItUpDropMenu li { - margin-right:0px; -} -.markItUpHeader ul .markItUpSeparator { - margin:0 10px; - width:1px; - height:16px; - overflow:hidden; - background-color:#CCC; -} -.markItUpHeader ul ul .markItUpSeparator { - width:auto; height:1px; - margin:0px; -} -/* next rows of buttons */ -.markItUpHeader ul ul { - display:none; - position:absolute; - top:18px; left:0px; - background:#F5F5F5; - border:1px solid #3C769D; - height:inherit; -} -.markItUpHeader ul ul li { - float:none; - border-bottom:1px solid #3C769D; -} -.markItUpHeader ul ul .markItUpDropMenu { - background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%; -} -/* next rows of buttons */ -.markItUpHeader ul ul ul { - position:absolute; - top:-1px; left:150px; -} -.markItUpHeader ul ul ul li { - float:none; -} -.markItUpHeader ul a { - display:block; - width:16px; height:16px; - text-indent:-10000px; - background-repeat:no-repeat; - padding:3px; - margin:0px; -} -.markItUpHeader ul ul a { - display:block; - padding-left:0px; - text-indent:0; - width:120px; - padding:5px 5px 5px 25px; - background-position:2px 50%; -} -.markItUpHeader ul ul a:hover { - color:#FFF; - background-color:#3C769D; -} -/***************************************************************************************/ -.html .markItUpEditor { - background-image:url(images/bg-editor-html.png); -} -.markdown .markItUpEditor { - background-image:url(images/bg-editor-markdown.png); -} -.textile .markItUpEditor { - background-image:url(images/bg-editor-textile.png); -} -.bbcode .markItUpEditor { - background-image:url(images/bg-editor-bbcode.png); -} -.wiki .markItUpEditor, -.dotclear .markItUpEditor { - background-image:url(images/bg-editor-wiki.png); +/* ------------------------------------------------------------------- +// markItUp! Universal MarkUp Engine, JQuery plugin +// By Jay Salvat - http://markitup.jaysalvat.com/ +// ------------------------------------------------------------------*/ +.markItUp * { + margin:0px; padding:0px; + outline:none; +} +.markItUp a:link, +.markItUp a:visited { + color:#000; + text-decoration:none; +} +.markItUp { + width:700px; + margin:5px 0 5px 0; + border:5px solid #F5F5F5; +} +.markItUpContainer { + border:1px solid #3C769D; + background:#FFF url(images/bg-container.png) repeat-x top left; + padding:5px 5px 2px 5px; + font:11px Verdana, Arial, Helvetica, sans-serif; +} +.markItUpEditor { + font:12px 'Courier New', Courier, monospace; + padding:5px 5px 5px 5px; + border:3px solid #3C769D; + width: 98% !important; + height:320px; + background:#FFF url(images/bg-editor.png) no-repeat; + clear:both; + line-height:18px; + overflow:auto; +} +.markItUpPreviewFrame { + overflow:auto; + background-color:#FFFFFF; + border:1px solid #3C769D; + width:99.9%; + height:300px; + margin:5px 0; +} +.markItUpFooter { + width:100%; + cursor:n-resize; +} +.markItUpResizeHandle { + overflow:hidden; + width:22px; height:5px; + margin-left:auto; + margin-right:auto; + background-image:url(images/handle.png); + cursor:n-resize; +} +/***************************************************************************************/ +/* first row of buttons */ +.markItUpHeader ul li { + list-style:none; + float:left; + position:relative; +} +.markItUpHeader ul li ul{ + display:none; +} +.markItUpHeader ul li:hover > ul{ + display:block; +} +.markItUpHeader ul .markItUpDropMenu { + background:transparent url(images/menu.png) no-repeat 115% 50%; + margin-right:5px; +} +.markItUpHeader ul .markItUpDropMenu li { + margin-right:0px; +} +.markItUpHeader ul .markItUpSeparator { + margin:0 10px; + width:1px; + height:16px; + overflow:hidden; + background-color:#CCC; +} +.markItUpHeader ul ul .markItUpSeparator { + width:auto; height:1px; + margin:0px; +} +/* next rows of buttons */ +.markItUpHeader ul ul { + display:none; + position:absolute; + top:18px; left:0px; + background:#F5F5F5; + border:1px solid #3C769D; + height:inherit; +} +.markItUpHeader ul ul li { + float:none; + border-bottom:1px solid #3C769D; +} +.markItUpHeader ul ul .markItUpDropMenu { + background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%; +} +/* next rows of buttons */ +.markItUpHeader ul ul ul { + position:absolute; + top:-1px; left:150px; +} +.markItUpHeader ul ul ul li { + float:none; +} +.markItUpHeader ul a { + display:block; + width:16px; height:16px; + text-indent:-10000px; + background-repeat:no-repeat; + padding:3px; + margin:0px; +} +.markItUpHeader ul ul a { + display:block; + padding-left:0px; + text-indent:0; + width:120px; + padding:5px 5px 5px 25px; + background-position:2px 50%; +} +.markItUpHeader ul ul a:hover { + color:#FFF; + background-color:#3C769D; +} +/***************************************************************************************/ +.html .markItUpEditor { + background-image:url(images/bg-editor-html.png); +} +.markdown .markItUpEditor { + background-image:url(images/bg-editor-markdown.png); +} +.textile .markItUpEditor { + background-image:url(images/bg-editor-textile.png); +} +.bbcode .markItUpEditor { + background-image:url(images/bg-editor-bbcode.png); +} +.wiki .markItUpEditor, +.dotclear .markItUpEditor { + background-image:url(images/bg-editor-wiki.png); } \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/markitup/skins/simple/style.css b/assets/grocery_crud/texteditor/markitup/skins/simple/style.css index 7b2bbc0..366b6b7 100755 --- a/assets/grocery_crud/texteditor/markitup/skins/simple/style.css +++ b/assets/grocery_crud/texteditor/markitup/skins/simple/style.css @@ -1,118 +1,118 @@ -/* ------------------------------------------------------------------- -// markItUp! Universal MarkUp Engine, JQuery plugin -// By Jay Salvat - http://markitup.jaysalvat.com/ -// ------------------------------------------------------------------*/ -.markItUp * { - margin:0px; padding:0px; - outline:none; -} -.markItUp a:link, -.markItUp a:visited { - color:#000; - text-decoration:none; -} -.markItUp { - width:700px; - margin:5px 0 5px 0; -} -.markItUpContainer { - font:11px Verdana, Arial, Helvetica, sans-serif; -} -.markItUpEditor { - font:12px 'Courier New', Courier, monospace; - padding:5px; - width:690px; - height:320px; - clear:both; - line-height:18px; - overflow:auto; -} -.markItUpPreviewFrame { - overflow:auto; - background-color:#FFF; - width:99.9%; - height:300px; - margin:5px 0; -} -.markItUpFooter { - width:100%; -} -.markItUpResizeHandle { - overflow:hidden; - width:22px; height:5px; - margin-left:auto; - margin-right:auto; - background-image:url(images/handle.png); - cursor:n-resize; -} -/***************************************************************************************/ -/* first row of buttons */ -.markItUpHeader ul li { - list-style:none; - float:left; - position:relative; -} -.markItUpHeader ul li:hover > ul{ - display:block; -} -.markItUpHeader ul .markItUpDropMenu { - background:transparent url(images/menu.png) no-repeat 115% 50%; - margin-right:5px; -} -.markItUpHeader ul .markItUpDropMenu li { - margin-right:0px; -} -/* next rows of buttons */ -.markItUpHeader ul ul { - display:none; - position:absolute; - top:18px; left:0px; - background:#FFF; - border:1px solid #000; -} -.markItUpHeader ul ul li { - float:none; - border-bottom:1px solid #000; -} -.markItUpHeader ul ul .markItUpDropMenu { - background:#FFF url(images/submenu.png) no-repeat 100% 50%; -} -.markItUpHeader ul .markItUpSeparator { - margin:0 10px; - width:1px; - height:16px; - overflow:hidden; - background-color:#CCC; -} -.markItUpHeader ul ul .markItUpSeparator { - width:auto; height:1px; - margin:0px; -} -/* next rows of buttons */ -.markItUpHeader ul ul ul { - position:absolute; - top:-1px; left:150px; -} -.markItUpHeader ul ul ul li { - float:none; -} -.markItUpHeader ul a { - display:block; - width:16px; height:16px; - text-indent:-10000px; - background-repeat:no-repeat; - padding:3px; - margin:0px; -} -.markItUpHeader ul ul a { - display:block; - padding-left:0px; - text-indent:0; - width:120px; - padding:5px 5px 5px 25px; - background-position:2px 50%; -} -.markItUpHeader ul ul a:hover { - color:#FFF; - background-color:#000; -} +/* ------------------------------------------------------------------- +// markItUp! Universal MarkUp Engine, JQuery plugin +// By Jay Salvat - http://markitup.jaysalvat.com/ +// ------------------------------------------------------------------*/ +.markItUp * { + margin:0px; padding:0px; + outline:none; +} +.markItUp a:link, +.markItUp a:visited { + color:#000; + text-decoration:none; +} +.markItUp { + width:700px; + margin:5px 0 5px 0; +} +.markItUpContainer { + font:11px Verdana, Arial, Helvetica, sans-serif; +} +.markItUpEditor { + font:12px 'Courier New', Courier, monospace; + padding:5px; + width:690px; + height:320px; + clear:both; + line-height:18px; + overflow:auto; +} +.markItUpPreviewFrame { + overflow:auto; + background-color:#FFF; + width:99.9%; + height:300px; + margin:5px 0; +} +.markItUpFooter { + width:100%; +} +.markItUpResizeHandle { + overflow:hidden; + width:22px; height:5px; + margin-left:auto; + margin-right:auto; + background-image:url(images/handle.png); + cursor:n-resize; +} +/***************************************************************************************/ +/* first row of buttons */ +.markItUpHeader ul li { + list-style:none; + float:left; + position:relative; +} +.markItUpHeader ul li:hover > ul{ + display:block; +} +.markItUpHeader ul .markItUpDropMenu { + background:transparent url(images/menu.png) no-repeat 115% 50%; + margin-right:5px; +} +.markItUpHeader ul .markItUpDropMenu li { + margin-right:0px; +} +/* next rows of buttons */ +.markItUpHeader ul ul { + display:none; + position:absolute; + top:18px; left:0px; + background:#FFF; + border:1px solid #000; +} +.markItUpHeader ul ul li { + float:none; + border-bottom:1px solid #000; +} +.markItUpHeader ul ul .markItUpDropMenu { + background:#FFF url(images/submenu.png) no-repeat 100% 50%; +} +.markItUpHeader ul .markItUpSeparator { + margin:0 10px; + width:1px; + height:16px; + overflow:hidden; + background-color:#CCC; +} +.markItUpHeader ul ul .markItUpSeparator { + width:auto; height:1px; + margin:0px; +} +/* next rows of buttons */ +.markItUpHeader ul ul ul { + position:absolute; + top:-1px; left:150px; +} +.markItUpHeader ul ul ul li { + float:none; +} +.markItUpHeader ul a { + display:block; + width:16px; height:16px; + text-indent:-10000px; + background-repeat:no-repeat; + padding:3px; + margin:0px; +} +.markItUpHeader ul ul a { + display:block; + padding-left:0px; + text-indent:0; + width:120px; + padding:5px 5px 5px 25px; + background-position:2px 50%; +} +.markItUpHeader ul ul a:hover { + color:#FFF; + background-color:#000; +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/css/advhr.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/css/advhr.css index 0e22834..3fe369c 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/css/advhr.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/css/advhr.css @@ -1,5 +1,5 @@ -input.radio {border:1px none #000; background:transparent; vertical-align:middle;} -.panel_wrapper div.current {height:80px;} -#width {width:50px; vertical-align:middle;} -#width2 {width:50px; vertical-align:middle;} -#size {width:100px;} +input.radio {border:1px none #000; background:transparent; vertical-align:middle;} +.panel_wrapper div.current {height:80px;} +#width {width:50px; vertical-align:middle;} +#width2 {width:50px; vertical-align:middle;} +#size {width:100px;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/editor_plugin_src.js index 0c652d3..d0fe664 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/editor_plugin_src.js @@ -1,57 +1,57 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedHRPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceAdvancedHr', function() { - ed.windowManager.open({ - file : url + '/rule.htm', - width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), - height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('advhr', { - title : 'advhr.advhr_desc', - cmd : 'mceAdvancedHr' - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('advhr', n.nodeName == 'HR'); - }); - - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'HR') - ed.selection.select(e); - }); - }, - - getInfo : function() { - return { - longname : 'Advanced HR', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedHRPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvancedHr', function() { + ed.windowManager.open({ + file : url + '/rule.htm', + width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), + height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('advhr', { + title : 'advhr.advhr_desc', + cmd : 'mceAdvancedHr' + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('advhr', n.nodeName == 'HR'); + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'HR') + ed.selection.select(e); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced HR', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/js/rule.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/js/rule.js index b6cbd66..e9dbc92 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/js/rule.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/advhr/js/rule.js @@ -1,43 +1,43 @@ -var AdvHRDialog = { - init : function(ed) { - var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; - - w = dom.getAttrib(n, 'width'); - f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); - f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; - f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); - selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); - }, - - update : function() { - var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; - - h = ''); - }, - - init : function(ed) { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); - - tinyMCEPopup.resizeToInnerSize(); - this.fillClassList('class_list'); - this.fillFileList('src_list', fl); - this.fillFileList('over_list', fl); - this.fillFileList('out_list', fl); - TinyMCE_EditableSelects.init(); - - if (n.nodeName == 'IMG') { - nl.src.value = dom.getAttrib(n, 'src'); - nl.width.value = dom.getAttrib(n, 'width'); - nl.height.value = dom.getAttrib(n, 'height'); - nl.alt.value = dom.getAttrib(n, 'alt'); - nl.title.value = dom.getAttrib(n, 'title'); - nl.vspace.value = this.getAttrib(n, 'vspace'); - nl.hspace.value = this.getAttrib(n, 'hspace'); - nl.border.value = this.getAttrib(n, 'border'); - selectByValue(f, 'align', this.getAttrib(n, 'align')); - selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); - nl.style.value = dom.getAttrib(n, 'style'); - nl.id.value = dom.getAttrib(n, 'id'); - nl.dir.value = dom.getAttrib(n, 'dir'); - nl.lang.value = dom.getAttrib(n, 'lang'); - nl.usemap.value = dom.getAttrib(n, 'usemap'); - nl.longdesc.value = dom.getAttrib(n, 'longdesc'); - nl.insert.value = ed.getLang('update'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) - nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) - nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (ed.settings.inline_styles) { - // Move attribs to styles - if (dom.getAttrib(n, 'align')) - this.updateStyle('align'); - - if (dom.getAttrib(n, 'hspace')) - this.updateStyle('hspace'); - - if (dom.getAttrib(n, 'border')) - this.updateStyle('border'); - - if (dom.getAttrib(n, 'vspace')) - this.updateStyle('vspace'); - } - } - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); - if (isVisible('overbrowser')) - document.getElementById('onmouseoversrc').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); - if (isVisible('outbrowser')) - document.getElementById('onmouseoutsrc').style.width = '260px'; - - // If option enabled default contrain proportions to checked - if (ed.getParam("advimage_constrain_proportions", true)) - f.constrain.checked = true; - - // Check swap image if valid data - if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) - this.setSwapImage(true); - else - this.setSwapImage(false); - - this.changeAppearance(); - this.showPreviewImage(nl.src.value, 1); - }, - - insert : function(file, title) { - var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { - if (!f.alt.value) { - tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { - if (s) - t.insertAndClose(); - }); - - return; - } - } - - t.insertAndClose(); - }, - - insertAndClose : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - // Fixes crash in Safari - if (tinymce.isWebKit) - ed.getWin().focus(); - - if (!ed.settings.inline_styles) { - args = { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }; - } else { - // Remove deprecated values - args = { - vspace : '', - hspace : '', - border : '', - align : '' - }; - } - - tinymce.extend(args, { - src : nl.src.value.replace(/ /g, '%20'), - width : nl.width.value, - height : nl.height.value, - alt : nl.alt.value, - title : nl.title.value, - 'class' : getSelectValue(f, 'class_list'), - style : nl.style.value, - id : nl.id.value, - dir : nl.dir.value, - lang : nl.lang.value, - usemap : nl.usemap.value, - longdesc : nl.longdesc.value - }); - - args.onmouseover = args.onmouseout = ''; - - if (f.onmousemovecheck.checked) { - if (nl.onmouseoversrc.value) - args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; - - if (nl.onmouseoutsrc.value) - args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; - } - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - } else { - tinymce.each(args, function(value, name) { - if (value === "") { - delete args[name]; - } - }); - - ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); - ed.undoManager.add(); - } - - tinyMCEPopup.editor.execCommand('mceRepaint'); - tinyMCEPopup.editor.focus(); - tinyMCEPopup.close(); - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - setSwapImage : function(st) { - var f = document.forms[0]; - - f.onmousemovecheck.checked = st; - setBrowserDisabled('overbrowser', !st); - setBrowserDisabled('outbrowser', !st); - - if (f.over_list) - f.over_list.disabled = !st; - - if (f.out_list) - f.out_list.disabled = !st; - - f.onmouseoversrc.disabled = !st; - f.onmouseoutsrc.disabled = !st; - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options.length = 0; - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = typeof(l) === 'function' ? l() : window[l]; - lst.options.length = 0; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.elements.width.value = f.elements.height.value = ''; - }, - - updateImageData : function(img, st) { - var f = document.forms[0]; - - if (!st) { - f.elements.width.value = img.width; - f.elements.height.value = img.height; - } - - this.preloadImg = img; - }, - - changeAppearance : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); - - if (img) { - if (ed.getParam('inline_styles')) { - ed.dom.setAttrib(img, 'style', f.style.value); - } else { - img.align = f.align.value; - img.border = f.border.value; - img.hspace = f.hspace.value; - img.vspace = f.vspace.value; - } - } - }, - - changeHeight : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; - f.height.value = tp.toFixed(0); - }, - - changeWidth : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; - f.width.value = tp.toFixed(0); - }, - - updateStyle : function(ty) { - var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); - - if (tinyMCEPopup.editor.settings.inline_styles) { - // Handle align - if (ty == 'align') { - dom.setStyle(img, 'float', ''); - dom.setStyle(img, 'vertical-align', ''); - - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') - dom.setStyle(img, 'float', v); - else - img.style.verticalAlign = v; - } - } - - // Handle border - if (ty == 'border') { - b = img.style.border ? img.style.border.split(' ') : []; - bStyle = dom.getStyle(img, 'border-style'); - bColor = dom.getStyle(img, 'border-color'); - - dom.setStyle(img, 'border', ''); - - v = f.border.value; - if (v || v == '0') { - if (v == '0') - img.style.border = isIE ? '0' : '0 none none'; - else { - var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9); - - if (b.length == 3 && b[isOldIE ? 2 : 1]) - bStyle = b[isOldIE ? 2 : 1]; - else if (!bStyle || bStyle == 'none') - bStyle = 'solid'; - if (b.length == 3 && b[isIE ? 0 : 2]) - bColor = b[isOldIE ? 0 : 2]; - else if (!bColor || bColor == 'none') - bColor = 'black'; - img.style.border = v + 'px ' + bStyle + ' ' + bColor; - } - } - } - - // Handle hspace - if (ty == 'hspace') { - dom.setStyle(img, 'marginLeft', ''); - dom.setStyle(img, 'marginRight', ''); - - v = f.hspace.value; - if (v) { - img.style.marginLeft = v + 'px'; - img.style.marginRight = v + 'px'; - } - } - - // Handle vspace - if (ty == 'vspace') { - dom.setStyle(img, 'marginTop', ''); - dom.setStyle(img, 'marginBottom', ''); - - v = f.vspace.value; - if (v) { - img.style.marginTop = v + 'px'; - img.style.marginBottom = v + 'px'; - } - } - - // Merge - dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); - } - }, - - changeMouseMove : function() { - }, - - showPreviewImage : function(u, st) { - if (!u) { - tinyMCEPopup.dom.setHTML('prev', ''); - return; - } - - if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) - this.resetImageData(); - - u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); - - if (!st) - tinyMCEPopup.dom.setHTML('prev', ''); - else - tinyMCEPopup.dom.setHTML('prev', ''); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', fl); + this.fillFileList('over_list', fl); + this.fillFileList('out_list', fl); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value.replace(/ /g, '%20'), + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + b = img.style.border ? img.style.border.split(' ') : []; + bStyle = dom.getStyle(img, 'border-style'); + bColor = dom.getStyle(img, 'border-color'); + + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = isIE ? '0' : '0 none none'; + else { + var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9); + + if (b.length == 3 && b[isOldIE ? 2 : 1]) + bStyle = b[isOldIE ? 2 : 1]; + else if (!bStyle || bStyle == 'none') + bStyle = 'solid'; + if (b.length == 3 && b[isIE ? 0 : 2]) + bColor = b[isOldIE ? 0 : 2]; + else if (!bColor || bColor == 'none') + bColor = 'black'; + img.style.border = v + 'px ' + bStyle + ' ' + bColor; + } + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/css/advlink.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/css/advlink.css index 1436431..66c6549 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/css/advlink.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/css/advlink.css @@ -1,8 +1,8 @@ -.mceLinkList, .mceAnchorList, #targetlist {width:280px;} -.mceActionPanel {margin-top:7px;} -.panel_wrapper div.current {height:320px;} -#classlist, #title, #href {width:280px;} -#popupurl, #popupname {width:200px;} -#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} -#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} -#events_panel input {width:200px;} +.mceLinkList, .mceAnchorList, #targetlist {width:280px;} +.mceActionPanel {margin-top:7px;} +.panel_wrapper div.current {height:320px;} +#classlist, #title, #href {width:280px;} +#popupurl, #popupname {width:200px;} +#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} +#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} +#events_panel input {width:200px;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/editor_plugin_src.js index 14e46a7..d63f99a 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/editor_plugin_src.js @@ -1,61 +1,61 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { - init : function(ed, url) { - this.editor = ed; - - // Register commands - ed.addCommand('mceAdvLink', function() { - var se = ed.selection; - - // No selection and not in link - if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) - return; - - ed.windowManager.open({ - file : url + '/link.htm', - width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), - height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('link', { - title : 'advlink.link_desc', - cmd : 'mceAdvLink' - }); - - ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); - - ed.onNodeChange.add(function(ed, cm, n, co) { - cm.setDisabled('link', co && n.nodeName != 'A'); - cm.setActive('link', n.nodeName == 'A' && !n.name); - }); - }, - - getInfo : function() { - return { - longname : 'Advanced link', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { + init : function(ed, url) { + this.editor = ed; + + // Register commands + ed.addCommand('mceAdvLink', function() { + var se = ed.selection; + + // No selection and not in link + if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) + return; + + ed.windowManager.open({ + file : url + '/link.htm', + width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), + height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('link', { + title : 'advlink.link_desc', + cmd : 'mceAdvLink' + }); + + ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('link', co && n.nodeName != 'A'); + cm.setActive('link', n.nodeName == 'A' && !n.name); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/js/advlink.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/js/advlink.js index f013aac..6a3904b 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/js/advlink.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/advlink/js/advlink.js @@ -1,543 +1,543 @@ -/* Functions for the advlink plugin popup */ - -tinyMCEPopup.requireLangPack(); - -var templates = { - "window.open" : "window.open('${url}','${target}','${options}')" -}; - -function preinit() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); -} - -function changeClass() { - var f = document.forms[0]; - - f.classes.value = getSelectValue(f, 'classlist'); -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - var formObj = document.forms[0]; - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - var action = "insert"; - var html; - - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); - document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); - document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); - - // Link list - html = getLinkListHTML('linklisthref','href'); - if (html == "") - document.getElementById("linklisthrefrow").style.display = 'none'; - else - document.getElementById("linklisthrefcontainer").innerHTML = html; - - // Anchor list - html = getAnchorListHTML('anchorlist','href'); - if (html == "") - document.getElementById("anchorlistrow").style.display = 'none'; - else - document.getElementById("anchorlistcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '260px'; - - if (isVisible('popupurlbrowser')) - document.getElementById('popupurl').style.width = '180px'; - - elm = inst.dom.getParent(elm, "A"); - if (elm == null) { - var prospect = inst.dom.create("p", null, inst.selection.getContent()); - if (prospect.childNodes.length === 1) { - elm = prospect.firstChild; - } - } - - if (elm != null && elm.nodeName == "A") - action = "update"; - - formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); - - setPopupControlsDisabled(true); - - if (action == "update") { - var href = inst.dom.getAttrib(elm, 'href'); - var onclick = inst.dom.getAttrib(elm, 'onclick'); - var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self"; - - // Setup form data - setFormValue('href', href); - setFormValue('title', inst.dom.getAttrib(elm, 'title')); - setFormValue('id', inst.dom.getAttrib(elm, 'id')); - setFormValue('style', inst.dom.getAttrib(elm, "style")); - setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); - setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); - setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); - setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); - setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); - setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('type', inst.dom.getAttrib(elm, 'type')); - setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); - setFormValue('target', linkTarget); - setFormValue('classes', inst.dom.getAttrib(elm, 'class')); - - // Parse onclick data - if (onclick != null && onclick.indexOf('window.open') != -1) - parseWindowOpen(onclick); - else - parseFunction(onclick); - - // Select by the values - selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); - selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); - selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); - selectByValue(formObj, 'linklisthref', href); - - if (href.charAt(0) == '#') - selectByValue(formObj, 'anchorlist', href); - - addClassesToList('classlist', 'advlink_styles'); - - selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); - selectByValue(formObj, 'targetlist', linkTarget, true); - } else - addClassesToList('classlist', 'advlink_styles'); -} - -function checkPrefix(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) - n.value = 'http://' + n.value; -} - -function setFormValue(name, value) { - document.forms[0].elements[name].value = value; -} - -function parseWindowOpen(onclick) { - var formObj = document.forms[0]; - - // Preprocess center code - if (onclick.indexOf('return false;') != -1) { - formObj.popupreturn.checked = true; - onclick = onclick.replace('return false;', ''); - } else - formObj.popupreturn.checked = false; - - var onClickData = parseLink(onclick); - - if (onClickData != null) { - formObj.ispopup.checked = true; - setPopupControlsDisabled(false); - - var onClickWindowOptions = parseOptions(onClickData['options']); - var url = onClickData['url']; - - formObj.popupname.value = onClickData['target']; - formObj.popupurl.value = url; - formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); - formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); - - formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); - formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); - - if (formObj.popupleft.value.indexOf('screen') != -1) - formObj.popupleft.value = "c"; - - if (formObj.popuptop.value.indexOf('screen') != -1) - formObj.popuptop.value = "c"; - - formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; - formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; - formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; - formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; - formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; - formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; - formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; - - buildOnClick(); - } -} - -function parseFunction(onclick) { - var formObj = document.forms[0]; - var onClickData = parseLink(onclick); - - // TODO: Add stuff here -} - -function getOption(opts, name) { - return typeof(opts[name]) == "undefined" ? "" : opts[name]; -} - -function setPopupControlsDisabled(state) { - var formObj = document.forms[0]; - - formObj.popupname.disabled = state; - formObj.popupurl.disabled = state; - formObj.popupwidth.disabled = state; - formObj.popupheight.disabled = state; - formObj.popupleft.disabled = state; - formObj.popuptop.disabled = state; - formObj.popuplocation.disabled = state; - formObj.popupscrollbars.disabled = state; - formObj.popupmenubar.disabled = state; - formObj.popupresizable.disabled = state; - formObj.popuptoolbar.disabled = state; - formObj.popupstatus.disabled = state; - formObj.popupreturn.disabled = state; - formObj.popupdependent.disabled = state; - - setBrowserDisabled('popupurlbrowser', state); -} - -function parseLink(link) { - link = link.replace(new RegExp(''', 'g'), "'"); - - var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); - - // Is function name a template function - var template = templates[fnName]; - if (template) { - // Build regexp - var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); - var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; - var replaceStr = ""; - for (var i=0; i'); - for (var i=0; i' + name + ''; - - if ((name = nodes[i].id) != "" && !nodes[i].href) - html += ''; - } - - if (html == "") - return ""; - - html = ''; - - return html; -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm, elementArray, i; - - elm = inst.selection.getNode(); - checkPrefix(document.forms[0].href); - - elm = inst.dom.getParent(elm, "A"); - - // Remove element if there is no href - if (!document.forms[0].href.value) { - i = inst.selection.getBookmark(); - inst.dom.remove(elm, 1); - inst.selection.moveToBookmark(i); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - - // Create new anchor elements - if (elm == null) { - inst.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); - - elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); - for (i=0; i' + tinyMCELinkList[i][0] + ''; - - html += ''; - - return html; - - // tinyMCE.debug('-- image list start --', html, '-- image list end --'); -} - -function getTargetListHTML(elm_id, target_form_element) { - var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); - var html = ''; - - html += ''; - - return html; -} - -// While loading -preinit(); -tinyMCEPopup.onInit.add(init); +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + var action = "insert"; + var html; + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); + document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); + document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); + + // Link list + html = getLinkListHTML('linklisthref','href'); + if (html == "") + document.getElementById("linklisthrefrow").style.display = 'none'; + else + document.getElementById("linklisthrefcontainer").innerHTML = html; + + // Anchor list + html = getAnchorListHTML('anchorlist','href'); + if (html == "") + document.getElementById("anchorlistrow").style.display = 'none'; + else + document.getElementById("anchorlistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '260px'; + + if (isVisible('popupurlbrowser')) + document.getElementById('popupurl').style.width = '180px'; + + elm = inst.dom.getParent(elm, "A"); + if (elm == null) { + var prospect = inst.dom.create("p", null, inst.selection.getContent()); + if (prospect.childNodes.length === 1) { + elm = prospect.firstChild; + } + } + + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self"; + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', linkTarget); + setFormValue('classes', inst.dom.getAttrib(elm, 'class')); + + // Parse onclick data + if (onclick != null && onclick.indexOf('window.open') != -1) + parseWindowOpen(onclick); + else + parseFunction(onclick); + + // Select by the values + selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', linkTarget, true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +function parseWindowOpen(onclick) { + var formObj = document.forms[0]; + + // Preprocess center code + if (onclick.indexOf('return false;') != -1) { + formObj.popupreturn.checked = true; + onclick = onclick.replace('return false;', ''); + } else + formObj.popupreturn.checked = false; + + var onClickData = parseLink(onclick); + + if (onClickData != null) { + formObj.ispopup.checked = true; + setPopupControlsDisabled(false); + + var onClickWindowOptions = parseOptions(onClickData['options']); + var url = onClickData['url']; + + formObj.popupname.value = onClickData['target']; + formObj.popupurl.value = url; + formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); + formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); + + formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); + formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); + + if (formObj.popupleft.value.indexOf('screen') != -1) + formObj.popupleft.value = "c"; + + if (formObj.popuptop.value.indexOf('screen') != -1) + formObj.popuptop.value = "c"; + + formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; + formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; + formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; + formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; + formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; + formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; + formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; + + buildOnClick(); + } +} + +function parseFunction(onclick) { + var formObj = document.forms[0]; + var onClickData = parseLink(onclick); + + // TODO: Add stuff here +} + +function getOption(opts, name) { + return typeof(opts[name]) == "undefined" ? "" : opts[name]; +} + +function setPopupControlsDisabled(state) { + var formObj = document.forms[0]; + + formObj.popupname.disabled = state; + formObj.popupurl.disabled = state; + formObj.popupwidth.disabled = state; + formObj.popupheight.disabled = state; + formObj.popupleft.disabled = state; + formObj.popuptop.disabled = state; + formObj.popuplocation.disabled = state; + formObj.popupscrollbars.disabled = state; + formObj.popupmenubar.disabled = state; + formObj.popupresizable.disabled = state; + formObj.popuptoolbar.disabled = state; + formObj.popupstatus.disabled = state; + formObj.popupreturn.disabled = state; + formObj.popupdependent.disabled = state; + + setBrowserDisabled('popupurlbrowser', state); +} + +function parseLink(link) { + link = link.replace(new RegExp(''', 'g'), "'"); + + var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); + + // Is function name a template function + var template = templates[fnName]; + if (template) { + // Build regexp + var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); + var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; + var replaceStr = ""; + for (var i=0; i'); + for (var i=0; i' + name + ''; + + if ((name = nodes[i].id) != "" && !nodes[i].href) + html += ''; + } + + if (html == "") + return ""; + + html = ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/advlist/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/advlist/editor_plugin_src.js index a8f046b..b79a76c 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/advlist/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/advlist/editor_plugin_src.js @@ -1,176 +1,176 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each; - - tinymce.create('tinymce.plugins.AdvListPlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - function buildFormats(str) { - var formats = []; - - each(str.split(/,/), function(type) { - formats.push({ - title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')), - styles : { - listStyleType : type == 'default' ? '' : type - } - }); - }); - - return formats; - }; - - // Setup number formats from config or default - t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); - t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square"); - - if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent)) - t.isIE7 = true; - }, - - createControl: function(name, cm) { - var t = this, btn, format, editor = t.editor; - - if (name == 'numlist' || name == 'bullist') { - // Default to first item if it's a default item - if (t[name][0].title == 'advlist.def') - format = t[name][0]; - - function hasFormat(node, format) { - var state = true; - - each(format.styles, function(value, name) { - // Format doesn't match - if (editor.dom.getStyle(node, name) != value) { - state = false; - return false; - } - }); - - return state; - }; - - function applyListFormat() { - var list, dom = editor.dom, sel = editor.selection; - - // Check for existing list element - list = dom.getParent(sel.getNode(), 'ol,ul'); - - // Switch/add list type if needed - if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format)) - editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); - - // Append styles to new list element - if (format) { - list = dom.getParent(sel.getNode(), 'ol,ul'); - if (list) { - dom.setStyles(list, format.styles); - list.removeAttribute('data-mce-style'); - } - } - - editor.focus(); - }; - - btn = cm.createSplitButton(name, { - title : 'advanced.' + name + '_desc', - 'class' : 'mce_' + name, - onclick : function() { - applyListFormat(); - } - }); - - btn.onRenderMenu.add(function(btn, menu) { - menu.onHideMenu.add(function() { - if (t.bookmark) { - editor.selection.moveToBookmark(t.bookmark); - t.bookmark = 0; - } - }); - - menu.onShowMenu.add(function() { - var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList; - - if (list || format) { - fmtList = t[name]; - - // Unselect existing items - each(menu.items, function(item) { - var state = true; - - item.setSelected(0); - - if (list && !item.isDisabled()) { - each(fmtList, function(fmt) { - if (fmt.id == item.id) { - if (!hasFormat(list, fmt)) { - state = false; - return false; - } - } - }); - - if (state) - item.setSelected(1); - } - }); - - // Select the current format - if (!list) - menu.items[format.id].setSelected(1); - } - - editor.focus(); - - // IE looses it's selection so store it away and restore it later - if (tinymce.isIE) { - t.bookmark = editor.selection.getBookmark(1); - } - }); - - menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1); - - each(t[name], function(item) { - // IE<8 doesn't support lower-greek, skip it - if (t.isIE7 && item.styles.listStyleType == 'lower-greek') - return; - - item.id = editor.dom.uniqueId(); - - menu.add({id : item.id, title : item.title, onclick : function() { - format = item; - applyListFormat(); - }}); - }); - }); - - return btn; - } - }, - - getInfo : function() { - return { - longname : 'Advanced lists', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each; + + tinymce.create('tinymce.plugins.AdvListPlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + function buildFormats(str) { + var formats = []; + + each(str.split(/,/), function(type) { + formats.push({ + title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')), + styles : { + listStyleType : type == 'default' ? '' : type + } + }); + }); + + return formats; + }; + + // Setup number formats from config or default + t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); + t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square"); + + if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent)) + t.isIE7 = true; + }, + + createControl: function(name, cm) { + var t = this, btn, format, editor = t.editor; + + if (name == 'numlist' || name == 'bullist') { + // Default to first item if it's a default item + if (t[name][0].title == 'advlist.def') + format = t[name][0]; + + function hasFormat(node, format) { + var state = true; + + each(format.styles, function(value, name) { + // Format doesn't match + if (editor.dom.getStyle(node, name) != value) { + state = false; + return false; + } + }); + + return state; + }; + + function applyListFormat() { + var list, dom = editor.dom, sel = editor.selection; + + // Check for existing list element + list = dom.getParent(sel.getNode(), 'ol,ul'); + + // Switch/add list type if needed + if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format)) + editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); + + // Append styles to new list element + if (format) { + list = dom.getParent(sel.getNode(), 'ol,ul'); + if (list) { + dom.setStyles(list, format.styles); + list.removeAttribute('data-mce-style'); + } + } + + editor.focus(); + }; + + btn = cm.createSplitButton(name, { + title : 'advanced.' + name + '_desc', + 'class' : 'mce_' + name, + onclick : function() { + applyListFormat(); + } + }); + + btn.onRenderMenu.add(function(btn, menu) { + menu.onHideMenu.add(function() { + if (t.bookmark) { + editor.selection.moveToBookmark(t.bookmark); + t.bookmark = 0; + } + }); + + menu.onShowMenu.add(function() { + var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList; + + if (list || format) { + fmtList = t[name]; + + // Unselect existing items + each(menu.items, function(item) { + var state = true; + + item.setSelected(0); + + if (list && !item.isDisabled()) { + each(fmtList, function(fmt) { + if (fmt.id == item.id) { + if (!hasFormat(list, fmt)) { + state = false; + return false; + } + } + }); + + if (state) + item.setSelected(1); + } + }); + + // Select the current format + if (!list) + menu.items[format.id].setSelected(1); + } + + editor.focus(); + + // IE looses it's selection so store it away and restore it later + if (tinymce.isIE) { + t.bookmark = editor.selection.getBookmark(1); + } + }); + + menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1); + + each(t[name], function(item) { + // IE<8 doesn't support lower-greek, skip it + if (t.isIE7 && item.styles.listStyleType == 'lower-greek') + return; + + item.id = editor.dom.uniqueId(); + + menu.add({id : item.id, title : item.title, onclick : function() { + format = item; + applyListFormat(); + }}); + }); + }); + + return btn; + } + }, + + getInfo : function() { + return { + longname : 'Advanced lists', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/autolink/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/autolink/editor_plugin_src.js index 663314a..d1e8c48 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/autolink/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/autolink/editor_plugin_src.js @@ -1,184 +1,184 @@ -/** - * editor_plugin_src.js - * - * Copyright 2011, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AutolinkPlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - - init : function(ed, url) { - var t = this; - - // Add a key down handler - ed.onKeyDown.addToTop(function(ed, e) { - if (e.keyCode == 13) - return t.handleEnter(ed); - }); - - // Internet Explorer has built-in automatic linking for most cases - if (tinyMCE.isIE) - return; - - ed.onKeyPress.add(function(ed, e) { - if (e.which == 41) - return t.handleEclipse(ed); - }); - - // Add a key up handler - ed.onKeyUp.add(function(ed, e) { - if (e.keyCode == 32) - return t.handleSpacebar(ed); - }); - }, - - handleEclipse : function(ed) { - this.parseCurrentLine(ed, -1, '(', true); - }, - - handleSpacebar : function(ed) { - this.parseCurrentLine(ed, 0, '', true); - }, - - handleEnter : function(ed) { - this.parseCurrentLine(ed, -1, '', false); - }, - - parseCurrentLine : function(ed, end_offset, delimiter, goback) { - var r, end, start, endContainer, bookmark, text, matches, prev, len; - - // We need at least five characters to form a URL, - // hence, at minimum, five characters from the beginning of the line. - r = ed.selection.getRng(true).cloneRange(); - if (r.startOffset < 5) { - // During testing, the caret is placed inbetween two text nodes. - // The previous text node contains the URL. - prev = r.endContainer.previousSibling; - if (prev == null) { - if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null) - return; - - prev = r.endContainer.firstChild.nextSibling; - } - len = prev.length; - r.setStart(prev, len); - r.setEnd(prev, len); - - if (r.endOffset < 5) - return; - - end = r.endOffset; - endContainer = prev; - } else { - endContainer = r.endContainer; - - // Get a text node - if (endContainer.nodeType != 3 && endContainer.firstChild) { - while (endContainer.nodeType != 3 && endContainer.firstChild) - endContainer = endContainer.firstChild; - - // Move range to text node - if (endContainer.nodeType == 3) { - r.setStart(endContainer, 0); - r.setEnd(endContainer, endContainer.nodeValue.length); - } - } - - if (r.endOffset == 1) - end = 2; - else - end = r.endOffset - 1 - end_offset; - } - - start = end; - - do - { - // Move the selection one character backwards. - r.setStart(endContainer, end - 2); - r.setEnd(endContainer, end - 1); - end -= 1; - - // Loop until one of the following is found: a blank space,  , delimeter, (end-2) >= 0 - } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter); - - if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) { - r.setStart(endContainer, end); - r.setEnd(endContainer, start); - end += 1; - } else if (r.startOffset == 0) { - r.setStart(endContainer, 0); - r.setEnd(endContainer, start); - } - else { - r.setStart(endContainer, end); - r.setEnd(endContainer, start); - } - - // Exclude last . from word like "www.site.com." - var text = r.toString(); - if (text.charAt(text.length - 1) == '.') { - r.setEnd(endContainer, start - 1); - } - - text = r.toString(); - matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i); - - if (matches) { - if (matches[1] == 'www.') { - matches[1] = 'http://www.'; - } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { - matches[1] = 'mailto:' + matches[1]; - } - - bookmark = ed.selection.getBookmark(); - - ed.selection.setRng(r); - tinyMCE.execCommand('createlink',false, matches[1] + matches[2]); - ed.selection.moveToBookmark(bookmark); - ed.nodeChanged(); - - // TODO: Determine if this is still needed. - if (tinyMCE.isWebKit) { - // move the caret to its original position - ed.selection.collapse(false); - var max = Math.min(endContainer.length, start + 1); - r.setStart(endContainer, max); - r.setEnd(endContainer, max); - ed.selection.setRng(r); - } - } - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Autolink', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2011, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AutolinkPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + + init : function(ed, url) { + var t = this; + + // Add a key down handler + ed.onKeyDown.addToTop(function(ed, e) { + if (e.keyCode == 13) + return t.handleEnter(ed); + }); + + // Internet Explorer has built-in automatic linking for most cases + if (tinyMCE.isIE) + return; + + ed.onKeyPress.add(function(ed, e) { + if (e.which == 41) + return t.handleEclipse(ed); + }); + + // Add a key up handler + ed.onKeyUp.add(function(ed, e) { + if (e.keyCode == 32) + return t.handleSpacebar(ed); + }); + }, + + handleEclipse : function(ed) { + this.parseCurrentLine(ed, -1, '(', true); + }, + + handleSpacebar : function(ed) { + this.parseCurrentLine(ed, 0, '', true); + }, + + handleEnter : function(ed) { + this.parseCurrentLine(ed, -1, '', false); + }, + + parseCurrentLine : function(ed, end_offset, delimiter, goback) { + var r, end, start, endContainer, bookmark, text, matches, prev, len; + + // We need at least five characters to form a URL, + // hence, at minimum, five characters from the beginning of the line. + r = ed.selection.getRng(true).cloneRange(); + if (r.startOffset < 5) { + // During testing, the caret is placed inbetween two text nodes. + // The previous text node contains the URL. + prev = r.endContainer.previousSibling; + if (prev == null) { + if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null) + return; + + prev = r.endContainer.firstChild.nextSibling; + } + len = prev.length; + r.setStart(prev, len); + r.setEnd(prev, len); + + if (r.endOffset < 5) + return; + + end = r.endOffset; + endContainer = prev; + } else { + endContainer = r.endContainer; + + // Get a text node + if (endContainer.nodeType != 3 && endContainer.firstChild) { + while (endContainer.nodeType != 3 && endContainer.firstChild) + endContainer = endContainer.firstChild; + + // Move range to text node + if (endContainer.nodeType == 3) { + r.setStart(endContainer, 0); + r.setEnd(endContainer, endContainer.nodeValue.length); + } + } + + if (r.endOffset == 1) + end = 2; + else + end = r.endOffset - 1 - end_offset; + } + + start = end; + + do + { + // Move the selection one character backwards. + r.setStart(endContainer, end - 2); + r.setEnd(endContainer, end - 1); + end -= 1; + + // Loop until one of the following is found: a blank space,  , delimeter, (end-2) >= 0 + } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter); + + if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) { + r.setStart(endContainer, end); + r.setEnd(endContainer, start); + end += 1; + } else if (r.startOffset == 0) { + r.setStart(endContainer, 0); + r.setEnd(endContainer, start); + } + else { + r.setStart(endContainer, end); + r.setEnd(endContainer, start); + } + + // Exclude last . from word like "www.site.com." + var text = r.toString(); + if (text.charAt(text.length - 1) == '.') { + r.setEnd(endContainer, start - 1); + } + + text = r.toString(); + matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i); + + if (matches) { + if (matches[1] == 'www.') { + matches[1] = 'http://www.'; + } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { + matches[1] = 'mailto:' + matches[1]; + } + + bookmark = ed.selection.getBookmark(); + + ed.selection.setRng(r); + tinyMCE.execCommand('createlink',false, matches[1] + matches[2]); + ed.selection.moveToBookmark(bookmark); + ed.nodeChanged(); + + // TODO: Determine if this is still needed. + if (tinyMCE.isWebKit) { + // move the caret to its original position + ed.selection.collapse(false); + var max = Math.min(endContainer.length, start + 1); + r.setStart(endContainer, max); + r.setEnd(endContainer, max); + ed.selection.setRng(r); + } + } + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Autolink', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/autoresize/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/autoresize/editor_plugin_src.js index 998c147..a997366 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/autoresize/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/autoresize/editor_plugin_src.js @@ -1,119 +1,119 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - /** - * Auto Resize - * - * This plugin automatically resizes the content area to fit its content height. - * It will retain a minimum height, which is the height of the content area when - * it's initialized. - */ - tinymce.create('tinymce.plugins.AutoResizePlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - var t = this, oldSize = 0; - - if (ed.getParam('fullscreen_is_enabled')) - return; - - /** - * This method gets executed each time the editor needs to resize. - */ - function resize() { - var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; - - // Get height differently depending on the browser used - myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight); - - // Don't make it smaller than the minimum height - if (myHeight > t.autoresize_min_height) - resizeHeight = myHeight; - - // If a maximum height has been defined don't exceed this height - if (t.autoresize_max_height && myHeight > t.autoresize_max_height) { - resizeHeight = t.autoresize_max_height; - body.style.overflowY = "auto"; - de.style.overflowY = "auto"; // Old IE - } else { - body.style.overflowY = "hidden"; - de.style.overflowY = "hidden"; // Old IE - body.scrollTop = 0; - } - - // Resize content element - if (resizeHeight !== oldSize) { - deltaSize = resizeHeight - oldSize; - DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); - oldSize = resizeHeight; - - // WebKit doesn't decrease the size of the body element until the iframe gets resized - // So we need to continue to resize the iframe down until the size gets fixed - if (tinymce.isWebKit && deltaSize < 0) - resize(); - } - }; - - t.editor = ed; - - // Define minimum height - t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight)); - - // Define maximum height - t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0)); - - // Add padding at the bottom for better UX - ed.onInit.add(function(ed){ - ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px'); - }); - - // Add appropriate listeners for resizing content area - ed.onChange.add(resize); - ed.onSetContent.add(resize); - ed.onPaste.add(resize); - ed.onKeyUp.add(resize); - ed.onPostRender.add(resize); - - if (ed.getParam('autoresize_on_init', true)) { - ed.onLoad.add(resize); - ed.onLoadContent.add(resize); - } - - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - ed.addCommand('mceAutoResize', resize); - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Auto Resize', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + /** + * Auto Resize + * + * This plugin automatically resizes the content area to fit its content height. + * It will retain a minimum height, which is the height of the content area when + * it's initialized. + */ + tinymce.create('tinymce.plugins.AutoResizePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + var t = this, oldSize = 0; + + if (ed.getParam('fullscreen_is_enabled')) + return; + + /** + * This method gets executed each time the editor needs to resize. + */ + function resize() { + var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; + + // Get height differently depending on the browser used + myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight); + + // Don't make it smaller than the minimum height + if (myHeight > t.autoresize_min_height) + resizeHeight = myHeight; + + // If a maximum height has been defined don't exceed this height + if (t.autoresize_max_height && myHeight > t.autoresize_max_height) { + resizeHeight = t.autoresize_max_height; + body.style.overflowY = "auto"; + de.style.overflowY = "auto"; // Old IE + } else { + body.style.overflowY = "hidden"; + de.style.overflowY = "hidden"; // Old IE + body.scrollTop = 0; + } + + // Resize content element + if (resizeHeight !== oldSize) { + deltaSize = resizeHeight - oldSize; + DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); + oldSize = resizeHeight; + + // WebKit doesn't decrease the size of the body element until the iframe gets resized + // So we need to continue to resize the iframe down until the size gets fixed + if (tinymce.isWebKit && deltaSize < 0) + resize(); + } + }; + + t.editor = ed; + + // Define minimum height + t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight)); + + // Define maximum height + t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0)); + + // Add padding at the bottom for better UX + ed.onInit.add(function(ed){ + ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px'); + }); + + // Add appropriate listeners for resizing content area + ed.onChange.add(resize); + ed.onSetContent.add(resize); + ed.onPaste.add(resize); + ed.onKeyUp.add(resize); + ed.onPostRender.add(resize); + + if (ed.getParam('autoresize_on_init', true)) { + ed.onLoad.add(resize); + ed.onLoadContent.add(resize); + } + + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceAutoResize', resize); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Auto Resize', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/autosave/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/autosave/editor_plugin_src.js index 8b308f5..663f68f 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/autosave/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/autosave/editor_plugin_src.js @@ -1,433 +1,433 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - * - * Adds auto-save capability to the TinyMCE text editor to rescue content - * inadvertently lost. This plugin was originally developed by Speednet - * and that project can be found here: http://code.google.com/p/tinyautosave/ - * - * TECHNOLOGY DISCUSSION: - * - * The plugin attempts to use the most advanced features available in the current browser to save - * as much content as possible. There are a total of four different methods used to autosave the - * content. In order of preference, they are: - * - * 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain - * on the client computer. Data stored in the localStorage area has no expiration date, so we must - * manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed - * to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers. As - * HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7, - * localStorage is stored in the following folder: - * C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder] - * - * 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage, - * except it is designed to expire after a certain amount of time. Because the specification - * around expiration date/time is very loosely-described, it is preferrable to use locaStorage and - * manage the expiration ourselves. sessionStorage has similar storage characteristics to - * localStorage, although it seems to have better support by Firefox 3 at the moment. (That will - * certainly change as Firefox continues getting better at HTML 5 adoption.) - * - * 3. UserData - A very under-exploited feature of Microsoft Internet Explorer, UserData is a - * way to store up to 128K of data per "document", or up to 1MB of data per domain, on the client - * computer. The feature is available for IE 5+, which makes it available for every version of IE - * supported by TinyMCE. The content is persistent across browser restarts and expires on the - * date/time specified, just like a cookie. However, the data is not cleared when the user clears - * cookies on the browser, which makes it well-suited for rescuing autosaved content. UserData, - * like other Microsoft IE browser technologies, is implemented as a behavior attached to a - * specific DOM object, so in this case we attach the behavior to the same DOM element that the - * TinyMCE editor instance is attached to. - */ - -(function(tinymce) { - // Setup constants to help the compressor to reduce script size - var PLUGIN_NAME = 'autosave', - RESTORE_DRAFT = 'restoredraft', - TRUE = true, - undefined, - unloadHandlerAdded, - Dispatcher = tinymce.util.Dispatcher; - - /** - * This plugin adds auto-save capability to the TinyMCE text editor to rescue content - * inadvertently lost. By using localStorage. - * - * @class tinymce.plugins.AutoSave - */ - tinymce.create('tinymce.plugins.AutoSave', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @method init - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - var self = this, settings = ed.settings; - - self.editor = ed; - - // Parses the specified time string into a milisecond number 10m, 10s etc. - function parseTime(time) { - var multipels = { - s : 1000, - m : 60000 - }; - - time = /^(\d+)([ms]?)$/.exec('' + time); - - return (time[2] ? multipels[time[2]] : 1) * parseInt(time); - }; - - // Default config - tinymce.each({ - ask_before_unload : TRUE, - interval : '30s', - retention : '20m', - minlength : 50 - }, function(value, key) { - key = PLUGIN_NAME + '_' + key; - - if (settings[key] === undefined) - settings[key] = value; - }); - - // Parse times - settings.autosave_interval = parseTime(settings.autosave_interval); - settings.autosave_retention = parseTime(settings.autosave_retention); - - // Register restore button - ed.addButton(RESTORE_DRAFT, { - title : PLUGIN_NAME + ".restore_content", - onclick : function() { - if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|]*>/gi, "").length > 0) { - // Show confirm dialog if the editor isn't empty - ed.windowManager.confirm( - PLUGIN_NAME + ".warning_message", - function(ok) { - if (ok) - self.restoreDraft(); - } - ); - } else - self.restoreDraft(); - } - }); - - // Enable/disable restoredraft button depending on if there is a draft stored or not - ed.onNodeChange.add(function() { - var controlManager = ed.controlManager; - - if (controlManager.get(RESTORE_DRAFT)) - controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft()); - }); - - ed.onInit.add(function() { - // Check if the user added the restore button, then setup auto storage logic - if (ed.controlManager.get(RESTORE_DRAFT)) { - // Setup storage engine - self.setupStorage(ed); - - // Auto save contents each interval time - setInterval(function() { - if (!ed.removed) { - self.storeDraft(); - ed.nodeChanged(); - } - }, settings.autosave_interval); - } - }); - - /** - * This event gets fired when a draft is stored to local storage. - * - * @event onStoreDraft - * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. - * @param {Object} draft Draft object containing the HTML contents of the editor. - */ - self.onStoreDraft = new Dispatcher(self); - - /** - * This event gets fired when a draft is restored from local storage. - * - * @event onStoreDraft - * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. - * @param {Object} draft Draft object containing the HTML contents of the editor. - */ - self.onRestoreDraft = new Dispatcher(self); - - /** - * This event gets fired when a draft removed/expired. - * - * @event onRemoveDraft - * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. - * @param {Object} draft Draft object containing the HTML contents of the editor. - */ - self.onRemoveDraft = new Dispatcher(self); - - // Add ask before unload dialog only add one unload handler - if (!unloadHandlerAdded) { - window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler; - unloadHandlerAdded = TRUE; - } - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @method getInfo - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Auto save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - /** - * Returns an expiration date UTC string. - * - * @method getExpDate - * @return {String} Expiration date UTC string. - */ - getExpDate : function() { - return new Date( - new Date().getTime() + this.editor.settings.autosave_retention - ).toUTCString(); - }, - - /** - * This method will setup the storage engine. If the browser has support for it. - * - * @method setupStorage - */ - setupStorage : function(ed) { - var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK"; - - self.key = PLUGIN_NAME + ed.id; - - // Loop though each storage engine type until we find one that works - tinymce.each([ - function() { - // Try HTML5 Local Storage - if (localStorage) { - localStorage.setItem(testKey, testVal); - - if (localStorage.getItem(testKey) === testVal) { - localStorage.removeItem(testKey); - - return localStorage; - } - } - }, - - function() { - // Try HTML5 Session Storage - if (sessionStorage) { - sessionStorage.setItem(testKey, testVal); - - if (sessionStorage.getItem(testKey) === testVal) { - sessionStorage.removeItem(testKey); - - return sessionStorage; - } - } - }, - - function() { - // Try IE userData - if (tinymce.isIE) { - ed.getElement().style.behavior = "url('#default#userData')"; - - // Fake localStorage on old IE - return { - autoExpires : TRUE, - - setItem : function(key, value) { - var userDataElement = ed.getElement(); - - userDataElement.setAttribute(key, value); - userDataElement.expires = self.getExpDate(); - - try { - userDataElement.save("TinyMCE"); - } catch (e) { - // Ignore, saving might fail if "Userdata Persistence" is disabled in IE - } - }, - - getItem : function(key) { - var userDataElement = ed.getElement(); - - try { - userDataElement.load("TinyMCE"); - return userDataElement.getAttribute(key); - } catch (e) { - // Ignore, loading might fail if "Userdata Persistence" is disabled in IE - return null; - } - }, - - removeItem : function(key) { - ed.getElement().removeAttribute(key); - } - }; - } - }, - ], function(setup) { - // Try executing each function to find a suitable storage engine - try { - self.storage = setup(); - - if (self.storage) - return false; - } catch (e) { - // Ignore - } - }); - }, - - /** - * This method will store the current contents in the the storage engine. - * - * @method storeDraft - */ - storeDraft : function() { - var self = this, storage = self.storage, editor = self.editor, expires, content; - - // Is the contents dirty - if (storage) { - // If there is no existing key and the contents hasn't been changed since - // it's original value then there is no point in saving a draft - if (!storage.getItem(self.key) && !editor.isDirty()) - return; - - // Store contents if the contents if longer than the minlength of characters - content = editor.getContent({draft: true}); - if (content.length > editor.settings.autosave_minlength) { - expires = self.getExpDate(); - - // Store expiration date if needed IE userData has auto expire built in - if (!self.storage.autoExpires) - self.storage.setItem(self.key + "_expires", expires); - - self.storage.setItem(self.key, content); - self.onStoreDraft.dispatch(self, { - expires : expires, - content : content - }); - } - } - }, - - /** - * This method will restore the contents from the storage engine back to the editor. - * - * @method restoreDraft - */ - restoreDraft : function() { - var self = this, storage = self.storage, content; - - if (storage) { - content = storage.getItem(self.key); - - if (content) { - self.editor.setContent(content); - self.onRestoreDraft.dispatch(self, { - content : content - }); - } - } - }, - - /** - * This method will return true/false if there is a local storage draft available. - * - * @method hasDraft - * @return {boolean} true/false state if there is a local draft. - */ - hasDraft : function() { - var self = this, storage = self.storage, expDate, exists; - - if (storage) { - // Does the item exist at all - exists = !!storage.getItem(self.key); - if (exists) { - // Storage needs autoexpire - if (!self.storage.autoExpires) { - expDate = new Date(storage.getItem(self.key + "_expires")); - - // Contents hasn't expired - if (new Date().getTime() < expDate.getTime()) - return TRUE; - - // Remove it if it has - self.removeDraft(); - } else - return TRUE; - } - } - - return false; - }, - - /** - * Removes the currently stored draft. - * - * @method removeDraft - */ - removeDraft : function() { - var self = this, storage = self.storage, key = self.key, content; - - if (storage) { - // Get current contents and remove the existing draft - content = storage.getItem(key); - storage.removeItem(key); - storage.removeItem(key + "_expires"); - - // Dispatch remove event if we had any contents - if (content) { - self.onRemoveDraft.dispatch(self, { - content : content - }); - } - } - }, - - "static" : { - // Internal unload handler will be called before the page is unloaded - _beforeUnloadHandler : function(e) { - var msg; - - tinymce.each(tinyMCE.editors, function(ed) { - // Store a draft for each editor instance - if (ed.plugins.autosave) - ed.plugins.autosave.storeDraft(); - - // Never ask in fullscreen mode - if (ed.getParam("fullscreen_is_enabled")) - return; - - // Setup a return message if the editor is dirty - if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload")) - msg = ed.getLang("autosave.unload_msg"); - }); - - return msg; - } - } - }); - - tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave); -})(tinymce); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + * + * Adds auto-save capability to the TinyMCE text editor to rescue content + * inadvertently lost. This plugin was originally developed by Speednet + * and that project can be found here: http://code.google.com/p/tinyautosave/ + * + * TECHNOLOGY DISCUSSION: + * + * The plugin attempts to use the most advanced features available in the current browser to save + * as much content as possible. There are a total of four different methods used to autosave the + * content. In order of preference, they are: + * + * 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain + * on the client computer. Data stored in the localStorage area has no expiration date, so we must + * manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed + * to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers. As + * HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7, + * localStorage is stored in the following folder: + * C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder] + * + * 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage, + * except it is designed to expire after a certain amount of time. Because the specification + * around expiration date/time is very loosely-described, it is preferrable to use locaStorage and + * manage the expiration ourselves. sessionStorage has similar storage characteristics to + * localStorage, although it seems to have better support by Firefox 3 at the moment. (That will + * certainly change as Firefox continues getting better at HTML 5 adoption.) + * + * 3. UserData - A very under-exploited feature of Microsoft Internet Explorer, UserData is a + * way to store up to 128K of data per "document", or up to 1MB of data per domain, on the client + * computer. The feature is available for IE 5+, which makes it available for every version of IE + * supported by TinyMCE. The content is persistent across browser restarts and expires on the + * date/time specified, just like a cookie. However, the data is not cleared when the user clears + * cookies on the browser, which makes it well-suited for rescuing autosaved content. UserData, + * like other Microsoft IE browser technologies, is implemented as a behavior attached to a + * specific DOM object, so in this case we attach the behavior to the same DOM element that the + * TinyMCE editor instance is attached to. + */ + +(function(tinymce) { + // Setup constants to help the compressor to reduce script size + var PLUGIN_NAME = 'autosave', + RESTORE_DRAFT = 'restoredraft', + TRUE = true, + undefined, + unloadHandlerAdded, + Dispatcher = tinymce.util.Dispatcher; + + /** + * This plugin adds auto-save capability to the TinyMCE text editor to rescue content + * inadvertently lost. By using localStorage. + * + * @class tinymce.plugins.AutoSave + */ + tinymce.create('tinymce.plugins.AutoSave', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @method init + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + var self = this, settings = ed.settings; + + self.editor = ed; + + // Parses the specified time string into a milisecond number 10m, 10s etc. + function parseTime(time) { + var multipels = { + s : 1000, + m : 60000 + }; + + time = /^(\d+)([ms]?)$/.exec('' + time); + + return (time[2] ? multipels[time[2]] : 1) * parseInt(time); + }; + + // Default config + tinymce.each({ + ask_before_unload : TRUE, + interval : '30s', + retention : '20m', + minlength : 50 + }, function(value, key) { + key = PLUGIN_NAME + '_' + key; + + if (settings[key] === undefined) + settings[key] = value; + }); + + // Parse times + settings.autosave_interval = parseTime(settings.autosave_interval); + settings.autosave_retention = parseTime(settings.autosave_retention); + + // Register restore button + ed.addButton(RESTORE_DRAFT, { + title : PLUGIN_NAME + ".restore_content", + onclick : function() { + if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|]*>/gi, "").length > 0) { + // Show confirm dialog if the editor isn't empty + ed.windowManager.confirm( + PLUGIN_NAME + ".warning_message", + function(ok) { + if (ok) + self.restoreDraft(); + } + ); + } else + self.restoreDraft(); + } + }); + + // Enable/disable restoredraft button depending on if there is a draft stored or not + ed.onNodeChange.add(function() { + var controlManager = ed.controlManager; + + if (controlManager.get(RESTORE_DRAFT)) + controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft()); + }); + + ed.onInit.add(function() { + // Check if the user added the restore button, then setup auto storage logic + if (ed.controlManager.get(RESTORE_DRAFT)) { + // Setup storage engine + self.setupStorage(ed); + + // Auto save contents each interval time + setInterval(function() { + if (!ed.removed) { + self.storeDraft(); + ed.nodeChanged(); + } + }, settings.autosave_interval); + } + }); + + /** + * This event gets fired when a draft is stored to local storage. + * + * @event onStoreDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onStoreDraft = new Dispatcher(self); + + /** + * This event gets fired when a draft is restored from local storage. + * + * @event onStoreDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onRestoreDraft = new Dispatcher(self); + + /** + * This event gets fired when a draft removed/expired. + * + * @event onRemoveDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onRemoveDraft = new Dispatcher(self); + + // Add ask before unload dialog only add one unload handler + if (!unloadHandlerAdded) { + window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler; + unloadHandlerAdded = TRUE; + } + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Auto save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + /** + * Returns an expiration date UTC string. + * + * @method getExpDate + * @return {String} Expiration date UTC string. + */ + getExpDate : function() { + return new Date( + new Date().getTime() + this.editor.settings.autosave_retention + ).toUTCString(); + }, + + /** + * This method will setup the storage engine. If the browser has support for it. + * + * @method setupStorage + */ + setupStorage : function(ed) { + var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK"; + + self.key = PLUGIN_NAME + ed.id; + + // Loop though each storage engine type until we find one that works + tinymce.each([ + function() { + // Try HTML5 Local Storage + if (localStorage) { + localStorage.setItem(testKey, testVal); + + if (localStorage.getItem(testKey) === testVal) { + localStorage.removeItem(testKey); + + return localStorage; + } + } + }, + + function() { + // Try HTML5 Session Storage + if (sessionStorage) { + sessionStorage.setItem(testKey, testVal); + + if (sessionStorage.getItem(testKey) === testVal) { + sessionStorage.removeItem(testKey); + + return sessionStorage; + } + } + }, + + function() { + // Try IE userData + if (tinymce.isIE) { + ed.getElement().style.behavior = "url('#default#userData')"; + + // Fake localStorage on old IE + return { + autoExpires : TRUE, + + setItem : function(key, value) { + var userDataElement = ed.getElement(); + + userDataElement.setAttribute(key, value); + userDataElement.expires = self.getExpDate(); + + try { + userDataElement.save("TinyMCE"); + } catch (e) { + // Ignore, saving might fail if "Userdata Persistence" is disabled in IE + } + }, + + getItem : function(key) { + var userDataElement = ed.getElement(); + + try { + userDataElement.load("TinyMCE"); + return userDataElement.getAttribute(key); + } catch (e) { + // Ignore, loading might fail if "Userdata Persistence" is disabled in IE + return null; + } + }, + + removeItem : function(key) { + ed.getElement().removeAttribute(key); + } + }; + } + }, + ], function(setup) { + // Try executing each function to find a suitable storage engine + try { + self.storage = setup(); + + if (self.storage) + return false; + } catch (e) { + // Ignore + } + }); + }, + + /** + * This method will store the current contents in the the storage engine. + * + * @method storeDraft + */ + storeDraft : function() { + var self = this, storage = self.storage, editor = self.editor, expires, content; + + // Is the contents dirty + if (storage) { + // If there is no existing key and the contents hasn't been changed since + // it's original value then there is no point in saving a draft + if (!storage.getItem(self.key) && !editor.isDirty()) + return; + + // Store contents if the contents if longer than the minlength of characters + content = editor.getContent({draft: true}); + if (content.length > editor.settings.autosave_minlength) { + expires = self.getExpDate(); + + // Store expiration date if needed IE userData has auto expire built in + if (!self.storage.autoExpires) + self.storage.setItem(self.key + "_expires", expires); + + self.storage.setItem(self.key, content); + self.onStoreDraft.dispatch(self, { + expires : expires, + content : content + }); + } + } + }, + + /** + * This method will restore the contents from the storage engine back to the editor. + * + * @method restoreDraft + */ + restoreDraft : function() { + var self = this, storage = self.storage, content; + + if (storage) { + content = storage.getItem(self.key); + + if (content) { + self.editor.setContent(content); + self.onRestoreDraft.dispatch(self, { + content : content + }); + } + } + }, + + /** + * This method will return true/false if there is a local storage draft available. + * + * @method hasDraft + * @return {boolean} true/false state if there is a local draft. + */ + hasDraft : function() { + var self = this, storage = self.storage, expDate, exists; + + if (storage) { + // Does the item exist at all + exists = !!storage.getItem(self.key); + if (exists) { + // Storage needs autoexpire + if (!self.storage.autoExpires) { + expDate = new Date(storage.getItem(self.key + "_expires")); + + // Contents hasn't expired + if (new Date().getTime() < expDate.getTime()) + return TRUE; + + // Remove it if it has + self.removeDraft(); + } else + return TRUE; + } + } + + return false; + }, + + /** + * Removes the currently stored draft. + * + * @method removeDraft + */ + removeDraft : function() { + var self = this, storage = self.storage, key = self.key, content; + + if (storage) { + // Get current contents and remove the existing draft + content = storage.getItem(key); + storage.removeItem(key); + storage.removeItem(key + "_expires"); + + // Dispatch remove event if we had any contents + if (content) { + self.onRemoveDraft.dispatch(self, { + content : content + }); + } + } + }, + + "static" : { + // Internal unload handler will be called before the page is unloaded + _beforeUnloadHandler : function(e) { + var msg; + + tinymce.each(tinyMCE.editors, function(ed) { + // Store a draft for each editor instance + if (ed.plugins.autosave) + ed.plugins.autosave.storeDraft(); + + // Never ask in fullscreen mode + if (ed.getParam("fullscreen_is_enabled")) + return; + + // Setup a return message if the editor is dirty + if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload")) + msg = ed.getLang("autosave.unload_msg"); + }); + + return msg; + } + } + }); + + tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave); +})(tinymce); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/autosave/langs/en.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/autosave/langs/en.js index fce6bd3..219f769 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/autosave/langs/en.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/autosave/langs/en.js @@ -1,4 +1,4 @@ -tinyMCE.addI18n('en.autosave',{ -restore_content: "Restore auto-saved content", -warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" +tinyMCE.addI18n('en.autosave',{ +restore_content: "Restore auto-saved content", +warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" }); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/bbcode/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/bbcode/editor_plugin_src.js index 4e7eb33..2d22dd0 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -1,120 +1,120 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.BBCodePlugin', { - init : function(ed, url) { - var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = t['_' + dialect + '_bbcode2html'](o.content); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.set) - o.content = t['_' + dialect + '_bbcode2html'](o.content); - - if (o.get) - o.content = t['_' + dialect + '_html2bbcode'](o.content); - }); - }, - - getInfo : function() { - return { - longname : 'BBCode Plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - // HTML -> BBCode in PunBB dialect - _punbb_html2bbcode : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - }; - - // example: to [b] - rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); - rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); - rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); - rep(/(.*?)<\/font>/gi,"$1"); - rep(//gi,"[img]$1[/img]"); - rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); - rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); - rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); - rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); - rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); - rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); - rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); - rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); - rep(/<\/(strong|b)>/gi,"[/b]"); - rep(/<(strong|b)>/gi,"[b]"); - rep(/<\/(em|i)>/gi,"[/i]"); - rep(/<(em|i)>/gi,"[i]"); - rep(/<\/u>/gi,"[/u]"); - rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); - rep(//gi,"[u]"); - rep(/]*>/gi,"[quote]"); - rep(/<\/blockquote>/gi,"[/quote]"); - rep(/
      /gi,"\n"); - rep(//gi,"\n"); - rep(/
      /gi,"\n"); - rep(/

      /gi,""); - rep(/<\/p>/gi,"\n"); - rep(/ |\u00a0/gi," "); - rep(/"/gi,"\""); - rep(/</gi,"<"); - rep(/>/gi,">"); - rep(/&/gi,"&"); - - return s; - }, - - // BBCode -> HTML from PunBB dialect - _punbb_bbcode2html : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - }; - - // example: [b] to - rep(/\n/gi,"
      "); - rep(/\[b\]/gi,""); - rep(/\[\/b\]/gi,""); - rep(/\[i\]/gi,""); - rep(/\[\/i\]/gi,""); - rep(/\[u\]/gi,""); - rep(/\[\/u\]/gi,""); - rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); - rep(/\[url\](.*?)\[\/url\]/gi,"$1"); - rep(/\[img\](.*?)\[\/img\]/gi,""); - rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); - rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); - rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); - - return s; - } - }); - - // Register plugin - tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.BBCodePlugin', { + init : function(ed, url) { + var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t['_' + dialect + '_bbcode2html'](o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t['_' + dialect + '_bbcode2html'](o.content); + + if (o.get) + o.content = t['_' + dialect + '_html2bbcode'](o.content); + }); + }, + + getInfo : function() { + return { + longname : 'BBCode Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + // HTML -> BBCode in PunBB dialect + _punbb_html2bbcode : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: to [b] + rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); + rep(/(.*?)<\/font>/gi,"$1"); + rep(//gi,"[img]$1[/img]"); + rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); + rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); + rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); + rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); + rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); + rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); + rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); + rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); + rep(/<\/(strong|b)>/gi,"[/b]"); + rep(/<(strong|b)>/gi,"[b]"); + rep(/<\/(em|i)>/gi,"[/i]"); + rep(/<(em|i)>/gi,"[i]"); + rep(/<\/u>/gi,"[/u]"); + rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); + rep(//gi,"[u]"); + rep(/]*>/gi,"[quote]"); + rep(/<\/blockquote>/gi,"[/quote]"); + rep(/
      /gi,"\n"); + rep(//gi,"\n"); + rep(/
      /gi,"\n"); + rep(/

      /gi,""); + rep(/<\/p>/gi,"\n"); + rep(/ |\u00a0/gi," "); + rep(/"/gi,"\""); + rep(/</gi,"<"); + rep(/>/gi,">"); + rep(/&/gi,"&"); + + return s; + }, + + // BBCode -> HTML from PunBB dialect + _punbb_bbcode2html : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: [b] to + rep(/\n/gi,"
      "); + rep(/\[b\]/gi,""); + rep(/\[\/b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[\/i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/u\]/gi,""); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); + rep(/\[url\](.*?)\[\/url\]/gi,"$1"); + rep(/\[img\](.*?)\[\/img\]/gi,""); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); + rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); + + return s; + } + }); + + // Register plugin + tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/contextmenu/editor_plugin_src.js index 48b0fff..8502140 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/contextmenu/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/contextmenu/editor_plugin_src.js @@ -1,163 +1,163 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; - - /** - * This plugin a context menu to TinyMCE editor instances. - * - * @class tinymce.plugins.ContextMenu - */ - tinymce.create('tinymce.plugins.ContextMenu', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @method init - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed) { - var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu; - - t.editor = ed; - - contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native; - - /** - * This event gets fired when the context menu is shown. - * - * @event onContextMenu - * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. - * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. - */ - t.onContextMenu = new tinymce.util.Dispatcher(this); - - hideMenu = function(e) { - hide(ed, e); - }; - - showMenu = ed.onContextMenu.add(function(ed, e) { - // Block TinyMCE menu on ctrlKey and work around Safari issue - if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative) - return; - - Event.cancel(e); - - // Select the image if it's clicked. WebKit would other wise expand the selection - if (e.target.nodeName == 'IMG') - ed.selection.select(e.target); - - t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY); - Event.add(ed.getDoc(), 'click', hideMenu); - - ed.nodeChanged(); - }); - - ed.onRemove.add(function() { - if (t._menu) - t._menu.removeAll(); - }); - - function hide(ed, e) { - realCtrlKey = 0; - - // Since the contextmenu event moves - // the selection we need to store it away - if (e && e.button == 2) { - realCtrlKey = e.ctrlKey; - return; - } - - if (t._menu) { - t._menu.removeAll(); - t._menu.destroy(); - Event.remove(ed.getDoc(), 'click', hideMenu); - t._menu = null; - } - }; - - ed.onMouseDown.add(hide); - ed.onKeyDown.add(hide); - ed.onKeyDown.add(function(ed, e) { - if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) { - Event.cancel(e); - showMenu(ed, e); - } - }); - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @method getInfo - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Contextmenu', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _getMenu : function(ed) { - var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p; - - if (m) { - m.removeAll(); - m.destroy(); - } - - p = DOM.getPos(ed.getContentAreaContainer()); - - m = ed.controlManager.createDropMenu('contextmenu', { - offset_x : p.x + ed.getParam('contextmenu_offset_x', 0), - offset_y : p.y + ed.getParam('contextmenu_offset_y', 0), - constrain : 1, - keyboard_focus: true - }); - - t._menu = m; - - m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); - m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); - m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); - - if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { - m.addSeparator(); - m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); - m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); - } - - m.addSeparator(); - m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); - - m.addSeparator(); - am = m.addMenu({title : 'contextmenu.align'}); - am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); - am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); - am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); - am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); - - t.onContextMenu.dispatch(t, m, el, col); - - return m; - } - }); - - // Register plugin - tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + /** + * This plugin a context menu to TinyMCE editor instances. + * + * @class tinymce.plugins.ContextMenu + */ + tinymce.create('tinymce.plugins.ContextMenu', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @method init + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed) { + var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu; + + t.editor = ed; + + contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native; + + /** + * This event gets fired when the context menu is shown. + * + * @event onContextMenu + * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. + * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. + */ + t.onContextMenu = new tinymce.util.Dispatcher(this); + + hideMenu = function(e) { + hide(ed, e); + }; + + showMenu = ed.onContextMenu.add(function(ed, e) { + // Block TinyMCE menu on ctrlKey and work around Safari issue + if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative) + return; + + Event.cancel(e); + + // Select the image if it's clicked. WebKit would other wise expand the selection + if (e.target.nodeName == 'IMG') + ed.selection.select(e.target); + + t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY); + Event.add(ed.getDoc(), 'click', hideMenu); + + ed.nodeChanged(); + }); + + ed.onRemove.add(function() { + if (t._menu) + t._menu.removeAll(); + }); + + function hide(ed, e) { + realCtrlKey = 0; + + // Since the contextmenu event moves + // the selection we need to store it away + if (e && e.button == 2) { + realCtrlKey = e.ctrlKey; + return; + } + + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hideMenu); + t._menu = null; + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + ed.onKeyDown.add(function(ed, e) { + if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) { + Event.cancel(e); + showMenu(ed, e); + } + }); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Contextmenu', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p = DOM.getPos(ed.getContentAreaContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1, + keyboard_focus: true + }); + + t._menu = m; + + m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); + m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); + m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); + + if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { + m.addSeparator(); + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + } + + m.addSeparator(); + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + + m.addSeparator(); + am = m.addMenu({title : 'contextmenu.align'}); + am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); + am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); + am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); + am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + } + }); + + // Register plugin + tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/directionality/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/directionality/editor_plugin_src.js index b134014..f5594bd 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/directionality/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/directionality/editor_plugin_src.js @@ -1,85 +1,85 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Directionality', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - function setDir(dir) { - var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks(); - - if (blocks.length) { - curDir = dom.getAttrib(blocks[0], "dir"); - - tinymce.each(blocks, function(block) { - // Add dir to block if the parent block doesn't already have that dir - if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) { - if (curDir != dir) { - dom.setAttrib(block, "dir", dir); - } else { - dom.setAttrib(block, "dir", null); - } - } - }); - - ed.nodeChanged(); - } - } - - ed.addCommand('mceDirectionLTR', function() { - setDir("ltr"); - }); - - ed.addCommand('mceDirectionRTL', function() { - setDir("rtl"); - }); - - ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); - ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); - - ed.onNodeChange.add(t._nodeChange, t); - }, - - getInfo : function() { - return { - longname : 'Directionality', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var dom = ed.dom, dir; - - n = dom.getParent(n, dom.isBlock); - if (!n) { - cm.setDisabled('ltr', 1); - cm.setDisabled('rtl', 1); - return; - } - - dir = dom.getAttrib(n, 'dir'); - cm.setActive('ltr', dir == "ltr"); - cm.setDisabled('ltr', 0); - cm.setActive('rtl', dir == "rtl"); - cm.setDisabled('rtl', 0); - } - }); - - // Register plugin - tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Directionality', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + function setDir(dir) { + var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks(); + + if (blocks.length) { + curDir = dom.getAttrib(blocks[0], "dir"); + + tinymce.each(blocks, function(block) { + // Add dir to block if the parent block doesn't already have that dir + if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) { + if (curDir != dir) { + dom.setAttrib(block, "dir", dir); + } else { + dom.setAttrib(block, "dir", null); + } + } + }); + + ed.nodeChanged(); + } + } + + ed.addCommand('mceDirectionLTR', function() { + setDir("ltr"); + }); + + ed.addCommand('mceDirectionRTL', function() { + setDir("rtl"); + }); + + ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); + ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); + + ed.onNodeChange.add(t._nodeChange, t); + }, + + getInfo : function() { + return { + longname : 'Directionality', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var dom = ed.dom, dir; + + n = dom.getParent(n, dom.isBlock); + if (!n) { + cm.setDisabled('ltr', 1); + cm.setDisabled('rtl', 1); + return; + } + + dir = dom.getAttrib(n, 'dir'); + cm.setActive('ltr', dir == "ltr"); + cm.setDisabled('ltr', 0); + cm.setActive('rtl', dir == "rtl"); + cm.setDisabled('rtl', 0); + } + }); + + // Register plugin + tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/editor_plugin_src.js index 71d5416..b14a69c 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/editor_plugin_src.js @@ -1,43 +1,43 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - tinymce.create('tinymce.plugins.EmotionsPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceEmotion', function() { - ed.windowManager.open({ - file : url + '/emotions.htm', - width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), - height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); - }, - - getInfo : function() { - return { - longname : 'Emotions', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + tinymce.create('tinymce.plugins.EmotionsPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceEmotion', function() { + ed.windowManager.open({ + file : url + '/emotions.htm', + width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), + height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); + }, + + getInfo : function() { + return { + longname : 'Emotions', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); })(tinymce); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/js/emotions.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/js/emotions.js index b360f20..12ef8ac 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/js/emotions.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/js/emotions.js @@ -1,43 +1,43 @@ -tinyMCEPopup.requireLangPack(); - -var EmotionsDialog = { - addKeyboardNavigation: function(){ - var tableElm, cells, settings; - - cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table"); - - settings ={ - root: "emoticon_table", - items: cells - }; - cells[0].tabindex=0; - tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); - if (tinymce.isGecko) { - cells[0].focus(); - } else { - setTimeout(function(){ - cells[0].focus(); - }, 100); - } - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); - }, - init : function(ed) { - tinyMCEPopup.resizeToInnerSize(); - this.addKeyboardNavigation(); - }, - - insert : function(file, title) { - var ed = tinyMCEPopup.editor, dom = ed.dom; - - tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { - src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, - alt : ed.getLang(title), - title : ed.getLang(title), - border : 0 - })); - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); +tinyMCEPopup.requireLangPack(); + +var EmotionsDialog = { + addKeyboardNavigation: function(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table"); + + settings ={ + root: "emoticon_table", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); + }, + init : function(ed) { + tinyMCEPopup.resizeToInnerSize(); + this.addKeyboardNavigation(); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { + src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, + alt : ed.getLang(title), + title : ed.getLang(title), + border : 0 + })); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/langs/en_dlg.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/langs/en_dlg.js index c765af6..037c4b5 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/langs/en_dlg.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/emotions/langs/en_dlg.js @@ -1 +1 @@ -tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"}); +tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"}); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/example/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/example/editor_plugin_src.js index 9a0e7da..39ddb4e 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/example/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/example/editor_plugin_src.js @@ -1,84 +1,84 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - // Load plugin specific language pack - tinymce.PluginManager.requireLangPack('example'); - - tinymce.create('tinymce.plugins.ExamplePlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - ed.addCommand('mceExample', function() { - ed.windowManager.open({ - file : url + '/dialog.htm', - width : 320 + parseInt(ed.getLang('example.delta_width', 0)), - height : 120 + parseInt(ed.getLang('example.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, // Plugin absolute URL - some_custom_arg : 'custom arg' // Custom argument - }); - }); - - // Register example button - ed.addButton('example', { - title : 'example.desc', - cmd : 'mceExample', - image : url + '/img/example.gif' - }); - - // Add a node change handler, selects the button in the UI when a image is selected - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('example', n.nodeName == 'IMG'); - }); - }, - - /** - * Creates control instances based in the incomming name. This method is normally not - * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons - * but you sometimes need to create more complex controls like listboxes, split buttons etc then this - * method can be used to create those. - * - * @param {String} n Name of the control to create. - * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. - * @return {tinymce.ui.Control} New control instance or null if no control was created. - */ - createControl : function(n, cm) { - return null; - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Example plugin', - author : 'Some author', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', - version : "1.0" - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('example'); + + tinymce.create('tinymce.plugins.ExamplePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceExample', function() { + ed.windowManager.open({ + file : url + '/dialog.htm', + width : 320 + parseInt(ed.getLang('example.delta_width', 0)), + height : 120 + parseInt(ed.getLang('example.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, // Plugin absolute URL + some_custom_arg : 'custom arg' // Custom argument + }); + }); + + // Register example button + ed.addButton('example', { + title : 'example.desc', + cmd : 'mceExample', + image : url + '/img/example.gif' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('example', n.nodeName == 'IMG'); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', + version : "1.0" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/example/js/dialog.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/example/js/dialog.js index fa83411..febc496 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/example/js/dialog.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/example/js/dialog.js @@ -1,19 +1,19 @@ -tinyMCEPopup.requireLangPack(); - -var ExampleDialog = { - init : function() { - var f = document.forms[0]; - - // Get the selected contents as text and place it in the input - f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); - f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); - }, - - insert : function() { - // Insert the contents from the input into the document - tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); +tinyMCEPopup.requireLangPack(); + +var ExampleDialog = { + init : function() { + var f = document.forms[0]; + + // Get the selected contents as text and place it in the input + f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); + f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); + }, + + insert : function() { + // Insert the contents from the input into the document + tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/example/langs/en.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/example/langs/en.js index e0784f8..3a9db64 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/example/langs/en.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/example/langs/en.js @@ -1,3 +1,3 @@ -tinyMCE.addI18n('en.example',{ - desc : 'This is just a template button' -}); +tinyMCE.addI18n('en.example',{ + desc : 'This is just a template button' +}); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/example/langs/en_dlg.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/example/langs/en_dlg.js index ebcf948..8a55777 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/example/langs/en_dlg.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/example/langs/en_dlg.js @@ -1,3 +1,3 @@ -tinyMCE.addI18n('en.example_dlg',{ - title : 'This is just a example title' -}); +tinyMCE.addI18n('en.example_dlg',{ + title : 'This is just a example title' +}); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/example_dependency/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/example_dependency/editor_plugin_src.js index f761441..1487049 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/example_dependency/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/example_dependency/editor_plugin_src.js @@ -1,50 +1,50 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - - tinymce.create('tinymce.plugins.ExampleDependencyPlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - }, - - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Example Dependency plugin', - author : 'Some author', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency', - version : "1.0" - }; - } - }); - - /** - * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order. - * plugins in this list will be initialised when this plugin is initialized. (before the init method is called). - * plugins in a depends list should typically be specified using the short name). If neccesary this can be done - * with an object which has the url to the plugin and the shortname. - */ - tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + + tinymce.create('tinymce.plugins.ExampleDependencyPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + }, + + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example Dependency plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency', + version : "1.0" + }; + } + }); + + /** + * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order. + * plugins in this list will be initialised when this plugin is initialized. (before the init method is called). + * plugins in a depends list should typically be specified using the short name). If neccesary this can be done + * with an object which has the url to the plugin and the shortname. + */ + tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/css/fullpage.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/css/fullpage.css index 2675cec..76845ae 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/css/fullpage.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/css/fullpage.css @@ -1,143 +1,143 @@ -/* Hide the advanced tab */ -#advanced_tab { - display: none; -} - -#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { - width: 280px; -} - -#doctype, #docencoding { - width: 200px; -} - -#langcode { - width: 30px; -} - -#bgimage { - width: 220px; -} - -#fontface { - width: 240px; -} - -#leftmargin, #rightmargin, #topmargin, #bottommargin { - width: 50px; -} - -.panel_wrapper div.current { - height: 400px; -} - -#stylesheet, #style { - width: 240px; -} - -#doctypes { - width: 200px; -} - -/* Head list classes */ - -.headlistwrapper { - width: 100%; -} - -.selected { - border: 1px solid #0A246A; - background-color: #B6BDD2; -} - -.toolbar { - width: 100%; -} - -#headlist { - width: 100%; - margin-top: 3px; - font-size: 11px; -} - -#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { - display: none; -} - -#addmenu { - position: absolute; - border: 1px solid gray; - display: none; - z-index: 100; - background-color: white; -} - -#addmenu a { - display: block; - width: 100%; - line-height: 20px; - text-decoration: none; - background-color: white; -} - -#addmenu a:hover { - background-color: #B6BDD2; - color: black; -} - -#addmenu span { - padding-left: 10px; - padding-right: 10px; -} - -#updateElementPanel { - display: none; -} - -#script_element .panel_wrapper div.current { - height: 108px; -} - -#style_element .panel_wrapper div.current { - height: 108px; -} - -#link_element .panel_wrapper div.current { - height: 140px; -} - -#element_script_value { - width: 100%; - height: 100px; -} - -#element_comment_value { - width: 100%; - height: 120px; -} - -#element_style_value { - width: 100%; - height: 100px; -} - -#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { - width: 250px; -} - -.updateElementButton { - margin-top: 3px; -} - -/* MSIE specific styles */ - -* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { - width: 22px; - height: 22px; -} - -textarea { - height: 55px; -} - +/* Hide the advanced tab */ +#advanced_tab { + display: none; +} + +#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { + width: 280px; +} + +#doctype, #docencoding { + width: 200px; +} + +#langcode { + width: 30px; +} + +#bgimage { + width: 220px; +} + +#fontface { + width: 240px; +} + +#leftmargin, #rightmargin, #topmargin, #bottommargin { + width: 50px; +} + +.panel_wrapper div.current { + height: 400px; +} + +#stylesheet, #style { + width: 240px; +} + +#doctypes { + width: 200px; +} + +/* Head list classes */ + +.headlistwrapper { + width: 100%; +} + +.selected { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.toolbar { + width: 100%; +} + +#headlist { + width: 100%; + margin-top: 3px; + font-size: 11px; +} + +#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { + display: none; +} + +#addmenu { + position: absolute; + border: 1px solid gray; + display: none; + z-index: 100; + background-color: white; +} + +#addmenu a { + display: block; + width: 100%; + line-height: 20px; + text-decoration: none; + background-color: white; +} + +#addmenu a:hover { + background-color: #B6BDD2; + color: black; +} + +#addmenu span { + padding-left: 10px; + padding-right: 10px; +} + +#updateElementPanel { + display: none; +} + +#script_element .panel_wrapper div.current { + height: 108px; +} + +#style_element .panel_wrapper div.current { + height: 108px; +} + +#link_element .panel_wrapper div.current { + height: 140px; +} + +#element_script_value { + width: 100%; + height: 100px; +} + +#element_comment_value { + width: 100%; + height: 120px; +} + +#element_style_value { + width: 100%; + height: 100px; +} + +#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { + width: 250px; +} + +.updateElementButton { + margin-top: 3px; +} + +/* MSIE specific styles */ + +* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { + width: 22px; + height: 22px; +} + +textarea { + height: 55px; +} + .panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/editor_plugin_src.js index 23de7c5..775b240 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/editor_plugin_src.js @@ -1,405 +1,405 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each, Node = tinymce.html.Node; - - tinymce.create('tinymce.plugins.FullPagePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceFullPageProperties', function() { - ed.windowManager.open({ - file : url + '/fullpage.htm', - width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), - height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - data : t._htmlToData() - }); - }); - - // Register buttons - ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); - - ed.onBeforeSetContent.add(t._setContent, t); - ed.onGetContent.add(t._getContent, t); - }, - - getInfo : function() { - return { - longname : 'Fullpage', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private plugin internal methods - - _htmlToData : function() { - var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor; - - function getAttr(elm, name) { - var value = elm.attr(name); - - return value || ''; - }; - - // Default some values - data.fontface = editor.getParam("fullpage_default_fontface", ""); - data.fontsize = editor.getParam("fullpage_default_fontsize", ""); - - // Parse XML PI - elm = headerFragment.firstChild; - if (elm.type == 7) { - data.xml_pi = true; - matches = /encoding="([^"]+)"/.exec(elm.value); - if (matches) - data.docencoding = matches[1]; - } - - // Parse doctype - elm = headerFragment.getAll('#doctype')[0]; - if (elm) - data.doctype = '"; - - // Parse title element - elm = headerFragment.getAll('title')[0]; - if (elm && elm.firstChild) { - data.metatitle = elm.firstChild.value; - } - - // Parse meta elements - each(headerFragment.getAll('meta'), function(meta) { - var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; - - if (name) - data['meta' + name.toLowerCase()] = meta.attr('content'); - else if (httpEquiv == "Content-Type") { - matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); - - if (matches) - data.docencoding = matches[1]; - } - }); - - // Parse html attribs - elm = headerFragment.getAll('html')[0]; - if (elm) - data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); - - // Parse stylesheet - elm = headerFragment.getAll('link')[0]; - if (elm && elm.attr('rel') == 'stylesheet') - data.stylesheet = elm.attr('href'); - - // Parse body parts - elm = headerFragment.getAll('body')[0]; - if (elm) { - data.langdir = getAttr(elm, 'dir'); - data.style = getAttr(elm, 'style'); - data.visited_color = getAttr(elm, 'vlink'); - data.link_color = getAttr(elm, 'link'); - data.active_color = getAttr(elm, 'alink'); - } - - return data; - }, - - _dataToHtml : function(data) { - var headerFragment, headElement, html, elm, value, dom = this.editor.dom; - - function setAttr(elm, name, value) { - elm.attr(name, value ? value : undefined); - }; - - function addHeadNode(node) { - if (headElement.firstChild) - headElement.insert(node, headElement.firstChild); - else - headElement.append(node); - }; - - headerFragment = this._parseHeader(); - headElement = headerFragment.getAll('head')[0]; - if (!headElement) { - elm = headerFragment.getAll('html')[0]; - headElement = new Node('head', 1); - - if (elm.firstChild) - elm.insert(headElement, elm.firstChild, true); - else - elm.append(headElement); - } - - // Add/update/remove XML-PI - elm = headerFragment.firstChild; - if (data.xml_pi) { - value = 'version="1.0"'; - - if (data.docencoding) - value += ' encoding="' + data.docencoding + '"'; - - if (elm.type != 7) { - elm = new Node('xml', 7); - headerFragment.insert(elm, headerFragment.firstChild, true); - } - - elm.value = value; - } else if (elm && elm.type == 7) - elm.remove(); - - // Add/update/remove doctype - elm = headerFragment.getAll('#doctype')[0]; - if (data.doctype) { - if (!elm) { - elm = new Node('#doctype', 10); - - if (data.xml_pi) - headerFragment.insert(elm, headerFragment.firstChild); - else - addHeadNode(elm); - } - - elm.value = data.doctype.substring(9, data.doctype.length - 1); - } else if (elm) - elm.remove(); - - // Add/update/remove title - elm = headerFragment.getAll('title')[0]; - if (data.metatitle) { - if (!elm) { - elm = new Node('title', 1); - elm.append(new Node('#text', 3)).value = data.metatitle; - addHeadNode(elm); - } - } - - // Add meta encoding - if (data.docencoding) { - elm = null; - each(headerFragment.getAll('meta'), function(meta) { - if (meta.attr('http-equiv') == 'Content-Type') - elm = meta; - }); - - if (!elm) { - elm = new Node('meta', 1); - elm.attr('http-equiv', 'Content-Type'); - elm.shortEnded = true; - addHeadNode(elm); - } - - elm.attr('content', 'text/html; charset=' + data.docencoding); - } - - // Add/update/remove meta - each('keywords,description,author,copyright,robots'.split(','), function(name) { - var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name]; - - for (i = 0; i < nodes.length; i++) { - meta = nodes[i]; - - if (meta.attr('name') == name) { - if (value) - meta.attr('content', value); - else - meta.remove(); - - return; - } - } - - if (value) { - elm = new Node('meta', 1); - elm.attr('name', name); - elm.attr('content', value); - elm.shortEnded = true; - - addHeadNode(elm); - } - }); - - // Add/update/delete link - elm = headerFragment.getAll('link')[0]; - if (elm && elm.attr('rel') == 'stylesheet') { - if (data.stylesheet) - elm.attr('href', data.stylesheet); - else - elm.remove(); - } else if (data.stylesheet) { - elm = new Node('link', 1); - elm.attr({ - rel : 'stylesheet', - text : 'text/css', - href : data.stylesheet - }); - elm.shortEnded = true; - - addHeadNode(elm); - } - - // Update body attributes - elm = headerFragment.getAll('body')[0]; - if (elm) { - setAttr(elm, 'dir', data.langdir); - setAttr(elm, 'style', data.style); - setAttr(elm, 'vlink', data.visited_color); - setAttr(elm, 'link', data.link_color); - setAttr(elm, 'alink', data.active_color); - - // Update iframe body as well - dom.setAttribs(this.editor.getBody(), { - style : data.style, - dir : data.dir, - vLink : data.visited_color, - link : data.link_color, - aLink : data.active_color - }); - } - - // Set html attributes - elm = headerFragment.getAll('html')[0]; - if (elm) { - setAttr(elm, 'lang', data.langcode); - setAttr(elm, 'xml:lang', data.langcode); - } - - // Serialize header fragment and crop away body part - html = new tinymce.html.Serializer({ - validate: false, - indent: true, - apply_source_formatting : true, - indent_before: 'head,html,body,meta,title,script,link,style', - indent_after: 'head,html,body,meta,title,script,link,style' - }).serialize(headerFragment); - - this.head = html.substring(0, html.indexOf('')); - }, - - _parseHeader : function() { - // Parse the contents with a DOM parser - return new tinymce.html.DomParser({ - validate: false, - root_name: '#document' - }).parse(this.head); - }, - - _setContent : function(ed, o) { - var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm; - - function low(s) { - return s.replace(/<\/?[A-Z]+/g, function(a) { - return a.toLowerCase(); - }) - }; - - // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate - if (o.format == 'raw' && self.head) - return; - - if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) - return; - - // Parse out head, body and footer - content = content.replace(/<(\/?)BODY/gi, '<$1body'); - startPos = content.indexOf('', startPos); - self.head = low(content.substring(0, startPos + 1)); - - endPos = content.indexOf('\n'; - - header += editor.getParam('fullpage_default_doctype', ''); - header += '\n\n\n'; - - if (value = editor.getParam('fullpage_default_title')) - header += '' + value + '\n'; - - if (value = editor.getParam('fullpage_default_encoding')) - header += '\n'; - - if (value = editor.getParam('fullpage_default_font_family')) - styles += 'font-family: ' + value + ';'; - - if (value = editor.getParam('fullpage_default_font_size')) - styles += 'font-size: ' + value + ';'; - - if (value = editor.getParam('fullpage_default_text_color')) - styles += 'color: ' + value + ';'; - - header += '\n\n'; - - return header; - }, - - _getContent : function(ed, o) { - var self = this; - - if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) - o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot); - } - }); - - // Register plugin - tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, Node = tinymce.html.Node; + + tinymce.create('tinymce.plugins.FullPagePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullPageProperties', function() { + ed.windowManager.open({ + file : url + '/fullpage.htm', + width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), + height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + data : t._htmlToData() + }); + }); + + // Register buttons + ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); + + ed.onBeforeSetContent.add(t._setContent, t); + ed.onGetContent.add(t._getContent, t); + }, + + getInfo : function() { + return { + longname : 'Fullpage', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private plugin internal methods + + _htmlToData : function() { + var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor; + + function getAttr(elm, name) { + var value = elm.attr(name); + + return value || ''; + }; + + // Default some values + data.fontface = editor.getParam("fullpage_default_fontface", ""); + data.fontsize = editor.getParam("fullpage_default_fontsize", ""); + + // Parse XML PI + elm = headerFragment.firstChild; + if (elm.type == 7) { + data.xml_pi = true; + matches = /encoding="([^"]+)"/.exec(elm.value); + if (matches) + data.docencoding = matches[1]; + } + + // Parse doctype + elm = headerFragment.getAll('#doctype')[0]; + if (elm) + data.doctype = '"; + + // Parse title element + elm = headerFragment.getAll('title')[0]; + if (elm && elm.firstChild) { + data.metatitle = elm.firstChild.value; + } + + // Parse meta elements + each(headerFragment.getAll('meta'), function(meta) { + var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; + + if (name) + data['meta' + name.toLowerCase()] = meta.attr('content'); + else if (httpEquiv == "Content-Type") { + matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); + + if (matches) + data.docencoding = matches[1]; + } + }); + + // Parse html attribs + elm = headerFragment.getAll('html')[0]; + if (elm) + data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + + // Parse stylesheet + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') + data.stylesheet = elm.attr('href'); + + // Parse body parts + elm = headerFragment.getAll('body')[0]; + if (elm) { + data.langdir = getAttr(elm, 'dir'); + data.style = getAttr(elm, 'style'); + data.visited_color = getAttr(elm, 'vlink'); + data.link_color = getAttr(elm, 'link'); + data.active_color = getAttr(elm, 'alink'); + } + + return data; + }, + + _dataToHtml : function(data) { + var headerFragment, headElement, html, elm, value, dom = this.editor.dom; + + function setAttr(elm, name, value) { + elm.attr(name, value ? value : undefined); + }; + + function addHeadNode(node) { + if (headElement.firstChild) + headElement.insert(node, headElement.firstChild); + else + headElement.append(node); + }; + + headerFragment = this._parseHeader(); + headElement = headerFragment.getAll('head')[0]; + if (!headElement) { + elm = headerFragment.getAll('html')[0]; + headElement = new Node('head', 1); + + if (elm.firstChild) + elm.insert(headElement, elm.firstChild, true); + else + elm.append(headElement); + } + + // Add/update/remove XML-PI + elm = headerFragment.firstChild; + if (data.xml_pi) { + value = 'version="1.0"'; + + if (data.docencoding) + value += ' encoding="' + data.docencoding + '"'; + + if (elm.type != 7) { + elm = new Node('xml', 7); + headerFragment.insert(elm, headerFragment.firstChild, true); + } + + elm.value = value; + } else if (elm && elm.type == 7) + elm.remove(); + + // Add/update/remove doctype + elm = headerFragment.getAll('#doctype')[0]; + if (data.doctype) { + if (!elm) { + elm = new Node('#doctype', 10); + + if (data.xml_pi) + headerFragment.insert(elm, headerFragment.firstChild); + else + addHeadNode(elm); + } + + elm.value = data.doctype.substring(9, data.doctype.length - 1); + } else if (elm) + elm.remove(); + + // Add/update/remove title + elm = headerFragment.getAll('title')[0]; + if (data.metatitle) { + if (!elm) { + elm = new Node('title', 1); + elm.append(new Node('#text', 3)).value = data.metatitle; + addHeadNode(elm); + } + } + + // Add meta encoding + if (data.docencoding) { + elm = null; + each(headerFragment.getAll('meta'), function(meta) { + if (meta.attr('http-equiv') == 'Content-Type') + elm = meta; + }); + + if (!elm) { + elm = new Node('meta', 1); + elm.attr('http-equiv', 'Content-Type'); + elm.shortEnded = true; + addHeadNode(elm); + } + + elm.attr('content', 'text/html; charset=' + data.docencoding); + } + + // Add/update/remove meta + each('keywords,description,author,copyright,robots'.split(','), function(name) { + var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name]; + + for (i = 0; i < nodes.length; i++) { + meta = nodes[i]; + + if (meta.attr('name') == name) { + if (value) + meta.attr('content', value); + else + meta.remove(); + + return; + } + } + + if (value) { + elm = new Node('meta', 1); + elm.attr('name', name); + elm.attr('content', value); + elm.shortEnded = true; + + addHeadNode(elm); + } + }); + + // Add/update/delete link + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') { + if (data.stylesheet) + elm.attr('href', data.stylesheet); + else + elm.remove(); + } else if (data.stylesheet) { + elm = new Node('link', 1); + elm.attr({ + rel : 'stylesheet', + text : 'text/css', + href : data.stylesheet + }); + elm.shortEnded = true; + + addHeadNode(elm); + } + + // Update body attributes + elm = headerFragment.getAll('body')[0]; + if (elm) { + setAttr(elm, 'dir', data.langdir); + setAttr(elm, 'style', data.style); + setAttr(elm, 'vlink', data.visited_color); + setAttr(elm, 'link', data.link_color); + setAttr(elm, 'alink', data.active_color); + + // Update iframe body as well + dom.setAttribs(this.editor.getBody(), { + style : data.style, + dir : data.dir, + vLink : data.visited_color, + link : data.link_color, + aLink : data.active_color + }); + } + + // Set html attributes + elm = headerFragment.getAll('html')[0]; + if (elm) { + setAttr(elm, 'lang', data.langcode); + setAttr(elm, 'xml:lang', data.langcode); + } + + // Serialize header fragment and crop away body part + html = new tinymce.html.Serializer({ + validate: false, + indent: true, + apply_source_formatting : true, + indent_before: 'head,html,body,meta,title,script,link,style', + indent_after: 'head,html,body,meta,title,script,link,style' + }).serialize(headerFragment); + + this.head = html.substring(0, html.indexOf('')); + }, + + _parseHeader : function() { + // Parse the contents with a DOM parser + return new tinymce.html.DomParser({ + validate: false, + root_name: '#document' + }).parse(this.head); + }, + + _setContent : function(ed, o) { + var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm; + + function low(s) { + return s.replace(/<\/?[A-Z]+/g, function(a) { + return a.toLowerCase(); + }) + }; + + // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate + if (o.format == 'raw' && self.head) + return; + + if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) + return; + + // Parse out head, body and footer + content = content.replace(/<(\/?)BODY/gi, '<$1body'); + startPos = content.indexOf('', startPos); + self.head = low(content.substring(0, startPos + 1)); + + endPos = content.indexOf('\n'; + + header += editor.getParam('fullpage_default_doctype', ''); + header += '\n\n\n'; + + if (value = editor.getParam('fullpage_default_title')) + header += '' + value + '\n'; + + if (value = editor.getParam('fullpage_default_encoding')) + header += '\n'; + + if (value = editor.getParam('fullpage_default_font_family')) + styles += 'font-family: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_font_size')) + styles += 'font-size: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_text_color')) + styles += 'color: ' + value + ';'; + + header += '\n\n'; + + return header; + }, + + _getContent : function(ed, o) { + var self = this; + + if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) + o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot); + } + }); + + // Register plugin + tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/js/fullpage.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/js/fullpage.js index 3f672ad..11cc968 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/js/fullpage.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/fullpage/js/fullpage.js @@ -1,232 +1,232 @@ -/** - * fullpage.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinyMCEPopup.requireLangPack(); - - var defaultDocTypes = - 'XHTML 1.0 Transitional=,' + - 'XHTML 1.0 Frameset=,' + - 'XHTML 1.0 Strict=,' + - 'XHTML 1.1=,' + - 'HTML 4.01 Transitional=,' + - 'HTML 4.01 Strict=,' + - 'HTML 4.01 Frameset='; - - var defaultEncodings = - 'Western european (iso-8859-1)=iso-8859-1,' + - 'Central European (iso-8859-2)=iso-8859-2,' + - 'Unicode (UTF-8)=utf-8,' + - 'Chinese traditional (Big5)=big5,' + - 'Cyrillic (iso-8859-5)=iso-8859-5,' + - 'Japanese (iso-2022-jp)=iso-2022-jp,' + - 'Greek (iso-8859-7)=iso-8859-7,' + - 'Korean (iso-2022-kr)=iso-2022-kr,' + - 'ASCII (us-ascii)=us-ascii'; - - var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; - var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; - - function setVal(id, value) { - var elm = document.getElementById(id); - - if (elm) { - value = value || ''; - - if (elm.nodeName == "SELECT") - selectByValue(document.forms[0], id, value); - else if (elm.type == "checkbox") - elm.checked = !!value; - else - elm.value = value; - } - }; - - function getVal(id) { - var elm = document.getElementById(id); - - if (elm.nodeName == "SELECT") - return elm.options[elm.selectedIndex].value; - - if (elm.type == "checkbox") - return elm.checked; - - return elm.value; - }; - - window.FullPageDialog = { - changedStyle : function() { - var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style')); - - setVal('fontface', styles['font-face']); - setVal('fontsize', styles['font-size']); - setVal('textcolor', styles['color']); - - if (val = styles['background-image']) - setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1")); - else - setVal('bgimage', ''); - - setVal('bgcolor', styles['background-color']); - - // Reset margin form elements - setVal('topmargin', ''); - setVal('rightmargin', ''); - setVal('bottommargin', ''); - setVal('leftmargin', ''); - - // Expand margin - if (val = styles['margin']) { - val = val.split(' '); - styles['margin-top'] = val[0] || ''; - styles['margin-right'] = val[1] || val[0] || ''; - styles['margin-bottom'] = val[2] || val[0] || ''; - styles['margin-left'] = val[3] || val[0] || ''; - } - - if (val = styles['margin-top']) - setVal('topmargin', val.replace(/px/, '')); - - if (val = styles['margin-right']) - setVal('rightmargin', val.replace(/px/, '')); - - if (val = styles['margin-bottom']) - setVal('bottommargin', val.replace(/px/, '')); - - if (val = styles['margin-left']) - setVal('leftmargin', val.replace(/px/, '')); - - updateColor('bgcolor_pick', 'bgcolor'); - updateColor('textcolor_pick', 'textcolor'); - }, - - changedStyleProp : function() { - var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style')); - - styles['font-face'] = getVal('fontface'); - styles['font-size'] = getVal('fontsize'); - styles['color'] = getVal('textcolor'); - styles['background-color'] = getVal('bgcolor'); - - if (val = getVal('bgimage')) - styles['background-image'] = "url('" + val + "')"; - else - styles['background-image'] = ''; - - delete styles['margin']; - - if (val = getVal('topmargin')) - styles['margin-top'] = val + "px"; - else - styles['margin-top'] = ''; - - if (val = getVal('rightmargin')) - styles['margin-right'] = val + "px"; - else - styles['margin-right'] = ''; - - if (val = getVal('bottommargin')) - styles['margin-bottom'] = val + "px"; - else - styles['margin-bottom'] = ''; - - if (val = getVal('leftmargin')) - styles['margin-left'] = val + "px"; - else - styles['margin-left'] = ''; - - // Serialize, parse and reserialize this will compress redundant styles - setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles)))); - this.changedStyle(); - }, - - update : function() { - var data = {}; - - tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) { - data[node.id] = getVal(node.id); - }); - - tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data); - tinyMCEPopup.close(); - } - }; - - function init() { - var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor; - - // Setup doctype select box - list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(','); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'doctype', item[0], item[1]); - } - - // Setup fonts select box - list = editor.getParam("fullpage_fonts", defaultFontNames).split(';'); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'fontface', item[0], item[1]); - } - - // Setup fontsize select box - list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(','); - for (i = 0; i < list.length; i++) - addSelectValue(form, 'fontsize', list[i], list[i]); - - // Setup encodings select box - list = editor.getParam("fullpage_encodings", defaultEncodings).split(','); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'docencoding', item[0], item[1]); - } - - // Setup color pickers - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); - document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); - document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); - document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); - document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); - document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); - - // Resize some elements - if (isVisible('stylesheetbrowser')) - document.getElementById('stylesheet').style.width = '220px'; - - if (isVisible('link_href_browser')) - document.getElementById('element_link_href').style.width = '230px'; - - if (isVisible('bgimage_browser')) - document.getElementById('bgimage').style.width = '210px'; - - // Update form - tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) { - setVal(key, value); - }); - - FullPageDialog.changedStyle(); - - // Update colors - updateColor('textcolor_pick', 'textcolor'); - updateColor('bgcolor_pick', 'bgcolor'); - updateColor('visited_color_pick', 'visited_color'); - updateColor('active_color_pick', 'active_color'); - updateColor('link_color_pick', 'link_color'); - }; - - tinyMCEPopup.onInit.add(init); -})(); +/** + * fullpage.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinyMCEPopup.requireLangPack(); + + var defaultDocTypes = + 'XHTML 1.0 Transitional=,' + + 'XHTML 1.0 Frameset=,' + + 'XHTML 1.0 Strict=,' + + 'XHTML 1.1=,' + + 'HTML 4.01 Transitional=,' + + 'HTML 4.01 Strict=,' + + 'HTML 4.01 Frameset='; + + var defaultEncodings = + 'Western european (iso-8859-1)=iso-8859-1,' + + 'Central European (iso-8859-2)=iso-8859-2,' + + 'Unicode (UTF-8)=utf-8,' + + 'Chinese traditional (Big5)=big5,' + + 'Cyrillic (iso-8859-5)=iso-8859-5,' + + 'Japanese (iso-2022-jp)=iso-2022-jp,' + + 'Greek (iso-8859-7)=iso-8859-7,' + + 'Korean (iso-2022-kr)=iso-2022-kr,' + + 'ASCII (us-ascii)=us-ascii'; + + var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; + var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; + + function setVal(id, value) { + var elm = document.getElementById(id); + + if (elm) { + value = value || ''; + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") + elm.checked = !!value; + else + elm.value = value; + } + }; + + function getVal(id) { + var elm = document.getElementById(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + }; + + window.FullPageDialog = { + changedStyle : function() { + var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style')); + + setVal('fontface', styles['font-face']); + setVal('fontsize', styles['font-size']); + setVal('textcolor', styles['color']); + + if (val = styles['background-image']) + setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1")); + else + setVal('bgimage', ''); + + setVal('bgcolor', styles['background-color']); + + // Reset margin form elements + setVal('topmargin', ''); + setVal('rightmargin', ''); + setVal('bottommargin', ''); + setVal('leftmargin', ''); + + // Expand margin + if (val = styles['margin']) { + val = val.split(' '); + styles['margin-top'] = val[0] || ''; + styles['margin-right'] = val[1] || val[0] || ''; + styles['margin-bottom'] = val[2] || val[0] || ''; + styles['margin-left'] = val[3] || val[0] || ''; + } + + if (val = styles['margin-top']) + setVal('topmargin', val.replace(/px/, '')); + + if (val = styles['margin-right']) + setVal('rightmargin', val.replace(/px/, '')); + + if (val = styles['margin-bottom']) + setVal('bottommargin', val.replace(/px/, '')); + + if (val = styles['margin-left']) + setVal('leftmargin', val.replace(/px/, '')); + + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('textcolor_pick', 'textcolor'); + }, + + changedStyleProp : function() { + var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style')); + + styles['font-face'] = getVal('fontface'); + styles['font-size'] = getVal('fontsize'); + styles['color'] = getVal('textcolor'); + styles['background-color'] = getVal('bgcolor'); + + if (val = getVal('bgimage')) + styles['background-image'] = "url('" + val + "')"; + else + styles['background-image'] = ''; + + delete styles['margin']; + + if (val = getVal('topmargin')) + styles['margin-top'] = val + "px"; + else + styles['margin-top'] = ''; + + if (val = getVal('rightmargin')) + styles['margin-right'] = val + "px"; + else + styles['margin-right'] = ''; + + if (val = getVal('bottommargin')) + styles['margin-bottom'] = val + "px"; + else + styles['margin-bottom'] = ''; + + if (val = getVal('leftmargin')) + styles['margin-left'] = val + "px"; + else + styles['margin-left'] = ''; + + // Serialize, parse and reserialize this will compress redundant styles + setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles)))); + this.changedStyle(); + }, + + update : function() { + var data = {}; + + tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) { + data[node.id] = getVal(node.id); + }); + + tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data); + tinyMCEPopup.close(); + } + }; + + function init() { + var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor; + + // Setup doctype select box + list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'doctype', item[0], item[1]); + } + + // Setup fonts select box + list = editor.getParam("fullpage_fonts", defaultFontNames).split(';'); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'fontface', item[0], item[1]); + } + + // Setup fontsize select box + list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(','); + for (i = 0; i < list.length; i++) + addSelectValue(form, 'fontsize', list[i], list[i]); + + // Setup encodings select box + list = editor.getParam("fullpage_encodings", defaultEncodings).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'docencoding', item[0], item[1]); + } + + // Setup color pickers + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); + document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); + document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); + document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); + document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); + document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); + + // Resize some elements + if (isVisible('stylesheetbrowser')) + document.getElementById('stylesheet').style.width = '220px'; + + if (isVisible('link_href_browser')) + document.getElementById('element_link_href').style.width = '230px'; + + if (isVisible('bgimage_browser')) + document.getElementById('bgimage').style.width = '210px'; + + // Update form + tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) { + setVal(key, value); + }); + + FullPageDialog.changedStyle(); + + // Update colors + updateColor('textcolor_pick', 'textcolor'); + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('visited_color_pick', 'visited_color'); + updateColor('active_color_pick', 'active_color'); + updateColor('link_color_pick', 'link_color'); + }; + + tinyMCEPopup.onInit.add(init); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/fullscreen/editor_plugin_src.js index 524b487..00e6046 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/fullscreen/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/fullscreen/editor_plugin_src.js @@ -1,159 +1,159 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM; - - tinymce.create('tinymce.plugins.FullScreenPlugin', { - init : function(ed, url) { - var t = this, s = {}, vp, posCss; - - t.editor = ed; - - // Register commands - ed.addCommand('mceFullScreen', function() { - var win, de = DOM.doc.documentElement; - - if (ed.getParam('fullscreen_is_enabled')) { - if (ed.getParam('fullscreen_new_window')) - closeFullscreen(); // Call to close in new window - else { - DOM.win.setTimeout(function() { - tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); - tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent()); - tinyMCE.remove(ed); - DOM.remove('mce_fullscreen_container'); - de.style.overflow = ed.getParam('fullscreen_html_overflow'); - DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); - DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); - tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings - }, 10); - } - - return; - } - - if (ed.getParam('fullscreen_new_window')) { - win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); - try { - win.resizeTo(screen.availWidth, screen.availHeight); - } catch (e) { - // Ignore - } - } else { - tinyMCE.oldSettings = tinyMCE.settings; // Store old settings - s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; - s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); - vp = DOM.getViewPort(); - s.fullscreen_scrollx = vp.x; - s.fullscreen_scrolly = vp.y; - - // Fixes an Opera bug where the scrollbars doesn't reappear - if (tinymce.isOpera && s.fullscreen_overflow == 'visible') - s.fullscreen_overflow = 'auto'; - - // Fixes an IE bug where horizontal scrollbars would appear - if (tinymce.isIE && s.fullscreen_overflow == 'scroll') - s.fullscreen_overflow = 'auto'; - - // Fixes an IE bug where the scrollbars doesn't reappear - if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) - s.fullscreen_html_overflow = 'auto'; - - if (s.fullscreen_overflow == '0px') - s.fullscreen_overflow = ''; - - DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); - de.style.overflow = 'hidden'; //Fix for IE6/7 - vp = DOM.getViewPort(); - DOM.win.scrollTo(0, 0); - - if (tinymce.isIE) - vp.h -= 1; - - // Use fixed position if it exists - if (tinymce.isIE6 || document.compatMode == 'BackCompat') - posCss = 'absolute;top:' + vp.y; - else - posCss = 'fixed;top:0'; - - n = DOM.add(DOM.doc.body, 'div', { - id : 'mce_fullscreen_container', - style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); - DOM.add(n, 'div', {id : 'mce_fullscreen'}); - - tinymce.each(ed.settings, function(v, n) { - s[n] = v; - }); - - s.id = 'mce_fullscreen'; - s.width = n.clientWidth; - s.height = n.clientHeight - 15; - s.fullscreen_is_enabled = true; - s.fullscreen_editor_id = ed.id; - s.theme_advanced_resizing = false; - s.save_onsavecallback = function() { - ed.setContent(tinyMCE.get(s.id).getContent()); - ed.execCommand('mceSave'); - }; - - tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { - s[k] = v; - }); - - if (s.theme_advanced_toolbar_location === 'external') - s.theme_advanced_toolbar_location = 'top'; - - t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); - t.fullscreenEditor.onInit.add(function() { - t.fullscreenEditor.setContent(ed.getContent()); - t.fullscreenEditor.focus(); - }); - - t.fullscreenEditor.render(); - - t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); - t.fullscreenElement.update(); - //document.body.overflow = 'hidden'; - - t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { - var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize; - - // Get outer/inner size to get a delta size that can be used to calc the new iframe size - outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]); - innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]); - - fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h); - }); - } - }); - - // Register buttons - ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); - }); - }, - - getInfo : function() { - return { - longname : 'Fullscreen', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.FullScreenPlugin', { + init : function(ed, url) { + var t = this, s = {}, vp, posCss; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullScreen', function() { + var win, de = DOM.doc.documentElement; + + if (ed.getParam('fullscreen_is_enabled')) { + if (ed.getParam('fullscreen_new_window')) + closeFullscreen(); // Call to close in new window + else { + DOM.win.setTimeout(function() { + tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); + tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent()); + tinyMCE.remove(ed); + DOM.remove('mce_fullscreen_container'); + de.style.overflow = ed.getParam('fullscreen_html_overflow'); + DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); + DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); + tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings + }, 10); + } + + return; + } + + if (ed.getParam('fullscreen_new_window')) { + win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); + try { + win.resizeTo(screen.availWidth, screen.availHeight); + } catch (e) { + // Ignore + } + } else { + tinyMCE.oldSettings = tinyMCE.settings; // Store old settings + s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; + s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); + vp = DOM.getViewPort(); + s.fullscreen_scrollx = vp.x; + s.fullscreen_scrolly = vp.y; + + // Fixes an Opera bug where the scrollbars doesn't reappear + if (tinymce.isOpera && s.fullscreen_overflow == 'visible') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where horizontal scrollbars would appear + if (tinymce.isIE && s.fullscreen_overflow == 'scroll') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where the scrollbars doesn't reappear + if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) + s.fullscreen_html_overflow = 'auto'; + + if (s.fullscreen_overflow == '0px') + s.fullscreen_overflow = ''; + + DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); + de.style.overflow = 'hidden'; //Fix for IE6/7 + vp = DOM.getViewPort(); + DOM.win.scrollTo(0, 0); + + if (tinymce.isIE) + vp.h -= 1; + + // Use fixed position if it exists + if (tinymce.isIE6 || document.compatMode == 'BackCompat') + posCss = 'absolute;top:' + vp.y; + else + posCss = 'fixed;top:0'; + + n = DOM.add(DOM.doc.body, 'div', { + id : 'mce_fullscreen_container', + style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); + DOM.add(n, 'div', {id : 'mce_fullscreen'}); + + tinymce.each(ed.settings, function(v, n) { + s[n] = v; + }); + + s.id = 'mce_fullscreen'; + s.width = n.clientWidth; + s.height = n.clientHeight - 15; + s.fullscreen_is_enabled = true; + s.fullscreen_editor_id = ed.id; + s.theme_advanced_resizing = false; + s.save_onsavecallback = function() { + ed.setContent(tinyMCE.get(s.id).getContent()); + ed.execCommand('mceSave'); + }; + + tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { + s[k] = v; + }); + + if (s.theme_advanced_toolbar_location === 'external') + s.theme_advanced_toolbar_location = 'top'; + + t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); + t.fullscreenEditor.onInit.add(function() { + t.fullscreenEditor.setContent(ed.getContent()); + t.fullscreenEditor.focus(); + }); + + t.fullscreenEditor.render(); + + t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); + t.fullscreenElement.update(); + //document.body.overflow = 'hidden'; + + t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { + var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize; + + // Get outer/inner size to get a delta size that can be used to calc the new iframe size + outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]); + innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]); + + fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h); + }); + } + }); + + // Register buttons + ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); + }); + }, + + getInfo : function() { + return { + longname : 'Fullscreen', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/iespell/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/iespell/editor_plugin_src.js index 1b2bb98..9df52c4 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/iespell/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/iespell/editor_plugin_src.js @@ -1,54 +1,54 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.IESpell', { - init : function(ed, url) { - var t = this, sp; - - if (!tinymce.isIE) - return; - - t.editor = ed; - - // Register commands - ed.addCommand('mceIESpell', function() { - try { - sp = new ActiveXObject("ieSpell.ieSpellExtension"); - sp.CheckDocumentNode(ed.getDoc().documentElement); - } catch (e) { - if (e.number == -2146827859) { - ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { - if (s) - window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); - }); - } else - ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); - } - }); - - // Register buttons - ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); - }, - - getInfo : function() { - return { - longname : 'IESpell (IE Only)', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.IESpell', { + init : function(ed, url) { + var t = this, sp; + + if (!tinymce.isIE) + return; + + t.editor = ed; + + // Register commands + ed.addCommand('mceIESpell', function() { + try { + sp = new ActiveXObject("ieSpell.ieSpellExtension"); + sp.CheckDocumentNode(ed.getDoc().documentElement); + } catch (e) { + if (e.number == -2146827859) { + ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { + if (s) + window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); + }); + } else + ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); + } + }); + + // Register buttons + ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); + }, + + getInfo : function() { + return { + longname : 'IESpell (IE Only)', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/inlinepopups/editor_plugin_src.js index 67123ca..5715d21 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/inlinepopups/editor_plugin_src.js @@ -1,699 +1,699 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; - - tinymce.create('tinymce.plugins.InlinePopups', { - init : function(ed, url) { - // Replace window manager - ed.onBeforeRenderUI.add(function() { - ed.windowManager = new tinymce.InlineWindowManager(ed); - DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); - }); - }, - - getInfo : function() { - return { - longname : 'InlinePopups', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { - InlineWindowManager : function(ed) { - var t = this; - - t.parent(ed); - t.zIndex = 300000; - t.count = 0; - t.windows = {}; - }, - - open : function(f, p) { - var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow; - - f = f || {}; - p = p || {}; - - // Run native windows - if (!f.inline) - return t.parent(f, p); - - parentWindow = t._frontWindow(); - if (parentWindow && DOM.get(parentWindow.id + '_ifr')) { - parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement; - } - - // Only store selection if the type is a normal window - if (!f.type) - t.bookmark = ed.selection.getBookmark(1); - - id = DOM.uniqueId(); - vp = DOM.getViewPort(); - f.width = parseInt(f.width || 320); - f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); - f.min_width = parseInt(f.min_width || 150); - f.min_height = parseInt(f.min_height || 100); - f.max_width = parseInt(f.max_width || 2000); - f.max_height = parseInt(f.max_height || 2000); - f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); - f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); - f.movable = f.resizable = true; - p.mce_width = f.width; - p.mce_height = f.height; - p.mce_inline = true; - p.mce_window_id = id; - p.mce_auto_focus = f.auto_focus; - - // Transpose -// po = DOM.getPos(ed.getContainer()); -// f.left -= po.x; -// f.top -= po.y; - - t.features = f; - t.params = p; - t.onOpen.dispatch(t, f, p); - - if (f.type) { - opt += ' mceModal'; - - if (f.type) - opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); - - f.resizable = false; - } - - if (f.statusbar) - opt += ' mceStatusbar'; - - if (f.resizable) - opt += ' mceResizable'; - - if (f.minimizable) - opt += ' mceMinimizable'; - - if (f.maximizable) - opt += ' mceMaximizable'; - - if (f.movable) - opt += ' mceMovable'; - - // Create DOM objects - t._addAll(DOM.doc.body, - ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, - ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, - ['div', {id : id + '_top', 'class' : 'mceTop'}, - ['div', {'class' : 'mceLeft'}], - ['div', {'class' : 'mceCenter'}], - ['div', {'class' : 'mceRight'}], - ['span', {id : id + '_title'}, f.title || ''] - ], - - ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, - ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}], - ['span', {id : id + '_content'}], - ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}] - ], - - ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, - ['div', {'class' : 'mceLeft'}], - ['div', {'class' : 'mceCenter'}], - ['div', {'class' : 'mceRight'}], - ['span', {id : id + '_status'}, 'Content'] - ], - - ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], - ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] - ] - ] - ); - - DOM.setStyles(id, {top : -10000, left : -10000}); - - // Fix gecko rendering bug, where the editors iframe messed with window contents - if (tinymce.isGecko) - DOM.setStyle(id, 'overflow', 'auto'); - - // Measure borders - if (!f.type) { - dw += DOM.get(id + '_left').clientWidth; - dw += DOM.get(id + '_right').clientWidth; - dh += DOM.get(id + '_top').clientHeight; - dh += DOM.get(id + '_bottom').clientHeight; - } - - // Resize window - DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); - - u = f.url || f.file; - if (u) { - if (tinymce.relaxedDomain) - u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; - - u = tinymce._addVer(u); - } - - if (!f.type) { - DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); - DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); - DOM.setAttrib(id + '_ifr', 'src', u); - } else { - DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); - - if (f.type == 'confirm') - DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); - - DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); - DOM.setHTML(id + '_content', f.content.replace('\n', '
      ')); - - Event.add(id, 'keyup', function(evt) { - var VK_ESCAPE = 27; - if (evt.keyCode === VK_ESCAPE) { - f.button_func(false); - return Event.cancel(evt); - } - }); - - Event.add(id, 'keydown', function(evt) { - var cancelButton, VK_TAB = 9; - if (evt.keyCode === VK_TAB) { - cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0]; - if (cancelButton && cancelButton !== evt.target) { - cancelButton.focus(); - } else { - DOM.get(id + '_ok').focus(); - } - return Event.cancel(evt); - } - }); - } - - // Register events - mdf = Event.add(id, 'mousedown', function(e) { - var n = e.target, w, vp; - - w = t.windows[id]; - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - if (n.className == 'mceClose') { - t.close(null, id); - return Event.cancel(e); - } else if (n.className == 'mceMax') { - w.oldPos = w.element.getXY(); - w.oldSize = w.element.getSize(); - - vp = DOM.getViewPort(); - - // Reduce viewport size to avoid scrollbars - vp.w -= 2; - vp.h -= 2; - - w.element.moveTo(vp.x, vp.y); - w.element.resizeTo(vp.w, vp.h); - DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); - DOM.addClass(id + '_wrapper', 'mceMaximized'); - } else if (n.className == 'mceMed') { - // Reset to old size - w.element.moveTo(w.oldPos.x, w.oldPos.y); - w.element.resizeTo(w.oldSize.w, w.oldSize.h); - w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); - - DOM.removeClass(id + '_wrapper', 'mceMaximized'); - } else if (n.className == 'mceMove') - return t._startDrag(id, e, n.className); - else if (DOM.hasClass(n, 'mceResize')) - return t._startDrag(id, e, n.className.substring(13)); - } - }); - - clf = Event.add(id, 'click', function(e) { - var n = e.target; - - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - switch (n.className) { - case 'mceClose': - t.close(null, id); - return Event.cancel(e); - - case 'mceButton mceOk': - case 'mceButton mceCancel': - f.button_func(n.className == 'mceButton mceOk'); - return Event.cancel(e); - } - } - }); - - // Make sure the tab order loops within the dialog. - Event.add([id + '_left', id + '_right'], 'focus', function(evt) { - var iframe = DOM.get(id + '_ifr'); - if (iframe) { - var body = iframe.contentWindow.document.body; - var focusable = DOM.select(':input:enabled,*[tabindex=0]', body); - if (evt.target.id === (id + '_left')) { - focusable[focusable.length - 1].focus(); - } else { - focusable[0].focus(); - } - } else { - DOM.get(id + '_ok').focus(); - } - }); - - // Add window - w = t.windows[id] = { - id : id, - mousedown_func : mdf, - click_func : clf, - element : new Element(id, {blocker : 1, container : ed.getContainer()}), - iframeElement : new Element(id + '_ifr'), - features : f, - deltaWidth : dw, - deltaHeight : dh - }; - - w.iframeElement.on('focus', function() { - t.focus(id); - }); - - // Setup blocker - if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { - DOM.add(DOM.doc.body, 'div', { - id : 'mceModalBlocker', - 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', - style : {zIndex : t.zIndex - 1} - }); - - DOM.show('mceModalBlocker'); // Reduces flicker in IE - DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true'); - } else - DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); - - if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) - DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); - - DOM.setAttrib(id, 'aria-hidden', 'false'); - t.focus(id); - t._fixIELayout(id, 1); - - // Focus ok button - if (DOM.get(id + '_ok')) - DOM.get(id + '_ok').focus(); - t.count++; - - return w; - }, - - focus : function(id) { - var t = this, w; - - if (w = t.windows[id]) { - w.zIndex = this.zIndex++; - w.element.setStyle('zIndex', w.zIndex); - w.element.update(); - - id = id + '_wrapper'; - DOM.removeClass(t.lastId, 'mceFocus'); - DOM.addClass(id, 'mceFocus'); - t.lastId = id; - - if (w.focussedElement) { - w.focussedElement.focus(); - } else if (DOM.get(id + '_ok')) { - DOM.get(w.id + '_ok').focus(); - } else if (DOM.get(w.id + '_ifr')) { - DOM.get(w.id + '_ifr').focus(); - } - } - }, - - _addAll : function(te, ne) { - var i, n, t = this, dom = tinymce.DOM; - - if (is(ne, 'string')) - te.appendChild(dom.doc.createTextNode(ne)); - else if (ne.length) { - te = te.appendChild(dom.create(ne[0], ne[1])); - - for (i=2; i ix) { - fw = w; - ix = w.zIndex; - } - }); - return fw; - }, - - setTitle : function(w, ti) { - var e; - - w = this._findId(w); - - if (e = DOM.get(w + '_title')) - e.innerHTML = DOM.encode(ti); - }, - - alert : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'alert', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - confirm : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'confirm', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - // Internal functions - - _findId : function(w) { - var t = this; - - if (typeof(w) == 'string') - return w; - - each(t.windows, function(wo) { - var ifr = DOM.get(wo.id + '_ifr'); - - if (ifr && w == ifr.contentWindow) { - w = wo.id; - return false; - } - }); - - return w; - }, - - _fixIELayout : function(id, s) { - var w, img; - - if (!tinymce.isIE6) - return; - - // Fixes the bug where hover flickers and does odd things in IE6 - each(['n','s','w','e','nw','ne','sw','se'], function(v) { - var e = DOM.get(id + '_resize_' + v); - - DOM.setStyles(e, { - width : s ? e.clientWidth : '', - height : s ? e.clientHeight : '', - cursor : DOM.getStyle(e, 'cursor', 1) - }); - - DOM.setStyle(id + "_bottom", 'bottom', '-1px'); - - e = 0; - }); - - // Fixes graphics glitch - if (w = this.windows[id]) { - // Fixes rendering bug after resize - w.element.hide(); - w.element.show(); - - // Forced a repaint of the window - //DOM.get(id).style.filter = ''; - - // IE has a bug where images used in CSS won't get loaded - // sometimes when the cache in the browser is disabled - // This fix tries to solve it by loading the images using the image object - each(DOM.select('div,a', id), function(e, i) { - if (e.currentStyle.backgroundImage != 'none') { - img = new Image(); - img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); - } - }); - - DOM.get(id).style.filter = ''; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); -})(); - +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; + + tinymce.create('tinymce.plugins.InlinePopups', { + init : function(ed, url) { + // Replace window manager + ed.onBeforeRenderUI.add(function() { + ed.windowManager = new tinymce.InlineWindowManager(ed); + DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); + }); + }, + + getInfo : function() { + return { + longname : 'InlinePopups', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { + InlineWindowManager : function(ed) { + var t = this; + + t.parent(ed); + t.zIndex = 300000; + t.count = 0; + t.windows = {}; + }, + + open : function(f, p) { + var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow; + + f = f || {}; + p = p || {}; + + // Run native windows + if (!f.inline) + return t.parent(f, p); + + parentWindow = t._frontWindow(); + if (parentWindow && DOM.get(parentWindow.id + '_ifr')) { + parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement; + } + + // Only store selection if the type is a normal window + if (!f.type) + t.bookmark = ed.selection.getBookmark(1); + + id = DOM.uniqueId(); + vp = DOM.getViewPort(); + f.width = parseInt(f.width || 320); + f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); + f.min_width = parseInt(f.min_width || 150); + f.min_height = parseInt(f.min_height || 100); + f.max_width = parseInt(f.max_width || 2000); + f.max_height = parseInt(f.max_height || 2000); + f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); + f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); + f.movable = f.resizable = true; + p.mce_width = f.width; + p.mce_height = f.height; + p.mce_inline = true; + p.mce_window_id = id; + p.mce_auto_focus = f.auto_focus; + + // Transpose +// po = DOM.getPos(ed.getContainer()); +// f.left -= po.x; +// f.top -= po.y; + + t.features = f; + t.params = p; + t.onOpen.dispatch(t, f, p); + + if (f.type) { + opt += ' mceModal'; + + if (f.type) + opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); + + f.resizable = false; + } + + if (f.statusbar) + opt += ' mceStatusbar'; + + if (f.resizable) + opt += ' mceResizable'; + + if (f.minimizable) + opt += ' mceMinimizable'; + + if (f.maximizable) + opt += ' mceMaximizable'; + + if (f.movable) + opt += ' mceMovable'; + + // Create DOM objects + t._addAll(DOM.doc.body, + ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, + ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, + ['div', {id : id + '_top', 'class' : 'mceTop'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_title'}, f.title || ''] + ], + + ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, + ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}], + ['span', {id : id + '_content'}], + ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}] + ], + + ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_status'}, 'Content'] + ], + + ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], + ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] + ] + ] + ); + + DOM.setStyles(id, {top : -10000, left : -10000}); + + // Fix gecko rendering bug, where the editors iframe messed with window contents + if (tinymce.isGecko) + DOM.setStyle(id, 'overflow', 'auto'); + + // Measure borders + if (!f.type) { + dw += DOM.get(id + '_left').clientWidth; + dw += DOM.get(id + '_right').clientWidth; + dh += DOM.get(id + '_top').clientHeight; + dh += DOM.get(id + '_bottom').clientHeight; + } + + // Resize window + DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); + + u = f.url || f.file; + if (u) { + if (tinymce.relaxedDomain) + u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; + + u = tinymce._addVer(u); + } + + if (!f.type) { + DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); + DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); + DOM.setAttrib(id + '_ifr', 'src', u); + } else { + DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); + + if (f.type == 'confirm') + DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); + + DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); + DOM.setHTML(id + '_content', f.content.replace('\n', '
      ')); + + Event.add(id, 'keyup', function(evt) { + var VK_ESCAPE = 27; + if (evt.keyCode === VK_ESCAPE) { + f.button_func(false); + return Event.cancel(evt); + } + }); + + Event.add(id, 'keydown', function(evt) { + var cancelButton, VK_TAB = 9; + if (evt.keyCode === VK_TAB) { + cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0]; + if (cancelButton && cancelButton !== evt.target) { + cancelButton.focus(); + } else { + DOM.get(id + '_ok').focus(); + } + return Event.cancel(evt); + } + }); + } + + // Register events + mdf = Event.add(id, 'mousedown', function(e) { + var n = e.target, w, vp; + + w = t.windows[id]; + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + if (n.className == 'mceClose') { + t.close(null, id); + return Event.cancel(e); + } else if (n.className == 'mceMax') { + w.oldPos = w.element.getXY(); + w.oldSize = w.element.getSize(); + + vp = DOM.getViewPort(); + + // Reduce viewport size to avoid scrollbars + vp.w -= 2; + vp.h -= 2; + + w.element.moveTo(vp.x, vp.y); + w.element.resizeTo(vp.w, vp.h); + DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); + DOM.addClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMed') { + // Reset to old size + w.element.moveTo(w.oldPos.x, w.oldPos.y); + w.element.resizeTo(w.oldSize.w, w.oldSize.h); + w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); + + DOM.removeClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMove') + return t._startDrag(id, e, n.className); + else if (DOM.hasClass(n, 'mceResize')) + return t._startDrag(id, e, n.className.substring(13)); + } + }); + + clf = Event.add(id, 'click', function(e) { + var n = e.target; + + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + switch (n.className) { + case 'mceClose': + t.close(null, id); + return Event.cancel(e); + + case 'mceButton mceOk': + case 'mceButton mceCancel': + f.button_func(n.className == 'mceButton mceOk'); + return Event.cancel(e); + } + } + }); + + // Make sure the tab order loops within the dialog. + Event.add([id + '_left', id + '_right'], 'focus', function(evt) { + var iframe = DOM.get(id + '_ifr'); + if (iframe) { + var body = iframe.contentWindow.document.body; + var focusable = DOM.select(':input:enabled,*[tabindex=0]', body); + if (evt.target.id === (id + '_left')) { + focusable[focusable.length - 1].focus(); + } else { + focusable[0].focus(); + } + } else { + DOM.get(id + '_ok').focus(); + } + }); + + // Add window + w = t.windows[id] = { + id : id, + mousedown_func : mdf, + click_func : clf, + element : new Element(id, {blocker : 1, container : ed.getContainer()}), + iframeElement : new Element(id + '_ifr'), + features : f, + deltaWidth : dw, + deltaHeight : dh + }; + + w.iframeElement.on('focus', function() { + t.focus(id); + }); + + // Setup blocker + if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { + DOM.add(DOM.doc.body, 'div', { + id : 'mceModalBlocker', + 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', + style : {zIndex : t.zIndex - 1} + }); + + DOM.show('mceModalBlocker'); // Reduces flicker in IE + DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true'); + } else + DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); + + if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) + DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); + + DOM.setAttrib(id, 'aria-hidden', 'false'); + t.focus(id); + t._fixIELayout(id, 1); + + // Focus ok button + if (DOM.get(id + '_ok')) + DOM.get(id + '_ok').focus(); + t.count++; + + return w; + }, + + focus : function(id) { + var t = this, w; + + if (w = t.windows[id]) { + w.zIndex = this.zIndex++; + w.element.setStyle('zIndex', w.zIndex); + w.element.update(); + + id = id + '_wrapper'; + DOM.removeClass(t.lastId, 'mceFocus'); + DOM.addClass(id, 'mceFocus'); + t.lastId = id; + + if (w.focussedElement) { + w.focussedElement.focus(); + } else if (DOM.get(id + '_ok')) { + DOM.get(w.id + '_ok').focus(); + } else if (DOM.get(w.id + '_ifr')) { + DOM.get(w.id + '_ifr').focus(); + } + } + }, + + _addAll : function(te, ne) { + var i, n, t = this, dom = tinymce.DOM; + + if (is(ne, 'string')) + te.appendChild(dom.doc.createTextNode(ne)); + else if (ne.length) { + te = te.appendChild(dom.create(ne[0], ne[1])); + + for (i=2; i ix) { + fw = w; + ix = w.zIndex; + } + }); + return fw; + }, + + setTitle : function(w, ti) { + var e; + + w = this._findId(w); + + if (e = DOM.get(w + '_title')) + e.innerHTML = DOM.encode(ti); + }, + + alert : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'alert', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + confirm : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'confirm', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + // Internal functions + + _findId : function(w) { + var t = this; + + if (typeof(w) == 'string') + return w; + + each(t.windows, function(wo) { + var ifr = DOM.get(wo.id + '_ifr'); + + if (ifr && w == ifr.contentWindow) { + w = wo.id; + return false; + } + }); + + return w; + }, + + _fixIELayout : function(id, s) { + var w, img; + + if (!tinymce.isIE6) + return; + + // Fixes the bug where hover flickers and does odd things in IE6 + each(['n','s','w','e','nw','ne','sw','se'], function(v) { + var e = DOM.get(id + '_resize_' + v); + + DOM.setStyles(e, { + width : s ? e.clientWidth : '', + height : s ? e.clientHeight : '', + cursor : DOM.getStyle(e, 'cursor', 1) + }); + + DOM.setStyle(id + "_bottom", 'bottom', '-1px'); + + e = 0; + }); + + // Fixes graphics glitch + if (w = this.windows[id]) { + // Fixes rendering bug after resize + w.element.hide(); + w.element.show(); + + // Forced a repaint of the window + //DOM.get(id).style.filter = ''; + + // IE has a bug where images used in CSS won't get loaded + // sometimes when the cache in the browser is disabled + // This fix tries to solve it by loading the images using the image object + each(DOM.select('div,a', id), function(e, i) { + if (e.currentStyle.backgroundImage != 'none') { + img = new Image(); + img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); + } + }); + + DOM.get(id).style.filter = ''; + } + } + }); + + // Register plugin + tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); +})(); + diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css index 74416fc..a50d4fc 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css @@ -1,90 +1,90 @@ -/* Clearlooks 2 */ - -/* Reset */ -.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} - -/* General */ -.clearlooks2 {position:absolute; direction:ltr} -.clearlooks2 .mceWrapper {position:static} -.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} -.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} -.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} - -/* Top */ -.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} -.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} -.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} -.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} -.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} -.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} -.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} -.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} -.clearlooks2 .mceFocus .mceTop span {color:#FFF} - -/* Middle */ -.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} -.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} -.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} -.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} -.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} - -/* Bottom */ -.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} -.clearlooks2 .mceBottom {left:0; bottom:0; width:100%} -.clearlooks2 .mceBottom div {top:0} -.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} -.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} -.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} -.clearlooks2 .mceBottom span {display:none} -.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} -.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} -.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} -.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} -.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} - -/* Actions */ -.clearlooks2 a {width:29px; height:16px; top:3px;} -.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} -.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} -.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} -.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} -.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} -.clearlooks2 .mceMovable .mceMove {display:block} -.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} -.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} -.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} -.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} -.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} -.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} -.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} -.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} -.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} - -/* Resize */ -.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} -.clearlooks2 .mceResizable .mceResize {display:block} -.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} -.clearlooks2 .mceMinimizable .mceMin {display:block} -.clearlooks2 .mceMaximizable .mceMax {display:block} -.clearlooks2 .mceMaximized .mceMed {display:block} -.clearlooks2 .mceMaximized .mceMax {display:none} -.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} -.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} -.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} -.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} -.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} -.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} -.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} -.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} - -/* Alert/Confirm */ -.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} -.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} -.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} -.clearlooks2 a:hover {font-weight:bold;} -.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} -.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} -.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} -.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} -.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} -.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} +/* Clearlooks 2 */ + +/* Reset */ +.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} + +/* General */ +.clearlooks2 {position:absolute; direction:ltr} +.clearlooks2 .mceWrapper {position:static} +.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} +.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} +.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} + +/* Top */ +.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} +.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} +.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} +.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} +.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} +.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} +.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} +.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} +.clearlooks2 .mceFocus .mceTop span {color:#FFF} + +/* Middle */ +.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} +.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} +.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} +.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} +.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} + +/* Bottom */ +.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} +.clearlooks2 .mceBottom {left:0; bottom:0; width:100%} +.clearlooks2 .mceBottom div {top:0} +.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} +.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} +.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} +.clearlooks2 .mceBottom span {display:none} +.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} +.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} +.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} +.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} +.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} + +/* Actions */ +.clearlooks2 a {width:29px; height:16px; top:3px;} +.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} +.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} +.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} +.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} +.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} +.clearlooks2 .mceMovable .mceMove {display:block} +.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} +.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} +.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} +.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} +.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} +.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} + +/* Resize */ +.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} +.clearlooks2 .mceResizable .mceResize {display:block} +.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} +.clearlooks2 .mceMinimizable .mceMin {display:block} +.clearlooks2 .mceMaximizable .mceMax {display:block} +.clearlooks2 .mceMaximized .mceMed {display:block} +.clearlooks2 .mceMaximized .mceMax {display:none} +.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} +.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} +.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} +.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} +.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} +.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} +.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} +.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} + +/* Alert/Confirm */ +.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} +.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} +.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} +.clearlooks2 a:hover {font-weight:bold;} +.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} +.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} +.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} +.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} +.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} +.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/insertdatetime/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/insertdatetime/editor_plugin_src.js index 181c791..524eff3 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/insertdatetime/editor_plugin_src.js @@ -1,83 +1,83 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.InsertDateTime', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - ed.addCommand('mceInsertDate', function() { - var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt'))); - - ed.execCommand('mceInsertContent', false, str); - }); - - ed.addCommand('mceInsertTime', function() { - var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt'))); - - ed.execCommand('mceInsertContent', false, str); - }); - - ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'}); - ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'}); - }, - - getInfo : function() { - return { - longname : 'Insert date/time', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _getDateTime : function(d, fmt) { - var ed = this.editor; - - function addZeros(value, len) { - value = "" + value; - - if (value.length < len) { - for (var i=0; i<(len-value.length); i++) - value = "0" + value; - } - - return value; - }; - - fmt = fmt.replace("%D", "%m/%d/%y"); - fmt = fmt.replace("%r", "%I:%M:%S %p"); - fmt = fmt.replace("%Y", "" + d.getFullYear()); - fmt = fmt.replace("%y", "" + d.getYear()); - fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); - fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); - fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); - fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); - fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); - fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); - fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); - fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]); - fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]); - fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]); - fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]); - fmt = fmt.replace("%%", "%"); - - return fmt; - } - }); - - // Register plugin - tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.InsertDateTime', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + ed.addCommand('mceInsertDate', function() { + var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt'))); + + ed.execCommand('mceInsertContent', false, str); + }); + + ed.addCommand('mceInsertTime', function() { + var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt'))); + + ed.execCommand('mceInsertContent', false, str); + }); + + ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'}); + ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'}); + }, + + getInfo : function() { + return { + longname : 'Insert date/time', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _getDateTime : function(d, fmt) { + var ed = this.editor; + + function addZeros(value, len) { + value = "" + value; + + if (value.length < len) { + for (var i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + }; + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/layer/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/layer/editor_plugin_src.js index daed280..0b5d5b6 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/layer/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/layer/editor_plugin_src.js @@ -1,262 +1,262 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - function findParentLayer(node) { - do { - if (node.className && node.className.indexOf('mceItemLayer') != -1) { - return node; - } - } while (node = node.parentNode); - }; - - tinymce.create('tinymce.plugins.Layer', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceInsertLayer', t._insertLayer, t); - - ed.addCommand('mceMoveForward', function() { - t._move(1); - }); - - ed.addCommand('mceMoveBackward', function() { - t._move(-1); - }); - - ed.addCommand('mceMakeAbsolute', function() { - t._toggleAbsolute(); - }); - - // Register buttons - ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); - ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); - ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); - ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); - - ed.onInit.add(function() { - var dom = ed.dom; - - if (tinymce.isIE) - ed.getDoc().execCommand('2D-Position', false, true); - }); - - // Remove serialized styles when selecting a layer since it might be changed by a drag operation - ed.onMouseUp.add(function(ed, e) { - var layer = findParentLayer(e.target); - - if (layer) { - ed.dom.setAttrib(layer, 'data-mce-style', ''); - } - }); - - // Fixes edit focus issues with layers on Gecko - // This will enable designMode while inside a layer and disable it when outside - ed.onMouseDown.add(function(ed, e) { - var node = e.target, doc = ed.getDoc(), parent; - - if (tinymce.isGecko) { - if (findParentLayer(node)) { - if (doc.designMode !== 'on') { - doc.designMode = 'on'; - - // Repaint caret - node = doc.body; - parent = node.parentNode; - parent.removeChild(node); - parent.appendChild(node); - } - } else if (doc.designMode == 'on') { - doc.designMode = 'off'; - } - } - }); - - ed.onNodeChange.add(t._nodeChange, t); - ed.onVisualAid.add(t._visualAid, t); - }, - - getInfo : function() { - return { - longname : 'Layer', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var le, p; - - le = this._getParentLayer(n); - p = ed.dom.getParent(n, 'DIV,P,IMG'); - - if (!p) { - cm.setDisabled('absolute', 1); - cm.setDisabled('moveforward', 1); - cm.setDisabled('movebackward', 1); - } else { - cm.setDisabled('absolute', 0); - cm.setDisabled('moveforward', !le); - cm.setDisabled('movebackward', !le); - cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); - } - }, - - // Private methods - - _visualAid : function(ed, e, s) { - var dom = ed.dom; - - tinymce.each(dom.select('div,p', e), function(e) { - if (/^(absolute|relative|fixed)$/i.test(e.style.position)) { - if (s) - dom.addClass(e, 'mceItemVisualAid'); - else - dom.removeClass(e, 'mceItemVisualAid'); - - dom.addClass(e, 'mceItemLayer'); - } - }); - }, - - _move : function(d) { - var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; - - nl = []; - tinymce.walk(ed.getBody(), function(n) { - if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) - nl.push(n); - }, 'childNodes'); - - // Find z-indexes - for (i=0; i -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else { - if (z[ci] > 0) - nl[ci].style.zIndex = z[ci] - 1; - } - } else { - // Move forward - - // Try find a higher one - for (i=0; i z[ci]) { - fi = i; - break; - } - } - - if (fi > -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else - nl[ci].style.zIndex = z[ci] + 1; - } - - ed.execCommand('mceRepaint'); - }, - - _getParentLayer : function(n) { - return this.editor.dom.getParent(n, function(n) { - return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); - }); - }, - - _insertLayer : function() { - var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody(); - - ed.dom.add(body, 'div', { - style : { - position : 'absolute', - left : p.x, - top : (p.y > 20 ? p.y : 20), - width : 100, - height : 100 - }, - 'class' : 'mceItemVisualAid mceItemLayer' - }, ed.selection.getContent() || ed.getLang('layer.content')); - - // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7 - if (tinymce.isIE) - dom.setHTML(body, body.innerHTML); - }, - - _toggleAbsolute : function() { - var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); - - if (!le) - le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); - - if (le) { - if (le.style.position.toLowerCase() == "absolute") { - ed.dom.setStyles(le, { - position : '', - left : '', - top : '', - width : '', - height : '' - }); - - ed.dom.removeClass(le, 'mceItemVisualAid'); - ed.dom.removeClass(le, 'mceItemLayer'); - } else { - if (le.style.left == "") - le.style.left = 20 + 'px'; - - if (le.style.top == "") - le.style.top = 20 + 'px'; - - if (le.style.width == "") - le.style.width = le.width ? (le.width + 'px') : '100px'; - - if (le.style.height == "") - le.style.height = le.height ? (le.height + 'px') : '100px'; - - le.style.position = "absolute"; - - ed.dom.setAttrib(le, 'data-mce-style', ''); - ed.addVisual(ed.getBody()); - } - - ed.execCommand('mceRepaint'); - ed.nodeChanged(); - } - } - }); - - // Register plugin - tinymce.PluginManager.add('layer', tinymce.plugins.Layer); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + function findParentLayer(node) { + do { + if (node.className && node.className.indexOf('mceItemLayer') != -1) { + return node; + } + } while (node = node.parentNode); + }; + + tinymce.create('tinymce.plugins.Layer', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceInsertLayer', t._insertLayer, t); + + ed.addCommand('mceMoveForward', function() { + t._move(1); + }); + + ed.addCommand('mceMoveBackward', function() { + t._move(-1); + }); + + ed.addCommand('mceMakeAbsolute', function() { + t._toggleAbsolute(); + }); + + // Register buttons + ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); + ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); + ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); + ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); + + ed.onInit.add(function() { + var dom = ed.dom; + + if (tinymce.isIE) + ed.getDoc().execCommand('2D-Position', false, true); + }); + + // Remove serialized styles when selecting a layer since it might be changed by a drag operation + ed.onMouseUp.add(function(ed, e) { + var layer = findParentLayer(e.target); + + if (layer) { + ed.dom.setAttrib(layer, 'data-mce-style', ''); + } + }); + + // Fixes edit focus issues with layers on Gecko + // This will enable designMode while inside a layer and disable it when outside + ed.onMouseDown.add(function(ed, e) { + var node = e.target, doc = ed.getDoc(), parent; + + if (tinymce.isGecko) { + if (findParentLayer(node)) { + if (doc.designMode !== 'on') { + doc.designMode = 'on'; + + // Repaint caret + node = doc.body; + parent = node.parentNode; + parent.removeChild(node); + parent.appendChild(node); + } + } else if (doc.designMode == 'on') { + doc.designMode = 'off'; + } + } + }); + + ed.onNodeChange.add(t._nodeChange, t); + ed.onVisualAid.add(t._visualAid, t); + }, + + getInfo : function() { + return { + longname : 'Layer', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var le, p; + + le = this._getParentLayer(n); + p = ed.dom.getParent(n, 'DIV,P,IMG'); + + if (!p) { + cm.setDisabled('absolute', 1); + cm.setDisabled('moveforward', 1); + cm.setDisabled('movebackward', 1); + } else { + cm.setDisabled('absolute', 0); + cm.setDisabled('moveforward', !le); + cm.setDisabled('movebackward', !le); + cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); + } + }, + + // Private methods + + _visualAid : function(ed, e, s) { + var dom = ed.dom; + + tinymce.each(dom.select('div,p', e), function(e) { + if (/^(absolute|relative|fixed)$/i.test(e.style.position)) { + if (s) + dom.addClass(e, 'mceItemVisualAid'); + else + dom.removeClass(e, 'mceItemVisualAid'); + + dom.addClass(e, 'mceItemLayer'); + } + }); + }, + + _move : function(d) { + var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; + + nl = []; + tinymce.walk(ed.getBody(), function(n) { + if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) + nl.push(n); + }, 'childNodes'); + + // Find z-indexes + for (i=0; i -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else { + if (z[ci] > 0) + nl[ci].style.zIndex = z[ci] - 1; + } + } else { + // Move forward + + // Try find a higher one + for (i=0; i z[ci]) { + fi = i; + break; + } + } + + if (fi > -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else + nl[ci].style.zIndex = z[ci] + 1; + } + + ed.execCommand('mceRepaint'); + }, + + _getParentLayer : function(n) { + return this.editor.dom.getParent(n, function(n) { + return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); + }); + }, + + _insertLayer : function() { + var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody(); + + ed.dom.add(body, 'div', { + style : { + position : 'absolute', + left : p.x, + top : (p.y > 20 ? p.y : 20), + width : 100, + height : 100 + }, + 'class' : 'mceItemVisualAid mceItemLayer' + }, ed.selection.getContent() || ed.getLang('layer.content')); + + // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7 + if (tinymce.isIE) + dom.setHTML(body, body.innerHTML); + }, + + _toggleAbsolute : function() { + var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); + + if (!le) + le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); + + if (le) { + if (le.style.position.toLowerCase() == "absolute") { + ed.dom.setStyles(le, { + position : '', + left : '', + top : '', + width : '', + height : '' + }); + + ed.dom.removeClass(le, 'mceItemVisualAid'); + ed.dom.removeClass(le, 'mceItemLayer'); + } else { + if (le.style.left == "") + le.style.left = 20 + 'px'; + + if (le.style.top == "") + le.style.top = 20 + 'px'; + + if (le.style.width == "") + le.style.width = le.width ? (le.width + 'px') : '100px'; + + if (le.style.height == "") + le.style.height = le.height ? (le.height + 'px') : '100px'; + + le.style.position = "absolute"; + + ed.dom.setAttrib(le, 'data-mce-style', ''); + ed.addVisual(ed.getBody()); + } + + ed.execCommand('mceRepaint'); + ed.nodeChanged(); + } + } + }); + + // Register plugin + tinymce.PluginManager.add('layer', tinymce.plugins.Layer); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/legacyoutput/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/legacyoutput/editor_plugin_src.js index 8f0dc75..809630b 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/legacyoutput/editor_plugin_src.js @@ -1,139 +1,139 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - * - * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align - * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash - * - * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are - * not apart of the newer specifications for HTML and XHTML. - */ - -(function(tinymce) { - // Override inline_styles setting to force TinyMCE to produce deprecated contents - tinymce.onAddEditor.addToTop(function(tinymce, editor) { - editor.settings.inline_styles = false; - }); - - // Create the legacy ouput plugin - tinymce.create('tinymce.plugins.LegacyOutput', { - init : function(editor) { - editor.onInit.add(function() { - var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', - fontSizes = tinymce.explode(editor.settings.font_size_style_values), - schema = editor.schema; - - // Override some internal formats to produce legacy elements and attributes - editor.formatter.register({ - // Change alignment formats to use the deprecated align attribute - alignleft : {selector : alignElements, attributes : {align : 'left'}}, - aligncenter : {selector : alignElements, attributes : {align : 'center'}}, - alignright : {selector : alignElements, attributes : {align : 'right'}}, - alignfull : {selector : alignElements, attributes : {align : 'justify'}}, - - // Change the basic formatting elements to use deprecated element types - bold : [ - {inline : 'b', remove : 'all'}, - {inline : 'strong', remove : 'all'}, - {inline : 'span', styles : {fontWeight : 'bold'}} - ], - italic : [ - {inline : 'i', remove : 'all'}, - {inline : 'em', remove : 'all'}, - {inline : 'span', styles : {fontStyle : 'italic'}} - ], - underline : [ - {inline : 'u', remove : 'all'}, - {inline : 'span', styles : {textDecoration : 'underline'}, exact : true} - ], - strikethrough : [ - {inline : 'strike', remove : 'all'}, - {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true} - ], - - // Change font size and font family to use the deprecated font element - fontname : {inline : 'font', attributes : {face : '%value'}}, - fontsize : { - inline : 'font', - attributes : { - size : function(vars) { - return tinymce.inArray(fontSizes, vars.value) + 1; - } - } - }, - - // Setup font elements for colors as well - forecolor : {inline : 'font', attributes : {color : '%value'}}, - hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}} - }); - - // Check that deprecated elements are allowed if not add them - tinymce.each('b,i,u,strike'.split(','), function(name) { - schema.addValidElements(name + '[*]'); - }); - - // Add font element if it's missing - if (!schema.getElementRule("font")) - schema.addValidElements("font[face|size|color|style]"); - - // Add the missing and depreacted align attribute for the serialization engine - tinymce.each(alignElements.split(','), function(name) { - var rule = schema.getElementRule(name), found; - - if (rule) { - if (!rule.attributes.align) { - rule.attributes.align = {}; - rule.attributesOrder.push('align'); - } - } - }); - - // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes - editor.onNodeChange.add(function(editor, control_manager) { - var control, fontElm, fontName, fontSize; - - // Find font element get it's name and size - fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); - if (fontElm) { - fontName = fontElm.face; - fontSize = fontElm.size; - } - - // Select/unselect the font name in droplist - if (control = control_manager.get('fontselect')) { - control.select(function(value) { - return value == fontName; - }); - } - - // Select/unselect the font size in droplist - if (control = control_manager.get('fontsizeselect')) { - control.select(function(value) { - var index = tinymce.inArray(fontSizes, value.fontSize); - - return index + 1 == fontSize; - }); - } - }); - }); - }, - - getInfo : function() { - return { - longname : 'LegacyOutput', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput); -})(tinymce); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + * + * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align + * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash + * + * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are + * not apart of the newer specifications for HTML and XHTML. + */ + +(function(tinymce) { + // Override inline_styles setting to force TinyMCE to produce deprecated contents + tinymce.onAddEditor.addToTop(function(tinymce, editor) { + editor.settings.inline_styles = false; + }); + + // Create the legacy ouput plugin + tinymce.create('tinymce.plugins.LegacyOutput', { + init : function(editor) { + editor.onInit.add(function() { + var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', + fontSizes = tinymce.explode(editor.settings.font_size_style_values), + schema = editor.schema; + + // Override some internal formats to produce legacy elements and attributes + editor.formatter.register({ + // Change alignment formats to use the deprecated align attribute + alignleft : {selector : alignElements, attributes : {align : 'left'}}, + aligncenter : {selector : alignElements, attributes : {align : 'center'}}, + alignright : {selector : alignElements, attributes : {align : 'right'}}, + alignfull : {selector : alignElements, attributes : {align : 'justify'}}, + + // Change the basic formatting elements to use deprecated element types + bold : [ + {inline : 'b', remove : 'all'}, + {inline : 'strong', remove : 'all'}, + {inline : 'span', styles : {fontWeight : 'bold'}} + ], + italic : [ + {inline : 'i', remove : 'all'}, + {inline : 'em', remove : 'all'}, + {inline : 'span', styles : {fontStyle : 'italic'}} + ], + underline : [ + {inline : 'u', remove : 'all'}, + {inline : 'span', styles : {textDecoration : 'underline'}, exact : true} + ], + strikethrough : [ + {inline : 'strike', remove : 'all'}, + {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true} + ], + + // Change font size and font family to use the deprecated font element + fontname : {inline : 'font', attributes : {face : '%value'}}, + fontsize : { + inline : 'font', + attributes : { + size : function(vars) { + return tinymce.inArray(fontSizes, vars.value) + 1; + } + } + }, + + // Setup font elements for colors as well + forecolor : {inline : 'font', attributes : {color : '%value'}}, + hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}} + }); + + // Check that deprecated elements are allowed if not add them + tinymce.each('b,i,u,strike'.split(','), function(name) { + schema.addValidElements(name + '[*]'); + }); + + // Add font element if it's missing + if (!schema.getElementRule("font")) + schema.addValidElements("font[face|size|color|style]"); + + // Add the missing and depreacted align attribute for the serialization engine + tinymce.each(alignElements.split(','), function(name) { + var rule = schema.getElementRule(name), found; + + if (rule) { + if (!rule.attributes.align) { + rule.attributes.align = {}; + rule.attributesOrder.push('align'); + } + } + }); + + // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes + editor.onNodeChange.add(function(editor, control_manager) { + var control, fontElm, fontName, fontSize; + + // Find font element get it's name and size + fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); + if (fontElm) { + fontName = fontElm.face; + fontSize = fontElm.size; + } + + // Select/unselect the font name in droplist + if (control = control_manager.get('fontselect')) { + control.select(function(value) { + return value == fontName; + }); + } + + // Select/unselect the font size in droplist + if (control = control_manager.get('fontsizeselect')) { + control.select(function(value) { + var index = tinymce.inArray(fontSizes, value.fontSize); + + return index + 1 == fontSize; + }); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'LegacyOutput', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput); +})(tinymce); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/lists/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/lists/editor_plugin_src.js index d9ea6d1..08949a0 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/lists/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/lists/editor_plugin_src.js @@ -1,955 +1,955 @@ -/** - * editor_plugin_src.js - * - * Copyright 2011, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each, Event = tinymce.dom.Event, bookmark; - - // Skips text nodes that only contain whitespace since they aren't semantically important. - function skipWhitespaceNodes(e, next) { - while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) { - e = next(e); - } - return e; - } - - function skipWhitespaceNodesBackwards(e) { - return skipWhitespaceNodes(e, function(e) { - return e.previousSibling; - }); - } - - function skipWhitespaceNodesForwards(e) { - return skipWhitespaceNodes(e, function(e) { - return e.nextSibling; - }); - } - - function hasParentInList(ed, e, list) { - return ed.dom.getParent(e, function(p) { - return tinymce.inArray(list, p) !== -1; - }); - } - - function isList(e) { - return e && (e.tagName === 'OL' || e.tagName === 'UL'); - } - - function splitNestedLists(element, dom) { - var tmp, nested, wrapItem; - tmp = skipWhitespaceNodesBackwards(element.lastChild); - while (isList(tmp)) { - nested = tmp; - tmp = skipWhitespaceNodesBackwards(nested.previousSibling); - } - if (nested) { - wrapItem = dom.create('li', { style: 'list-style-type: none;'}); - dom.split(element, nested); - dom.insertAfter(wrapItem, nested); - wrapItem.appendChild(nested); - wrapItem.appendChild(nested); - element = wrapItem.previousSibling; - } - return element; - } - - function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) { - e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs); - return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs); - } - - function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) { - var prev = skipWhitespaceNodesBackwards(e.previousSibling); - if (prev) { - return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs); - } else { - return e; - } - } - - function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) { - var next = skipWhitespaceNodesForwards(e.nextSibling); - if (next) { - return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs); - } else { - return e; - } - } - - function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) { - if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) { - return merge(e1, e2, differentStylesMasterElement); - } else if (e1 && e1.tagName === 'LI' && isList(e2)) { - // Fix invalidly nested lists. - e1.appendChild(e2); - } - return e2; - } - - function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) { - if (!e1 || !e2) { - return false; - } else if (e1.tagName === 'LI' && e2.tagName === 'LI') { - return e2.style.listStyleType === 'none' || containsOnlyAList(e2); - } else if (isList(e1)) { - return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2); - } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P'; - } - - function isListForIndent(e) { - var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild); - return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI)); - } - - function containsOnlyAList(e) { - var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild); - return firstChild && lastChild && firstChild === lastChild && isList(firstChild); - } - - function merge(e1, e2, masterElement) { - var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild); - if (e1.tagName === 'P') { - e1.appendChild(e1.ownerDocument.createElement('br')); - } - while (e2.firstChild) { - e1.appendChild(e2.firstChild); - } - if (masterElement) { - e1.style.listStyleType = masterElement.style.listStyleType; - } - e2.parentNode.removeChild(e2); - attemptMerge(lastOriginal, firstNew, false); - return e1; - } - - function findItemToOperateOn(e, dom) { - var item; - if (!dom.is(e, 'li,ol,ul')) { - item = dom.getParent(e, 'li'); - if (item) { - e = item; - } - } - return e; - } - - tinymce.create('tinymce.plugins.Lists', { - init: function(ed) { - var LIST_TABBING = 'TABBING'; - var LIST_EMPTY_ITEM = 'EMPTY'; - var LIST_ESCAPE = 'ESCAPE'; - var LIST_PARAGRAPH = 'PARAGRAPH'; - var LIST_UNKNOWN = 'UNKNOWN'; - var state = LIST_UNKNOWN; - - function isTabInList(e) { - // Don't indent on Ctrl+Tab or Alt+Tab - return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) && - (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList')); - } - - function isOnLastListItem() { - var li = getLi(); - var grandParent = li.parentNode.parentNode; - var isLastItem = li.parentNode.lastChild === li; - return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li); - } - - function isNestedList(grandParent) { - if (isList(grandParent)) { - return grandParent.parentNode && grandParent.parentNode.tagName === 'LI'; - } else { - return grandParent.tagName === 'LI'; - } - } - - function isInEmptyListItem() { - return ed.selection.isCollapsed() && isEmptyListItem(getLi()); - } - - function getLi() { - var n = ed.selection.getStart(); - // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position - return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n; - } - - function isEmptyListItem(li) { - var numChildren = li.childNodes.length; - if (li.tagName === 'LI') { - return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li)); - } - return false; - } - - function isEmptyIE9Li(li) { - // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these - var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'}); - var isLastLi = li == lis[lis.length - 1]; - var child = li.firstChild; - return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32)); - } - - function isEnter(e) { - return e.keyCode === tinymce.VK.ENTER; - } - - function isEnterWithoutShift(e) { - return isEnter(e) && !e.shiftKey; - } - - function getListKeyState(e) { - if (isTabInList(e)) { - return LIST_TABBING; - } else if (isEnterWithoutShift(e) && isOnLastListItem()) { - // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now - //return LIST_ESCAPE; - return LIST_UNKNOWN; - } else if (isEnterWithoutShift(e) && isInEmptyListItem()) { - return LIST_EMPTY_ITEM; - } else { - return LIST_UNKNOWN; - } - } - - function cancelDefaultEvents(ed, e) { - // list escape is done manually using outdent as it does not create paragraphs correctly in td's - if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) { - Event.cancel(e); - } - } - - function isCursorAtEndOfContainer() { - var range = ed.selection.getRng(true); - var startContainer = range.startContainer; - if (startContainer.nodeType == 3) { - var value = startContainer.nodeValue; - if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) { - // IE9 places a space on the end of the text in some cases so ignore last char - return (range.endOffset == value.length-1); - } else { - return (range.endOffset == value.length); - } - } else if (startContainer.nodeType == 1) { - return range.endOffset == startContainer.childNodes.length; - } - return false; - } - - /* - If we are at the end of a list item surrounded with an element, pressing enter should create a - new list item instead without splitting the element e.g. don't want to create new P or H1 tag - */ - function isEndOfListItem() { - var node = ed.selection.getNode(); - var validElements = 'h1,h2,h3,h4,h5,h6,p,div'; - var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node; - return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer(); - } - - // Creates a new list item after the current selection's list item parent - function createNewLi(ed, e) { - if (isEnterWithoutShift(e) && isEndOfListItem()) { - var node = ed.selection.getNode(); - var li = ed.dom.create("li"); - var parentLi = ed.dom.getParent(node, 'li'); - ed.dom.insertAfter(li, parentLi); - - // Move caret to new list element. - if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) { - // Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic - //li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point - ed.selection.setCursorLocation(li, 1); - } else { - ed.selection.setCursorLocation(li, 0); - } - e.preventDefault(); - } - } - - function imageJoiningListItem(ed, e) { - var prevSibling; - - if (!tinymce.isGecko) - return; - - var n = ed.selection.getStart(); - if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG') - return; - - function lastLI(node) { - var child = node.firstChild; - var li = null; - do { - if (!child) - break; - - if (child.tagName === 'LI') - li = child; - } while (child = child.nextSibling); - - return li; - } - - function addChildren(parentNode, destination) { - while (parentNode.childNodes.length > 0) - destination.appendChild(parentNode.childNodes[0]); - } - - // Check if there is a previous sibling - prevSibling = n.parentNode.previousSibling; - if (!prevSibling) - return; - - var ul; - if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL') - ul = prevSibling; - else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL')) - ul = prevSibling.previousSibling; - else - return; - - var li = lastLI(ul); - - // move the caret to the end of the list item - var rng = ed.dom.createRng(); - rng.setStart(li, 1); - rng.setEnd(li, 1); - ed.selection.setRng(rng); - ed.selection.collapse(true); - - // save a bookmark at the end of the list item - var bookmark = ed.selection.getBookmark(); - - // copy the image an its text to the list item - var clone = n.parentNode.cloneNode(true); - if (clone.tagName === 'P' || clone.tagName === 'DIV') - addChildren(clone, li); - else - li.appendChild(clone); - - // remove the old copy of the image - n.parentNode.parentNode.removeChild(n.parentNode); - - // move the caret where we saved the bookmark - ed.selection.moveToBookmark(bookmark); - } - - // fix the cursor position to ensure it is correct in IE - function setCursorPositionToOriginalLi(li) { - var list = ed.dom.getParent(li, 'ol,ul'); - if (list != null) { - var lastLi = list.lastChild; - // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic - //lastLi.appendChild(ed.getDoc().createElement('')); - ed.selection.setCursorLocation(lastLi, 0); - } - } - - this.ed = ed; - ed.addCommand('Indent', this.indent, this); - ed.addCommand('Outdent', this.outdent, this); - ed.addCommand('InsertUnorderedList', function() { - this.applyList('UL', 'OL'); - }, this); - ed.addCommand('InsertOrderedList', function() { - this.applyList('OL', 'UL'); - }, this); - - ed.onInit.add(function() { - ed.editorCommands.addCommands({ - 'outdent': function() { - var sel = ed.selection, dom = ed.dom; - - function hasStyleIndent(n) { - n = dom.getParent(n, dom.isBlock); - return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0; - } - - return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList'); - } - }, 'state'); - }); - - ed.onKeyUp.add(function(ed, e) { - if (state == LIST_TABBING) { - ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null); - state = LIST_UNKNOWN; - return Event.cancel(e); - } else if (state == LIST_EMPTY_ITEM) { - var li = getLi(); - var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey; - ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null); - if (tinymce.isIE) { - setCursorPositionToOriginalLi(li); - } - - return Event.cancel(e); - } else if (state == LIST_ESCAPE) { - if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) { - // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting. - // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after - // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag. - var n = ed.getDoc().createTextNode('\uFEFF'); - ed.selection.getNode().appendChild(n); - } else if (tinymce.isIE9 || tinymce.isGecko) { - // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour - // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves - ed.execCommand('Outdent'); - return Event.cancel(e); - } - } - }); - - function fixListItem(parent, reference) { - // a zero-sized non-breaking space is placed in the empty list item so that the nested list is - // displayed on the below line instead of next to it - var n = ed.getDoc().createTextNode('\uFEFF'); - parent.insertBefore(n, reference); - ed.selection.setCursorLocation(n, 0); - // repaint to remove rendering artifact. only visible when creating new list - ed.execCommand('mceRepaint'); - } - - function fixIndentedListItemForGecko(ed, e) { - if (isEnter(e)) { - var li = getLi(); - if (li) { - var parent = li.parentNode; - var grandParent = parent && parent.parentNode; - if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) { - fixListItem(grandParent, parent); - } - } - } - } - - function fixIndentedListItemForIE8(ed, e) { - if (isEnter(e)) { - var li = getLi(); - if (ed.dom.select('ul li', li).length === 1) { - var list = li.firstChild; - fixListItem(li, list); - } - } - } - - function fixDeletingFirstCharOfList(ed, e) { - function listElements(li) { - var elements = []; - var walker = new tinymce.dom.TreeWalker(li.firstChild, li); - for (var node = walker.current(); node; node = walker.next()) { - if (ed.dom.is(node, 'ol,ul,li')) { - elements.push(node); - } - } - return elements; - } - - if (e.keyCode == tinymce.VK.BACKSPACE) { - var li = getLi(); - if (li) { - var list = ed.dom.getParent(li, 'ol,ul'), - rng = ed.selection.getRng(); - if (list && list.firstChild === li && rng.startOffset == 0) { - var elements = listElements(li); - elements.unshift(li); - ed.execCommand("Outdent", false, elements); - ed.undoManager.add(); - return Event.cancel(e); - } - } - } - } - - function fixDeletingEmptyLiInWebkit(ed, e) { - var li = getLi(); - if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) { - if (ed.dom.select('ul,ol', li).length === 1) { - var prevLi = li.previousSibling; - ed.dom.remove(ed.dom.select('br', li)); - ed.dom.remove(li, true); - var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 }); - if (textNodes.length === 1) { - var textNode = textNodes[0]; - ed.selection.setCursorLocation(textNode, textNode.length); - } - ed.undoManager.add(); - return Event.cancel(e); - } - } - } - - ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); }); - ed.onKeyDown.add(cancelDefaultEvents); - ed.onKeyDown.add(imageJoiningListItem); - ed.onKeyDown.add(createNewLi); - - if (tinymce.isGecko) { - ed.onKeyUp.add(fixIndentedListItemForGecko); - } - if (tinymce.isIE8) { - ed.onKeyUp.add(fixIndentedListItemForIE8); - } - if (tinymce.isGecko || tinymce.isWebKit) { - ed.onKeyDown.add(fixDeletingFirstCharOfList); - } - if (tinymce.isWebKit) { - ed.onKeyDown.add(fixDeletingEmptyLiInWebkit); - } - }, - - applyList: function(targetListType, oppositeListType) { - var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions, - selectedBlocks = ed.selection.getSelectedBlocks(); - - function cleanupBr(e) { - if (e && e.tagName === 'BR') { - dom.remove(e); - } - } - - function makeList(element) { - var list = dom.create(targetListType), li; - - function adjustIndentForNewList(element) { - // If there's a margin-left, outdent one level to account for the extra list margin. - if (element.style.marginLeft || element.style.paddingLeft) { - t.adjustPaddingFunction(false)(element); - } - } - - if (element.tagName === 'LI') { - // No change required. - } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') { - processBrs(element, function(startSection, br) { - doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode); - li = startSection.parentNode; - adjustIndentForNewList(li); - cleanupBr(br); - }); - if (li) { - if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) { - dom.split(li.parentNode.parentNode, li.parentNode); - } - attemptMergeWithAdjacent(li.parentNode, true); - } - return; - } else { - // Put the list around the element. - li = dom.create('li'); - dom.insertAfter(li, element); - li.appendChild(element); - adjustIndentForNewList(element); - element = li; - } - dom.insertAfter(list, element); - list.appendChild(element); - attemptMergeWithAdjacent(list, true); - applied.push(element); - } - - function doWrapList(start, end, template) { - var li, n = start, tmp; - while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) { - start = dom.split(start.parentNode, start.previousSibling); - start = start.nextSibling; - n = start; - } - if (template) { - li = template.cloneNode(true); - start.parentNode.insertBefore(li, start); - while (li.firstChild) dom.remove(li.firstChild); - li = dom.rename(li, 'li'); - } else { - li = dom.create('li'); - start.parentNode.insertBefore(li, start); - } - while (n && n != end) { - tmp = n.nextSibling; - li.appendChild(n); - n = tmp; - } - if (li.childNodes.length === 0) { - li.innerHTML = '
      '; - } - makeList(li); - } - - function processBrs(element, callback) { - var startSection, previousBR, END_TO_START = 3, START_TO_END = 1, - breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl'; - - function isAnyPartSelected(start, end) { - var r = dom.createRng(), sel; - bookmark.keep = true; - ed.selection.moveToBookmark(bookmark); - bookmark.keep = false; - sel = ed.selection.getRng(true); - if (!end) { - end = start.parentNode.lastChild; - } - r.setStartBefore(start); - r.setEndAfter(end); - return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0); - } - - function nextLeaf(br) { - if (br.nextSibling) - return br.nextSibling; - if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot()) - return nextLeaf(br.parentNode); - } - - // Split on BRs within the range and process those. - startSection = element.firstChild; - // First mark the BRs that have any part of the previous section selected. - var trailingContentSelected = false; - each(dom.select(breakElements, element), function(br) { - if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { - return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. - } - if (isAnyPartSelected(startSection, br)) { - dom.addClass(br, '_mce_tagged_br'); - startSection = nextLeaf(br); - } - }); - trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined)); - startSection = element.firstChild; - each(dom.select(breakElements, element), function(br) { - // Got a section from start to br. - var tmp = nextLeaf(br); - if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { - return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. - } - if (dom.hasClass(br, '_mce_tagged_br')) { - callback(startSection, br, previousBR); - previousBR = null; - } else { - previousBR = br; - } - startSection = tmp; - }); - if (trailingContentSelected) { - callback(startSection, undefined, previousBR); - } - } - - function wrapList(element) { - processBrs(element, function(startSection, br, previousBR) { - // Need to indent this part - doWrapList(startSection, br); - cleanupBr(br); - cleanupBr(previousBR); - }); - } - - function changeList(element) { - if (tinymce.inArray(applied, element) !== -1) { - return; - } - if (element.parentNode.tagName === oppositeListType) { - dom.split(element.parentNode, element); - makeList(element); - attemptMergeWithNext(element.parentNode, false); - } - applied.push(element); - } - - function convertListItemToParagraph(element) { - var child, nextChild, mergedElement, splitLast; - if (tinymce.inArray(applied, element) !== -1) { - return; - } - element = splitNestedLists(element, dom); - while (dom.is(element.parentNode, 'ol,ul,li')) { - dom.split(element.parentNode, element); - } - // Push the original element we have from the selection, not the renamed one. - applied.push(element); - element = dom.rename(element, 'p'); - mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines); - if (mergedElement === element) { - // Now split out any block elements that can't be contained within a P. - // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each) - child = element.firstChild; - while (child) { - if (dom.isBlock(child)) { - child = dom.split(child.parentNode, child); - splitLast = true; - nextChild = child.nextSibling && child.nextSibling.firstChild; - } else { - nextChild = child.nextSibling; - if (splitLast && child.tagName === 'BR') { - dom.remove(child); - } - splitLast = false; - } - child = nextChild; - } - } - } - - each(selectedBlocks, function(e) { - e = findItemToOperateOn(e, dom); - if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) { - hasOppositeType = true; - } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) { - hasSameType = true; - } else { - hasNonList = true; - } - }); - - if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) { - actions = { - 'LI': changeList, - 'H1': makeList, - 'H2': makeList, - 'H3': makeList, - 'H4': makeList, - 'H5': makeList, - 'H6': makeList, - 'P': makeList, - 'BODY': makeList, - 'DIV': selectedBlocks.length > 1 ? makeList : wrapList, - defaultAction: wrapList, - elements: this.selectedBlocks() - }; - } else { - actions = { - defaultAction: convertListItemToParagraph, - elements: this.selectedBlocks(), - processEvenIfEmpty: true - }; - } - this.process(actions); - }, - - indent: function() { - var ed = this.ed, dom = ed.dom, indented = []; - - function createWrapItem(element) { - var wrapItem = dom.create('li', { style: 'list-style-type: none;'}); - dom.insertAfter(wrapItem, element); - return wrapItem; - } - - function createWrapList(element) { - var wrapItem = createWrapItem(element), - list = dom.getParent(element, 'ol,ul'), - listType = list.tagName, - listStyle = dom.getStyle(list, 'list-style-type'), - attrs = {}, - wrapList; - if (listStyle !== '') { - attrs.style = 'list-style-type: ' + listStyle + ';'; - } - wrapList = dom.create(listType, attrs); - wrapItem.appendChild(wrapList); - return wrapList; - } - - function indentLI(element) { - if (!hasParentInList(ed, element, indented)) { - element = splitNestedLists(element, dom); - var wrapList = createWrapList(element); - wrapList.appendChild(element); - attemptMergeWithAdjacent(wrapList.parentNode, false); - attemptMergeWithAdjacent(wrapList, false); - indented.push(element); - } - } - - this.process({ - 'LI': indentLI, - defaultAction: this.adjustPaddingFunction(true), - elements: this.selectedBlocks() - }); - - }, - - outdent: function(ui, elements) { - var t = this, ed = t.ed, dom = ed.dom, outdented = []; - - function outdentLI(element) { - var listElement, targetParent, align; - if (!hasParentInList(ed, element, outdented)) { - if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') { - return t.adjustPaddingFunction(false)(element); - } - align = dom.getStyle(element, 'text-align', true); - if (align === 'center' || align === 'right') { - dom.setStyle(element, 'text-align', 'left'); - return; - } - element = splitNestedLists(element, dom); - listElement = element.parentNode; - targetParent = element.parentNode.parentNode; - if (targetParent.tagName === 'P') { - dom.split(targetParent, element.parentNode); - } else { - dom.split(listElement, element); - if (targetParent.tagName === 'LI') { - // Nested list, need to split the LI and go back out to the OL/UL element. - dom.split(targetParent, element); - } else if (!dom.is(targetParent, 'ol,ul')) { - dom.rename(element, 'p'); - } - } - outdented.push(element); - } - } - - var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks(); - this.process({ - 'LI': outdentLI, - defaultAction: this.adjustPaddingFunction(false), - elements: listElements - }); - - each(outdented, attemptMergeWithAdjacent); - }, - - process: function(actions) { - var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r; - - function isEmptyElement(element) { - var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) { - return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark' - || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == '')); - }); - return excludeBrsAndBookmarks.length === 0; - } - - function processElement(element) { - dom.removeClass(element, '_mce_act_on'); - if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) { - return; - } - element = findItemToOperateOn(element, dom); - var action = actions[element.tagName]; - if (!action) { - action = actions.defaultAction; - } - action(element); - } - - function recurse(element) { - t.splitSafeEach(element.childNodes, processElement, true); - } - - function brAtEdgeOfSelection(container, offset) { - return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length && - container.childNodes[offset].tagName === 'BR'; - } - - function isInTable() { - var n = sel.getNode(); - var p = dom.getParent(n, 'td'); - return p !== null; - } - - selectedBlocks = actions.elements; - - r = sel.getRng(true); - if (!r.collapsed) { - if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) { - r.setEnd(r.endContainer, r.endOffset - 1); - sel.setRng(r); - } - if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) { - r.setStart(r.startContainer, r.startOffset + 1); - sel.setRng(r); - } - } - - - if (tinymce.isIE8) { - // append a zero sized nbsp so that caret is restored correctly using bookmark - var s = t.ed.selection.getNode(); - if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) { - var i = t.ed.getDoc().createTextNode('\uFEFF'); - s.appendChild(i); - } - } - - bookmark = sel.getBookmark(); - actions.OL = actions.UL = recurse; - t.splitSafeEach(selectedBlocks, processElement); - sel.moveToBookmark(bookmark); - bookmark = null; - - // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6 - if (!isInTable()) { - // Avoids table or image handles being left behind in Firefox. - t.ed.execCommand('mceRepaint'); - } - }, - - splitSafeEach: function(elements, f, forceClassBase) { - if (forceClassBase || - (tinymce.isGecko && - (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) || - /Firefox\/3\.[0-4]/.test(navigator.userAgent)))) { - this.classBasedEach(elements, f); - } else { - each(elements, f); - } - }, - - classBasedEach: function(elements, f) { - var dom = this.ed.dom, nodes, element; - // Mark nodes - each(elements, function(element) { - dom.addClass(element, '_mce_act_on'); - }); - nodes = dom.select('._mce_act_on'); - while (nodes.length > 0) { - element = nodes.shift(); - dom.removeClass(element, '_mce_act_on'); - f(element); - nodes = dom.select('._mce_act_on'); - } - }, - - adjustPaddingFunction: function(isIndent) { - var indentAmount, indentUnits, ed = this.ed; - indentAmount = ed.settings.indentation; - indentUnits = /[a-z%]+/i.exec(indentAmount); - indentAmount = parseInt(indentAmount, 10); - return function(element) { - var currentIndent, newIndentAmount; - currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10); - if (isIndent) { - newIndentAmount = currentIndent + indentAmount; - } else { - newIndentAmount = currentIndent - indentAmount; - } - ed.dom.setStyle(element, 'padding-left', ''); - ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : ''); - }; - }, - - selectedBlocks: function() { - var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks(); - return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks; - }, - - getInfo: function() { - return { - longname : 'Lists', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - tinymce.PluginManager.add("lists", tinymce.plugins.Lists); -}()); +/** + * editor_plugin_src.js + * + * Copyright 2011, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, Event = tinymce.dom.Event, bookmark; + + // Skips text nodes that only contain whitespace since they aren't semantically important. + function skipWhitespaceNodes(e, next) { + while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) { + e = next(e); + } + return e; + } + + function skipWhitespaceNodesBackwards(e) { + return skipWhitespaceNodes(e, function(e) { + return e.previousSibling; + }); + } + + function skipWhitespaceNodesForwards(e) { + return skipWhitespaceNodes(e, function(e) { + return e.nextSibling; + }); + } + + function hasParentInList(ed, e, list) { + return ed.dom.getParent(e, function(p) { + return tinymce.inArray(list, p) !== -1; + }); + } + + function isList(e) { + return e && (e.tagName === 'OL' || e.tagName === 'UL'); + } + + function splitNestedLists(element, dom) { + var tmp, nested, wrapItem; + tmp = skipWhitespaceNodesBackwards(element.lastChild); + while (isList(tmp)) { + nested = tmp; + tmp = skipWhitespaceNodesBackwards(nested.previousSibling); + } + if (nested) { + wrapItem = dom.create('li', { style: 'list-style-type: none;'}); + dom.split(element, nested); + dom.insertAfter(wrapItem, nested); + wrapItem.appendChild(nested); + wrapItem.appendChild(nested); + element = wrapItem.previousSibling; + } + return element; + } + + function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) { + e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs); + return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs); + } + + function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) { + var prev = skipWhitespaceNodesBackwards(e.previousSibling); + if (prev) { + return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs); + } else { + return e; + } + } + + function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) { + var next = skipWhitespaceNodesForwards(e.nextSibling); + if (next) { + return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs); + } else { + return e; + } + } + + function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) { + if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) { + return merge(e1, e2, differentStylesMasterElement); + } else if (e1 && e1.tagName === 'LI' && isList(e2)) { + // Fix invalidly nested lists. + e1.appendChild(e2); + } + return e2; + } + + function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) { + if (!e1 || !e2) { + return false; + } else if (e1.tagName === 'LI' && e2.tagName === 'LI') { + return e2.style.listStyleType === 'none' || containsOnlyAList(e2); + } else if (isList(e1)) { + return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2); + } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P'; + } + + function isListForIndent(e) { + var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild); + return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI)); + } + + function containsOnlyAList(e) { + var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild); + return firstChild && lastChild && firstChild === lastChild && isList(firstChild); + } + + function merge(e1, e2, masterElement) { + var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild); + if (e1.tagName === 'P') { + e1.appendChild(e1.ownerDocument.createElement('br')); + } + while (e2.firstChild) { + e1.appendChild(e2.firstChild); + } + if (masterElement) { + e1.style.listStyleType = masterElement.style.listStyleType; + } + e2.parentNode.removeChild(e2); + attemptMerge(lastOriginal, firstNew, false); + return e1; + } + + function findItemToOperateOn(e, dom) { + var item; + if (!dom.is(e, 'li,ol,ul')) { + item = dom.getParent(e, 'li'); + if (item) { + e = item; + } + } + return e; + } + + tinymce.create('tinymce.plugins.Lists', { + init: function(ed) { + var LIST_TABBING = 'TABBING'; + var LIST_EMPTY_ITEM = 'EMPTY'; + var LIST_ESCAPE = 'ESCAPE'; + var LIST_PARAGRAPH = 'PARAGRAPH'; + var LIST_UNKNOWN = 'UNKNOWN'; + var state = LIST_UNKNOWN; + + function isTabInList(e) { + // Don't indent on Ctrl+Tab or Alt+Tab + return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) && + (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList')); + } + + function isOnLastListItem() { + var li = getLi(); + var grandParent = li.parentNode.parentNode; + var isLastItem = li.parentNode.lastChild === li; + return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li); + } + + function isNestedList(grandParent) { + if (isList(grandParent)) { + return grandParent.parentNode && grandParent.parentNode.tagName === 'LI'; + } else { + return grandParent.tagName === 'LI'; + } + } + + function isInEmptyListItem() { + return ed.selection.isCollapsed() && isEmptyListItem(getLi()); + } + + function getLi() { + var n = ed.selection.getStart(); + // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position + return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n; + } + + function isEmptyListItem(li) { + var numChildren = li.childNodes.length; + if (li.tagName === 'LI') { + return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li)); + } + return false; + } + + function isEmptyIE9Li(li) { + // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these + var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'}); + var isLastLi = li == lis[lis.length - 1]; + var child = li.firstChild; + return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32)); + } + + function isEnter(e) { + return e.keyCode === tinymce.VK.ENTER; + } + + function isEnterWithoutShift(e) { + return isEnter(e) && !e.shiftKey; + } + + function getListKeyState(e) { + if (isTabInList(e)) { + return LIST_TABBING; + } else if (isEnterWithoutShift(e) && isOnLastListItem()) { + // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now + //return LIST_ESCAPE; + return LIST_UNKNOWN; + } else if (isEnterWithoutShift(e) && isInEmptyListItem()) { + return LIST_EMPTY_ITEM; + } else { + return LIST_UNKNOWN; + } + } + + function cancelDefaultEvents(ed, e) { + // list escape is done manually using outdent as it does not create paragraphs correctly in td's + if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) { + Event.cancel(e); + } + } + + function isCursorAtEndOfContainer() { + var range = ed.selection.getRng(true); + var startContainer = range.startContainer; + if (startContainer.nodeType == 3) { + var value = startContainer.nodeValue; + if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) { + // IE9 places a space on the end of the text in some cases so ignore last char + return (range.endOffset == value.length-1); + } else { + return (range.endOffset == value.length); + } + } else if (startContainer.nodeType == 1) { + return range.endOffset == startContainer.childNodes.length; + } + return false; + } + + /* + If we are at the end of a list item surrounded with an element, pressing enter should create a + new list item instead without splitting the element e.g. don't want to create new P or H1 tag + */ + function isEndOfListItem() { + var node = ed.selection.getNode(); + var validElements = 'h1,h2,h3,h4,h5,h6,p,div'; + var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node; + return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer(); + } + + // Creates a new list item after the current selection's list item parent + function createNewLi(ed, e) { + if (isEnterWithoutShift(e) && isEndOfListItem()) { + var node = ed.selection.getNode(); + var li = ed.dom.create("li"); + var parentLi = ed.dom.getParent(node, 'li'); + ed.dom.insertAfter(li, parentLi); + + // Move caret to new list element. + if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) { + // Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic + //li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point + ed.selection.setCursorLocation(li, 1); + } else { + ed.selection.setCursorLocation(li, 0); + } + e.preventDefault(); + } + } + + function imageJoiningListItem(ed, e) { + var prevSibling; + + if (!tinymce.isGecko) + return; + + var n = ed.selection.getStart(); + if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG') + return; + + function lastLI(node) { + var child = node.firstChild; + var li = null; + do { + if (!child) + break; + + if (child.tagName === 'LI') + li = child; + } while (child = child.nextSibling); + + return li; + } + + function addChildren(parentNode, destination) { + while (parentNode.childNodes.length > 0) + destination.appendChild(parentNode.childNodes[0]); + } + + // Check if there is a previous sibling + prevSibling = n.parentNode.previousSibling; + if (!prevSibling) + return; + + var ul; + if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL') + ul = prevSibling; + else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL')) + ul = prevSibling.previousSibling; + else + return; + + var li = lastLI(ul); + + // move the caret to the end of the list item + var rng = ed.dom.createRng(); + rng.setStart(li, 1); + rng.setEnd(li, 1); + ed.selection.setRng(rng); + ed.selection.collapse(true); + + // save a bookmark at the end of the list item + var bookmark = ed.selection.getBookmark(); + + // copy the image an its text to the list item + var clone = n.parentNode.cloneNode(true); + if (clone.tagName === 'P' || clone.tagName === 'DIV') + addChildren(clone, li); + else + li.appendChild(clone); + + // remove the old copy of the image + n.parentNode.parentNode.removeChild(n.parentNode); + + // move the caret where we saved the bookmark + ed.selection.moveToBookmark(bookmark); + } + + // fix the cursor position to ensure it is correct in IE + function setCursorPositionToOriginalLi(li) { + var list = ed.dom.getParent(li, 'ol,ul'); + if (list != null) { + var lastLi = list.lastChild; + // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic + //lastLi.appendChild(ed.getDoc().createElement('')); + ed.selection.setCursorLocation(lastLi, 0); + } + } + + this.ed = ed; + ed.addCommand('Indent', this.indent, this); + ed.addCommand('Outdent', this.outdent, this); + ed.addCommand('InsertUnorderedList', function() { + this.applyList('UL', 'OL'); + }, this); + ed.addCommand('InsertOrderedList', function() { + this.applyList('OL', 'UL'); + }, this); + + ed.onInit.add(function() { + ed.editorCommands.addCommands({ + 'outdent': function() { + var sel = ed.selection, dom = ed.dom; + + function hasStyleIndent(n) { + n = dom.getParent(n, dom.isBlock); + return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0; + } + + return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList'); + } + }, 'state'); + }); + + ed.onKeyUp.add(function(ed, e) { + if (state == LIST_TABBING) { + ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null); + state = LIST_UNKNOWN; + return Event.cancel(e); + } else if (state == LIST_EMPTY_ITEM) { + var li = getLi(); + var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey; + ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null); + if (tinymce.isIE) { + setCursorPositionToOriginalLi(li); + } + + return Event.cancel(e); + } else if (state == LIST_ESCAPE) { + if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) { + // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting. + // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after + // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag. + var n = ed.getDoc().createTextNode('\uFEFF'); + ed.selection.getNode().appendChild(n); + } else if (tinymce.isIE9 || tinymce.isGecko) { + // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour + // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves + ed.execCommand('Outdent'); + return Event.cancel(e); + } + } + }); + + function fixListItem(parent, reference) { + // a zero-sized non-breaking space is placed in the empty list item so that the nested list is + // displayed on the below line instead of next to it + var n = ed.getDoc().createTextNode('\uFEFF'); + parent.insertBefore(n, reference); + ed.selection.setCursorLocation(n, 0); + // repaint to remove rendering artifact. only visible when creating new list + ed.execCommand('mceRepaint'); + } + + function fixIndentedListItemForGecko(ed, e) { + if (isEnter(e)) { + var li = getLi(); + if (li) { + var parent = li.parentNode; + var grandParent = parent && parent.parentNode; + if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) { + fixListItem(grandParent, parent); + } + } + } + } + + function fixIndentedListItemForIE8(ed, e) { + if (isEnter(e)) { + var li = getLi(); + if (ed.dom.select('ul li', li).length === 1) { + var list = li.firstChild; + fixListItem(li, list); + } + } + } + + function fixDeletingFirstCharOfList(ed, e) { + function listElements(li) { + var elements = []; + var walker = new tinymce.dom.TreeWalker(li.firstChild, li); + for (var node = walker.current(); node; node = walker.next()) { + if (ed.dom.is(node, 'ol,ul,li')) { + elements.push(node); + } + } + return elements; + } + + if (e.keyCode == tinymce.VK.BACKSPACE) { + var li = getLi(); + if (li) { + var list = ed.dom.getParent(li, 'ol,ul'), + rng = ed.selection.getRng(); + if (list && list.firstChild === li && rng.startOffset == 0) { + var elements = listElements(li); + elements.unshift(li); + ed.execCommand("Outdent", false, elements); + ed.undoManager.add(); + return Event.cancel(e); + } + } + } + } + + function fixDeletingEmptyLiInWebkit(ed, e) { + var li = getLi(); + if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) { + if (ed.dom.select('ul,ol', li).length === 1) { + var prevLi = li.previousSibling; + ed.dom.remove(ed.dom.select('br', li)); + ed.dom.remove(li, true); + var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 }); + if (textNodes.length === 1) { + var textNode = textNodes[0]; + ed.selection.setCursorLocation(textNode, textNode.length); + } + ed.undoManager.add(); + return Event.cancel(e); + } + } + } + + ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); }); + ed.onKeyDown.add(cancelDefaultEvents); + ed.onKeyDown.add(imageJoiningListItem); + ed.onKeyDown.add(createNewLi); + + if (tinymce.isGecko) { + ed.onKeyUp.add(fixIndentedListItemForGecko); + } + if (tinymce.isIE8) { + ed.onKeyUp.add(fixIndentedListItemForIE8); + } + if (tinymce.isGecko || tinymce.isWebKit) { + ed.onKeyDown.add(fixDeletingFirstCharOfList); + } + if (tinymce.isWebKit) { + ed.onKeyDown.add(fixDeletingEmptyLiInWebkit); + } + }, + + applyList: function(targetListType, oppositeListType) { + var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions, + selectedBlocks = ed.selection.getSelectedBlocks(); + + function cleanupBr(e) { + if (e && e.tagName === 'BR') { + dom.remove(e); + } + } + + function makeList(element) { + var list = dom.create(targetListType), li; + + function adjustIndentForNewList(element) { + // If there's a margin-left, outdent one level to account for the extra list margin. + if (element.style.marginLeft || element.style.paddingLeft) { + t.adjustPaddingFunction(false)(element); + } + } + + if (element.tagName === 'LI') { + // No change required. + } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') { + processBrs(element, function(startSection, br) { + doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode); + li = startSection.parentNode; + adjustIndentForNewList(li); + cleanupBr(br); + }); + if (li) { + if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) { + dom.split(li.parentNode.parentNode, li.parentNode); + } + attemptMergeWithAdjacent(li.parentNode, true); + } + return; + } else { + // Put the list around the element. + li = dom.create('li'); + dom.insertAfter(li, element); + li.appendChild(element); + adjustIndentForNewList(element); + element = li; + } + dom.insertAfter(list, element); + list.appendChild(element); + attemptMergeWithAdjacent(list, true); + applied.push(element); + } + + function doWrapList(start, end, template) { + var li, n = start, tmp; + while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) { + start = dom.split(start.parentNode, start.previousSibling); + start = start.nextSibling; + n = start; + } + if (template) { + li = template.cloneNode(true); + start.parentNode.insertBefore(li, start); + while (li.firstChild) dom.remove(li.firstChild); + li = dom.rename(li, 'li'); + } else { + li = dom.create('li'); + start.parentNode.insertBefore(li, start); + } + while (n && n != end) { + tmp = n.nextSibling; + li.appendChild(n); + n = tmp; + } + if (li.childNodes.length === 0) { + li.innerHTML = '
      '; + } + makeList(li); + } + + function processBrs(element, callback) { + var startSection, previousBR, END_TO_START = 3, START_TO_END = 1, + breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl'; + + function isAnyPartSelected(start, end) { + var r = dom.createRng(), sel; + bookmark.keep = true; + ed.selection.moveToBookmark(bookmark); + bookmark.keep = false; + sel = ed.selection.getRng(true); + if (!end) { + end = start.parentNode.lastChild; + } + r.setStartBefore(start); + r.setEndAfter(end); + return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0); + } + + function nextLeaf(br) { + if (br.nextSibling) + return br.nextSibling; + if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot()) + return nextLeaf(br.parentNode); + } + + // Split on BRs within the range and process those. + startSection = element.firstChild; + // First mark the BRs that have any part of the previous section selected. + var trailingContentSelected = false; + each(dom.select(breakElements, element), function(br) { + if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { + return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. + } + if (isAnyPartSelected(startSection, br)) { + dom.addClass(br, '_mce_tagged_br'); + startSection = nextLeaf(br); + } + }); + trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined)); + startSection = element.firstChild; + each(dom.select(breakElements, element), function(br) { + // Got a section from start to br. + var tmp = nextLeaf(br); + if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { + return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. + } + if (dom.hasClass(br, '_mce_tagged_br')) { + callback(startSection, br, previousBR); + previousBR = null; + } else { + previousBR = br; + } + startSection = tmp; + }); + if (trailingContentSelected) { + callback(startSection, undefined, previousBR); + } + } + + function wrapList(element) { + processBrs(element, function(startSection, br, previousBR) { + // Need to indent this part + doWrapList(startSection, br); + cleanupBr(br); + cleanupBr(previousBR); + }); + } + + function changeList(element) { + if (tinymce.inArray(applied, element) !== -1) { + return; + } + if (element.parentNode.tagName === oppositeListType) { + dom.split(element.parentNode, element); + makeList(element); + attemptMergeWithNext(element.parentNode, false); + } + applied.push(element); + } + + function convertListItemToParagraph(element) { + var child, nextChild, mergedElement, splitLast; + if (tinymce.inArray(applied, element) !== -1) { + return; + } + element = splitNestedLists(element, dom); + while (dom.is(element.parentNode, 'ol,ul,li')) { + dom.split(element.parentNode, element); + } + // Push the original element we have from the selection, not the renamed one. + applied.push(element); + element = dom.rename(element, 'p'); + mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines); + if (mergedElement === element) { + // Now split out any block elements that can't be contained within a P. + // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each) + child = element.firstChild; + while (child) { + if (dom.isBlock(child)) { + child = dom.split(child.parentNode, child); + splitLast = true; + nextChild = child.nextSibling && child.nextSibling.firstChild; + } else { + nextChild = child.nextSibling; + if (splitLast && child.tagName === 'BR') { + dom.remove(child); + } + splitLast = false; + } + child = nextChild; + } + } + } + + each(selectedBlocks, function(e) { + e = findItemToOperateOn(e, dom); + if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) { + hasOppositeType = true; + } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) { + hasSameType = true; + } else { + hasNonList = true; + } + }); + + if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) { + actions = { + 'LI': changeList, + 'H1': makeList, + 'H2': makeList, + 'H3': makeList, + 'H4': makeList, + 'H5': makeList, + 'H6': makeList, + 'P': makeList, + 'BODY': makeList, + 'DIV': selectedBlocks.length > 1 ? makeList : wrapList, + defaultAction: wrapList, + elements: this.selectedBlocks() + }; + } else { + actions = { + defaultAction: convertListItemToParagraph, + elements: this.selectedBlocks(), + processEvenIfEmpty: true + }; + } + this.process(actions); + }, + + indent: function() { + var ed = this.ed, dom = ed.dom, indented = []; + + function createWrapItem(element) { + var wrapItem = dom.create('li', { style: 'list-style-type: none;'}); + dom.insertAfter(wrapItem, element); + return wrapItem; + } + + function createWrapList(element) { + var wrapItem = createWrapItem(element), + list = dom.getParent(element, 'ol,ul'), + listType = list.tagName, + listStyle = dom.getStyle(list, 'list-style-type'), + attrs = {}, + wrapList; + if (listStyle !== '') { + attrs.style = 'list-style-type: ' + listStyle + ';'; + } + wrapList = dom.create(listType, attrs); + wrapItem.appendChild(wrapList); + return wrapList; + } + + function indentLI(element) { + if (!hasParentInList(ed, element, indented)) { + element = splitNestedLists(element, dom); + var wrapList = createWrapList(element); + wrapList.appendChild(element); + attemptMergeWithAdjacent(wrapList.parentNode, false); + attemptMergeWithAdjacent(wrapList, false); + indented.push(element); + } + } + + this.process({ + 'LI': indentLI, + defaultAction: this.adjustPaddingFunction(true), + elements: this.selectedBlocks() + }); + + }, + + outdent: function(ui, elements) { + var t = this, ed = t.ed, dom = ed.dom, outdented = []; + + function outdentLI(element) { + var listElement, targetParent, align; + if (!hasParentInList(ed, element, outdented)) { + if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') { + return t.adjustPaddingFunction(false)(element); + } + align = dom.getStyle(element, 'text-align', true); + if (align === 'center' || align === 'right') { + dom.setStyle(element, 'text-align', 'left'); + return; + } + element = splitNestedLists(element, dom); + listElement = element.parentNode; + targetParent = element.parentNode.parentNode; + if (targetParent.tagName === 'P') { + dom.split(targetParent, element.parentNode); + } else { + dom.split(listElement, element); + if (targetParent.tagName === 'LI') { + // Nested list, need to split the LI and go back out to the OL/UL element. + dom.split(targetParent, element); + } else if (!dom.is(targetParent, 'ol,ul')) { + dom.rename(element, 'p'); + } + } + outdented.push(element); + } + } + + var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks(); + this.process({ + 'LI': outdentLI, + defaultAction: this.adjustPaddingFunction(false), + elements: listElements + }); + + each(outdented, attemptMergeWithAdjacent); + }, + + process: function(actions) { + var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r; + + function isEmptyElement(element) { + var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) { + return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark' + || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == '')); + }); + return excludeBrsAndBookmarks.length === 0; + } + + function processElement(element) { + dom.removeClass(element, '_mce_act_on'); + if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) { + return; + } + element = findItemToOperateOn(element, dom); + var action = actions[element.tagName]; + if (!action) { + action = actions.defaultAction; + } + action(element); + } + + function recurse(element) { + t.splitSafeEach(element.childNodes, processElement, true); + } + + function brAtEdgeOfSelection(container, offset) { + return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length && + container.childNodes[offset].tagName === 'BR'; + } + + function isInTable() { + var n = sel.getNode(); + var p = dom.getParent(n, 'td'); + return p !== null; + } + + selectedBlocks = actions.elements; + + r = sel.getRng(true); + if (!r.collapsed) { + if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) { + r.setEnd(r.endContainer, r.endOffset - 1); + sel.setRng(r); + } + if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) { + r.setStart(r.startContainer, r.startOffset + 1); + sel.setRng(r); + } + } + + + if (tinymce.isIE8) { + // append a zero sized nbsp so that caret is restored correctly using bookmark + var s = t.ed.selection.getNode(); + if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) { + var i = t.ed.getDoc().createTextNode('\uFEFF'); + s.appendChild(i); + } + } + + bookmark = sel.getBookmark(); + actions.OL = actions.UL = recurse; + t.splitSafeEach(selectedBlocks, processElement); + sel.moveToBookmark(bookmark); + bookmark = null; + + // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6 + if (!isInTable()) { + // Avoids table or image handles being left behind in Firefox. + t.ed.execCommand('mceRepaint'); + } + }, + + splitSafeEach: function(elements, f, forceClassBase) { + if (forceClassBase || + (tinymce.isGecko && + (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) || + /Firefox\/3\.[0-4]/.test(navigator.userAgent)))) { + this.classBasedEach(elements, f); + } else { + each(elements, f); + } + }, + + classBasedEach: function(elements, f) { + var dom = this.ed.dom, nodes, element; + // Mark nodes + each(elements, function(element) { + dom.addClass(element, '_mce_act_on'); + }); + nodes = dom.select('._mce_act_on'); + while (nodes.length > 0) { + element = nodes.shift(); + dom.removeClass(element, '_mce_act_on'); + f(element); + nodes = dom.select('._mce_act_on'); + } + }, + + adjustPaddingFunction: function(isIndent) { + var indentAmount, indentUnits, ed = this.ed; + indentAmount = ed.settings.indentation; + indentUnits = /[a-z%]+/i.exec(indentAmount); + indentAmount = parseInt(indentAmount, 10); + return function(element) { + var currentIndent, newIndentAmount; + currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10); + if (isIndent) { + newIndentAmount = currentIndent + indentAmount; + } else { + newIndentAmount = currentIndent - indentAmount; + } + ed.dom.setStyle(element, 'padding-left', ''); + ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : ''); + }; + }, + + selectedBlocks: function() { + var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks(); + return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks; + }, + + getInfo: function() { + return { + longname : 'Lists', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + tinymce.PluginManager.add("lists", tinymce.plugins.Lists); +}()); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/media/css/media.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/media/css/media.css index 0c45c7f..fd04898 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/media/css/media.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/media/css/media.css @@ -1,17 +1,17 @@ -#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } -#hspace, #vspace { width: 50px } -#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } -#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } -#width, #height { width: 40px } -#src, #media_type { width: 250px } -#class { width: 120px } -#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } -.panel_wrapper div.current { height: 420px; overflow: auto } -#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } -.mceAddSelectValue { background-color: #DDDDDD } -#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } -#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } -#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } -#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } -#qt_qtsrc { width: 200px } -iframe {border: 1px solid gray} +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } +.panel_wrapper div.current { height: 420px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } +iframe {border: 1px solid gray} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/media/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/media/editor_plugin_src.js index 33a5805..309081e 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/media/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/media/editor_plugin_src.js @@ -1,898 +1,898 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node, - mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes; - - // Media types supported by this plugin - mediaTypes = [ - // Type, clsid:s, mime types, codebase - ["Flash", "d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"], - ["ShockWave", "166b1bca-3f9c-11cf-8075-444553540000", "application/x-director", "http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"], - ["WindowsMedia", "6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a", "application/x-mplayer2", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"], - ["QuickTime", "02bf25d5-8c17-4b23-bc80-d3488abddc6b", "video/quicktime", "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"], - ["RealMedia", "cfcdaa03-8be4-11cf-b84b-0020afbbccfa", "audio/x-pn-realaudio-plugin", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"], - ["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"], - ["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"], - ["Iframe"], - ["Video"], - ["EmbeddedAudio"], - ["Audio"] - ]; - - function normalizeSize(size) { - return typeof(size) == "string" ? size.replace(/[^0-9%]/g, '') : size; - } - - function toArray(obj) { - var undef, out, i; - - if (obj && !obj.splice) { - out = []; - - for (i = 0; true; i++) { - if (obj[i]) - out[i] = obj[i]; - else - break; - } - - return out; - } - - return obj; - }; - - tinymce.create('tinymce.plugins.MediaPlugin', { - init : function(ed, url) { - var self = this, lookup = {}, i, y, item, name; - - function isMediaImg(node) { - return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia'); - }; - - self.editor = ed; - self.url = url; - - // Parse media types into a lookup table - scriptRegExp = ''; - for (i = 0; i < mediaTypes.length; i++) { - name = mediaTypes[i][0]; - - item = { - name : name, - clsids : tinymce.explode(mediaTypes[i][1] || ''), - mimes : tinymce.explode(mediaTypes[i][2] || ''), - codebase : mediaTypes[i][3] - }; - - for (y = 0; y < item.clsids.length; y++) - lookup['clsid:' + item.clsids[y]] = item; - - for (y = 0; y < item.mimes.length; y++) - lookup[item.mimes[y]] = item; - - lookup['mceItem' + name] = item; - lookup[name.toLowerCase()] = item; - - scriptRegExp += (scriptRegExp ? '|' : '') + name; - } - - // Handle the media_types setting - tinymce.each(ed.getParam("media_types", - "video=mp4,m4v,ogv,webm;" + - "silverlight=xap;" + - "flash=swf,flv;" + - "shockwave=dcr;" + - "quicktime=mov,qt,mpg,mpeg;" + - "shockwave=dcr;" + - "windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" + - "realmedia=rm,ra,ram;" + - "java=jar;" + - "audio=mp3,ogg" - ).split(';'), function(item) { - var i, extensions, type; - - item = item.split(/=/); - extensions = tinymce.explode(item[1].toLowerCase()); - for (i = 0; i < extensions.length; i++) { - type = lookup[item[0].toLowerCase()]; - - if (type) - lookup[extensions[i]] = type; - } - }); - - scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)'); - self.lookup = lookup; - - ed.onPreInit.add(function() { - // Allow video elements - ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]'); - - // Convert video elements to image placeholder - ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) { - var i = nodes.length; - - while (i--) - self.objectToImg(nodes[i]); - }); - - // Convert image placeholders to video elements - ed.serializer.addNodeFilter('img', function(nodes, name, args) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1) - self.imgToObject(node, args); - } - }); - }); - - ed.onInit.add(function() { - // Display "media" instead of "img" in element path - if (ed.theme && ed.theme.onResolveName) { - ed.theme.onResolveName.add(function(theme, path_object) { - if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia')) - path_object.name = 'media'; - }); - } - - // Add contect menu if it's loaded - if (ed && ed.plugins.contextmenu) { - ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) { - if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1) - menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'}); - }); - } - }); - - // Register commands - ed.addCommand('mceMedia', function() { - var data, img; - - img = ed.selection.getNode(); - if (isMediaImg(img)) { - data = ed.dom.getAttrib(img, 'data-mce-json'); - if (data) { - data = JSON.parse(data); - - // Add some extra properties to the data object - tinymce.each(rootAttributes, function(name) { - var value = ed.dom.getAttrib(img, name); - - if (value) - data[name] = value; - }); - - data.type = self.getType(img.className).name.toLowerCase(); - } - } - - if (!data) { - data = { - type : 'flash', - video: {sources:[]}, - params: {} - }; - } - - ed.windowManager.open({ - file : url + '/media.htm', - width : 430 + parseInt(ed.getLang('media.delta_width', 0)), - height : 500 + parseInt(ed.getLang('media.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - data : data - }); - }); - - // Register buttons - ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'}); - - // Update media selection status - ed.onNodeChange.add(function(ed, cm, node) { - cm.setActive('media', isMediaImg(node)); - }); - }, - - convertUrl : function(url, force_absolute) { - var self = this, editor = self.editor, settings = editor.settings, - urlConverter = settings.url_converter, - urlConverterScope = settings.url_converter_scope || self; - - if (!url) - return url; - - if (force_absolute) - return editor.documentBaseURI.toAbsolute(url); - - return urlConverter.call(urlConverterScope, url, 'src', 'object'); - }, - - getInfo : function() { - return { - longname : 'Media', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - /** - * Converts the JSON data object to an img node. - */ - dataToImg : function(data, force_absolute) { - var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i; - - data.params.src = self.convertUrl(data.params.src, force_absolute); - - attrs = data.video.attrs; - if (attrs) - attrs.src = self.convertUrl(attrs.src, force_absolute); - - if (attrs) - attrs.poster = self.convertUrl(attrs.poster, force_absolute); - - sources = toArray(data.video.sources); - if (sources) { - for (i = 0; i < sources.length; i++) - sources[i].src = self.convertUrl(sources[i].src, force_absolute); - } - - img = self.editor.dom.create('img', { - id : data.id, - style : data.style, - align : data.align, - hspace : data.hspace, - vspace : data.vspace, - src : self.editor.theme.url + '/img/trans.gif', - 'class' : 'mceItemMedia mceItem' + self.getType(data.type).name, - 'data-mce-json' : JSON.serialize(data, "'") - }); - - img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320")); - img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240")); - - return img; - }, - - /** - * Converts the JSON data object to a HTML string. - */ - dataToHtml : function(data, force_absolute) { - return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute}); - }, - - /** - * Converts the JSON data object to a HTML string. - */ - htmlToData : function(html) { - var fragment, img, data; - - data = { - type : 'flash', - video: {sources:[]}, - params: {} - }; - - fragment = this.editor.parser.parse(html); - img = fragment.getAll('img')[0]; - - if (img) { - data = JSON.parse(img.attr('data-mce-json')); - data.type = this.getType(img.attr('class')).name.toLowerCase(); - - // Add some extra properties to the data object - tinymce.each(rootAttributes, function(name) { - var value = img.attr(name); - - if (value) - data[name] = value; - }); - } - - return data; - }, - - /** - * Get type item by extension, class, clsid or mime type. - * - * @method getType - * @param {String} value Value to get type item by. - * @return {Object} Type item object or undefined. - */ - getType : function(value) { - var i, values, typeItem; - - // Find type by checking the classes - values = tinymce.explode(value, ' '); - for (i = 0; i < values.length; i++) { - typeItem = this.lookup[values[i]]; - - if (typeItem) - return typeItem; - } - }, - - /** - * Converts a tinymce.html.Node image element to video/object/embed. - */ - imgToObject : function(node, args) { - var self = this, editor = self.editor, video, object, embed, iframe, name, value, data, - source, sources, params, param, typeItem, i, item, mp4Source, replacement, - posterSrc, style, audio; - - // Adds the flash player - function addPlayer(video_src, poster_src) { - var baseUri, flashVars, flashVarsOutput, params, flashPlayer; - - flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf')); - if (flashPlayer) { - baseUri = editor.documentBaseURI; - data.params.src = flashPlayer; - - // Convert the movie url to absolute urls - if (editor.getParam('flash_video_player_absvideourl', true)) { - video_src = baseUri.toAbsolute(video_src || '', true); - poster_src = baseUri.toAbsolute(poster_src || '', true); - } - - // Generate flash vars - flashVarsOutput = ''; - flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}); - tinymce.each(flashVars, function(value, name) { - // Replace $url and $poster variables in flashvars value - value = value.replace(/\$url/, video_src || ''); - value = value.replace(/\$poster/, poster_src || ''); - - if (value.length > 0) - flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); - }); - - if (flashVarsOutput.length) - data.params.flashvars = flashVarsOutput; - - params = editor.getParam('flash_video_player_params', { - allowfullscreen: true, - allowscriptaccess: true - }); - - tinymce.each(params, function(value, name) { - data.params[name] = "" + value; - }); - } - }; - - data = node.attr('data-mce-json'); - if (!data) - return; - - data = JSON.parse(data); - typeItem = this.getType(node.attr('class')); - - style = node.attr('data-mce-style'); - if (!style) { - style = node.attr('style'); - - if (style) - style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); - } - - // Use node width/height to override the data width/height when the placeholder is resized - data.width = node.attr('width') || data.width; - data.height = node.attr('height') || data.height; - - // Handle iframe - if (typeItem.name === 'Iframe') { - replacement = new Node('iframe', 1); - - tinymce.each(rootAttributes, function(name) { - var value = node.attr(name); - - if (name == 'class' && value) - value = value.replace(/mceItem.+ ?/g, ''); - - if (value && value.length > 0) - replacement.attr(name, value); - }); - - for (name in data.params) - replacement.attr(name, data.params[name]); - - replacement.attr({ - style: style, - src: data.params.src - }); - - node.replace(replacement); - - return; - } - - // Handle scripts - if (this.editor.settings.media_use_script) { - replacement = new Node('script', 1).attr('type', 'text/javascript'); - - value = new Node('#text', 3); - value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { - width: node.attr('width'), - height: node.attr('height') - })) + ');'; - - replacement.append(value); - node.replace(replacement); - - return; - } - - // Add HTML5 video element - if (typeItem.name === 'Video' && data.video.sources[0]) { - // Create new object element - video = new Node('video', 1).attr(tinymce.extend({ - id : node.attr('id'), - width: normalizeSize(node.attr('width')), - height: normalizeSize(node.attr('height')), - style : style - }, data.video.attrs)); - - // Get poster source and use that for flash fallback - if (data.video.attrs) - posterSrc = data.video.attrs.poster; - - sources = data.video.sources = toArray(data.video.sources); - for (i = 0; i < sources.length; i++) { - if (/\.mp4$/.test(sources[i].src)) - mp4Source = sources[i].src; - } - - if (!sources[0].type) { - video.attr('src', sources[0].src); - sources.splice(0, 1); - } - - for (i = 0; i < sources.length; i++) { - source = new Node('source', 1).attr(sources[i]); - source.shortEnded = true; - video.append(source); - } - - // Create flash fallback for video if we have a mp4 source - if (mp4Source) { - addPlayer(mp4Source, posterSrc); - typeItem = self.getType('flash'); - } else - data.params.src = ''; - } - - // Add HTML5 audio element - if (typeItem.name === 'Audio' && data.video.sources[0]) { - // Create new object element - audio = new Node('audio', 1).attr(tinymce.extend({ - id : node.attr('id'), - width: normalizeSize(node.attr('width')), - height: normalizeSize(node.attr('height')), - style : style - }, data.video.attrs)); - - // Get poster source and use that for flash fallback - if (data.video.attrs) - posterSrc = data.video.attrs.poster; - - sources = data.video.sources = toArray(data.video.sources); - if (!sources[0].type) { - audio.attr('src', sources[0].src); - sources.splice(0, 1); - } - - for (i = 0; i < sources.length; i++) { - source = new Node('source', 1).attr(sources[i]); - source.shortEnded = true; - audio.append(source); - } - - data.params.src = ''; - } - - if (typeItem.name === 'EmbeddedAudio') { - embed = new Node('embed', 1); - embed.shortEnded = true; - embed.attr({ - id: node.attr('id'), - width: normalizeSize(node.attr('width')), - height: normalizeSize(node.attr('height')), - style : style, - type: node.attr('type') - }); - - for (name in data.params) - embed.attr(name, data.params[name]); - - tinymce.each(rootAttributes, function(name) { - if (data[name] && name != 'type') - embed.attr(name, data[name]); - }); - - data.params.src = ''; - } - - // Do we have a params src then we can generate object - if (data.params.src) { - // Is flv movie add player for it - if (/\.flv$/i.test(data.params.src)) - addPlayer(data.params.src, ''); - - if (args && args.force_absolute) - data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); - - // Create new object element - object = new Node('object', 1).attr({ - id : node.attr('id'), - width: normalizeSize(node.attr('width')), - height: normalizeSize(node.attr('height')), - style : style - }); - - tinymce.each(rootAttributes, function(name) { - var value = data[name]; - - if (name == 'class' && value) - value = value.replace(/mceItem.+ ?/g, ''); - - if (value && name != 'type') - object.attr(name, value); - }); - - // Add params - for (name in data.params) { - param = new Node('param', 1); - param.shortEnded = true; - value = data.params[name]; - - // Windows media needs to use url instead of src for the media URL - if (name === 'src' && typeItem.name === 'WindowsMedia') - name = 'url'; - - param.attr({name: name, value: value}); - object.append(param); - } - - // Setup add type and classid if strict is disabled - if (this.editor.getParam('media_strict', true)) { - object.attr({ - data: data.params.src, - type: typeItem.mimes[0] - }); - } else { - object.attr({ - classid: "clsid:" + typeItem.clsids[0], - codebase: typeItem.codebase - }); - - embed = new Node('embed', 1); - embed.shortEnded = true; - embed.attr({ - id: node.attr('id'), - width: normalizeSize(node.attr('width')), - height: normalizeSize(node.attr('height')), - style : style, - type: typeItem.mimes[0] - }); - - for (name in data.params) - embed.attr(name, data.params[name]); - - tinymce.each(rootAttributes, function(name) { - if (data[name] && name != 'type') - embed.attr(name, data[name]); - }); - - object.append(embed); - } - - // Insert raw HTML - if (data.object_html) { - value = new Node('#text', 3); - value.raw = true; - value.value = data.object_html; - object.append(value); - } - - // Append object to video element if it exists - if (video) - video.append(object); - } - - if (video) { - // Insert raw HTML - if (data.video_html) { - value = new Node('#text', 3); - value.raw = true; - value.value = data.video_html; - video.append(value); - } - } - - if (audio) { - // Insert raw HTML - if (data.video_html) { - value = new Node('#text', 3); - value.raw = true; - value.value = data.video_html; - audio.append(value); - } - } - - var n = video || audio || object || embed; - if (n) - node.replace(n); - else - node.remove(); - }, - - /** - * Converts a tinymce.html.Node video/object/embed to an img element. - * - * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: - * - * - * The JSON structure will be like this: - * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} - */ - objectToImg : function(node) { - var object, embed, video, iframe, img, name, id, width, height, style, i, html, - param, params, source, sources, data, type, lookup = this.lookup, - matches, attrs, urlConverter = this.editor.settings.url_converter, - urlConverterScope = this.editor.settings.url_converter_scope, - hspace, vspace, align, bgcolor; - - function getInnerHTML(node) { - return new tinymce.html.Serializer({ - inner: true, - validate: false - }).serialize(node); - }; - - function lookupAttribute(o, attr) { - return lookup[(o.attr(attr) || '').toLowerCase()]; - } - - function lookupExtension(src) { - var ext = src.replace(/^.*\.([^.]+)$/, '$1'); - return lookup[ext.toLowerCase() || '']; - } - - // If node isn't in document - if (!node.parent) - return; - - // Handle media scripts - if (node.name === 'script') { - if (node.firstChild) - matches = scriptRegExp.exec(node.firstChild.value); - - if (!matches) - return; - - type = matches[1]; - data = {video : {}, params : JSON.parse(matches[2])}; - width = data.params.width; - height = data.params.height; - } - - // Setup data objects - data = data || { - video : {}, - params : {} - }; - - // Setup new image object - img = new Node('img', 1); - img.attr({ - src : this.editor.theme.url + '/img/trans.gif' - }); - - // Video element - name = node.name; - if (name === 'video' || name == 'audio') { - video = node; - object = node.getAll('object')[0]; - embed = node.getAll('embed')[0]; - width = video.attr('width'); - height = video.attr('height'); - id = video.attr('id'); - data.video = {attrs : {}, sources : []}; - - // Get all video attributes - attrs = data.video.attrs; - for (name in video.attributes.map) - attrs[name] = video.attributes.map[name]; - - source = node.attr('src'); - if (source) - data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); - - // Get all sources - sources = video.getAll("source"); - for (i = 0; i < sources.length; i++) { - source = sources[i].remove(); - - data.video.sources.push({ - src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), - type: source.attr('type'), - media: source.attr('media') - }); - } - - // Convert the poster URL - if (attrs.poster) - attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); - } - - // Object element - if (node.name === 'object') { - object = node; - embed = node.getAll('embed')[0]; - } - - // Embed element - if (node.name === 'embed') - embed = node; - - // Iframe element - if (node.name === 'iframe') { - iframe = node; - type = 'Iframe'; - } - - if (object) { - // Get width/height - width = width || object.attr('width'); - height = height || object.attr('height'); - style = style || object.attr('style'); - id = id || object.attr('id'); - hspace = hspace || object.attr('hspace'); - vspace = vspace || object.attr('vspace'); - align = align || object.attr('align'); - bgcolor = bgcolor || object.attr('bgcolor'); - data.name = object.attr('name'); - - // Get all object params - params = object.getAll("param"); - for (i = 0; i < params.length; i++) { - param = params[i]; - name = param.remove().attr('name'); - - if (!excludedAttrs[name]) - data.params[name] = param.attr('value'); - } - - data.params.src = data.params.src || object.attr('data'); - } - - if (embed) { - // Get width/height - width = width || embed.attr('width'); - height = height || embed.attr('height'); - style = style || embed.attr('style'); - id = id || embed.attr('id'); - hspace = hspace || embed.attr('hspace'); - vspace = vspace || embed.attr('vspace'); - align = align || embed.attr('align'); - bgcolor = bgcolor || embed.attr('bgcolor'); - - // Get all embed attributes - for (name in embed.attributes.map) { - if (!excludedAttrs[name] && !data.params[name]) - data.params[name] = embed.attributes.map[name]; - } - } - - if (iframe) { - // Get width/height - width = normalizeSize(iframe.attr('width')); - height = normalizeSize(iframe.attr('height')); - style = style || iframe.attr('style'); - id = iframe.attr('id'); - hspace = iframe.attr('hspace'); - vspace = iframe.attr('vspace'); - align = iframe.attr('align'); - bgcolor = iframe.attr('bgcolor'); - - tinymce.each(rootAttributes, function(name) { - img.attr(name, iframe.attr(name)); - }); - - // Get all iframe attributes - for (name in iframe.attributes.map) { - if (!excludedAttrs[name] && !data.params[name]) - data.params[name] = iframe.attributes.map[name]; - } - } - - // Use src not movie - if (data.params.movie) { - data.params.src = data.params.src || data.params.movie; - delete data.params.movie; - } - - // Convert the URL to relative/absolute depending on configuration - if (data.params.src) - data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); - - if (video) { - if (node.name === 'video') - type = lookup.video.name; - else if (node.name === 'audio') - type = lookup.audio.name; - } - - if (object && !type) - type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; - - if (embed && !type) - type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; - - // for embedded audio we preserve the original specified type - if (embed && type == 'EmbeddedAudio') { - data.params.type = embed.attr('type'); - } - - // Replace the video/object/embed element with a placeholder image containing the data - node.replace(img); - - // Remove embed - if (embed) - embed.remove(); - - // Serialize the inner HTML of the object element - if (object) { - html = getInnerHTML(object.remove()); - - if (html) - data.object_html = html; - } - - // Serialize the inner HTML of the video element - if (video) { - html = getInnerHTML(video.remove()); - - if (html) - data.video_html = html; - } - - data.hspace = hspace; - data.vspace = vspace; - data.align = align; - data.bgcolor = bgcolor; - - // Set width/height of placeholder - img.attr({ - id : id, - 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), - style : style, - width : width || (node.name == 'audio' ? "300" : "320"), - height : height || (node.name == 'audio' ? "32" : "240"), - hspace : hspace, - vspace : vspace, - align : align, - bgcolor : bgcolor, - "data-mce-json" : JSON.serialize(data, "'") - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node, + mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes; + + // Media types supported by this plugin + mediaTypes = [ + // Type, clsid:s, mime types, codebase + ["Flash", "d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"], + ["ShockWave", "166b1bca-3f9c-11cf-8075-444553540000", "application/x-director", "http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"], + ["WindowsMedia", "6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a", "application/x-mplayer2", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"], + ["QuickTime", "02bf25d5-8c17-4b23-bc80-d3488abddc6b", "video/quicktime", "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"], + ["RealMedia", "cfcdaa03-8be4-11cf-b84b-0020afbbccfa", "audio/x-pn-realaudio-plugin", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"], + ["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"], + ["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"], + ["Iframe"], + ["Video"], + ["EmbeddedAudio"], + ["Audio"] + ]; + + function normalizeSize(size) { + return typeof(size) == "string" ? size.replace(/[^0-9%]/g, '') : size; + } + + function toArray(obj) { + var undef, out, i; + + if (obj && !obj.splice) { + out = []; + + for (i = 0; true; i++) { + if (obj[i]) + out[i] = obj[i]; + else + break; + } + + return out; + } + + return obj; + }; + + tinymce.create('tinymce.plugins.MediaPlugin', { + init : function(ed, url) { + var self = this, lookup = {}, i, y, item, name; + + function isMediaImg(node) { + return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia'); + }; + + self.editor = ed; + self.url = url; + + // Parse media types into a lookup table + scriptRegExp = ''; + for (i = 0; i < mediaTypes.length; i++) { + name = mediaTypes[i][0]; + + item = { + name : name, + clsids : tinymce.explode(mediaTypes[i][1] || ''), + mimes : tinymce.explode(mediaTypes[i][2] || ''), + codebase : mediaTypes[i][3] + }; + + for (y = 0; y < item.clsids.length; y++) + lookup['clsid:' + item.clsids[y]] = item; + + for (y = 0; y < item.mimes.length; y++) + lookup[item.mimes[y]] = item; + + lookup['mceItem' + name] = item; + lookup[name.toLowerCase()] = item; + + scriptRegExp += (scriptRegExp ? '|' : '') + name; + } + + // Handle the media_types setting + tinymce.each(ed.getParam("media_types", + "video=mp4,m4v,ogv,webm;" + + "silverlight=xap;" + + "flash=swf,flv;" + + "shockwave=dcr;" + + "quicktime=mov,qt,mpg,mpeg;" + + "shockwave=dcr;" + + "windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" + + "realmedia=rm,ra,ram;" + + "java=jar;" + + "audio=mp3,ogg" + ).split(';'), function(item) { + var i, extensions, type; + + item = item.split(/=/); + extensions = tinymce.explode(item[1].toLowerCase()); + for (i = 0; i < extensions.length; i++) { + type = lookup[item[0].toLowerCase()]; + + if (type) + lookup[extensions[i]] = type; + } + }); + + scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)'); + self.lookup = lookup; + + ed.onPreInit.add(function() { + // Allow video elements + ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]'); + + // Convert video elements to image placeholder + ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) { + var i = nodes.length; + + while (i--) + self.objectToImg(nodes[i]); + }); + + // Convert image placeholders to video elements + ed.serializer.addNodeFilter('img', function(nodes, name, args) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1) + self.imgToObject(node, args); + } + }); + }); + + ed.onInit.add(function() { + // Display "media" instead of "img" in element path + if (ed.theme && ed.theme.onResolveName) { + ed.theme.onResolveName.add(function(theme, path_object) { + if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia')) + path_object.name = 'media'; + }); + } + + // Add contect menu if it's loaded + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) { + if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1) + menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'}); + }); + } + }); + + // Register commands + ed.addCommand('mceMedia', function() { + var data, img; + + img = ed.selection.getNode(); + if (isMediaImg(img)) { + data = ed.dom.getAttrib(img, 'data-mce-json'); + if (data) { + data = JSON.parse(data); + + // Add some extra properties to the data object + tinymce.each(rootAttributes, function(name) { + var value = ed.dom.getAttrib(img, name); + + if (value) + data[name] = value; + }); + + data.type = self.getType(img.className).name.toLowerCase(); + } + } + + if (!data) { + data = { + type : 'flash', + video: {sources:[]}, + params: {} + }; + } + + ed.windowManager.open({ + file : url + '/media.htm', + width : 430 + parseInt(ed.getLang('media.delta_width', 0)), + height : 500 + parseInt(ed.getLang('media.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + data : data + }); + }); + + // Register buttons + ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'}); + + // Update media selection status + ed.onNodeChange.add(function(ed, cm, node) { + cm.setActive('media', isMediaImg(node)); + }); + }, + + convertUrl : function(url, force_absolute) { + var self = this, editor = self.editor, settings = editor.settings, + urlConverter = settings.url_converter, + urlConverterScope = settings.url_converter_scope || self; + + if (!url) + return url; + + if (force_absolute) + return editor.documentBaseURI.toAbsolute(url); + + return urlConverter.call(urlConverterScope, url, 'src', 'object'); + }, + + getInfo : function() { + return { + longname : 'Media', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + /** + * Converts the JSON data object to an img node. + */ + dataToImg : function(data, force_absolute) { + var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i; + + data.params.src = self.convertUrl(data.params.src, force_absolute); + + attrs = data.video.attrs; + if (attrs) + attrs.src = self.convertUrl(attrs.src, force_absolute); + + if (attrs) + attrs.poster = self.convertUrl(attrs.poster, force_absolute); + + sources = toArray(data.video.sources); + if (sources) { + for (i = 0; i < sources.length; i++) + sources[i].src = self.convertUrl(sources[i].src, force_absolute); + } + + img = self.editor.dom.create('img', { + id : data.id, + style : data.style, + align : data.align, + hspace : data.hspace, + vspace : data.vspace, + src : self.editor.theme.url + '/img/trans.gif', + 'class' : 'mceItemMedia mceItem' + self.getType(data.type).name, + 'data-mce-json' : JSON.serialize(data, "'") + }); + + img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320")); + img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240")); + + return img; + }, + + /** + * Converts the JSON data object to a HTML string. + */ + dataToHtml : function(data, force_absolute) { + return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute}); + }, + + /** + * Converts the JSON data object to a HTML string. + */ + htmlToData : function(html) { + var fragment, img, data; + + data = { + type : 'flash', + video: {sources:[]}, + params: {} + }; + + fragment = this.editor.parser.parse(html); + img = fragment.getAll('img')[0]; + + if (img) { + data = JSON.parse(img.attr('data-mce-json')); + data.type = this.getType(img.attr('class')).name.toLowerCase(); + + // Add some extra properties to the data object + tinymce.each(rootAttributes, function(name) { + var value = img.attr(name); + + if (value) + data[name] = value; + }); + } + + return data; + }, + + /** + * Get type item by extension, class, clsid or mime type. + * + * @method getType + * @param {String} value Value to get type item by. + * @return {Object} Type item object or undefined. + */ + getType : function(value) { + var i, values, typeItem; + + // Find type by checking the classes + values = tinymce.explode(value, ' '); + for (i = 0; i < values.length; i++) { + typeItem = this.lookup[values[i]]; + + if (typeItem) + return typeItem; + } + }, + + /** + * Converts a tinymce.html.Node image element to video/object/embed. + */ + imgToObject : function(node, args) { + var self = this, editor = self.editor, video, object, embed, iframe, name, value, data, + source, sources, params, param, typeItem, i, item, mp4Source, replacement, + posterSrc, style, audio; + + // Adds the flash player + function addPlayer(video_src, poster_src) { + var baseUri, flashVars, flashVarsOutput, params, flashPlayer; + + flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf')); + if (flashPlayer) { + baseUri = editor.documentBaseURI; + data.params.src = flashPlayer; + + // Convert the movie url to absolute urls + if (editor.getParam('flash_video_player_absvideourl', true)) { + video_src = baseUri.toAbsolute(video_src || '', true); + poster_src = baseUri.toAbsolute(poster_src || '', true); + } + + // Generate flash vars + flashVarsOutput = ''; + flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}); + tinymce.each(flashVars, function(value, name) { + // Replace $url and $poster variables in flashvars value + value = value.replace(/\$url/, video_src || ''); + value = value.replace(/\$poster/, poster_src || ''); + + if (value.length > 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = node.attr('data-mce-json'); + if (!data) + return; + + data = JSON.parse(data); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style'); + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Use node width/height to override the data width/height when the placeholder is resized + data.width = node.attr('width') || data.width; + data.height = node.attr('height') || data.height; + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); + }); + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src + }); + + node.replace(replacement); + + return; + } + + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); + + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; + } + + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } + + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } + + // Add HTML5 audio element + if (typeItem.name === 'Audio' && data.video.sources[0]) { + // Create new object element + audio = new Node('audio', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + if (!sources[0].type) { + audio.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + audio.append(source); + } + + data.params.src = ''; + } + + if (typeItem.name === 'EmbeddedAudio') { + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: node.attr('type') + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + var value = data[name]; + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && name != 'type') + object.attr(name, value); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); + } + + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); + + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: typeItem.mimes[0] + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + object.append(embed); + } + + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (audio) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + audio.append(value); + } + } + + var n = video || audio || object || embed; + if (n) + node.replace(n); + else + node.remove(); + }, + + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope, + hspace, vspace, align, bgcolor; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; + + function lookupAttribute(o, attr) { + return lookup[(o.attr(attr) || '').toLowerCase()]; + } + + function lookupExtension(src) { + var ext = src.replace(/^.*\.([^.]+)$/, '$1'); + return lookup[ext.toLowerCase() || '']; + } + + // If node isn't in document + if (!node.parent) + return; + + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } + + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' + }); + + // Video element + name = node.name; + if (name === 'video' || name == 'audio') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; + } + + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + hspace = hspace || object.attr('hspace'); + vspace = vspace || object.attr('vspace'); + align = align || object.attr('align'); + bgcolor = bgcolor || object.attr('bgcolor'); + data.name = object.attr('name'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); + } + + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + hspace = hspace || embed.attr('hspace'); + vspace = vspace || embed.attr('vspace'); + align = align || embed.attr('align'); + bgcolor = bgcolor || embed.attr('bgcolor'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } + + if (iframe) { + // Get width/height + width = normalizeSize(iframe.attr('width')); + height = normalizeSize(iframe.attr('height')); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + hspace = iframe.attr('hspace'); + vspace = iframe.attr('vspace'); + align = iframe.attr('align'); + bgcolor = iframe.attr('bgcolor'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); + }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } + } + + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } + + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); + + if (video) { + if (node.name === 'video') + type = lookup.video.name; + else if (node.name === 'audio') + type = lookup.audio.name; + } + + if (object && !type) + type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; + + if (embed && !type) + type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; + + // for embedded audio we preserve the original specified type + if (embed && type == 'EmbeddedAudio') { + data.params.type = embed.attr('type'); + } + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + data.hspace = hspace; + data.vspace = vspace; + data.align = align; + data.bgcolor = bgcolor; + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || (node.name == 'audio' ? "300" : "320"), + height : height || (node.name == 'audio' ? "32" : "240"), + hspace : hspace, + vspace : vspace, + align : align, + bgcolor : bgcolor, + "data-mce-json" : JSON.serialize(data, "'") + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/media/js/embed.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/media/js/embed.js index f8dc810..a36e128 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/media/js/embed.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/media/js/embed.js @@ -1,73 +1,73 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ''; + + h += ''); - - function get(id) { - return document.getElementById(id); - } - - function clone(obj) { - var i, len, copy, attr; - - if (null == obj || "object" != typeof obj) - return obj; - - // Handle Array - if ('length' in obj) { - copy = []; - - for (i = 0, len = obj.length; i < len; ++i) { - copy[i] = clone(obj[i]); - } - - return copy; - } - - // Handle Object - copy = {}; - for (attr in obj) { - if (obj.hasOwnProperty(attr)) - copy[attr] = clone(obj[attr]); - } - - return copy; - } - - function getVal(id) { - var elm = get(id); - - if (elm.nodeName == "SELECT") - return elm.options[elm.selectedIndex].value; - - if (elm.type == "checkbox") - return elm.checked; - - return elm.value; - } - - function setVal(id, value, name) { - if (typeof(value) != 'undefined' && value != null) { - var elm = get(id); - - if (elm.nodeName == "SELECT") - selectByValue(document.forms[0], id, value); - else if (elm.type == "checkbox") { - if (typeof(value) == 'string') { - value = value.toLowerCase(); - value = (!name && value === 'true') || (name && value === name.toLowerCase()); - } - elm.checked = !!value; - } else - elm.value = value; - } - } - - window.Media = { - init : function() { - var html, editor, self = this; - - self.editor = editor = tinyMCEPopup.editor; - - // Setup file browsers and color pickers - get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); - get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); - get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); - get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); - get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); - get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); - get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media'); - - html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); - if (html == "") - get("linklistrow").style.display = 'none'; - else - get("linklistcontainer").innerHTML = html; - - if (isVisible('filebrowser')) - get('src').style.width = '230px'; - - if (isVisible('video_filebrowser_altsource1')) - get('video_altsource1').style.width = '220px'; - - if (isVisible('video_filebrowser_altsource2')) - get('video_altsource2').style.width = '220px'; - - if (isVisible('audio_filebrowser_altsource1')) - get('audio_altsource1').style.width = '220px'; - - if (isVisible('audio_filebrowser_altsource2')) - get('audio_altsource2').style.width = '220px'; - - if (isVisible('filebrowser_poster')) - get('video_poster').style.width = '220px'; - - editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); - - self.setDefaultDialogSettings(editor); - self.data = clone(tinyMCEPopup.getWindowArg('data')); - self.dataToForm(); - self.preview(); - - updateColor('bgcolor_pick', 'bgcolor'); - }, - - insert : function() { - var editor = tinyMCEPopup.editor; - - this.formToData(); - editor.execCommand('mceRepaint'); - tinyMCEPopup.restoreSelection(); - editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); - tinyMCEPopup.close(); - }, - - preview : function() { - get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); - }, - - moveStates : function(to_form, field) { - var data = this.data, editor = this.editor, - mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; - - defaultStates = { - // QuickTime - quicktime_autoplay : true, - quicktime_controller : true, - - // Flash - flash_play : true, - flash_loop : true, - flash_menu : true, - - // WindowsMedia - windowsmedia_autostart : true, - windowsmedia_enablecontextmenu : true, - windowsmedia_invokeurls : true, - - // RealMedia - realmedia_autogotourl : true, - realmedia_imagestatus : true - }; - - function parseQueryParams(str) { - var out = {}; - - if (str) { - tinymce.each(str.split('&'), function(item) { - var parts = item.split('='); - - out[unescape(parts[0])] = unescape(parts[1]); - }); - } - - return out; - }; - - function setOptions(type, names) { - var i, name, formItemName, value, list; - - if (type == data.type || type == 'global') { - names = tinymce.explode(names); - for (i = 0; i < names.length; i++) { - name = names[i]; - formItemName = type == 'global' ? name : type + '_' + name; - - if (type == 'global') - list = data; - else if (type == 'video' || type == 'audio') { - list = data.video.attrs; - - if (!list && !to_form) - data.video.attrs = list = {}; - } else - list = data.params; - - if (list) { - if (to_form) { - setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); - } else { - delete list[name]; - - value = getVal(formItemName); - if ((type == 'video' || type == 'audio') && value === true) - value = name; - - if (defaultStates[formItemName]) { - if (value !== defaultStates[formItemName]) { - value = "" + value; - list[name] = value; - } - } else if (value) { - value = "" + value; - list[name] = value; - } - } - } - } - } - } - - if (!to_form) { - data.type = get('media_type').options[get('media_type').selectedIndex].value; - data.width = getVal('width'); - data.height = getVal('height'); - - // Switch type based on extension - src = getVal('src'); - if (field == 'src') { - ext = src.replace(/^.*\.([^.]+)$/, '$1'); - if (typeInfo = mediaPlugin.getType(ext)) - data.type = typeInfo.name.toLowerCase(); - - setVal('media_type', data.type); - } - - if (data.type == "video" || data.type == "audio") { - if (!data.video.sources) - data.video.sources = []; - - data.video.sources[0] = {src: getVal('src')}; - } - } - - // Hide all fieldsets and show the one active - get('video_options').style.display = 'none'; - get('audio_options').style.display = 'none'; - get('flash_options').style.display = 'none'; - get('quicktime_options').style.display = 'none'; - get('shockwave_options').style.display = 'none'; - get('windowsmedia_options').style.display = 'none'; - get('realmedia_options').style.display = 'none'; - get('embeddedaudio_options').style.display = 'none'; - - if (get(data.type + '_options')) - get(data.type + '_options').style.display = 'block'; - - setVal('media_type', data.type); - - setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); - setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); - setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); - setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); - setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); - setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); - setOptions('audio', 'autoplay,loop,preload,controls'); - setOptions('embeddedaudio', 'autoplay,loop,controls'); - setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); - - if (to_form) { - if (data.type == 'video') { - if (data.video.sources[0]) - setVal('src', data.video.sources[0].src); - - src = data.video.sources[1]; - if (src) - setVal('video_altsource1', src.src); - - src = data.video.sources[2]; - if (src) - setVal('video_altsource2', src.src); - } else if (data.type == 'audio') { - if (data.video.sources[0]) - setVal('src', data.video.sources[0].src); - - src = data.video.sources[1]; - if (src) - setVal('audio_altsource1', src.src); - - src = data.video.sources[2]; - if (src) - setVal('audio_altsource2', src.src); - } else { - // Check flash vars - if (data.type == 'flash') { - tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { - if (value == '$url') - data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; - }); - } - - setVal('src', data.params.src); - } - } else { - src = getVal("src"); - - // YouTube *NEW* - if (src.match(/youtu.be\/[a-z1-9.-_]+/)) { - data.width = 425; - data.height = 350; - data.params.frameborder = '0'; - data.type = 'iframe'; - src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; - setVal('src', src); - setVal('media_type', data.type); - } - - // YouTube - if (src.match(/youtube.com(.+)v=([^&]+)/)) { - data.width = 425; - data.height = 350; - data.params.frameborder = '0'; - data.type = 'iframe'; - src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; - setVal('src', src); - setVal('media_type', data.type); - } - - // Google video - if (src.match(/video.google.com(.+)docid=([^&]+)/)) { - data.width = 425; - data.height = 326; - data.type = 'flash'; - src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; - setVal('src', src); - setVal('media_type', data.type); - } - - // Vimeo - if (src.match(/vimeo.com\/([0-9]+)/)) { - data.width = 425; - data.height = 350; - data.params.frameborder = '0'; - data.type = 'iframe'; - src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1]; - setVal('src', src); - setVal('media_type', data.type); - } - - // stream.cz - if (src.match(/stream.cz\/((?!object).)*\/([0-9]+)/)) { - data.width = 425; - data.height = 350; - data.params.frameborder = '0'; - data.type = 'iframe'; - src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1]; - setVal('src', src); - setVal('media_type', data.type); - } - - // Google maps - if (src.match(/maps.google.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) { - data.width = 425; - data.height = 350; - data.params.frameborder = '0'; - data.type = 'iframe'; - src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed"; - setVal('src', src); - setVal('media_type', data.type); - } - - if (data.type == 'video') { - if (!data.video.sources) - data.video.sources = []; - - data.video.sources[0] = {src : src}; - - src = getVal("video_altsource1"); - if (src) - data.video.sources[1] = {src : src}; - - src = getVal("video_altsource2"); - if (src) - data.video.sources[2] = {src : src}; - } else if (data.type == 'audio') { - if (!data.video.sources) - data.video.sources = []; - - data.video.sources[0] = {src : src}; - - src = getVal("audio_altsource1"); - if (src) - data.video.sources[1] = {src : src}; - - src = getVal("audio_altsource2"); - if (src) - data.video.sources[2] = {src : src}; - } else - data.params.src = src; - - // Set default size - setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); - setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); - } - }, - - dataToForm : function() { - this.moveStates(true); - }, - - formToData : function(field) { - if (field == "width" || field == "height") - this.changeSize(field); - - if (field == 'source') { - this.moveStates(false, field); - setVal('source', this.editor.plugins.media.dataToHtml(this.data)); - this.panel = 'source'; - } else { - if (this.panel == 'source') { - this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); - this.dataToForm(); - this.panel = ''; - } - - this.moveStates(false, field); - this.preview(); - } - }, - - beforeResize : function() { - this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); - this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); - }, - - changeSize : function(type) { - var width, height, scale, size; - - if (get('constrain').checked) { - width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); - height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); - - if (type == 'width') { - this.height = Math.round((width / this.width) * height); - setVal('height', this.height); - } else { - this.width = Math.round((height / this.height) * width); - setVal('width', this.width); - } - } - }, - - getMediaListHTML : function() { - if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { - var html = ""; - - html += ''; - - return html; - } - - return ""; - }, - - getMediaTypeHTML : function(editor) { - function option(media_type, element) { - if (!editor.schema.getElementRule(element || media_type)) { - return ''; - } - - return '' - } - - var html = ""; - - html += ''; - return html; - }, - - setDefaultDialogSettings : function(editor) { - var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); - tinymce.each(defaultDialogSettings, function(v, k) { - setVal(k, v); - }); - } - }; - - tinyMCEPopup.requireLangPack(); - tinyMCEPopup.onInit.add(function() { - Media.init(); - }); -})(); +(function() { + var url; + + if (url = tinyMCEPopup.getParam("media_external_list_url")) + document.write(''); + + function get(id) { + return document.getElementById(id); + } + + function clone(obj) { + var i, len, copy, attr; + + if (null == obj || "object" != typeof obj) + return obj; + + // Handle Array + if ('length' in obj) { + copy = []; + + for (i = 0, len = obj.length; i < len; ++i) { + copy[i] = clone(obj[i]); + } + + return copy; + } + + // Handle Object + copy = {}; + for (attr in obj) { + if (obj.hasOwnProperty(attr)) + copy[attr] = clone(obj[attr]); + } + + return copy; + } + + function getVal(id) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + } + + function setVal(id, value, name) { + if (typeof(value) != 'undefined' && value != null) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") { + if (typeof(value) == 'string') { + value = value.toLowerCase(); + value = (!name && value === 'true') || (name && value === name.toLowerCase()); + } + elm.checked = !!value; + } else + elm.value = value; + } + } + + window.Media = { + init : function() { + var html, editor, self = this; + + self.editor = editor = tinyMCEPopup.editor; + + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); + get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); + get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media'); + + html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; + + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('video_filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('video_filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource1')) + get('audio_altsource1').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource2')) + get('audio_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); + + self.setDefaultDialogSettings(editor); + self.data = clone(tinyMCEPopup.getWindowArg('data')); + self.dataToForm(); + self.preview(); + + updateColor('bgcolor_pick', 'bgcolor'); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video' || type == 'audio') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); + } else { + delete list[name]; + + value = getVal(formItemName); + if ((type == 'video' || type == 'audio') && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } + + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); + + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); + + setVal('media_type', data.type); + } + + if (data.type == "video" || data.type == "audio") { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src: getVal('src')}; + } + } + + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('audio_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + get('embeddedaudio_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); + setOptions('audio', 'autoplay,loop,preload,controls'); + setOptions('embeddedaudio', 'autoplay,loop,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else if (data.type == 'audio') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('audio_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('audio_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube *NEW* + if (src.match(/youtu.be\/[a-z1-9.-_]+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // YouTube + if (src.match(/youtube.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google video + if (src.match(/video.google.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + // Vimeo + if (src.match(/vimeo.com\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // stream.cz + if (src.match(/stream.cz\/((?!object).)*\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google maps + if (src.match(/maps.google.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed"; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else if (data.type == 'audio') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("audio_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("audio_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); + setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, + + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; + }, + + getMediaTypeHTML : function(editor) { + function option(media_type, element) { + if (!editor.schema.getElementRule(element || media_type)) { + return ''; + } + + return '' + } + + var html = ""; + + html += ''; + return html; + }, + + setDefaultDialogSettings : function(editor) { + var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); + tinymce.each(defaultDialogSettings, function(v, k) { + setVal(k, v); + }); + } + }; + + tinyMCEPopup.requireLangPack(); + tinyMCEPopup.onInit.add(function() { + Media.init(); + }); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/media/langs/en_dlg.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/media/langs/en_dlg.js index 6f98f07..cc04137 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/media/langs/en_dlg.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/media/langs/en_dlg.js @@ -1 +1 @@ -tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" }); +tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" }); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/nonbreaking/editor_plugin_src.js index d492fbe..6b8299a 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/nonbreaking/editor_plugin_src.js @@ -1,54 +1,54 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Nonbreaking', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceNonBreaking', function() { - ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); - }); - - // Register buttons - ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); - - if (ed.getParam('nonbreaking_force_tab')) { - ed.onKeyDown.add(function(ed, e) { - if (e.keyCode == 9) { - e.preventDefault(); - - ed.execCommand('mceNonBreaking'); - ed.execCommand('mceNonBreaking'); - ed.execCommand('mceNonBreaking'); - } - }); - } - }, - - getInfo : function() { - return { - longname : 'Nonbreaking space', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - - // Private methods - }); - - // Register plugin - tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Nonbreaking', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceNonBreaking', function() { + ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); + }); + + // Register buttons + ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); + + if (ed.getParam('nonbreaking_force_tab')) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode == 9) { + e.preventDefault(); + + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + } + }); + } + }, + + getInfo : function() { + return { + longname : 'Nonbreaking space', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + + // Private methods + }); + + // Register plugin + tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/noneditable/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/noneditable/editor_plugin_src.js index a18bcd7..4eae580 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/noneditable/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/noneditable/editor_plugin_src.js @@ -1,537 +1,537 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var TreeWalker = tinymce.dom.TreeWalker; - var externalName = 'contenteditable', internalName = 'data-mce-' + externalName; - var VK = tinymce.VK; - - function handleContentEditableSelection(ed) { - var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF'; - - // Returns the content editable state of a node "true/false" or null - function getContentEditable(node) { - var contentEditable; - - // Ignore non elements - if (node.nodeType === 1) { - // Check for fake content editable - contentEditable = node.getAttribute(internalName); - if (contentEditable && contentEditable !== "inherit") { - return contentEditable; - } - - // Check for real content editable - contentEditable = node.contentEditable; - if (contentEditable !== "inherit") { - return contentEditable; - } - } - - return null; - }; - - // Returns the noneditable parent or null if there is a editable before it or if it wasn't found - function getNonEditableParent(node) { - var state; - - while (node) { - state = getContentEditable(node); - if (state) { - return state === "false" ? node : null; - } - - node = node.parentNode; - } - }; - - // Get caret container parent for the specified node - function getParentCaretContainer(node) { - while (node) { - if (node.id === caretContainerId) { - return node; - } - - node = node.parentNode; - } - }; - - // Finds the first text node in the specified node - function findFirstTextNode(node) { - var walker; - - if (node) { - walker = new TreeWalker(node, node); - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType === 3) { - return node; - } - } - } - }; - - // Insert caret container before/after target or expand selection to include block - function insertCaretContainerOrExpandToBlock(target, before) { - var caretContainer, rng; - - // Select block - if (getContentEditable(target) === "false") { - if (dom.isBlock(target)) { - selection.select(target); - return; - } - } - - rng = dom.createRng(); - - if (getContentEditable(target) === "true") { - if (!target.firstChild) { - target.appendChild(ed.getDoc().createTextNode('\u00a0')); - } - - target = target.firstChild; - before = true; - } - - //caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style:'border: 1px solid red'}, invisibleChar); - caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar); - - if (before) { - target.parentNode.insertBefore(caretContainer, target); - } else { - dom.insertAfter(caretContainer, target); - } - - rng.setStart(caretContainer.firstChild, 1); - rng.collapse(true); - selection.setRng(rng); - - return caretContainer; - }; - - // Removes any caret container except the one we might be in - function removeCaretContainer(caretContainer) { - var child, currentCaretContainer, lastContainer; - - if (caretContainer) { - rng = selection.getRng(true); - rng.setStartBefore(caretContainer); - rng.setEndBefore(caretContainer); - - child = findFirstTextNode(caretContainer); - if (child && child.nodeValue.charAt(0) == invisibleChar) { - child = child.deleteData(0, 1); - } - - dom.remove(caretContainer, true); - - selection.setRng(rng); - } else { - currentCaretContainer = getParentCaretContainer(selection.getStart()); - while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) { - if (currentCaretContainer !== caretContainer) { - child = findFirstTextNode(caretContainer); - if (child && child.nodeValue.charAt(0) == invisibleChar) { - child = child.deleteData(0, 1); - } - - dom.remove(caretContainer, true); - } - - lastContainer = caretContainer; - } - } - }; - - // Modifies the selection to include contentEditable false elements or insert caret containers - function moveSelection() { - var nonEditableStart, nonEditableEnd, isCollapsed, rng, element; - - // Checks if there is any contents to the left/right side of caret returns the noneditable element or any editable element if it finds one inside - function hasSideContent(element, left) { - var container, offset, walker, node, len; - - container = rng.startContainer; - offset = rng.startOffset; - - // If endpoint is in middle of text node then expand to beginning/end of element - if (container.nodeType == 3) { - len = container.nodeValue.length; - if ((offset > 0 && offset < len) || (left ? offset == len : offset == 0)) { - return; - } - } else { - // Can we resolve the node by index - if (offset < container.childNodes.length) { - // Browser represents caret position as the offset at the start of an element. When moving right - // this is the element we are moving into so we consider our container to be child node at offset-1 - var pos = !left && offset > 0 ? offset-1 : offset; - container = container.childNodes[pos]; - if (container.hasChildNodes()) { - container = container.firstChild; - } - } else { - // If not then the caret is at the last position in it's container and the caret container should be inserted after the noneditable element - return !left ? element : null; - } - } - - // Walk left/right to look for contents - walker = new TreeWalker(container, element); - while (node = walker[left ? 'prev' : 'next']()) { - if (node.nodeType === 3 && node.nodeValue.length > 0) { - return; - } else if (getContentEditable(node) === "true") { - // Found contentEditable=true element return this one to we can move the caret inside it - return node; - } - } - - return element; - }; - - // Remove any existing caret containers - removeCaretContainer(); - - // Get noneditable start/end elements - isCollapsed = selection.isCollapsed(); - nonEditableStart = getNonEditableParent(selection.getStart()); - nonEditableEnd = getNonEditableParent(selection.getEnd()); - - // Is any fo the range endpoints noneditable - if (nonEditableStart || nonEditableEnd) { - rng = selection.getRng(true); - - // If it's a caret selection then look left/right to see if we need to move the caret out side or expand - if (isCollapsed) { - nonEditableStart = nonEditableStart || nonEditableEnd; - var start = selection.getStart(); - if (element = hasSideContent(nonEditableStart, true)) { - // We have no contents to the left of the caret then insert a caret container before the noneditable element - insertCaretContainerOrExpandToBlock(element, true); - } else if (element = hasSideContent(nonEditableStart, false)) { - // We have no contents to the right of the caret then insert a caret container after the noneditable element - insertCaretContainerOrExpandToBlock(element, false); - } else { - // We are in the middle of a noneditable so expand to select it - selection.select(nonEditableStart); - } - } else { - rng = selection.getRng(true); - - // Expand selection to include start non editable element - if (nonEditableStart) { - rng.setStartBefore(nonEditableStart); - } - - // Expand selection to include end non editable element - if (nonEditableEnd) { - rng.setEndAfter(nonEditableEnd); - } - - selection.setRng(rng); - } - } - }; - - function handleKey(ed, e) { - var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement; - - function getNonEmptyTextNodeSibling(node, prev) { - while (node = node[prev ? 'previousSibling' : 'nextSibling']) { - if (node.nodeType !== 3 || node.nodeValue.length > 0) { - return node; - } - } - }; - - function positionCaretOnElement(element, start) { - selection.select(element); - selection.collapse(start); - } - - function canDelete(backspace) { - var rng, container, offset, nonEditableParent; - - function removeNodeIfNotParent(node) { - var parent = container; - - while (parent) { - if (parent === node) { - return; - } - - parent = parent.parentNode; - } - - dom.remove(node); - moveSelection(); - } - - function isNextPrevTreeNodeNonEditable() { - var node, walker, nonEmptyElements = ed.schema.getNonEmptyElements(); - - walker = new tinymce.dom.TreeWalker(container, ed.getBody()); - while (node = (backspace ? walker.prev() : walker.next())) { - // Found IMG/INPUT etc - if (nonEmptyElements[node.nodeName.toLowerCase()]) { - break; - } - - // Found text node with contents - if (node.nodeType === 3 && tinymce.trim(node.nodeValue).length > 0) { - break; - } - - // Found non editable node - if (getContentEditable(node) === "false") { - removeNodeIfNotParent(node); - return true; - } - } - - // Check if the content node is within a non editable parent - if (getNonEditableParent(node)) { - return true; - } - - return false; - } - - if (selection.isCollapsed()) { - rng = selection.getRng(true); - container = rng.startContainer; - offset = rng.startOffset; - container = getParentCaretContainer(container) || container; - - // Is in noneditable parent - if (nonEditableParent = getNonEditableParent(container)) { - removeNodeIfNotParent(nonEditableParent); - return false; - } - - // Check if the caret is in the middle of a text node - if (container.nodeType == 3 && (backspace ? offset > 0 : offset < container.nodeValue.length)) { - return true; - } - - // Resolve container index - if (container.nodeType == 1) { - container = container.childNodes[offset] || container; - } - - // Check if previous or next tree node is non editable then block the event - if (isNextPrevTreeNodeNonEditable()) { - return false; - } - } - - return true; - } - - startElement = selection.getStart() - endElement = selection.getEnd(); - - // Disable all key presses in contentEditable=false except delete or backspace - nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement); - if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) { - // Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior - if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) { - return; - } - - e.preventDefault(); - - // Arrow left/right select the element and collapse left/right - if (keyCode == VK.LEFT || keyCode == VK.RIGHT) { - var left = keyCode == VK.LEFT; - // If a block element find previous or next element to position the caret - if (ed.dom.isBlock(nonEditableParent)) { - var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling; - var walker = new TreeWalker(targetElement, targetElement); - var caretElement = left ? walker.prev() : walker.next(); - positionCaretOnElement(caretElement, !left); - } else { - positionCaretOnElement(nonEditableParent, left); - } - } - } else { - // Is arrow left/right, backspace or delete - if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) { - caretContainer = getParentCaretContainer(startElement); - if (caretContainer) { - // Arrow left or backspace - if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) { - nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true); - - if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { - e.preventDefault(); - - if (keyCode == VK.LEFT) { - positionCaretOnElement(nonEditableParent, true); - } else { - dom.remove(nonEditableParent); - return; - } - } else { - removeCaretContainer(caretContainer); - } - } - - // Arrow right or delete - if (keyCode == VK.RIGHT || keyCode == VK.DELETE) { - nonEditableParent = getNonEmptyTextNodeSibling(caretContainer); - - if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { - e.preventDefault(); - - if (keyCode == VK.RIGHT) { - positionCaretOnElement(nonEditableParent, false); - } else { - dom.remove(nonEditableParent); - return; - } - } else { - removeCaretContainer(caretContainer); - } - } - } - - if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) { - e.preventDefault(); - return false; - } - } - } - }; - - ed.onMouseDown.addToTop(function(ed, e) { - var node = ed.selection.getNode(); - - if (getContentEditable(node) === "false" && node == e.target) { - // Expand selection on mouse down we can't block the default event since it's used for drag/drop - moveSelection(); - } - }); - - ed.onMouseUp.addToTop(moveSelection); - ed.onKeyDown.addToTop(handleKey); - ed.onKeyUp.addToTop(moveSelection); - }; - - tinymce.create('tinymce.plugins.NonEditablePlugin', { - init : function(ed, url) { - var editClass, nonEditClass, nonEditableRegExps; - - // Converts configured regexps to noneditable span items - function convertRegExpsToNonEditable(ed, args) { - var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass); - - // Don't replace the variables when raw is used for example on undo/redo - if (args.format == "raw") { - return; - } - - while (i--) { - content = content.replace(nonEditableRegExps[i], function(match) { - var args = arguments, index = args[args.length - 2]; - - // Is value inside an attribute then don't replace - if (index > 0 && content.charAt(index - 1) == '"') { - return match; - } - - return '' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + ''; - }); - } - - args.content = content; - }; - - editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " "; - nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " "; - - // Setup noneditable regexps array - nonEditableRegExps = ed.getParam("noneditable_regexp"); - if (nonEditableRegExps && !nonEditableRegExps.length) { - nonEditableRegExps = [nonEditableRegExps]; - } - - ed.onPreInit.add(function() { - handleContentEditableSelection(ed); - - if (nonEditableRegExps) { - ed.selection.onBeforeSetContent.add(convertRegExpsToNonEditable); - ed.onBeforeSetContent.add(convertRegExpsToNonEditable); - } - - // Apply contentEditable true/false on elements with the noneditable/editable classes - ed.parser.addAttributeFilter('class', function(nodes) { - var i = nodes.length, className, node; - - while (i--) { - node = nodes[i]; - className = " " + node.attr("class") + " "; - - if (className.indexOf(editClass) !== -1) { - node.attr(internalName, "true"); - } else if (className.indexOf(nonEditClass) !== -1) { - node.attr(internalName, "false"); - } - } - }); - - // Remove internal name - ed.serializer.addAttributeFilter(internalName, function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (nonEditableRegExps && node.attr('data-mce-content')) { - node.name = "#text"; - node.type = 3; - node.raw = true; - node.value = node.attr('data-mce-content'); - } else { - node.attr(externalName, null); - node.attr(internalName, null); - } - } - }); - - // Convert external name into internal name - ed.parser.addAttributeFilter(externalName, function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.attr(internalName, node.attr(externalName)); - node.attr(externalName, null); - } - }); - }); - }, - - getInfo : function() { - return { - longname : 'Non editable elements', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var TreeWalker = tinymce.dom.TreeWalker; + var externalName = 'contenteditable', internalName = 'data-mce-' + externalName; + var VK = tinymce.VK; + + function handleContentEditableSelection(ed) { + var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF'; + + // Returns the content editable state of a node "true/false" or null + function getContentEditable(node) { + var contentEditable; + + // Ignore non elements + if (node.nodeType === 1) { + // Check for fake content editable + contentEditable = node.getAttribute(internalName); + if (contentEditable && contentEditable !== "inherit") { + return contentEditable; + } + + // Check for real content editable + contentEditable = node.contentEditable; + if (contentEditable !== "inherit") { + return contentEditable; + } + } + + return null; + }; + + // Returns the noneditable parent or null if there is a editable before it or if it wasn't found + function getNonEditableParent(node) { + var state; + + while (node) { + state = getContentEditable(node); + if (state) { + return state === "false" ? node : null; + } + + node = node.parentNode; + } + }; + + // Get caret container parent for the specified node + function getParentCaretContainer(node) { + while (node) { + if (node.id === caretContainerId) { + return node; + } + + node = node.parentNode; + } + }; + + // Finds the first text node in the specified node + function findFirstTextNode(node) { + var walker; + + if (node) { + walker = new TreeWalker(node, node); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3) { + return node; + } + } + } + }; + + // Insert caret container before/after target or expand selection to include block + function insertCaretContainerOrExpandToBlock(target, before) { + var caretContainer, rng; + + // Select block + if (getContentEditable(target) === "false") { + if (dom.isBlock(target)) { + selection.select(target); + return; + } + } + + rng = dom.createRng(); + + if (getContentEditable(target) === "true") { + if (!target.firstChild) { + target.appendChild(ed.getDoc().createTextNode('\u00a0')); + } + + target = target.firstChild; + before = true; + } + + //caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style:'border: 1px solid red'}, invisibleChar); + caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar); + + if (before) { + target.parentNode.insertBefore(caretContainer, target); + } else { + dom.insertAfter(caretContainer, target); + } + + rng.setStart(caretContainer.firstChild, 1); + rng.collapse(true); + selection.setRng(rng); + + return caretContainer; + }; + + // Removes any caret container except the one we might be in + function removeCaretContainer(caretContainer) { + var child, currentCaretContainer, lastContainer; + + if (caretContainer) { + rng = selection.getRng(true); + rng.setStartBefore(caretContainer); + rng.setEndBefore(caretContainer); + + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + + selection.setRng(rng); + } else { + currentCaretContainer = getParentCaretContainer(selection.getStart()); + while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) { + if (currentCaretContainer !== caretContainer) { + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + } + + lastContainer = caretContainer; + } + } + }; + + // Modifies the selection to include contentEditable false elements or insert caret containers + function moveSelection() { + var nonEditableStart, nonEditableEnd, isCollapsed, rng, element; + + // Checks if there is any contents to the left/right side of caret returns the noneditable element or any editable element if it finds one inside + function hasSideContent(element, left) { + var container, offset, walker, node, len; + + container = rng.startContainer; + offset = rng.startOffset; + + // If endpoint is in middle of text node then expand to beginning/end of element + if (container.nodeType == 3) { + len = container.nodeValue.length; + if ((offset > 0 && offset < len) || (left ? offset == len : offset == 0)) { + return; + } + } else { + // Can we resolve the node by index + if (offset < container.childNodes.length) { + // Browser represents caret position as the offset at the start of an element. When moving right + // this is the element we are moving into so we consider our container to be child node at offset-1 + var pos = !left && offset > 0 ? offset-1 : offset; + container = container.childNodes[pos]; + if (container.hasChildNodes()) { + container = container.firstChild; + } + } else { + // If not then the caret is at the last position in it's container and the caret container should be inserted after the noneditable element + return !left ? element : null; + } + } + + // Walk left/right to look for contents + walker = new TreeWalker(container, element); + while (node = walker[left ? 'prev' : 'next']()) { + if (node.nodeType === 3 && node.nodeValue.length > 0) { + return; + } else if (getContentEditable(node) === "true") { + // Found contentEditable=true element return this one to we can move the caret inside it + return node; + } + } + + return element; + }; + + // Remove any existing caret containers + removeCaretContainer(); + + // Get noneditable start/end elements + isCollapsed = selection.isCollapsed(); + nonEditableStart = getNonEditableParent(selection.getStart()); + nonEditableEnd = getNonEditableParent(selection.getEnd()); + + // Is any fo the range endpoints noneditable + if (nonEditableStart || nonEditableEnd) { + rng = selection.getRng(true); + + // If it's a caret selection then look left/right to see if we need to move the caret out side or expand + if (isCollapsed) { + nonEditableStart = nonEditableStart || nonEditableEnd; + var start = selection.getStart(); + if (element = hasSideContent(nonEditableStart, true)) { + // We have no contents to the left of the caret then insert a caret container before the noneditable element + insertCaretContainerOrExpandToBlock(element, true); + } else if (element = hasSideContent(nonEditableStart, false)) { + // We have no contents to the right of the caret then insert a caret container after the noneditable element + insertCaretContainerOrExpandToBlock(element, false); + } else { + // We are in the middle of a noneditable so expand to select it + selection.select(nonEditableStart); + } + } else { + rng = selection.getRng(true); + + // Expand selection to include start non editable element + if (nonEditableStart) { + rng.setStartBefore(nonEditableStart); + } + + // Expand selection to include end non editable element + if (nonEditableEnd) { + rng.setEndAfter(nonEditableEnd); + } + + selection.setRng(rng); + } + } + }; + + function handleKey(ed, e) { + var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement; + + function getNonEmptyTextNodeSibling(node, prev) { + while (node = node[prev ? 'previousSibling' : 'nextSibling']) { + if (node.nodeType !== 3 || node.nodeValue.length > 0) { + return node; + } + } + }; + + function positionCaretOnElement(element, start) { + selection.select(element); + selection.collapse(start); + } + + function canDelete(backspace) { + var rng, container, offset, nonEditableParent; + + function removeNodeIfNotParent(node) { + var parent = container; + + while (parent) { + if (parent === node) { + return; + } + + parent = parent.parentNode; + } + + dom.remove(node); + moveSelection(); + } + + function isNextPrevTreeNodeNonEditable() { + var node, walker, nonEmptyElements = ed.schema.getNonEmptyElements(); + + walker = new tinymce.dom.TreeWalker(container, ed.getBody()); + while (node = (backspace ? walker.prev() : walker.next())) { + // Found IMG/INPUT etc + if (nonEmptyElements[node.nodeName.toLowerCase()]) { + break; + } + + // Found text node with contents + if (node.nodeType === 3 && tinymce.trim(node.nodeValue).length > 0) { + break; + } + + // Found non editable node + if (getContentEditable(node) === "false") { + removeNodeIfNotParent(node); + return true; + } + } + + // Check if the content node is within a non editable parent + if (getNonEditableParent(node)) { + return true; + } + + return false; + } + + if (selection.isCollapsed()) { + rng = selection.getRng(true); + container = rng.startContainer; + offset = rng.startOffset; + container = getParentCaretContainer(container) || container; + + // Is in noneditable parent + if (nonEditableParent = getNonEditableParent(container)) { + removeNodeIfNotParent(nonEditableParent); + return false; + } + + // Check if the caret is in the middle of a text node + if (container.nodeType == 3 && (backspace ? offset > 0 : offset < container.nodeValue.length)) { + return true; + } + + // Resolve container index + if (container.nodeType == 1) { + container = container.childNodes[offset] || container; + } + + // Check if previous or next tree node is non editable then block the event + if (isNextPrevTreeNodeNonEditable()) { + return false; + } + } + + return true; + } + + startElement = selection.getStart() + endElement = selection.getEnd(); + + // Disable all key presses in contentEditable=false except delete or backspace + nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement); + if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) { + // Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior + if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) { + return; + } + + e.preventDefault(); + + // Arrow left/right select the element and collapse left/right + if (keyCode == VK.LEFT || keyCode == VK.RIGHT) { + var left = keyCode == VK.LEFT; + // If a block element find previous or next element to position the caret + if (ed.dom.isBlock(nonEditableParent)) { + var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling; + var walker = new TreeWalker(targetElement, targetElement); + var caretElement = left ? walker.prev() : walker.next(); + positionCaretOnElement(caretElement, !left); + } else { + positionCaretOnElement(nonEditableParent, left); + } + } + } else { + // Is arrow left/right, backspace or delete + if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) { + caretContainer = getParentCaretContainer(startElement); + if (caretContainer) { + // Arrow left or backspace + if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.LEFT) { + positionCaretOnElement(nonEditableParent, true); + } else { + dom.remove(nonEditableParent); + return; + } + } else { + removeCaretContainer(caretContainer); + } + } + + // Arrow right or delete + if (keyCode == VK.RIGHT || keyCode == VK.DELETE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.RIGHT) { + positionCaretOnElement(nonEditableParent, false); + } else { + dom.remove(nonEditableParent); + return; + } + } else { + removeCaretContainer(caretContainer); + } + } + } + + if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) { + e.preventDefault(); + return false; + } + } + } + }; + + ed.onMouseDown.addToTop(function(ed, e) { + var node = ed.selection.getNode(); + + if (getContentEditable(node) === "false" && node == e.target) { + // Expand selection on mouse down we can't block the default event since it's used for drag/drop + moveSelection(); + } + }); + + ed.onMouseUp.addToTop(moveSelection); + ed.onKeyDown.addToTop(handleKey); + ed.onKeyUp.addToTop(moveSelection); + }; + + tinymce.create('tinymce.plugins.NonEditablePlugin', { + init : function(ed, url) { + var editClass, nonEditClass, nonEditableRegExps; + + // Converts configured regexps to noneditable span items + function convertRegExpsToNonEditable(ed, args) { + var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass); + + // Don't replace the variables when raw is used for example on undo/redo + if (args.format == "raw") { + return; + } + + while (i--) { + content = content.replace(nonEditableRegExps[i], function(match) { + var args = arguments, index = args[args.length - 2]; + + // Is value inside an attribute then don't replace + if (index > 0 && content.charAt(index - 1) == '"') { + return match; + } + + return '' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + ''; + }); + } + + args.content = content; + }; + + editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " "; + nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " "; + + // Setup noneditable regexps array + nonEditableRegExps = ed.getParam("noneditable_regexp"); + if (nonEditableRegExps && !nonEditableRegExps.length) { + nonEditableRegExps = [nonEditableRegExps]; + } + + ed.onPreInit.add(function() { + handleContentEditableSelection(ed); + + if (nonEditableRegExps) { + ed.selection.onBeforeSetContent.add(convertRegExpsToNonEditable); + ed.onBeforeSetContent.add(convertRegExpsToNonEditable); + } + + // Apply contentEditable true/false on elements with the noneditable/editable classes + ed.parser.addAttributeFilter('class', function(nodes) { + var i = nodes.length, className, node; + + while (i--) { + node = nodes[i]; + className = " " + node.attr("class") + " "; + + if (className.indexOf(editClass) !== -1) { + node.attr(internalName, "true"); + } else if (className.indexOf(nonEditClass) !== -1) { + node.attr(internalName, "false"); + } + } + }); + + // Remove internal name + ed.serializer.addAttributeFilter(internalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + + if (nonEditableRegExps && node.attr('data-mce-content')) { + node.name = "#text"; + node.type = 3; + node.raw = true; + node.value = node.attr('data-mce-content'); + } else { + node.attr(externalName, null); + node.attr(internalName, null); + } + } + }); + + // Convert external name into internal name + ed.parser.addAttributeFilter(externalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.attr(internalName, node.attr(externalName)); + node.attr(externalName, null); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'Non editable elements', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/pagebreak/editor_plugin_src.js index a094c19..93e1a31 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/pagebreak/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/pagebreak/editor_plugin_src.js @@ -1,74 +1,74 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.PageBreakPlugin', { - init : function(ed, url) { - var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; - - pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); - - // Register commands - ed.addCommand('mcePageBreak', function() { - ed.execCommand('mceInsertContent', 0, pb); - }); - - // Register buttons - ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); - - ed.onInit.add(function() { - if (ed.theme.onResolveName) { - ed.theme.onResolveName.add(function(th, o) { - if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) - o.name = 'pagebreak'; - }); - } - }); - - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) - ed.selection.select(e); - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); - }); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = o.content.replace(pbRE, pb); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.get) - o.content = o.content.replace(/]+>/g, function(im) { - if (im.indexOf('class="mcePageBreak') !== -1) - im = sep; - - return im; - }); - }); - }, - - getInfo : function() { - return { - longname : 'PageBreak', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.PageBreakPlugin', { + init : function(ed, url) { + var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; + + pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); + + // Register commands + ed.addCommand('mcePageBreak', function() { + ed.execCommand('mceInsertContent', 0, pb); + }); + + // Register buttons + ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); + + ed.onInit.add(function() { + if (ed.theme.onResolveName) { + ed.theme.onResolveName.add(function(th, o) { + if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) + o.name = 'pagebreak'; + }); + } + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) + ed.selection.select(e); + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); + }); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = o.content.replace(pbRE, pb); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = o.content.replace(/]+>/g, function(im) { + if (im.indexOf('class="mcePageBreak') !== -1) + im = sep; + + return im; + }); + }); + }, + + getInfo : function() { + return { + longname : 'PageBreak', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/editor_plugin_src.js index 0154ece..00b3c71 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/editor_plugin_src.js @@ -1,885 +1,885 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each, - defs = { - paste_auto_cleanup_on_paste : true, - paste_enable_default_filters : true, - paste_block_drop : false, - paste_retain_style_properties : "none", - paste_strip_class_attributes : "mso", - paste_remove_spans : false, - paste_remove_styles : false, - paste_remove_styles_if_webkit : true, - paste_convert_middot_lists : true, - paste_convert_headers_to_strong : false, - paste_dialog_width : "450", - paste_dialog_height : "400", - paste_max_consecutive_linebreaks: 2, - paste_text_use_dialog : false, - paste_text_sticky : false, - paste_text_sticky_default : false, - paste_text_notifyalways : false, - paste_text_linebreaktype : "combined", - paste_text_replacements : [ - [/\u2026/g, "..."], - [/[\x93\x94\u201c\u201d]/g, '"'], - [/[\x60\x91\x92\u2018\u2019]/g, "'"] - ] - }; - - function getParam(ed, name) { - return ed.getParam(name, defs[name]); - } - - tinymce.create('tinymce.plugins.PastePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - t.url = url; - - // Setup plugin events - t.onPreProcess = new tinymce.util.Dispatcher(t); - t.onPostProcess = new tinymce.util.Dispatcher(t); - - // Register default handlers - t.onPreProcess.add(t._preProcess); - t.onPostProcess.add(t._postProcess); - - // Register optional preprocess handler - t.onPreProcess.add(function(pl, o) { - ed.execCallback('paste_preprocess', pl, o); - }); - - // Register optional postprocess - t.onPostProcess.add(function(pl, o) { - ed.execCallback('paste_postprocess', pl, o); - }); - - ed.onKeyDown.addToTop(function(ed, e) { - // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that - if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) - return false; // Stop other listeners - }); - - // Initialize plain text flag - ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); - - // This function executes the process handlers and inserts the contents - // force_rich overrides plain text mode set by user, important for pasting with execCommand - function process(o, force_rich) { - var dom = ed.dom, rng; - - // Execute pre process handlers - t.onPreProcess.dispatch(t, o); - - // Create DOM structure - o.node = dom.create('div', 0, o.content); - - // If pasting inside the same element and the contents is only one block - // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element - if (tinymce.isGecko) { - rng = ed.selection.getRng(true); - if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { - // Is only one block node and it doesn't contain word stuff - if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) - dom.remove(o.node.firstChild, true); - } - } - - // Execute post process handlers - t.onPostProcess.dispatch(t, o); - - // Serialize content - o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); - - // Plain text option active? - if ((!force_rich) && (ed.pasteAsPlainText)) { - t._insertPlainText(o.content); - - if (!getParam(ed, "paste_text_sticky")) { - ed.pasteAsPlainText = false; - ed.controlManager.setActive("pastetext", false); - } - } else { - t._insert(o.content); - } - } - - // Add command for external usage - ed.addCommand('mceInsertClipboardContent', function(u, o) { - process(o, true); - }); - - if (!getParam(ed, "paste_text_use_dialog")) { - ed.addCommand('mcePasteText', function(u, v) { - var cookie = tinymce.util.Cookie; - - ed.pasteAsPlainText = !ed.pasteAsPlainText; - ed.controlManager.setActive('pastetext', ed.pasteAsPlainText); - - if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) { - if (getParam(ed, "paste_text_sticky")) { - ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); - } else { - ed.windowManager.alert(ed.translate('paste.plaintext_mode')); - } - - if (!getParam(ed, "paste_text_notifyalways")) { - cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31)) - } - } - }); - } - - ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'}); - ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'}); - - // This function grabs the contents from the clipboard by adding a - // hidden div and placing the caret inside it and after the browser paste - // is done it grabs that contents and processes that - function grabContent(e) { - var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; - - // Check if browser supports direct plaintext access - if (e.clipboardData || dom.doc.dataTransfer) { - textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); - - if (ed.pasteAsPlainText) { - e.preventDefault(); - process({content : dom.encode(textContent).replace(/\r?\n/g, '
      ')}); - return; - } - } - - if (dom.get('_mcePaste')) - return; - - // Create container to paste into - n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); - - // If contentEditable mode we need to find out the position of the closest element - if (body != ed.getDoc().body) - posY = dom.getPos(ed.selection.getStart(), body).y; - else - posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; - - // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles - // If also needs to be in view on IE or the paste would fail - dom.setStyles(n, { - position : 'absolute', - left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div - top : posY - 25, - width : 1, - height : 1, - overflow : 'hidden' - }); - - if (tinymce.isIE) { - // Store away the old range - oldRng = sel.getRng(); - - // Select the container - rng = dom.doc.body.createTextRange(); - rng.moveToElementText(n); - rng.execCommand('Paste'); - - // Remove container - dom.remove(n); - - // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due - // to IE security settings so we pass the junk though better than nothing right - if (n.innerHTML === '\uFEFF\uFEFF') { - ed.execCommand('mcePasteWord'); - e.preventDefault(); - return; - } - - // Restore the old range and clear the contents before pasting - sel.setRng(oldRng); - sel.setContent(''); - - // For some odd reason we need to detach the the mceInsertContent call from the paste event - // It's like IE has a reference to the parent element that you paste in and the selection gets messed up - // when it tries to restore the selection - setTimeout(function() { - // Process contents - process({content : n.innerHTML}); - }, 0); - - // Block the real paste event - return tinymce.dom.Event.cancel(e); - } else { - function block(e) { - e.preventDefault(); - }; - - // Block mousedown and click to prevent selection change - dom.bind(ed.getDoc(), 'mousedown', block); - dom.bind(ed.getDoc(), 'keydown', block); - - or = ed.selection.getRng(); - - // Move select contents inside DIV - n = n.firstChild; - rng = ed.getDoc().createRange(); - rng.setStart(n, 0); - rng.setEnd(n, 2); - sel.setRng(rng); - - // Wait a while and grab the pasted contents - window.setTimeout(function() { - var h = '', nl; - - // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit - if (!dom.select('div.mcePaste > div.mcePaste').length) { - nl = dom.select('div.mcePaste'); - - // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string - each(nl, function(n) { - var child = n.firstChild; - - // WebKit inserts a DIV container with lots of odd styles - if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { - dom.remove(child, 1); - } - - // Remove apply style spans - each(dom.select('span.Apple-style-span', n), function(n) { - dom.remove(n, 1); - }); - - // Remove bogus br elements - each(dom.select('br[data-mce-bogus]', n), function(n) { - dom.remove(n); - }); - - // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV - if (n.parentNode.className != 'mcePaste') - h += n.innerHTML; - }); - } else { - // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc - // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same - h = '

      ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

      ').replace(/\r?\n/g, '
      ') + '

      '; - } - - // Remove the nodes - each(dom.select('div.mcePaste'), function(n) { - dom.remove(n); - }); - - // Restore the old selection - if (or) - sel.setRng(or); - - process({content : h}); - - // Unblock events ones we got the contents - dom.unbind(ed.getDoc(), 'mousedown', block); - dom.unbind(ed.getDoc(), 'keydown', block); - }, 0); - } - } - - // Check if we should use the new auto process method - if (getParam(ed, "paste_auto_cleanup_on_paste")) { - // Is it's Opera or older FF use key handler - if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { - ed.onKeyDown.addToTop(function(ed, e) { - if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) - grabContent(e); - }); - } else { - // Grab contents on paste event on Gecko and WebKit - ed.onPaste.addToTop(function(ed, e) { - return grabContent(e); - }); - } - } - - ed.onInit.add(function() { - ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); - - // Block all drag/drop events - if (getParam(ed, "paste_block_drop")) { - ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { - e.preventDefault(); - e.stopPropagation(); - - return false; - }); - } - }); - - // Add legacy support - t._legacySupport(); - }, - - getInfo : function() { - return { - longname : 'Paste text/word', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _preProcess : function(pl, o) { - var ed = this.editor, - h = o.content, - grep = tinymce.grep, - explode = tinymce.explode, - trim = tinymce.trim, - len, stripClass; - - //console.log('Before preprocess:' + o.content); - - function process(items) { - each(items, function(v) { - // Remove or replace - if (v.constructor == RegExp) - h = h.replace(v, ''); - else - h = h.replace(v[0], v[1]); - }); - } - - if (ed.settings.paste_enable_default_filters == false) { - return; - } - - // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser - if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) { - // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser - process([[/(?:
       [\s\r\n]+|
      )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
       [\s\r\n]+|
      )*/g, '$1']]); - - // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break - process([ - [/

      /g, '

      '], // Replace multiple BR elements with uppercase BR to keep them intact - [/
      /g, ' '], // Replace single br elements with space since they are word wrap BR:s - [/

      /g, '
      '] // Replace back the double brs but into a single BR - ]); - } - - // Detect Word content and process it more aggressive - if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { - o.wordContent = true; // Mark the pasted contents as word specific content - //console.log('Word contents detected.'); - - // Process away some basic content - process([ - /^\s*( )+/gi, //   entities at the start of contents - /( |]*>)+\s*$/gi //   entities at the end of contents - ]); - - if (getParam(ed, "paste_convert_headers_to_strong")) { - h = h.replace(/

      ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

      $1

      "); - } - - if (getParam(ed, "paste_convert_middot_lists")) { - process([ - [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker - [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers - [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) - ]); - } - - process([ - // Word comments like conditional comments etc - //gi, - - // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags - /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, - - // Convert into for line-though - [/<(\/?)s>/gi, "<$1strike>"], - - // Replace nsbp entites to char since it's easier to handle - [/ /gi, "\u00a0"] - ]); - - // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. - // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. - do { - len = h.length; - h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); - } while (len != h.length); - - // Remove all spans if no styles is to be retained - if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { - h = h.replace(/<\/?span[^>]*>/gi, ""); - } else { - // We're keeping styles, so at least clean them up. - // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx - - process([ - // Convert ___ to string of alternating breaking/non-breaking spaces of same length - [/([\s\u00a0]*)<\/span>/gi, - function(str, spaces) { - return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; - } - ], - - // Examine all styles: delete junk, transform some, and keep the rest - [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, - function(str, tag, style) { - var n = [], - i = 0, - s = explode(trim(style).replace(/"/gi, "'"), ";"); - - // Examine each style definition within the tag's style attribute - each(s, function(v) { - var name, value, - parts = explode(v, ":"); - - function ensureUnits(v) { - return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; - } - - if (parts.length == 2) { - name = parts[0].toLowerCase(); - value = parts[1].toLowerCase(); - - // Translate certain MS Office styles into their CSS equivalents - switch (name) { - case "mso-padding-alt": - case "mso-padding-top-alt": - case "mso-padding-right-alt": - case "mso-padding-bottom-alt": - case "mso-padding-left-alt": - case "mso-margin-alt": - case "mso-margin-top-alt": - case "mso-margin-right-alt": - case "mso-margin-bottom-alt": - case "mso-margin-left-alt": - case "mso-table-layout-alt": - case "mso-height": - case "mso-width": - case "mso-vertical-align-alt": - n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); - return; - - case "horiz-align": - n[i++] = "text-align:" + value; - return; - - case "vert-align": - n[i++] = "vertical-align:" + value; - return; - - case "font-color": - case "mso-foreground": - n[i++] = "color:" + value; - return; - - case "mso-background": - case "mso-highlight": - n[i++] = "background:" + value; - return; - - case "mso-default-height": - n[i++] = "min-height:" + ensureUnits(value); - return; - - case "mso-default-width": - n[i++] = "min-width:" + ensureUnits(value); - return; - - case "mso-padding-between-alt": - n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); - return; - - case "text-line-through": - if ((value == "single") || (value == "double")) { - n[i++] = "text-decoration:line-through"; - } - return; - - case "mso-zero-height": - if (value == "yes") { - n[i++] = "display:none"; - } - return; - } - - // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name - if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { - return; - } - - // If it reached this point, it must be a valid CSS style - n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case - } - }); - - // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. - if (i > 0) { - return tag + ' style="' + n.join(';') + '"'; - } else { - return tag; - } - } - ] - ]); - } - } - - // Replace headers with - if (getParam(ed, "paste_convert_headers_to_strong")) { - process([ - [/]*>/gi, "

      "], - [/<\/h[1-6][^>]*>/gi, "

      "] - ]); - } - - process([ - // Copy paste from Java like Open Office will produce this junk on FF - [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] - ]); - - // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). - // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. - stripClass = getParam(ed, "paste_strip_class_attributes"); - - if (stripClass !== "none") { - function removeClasses(match, g1) { - if (stripClass === "all") - return ''; - - var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), - function(v) { - return (/^(?!mso)/i.test(v)); - } - ); - - return cls.length ? ' class="' + cls.join(" ") + '"' : ''; - }; - - h = h.replace(/ class="([^"]+)"/gi, removeClasses); - h = h.replace(/ class=([\-\w]+)/gi, removeClasses); - } - - // Remove spans option - if (getParam(ed, "paste_remove_spans")) { - h = h.replace(/<\/?span[^>]*>/gi, ""); - } - - //console.log('After preprocess:' + h); - - o.content = h; - }, - - /** - * Various post process items. - */ - _postProcess : function(pl, o) { - var t = this, ed = t.editor, dom = ed.dom, styleProps; - - if (ed.settings.paste_enable_default_filters == false) { - return; - } - - if (o.wordContent) { - // Remove named anchors or TOC links - each(dom.select('a', o.node), function(a) { - if (!a.href || a.href.indexOf('#_Toc') != -1) - dom.remove(a, 1); - }); - - if (getParam(ed, "paste_convert_middot_lists")) { - t._convertLists(pl, o); - } - - // Process styles - styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties - - // Process only if a string was specified and not equal to "all" or "*" - if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { - styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); - - // Retains some style properties - each(dom.select('*', o.node), function(el) { - var newStyle = {}, npc = 0, i, sp, sv; - - // Store a subset of the existing styles - if (styleProps) { - for (i = 0; i < styleProps.length; i++) { - sp = styleProps[i]; - sv = dom.getStyle(el, sp); - - if (sv) { - newStyle[sp] = sv; - npc++; - } - } - } - - // Remove all of the existing styles - dom.setAttrib(el, 'style', ''); - - if (styleProps && npc > 0) - dom.setStyles(el, newStyle); // Add back the stored subset of styles - else // Remove empty span tags that do not have class attributes - if (el.nodeName == 'SPAN' && !el.className) - dom.remove(el, true); - }); - } - } - - // Remove all style information or only specifically on WebKit to avoid the style bug on that browser - if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { - each(dom.select('*[style]', o.node), function(el) { - el.removeAttribute('style'); - el.removeAttribute('data-mce-style'); - }); - } else { - if (tinymce.isWebKit) { - // We need to compress the styles on WebKit since if you paste it will become - // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles - each(dom.select('*', o.node), function(el) { - el.removeAttribute('data-mce-style'); - }); - } - } - }, - - /** - * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. - */ - _convertLists : function(pl, o) { - var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; - - // Convert middot lists into real semantic lists - each(dom.select('p', o.node), function(p) { - var sib, val = '', type, html, idx, parents; - - // Get text node value at beginning of paragraph - for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) - val += sib.nodeValue; - - val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); - - // Detect unordered lists look for bullets - if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) - type = 'ul'; - - // Detect ordered lists 1., a. or ixv. - if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) - type = 'ol'; - - // Check if node value matches the list pattern: o   - if (type) { - margin = parseFloat(p.style.marginLeft || 0); - - if (margin > lastMargin) - levels.push(margin); - - if (!listElm || type != lastType) { - listElm = dom.create(type); - dom.insertAfter(listElm, p); - } else { - // Nested list element - if (margin > lastMargin) { - listElm = li.appendChild(dom.create(type)); - } else if (margin < lastMargin) { - // Find parent level based on margin value - idx = tinymce.inArray(levels, margin); - parents = dom.getParents(listElm.parentNode, type); - listElm = parents[parents.length - 1 - idx] || listElm; - } - } - - // Remove middot or number spans if they exists - each(dom.select('span', p), function(span) { - var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); - - // Remove span with the middot or the number - if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) - dom.remove(span); - else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) - dom.remove(span); - }); - - html = p.innerHTML; - - // Remove middot/list items - if (type == 'ul') - html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); - else - html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); - - // Create li and add paragraph data into the new li - li = listElm.appendChild(dom.create('li', 0, html)); - dom.remove(p); - - lastMargin = margin; - lastType = type; - } else - listElm = lastMargin = 0; // End list element - }); - - // Remove any left over makers - html = o.node.innerHTML; - if (html.indexOf('__MCE_ITEM__') != -1) - o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); - }, - - /** - * Inserts the specified contents at the caret position. - */ - _insert : function(h, skip_undo) { - var ed = this.editor, r = ed.selection.getRng(); - - // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. - if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) - ed.getDoc().execCommand('Delete', false, null); - - ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); - }, - - /** - * Instead of the old plain text method which tried to re-create a paste operation, the - * new approach adds a plain text mode toggle switch that changes the behavior of paste. - * This function is passed the same input that the regular paste plugin produces. - * It performs additional scrubbing and produces (and inserts) the plain text. - * This approach leverages all of the great existing functionality in the paste - * plugin, and requires minimal changes to add the new functionality. - * Speednet - June 2009 - */ - _insertPlainText : function(content) { - var ed = this.editor, - linebr = getParam(ed, "paste_text_linebreaktype"), - rl = getParam(ed, "paste_text_replacements"), - is = tinymce.is; - - function process(items) { - each(items, function(v) { - if (v.constructor == RegExp) - content = content.replace(v, ""); - else - content = content.replace(v[0], v[1]); - }); - }; - - if ((typeof(content) === "string") && (content.length > 0)) { - // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line - if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { - process([ - /[\n\r]+/g - ]); - } else { - // Otherwise just get rid of carriage returns (only need linefeeds) - process([ - /\r+/g - ]); - } - - process([ - [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them - [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
      tags and table rows - [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them - /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags - [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) - [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars. - ]); - - var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks")); - if (maxLinebreaks > -1) { - var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g"); - var linebreakReplacement = ""; - - while (linebreakReplacement.length < maxLinebreaks) { - linebreakReplacement += "\n"; - } - - process([ - [maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks - ]); - } - - content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); - - // Perform default or custom replacements - if (is(rl, "array")) { - process(rl); - } else if (is(rl, "string")) { - process(new RegExp(rl, "gi")); - } - - // Treat paragraphs as specified in the config - if (linebr == "none") { - // Convert all line breaks to space - process([ - [/\n+/g, " "] - ]); - } else if (linebr == "br") { - // Convert all line breaks to
      - process([ - [/\n/g, "
      "] - ]); - } else if (linebr == "p") { - // Convert all line breaks to

      ...

      - process([ - [/\n+/g, "

      "], - [/^(.*<\/p>)(

      )$/, '

      $1'] - ]); - } else { - // defaults to "combined" - // Convert single line breaks to
      and double line breaks to

      ...

      - process([ - [/\n\n/g, "

      "], - [/^(.*<\/p>)(

      )$/, '

      $1'], - [/\n/g, "
      "] - ]); - } - - ed.execCommand('mceInsertContent', false, content); - } - }, - - /** - * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. - */ - _legacySupport : function() { - var t = this, ed = t.editor; - - // Register command(s) for backwards compatibility - ed.addCommand("mcePasteWord", function() { - ed.windowManager.open({ - file: t.url + "/pasteword.htm", - width: parseInt(getParam(ed, "paste_dialog_width")), - height: parseInt(getParam(ed, "paste_dialog_height")), - inline: 1 - }); - }); - - if (getParam(ed, "paste_text_use_dialog")) { - ed.addCommand("mcePasteText", function() { - ed.windowManager.open({ - file : t.url + "/pastetext.htm", - width: parseInt(getParam(ed, "paste_dialog_width")), - height: parseInt(getParam(ed, "paste_dialog_height")), - inline : 1 - }); - }); - } - - // Register button for backwards compatibility - ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); - } - }); - - // Register plugin - tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, + defs = { + paste_auto_cleanup_on_paste : true, + paste_enable_default_filters : true, + paste_block_drop : false, + paste_retain_style_properties : "none", + paste_strip_class_attributes : "mso", + paste_remove_spans : false, + paste_remove_styles : false, + paste_remove_styles_if_webkit : true, + paste_convert_middot_lists : true, + paste_convert_headers_to_strong : false, + paste_dialog_width : "450", + paste_dialog_height : "400", + paste_max_consecutive_linebreaks: 2, + paste_text_use_dialog : false, + paste_text_sticky : false, + paste_text_sticky_default : false, + paste_text_notifyalways : false, + paste_text_linebreaktype : "combined", + paste_text_replacements : [ + [/\u2026/g, "..."], + [/[\x93\x94\u201c\u201d]/g, '"'], + [/[\x60\x91\x92\u2018\u2019]/g, "'"] + ] + }; + + function getParam(ed, name) { + return ed.getParam(name, defs[name]); + } + + tinymce.create('tinymce.plugins.PastePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + t.url = url; + + // Setup plugin events + t.onPreProcess = new tinymce.util.Dispatcher(t); + t.onPostProcess = new tinymce.util.Dispatcher(t); + + // Register default handlers + t.onPreProcess.add(t._preProcess); + t.onPostProcess.add(t._postProcess); + + // Register optional preprocess handler + t.onPreProcess.add(function(pl, o) { + ed.execCallback('paste_preprocess', pl, o); + }); + + // Register optional postprocess + t.onPostProcess.add(function(pl, o) { + ed.execCallback('paste_postprocess', pl, o); + }); + + ed.onKeyDown.addToTop(function(ed, e) { + // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + return false; // Stop other listeners + }); + + // Initialize plain text flag + ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); + + // This function executes the process handlers and inserts the contents + // force_rich overrides plain text mode set by user, important for pasting with execCommand + function process(o, force_rich) { + var dom = ed.dom, rng; + + // Execute pre process handlers + t.onPreProcess.dispatch(t, o); + + // Create DOM structure + o.node = dom.create('div', 0, o.content); + + // If pasting inside the same element and the contents is only one block + // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element + if (tinymce.isGecko) { + rng = ed.selection.getRng(true); + if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { + // Is only one block node and it doesn't contain word stuff + if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) + dom.remove(o.node.firstChild, true); + } + } + + // Execute post process handlers + t.onPostProcess.dispatch(t, o); + + // Serialize content + o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); + + // Plain text option active? + if ((!force_rich) && (ed.pasteAsPlainText)) { + t._insertPlainText(o.content); + + if (!getParam(ed, "paste_text_sticky")) { + ed.pasteAsPlainText = false; + ed.controlManager.setActive("pastetext", false); + } + } else { + t._insert(o.content); + } + } + + // Add command for external usage + ed.addCommand('mceInsertClipboardContent', function(u, o) { + process(o, true); + }); + + if (!getParam(ed, "paste_text_use_dialog")) { + ed.addCommand('mcePasteText', function(u, v) { + var cookie = tinymce.util.Cookie; + + ed.pasteAsPlainText = !ed.pasteAsPlainText; + ed.controlManager.setActive('pastetext', ed.pasteAsPlainText); + + if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) { + if (getParam(ed, "paste_text_sticky")) { + ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); + } else { + ed.windowManager.alert(ed.translate('paste.plaintext_mode')); + } + + if (!getParam(ed, "paste_text_notifyalways")) { + cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31)) + } + } + }); + } + + ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'}); + ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'}); + + // This function grabs the contents from the clipboard by adding a + // hidden div and placing the caret inside it and after the browser paste + // is done it grabs that contents and processes that + function grabContent(e) { + var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; + + // Check if browser supports direct plaintext access + if (e.clipboardData || dom.doc.dataTransfer) { + textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); + + if (ed.pasteAsPlainText) { + e.preventDefault(); + process({content : dom.encode(textContent).replace(/\r?\n/g, '
      ')}); + return; + } + } + + if (dom.get('_mcePaste')) + return; + + // Create container to paste into + n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); + + // If contentEditable mode we need to find out the position of the closest element + if (body != ed.getDoc().body) + posY = dom.getPos(ed.selection.getStart(), body).y; + else + posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; + + // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles + // If also needs to be in view on IE or the paste would fail + dom.setStyles(n, { + position : 'absolute', + left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div + top : posY - 25, + width : 1, + height : 1, + overflow : 'hidden' + }); + + if (tinymce.isIE) { + // Store away the old range + oldRng = sel.getRng(); + + // Select the container + rng = dom.doc.body.createTextRange(); + rng.moveToElementText(n); + rng.execCommand('Paste'); + + // Remove container + dom.remove(n); + + // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due + // to IE security settings so we pass the junk though better than nothing right + if (n.innerHTML === '\uFEFF\uFEFF') { + ed.execCommand('mcePasteWord'); + e.preventDefault(); + return; + } + + // Restore the old range and clear the contents before pasting + sel.setRng(oldRng); + sel.setContent(''); + + // For some odd reason we need to detach the the mceInsertContent call from the paste event + // It's like IE has a reference to the parent element that you paste in and the selection gets messed up + // when it tries to restore the selection + setTimeout(function() { + // Process contents + process({content : n.innerHTML}); + }, 0); + + // Block the real paste event + return tinymce.dom.Event.cancel(e); + } else { + function block(e) { + e.preventDefault(); + }; + + // Block mousedown and click to prevent selection change + dom.bind(ed.getDoc(), 'mousedown', block); + dom.bind(ed.getDoc(), 'keydown', block); + + or = ed.selection.getRng(); + + // Move select contents inside DIV + n = n.firstChild; + rng = ed.getDoc().createRange(); + rng.setStart(n, 0); + rng.setEnd(n, 2); + sel.setRng(rng); + + // Wait a while and grab the pasted contents + window.setTimeout(function() { + var h = '', nl; + + // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit + if (!dom.select('div.mcePaste > div.mcePaste').length) { + nl = dom.select('div.mcePaste'); + + // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string + each(nl, function(n) { + var child = n.firstChild; + + // WebKit inserts a DIV container with lots of odd styles + if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { + dom.remove(child, 1); + } + + // Remove apply style spans + each(dom.select('span.Apple-style-span', n), function(n) { + dom.remove(n, 1); + }); + + // Remove bogus br elements + each(dom.select('br[data-mce-bogus]', n), function(n) { + dom.remove(n); + }); + + // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV + if (n.parentNode.className != 'mcePaste') + h += n.innerHTML; + }); + } else { + // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc + // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same + h = '

      ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

      ').replace(/\r?\n/g, '
      ') + '

      '; + } + + // Remove the nodes + each(dom.select('div.mcePaste'), function(n) { + dom.remove(n); + }); + + // Restore the old selection + if (or) + sel.setRng(or); + + process({content : h}); + + // Unblock events ones we got the contents + dom.unbind(ed.getDoc(), 'mousedown', block); + dom.unbind(ed.getDoc(), 'keydown', block); + }, 0); + } + } + + // Check if we should use the new auto process method + if (getParam(ed, "paste_auto_cleanup_on_paste")) { + // Is it's Opera or older FF use key handler + if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { + ed.onKeyDown.addToTop(function(ed, e) { + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + grabContent(e); + }); + } else { + // Grab contents on paste event on Gecko and WebKit + ed.onPaste.addToTop(function(ed, e) { + return grabContent(e); + }); + } + } + + ed.onInit.add(function() { + ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { + ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { + e.preventDefault(); + e.stopPropagation(); + + return false; + }); + } + }); + + // Add legacy support + t._legacySupport(); + }, + + getInfo : function() { + return { + longname : 'Paste text/word', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _preProcess : function(pl, o) { + var ed = this.editor, + h = o.content, + grep = tinymce.grep, + explode = tinymce.explode, + trim = tinymce.trim, + len, stripClass; + + //console.log('Before preprocess:' + o.content); + + function process(items) { + each(items, function(v) { + // Remove or replace + if (v.constructor == RegExp) + h = h.replace(v, ''); + else + h = h.replace(v[0], v[1]); + }); + } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) { + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + process([[/(?:
       [\s\r\n]+|
      )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
       [\s\r\n]+|
      )*/g, '$1']]); + + // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break + process([ + [/

      /g, '

      '], // Replace multiple BR elements with uppercase BR to keep them intact + [/
      /g, ' '], // Replace single br elements with space since they are word wrap BR:s + [/

      /g, '
      '] // Replace back the double brs but into a single BR + ]); + } + + // Detect Word content and process it more aggressive + if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { + o.wordContent = true; // Mark the pasted contents as word specific content + //console.log('Word contents detected.'); + + // Process away some basic content + process([ + /^\s*( )+/gi, //   entities at the start of contents + /( |]*>)+\s*$/gi //   entities at the end of contents + ]); + + if (getParam(ed, "paste_convert_headers_to_strong")) { + h = h.replace(/

      ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

      $1

      "); + } + + if (getParam(ed, "paste_convert_middot_lists")) { + process([ + [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) + ]); + } + + process([ + // Word comments like conditional comments etc + //gi, + + // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + + // Convert into for line-though + [/<(\/?)s>/gi, "<$1strike>"], + + // Replace nsbp entites to char since it's easier to handle + [/ /gi, "\u00a0"] + ]); + + // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. + // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. + do { + len = h.length; + h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); + } while (len != h.length); + + // Remove all spans if no styles is to be retained + if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } else { + // We're keeping styles, so at least clean them up. + // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx + + process([ + // Convert ___ to string of alternating breaking/non-breaking spaces of same length + [/([\s\u00a0]*)<\/span>/gi, + function(str, spaces) { + return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; + } + ], + + // Examine all styles: delete junk, transform some, and keep the rest + [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, + function(str, tag, style) { + var n = [], + i = 0, + s = explode(trim(style).replace(/"/gi, "'"), ";"); + + // Examine each style definition within the tag's style attribute + each(s, function(v) { + var name, value, + parts = explode(v, ":"); + + function ensureUnits(v) { + return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; + } + + if (parts.length == 2) { + name = parts[0].toLowerCase(); + value = parts[1].toLowerCase(); + + // Translate certain MS Office styles into their CSS equivalents + switch (name) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); + return; + + case "horiz-align": + n[i++] = "text-align:" + value; + return; + + case "vert-align": + n[i++] = "vertical-align:" + value; + return; + + case "font-color": + case "mso-foreground": + n[i++] = "color:" + value; + return; + + case "mso-background": + case "mso-highlight": + n[i++] = "background:" + value; + return; + + case "mso-default-height": + n[i++] = "min-height:" + ensureUnits(value); + return; + + case "mso-default-width": + n[i++] = "min-width:" + ensureUnits(value); + return; + + case "mso-padding-between-alt": + n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); + return; + + case "text-line-through": + if ((value == "single") || (value == "double")) { + n[i++] = "text-decoration:line-through"; + } + return; + + case "mso-zero-height": + if (value == "yes") { + n[i++] = "display:none"; + } + return; + } + + // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name + if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { + return; + } + + // If it reached this point, it must be a valid CSS style + n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case + } + }); + + // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. + if (i > 0) { + return tag + ' style="' + n.join(';') + '"'; + } else { + return tag; + } + } + ] + ]); + } + } + + // Replace headers with + if (getParam(ed, "paste_convert_headers_to_strong")) { + process([ + [/]*>/gi, "

      "], + [/<\/h[1-6][^>]*>/gi, "

      "] + ]); + } + + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). + // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. + stripClass = getParam(ed, "paste_strip_class_attributes"); + + if (stripClass !== "none") { + function removeClasses(match, g1) { + if (stripClass === "all") + return ''; + + var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), + function(v) { + return (/^(?!mso)/i.test(v)); + } + ); + + return cls.length ? ' class="' + cls.join(" ") + '"' : ''; + }; + + h = h.replace(/ class="([^"]+)"/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); + } + + // Remove spans option + if (getParam(ed, "paste_remove_spans")) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } + + //console.log('After preprocess:' + h); + + o.content = h; + }, + + /** + * Various post process items. + */ + _postProcess : function(pl, o) { + var t = this, ed = t.editor, dom = ed.dom, styleProps; + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + if (o.wordContent) { + // Remove named anchors or TOC links + each(dom.select('a', o.node), function(a) { + if (!a.href || a.href.indexOf('#_Toc') != -1) + dom.remove(a, 1); + }); + + if (getParam(ed, "paste_convert_middot_lists")) { + t._convertLists(pl, o); + } + + // Process styles + styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties + + // Process only if a string was specified and not equal to "all" or "*" + if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { + styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); + + // Retains some style properties + each(dom.select('*', o.node), function(el) { + var newStyle = {}, npc = 0, i, sp, sv; + + // Store a subset of the existing styles + if (styleProps) { + for (i = 0; i < styleProps.length; i++) { + sp = styleProps[i]; + sv = dom.getStyle(el, sp); + + if (sv) { + newStyle[sp] = sv; + npc++; + } + } + } + + // Remove all of the existing styles + dom.setAttrib(el, 'style', ''); + + if (styleProps && npc > 0) + dom.setStyles(el, newStyle); // Add back the stored subset of styles + else // Remove empty span tags that do not have class attributes + if (el.nodeName == 'SPAN' && !el.className) + dom.remove(el, true); + }); + } + } + + // Remove all style information or only specifically on WebKit to avoid the style bug on that browser + if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { + each(dom.select('*[style]', o.node), function(el) { + el.removeAttribute('style'); + el.removeAttribute('data-mce-style'); + }); + } else { + if (tinymce.isWebKit) { + // We need to compress the styles on WebKit since if you paste it will become + // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles + each(dom.select('*', o.node), function(el) { + el.removeAttribute('data-mce-style'); + }); + } + } + }, + + /** + * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. + */ + _convertLists : function(pl, o) { + var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; + + // Convert middot lists into real semantic lists + each(dom.select('p', o.node), function(p) { + var sib, val = '', type, html, idx, parents; + + // Get text node value at beginning of paragraph + for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) + val += sib.nodeValue; + + val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); + + // Detect unordered lists look for bullets + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) + type = 'ul'; + + // Detect ordered lists 1., a. or ixv. + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) + type = 'ol'; + + // Check if node value matches the list pattern: o   + if (type) { + margin = parseFloat(p.style.marginLeft || 0); + + if (margin > lastMargin) + levels.push(margin); + + if (!listElm || type != lastType) { + listElm = dom.create(type); + dom.insertAfter(listElm, p); + } else { + // Nested list element + if (margin > lastMargin) { + listElm = li.appendChild(dom.create(type)); + } else if (margin < lastMargin) { + // Find parent level based on margin value + idx = tinymce.inArray(levels, margin); + parents = dom.getParents(listElm.parentNode, type); + listElm = parents[parents.length - 1 - idx] || listElm; + } + } + + // Remove middot or number spans if they exists + each(dom.select('span', p), function(span) { + var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); + + // Remove span with the middot or the number + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) + dom.remove(span); + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + dom.remove(span); + }); + + html = p.innerHTML; + + // Remove middot/list items + if (type == 'ul') + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); + else + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); + + // Create li and add paragraph data into the new li + li = listElm.appendChild(dom.create('li', 0, html)); + dom.remove(p); + + lastMargin = margin; + lastType = type; + } else + listElm = lastMargin = 0; // End list element + }); + + // Remove any left over makers + html = o.node.innerHTML; + if (html.indexOf('__MCE_ITEM__') != -1) + o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); + }, + + /** + * Inserts the specified contents at the caret position. + */ + _insert : function(h, skip_undo) { + var ed = this.editor, r = ed.selection.getRng(); + + // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. + if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) + ed.getDoc().execCommand('Delete', false, null); + + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); + }, + + /** + * Instead of the old plain text method which tried to re-create a paste operation, the + * new approach adds a plain text mode toggle switch that changes the behavior of paste. + * This function is passed the same input that the regular paste plugin produces. + * It performs additional scrubbing and produces (and inserts) the plain text. + * This approach leverages all of the great existing functionality in the paste + * plugin, and requires minimal changes to add the new functionality. + * Speednet - June 2009 + */ + _insertPlainText : function(content) { + var ed = this.editor, + linebr = getParam(ed, "paste_text_linebreaktype"), + rl = getParam(ed, "paste_text_replacements"), + is = tinymce.is; + + function process(items) { + each(items, function(v) { + if (v.constructor == RegExp) + content = content.replace(v, ""); + else + content = content.replace(v[0], v[1]); + }); + }; + + if ((typeof(content) === "string") && (content.length > 0)) { + // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { + process([ + /[\n\r]+/g + ]); + } else { + // Otherwise just get rid of carriage returns (only need linefeeds) + process([ + /\r+/g + ]); + } + + process([ + [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them + [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
      tags and table rows + [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them + /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags + [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars. + ]); + + var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks")); + if (maxLinebreaks > -1) { + var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g"); + var linebreakReplacement = ""; + + while (linebreakReplacement.length < maxLinebreaks) { + linebreakReplacement += "\n"; + } + + process([ + [maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks + ]); + } + + content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); + + // Perform default or custom replacements + if (is(rl, "array")) { + process(rl); + } else if (is(rl, "string")) { + process(new RegExp(rl, "gi")); + } + + // Treat paragraphs as specified in the config + if (linebr == "none") { + // Convert all line breaks to space + process([ + [/\n+/g, " "] + ]); + } else if (linebr == "br") { + // Convert all line breaks to
      + process([ + [/\n/g, "
      "] + ]); + } else if (linebr == "p") { + // Convert all line breaks to

      ...

      + process([ + [/\n+/g, "

      "], + [/^(.*<\/p>)(

      )$/, '

      $1'] + ]); + } else { + // defaults to "combined" + // Convert single line breaks to
      and double line breaks to

      ...

      + process([ + [/\n\n/g, "

      "], + [/^(.*<\/p>)(

      )$/, '

      $1'], + [/\n/g, "
      "] + ]); + } + + ed.execCommand('mceInsertContent', false, content); + } + }, + + /** + * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. + */ + _legacySupport : function() { + var t = this, ed = t.editor; + + // Register command(s) for backwards compatibility + ed.addCommand("mcePasteWord", function() { + ed.windowManager.open({ + file: t.url + "/pasteword.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline: 1 + }); + }); + + if (getParam(ed, "paste_text_use_dialog")) { + ed.addCommand("mcePasteText", function() { + ed.windowManager.open({ + file : t.url + "/pastetext.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline : 1 + }); + }); + } + + // Register button for backwards compatibility + ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); + } + }); + + // Register plugin + tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/js/pastetext.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/js/pastetext.js index c524f9e..b454faf 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/js/pastetext.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/js/pastetext.js @@ -1,36 +1,36 @@ -tinyMCEPopup.requireLangPack(); - -var PasteTextDialog = { - init : function() { - this.resize(); - }, - - insert : function() { - var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; - - // Convert linebreaks into paragraphs - if (document.getElementById('linebreaks').checked) { - lines = h.split(/\r?\n/); - if (lines.length > 1) { - h = ''; - tinymce.each(lines, function(row) { - h += '

      ' + row + '

      '; - }); - } - } - - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); - tinyMCEPopup.close(); - }, - - resize : function() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('content'); - - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 90) + 'px'; - } -}; - -tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); +tinyMCEPopup.requireLangPack(); + +var PasteTextDialog = { + init : function() { + this.resize(); + }, + + insert : function() { + var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; + + // Convert linebreaks into paragraphs + if (document.getElementById('linebreaks').checked) { + lines = h.split(/\r?\n/); + if (lines.length > 1) { + h = ''; + tinymce.each(lines, function(row) { + h += '

      ' + row + '

      '; + }); + } + } + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('content'); + + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } +}; + +tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/js/pasteword.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/js/pasteword.js index a52731c..190641f 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/js/pasteword.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/paste/js/pasteword.js @@ -1,51 +1,51 @@ -tinyMCEPopup.requireLangPack(); - -var PasteWordDialog = { - init : function() { - var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; - - // Create iframe - el.innerHTML = ''; - ifr = document.getElementById('iframe'); - doc = ifr.contentWindow.document; - - // Force absolute CSS urls - css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; - css = css.concat(tinymce.explode(ed.settings.content_css) || []); - tinymce.each(css, function(u) { - cssHTML += ''; - }); - - // Write content into iframe - doc.open(); - doc.write('' + cssHTML + ''); - doc.close(); - - doc.designMode = 'on'; - this.resize(); - - window.setTimeout(function() { - ifr.contentWindow.focus(); - }, 10); - }, - - insert : function() { - var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; - - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); - tinyMCEPopup.close(); - }, - - resize : function() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('iframe'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 90) + 'px'; - } - } -}; - -tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/editor_plugin_src.js index 7db66d4..c997a13 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/editor_plugin_src.js @@ -1,53 +1,53 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Preview', { - init : function(ed, url) { - var t = this, css = tinymce.explode(ed.settings.content_css); - - t.editor = ed; - - // Force absolute CSS urls - tinymce.each(css, function(u, k) { - css[k] = ed.documentBaseURI.toAbsolute(u); - }); - - ed.addCommand('mcePreview', function() { - ed.windowManager.open({ - file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), - width : parseInt(ed.getParam("plugin_preview_width", "550")), - height : parseInt(ed.getParam("plugin_preview_height", "600")), - resizable : "yes", - scrollbars : "yes", - popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), - inline : ed.getParam("plugin_preview_inline", 1) - }, { - base : ed.documentBaseURI.getURI() - }); - }); - - ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); - }, - - getInfo : function() { - return { - longname : 'Preview', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('preview', tinymce.plugins.Preview); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Preview', { + init : function(ed, url) { + var t = this, css = tinymce.explode(ed.settings.content_css); + + t.editor = ed; + + // Force absolute CSS urls + tinymce.each(css, function(u, k) { + css[k] = ed.documentBaseURI.toAbsolute(u); + }); + + ed.addCommand('mcePreview', function() { + ed.windowManager.open({ + file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), + width : parseInt(ed.getParam("plugin_preview_width", "550")), + height : parseInt(ed.getParam("plugin_preview_height", "600")), + resizable : "yes", + scrollbars : "yes", + popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), + inline : ed.getParam("plugin_preview_inline", 1) + }, { + base : ed.documentBaseURI.getURI() + }); + }); + + ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); + }, + + getInfo : function() { + return { + longname : 'Preview', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('preview', tinymce.plugins.Preview); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/example.html b/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/example.html index b2c3d90..92fe641 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/example.html +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/example.html @@ -1,28 +1,28 @@ - - - - - -Example of a custom preview page - - - -Editor contents:
      -
      - -
      - - - + + + + + +Example of a custom preview page + + + +Editor contents:
      +
      + +
      + + + diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/jscripts/embed.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/jscripts/embed.js index f8dc810..a36e128 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/jscripts/embed.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/preview/jscripts/embed.js @@ -1,73 +1,73 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ''; + + h += ' - - - - - -{#preview.preview_desc} - - - - - + + + + + + +{#preview.preview_desc} + + + + + diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/print/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/print/editor_plugin_src.js index 3933fe6..2f356c5 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/print/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/print/editor_plugin_src.js @@ -1,34 +1,34 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Print', { - init : function(ed, url) { - ed.addCommand('mcePrint', function() { - ed.getWin().print(); - }); - - ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); - }, - - getInfo : function() { - return { - longname : 'Print', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('print', tinymce.plugins.Print); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Print', { + init : function(ed, url) { + ed.addCommand('mcePrint', function() { + ed.getWin().print(); + }); + + ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); + }, + + getInfo : function() { + return { + longname : 'Print', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('print', tinymce.plugins.Print); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/save/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/save/editor_plugin_src.js index f5a3de8..798c886 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/save/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/save/editor_plugin_src.js @@ -1,101 +1,101 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Save', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceSave', t._save, t); - ed.addCommand('mceCancel', t._cancel, t); - - // Register buttons - ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); - ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); - - ed.onNodeChange.add(t._nodeChange, t); - ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); - }, - - getInfo : function() { - return { - longname : 'Save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var ed = this.editor; - - if (ed.getParam('save_enablewhendirty')) { - cm.setDisabled('save', !ed.isDirty()); - cm.setDisabled('cancel', !ed.isDirty()); - } - }, - - // Private methods - - _save : function() { - var ed = this.editor, formObj, os, i, elementId; - - formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); - - if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) - return; - - tinyMCE.triggerSave(); - - // Use callback instead - if (os = ed.getParam("save_onsavecallback")) { - if (ed.execCallback('save_onsavecallback', ed)) { - ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); - ed.nodeChanged(); - } - - return; - } - - if (formObj) { - ed.isNotDirty = true; - - if (formObj.onsubmit == null || formObj.onsubmit() != false) - formObj.submit(); - - ed.nodeChanged(); - } else - ed.windowManager.alert("Error: No form element found."); - }, - - _cancel : function() { - var ed = this.editor, os, h = tinymce.trim(ed.startContent); - - // Use callback instead - if (os = ed.getParam("save_oncancelcallback")) { - ed.execCallback('save_oncancelcallback', ed); - return; - } - - ed.setContent(h); - ed.undoManager.clear(); - ed.nodeChanged(); - } - }); - - // Register plugin - tinymce.PluginManager.add('save', tinymce.plugins.Save); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Save', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceSave', t._save, t); + ed.addCommand('mceCancel', t._cancel, t); + + // Register buttons + ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); + ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); + + ed.onNodeChange.add(t._nodeChange, t); + ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); + }, + + getInfo : function() { + return { + longname : 'Save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var ed = this.editor; + + if (ed.getParam('save_enablewhendirty')) { + cm.setDisabled('save', !ed.isDirty()); + cm.setDisabled('cancel', !ed.isDirty()); + } + }, + + // Private methods + + _save : function() { + var ed = this.editor, formObj, os, i, elementId; + + formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); + + if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) + return; + + tinyMCE.triggerSave(); + + // Use callback instead + if (os = ed.getParam("save_onsavecallback")) { + if (ed.execCallback('save_onsavecallback', ed)) { + ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); + ed.nodeChanged(); + } + + return; + } + + if (formObj) { + ed.isNotDirty = true; + + if (formObj.onsubmit == null || formObj.onsubmit() != false) + formObj.submit(); + + ed.nodeChanged(); + } else + ed.windowManager.alert("Error: No form element found."); + }, + + _cancel : function() { + var ed = this.editor, os, h = tinymce.trim(ed.startContent); + + // Use callback instead + if (os = ed.getParam("save_oncancelcallback")) { + ed.execCallback('save_oncancelcallback', ed); + return; + } + + ed.setContent(h); + ed.undoManager.clear(); + ed.nodeChanged(); + } + }); + + // Register plugin + tinymce.PluginManager.add('save', tinymce.plugins.Save); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/css/searchreplace.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/css/searchreplace.css index ecdf58c..3e2eaf3 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/css/searchreplace.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/css/searchreplace.css @@ -1,6 +1,6 @@ -.panel_wrapper {height:85px;} -.panel_wrapper div.current {height:85px;} - -/* IE */ -* html .panel_wrapper {height:100px;} -* html .panel_wrapper div.current {height:100px;} +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/editor_plugin_src.js index 4c87e8f..8b41a01 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/editor_plugin_src.js @@ -1,61 +1,61 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.SearchReplacePlugin', { - init : function(ed, url) { - function open(m) { - // Keep IE from writing out the f/r character to the editor - // instance while initializing a new dialog. See: #3131190 - window.focus(); - - ed.windowManager.open({ - file : url + '/searchreplace.htm', - width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), - height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), - inline : 1, - auto_focus : 0 - }, { - mode : m, - search_string : ed.selection.getContent({format : 'text'}), - plugin_url : url - }); - }; - - // Register commands - ed.addCommand('mceSearch', function() { - open('search'); - }); - - ed.addCommand('mceReplace', function() { - open('replace'); - }); - - // Register buttons - ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); - ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); - - ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); - }, - - getInfo : function() { - return { - longname : 'Search/Replace', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); + }, + + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/js/searchreplace.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/js/searchreplace.js index 80284b9..3d9d36d 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/js/searchreplace.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/searchreplace/js/searchreplace.js @@ -1,142 +1,142 @@ -tinyMCEPopup.requireLangPack(); - -var SearchReplaceDialog = { - init : function(ed) { - var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); - - t.switchMode(m); - - f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); - - // Focus input field - f[m + '_panel_searchstring'].focus(); - - mcTabs.onChange.add(function(tab_id, panel_id) { - t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); - }); - }, - - switchMode : function(m) { - var f, lm = this.lastMode; - - if (lm != m) { - f = document.forms[0]; - - if (lm) { - f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; - f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; - f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; - f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; - } - - mcTabs.displayTab(m + '_tab', m + '_panel'); - document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; - document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; - this.lastMode = m; - } - }, - - searchNext : function(a) { - var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; - - // Get input - f = document.forms[0]; - s = f[m + '_panel_searchstring'].value; - b = f[m + '_panel_backwardsu'].checked; - ca = f[m + '_panel_casesensitivebox'].checked; - rs = f['replace_panel_replacestring'].value; - - if (tinymce.isIE) { - r = ed.getDoc().selection.createRange(); - } - - if (s == '') - return; - - function fix() { - // Correct Firefox graphics glitches - // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? - r = se.getRng().cloneRange(); - ed.getDoc().execCommand('SelectAll', false, null); - se.setRng(r); - }; - - function replace() { - ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE - }; - - // IE flags - if (ca) - fl = fl | 4; - - switch (a) { - case 'all': - // Move caret to beginning of text - ed.execCommand('SelectAll'); - ed.selection.collapse(true); - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - while (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - replace(); - fo = 1; - - if (b) { - r.moveEnd("character", -(rs.length)); // Otherwise will loop forever - } - } - - tinyMCEPopup.storeSelection(); - } else { - while (w.find(s, ca, b, false, false, false, false)) { - replace(); - fo = 1; - } - } - - if (fo) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); - else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - return; - - case 'current': - if (!ed.selection.isCollapsed()) - replace(); - - break; - } - - se.collapse(b); - r = se.getRng(); - - // Whats the point - if (!s) - return; - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - if (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - } else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - tinyMCEPopup.storeSelection(); - } else { - if (!w.find(s, ca, b, false, false, false, false)) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - else - fix(); - } - } -}; - -tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + t.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + + if (b) { + r.moveEnd("character", -(rs.length)); // Otherwise will loop forever + } + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/spellchecker/css/content.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/spellchecker/css/content.css index 24efa02..656ce1e 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/spellchecker/css/content.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/spellchecker/css/content.css @@ -1 +1 @@ -.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} +.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/spellchecker/editor_plugin_src.js index 86fdfce..9fd45d3 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/spellchecker/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/spellchecker/editor_plugin_src.js @@ -1,436 +1,436 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; - - tinymce.create('tinymce.plugins.SpellcheckerPlugin', { - getInfo : function() { - return { - longname : 'Spellchecker', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - init : function(ed, url) { - var t = this, cm; - - t.url = url; - t.editor = ed; - t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}"); - - if (t.rpcUrl == '{backend}') { - // Sniff if the browser supports native spellchecking (Don't know of a better way) - if (tinymce.isIE) - return; - - t.hasSupport = true; - - // Disable the context menu when spellchecking is active - ed.onContextMenu.addToTop(function(ed, e) { - if (t.active) - return false; - }); - } - - // Register commands - ed.addCommand('mceSpellCheck', function() { - if (t.rpcUrl == '{backend}') { - // Enable/disable native spellchecker - t.editor.getBody().spellcheck = t.active = !t.active; - return; - } - - if (!t.active) { - ed.setProgressState(1); - t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { - if (r.length > 0) { - t.active = 1; - t._markWords(r); - ed.setProgressState(0); - ed.nodeChanged(); - } else { - ed.setProgressState(0); - - if (ed.getParam('spellchecker_report_no_misspellings', true)) - ed.windowManager.alert('spellchecker.no_mpell'); - } - }); - } else - t._done(); - }); - - if (ed.settings.content_css !== false) - ed.contentCSS.push(url + '/css/content.css'); - - ed.onClick.add(t._showMenu, t); - ed.onContextMenu.add(t._showMenu, t); - ed.onBeforeGetContent.add(function() { - if (t.active) - t._removeWords(); - }); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('spellchecker', t.active); - }); - - ed.onSetContent.add(function() { - t._done(); - }); - - ed.onBeforeGetContent.add(function() { - t._done(); - }); - - ed.onBeforeExecCommand.add(function(ed, cmd) { - if (cmd == 'mceFullScreen') - t._done(); - }); - - // Find selected language - t.languages = {}; - each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { - if (k.indexOf('+') === 0) { - k = k.substring(1); - t.selectedLang = v; - } - - t.languages[k] = v; - }); - }, - - createControl : function(n, cm) { - var t = this, c, ed = t.editor; - - if (n == 'spellchecker') { - // Use basic button if we use the native spellchecker - if (t.rpcUrl == '{backend}') { - // Create simple toggle button if we have native support - if (t.hasSupport) - c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - return c; - } - - c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - c.onRenderMenu.add(function(c, m) { - m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(t.languages, function(v, k) { - var o = {icon : 1}, mi; - - o.onclick = function() { - if (v == t.selectedLang) { - return; - } - mi.setSelected(1); - t.selectedItem.setSelected(0); - t.selectedItem = mi; - t.selectedLang = v; - }; - - o.title = k; - mi = m.add(o); - mi.setSelected(v == t.selectedLang); - - if (v == t.selectedLang) - t.selectedItem = mi; - }) - }); - - return c; - } - }, - - // Internal functions - - _walk : function(n, f) { - var d = this.editor.getDoc(), w; - - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); - - while ((n = w.nextNode()) != null) - f.call(this, n); - } else - tinymce.walk(n, f, 'childNodes'); - }, - - _getSeparators : function() { - var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\u201d\u201c'); - - // Build word separator regexp - for (i=0; i elements content is broken after spellchecking. - // Bug #1408: Preceding whitespace characters are removed - // @TODO: I'm not sure that both are still issues on IE9. - if (tinymce.isIE) { - // Enclose mispelled words with temporal tag - v = v.replace(rx, '$1$2'); - // Loop over the content finding mispelled words - while ((pos = v.indexOf('')) != -1) { - // Add text node for the content before the word - txt = v.substring(0, pos); - if (txt.length) { - node = doc.createTextNode(dom.decode(txt)); - elem.appendChild(node); - } - v = v.substring(pos+10); - pos = v.indexOf(''); - txt = v.substring(0, pos); - v = v.substring(pos+11); - // Add span element for the word - elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt)); - } - // Add text node for the rest of the content - if (v.length) { - node = doc.createTextNode(dom.decode(v)); - elem.appendChild(node); - } - } else { - // Other browsers preserve whitespace characters on innerHTML usage - elem.innerHTML = v.replace(rx, '$1$2'); - } - - // Finally, replace the node with the container - dom.replace(elem, n); - } - }); - - se.setRng(r); - }, - - _showMenu : function(ed, e) { - var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target; - - e = 0; // Fixes IE memory leak - - if (!m) { - m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'}); - t._menu = m; - } - - if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) { - m.removeAll(); - m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) { - var ignoreRpc; - - m.removeAll(); - - if (r.length > 0) { - m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(r, function(v) { - m.add({title : v, onclick : function() { - dom.replace(ed.getDoc().createTextNode(v), wordSpan); - t._checkDone(); - }}); - }); - - m.addSeparator(); - } else - m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - if (ed.getParam('show_ignore_words', true)) { - ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); - m.add({ - title : 'spellchecker.ignore_word', - onclick : function() { - var word = wordSpan.innerHTML; - - dom.remove(wordSpan, 1); - t._checkDone(); - - // tell the server if we need to - if (ignoreRpc) { - ed.setProgressState(1); - t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - } - }); - - m.add({ - title : 'spellchecker.ignore_words', - onclick : function() { - var word = wordSpan.innerHTML; - - t._removeWords(dom.decode(word)); - t._checkDone(); - - // tell the server if we need to - if (ignoreRpc) { - ed.setProgressState(1); - t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - } - }); - } - - if (t.editor.getParam("spellchecker_enable_learn_rpc")) { - m.add({ - title : 'spellchecker.learn_word', - onclick : function() { - var word = wordSpan.innerHTML; - - dom.remove(wordSpan, 1); - t._checkDone(); - - ed.setProgressState(1); - t._sendRPC('learnWord', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - }); - } - - m.update(); - }); - - p1 = DOM.getPos(ed.getContentAreaContainer()); - m.settings.offset_x = p1.x; - m.settings.offset_y = p1.y; - - ed.selection.select(wordSpan); - p1 = dom.getPos(wordSpan); - m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y); - - return tinymce.dom.Event.cancel(e); - } else - m.hideMenu(); - }, - - _checkDone : function() { - var t = this, ed = t.editor, dom = ed.dom, o; - - each(dom.select('span'), function(n) { - if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { - o = true; - return false; - } - }); - - if (!o) - t._done(); - }, - - _done : function() { - var t = this, la = t.active; - - if (t.active) { - t.active = 0; - t._removeWords(); - - if (t._menu) - t._menu.hideMenu(); - - if (la) - t.editor.nodeChanged(); - } - }, - - _sendRPC : function(m, p, cb) { - var t = this; - - JSONRequest.sendRPC({ - url : t.rpcUrl, - method : m, - params : p, - success : cb, - error : function(e, x) { - t.editor.setProgressState(0); - t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); - } - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.SpellcheckerPlugin', { + getInfo : function() { + return { + longname : 'Spellchecker', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + init : function(ed, url) { + var t = this, cm; + + t.url = url; + t.editor = ed; + t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}"); + + if (t.rpcUrl == '{backend}') { + // Sniff if the browser supports native spellchecking (Don't know of a better way) + if (tinymce.isIE) + return; + + t.hasSupport = true; + + // Disable the context menu when spellchecking is active + ed.onContextMenu.addToTop(function(ed, e) { + if (t.active) + return false; + }); + } + + // Register commands + ed.addCommand('mceSpellCheck', function() { + if (t.rpcUrl == '{backend}') { + // Enable/disable native spellchecker + t.editor.getBody().spellcheck = t.active = !t.active; + return; + } + + if (!t.active) { + ed.setProgressState(1); + t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { + if (r.length > 0) { + t.active = 1; + t._markWords(r); + ed.setProgressState(0); + ed.nodeChanged(); + } else { + ed.setProgressState(0); + + if (ed.getParam('spellchecker_report_no_misspellings', true)) + ed.windowManager.alert('spellchecker.no_mpell'); + } + }); + } else + t._done(); + }); + + if (ed.settings.content_css !== false) + ed.contentCSS.push(url + '/css/content.css'); + + ed.onClick.add(t._showMenu, t); + ed.onContextMenu.add(t._showMenu, t); + ed.onBeforeGetContent.add(function() { + if (t.active) + t._removeWords(); + }); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('spellchecker', t.active); + }); + + ed.onSetContent.add(function() { + t._done(); + }); + + ed.onBeforeGetContent.add(function() { + t._done(); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd) { + if (cmd == 'mceFullScreen') + t._done(); + }); + + // Find selected language + t.languages = {}; + each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { + if (k.indexOf('+') === 0) { + k = k.substring(1); + t.selectedLang = v; + } + + t.languages[k] = v; + }); + }, + + createControl : function(n, cm) { + var t = this, c, ed = t.editor; + + if (n == 'spellchecker') { + // Use basic button if we use the native spellchecker + if (t.rpcUrl == '{backend}') { + // Create simple toggle button if we have native support + if (t.hasSupport) + c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + return c; + } + + c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + c.onRenderMenu.add(function(c, m) { + m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(t.languages, function(v, k) { + var o = {icon : 1}, mi; + + o.onclick = function() { + if (v == t.selectedLang) { + return; + } + mi.setSelected(1); + t.selectedItem.setSelected(0); + t.selectedItem = mi; + t.selectedLang = v; + }; + + o.title = k; + mi = m.add(o); + mi.setSelected(v == t.selectedLang); + + if (v == t.selectedLang) + t.selectedItem = mi; + }) + }); + + return c; + } + }, + + // Internal functions + + _walk : function(n, f) { + var d = this.editor.getDoc(), w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(this, n); + } else + tinymce.walk(n, f, 'childNodes'); + }, + + _getSeparators : function() { + var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\u201d\u201c'); + + // Build word separator regexp + for (i=0; i elements content is broken after spellchecking. + // Bug #1408: Preceding whitespace characters are removed + // @TODO: I'm not sure that both are still issues on IE9. + if (tinymce.isIE) { + // Enclose mispelled words with temporal tag + v = v.replace(rx, '$1$2'); + // Loop over the content finding mispelled words + while ((pos = v.indexOf('')) != -1) { + // Add text node for the content before the word + txt = v.substring(0, pos); + if (txt.length) { + node = doc.createTextNode(dom.decode(txt)); + elem.appendChild(node); + } + v = v.substring(pos+10); + pos = v.indexOf(''); + txt = v.substring(0, pos); + v = v.substring(pos+11); + // Add span element for the word + elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt)); + } + // Add text node for the rest of the content + if (v.length) { + node = doc.createTextNode(dom.decode(v)); + elem.appendChild(node); + } + } else { + // Other browsers preserve whitespace characters on innerHTML usage + elem.innerHTML = v.replace(rx, '$1$2'); + } + + // Finally, replace the node with the container + dom.replace(elem, n); + } + }); + + se.setRng(r); + }, + + _showMenu : function(ed, e) { + var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target; + + e = 0; // Fixes IE memory leak + + if (!m) { + m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'}); + t._menu = m; + } + + if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) { + m.removeAll(); + m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) { + var ignoreRpc; + + m.removeAll(); + + if (r.length > 0) { + m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(r, function(v) { + m.add({title : v, onclick : function() { + dom.replace(ed.getDoc().createTextNode(v), wordSpan); + t._checkDone(); + }}); + }); + + m.addSeparator(); + } else + m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + if (ed.getParam('show_ignore_words', true)) { + ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); + m.add({ + title : 'spellchecker.ignore_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + + m.add({ + title : 'spellchecker.ignore_words', + onclick : function() { + var word = wordSpan.innerHTML; + + t._removeWords(dom.decode(word)); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + } + + if (t.editor.getParam("spellchecker_enable_learn_rpc")) { + m.add({ + title : 'spellchecker.learn_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + ed.setProgressState(1); + t._sendRPC('learnWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + }); + } + + m.update(); + }); + + p1 = DOM.getPos(ed.getContentAreaContainer()); + m.settings.offset_x = p1.x; + m.settings.offset_y = p1.y; + + ed.selection.select(wordSpan); + p1 = dom.getPos(wordSpan); + m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y); + + return tinymce.dom.Event.cancel(e); + } else + m.hideMenu(); + }, + + _checkDone : function() { + var t = this, ed = t.editor, dom = ed.dom, o; + + each(dom.select('span'), function(n) { + if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { + o = true; + return false; + } + }); + + if (!o) + t._done(); + }, + + _done : function() { + var t = this, la = t.active; + + if (t.active) { + t.active = 0; + t._removeWords(); + + if (t._menu) + t._menu.hideMenu(); + + if (la) + t.editor.nodeChanged(); + } + }, + + _sendRPC : function(m, p, cb) { + var t = this; + + JSONRequest.sendRPC({ + url : t.rpcUrl, + method : m, + params : p, + success : cb, + error : function(e, x) { + t.editor.setProgressState(0); + t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); + } + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/style/css/props.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/style/css/props.css index 3b8f0ee..51a3b1f 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/style/css/props.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/style/css/props.css @@ -1,14 +1,14 @@ -#text_font {width:250px;} -#text_size {width:70px;} -.mceAddSelectValue {background:#DDD;} -select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} -#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} -#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} -#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} -.panel_toggle_insert_span {padding-top:10px;} -.panel_wrapper div.current {padding-top:10px;height:230px;} -.delim {border-left:1px solid gray;} -.tdelim {border-bottom:1px solid gray;} -#block_display {width:145px;} -#list_type {width:115px;} -.disabled {background:#EEE;} +#text_font {width:250px;} +#text_size {width:70px;} +.mceAddSelectValue {background:#DDD;} +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} +.panel_toggle_insert_span {padding-top:10px;} +.panel_wrapper div.current {padding-top:10px;height:230px;} +.delim {border-left:1px solid gray;} +.tdelim {border-bottom:1px solid gray;} +#block_display {width:145px;} +#list_type {width:115px;} +.disabled {background:#EEE;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/style/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/style/editor_plugin_src.js index eaa7c77..de892b6 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/style/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/style/editor_plugin_src.js @@ -1,71 +1,71 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.StylePlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceStyleProps', function() { - - var applyStyleToBlocks = false; - var blocks = ed.selection.getSelectedBlocks(); - var styles = []; - - if (blocks.length === 1) { - styles.push(ed.selection.getNode().style.cssText); - } - else { - tinymce.each(blocks, function(block) { - styles.push(ed.dom.getAttrib(block, 'style')); - }); - applyStyleToBlocks = true; - } - - ed.windowManager.open({ - file : url + '/props.htm', - width : 480 + parseInt(ed.getLang('style.delta_width', 0)), - height : 340 + parseInt(ed.getLang('style.delta_height', 0)), - inline : 1 - }, { - applyStyleToBlocks : applyStyleToBlocks, - plugin_url : url, - styles : styles - }); - }); - - ed.addCommand('mceSetElementStyle', function(ui, v) { - if (e = ed.selection.getNode()) { - ed.dom.setAttrib(e, 'style', v); - ed.execCommand('mceRepaint'); - } - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setDisabled('styleprops', n.nodeName === 'BODY'); - }); - - // Register buttons - ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); - }, - - getInfo : function() { - return { - longname : 'Style', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.StylePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceStyleProps', function() { + + var applyStyleToBlocks = false; + var blocks = ed.selection.getSelectedBlocks(); + var styles = []; + + if (blocks.length === 1) { + styles.push(ed.selection.getNode().style.cssText); + } + else { + tinymce.each(blocks, function(block) { + styles.push(ed.dom.getAttrib(block, 'style')); + }); + applyStyleToBlocks = true; + } + + ed.windowManager.open({ + file : url + '/props.htm', + width : 480 + parseInt(ed.getLang('style.delta_width', 0)), + height : 340 + parseInt(ed.getLang('style.delta_height', 0)), + inline : 1 + }, { + applyStyleToBlocks : applyStyleToBlocks, + plugin_url : url, + styles : styles + }); + }); + + ed.addCommand('mceSetElementStyle', function(ui, v) { + if (e = ed.selection.getNode()) { + ed.dom.setAttrib(e, 'style', v); + ed.execCommand('mceRepaint'); + } + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setDisabled('styleprops', n.nodeName === 'BODY'); + }); + + // Register buttons + ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); + }, + + getInfo : function() { + return { + longname : 'Style', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/style/js/props.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/style/js/props.js index 0a8a8ec..ebc39ad 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/style/js/props.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/style/js/props.js @@ -1,709 +1,709 @@ -tinyMCEPopup.requireLangPack(); - -var defaultFonts = "" + - "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Courier New, Courier, mono=Courier New, Courier, mono;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + - "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + - "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; - -var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; -var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; -var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; -var defaultTextStyle = "normal;italic;oblique"; -var defaultVariant = "normal;small-caps"; -var defaultLineHeight = "normal"; -var defaultAttachment = "fixed;scroll"; -var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; -var defaultPosH = "left;center;right"; -var defaultPosV = "top;center;bottom"; -var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; -var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; -var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; -var defaultBorderWidth = "thin;medium;thick"; -var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; - -function aggregateStyles(allStyles) { - var mergedStyles = {}; - - tinymce.each(allStyles, function(style) { - if (style !== '') { - var parsedStyles = tinyMCEPopup.editor.dom.parseStyle(style); - for (var name in parsedStyles) { - if (parsedStyles.hasOwnProperty(name)) { - if (mergedStyles[name] === undefined) { - mergedStyles[name] = parsedStyles[name]; - } - else if (name === 'text-decoration') { - if (mergedStyles[name].indexOf(parsedStyles[name]) === -1) { - mergedStyles[name] = mergedStyles[name] +' '+ parsedStyles[name]; - } - } - } - } - } - }); - - return mergedStyles; -} - -var applyActionIsInsert; -var existingStyles; - -function init(ed) { - var ce = document.getElementById('container'), h; - - existingStyles = aggregateStyles(tinyMCEPopup.getWindowArg('styles')); - ce.style.cssText = tinyMCEPopup.editor.dom.serializeStyle(existingStyles); - - applyActionIsInsert = ed.getParam("edit_css_style_insert_span", false); - document.getElementById('toggle_insert_span').checked = applyActionIsInsert; - - h = getBrowserHTML('background_image_browser','background_image','image','advimage'); - document.getElementById("background_image_browser").innerHTML = h; - - document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); - document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); - document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); - document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); - document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); - document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); - - fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); - fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); - fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); - fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); - fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); - fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); - fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); - fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); - fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); - - fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); - fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); - - fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); - fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); - fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); - fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); - fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); - fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); - fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); - - fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); - fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); - fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); - - fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); - - fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); - fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); - - fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); - fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); - - fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); - - fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); - - TinyMCE_EditableSelects.init(); - setupFormData(); - showDisabledControls(); -} - -function setupFormData() { - var ce = document.getElementById('container'), f = document.forms[0], s, b, i; - - // Setup text fields - - selectByValue(f, 'text_font', ce.style.fontFamily, true, true); - selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); - selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); - selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); - selectByValue(f, 'text_style', ce.style.fontStyle, true, true); - selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); - selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); - selectByValue(f, 'text_case', ce.style.textTransform, true, true); - selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); - f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); - updateColor('text_color_pick', 'text_color'); - f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); - f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); - f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); - f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); - f.text_none.checked = inStr(ce.style.textDecoration, 'none'); - updateTextDecorations(); - - // Setup background fields - - f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); - updateColor('background_color_pick', 'background_color'); - f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); - selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); - selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); - selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); - selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); - selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); - - // Setup block fields - - selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); - selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); - selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); - selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); - selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); - selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); - f.block_text_indent.value = getNum(ce.style.textIndent); - selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); - selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); - selectByValue(f, 'block_display', ce.style.display, true, true); - - // Setup box fields - - f.box_width.value = getNum(ce.style.width); - selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); - - f.box_height.value = getNum(ce.style.height); - selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); - selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); - - selectByValue(f, 'box_clear', ce.style.clear, true, true); - - setupBox(f, ce, 'box_padding', 'padding', ''); - setupBox(f, ce, 'box_margin', 'margin', ''); - - // Setup border fields - - setupBox(f, ce, 'border_style', 'border', 'Style'); - setupBox(f, ce, 'border_width', 'border', 'Width'); - setupBox(f, ce, 'border_color', 'border', 'Color'); - - updateColor('border_color_top_pick', 'border_color_top'); - updateColor('border_color_right_pick', 'border_color_right'); - updateColor('border_color_bottom_pick', 'border_color_bottom'); - updateColor('border_color_left_pick', 'border_color_left'); - - f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); - f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); - f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); - f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); - - // Setup list fields - - selectByValue(f, 'list_type', ce.style.listStyleType, true, true); - selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); - f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - - // Setup box fields - - selectByValue(f, 'positioning_type', ce.style.position, true, true); - selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); - selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); - f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; - - f.positioning_width.value = getNum(ce.style.width); - selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); - - f.positioning_height.value = getNum(ce.style.height); - selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); - - setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); - - s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); - s = s.replace(/,/g, ' '); - - if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = getNum(getVal(s, 1)); - selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); - f.positioning_clip_bottom.value = getNum(getVal(s, 2)); - selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); - f.positioning_clip_left.value = getNum(getVal(s, 3)); - selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); - } else { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; - } - -// setupBox(f, ce, '', 'border', 'Color'); -} - -function getMeasurement(s) { - return s.replace(/^([0-9.]+)(.*)$/, "$2"); -} - -function getNum(s) { - if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) - return s.replace(/[^0-9.]/g, ''); - - return s; -} - -function inStr(s, n) { - return new RegExp(n, 'gi').test(s); -} - -function getVal(s, i) { - var a = s.split(' '); - - if (a.length > 1) - return a[i]; - - return ""; -} - -function setValue(f, n, v) { - if (f.elements[n].type == "text") - f.elements[n].value = v; - else - selectByValue(f, n, v, true, true); -} - -function setupBox(f, ce, fp, pr, sf, b) { - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (isSame(ce, pr, sf, b)) { - f.elements[fp + "_same"].checked = true; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - f.elements[fp + "_right"].value = ""; - f.elements[fp + "_right"].disabled = true; - f.elements[fp + "_bottom"].value = ""; - f.elements[fp + "_bottom"].disabled = true; - f.elements[fp + "_left"].value = ""; - f.elements[fp + "_left"].disabled = true; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - f.elements[fp + "_left_measurement"].disabled = true; - f.elements[fp + "_bottom_measurement"].disabled = true; - f.elements[fp + "_right_measurement"].disabled = true; - } - } else { - f.elements[fp + "_same"].checked = false; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); - f.elements[fp + "_right"].disabled = false; - - setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); - f.elements[fp + "_bottom"].disabled = false; - - setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left"].disabled = false; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); - selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); - selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left_measurement"].disabled = false; - f.elements[fp + "_bottom_measurement"].disabled = false; - f.elements[fp + "_right_measurement"].disabled = false; - } - } -} - -function isSame(e, pr, sf, b) { - var a = [], i, x; - - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (typeof(sf) == "undefined" || sf == null) - sf = ""; - - a[0] = e.style[pr + b[0] + sf]; - a[1] = e.style[pr + b[1] + sf]; - a[2] = e.style[pr + b[2] + sf]; - a[3] = e.style[pr + b[3] + sf]; - - for (i=0; i 0 ? s.substring(1) : s; - - if (f.text_none.checked) - s = "none"; - - ce.style.textDecoration = s; - - // Build background styles - - ce.style.backgroundColor = f.background_color.value; - ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; - ce.style.backgroundRepeat = f.background_repeat.value; - ce.style.backgroundAttachment = f.background_attachment.value; - - if (f.background_hpos.value != "") { - s = ""; - s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; - s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); - ce.style.backgroundPosition = s; - } - - // Build block styles - - ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); - ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); - ce.style.verticalAlign = f.block_vertical_alignment.value; - ce.style.textAlign = f.block_text_align.value; - ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); - ce.style.whiteSpace = f.block_whitespace.value; - ce.style.display = f.block_display.value; - - // Build box styles - - ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); - ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); - ce.style.styleFloat = f.box_float.value; - ce.style.cssFloat = f.box_float.value; - - ce.style.clear = f.box_clear.value; - - if (!f.box_padding_same.checked) { - ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); - ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); - ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); - } else - ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - - if (!f.box_margin_same.checked) { - ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); - ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); - ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); - } else - ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - - // Build border styles - - if (!f.border_style_same.checked) { - ce.style.borderTopStyle = f.border_style_top.value; - ce.style.borderRightStyle = f.border_style_right.value; - ce.style.borderBottomStyle = f.border_style_bottom.value; - ce.style.borderLeftStyle = f.border_style_left.value; - } else - ce.style.borderStyle = f.border_style_top.value; - - if (!f.border_width_same.checked) { - ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); - ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); - ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); - } else - ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - - if (!f.border_color_same.checked) { - ce.style.borderTopColor = f.border_color_top.value; - ce.style.borderRightColor = f.border_color_right.value; - ce.style.borderBottomColor = f.border_color_bottom.value; - ce.style.borderLeftColor = f.border_color_left.value; - } else - ce.style.borderColor = f.border_color_top.value; - - // Build list styles - - ce.style.listStyleType = f.list_type.value; - ce.style.listStylePosition = f.list_position.value; - ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; - - // Build positioning styles - - ce.style.position = f.positioning_type.value; - ce.style.visibility = f.positioning_visibility.value; - - if (ce.style.width == "") - ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); - - if (ce.style.height == "") - ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); - - ce.style.zIndex = f.positioning_zindex.value; - ce.style.overflow = f.positioning_overflow.value; - - if (!f.positioning_placement_same.checked) { - ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); - ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); - ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); - } else { - s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.top = s; - ce.style.right = s; - ce.style.bottom = s; - ce.style.left = s; - } - - if (!f.positioning_clip_same.checked) { - s = "rect("; - s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); - s += ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } else { - s = "rect("; - t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; - s += t + " "; - s += t + " "; - s += t + " "; - s += t + ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } - - ce.style.cssText = ce.style.cssText; -} - -function isNum(s) { - return new RegExp('[0-9]+', 'g').test(s); -} - -function showDisabledControls() { - var f = document.forms, i, a; - - for (i=0; i 1) { - addSelectValue(f, s, p[0], p[1]); - - if (se) - selectByValue(f, s, p[1]); - } else { - addSelectValue(f, s, p[0], p[0]); - - if (se) - selectByValue(f, s, p[0]); - } - } -} - -function toggleSame(ce, pre) { - var el = document.forms[0].elements, i; - - if (ce.checked) { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = true; - el[pre + "_bottom"].disabled = true; - el[pre + "_left"].disabled = true; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = true; - el[pre + "_bottom_measurement"].disabled = true; - el[pre + "_left_measurement"].disabled = true; - } - } else { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = false; - el[pre + "_bottom"].disabled = false; - el[pre + "_left"].disabled = false; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = false; - el[pre + "_bottom_measurement"].disabled = false; - el[pre + "_left_measurement"].disabled = false; - } - } - - showDisabledControls(); -} - -function synch(fr, to) { - var f = document.forms[0]; - - f.elements[to].value = f.elements[fr].value; - - if (f.elements[fr + "_measurement"]) - selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); -} - -function updateTextDecorations(){ - var el = document.forms[0].elements; - - var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"]; - var noneChecked = el["text_none"].checked; - tinymce.each(textDecorations, function(id) { - el[id].disabled = noneChecked; - if (noneChecked) { - el[id].checked = false; - } - }); -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function aggregateStyles(allStyles) { + var mergedStyles = {}; + + tinymce.each(allStyles, function(style) { + if (style !== '') { + var parsedStyles = tinyMCEPopup.editor.dom.parseStyle(style); + for (var name in parsedStyles) { + if (parsedStyles.hasOwnProperty(name)) { + if (mergedStyles[name] === undefined) { + mergedStyles[name] = parsedStyles[name]; + } + else if (name === 'text-decoration') { + if (mergedStyles[name].indexOf(parsedStyles[name]) === -1) { + mergedStyles[name] = mergedStyles[name] +' '+ parsedStyles[name]; + } + } + } + } + } + }); + + return mergedStyles; +} + +var applyActionIsInsert; +var existingStyles; + +function init(ed) { + var ce = document.getElementById('container'), h; + + existingStyles = aggregateStyles(tinyMCEPopup.getWindowArg('styles')); + ce.style.cssText = tinyMCEPopup.editor.dom.serializeStyle(existingStyles); + + applyActionIsInsert = ed.getParam("edit_css_style_insert_span", false); + document.getElementById('toggle_insert_span').checked = applyActionIsInsert; + + h = getBrowserHTML('background_image_browser','background_image','image','advimage'); + document.getElementById("background_image_browser").innerHTML = h; + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + f.text_none.checked = inStr(ce.style.textDecoration, 'none'); + updateTextDecorations(); + + // Setup background fields + + f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); + f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); + f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); + f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9.]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) + return s.replace(/[^0-9.]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = s.split(' '); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = [], i, x; + + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = ce.style.cssText; +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} + +function updateTextDecorations(){ + var el = document.forms[0].elements; + + var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"]; + var noneChecked = el["text_none"].checked; + tinymce.each(textDecorations, function(id) { + el[id].disabled = noneChecked; + if (noneChecked) { + el[id].checked = false; + } + }); +} + +tinyMCEPopup.onInit.add(init); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/style/langs/en_dlg.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/style/langs/en_dlg.js index 82bf2cb..35881b3 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/style/langs/en_dlg.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/style/langs/en_dlg.js @@ -1 +1 @@ -tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"}); +tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"}); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/tabfocus/editor_plugin_src.js index f9df7de..1a00e10 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/tabfocus/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/tabfocus/editor_plugin_src.js @@ -1,122 +1,122 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; - - tinymce.create('tinymce.plugins.TabFocusPlugin', { - init : function(ed, url) { - function tabCancel(ed, e) { - if (e.keyCode === 9) - return Event.cancel(e); - } - - function tabHandler(ed, e) { - var x, i, f, el, v; - - function find(d) { - el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); - - function canSelectRecursive(e) { - return e.nodeName==="BODY" || (e.type != 'hidden' && - !(e.style.display == "none") && - !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode)); - } - function canSelectInOldIe(el) { - return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA"; - } - function isOldIe() { - return tinymce.isIE6 || tinymce.isIE7; - } - function canSelect(el) { - return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el); - } - - each(el, function(e, i) { - if (e.id == ed.id) { - x = i; - return false; - } - }); - if (d > 0) { - for (i = x + 1; i < el.length; i++) { - if (canSelect(el[i])) - return el[i]; - } - } else { - for (i = x - 1; i >= 0; i--) { - if (canSelect(el[i])) - return el[i]; - } - } - - return null; - } - - if (e.keyCode === 9) { - v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); - - if (v.length == 1) { - v[1] = v[0]; - v[0] = ':prev'; - } - - // Find element to focus - if (e.shiftKey) { - if (v[0] == ':prev') - el = find(-1); - else - el = DOM.get(v[0]); - } else { - if (v[1] == ':next') - el = find(1); - else - el = DOM.get(v[1]); - } - - if (el) { - if (el.id && (ed = tinymce.get(el.id || el.name))) - ed.focus(); - else - window.setTimeout(function() { - if (!tinymce.isWebKit) - window.focus(); - el.focus(); - }, 10); - - return Event.cancel(e); - } - } - } - - ed.onKeyUp.add(tabCancel); - - if (tinymce.isGecko) { - ed.onKeyPress.add(tabHandler); - ed.onKeyDown.add(tabCancel); - } else - ed.onKeyDown.add(tabHandler); - - }, - - getInfo : function() { - return { - longname : 'Tabfocus', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; + + tinymce.create('tinymce.plugins.TabFocusPlugin', { + init : function(ed, url) { + function tabCancel(ed, e) { + if (e.keyCode === 9) + return Event.cancel(e); + } + + function tabHandler(ed, e) { + var x, i, f, el, v; + + function find(d) { + el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); + + function canSelectRecursive(e) { + return e.nodeName==="BODY" || (e.type != 'hidden' && + !(e.style.display == "none") && + !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode)); + } + function canSelectInOldIe(el) { + return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA"; + } + function isOldIe() { + return tinymce.isIE6 || tinymce.isIE7; + } + function canSelect(el) { + return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el); + } + + each(el, function(e, i) { + if (e.id == ed.id) { + x = i; + return false; + } + }); + if (d > 0) { + for (i = x + 1; i < el.length; i++) { + if (canSelect(el[i])) + return el[i]; + } + } else { + for (i = x - 1; i >= 0; i--) { + if (canSelect(el[i])) + return el[i]; + } + } + + return null; + } + + if (e.keyCode === 9) { + v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); + + if (v.length == 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + + // Find element to focus + if (e.shiftKey) { + if (v[0] == ':prev') + el = find(-1); + else + el = DOM.get(v[0]); + } else { + if (v[1] == ':next') + el = find(1); + else + el = DOM.get(v[1]); + } + + if (el) { + if (el.id && (ed = tinymce.get(el.id || el.name))) + ed.focus(); + else + window.setTimeout(function() { + if (!tinymce.isWebKit) + window.focus(); + el.focus(); + }, 10); + + return Event.cancel(e); + } + } + } + + ed.onKeyUp.add(tabCancel); + + if (tinymce.isGecko) { + ed.onKeyPress.add(tabHandler); + ed.onKeyDown.add(tabCancel); + } else + ed.onKeyDown.add(tabHandler); + + }, + + getInfo : function() { + return { + longname : 'Tabfocus', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/cell.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/cell.css index a067ecd..4a286d6 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/cell.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/cell.css @@ -1,17 +1,17 @@ -/* CSS file for cell dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#class { - width: 150px; +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; } \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/row.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/row.css index 1f7755d..58fe9ca 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/row.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/row.css @@ -1,25 +1,25 @@ -/* CSS file for row dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#rowtype,#align,#valign,#class,#height { - width: 150px; -} - -#height { - width: 50px; -} - -.col2 { - padding-left: 20px; -} +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/table.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/table.css index d11c3f6..a851d36 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/table.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/css/table.css @@ -1,13 +1,13 @@ -/* CSS file for table dialog in the table plugin */ - -.panel_wrapper div.current { - height: 245px; -} - -.advfield { - width: 200px; -} - -#class { - width: 150px; -} +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/editor_plugin_src.js index 9afe547..2bd1d26 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/editor_plugin_src.js @@ -1,1452 +1,1452 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var each = tinymce.each; - - // Checks if the selection/caret is at the start of the specified block element - function isAtStart(rng, par) { - var doc = par.ownerDocument, rng2 = doc.createRange(), elm; - - rng2.setStartBefore(par); - rng2.setEnd(rng.endContainer, rng.endOffset); - - elm = doc.createElement('body'); - elm.appendChild(rng2.cloneContents()); - - // Check for text characters of other elements that should be treated as content - return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; - }; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1); - } - - /** - * Table Grid class. - */ - function TableGrid(table, dom, selection) { - var grid, startPos, endPos, selectedCell; - - buildGrid(); - selectedCell = dom.getParent(selection.getStart(), 'th,td'); - if (selectedCell) { - startPos = getPos(selectedCell); - endPos = findEndPos(); - selectedCell = getCell(startPos.x, startPos.y); - } - - function cloneNode(node, children) { - node = node.cloneNode(children); - node.removeAttribute('id'); - - return node; - } - - function buildGrid() { - var startY = 0; - - grid = []; - - each(['thead', 'tbody', 'tfoot'], function(part) { - var rows = dom.select('> ' + part + ' tr', table); - - each(rows, function(tr, y) { - y += startY; - - each(dom.select('> td, > th', tr), function(td, x) { - var x2, y2, rowspan, colspan; - - // Skip over existing cells produced by rowspan - if (grid[y]) { - while (grid[y][x]) - x++; - } - - // Get col/rowspan from cell - rowspan = getSpanVal(td, 'rowspan'); - colspan = getSpanVal(td, 'colspan'); - - // Fill out rowspan/colspan right and down - for (y2 = y; y2 < y + rowspan; y2++) { - if (!grid[y2]) - grid[y2] = []; - - for (x2 = x; x2 < x + colspan; x2++) { - grid[y2][x2] = { - part : part, - real : y2 == y && x2 == x, - elm : td, - rowspan : rowspan, - colspan : colspan - }; - } - } - }); - }); - - startY += rows.length; - }); - }; - - function getCell(x, y) { - var row; - - row = grid[y]; - if (row) - return row[x]; - }; - - function setSpanVal(td, name, val) { - if (td) { - val = parseInt(val); - - if (val === 1) - td.removeAttribute(name, 1); - else - td.setAttribute(name, val, 1); - } - } - - function isCellSelected(cell) { - return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); - }; - - function getSelectedRows() { - var rows = []; - - each(table.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { - rows.push(row); - return false; - } - }); - }); - - return rows; - }; - - function deleteTable() { - var rng = dom.createRng(); - - rng.setStartAfter(table); - rng.setEndAfter(table); - - selection.setRng(rng); - - dom.remove(table); - }; - - function cloneCell(cell) { - var formatNode; - - // Clone formats - tinymce.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - node = cloneNode(node, false); - - if (!formatNode) - formatNode = curNode = node; - else if (curNode) - curNode.appendChild(node); - - curNode = node; - }); - - // Add something to the inner node - if (curNode) - curNode.innerHTML = tinymce.isIE ? ' ' : '
      '; - - return false; - } - }, 'childNodes'); - - cell = cloneNode(cell, false); - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - if (formatNode) { - cell.appendChild(formatNode); - } else { - if (!tinymce.isIE) - cell.innerHTML = '
      '; - } - - return cell; - }; - - function cleanup() { - var rng = dom.createRng(); - - // Empty rows - each(dom.select('tr', table), function(tr) { - if (tr.cells.length == 0) - dom.remove(tr); - }); - - // Empty table - if (dom.select('tr', table).length == 0) { - rng.setStartAfter(table); - rng.setEndAfter(table); - selection.setRng(rng); - dom.remove(table); - return; - } - - // Empty header/body/footer - each(dom.select('thead,tbody,tfoot', table), function(part) { - if (part.rows.length == 0) - dom.remove(part); - }); - - // Restore selection to start position if it still exists - buildGrid(); - - // Restore the selection to the closest table position - row = grid[Math.min(grid.length - 1, startPos.y)]; - if (row) { - selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); - selection.collapse(true); - } - }; - - function fillLeftDown(x, y, rows, cols) { - var tr, x2, r, c, cell; - - tr = grid[y][x].elm.parentNode; - for (r = 1; r <= rows; r++) { - tr = dom.getNext(tr, 'tr'); - - if (tr) { - // Loop left to find real cell - for (x2 = x; x2 >= 0; x2--) { - cell = grid[y + r][x2].elm; - - if (cell.parentNode == tr) { - // Append clones after - for (c = 1; c <= cols; c++) - dom.insertAfter(cloneCell(cell), cell); - - break; - } - } - - if (x2 == -1) { - // Insert nodes before first cell - for (c = 1; c <= cols; c++) - tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); - } - } - } - }; - - function split() { - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan, newCell, i; - - if (isCellSelected(cell)) { - cell = cell.elm; - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan > 1 || rowSpan > 1) { - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - // Insert cells right - for (i = 0; i < colSpan - 1; i++) - dom.insertAfter(cloneCell(cell), cell); - - fillLeftDown(x, y, rowSpan - 1, colSpan); - } - } - }); - }); - }; - - function merge(cell, cols, rows) { - var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; - - // Use specified cell and cols/rows - if (cell) { - pos = getPos(cell); - startX = pos.x; - startY = pos.y; - endX = startX + (cols - 1); - endY = startY + (rows - 1); - } else { - startPos = endPos = null; - - // Calculate start/end pos by checking for selected cells in grid works better with context menu - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - if (!startPos) { - startPos = {x: x, y: y}; - } - - endPos = {x: x, y: y}; - } - }); - }); - - // Use selection - startX = startPos.x; - startY = startPos.y; - endX = endPos.x; - endY = endPos.y; - } - - // Find start/end cells - startCell = getCell(startX, startY); - endCell = getCell(endX, endY); - - // Check if the cells exists and if they are of the same part for example tbody = tbody - if (startCell && endCell && startCell.part == endCell.part) { - // Split and rebuild grid - split(); - buildGrid(); - - // Set row/col span to start cell - startCell = getCell(startX, startY).elm; - setSpanVal(startCell, 'colSpan', (endX - startX) + 1); - setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); - - // Remove other cells and add it's contents to the start cell - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - if (!grid[y] || !grid[y][x]) - continue; - - cell = grid[y][x].elm; - - if (cell != startCell) { - // Move children to startCell - children = tinymce.grep(cell.childNodes); - each(children, function(node) { - startCell.appendChild(node); - }); - - // Remove bogus nodes if there is children in the target cell - if (children.length) { - children = tinymce.grep(startCell.childNodes); - count = 0; - each(children, function(node) { - if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) - startCell.removeChild(node); - }); - } - - // Remove cell - dom.remove(cell); - } - } - } - - // Remove empty rows etc and restore caret location - cleanup(); - } - }; - - function insertRow(before) { - var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; - - // Find first/last row - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - cell = cell.elm; - rowElm = cell.parentNode; - newRow = cloneNode(rowElm, false); - posY = y; - - if (before) - return false; - } - }); - - if (before) - return !posY; - }); - - for (x = 0; x < grid[0].length; x++) { - // Cell not found could be because of an invalid table structure - if (!grid[posY][x]) - continue; - - cell = grid[posY][x].elm; - - if (cell != lastCell) { - if (!before) { - rowSpan = getSpanVal(cell, 'rowspan'); - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan + 1); - continue; - } - } else { - // Check if cell above can be expanded - if (posY > 0 && grid[posY - 1][x]) { - otherCell = grid[posY - 1][x].elm; - rowSpan = getSpanVal(otherCell, 'rowSpan'); - if (rowSpan > 1) { - setSpanVal(otherCell, 'rowSpan', rowSpan + 1); - continue; - } - } - } - - // Insert new cell into new row - newCell = cloneCell(cell); - setSpanVal(newCell, 'colSpan', cell.colSpan); - - newRow.appendChild(newCell); - - lastCell = cell; - } - } - - if (newRow.hasChildNodes()) { - if (!before) - dom.insertAfter(newRow, rowElm); - else - rowElm.parentNode.insertBefore(newRow, rowElm); - } - }; - - function insertCol(before) { - var posX, lastCell; - - // Find first/last column - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - posX = x; - - if (before) - return false; - } - }); - - if (before) - return !posX; - }); - - each(grid, function(row, y) { - var cell, rowSpan, colSpan; - - if (!row[posX]) - return; - - cell = row[posX].elm; - if (cell != lastCell) { - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan == 1) { - if (!before) { - dom.insertAfter(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } else { - cell.parentNode.insertBefore(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } - } else - setSpanVal(cell, 'colSpan', cell.colSpan + 1); - - lastCell = cell; - } - }); - }; - - function deleteCols() { - var cols = []; - - // Get selected column indexes - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { - each(grid, function(row) { - var cell = row[x].elm, colSpan; - - colSpan = getSpanVal(cell, 'colSpan'); - - if (colSpan > 1) - setSpanVal(cell, 'colSpan', colSpan - 1); - else - dom.remove(cell); - }); - - cols.push(x); - } - }); - }); - - cleanup(); - }; - - function deleteRows() { - var rows; - - function deleteRow(tr) { - var nextTr, pos, lastCell; - - nextTr = dom.getNext(tr, 'tr'); - - // Move down row spanned cells - each(tr.cells, function(cell) { - var rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - pos = getPos(cell); - fillLeftDown(pos.x, pos.y, 1, 1); - } - }); - - // Delete cells - pos = getPos(tr.cells[0]); - each(grid[pos.y], function(cell) { - var rowSpan; - - cell = cell.elm; - - if (cell != lastCell) { - rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan <= 1) - dom.remove(cell); - else - setSpanVal(cell, 'rowSpan', rowSpan - 1); - - lastCell = cell; - } - }); - }; - - // Get selected rows and move selection out of scope - rows = getSelectedRows(); - - // Delete all selected rows - each(rows.reverse(), function(tr) { - deleteRow(tr); - }); - - cleanup(); - }; - - function cutRows() { - var rows = getSelectedRows(); - - dom.remove(rows); - cleanup(); - - return rows; - }; - - function copyRows() { - var rows = getSelectedRows(); - - each(rows, function(row, i) { - rows[i] = cloneNode(row, true); - }); - - return rows; - }; - - function pasteRows(rows, before) { - var selectedRows = getSelectedRows(), - targetRow = selectedRows[before ? 0 : selectedRows.length - 1], - targetCellCount = targetRow.cells.length; - - // Calc target cell count - each(grid, function(row) { - var match; - - targetCellCount = 0; - each(row, function(cell, x) { - if (cell.real) - targetCellCount += cell.colspan; - - if (cell.elm.parentNode == targetRow) - match = 1; - }); - - if (match) - return false; - }); - - if (!before) - rows.reverse(); - - each(rows, function(row) { - var cellCount = row.cells.length, cell; - - // Remove col/rowspans - for (i = 0; i < cellCount; i++) { - cell = row.cells[i]; - setSpanVal(cell, 'colSpan', 1); - setSpanVal(cell, 'rowSpan', 1); - } - - // Needs more cells - for (i = cellCount; i < targetCellCount; i++) - row.appendChild(cloneCell(row.cells[cellCount - 1])); - - // Needs less cells - for (i = targetCellCount; i < cellCount; i++) - dom.remove(row.cells[i]); - - // Add before/after - if (before) - targetRow.parentNode.insertBefore(row, targetRow); - else - dom.insertAfter(row, targetRow); - }); - - // Remove current selection - dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - }; - - function getPos(target) { - var pos; - - each(grid, function(row, y) { - each(row, function(cell, x) { - if (cell.elm == target) { - pos = {x : x, y : y}; - return false; - } - }); - - return !pos; - }); - - return pos; - }; - - function setStartCell(cell) { - startPos = getPos(cell); - }; - - function findEndPos() { - var pos, maxX, maxY; - - maxX = maxY = 0; - - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan; - - if (isCellSelected(cell)) { - cell = grid[y][x]; - - if (x > maxX) - maxX = x; - - if (y > maxY) - maxY = y; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - }); - }); - - return {x : maxX, y : maxY}; - }; - - function setEndCell(cell) { - var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; - - endPos = getPos(cell); - - if (startPos && endPos) { - // Get start/end positions - startX = Math.min(startPos.x, endPos.x); - startY = Math.min(startPos.y, endPos.y); - endX = Math.max(startPos.x, endPos.x); - endY = Math.max(startPos.y, endPos.y); - - // Expand end positon to include spans - maxX = endX; - maxY = endY; - - // Expand startX - for (y = startY; y <= maxY; y++) { - cell = grid[y][startX]; - - if (!cell.real) { - if (startX - (cell.colspan - 1) < startX) - startX -= cell.colspan - 1; - } - } - - // Expand startY - for (x = startX; x <= maxX; x++) { - cell = grid[startY][x]; - - if (!cell.real) { - if (startY - (cell.rowspan - 1) < startY) - startY -= cell.rowspan - 1; - } - } - - // Find max X, Y - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x]; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - } - - // Remove current selection - dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - - // Add new selection - for (y = startY; y <= maxY; y++) { - for (x = startX; x <= maxX; x++) { - if (grid[y][x]) - dom.addClass(grid[y][x].elm, 'mceSelected'); - } - } - } - }; - - // Expose to public - tinymce.extend(this, { - deleteTable : deleteTable, - split : split, - merge : merge, - insertRow : insertRow, - insertCol : insertCol, - deleteCols : deleteCols, - deleteRows : deleteRows, - cutRows : cutRows, - copyRows : copyRows, - pasteRows : pasteRows, - getPos : getPos, - setStartCell : setStartCell, - setEndCell : setEndCell - }); - }; - - tinymce.create('tinymce.plugins.TablePlugin', { - init : function(ed, url) { - var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload - - function createTableGrid(node) { - var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); - - if (tblElm) - return new TableGrid(tblElm, ed.dom, selection); - }; - - function cleanup() { - // Restore selection possibilities - ed.getBody().style.webkitUserSelect = ''; - - if (hasCellSelection) { - ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - hasCellSelection = false; - } - }; - - // Register buttons - each([ - ['table', 'table.desc', 'mceInsertTable', true], - ['delete_table', 'table.del', 'mceTableDelete'], - ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], - ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], - ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], - ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], - ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], - ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], - ['row_props', 'table.row_desc', 'mceTableRowProps', true], - ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], - ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], - ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] - ], function(c) { - ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); - }); - - // Select whole table is a table border is clicked - if (!tinymce.isIE) { - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'TABLE') { - ed.selection.select(e); - ed.nodeChanged(); - } - }); - } - - ed.onPreProcess.add(function(ed, args) { - var nodes, i, node, dom = ed.dom, value; - - nodes = dom.select('table', args.node); - i = nodes.length; - while (i--) { - node = nodes[i]; - dom.setAttrib(node, 'data-mce-style', ''); - - if ((value = dom.getAttrib(node, 'width'))) { - dom.setStyle(node, 'width', value); - dom.setAttrib(node, 'width', ''); - } - - if ((value = dom.getAttrib(node, 'height'))) { - dom.setStyle(node, 'height', value); - dom.setAttrib(node, 'height', ''); - } - } - }); - - // Handle node change updates - ed.onNodeChange.add(function(ed, cm, n) { - var p; - - n = ed.selection.getStart(); - p = ed.dom.getParent(n, 'td,th,caption'); - cm.setActive('table', n.nodeName === 'TABLE' || !!p); - - // Disable table tools if we are in caption - if (p && p.nodeName === 'CAPTION') - p = 0; - - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_col', !p); - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_row', !p); - cm.setDisabled('col_after', !p); - cm.setDisabled('col_before', !p); - cm.setDisabled('row_after', !p); - cm.setDisabled('row_before', !p); - cm.setDisabled('row_props', !p); - cm.setDisabled('cell_props', !p); - cm.setDisabled('split_cells', !p); - cm.setDisabled('merge_cells', !p); - }); - - ed.onInit.add(function(ed) { - var startTable, startCell, dom = ed.dom, tableGrid; - - winMan = ed.windowManager; - - // Add cell selection logic - ed.onMouseDown.add(function(ed, e) { - if (e.button != 2) { - cleanup(); - - startCell = dom.getParent(e.target, 'td,th'); - startTable = dom.getParent(startCell, 'table'); - } - }); - - dom.bind(ed.getDoc(), 'mouseover', function(e) { - var sel, table, target = e.target; - - if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { - table = dom.getParent(target, 'table'); - if (table == startTable) { - if (!tableGrid) { - tableGrid = createTableGrid(table); - tableGrid.setStartCell(startCell); - - ed.getBody().style.webkitUserSelect = 'none'; - } - - tableGrid.setEndCell(target); - hasCellSelection = true; - } - - // Remove current selection - sel = ed.selection.getSel(); - - try { - if (sel.removeAllRanges) - sel.removeAllRanges(); - else - sel.empty(); - } catch (ex) { - // IE9 might throw errors here - } - - e.preventDefault(); - } - }); - - ed.onMouseUp.add(function(ed, e) { - var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; - - // Move selection to startCell - if (startCell) { - if (tableGrid) - ed.getBody().style.webkitUserSelect = ''; - - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); - - return; - } - } while (node = (start ? walker.next() : walker.prev())); - } - - // Try to expand text selection as much as we can only Gecko supports cell selection - selectedCells = dom.select('td.mceSelected,th.mceSelected'); - if (selectedCells.length > 0) { - rng = dom.createRng(); - node = selectedCells[0]; - endNode = selectedCells[selectedCells.length - 1]; - rng.setStartBefore(node); - rng.setEndAfter(node); - - setPoint(node, 1); - walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); - - do { - if (node.nodeName == 'TD' || node.nodeName == 'TH') { - if (!dom.hasClass(node, 'mceSelected')) - break; - - lastNode = node; - } - } while (node = walker.next()); - - setPoint(lastNode); - - sel.setRng(rng); - } - - ed.nodeChanged(); - startCell = tableGrid = startTable = null; - } - }); - - ed.onKeyUp.add(function(ed, e) { - cleanup(); - }); - - ed.onKeyDown.add(function (ed, e) { - fixTableCellSelection(ed); - }); - - ed.onMouseDown.add(function (ed, e) { - if (e.button != 2) { - fixTableCellSelection(ed); - } - }); - function tableCellSelected(ed, rng, n, currentCell) { - // The decision of when a table cell is selected is somewhat involved. The fact that this code is - // required is actually a pointer to the root cause of this bug. A cell is selected when the start - // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) - // or the parent of the table (in the case of the selection containing the last cell of a table). - var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), - tableParent, allOfCellSelected, tableCellSelection; - if (table) - tableParent = table.parentNode; - allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && - rng.startOffset == 0 && - rng.endOffset == 0 && - currentCell && - (n.nodeName=="TR" || n==tableParent); - tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; - return allOfCellSelected || tableCellSelection; - // return false; - } - - // this nasty hack is here to work around some WebKit selection bugs. - function fixTableCellSelection(ed) { - if (!tinymce.isWebKit) - return; - - var rng = ed.selection.getRng(); - var n = ed.selection.getNode(); - var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); - - if (!tableCellSelected(ed, rng, n, currentCell)) - return; - if (!currentCell) { - currentCell=n; - } - - // Get the very last node inside the table cell - var end = currentCell.lastChild; - while (end.lastChild) - end = end.lastChild; - - // Select the entire table cell. Nothing outside of the table cell should be selected. - rng.setEnd(end, end.nodeValue.length); - ed.selection.setRng(rng); - } - ed.plugins.table.fixTableCellSelection=fixTableCellSelection; - - // Add context menu - if (ed && ed.plugins.contextmenu) { - ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { - var sm, se = ed.selection, el = se.getNode() || ed.getBody(); - - if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { - m.removeAll(); - - if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { - m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); - m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); - m.addSeparator(); - } - - if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { - m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); - m.addSeparator(); - } - - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); - m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); - m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); - m.addSeparator(); - - // Cell menu - sm = m.addMenu({title : 'table.cell'}); - sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); - sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); - sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); - - // Row menu - sm = m.addMenu({title : 'table.row'}); - sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); - sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); - sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); - sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); - sm.addSeparator(); - sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); - sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); - sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); - sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); - - // Column menu - sm = m.addMenu({title : 'table.col'}); - sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); - sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); - sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); - } else - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); - }); - } - - // Fix to allow navigating up and down in a table in WebKit browsers. - if (tinymce.isWebKit) { - function moveSelection(ed, e) { - var VK = tinymce.VK; - var key = e.keyCode; - - function handle(upBool, sourceNode, event) { - var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; - var currentRow = ed.dom.getParent(sourceNode, 'tr'); - var siblingRow = currentRow[siblingDirection]; - - if (siblingRow) { - moveCursorToRow(ed, sourceNode, siblingRow, upBool); - tinymce.dom.Event.cancel(event); - return true; - } else { - var tableNode = ed.dom.getParent(currentRow, 'table'); - var middleNode = currentRow.parentNode; - var parentNodeName = middleNode.nodeName.toLowerCase(); - if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { - var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); - if (targetParent !== null) { - return moveToRowInTarget(upBool, targetParent, sourceNode, event); - } - } - return escapeTable(upBool, currentRow, siblingDirection, tableNode, event); - } - } - - function getTargetParent(upBool, topNode, secondNode, nodeName) { - var tbodies = ed.dom.select('>' + nodeName, topNode); - var position = tbodies.indexOf(secondNode); - if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { - return getFirstHeadOrFoot(upBool, topNode); - } else if (position === -1) { - var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; - return tbodies[topOrBottom]; - } else { - return tbodies[position + (upBool ? -1 : 1)]; - } - } - - function getFirstHeadOrFoot(upBool, parent) { - var tagName = upBool ? 'thead' : 'tfoot'; - var headOrFoot = ed.dom.select('>' + tagName, parent); - return headOrFoot.length !== 0 ? headOrFoot[0] : null; - } - - function moveToRowInTarget(upBool, targetParent, sourceNode, event) { - var targetRow = getChildForDirection(targetParent, upBool); - targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); - tinymce.dom.Event.cancel(event); - return true; - } - - function escapeTable(upBool, currentRow, siblingDirection, table, event) { - var tableSibling = table[siblingDirection]; - if (tableSibling) { - moveCursorToStartOfElement(tableSibling); - return true; - } else { - var parentCell = ed.dom.getParent(table, 'td,th'); - if (parentCell) { - return handle(upBool, parentCell, event); - } else { - var backUpSibling = getChildForDirection(currentRow, !upBool); - moveCursorToStartOfElement(backUpSibling); - return tinymce.dom.Event.cancel(event); - } - } - } - - function getChildForDirection(parent, up) { - var child = parent && parent[up ? 'lastChild' : 'firstChild']; - // BR is not a valid table child to return in this case we return the table cell - return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child; - } - - function moveCursorToStartOfElement(n) { - ed.selection.setCursorLocation(n, 0); - } - - function isVerticalMovement() { - return key == VK.UP || key == VK.DOWN; - } - - function isInTable(ed) { - var node = ed.selection.getNode(); - var currentRow = ed.dom.getParent(node, 'tr'); - return currentRow !== null; - } - - function columnIndex(column) { - var colIndex = 0; - var c = column; - while (c.previousSibling) { - c = c.previousSibling; - colIndex = colIndex + getSpanVal(c, "colspan"); - } - return colIndex; - } - - function findColumn(rowElement, columnIndex) { - var c = 0; - var r = 0; - each(rowElement.children, function(cell, i) { - c = c + getSpanVal(cell, "colspan"); - r = i; - if (c > columnIndex) - return false; - }); - return r; - } - - function moveCursorToRow(ed, node, row, upBool) { - var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th')); - var tgtColumnIndex = findColumn(row, srcColumnIndex); - var tgtNode = row.childNodes[tgtColumnIndex]; - var rowCellTarget = getChildForDirection(tgtNode, upBool); - moveCursorToStartOfElement(rowCellTarget || tgtNode); - } - - function shouldFixCaret(preBrowserNode) { - var newNode = ed.selection.getNode(); - var newParent = ed.dom.getParent(newNode, 'td,th'); - var oldParent = ed.dom.getParent(preBrowserNode, 'td,th'); - return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent) - } - - function checkSameParentTable(nodeOne, NodeTwo) { - return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE'); - } - - if (isVerticalMovement() && isInTable(ed)) { - var preBrowserNode = ed.selection.getNode(); - setTimeout(function() { - if (shouldFixCaret(preBrowserNode)) { - handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); - } - }, 0); - } - } - - ed.onKeyDown.add(moveSelection); - } - - // Fixes an issue on Gecko where it's impossible to place the caret behind a table - // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled - function fixTableCaretPos() { - var last; - - // Skip empty text nodes form the end - for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; - - if (last && last.nodeName == 'TABLE') { - if (ed.settings.forced_root_block) - ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '
      '); - else - ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'}); - } - }; - - // Fixes an bug where it's impossible to place the caret before a table in Gecko - // this fix solves it by detecting when the caret is at the beginning of such a table - // and then manually moves the caret infront of the table - if (tinymce.isGecko) { - ed.onKeyDown.add(function(ed, e) { - var rng, table, dom = ed.dom; - - // On gecko it's not possible to place the caret before a table - if (e.keyCode == 37 || e.keyCode == 38) { - rng = ed.selection.getRng(); - table = dom.getParent(rng.startContainer, 'table'); - - if (table && ed.getBody().firstChild == table) { - if (isAtStart(rng, table)) { - rng = dom.createRng(); - - rng.setStartBefore(table); - rng.setEndBefore(table); - - ed.selection.setRng(rng); - - e.preventDefault(); - } - } - } - }); - } - - ed.onKeyUp.add(fixTableCaretPos); - ed.onSetContent.add(fixTableCaretPos); - ed.onVisualAid.add(fixTableCaretPos); - - ed.onPreProcess.add(function(ed, o) { - var last = o.node.lastChild; - - if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") { - ed.dom.remove(last); - } - }); - - - /** - * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line - * - * Removed: Since the new enter logic seems to fix this one. - */ - /* - if (tinymce.isGecko) { - ed.onKeyDown.add(function(ed, e) { - if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) { - var node = ed.selection.getRng().startContainer; - var tableCell = dom.getParent(node, 'td,th'); - if (tableCell) { - var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF"); - dom.insertAfter(zeroSizedNbsp, node); - } - } - }); - } - */ - - fixTableCaretPos(); - ed.startContent = ed.getContent({format : 'raw'}); - }); - - // Register action commands - each({ - mceTableSplitCells : function(grid) { - grid.split(); - }, - - mceTableMergeCells : function(grid) { - var rowSpan, colSpan, cell; - - cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); - if (cell) { - rowSpan = cell.rowSpan; - colSpan = cell.colSpan; - } - - if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { - winMan.open({ - url : url + '/merge_cells.htm', - width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), - height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), - inline : 1 - }, { - rows : rowSpan, - cols : colSpan, - onaction : function(data) { - grid.merge(cell, data.cols, data.rows); - }, - plugin_url : url - }); - } else - grid.merge(); - }, - - mceTableInsertRowBefore : function(grid) { - grid.insertRow(true); - }, - - mceTableInsertRowAfter : function(grid) { - grid.insertRow(); - }, - - mceTableInsertColBefore : function(grid) { - grid.insertCol(true); - }, - - mceTableInsertColAfter : function(grid) { - grid.insertCol(); - }, - - mceTableDeleteCol : function(grid) { - grid.deleteCols(); - }, - - mceTableDeleteRow : function(grid) { - grid.deleteRows(); - }, - - mceTableCutRow : function(grid) { - clipboardRows = grid.cutRows(); - }, - - mceTableCopyRow : function(grid) { - clipboardRows = grid.copyRows(); - }, - - mceTablePasteRowBefore : function(grid) { - grid.pasteRows(clipboardRows, true); - }, - - mceTablePasteRowAfter : function(grid) { - grid.pasteRows(clipboardRows); - }, - - mceTableDelete : function(grid) { - grid.deleteTable(); - } - }, function(func, name) { - ed.addCommand(name, function() { - var grid = createTableGrid(); - - if (grid) { - func(grid); - ed.execCommand('mceRepaint'); - cleanup(); - } - }); - }); - - // Register dialog commands - each({ - mceInsertTable : function(val) { - winMan.open({ - url : url + '/table.htm', - width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), - height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - action : val ? val.action : 0 - }); - }, - - mceTableRowProps : function() { - winMan.open({ - url : url + '/row.htm', - width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }, - - mceTableCellProps : function() { - winMan.open({ - url : url + '/cell.htm', - width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - } - }, function(func, name) { - ed.addCommand(name, function(ui, val) { - func(val); - }); - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); -})(tinymce); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var each = tinymce.each; + + // Checks if the selection/caret is at the start of the specified block element + function isAtStart(rng, par) { + var doc = par.ownerDocument, rng2 = doc.createRange(), elm; + + rng2.setStartBefore(par); + rng2.setEnd(rng.endContainer, rng.endOffset); + + elm = doc.createElement('body'); + elm.appendChild(rng2.cloneContents()); + + // Check for text characters of other elements that should be treated as content + return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; + }; + + function getSpanVal(td, name) { + return parseInt(td.getAttribute(name) || 1); + } + + /** + * Table Grid class. + */ + function TableGrid(table, dom, selection) { + var grid, startPos, endPos, selectedCell; + + buildGrid(); + selectedCell = dom.getParent(selection.getStart(), 'th,td'); + if (selectedCell) { + startPos = getPos(selectedCell); + endPos = findEndPos(); + selectedCell = getCell(startPos.x, startPos.y); + } + + function cloneNode(node, children) { + node = node.cloneNode(children); + node.removeAttribute('id'); + + return node; + } + + function buildGrid() { + var startY = 0; + + grid = []; + + each(['thead', 'tbody', 'tfoot'], function(part) { + var rows = dom.select('> ' + part + ' tr', table); + + each(rows, function(tr, y) { + y += startY; + + each(dom.select('> td, > th', tr), function(td, x) { + var x2, y2, rowspan, colspan; + + // Skip over existing cells produced by rowspan + if (grid[y]) { + while (grid[y][x]) + x++; + } + + // Get col/rowspan from cell + rowspan = getSpanVal(td, 'rowspan'); + colspan = getSpanVal(td, 'colspan'); + + // Fill out rowspan/colspan right and down + for (y2 = y; y2 < y + rowspan; y2++) { + if (!grid[y2]) + grid[y2] = []; + + for (x2 = x; x2 < x + colspan; x2++) { + grid[y2][x2] = { + part : part, + real : y2 == y && x2 == x, + elm : td, + rowspan : rowspan, + colspan : colspan + }; + } + } + }); + }); + + startY += rows.length; + }); + }; + + function getCell(x, y) { + var row; + + row = grid[y]; + if (row) + return row[x]; + }; + + function setSpanVal(td, name, val) { + if (td) { + val = parseInt(val); + + if (val === 1) + td.removeAttribute(name, 1); + else + td.setAttribute(name, val, 1); + } + } + + function isCellSelected(cell) { + return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); + }; + + function getSelectedRows() { + var rows = []; + + each(table.rows, function(row) { + each(row.cells, function(cell) { + if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { + rows.push(row); + return false; + } + }); + }); + + return rows; + }; + + function deleteTable() { + var rng = dom.createRng(); + + rng.setStartAfter(table); + rng.setEndAfter(table); + + selection.setRng(rng); + + dom.remove(table); + }; + + function cloneCell(cell) { + var formatNode; + + // Clone formats + tinymce.walk(cell, function(node) { + var curNode; + + if (node.nodeType == 3) { + each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { + node = cloneNode(node, false); + + if (!formatNode) + formatNode = curNode = node; + else if (curNode) + curNode.appendChild(node); + + curNode = node; + }); + + // Add something to the inner node + if (curNode) + curNode.innerHTML = tinymce.isIE ? ' ' : '
      '; + + return false; + } + }, 'childNodes'); + + cell = cloneNode(cell, false); + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + if (formatNode) { + cell.appendChild(formatNode); + } else { + if (!tinymce.isIE) + cell.innerHTML = '
      '; + } + + return cell; + }; + + function cleanup() { + var rng = dom.createRng(); + + // Empty rows + each(dom.select('tr', table), function(tr) { + if (tr.cells.length == 0) + dom.remove(tr); + }); + + // Empty table + if (dom.select('tr', table).length == 0) { + rng.setStartAfter(table); + rng.setEndAfter(table); + selection.setRng(rng); + dom.remove(table); + return; + } + + // Empty header/body/footer + each(dom.select('thead,tbody,tfoot', table), function(part) { + if (part.rows.length == 0) + dom.remove(part); + }); + + // Restore selection to start position if it still exists + buildGrid(); + + // Restore the selection to the closest table position + row = grid[Math.min(grid.length - 1, startPos.y)]; + if (row) { + selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); + selection.collapse(true); + } + }; + + function fillLeftDown(x, y, rows, cols) { + var tr, x2, r, c, cell; + + tr = grid[y][x].elm.parentNode; + for (r = 1; r <= rows; r++) { + tr = dom.getNext(tr, 'tr'); + + if (tr) { + // Loop left to find real cell + for (x2 = x; x2 >= 0; x2--) { + cell = grid[y + r][x2].elm; + + if (cell.parentNode == tr) { + // Append clones after + for (c = 1; c <= cols; c++) + dom.insertAfter(cloneCell(cell), cell); + + break; + } + } + + if (x2 == -1) { + // Insert nodes before first cell + for (c = 1; c <= cols; c++) + tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); + } + } + } + }; + + function split() { + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan, newCell, i; + + if (isCellSelected(cell)) { + cell = cell.elm; + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan > 1 || rowSpan > 1) { + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + // Insert cells right + for (i = 0; i < colSpan - 1; i++) + dom.insertAfter(cloneCell(cell), cell); + + fillLeftDown(x, y, rowSpan - 1, colSpan); + } + } + }); + }); + }; + + function merge(cell, cols, rows) { + var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; + + // Use specified cell and cols/rows + if (cell) { + pos = getPos(cell); + startX = pos.x; + startY = pos.y; + endX = startX + (cols - 1); + endY = startY + (rows - 1); + } else { + startPos = endPos = null; + + // Calculate start/end pos by checking for selected cells in grid works better with context menu + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + if (!startPos) { + startPos = {x: x, y: y}; + } + + endPos = {x: x, y: y}; + } + }); + }); + + // Use selection + startX = startPos.x; + startY = startPos.y; + endX = endPos.x; + endY = endPos.y; + } + + // Find start/end cells + startCell = getCell(startX, startY); + endCell = getCell(endX, endY); + + // Check if the cells exists and if they are of the same part for example tbody = tbody + if (startCell && endCell && startCell.part == endCell.part) { + // Split and rebuild grid + split(); + buildGrid(); + + // Set row/col span to start cell + startCell = getCell(startX, startY).elm; + setSpanVal(startCell, 'colSpan', (endX - startX) + 1); + setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); + + // Remove other cells and add it's contents to the start cell + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + if (!grid[y] || !grid[y][x]) + continue; + + cell = grid[y][x].elm; + + if (cell != startCell) { + // Move children to startCell + children = tinymce.grep(cell.childNodes); + each(children, function(node) { + startCell.appendChild(node); + }); + + // Remove bogus nodes if there is children in the target cell + if (children.length) { + children = tinymce.grep(startCell.childNodes); + count = 0; + each(children, function(node) { + if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) + startCell.removeChild(node); + }); + } + + // Remove cell + dom.remove(cell); + } + } + } + + // Remove empty rows etc and restore caret location + cleanup(); + } + }; + + function insertRow(before) { + var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; + + // Find first/last row + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + cell = cell.elm; + rowElm = cell.parentNode; + newRow = cloneNode(rowElm, false); + posY = y; + + if (before) + return false; + } + }); + + if (before) + return !posY; + }); + + for (x = 0; x < grid[0].length; x++) { + // Cell not found could be because of an invalid table structure + if (!grid[posY][x]) + continue; + + cell = grid[posY][x].elm; + + if (cell != lastCell) { + if (!before) { + rowSpan = getSpanVal(cell, 'rowspan'); + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan + 1); + continue; + } + } else { + // Check if cell above can be expanded + if (posY > 0 && grid[posY - 1][x]) { + otherCell = grid[posY - 1][x].elm; + rowSpan = getSpanVal(otherCell, 'rowSpan'); + if (rowSpan > 1) { + setSpanVal(otherCell, 'rowSpan', rowSpan + 1); + continue; + } + } + } + + // Insert new cell into new row + newCell = cloneCell(cell); + setSpanVal(newCell, 'colSpan', cell.colSpan); + + newRow.appendChild(newCell); + + lastCell = cell; + } + } + + if (newRow.hasChildNodes()) { + if (!before) + dom.insertAfter(newRow, rowElm); + else + rowElm.parentNode.insertBefore(newRow, rowElm); + } + }; + + function insertCol(before) { + var posX, lastCell; + + // Find first/last column + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + posX = x; + + if (before) + return false; + } + }); + + if (before) + return !posX; + }); + + each(grid, function(row, y) { + var cell, rowSpan, colSpan; + + if (!row[posX]) + return; + + cell = row[posX].elm; + if (cell != lastCell) { + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan == 1) { + if (!before) { + dom.insertAfter(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } else { + cell.parentNode.insertBefore(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } + } else + setSpanVal(cell, 'colSpan', cell.colSpan + 1); + + lastCell = cell; + } + }); + }; + + function deleteCols() { + var cols = []; + + // Get selected column indexes + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { + each(grid, function(row) { + var cell = row[x].elm, colSpan; + + colSpan = getSpanVal(cell, 'colSpan'); + + if (colSpan > 1) + setSpanVal(cell, 'colSpan', colSpan - 1); + else + dom.remove(cell); + }); + + cols.push(x); + } + }); + }); + + cleanup(); + }; + + function deleteRows() { + var rows; + + function deleteRow(tr) { + var nextTr, pos, lastCell; + + nextTr = dom.getNext(tr, 'tr'); + + // Move down row spanned cells + each(tr.cells, function(cell) { + var rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan - 1); + pos = getPos(cell); + fillLeftDown(pos.x, pos.y, 1, 1); + } + }); + + // Delete cells + pos = getPos(tr.cells[0]); + each(grid[pos.y], function(cell) { + var rowSpan; + + cell = cell.elm; + + if (cell != lastCell) { + rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan <= 1) + dom.remove(cell); + else + setSpanVal(cell, 'rowSpan', rowSpan - 1); + + lastCell = cell; + } + }); + }; + + // Get selected rows and move selection out of scope + rows = getSelectedRows(); + + // Delete all selected rows + each(rows.reverse(), function(tr) { + deleteRow(tr); + }); + + cleanup(); + }; + + function cutRows() { + var rows = getSelectedRows(); + + dom.remove(rows); + cleanup(); + + return rows; + }; + + function copyRows() { + var rows = getSelectedRows(); + + each(rows, function(row, i) { + rows[i] = cloneNode(row, true); + }); + + return rows; + }; + + function pasteRows(rows, before) { + var selectedRows = getSelectedRows(), + targetRow = selectedRows[before ? 0 : selectedRows.length - 1], + targetCellCount = targetRow.cells.length; + + // Calc target cell count + each(grid, function(row) { + var match; + + targetCellCount = 0; + each(row, function(cell, x) { + if (cell.real) + targetCellCount += cell.colspan; + + if (cell.elm.parentNode == targetRow) + match = 1; + }); + + if (match) + return false; + }); + + if (!before) + rows.reverse(); + + each(rows, function(row) { + var cellCount = row.cells.length, cell; + + // Remove col/rowspans + for (i = 0; i < cellCount; i++) { + cell = row.cells[i]; + setSpanVal(cell, 'colSpan', 1); + setSpanVal(cell, 'rowSpan', 1); + } + + // Needs more cells + for (i = cellCount; i < targetCellCount; i++) + row.appendChild(cloneCell(row.cells[cellCount - 1])); + + // Needs less cells + for (i = targetCellCount; i < cellCount; i++) + dom.remove(row.cells[i]); + + // Add before/after + if (before) + targetRow.parentNode.insertBefore(row, targetRow); + else + dom.insertAfter(row, targetRow); + }); + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + }; + + function getPos(target) { + var pos; + + each(grid, function(row, y) { + each(row, function(cell, x) { + if (cell.elm == target) { + pos = {x : x, y : y}; + return false; + } + }); + + return !pos; + }); + + return pos; + }; + + function setStartCell(cell) { + startPos = getPos(cell); + }; + + function findEndPos() { + var pos, maxX, maxY; + + maxX = maxY = 0; + + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan; + + if (isCellSelected(cell)) { + cell = grid[y][x]; + + if (x > maxX) + maxX = x; + + if (y > maxY) + maxY = y; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + }); + }); + + return {x : maxX, y : maxY}; + }; + + function setEndCell(cell) { + var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; + + endPos = getPos(cell); + + if (startPos && endPos) { + // Get start/end positions + startX = Math.min(startPos.x, endPos.x); + startY = Math.min(startPos.y, endPos.y); + endX = Math.max(startPos.x, endPos.x); + endY = Math.max(startPos.y, endPos.y); + + // Expand end positon to include spans + maxX = endX; + maxY = endY; + + // Expand startX + for (y = startY; y <= maxY; y++) { + cell = grid[y][startX]; + + if (!cell.real) { + if (startX - (cell.colspan - 1) < startX) + startX -= cell.colspan - 1; + } + } + + // Expand startY + for (x = startX; x <= maxX; x++) { + cell = grid[startY][x]; + + if (!cell.real) { + if (startY - (cell.rowspan - 1) < startY) + startY -= cell.rowspan - 1; + } + } + + // Find max X, Y + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + cell = grid[y][x]; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + } + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + + // Add new selection + for (y = startY; y <= maxY; y++) { + for (x = startX; x <= maxX; x++) { + if (grid[y][x]) + dom.addClass(grid[y][x].elm, 'mceSelected'); + } + } + } + }; + + // Expose to public + tinymce.extend(this, { + deleteTable : deleteTable, + split : split, + merge : merge, + insertRow : insertRow, + insertCol : insertCol, + deleteCols : deleteCols, + deleteRows : deleteRows, + cutRows : cutRows, + copyRows : copyRows, + pasteRows : pasteRows, + getPos : getPos, + setStartCell : setStartCell, + setEndCell : setEndCell + }); + }; + + tinymce.create('tinymce.plugins.TablePlugin', { + init : function(ed, url) { + var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload + + function createTableGrid(node) { + var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); + + if (tblElm) + return new TableGrid(tblElm, ed.dom, selection); + }; + + function cleanup() { + // Restore selection possibilities + ed.getBody().style.webkitUserSelect = ''; + + if (hasCellSelection) { + ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + hasCellSelection = false; + } + }; + + // Register buttons + each([ + ['table', 'table.desc', 'mceInsertTable', true], + ['delete_table', 'table.del', 'mceTableDelete'], + ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], + ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], + ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], + ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], + ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], + ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], + ['row_props', 'table.row_desc', 'mceTableRowProps', true], + ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], + ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], + ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] + ], function(c) { + ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); + }); + + // Select whole table is a table border is clicked + if (!tinymce.isIE) { + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'TABLE') { + ed.selection.select(e); + ed.nodeChanged(); + } + }); + } + + ed.onPreProcess.add(function(ed, args) { + var nodes, i, node, dom = ed.dom, value; + + nodes = dom.select('table', args.node); + i = nodes.length; + while (i--) { + node = nodes[i]; + dom.setAttrib(node, 'data-mce-style', ''); + + if ((value = dom.getAttrib(node, 'width'))) { + dom.setStyle(node, 'width', value); + dom.setAttrib(node, 'width', ''); + } + + if ((value = dom.getAttrib(node, 'height'))) { + dom.setStyle(node, 'height', value); + dom.setAttrib(node, 'height', ''); + } + } + }); + + // Handle node change updates + ed.onNodeChange.add(function(ed, cm, n) { + var p; + + n = ed.selection.getStart(); + p = ed.dom.getParent(n, 'td,th,caption'); + cm.setActive('table', n.nodeName === 'TABLE' || !!p); + + // Disable table tools if we are in caption + if (p && p.nodeName === 'CAPTION') + p = 0; + + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_col', !p); + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_row', !p); + cm.setDisabled('col_after', !p); + cm.setDisabled('col_before', !p); + cm.setDisabled('row_after', !p); + cm.setDisabled('row_before', !p); + cm.setDisabled('row_props', !p); + cm.setDisabled('cell_props', !p); + cm.setDisabled('split_cells', !p); + cm.setDisabled('merge_cells', !p); + }); + + ed.onInit.add(function(ed) { + var startTable, startCell, dom = ed.dom, tableGrid; + + winMan = ed.windowManager; + + // Add cell selection logic + ed.onMouseDown.add(function(ed, e) { + if (e.button != 2) { + cleanup(); + + startCell = dom.getParent(e.target, 'td,th'); + startTable = dom.getParent(startCell, 'table'); + } + }); + + dom.bind(ed.getDoc(), 'mouseover', function(e) { + var sel, table, target = e.target; + + if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { + table = dom.getParent(target, 'table'); + if (table == startTable) { + if (!tableGrid) { + tableGrid = createTableGrid(table); + tableGrid.setStartCell(startCell); + + ed.getBody().style.webkitUserSelect = 'none'; + } + + tableGrid.setEndCell(target); + hasCellSelection = true; + } + + // Remove current selection + sel = ed.selection.getSel(); + + try { + if (sel.removeAllRanges) + sel.removeAllRanges(); + else + sel.empty(); + } catch (ex) { + // IE9 might throw errors here + } + + e.preventDefault(); + } + }); + + ed.onMouseUp.add(function(ed, e) { + var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; + + // Move selection to startCell + if (startCell) { + if (tableGrid) + ed.getBody().style.webkitUserSelect = ''; + + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + } + + // Try to expand text selection as much as we can only Gecko supports cell selection + selectedCells = dom.select('td.mceSelected,th.mceSelected'); + if (selectedCells.length > 0) { + rng = dom.createRng(); + node = selectedCells[0]; + endNode = selectedCells[selectedCells.length - 1]; + rng.setStartBefore(node); + rng.setEndAfter(node); + + setPoint(node, 1); + walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); + + do { + if (node.nodeName == 'TD' || node.nodeName == 'TH') { + if (!dom.hasClass(node, 'mceSelected')) + break; + + lastNode = node; + } + } while (node = walker.next()); + + setPoint(lastNode); + + sel.setRng(rng); + } + + ed.nodeChanged(); + startCell = tableGrid = startTable = null; + } + }); + + ed.onKeyUp.add(function(ed, e) { + cleanup(); + }); + + ed.onKeyDown.add(function (ed, e) { + fixTableCellSelection(ed); + }); + + ed.onMouseDown.add(function (ed, e) { + if (e.button != 2) { + fixTableCellSelection(ed); + } + }); + function tableCellSelected(ed, rng, n, currentCell) { + // The decision of when a table cell is selected is somewhat involved. The fact that this code is + // required is actually a pointer to the root cause of this bug. A cell is selected when the start + // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) + // or the parent of the table (in the case of the selection containing the last cell of a table). + var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), + tableParent, allOfCellSelected, tableCellSelection; + if (table) + tableParent = table.parentNode; + allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && + rng.startOffset == 0 && + rng.endOffset == 0 && + currentCell && + (n.nodeName=="TR" || n==tableParent); + tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; + return allOfCellSelected || tableCellSelection; + // return false; + } + + // this nasty hack is here to work around some WebKit selection bugs. + function fixTableCellSelection(ed) { + if (!tinymce.isWebKit) + return; + + var rng = ed.selection.getRng(); + var n = ed.selection.getNode(); + var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); + + if (!tableCellSelected(ed, rng, n, currentCell)) + return; + if (!currentCell) { + currentCell=n; + } + + // Get the very last node inside the table cell + var end = currentCell.lastChild; + while (end.lastChild) + end = end.lastChild; + + // Select the entire table cell. Nothing outside of the table cell should be selected. + rng.setEnd(end, end.nodeValue.length); + ed.selection.setRng(rng); + } + ed.plugins.table.fixTableCellSelection=fixTableCellSelection; + + // Add context menu + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { + var sm, se = ed.selection, el = se.getNode() || ed.getBody(); + + if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { + m.removeAll(); + + if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + m.addSeparator(); + } + + if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + m.addSeparator(); + } + + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); + m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); + m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); + m.addSeparator(); + + // Cell menu + sm = m.addMenu({title : 'table.cell'}); + sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); + sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); + sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); + + // Row menu + sm = m.addMenu({title : 'table.row'}); + sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); + sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); + sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); + sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); + sm.addSeparator(); + sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); + sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); + sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); + sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); + + // Column menu + sm = m.addMenu({title : 'table.col'}); + sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); + sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); + sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); + } else + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); + }); + } + + // Fix to allow navigating up and down in a table in WebKit browsers. + if (tinymce.isWebKit) { + function moveSelection(ed, e) { + var VK = tinymce.VK; + var key = e.keyCode; + + function handle(upBool, sourceNode, event) { + var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; + var currentRow = ed.dom.getParent(sourceNode, 'tr'); + var siblingRow = currentRow[siblingDirection]; + + if (siblingRow) { + moveCursorToRow(ed, sourceNode, siblingRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } else { + var tableNode = ed.dom.getParent(currentRow, 'table'); + var middleNode = currentRow.parentNode; + var parentNodeName = middleNode.nodeName.toLowerCase(); + if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { + var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); + if (targetParent !== null) { + return moveToRowInTarget(upBool, targetParent, sourceNode, event); + } + } + return escapeTable(upBool, currentRow, siblingDirection, tableNode, event); + } + } + + function getTargetParent(upBool, topNode, secondNode, nodeName) { + var tbodies = ed.dom.select('>' + nodeName, topNode); + var position = tbodies.indexOf(secondNode); + if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { + return getFirstHeadOrFoot(upBool, topNode); + } else if (position === -1) { + var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; + return tbodies[topOrBottom]; + } else { + return tbodies[position + (upBool ? -1 : 1)]; + } + } + + function getFirstHeadOrFoot(upBool, parent) { + var tagName = upBool ? 'thead' : 'tfoot'; + var headOrFoot = ed.dom.select('>' + tagName, parent); + return headOrFoot.length !== 0 ? headOrFoot[0] : null; + } + + function moveToRowInTarget(upBool, targetParent, sourceNode, event) { + var targetRow = getChildForDirection(targetParent, upBool); + targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } + + function escapeTable(upBool, currentRow, siblingDirection, table, event) { + var tableSibling = table[siblingDirection]; + if (tableSibling) { + moveCursorToStartOfElement(tableSibling); + return true; + } else { + var parentCell = ed.dom.getParent(table, 'td,th'); + if (parentCell) { + return handle(upBool, parentCell, event); + } else { + var backUpSibling = getChildForDirection(currentRow, !upBool); + moveCursorToStartOfElement(backUpSibling); + return tinymce.dom.Event.cancel(event); + } + } + } + + function getChildForDirection(parent, up) { + var child = parent && parent[up ? 'lastChild' : 'firstChild']; + // BR is not a valid table child to return in this case we return the table cell + return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child; + } + + function moveCursorToStartOfElement(n) { + ed.selection.setCursorLocation(n, 0); + } + + function isVerticalMovement() { + return key == VK.UP || key == VK.DOWN; + } + + function isInTable(ed) { + var node = ed.selection.getNode(); + var currentRow = ed.dom.getParent(node, 'tr'); + return currentRow !== null; + } + + function columnIndex(column) { + var colIndex = 0; + var c = column; + while (c.previousSibling) { + c = c.previousSibling; + colIndex = colIndex + getSpanVal(c, "colspan"); + } + return colIndex; + } + + function findColumn(rowElement, columnIndex) { + var c = 0; + var r = 0; + each(rowElement.children, function(cell, i) { + c = c + getSpanVal(cell, "colspan"); + r = i; + if (c > columnIndex) + return false; + }); + return r; + } + + function moveCursorToRow(ed, node, row, upBool) { + var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th')); + var tgtColumnIndex = findColumn(row, srcColumnIndex); + var tgtNode = row.childNodes[tgtColumnIndex]; + var rowCellTarget = getChildForDirection(tgtNode, upBool); + moveCursorToStartOfElement(rowCellTarget || tgtNode); + } + + function shouldFixCaret(preBrowserNode) { + var newNode = ed.selection.getNode(); + var newParent = ed.dom.getParent(newNode, 'td,th'); + var oldParent = ed.dom.getParent(preBrowserNode, 'td,th'); + return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent) + } + + function checkSameParentTable(nodeOne, NodeTwo) { + return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE'); + } + + if (isVerticalMovement() && isInTable(ed)) { + var preBrowserNode = ed.selection.getNode(); + setTimeout(function() { + if (shouldFixCaret(preBrowserNode)) { + handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); + } + }, 0); + } + } + + ed.onKeyDown.add(moveSelection); + } + + // Fixes an issue on Gecko where it's impossible to place the caret behind a table + // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled + function fixTableCaretPos() { + var last; + + // Skip empty text nodes form the end + for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; + + if (last && last.nodeName == 'TABLE') { + if (ed.settings.forced_root_block) + ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '
      '); + else + ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'}); + } + }; + + // Fixes an bug where it's impossible to place the caret before a table in Gecko + // this fix solves it by detecting when the caret is at the beginning of such a table + // and then manually moves the caret infront of the table + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + var rng, table, dom = ed.dom; + + // On gecko it's not possible to place the caret before a table + if (e.keyCode == 37 || e.keyCode == 38) { + rng = ed.selection.getRng(); + table = dom.getParent(rng.startContainer, 'table'); + + if (table && ed.getBody().firstChild == table) { + if (isAtStart(rng, table)) { + rng = dom.createRng(); + + rng.setStartBefore(table); + rng.setEndBefore(table); + + ed.selection.setRng(rng); + + e.preventDefault(); + } + } + } + }); + } + + ed.onKeyUp.add(fixTableCaretPos); + ed.onSetContent.add(fixTableCaretPos); + ed.onVisualAid.add(fixTableCaretPos); + + ed.onPreProcess.add(function(ed, o) { + var last = o.node.lastChild; + + if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") { + ed.dom.remove(last); + } + }); + + + /** + * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line + * + * Removed: Since the new enter logic seems to fix this one. + */ + /* + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) { + var node = ed.selection.getRng().startContainer; + var tableCell = dom.getParent(node, 'td,th'); + if (tableCell) { + var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF"); + dom.insertAfter(zeroSizedNbsp, node); + } + } + }); + } + */ + + fixTableCaretPos(); + ed.startContent = ed.getContent({format : 'raw'}); + }); + + // Register action commands + each({ + mceTableSplitCells : function(grid) { + grid.split(); + }, + + mceTableMergeCells : function(grid) { + var rowSpan, colSpan, cell; + + cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); + if (cell) { + rowSpan = cell.rowSpan; + colSpan = cell.colSpan; + } + + if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { + winMan.open({ + url : url + '/merge_cells.htm', + width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), + height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), + inline : 1 + }, { + rows : rowSpan, + cols : colSpan, + onaction : function(data) { + grid.merge(cell, data.cols, data.rows); + }, + plugin_url : url + }); + } else + grid.merge(); + }, + + mceTableInsertRowBefore : function(grid) { + grid.insertRow(true); + }, + + mceTableInsertRowAfter : function(grid) { + grid.insertRow(); + }, + + mceTableInsertColBefore : function(grid) { + grid.insertCol(true); + }, + + mceTableInsertColAfter : function(grid) { + grid.insertCol(); + }, + + mceTableDeleteCol : function(grid) { + grid.deleteCols(); + }, + + mceTableDeleteRow : function(grid) { + grid.deleteRows(); + }, + + mceTableCutRow : function(grid) { + clipboardRows = grid.cutRows(); + }, + + mceTableCopyRow : function(grid) { + clipboardRows = grid.copyRows(); + }, + + mceTablePasteRowBefore : function(grid) { + grid.pasteRows(clipboardRows, true); + }, + + mceTablePasteRowAfter : function(grid) { + grid.pasteRows(clipboardRows); + }, + + mceTableDelete : function(grid) { + grid.deleteTable(); + } + }, function(func, name) { + ed.addCommand(name, function() { + var grid = createTableGrid(); + + if (grid) { + func(grid); + ed.execCommand('mceRepaint'); + cleanup(); + } + }); + }); + + // Register dialog commands + each({ + mceInsertTable : function(val) { + winMan.open({ + url : url + '/table.htm', + width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), + height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + action : val ? val.action : 0 + }); + }, + + mceTableRowProps : function() { + winMan.open({ + url : url + '/row.htm', + width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }, + + mceTableCellProps : function() { + winMan.open({ + url : url + '/cell.htm', + width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + } + }, function(func, name) { + ed.addCommand(name, function(ui, val) { + func(val); + }); + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); +})(tinymce); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/js/cell.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/js/cell.js index 02ecf22..f0356f7 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/table/js/cell.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/table/js/cell.js @@ -1,319 +1,319 @@ -tinyMCEPopup.requireLangPack(); - -var ed; - -function init() { - ed = tinyMCEPopup.editor; - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') - - var inst = ed; - var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); - var formObj = document.forms[0]; - var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); - - // Get table cell data - var celltype = tdElm.nodeName.toLowerCase(); - var align = ed.dom.getAttrib(tdElm, 'align'); - var valign = ed.dom.getAttrib(tdElm, 'valign'); - var width = trimSize(getStyle(tdElm, 'width', 'width')); - var height = trimSize(getStyle(tdElm, 'height', 'height')); - var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); - var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); - var className = ed.dom.getAttrib(tdElm, 'class'); - var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - var id = ed.dom.getAttrib(tdElm, 'id'); - var lang = ed.dom.getAttrib(tdElm, 'lang'); - var dir = ed.dom.getAttrib(tdElm, 'dir'); - var scope = ed.dom.getAttrib(tdElm, 'scope'); - - // Setup form - addClassesToList('class', 'table_cell_styles'); - TinyMCE_EditableSelects.init(); - - if (!ed.dom.hasClass(tdElm, 'mceSelected')) { - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.backgroundimage.value = backgroundimage; - formObj.width.value = width; - formObj.height.value = height; - formObj.id.value = id; - formObj.lang.value = lang; - formObj.style.value = ed.dom.serializeStyle(st); - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'valign', valign); - selectByValue(formObj, 'class', className, true, true); - selectByValue(formObj, 'celltype', celltype); - selectByValue(formObj, 'dir', dir); - selectByValue(formObj, 'scope', scope); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - } else - tinyMCEPopup.dom.hide('action'); -} - -function updateAction() { - var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; - - if (!AutoValidator.validate(formObj)) { - tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); - return false; - } - - tinyMCEPopup.restoreSelection(); - el = ed.selection.getStart(); - tdElm = ed.dom.getParent(el, "td,th"); - trElm = ed.dom.getParent(el, "tr"); - tableElm = ed.dom.getParent(el, "table"); - - // Cell is selected - if (ed.dom.hasClass(tdElm, 'mceSelected')) { - // Update all selected sells - tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { - updateCell(td); - }); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (getSelectValue(formObj, 'action')) { - case "cell": - var celltype = getSelectValue(formObj, 'celltype'); - var scope = getSelectValue(formObj, 'scope'); - - function doUpdate(s) { - if (s) { - updateCell(tdElm); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - } - }; - - if (ed.getParam("accessibility_warnings", 1)) { - if (celltype == "th" && scope == "") - tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); - else - doUpdate(1); - - return; - } - - updateCell(tdElm); - break; - - case "row": - var cell = trElm.firstChild; - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - cell = updateCell(cell, true); - } while ((cell = nextCell(cell)) != null); - - break; - - case "col": - var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - if (cell == tdElm) - break; - col += cell.getAttribute("colspan")?cell.getAttribute("colspan"):1; - } while ((cell = nextCell(cell)) != null); - - for (var i=0; i 0) { - tinymce.each(tableElm.rows, function(tr) { - var i; - - for (i = 0; i < tr.cells.length; i++) { - if (dom.hasClass(tr.cells[i], 'mceSelected')) { - updateRow(tr, true); - return; - } - } - }); - - inst.addVisual(); - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (action) { - case "row": - updateRow(trElm); - break; - - case "all": - var rows = tableElm.getElementsByTagName("tr"); - - for (var i=0; i 0) { + tinymce.each(tableElm.rows, function(tr) { + var i; + + for (i = 0; i < tr.cells.length; i++) { + if (dom.hasClass(tr.cells[i], 'mceSelected')) { + updateRow(tr, true); + return; + } + } + }); + + inst.addVisual(); + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (action) { + case "row": + updateRow(trElm); + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); - return false; - } else if (rowLimit && rows > rowLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); - return false; - } else if (cellLimit && cols * rows > cellLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); - return false; - } - - // Update table - if (action == "update") { - dom.setAttrib(elm, 'cellPadding', cellpadding, true); - dom.setAttrib(elm, 'cellSpacing', cellspacing, true); - - if (!isCssSize(border)) { - dom.setAttrib(elm, 'border', border); - } else { - dom.setAttrib(elm, 'border', ''); - } - - if (border == '') { - dom.setStyle(elm, 'border-width', ''); - dom.setStyle(elm, 'border', ''); - dom.setAttrib(elm, 'border', ''); - } - - dom.setAttrib(elm, 'align', align); - dom.setAttrib(elm, 'frame', frame); - dom.setAttrib(elm, 'rules', rules); - dom.setAttrib(elm, 'class', className); - dom.setAttrib(elm, 'style', style); - dom.setAttrib(elm, 'id', id); - dom.setAttrib(elm, 'summary', summary); - dom.setAttrib(elm, 'dir', dir); - dom.setAttrib(elm, 'lang', lang); - - capEl = inst.dom.select('caption', elm)[0]; - - if (capEl && !caption) - capEl.parentNode.removeChild(capEl); - - if (!capEl && caption) { - capEl = elm.ownerDocument.createElement('caption'); - - if (!tinymce.isIE) - capEl.innerHTML = '
      '; - - elm.insertBefore(capEl, elm.firstChild); - } - - if (width && inst.settings.inline_styles) { - dom.setStyle(elm, 'width', width); - dom.setAttrib(elm, 'width', ''); - } else { - dom.setAttrib(elm, 'width', width, true); - dom.setStyle(elm, 'width', ''); - } - - // Remove these since they are not valid XHTML - dom.setAttrib(elm, 'borderColor', ''); - dom.setAttrib(elm, 'bgColor', ''); - dom.setAttrib(elm, 'background', ''); - - if (height && inst.settings.inline_styles) { - dom.setStyle(elm, 'height', height); - dom.setAttrib(elm, 'height', ''); - } else { - dom.setAttrib(elm, 'height', height, true); - dom.setStyle(elm, 'height', ''); - } - - if (background != '') - elm.style.backgroundImage = "url('" + background + "')"; - else - elm.style.backgroundImage = ''; - -/* if (tinyMCEPopup.getParam("inline_styles")) { - if (width != '') - elm.style.width = getCSSSize(width); - }*/ - - if (bordercolor != "") { - elm.style.borderColor = bordercolor; - elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; - elm.style.borderWidth = cssSize(border); - } else - elm.style.borderColor = ''; - - elm.style.backgroundColor = bgcolor; - elm.style.height = getCSSSize(height); - - inst.addVisual(); - - // Fix for stange MSIE align bug - //elm.outerHTML = elm.outerHTML; - - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); - - // Repaint if dimensions changed - if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) - inst.execCommand('mceRepaint'); - - tinyMCEPopup.close(); - return true; - } - - // Create new table - html += ''); - - tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { - if (patt) - patt += ','; - - patt += n + ' ._mce_marker'; - }); - - tinymce.each(inst.dom.select(patt), function(n) { - inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); - }); - - dom.setOuterHTML(dom.select('br._mce_marker')[0], html); - } else - inst.execCommand('mceInsertContent', false, html); - - tinymce.each(dom.select('table[data-mce-new]'), function(node) { - var tdorth = dom.select('td,th', node); - - // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document - if (tinymce.isIE && node.nextSibling == null) { - if (inst.settings.forced_root_block) - dom.insertAfter(dom.create(inst.settings.forced_root_block), node); - else - dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node); - } - - try { - // IE9 might fail to do this selection - inst.selection.setCursorLocation(tdorth[0], 0); - } catch (ex) { - // Ignore - } - - dom.setAttrib(node, 'data-mce-new', ''); - }); - - inst.addVisual(); - inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); - - tinyMCEPopup.close(); -} - -function makeAttrib(attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib]; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - if (value == "") - return ""; - - // XML encode it - value = value.replace(/&/g, '&'); - value = value.replace(/\"/g, '"'); - value = value.replace(//g, '>'); - - return ' ' + attrib + '="' + value + '"'; -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); - var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; - var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; - var inst = tinyMCEPopup.editor, dom = inst.dom; - var formObj = document.forms[0]; - var elm = dom.getParent(inst.selection.getNode(), "table"); - - // Hide advanced fields that isn't available in the schema - tinymce.each("summary id rules dir style frame".split(" "), function(name) { - var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr"); - - if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) { - tr.style.display = 'none'; - } - }); - - action = tinyMCEPopup.getWindowArg('action'); - - if (!action) - action = elm ? "update" : "insert"; - - if (elm && action != "insert") { - var rowsAr = elm.rows; - var cols = 0; - for (var i=0; i cols) - cols = rowsAr[i].cells.length; - - cols = cols; - rows = rowsAr.length; - - st = dom.parseStyle(dom.getAttrib(elm, "style")); - border = trimSize(getStyle(elm, 'border', 'borderWidth')); - cellpadding = dom.getAttrib(elm, 'cellpadding', ""); - cellspacing = dom.getAttrib(elm, 'cellspacing', ""); - width = trimSize(getStyle(elm, 'width', 'width')); - height = trimSize(getStyle(elm, 'height', 'height')); - bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); - bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); - align = dom.getAttrib(elm, 'align', align); - frame = dom.getAttrib(elm, 'frame'); - rules = dom.getAttrib(elm, 'rules'); - className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); - id = dom.getAttrib(elm, 'id'); - summary = dom.getAttrib(elm, 'summary'); - style = dom.serializeStyle(st); - dir = dom.getAttrib(elm, 'dir'); - lang = dom.getAttrib(elm, 'lang'); - background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; - - orgTableWidth = width; - orgTableHeight = height; - - action = "update"; - formObj.insert.value = inst.getLang('update'); - } - - addClassesToList('class', "table_styles"); - TinyMCE_EditableSelects.init(); - - // Update form - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'tframe', frame); - selectByValue(formObj, 'rules', rules); - selectByValue(formObj, 'class', className, true, true); - formObj.cols.value = cols; - formObj.rows.value = rows; - formObj.border.value = border; - formObj.cellpadding.value = cellpadding; - formObj.cellspacing.value = cellspacing; - formObj.width.value = width; - formObj.height.value = height; - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.id.value = id; - formObj.summary.value = summary; - formObj.style.value = style; - formObj.dir.value = dir; - formObj.lang.value = lang; - formObj.backgroundimage.value = background; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - // Disable some fields in update mode - if (action == "update") { - formObj.cols.disabled = true; - formObj.rows.disabled = true; - } -} - -function changedSize() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - -/* var width = formObj.width.value; - if (width != "") - st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; - else - st['width'] = "";*/ - - var height = formObj.height.value; - if (height != "") - st['height'] = getCSSSize(height); - else - st['height'] = ""; - - formObj.style.value = dom.serializeStyle(st); -} - -function isCssSize(value) { - return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value); -} - -function cssSize(value, def) { - value = tinymce.trim(value || def); - - if (!isCssSize(value)) { - return parseInt(value, 10) + 'px'; - } - - return value; -} - -function changedBackgroundImage() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedBorder() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - // Update border width if the element has a color - if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != "")) - st['border-width'] = cssSize(formObj.border.value); - else { - if (!formObj.border.value) { - st['border'] = ''; - st['border-width'] = ''; - } - } - - formObj.style.value = dom.serializeStyle(st); -} - -function changedColor() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-color'] = formObj.bgcolor.value; - - if (formObj.bordercolor.value != "") { - st['border-color'] = formObj.bordercolor.value; - - // Add border-width if it's missing - if (!st['border-width']) - st['border-width'] = cssSize(formObj.border.value, 1); - } - - formObj.style.value = dom.serializeStyle(st); -} - -function changedStyle() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - if (st['background-image']) - formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - else - formObj.backgroundimage.value = ''; - - if (st['width']) - formObj.width.value = trimSize(st['width']); - - if (st['height']) - formObj.height.value = trimSize(st['height']); - - if (st['background-color']) { - formObj.bgcolor.value = st['background-color']; - updateColor('bgcolor_pick','bgcolor'); - } - - if (st['border-color']) { - formObj.bordercolor.value = st['border-color']; - updateColor('bordercolor_pick','bordercolor'); - } -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom; + +function insertTable() { + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules; + var html = '', capEl, elm; + var cellLimit, rowLimit, colLimit; + + tinyMCEPopup.restoreSelection(); + + if (!AutoValidator.validate(formObj)) { + tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); + return false; + } + + elm = dom.getParent(inst.selection.getNode(), 'table'); + + // Get form data + cols = formObj.elements['cols'].value; + rows = formObj.elements['rows'].value; + border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; + cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; + cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; + align = getSelectValue(formObj, "align"); + frame = getSelectValue(formObj, "tframe"); + rules = getSelectValue(formObj, "rules"); + width = formObj.elements['width'].value; + height = formObj.elements['height'].value; + bordercolor = formObj.elements['bordercolor'].value; + bgcolor = formObj.elements['bgcolor'].value; + className = getSelectValue(formObj, "class"); + id = formObj.elements['id'].value; + summary = formObj.elements['summary'].value; + style = formObj.elements['style'].value; + dir = formObj.elements['dir'].value; + lang = formObj.elements['lang'].value; + background = formObj.elements['backgroundimage'].value; + caption = formObj.elements['caption'].checked; + + cellLimit = tinyMCEPopup.getParam('table_cell_limit', false); + rowLimit = tinyMCEPopup.getParam('table_row_limit', false); + colLimit = tinyMCEPopup.getParam('table_col_limit', false); + + // Validate table size + if (colLimit && cols > colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + + if (!isCssSize(border)) { + dom.setAttrib(elm, 'border', border); + } else { + dom.setAttrib(elm, 'border', ''); + } + + if (border == '') { + dom.setStyle(elm, 'border-width', ''); + dom.setStyle(elm, 'border', ''); + dom.setAttrib(elm, 'border', ''); + } + + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
      '; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = cssSize(border); + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += ''); + + tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { + if (patt) + patt += ','; + + patt += n + ' ._mce_marker'; + }); + + tinymce.each(inst.dom.select(patt), function(n) { + inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); + }); + + dom.setOuterHTML(dom.select('br._mce_marker')[0], html); + } else + inst.execCommand('mceInsertContent', false, html); + + tinymce.each(dom.select('table[data-mce-new]'), function(node) { + var tdorth = dom.select('td,th', node); + + // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document + if (tinymce.isIE && node.nextSibling == null) { + if (inst.settings.forced_root_block) + dom.insertAfter(dom.create(inst.settings.forced_root_block), node); + else + dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node); + } + + try { + // IE9 might fail to do this selection + inst.selection.setCursorLocation(tdorth[0], 0); + } catch (ex) { + // Ignore + } + + dom.setAttrib(node, 'data-mce-new', ''); + }); + + inst.addVisual(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + tinyMCEPopup.close(); +} + +function makeAttrib(attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib]; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value == "") + return ""; + + // XML encode it + value = value.replace(/&/g, '&'); + value = value.replace(/\"/g, '"'); + value = value.replace(//g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + // Hide advanced fields that isn't available in the schema + tinymce.each("summary id rules dir style frame".split(" "), function(name) { + var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr"); + + if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) { + tr.style.display = 'none'; + } + }); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'tframe', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function isCssSize(value) { + return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value); +} + +function cssSize(value, def) { + value = tinymce.trim(value || def); + + if (!isCssSize(value)) { + return parseInt(value, 10) + 'px'; + } + + return value; +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != "")) + st['border-width'] = cssSize(formObj.border.value); + else { + if (!formObj.border.value) { + st['border'] = ''; + st['border-width'] = ''; + } + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = cssSize(formObj.border.value, 1); + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/template/css/template.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/template/css/template.css index 2d23a49..a0b6ab3 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/template/css/template.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/template/css/template.css @@ -1,23 +1,23 @@ -#frmbody { - padding: 10px; - background-color: #FFF; - border: 1px solid #CCC; -} - -.frmRow { - margin-bottom: 10px; -} - -#templatesrc { - border: none; - width: 320px; - height: 240px; -} - -.title { - padding-bottom: 5px; -} - -.mceActionPanel { - padding-top: 5px; -} +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/template/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/template/editor_plugin_src.js index 9cac269..ce772ec 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/template/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/template/editor_plugin_src.js @@ -1,159 +1,159 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each; - - tinymce.create('tinymce.plugins.TemplatePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceTemplate', function(ui) { - ed.windowManager.open({ - file : url + '/template.htm', - width : ed.getParam('template_popup_width', 750), - height : ed.getParam('template_popup_height', 600), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceInsertTemplate', t._insertTemplate, t); - - // Register buttons - ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'}); - - ed.onPreProcess.add(function(ed, o) { - var dom = ed.dom; - - each(dom.select('div', o.node), function(e) { - if (dom.hasClass(e, 'mceTmpl')) { - each(dom.select('*', e), function(e) { - if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) - e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); - }); - - t._replaceVals(e); - } - }); - }); - }, - - getInfo : function() { - return { - longname : 'Template plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://www.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _insertTemplate : function(ui, v) { - var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent(); - - h = v.content; - - each(t.editor.getParam('template_replace_values'), function(v, k) { - if (typeof(v) != 'function') - h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); - }); - - el = dom.create('div', null, h); - - // Find template element within div - n = dom.select('.mceTmpl', el); - if (n && n.length > 0) { - el = dom.create('div', null); - el.appendChild(n[0].cloneNode(true)); - } - - function hasClass(n, c) { - return new RegExp('\\b' + c + '\\b', 'g').test(n.className); - }; - - each(dom.select('*', el), function(n) { - // Replace cdate - if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); - - // Replace mdate - if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); - - // Replace selection - if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) - n.innerHTML = sel; - }); - - t._replaceVals(el); - - ed.execCommand('mceInsertContent', false, el.innerHTML); - ed.addVisual(); - }, - - _replaceVals : function(e) { - var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); - - each(dom.select('*', e), function(e) { - each(vl, function(v, k) { - if (dom.hasClass(e, k)) { - if (typeof(vl[k]) == 'function') - vl[k](e); - } - }); - }); - }, - - _getDateTime : function(d, fmt) { - if (!fmt) - return ""; - - function addZeros(value, len) { - var i; - - value = "" + value; - - if (value.length < len) { - for (i=0; i<(len-value.length); i++) - value = "0" + value; - } - - return value; - } - - fmt = fmt.replace("%D", "%m/%d/%y"); - fmt = fmt.replace("%r", "%I:%M:%S %p"); - fmt = fmt.replace("%Y", "" + d.getFullYear()); - fmt = fmt.replace("%y", "" + d.getYear()); - fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); - fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); - fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); - fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); - fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); - fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); - fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); - fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); - fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); - fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); - fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); - fmt = fmt.replace("%%", "%"); - - return fmt; - } - }); - - // Register plugin - tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each; + + tinymce.create('tinymce.plugins.TemplatePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceTemplate', function(ui) { + ed.windowManager.open({ + file : url + '/template.htm', + width : ed.getParam('template_popup_width', 750), + height : ed.getParam('template_popup_height', 600), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceInsertTemplate', t._insertTemplate, t); + + // Register buttons + ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'}); + + ed.onPreProcess.add(function(ed, o) { + var dom = ed.dom; + + each(dom.select('div', o.node), function(e) { + if (dom.hasClass(e, 'mceTmpl')) { + each(dom.select('*', e), function(e) { + if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + }); + + t._replaceVals(e); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'Template plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://www.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _insertTemplate : function(ui, v) { + var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent(); + + h = v.content; + + each(t.editor.getParam('template_replace_values'), function(v, k) { + if (typeof(v) != 'function') + h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); + }); + + el = dom.create('div', null, h); + + // Find template element within div + n = dom.select('.mceTmpl', el); + if (n && n.length > 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/template/js/template.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/template/js/template.js index bc3045d..6ce14a2 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/template/js/template.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/template/js/template.js @@ -1,106 +1,106 @@ -tinyMCEPopup.requireLangPack(); - -var TemplateDialog = { - preInit : function() { - var url = tinyMCEPopup.getParam("template_external_list_url"); - - if (url != null) - document.write(''); - }, - - init : function() { - var ed = tinyMCEPopup.editor, tsrc, sel, x, u; - - tsrc = ed.getParam("template_templates", false); - sel = document.getElementById('tpath'); - - // Setup external template list - if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { - for (x=0, tsrc = []; x'); - }); - }, - - selectTemplate : function(u, ti) { - var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; - - if (!u) - return; - - d.body.innerHTML = this.templateHTML = this.getFileContents(u); - - for (x=0; x'); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x$1'); - - div = ed.dom.create('div', null, nv); - while (node = div.lastChild) - ed.dom.insertAfter(node, nl[i]); - - ed.dom.remove(nl[i]); - } - } else { - nl = ed.dom.select('span.mceItemNbsp', b); - - for (i = nl.length - 1; i >= 0; i--) - ed.dom.remove(nl[i], 1); - } - - s.moveToBookmark(bm); - } - }); - - // Register plugin - tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.VisualChars', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceVisualChars', t._toggleVisualChars, t); + + // Register buttons + ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); + + ed.onBeforeGetContent.add(function(ed, o) { + if (t.state && o.format != 'raw' && !o.draft) { + t.state = true; + t._toggleVisualChars(false); + } + }); + }, + + getInfo : function() { + return { + longname : 'Visual characters', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _toggleVisualChars : function(bookmark) { + var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; + + t.state = !t.state; + ed.controlManager.setActive('visualchars', t.state); + + if (bookmark) + bm = s.getBookmark(); + + if (t.state) { + nl = []; + tinymce.walk(b, function(n) { + if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) + nl.push(n); + }, 'childNodes'); + + for (i = 0; i < nl.length; i++) { + nv = nl[i].nodeValue; + nv = nv.replace(/(\u00a0)/g, '$1'); + + div = ed.dom.create('div', null, nv); + while (node = div.lastChild) + ed.dom.insertAfter(node, nl[i]); + + ed.dom.remove(nl[i]); + } + } else { + nl = ed.dom.select('span.mceItemNbsp', b); + + for (i = nl.length - 1; i >= 0; i--) + ed.dom.remove(nl[i], 1); + } + + s.moveToBookmark(bm); + } + }); + + // Register plugin + tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/wordcount/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/wordcount/editor_plugin_src.js index 34b2655..3ba6be6 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/wordcount/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/wordcount/editor_plugin_src.js @@ -1,122 +1,122 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.WordCount', { - block : 0, - id : null, - countre : null, - cleanre : null, - - init : function(ed, url) { - var t = this, last = 0, VK = tinymce.VK; - - t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ - t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); - t.update_rate = ed.getParam('wordcount_update_rate', 2000); - t.update_on_delete = ed.getParam('wordcount_update_on_delete', false); - t.id = ed.id + '-word-count'; - - ed.onPostRender.add(function(ed, cm) { - var row, id; - - // Add it to the specified id or the theme advanced path - id = ed.getParam('wordcount_target_id'); - if (!id) { - row = tinymce.DOM.get(ed.id + '_path_row'); - - if (row) - tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); - } else { - tinymce.DOM.add(id, 'span', {}, '0'); - } - }); - - ed.onInit.add(function(ed) { - ed.selection.onSetContent.add(function() { - t._count(ed); - }); - - t._count(ed); - }); - - ed.onSetContent.add(function(ed) { - t._count(ed); - }); - - function checkKeys(key) { - return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last)); - } - - function checkDelOrBksp(key) { - return key === VK.DELETE || key === VK.BACKSPACE; - } - - ed.onKeyUp.add(function(ed, e) { - if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) { - t._count(ed); - } - - last = e.keyCode; - }); - }, - - _getCount : function(ed) { - var tc = 0; - var tx = ed.getContent({ format: 'raw' }); - - if (tx) { - tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces - tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars - - // deal with html entities - tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); - tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation - - var wordArray = tx.match(this.countre); - if (wordArray) { - tc = wordArray.length; - } - } - - return tc; - }, - - _count : function(ed) { - var t = this; - - // Keep multiple calls from happening at the same time - if (t.block) - return; - - t.block = 1; - - setTimeout(function() { - if (!ed.destroyed) { - var tc = t._getCount(ed); - tinymce.DOM.setHTML(t.id, tc.toString()); - setTimeout(function() {t.block = 0;}, t.update_rate); - } - }, 1); - }, - - getInfo: function() { - return { - longname : 'Word Count plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.WordCount', { + block : 0, + id : null, + countre : null, + cleanre : null, + + init : function(ed, url) { + var t = this, last = 0, VK = tinymce.VK; + + t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ + t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); + t.update_rate = ed.getParam('wordcount_update_rate', 2000); + t.update_on_delete = ed.getParam('wordcount_update_on_delete', false); + t.id = ed.id + '-word-count'; + + ed.onPostRender.add(function(ed, cm) { + var row, id; + + // Add it to the specified id or the theme advanced path + id = ed.getParam('wordcount_target_id'); + if (!id) { + row = tinymce.DOM.get(ed.id + '_path_row'); + + if (row) + tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); + } else { + tinymce.DOM.add(id, 'span', {}, '0'); + } + }); + + ed.onInit.add(function(ed) { + ed.selection.onSetContent.add(function() { + t._count(ed); + }); + + t._count(ed); + }); + + ed.onSetContent.add(function(ed) { + t._count(ed); + }); + + function checkKeys(key) { + return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last)); + } + + function checkDelOrBksp(key) { + return key === VK.DELETE || key === VK.BACKSPACE; + } + + ed.onKeyUp.add(function(ed, e) { + if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) { + t._count(ed); + } + + last = e.keyCode; + }); + }, + + _getCount : function(ed) { + var tc = 0; + var tx = ed.getContent({ format: 'raw' }); + + if (tx) { + tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces + tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars + + // deal with html entities + tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); + tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation + + var wordArray = tx.match(this.countre); + if (wordArray) { + tc = wordArray.length; + } + } + + return tc; + }, + + _count : function(ed) { + var t = this; + + // Keep multiple calls from happening at the same time + if (t.block) + return; + + t.block = 1; + + setTimeout(function() { + if (!ed.destroyed) { + var tc = t._getCount(ed); + tinymce.DOM.setHTML(t.id, tc.toString()); + setTimeout(function() {t.block = 0;}, t.update_rate); + } + }, 1); + }, + + getInfo: function() { + return { + longname : 'Word Count plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); +})(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/css/attributes.css index 9a6a235..0356241 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/css/attributes.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/css/attributes.css @@ -1,11 +1,11 @@ -.panel_wrapper div.current { - height: 290px; -} - -#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { - width: 200px; -} - -#events_panel input { - width: 200px; -} +.panel_wrapper div.current { + height: 290px; +} + +#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { + width: 200px; +} + +#events_panel input { + width: 200px; +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/css/popup.css b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/css/popup.css index e67114d..034b985 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/css/popup.css +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/css/popup.css @@ -1,9 +1,9 @@ -input.field, select.field {width:200px;} -input.picker {width:179px; margin-left: 5px;} -input.disabled {border-color:#F2F2F2;} -img.picker {vertical-align:text-bottom; cursor:pointer;} -h1 {padding: 0 0 5px 0;} -.panel_wrapper div.current {height:160px;} -#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} -a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} -#datetime {width:180px;} +input.field, select.field {width:200px;} +input.picker {width:179px; margin-left: 5px;} +input.disabled {border-color:#F2F2F2;} +img.picker {vertical-align:text-bottom; cursor:pointer;} +h1 {padding: 0 0 5px 0;} +.panel_wrapper div.current {height:160px;} +#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} +a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} +#datetime {width:180px;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js index f240572..1ea4fce 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js @@ -1,132 +1,132 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceCite', function() { - ed.windowManager.open({ - file : url + '/cite.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAcronym', function() { - ed.windowManager.open({ - file : url + '/acronym.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAbbr', function() { - ed.windowManager.open({ - file : url + '/abbr.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceDel', function() { - ed.windowManager.open({ - file : url + '/del.htm', - width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceIns', function() { - ed.windowManager.open({ - file : url + '/ins.htm', - width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAttributes', function() { - ed.windowManager.open({ - file : url + '/attributes.htm', - width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), - height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); - ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); - ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); - ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); - ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); - ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); - - ed.onNodeChange.add(function(ed, cm, n, co) { - n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); - - cm.setDisabled('cite', co); - cm.setDisabled('acronym', co); - cm.setDisabled('abbr', co); - cm.setDisabled('del', co); - cm.setDisabled('ins', co); - cm.setDisabled('attribs', n && n.nodeName == 'BODY'); - cm.setActive('cite', 0); - cm.setActive('acronym', 0); - cm.setActive('abbr', 0); - cm.setActive('del', 0); - cm.setActive('ins', 0); - - // Activate all - if (n) { - do { - cm.setDisabled(n.nodeName.toLowerCase(), 0); - cm.setActive(n.nodeName.toLowerCase(), 1); - } while (n = n.parentNode); - } - }); - - ed.onPreInit.add(function() { - // Fixed IE issue where it can't handle these elements correctly - ed.dom.create('abbr'); - }); - }, - - getInfo : function() { - return { - longname : 'XHTML Xtras Plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceCite', function() { + ed.windowManager.open({ + file : url + '/cite.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAcronym', function() { + ed.windowManager.open({ + file : url + '/acronym.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAbbr', function() { + ed.windowManager.open({ + file : url + '/abbr.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceDel', function() { + ed.windowManager.open({ + file : url + '/del.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceIns', function() { + ed.windowManager.open({ + file : url + '/ins.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAttributes', function() { + ed.windowManager.open({ + file : url + '/attributes.htm', + width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), + height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); + ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); + ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); + ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); + ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); + ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); + + ed.onNodeChange.add(function(ed, cm, n, co) { + n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); + + cm.setDisabled('cite', co); + cm.setDisabled('acronym', co); + cm.setDisabled('abbr', co); + cm.setDisabled('del', co); + cm.setDisabled('ins', co); + cm.setDisabled('attribs', n && n.nodeName == 'BODY'); + cm.setActive('cite', 0); + cm.setActive('acronym', 0); + cm.setActive('abbr', 0); + cm.setActive('del', 0); + cm.setActive('ins', 0); + + // Activate all + if (n) { + do { + cm.setDisabled(n.nodeName.toLowerCase(), 0); + cm.setActive(n.nodeName.toLowerCase(), 1); + } while (n = n.parentNode); + } + }); + + ed.onPreInit.add(function() { + // Fixed IE issue where it can't handle these elements correctly + ed.dom.create('abbr'); + }); + }, + + getInfo : function() { + return { + longname : 'XHTML Xtras Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/abbr.js index 4b51a25..a90e19b 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/abbr.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/abbr.js @@ -1,28 +1,28 @@ -/** - * abbr.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('abbr'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAbbr() { - SXE.insertElement('abbr'); - tinyMCEPopup.close(); -} - -function removeAbbr() { - SXE.removeElement('abbr'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); +/** + * abbr.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('abbr'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAbbr() { + SXE.insertElement('abbr'); + tinyMCEPopup.close(); +} + +function removeAbbr() { + SXE.removeElement('abbr'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/acronym.js index 6ec2f88..f20271a 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/acronym.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/acronym.js @@ -1,28 +1,28 @@ -/** - * acronym.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('acronym'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAcronym() { - SXE.insertElement('acronym'); - tinyMCEPopup.close(); -} - -function removeAcronym() { - SXE.removeElement('acronym'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); +/** + * acronym.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('acronym'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAcronym() { + SXE.insertElement('acronym'); + tinyMCEPopup.close(); +} + +function removeAcronym() { + SXE.removeElement('acronym'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/attributes.js index 9c99995..77def07 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/attributes.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/attributes.js @@ -1,111 +1,111 @@ -/** - * attributes.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - tinyMCEPopup.resizeToInnerSize(); - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - var elm = inst.selection.getNode(); - var f = document.forms[0]; - var onclick = dom.getAttrib(elm, 'onclick'); - - setFormValue('title', dom.getAttrib(elm, 'title')); - setFormValue('id', dom.getAttrib(elm, 'id')); - setFormValue('style', dom.getAttrib(elm, "style")); - setFormValue('dir', dom.getAttrib(elm, 'dir')); - setFormValue('lang', dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); - className = dom.getAttrib(elm, 'class'); - - addClassesToList('classlist', 'advlink_styles'); - selectByValue(f, 'classlist', className, true); - - TinyMCE_EditableSelects.init(); -} - -function setFormValue(name, value) { - if(value && document.forms[0].elements[name]){ - document.forms[0].elements[name].value = value; - } -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - - setAllAttribs(elm); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); -} - -function setAttrib(elm, attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib.toLowerCase()]; - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - dom.setAttrib(elm, attrib.toLowerCase(), value); -} - -function setAllAttribs(elm) { - var f = document.forms[0]; - - setAttrib(elm, 'title'); - setAttrib(elm, 'id'); - setAttrib(elm, 'style'); - setAttrib(elm, 'class', getSelectValue(f, 'classlist')); - setAttrib(elm, 'dir'); - setAttrib(elm, 'lang'); - setAttrib(elm, 'tabindex'); - setAttrib(elm, 'accesskey'); - setAttrib(elm, 'onfocus'); - setAttrib(elm, 'onblur'); - setAttrib(elm, 'onclick'); - setAttrib(elm, 'ondblclick'); - setAttrib(elm, 'onmousedown'); - setAttrib(elm, 'onmouseup'); - setAttrib(elm, 'onmouseover'); - setAttrib(elm, 'onmousemove'); - setAttrib(elm, 'onmouseout'); - setAttrib(elm, 'onkeypress'); - setAttrib(elm, 'onkeydown'); - setAttrib(elm, 'onkeyup'); - - // Refresh in old MSIE -// if (tinyMCE.isMSIE5) -// elm.outerHTML = elm.outerHTML; -} - -function insertAttribute() { - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); -tinyMCEPopup.requireLangPack(); +/** + * attributes.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + tinyMCEPopup.resizeToInnerSize(); + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + var elm = inst.selection.getNode(); + var f = document.forms[0]; + var onclick = dom.getAttrib(elm, 'onclick'); + + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + setFormValue('style', dom.getAttrib(elm, "style")); + setFormValue('dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); + className = dom.getAttrib(elm, 'class'); + + addClassesToList('classlist', 'advlink_styles'); + selectByValue(f, 'classlist', className, true); + + TinyMCE_EditableSelects.init(); +} + +function setFormValue(name, value) { + if(value && document.forms[0].elements[name]){ + document.forms[0].elements[name].value = value; + } +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + + setAllAttribs(elm); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); +} + +function setAttrib(elm, attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib.toLowerCase()]; + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + dom.setAttrib(elm, attrib.toLowerCase(), value); +} + +function setAllAttribs(elm) { + var f = document.forms[0]; + + setAttrib(elm, 'title'); + setAttrib(elm, 'id'); + setAttrib(elm, 'style'); + setAttrib(elm, 'class', getSelectValue(f, 'classlist')); + setAttrib(elm, 'dir'); + setAttrib(elm, 'lang'); + setAttrib(elm, 'tabindex'); + setAttrib(elm, 'accesskey'); + setAttrib(elm, 'onfocus'); + setAttrib(elm, 'onblur'); + setAttrib(elm, 'onclick'); + setAttrib(elm, 'ondblclick'); + setAttrib(elm, 'onmousedown'); + setAttrib(elm, 'onmouseup'); + setAttrib(elm, 'onmouseover'); + setAttrib(elm, 'onmousemove'); + setAttrib(elm, 'onmouseout'); + setAttrib(elm, 'onkeypress'); + setAttrib(elm, 'onkeydown'); + setAttrib(elm, 'onkeyup'); + + // Refresh in old MSIE +// if (tinyMCE.isMSIE5) +// elm.outerHTML = elm.outerHTML; +} + +function insertAttribute() { + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/cite.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/cite.js index 009b715..e32fa90 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/cite.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/cite.js @@ -1,28 +1,28 @@ -/** - * cite.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('cite'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertCite() { - SXE.insertElement('cite'); - tinyMCEPopup.close(); -} - -function removeCite() { - SXE.removeElement('cite'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); +/** + * cite.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('cite'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertCite() { + SXE.insertElement('cite'); + tinyMCEPopup.close(); +} + +function removeCite() { + SXE.removeElement('cite'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/del.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/del.js index 1f957dc..da4dbbe 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/del.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/del.js @@ -1,53 +1,53 @@ -/** - * del.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('del'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); - elm.removeAttribute('data-mce-new'); -} - -function insertDel() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); - - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('del'); - var elementArray = SXE.inst.dom.select('del[data-mce-new]'); - for (var i=0; i 0) { + insertInlineElement('del'); + var elementArray = SXE.inst.dom.select('del[data-mce-new]'); + for (var i=0; i 0) { - tagName = element_name; - - insertInlineElement(element_name); - var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); - for (var i=0; i -1) ? true : false; -} - -SXE.removeClass = function(elm,cl) { - if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { - return true; - } - var classNames = elm.className.split(" "); - var newClassNames = ""; - for (var x = 0, cnl = classNames.length; x < cnl; x++) { - if (classNames[x] != cl) { - newClassNames += (classNames[x] + " "); - } - } - elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end -} - -SXE.addClass = function(elm,cl) { - if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; - return true; -} - -function insertInlineElement(en) { - var ed = tinyMCEPopup.editor, dom = ed.dom; - - ed.getDoc().execCommand('FontName', false, 'mceinline'); - tinymce.each(dom.select('span,font'), function(n) { - if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') - dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); - }); -} +/** + * element_common.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +tinyMCEPopup.requireLangPack(); + +function initCommonAttributes(elm) { + var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; + + // Setup form data for common element attributes + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true); + setFormValue('style', dom.getAttrib(elm, 'style')); + selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', dom.getAttrib(elm, 'onclick')); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); +} + +function setFormValue(name, value) { + if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value; +} + +function insertDateTime(id) { + document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S"); +} + +function getDateTime(d, fmt) { + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%%", "%"); + + return fmt; +} + +function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i 0) { + tagName = element_name; + + insertInlineElement(element_name); + var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); + for (var i=0; i -1) ? true : false; +} + +SXE.removeClass = function(elm,cl) { + if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { + return true; + } + var classNames = elm.className.split(" "); + var newClassNames = ""; + for (var x = 0, cnl = classNames.length; x < cnl; x++) { + if (classNames[x] != cl) { + newClassNames += (classNames[x] + " "); + } + } + elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end +} + +SXE.addClass = function(elm,cl) { + if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; + return true; +} + +function insertInlineElement(en) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + ed.getDoc().execCommand('FontName', false, 'mceinline'); + tinymce.each(dom.select('span,font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') + dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); + }); +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/ins.js b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/ins.js index c4addfb..66fbe7d 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/ins.js +++ b/assets/grocery_crud/texteditor/tiny_mce/plugins/xhtmlxtras/js/ins.js @@ -1,53 +1,53 @@ -/** - * ins.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('ins'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); - elm.removeAttribute('data-mce-new'); -} - -function insertIns() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); - - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('ins'); - var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); - for (var i=0; i 0) { + insertInlineElement('ins'); + var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); + for (var i=0; i= 1 && v <= 7) { - k = v + ' (' + t.sizes[v - 1] + 'pt)'; - cl = s.font_size_classes[v - 1]; - v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); - } - - if (/^\s*\./.test(v)) - cl = v.replace(/\./g, ''); - - o[k] = cl ? {'class' : cl} : {fontSize : v}; - }); - - s.theme_advanced_font_sizes = o; - } - - if ((v = s.theme_advanced_path_location) && v != 'none') - s.theme_advanced_statusbar_location = s.theme_advanced_path_location; - - if (s.theme_advanced_statusbar_location == 'none') - s.theme_advanced_statusbar_location = 0; - - if (ed.settings.content_css !== false) - ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); - - // Init editor - ed.onInit.add(function() { - if (!ed.settings.readonly) { - ed.onNodeChange.add(t._nodeChanged, t); - ed.onKeyUp.add(t._updateUndoStatus, t); - ed.onMouseUp.add(t._updateUndoStatus, t); - ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { - t._updateUndoStatus(ed); - }); - } - }); - - ed.onSetProgressState.add(function(ed, b, ti) { - var co, id = ed.id, tb; - - if (b) { - t.progressTimer = setTimeout(function() { - co = ed.getContainer(); - co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); - tb = DOM.get(ed.id + '_tbl'); - - DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); - DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); - }, ti || 0); - } else { - DOM.remove(id + '_blocker'); - DOM.remove(id + '_progress'); - clearTimeout(t.progressTimer); - } - }); - - DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); - - if (s.skin_variant) - DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); - }, - - _isHighContrast : function() { - var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); - - actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); - DOM.remove(div); - - return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; - }, - - createControl : function(n, cf) { - var cd, c; - - if (c = cf.createControl(n)) - return c; - - switch (n) { - case "styleselect": - return this._createStyleSelect(); - - case "formatselect": - return this._createBlockFormats(); - - case "fontselect": - return this._createFontSelect(); - - case "fontsizeselect": - return this._createFontSizeSelect(); - - case "forecolor": - return this._createForeColorMenu(); - - case "backcolor": - return this._createBackColorMenu(); - } - - if ((cd = this.controls[n])) - return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); - }, - - execCommand : function(cmd, ui, val) { - var f = this['_' + cmd]; - - if (f) { - f.call(this, ui, val); - return true; - } - - return false; - }, - - _importClasses : function(e) { - var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); - - if (ctrl.getLength() == 0) { - each(ed.dom.getClasses(), function(o, idx) { - var name = 'style_' + idx, fmt; - - fmt = { - inline : 'span', - attributes : {'class' : o['class']}, - selector : '*' - }; - - ed.formatter.register(name, fmt); - - ctrl.add(o['class'], name, { - style: function() { - return getPreviewCss(ed, fmt); - } - }); - }); - } - }, - - _createStyleSelect : function(n) { - var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; - - // Setup style select box - ctrl = ctrlMan.createListBox('styleselect', { - title : 'advanced.style_select', - onselect : function(name) { - var matches, formatNames = [], removedFormat; - - each(ctrl.items, function(item) { - formatNames.push(item.value); - }); - - ed.focus(); - ed.undoManager.add(); - - // Toggle off the current format(s) - matches = ed.formatter.matchAll(formatNames); - tinymce.each(matches, function(match) { - if (!name || match == name) { - if (match) - ed.formatter.remove(match); - - removedFormat = true; - } - }); - - if (!removedFormat) - ed.formatter.apply(name); - - ed.undoManager.add(); - ed.nodeChanged(); - - return false; // No auto select - } - }); - - // Handle specified format - ed.onPreInit.add(function() { - var counter = 0, formats = ed.getParam('style_formats'); - - if (formats) { - each(formats, function(fmt) { - var name, keys = 0; - - each(fmt, function() {keys++;}); - - if (keys > 1) { - name = fmt.name = fmt.name || 'style_' + (counter++); - ed.formatter.register(name, fmt); - ctrl.add(fmt.title, name, { - style: function() { - return getPreviewCss(ed, fmt); - } - }); - } else - ctrl.add(fmt.title); - }); - } else { - each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { - var name, fmt; - - if (val) { - name = 'style_' + (counter++); - fmt = { - inline : 'span', - classes : val, - selector : '*' - }; - - ed.formatter.register(name, fmt); - ctrl.add(t.editor.translate(key), name, { - style: function() { - return getPreviewCss(ed, fmt); - } - }); - } - }); - } - }); - - // Auto import classes if the ctrl box is empty - if (ctrl.getLength() == 0) { - ctrl.onPostRender.add(function(ed, n) { - if (!ctrl.NativeListBox) { - Event.add(n.id + '_text', 'focus', t._importClasses, t); - Event.add(n.id + '_text', 'mousedown', t._importClasses, t); - Event.add(n.id + '_open', 'focus', t._importClasses, t); - Event.add(n.id + '_open', 'mousedown', t._importClasses, t); - } else - Event.add(n.id, 'focus', t._importClasses, t); - }); - } - - return ctrl; - }, - - _createFontSelect : function() { - var c, t = this, ed = t.editor; - - c = ed.controlManager.createListBox('fontselect', { - title : 'advanced.fontdefault', - onselect : function(v) { - var cur = c.items[c.selectedIndex]; - - if (!v && cur) { - ed.execCommand('FontName', false, cur.value); - return; - } - - ed.execCommand('FontName', false, v); - - // Fake selection, execCommand will fire a nodeChange and update the selection - c.select(function(sv) { - return v == sv; - }); - - if (cur && cur.value == v) { - c.select(null); - } - - return false; // No auto select - } - }); - - if (c) { - each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { - c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); - }); - } - - return c; - }, - - _createFontSizeSelect : function() { - var t = this, ed = t.editor, c, i = 0, cl = []; - - c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { - var cur = c.items[c.selectedIndex]; - - if (!v && cur) { - cur = cur.value; - - if (cur['class']) { - ed.formatter.toggle('fontsize_class', {value : cur['class']}); - ed.undoManager.add(); - ed.nodeChanged(); - } else { - ed.execCommand('FontSize', false, cur.fontSize); - } - - return; - } - - if (v['class']) { - ed.focus(); - ed.undoManager.add(); - ed.formatter.toggle('fontsize_class', {value : v['class']}); - ed.undoManager.add(); - ed.nodeChanged(); - } else - ed.execCommand('FontSize', false, v.fontSize); - - // Fake selection, execCommand will fire a nodeChange and update the selection - c.select(function(sv) { - return v == sv; - }); - - if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) { - c.select(null); - } - - return false; // No auto select - }}); - - if (c) { - each(t.settings.theme_advanced_font_sizes, function(v, k) { - var fz = v.fontSize; - - if (fz >= 1 && fz <= 7) - fz = t.sizes[parseInt(fz) - 1] + 'pt'; - - c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); - }); - } - - return c; - }, - - _createBlockFormats : function() { - var c, fmts = { - p : 'advanced.paragraph', - address : 'advanced.address', - pre : 'advanced.pre', - h1 : 'advanced.h1', - h2 : 'advanced.h2', - h3 : 'advanced.h3', - h4 : 'advanced.h4', - h5 : 'advanced.h5', - h6 : 'advanced.h6', - div : 'advanced.div', - blockquote : 'advanced.blockquote', - code : 'advanced.code', - dt : 'advanced.dt', - dd : 'advanced.dd', - samp : 'advanced.samp' - }, t = this; - - c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { - t.editor.execCommand('FormatBlock', false, v); - return false; - }}); - - if (c) { - each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { - c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v, style: function() { - return getPreviewCss(t.editor, {block: v}); - }}); - }); - } - - return c; - }, - - _createForeColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_text_colors) - o.colors = v; - - if (s.theme_advanced_default_foreground_color) - o.default_color = s.theme_advanced_default_foreground_color; - - o.title = 'advanced.forecolor_desc'; - o.cmd = 'ForeColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('forecolor', o); - - return c; - }, - - _createBackColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_background_colors) - o.colors = v; - - if (s.theme_advanced_default_background_color) - o.default_color = s.theme_advanced_default_background_color; - - o.title = 'advanced.backcolor_desc'; - o.cmd = 'HiliteColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('backcolor', o); - - return c; - }, - - renderUI : function(o) { - var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; - - if (ed.settings) { - ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); - } - - // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. - // Maybe actually inherit it from the original textara? - n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '') + (ed.settings.directionality == "rtl" ? ' mceRtl' : '')}); - DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); - - if (!DOM.boxModel) - n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); - - n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); - n = tb = DOM.add(n, 'tbody'); - - switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { - case "rowlayout": - ic = t._rowLayout(s, tb, o); - break; - - case "customlayout": - ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); - break; - - default: - ic = t._simpleLayout(s, tb, o, p); - } - - n = o.targetNode; - - // Add classes to first and last TRs - nl = sc.rows; - DOM.addClass(nl[0], 'mceFirst'); - DOM.addClass(nl[nl.length - 1], 'mceLast'); - - // Add classes to first and last TDs - each(DOM.select('tr', tb), function(n) { - DOM.addClass(n.firstChild, 'mceFirst'); - DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); - }); - - if (DOM.get(s.theme_advanced_toolbar_container)) - DOM.get(s.theme_advanced_toolbar_container).appendChild(p); - else - DOM.insertAfter(p, n); - - Event.add(ed.id + '_path_row', 'click', function(e) { - e = e.target; - - if (e.nodeName == 'A') { - t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); - return false; - } - }); -/* - if (DOM.get(ed.id + '_path_row')) { - Event.add(ed.id + '_tbl', 'mouseover', function(e) { - var re; - - e = e.target; - - if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { - re = DOM.get(ed.id + '_path_row'); - t.lastPath = re.innerHTML; - DOM.setHTML(re, e.parentNode.title); - } - }); - - Event.add(ed.id + '_tbl', 'mouseout', function(e) { - if (t.lastPath) { - DOM.setHTML(ed.id + '_path_row', t.lastPath); - t.lastPath = 0; - } - }); - } -*/ - - if (!ed.getParam('accessibility_focus')) - Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); - - if (s.theme_advanced_toolbar_location == 'external') - o.deltaHeight = 0; - - t.deltaHeight = o.deltaHeight; - o.targetNode = null; - - ed.onKeyDown.add(function(ed, evt) { - var DOM_VK_F10 = 121, DOM_VK_F11 = 122; - - if (evt.altKey) { - if (evt.keyCode === DOM_VK_F10) { - // Make sure focus is given to toolbar in Safari. - // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame - if (tinymce.isWebKit) { - window.focus(); - } - t.toolbarGroup.focus(); - return Event.cancel(evt); - } else if (evt.keyCode === DOM_VK_F11) { - DOM.get(ed.id + '_path_row').focus(); - return Event.cancel(evt); - } - } - }); - - // alt+0 is the UK recommended shortcut for accessing the list of access controls. - ed.addShortcut('alt+0', '', 'mceShortcuts', t); - - return { - iframeContainer : ic, - editorContainer : ed.id + '_parent', - sizeContainer : sc, - deltaHeight : o.deltaHeight - }; - }, - - getInfo : function() { - return { - longname : 'Advanced theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - }, - - resizeBy : function(dw, dh) { - var e = DOM.get(this.editor.id + '_ifr'); - - this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); - }, - - resizeTo : function(w, h, store) { - var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); - - // Boundery fix box - w = Math.max(s.theme_advanced_resizing_min_width || 100, w); - h = Math.max(s.theme_advanced_resizing_min_height || 100, h); - w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); - h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); - - // Resize iframe and container - DOM.setStyle(e, 'height', ''); - DOM.setStyle(ifr, 'height', h); - - if (s.theme_advanced_resize_horizontal) { - DOM.setStyle(e, 'width', ''); - DOM.setStyle(ifr, 'width', w); - - // Make sure that the size is never smaller than the over all ui - if (w < e.clientWidth) { - w = e.clientWidth; - DOM.setStyle(ifr, 'width', e.clientWidth); - } - } - - // Store away the size - if (store && s.theme_advanced_resizing_use_cookie) { - Cookie.setHash("TinyMCE_" + ed.id + "_size", { - cw : w, - ch : h - }); - } - }, - - destroy : function() { - var id = this.editor.id; - - Event.clear(id + '_resize'); - Event.clear(id + '_path_row'); - Event.clear(id + '_external_close'); - }, - - // Internal functions - - _simpleLayout : function(s, tb, o, p) { - var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; - - if (s.readonly) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - return ic; - } - - // Create toolbar container at top - if (lo == 'top') - t._addToolbars(tb, o); - - // Create external toolbar - if (lo == 'external') { - n = c = DOM.create('div', {style : 'position:relative'}); - n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); - DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); - n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); - etb = DOM.add(n, 'tbody'); - - if (p.firstChild.className == 'mceOldBoxModel') - p.firstChild.appendChild(c); - else - p.insertBefore(c, p.firstChild); - - t._addToolbars(etb, o); - - ed.onMouseUp.add(function() { - var e = DOM.get(ed.id + '_external'); - DOM.show(e); - - DOM.hide(lastExtID); - - var f = Event.add(ed.id + '_external_close', 'click', function() { - DOM.hide(ed.id + '_external'); - Event.remove(ed.id + '_external_close', 'click', f); - return false; - }); - - DOM.show(e); - DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); - - // Fixes IE rendering bug - DOM.hide(e); - DOM.show(e); - e.style.filter = ''; - - lastExtID = ed.id + '_external'; - - e = null; - }); - } - - if (sl == 'top') - t._addStatusBar(tb, o); - - // Create iframe container - if (!s.theme_advanced_toolbar_container) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - } - - // Create toolbar container at bottom - if (lo == 'bottom') - t._addToolbars(tb, o); - - if (sl == 'bottom') - t._addStatusBar(tb, o); - - return ic; - }, - - _rowLayout : function(s, tb, o) { - var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; - - dc = s.theme_advanced_containers_default_class || ''; - da = s.theme_advanced_containers_default_align || 'center'; - - each(explode(s.theme_advanced_containers || ''), function(c, i) { - var v = s['theme_advanced_container_' + c] || ''; - - switch (c.toLowerCase()) { - case 'mceeditor': - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - break; - - case 'mceelementpath': - t._addStatusBar(tb, o); - break; - - default: - a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(tb, 'tr'), 'td', { - 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da - }); - - to = cf.createToolbar("toolbar" + i); - t._addControls(v, to); - DOM.setHTML(n, to.renderHTML()); - o.deltaHeight -= s.theme_advanced_row_height; - } - }); - - return ic; - }, - - _addControls : function(v, tb) { - var t = this, s = t.settings, di, cf = t.editor.controlManager; - - if (s.theme_advanced_disable && !t._disabled) { - di = {}; - - each(explode(s.theme_advanced_disable), function(v) { - di[v] = 1; - }); - - t._disabled = di; - } else - di = t._disabled; - - each(explode(v), function(n) { - var c; - - if (di && di[n]) - return; - - // Compatiblity with 2.x - if (n == 'tablecontrols') { - each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { - n = t.createControl(n, cf); - - if (n) - tb.add(n); - }); - - return; - } - - c = t.createControl(n, cf); - - if (c) - tb.add(c); - }); - }, - - _addToolbars : function(c, o) { - var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup, toolbarsExist = false; - - toolbarGroup = cf.createToolbarGroup('toolbargroup', { - 'name': ed.getLang('advanced.toolbar'), - 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') - }); - - t.toolbarGroup = toolbarGroup; - - a = s.theme_advanced_toolbar_align.toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(c, 'tr', {role: 'toolbar'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"}); - - // Create toolbar and add the controls - for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { - toolbarsExist = true; - tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); - - if (s['theme_advanced_buttons' + i + '_add']) - v += ',' + s['theme_advanced_buttons' + i + '_add']; - - if (s['theme_advanced_buttons' + i + '_add_before']) - v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; - - t._addControls(v, tb); - toolbarGroup.add(tb); - - o.deltaHeight -= s.theme_advanced_row_height; - } - // Handle case when there are no toolbar buttons and ensure editor height is adjusted accordingly - if (!toolbarsExist) - o.deltaHeight -= s.theme_advanced_row_height; - h.push(toolbarGroup.renderHTML()); - h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); - DOM.setHTML(n, h.join('')); - }, - - _addStatusBar : function(tb, o) { - var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; - - n = DOM.add(tb, 'tr'); - n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); - n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); - if (s.theme_advanced_path) { - DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); - DOM.add(n, 'span', {}, ': '); - } else { - DOM.add(n, 'span', {}, ' '); - } - - - if (s.theme_advanced_resizing) { - DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); - - if (s.theme_advanced_resizing_use_cookie) { - ed.onPostRender.add(function() { - var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); - - if (!o) - return; - - t.resizeTo(o.cw, o.ch); - }); - } - - ed.onPostRender.add(function() { - Event.add(ed.id + '_resize', 'click', function(e) { - e.preventDefault(); - }); - - Event.add(ed.id + '_resize', 'mousedown', function(e) { - var mouseMoveHandler1, mouseMoveHandler2, - mouseUpHandler1, mouseUpHandler2, - startX, startY, startWidth, startHeight, width, height, ifrElm; - - function resizeOnMove(e) { - e.preventDefault(); - - width = startWidth + (e.screenX - startX); - height = startHeight + (e.screenY - startY); - - t.resizeTo(width, height); - }; - - function endResize(e) { - // Stop listening - Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); - Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); - Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); - Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); - - width = startWidth + (e.screenX - startX); - height = startHeight + (e.screenY - startY); - t.resizeTo(width, height, true); - - ed.nodeChanged(); - }; - - e.preventDefault(); - - // Get the current rect size - startX = e.screenX; - startY = e.screenY; - ifrElm = DOM.get(t.editor.id + '_ifr'); - startWidth = width = ifrElm.clientWidth; - startHeight = height = ifrElm.clientHeight; - - // Register envent handlers - mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); - mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); - mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); - mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); - }); - }); - } - - o.deltaHeight -= 21; - n = tb = null; - }, - - _updateUndoStatus : function(ed) { - var cm = ed.controlManager, um = ed.undoManager; - - cm.setDisabled('undo', !um.hasUndo() && !um.typing); - cm.setDisabled('redo', !um.hasRedo()); - }, - - _nodeChanged : function(ed, cm, n, co, ob) { - var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; - - tinymce.each(t.stateControls, function(c) { - cm.setActive(c, ed.queryCommandState(t.controls[c][1])); - }); - - function getParent(name) { - var i, parents = ob.parents, func = name; - - if (typeof(name) == 'string') { - func = function(node) { - return node.nodeName == name; - }; - } - - for (i = 0; i < parents.length; i++) { - if (func(parents[i])) - return parents[i]; - } - }; - - cm.setActive('visualaid', ed.hasVisual); - t._updateUndoStatus(ed); - cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); - - p = getParent('A'); - if (c = cm.get('link')) { - c.setDisabled((!p && co) || (p && !p.href)); - c.setActive(!!p && (!p.name && !p.id)); - } - - if (c = cm.get('unlink')) { - c.setDisabled(!p && co); - c.setActive(!!p && !p.name && !p.id); - } - - if (c = cm.get('anchor')) { - c.setActive(!co && !!p && (p.name || (p.id && !p.href))); - } - - p = getParent('IMG'); - if (c = cm.get('image')) - c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); - - if (c = cm.get('styleselect')) { - t._importClasses(); - - formatNames = []; - each(c.items, function(item) { - formatNames.push(item.value); - }); - - matches = ed.formatter.matchAll(formatNames); - c.select(matches[0]); - tinymce.each(matches, function(match, index) { - if (index > 0) { - c.mark(match); - } - }); - } - - if (c = cm.get('formatselect')) { - p = getParent(ed.dom.isBlock); - - if (p) - c.select(p.nodeName.toLowerCase()); - } - - // Find out current fontSize, fontFamily and fontClass - getParent(function(n) { - if (n.nodeName === 'SPAN') { - if (!cl && n.className) - cl = n.className; - } - - if (ed.dom.is(n, s.theme_advanced_font_selector)) { - if (!fz && n.style.fontSize) - fz = n.style.fontSize; - - if (!fn && n.style.fontFamily) - fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); - - if (!fc && n.style.color) - fc = n.style.color; - - if (!bc && n.style.backgroundColor) - bc = n.style.backgroundColor; - } - - return false; - }); - - if (c = cm.get('fontselect')) { - c.select(function(v) { - return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; - }); - } - - // Select font size - if (c = cm.get('fontsizeselect')) { - // Use computed style - if (s.theme_advanced_runtime_fontsize && !fz && !cl) - fz = ed.dom.getStyle(n, 'fontSize', true); - - c.select(function(v) { - if (v.fontSize && v.fontSize === fz) - return true; - - if (v['class'] && v['class'] === cl) - return true; - }); - } - - if (s.theme_advanced_show_current_color) { - function updateColor(controlId, color) { - if (c = cm.get(controlId)) { - if (!color) - color = c.settings.default_color; - if (color !== c.value) { - c.displayColor(color); - } - } - } - updateColor('forecolor', fc); - updateColor('backcolor', bc); - } - - if (s.theme_advanced_show_current_color) { - function updateColor(controlId, color) { - if (c = cm.get(controlId)) { - if (!color) - color = c.settings.default_color; - if (color !== c.value) { - c.displayColor(color); - } - } - }; - - updateColor('forecolor', fc); - updateColor('backcolor', bc); - } - - if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { - p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); - - if (t.statusKeyboardNavigation) { - t.statusKeyboardNavigation.destroy(); - t.statusKeyboardNavigation = null; - } - - DOM.setHTML(p, ''); - - getParent(function(n) { - var na = n.nodeName.toLowerCase(), u, pi, ti = ''; - - // Ignore non element and bogus/hidden elements - if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) - return; - - // Handle prefix - if (tinymce.isIE && n.scopeName !== 'HTML' && n.scopeName) - na = n.scopeName + ':' + na; - - // Remove internal prefix - na = na.replace(/mce\:/g, ''); - - // Handle node name - switch (na) { - case 'b': - na = 'strong'; - break; - - case 'i': - na = 'em'; - break; - - case 'img': - if (v = DOM.getAttrib(n, 'src')) - ti += 'src: ' + v + ' '; - - break; - - case 'a': - if (v = DOM.getAttrib(n, 'name')) { - ti += 'name: ' + v + ' '; - na += '#' + v; - } - - if (v = DOM.getAttrib(n, 'href')) - ti += 'href: ' + v + ' '; - - break; - - case 'font': - if (v = DOM.getAttrib(n, 'face')) - ti += 'font: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'size')) - ti += 'size: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'color')) - ti += 'color: ' + v + ' '; - - break; - - case 'span': - if (v = DOM.getAttrib(n, 'style')) - ti += 'style: ' + v + ' '; - - break; - } - - if (v = DOM.getAttrib(n, 'id')) - ti += 'id: ' + v + ' '; - - if (v = n.className) { - v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, ''); - - if (v) { - ti += 'class: ' + v + ' '; - - if (ed.dom.isBlock(n) || na == 'img' || na == 'span') - na += '.' + v; - } - } - - na = na.replace(/(html:)/g, ''); - na = {name : na, node : n, title : ti}; - t.onResolveName.dispatch(t, na); - ti = na.title; - na = na.name; - - //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; - pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); - - if (p.hasChildNodes()) { - p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); - p.insertBefore(pi, p.firstChild); - } else - p.appendChild(pi); - }, ed.getBody()); - - if (DOM.select('a', p).length > 0) { - t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ - root: ed.id + "_path_row", - items: DOM.select('a', p), - excludeFromTabOrder: true, - onCancel: function() { - ed.focus(); - } - }, DOM); - } - } - }, - - // Commands gets called by execCommand - - _sel : function(v) { - this.editor.execCommand('mceSelectNodeDepth', false, v); - }, - - _mceInsertAnchor : function(ui, v) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/anchor.htm', - width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), - height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceCharMap : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/charmap.htm', - width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), - height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceHelp : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/about.htm', - width : 480, - height : 380, - inline : true - }, { - theme_url : this.url - }); - }, - - _mceShortcuts : function() { - var ed = this.editor; - ed.windowManager.open({ - url: this.url + '/shortcuts.htm', - width: 480, - height: 380, - inline: true - }, { - theme_url: this.url - }); - }, - - _mceColorPicker : function(u, v) { - var ed = this.editor; - - v = v || {}; - - ed.windowManager.open({ - url : this.url + '/color_picker.htm', - width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), - close_previous : false, - inline : true - }, { - input_color : v.color, - func : v.func, - theme_url : this.url - }); - }, - - _mceCodeEditor : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/source_editor.htm', - width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), - height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), - inline : true, - resizable : true, - maximizable : true - }, { - theme_url : this.url - }); - }, - - _mceImage : function(ui, val) { - var ed = this.editor; - - // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) - return; - - ed.windowManager.open({ - url : this.url + '/image.htm', - width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), - height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceLink : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/link.htm', - width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), - height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceNewDocument : function() { - var ed = this.editor; - - ed.windowManager.confirm('advanced.newdocument', function(s) { - if (s) - ed.execCommand('mceSetContent', false, ''); - }); - }, - - _mceForeColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.fgColor, - func : function(co) { - t.fgColor = co; - t.editor.execCommand('ForeColor', false, co); - } - }); - }, - - _mceBackColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.bgColor, - func : function(co) { - t.bgColor = co; - t.editor.execCommand('HiliteColor', false, co); - } - }); - }, - - _ufirst : function(s) { - return s.substring(0, 1).toUpperCase() + s.substring(1); - } - }); - - tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); -}(tinymce)); +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + + // Generates a preview for a format + function getPreviewCss(ed, fmt) { + var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName; + + previewStyles = ed.settings.preview_styles; + + // No preview forced + if (previewStyles === false) + return ''; + + // Default preview + if (!previewStyles) + previewStyles = 'font-family font-size font-weight text-decoration text-transform color background-color'; + + // Removes any variables since these can't be previewed + function removeVars(val) { + return val.replace(/%(\w+)/g, ''); + }; + + // Create block/inline element to use for preview + name = fmt.block || fmt.inline || 'span'; + previewElm = dom.create(name); + + // Add format styles to preview element + each(fmt.styles, function(value, name) { + value = removeVars(value); + + if (value) + dom.setStyle(previewElm, name, value); + }); + + // Add attributes to preview element + each(fmt.attributes, function(value, name) { + value = removeVars(value); + + if (value) + dom.setAttrib(previewElm, name, value); + }); + + // Add classes to preview element + each(fmt.classes, function(value) { + value = removeVars(value); + + if (!dom.hasClass(previewElm, value)) + dom.addClass(previewElm, value); + }); + + // Add the previewElm outside the visual area + dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF}); + ed.getBody().appendChild(previewElm); + + // Get parent container font size so we can compute px values out of em/% for older IE:s + parentFontSize = dom.getStyle(ed.getBody(), 'fontSize', true); + parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; + + each(previewStyles.split(' '), function(name) { + var value = dom.getStyle(previewElm, name, true); + + // If background is transparent then check if the body has a background color we can use + if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) { + value = dom.getStyle(ed.getBody(), name, true); + + // Ignore white since it's the default color, not the nicest fix + if (dom.toHex(value).toLowerCase() == '#ffffff') { + return; + } + } + + // Old IE won't calculate the font size so we need to do that manually + if (name == 'font-size') { + if (/em|%$/.test(value)) { + if (parentFontSize === 0) { + return; + } + + // Convert font size from em/% to px + value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1); + value = (value * parentFontSize) + 'px'; + } + } + + previewCss += name + ':' + value + ';'; + }); + + dom.remove(previewElm); + + return previewCss; + }; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('advanced'); + + tinymce.create('tinymce.themes.AdvancedTheme', { + sizes : [8, 10, 12, 14, 18, 24, 36], + + // Control name lookup, format: title, command + controls : { + bold : ['bold_desc', 'Bold'], + italic : ['italic_desc', 'Italic'], + underline : ['underline_desc', 'Underline'], + strikethrough : ['striketrough_desc', 'Strikethrough'], + justifyleft : ['justifyleft_desc', 'JustifyLeft'], + justifycenter : ['justifycenter_desc', 'JustifyCenter'], + justifyright : ['justifyright_desc', 'JustifyRight'], + justifyfull : ['justifyfull_desc', 'JustifyFull'], + bullist : ['bullist_desc', 'InsertUnorderedList'], + numlist : ['numlist_desc', 'InsertOrderedList'], + outdent : ['outdent_desc', 'Outdent'], + indent : ['indent_desc', 'Indent'], + cut : ['cut_desc', 'Cut'], + copy : ['copy_desc', 'Copy'], + paste : ['paste_desc', 'Paste'], + undo : ['undo_desc', 'Undo'], + redo : ['redo_desc', 'Redo'], + link : ['link_desc', 'mceLink'], + unlink : ['unlink_desc', 'unlink'], + image : ['image_desc', 'mceImage'], + cleanup : ['cleanup_desc', 'mceCleanup'], + help : ['help_desc', 'mceHelp'], + code : ['code_desc', 'mceCodeEditor'], + hr : ['hr_desc', 'InsertHorizontalRule'], + removeformat : ['removeformat_desc', 'RemoveFormat'], + sub : ['sub_desc', 'subscript'], + sup : ['sup_desc', 'superscript'], + forecolor : ['forecolor_desc', 'ForeColor'], + forecolorpicker : ['forecolor_desc', 'mceForeColor'], + backcolor : ['backcolor_desc', 'HiliteColor'], + backcolorpicker : ['backcolor_desc', 'mceBackColor'], + charmap : ['charmap_desc', 'mceCharMap'], + visualaid : ['visualaid_desc', 'mceToggleVisualAid'], + anchor : ['anchor_desc', 'mceInsertAnchor'], + newdocument : ['newdocument_desc', 'mceNewDocument'], + blockquote : ['blockquote_desc', 'mceBlockQuote'] + }, + + stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], + + init : function(ed, url) { + var t = this, s, v, o; + + t.editor = ed; + t.url = url; + t.onResolveName = new tinymce.util.Dispatcher(this); + s = ed.settings; + + ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); + ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; + + // Setup default buttons + if (!s.theme_advanced_buttons1) { + s = extend({ + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", + theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", + theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap" + }, s); + } + + // Default settings + t.settings = s = extend({ + theme_advanced_path : true, + theme_advanced_toolbar_location : 'top', + theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", + theme_advanced_toolbar_align : "left", + theme_advanced_statusbar_location : "bottom", + theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", + theme_advanced_more_colors : 1, + theme_advanced_row_height : 23, + theme_advanced_resize_horizontal : 1, + theme_advanced_resizing_use_cookie : 1, + theme_advanced_font_sizes : "1,2,3,4,5,6,7", + theme_advanced_font_selector : "span", + theme_advanced_show_current_color: 0, + readonly : ed.settings.readonly + }, s); + + // Setup default font_size_style_values + if (!s.font_size_style_values) + s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; + + if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { + s.font_size_style_values = tinymce.explode(s.font_size_style_values); + s.font_size_classes = tinymce.explode(s.font_size_classes || ''); + + // Parse string value + o = {}; + ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; + each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { + var cl; + + if (k == v && v >= 1 && v <= 7) { + k = v + ' (' + t.sizes[v - 1] + 'pt)'; + cl = s.font_size_classes[v - 1]; + v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); + } + + if (/^\s*\./.test(v)) + cl = v.replace(/\./g, ''); + + o[k] = cl ? {'class' : cl} : {fontSize : v}; + }); + + s.theme_advanced_font_sizes = o; + } + + if ((v = s.theme_advanced_path_location) && v != 'none') + s.theme_advanced_statusbar_location = s.theme_advanced_path_location; + + if (s.theme_advanced_statusbar_location == 'none') + s.theme_advanced_statusbar_location = 0; + + if (ed.settings.content_css !== false) + ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); + + // Init editor + ed.onInit.add(function() { + if (!ed.settings.readonly) { + ed.onNodeChange.add(t._nodeChanged, t); + ed.onKeyUp.add(t._updateUndoStatus, t); + ed.onMouseUp.add(t._updateUndoStatus, t); + ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { + t._updateUndoStatus(ed); + }); + } + }); + + ed.onSetProgressState.add(function(ed, b, ti) { + var co, id = ed.id, tb; + + if (b) { + t.progressTimer = setTimeout(function() { + co = ed.getContainer(); + co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); + tb = DOM.get(ed.id + '_tbl'); + + DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); + DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); + }, ti || 0); + } else { + DOM.remove(id + '_blocker'); + DOM.remove(id + '_progress'); + clearTimeout(t.progressTimer); + } + }); + + DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); + + if (s.skin_variant) + DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); + }, + + _isHighContrast : function() { + var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); + + actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); + DOM.remove(div); + + return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; + }, + + createControl : function(n, cf) { + var cd, c; + + if (c = cf.createControl(n)) + return c; + + switch (n) { + case "styleselect": + return this._createStyleSelect(); + + case "formatselect": + return this._createBlockFormats(); + + case "fontselect": + return this._createFontSelect(); + + case "fontsizeselect": + return this._createFontSizeSelect(); + + case "forecolor": + return this._createForeColorMenu(); + + case "backcolor": + return this._createBackColorMenu(); + } + + if ((cd = this.controls[n])) + return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); + }, + + execCommand : function(cmd, ui, val) { + var f = this['_' + cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + + return false; + }, + + _importClasses : function(e) { + var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); + + if (ctrl.getLength() == 0) { + each(ed.dom.getClasses(), function(o, idx) { + var name = 'style_' + idx, fmt; + + fmt = { + inline : 'span', + attributes : {'class' : o['class']}, + selector : '*' + }; + + ed.formatter.register(name, fmt); + + ctrl.add(o['class'], name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + }); + } + }, + + _createStyleSelect : function(n) { + var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; + + // Setup style select box + ctrl = ctrlMan.createListBox('styleselect', { + title : 'advanced.style_select', + onselect : function(name) { + var matches, formatNames = [], removedFormat; + + each(ctrl.items, function(item) { + formatNames.push(item.value); + }); + + ed.focus(); + ed.undoManager.add(); + + // Toggle off the current format(s) + matches = ed.formatter.matchAll(formatNames); + tinymce.each(matches, function(match) { + if (!name || match == name) { + if (match) + ed.formatter.remove(match); + + removedFormat = true; + } + }); + + if (!removedFormat) + ed.formatter.apply(name); + + ed.undoManager.add(); + ed.nodeChanged(); + + return false; // No auto select + } + }); + + // Handle specified format + ed.onPreInit.add(function() { + var counter = 0, formats = ed.getParam('style_formats'); + + if (formats) { + each(formats, function(fmt) { + var name, keys = 0; + + each(fmt, function() {keys++;}); + + if (keys > 1) { + name = fmt.name = fmt.name || 'style_' + (counter++); + ed.formatter.register(name, fmt); + ctrl.add(fmt.title, name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + } else + ctrl.add(fmt.title); + }); + } else { + each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { + var name, fmt; + + if (val) { + name = 'style_' + (counter++); + fmt = { + inline : 'span', + classes : val, + selector : '*' + }; + + ed.formatter.register(name, fmt); + ctrl.add(t.editor.translate(key), name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + } + }); + } + }); + + // Auto import classes if the ctrl box is empty + if (ctrl.getLength() == 0) { + ctrl.onPostRender.add(function(ed, n) { + if (!ctrl.NativeListBox) { + Event.add(n.id + '_text', 'focus', t._importClasses, t); + Event.add(n.id + '_text', 'mousedown', t._importClasses, t); + Event.add(n.id + '_open', 'focus', t._importClasses, t); + Event.add(n.id + '_open', 'mousedown', t._importClasses, t); + } else + Event.add(n.id, 'focus', t._importClasses, t); + }); + } + + return ctrl; + }, + + _createFontSelect : function() { + var c, t = this, ed = t.editor; + + c = ed.controlManager.createListBox('fontselect', { + title : 'advanced.fontdefault', + onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + ed.execCommand('FontName', false, cur.value); + return; + } + + ed.execCommand('FontName', false, v); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && cur.value == v) { + c.select(null); + } + + return false; // No auto select + } + }); + + if (c) { + each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { + c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); + }); + } + + return c; + }, + + _createFontSizeSelect : function() { + var t = this, ed = t.editor, c, i = 0, cl = []; + + c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + cur = cur.value; + + if (cur['class']) { + ed.formatter.toggle('fontsize_class', {value : cur['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else { + ed.execCommand('FontSize', false, cur.fontSize); + } + + return; + } + + if (v['class']) { + ed.focus(); + ed.undoManager.add(); + ed.formatter.toggle('fontsize_class', {value : v['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else + ed.execCommand('FontSize', false, v.fontSize); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) { + c.select(null); + } + + return false; // No auto select + }}); + + if (c) { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + var fz = v.fontSize; + + if (fz >= 1 && fz <= 7) + fz = t.sizes[parseInt(fz) - 1] + 'pt'; + + c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); + }); + } + + return c; + }, + + _createBlockFormats : function() { + var c, fmts = { + p : 'advanced.paragraph', + address : 'advanced.address', + pre : 'advanced.pre', + h1 : 'advanced.h1', + h2 : 'advanced.h2', + h3 : 'advanced.h3', + h4 : 'advanced.h4', + h5 : 'advanced.h5', + h6 : 'advanced.h6', + div : 'advanced.div', + blockquote : 'advanced.blockquote', + code : 'advanced.code', + dt : 'advanced.dt', + dd : 'advanced.dd', + samp : 'advanced.samp' + }, t = this; + + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { + t.editor.execCommand('FormatBlock', false, v); + return false; + }}); + + if (c) { + each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v, style: function() { + return getPreviewCss(t.editor, {block: v}); + }}); + }); + } + + return c; + }, + + _createForeColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_text_colors) + o.colors = v; + + if (s.theme_advanced_default_foreground_color) + o.default_color = s.theme_advanced_default_foreground_color; + + o.title = 'advanced.forecolor_desc'; + o.cmd = 'ForeColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('forecolor', o); + + return c; + }, + + _createBackColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_background_colors) + o.colors = v; + + if (s.theme_advanced_default_background_color) + o.default_color = s.theme_advanced_default_background_color; + + o.title = 'advanced.backcolor_desc'; + o.cmd = 'HiliteColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('backcolor', o); + + return c; + }, + + renderUI : function(o) { + var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; + + if (ed.settings) { + ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); + } + + // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. + // Maybe actually inherit it from the original textara? + n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '') + (ed.settings.directionality == "rtl" ? ' mceRtl' : '')}); + DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); + + if (!DOM.boxModel) + n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); + + n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = tb = DOM.add(n, 'tbody'); + + switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { + case "rowlayout": + ic = t._rowLayout(s, tb, o); + break; + + case "customlayout": + ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); + break; + + default: + ic = t._simpleLayout(s, tb, o, p); + } + + n = o.targetNode; + + // Add classes to first and last TRs + nl = sc.rows; + DOM.addClass(nl[0], 'mceFirst'); + DOM.addClass(nl[nl.length - 1], 'mceLast'); + + // Add classes to first and last TDs + each(DOM.select('tr', tb), function(n) { + DOM.addClass(n.firstChild, 'mceFirst'); + DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); + }); + + if (DOM.get(s.theme_advanced_toolbar_container)) + DOM.get(s.theme_advanced_toolbar_container).appendChild(p); + else + DOM.insertAfter(p, n); + + Event.add(ed.id + '_path_row', 'click', function(e) { + e = e.target; + + if (e.nodeName == 'A') { + t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); + return false; + } + }); +/* + if (DOM.get(ed.id + '_path_row')) { + Event.add(ed.id + '_tbl', 'mouseover', function(e) { + var re; + + e = e.target; + + if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { + re = DOM.get(ed.id + '_path_row'); + t.lastPath = re.innerHTML; + DOM.setHTML(re, e.parentNode.title); + } + }); + + Event.add(ed.id + '_tbl', 'mouseout', function(e) { + if (t.lastPath) { + DOM.setHTML(ed.id + '_path_row', t.lastPath); + t.lastPath = 0; + } + }); + } +*/ + + if (!ed.getParam('accessibility_focus')) + Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); + + if (s.theme_advanced_toolbar_location == 'external') + o.deltaHeight = 0; + + t.deltaHeight = o.deltaHeight; + o.targetNode = null; + + ed.onKeyDown.add(function(ed, evt) { + var DOM_VK_F10 = 121, DOM_VK_F11 = 122; + + if (evt.altKey) { + if (evt.keyCode === DOM_VK_F10) { + // Make sure focus is given to toolbar in Safari. + // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame + if (tinymce.isWebKit) { + window.focus(); + } + t.toolbarGroup.focus(); + return Event.cancel(evt); + } else if (evt.keyCode === DOM_VK_F11) { + DOM.get(ed.id + '_path_row').focus(); + return Event.cancel(evt); + } + } + }); + + // alt+0 is the UK recommended shortcut for accessing the list of access controls. + ed.addShortcut('alt+0', '', 'mceShortcuts', t); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_parent', + sizeContainer : sc, + deltaHeight : o.deltaHeight + }; + }, + + getInfo : function() { + return { + longname : 'Advanced theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + }, + + resizeBy : function(dw, dh) { + var e = DOM.get(this.editor.id + '_ifr'); + + this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); + }, + + resizeTo : function(w, h, store) { + var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); + + // Boundery fix box + w = Math.max(s.theme_advanced_resizing_min_width || 100, w); + h = Math.max(s.theme_advanced_resizing_min_height || 100, h); + w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); + h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); + + // Resize iframe and container + DOM.setStyle(e, 'height', ''); + DOM.setStyle(ifr, 'height', h); + + if (s.theme_advanced_resize_horizontal) { + DOM.setStyle(e, 'width', ''); + DOM.setStyle(ifr, 'width', w); + + // Make sure that the size is never smaller than the over all ui + if (w < e.clientWidth) { + w = e.clientWidth; + DOM.setStyle(ifr, 'width', e.clientWidth); + } + } + + // Store away the size + if (store && s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : w, + ch : h + }); + } + }, + + destroy : function() { + var id = this.editor.id; + + Event.clear(id + '_resize'); + Event.clear(id + '_path_row'); + Event.clear(id + '_external_close'); + }, + + // Internal functions + + _simpleLayout : function(s, tb, o, p) { + var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; + + if (s.readonly) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + return ic; + } + + // Create toolbar container at top + if (lo == 'top') + t._addToolbars(tb, o); + + // Create external toolbar + if (lo == 'external') { + n = c = DOM.create('div', {style : 'position:relative'}); + n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); + DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); + n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); + etb = DOM.add(n, 'tbody'); + + if (p.firstChild.className == 'mceOldBoxModel') + p.firstChild.appendChild(c); + else + p.insertBefore(c, p.firstChild); + + t._addToolbars(etb, o); + + ed.onMouseUp.add(function() { + var e = DOM.get(ed.id + '_external'); + DOM.show(e); + + DOM.hide(lastExtID); + + var f = Event.add(ed.id + '_external_close', 'click', function() { + DOM.hide(ed.id + '_external'); + Event.remove(ed.id + '_external_close', 'click', f); + return false; + }); + + DOM.show(e); + DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); + + // Fixes IE rendering bug + DOM.hide(e); + DOM.show(e); + e.style.filter = ''; + + lastExtID = ed.id + '_external'; + + e = null; + }); + } + + if (sl == 'top') + t._addStatusBar(tb, o); + + // Create iframe container + if (!s.theme_advanced_toolbar_container) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + } + + // Create toolbar container at bottom + if (lo == 'bottom') + t._addToolbars(tb, o); + + if (sl == 'bottom') + t._addStatusBar(tb, o); + + return ic; + }, + + _rowLayout : function(s, tb, o) { + var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; + + dc = s.theme_advanced_containers_default_class || ''; + da = s.theme_advanced_containers_default_align || 'center'; + + each(explode(s.theme_advanced_containers || ''), function(c, i) { + var v = s['theme_advanced_container_' + c] || ''; + + switch (c.toLowerCase()) { + case 'mceeditor': + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + break; + + case 'mceelementpath': + t._addStatusBar(tb, o); + break; + + default: + a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(tb, 'tr'), 'td', { + 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da + }); + + to = cf.createToolbar("toolbar" + i); + t._addControls(v, to); + DOM.setHTML(n, to.renderHTML()); + o.deltaHeight -= s.theme_advanced_row_height; + } + }); + + return ic; + }, + + _addControls : function(v, tb) { + var t = this, s = t.settings, di, cf = t.editor.controlManager; + + if (s.theme_advanced_disable && !t._disabled) { + di = {}; + + each(explode(s.theme_advanced_disable), function(v) { + di[v] = 1; + }); + + t._disabled = di; + } else + di = t._disabled; + + each(explode(v), function(n) { + var c; + + if (di && di[n]) + return; + + // Compatiblity with 2.x + if (n == 'tablecontrols') { + each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { + n = t.createControl(n, cf); + + if (n) + tb.add(n); + }); + + return; + } + + c = t.createControl(n, cf); + + if (c) + tb.add(c); + }); + }, + + _addToolbars : function(c, o) { + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup, toolbarsExist = false; + + toolbarGroup = cf.createToolbarGroup('toolbargroup', { + 'name': ed.getLang('advanced.toolbar'), + 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') + }); + + t.toolbarGroup = toolbarGroup; + + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(c, 'tr', {role: 'toolbar'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"}); + + // Create toolbar and add the controls + for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { + toolbarsExist = true; + tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); + + if (s['theme_advanced_buttons' + i + '_add']) + v += ',' + s['theme_advanced_buttons' + i + '_add']; + + if (s['theme_advanced_buttons' + i + '_add_before']) + v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; + + t._addControls(v, tb); + toolbarGroup.add(tb); + + o.deltaHeight -= s.theme_advanced_row_height; + } + // Handle case when there are no toolbar buttons and ensure editor height is adjusted accordingly + if (!toolbarsExist) + o.deltaHeight -= s.theme_advanced_row_height; + h.push(toolbarGroup.renderHTML()); + h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); + DOM.setHTML(n, h.join('')); + }, + + _addStatusBar : function(tb, o) { + var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; + + n = DOM.add(tb, 'tr'); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); + if (s.theme_advanced_path) { + DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); + DOM.add(n, 'span', {}, ': '); + } else { + DOM.add(n, 'span', {}, ' '); + } + + + if (s.theme_advanced_resizing) { + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); + + if (s.theme_advanced_resizing_use_cookie) { + ed.onPostRender.add(function() { + var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); + + if (!o) + return; + + t.resizeTo(o.cw, o.ch); + }); + } + + ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'click', function(e) { + e.preventDefault(); + }); + + Event.add(ed.id + '_resize', 'mousedown', function(e) { + var mouseMoveHandler1, mouseMoveHandler2, + mouseUpHandler1, mouseUpHandler2, + startX, startY, startWidth, startHeight, width, height, ifrElm; + + function resizeOnMove(e) { + e.preventDefault(); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + + t.resizeTo(width, height); + }; + + function endResize(e) { + // Stop listening + Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); + Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); + Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); + Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + t.resizeTo(width, height, true); + + ed.nodeChanged(); + }; + + e.preventDefault(); + + // Get the current rect size + startX = e.screenX; + startY = e.screenY; + ifrElm = DOM.get(t.editor.id + '_ifr'); + startWidth = width = ifrElm.clientWidth; + startHeight = height = ifrElm.clientHeight; + + // Register envent handlers + mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); + mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); + mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); + mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); + }); + }); + } + + o.deltaHeight -= 21; + n = tb = null; + }, + + _updateUndoStatus : function(ed) { + var cm = ed.controlManager, um = ed.undoManager; + + cm.setDisabled('undo', !um.hasUndo() && !um.typing); + cm.setDisabled('redo', !um.hasRedo()); + }, + + _nodeChanged : function(ed, cm, n, co, ob) { + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; + + tinymce.each(t.stateControls, function(c) { + cm.setActive(c, ed.queryCommandState(t.controls[c][1])); + }); + + function getParent(name) { + var i, parents = ob.parents, func = name; + + if (typeof(name) == 'string') { + func = function(node) { + return node.nodeName == name; + }; + } + + for (i = 0; i < parents.length; i++) { + if (func(parents[i])) + return parents[i]; + } + }; + + cm.setActive('visualaid', ed.hasVisual); + t._updateUndoStatus(ed); + cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); + + p = getParent('A'); + if (c = cm.get('link')) { + c.setDisabled((!p && co) || (p && !p.href)); + c.setActive(!!p && (!p.name && !p.id)); + } + + if (c = cm.get('unlink')) { + c.setDisabled(!p && co); + c.setActive(!!p && !p.name && !p.id); + } + + if (c = cm.get('anchor')) { + c.setActive(!co && !!p && (p.name || (p.id && !p.href))); + } + + p = getParent('IMG'); + if (c = cm.get('image')) + c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); + + if (c = cm.get('styleselect')) { + t._importClasses(); + + formatNames = []; + each(c.items, function(item) { + formatNames.push(item.value); + }); + + matches = ed.formatter.matchAll(formatNames); + c.select(matches[0]); + tinymce.each(matches, function(match, index) { + if (index > 0) { + c.mark(match); + } + }); + } + + if (c = cm.get('formatselect')) { + p = getParent(ed.dom.isBlock); + + if (p) + c.select(p.nodeName.toLowerCase()); + } + + // Find out current fontSize, fontFamily and fontClass + getParent(function(n) { + if (n.nodeName === 'SPAN') { + if (!cl && n.className) + cl = n.className; + } + + if (ed.dom.is(n, s.theme_advanced_font_selector)) { + if (!fz && n.style.fontSize) + fz = n.style.fontSize; + + if (!fn && n.style.fontFamily) + fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + + if (!fc && n.style.color) + fc = n.style.color; + + if (!bc && n.style.backgroundColor) + bc = n.style.backgroundColor; + } + + return false; + }); + + if (c = cm.get('fontselect')) { + c.select(function(v) { + return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; + }); + } + + // Select font size + if (c = cm.get('fontsizeselect')) { + // Use computed style + if (s.theme_advanced_runtime_fontsize && !fz && !cl) + fz = ed.dom.getStyle(n, 'fontSize', true); + + c.select(function(v) { + if (v.fontSize && v.fontSize === fz) + return true; + + if (v['class'] && v['class'] === cl) + return true; + }); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + } + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + }; + + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { + p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + + if (t.statusKeyboardNavigation) { + t.statusKeyboardNavigation.destroy(); + t.statusKeyboardNavigation = null; + } + + DOM.setHTML(p, ''); + + getParent(function(n) { + var na = n.nodeName.toLowerCase(), u, pi, ti = ''; + + // Ignore non element and bogus/hidden elements + if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) + return; + + // Handle prefix + if (tinymce.isIE && n.scopeName !== 'HTML' && n.scopeName) + na = n.scopeName + ':' + na; + + // Remove internal prefix + na = na.replace(/mce\:/g, ''); + + // Handle node name + switch (na) { + case 'b': + na = 'strong'; + break; + + case 'i': + na = 'em'; + break; + + case 'img': + if (v = DOM.getAttrib(n, 'src')) + ti += 'src: ' + v + ' '; + + break; + + case 'a': + if (v = DOM.getAttrib(n, 'name')) { + ti += 'name: ' + v + ' '; + na += '#' + v; + } + + if (v = DOM.getAttrib(n, 'href')) + ti += 'href: ' + v + ' '; + + break; + + case 'font': + if (v = DOM.getAttrib(n, 'face')) + ti += 'font: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'size')) + ti += 'size: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'color')) + ti += 'color: ' + v + ' '; + + break; + + case 'span': + if (v = DOM.getAttrib(n, 'style')) + ti += 'style: ' + v + ' '; + + break; + } + + if (v = DOM.getAttrib(n, 'id')) + ti += 'id: ' + v + ' '; + + if (v = n.className) { + v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, ''); + + if (v) { + ti += 'class: ' + v + ' '; + + if (ed.dom.isBlock(n) || na == 'img' || na == 'span') + na += '.' + v; + } + } + + na = na.replace(/(html:)/g, ''); + na = {name : na, node : n, title : ti}; + t.onResolveName.dispatch(t, na); + ti = na.title; + na = na.name; + + //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; + pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + + if (p.hasChildNodes()) { + p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); + p.insertBefore(pi, p.firstChild); + } else + p.appendChild(pi); + }, ed.getBody()); + + if (DOM.select('a', p).length > 0) { + t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ + root: ed.id + "_path_row", + items: DOM.select('a', p), + excludeFromTabOrder: true, + onCancel: function() { + ed.focus(); + } + }, DOM); + } + } + }, + + // Commands gets called by execCommand + + _sel : function(v) { + this.editor.execCommand('mceSelectNodeDepth', false, v); + }, + + _mceInsertAnchor : function(ui, v) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/anchor.htm', + width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), + height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceCharMap : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/charmap.htm', + width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceHelp : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/about.htm', + width : 480, + height : 380, + inline : true + }, { + theme_url : this.url + }); + }, + + _mceShortcuts : function() { + var ed = this.editor; + ed.windowManager.open({ + url: this.url + '/shortcuts.htm', + width: 480, + height: 380, + inline: true + }, { + theme_url: this.url + }); + }, + + _mceColorPicker : function(u, v) { + var ed = this.editor; + + v = v || {}; + + ed.windowManager.open({ + url : this.url + '/color_picker.htm', + width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), + close_previous : false, + inline : true + }, { + input_color : v.color, + func : v.func, + theme_url : this.url + }); + }, + + _mceCodeEditor : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/source_editor.htm', + width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), + height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), + inline : true, + resizable : true, + maximizable : true + }, { + theme_url : this.url + }); + }, + + _mceImage : function(ui, val) { + var ed = this.editor; + + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + url : this.url + '/image.htm', + width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), + height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceLink : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/link.htm', + width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), + height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceNewDocument : function() { + var ed = this.editor; + + ed.windowManager.confirm('advanced.newdocument', function(s) { + if (s) + ed.execCommand('mceSetContent', false, ''); + }); + }, + + _mceForeColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.fgColor, + func : function(co) { + t.fgColor = co; + t.editor.execCommand('ForeColor', false, co); + } + }); + }, + + _mceBackColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.bgColor, + func : function(co) { + t.bgColor = co; + t.editor.execCommand('HiliteColor', false, co); + } + }); + }, + + _ufirst : function(s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + }); + + tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); +}(tinymce)); diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/about.js b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/about.js index 5b35845..a7ee0bb 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/about.js +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/about.js @@ -1,73 +1,73 @@ -tinyMCEPopup.requireLangPack(); - -function init() { - var ed, tcont; - - tinyMCEPopup.resizeToInnerSize(); - ed = tinyMCEPopup.editor; - - // Give FF some time - window.setTimeout(insertHelpIFrame, 10); - - tcont = document.getElementById('plugintablecontainer'); - document.getElementById('plugins_tab').style.display = 'none'; - - var html = ""; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - - tinymce.each(ed.plugins, function(p, n) { - var info; - - if (!p.getInfo) - return; - - html += ''; - - info = p.getInfo(); - - if (info.infourl != null && info.infourl != '') - html += ''; - else - html += ''; - - if (info.authorurl != null && info.authorurl != '') - html += ''; - else - html += ''; - - html += ''; - html += ''; - - document.getElementById('plugins_tab').style.display = ''; - - }); - - html += ''; - html += '
      ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
      ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
      '; - - tcont.innerHTML = html; - - tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; - tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; -} - -function insertHelpIFrame() { - var html; - - if (tinyMCEPopup.getParam('docs_url')) { - html = ''; - document.getElementById('iframecontainer').innerHTML = html; - document.getElementById('help_tab').style.display = 'block'; - document.getElementById('help_tab').setAttribute("aria-hidden", "false"); - } -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
      ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
      ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
      '; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + document.getElementById('help_tab').setAttribute("aria-hidden", "false"); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/anchor.js b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/anchor.js index 2909a3a..0d9c389 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/anchor.js +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/anchor.js @@ -1,56 +1,56 @@ -tinyMCEPopup.requireLangPack(); - -var AnchorDialog = { - init : function(ed) { - var action, elm, f = document.forms[0]; - - this.editor = ed; - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id'); - - if (v) { - this.action = 'update'; - f.anchorName.value = v; - } - - f.insert.value = ed.getLang(elm ? 'update' : 'insert'); - }, - - update : function() { - var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName; - - if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { - tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); - return; - } - - tinyMCEPopup.restoreSelection(); - - if (this.action != 'update') - ed.selection.collapse(1); - - var aRule = ed.schema.getElementRule('a'); - if (!aRule || aRule.attributes.name) { - attribName = 'name'; - } else { - attribName = 'id'; - } - - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - if (elm) { - elm.setAttribute(attribName, name); - elm[attribName] = name; - ed.undoManager.add(); - } else { - // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it - var attrs = {'class' : 'mceItemAnchor'}; - attrs[attribName] = name; - ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF')); - ed.nodeChanged(); - } - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName; + + if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { + tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); + return; + } + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + var aRule = ed.schema.getElementRule('a'); + if (!aRule || aRule.attributes.name) { + attribName = 'name'; + } else { + attribName = 'id'; + } + + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + if (elm) { + elm.setAttribute(attribName, name); + elm[attribName] = name; + ed.undoManager.add(); + } else { + // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it + var attrs = {'class' : 'mceItemAnchor'}; + attrs[attribName] = name; + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF')); + ed.nodeChanged(); + } + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/charmap.js b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/charmap.js index bb18695..538745d 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/charmap.js +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/charmap.js @@ -1,363 +1,363 @@ -/** - * charmap.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -tinyMCEPopup.requireLangPack(); - -var charmap = [ - [' ', ' ', true, 'no-break space'], - ['&', '&', true, 'ampersand'], - ['"', '"', true, 'quotation mark'], -// finance - ['¢', '¢', true, 'cent sign'], - ['€', '€', true, 'euro sign'], - ['£', '£', true, 'pound sign'], - ['¥', '¥', true, 'yen sign'], -// signs - ['©', '©', true, 'copyright sign'], - ['®', '®', true, 'registered sign'], - ['™', '™', true, 'trade mark sign'], - ['‰', '‰', true, 'per mille sign'], - ['µ', 'µ', true, 'micro sign'], - ['·', '·', true, 'middle dot'], - ['•', '•', true, 'bullet'], - ['…', '…', true, 'three dot leader'], - ['′', '′', true, 'minutes / feet'], - ['″', '″', true, 'seconds / inches'], - ['§', '§', true, 'section sign'], - ['¶', '¶', true, 'paragraph sign'], - ['ß', 'ß', true, 'sharp s / ess-zed'], -// quotations - ['‹', '‹', true, 'single left-pointing angle quotation mark'], - ['›', '›', true, 'single right-pointing angle quotation mark'], - ['«', '«', true, 'left pointing guillemet'], - ['»', '»', true, 'right pointing guillemet'], - ['‘', '‘', true, 'left single quotation mark'], - ['’', '’', true, 'right single quotation mark'], - ['“', '“', true, 'left double quotation mark'], - ['”', '”', true, 'right double quotation mark'], - ['‚', '‚', true, 'single low-9 quotation mark'], - ['„', '„', true, 'double low-9 quotation mark'], - ['<', '<', true, 'less-than sign'], - ['>', '>', true, 'greater-than sign'], - ['≤', '≤', true, 'less-than or equal to'], - ['≥', '≥', true, 'greater-than or equal to'], - ['–', '–', true, 'en dash'], - ['—', '—', true, 'em dash'], - ['¯', '¯', true, 'macron'], - ['‾', '‾', true, 'overline'], - ['¤', '¤', true, 'currency sign'], - ['¦', '¦', true, 'broken bar'], - ['¨', '¨', true, 'diaeresis'], - ['¡', '¡', true, 'inverted exclamation mark'], - ['¿', '¿', true, 'turned question mark'], - ['ˆ', 'ˆ', true, 'circumflex accent'], - ['˜', '˜', true, 'small tilde'], - ['°', '°', true, 'degree sign'], - ['−', '−', true, 'minus sign'], - ['±', '±', true, 'plus-minus sign'], - ['÷', '÷', true, 'division sign'], - ['⁄', '⁄', true, 'fraction slash'], - ['×', '×', true, 'multiplication sign'], - ['¹', '¹', true, 'superscript one'], - ['²', '²', true, 'superscript two'], - ['³', '³', true, 'superscript three'], - ['¼', '¼', true, 'fraction one quarter'], - ['½', '½', true, 'fraction one half'], - ['¾', '¾', true, 'fraction three quarters'], -// math / logical - ['ƒ', 'ƒ', true, 'function / florin'], - ['∫', '∫', true, 'integral'], - ['∑', '∑', true, 'n-ary sumation'], - ['∞', '∞', true, 'infinity'], - ['√', '√', true, 'square root'], - ['∼', '∼', false,'similar to'], - ['≅', '≅', false,'approximately equal to'], - ['≈', '≈', true, 'almost equal to'], - ['≠', '≠', true, 'not equal to'], - ['≡', '≡', true, 'identical to'], - ['∈', '∈', false,'element of'], - ['∉', '∉', false,'not an element of'], - ['∋', '∋', false,'contains as member'], - ['∏', '∏', true, 'n-ary product'], - ['∧', '∧', false,'logical and'], - ['∨', '∨', false,'logical or'], - ['¬', '¬', true, 'not sign'], - ['∩', '∩', true, 'intersection'], - ['∪', '∪', false,'union'], - ['∂', '∂', true, 'partial differential'], - ['∀', '∀', false,'for all'], - ['∃', '∃', false,'there exists'], - ['∅', '∅', false,'diameter'], - ['∇', '∇', false,'backward difference'], - ['∗', '∗', false,'asterisk operator'], - ['∝', '∝', false,'proportional to'], - ['∠', '∠', false,'angle'], -// undefined - ['´', '´', true, 'acute accent'], - ['¸', '¸', true, 'cedilla'], - ['ª', 'ª', true, 'feminine ordinal indicator'], - ['º', 'º', true, 'masculine ordinal indicator'], - ['†', '†', true, 'dagger'], - ['‡', '‡', true, 'double dagger'], -// alphabetical special chars - ['À', 'À', true, 'A - grave'], - ['Á', 'Á', true, 'A - acute'], - ['Â', 'Â', true, 'A - circumflex'], - ['Ã', 'Ã', true, 'A - tilde'], - ['Ä', 'Ä', true, 'A - diaeresis'], - ['Å', 'Å', true, 'A - ring above'], - ['Æ', 'Æ', true, 'ligature AE'], - ['Ç', 'Ç', true, 'C - cedilla'], - ['È', 'È', true, 'E - grave'], - ['É', 'É', true, 'E - acute'], - ['Ê', 'Ê', true, 'E - circumflex'], - ['Ë', 'Ë', true, 'E - diaeresis'], - ['Ì', 'Ì', true, 'I - grave'], - ['Í', 'Í', true, 'I - acute'], - ['Î', 'Î', true, 'I - circumflex'], - ['Ï', 'Ï', true, 'I - diaeresis'], - ['Ð', 'Ð', true, 'ETH'], - ['Ñ', 'Ñ', true, 'N - tilde'], - ['Ò', 'Ò', true, 'O - grave'], - ['Ó', 'Ó', true, 'O - acute'], - ['Ô', 'Ô', true, 'O - circumflex'], - ['Õ', 'Õ', true, 'O - tilde'], - ['Ö', 'Ö', true, 'O - diaeresis'], - ['Ø', 'Ø', true, 'O - slash'], - ['Œ', 'Œ', true, 'ligature OE'], - ['Š', 'Š', true, 'S - caron'], - ['Ù', 'Ù', true, 'U - grave'], - ['Ú', 'Ú', true, 'U - acute'], - ['Û', 'Û', true, 'U - circumflex'], - ['Ü', 'Ü', true, 'U - diaeresis'], - ['Ý', 'Ý', true, 'Y - acute'], - ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], - ['Þ', 'Þ', true, 'THORN'], - ['à', 'à', true, 'a - grave'], - ['á', 'á', true, 'a - acute'], - ['â', 'â', true, 'a - circumflex'], - ['ã', 'ã', true, 'a - tilde'], - ['ä', 'ä', true, 'a - diaeresis'], - ['å', 'å', true, 'a - ring above'], - ['æ', 'æ', true, 'ligature ae'], - ['ç', 'ç', true, 'c - cedilla'], - ['è', 'è', true, 'e - grave'], - ['é', 'é', true, 'e - acute'], - ['ê', 'ê', true, 'e - circumflex'], - ['ë', 'ë', true, 'e - diaeresis'], - ['ì', 'ì', true, 'i - grave'], - ['í', 'í', true, 'i - acute'], - ['î', 'î', true, 'i - circumflex'], - ['ï', 'ï', true, 'i - diaeresis'], - ['ð', 'ð', true, 'eth'], - ['ñ', 'ñ', true, 'n - tilde'], - ['ò', 'ò', true, 'o - grave'], - ['ó', 'ó', true, 'o - acute'], - ['ô', 'ô', true, 'o - circumflex'], - ['õ', 'õ', true, 'o - tilde'], - ['ö', 'ö', true, 'o - diaeresis'], - ['ø', 'ø', true, 'o slash'], - ['œ', 'œ', true, 'ligature oe'], - ['š', 'š', true, 's - caron'], - ['ù', 'ù', true, 'u - grave'], - ['ú', 'ú', true, 'u - acute'], - ['û', 'û', true, 'u - circumflex'], - ['ü', 'ü', true, 'u - diaeresis'], - ['ý', 'ý', true, 'y - acute'], - ['þ', 'þ', true, 'thorn'], - ['ÿ', 'ÿ', true, 'y - diaeresis'], - ['Α', 'Α', true, 'Alpha'], - ['Β', 'Β', true, 'Beta'], - ['Γ', 'Γ', true, 'Gamma'], - ['Δ', 'Δ', true, 'Delta'], - ['Ε', 'Ε', true, 'Epsilon'], - ['Ζ', 'Ζ', true, 'Zeta'], - ['Η', 'Η', true, 'Eta'], - ['Θ', 'Θ', true, 'Theta'], - ['Ι', 'Ι', true, 'Iota'], - ['Κ', 'Κ', true, 'Kappa'], - ['Λ', 'Λ', true, 'Lambda'], - ['Μ', 'Μ', true, 'Mu'], - ['Ν', 'Ν', true, 'Nu'], - ['Ξ', 'Ξ', true, 'Xi'], - ['Ο', 'Ο', true, 'Omicron'], - ['Π', 'Π', true, 'Pi'], - ['Ρ', 'Ρ', true, 'Rho'], - ['Σ', 'Σ', true, 'Sigma'], - ['Τ', 'Τ', true, 'Tau'], - ['Υ', 'Υ', true, 'Upsilon'], - ['Φ', 'Φ', true, 'Phi'], - ['Χ', 'Χ', true, 'Chi'], - ['Ψ', 'Ψ', true, 'Psi'], - ['Ω', 'Ω', true, 'Omega'], - ['α', 'α', true, 'alpha'], - ['β', 'β', true, 'beta'], - ['γ', 'γ', true, 'gamma'], - ['δ', 'δ', true, 'delta'], - ['ε', 'ε', true, 'epsilon'], - ['ζ', 'ζ', true, 'zeta'], - ['η', 'η', true, 'eta'], - ['θ', 'θ', true, 'theta'], - ['ι', 'ι', true, 'iota'], - ['κ', 'κ', true, 'kappa'], - ['λ', 'λ', true, 'lambda'], - ['μ', 'μ', true, 'mu'], - ['ν', 'ν', true, 'nu'], - ['ξ', 'ξ', true, 'xi'], - ['ο', 'ο', true, 'omicron'], - ['π', 'π', true, 'pi'], - ['ρ', 'ρ', true, 'rho'], - ['ς', 'ς', true, 'final sigma'], - ['σ', 'σ', true, 'sigma'], - ['τ', 'τ', true, 'tau'], - ['υ', 'υ', true, 'upsilon'], - ['φ', 'φ', true, 'phi'], - ['χ', 'χ', true, 'chi'], - ['ψ', 'ψ', true, 'psi'], - ['ω', 'ω', true, 'omega'], -// symbols - ['ℵ', 'ℵ', false,'alef symbol'], - ['ϖ', 'ϖ', false,'pi symbol'], - ['ℜ', 'ℜ', false,'real part symbol'], - ['ϑ','ϑ', false,'theta symbol'], - ['ϒ', 'ϒ', false,'upsilon - hook symbol'], - ['℘', '℘', false,'Weierstrass p'], - ['ℑ', 'ℑ', false,'imaginary part'], -// arrows - ['←', '←', true, 'leftwards arrow'], - ['↑', '↑', true, 'upwards arrow'], - ['→', '→', true, 'rightwards arrow'], - ['↓', '↓', true, 'downwards arrow'], - ['↔', '↔', true, 'left right arrow'], - ['↵', '↵', false,'carriage return'], - ['⇐', '⇐', false,'leftwards double arrow'], - ['⇑', '⇑', false,'upwards double arrow'], - ['⇒', '⇒', false,'rightwards double arrow'], - ['⇓', '⇓', false,'downwards double arrow'], - ['⇔', '⇔', false,'left right double arrow'], - ['∴', '∴', false,'therefore'], - ['⊂', '⊂', false,'subset of'], - ['⊃', '⊃', false,'superset of'], - ['⊄', '⊄', false,'not a subset of'], - ['⊆', '⊆', false,'subset of or equal to'], - ['⊇', '⊇', false,'superset of or equal to'], - ['⊕', '⊕', false,'circled plus'], - ['⊗', '⊗', false,'circled times'], - ['⊥', '⊥', false,'perpendicular'], - ['⋅', '⋅', false,'dot operator'], - ['⌈', '⌈', false,'left ceiling'], - ['⌉', '⌉', false,'right ceiling'], - ['⌊', '⌊', false,'left floor'], - ['⌋', '⌋', false,'right floor'], - ['⟨', '〈', false,'left-pointing angle bracket'], - ['⟩', '〉', false,'right-pointing angle bracket'], - ['◊', '◊', true, 'lozenge'], - ['♠', '♠', true, 'black spade suit'], - ['♣', '♣', true, 'black club suit'], - ['♥', '♥', true, 'black heart suit'], - ['♦', '♦', true, 'black diamond suit'], - [' ', ' ', false,'en space'], - [' ', ' ', false,'em space'], - [' ', ' ', false,'thin space'], - ['‌', '‌', false,'zero width non-joiner'], - ['‍', '‍', false,'zero width joiner'], - ['‎', '‎', false,'left-to-right mark'], - ['‏', '‏', false,'right-to-left mark'], - ['­', '­', false,'soft hyphen'] -]; - -tinyMCEPopup.onInit.add(function() { - tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); - addKeyboardNavigation(); -}); - -function addKeyboardNavigation(){ - var tableElm, cells, settings; - - cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); - - settings ={ - root: "charmapgroup", - items: cells - }; - cells[0].tabindex=0; - tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); - if (tinymce.isGecko) { - cells[0].focus(); - } else { - setTimeout(function(){ - cells[0].focus(); - }, 100); - } - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); -} - -function renderCharMapHTML() { - var charsPerRow = 20, tdWidth=20, tdHeight=20, i; - var html = '
      '+ - ''; - var cols=-1; - - for (i=0; i' - + '' - + charmap[i][1] - + ''; - if ((cols+1) % charsPerRow == 0) - html += ''; - } - } - - if (cols % charsPerRow > 0) { - var padd = charsPerRow - (cols % charsPerRow); - for (var i=0; i '; - } - - html += '
      '; - html = html.replace(/<\/tr>/g, ''); - - return html; -} - -function insertChar(chr) { - tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); - - // Refocus in window - if (tinyMCEPopup.isWindow) - window.focus(); - - tinyMCEPopup.editor.focus(); - tinyMCEPopup.close(); -} - -function previewChar(codeA, codeB, codeN) { - var elmA = document.getElementById('codeA'); - var elmB = document.getElementById('codeB'); - var elmV = document.getElementById('codeV'); - var elmN = document.getElementById('codeN'); - - if (codeA=='#160;') { - elmV.innerHTML = '__'; - } else { - elmV.innerHTML = '&' + codeA; - } - - elmB.innerHTML = '&' + codeA; - elmA.innerHTML = '&' + codeB; - elmN.innerHTML = codeN; -} +/** + * charmap.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true, 'lozenge'], + ['♠', '♠', true, 'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); + addKeyboardNavigation(); +}); + +function addKeyboardNavigation(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); + + settings ={ + root: "charmapgroup", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); +} + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = '
      '+ + ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
      '; + html = html.replace(/<\/tr>/g, ''); + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/color_picker.js b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/color_picker.js index 4ae53ab..2b4757f 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/color_picker.js +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/color_picker.js @@ -1,345 +1,345 @@ -tinyMCEPopup.requireLangPack(); - -var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; - -var colors = [ - "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", - "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", - "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", - "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", - "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", - "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", - "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", - "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", - "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", - "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", - "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", - "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", - "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", - "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", - "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", - "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", - "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", - "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", - "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", - "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", - "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", - "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", - "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", - "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", - "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", - "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", - "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" -]; - -var named = { - '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', - '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', - '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', - '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', - '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', - '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', - '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', - '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', - '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', - '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', - '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', - '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', - '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', - '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', - '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', - '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', - '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', - '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', - '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', - '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', - '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', - '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', - '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' -}; - -var namedLookup = {}; - -function init() { - var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; - - tinyMCEPopup.resizeToInnerSize(); - - generatePicker(); - generateWebColors(); - generateNamedColors(); - - if (inputColor) { - changeFinalColor(inputColor); - - col = convertHexToRGB(inputColor); - - if (col) - updateLight(col.r, col.g, col.b); - } - - for (key in named) { - value = named[key]; - namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); - } -} - -function toHexColor(color) { - var matches, red, green, blue, toInt = parseInt; - - function hex(value) { - value = parseInt(value).toString(16); - - return value.length > 1 ? value : '0' + value; // Padd with leading zero - }; - - color = tinymce.trim(color); - color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#' - color = namedLookup[color] || color; - - matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color); - - if (matches) { - red = toInt(matches[1]); - green = toInt(matches[2]); - blue = toInt(matches[3]); - } else { - matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color); - - if (matches) { - red = toInt(matches[1], 16); - green = toInt(matches[2], 16); - blue = toInt(matches[3], 16); - } else { - matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color); - - if (matches) { - red = toInt(matches[1] + matches[1], 16); - green = toInt(matches[2] + matches[2], 16); - blue = toInt(matches[3] + matches[3], 16); - } else { - return ''; - } - } - } - - return '#' + hex(red) + hex(green) + hex(blue); -} - -function insertAction() { - var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); - - var hexColor = toHexColor(color); - - if (hexColor === '') { - var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value'); - tinyMCEPopup.alert(text + ': ' + color); - } - else { - tinyMCEPopup.restoreSelection(); - - if (f) - f(hexColor); - - tinyMCEPopup.close(); - } -} - -function showColor(color, name) { - if (name) - document.getElementById("colorname").innerHTML = name; - - document.getElementById("preview").style.backgroundColor = color; - document.getElementById("color").value = color.toUpperCase(); -} - -function convertRGBToHex(col) { - var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); - - if (!col) - return col; - - var rgb = col.replace(re, "$1,$2,$3").split(','); - if (rgb.length == 3) { - r = parseInt(rgb[0]).toString(16); - g = parseInt(rgb[1]).toString(16); - b = parseInt(rgb[2]).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - return "#" + r + g + b; - } - - return col; -} - -function convertHexToRGB(col) { - if (col.indexOf('#') != -1) { - col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); - - r = parseInt(col.substring(0, 2), 16); - g = parseInt(col.substring(2, 4), 16); - b = parseInt(col.substring(4, 6), 16); - - return {r : r, g : g, b : b}; - } - - return null; -} - -function generatePicker() { - var el = document.getElementById('light'), h = '', i; - - for (i = 0; i < detail; i++){ - h += '
      '; - } - - el.innerHTML = h; -} - -function generateWebColors() { - var el = document.getElementById('webcolors'), h = '', i; - - if (el.className == 'generated') - return; - - // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. - h += '
      ' - + ''; - - for (i=0; i' - + ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - if ((i+1) % 18 == 0) - h += ''; - } - - h += '
      '; - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el.firstChild); -} - -function paintCanvas(el) { - tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { - var context; - if (canvas.getContext && (context = canvas.getContext("2d"))) { - context.fillStyle = canvas.getAttribute('data-color'); - context.fillRect(0, 0, 10, 10); - } - }); -} -function generateNamedColors() { - var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; - - if (el.className == 'generated') - return; - - for (n in named) { - v = named[n]; - h += ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - i++; - } - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el); -} - -function enableKeyboardNavigation(el) { - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { - root: el, - items: tinyMCEPopup.dom.select('a', el) - }, tinyMCEPopup.dom); -} - -function dechex(n) { - return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); -} - -function computeColor(e) { - var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); - - x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); - y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); - - partWidth = document.getElementById('colors').width / 6; - partDetail = detail / 2; - imHeight = document.getElementById('colors').height; - - r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; - g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); - b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); - - coef = (imHeight - y) / imHeight; - r = 128 + (r - 128) * coef; - g = 128 + (g - 128) * coef; - b = 128 + (b - 128) * coef; - - changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); - updateLight(r, g, b); -} - -function updateLight(r, g, b) { - var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; - - for (i=0; i=0) && (i 1 ? value : '0' + value; // Padd with leading zero + }; + + color = tinymce.trim(color); + color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#' + color = namedLookup[color] || color; + + matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color); + + if (matches) { + red = toInt(matches[1]); + green = toInt(matches[2]); + blue = toInt(matches[3]); + } else { + matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color); + + if (matches) { + red = toInt(matches[1], 16); + green = toInt(matches[2], 16); + blue = toInt(matches[3], 16); + } else { + matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color); + + if (matches) { + red = toInt(matches[1] + matches[1], 16); + green = toInt(matches[2] + matches[2], 16); + blue = toInt(matches[3] + matches[3], 16); + } else { + return ''; + } + } + } + + return '#' + hex(red) + hex(green) + hex(blue); +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + var hexColor = toHexColor(color); + + if (hexColor === '') { + var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value'); + tinyMCEPopup.alert(text + ': ' + color); + } + else { + tinyMCEPopup.restoreSelection(); + + if (f) + f(hexColor); + + tinyMCEPopup.close(); + } +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toUpperCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
      '; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. + h += '
      ' + + ''; + + for (i=0; i' + + ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
      '; + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el.firstChild); +} + +function paintCanvas(el) { + tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { + var context; + if (canvas.getContext && (context = canvas.getContext("2d"))) { + context.fillStyle = canvas.getAttribute('data-color'); + context.fillRect(0, 0, 10, 10); + } + }); +} +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + i++; + } + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el); +} + +function enableKeyboardNavigation(el) { + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: el, + items: tinyMCEPopup.dom.select('a', el) + }, tinyMCEPopup.dom); +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; + g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); + b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '180px'; - - e = ed.selection.getNode(); - - this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); - - if (e.nodeName == 'IMG') { - f.src.value = ed.dom.getAttrib(e, 'src'); - f.alt.value = ed.dom.getAttrib(e, 'alt'); - f.border.value = this.getAttrib(e, 'border'); - f.vspace.value = this.getAttrib(e, 'vspace'); - f.hspace.value = this.getAttrib(e, 'hspace'); - f.width.value = ed.dom.getAttrib(e, 'width'); - f.height.value = ed.dom.getAttrib(e, 'height'); - f.insert.value = ed.getLang('update'); - this.styleVal = ed.dom.getAttrib(e, 'style'); - selectByValue(f, 'image_list', f.src.value); - selectByValue(f, 'align', this.getAttrib(e, 'align')); - this.updateStyle(); - } - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = typeof(l) === 'function' ? l() : window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - update : function() { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (!ed.settings.inline_styles) { - args = tinymce.extend(args, { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }); - } else - args.style = this.styleVal; - - tinymce.extend(args, { - src : f.src.value.replace(/ /g, '%20'), - alt : f.alt.value, - width : f.width.value, - height : f.height.value - }); - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - tinyMCEPopup.editor.execCommand('mceRepaint'); - tinyMCEPopup.editor.focus(); - } else { - tinymce.each(args, function(value, name) { - if (value === "") { - delete args[name]; - } - }); - - ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); - ed.undoManager.add(); - } - - tinyMCEPopup.close(); - }, - - updateStyle : function() { - var dom = tinyMCEPopup.dom, st = {}, v, f = document.forms[0]; - - if (tinyMCEPopup.editor.settings.inline_styles) { - tinymce.each(tinyMCEPopup.dom.parseStyle(this.styleVal), function(value, key) { - st[key] = value; - }); - - // Handle align - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') { - st['float'] = v; - delete st['vertical-align']; - } else { - st['vertical-align'] = v; - delete st['float']; - } - } else { - delete st['float']; - delete st['vertical-align']; - } - - // Handle border - v = f.border.value; - if (v || v == '0') { - if (v == '0') - st['border'] = '0'; - else - st['border'] = v + 'px solid black'; - } else - delete st['border']; - - // Handle hspace - v = f.hspace.value; - if (v) { - delete st['margin']; - st['margin-left'] = v + 'px'; - st['margin-right'] = v + 'px'; - } else { - delete st['margin-left']; - delete st['margin-right']; - } - - // Handle vspace - v = f.vspace.value; - if (v) { - delete st['margin']; - st['margin-top'] = v + 'px'; - st['margin-bottom'] = v + 'px'; - } else { - delete st['margin-top']; - delete st['margin-bottom']; - } - - // Merge - st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); - this.styleVal = dom.serializeStyle(st, 'img'); - } - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.width.value = f.height.value = ""; - }, - - updateImageData : function() { - var f = document.forms[0], t = ImageDialog; - - if (f.width.value == "") - f.width.value = t.preloadImg.width; - - if (f.height.value == "") - f.height.value = t.preloadImg.height; - }, - - getImageData : function() { - var f = document.forms[0]; - - this.preloadImg = new Image(); - this.preloadImg.onload = this.updateImageData; - this.preloadImg.onerror = this.resetImageData; - this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value.replace(/ /g, '%20'), + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st = {}, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + tinymce.each(tinyMCEPopup.dom.parseStyle(this.styleVal), function(value, key) { + st[key] = value; + }); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); + this.styleVal = dom.serializeStyle(st, 'img'); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/link.js b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/link.js index 8c1d73c..2e25ff5 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/link.js +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/link.js @@ -1,159 +1,159 @@ -tinyMCEPopup.requireLangPack(); - -var LinkDialog = { - preInit : function() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '180px'; - - this.fillClassList('class_list'); - this.fillFileList('link_list', 'tinyMCELinkList'); - this.fillTargetList('target_list'); - - if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { - f.href.value = ed.dom.getAttrib(e, 'href'); - f.linktitle.value = ed.dom.getAttrib(e, 'title'); - f.insert.value = ed.getLang('update'); - selectByValue(f, 'link_list', f.href.value); - selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); - selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); - } - }, - - update : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); - - tinyMCEPopup.restoreSelection(); - e = ed.dom.getParent(ed.selection.getNode(), 'A'); - - // Remove element if there is no href - if (!f.href.value) { - if (e) { - b = ed.selection.getBookmark(); - ed.dom.remove(e, 1); - ed.selection.moveToBookmark(b); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - } - - // Create new anchor elements - if (e == null) { - ed.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); - - tinymce.each(ed.dom.select("a"), function(n) { - if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { - e = n; - - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value, - target : f.target_list ? getSelectValue(f, "target_list") : null, - 'class' : f.class_list ? getSelectValue(f, "class_list") : null - }); - } - }); - } else { - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value - }); - - if (f.target_list) { - ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list")); - } - - if (f.class_list) { - ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list")); - } - } - - // Don't move caret if selection was image - if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { - ed.focus(); - ed.selection.select(e); - ed.selection.collapse(0); - tinyMCEPopup.storeSelection(); - } - - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - }, - - checkPrefix : function(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) - n.value = 'http://' + n.value; - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillTargetList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v; - - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); - - if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { - tinymce.each(v.split(','), function(v) { - v = v.split('='); - lst.options[lst.options.length] = new Option(v[0], v[1]); - }); - } - } -}; - -LinkDialog.preInit(); -tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + // Create new anchor elements + if (e == null) { + ed.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value + }); + + if (f.target_list) { + ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list")); + } + + if (f.class_list) { + ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list")); + } + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/source_editor.js b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/source_editor.js index dd5e366..7792ba1 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/source_editor.js +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/js/source_editor.js @@ -1,78 +1,78 @@ -tinyMCEPopup.requireLangPack(); -tinyMCEPopup.onInit.add(onLoadInit); - -function saveContent() { - tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); - tinyMCEPopup.close(); -} - -function onLoadInit() { - tinyMCEPopup.resizeToInnerSize(); - - // Remove Gecko spellchecking - if (tinymce.isGecko) - document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); - - document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); - - if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { - turnWrapOn(); - document.getElementById('wraped').checked = true; - } - - resizeInputs(); -} - -function setWrap(val) { - var v, n, s = document.getElementById('htmlSource'); - - s.wrap = val; - - if (!tinymce.isIE) { - v = s.value; - n = s.cloneNode(false); - n.setAttribute("wrap", val); - s.parentNode.replaceChild(n, s); - n.value = v; - } -} - -function setWhiteSpaceCss(value) { - var el = document.getElementById('htmlSource'); - tinymce.DOM.setStyle(el, 'white-space', value); -} - -function turnWrapOff() { - if (tinymce.isWebKit) { - setWhiteSpaceCss('pre'); - } else { - setWrap('off'); - } -} - -function turnWrapOn() { - if (tinymce.isWebKit) { - setWhiteSpaceCss('pre-wrap'); - } else { - setWrap('soft'); - } -} - -function toggleWordWrap(elm) { - if (elm.checked) { - turnWrapOn(); - } else { - turnWrapOff(); - } -} - -function resizeInputs() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('htmlSource'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 65) + 'px'; - } -} +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + turnWrapOn(); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function setWhiteSpaceCss(value) { + var el = document.getElementById('htmlSource'); + tinymce.DOM.setStyle(el, 'white-space', value); +} + +function turnWrapOff() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre'); + } else { + setWrap('off'); + } +} + +function turnWrapOn() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre-wrap'); + } else { + setWrap('soft'); + } +} + +function toggleWordWrap(elm) { + if (elm.checked) { + turnWrapOn(); + } else { + turnWrapOff(); + } +} + +function resizeInputs() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('htmlSource'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 65) + 'px'; + } +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/langs/en_dlg.js b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/langs/en_dlg.js index b4bd922..50cd87e 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/langs/en_dlg.js +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/langs/en_dlg.js @@ -1 +1 @@ -tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""}); +tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""}); diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/content.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/content.css index 2fd94a1..4d63ca9 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/content.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/content.css @@ -1,50 +1,50 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table, img, hr, .mceItemAnchor {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} -*[contentEditable]:focus {outline:0} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemAudio {background-image:url(../../img/video.gif)} -.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/dialog.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/dialog.css index 879786f..8950ba3 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/dialog.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/dialog.css @@ -1,118 +1,118 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(img/buttons.png) 0 -52px} -#cancel {background:url(img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} -#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} -#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(img/buttons.png) 0 -52px} +#cancel {background:url(img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} +#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} +#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/ui.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/ui.css index 77083f3..2e8c658 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/ui.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/default/ui.css @@ -1,219 +1,219 @@ -/* Reset */ -.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.defaultSkin table td {vertical-align:middle} - -/* Containers */ -.defaultSkin table {direction:ltr;background:transparent} -.defaultSkin iframe {display:block;} -.defaultSkin .mceToolbar {height:26px} -.defaultSkin .mceLeft {text-align:left} -.defaultSkin .mceRight {text-align:right} - -/* External */ -.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} -.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} - -/* Layout */ -.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} -.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} -.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} -.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} -.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} -.defaultSkin .mceStatusbar div {float:left; margin:2px} -.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} -.defaultSkin .mceStatusbar a:hover {text-decoration:underline} -.defaultSkin table.mceToolbar {margin-left:3px} -.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} -.defaultSkin td.mceCenter {text-align:center;} -.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} -.defaultSkin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} -.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceButtonLabeled {width:auto} -.defaultSkin .mceButtonLabeled span.mceIcon {float:left} -.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} - -/* ListBox */ -.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} -.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} -.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} -.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} -.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} -.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} -.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} -.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} -.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} - -/* SplitButton */ -.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} -.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} -.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} -.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} -.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} -.defaultSkin .mceSplitButton span.mceOpen {display:none} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} -.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} - -/* ColorSplitButton */ -.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.defaultSkin .mceColorSplitMenu td {padding:2px} -.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} -.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} -.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} - -/* Menu */ -.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8; direction:ltr} -.defaultSkin .mceNoIcons span.mceIcon {width:0;} -.defaultSkin .mceNoIcons a .mceText {padding-left:10px} -.defaultSkin .mceMenu table {background:#FFF} -.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} -.defaultSkin .mceMenu td {height:20px} -.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} -.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} -.defaultSkin .mceMenu pre.mceText {font-family:Monospace} -.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} -.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} -.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.defaultSkin .mceMenuItemDisabled .mceText {color:#888} -.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} -.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} -.defaultSkin .mceMenu span.mceMenuLine {display:none} -.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} -.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal} - -/* Progress,Resize */ -.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} -.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Rtl */ -.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} -.mceRtl .mceMenuItem .mceText {text-align: right} - -/* Formats */ -.defaultSkin .mce_formatPreview a {font-size:10px} -.defaultSkin .mce_p span.mceText {} -.defaultSkin .mce_address span.mceText {font-style:italic} -.defaultSkin .mce_pre span.mceText {font-family:monospace} -.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.defaultSkin span.mce_bold {background-position:0 0} -.defaultSkin span.mce_italic {background-position:-60px 0} -.defaultSkin span.mce_underline {background-position:-140px 0} -.defaultSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSkin span.mce_undo {background-position:-160px 0} -.defaultSkin span.mce_redo {background-position:-100px 0} -.defaultSkin span.mce_cleanup {background-position:-40px 0} -.defaultSkin span.mce_bullist {background-position:-20px 0} -.defaultSkin span.mce_numlist {background-position:-80px 0} -.defaultSkin span.mce_justifyleft {background-position:-460px 0} -.defaultSkin span.mce_justifyright {background-position:-480px 0} -.defaultSkin span.mce_justifycenter {background-position:-420px 0} -.defaultSkin span.mce_justifyfull {background-position:-440px 0} -.defaultSkin span.mce_anchor {background-position:-200px 0} -.defaultSkin span.mce_indent {background-position:-400px 0} -.defaultSkin span.mce_outdent {background-position:-540px 0} -.defaultSkin span.mce_link {background-position:-500px 0} -.defaultSkin span.mce_unlink {background-position:-640px 0} -.defaultSkin span.mce_sub {background-position:-600px 0} -.defaultSkin span.mce_sup {background-position:-620px 0} -.defaultSkin span.mce_removeformat {background-position:-580px 0} -.defaultSkin span.mce_newdocument {background-position:-520px 0} -.defaultSkin span.mce_image {background-position:-380px 0} -.defaultSkin span.mce_help {background-position:-340px 0} -.defaultSkin span.mce_code {background-position:-260px 0} -.defaultSkin span.mce_hr {background-position:-360px 0} -.defaultSkin span.mce_visualaid {background-position:-660px 0} -.defaultSkin span.mce_charmap {background-position:-240px 0} -.defaultSkin span.mce_paste {background-position:-560px 0} -.defaultSkin span.mce_copy {background-position:-700px 0} -.defaultSkin span.mce_cut {background-position:-680px 0} -.defaultSkin span.mce_blockquote {background-position:-220px 0} -.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} -.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} -.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} -.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.defaultSkin span.mce_advhr {background-position:-0px -20px} -.defaultSkin span.mce_ltr {background-position:-20px -20px} -.defaultSkin span.mce_rtl {background-position:-40px -20px} -.defaultSkin span.mce_emotions {background-position:-60px -20px} -.defaultSkin span.mce_fullpage {background-position:-80px -20px} -.defaultSkin span.mce_fullscreen {background-position:-100px -20px} -.defaultSkin span.mce_iespell {background-position:-120px -20px} -.defaultSkin span.mce_insertdate {background-position:-140px -20px} -.defaultSkin span.mce_inserttime {background-position:-160px -20px} -.defaultSkin span.mce_absolute {background-position:-180px -20px} -.defaultSkin span.mce_backward {background-position:-200px -20px} -.defaultSkin span.mce_forward {background-position:-220px -20px} -.defaultSkin span.mce_insert_layer {background-position:-240px -20px} -.defaultSkin span.mce_insertlayer {background-position:-260px -20px} -.defaultSkin span.mce_movebackward {background-position:-280px -20px} -.defaultSkin span.mce_moveforward {background-position:-300px -20px} -.defaultSkin span.mce_media {background-position:-320px -20px} -.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} -.defaultSkin span.mce_pastetext {background-position:-360px -20px} -.defaultSkin span.mce_pasteword {background-position:-380px -20px} -.defaultSkin span.mce_selectall {background-position:-400px -20px} -.defaultSkin span.mce_preview {background-position:-420px -20px} -.defaultSkin span.mce_print {background-position:-440px -20px} -.defaultSkin span.mce_cancel {background-position:-460px -20px} -.defaultSkin span.mce_save {background-position:-480px -20px} -.defaultSkin span.mce_replace {background-position:-500px -20px} -.defaultSkin span.mce_search {background-position:-520px -20px} -.defaultSkin span.mce_styleprops {background-position:-560px -20px} -.defaultSkin span.mce_table {background-position:-580px -20px} -.defaultSkin span.mce_cell_props {background-position:-600px -20px} -.defaultSkin span.mce_delete_table {background-position:-620px -20px} -.defaultSkin span.mce_delete_col {background-position:-640px -20px} -.defaultSkin span.mce_delete_row {background-position:-660px -20px} -.defaultSkin span.mce_col_after {background-position:-680px -20px} -.defaultSkin span.mce_col_before {background-position:-700px -20px} -.defaultSkin span.mce_row_after {background-position:-720px -20px} -.defaultSkin span.mce_row_before {background-position:-740px -20px} -.defaultSkin span.mce_merge_cells {background-position:-760px -20px} -.defaultSkin span.mce_table_props {background-position:-980px -20px} -.defaultSkin span.mce_row_props {background-position:-780px -20px} -.defaultSkin span.mce_split_cells {background-position:-800px -20px} -.defaultSkin span.mce_template {background-position:-820px -20px} -.defaultSkin span.mce_visualchars {background-position:-840px -20px} -.defaultSkin span.mce_abbr {background-position:-860px -20px} -.defaultSkin span.mce_acronym {background-position:-880px -20px} -.defaultSkin span.mce_attribs {background-position:-900px -20px} -.defaultSkin span.mce_cite {background-position:-920px -20px} -.defaultSkin span.mce_del {background-position:-940px -20px} -.defaultSkin span.mce_ins {background-position:-960px -20px} -.defaultSkin span.mce_pagebreak {background-position:0 -40px} -.defaultSkin span.mce_restoredraft {background-position:-20px -40px} -.defaultSkin span.mce_spellchecker {background-position:-540px -20px} -.defaultSkin span.mce_visualblocks {background-position: -40px -40px} +/* Reset */ +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {direction:ltr;background:transparent} +.defaultSkin iframe {display:block;} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8; direction:ltr} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} +.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} +.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Rtl */ +.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} +.mceRtl .mceMenuItem .mceText {text-align: right} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin span.mce_restoredraft {background-position:-20px -40px} +.defaultSkin span.mce_spellchecker {background-position:-540px -20px} +.defaultSkin span.mce_visualblocks {background-position: -40px -40px} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/content.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/content.css index cbce6c6..ee3d369 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/content.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/content.css @@ -1,24 +1,24 @@ -body, td, pre { margin:8px;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table, img, hr, .mceItemAnchor {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} -*[contentEditable]:focus {outline:0} +body, td, pre { margin:8px;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/dialog.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/dialog.css index 6d9fc8d..fa3c31a 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/dialog.css @@ -1,106 +1,106 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -background:#F0F0EE; -color: black; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE; color:#000;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;background-color:transparent;} -a:hover {color:#2B6FB6;background-color:transparent;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;background-color:transparent;} -input.invalid {border:1px solid #EE0000;background-color:transparent;} -input {background:#FFF; border:1px solid #CCC;color:black;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -font-weight:bold; -width:94px; height:23px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#cancel {float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} -.tabs li.current {font-weight: bold; margin-right:2px;} -.tabs span {float:left; display:block; padding:0px 10px 0 0;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} -#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} -#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +background:#F0F0EE; +color: black; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE; color:#000;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;background-color:transparent;} +a:hover {color:#2B6FB6;background-color:transparent;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;background-color:transparent;} +input.invalid {border:1px solid #EE0000;background-color:transparent;} +input {background:#FFF; border:1px solid #CCC;color:black;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +font-weight:bold; +width:94px; height:23px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#cancel {float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} +.tabs li.current {font-weight: bold; margin-right:2px;} +.tabs span {float:left; display:block; padding:0px 10px 0 0;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} +#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} +#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/ui.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/ui.css index effbbe1..16ec276 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/ui.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/highcontrast/ui.css @@ -1,106 +1,106 @@ -/* Reset */ -.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} -.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} -.highcontrastSkin table td {vertical-align:middle} - -.highcontrastSkin .mceIconOnly {display: block !important;} - -/* External */ -.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} -.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} - -/* Layout */ -.highcontrastSkin table.mceLayout {border: 1px solid;} -.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} -.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} -.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} -.highcontrastSkin .mceStatusbar div {float:left} -.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} - -.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} -.highcontrastSkin .mceToolbar tr { display: block;} -.highcontrastSkin .mceToolbar table { display: block; } - -/* Button */ - -.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} -.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} -.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} - -/* Separator */ -.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} - -/* ListBox */ -.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} -.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} -.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} - -.highcontrastSkin .mceListBoxMenu {overflow-y:auto} - -/* SplitButton */ -.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} -.highcontrastSkin .mceSplitButton tr { display: table-row; } -.highcontrastSkin table.mceSplitButton { display: table; } -.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } -.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} - -/* Menu */ -.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} -.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; direction:ltr} -.highcontrastSkin .mceMenu table {background:white; color: black} -.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} -.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} -.highcontrastSkin .mceMenu td {height:2em} -.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} -.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} -.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} -.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} -.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} -.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} -.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} -.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} -.highcontrastSkin .mceMenu span.mceMenuLine {display:none} -.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} -.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal} - -/* ColorSplitButton */ -.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} -.highcontrastSkin .mceColorSplitMenu td {padding:2px} -.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} -.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} -.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} -.highcontrastSkin .mceColorPreview {display:none;} -.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} - -/* Progress,Resize */ -.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Rtl */ -.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} -.mceRtl .mceMenuItem .mceText {text-align: right} - -/* Formats */ -.highcontrastSkin .mce_p span.mceText {} -.highcontrastSkin .mce_address span.mceText {font-style:italic} -.highcontrastSkin .mce_pre span.mceText {font-family:monospace} -.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} +/* Reset */ +.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} +.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} +.highcontrastSkin table td {vertical-align:middle} + +.highcontrastSkin .mceIconOnly {display: block !important;} + +/* External */ +.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} +.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} + +/* Layout */ +.highcontrastSkin table.mceLayout {border: 1px solid;} +.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} +.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} +.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} +.highcontrastSkin .mceStatusbar div {float:left} +.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} + +.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} +.highcontrastSkin .mceToolbar tr { display: block;} +.highcontrastSkin .mceToolbar table { display: block; } + +/* Button */ + +.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} +.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} +.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} + +/* Separator */ +.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} + +/* ListBox */ +.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} +.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} +.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} + +.highcontrastSkin .mceListBoxMenu {overflow-y:auto} + +/* SplitButton */ +.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} +.highcontrastSkin .mceSplitButton tr { display: table-row; } +.highcontrastSkin table.mceSplitButton { display: table; } +.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } +.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} + +/* Menu */ +.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} +.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; direction:ltr} +.highcontrastSkin .mceMenu table {background:white; color: black} +.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} +.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} +.highcontrastSkin .mceMenu td {height:2em} +.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} +.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} +.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} +.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} +.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} +.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} +.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} +.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} +.highcontrastSkin .mceMenu span.mceMenuLine {display:none} +.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} +.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal} + +/* ColorSplitButton */ +.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} +.highcontrastSkin .mceColorSplitMenu td {padding:2px} +.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} +.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} +.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} +.highcontrastSkin .mceColorPreview {display:none;} +.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} + +/* Progress,Resize */ +.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Rtl */ +.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} +.mceRtl .mceMenuItem .mceText {text-align: right} + +/* Formats */ +.highcontrastSkin .mce_p span.mceText {} +.highcontrastSkin .mce_address span.mceText {font-style:italic} +.highcontrastSkin .mce_pre span.mceText {font-family:monospace} +.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/content.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/content.css index a1a8f9b..631fa0e 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/content.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/content.css @@ -1,48 +1,48 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table, img, hr, .mceItemAnchor {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} -*[contentEditable]:focus {outline:0} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemAudio {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/dialog.css index a54db98..84d2fe9 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/dialog.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/dialog.css @@ -1,118 +1,118 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(../default/img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(../default/img/buttons.png) 0 -52px} -#cancel {background:url(../default/img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} -#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} -#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px} +#cancel {background:url(../default/img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} +#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} +#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui.css index a310223..abd5d8d 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui.css @@ -1,222 +1,222 @@ -/* Reset */ -.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.o2k7Skin table td {vertical-align:middle} - -/* Containers */ -.o2k7Skin table {background:transparent} -.o2k7Skin iframe {display:block;} -.o2k7Skin .mceToolbar {height:26px} - -/* External */ -.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} -.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} - -/* Layout */ -.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} -.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} -.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} -.o2k7Skin td.mceToolbar{background:#E5EFFD} -.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} -.o2k7Skin .mceStatusbar div {float:left; padding:2px} -.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} -.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} -.o2k7Skin table.mceToolbar {margin-left:3px} -.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} -.o2k7Skin .mceToolbar td.mceFirst span {margin:0} -.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} -.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} -.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} -.o2k7Skin td.mceCenter {text-align:center;} -.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} -.o2k7Skin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} -.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} -.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} -.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceButtonLabeled {width:auto} -.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} -.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* ListBox */ -.o2k7Skin .mceListBox {padding-left: 3px} -.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} -.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} -.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} -.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} -.o2k7Skin .mceListBoxDisabled .mceText {color:gray} -.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} -.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} -.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} - -/* SplitButton */ -.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} -.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} -.o2k7Skin .mceSplitButton a.mceAction {width:22px} -.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} -.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} -.o2k7Skin .mceSplitButton span.mceOpen {display:none} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} -.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} - -/* ColorSplitButton */ -.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.o2k7Skin .mceColorSplitMenu td {padding:2px} -.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} -.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} -.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} - -/* Menu */ -.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD; direction:ltr} -.o2k7Skin .mceNoIcons span.mceIcon {width:0;} -.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} -.o2k7Skin .mceMenu table {background:#FFF} -.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} -.o2k7Skin .mceMenu td {height:20px} -.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} -.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} -.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} -.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} -.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} -.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} -.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} -.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} -.o2k7Skin .mceMenu span.mceMenuLine {display:none} -.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} -.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} - -/* Progress,Resize */ -.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Rtl */ -.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} -.mceRtl .mceMenuItem .mceText {text-align: right} - -/* Formats */ -.o2k7Skin .mce_formatPreview a {font-size:10px} -.o2k7Skin .mce_p span.mceText {} -.o2k7Skin .mce_address span.mceText {font-style:italic} -.o2k7Skin .mce_pre span.mceText {font-family:monospace} -.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.o2k7Skin span.mce_bold {background-position:0 0} -.o2k7Skin span.mce_italic {background-position:-60px 0} -.o2k7Skin span.mce_underline {background-position:-140px 0} -.o2k7Skin span.mce_strikethrough {background-position:-120px 0} -.o2k7Skin span.mce_undo {background-position:-160px 0} -.o2k7Skin span.mce_redo {background-position:-100px 0} -.o2k7Skin span.mce_cleanup {background-position:-40px 0} -.o2k7Skin span.mce_bullist {background-position:-20px 0} -.o2k7Skin span.mce_numlist {background-position:-80px 0} -.o2k7Skin span.mce_justifyleft {background-position:-460px 0} -.o2k7Skin span.mce_justifyright {background-position:-480px 0} -.o2k7Skin span.mce_justifycenter {background-position:-420px 0} -.o2k7Skin span.mce_justifyfull {background-position:-440px 0} -.o2k7Skin span.mce_anchor {background-position:-200px 0} -.o2k7Skin span.mce_indent {background-position:-400px 0} -.o2k7Skin span.mce_outdent {background-position:-540px 0} -.o2k7Skin span.mce_link {background-position:-500px 0} -.o2k7Skin span.mce_unlink {background-position:-640px 0} -.o2k7Skin span.mce_sub {background-position:-600px 0} -.o2k7Skin span.mce_sup {background-position:-620px 0} -.o2k7Skin span.mce_removeformat {background-position:-580px 0} -.o2k7Skin span.mce_newdocument {background-position:-520px 0} -.o2k7Skin span.mce_image {background-position:-380px 0} -.o2k7Skin span.mce_help {background-position:-340px 0} -.o2k7Skin span.mce_code {background-position:-260px 0} -.o2k7Skin span.mce_hr {background-position:-360px 0} -.o2k7Skin span.mce_visualaid {background-position:-660px 0} -.o2k7Skin span.mce_charmap {background-position:-240px 0} -.o2k7Skin span.mce_paste {background-position:-560px 0} -.o2k7Skin span.mce_copy {background-position:-700px 0} -.o2k7Skin span.mce_cut {background-position:-680px 0} -.o2k7Skin span.mce_blockquote {background-position:-220px 0} -.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} -.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} -.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} -.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.o2k7Skin span.mce_advhr {background-position:-0px -20px} -.o2k7Skin span.mce_ltr {background-position:-20px -20px} -.o2k7Skin span.mce_rtl {background-position:-40px -20px} -.o2k7Skin span.mce_emotions {background-position:-60px -20px} -.o2k7Skin span.mce_fullpage {background-position:-80px -20px} -.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} -.o2k7Skin span.mce_iespell {background-position:-120px -20px} -.o2k7Skin span.mce_insertdate {background-position:-140px -20px} -.o2k7Skin span.mce_inserttime {background-position:-160px -20px} -.o2k7Skin span.mce_absolute {background-position:-180px -20px} -.o2k7Skin span.mce_backward {background-position:-200px -20px} -.o2k7Skin span.mce_forward {background-position:-220px -20px} -.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} -.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} -.o2k7Skin span.mce_movebackward {background-position:-280px -20px} -.o2k7Skin span.mce_moveforward {background-position:-300px -20px} -.o2k7Skin span.mce_media {background-position:-320px -20px} -.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} -.o2k7Skin span.mce_pastetext {background-position:-360px -20px} -.o2k7Skin span.mce_pasteword {background-position:-380px -20px} -.o2k7Skin span.mce_selectall {background-position:-400px -20px} -.o2k7Skin span.mce_preview {background-position:-420px -20px} -.o2k7Skin span.mce_print {background-position:-440px -20px} -.o2k7Skin span.mce_cancel {background-position:-460px -20px} -.o2k7Skin span.mce_save {background-position:-480px -20px} -.o2k7Skin span.mce_replace {background-position:-500px -20px} -.o2k7Skin span.mce_search {background-position:-520px -20px} -.o2k7Skin span.mce_styleprops {background-position:-560px -20px} -.o2k7Skin span.mce_table {background-position:-580px -20px} -.o2k7Skin span.mce_cell_props {background-position:-600px -20px} -.o2k7Skin span.mce_delete_table {background-position:-620px -20px} -.o2k7Skin span.mce_delete_col {background-position:-640px -20px} -.o2k7Skin span.mce_delete_row {background-position:-660px -20px} -.o2k7Skin span.mce_col_after {background-position:-680px -20px} -.o2k7Skin span.mce_col_before {background-position:-700px -20px} -.o2k7Skin span.mce_row_after {background-position:-720px -20px} -.o2k7Skin span.mce_row_before {background-position:-740px -20px} -.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} -.o2k7Skin span.mce_table_props {background-position:-980px -20px} -.o2k7Skin span.mce_row_props {background-position:-780px -20px} -.o2k7Skin span.mce_split_cells {background-position:-800px -20px} -.o2k7Skin span.mce_template {background-position:-820px -20px} -.o2k7Skin span.mce_visualchars {background-position:-840px -20px} -.o2k7Skin span.mce_abbr {background-position:-860px -20px} -.o2k7Skin span.mce_acronym {background-position:-880px -20px} -.o2k7Skin span.mce_attribs {background-position:-900px -20px} -.o2k7Skin span.mce_cite {background-position:-920px -20px} -.o2k7Skin span.mce_del {background-position:-940px -20px} -.o2k7Skin span.mce_ins {background-position:-960px -20px} -.o2k7Skin span.mce_pagebreak {background-position:0 -40px} -.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} -.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} -.o2k7Skin span.mce_visualblocks {background-position: -40px -40px} +/* Reset */ +.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:transparent} +.o2k7Skin iframe {display:block;} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.o2k7Skin td.mceToolbar{background:#E5EFFD} +.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {padding-left: 3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD; direction:ltr} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} +.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Rtl */ +.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} +.mceRtl .mceMenuItem .mceText {text-align: right} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} +.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} +.o2k7Skin span.mce_visualblocks {background-position: -40px -40px} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui_black.css index 50c9b76..85812cd 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui_black.css @@ -1,8 +1,8 @@ -/* Black */ -.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} -.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} -.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} -.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} -.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} -.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +/* Black */ +.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} .o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css index 960a8e4..d64c361 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css @@ -1,5 +1,5 @@ -/* Silver */ -.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} -.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} -.o2k7SkinSilver .mceListBox .mceText {background:#FFF} -.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} +/* Silver */ +.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} +.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/editor_template_src.js b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/editor_template_src.js index 01ce87c..a293fad 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/editor_template_src.js +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/editor_template_src.js @@ -1,84 +1,84 @@ -/** - * editor_template_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('simple'); - - tinymce.create('tinymce.themes.SimpleTheme', { - init : function(ed, url) { - var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; - - t.editor = ed; - ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); - - ed.onInit.add(function() { - ed.onNodeChange.add(function(ed, cm) { - tinymce.each(states, function(c) { - cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); - }); - }); - }); - - DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); - }, - - renderUI : function(o) { - var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; - - n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); - n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); - n = tb = DOM.add(n, 'tbody'); - - // Create iframe container - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); - - // Create toolbar container - n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); - - // Create toolbar - tb = t.toolbar = cf.createToolbar("tools1"); - tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); - tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); - tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); - tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); - tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); - tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); - tb.renderTo(n); - - return { - iframeContainer : ic, - editorContainer : ed.id + '_container', - sizeContainer : sc, - deltaHeight : -20 - }; - }, - - getInfo : function() { - return { - longname : 'Simple theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - } - }); - - tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('simple'); + + tinymce.create('tinymce.themes.SimpleTheme', { + init : function(ed, url) { + var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; + + t.editor = ed; + ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); + + ed.onInit.add(function() { + ed.onNodeChange.add(function(ed, cm) { + tinymce.each(states, function(c) { + cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); + }); + }); + }); + + DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); + }, + + renderUI : function(o) { + var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; + + n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); + n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); + n = tb = DOM.add(n, 'tbody'); + + // Create iframe container + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); + + // Create toolbar container + n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); + + // Create toolbar + tb = t.toolbar = cf.createToolbar("tools1"); + tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); + tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); + tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); + tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); + tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); + tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); + tb.renderTo(n); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_container', + sizeContainer : sc, + deltaHeight : -20 + }; + }, + + getInfo : function() { + return { + longname : 'Simple theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + } + }); + + tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); })(); \ No newline at end of file diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/default/content.css b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/default/content.css index 2506c80..5f54fc6 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/default/content.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/default/content.css @@ -1,25 +1,25 @@ -body, td, pre { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -body { - background-color: #FFFFFF; -} - -.mceVisualAid { - border: 1px dashed #BBBBBB; -} - -/* MSIE specific */ - -* html body { - scrollbar-3dlight-color: #F0F0EE; - scrollbar-arrow-color: #676662; - scrollbar-base-color: #F0F0EE; - scrollbar-darkshadow-color: #DDDDDD; - scrollbar-face-color: #E0E0DD; - scrollbar-highlight-color: #F0F0EE; - scrollbar-shadow-color: #F0F0EE; - scrollbar-track-color: #F5F5F5; -} +body, td, pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/default/ui.css b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/default/ui.css index 076fe84..32feae6 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/default/ui.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/default/ui.css @@ -1,32 +1,32 @@ -/* Reset */ -.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.defaultSimpleSkin {position:relative} -.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} -.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} -.defaultSimpleSkin .mceToolbar {height:24px;} - -/* Layout */ -.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} - -/* Button */ -.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} -.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} - -/* Theme */ -.defaultSimpleSkin span.mce_bold {background-position:0 0} -.defaultSimpleSkin span.mce_italic {background-position:-60px 0} -.defaultSimpleSkin span.mce_underline {background-position:-140px 0} -.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSimpleSkin span.mce_undo {background-position:-160px 0} -.defaultSimpleSkin span.mce_redo {background-position:-100px 0} -.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} -.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} +/* Reset */ +.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.defaultSimpleSkin {position:relative} +.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} +.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} +.defaultSimpleSkin .mceToolbar {height:24px;} + +/* Layout */ +.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} +.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} + +/* Theme */ +.defaultSimpleSkin span.mce_bold {background-position:0 0} +.defaultSimpleSkin span.mce_italic {background-position:-60px 0} +.defaultSimpleSkin span.mce_underline {background-position:-140px 0} +.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSimpleSkin span.mce_undo {background-position:-160px 0} +.defaultSimpleSkin span.mce_redo {background-position:-100px 0} +.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} +.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/o2k7/content.css b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/o2k7/content.css index 595809f..93551e3 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/o2k7/content.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/o2k7/content.css @@ -1,17 +1,17 @@ -body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} - -body {background: #FFF;} -.mceVisualAid {border: 1px dashed #BBB;} - -/* IE */ - -* html body { -scrollbar-3dlight-color: #F0F0EE; -scrollbar-arrow-color: #676662; -scrollbar-base-color: #F0F0EE; -scrollbar-darkshadow-color: #DDDDDD; -scrollbar-face-color: #E0E0DD; -scrollbar-highlight-color: #F0F0EE; -scrollbar-shadow-color: #F0F0EE; -scrollbar-track-color: #F5F5F5; -} +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} + +body {background: #FFF;} +.mceVisualAid {border: 1px dashed #BBB;} + +/* IE */ + +* html body { +scrollbar-3dlight-color: #F0F0EE; +scrollbar-arrow-color: #676662; +scrollbar-base-color: #F0F0EE; +scrollbar-darkshadow-color: #DDDDDD; +scrollbar-face-color: #E0E0DD; +scrollbar-highlight-color: #F0F0EE; +scrollbar-shadow-color: #F0F0EE; +scrollbar-track-color: #F5F5F5; +} diff --git a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/o2k7/ui.css b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/o2k7/ui.css index cf6c35d..021d650 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/o2k7/ui.css +++ b/assets/grocery_crud/texteditor/tiny_mce/themes/simple/skins/o2k7/ui.css @@ -1,35 +1,35 @@ -/* Reset */ -.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.o2k7SimpleSkin {position:relative} -.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} -.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} -.o2k7SimpleSkin .mceToolbar {height:26px;} - -/* Layout */ -.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } -.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} - -/* Button */ -.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} -.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} -.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* Theme */ -.o2k7SimpleSkin span.mce_bold {background-position:0 0} -.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} -.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} -.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} -.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} -.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} -.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} -.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} +/* Reset */ +.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.o2k7SimpleSkin {position:relative} +.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} +.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} +.o2k7SimpleSkin .mceToolbar {height:26px;} + +/* Layout */ +.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } +.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} +.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} +.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* Theme */ +.o2k7SimpleSkin span.mce_bold {background-position:0 0} +.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} +.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} +.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} +.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} +.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} +.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} +.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/assets/grocery_crud/texteditor/tiny_mce/tiny_mce_popup.js b/assets/grocery_crud/texteditor/tiny_mce/tiny_mce_popup.js index f2d3ef9..bb8e58c 100755 --- a/assets/grocery_crud/texteditor/tiny_mce/tiny_mce_popup.js +++ b/assets/grocery_crud/texteditor/tiny_mce/tiny_mce_popup.js @@ -1,5 +1,5 @@ - -// Uncomment and change this document.domain value if you are loading the script cross subdomains -// document.domain = 'moxiecode.com'; - + +// Uncomment and change this document.domain value if you are loading the script cross subdomains +// document.domain = 'moxiecode.com'; + var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write(' \ No newline at end of file diff --git a/assets/grocery_crud/themes/datatables/views/edit.php b/assets/grocery_crud/themes/datatables/views/edit.php index 28ea376..144ced0 100755 --- a/assets/grocery_crud/themes/datatables/views/edit.php +++ b/assets/grocery_crud/themes/datatables/views/edit.php @@ -1,77 +1,77 @@ -set_css($this->default_theme_path.'/datatables/css/datatables.css'); - $this->set_js_lib($this->default_theme_path.'/flexigrid/js/jquery.form.js'); - $this->set_js_config($this->default_theme_path.'/datatables/js/datatables-edit.js'); - $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); - - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.noty.js'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/config/jquery.noty.config.js'); -?> -
      -

      - -
      -

      -
      - -
      - -
      -
      - field_name]->display_as?>field_name]->required)? "* " : ""?> : -
      -
      - field_name]->input?> -
      -
      -
      - - - input; - } - ?> - - -
      -
      -
      -
      -
      -
      - ' class='ui-input-button' /> -
      - unset_back_to_list) { ?> -
      - ' class='ui-input-button' id="save-and-go-back-button"/> -
      -
      - ' class='ui-input-button' id="cancel-button" /> -
      - -
      -
      l('form_update_loading'); ?>
      -
      -
      -
      - -
      -
      - \ No newline at end of file diff --git a/assets/grocery_crud/themes/datatables/views/list.php b/assets/grocery_crud/themes/datatables/views/list.php index 9f72752..cb826df 100755 --- a/assets/grocery_crud/themes/datatables/views/list.php +++ b/assets/grocery_crud/themes/datatables/views/list.php @@ -1,74 +1,74 @@ - - - - - - - - - - - - - $row){ ?> - - - - - - - - - - - - - - - - - - - - -
      display_as; ?>l('list_actions'); ?>
      {$column->field_name}?> - action_urls)){ - foreach($row->action_urls as $action_unique_id => $action_url){ - $action = $actions[$action_unique_id]; - ?> - -  label?> - - - - - -  l('list_view'); ?> - - - - - - -  l('list_edit'); ?> - - - - - -  l('list_delete'); ?> - - -
      - - - - l('list_clear_filtering');?> - -
      + + + + + + + + + + + + + $row){ ?> + + + + + + + + + + + + + + + + + + + + +
      display_as; ?>l('list_actions'); ?>
      {$column->field_name}?> + action_urls)){ + foreach($row->action_urls as $action_unique_id => $action_url){ + $action = $actions[$action_unique_id]; + ?> + +  label?> + + + + + +  l('list_view'); ?> + + + + + + +  l('list_edit'); ?> + + + + + +  l('list_delete'); ?> + + +
      + + + + l('list_clear_filtering');?> + +
      diff --git a/assets/grocery_crud/themes/datatables/views/list_template.php b/assets/grocery_crud/themes/datatables/views/list_template.php index 242dbf2..1245f11 100755 --- a/assets/grocery_crud/themes/datatables/views/list_template.php +++ b/assets/grocery_crud/themes/datatables/views/list_template.php @@ -1,122 +1,122 @@ -set_css($this->default_theme_path.'/datatables/css/demo_table_jui.css'); - $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); - $this->set_css($this->default_theme_path.'/datatables/css/datatables.css'); - $this->set_css($this->default_theme_path.'/datatables/css/jquery.dataTables.css'); - $this->set_css($this->default_theme_path.'/datatables/extras/TableTools/media/css/TableTools.css'); - $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY); - - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.noty.js'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/config/jquery.noty.config.js'); - $this->set_js_lib($this->default_javascript_path.'/common/lazyload-min.js'); - - if (!$this->is_IE7()) { - $this->set_js_lib($this->default_javascript_path.'/common/list.js'); - } - - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); - $this->set_js_lib($this->default_theme_path.'/datatables/js/jquery.dataTables.min.js'); - $this->set_js($this->default_theme_path.'/datatables/js/datatables-extras.js'); - $this->set_js($this->default_theme_path.'/datatables/js/datatables.js'); - $this->set_js($this->default_theme_path.'/datatables/extras/TableTools/media/js/ZeroClipboard.js'); - $this->set_js($this->default_theme_path.'/datatables/extras/TableTools/media/js/TableTools.min.js'); - - /** Fancybox */ - $this->set_css($this->default_css_path.'/jquery_plugins/fancybox/jquery.fancybox.css'); - $this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.fancybox-1.3.4.js'); - $this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.easing-1.3.pack.js'); -?> - - - - - - - -
      -
      style="display:block"> -

      -
      - - - -
      -
      - +set_css($this->default_theme_path.'/datatables/css/demo_table_jui.css'); + $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); + $this->set_css($this->default_theme_path.'/datatables/css/datatables.css'); + $this->set_css($this->default_theme_path.'/datatables/css/jquery.dataTables.css'); + $this->set_css($this->default_theme_path.'/datatables/extras/TableTools/media/css/TableTools.css'); + $this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY); + + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.noty.js'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/config/jquery.noty.config.js'); + $this->set_js_lib($this->default_javascript_path.'/common/lazyload-min.js'); + + if (!$this->is_IE7()) { + $this->set_js_lib($this->default_javascript_path.'/common/list.js'); + } + + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); + $this->set_js_lib($this->default_theme_path.'/datatables/js/jquery.dataTables.min.js'); + $this->set_js($this->default_theme_path.'/datatables/js/datatables-extras.js'); + $this->set_js($this->default_theme_path.'/datatables/js/datatables.js'); + $this->set_js($this->default_theme_path.'/datatables/extras/TableTools/media/js/ZeroClipboard.js'); + $this->set_js($this->default_theme_path.'/datatables/extras/TableTools/media/js/TableTools.min.js'); + + /** Fancybox */ + $this->set_css($this->default_css_path.'/jquery_plugins/fancybox/jquery.fancybox.css'); + $this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.fancybox-1.3.4.js'); + $this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.easing-1.3.pack.js'); +?> + + + + + + + +
      +
      style="display:block"> +

      +
      + + + +
      +
      +
      \ No newline at end of file diff --git a/assets/grocery_crud/themes/datatables/views/read.php b/assets/grocery_crud/themes/datatables/views/read.php index d54b0b2..319c332 100755 --- a/assets/grocery_crud/themes/datatables/views/read.php +++ b/assets/grocery_crud/themes/datatables/views/read.php @@ -1,66 +1,66 @@ -set_css($this->default_theme_path.'/datatables/css/datatables.css'); - $this->set_js_lib($this->default_theme_path.'/flexigrid/js/jquery.form.js'); - $this->set_js_config($this->default_theme_path.'/datatables/js/datatables-edit.js'); - $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); - - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.noty.js'); - $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/config/jquery.noty.config.js'); -?> -
      -

      - -
      -

      -
      - -
      - -
      -
      - field_name]->display_as?>field_name]->required)? "* " : ""?> : -
      -
      - field_name]->input?> -
      -
      -
      - - - input; - } - ?> - - -
      -
      -
      -
      -
      -
      - ' class='ui-input-button back-to-list' id="cancel-button" /> -
      -
      -
      - -
      -
      - +set_css($this->default_theme_path.'/datatables/css/datatables.css'); + $this->set_js_lib($this->default_theme_path.'/flexigrid/js/jquery.form.js'); + $this->set_js_config($this->default_theme_path.'/datatables/js/datatables-edit.js'); + $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); + + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.noty.js'); + $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/config/jquery.noty.config.js'); +?> +
      +

      + +
      +

      +
      + +
      + +
      +
      + field_name]->display_as?>field_name]->required)? "* " : ""?> : +
      +
      + field_name]->input?> +
      +
      +
      + + + input; + } + ?> + + +
      +
      +
      +
      +
      +
      + ' class='ui-input-button back-to-list' id="cancel-button" /> +
      +
      +
      + +
      +
      + diff --git a/assets/grocery_crud/themes/flexigrid/config.php b/assets/grocery_crud/themes/flexigrid/config.php index 4682f12..36beb58 100755 --- a/assets/grocery_crud/themes/flexigrid/config.php +++ b/assets/grocery_crud/themes/flexigrid/config.php @@ -1,2 +1,2 @@ - .btn { - position: relative; - float: left; - margin-left: -1px; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.btn-group > .btn:first-child { - margin-left: 0; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-topleft: 4px; -} - -.btn-group > .btn:last-child, -.btn-group > .dropdown-toggle { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-bottomright: 4px; -} - -.btn-group > .btn.large:first-child { - margin-left: 0; - -webkit-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -webkit-border-top-left-radius: 6px; - border-top-left-radius: 6px; - -moz-border-radius-bottomleft: 6px; - -moz-border-radius-topleft: 6px; -} - -.btn-group > .btn.large:last-child, -.btn-group > .large.dropdown-toggle { - -webkit-border-top-right-radius: 6px; - border-top-right-radius: 6px; - -webkit-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - -moz-border-radius-topright: 6px; - -moz-border-radius-bottomright: 6px; -} - -.btn-group > .btn:hover, -.btn-group > .btn:focus, -.btn-group > .btn:active, -.btn-group > .btn.active { - z-index: 2; -} - -.btn-group .dropdown-toggle:active, -.btn-group.open .dropdown-toggle { - outline: 0; -} - -.btn-group > .dropdown-toggle { - *padding-top: 4px; - padding-right: 8px; - *padding-bottom: 4px; - padding-left: 8px; - -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.btn-group > .btn-mini.dropdown-toggle { - padding-right: 5px; - padding-left: 5px; -} - -.btn-group > .btn-small.dropdown-toggle { - *padding-top: 4px; - *padding-bottom: 4px; -} - -.btn-group > .btn-large.dropdown-toggle { - padding-right: 12px; - padding-left: 12px; -} - -.btn-group.open .dropdown-toggle { - background-image: none; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.btn-group.open .btn.dropdown-toggle { - background-color: #e6e6e6; -} - -.btn-group.open .btn-primary.dropdown-toggle { - background-color: #0055cc; -} - -.btn-group.open .btn-warning.dropdown-toggle { - background-color: #f89406; -} - -.btn-group.open .btn-danger.dropdown-toggle { - background-color: #bd362f; -} - -.btn-group.open .btn-success.dropdown-toggle { - background-color: #51a351; -} - -.btn-group.open .btn-info.dropdown-toggle { - background-color: #2f96b4; -} - -.btn-group.open .btn-inverse.dropdown-toggle { - background-color: #222222; -} - -.btn .caret { - margin-top: 7px; - margin-left: 0; -} - -.btn:hover .caret, -.open.btn-group .caret { - opacity: 1; - filter: alpha(opacity=100); -} - -.btn-mini .caret { - margin-top: 5px; -} - -.btn-small .caret { - margin-top: 6px; -} - -.btn-large .caret { - margin-top: 6px; - border-top-width: 5px; - border-right-width: 5px; - border-left-width: 5px; -} - -.dropup .btn-large .caret { - border-top: 0; - border-bottom: 5px solid #000000; -} - -.btn-primary .caret, -.btn-warning .caret, -.btn-danger .caret, -.btn-info .caret, -.btn-success .caret, -.btn-inverse .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; - opacity: 0.75; - filter: alpha(opacity=75); -} - -/* End of twitter bootstrap buttons */ - -.pretty-radio-buttons -{ - margin-top: 6px; -} - -.pretty-radio-buttons label -{ - margin-right: 10px; -} -.ui-widget -{ - font-size: 12px !important; -} - - -/** Common CSS */ -.loading-opacity -{ - opacity: 0.5; - pointer-events: none; - cursor: default; -} - -.loading-opacity:before { - font-size: 26px; - position:absolute; - color: #000; - content: "Loading..."; - margin-left: 550px; - z-index: 1000; -} +@charset "UTF-8"; +table th +{ + padding:0px; + margin:0px; +} + +/* CSS Document */ +.flexigrid { + font-family:Arial,Helvetica,sans-serif; + font-size:11px; + position:relative; + border:0px solid #eee; + overflow:hidden; + color:#000; +} +.flexigrid.crud-form +{ + overflow:visible; +} +.flexigrid .field-sorting +{ + cursor: pointer; +} +.flexigrid.hideBody { + height:26px !important; + border-bottom:1px solid #ccc; +} +.ie6fullwidthbug { + border-right:0px solid #ccc; + padding-right:2px; +} +.flexigrid div.nDiv { + background:#eee url(images/line.gif) repeat-y -1px top; + border:1px solid #ccc; + border-top:0px; + overflow:auto; + left:0px; + position:absolute; + z-index:999; + float:left; +} +.flexigrid div.nDiv table { + margin:2px; +} +.flexigrid div.hDivBox { + padding-right:40px; +} +.flexigrid div.bDiv table { + margin-bottom:10px; + width: 100%; +} +.flexigrid div.bDiv table.autoht { + border-bottom:0px; + margin-bottom:0px; +} +.flexigrid div.nDiv td { + padding:2px 3px; + border:1px solid #eee; + cursor:default; +} +.flexigrid div.nDiv tr:hover td,.flexigrid div.nDiv tr.ndcolover td { + background:#d5effc url(images/hl.png) repeat-x top; + border:1px solid #a8d8eb; +} +.flexigrid div.nDiv td.ndcol1 { + border-right:1px solid #ccc; +} +.flexigrid div.nDiv td.ndcol2 { + border-left:1px solid #fff; + padding-right:10px; +} +.flexigrid div.nDiv tr:hover td.ndcol1,.flexigrid div.nDiv tr.ndcolover td.ndcol1 { + border-right:1px solid #d2e3ec; +} +.flexigrid div.nDiv tr:hover td.ndcol2,.flexigrid div.nDiv tr.ndcolover td.ndcol2 { + border-left:1px solid #eef8ff; +} +.flexigrid div.nBtn { + position:absolute; + height:24px; + width:14px; + z-index:900; + background:#fafafa url(images/fhbg.gif) repeat-x bottom; + border:0px solid #ccc; + border-left:1px solid #ccc; + top:0px; + left:0px; + margin-top:1px; + cursor:pointer; + display:none; +} +.flexigrid div.nBtn div { + height:24px; + width:12px; + border-left:1px solid #fff; + float:left; + background:url(images/ddn.png) no-repeat center; +} +.flexigrid div.nBtn.srtd { + background:url(images/wbg.gif) repeat-x 0px -1px; +} +.flexigrid div.mDiv { + background:url(images/wbg.gif) repeat-x top; + border:1px solid #ccc; + border-bottom:0px; + border-top:0px; + font-weight:bold; + display:block; + overflow:hidden; + white-space:nowrap; + position:relative; +} +.flexigrid div.mDiv div { + padding:6px; + white-space:nowrap; +} +.flexigrid div.mDiv div.ptogtitle { + position:absolute; + top:4px; + right:3px; + padding:0px; + height:16px; + width:16px; + overflow:hidden; + border:1px solid #ccc; + cursor:pointer; +} +.flexigrid div.mDiv div.ptogtitle:hover { + background-position:left -2px; + border-color:#bbb; +} +.flexigrid div.mDiv div.ptogtitle span { + display:block; + border-left:1px solid #eee; + border-top:1px solid #fff; + border-bottom:1px solid #ddd; + width:14px; + height:14px; + background:url(images/uup.png) no-repeat center; +} +.flexigrid div.mDiv div.ptogtitle.vsble span { + background:url(images/ddn.png) no-repeat center; +} +.flexigrid div.tDiv /*toolbar*/ { + background:#fafafa url(images/bg.gif) repeat-x top; + position:relative; + border:1px solid #ccc; + border-bottom:0px; + overflow:hidden; +} +.flexigrid div.tDiv2 { + float:left; + padding:1px; +} +.flexigrid div.tDiv3 { + float:right; + padding:1px; +} +.flexigrid div.sDiv /*toolbar*/ { + background:#fafafa url(images/bg.gif) repeat-x top; + position:relative; + border:1px solid #ccc; + border-top:0px; + overflow:hidden; + display:none; +} +.flexigrid div.sDiv2 { + float:left; + clear:both; + padding:5px; + padding-left:5px; + width:604px; +} +.flexigrid div.sDiv2 input,.flexigrid div.sDiv2 select { + vertical-align:middle; +} +.flexigrid.crud-form select +{ + min-width: 200px; +} +.flexigrid div.btnseparator { + float:left; + height:22px; + border-left:1px solid #ccc; + border-right:1px solid #fff; + margin:1px; +} +.flexigrid div.fbutton { + float:left; + display:block; + cursor:pointer; + padding:1px; +} +.flexigrid div.fbutton div { + float:left; + padding:1px 3px; +} +.flexigrid div.fbutton span { + float:left; + display:block; + padding:3px; +} +.flexigrid div.fbutton span.add { + background:url(images/add.png) no-repeat; + background-position: 0px 3px; + padding-left: 20px; +} +.flexigrid div.fbutton span.export { + background:url(images/export.png) no-repeat; + background-position: 0px 3px; + padding-left: 20px; +} +.flexigrid div.fbutton span.print { + background:url(images/print.png) no-repeat; + background-position: 0px 3px; + padding-left: 20px; +} +.flexigrid div.fbutton span.delete { + background:url(images/close.png) no-repeat; + padding-left: 20px; +} +.flexigrid div.fbutton:hover,.flexigrid div.fbutton.fbOver { + padding:0px; + border:1px solid #ccc; +} +.flexigrid div.fbutton:hover div,.flexigrid div.fbutton.fbOver div { + padding:0px 2px; + border-left:1px solid #fff; + border-top:1px solid #fff; + border-right:1px solid #eee; + border-bottom: 1px solid #eee; +} +/* end toolbar*/ +.flexigrid div.hDiv table { + border-right:1px solid #fff; +} +.flexigrid table tr.hDiv +{ + background:#fafafa url(images/fhbg.gif) repeat-x bottom; + position:relative; + border:1px solid #ccc; + border-bottom:0px; + overflow:hidden; +} +.flexigrid div.cDrag { + float:left; + position:absolute; + z-index:2; + overflow:visible; +} +.flexigrid div.cDrag div { + float:left; + background:none; + display:block; + position:absolute; + height:24px; + width:5px; + cursor:col-resize; +} +.flexigrid div.cDrag div:hover,.flexigrid div.cDrag div.dragging { + background:url(images/line.gif) repeat-y 2px center; +} +.flexigrid div.iDiv { + border:1px solid #316ac5; + position:absolute; + overflow:visible; + background:none; +} +.flexigrid div.iDiv input,.flexigrid div.iDiv select,.flexigrid div.iDiv textarea { + font-family:Arial,Helvetica,sans-serif; + font-size:11px; +} +.flexigrid div.iDiv input.tb { + border:0px; + padding:0px; + width:100%; + height:100%; + padding:0px; + background:none; +} +.flexigrid div.bDiv { + border:1px solid #ccc; + border-top:0px; + background:#fff; + overflow:auto; + position:relative; +} +.flexigrid div.form-div { + border:1px solid #ccc; + border-top:0px; + background:#fff; + position:relative; + font-size:15px; + padding:0px 0px 10px 0px; +} +.flexigrid div.form-div select +{ + font-size: 15px; + border: 1px solid #AAA; + padding: 5px 5px 5px 5px; + background: #fafafa; +} +.flexigrid div.form-div select option +{ + padding-right: 10px; +} +.flexigrid div.form-div input[type=text], .flexigrid div.form-div input[type=password] +{ + font-size: 15px; + width: 500px; + height:20px; + border: 1px solid #AAA; + padding: 5px 5px 5px 5px; + background: #fafafa; +} +.flexigrid div.form-div textarea +{ + font-size: 15px; + border: 1px solid #AAA; + padding: 5px 5px 5px 5px; + background: #fafafa; +} + +.flexigrid div.form-div textarea:hover, +.flexigrid div.form-div input[type=text]:hover, +.flexigrid div.form-div select:hover +{ + border: 1px solid #555; + background: #fff; +} +.flexigrid div.form-div textarea:focus, .flexigrid div.form-div input[type=text]:focus, .flexigrid div.form-div select:focus +{ + border: 1px solid #444; + background: #fff; +} +div.form-div input.datepicker-input +{ + width: 100px !important; +} +div.form-div input.datetime-input +{ + width:150px !important; +} +.form-field-box +{ + padding: 5px 10px; + margin: 0px 0px 5px 0px; + min-height: 30px; +} +.form-field-box.odd +{ + background: #fff; +} +.form-field-box.even +{ + background: #EFEFEF; +} +.form-display-as-box +{ + float:left; + width:200px; + padding-top:7px; +} +.form-input-box +{ + float:left; +} +.flexigrid div.form-button-box { + float:left; + margin-top:11px; + margin-left:10px; +} +.flexigrid div.bDiv table { + border-bottom:1px solid #ccc; +} +.flexigrid div.hGrip { + position:absolute; + top:0px; + right:0px; + height:5px; + width:5px; + background:url(images/line.gif) repeat-x center; + margin-right:1px; + cursor:col-resize; +} +.flexigrid div.hGrip:hover,.flexigrid div.hGrip.hgOver { + border-right:1px solid #999; + margin-right:0px; +} +.flexigrid div.vGrip { + height:5px; + overflow:hidden; + position:relative; + background:#fafafa url(images/wbg.gif) repeat-x 0px -1px; + border:1px solid #ccc; + border-top:0px; + text-align:center; + cursor:row-resize; +} +.flexigrid div.vGrip span { + display:block; + margin:1px auto; + width:20px; + height:1px; + overflow:hidden; + border-top:1px solid #aaa; + border-bottom:1px solid #aaa; + background:none; +} +.flexigrid table tr.hDiv th,.flexigrid div.bDiv td /* common cell properties*/ { + text-align:left; + border-right:1px solid #ddd; + border-left:1px solid #fff; + overflow:hidden; + vertical-align:top !important; +} +.flexigrid table tr.hDiv th div,.flexigrid div.bDiv td div,div.colCopy div/* common inner cell properties*/ { + padding:5px; + border-left:0px solid #fff; +} +.flexigrid div.hDiv th,div.colCopy { + font-weight:normal; + height:24px; + cursor:default; + white-space:nowrap; + overflow:hidden; +} +div.colCopy { + font-family:Arial,Helvetica,sans-serif; + font-size:11px; + background:#fafafa url(images/fhbg.gif) repeat-x bottom; + border:1px solid #ccc; + border-bottom:0px; + overflow:hidden; +} +.flexigrid div.hDiv th.sorted { + background:url(images/wbg.gif) repeat-x 0px -1px; + border-bottom:0px solid #ccc; +} +.flexigrid div.hDiv th.thOver { +} +.flexigrid div.hDiv th.thOver div,.flexigrid div.hDiv th.sorted.thOver div { + border-bottom:1px solid orange; + padding-bottom:4px; +} +.flexigrid div.hDiv th.sorted div { + border-bottom:0px solid #ccc; + padding-bottom:5px; +} +.flexigrid div.hDiv th.thMove { + background:#fff; + color:#fff; +} +.flexigrid div.hDiv th.sorted.thMove div { + border-bottom:1px solid #fff; + padding-bottom:4px +} +.flexigrid div.hDiv th.thMove div { + background:#fff !important; +} +.flexigrid table tr.hDiv th div.desc { + background:url(images/dn.png) no-repeat center top; +} +.flexigrid table tr.hDiv th div.asc { + background:url(images/up.png) no-repeat center top; +} +.flexigrid div.bDiv td { + border-bottom:1px solid #fff; + vertical-align:top; + white-space:nowrap; +} +.flexigrid div.hDiv th div { + overflow:hidden; +} +.flexigrid span.cdropleft { + display:block; + background:url(images/prev.gif) no-repeat -4px center; + width:24px; + height:24px; + position:relative; + top:-24px; + margin-bottom:-24px; + z-index:3; +} +.flexigrid div.hDiv span.cdropright { + display:block; + background:url(images/next.gif) no-repeat 12px center; + width:24px; + height:24px; + float:right; + position:relative; + top:-24px; + margin-bottom:-24px; +} +.flexigrid div.bDiv td div { + border-top:0px solid #fff; + padding-bottom:4px; +} +.flexigrid tr td.sorted { + background:#f3f3f3; + border-right:1px solid #ddd; + border-bottom:1px solid #f3f3f3; +} +.flexigrid tr td.sorted div { +} +.flexigrid tr.erow td { + background:#f7f7f7; + border-bottom:1px solid #f7f7f7; +} +.flexigrid tr.erow td.sorted { + background:#e3e3e3; + border-bottom:1px solid #e3e3e3; +} +.flexigrid tr.erow td.sorted div { +} +.flexigrid div.bDiv tr:hover td,.flexigrid div.bDiv tr:hover td.sorted,.flexigrid div.bDiv tr.trOver td.sorted,.flexigrid div.bDiv tr.trOver td { + background:#d9ebf5; + border-left:1px solid #eef8ff; + border-bottom:1px dotted #a8d8eb; +} +.flexigrid div.bDiv tr.trSelected:hover td,.flexigrid div.bDiv tr.trSelected:hover td.sorted,.flexigrid div.bDiv tr.trOver.trSelected td.sorted,.flexigrid div.bDiv tr.trOver.trSelected td,.flexigrid tr.trSelected td.sorted,.flexigrid tr.trSelected td { + background:#d5effc url(images/hl.png) repeat-x top; + border-right:1px solid #d2e3ec; + border-left:1px solid #eef8ff; + border-bottom: 1px solid #a8d8eb; +} +/* novstripe adjustments */ +.flexigrid.novstripe .bDiv table { + border-bottom:1px solid #ccc; + border-right:1px solid #ccc; +} +.flexigrid.novstripe div.bDiv td { + border-right-color:#fff; +} +.flexigrid.novstripe div.bDiv tr.erow td.sorted { + border-right-color:#e3e3e3; +} +.flexigrid.novstripe div.bDiv tr td.sorted { + border-right-color:#f3f3f3; +} +.flexigrid.novstripe div.bDiv tr.erow td { + border-right-color:#f7f7f7; + border-left-color:#f7f7f7; +} +.flexigrid.novstripe div.bDiv tr.trSelected:hover td,.flexigrid.novstripe div.bDiv tr.trSelected:hover td.sorted,.flexigrid.novstripe div.bDiv tr.trOver.trSelected td.sorted,.flexigrid.novstripe div.bDiv tr.trOver.trSelected td,.flexigrid.novstripe tr.trSelected td.sorted,.flexigrid.novstripe tr.trSelected td { + border-right:1px solid #0066FF; + border-left:1px solid #0066FF; +} +.flexigrid.novstripe div.bDiv tr.trOver td,.flexigrid.novstripe div.bDiv tr:hover td { + border-left-color:#d9ebf5; + border-right-color: #d9ebf5; +} +/* end novstripe */ +.flexigrid div.pDiv { + background:url(images/wbg.gif) repeat-x 0 -1px; + border:1px solid #ccc; + border-top:0px; + overflow:hidden; + white-space:nowrap; + position:relative; +} +.flexigrid div.pDiv div.pDiv2 { + margin:3px; + margin-left:-2px; + float:left; + width:1024px; +} +div.pGroup { + float:left; + background:none; + height:24px; + margin:0px 5px; +} +.flexigrid div.pDiv .pPageStat,.flexigrid div.pDiv .pcontrol { + position:relative; + top:5px; + overflow:visible; +} +.flexigrid div.pDiv input { + vertical-align:text-top; + position:relative; + top:-5px; +} +.flexigrid div.pDiv div.pButton { + float:left; + width:22px; + height:22px; + border:0px; + cursor:pointer; + overflow:hidden; +} +.flexigrid div.pDiv div.pButton:hover,.flexigrid div.pDiv div.pButton.pBtnOver { + width:20px; + height:20px; + border:1px solid #ccc; + cursor:pointer; +} +.flexigrid div.pDiv div.pButton span { + width:20px; + height:20px; + display:block; + float:left; +} +.flexigrid div.pDiv div.pButton:hover span,.flexigrid div.pDiv div.pButton.pBtnOver span { + width:19px; + height:19px; + border-top:1px solid #fff; + border-left:1px solid #fff; +} +.flexigrid .pSearch { + background:url(images/magnifier.png) no-repeat center; +} +.flexigrid .pFirst { + background:url(images/first.gif) no-repeat center; +} +.flexigrid .pPrev { + background:url(images/prev.gif) no-repeat center; +} +.flexigrid .pNext { + background:url(images/next.gif) no-repeat center; +} +.flexigrid .pLast { + background:url(images/last.gif) no-repeat center; +} +.flexigrid .pReload { + background:url(images/load.png) no-repeat center; +} +.flexigrid .pReload.loading,.flexigrid .fbutton.loading{ + background:url(images/load.gif) no-repeat center; +} +.flexigrid .simple-loading{ + background:url(images/load.gif) no-repeat center; + display:block; + float:left; + width: 16px; + height: 16px; +} +.flexigrid .search-div-clear-button +{ + float:right; + padding:5px; +} +.flexigrid .edit-icon +{ + background:url(images/edit.png) no-repeat; + cursor: pointer; + width: 16px; + height:16px; + float:right; + border: none !important; + padding:0px !important; + padding-bottom:0px !important; + margin-left:5px; + display: block; +} +.flexigrid .delete-icon +{ + background:url(images/close.png) no-repeat; + cursor: pointer; + width: 16px; + height:16px; + float:right; + border: none !important; + padding:0px !important; + padding-bottom:0px !important; + margin-left:5px; + display: block; +} +.flexigrid .read-icon +{ + background:url(images/magnifier.png) no-repeat center; + cursor: pointer; + width: 16px; + height:16px; + float:right; + border: none !important; + padding:0px !important; + padding-bottom:0px !important; + margin-left:5px; + display: block; +} +.flexigrid .tools +{ + white-space: nowrap; + padding:0px; + padding:5px 5px 3px 5px; +} + +/* Some extras */ + +.text-center +{ + text-align: center; +} +.text-left +{ + text-align: left; +} +.text-right +{ + text-align: right; +} +.add-anchor, .delete-anchor, .export-anchor, .print-anchor +{ + color: #000; +} +.floatL +{ + float:left; +} +.floatR +{ + float:right; +} +.clear +{ + clear: both !important; + border: none !important; + padding: 0px !important; + margin: 0px !important; + height:0px; + width:0px; +} +.flexigrid a img +{ + border: none; +} +.flexigrid textarea +{ + width:500px; + height: 80px; +} +/* ie adjustments */ +.flexigrid.ie div.hDiv th div,.flexigrid.ie div.bDiv td div,div.colCopy.ie div/* common inner cell properties*/ { + overflow: hidden; +} +.report-div +{ + padding: 10px; + border-style: solid; + border-width: 1px; + margin-bottom: 10px; + margin-top: 10px; + display:none; + font-family: Arial,Helvetica,sans-serif; +} +.report-div.success +{ + border-color: green; +} +.report-div.success p +{ + background: url(images/success.png) no-repeat left center; + margin: 0px !important; + padding: 10px 0px 10px 25px !important; +} +.report-div.error +{ + border-color: red; +} +.report-div.error p +{ + background: url(images/error.png) no-repeat left center; + margin: 0px !important; + padding: 10px 0px 10px 25px !important; +} +input.field_error +{ + border: 1px solid red !important; +} +.flexigrid .ftitle-left +{ + float: left; + margin:0px !important; + padding: 0px !important; +} +.flexigrid .ftitle-right +{ + float: right; + margin:0px; + padding:0px 25px 0px 0px !important; +} +div.flexigrid .ftitle a +{ + color: blue; + text-decoration: none; +} +div.flexigrid .ftitle a:hover +{ + text-decoration: underline; +} +div.flexigrid a +{ + color: blue; + text-decoration: none; +} +div.flexigrid a:hover +{ + text-decoration: underline; +} +.small-loading +{ + background: url('images/load.gif') no-repeat; + width:16px; + height:15px; + padding-left:25px; + padding-top:1px; + display: none; +} +.crud-action +{ + float:right; + margin-left:5px; + padding:0px; + margin-right: 3px; +} +.readonly_label +{ + padding-top:7px; +} +ul.chzn-choices li.search-field input +{ + box-shadow: none !important; +} +#crudForm .pDiv +{ + background: #FFF !important; + padding-top:10px; + padding-bottom:10px; + border-radius: 0px 0px 5px 5px; +} +textarea.texteditor, textarea.mini-texteditor +{ + width:750px; + height: 200px; +} +.flexigrid div.form-div{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color: #444;} +.flexigrid div.form-div input[type=text],.flexigrid div.form-div textarea,.flexigrid div.form-div select{display:inline-block;line-height:18px;color:#444;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.flexigrid div.form-div input[type=text],.flexigrid div.form-div select,.flexigrid div.form-div textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;} +.flexigrid div.form-div input[type=text]{line-height:normal;*overflow:visible;} +.flexigrid div.form-div input[type=text],.flexigrid div.form-div select,.flexigrid div.form-div textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:normal;line-height:normal;} +.flexigrid div.form-div input[type=text],.flexigrid div.form-div textarea{-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);} +.flexigrid div.form-div input[type=text]:focus,.flexigrid div.form-div textarea:focus{outline:0;border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);} + +/* Some beautiful twitter bootstrap buttons */ +.btn { + display: inline-block; + *display: inline; + padding: 4px 10px 4px; + margin-bottom: 0; + *margin-left: .3em; + font-size: 13px; + line-height: 18px; + *line-height: 20px; + color: #333333; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; + cursor: pointer; + background-color: #f5f5f5; + *background-color: #e6e6e6; + background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(top, #ffffff, #e6e6e6); + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-repeat: repeat-x; + border: 1px solid #cccccc; + *border: 0; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-bottom-color: #b3b3b3; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn:hover, +.btn:active, +.btn.active, +.btn.disabled, +.btn[disabled] { + background-color: #e6e6e6; + *background-color: #d9d9d9; +} + +.btn:active, +.btn.active { + background-color: #cccccc \9; +} + +.btn:first-child { + *margin-left: 0; +} + +.btn:hover { + color: #333333; + text-decoration: none; + background-color: #e6e6e6; + *background-color: #d9d9d9; + /* Buttons in IE7 don't get borders, so darken on hover */ + + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -ms-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} + +.btn:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.btn.active, +.btn:active { + background-color: #e6e6e6; + background-color: #d9d9d9 \9; + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn.disabled, +.btn[disabled] { + cursor: default; + background-color: #e6e6e6; + background-image: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.btn-large { + padding: 9px 14px; + font-size: 15px; + line-height: normal; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} + +.btn-large [class^="icon-"] { + margin-top: 1px; +} + +.btn-small { + padding: 5px 9px; + font-size: 11px; + line-height: 16px; +} + +.btn-small [class^="icon-"] { + margin-top: -1px; +} + +.btn-mini { + padding: 2px 6px; + font-size: 11px; + line-height: 14px; +} + +.btn-primary, +.btn-primary:hover, +.btn-warning, +.btn-warning:hover, +.btn-danger, +.btn-danger:hover, +.btn-success, +.btn-success:hover, +.btn-info, +.btn-info:hover, +.btn-inverse, +.btn-inverse:hover { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.btn-primary.active, +.btn-warning.active, +.btn-danger.active, +.btn-success.active, +.btn-info.active, +.btn-inverse.active { + color: rgba(255, 255, 255, 0.75); +} + +.btn { + border-color: #ccc; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} + +.btn-primary { + background-color: #0074cc; + *background-color: #0055cc; + background-image: -ms-linear-gradient(top, #0088cc, #0055cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0055cc); + background-image: -o-linear-gradient(top, #0088cc, #0055cc); + background-image: -moz-linear-gradient(top, #0088cc, #0055cc); + background-image: linear-gradient(top, #0088cc, #0055cc); + background-repeat: repeat-x; + border-color: #0055cc #0055cc #003580; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} + +.btn-primary:hover, +.btn-primary:active, +.btn-primary.active, +.btn-primary.disabled, +.btn-primary[disabled] { + background-color: #0055cc; + *background-color: #004ab3; +} + +.btn-primary:active, +.btn-primary.active { + background-color: #004099 \9; +} + +.btn-warning { + background-color: #faa732; + *background-color: #f89406; + background-image: -ms-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(top, #fbb450, #f89406); + background-repeat: repeat-x; + border-color: #f89406 #f89406 #ad6704; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} + +.btn-warning:hover, +.btn-warning:active, +.btn-warning.active, +.btn-warning.disabled, +.btn-warning[disabled] { + background-color: #f89406; + *background-color: #df8505; +} + +.btn-warning:active, +.btn-warning.active { + background-color: #c67605 \9; +} + +.btn-danger { + background-color: #da4f49; + *background-color: #bd362f; + background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); + background-image: linear-gradient(top, #ee5f5b, #bd362f); + background-repeat: repeat-x; + border-color: #bd362f #bd362f #802420; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} + +.btn-danger:hover, +.btn-danger:active, +.btn-danger.active, +.btn-danger.disabled, +.btn-danger[disabled] { + background-color: #bd362f; + *background-color: #a9302a; +} + +.btn-danger:active, +.btn-danger.active { + background-color: #942a25 \9; +} + +.btn-success { + background-color: #5bb75b; + *background-color: #51a351; + background-image: -ms-linear-gradient(top, #62c462, #51a351); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); + background-image: -webkit-linear-gradient(top, #62c462, #51a351); + background-image: -o-linear-gradient(top, #62c462, #51a351); + background-image: -moz-linear-gradient(top, #62c462, #51a351); + background-image: linear-gradient(top, #62c462, #51a351); + background-repeat: repeat-x; + border-color: #51a351 #51a351 #387038; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} + +.btn-success:hover, +.btn-success:active, +.btn-success.active, +.btn-success.disabled, +.btn-success[disabled] { + background-color: #51a351; + *background-color: #499249; +} + +.btn-success:active, +.btn-success.active { + background-color: #408140 \9; +} + +.btn-info { + background-color: #49afcd; + *background-color: #2f96b4; + background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); + background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); + background-image: linear-gradient(top, #5bc0de, #2f96b4); + background-repeat: repeat-x; + border-color: #2f96b4 #2f96b4 #1f6377; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} + +.btn-info:hover, +.btn-info:active, +.btn-info.active, +.btn-info.disabled, +.btn-info[disabled] { + background-color: #2f96b4; + *background-color: #2a85a0; +} + +.btn-info:active, +.btn-info.active { + background-color: #24748c \9; +} + +.btn-inverse { + background-color: #414141; + *background-color: #222222; + background-image: -ms-linear-gradient(top, #555555, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222)); + background-image: -webkit-linear-gradient(top, #555555, #222222); + background-image: -o-linear-gradient(top, #555555, #222222); + background-image: -moz-linear-gradient(top, #555555, #222222); + background-image: linear-gradient(top, #555555, #222222); + background-repeat: repeat-x; + border-color: #222222 #222222 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} + +.btn-inverse:hover, +.btn-inverse:active, +.btn-inverse.active, +.btn-inverse.disabled, +.btn-inverse[disabled] { + background-color: #222222; + *background-color: #151515; +} + +.btn-inverse:active, +.btn-inverse.active { + background-color: #080808 \9; +} + +button.btn, +input[type="submit"].btn { + *padding-top: 2px; + *padding-bottom: 2px; +} + +button.btn::-moz-focus-inner, +input[type="submit"].btn::-moz-focus-inner { + padding: 0; + border: 0; +} + +button.btn.btn-large, +input[type="submit"].btn.btn-large { + *padding-top: 7px; + *padding-bottom: 7px; +} + +button.btn.btn-small, +input[type="submit"].btn.btn-small { + *padding-top: 3px; + *padding-bottom: 3px; +} + +button.btn.btn-mini, +input[type="submit"].btn.btn-mini { + *padding-top: 1px; + *padding-bottom: 1px; +} + +.btn-group { + position: relative; + *margin-left: .3em; + *zoom: 1; +} + +.btn-group:before, +.btn-group:after { + display: table; + content: ""; +} + +.btn-group:after { + clear: both; +} + +.btn-group:first-child { + *margin-left: 0; +} + +.btn-group + .btn-group { + margin-left: 5px; +} + +.btn-toolbar { + margin-top: 9px; + margin-bottom: 9px; +} + +.btn-toolbar .btn-group { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; +} + +.btn-group > .btn { + position: relative; + float: left; + margin-left: -1px; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.btn-group > .btn:first-child { + margin-left: 0; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 4px; +} + +.btn-group > .btn:last-child, +.btn-group > .dropdown-toggle { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; +} + +.btn-group > .btn.large:first-child { + margin-left: 0; + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -webkit-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-topleft: 6px; +} + +.btn-group > .btn.large:last-child, +.btn-group > .large.dropdown-toggle { + -webkit-border-top-right-radius: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-topright: 6px; + -moz-border-radius-bottomright: 6px; +} + +.btn-group > .btn:hover, +.btn-group > .btn:focus, +.btn-group > .btn:active, +.btn-group > .btn.active { + z-index: 2; +} + +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} + +.btn-group > .dropdown-toggle { + *padding-top: 4px; + padding-right: 8px; + *padding-bottom: 4px; + padding-left: 8px; + -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn-group > .btn-mini.dropdown-toggle { + padding-right: 5px; + padding-left: 5px; +} + +.btn-group > .btn-small.dropdown-toggle { + *padding-top: 4px; + *padding-bottom: 4px; +} + +.btn-group > .btn-large.dropdown-toggle { + padding-right: 12px; + padding-left: 12px; +} + +.btn-group.open .dropdown-toggle { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn-group.open .btn.dropdown-toggle { + background-color: #e6e6e6; +} + +.btn-group.open .btn-primary.dropdown-toggle { + background-color: #0055cc; +} + +.btn-group.open .btn-warning.dropdown-toggle { + background-color: #f89406; +} + +.btn-group.open .btn-danger.dropdown-toggle { + background-color: #bd362f; +} + +.btn-group.open .btn-success.dropdown-toggle { + background-color: #51a351; +} + +.btn-group.open .btn-info.dropdown-toggle { + background-color: #2f96b4; +} + +.btn-group.open .btn-inverse.dropdown-toggle { + background-color: #222222; +} + +.btn .caret { + margin-top: 7px; + margin-left: 0; +} + +.btn:hover .caret, +.open.btn-group .caret { + opacity: 1; + filter: alpha(opacity=100); +} + +.btn-mini .caret { + margin-top: 5px; +} + +.btn-small .caret { + margin-top: 6px; +} + +.btn-large .caret { + margin-top: 6px; + border-top-width: 5px; + border-right-width: 5px; + border-left-width: 5px; +} + +.dropup .btn-large .caret { + border-top: 0; + border-bottom: 5px solid #000000; +} + +.btn-primary .caret, +.btn-warning .caret, +.btn-danger .caret, +.btn-info .caret, +.btn-success .caret, +.btn-inverse .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; + opacity: 0.75; + filter: alpha(opacity=75); +} + +/* End of twitter bootstrap buttons */ + +.pretty-radio-buttons +{ + margin-top: 6px; +} + +.pretty-radio-buttons label +{ + margin-right: 10px; +} +.ui-widget +{ + font-size: 12px !important; +} + + +/** Common CSS */ +.loading-opacity +{ + opacity: 0.5; + pointer-events: none; + cursor: default; +} + +.loading-opacity:before { + font-size: 26px; + position:absolute; + color: #000; + content: "Loading..."; + margin-left: 550px; + z-index: 1000; +} diff --git a/assets/grocery_crud/themes/flexigrid/css/images/index.html b/assets/grocery_crud/themes/flexigrid/css/images/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/themes/flexigrid/css/images/index.html +++ b/assets/grocery_crud/themes/flexigrid/css/images/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + \ No newline at end of file diff --git a/assets/grocery_crud/themes/flexigrid/css/index.html b/assets/grocery_crud/themes/flexigrid/css/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/themes/flexigrid/css/index.html +++ b/assets/grocery_crud/themes/flexigrid/css/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + \ No newline at end of file diff --git a/assets/grocery_crud/themes/flexigrid/index.html b/assets/grocery_crud/themes/flexigrid/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/themes/flexigrid/index.html +++ b/assets/grocery_crud/themes/flexigrid/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + \ No newline at end of file diff --git a/assets/grocery_crud/themes/flexigrid/js/cookies.js b/assets/grocery_crud/themes/flexigrid/js/cookies.js index 3d39495..caeb0c4 100755 --- a/assets/grocery_crud/themes/flexigrid/js/cookies.js +++ b/assets/grocery_crud/themes/flexigrid/js/cookies.js @@ -1,25 +1,25 @@ -function createCookie(name,value,days) { - if (days) { - var date = new Date(); - date.setTime(date.getTime()+(days*24*60*60*1000)); - var expires = "; expires="+date.toGMTString(); - } - else var expires = ""; - document.cookie = name+"="+escape(value)+expires+"; path=/"; -} - -function readCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) - return unescape(c.substring(nameEQ.length,c.length)); - } - return null; -} - -function eraseCookie(name) { - createCookie(name,"",-1); +function createCookie(name,value,days) { + if (days) { + var date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + var expires = "; expires="+date.toGMTString(); + } + else var expires = ""; + document.cookie = name+"="+escape(value)+expires+"; path=/"; +} + +function readCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) + return unescape(c.substring(nameEQ.length,c.length)); + } + return null; +} + +function eraseCookie(name) { + createCookie(name,"",-1); } \ No newline at end of file diff --git a/assets/grocery_crud/themes/flexigrid/js/flexigrid-add.js b/assets/grocery_crud/themes/flexigrid/js/flexigrid-add.js index 28ac460..f006397 100755 --- a/assets/grocery_crud/themes/flexigrid/js/flexigrid-add.js +++ b/assets/grocery_crud/themes/flexigrid/js/flexigrid-add.js @@ -1,146 +1,146 @@ -$(function(){ - $('.ptogtitle').click(function(){ - if($(this).hasClass('vsble')) - { - $(this).removeClass('vsble'); - $('#main-table-box #crudForm').slideDown("slow"); - } - else - { - $(this).addClass('vsble'); - $('#main-table-box #crudForm').slideUp("slow"); - } - }); - - var save_and_close = false; - - $('#save-and-go-back-button').click(function(){ - save_and_close = true; - - $('#crudForm').trigger('submit'); - }); - - $('#crudForm').submit(function(){ - var my_crud_form = $(this); - - $(this).ajaxSubmit({ - url: validation_url, - dataType: 'json', - cache: 'false', - beforeSend: function(){ - $("#FormLoading").show(); - }, - success: function(data){ - $("#FormLoading").hide(); - if(data.success) - { - $('#crudForm').ajaxSubmit({ - dataType: 'text', - cache: 'false', - beforeSend: function(){ - $("#FormLoading").show(); - }, - success: function(result){ - $("#FormLoading").fadeOut("slow"); - data = $.parseJSON( result ); - if(data.success) - { - var data_unique_hash = my_crud_form.closest(".flexigrid").attr("data-unique-hash"); - - $('.flexigrid[data-unique-hash='+data_unique_hash+']').find('.ajax_refresh_and_loading').trigger('click'); - - if(save_and_close) - { - if ($('#save-and-go-back-button').closest('.ui-dialog').length === 0) { - window.location = data.success_list_url; - } else { - $(".ui-dialog-content").dialog("close"); - success_message(data.success_message); - } - - return true; - } - - $('.field_error').each(function(){ - $(this).removeClass('field_error'); - }); - clearForm(); - form_success_message(data.success_message); - } - else - { - alert( message_insert_error ); - } - }, - error: function(){ - alert( message_insert_error ); - $("#FormLoading").hide(); - } - }); - } - else - { - $('.field_error').removeClass('field_error'); - form_error_message(data.error_message); - $.each(data.error_fields, function(index,value){ - $('input[name='+index+']').addClass('field_error'); - }); - - } - }, - error: function(){ - error_message (message_insert_error); - $("#FormLoading").hide(); - } - }); - return false; - }); - - if( $('#cancel-button').closest('.ui-dialog').length === 0 ) { - - $('#cancel-button').click(function(){ - if( confirm( message_alert_add_form ) ) - { - window.location = list_url; - } - - return false; - }); - - } - }); - - function clearForm() - { - $('#crudForm').find(':input').each(function() { - switch(this.type) { - case 'password': - case 'select-multiple': - case 'select-one': - case 'text': - case 'textarea': - $(this).val(''); - break; - case 'checkbox': - case 'radio': - this.checked = false; - } - }); - - /* Clear upload inputs */ - $('.open-file,.gc-file-upload,.hidden-upload-input').each(function(){ - $(this).val(''); - }); - - $('.upload-success-url').hide(); - $('.fileinput-button').fadeIn("normal"); - /* -------------------- */ - - $('.remove-all').each(function(){ - $(this).trigger('click'); - }); - - $('.chosen-multiple-select, .chosen-select, .ajax-chosen-select').each(function(){ - $(this).trigger("liszt:updated"); - }); - } \ No newline at end of file +$(function(){ + $('.ptogtitle').click(function(){ + if($(this).hasClass('vsble')) + { + $(this).removeClass('vsble'); + $('#main-table-box #crudForm').slideDown("slow"); + } + else + { + $(this).addClass('vsble'); + $('#main-table-box #crudForm').slideUp("slow"); + } + }); + + var save_and_close = false; + + $('#save-and-go-back-button').click(function(){ + save_and_close = true; + + $('#crudForm').trigger('submit'); + }); + + $('#crudForm').submit(function(){ + var my_crud_form = $(this); + + $(this).ajaxSubmit({ + url: validation_url, + dataType: 'json', + cache: 'false', + beforeSend: function(){ + $("#FormLoading").show(); + }, + success: function(data){ + $("#FormLoading").hide(); + if(data.success) + { + $('#crudForm').ajaxSubmit({ + dataType: 'text', + cache: 'false', + beforeSend: function(){ + $("#FormLoading").show(); + }, + success: function(result){ + $("#FormLoading").fadeOut("slow"); + data = $.parseJSON( result ); + if(data.success) + { + var data_unique_hash = my_crud_form.closest(".flexigrid").attr("data-unique-hash"); + + $('.flexigrid[data-unique-hash='+data_unique_hash+']').find('.ajax_refresh_and_loading').trigger('click'); + + if(save_and_close) + { + if ($('#save-and-go-back-button').closest('.ui-dialog').length === 0) { + window.location = data.success_list_url; + } else { + $(".ui-dialog-content").dialog("close"); + success_message(data.success_message); + } + + return true; + } + + $('.field_error').each(function(){ + $(this).removeClass('field_error'); + }); + clearForm(); + form_success_message(data.success_message); + } + else + { + alert( message_insert_error ); + } + }, + error: function(){ + alert( message_insert_error ); + $("#FormLoading").hide(); + } + }); + } + else + { + $('.field_error').removeClass('field_error'); + form_error_message(data.error_message); + $.each(data.error_fields, function(index,value){ + $('input[name='+index+']').addClass('field_error'); + }); + + } + }, + error: function(){ + error_message (message_insert_error); + $("#FormLoading").hide(); + } + }); + return false; + }); + + if( $('#cancel-button').closest('.ui-dialog').length === 0 ) { + + $('#cancel-button').click(function(){ + if( confirm( message_alert_add_form ) ) + { + window.location = list_url; + } + + return false; + }); + + } + }); + + function clearForm() + { + $('#crudForm').find(':input').each(function() { + switch(this.type) { + case 'password': + case 'select-multiple': + case 'select-one': + case 'text': + case 'textarea': + $(this).val(''); + break; + case 'checkbox': + case 'radio': + this.checked = false; + } + }); + + /* Clear upload inputs */ + $('.open-file,.gc-file-upload,.hidden-upload-input').each(function(){ + $(this).val(''); + }); + + $('.upload-success-url').hide(); + $('.fileinput-button').fadeIn("normal"); + /* -------------------- */ + + $('.remove-all').each(function(){ + $(this).trigger('click'); + }); + + $('.chosen-multiple-select, .chosen-select, .ajax-chosen-select').each(function(){ + $(this).trigger("liszt:updated"); + }); + } \ No newline at end of file diff --git a/assets/grocery_crud/themes/flexigrid/js/flexigrid-edit.js b/assets/grocery_crud/themes/flexigrid/js/flexigrid-edit.js index 0b302fc..7273bfb 100755 --- a/assets/grocery_crud/themes/flexigrid/js/flexigrid-edit.js +++ b/assets/grocery_crud/themes/flexigrid/js/flexigrid-edit.js @@ -1,115 +1,115 @@ -$(function(){ - - var save_and_close = false; - - $('.ptogtitle').click(function(){ - if($(this).hasClass('vsble')) - { - $(this).removeClass('vsble'); - $('#main-table-box #crudForm').slideDown("slow"); - } - else - { - $(this).addClass('vsble'); - $('#main-table-box #crudForm').slideUp("slow"); - } - }); - - $('#save-and-go-back-button').click(function(){ - save_and_close = true; - - $('#crudForm').trigger('submit'); - }); - - $('#crudForm').submit(function(){ - var my_crud_form = $(this); - - $(this).ajaxSubmit({ - url: validation_url, - dataType: 'json', - cache: 'false', - beforeSend: function(){ - $("#FormLoading").show(); - }, - success: function(data){ - $("#FormLoading").hide(); - if(data.success) - { - $('#crudForm').ajaxSubmit({ - dataType: 'text', - cache: 'false', - beforeSend: function(){ - $("#FormLoading").show(); - }, - success: function(result){ - - $("#FormLoading").fadeOut("slow"); - data = $.parseJSON( result ); - if(data.success) - { - var data_unique_hash = my_crud_form.closest(".flexigrid").attr("data-unique-hash"); - - $('.flexigrid[data-unique-hash='+data_unique_hash+']').find('.ajax_refresh_and_loading').trigger('click'); - - if(save_and_close) - { - if ($('#save-and-go-back-button').closest('.ui-dialog').length === 0) { - window.location = data.success_list_url; - } else { - $(".ui-dialog-content").dialog("close"); - success_message(data.success_message); - } - - return true; - } - - form_success_message(data.success_message); - } - else - { - form_error_message(message_update_error); - } - }, - error: function(){ - form_error_message( message_update_error ); - } - }); - } - else - { - $('.field_error').each(function(){ - $(this).removeClass('field_error'); - }); - $('#report-error').slideUp('fast'); - $('#report-error').html(data.error_message); - $.each(data.error_fields, function(index,value){ - $('input[name='+index+']').addClass('field_error'); - }); - - $('#report-error').slideDown('normal'); - $('#report-success').slideUp('fast').html(''); - - } - }, - error: function(){ - alert( message_update_error ); - $("#FormLoading").hide(); - - } - }); - return false; - }); - - if( $('#cancel-button').closest('.ui-dialog').length === 0 ) { - - $('#cancel-button').click(function(){ - if( $(this).hasClass('back-to-list') || confirm( message_alert_edit_form ) ) - { - window.location = list_url; - } - - return false; - }); - - } -}); +$(function(){ + + var save_and_close = false; + + $('.ptogtitle').click(function(){ + if($(this).hasClass('vsble')) + { + $(this).removeClass('vsble'); + $('#main-table-box #crudForm').slideDown("slow"); + } + else + { + $(this).addClass('vsble'); + $('#main-table-box #crudForm').slideUp("slow"); + } + }); + + $('#save-and-go-back-button').click(function(){ + save_and_close = true; + + $('#crudForm').trigger('submit'); + }); + + $('#crudForm').submit(function(){ + var my_crud_form = $(this); + + $(this).ajaxSubmit({ + url: validation_url, + dataType: 'json', + cache: 'false', + beforeSend: function(){ + $("#FormLoading").show(); + }, + success: function(data){ + $("#FormLoading").hide(); + if(data.success) + { + $('#crudForm').ajaxSubmit({ + dataType: 'text', + cache: 'false', + beforeSend: function(){ + $("#FormLoading").show(); + }, + success: function(result){ + + $("#FormLoading").fadeOut("slow"); + data = $.parseJSON( result ); + if(data.success) + { + var data_unique_hash = my_crud_form.closest(".flexigrid").attr("data-unique-hash"); + + $('.flexigrid[data-unique-hash='+data_unique_hash+']').find('.ajax_refresh_and_loading').trigger('click'); + + if(save_and_close) + { + if ($('#save-and-go-back-button').closest('.ui-dialog').length === 0) { + window.location = data.success_list_url; + } else { + $(".ui-dialog-content").dialog("close"); + success_message(data.success_message); + } + + return true; + } + + form_success_message(data.success_message); + } + else + { + form_error_message(message_update_error); + } + }, + error: function(){ + form_error_message( message_update_error ); + } + }); + } + else + { + $('.field_error').each(function(){ + $(this).removeClass('field_error'); + }); + $('#report-error').slideUp('fast'); + $('#report-error').html(data.error_message); + $.each(data.error_fields, function(index,value){ + $('input[name='+index+']').addClass('field_error'); + }); + + $('#report-error').slideDown('normal'); + $('#report-success').slideUp('fast').html(''); + + } + }, + error: function(){ + alert( message_update_error ); + $("#FormLoading").hide(); + + } + }); + return false; + }); + + if( $('#cancel-button').closest('.ui-dialog').length === 0 ) { + + $('#cancel-button').click(function(){ + if( $(this).hasClass('back-to-list') || confirm( message_alert_edit_form ) ) + { + window.location = list_url; + } + + return false; + }); + + } +}); diff --git a/assets/grocery_crud/themes/flexigrid/js/flexigrid.js b/assets/grocery_crud/themes/flexigrid/js/flexigrid.js index 33656a2..793f37f 100755 --- a/assets/grocery_crud/themes/flexigrid/js/flexigrid.js +++ b/assets/grocery_crud/themes/flexigrid/js/flexigrid.js @@ -1,266 +1,266 @@ -$(function(){ - $('.quickSearchButton').click(function(){ - $(this).closest('.flexigrid').find('.quickSearchBox').slideToggle('normal'); - }); - - $('.ptogtitle').click(function(){ - if ($(this).hasClass('vsble')) { - $(this).removeClass('vsble'); - $(this).closest('.flexigrid').find('.main-table-box').slideDown("slow"); - } else { - $(this).addClass('vsble'); - $(this).closest('.flexigrid').find('.main-table-box').slideUp("slow"); - } - }); - - var call_fancybox = function(){ - $('.image-thumbnail').fancybox({ - 'transitionIn' : 'elastic', - 'transitionOut' : 'elastic', - 'speedIn' : 600, - 'speedOut' : 200, - 'overlayShow' : false - }); - }; - - call_fancybox(); - add_edit_button_listener(); - - $('.filtering_form').submit(function(){ - var crud_page = parseInt($(this).closest('.flexigrid').find('.crud_page').val(), 10); - var last_page = parseInt($(this).closest('.flexigrid').find('.last-page-number').html(), 10); - - if (crud_page > last_page) { - $(this).closest('.flexigrid').find('.crud_page').val(last_page); - } - if (crud_page <= 0) { - $(this).closest('.flexigrid').find('.crud_page').val('1'); - } - - var this_form = $(this); - - var ajax_list_info_url = $(this).attr('data-ajax-list-info-url'); - - $(this).ajaxSubmit({ - url: ajax_list_info_url, - dataType: 'json', - beforeSend: function(){ - this_form.closest('.flexigrid').find('.ajax_refresh_and_loading').addClass('loading'); - }, - complete: function(){ - this_form.closest('.flexigrid').find('.ajax_refresh_and_loading').removeClass('loading'); - }, - success: function(data){ - this_form.closest('.flexigrid').find('.total_items').html( data.total_results); - displaying_and_pages(this_form.closest('.flexigrid')); - - this_form.ajaxSubmit({ - success: function(data){ - this_form.closest('.flexigrid').find('.ajax_list').html(data); - call_fancybox(); - add_edit_button_listener(); - } - }); - } - }); - - if ($('.flexigrid').length == 1) { //disable cookie storing for multiple grids in one page - createCookie('crud_page_'+unique_hash,crud_page,1); - createCookie('per_page_'+unique_hash,$('#per_page').val(),1); - createCookie('hidden_ordering_'+unique_hash,$('#hidden-ordering').val(),1); - createCookie('hidden_sorting_'+unique_hash,$('#hidden-sorting').val(),1); - createCookie('search_text_'+unique_hash,$(this).closest('.flexigrid').find('.search_text').val(),1); - createCookie('search_field_'+unique_hash,$('#search_field').val(),1); - } - - return false; - }); - - $('.crud_search').click(function(){ - $(this).closest('.flexigrid').find('.crud_page').val('1'); - $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); - }); - - $('.search_clear').click(function(){ - $(this).closest('.flexigrid').find('.crud_page').val('1'); - $(this).closest('.flexigrid').find('.search_text').val(''); - $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); - }); - - $('.per_page').change(function(){ - $(this).closest('.flexigrid').find('.crud_page').val('1'); - $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); - }); - - $('.ajax_refresh_and_loading').click(function(){ - $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); - }); - - $('.first-button').click(function(){ - $(this).closest('.flexigrid').find('.crud_page').val('1'); - $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); - }); - - $('.prev-button').click(function(){ - if( $(this).closest('.flexigrid').find('.crud_page').val() != "1") - { - $(this).closest('.flexigrid').find('.crud_page').val( parseInt($(this).closest('.flexigrid').find('.crud_page').val(),10) - 1 ); - $(this).closest('.flexigrid').find('.crud_page').trigger('change'); - } - }); - - $('.last-button').click(function(){ - $(this).closest('.flexigrid').find('.crud_page').val( $(this).closest('.flexigrid').find('.last-page-number').html()); - $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); - }); - - $('.next-button').click(function(){ - $(this).closest('.flexigrid').find('.crud_page').val( parseInt($(this).closest('.flexigrid').find('.crud_page').val()) + 1 ); - $(this).closest('.flexigrid').find('.crud_page').trigger('change'); - }); - - $('.crud_page').change(function(){ - $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); - }); - - $('.ajax_list').on('click','.field-sorting', function(){ - $(this).closest('.flexigrid').find('.hidden-sorting').val($(this).attr('rel')); - - if ($(this).hasClass('asc')) { - $(this).closest('.flexigrid').find('.hidden-ordering').val('desc'); - } else { - $(this).closest('.flexigrid').find('.hidden-ordering').val('asc'); - } - - $(this).closest('.flexigrid').find('.crud_page').val('1'); - $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); - }); - - $('.ajax_list').on('click','.delete-row', function(){ - var delete_url = $(this).attr('href'); - - var this_container = $(this).closest('.flexigrid'); - - if( confirm( message_alert_delete ) ) - { - $.ajax({ - url: delete_url, - dataType: 'json', - success: function(data) - { - if(data.success) - { - this_container.find('.ajax_refresh_and_loading').trigger('click'); - - success_message(data.success_message); - } - else - { - error_message(data.error_message); - - } - } - }); - } - - return false; - }); - - $('.export-anchor').click(function(){ - var export_url = $(this).attr('data-url'); - - var form_input_html = ''; - $.each($(this).closest('.flexigrid').find('.filtering_form').serializeArray(), function(i, field) { - form_input_html = form_input_html + ''; - }); - - var form_on_demand = $("
      ").attr("id","export_form").attr("method","post").attr("target","_blank") - .attr("action",export_url).html(form_input_html); - - $(this).closest('.flexigrid').find('.hidden-operations').html(form_on_demand); - - $(this).closest('.flexigrid').find('.hidden-operations').find('#export_form').submit(); - }); - - $('.print-anchor').click(function(){ - var print_url = $(this).attr('data-url'); - - var form_input_html = ''; - $.each($(this).closest('.flexigrid').find('.filtering_form').serializeArray(), function(i, field) { - form_input_html = form_input_html + ''; - }); - - var form_on_demand = $("").attr("id","print_form").attr("method","post").attr("action",print_url).html(form_input_html); - - $(this).closest('.flexigrid').find('.hidden-operations').html(form_on_demand); - - var _this_button = $(this); - - $(this).closest('.flexigrid').find('#print_form').ajaxSubmit({ - beforeSend: function(){ - _this_button.find('.fbutton').addClass('loading'); - _this_button.find('.fbutton>div').css('opacity','0.4'); - }, - complete: function(){ - _this_button.find('.fbutton').removeClass('loading'); - _this_button.find('.fbutton>div').css('opacity','1'); - }, - success: function(html_data){ - $("
      ").html(html_data).printElement(); - } - }); - }); - - $('.crud_page').numeric(); - - - if ($('.flexigrid').length == 1) { //disable cookie storing for multiple grids in one page - var cookie_crud_page = readCookie('crud_page_'+unique_hash); - var cookie_per_page = readCookie('per_page_'+unique_hash); - var hidden_ordering = readCookie('hidden_ordering_'+unique_hash); - var hidden_sorting = readCookie('hidden_sorting_'+unique_hash); - var cookie_search_text = readCookie('search_text_'+unique_hash); - var cookie_search_field = readCookie('search_field_'+unique_hash); - - if(cookie_crud_page !== null && cookie_per_page !== null) - { - $('#crud_page').val(cookie_crud_page); - $('#per_page').val(cookie_per_page); - $('#hidden-ordering').val(hidden_ordering); - $('#hidden-sorting').val(hidden_sorting); - $('#search_text').val(cookie_search_text); - $('#search_field').val(cookie_search_field); - - if(cookie_search_text !== '') - $('#quickSearchButton').trigger('click'); - - $('#filtering_form').trigger('submit'); - } - } - -}); - -function displaying_and_pages(this_container) -{ - if (this_container.find('.crud_page').val() == 0) { - this_container.find('.crud_page').val('1'); - } - - var crud_page = parseInt( this_container.find('.crud_page').val(), 10) ; - var per_page = parseInt( this_container.find('.per_page').val(), 10 ); - var total_items = parseInt( this_container.find('.total_items').html(), 10 ); - - this_container.find('.last-page-number').html( Math.ceil( total_items / per_page) ); - - if (total_items == 0) { - this_container.find('.page-starts-from').html( '0'); - } else { - this_container.find('.page-starts-from').html( (crud_page - 1)*per_page + 1 ); - } - - if (crud_page*per_page > total_items) { - this_container.find('.page-ends-to').html( total_items ); - } else { - this_container.find('.page-ends-to').html( crud_page*per_page ); - } +$(function(){ + $('.quickSearchButton').click(function(){ + $(this).closest('.flexigrid').find('.quickSearchBox').slideToggle('normal'); + }); + + $('.ptogtitle').click(function(){ + if ($(this).hasClass('vsble')) { + $(this).removeClass('vsble'); + $(this).closest('.flexigrid').find('.main-table-box').slideDown("slow"); + } else { + $(this).addClass('vsble'); + $(this).closest('.flexigrid').find('.main-table-box').slideUp("slow"); + } + }); + + var call_fancybox = function(){ + $('.image-thumbnail').fancybox({ + 'transitionIn' : 'elastic', + 'transitionOut' : 'elastic', + 'speedIn' : 600, + 'speedOut' : 200, + 'overlayShow' : false + }); + }; + + call_fancybox(); + add_edit_button_listener(); + + $('.filtering_form').submit(function(){ + var crud_page = parseInt($(this).closest('.flexigrid').find('.crud_page').val(), 10); + var last_page = parseInt($(this).closest('.flexigrid').find('.last-page-number').html(), 10); + + if (crud_page > last_page) { + $(this).closest('.flexigrid').find('.crud_page').val(last_page); + } + if (crud_page <= 0) { + $(this).closest('.flexigrid').find('.crud_page').val('1'); + } + + var this_form = $(this); + + var ajax_list_info_url = $(this).attr('data-ajax-list-info-url'); + + $(this).ajaxSubmit({ + url: ajax_list_info_url, + dataType: 'json', + beforeSend: function(){ + this_form.closest('.flexigrid').find('.ajax_refresh_and_loading').addClass('loading'); + }, + complete: function(){ + this_form.closest('.flexigrid').find('.ajax_refresh_and_loading').removeClass('loading'); + }, + success: function(data){ + this_form.closest('.flexigrid').find('.total_items').html( data.total_results); + displaying_and_pages(this_form.closest('.flexigrid')); + + this_form.ajaxSubmit({ + success: function(data){ + this_form.closest('.flexigrid').find('.ajax_list').html(data); + call_fancybox(); + add_edit_button_listener(); + } + }); + } + }); + + if ($('.flexigrid').length == 1) { //disable cookie storing for multiple grids in one page + createCookie('crud_page_'+unique_hash,crud_page,1); + createCookie('per_page_'+unique_hash,$('#per_page').val(),1); + createCookie('hidden_ordering_'+unique_hash,$('#hidden-ordering').val(),1); + createCookie('hidden_sorting_'+unique_hash,$('#hidden-sorting').val(),1); + createCookie('search_text_'+unique_hash,$(this).closest('.flexigrid').find('.search_text').val(),1); + createCookie('search_field_'+unique_hash,$('#search_field').val(),1); + } + + return false; + }); + + $('.crud_search').click(function(){ + $(this).closest('.flexigrid').find('.crud_page').val('1'); + $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); + }); + + $('.search_clear').click(function(){ + $(this).closest('.flexigrid').find('.crud_page').val('1'); + $(this).closest('.flexigrid').find('.search_text').val(''); + $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); + }); + + $('.per_page').change(function(){ + $(this).closest('.flexigrid').find('.crud_page').val('1'); + $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); + }); + + $('.ajax_refresh_and_loading').click(function(){ + $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); + }); + + $('.first-button').click(function(){ + $(this).closest('.flexigrid').find('.crud_page').val('1'); + $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); + }); + + $('.prev-button').click(function(){ + if( $(this).closest('.flexigrid').find('.crud_page').val() != "1") + { + $(this).closest('.flexigrid').find('.crud_page').val( parseInt($(this).closest('.flexigrid').find('.crud_page').val(),10) - 1 ); + $(this).closest('.flexigrid').find('.crud_page').trigger('change'); + } + }); + + $('.last-button').click(function(){ + $(this).closest('.flexigrid').find('.crud_page').val( $(this).closest('.flexigrid').find('.last-page-number').html()); + $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); + }); + + $('.next-button').click(function(){ + $(this).closest('.flexigrid').find('.crud_page').val( parseInt($(this).closest('.flexigrid').find('.crud_page').val()) + 1 ); + $(this).closest('.flexigrid').find('.crud_page').trigger('change'); + }); + + $('.crud_page').change(function(){ + $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); + }); + + $('.ajax_list').on('click','.field-sorting', function(){ + $(this).closest('.flexigrid').find('.hidden-sorting').val($(this).attr('rel')); + + if ($(this).hasClass('asc')) { + $(this).closest('.flexigrid').find('.hidden-ordering').val('desc'); + } else { + $(this).closest('.flexigrid').find('.hidden-ordering').val('asc'); + } + + $(this).closest('.flexigrid').find('.crud_page').val('1'); + $(this).closest('.flexigrid').find('.filtering_form').trigger('submit'); + }); + + $('.ajax_list').on('click','.delete-row', function(){ + var delete_url = $(this).attr('href'); + + var this_container = $(this).closest('.flexigrid'); + + if( confirm( message_alert_delete ) ) + { + $.ajax({ + url: delete_url, + dataType: 'json', + success: function(data) + { + if(data.success) + { + this_container.find('.ajax_refresh_and_loading').trigger('click'); + + success_message(data.success_message); + } + else + { + error_message(data.error_message); + + } + } + }); + } + + return false; + }); + + $('.export-anchor').click(function(){ + var export_url = $(this).attr('data-url'); + + var form_input_html = ''; + $.each($(this).closest('.flexigrid').find('.filtering_form').serializeArray(), function(i, field) { + form_input_html = form_input_html + ''; + }); + + var form_on_demand = $("").attr("id","export_form").attr("method","post").attr("target","_blank") + .attr("action",export_url).html(form_input_html); + + $(this).closest('.flexigrid').find('.hidden-operations').html(form_on_demand); + + $(this).closest('.flexigrid').find('.hidden-operations').find('#export_form').submit(); + }); + + $('.print-anchor').click(function(){ + var print_url = $(this).attr('data-url'); + + var form_input_html = ''; + $.each($(this).closest('.flexigrid').find('.filtering_form').serializeArray(), function(i, field) { + form_input_html = form_input_html + ''; + }); + + var form_on_demand = $("").attr("id","print_form").attr("method","post").attr("action",print_url).html(form_input_html); + + $(this).closest('.flexigrid').find('.hidden-operations').html(form_on_demand); + + var _this_button = $(this); + + $(this).closest('.flexigrid').find('#print_form').ajaxSubmit({ + beforeSend: function(){ + _this_button.find('.fbutton').addClass('loading'); + _this_button.find('.fbutton>div').css('opacity','0.4'); + }, + complete: function(){ + _this_button.find('.fbutton').removeClass('loading'); + _this_button.find('.fbutton>div').css('opacity','1'); + }, + success: function(html_data){ + $("
      ").html(html_data).printElement(); + } + }); + }); + + $('.crud_page').numeric(); + + + if ($('.flexigrid').length == 1) { //disable cookie storing for multiple grids in one page + var cookie_crud_page = readCookie('crud_page_'+unique_hash); + var cookie_per_page = readCookie('per_page_'+unique_hash); + var hidden_ordering = readCookie('hidden_ordering_'+unique_hash); + var hidden_sorting = readCookie('hidden_sorting_'+unique_hash); + var cookie_search_text = readCookie('search_text_'+unique_hash); + var cookie_search_field = readCookie('search_field_'+unique_hash); + + if(cookie_crud_page !== null && cookie_per_page !== null) + { + $('#crud_page').val(cookie_crud_page); + $('#per_page').val(cookie_per_page); + $('#hidden-ordering').val(hidden_ordering); + $('#hidden-sorting').val(hidden_sorting); + $('#search_text').val(cookie_search_text); + $('#search_field').val(cookie_search_field); + + if(cookie_search_text !== '') + $('#quickSearchButton').trigger('click'); + + $('#filtering_form').trigger('submit'); + } + } + +}); + +function displaying_and_pages(this_container) +{ + if (this_container.find('.crud_page').val() == 0) { + this_container.find('.crud_page').val('1'); + } + + var crud_page = parseInt( this_container.find('.crud_page').val(), 10) ; + var per_page = parseInt( this_container.find('.per_page').val(), 10 ); + var total_items = parseInt( this_container.find('.total_items').html(), 10 ); + + this_container.find('.last-page-number').html( Math.ceil( total_items / per_page) ); + + if (total_items == 0) { + this_container.find('.page-starts-from').html( '0'); + } else { + this_container.find('.page-starts-from').html( (crud_page - 1)*per_page + 1 ); + } + + if (crud_page*per_page > total_items) { + this_container.find('.page-ends-to').html( total_items ); + } else { + this_container.find('.page-ends-to').html( crud_page*per_page ); + } } \ No newline at end of file diff --git a/assets/grocery_crud/themes/flexigrid/js/index.html b/assets/grocery_crud/themes/flexigrid/js/index.html index 065d2da..04e928c 100755 --- a/assets/grocery_crud/themes/flexigrid/js/index.html +++ b/assets/grocery_crud/themes/flexigrid/js/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + \ No newline at end of file diff --git a/assets/grocery_crud/themes/flexigrid/js/jquery.form.js b/assets/grocery_crud/themes/flexigrid/js/jquery.form.js index 1107cdb..3d36d63 100755 --- a/assets/grocery_crud/themes/flexigrid/js/jquery.form.js +++ b/assets/grocery_crud/themes/flexigrid/js/jquery.form.js @@ -1,825 +1,825 @@ -/*! - * jQuery Form Plugin - * version: 2.72 (28-APR-2011) - * @requires jQuery v1.3.2 or later - * - * Examples and documentation at: http://malsup.com/jquery/form/ - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -;(function($) { - -/* - Usage Note: - ----------- - Do not use both ajaxSubmit and ajaxForm on the same form. These - functions are intended to be exclusive. Use ajaxSubmit if you want - to bind your own submit handler to the form. For example, - - $(document).ready(function() { - $('#myForm').bind('submit', function(e) { - e.preventDefault(); // <-- important - $(this).ajaxSubmit({ - target: '#output' - }); - }); - }); - - Use ajaxForm when you want the plugin to manage all the event binding - for you. For example, - - $(document).ready(function() { - $('#myForm').ajaxForm({ - target: '#output' - }); - }); - - When using ajaxForm, the ajaxSubmit function will be invoked for you - at the appropriate time. -*/ - -/** - * ajaxSubmit() provides a mechanism for immediately submitting - * an HTML form using AJAX. - */ -$.fn.ajaxSubmit = function(options) { - // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) - if (!this.length) { - log('ajaxSubmit: skipping submit process - no element selected'); - return this; - } - - if (typeof options == 'function') { - options = { success: options }; - } - - var action = this.attr('action'); - var url = (typeof action === 'string') ? $.trim(action) : ''; - if (url) { - // clean url (don't include hash vaue) - url = (url.match(/^([^#]+)/)||[])[1]; - } - url = url || window.location.href || ''; - - options = $.extend(true, { - url: url, - success: $.ajaxSettings.success, - type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57) - iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' - }, options); - - // hook for manipulating the form data before it is extracted; - // convenient for use with rich editors like tinyMCE or FCKEditor - var veto = {}; - this.trigger('form-pre-serialize', [this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); - return this; - } - - // provide opportunity to alter form data before it is serialized - if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSerialize callback'); - return this; - } - - var n,v,a = this.formToArray(options.semantic); - if (options.data) { - options.extraData = options.data; - for (n in options.data) { - if(options.data[n] instanceof Array) { - for (var k in options.data[n]) { - a.push( { name: n, value: options.data[n][k] } ); - } - } - else { - v = options.data[n]; - v = $.isFunction(v) ? v() : v; // if value is fn, invoke it - a.push( { name: n, value: v } ); - } - } - } - - // give pre-submit callback an opportunity to abort the submit - if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSubmit callback'); - return this; - } - - // fire vetoable 'validate' event - this.trigger('form-submit-validate', [a, this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); - return this; - } - - var q = $.param(a); - - if (options.type.toUpperCase() == 'GET') { - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else { - options.data = q; // data is the query string for 'post' - } - - var $form = this, callbacks = []; - if (options.resetForm) { - callbacks.push(function() { $form.resetForm(); }); - } - if (options.clearForm) { - callbacks.push(function() { $form.clearForm(); }); - } - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function(){}; - callbacks.push(function(data) { - var fn = options.replaceTarget ? 'replaceWith' : 'html'; - $(options.target)[fn](data).each(oldSuccess, arguments); - }); - } - else if (options.success) { - callbacks.push(options.success); - } - - options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg - var context = options.context || options; // jQuery 1.4+ supports scope context - for (var i=0, max=callbacks.length; i < max; i++) { - callbacks[i].apply(context, [data, status, xhr || $form, $form]); - } - }; - - // are there files to upload? - var fileInputs = $('input:file', this).length > 0; - var mp = 'multipart/form-data'; - var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); - - // options.iframe allows user to force iframe mode - // 06-NOV-09: now defaulting to iframe mode if file input is detected - if (options.iframe !== false && (fileInputs || options.iframe || multipart)) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if (options.closeKeepAlive) { - $.get(options.closeKeepAlive, fileUpload); - } - else { - fileUpload(); - } - } - else { - $.ajax(options); - } - - // fire 'notify' event - this.trigger('form-submit-notify', [this, options]); - return this; - - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUpload() { - var form = $form[0]; - - if ($(':input[name=submit],:input[id=submit]', form).length) { - // if there is an input with a name or id of 'submit' then we won't be - // able to invoke the submit fn on the form (at least not x-browser) - alert('Error: Form elements must not have name or id of "submit".'); - return; - } - - var s = $.extend(true, {}, $.ajaxSettings, options); - s.context = s.context || s; - var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id; - var $io = $('' : ''); - inst._keyEvent = false; - return html; - }, - - /* Generate the month and year header. */ - _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, - secondary, monthNames, monthNamesShort) { - var changeMonth = this._get(inst, 'changeMonth'); - var changeYear = this._get(inst, 'changeYear'); - var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); - var html = '
      '; - var monthHtml = ''; - // month selection - if (secondary || !changeMonth) - monthHtml += '' + monthNames[drawMonth] + ''; - else { - var inMinYear = (minDate && minDate.getFullYear() == drawYear); - var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); - monthHtml += ''; - } - if (!showMonthAfterYear) - html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); - // year selection - if ( !inst.yearshtml ) { - inst.yearshtml = ''; - if (secondary || !changeYear) - html += '' + drawYear + ''; - else { - // determine range of years to display - var years = this._get(inst, 'yearRange').split(':'); - var thisYear = new Date().getFullYear(); - var determineYear = function(value) { - var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : - (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : - parseInt(value, 10))); - return (isNaN(year) ? thisYear : year); - }; - var year = determineYear(years[0]); - var endYear = Math.max(year, determineYear(years[1] || '')); - year = (minDate ? Math.max(year, minDate.getFullYear()) : year); - endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); - inst.yearshtml += ''; - - html += inst.yearshtml; - inst.yearshtml = null; - } - } - html += this._get(inst, 'yearSuffix'); - if (showMonthAfterYear) - html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; - html += '
      '; // Close datepicker_header - return html; - }, - - /* Adjust one of the date sub-fields. */ - _adjustInstDate: function(inst, offset, period) { - var year = inst.drawYear + (period == 'Y' ? offset : 0); - var month = inst.drawMonth + (period == 'M' ? offset : 0); - var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + - (period == 'D' ? offset : 0); - var date = this._restrictMinMax(inst, - this._daylightSavingAdjust(new Date(year, month, day))); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - if (period == 'M' || period == 'Y') - this._notifyChange(inst); - }, - - /* Ensure a date is within any min/max bounds. */ - _restrictMinMax: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - var newDate = (minDate && date < minDate ? minDate : date); - newDate = (maxDate && newDate > maxDate ? maxDate : newDate); - return newDate; - }, - - /* Notify change of month/year. */ - _notifyChange: function(inst) { - var onChange = this._get(inst, 'onChangeMonthYear'); - if (onChange) - onChange.apply((inst.input ? inst.input[0] : null), - [inst.selectedYear, inst.selectedMonth + 1, inst]); - }, - - /* Determine the number of months to show. */ - _getNumberOfMonths: function(inst) { - var numMonths = this._get(inst, 'numberOfMonths'); - return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); - }, - - /* Determine the current maximum date - ensure no time components are set. */ - _getMinMaxDate: function(inst, minMax) { - return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); - }, - - /* Find the number of days in a given month. */ - _getDaysInMonth: function(year, month) { - return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); - }, - - /* Find the day of the week of the first of a month. */ - _getFirstDayOfMonth: function(year, month) { - return new Date(year, month, 1).getDay(); - }, - - /* Determines if we should allow a "next/prev" month display change. */ - _canAdjustMonth: function(inst, offset, curYear, curMonth) { - var numMonths = this._getNumberOfMonths(inst); - var date = this._daylightSavingAdjust(new Date(curYear, - curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); - if (offset < 0) - date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); - return this._isInRange(inst, date); - }, - - /* Is the given date in the accepted range? */ - _isInRange: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - return ((!minDate || date.getTime() >= minDate.getTime()) && - (!maxDate || date.getTime() <= maxDate.getTime())); - }, - - /* Provide the configuration settings for formatting/parsing. */ - _getFormatConfig: function(inst) { - var shortYearCutoff = this._get(inst, 'shortYearCutoff'); - shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : - new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); - return {shortYearCutoff: shortYearCutoff, - dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), - monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; - }, - - /* Format the given date for display. */ - _formatDate: function(inst, day, month, year) { - if (!day) { - inst.currentDay = inst.selectedDay; - inst.currentMonth = inst.selectedMonth; - inst.currentYear = inst.selectedYear; - } - var date = (day ? (typeof day == 'object' ? day : - this._daylightSavingAdjust(new Date(year, month, day))) : - this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); - } -}); - -/* - * Bind hover events for datepicker elements. - * Done via delegate so the binding only occurs once in the lifetime of the parent div. - * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. - */ -function bindHover(dpDiv) { - var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; - return dpDiv.delegate(selector, 'mouseout', function() { - $(this).removeClass('ui-state-hover'); - if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); - if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); - }) - .delegate(selector, 'mouseover', function(){ - if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { - $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); - $(this).addClass('ui-state-hover'); - if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); - if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); - } - }); -} - -/* jQuery extend now ignores nulls! */ -function extendRemove(target, props) { - $.extend(target, props); - for (var name in props) - if (props[name] == null || props[name] == undefined) - target[name] = props[name]; - return target; -}; - -/* Invoke the datepicker functionality. - @param options string - a command, optionally followed by additional parameters or - Object - settings for attaching new datepicker functionality - @return jQuery object */ -$.fn.datepicker = function(options){ - - /* Verify an empty collection wasn't passed - Fixes #6976 */ - if ( !this.length ) { - return this; - } - - /* Initialise the date picker. */ - if (!$.datepicker.initialized) { - $(document).mousedown($.datepicker._checkExternalClick). - find(document.body).append($.datepicker.dpDiv); - $.datepicker.initialized = true; - } - - var otherArgs = Array.prototype.slice.call(arguments, 1); - if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - return this.each(function() { - typeof options == 'string' ? - $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this].concat(otherArgs)) : - $.datepicker._attachDatepicker(this, options); - }); -}; - -$.datepicker = new Datepicker(); // singleton instance -$.datepicker.initialized = false; -$.datepicker.uuid = new Date().getTime(); -$.datepicker.version = "1.9.2"; - -// Workaround for #4055 -// Add another global to avoid noConflict issues with inline event handlers -window['DP_jQuery_' + dpuuid] = $; - -})(jQuery); -(function( $, undefined ) { - -var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ", - sizeRelatedOptions = { - buttons: true, - height: true, - maxHeight: true, - maxWidth: true, - minHeight: true, - minWidth: true, - width: true - }, - resizableRelatedOptions = { - maxHeight: true, - maxWidth: true, - minHeight: true, - minWidth: true - }; - -$.widget("ui.dialog", { - version: "1.9.2", - options: { - autoOpen: true, - buttons: {}, - closeOnEscape: true, - closeText: "close", - dialogClass: "", - draggable: true, - hide: null, - height: "auto", - maxHeight: false, - maxWidth: false, - minHeight: 150, - minWidth: 150, - modal: false, - position: { - my: "center", - at: "center", - of: window, - collision: "fit", - // ensure that the titlebar is never outside the document - using: function( pos ) { - var topOffset = $( this ).css( pos ).offset().top; - if ( topOffset < 0 ) { - $( this ).css( "top", pos.top - topOffset ); - } - } - }, - resizable: true, - show: null, - stack: true, - title: "", - width: 300, - zIndex: 1000 - }, - - _create: function() { - this.originalTitle = this.element.attr( "title" ); - // #5742 - .attr() might return a DOMElement - if ( typeof this.originalTitle !== "string" ) { - this.originalTitle = ""; - } - this.oldPosition = { - parent: this.element.parent(), - index: this.element.parent().children().index( this.element ) - }; - this.options.title = this.options.title || this.originalTitle; - var that = this, - options = this.options, - - title = options.title || " ", - uiDialog, - uiDialogTitlebar, - uiDialogTitlebarClose, - uiDialogTitle, - uiDialogButtonPane; - - uiDialog = ( this.uiDialog = $( "
      " ) ) - .addClass( uiDialogClasses + options.dialogClass ) - .css({ - display: "none", - outline: 0, // TODO: move to stylesheet - zIndex: options.zIndex - }) - // setting tabIndex makes the div focusable - .attr( "tabIndex", -1) - .keydown(function( event ) { - if ( options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && - event.keyCode === $.ui.keyCode.ESCAPE ) { - that.close( event ); - event.preventDefault(); - } - }) - .mousedown(function( event ) { - that.moveToTop( false, event ); - }) - .appendTo( "body" ); - - this.element - .show() - .removeAttr( "title" ) - .addClass( "ui-dialog-content ui-widget-content" ) - .appendTo( uiDialog ); - - uiDialogTitlebar = ( this.uiDialogTitlebar = $( "
      " ) ) - .addClass( "ui-dialog-titlebar ui-widget-header " + - "ui-corner-all ui-helper-clearfix" ) - .bind( "mousedown", function() { - // Dialog isn't getting focus when dragging (#8063) - uiDialog.focus(); - }) - .prependTo( uiDialog ); - - uiDialogTitlebarClose = $( "" ) - .addClass( "ui-dialog-titlebar-close ui-corner-all" ) - .attr( "role", "button" ) - .click(function( event ) { - event.preventDefault(); - that.close( event ); - }) - .appendTo( uiDialogTitlebar ); - - ( this.uiDialogTitlebarCloseText = $( "" ) ) - .addClass( "ui-icon ui-icon-closethick" ) - .text( options.closeText ) - .appendTo( uiDialogTitlebarClose ); - - uiDialogTitle = $( "" ) - .uniqueId() - .addClass( "ui-dialog-title" ) - .html( title ) - .prependTo( uiDialogTitlebar ); - - uiDialogButtonPane = ( this.uiDialogButtonPane = $( "
      " ) ) - .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ); - - ( this.uiButtonSet = $( "
      " ) ) - .addClass( "ui-dialog-buttonset" ) - .appendTo( uiDialogButtonPane ); - - uiDialog.attr({ - role: "dialog", - "aria-labelledby": uiDialogTitle.attr( "id" ) - }); - - uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection(); - this._hoverable( uiDialogTitlebarClose ); - this._focusable( uiDialogTitlebarClose ); - - if ( options.draggable && $.fn.draggable ) { - this._makeDraggable(); - } - if ( options.resizable && $.fn.resizable ) { - this._makeResizable(); - } - - this._createButtons( options.buttons ); - this._isOpen = false; - - if ( $.fn.bgiframe ) { - uiDialog.bgiframe(); - } - - // prevent tabbing out of modal dialogs - this._on( uiDialog, { keydown: function( event ) { - if ( !options.modal || event.keyCode !== $.ui.keyCode.TAB ) { - return; - } - - var tabbables = $( ":tabbable", uiDialog ), - first = tabbables.filter( ":first" ), - last = tabbables.filter( ":last" ); - - if ( event.target === last[0] && !event.shiftKey ) { - first.focus( 1 ); - return false; - } else if ( event.target === first[0] && event.shiftKey ) { - last.focus( 1 ); - return false; - } - }}); - }, - - _init: function() { - if ( this.options.autoOpen ) { - this.open(); - } - }, - - _destroy: function() { - var next, - oldPosition = this.oldPosition; - - if ( this.overlay ) { - this.overlay.destroy(); - } - this.uiDialog.hide(); - this.element - .removeClass( "ui-dialog-content ui-widget-content" ) - .hide() - .appendTo( "body" ); - this.uiDialog.remove(); - - if ( this.originalTitle ) { - this.element.attr( "title", this.originalTitle ); - } - - next = oldPosition.parent.children().eq( oldPosition.index ); - // Don't try to place the dialog next to itself (#8613) - if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { - next.before( this.element ); - } else { - oldPosition.parent.append( this.element ); - } - }, - - widget: function() { - return this.uiDialog; - }, - - close: function( event ) { - var that = this, - maxZ, thisZ; - - if ( !this._isOpen ) { - return; - } - - if ( false === this._trigger( "beforeClose", event ) ) { - return; - } - - this._isOpen = false; - - if ( this.overlay ) { - this.overlay.destroy(); - } - - if ( this.options.hide ) { - this._hide( this.uiDialog, this.options.hide, function() { - that._trigger( "close", event ); - }); - } else { - this.uiDialog.hide(); - this._trigger( "close", event ); - } - - $.ui.dialog.overlay.resize(); - - // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) - if ( this.options.modal ) { - maxZ = 0; - $( ".ui-dialog" ).each(function() { - if ( this !== that.uiDialog[0] ) { - thisZ = $( this ).css( "z-index" ); - if ( !isNaN( thisZ ) ) { - maxZ = Math.max( maxZ, thisZ ); - } - } - }); - $.ui.dialog.maxZ = maxZ; - } - - return this; - }, - - isOpen: function() { - return this._isOpen; - }, - - // the force parameter allows us to move modal dialogs to their correct - // position on open - moveToTop: function( force, event ) { - var options = this.options, - saveScroll; - - if ( ( options.modal && !force ) || - ( !options.stack && !options.modal ) ) { - return this._trigger( "focus", event ); - } - - if ( options.zIndex > $.ui.dialog.maxZ ) { - $.ui.dialog.maxZ = options.zIndex; - } - if ( this.overlay ) { - $.ui.dialog.maxZ += 1; - $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ; - this.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ ); - } - - // Save and then restore scroll - // Opera 9.5+ resets when parent z-index is changed. - // http://bugs.jqueryui.com/ticket/3193 - saveScroll = { - scrollTop: this.element.scrollTop(), - scrollLeft: this.element.scrollLeft() - }; - $.ui.dialog.maxZ += 1; - this.uiDialog.css( "z-index", $.ui.dialog.maxZ ); - this.element.attr( saveScroll ); - this._trigger( "focus", event ); - - return this; - }, - - open: function() { - if ( this._isOpen ) { - return; - } - - var hasFocus, - options = this.options, - uiDialog = this.uiDialog; - - this._size(); - this._position( options.position ); - uiDialog.show( options.show ); - this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null; - this.moveToTop( true ); - - // set focus to the first tabbable element in the content area or the first button - // if there are no tabbable elements, set focus on the dialog itself - hasFocus = this.element.find( ":tabbable" ); - if ( !hasFocus.length ) { - hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); - if ( !hasFocus.length ) { - hasFocus = uiDialog; - } - } - hasFocus.eq( 0 ).focus(); - - this._isOpen = true; - this._trigger( "open" ); - - return this; - }, - - _createButtons: function( buttons ) { - var that = this, - hasButtons = false; - - // if we already have a button pane, remove it - this.uiDialogButtonPane.remove(); - this.uiButtonSet.empty(); - - if ( typeof buttons === "object" && buttons !== null ) { - $.each( buttons, function() { - return !(hasButtons = true); - }); - } - if ( hasButtons ) { - $.each( buttons, function( name, props ) { - var button, click; - props = $.isFunction( props ) ? - { click: props, text: name } : - props; - // Default to a non-submitting button - props = $.extend( { type: "button" }, props ); - // Change the context for the click callback to be the main element - click = props.click; - props.click = function() { - click.apply( that.element[0], arguments ); - }; - button = $( "", props ) - .appendTo( that.uiButtonSet ); - if ( $.fn.button ) { - button.button(); - } - }); - this.uiDialog.addClass( "ui-dialog-buttons" ); - this.uiDialogButtonPane.appendTo( this.uiDialog ); - } else { - this.uiDialog.removeClass( "ui-dialog-buttons" ); - } - }, - - _makeDraggable: function() { - var that = this, - options = this.options; - - function filteredUi( ui ) { - return { - position: ui.position, - offset: ui.offset - }; - } - - this.uiDialog.draggable({ - cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", - handle: ".ui-dialog-titlebar", - containment: "document", - start: function( event, ui ) { - $( this ) - .addClass( "ui-dialog-dragging" ); - that._trigger( "dragStart", event, filteredUi( ui ) ); - }, - drag: function( event, ui ) { - that._trigger( "drag", event, filteredUi( ui ) ); - }, - stop: function( event, ui ) { - options.position = [ - ui.position.left - that.document.scrollLeft(), - ui.position.top - that.document.scrollTop() - ]; - $( this ) - .removeClass( "ui-dialog-dragging" ); - that._trigger( "dragStop", event, filteredUi( ui ) ); - $.ui.dialog.overlay.resize(); - } - }); - }, - - _makeResizable: function( handles ) { - handles = (handles === undefined ? this.options.resizable : handles); - var that = this, - options = this.options, - // .ui-resizable has position: relative defined in the stylesheet - // but dialogs have to use absolute or fixed positioning - position = this.uiDialog.css( "position" ), - resizeHandles = typeof handles === 'string' ? - handles : - "n,e,s,w,se,sw,ne,nw"; - - function filteredUi( ui ) { - return { - originalPosition: ui.originalPosition, - originalSize: ui.originalSize, - position: ui.position, - size: ui.size - }; - } - - this.uiDialog.resizable({ - cancel: ".ui-dialog-content", - containment: "document", - alsoResize: this.element, - maxWidth: options.maxWidth, - maxHeight: options.maxHeight, - minWidth: options.minWidth, - minHeight: this._minHeight(), - handles: resizeHandles, - start: function( event, ui ) { - $( this ).addClass( "ui-dialog-resizing" ); - that._trigger( "resizeStart", event, filteredUi( ui ) ); - }, - resize: function( event, ui ) { - that._trigger( "resize", event, filteredUi( ui ) ); - }, - stop: function( event, ui ) { - $( this ).removeClass( "ui-dialog-resizing" ); - options.height = $( this ).height(); - options.width = $( this ).width(); - that._trigger( "resizeStop", event, filteredUi( ui ) ); - $.ui.dialog.overlay.resize(); - } - }) - .css( "position", position ) - .find( ".ui-resizable-se" ) - .addClass( "ui-icon ui-icon-grip-diagonal-se" ); - }, - - _minHeight: function() { - var options = this.options; - - if ( options.height === "auto" ) { - return options.minHeight; - } else { - return Math.min( options.minHeight, options.height ); - } - }, - - _position: function( position ) { - var myAt = [], - offset = [ 0, 0 ], - isVisible; - - if ( position ) { - // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( - // if (typeof position == 'string' || $.isArray(position)) { - // myAt = $.isArray(position) ? position : position.split(' '); - - if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) { - myAt = position.split ? position.split( " " ) : [ position[ 0 ], position[ 1 ] ]; - if ( myAt.length === 1 ) { - myAt[ 1 ] = myAt[ 0 ]; - } - - $.each( [ "left", "top" ], function( i, offsetPosition ) { - if ( +myAt[ i ] === myAt[ i ] ) { - offset[ i ] = myAt[ i ]; - myAt[ i ] = offsetPosition; - } - }); - - position = { - my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " + - myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]), - at: myAt.join( " " ) - }; - } - - position = $.extend( {}, $.ui.dialog.prototype.options.position, position ); - } else { - position = $.ui.dialog.prototype.options.position; - } - - // need to show the dialog to get the actual offset in the position plugin - isVisible = this.uiDialog.is( ":visible" ); - if ( !isVisible ) { - this.uiDialog.show(); - } - this.uiDialog.position( position ); - if ( !isVisible ) { - this.uiDialog.hide(); - } - }, - - _setOptions: function( options ) { - var that = this, - resizableOptions = {}, - resize = false; - - $.each( options, function( key, value ) { - that._setOption( key, value ); - - if ( key in sizeRelatedOptions ) { - resize = true; - } - if ( key in resizableRelatedOptions ) { - resizableOptions[ key ] = value; - } - }); - - if ( resize ) { - this._size(); - } - if ( this.uiDialog.is( ":data(resizable)" ) ) { - this.uiDialog.resizable( "option", resizableOptions ); - } - }, - - _setOption: function( key, value ) { - var isDraggable, isResizable, - uiDialog = this.uiDialog; - - switch ( key ) { - case "buttons": - this._createButtons( value ); - break; - case "closeText": - // ensure that we always pass a string - this.uiDialogTitlebarCloseText.text( "" + value ); - break; - case "dialogClass": - uiDialog - .removeClass( this.options.dialogClass ) - .addClass( uiDialogClasses + value ); - break; - case "disabled": - if ( value ) { - uiDialog.addClass( "ui-dialog-disabled" ); - } else { - uiDialog.removeClass( "ui-dialog-disabled" ); - } - break; - case "draggable": - isDraggable = uiDialog.is( ":data(draggable)" ); - if ( isDraggable && !value ) { - uiDialog.draggable( "destroy" ); - } - - if ( !isDraggable && value ) { - this._makeDraggable(); - } - break; - case "position": - this._position( value ); - break; - case "resizable": - // currently resizable, becoming non-resizable - isResizable = uiDialog.is( ":data(resizable)" ); - if ( isResizable && !value ) { - uiDialog.resizable( "destroy" ); - } - - // currently resizable, changing handles - if ( isResizable && typeof value === "string" ) { - uiDialog.resizable( "option", "handles", value ); - } - - // currently non-resizable, becoming resizable - if ( !isResizable && value !== false ) { - this._makeResizable( value ); - } - break; - case "title": - // convert whatever was passed in o a string, for html() to not throw up - $( ".ui-dialog-title", this.uiDialogTitlebar ) - .html( "" + ( value || " " ) ); - break; - } - - this._super( key, value ); - }, - - _size: function() { - /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content - * divs will both have width and height set, so we need to reset them - */ - var nonContentHeight, minContentHeight, autoHeight, - options = this.options, - isVisible = this.uiDialog.is( ":visible" ); - - // reset content sizing - this.element.show().css({ - width: "auto", - minHeight: 0, - height: 0 - }); - - if ( options.minWidth > options.width ) { - options.width = options.minWidth; - } - - // reset wrapper sizing - // determine the height of all the non-content elements - nonContentHeight = this.uiDialog.css({ - height: "auto", - width: options.width - }) - .outerHeight(); - minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); - - if ( options.height === "auto" ) { - // only needed for IE6 support - if ( $.support.minHeight ) { - this.element.css({ - minHeight: minContentHeight, - height: "auto" - }); - } else { - this.uiDialog.show(); - autoHeight = this.element.css( "height", "auto" ).height(); - if ( !isVisible ) { - this.uiDialog.hide(); - } - this.element.height( Math.max( autoHeight, minContentHeight ) ); - } - } else { - this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); - } - - if (this.uiDialog.is( ":data(resizable)" ) ) { - this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); - } - } -}); - -$.extend($.ui.dialog, { - uuid: 0, - maxZ: 0, - - getTitleId: function($el) { - var id = $el.attr( "id" ); - if ( !id ) { - this.uuid += 1; - id = this.uuid; - } - return "ui-dialog-title-" + id; - }, - - overlay: function( dialog ) { - this.$el = $.ui.dialog.overlay.create( dialog ); - } -}); - -$.extend( $.ui.dialog.overlay, { - instances: [], - // reuse old instances due to IE memory leak with alpha transparency (see #5185) - oldInstances: [], - maxZ: 0, - events: $.map( - "focus,mousedown,mouseup,keydown,keypress,click".split( "," ), - function( event ) { - return event + ".dialog-overlay"; - } - ).join( " " ), - create: function( dialog ) { - if ( this.instances.length === 0 ) { - // prevent use of anchors and inputs - // we use a setTimeout in case the overlay is created from an - // event that we're going to be cancelling (see #2804) - setTimeout(function() { - // handle $(el).dialog().dialog('close') (see #4065) - if ( $.ui.dialog.overlay.instances.length ) { - $( document ).bind( $.ui.dialog.overlay.events, function( event ) { - // stop events if the z-index of the target is < the z-index of the overlay - // we cannot return true when we don't want to cancel the event (#3523) - if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { - return false; - } - }); - } - }, 1 ); - - // handle window resize - $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize ); - } - - var $el = ( this.oldInstances.pop() || $( "
      " ).addClass( "ui-widget-overlay" ) ); - - // allow closing by pressing the escape key - $( document ).bind( "keydown.dialog-overlay", function( event ) { - var instances = $.ui.dialog.overlay.instances; - // only react to the event if we're the top overlay - if ( instances.length !== 0 && instances[ instances.length - 1 ] === $el && - dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && - event.keyCode === $.ui.keyCode.ESCAPE ) { - - dialog.close( event ); - event.preventDefault(); - } - }); - - $el.appendTo( document.body ).css({ - width: this.width(), - height: this.height() - }); - - if ( $.fn.bgiframe ) { - $el.bgiframe(); - } - - this.instances.push( $el ); - return $el; - }, - - destroy: function( $el ) { - var indexOf = $.inArray( $el, this.instances ), - maxZ = 0; - - if ( indexOf !== -1 ) { - this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] ); - } - - if ( this.instances.length === 0 ) { - $( [ document, window ] ).unbind( ".dialog-overlay" ); - } - - $el.height( 0 ).width( 0 ).remove(); - - // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) - $.each( this.instances, function() { - maxZ = Math.max( maxZ, this.css( "z-index" ) ); - }); - this.maxZ = maxZ; - }, - - height: function() { - var scrollHeight, - offsetHeight; - // handle IE - if ( $.ui.ie ) { - scrollHeight = Math.max( - document.documentElement.scrollHeight, - document.body.scrollHeight - ); - offsetHeight = Math.max( - document.documentElement.offsetHeight, - document.body.offsetHeight - ); - - if ( scrollHeight < offsetHeight ) { - return $( window ).height() + "px"; - } else { - return scrollHeight + "px"; - } - // handle "good" browsers - } else { - return $( document ).height() + "px"; - } - }, - - width: function() { - var scrollWidth, - offsetWidth; - // handle IE - if ( $.ui.ie ) { - scrollWidth = Math.max( - document.documentElement.scrollWidth, - document.body.scrollWidth - ); - offsetWidth = Math.max( - document.documentElement.offsetWidth, - document.body.offsetWidth - ); - - if ( scrollWidth < offsetWidth ) { - return $( window ).width() + "px"; - } else { - return scrollWidth + "px"; - } - // handle "good" browsers - } else { - return $( document ).width() + "px"; - } - }, - - resize: function() { - /* If the dialog is draggable and the user drags it past the - * right edge of the window, the document becomes wider so we - * need to stretch the overlay. If the user then drags the - * dialog back to the left, the document will become narrower, - * so we need to shrink the overlay to the appropriate size. - * This is handled by shrinking the overlay before setting it - * to the full document size. - */ - var $overlays = $( [] ); - $.each( $.ui.dialog.overlay.instances, function() { - $overlays = $overlays.add( this ); - }); - - $overlays.css({ - width: 0, - height: 0 - }).css({ - width: $.ui.dialog.overlay.width(), - height: $.ui.dialog.overlay.height() - }); - } -}); - -$.extend( $.ui.dialog.overlay.prototype, { - destroy: function() { - $.ui.dialog.overlay.destroy( this.$el ); - } -}); - -}( jQuery ) ); -(function( $, undefined ) { - -var mouseHandled = false; - -$.widget( "ui.menu", { - version: "1.9.2", - defaultElement: "
        ", - delay: 300, - options: { - icons: { - submenu: "ui-icon-carat-1-e" - }, - menus: "ul", - position: { - my: "left top", - at: "right top" - }, - role: "menu", - - // callbacks - blur: null, - focus: null, - select: null - }, - - _create: function() { - this.activeMenu = this.element; - this.element - .uniqueId() - .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) - .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ) - .attr({ - role: this.options.role, - tabIndex: 0 - }) - // need to catch all clicks on disabled menu - // not possible through _on - .bind( "click" + this.eventNamespace, $.proxy(function( event ) { - if ( this.options.disabled ) { - event.preventDefault(); - } - }, this )); - - if ( this.options.disabled ) { - this.element - .addClass( "ui-state-disabled" ) - .attr( "aria-disabled", "true" ); - } - - this._on({ - // Prevent focus from sticking to links inside menu after clicking - // them (focus should always stay on UL during navigation). - "mousedown .ui-menu-item > a": function( event ) { - event.preventDefault(); - }, - "click .ui-state-disabled > a": function( event ) { - event.preventDefault(); - }, - "click .ui-menu-item:has(a)": function( event ) { - var target = $( event.target ).closest( ".ui-menu-item" ); - if ( !mouseHandled && target.not( ".ui-state-disabled" ).length ) { - mouseHandled = true; - - this.select( event ); - // Open submenu on click - if ( target.has( ".ui-menu" ).length ) { - this.expand( event ); - } else if ( !this.element.is( ":focus" ) ) { - // Redirect focus to the menu - this.element.trigger( "focus", [ true ] ); - - // If the active item is on the top level, let it stay active. - // Otherwise, blur the active item since it is no longer visible. - if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { - clearTimeout( this.timer ); - } - } - } - }, - "mouseenter .ui-menu-item": function( event ) { - var target = $( event.currentTarget ); - // Remove ui-state-active class from siblings of the newly focused menu item - // to avoid a jump caused by adjacent elements both having a class with a border - target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" ); - this.focus( event, target ); - }, - mouseleave: "collapseAll", - "mouseleave .ui-menu": "collapseAll", - focus: function( event, keepActiveItem ) { - // If there's already an active item, keep it active - // If not, activate the first item - var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 ); - - if ( !keepActiveItem ) { - this.focus( event, item ); - } - }, - blur: function( event ) { - this._delay(function() { - if ( !$.contains( this.element[0], this.document[0].activeElement ) ) { - this.collapseAll( event ); - } - }); - }, - keydown: "_keydown" - }); - - this.refresh(); - - // Clicks outside of a menu collapse any open menus - this._on( this.document, { - click: function( event ) { - if ( !$( event.target ).closest( ".ui-menu" ).length ) { - this.collapseAll( event ); - } - - // Reset the mouseHandled flag - mouseHandled = false; - } - }); - }, - - _destroy: function() { - // Destroy (sub)menus - this.element - .removeAttr( "aria-activedescendant" ) - .find( ".ui-menu" ).andSelf() - .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" ) - .removeAttr( "role" ) - .removeAttr( "tabIndex" ) - .removeAttr( "aria-labelledby" ) - .removeAttr( "aria-expanded" ) - .removeAttr( "aria-hidden" ) - .removeAttr( "aria-disabled" ) - .removeUniqueId() - .show(); - - // Destroy menu items - this.element.find( ".ui-menu-item" ) - .removeClass( "ui-menu-item" ) - .removeAttr( "role" ) - .removeAttr( "aria-disabled" ) - .children( "a" ) - .removeUniqueId() - .removeClass( "ui-corner-all ui-state-hover" ) - .removeAttr( "tabIndex" ) - .removeAttr( "role" ) - .removeAttr( "aria-haspopup" ) - .children().each( function() { - var elem = $( this ); - if ( elem.data( "ui-menu-submenu-carat" ) ) { - elem.remove(); - } - }); - - // Destroy menu dividers - this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" ); - }, - - _keydown: function( event ) { - var match, prev, character, skip, regex, - preventDefault = true; - - function escape( value ) { - return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); - } - - switch ( event.keyCode ) { - case $.ui.keyCode.PAGE_UP: - this.previousPage( event ); - break; - case $.ui.keyCode.PAGE_DOWN: - this.nextPage( event ); - break; - case $.ui.keyCode.HOME: - this._move( "first", "first", event ); - break; - case $.ui.keyCode.END: - this._move( "last", "last", event ); - break; - case $.ui.keyCode.UP: - this.previous( event ); - break; - case $.ui.keyCode.DOWN: - this.next( event ); - break; - case $.ui.keyCode.LEFT: - this.collapse( event ); - break; - case $.ui.keyCode.RIGHT: - if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { - this.expand( event ); - } - break; - case $.ui.keyCode.ENTER: - case $.ui.keyCode.SPACE: - this._activate( event ); - break; - case $.ui.keyCode.ESCAPE: - this.collapse( event ); - break; - default: - preventDefault = false; - prev = this.previousFilter || ""; - character = String.fromCharCode( event.keyCode ); - skip = false; - - clearTimeout( this.filterTimer ); - - if ( character === prev ) { - skip = true; - } else { - character = prev + character; - } - - regex = new RegExp( "^" + escape( character ), "i" ); - match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { - return regex.test( $( this ).children( "a" ).text() ); - }); - match = skip && match.index( this.active.next() ) !== -1 ? - this.active.nextAll( ".ui-menu-item" ) : - match; - - // If no matches on the current filter, reset to the last character pressed - // to move down the menu to the first item that starts with that character - if ( !match.length ) { - character = String.fromCharCode( event.keyCode ); - regex = new RegExp( "^" + escape( character ), "i" ); - match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { - return regex.test( $( this ).children( "a" ).text() ); - }); - } - - if ( match.length ) { - this.focus( event, match ); - if ( match.length > 1 ) { - this.previousFilter = character; - this.filterTimer = this._delay(function() { - delete this.previousFilter; - }, 1000 ); - } else { - delete this.previousFilter; - } - } else { - delete this.previousFilter; - } - } - - if ( preventDefault ) { - event.preventDefault(); - } - }, - - _activate: function( event ) { - if ( !this.active.is( ".ui-state-disabled" ) ) { - if ( this.active.children( "a[aria-haspopup='true']" ).length ) { - this.expand( event ); - } else { - this.select( event ); - } - } - }, - - refresh: function() { - var menus, - icon = this.options.icons.submenu, - submenus = this.element.find( this.options.menus ); - - // Initialize nested menus - submenus.filter( ":not(.ui-menu)" ) - .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) - .hide() - .attr({ - role: this.options.role, - "aria-hidden": "true", - "aria-expanded": "false" - }) - .each(function() { - var menu = $( this ), - item = menu.prev( "a" ), - submenuCarat = $( "" ) - .addClass( "ui-menu-icon ui-icon " + icon ) - .data( "ui-menu-submenu-carat", true ); - - item - .attr( "aria-haspopup", "true" ) - .prepend( submenuCarat ); - menu.attr( "aria-labelledby", item.attr( "id" ) ); - }); - - menus = submenus.add( this.element ); - - // Don't refresh list items that are already adapted - menus.children( ":not(.ui-menu-item):has(a)" ) - .addClass( "ui-menu-item" ) - .attr( "role", "presentation" ) - .children( "a" ) - .uniqueId() - .addClass( "ui-corner-all" ) - .attr({ - tabIndex: -1, - role: this._itemRole() - }); - - // Initialize unlinked menu-items containing spaces and/or dashes only as dividers - menus.children( ":not(.ui-menu-item)" ).each(function() { - var item = $( this ); - // hyphen, em dash, en dash - if ( !/[^\-—–\s]/.test( item.text() ) ) { - item.addClass( "ui-widget-content ui-menu-divider" ); - } - }); - - // Add aria-disabled attribute to any disabled menu item - menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); - - // If the active item has been removed, blur the menu - if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { - this.blur(); - } - }, - - _itemRole: function() { - return { - menu: "menuitem", - listbox: "option" - }[ this.options.role ]; - }, - - focus: function( event, item ) { - var nested, focused; - this.blur( event, event && event.type === "focus" ); - - this._scrollIntoView( item ); - - this.active = item.first(); - focused = this.active.children( "a" ).addClass( "ui-state-focus" ); - // Only update aria-activedescendant if there's a role - // otherwise we assume focus is managed elsewhere - if ( this.options.role ) { - this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); - } - - // Highlight active parent menu item, if any - this.active - .parent() - .closest( ".ui-menu-item" ) - .children( "a:first" ) - .addClass( "ui-state-active" ); - - if ( event && event.type === "keydown" ) { - this._close(); - } else { - this.timer = this._delay(function() { - this._close(); - }, this.delay ); - } - - nested = item.children( ".ui-menu" ); - if ( nested.length && ( /^mouse/.test( event.type ) ) ) { - this._startOpening(nested); - } - this.activeMenu = item.parent(); - - this._trigger( "focus", event, { item: item } ); - }, - - _scrollIntoView: function( item ) { - var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; - if ( this._hasScroll() ) { - borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0; - paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0; - offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; - scroll = this.activeMenu.scrollTop(); - elementHeight = this.activeMenu.height(); - itemHeight = item.height(); - - if ( offset < 0 ) { - this.activeMenu.scrollTop( scroll + offset ); - } else if ( offset + itemHeight > elementHeight ) { - this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); - } - } - }, - - blur: function( event, fromFocus ) { - if ( !fromFocus ) { - clearTimeout( this.timer ); - } - - if ( !this.active ) { - return; - } - - this.active.children( "a" ).removeClass( "ui-state-focus" ); - this.active = null; - - this._trigger( "blur", event, { item: this.active } ); - }, - - _startOpening: function( submenu ) { - clearTimeout( this.timer ); - - // Don't open if already open fixes a Firefox bug that caused a .5 pixel - // shift in the submenu position when mousing over the carat icon - if ( submenu.attr( "aria-hidden" ) !== "true" ) { - return; - } - - this.timer = this._delay(function() { - this._close(); - this._open( submenu ); - }, this.delay ); - }, - - _open: function( submenu ) { - var position = $.extend({ - of: this.active - }, this.options.position ); - - clearTimeout( this.timer ); - this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) - .hide() - .attr( "aria-hidden", "true" ); - - submenu - .show() - .removeAttr( "aria-hidden" ) - .attr( "aria-expanded", "true" ) - .position( position ); - }, - - collapseAll: function( event, all ) { - clearTimeout( this.timer ); - this.timer = this._delay(function() { - // If we were passed an event, look for the submenu that contains the event - var currentMenu = all ? this.element : - $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); - - // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway - if ( !currentMenu.length ) { - currentMenu = this.element; - } - - this._close( currentMenu ); - - this.blur( event ); - this.activeMenu = currentMenu; - }, this.delay ); - }, - - // With no arguments, closes the currently active menu - if nothing is active - // it closes all menus. If passed an argument, it will search for menus BELOW - _close: function( startMenu ) { - if ( !startMenu ) { - startMenu = this.active ? this.active.parent() : this.element; - } - - startMenu - .find( ".ui-menu" ) - .hide() - .attr( "aria-hidden", "true" ) - .attr( "aria-expanded", "false" ) - .end() - .find( "a.ui-state-active" ) - .removeClass( "ui-state-active" ); - }, - - collapse: function( event ) { - var newItem = this.active && - this.active.parent().closest( ".ui-menu-item", this.element ); - if ( newItem && newItem.length ) { - this._close(); - this.focus( event, newItem ); - } - }, - - expand: function( event ) { - var newItem = this.active && - this.active - .children( ".ui-menu " ) - .children( ".ui-menu-item" ) - .first(); - - if ( newItem && newItem.length ) { - this._open( newItem.parent() ); - - // Delay so Firefox will not hide activedescendant change in expanding submenu from AT - this._delay(function() { - this.focus( event, newItem ); - }); - } - }, - - next: function( event ) { - this._move( "next", "first", event ); - }, - - previous: function( event ) { - this._move( "prev", "last", event ); - }, - - isFirstItem: function() { - return this.active && !this.active.prevAll( ".ui-menu-item" ).length; - }, - - isLastItem: function() { - return this.active && !this.active.nextAll( ".ui-menu-item" ).length; - }, - - _move: function( direction, filter, event ) { - var next; - if ( this.active ) { - if ( direction === "first" || direction === "last" ) { - next = this.active - [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) - .eq( -1 ); - } else { - next = this.active - [ direction + "All" ]( ".ui-menu-item" ) - .eq( 0 ); - } - } - if ( !next || !next.length || !this.active ) { - next = this.activeMenu.children( ".ui-menu-item" )[ filter ](); - } - - this.focus( event, next ); - }, - - nextPage: function( event ) { - var item, base, height; - - if ( !this.active ) { - this.next( event ); - return; - } - if ( this.isLastItem() ) { - return; - } - if ( this._hasScroll() ) { - base = this.active.offset().top; - height = this.element.height(); - this.active.nextAll( ".ui-menu-item" ).each(function() { - item = $( this ); - return item.offset().top - base - height < 0; - }); - - this.focus( event, item ); - } else { - this.focus( event, this.activeMenu.children( ".ui-menu-item" ) - [ !this.active ? "first" : "last" ]() ); - } - }, - - previousPage: function( event ) { - var item, base, height; - if ( !this.active ) { - this.next( event ); - return; - } - if ( this.isFirstItem() ) { - return; - } - if ( this._hasScroll() ) { - base = this.active.offset().top; - height = this.element.height(); - this.active.prevAll( ".ui-menu-item" ).each(function() { - item = $( this ); - return item.offset().top - base + height > 0; - }); - - this.focus( event, item ); - } else { - this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() ); - } - }, - - _hasScroll: function() { - return this.element.outerHeight() < this.element.prop( "scrollHeight" ); - }, - - select: function( event ) { - // TODO: It should never be possible to not have an active item at this - // point, but the tests don't trigger mouseenter before click. - this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); - var ui = { item: this.active }; - if ( !this.active.has( ".ui-menu" ).length ) { - this.collapseAll( event, true ); - } - this._trigger( "select", event, ui ); - } -}); - -}( jQuery )); -(function( $, undefined ) { - -$.widget( "ui.progressbar", { - version: "1.9.2", - options: { - value: 0, - max: 100 - }, - - min: 0, - - _create: function() { - this.element - .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) - .attr({ - role: "progressbar", - "aria-valuemin": this.min, - "aria-valuemax": this.options.max, - "aria-valuenow": this._value() - }); - - this.valueDiv = $( "
        " ) - .appendTo( this.element ); - - this.oldValue = this._value(); - this._refreshValue(); - }, - - _destroy: function() { - this.element - .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) - .removeAttr( "role" ) - .removeAttr( "aria-valuemin" ) - .removeAttr( "aria-valuemax" ) - .removeAttr( "aria-valuenow" ); - - this.valueDiv.remove(); - }, - - value: function( newValue ) { - if ( newValue === undefined ) { - return this._value(); - } - - this._setOption( "value", newValue ); - return this; - }, - - _setOption: function( key, value ) { - if ( key === "value" ) { - this.options.value = value; - this._refreshValue(); - if ( this._value() === this.options.max ) { - this._trigger( "complete" ); - } - } - - this._super( key, value ); - }, - - _value: function() { - var val = this.options.value; - // normalize invalid value - if ( typeof val !== "number" ) { - val = 0; - } - return Math.min( this.options.max, Math.max( this.min, val ) ); - }, - - _percentage: function() { - return 100 * this._value() / this.options.max; - }, - - _refreshValue: function() { - var value = this.value(), - percentage = this._percentage(); - - if ( this.oldValue !== value ) { - this.oldValue = value; - this._trigger( "change" ); - } - - this.valueDiv - .toggle( value > this.min ) - .toggleClass( "ui-corner-right", value === this.options.max ) - .width( percentage.toFixed(0) + "%" ); - this.element.attr( "aria-valuenow", value ); - } -}); - -})( jQuery ); -(function( $, undefined ) { - -// number of pages in a slider -// (how many times can you page up/down to go through the whole range) -var numPages = 5; - -$.widget( "ui.slider", $.ui.mouse, { - version: "1.9.2", - widgetEventPrefix: "slide", - - options: { - animate: false, - distance: 0, - max: 100, - min: 0, - orientation: "horizontal", - range: false, - step: 1, - value: 0, - values: null - }, - - _create: function() { - var i, handleCount, - o = this.options, - existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), - handle = "", - handles = []; - - this._keySliding = false; - this._mouseSliding = false; - this._animateOff = true; - this._handleIndex = null; - this._detectOrientation(); - this._mouseInit(); - - this.element - .addClass( "ui-slider" + - " ui-slider-" + this.orientation + - " ui-widget" + - " ui-widget-content" + - " ui-corner-all" + - ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) ); - - this.range = $([]); - - if ( o.range ) { - if ( o.range === true ) { - if ( !o.values ) { - o.values = [ this._valueMin(), this._valueMin() ]; - } - if ( o.values.length && o.values.length !== 2 ) { - o.values = [ o.values[0], o.values[0] ]; - } - } - - this.range = $( "
        " ) - .appendTo( this.element ) - .addClass( "ui-slider-range" + - // note: this isn't the most fittingly semantic framework class for this element, - // but worked best visually with a variety of themes - " ui-widget-header" + - ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); - } - - handleCount = ( o.values && o.values.length ) || 1; - - for ( i = existingHandles.length; i < handleCount; i++ ) { - handles.push( handle ); - } - - this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); - - this.handle = this.handles.eq( 0 ); - - this.handles.add( this.range ).filter( "a" ) - .click(function( event ) { - event.preventDefault(); - }) - .mouseenter(function() { - if ( !o.disabled ) { - $( this ).addClass( "ui-state-hover" ); - } - }) - .mouseleave(function() { - $( this ).removeClass( "ui-state-hover" ); - }) - .focus(function() { - if ( !o.disabled ) { - $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); - $( this ).addClass( "ui-state-focus" ); - } else { - $( this ).blur(); - } - }) - .blur(function() { - $( this ).removeClass( "ui-state-focus" ); - }); - - this.handles.each(function( i ) { - $( this ).data( "ui-slider-handle-index", i ); - }); - - this._on( this.handles, { - keydown: function( event ) { - var allowed, curVal, newVal, step, - index = $( event.target ).data( "ui-slider-handle-index" ); - - switch ( event.keyCode ) { - case $.ui.keyCode.HOME: - case $.ui.keyCode.END: - case $.ui.keyCode.PAGE_UP: - case $.ui.keyCode.PAGE_DOWN: - case $.ui.keyCode.UP: - case $.ui.keyCode.RIGHT: - case $.ui.keyCode.DOWN: - case $.ui.keyCode.LEFT: - event.preventDefault(); - if ( !this._keySliding ) { - this._keySliding = true; - $( event.target ).addClass( "ui-state-active" ); - allowed = this._start( event, index ); - if ( allowed === false ) { - return; - } - } - break; - } - - step = this.options.step; - if ( this.options.values && this.options.values.length ) { - curVal = newVal = this.values( index ); - } else { - curVal = newVal = this.value(); - } - - switch ( event.keyCode ) { - case $.ui.keyCode.HOME: - newVal = this._valueMin(); - break; - case $.ui.keyCode.END: - newVal = this._valueMax(); - break; - case $.ui.keyCode.PAGE_UP: - newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) ); - break; - case $.ui.keyCode.PAGE_DOWN: - newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) ); - break; - case $.ui.keyCode.UP: - case $.ui.keyCode.RIGHT: - if ( curVal === this._valueMax() ) { - return; - } - newVal = this._trimAlignValue( curVal + step ); - break; - case $.ui.keyCode.DOWN: - case $.ui.keyCode.LEFT: - if ( curVal === this._valueMin() ) { - return; - } - newVal = this._trimAlignValue( curVal - step ); - break; - } - - this._slide( event, index, newVal ); - }, - keyup: function( event ) { - var index = $( event.target ).data( "ui-slider-handle-index" ); - - if ( this._keySliding ) { - this._keySliding = false; - this._stop( event, index ); - this._change( event, index ); - $( event.target ).removeClass( "ui-state-active" ); - } - } - }); - - this._refreshValue(); - - this._animateOff = false; - }, - - _destroy: function() { - this.handles.remove(); - this.range.remove(); - - this.element - .removeClass( "ui-slider" + - " ui-slider-horizontal" + - " ui-slider-vertical" + - " ui-slider-disabled" + - " ui-widget" + - " ui-widget-content" + - " ui-corner-all" ); - - this._mouseDestroy(); - }, - - _mouseCapture: function( event ) { - var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, - that = this, - o = this.options; - - if ( o.disabled ) { - return false; - } - - this.elementSize = { - width: this.element.outerWidth(), - height: this.element.outerHeight() - }; - this.elementOffset = this.element.offset(); - - position = { x: event.pageX, y: event.pageY }; - normValue = this._normValueFromMouse( position ); - distance = this._valueMax() - this._valueMin() + 1; - this.handles.each(function( i ) { - var thisDistance = Math.abs( normValue - that.values(i) ); - if ( distance > thisDistance ) { - distance = thisDistance; - closestHandle = $( this ); - index = i; - } - }); - - // workaround for bug #3736 (if both handles of a range are at 0, - // the first is always used as the one with least distance, - // and moving it is obviously prevented by preventing negative ranges) - if( o.range === true && this.values(1) === o.min ) { - index += 1; - closestHandle = $( this.handles[index] ); - } - - allowed = this._start( event, index ); - if ( allowed === false ) { - return false; - } - this._mouseSliding = true; - - this._handleIndex = index; - - closestHandle - .addClass( "ui-state-active" ) - .focus(); - - offset = closestHandle.offset(); - mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); - this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { - left: event.pageX - offset.left - ( closestHandle.width() / 2 ), - top: event.pageY - offset.top - - ( closestHandle.height() / 2 ) - - ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - - ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + - ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) - }; - - if ( !this.handles.hasClass( "ui-state-hover" ) ) { - this._slide( event, index, normValue ); - } - this._animateOff = true; - return true; - }, - - _mouseStart: function() { - return true; - }, - - _mouseDrag: function( event ) { - var position = { x: event.pageX, y: event.pageY }, - normValue = this._normValueFromMouse( position ); - - this._slide( event, this._handleIndex, normValue ); - - return false; - }, - - _mouseStop: function( event ) { - this.handles.removeClass( "ui-state-active" ); - this._mouseSliding = false; - - this._stop( event, this._handleIndex ); - this._change( event, this._handleIndex ); - - this._handleIndex = null; - this._clickOffset = null; - this._animateOff = false; - - return false; - }, - - _detectOrientation: function() { - this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; - }, - - _normValueFromMouse: function( position ) { - var pixelTotal, - pixelMouse, - percentMouse, - valueTotal, - valueMouse; - - if ( this.orientation === "horizontal" ) { - pixelTotal = this.elementSize.width; - pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); - } else { - pixelTotal = this.elementSize.height; - pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); - } - - percentMouse = ( pixelMouse / pixelTotal ); - if ( percentMouse > 1 ) { - percentMouse = 1; - } - if ( percentMouse < 0 ) { - percentMouse = 0; - } - if ( this.orientation === "vertical" ) { - percentMouse = 1 - percentMouse; - } - - valueTotal = this._valueMax() - this._valueMin(); - valueMouse = this._valueMin() + percentMouse * valueTotal; - - return this._trimAlignValue( valueMouse ); - }, - - _start: function( event, index ) { - var uiHash = { - handle: this.handles[ index ], - value: this.value() - }; - if ( this.options.values && this.options.values.length ) { - uiHash.value = this.values( index ); - uiHash.values = this.values(); - } - return this._trigger( "start", event, uiHash ); - }, - - _slide: function( event, index, newVal ) { - var otherVal, - newValues, - allowed; - - if ( this.options.values && this.options.values.length ) { - otherVal = this.values( index ? 0 : 1 ); - - if ( ( this.options.values.length === 2 && this.options.range === true ) && - ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) - ) { - newVal = otherVal; - } - - if ( newVal !== this.values( index ) ) { - newValues = this.values(); - newValues[ index ] = newVal; - // A slide can be canceled by returning false from the slide callback - allowed = this._trigger( "slide", event, { - handle: this.handles[ index ], - value: newVal, - values: newValues - } ); - otherVal = this.values( index ? 0 : 1 ); - if ( allowed !== false ) { - this.values( index, newVal, true ); - } - } - } else { - if ( newVal !== this.value() ) { - // A slide can be canceled by returning false from the slide callback - allowed = this._trigger( "slide", event, { - handle: this.handles[ index ], - value: newVal - } ); - if ( allowed !== false ) { - this.value( newVal ); - } - } - } - }, - - _stop: function( event, index ) { - var uiHash = { - handle: this.handles[ index ], - value: this.value() - }; - if ( this.options.values && this.options.values.length ) { - uiHash.value = this.values( index ); - uiHash.values = this.values(); - } - - this._trigger( "stop", event, uiHash ); - }, - - _change: function( event, index ) { - if ( !this._keySliding && !this._mouseSliding ) { - var uiHash = { - handle: this.handles[ index ], - value: this.value() - }; - if ( this.options.values && this.options.values.length ) { - uiHash.value = this.values( index ); - uiHash.values = this.values(); - } - - this._trigger( "change", event, uiHash ); - } - }, - - value: function( newValue ) { - if ( arguments.length ) { - this.options.value = this._trimAlignValue( newValue ); - this._refreshValue(); - this._change( null, 0 ); - return; - } - - return this._value(); - }, - - values: function( index, newValue ) { - var vals, - newValues, - i; - - if ( arguments.length > 1 ) { - this.options.values[ index ] = this._trimAlignValue( newValue ); - this._refreshValue(); - this._change( null, index ); - return; - } - - if ( arguments.length ) { - if ( $.isArray( arguments[ 0 ] ) ) { - vals = this.options.values; - newValues = arguments[ 0 ]; - for ( i = 0; i < vals.length; i += 1 ) { - vals[ i ] = this._trimAlignValue( newValues[ i ] ); - this._change( null, i ); - } - this._refreshValue(); - } else { - if ( this.options.values && this.options.values.length ) { - return this._values( index ); - } else { - return this.value(); - } - } - } else { - return this._values(); - } - }, - - _setOption: function( key, value ) { - var i, - valsLength = 0; - - if ( $.isArray( this.options.values ) ) { - valsLength = this.options.values.length; - } - - $.Widget.prototype._setOption.apply( this, arguments ); - - switch ( key ) { - case "disabled": - if ( value ) { - this.handles.filter( ".ui-state-focus" ).blur(); - this.handles.removeClass( "ui-state-hover" ); - this.handles.prop( "disabled", true ); - this.element.addClass( "ui-disabled" ); - } else { - this.handles.prop( "disabled", false ); - this.element.removeClass( "ui-disabled" ); - } - break; - case "orientation": - this._detectOrientation(); - this.element - .removeClass( "ui-slider-horizontal ui-slider-vertical" ) - .addClass( "ui-slider-" + this.orientation ); - this._refreshValue(); - break; - case "value": - this._animateOff = true; - this._refreshValue(); - this._change( null, 0 ); - this._animateOff = false; - break; - case "values": - this._animateOff = true; - this._refreshValue(); - for ( i = 0; i < valsLength; i += 1 ) { - this._change( null, i ); - } - this._animateOff = false; - break; - case "min": - case "max": - this._animateOff = true; - this._refreshValue(); - this._animateOff = false; - break; - } - }, - - //internal value getter - // _value() returns value trimmed by min and max, aligned by step - _value: function() { - var val = this.options.value; - val = this._trimAlignValue( val ); - - return val; - }, - - //internal values getter - // _values() returns array of values trimmed by min and max, aligned by step - // _values( index ) returns single value trimmed by min and max, aligned by step - _values: function( index ) { - var val, - vals, - i; - - if ( arguments.length ) { - val = this.options.values[ index ]; - val = this._trimAlignValue( val ); - - return val; - } else { - // .slice() creates a copy of the array - // this copy gets trimmed by min and max and then returned - vals = this.options.values.slice(); - for ( i = 0; i < vals.length; i+= 1) { - vals[ i ] = this._trimAlignValue( vals[ i ] ); - } - - return vals; - } - }, - - // returns the step-aligned value that val is closest to, between (inclusive) min and max - _trimAlignValue: function( val ) { - if ( val <= this._valueMin() ) { - return this._valueMin(); - } - if ( val >= this._valueMax() ) { - return this._valueMax(); - } - var step = ( this.options.step > 0 ) ? this.options.step : 1, - valModStep = (val - this._valueMin()) % step, - alignValue = val - valModStep; - - if ( Math.abs(valModStep) * 2 >= step ) { - alignValue += ( valModStep > 0 ) ? step : ( -step ); - } - - // Since JavaScript has problems with large floats, round - // the final value to 5 digits after the decimal point (see #4124) - return parseFloat( alignValue.toFixed(5) ); - }, - - _valueMin: function() { - return this.options.min; - }, - - _valueMax: function() { - return this.options.max; - }, - - _refreshValue: function() { - var lastValPercent, valPercent, value, valueMin, valueMax, - oRange = this.options.range, - o = this.options, - that = this, - animate = ( !this._animateOff ) ? o.animate : false, - _set = {}; - - if ( this.options.values && this.options.values.length ) { - this.handles.each(function( i ) { - valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100; - _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; - $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); - if ( that.options.range === true ) { - if ( that.orientation === "horizontal" ) { - if ( i === 0 ) { - that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); - } - if ( i === 1 ) { - that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - } else { - if ( i === 0 ) { - that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); - } - if ( i === 1 ) { - that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - } - } - lastValPercent = valPercent; - }); - } else { - value = this.value(); - valueMin = this._valueMin(); - valueMax = this._valueMax(); - valPercent = ( valueMax !== valueMin ) ? - ( value - valueMin ) / ( valueMax - valueMin ) * 100 : - 0; - _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; - this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); - - if ( oRange === "min" && this.orientation === "horizontal" ) { - this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); - } - if ( oRange === "max" && this.orientation === "horizontal" ) { - this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - if ( oRange === "min" && this.orientation === "vertical" ) { - this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); - } - if ( oRange === "max" && this.orientation === "vertical" ) { - this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - } - } - -}); - -}(jQuery)); -(function( $ ) { - -function modifier( fn ) { - return function() { - var previous = this.element.val(); - fn.apply( this, arguments ); - this._refresh(); - if ( previous !== this.element.val() ) { - this._trigger( "change" ); - } - }; -} - -$.widget( "ui.spinner", { - version: "1.9.2", - defaultElement: "", - widgetEventPrefix: "spin", - options: { - culture: null, - icons: { - down: "ui-icon-triangle-1-s", - up: "ui-icon-triangle-1-n" - }, - incremental: true, - max: null, - min: null, - numberFormat: null, - page: 10, - step: 1, - - change: null, - spin: null, - start: null, - stop: null - }, - - _create: function() { - // handle string values that need to be parsed - this._setOption( "max", this.options.max ); - this._setOption( "min", this.options.min ); - this._setOption( "step", this.options.step ); - - // format the value, but don't constrain - this._value( this.element.val(), true ); - - this._draw(); - this._on( this._events ); - this._refresh(); - - // turning off autocomplete prevents the browser from remembering the - // value when navigating through history, so we re-enable autocomplete - // if the page is unloaded before the widget is destroyed. #7790 - this._on( this.window, { - beforeunload: function() { - this.element.removeAttr( "autocomplete" ); - } - }); - }, - - _getCreateOptions: function() { - var options = {}, - element = this.element; - - $.each( [ "min", "max", "step" ], function( i, option ) { - var value = element.attr( option ); - if ( value !== undefined && value.length ) { - options[ option ] = value; - } - }); - - return options; - }, - - _events: { - keydown: function( event ) { - if ( this._start( event ) && this._keydown( event ) ) { - event.preventDefault(); - } - }, - keyup: "_stop", - focus: function() { - this.previous = this.element.val(); - }, - blur: function( event ) { - if ( this.cancelBlur ) { - delete this.cancelBlur; - return; - } - - this._refresh(); - if ( this.previous !== this.element.val() ) { - this._trigger( "change", event ); - } - }, - mousewheel: function( event, delta ) { - if ( !delta ) { - return; - } - if ( !this.spinning && !this._start( event ) ) { - return false; - } - - this._spin( (delta > 0 ? 1 : -1) * this.options.step, event ); - clearTimeout( this.mousewheelTimer ); - this.mousewheelTimer = this._delay(function() { - if ( this.spinning ) { - this._stop( event ); - } - }, 100 ); - event.preventDefault(); - }, - "mousedown .ui-spinner-button": function( event ) { - var previous; - - // We never want the buttons to have focus; whenever the user is - // interacting with the spinner, the focus should be on the input. - // If the input is focused then this.previous is properly set from - // when the input first received focus. If the input is not focused - // then we need to set this.previous based on the value before spinning. - previous = this.element[0] === this.document[0].activeElement ? - this.previous : this.element.val(); - function checkFocus() { - var isActive = this.element[0] === this.document[0].activeElement; - if ( !isActive ) { - this.element.focus(); - this.previous = previous; - // support: IE - // IE sets focus asynchronously, so we need to check if focus - // moved off of the input because the user clicked on the button. - this._delay(function() { - this.previous = previous; - }); - } - } - - // ensure focus is on (or stays on) the text field - event.preventDefault(); - checkFocus.call( this ); - - // support: IE - // IE doesn't prevent moving focus even with event.preventDefault() - // so we set a flag to know when we should ignore the blur event - // and check (again) if focus moved off of the input. - this.cancelBlur = true; - this._delay(function() { - delete this.cancelBlur; - checkFocus.call( this ); - }); - - if ( this._start( event ) === false ) { - return; - } - - this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); - }, - "mouseup .ui-spinner-button": "_stop", - "mouseenter .ui-spinner-button": function( event ) { - // button will add ui-state-active if mouse was down while mouseleave and kept down - if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) { - return; - } - - if ( this._start( event ) === false ) { - return false; - } - this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); - }, - // TODO: do we really want to consider this a stop? - // shouldn't we just stop the repeater and wait until mouseup before - // we trigger the stop event? - "mouseleave .ui-spinner-button": "_stop" - }, - - _draw: function() { - var uiSpinner = this.uiSpinner = this.element - .addClass( "ui-spinner-input" ) - .attr( "autocomplete", "off" ) - .wrap( this._uiSpinnerHtml() ) - .parent() - // add buttons - .append( this._buttonHtml() ); - - this.element.attr( "role", "spinbutton" ); - - // button bindings - this.buttons = uiSpinner.find( ".ui-spinner-button" ) - .attr( "tabIndex", -1 ) - .button() - .removeClass( "ui-corner-all" ); - - // IE 6 doesn't understand height: 50% for the buttons - // unless the wrapper has an explicit height - if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) && - uiSpinner.height() > 0 ) { - uiSpinner.height( uiSpinner.height() ); - } - - // disable spinner if element was already disabled - if ( this.options.disabled ) { - this.disable(); - } - }, - - _keydown: function( event ) { - var options = this.options, - keyCode = $.ui.keyCode; - - switch ( event.keyCode ) { - case keyCode.UP: - this._repeat( null, 1, event ); - return true; - case keyCode.DOWN: - this._repeat( null, -1, event ); - return true; - case keyCode.PAGE_UP: - this._repeat( null, options.page, event ); - return true; - case keyCode.PAGE_DOWN: - this._repeat( null, -options.page, event ); - return true; - } - - return false; - }, - - _uiSpinnerHtml: function() { - return ""; - }, - - _buttonHtml: function() { - return "" + - "" + - "" + - "" + - "" + - "" + - ""; - }, - - _start: function( event ) { - if ( !this.spinning && this._trigger( "start", event ) === false ) { - return false; - } - - if ( !this.counter ) { - this.counter = 1; - } - this.spinning = true; - return true; - }, - - _repeat: function( i, steps, event ) { - i = i || 500; - - clearTimeout( this.timer ); - this.timer = this._delay(function() { - this._repeat( 40, steps, event ); - }, i ); - - this._spin( steps * this.options.step, event ); - }, - - _spin: function( step, event ) { - var value = this.value() || 0; - - if ( !this.counter ) { - this.counter = 1; - } - - value = this._adjustValue( value + step * this._increment( this.counter ) ); - - if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) { - this._value( value ); - this.counter++; - } - }, - - _increment: function( i ) { - var incremental = this.options.incremental; - - if ( incremental ) { - return $.isFunction( incremental ) ? - incremental( i ) : - Math.floor( i*i*i/50000 - i*i/500 + 17*i/200 + 1 ); - } - - return 1; - }, - - _precision: function() { - var precision = this._precisionOf( this.options.step ); - if ( this.options.min !== null ) { - precision = Math.max( precision, this._precisionOf( this.options.min ) ); - } - return precision; - }, - - _precisionOf: function( num ) { - var str = num.toString(), - decimal = str.indexOf( "." ); - return decimal === -1 ? 0 : str.length - decimal - 1; - }, - - _adjustValue: function( value ) { - var base, aboveMin, - options = this.options; - - // make sure we're at a valid step - // - find out where we are relative to the base (min or 0) - base = options.min !== null ? options.min : 0; - aboveMin = value - base; - // - round to the nearest step - aboveMin = Math.round(aboveMin / options.step) * options.step; - // - rounding is based on 0, so adjust back to our base - value = base + aboveMin; - - // fix precision from bad JS floating point math - value = parseFloat( value.toFixed( this._precision() ) ); - - // clamp the value - if ( options.max !== null && value > options.max) { - return options.max; - } - if ( options.min !== null && value < options.min ) { - return options.min; - } - - return value; - }, - - _stop: function( event ) { - if ( !this.spinning ) { - return; - } - - clearTimeout( this.timer ); - clearTimeout( this.mousewheelTimer ); - this.counter = 0; - this.spinning = false; - this._trigger( "stop", event ); - }, - - _setOption: function( key, value ) { - if ( key === "culture" || key === "numberFormat" ) { - var prevValue = this._parse( this.element.val() ); - this.options[ key ] = value; - this.element.val( this._format( prevValue ) ); - return; - } - - if ( key === "max" || key === "min" || key === "step" ) { - if ( typeof value === "string" ) { - value = this._parse( value ); - } - } - - this._super( key, value ); - - if ( key === "disabled" ) { - if ( value ) { - this.element.prop( "disabled", true ); - this.buttons.button( "disable" ); - } else { - this.element.prop( "disabled", false ); - this.buttons.button( "enable" ); - } - } - }, - - _setOptions: modifier(function( options ) { - this._super( options ); - this._value( this.element.val() ); - }), - - _parse: function( val ) { - if ( typeof val === "string" && val !== "" ) { - val = window.Globalize && this.options.numberFormat ? - Globalize.parseFloat( val, 10, this.options.culture ) : +val; - } - return val === "" || isNaN( val ) ? null : val; - }, - - _format: function( value ) { - if ( value === "" ) { - return ""; - } - return window.Globalize && this.options.numberFormat ? - Globalize.format( value, this.options.numberFormat, this.options.culture ) : - value; - }, - - _refresh: function() { - this.element.attr({ - "aria-valuemin": this.options.min, - "aria-valuemax": this.options.max, - // TODO: what should we do with values that can't be parsed? - "aria-valuenow": this._parse( this.element.val() ) - }); - }, - - // update the value without triggering change - _value: function( value, allowAny ) { - var parsed; - if ( value !== "" ) { - parsed = this._parse( value ); - if ( parsed !== null ) { - if ( !allowAny ) { - parsed = this._adjustValue( parsed ); - } - value = this._format( parsed ); - } - } - this.element.val( value ); - this._refresh(); - }, - - _destroy: function() { - this.element - .removeClass( "ui-spinner-input" ) - .prop( "disabled", false ) - .removeAttr( "autocomplete" ) - .removeAttr( "role" ) - .removeAttr( "aria-valuemin" ) - .removeAttr( "aria-valuemax" ) - .removeAttr( "aria-valuenow" ); - this.uiSpinner.replaceWith( this.element ); - }, - - stepUp: modifier(function( steps ) { - this._stepUp( steps ); - }), - _stepUp: function( steps ) { - this._spin( (steps || 1) * this.options.step ); - }, - - stepDown: modifier(function( steps ) { - this._stepDown( steps ); - }), - _stepDown: function( steps ) { - this._spin( (steps || 1) * -this.options.step ); - }, - - pageUp: modifier(function( pages ) { - this._stepUp( (pages || 1) * this.options.page ); - }), - - pageDown: modifier(function( pages ) { - this._stepDown( (pages || 1) * this.options.page ); - }), - - value: function( newVal ) { - if ( !arguments.length ) { - return this._parse( this.element.val() ); - } - modifier( this._value ).call( this, newVal ); - }, - - widget: function() { - return this.uiSpinner; - } -}); - -}( jQuery ) ); -(function( $, undefined ) { - -var tabId = 0, - rhash = /#.*$/; - -function getNextTabId() { - return ++tabId; -} - -function isLocal( anchor ) { - return anchor.hash.length > 1 && - anchor.href.replace( rhash, "" ) === - location.href.replace( rhash, "" ) - // support: Safari 5.1 - // Safari 5.1 doesn't encode spaces in window.location - // but it does encode spaces from anchors (#8777) - .replace( /\s/g, "%20" ); -} - -$.widget( "ui.tabs", { - version: "1.9.2", - delay: 300, - options: { - active: null, - collapsible: false, - event: "click", - heightStyle: "content", - hide: null, - show: null, - - // callbacks - activate: null, - beforeActivate: null, - beforeLoad: null, - load: null - }, - - _create: function() { - var that = this, - options = this.options, - active = options.active, - locationHash = location.hash.substring( 1 ); - - this.running = false; - - this.element - .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" ) - .toggleClass( "ui-tabs-collapsible", options.collapsible ) - // Prevent users from focusing disabled tabs via click - .delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) { - if ( $( this ).is( ".ui-state-disabled" ) ) { - event.preventDefault(); - } - }) - // support: IE <9 - // Preventing the default action in mousedown doesn't prevent IE - // from focusing the element, so if the anchor gets focused, blur. - // We don't have to worry about focusing the previously focused - // element since clicking on a non-focusable element should focus - // the body anyway. - .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() { - if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { - this.blur(); - } - }); - - this._processTabs(); - - if ( active === null ) { - // check the fragment identifier in the URL - if ( locationHash ) { - this.tabs.each(function( i, tab ) { - if ( $( tab ).attr( "aria-controls" ) === locationHash ) { - active = i; - return false; - } - }); - } - - // check for a tab marked active via a class - if ( active === null ) { - active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); - } - - // no active tab, set to false - if ( active === null || active === -1 ) { - active = this.tabs.length ? 0 : false; - } - } - - // handle numbers: negative, out of range - if ( active !== false ) { - active = this.tabs.index( this.tabs.eq( active ) ); - if ( active === -1 ) { - active = options.collapsible ? false : 0; - } - } - options.active = active; - - // don't allow collapsible: false and active: false - if ( !options.collapsible && options.active === false && this.anchors.length ) { - options.active = 0; - } - - // Take disabling tabs via class attribute from HTML - // into account and update option properly. - if ( $.isArray( options.disabled ) ) { - options.disabled = $.unique( options.disabled.concat( - $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { - return that.tabs.index( li ); - }) - ) ).sort(); - } - - // check for length avoids error when initializing empty list - if ( this.options.active !== false && this.anchors.length ) { - this.active = this._findActive( this.options.active ); - } else { - this.active = $(); - } - - this._refresh(); - - if ( this.active.length ) { - this.load( options.active ); - } - }, - - _getCreateEventData: function() { - return { - tab: this.active, - panel: !this.active.length ? $() : this._getPanelForTab( this.active ) - }; - }, - - _tabKeydown: function( event ) { - var focusedTab = $( this.document[0].activeElement ).closest( "li" ), - selectedIndex = this.tabs.index( focusedTab ), - goingForward = true; - - if ( this._handlePageNav( event ) ) { - return; - } - - switch ( event.keyCode ) { - case $.ui.keyCode.RIGHT: - case $.ui.keyCode.DOWN: - selectedIndex++; - break; - case $.ui.keyCode.UP: - case $.ui.keyCode.LEFT: - goingForward = false; - selectedIndex--; - break; - case $.ui.keyCode.END: - selectedIndex = this.anchors.length - 1; - break; - case $.ui.keyCode.HOME: - selectedIndex = 0; - break; - case $.ui.keyCode.SPACE: - // Activate only, no collapsing - event.preventDefault(); - clearTimeout( this.activating ); - this._activate( selectedIndex ); - return; - case $.ui.keyCode.ENTER: - // Toggle (cancel delayed activation, allow collapsing) - event.preventDefault(); - clearTimeout( this.activating ); - // Determine if we should collapse or activate - this._activate( selectedIndex === this.options.active ? false : selectedIndex ); - return; - default: - return; - } - - // Focus the appropriate tab, based on which key was pressed - event.preventDefault(); - clearTimeout( this.activating ); - selectedIndex = this._focusNextTab( selectedIndex, goingForward ); - - // Navigating with control key will prevent automatic activation - if ( !event.ctrlKey ) { - // Update aria-selected immediately so that AT think the tab is already selected. - // Otherwise AT may confuse the user by stating that they need to activate the tab, - // but the tab will already be activated by the time the announcement finishes. - focusedTab.attr( "aria-selected", "false" ); - this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" ); - - this.activating = this._delay(function() { - this.option( "active", selectedIndex ); - }, this.delay ); - } - }, - - _panelKeydown: function( event ) { - if ( this._handlePageNav( event ) ) { - return; - } - - // Ctrl+up moves focus to the current tab - if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) { - event.preventDefault(); - this.active.focus(); - } - }, - - // Alt+page up/down moves focus to the previous/next tab (and activates) - _handlePageNav: function( event ) { - if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) { - this._activate( this._focusNextTab( this.options.active - 1, false ) ); - return true; - } - if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) { - this._activate( this._focusNextTab( this.options.active + 1, true ) ); - return true; - } - }, - - _findNextTab: function( index, goingForward ) { - var lastTabIndex = this.tabs.length - 1; - - function constrain() { - if ( index > lastTabIndex ) { - index = 0; - } - if ( index < 0 ) { - index = lastTabIndex; - } - return index; - } - - while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) { - index = goingForward ? index + 1 : index - 1; - } - - return index; - }, - - _focusNextTab: function( index, goingForward ) { - index = this._findNextTab( index, goingForward ); - this.tabs.eq( index ).focus(); - return index; - }, - - _setOption: function( key, value ) { - if ( key === "active" ) { - // _activate() will handle invalid values and update this.options - this._activate( value ); - return; - } - - if ( key === "disabled" ) { - // don't use the widget factory's disabled handling - this._setupDisabled( value ); - return; - } - - this._super( key, value); - - if ( key === "collapsible" ) { - this.element.toggleClass( "ui-tabs-collapsible", value ); - // Setting collapsible: false while collapsed; open first panel - if ( !value && this.options.active === false ) { - this._activate( 0 ); - } - } - - if ( key === "event" ) { - this._setupEvents( value ); - } - - if ( key === "heightStyle" ) { - this._setupHeightStyle( value ); - } - }, - - _tabId: function( tab ) { - return tab.attr( "aria-controls" ) || "ui-tabs-" + getNextTabId(); - }, - - _sanitizeSelector: function( hash ) { - return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; - }, - - refresh: function() { - var options = this.options, - lis = this.tablist.children( ":has(a[href])" ); - - // get disabled tabs from class attribute from HTML - // this will get converted to a boolean if needed in _refresh() - options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { - return lis.index( tab ); - }); - - this._processTabs(); - - // was collapsed or no tabs - if ( options.active === false || !this.anchors.length ) { - options.active = false; - this.active = $(); - // was active, but active tab is gone - } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) { - // all remaining tabs are disabled - if ( this.tabs.length === options.disabled.length ) { - options.active = false; - this.active = $(); - // activate previous tab - } else { - this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) ); - } - // was active, active tab still exists - } else { - // make sure active index is correct - options.active = this.tabs.index( this.active ); - } - - this._refresh(); - }, - - _refresh: function() { - this._setupDisabled( this.options.disabled ); - this._setupEvents( this.options.event ); - this._setupHeightStyle( this.options.heightStyle ); - - this.tabs.not( this.active ).attr({ - "aria-selected": "false", - tabIndex: -1 - }); - this.panels.not( this._getPanelForTab( this.active ) ) - .hide() - .attr({ - "aria-expanded": "false", - "aria-hidden": "true" - }); - - // Make sure one tab is in the tab order - if ( !this.active.length ) { - this.tabs.eq( 0 ).attr( "tabIndex", 0 ); - } else { - this.active - .addClass( "ui-tabs-active ui-state-active" ) - .attr({ - "aria-selected": "true", - tabIndex: 0 - }); - this._getPanelForTab( this.active ) - .show() - .attr({ - "aria-expanded": "true", - "aria-hidden": "false" - }); - } - }, - - _processTabs: function() { - var that = this; - - this.tablist = this._getList() - .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) - .attr( "role", "tablist" ); - - this.tabs = this.tablist.find( "> li:has(a[href])" ) - .addClass( "ui-state-default ui-corner-top" ) - .attr({ - role: "tab", - tabIndex: -1 - }); - - this.anchors = this.tabs.map(function() { - return $( "a", this )[ 0 ]; - }) - .addClass( "ui-tabs-anchor" ) - .attr({ - role: "presentation", - tabIndex: -1 - }); - - this.panels = $(); - - this.anchors.each(function( i, anchor ) { - var selector, panel, panelId, - anchorId = $( anchor ).uniqueId().attr( "id" ), - tab = $( anchor ).closest( "li" ), - originalAriaControls = tab.attr( "aria-controls" ); - - // inline tab - if ( isLocal( anchor ) ) { - selector = anchor.hash; - panel = that.element.find( that._sanitizeSelector( selector ) ); - // remote tab - } else { - panelId = that._tabId( tab ); - selector = "#" + panelId; - panel = that.element.find( selector ); - if ( !panel.length ) { - panel = that._createPanel( panelId ); - panel.insertAfter( that.panels[ i - 1 ] || that.tablist ); - } - panel.attr( "aria-live", "polite" ); - } - - if ( panel.length) { - that.panels = that.panels.add( panel ); - } - if ( originalAriaControls ) { - tab.data( "ui-tabs-aria-controls", originalAriaControls ); - } - tab.attr({ - "aria-controls": selector.substring( 1 ), - "aria-labelledby": anchorId - }); - panel.attr( "aria-labelledby", anchorId ); - }); - - this.panels - .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) - .attr( "role", "tabpanel" ); - }, - - // allow overriding how to find the list for rare usage scenarios (#7715) - _getList: function() { - return this.element.find( "ol,ul" ).eq( 0 ); - }, - - _createPanel: function( id ) { - return $( "
        " ) - .attr( "id", id ) - .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) - .data( "ui-tabs-destroy", true ); - }, - - _setupDisabled: function( disabled ) { - if ( $.isArray( disabled ) ) { - if ( !disabled.length ) { - disabled = false; - } else if ( disabled.length === this.anchors.length ) { - disabled = true; - } - } - - // disable tabs - for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) { - if ( disabled === true || $.inArray( i, disabled ) !== -1 ) { - $( li ) - .addClass( "ui-state-disabled" ) - .attr( "aria-disabled", "true" ); - } else { - $( li ) - .removeClass( "ui-state-disabled" ) - .removeAttr( "aria-disabled" ); - } - } - - this.options.disabled = disabled; - }, - - _setupEvents: function( event ) { - var events = { - click: function( event ) { - event.preventDefault(); - } - }; - if ( event ) { - $.each( event.split(" "), function( index, eventName ) { - events[ eventName ] = "_eventHandler"; - }); - } - - this._off( this.anchors.add( this.tabs ).add( this.panels ) ); - this._on( this.anchors, events ); - this._on( this.tabs, { keydown: "_tabKeydown" } ); - this._on( this.panels, { keydown: "_panelKeydown" } ); - - this._focusable( this.tabs ); - this._hoverable( this.tabs ); - }, - - _setupHeightStyle: function( heightStyle ) { - var maxHeight, overflow, - parent = this.element.parent(); - - if ( heightStyle === "fill" ) { - // IE 6 treats height like minHeight, so we need to turn off overflow - // in order to get a reliable height - // we use the minHeight support test because we assume that only - // browsers that don't support minHeight will treat height as minHeight - if ( !$.support.minHeight ) { - overflow = parent.css( "overflow" ); - parent.css( "overflow", "hidden"); - } - maxHeight = parent.height(); - this.element.siblings( ":visible" ).each(function() { - var elem = $( this ), - position = elem.css( "position" ); - - if ( position === "absolute" || position === "fixed" ) { - return; - } - maxHeight -= elem.outerHeight( true ); - }); - if ( overflow ) { - parent.css( "overflow", overflow ); - } - - this.element.children().not( this.panels ).each(function() { - maxHeight -= $( this ).outerHeight( true ); - }); - - this.panels.each(function() { - $( this ).height( Math.max( 0, maxHeight - - $( this ).innerHeight() + $( this ).height() ) ); - }) - .css( "overflow", "auto" ); - } else if ( heightStyle === "auto" ) { - maxHeight = 0; - this.panels.each(function() { - maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); - }).height( maxHeight ); - } - }, - - _eventHandler: function( event ) { - var options = this.options, - active = this.active, - anchor = $( event.currentTarget ), - tab = anchor.closest( "li" ), - clickedIsActive = tab[ 0 ] === active[ 0 ], - collapsing = clickedIsActive && options.collapsible, - toShow = collapsing ? $() : this._getPanelForTab( tab ), - toHide = !active.length ? $() : this._getPanelForTab( active ), - eventData = { - oldTab: active, - oldPanel: toHide, - newTab: collapsing ? $() : tab, - newPanel: toShow - }; - - event.preventDefault(); - - if ( tab.hasClass( "ui-state-disabled" ) || - // tab is already loading - tab.hasClass( "ui-tabs-loading" ) || - // can't switch durning an animation - this.running || - // click on active header, but not collapsible - ( clickedIsActive && !options.collapsible ) || - // allow canceling activation - ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { - return; - } - - options.active = collapsing ? false : this.tabs.index( tab ); - - this.active = clickedIsActive ? $() : tab; - if ( this.xhr ) { - this.xhr.abort(); - } - - if ( !toHide.length && !toShow.length ) { - $.error( "jQuery UI Tabs: Mismatching fragment identifier." ); - } - - if ( toShow.length ) { - this.load( this.tabs.index( tab ), event ); - } - this._toggle( event, eventData ); - }, - - // handles show/hide for selecting tabs - _toggle: function( event, eventData ) { - var that = this, - toShow = eventData.newPanel, - toHide = eventData.oldPanel; - - this.running = true; - - function complete() { - that.running = false; - that._trigger( "activate", event, eventData ); - } - - function show() { - eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); - - if ( toShow.length && that.options.show ) { - that._show( toShow, that.options.show, complete ); - } else { - toShow.show(); - complete(); - } - } - - // start out by hiding, then showing, then completing - if ( toHide.length && this.options.hide ) { - this._hide( toHide, this.options.hide, function() { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - show(); - }); - } else { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - toHide.hide(); - show(); - } - - toHide.attr({ - "aria-expanded": "false", - "aria-hidden": "true" - }); - eventData.oldTab.attr( "aria-selected", "false" ); - // If we're switching tabs, remove the old tab from the tab order. - // If we're opening from collapsed state, remove the previous tab from the tab order. - // If we're collapsing, then keep the collapsing tab in the tab order. - if ( toShow.length && toHide.length ) { - eventData.oldTab.attr( "tabIndex", -1 ); - } else if ( toShow.length ) { - this.tabs.filter(function() { - return $( this ).attr( "tabIndex" ) === 0; - }) - .attr( "tabIndex", -1 ); - } - - toShow.attr({ - "aria-expanded": "true", - "aria-hidden": "false" - }); - eventData.newTab.attr({ - "aria-selected": "true", - tabIndex: 0 - }); - }, - - _activate: function( index ) { - var anchor, - active = this._findActive( index ); - - // trying to activate the already active panel - if ( active[ 0 ] === this.active[ 0 ] ) { - return; - } - - // trying to collapse, simulate a click on the current active header - if ( !active.length ) { - active = this.active; - } - - anchor = active.find( ".ui-tabs-anchor" )[ 0 ]; - this._eventHandler({ - target: anchor, - currentTarget: anchor, - preventDefault: $.noop - }); - }, - - _findActive: function( index ) { - return index === false ? $() : this.tabs.eq( index ); - }, - - _getIndex: function( index ) { - // meta-function to give users option to provide a href string instead of a numerical index. - if ( typeof index === "string" ) { - index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) ); - } - - return index; - }, - - _destroy: function() { - if ( this.xhr ) { - this.xhr.abort(); - } - - this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ); - - this.tablist - .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) - .removeAttr( "role" ); - - this.anchors - .removeClass( "ui-tabs-anchor" ) - .removeAttr( "role" ) - .removeAttr( "tabIndex" ) - .removeData( "href.tabs" ) - .removeData( "load.tabs" ) - .removeUniqueId(); - - this.tabs.add( this.panels ).each(function() { - if ( $.data( this, "ui-tabs-destroy" ) ) { - $( this ).remove(); - } else { - $( this ) - .removeClass( "ui-state-default ui-state-active ui-state-disabled " + - "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" ) - .removeAttr( "tabIndex" ) - .removeAttr( "aria-live" ) - .removeAttr( "aria-busy" ) - .removeAttr( "aria-selected" ) - .removeAttr( "aria-labelledby" ) - .removeAttr( "aria-hidden" ) - .removeAttr( "aria-expanded" ) - .removeAttr( "role" ); - } - }); - - this.tabs.each(function() { - var li = $( this ), - prev = li.data( "ui-tabs-aria-controls" ); - if ( prev ) { - li.attr( "aria-controls", prev ); - } else { - li.removeAttr( "aria-controls" ); - } - }); - - this.panels.show(); - - if ( this.options.heightStyle !== "content" ) { - this.panels.css( "height", "" ); - } - }, - - enable: function( index ) { - var disabled = this.options.disabled; - if ( disabled === false ) { - return; - } - - if ( index === undefined ) { - disabled = false; - } else { - index = this._getIndex( index ); - if ( $.isArray( disabled ) ) { - disabled = $.map( disabled, function( num ) { - return num !== index ? num : null; - }); - } else { - disabled = $.map( this.tabs, function( li, num ) { - return num !== index ? num : null; - }); - } - } - this._setupDisabled( disabled ); - }, - - disable: function( index ) { - var disabled = this.options.disabled; - if ( disabled === true ) { - return; - } - - if ( index === undefined ) { - disabled = true; - } else { - index = this._getIndex( index ); - if ( $.inArray( index, disabled ) !== -1 ) { - return; - } - if ( $.isArray( disabled ) ) { - disabled = $.merge( [ index ], disabled ).sort(); - } else { - disabled = [ index ]; - } - } - this._setupDisabled( disabled ); - }, - - load: function( index, event ) { - index = this._getIndex( index ); - var that = this, - tab = this.tabs.eq( index ), - anchor = tab.find( ".ui-tabs-anchor" ), - panel = this._getPanelForTab( tab ), - eventData = { - tab: tab, - panel: panel - }; - - // not remote - if ( isLocal( anchor[ 0 ] ) ) { - return; - } - - this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); - - // support: jQuery <1.8 - // jQuery <1.8 returns false if the request is canceled in beforeSend, - // but as of 1.8, $.ajax() always returns a jqXHR object. - if ( this.xhr && this.xhr.statusText !== "canceled" ) { - tab.addClass( "ui-tabs-loading" ); - panel.attr( "aria-busy", "true" ); - - this.xhr - .success(function( response ) { - // support: jQuery <1.8 - // http://bugs.jquery.com/ticket/11778 - setTimeout(function() { - panel.html( response ); - that._trigger( "load", event, eventData ); - }, 1 ); - }) - .complete(function( jqXHR, status ) { - // support: jQuery <1.8 - // http://bugs.jquery.com/ticket/11778 - setTimeout(function() { - if ( status === "abort" ) { - that.panels.stop( false, true ); - } - - tab.removeClass( "ui-tabs-loading" ); - panel.removeAttr( "aria-busy" ); - - if ( jqXHR === that.xhr ) { - delete that.xhr; - } - }, 1 ); - }); - } - }, - - // TODO: Remove this function in 1.10 when ajaxOptions is removed - _ajaxSettings: function( anchor, event, eventData ) { - var that = this; - return { - url: anchor.attr( "href" ), - beforeSend: function( jqXHR, settings ) { - return that._trigger( "beforeLoad", event, - $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) ); - } - }; - }, - - _getPanelForTab: function( tab ) { - var id = $( tab ).attr( "aria-controls" ); - return this.element.find( this._sanitizeSelector( "#" + id ) ); - } -}); - -// DEPRECATED -if ( $.uiBackCompat !== false ) { - - // helper method for a lot of the back compat extensions - $.ui.tabs.prototype._ui = function( tab, panel ) { - return { - tab: tab, - panel: panel, - index: this.anchors.index( tab ) - }; - }; - - // url method - $.widget( "ui.tabs", $.ui.tabs, { - url: function( index, url ) { - this.anchors.eq( index ).attr( "href", url ); - } - }); - - // TODO: Remove _ajaxSettings() method when removing this extension - // ajaxOptions and cache options - $.widget( "ui.tabs", $.ui.tabs, { - options: { - ajaxOptions: null, - cache: false - }, - - _create: function() { - this._super(); - - var that = this; - - this._on({ tabsbeforeload: function( event, ui ) { - // tab is already cached - if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) { - event.preventDefault(); - return; - } - - ui.jqXHR.success(function() { - if ( that.options.cache ) { - $.data( ui.tab[ 0 ], "cache.tabs", true ); - } - }); - }}); - }, - - _ajaxSettings: function( anchor, event, ui ) { - var ajaxOptions = this.options.ajaxOptions; - return $.extend( {}, ajaxOptions, { - error: function( xhr, status ) { - try { - // Passing index avoid a race condition when this method is - // called after the user has selected another tab. - // Pass the anchor that initiated this request allows - // loadError to manipulate the tab content panel via $(a.hash) - ajaxOptions.error( - xhr, status, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] ); - } - catch ( error ) {} - } - }, this._superApply( arguments ) ); - }, - - _setOption: function( key, value ) { - // reset cache if switching from cached to not cached - if ( key === "cache" && value === false ) { - this.anchors.removeData( "cache.tabs" ); - } - this._super( key, value ); - }, - - _destroy: function() { - this.anchors.removeData( "cache.tabs" ); - this._super(); - }, - - url: function( index ){ - this.anchors.eq( index ).removeData( "cache.tabs" ); - this._superApply( arguments ); - } - }); - - // abort method - $.widget( "ui.tabs", $.ui.tabs, { - abort: function() { - if ( this.xhr ) { - this.xhr.abort(); - } - } - }); - - // spinner - $.widget( "ui.tabs", $.ui.tabs, { - options: { - spinner: "Loading…" - }, - _create: function() { - this._super(); - this._on({ - tabsbeforeload: function( event, ui ) { - // Don't react to nested tabs or tabs that don't use a spinner - if ( event.target !== this.element[ 0 ] || - !this.options.spinner ) { - return; - } - - var span = ui.tab.find( "span" ), - html = span.html(); - span.html( this.options.spinner ); - ui.jqXHR.complete(function() { - span.html( html ); - }); - } - }); - } - }); - - // enable/disable events - $.widget( "ui.tabs", $.ui.tabs, { - options: { - enable: null, - disable: null - }, - - enable: function( index ) { - var options = this.options, - trigger; - - if ( index && options.disabled === true || - ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) !== -1 ) ) { - trigger = true; - } - - this._superApply( arguments ); - - if ( trigger ) { - this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); - } - }, - - disable: function( index ) { - var options = this.options, - trigger; - - if ( index && options.disabled === false || - ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) === -1 ) ) { - trigger = true; - } - - this._superApply( arguments ); - - if ( trigger ) { - this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); - } - } - }); - - // add/remove methods and events - $.widget( "ui.tabs", $.ui.tabs, { - options: { - add: null, - remove: null, - tabTemplate: "
      • #{label}
      • " - }, - - add: function( url, label, index ) { - if ( index === undefined ) { - index = this.anchors.length; - } - - var doInsertAfter, panel, - options = this.options, - li = $( options.tabTemplate - .replace( /#\{href\}/g, url ) - .replace( /#\{label\}/g, label ) ), - id = !url.indexOf( "#" ) ? - url.replace( "#", "" ) : - this._tabId( li ); - - li.addClass( "ui-state-default ui-corner-top" ).data( "ui-tabs-destroy", true ); - li.attr( "aria-controls", id ); - - doInsertAfter = index >= this.tabs.length; - - // try to find an existing element before creating a new one - panel = this.element.find( "#" + id ); - if ( !panel.length ) { - panel = this._createPanel( id ); - if ( doInsertAfter ) { - if ( index > 0 ) { - panel.insertAfter( this.panels.eq( -1 ) ); - } else { - panel.appendTo( this.element ); - } - } else { - panel.insertBefore( this.panels[ index ] ); - } - } - panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ).hide(); - - if ( doInsertAfter ) { - li.appendTo( this.tablist ); - } else { - li.insertBefore( this.tabs[ index ] ); - } - - options.disabled = $.map( options.disabled, function( n ) { - return n >= index ? ++n : n; - }); - - this.refresh(); - if ( this.tabs.length === 1 && options.active === false ) { - this.option( "active", 0 ); - } - - this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); - return this; - }, - - remove: function( index ) { - index = this._getIndex( index ); - var options = this.options, - tab = this.tabs.eq( index ).remove(), - panel = this._getPanelForTab( tab ).remove(); - - // If selected tab was removed focus tab to the right or - // in case the last tab was removed the tab to the left. - // We check for more than 2 tabs, because if there are only 2, - // then when we remove this tab, there will only be one tab left - // so we don't need to detect which tab to activate. - if ( tab.hasClass( "ui-tabs-active" ) && this.anchors.length > 2 ) { - this._activate( index + ( index + 1 < this.anchors.length ? 1 : -1 ) ); - } - - options.disabled = $.map( - $.grep( options.disabled, function( n ) { - return n !== index; - }), - function( n ) { - return n >= index ? --n : n; - }); - - this.refresh(); - - this._trigger( "remove", null, this._ui( tab.find( "a" )[ 0 ], panel[ 0 ] ) ); - return this; - } - }); - - // length method - $.widget( "ui.tabs", $.ui.tabs, { - length: function() { - return this.anchors.length; - } - }); - - // panel ids (idPrefix option + title attribute) - $.widget( "ui.tabs", $.ui.tabs, { - options: { - idPrefix: "ui-tabs-" - }, - - _tabId: function( tab ) { - var a = tab.is( "li" ) ? tab.find( "a[href]" ) : tab; - a = a[0]; - return $( a ).closest( "li" ).attr( "aria-controls" ) || - a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF\-]/g, "" ) || - this.options.idPrefix + getNextTabId(); - } - }); - - // _createPanel method - $.widget( "ui.tabs", $.ui.tabs, { - options: { - panelTemplate: "
        " - }, - - _createPanel: function( id ) { - return $( this.options.panelTemplate ) - .attr( "id", id ) - .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) - .data( "ui-tabs-destroy", true ); - } - }); - - // selected option - $.widget( "ui.tabs", $.ui.tabs, { - _create: function() { - var options = this.options; - if ( options.active === null && options.selected !== undefined ) { - options.active = options.selected === -1 ? false : options.selected; - } - this._super(); - options.selected = options.active; - if ( options.selected === false ) { - options.selected = -1; - } - }, - - _setOption: function( key, value ) { - if ( key !== "selected" ) { - return this._super( key, value ); - } - - var options = this.options; - this._super( "active", value === -1 ? false : value ); - options.selected = options.active; - if ( options.selected === false ) { - options.selected = -1; - } - }, - - _eventHandler: function() { - this._superApply( arguments ); - this.options.selected = this.options.active; - if ( this.options.selected === false ) { - this.options.selected = -1; - } - } - }); - - // show and select event - $.widget( "ui.tabs", $.ui.tabs, { - options: { - show: null, - select: null - }, - _create: function() { - this._super(); - if ( this.options.active !== false ) { - this._trigger( "show", null, this._ui( - this.active.find( ".ui-tabs-anchor" )[ 0 ], - this._getPanelForTab( this.active )[ 0 ] ) ); - } - }, - _trigger: function( type, event, data ) { - var tab, panel, - ret = this._superApply( arguments ); - - if ( !ret ) { - return false; - } - - if ( type === "beforeActivate" ) { - tab = data.newTab.length ? data.newTab : data.oldTab; - panel = data.newPanel.length ? data.newPanel : data.oldPanel; - ret = this._super( "select", event, { - tab: tab.find( ".ui-tabs-anchor" )[ 0], - panel: panel[ 0 ], - index: tab.closest( "li" ).index() - }); - } else if ( type === "activate" && data.newTab.length ) { - ret = this._super( "show", event, { - tab: data.newTab.find( ".ui-tabs-anchor" )[ 0 ], - panel: data.newPanel[ 0 ], - index: data.newTab.closest( "li" ).index() - }); - } - return ret; - } - }); - - // select method - $.widget( "ui.tabs", $.ui.tabs, { - select: function( index ) { - index = this._getIndex( index ); - if ( index === -1 ) { - if ( this.options.collapsible && this.options.selected !== -1 ) { - index = this.options.selected; - } else { - return; - } - } - this.anchors.eq( index ).trigger( this.options.event + this.eventNamespace ); - } - }); - - // cookie option - (function() { - - var listId = 0; - - $.widget( "ui.tabs", $.ui.tabs, { - options: { - cookie: null // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } - }, - _create: function() { - var options = this.options, - active; - if ( options.active == null && options.cookie ) { - active = parseInt( this._cookie(), 10 ); - if ( active === -1 ) { - active = false; - } - options.active = active; - } - this._super(); - }, - _cookie: function( active ) { - var cookie = [ this.cookie || - ( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ]; - if ( arguments.length ) { - cookie.push( active === false ? -1 : active ); - cookie.push( this.options.cookie ); - } - return $.cookie.apply( null, cookie ); - }, - _refresh: function() { - this._super(); - if ( this.options.cookie ) { - this._cookie( this.options.active, this.options.cookie ); - } - }, - _eventHandler: function() { - this._superApply( arguments ); - if ( this.options.cookie ) { - this._cookie( this.options.active, this.options.cookie ); - } - }, - _destroy: function() { - this._super(); - if ( this.options.cookie ) { - this._cookie( null, this.options.cookie ); - } - } - }); - - })(); - - // load event - $.widget( "ui.tabs", $.ui.tabs, { - _trigger: function( type, event, data ) { - var _data = $.extend( {}, data ); - if ( type === "load" ) { - _data.panel = _data.panel[ 0 ]; - _data.tab = _data.tab.find( ".ui-tabs-anchor" )[ 0 ]; - } - return this._super( type, event, _data ); - } - }); - - // fx option - // The new animation options (show, hide) conflict with the old show callback. - // The old fx option wins over show/hide anyway (always favor back-compat). - // If a user wants to use the new animation API, they must give up the old API. - $.widget( "ui.tabs", $.ui.tabs, { - options: { - fx: null // e.g. { height: "toggle", opacity: "toggle", duration: 200 } - }, - - _getFx: function() { - var hide, show, - fx = this.options.fx; - - if ( fx ) { - if ( $.isArray( fx ) ) { - hide = fx[ 0 ]; - show = fx[ 1 ]; - } else { - hide = show = fx; - } - } - - return fx ? { show: show, hide: hide } : null; - }, - - _toggle: function( event, eventData ) { - var that = this, - toShow = eventData.newPanel, - toHide = eventData.oldPanel, - fx = this._getFx(); - - if ( !fx ) { - return this._super( event, eventData ); - } - - that.running = true; - - function complete() { - that.running = false; - that._trigger( "activate", event, eventData ); - } - - function show() { - eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); - - if ( toShow.length && fx.show ) { - toShow - .animate( fx.show, fx.show.duration, function() { - complete(); - }); - } else { - toShow.show(); - complete(); - } - } - - // start out by hiding, then showing, then completing - if ( toHide.length && fx.hide ) { - toHide.animate( fx.hide, fx.hide.duration, function() { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - show(); - }); - } else { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - toHide.hide(); - show(); - } - } - }); -} - -})( jQuery ); -(function( $ ) { - -var increments = 0; - -function addDescribedBy( elem, id ) { - var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ); - describedby.push( id ); - elem - .data( "ui-tooltip-id", id ) - .attr( "aria-describedby", $.trim( describedby.join( " " ) ) ); -} - -function removeDescribedBy( elem ) { - var id = elem.data( "ui-tooltip-id" ), - describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ), - index = $.inArray( id, describedby ); - if ( index !== -1 ) { - describedby.splice( index, 1 ); - } - - elem.removeData( "ui-tooltip-id" ); - describedby = $.trim( describedby.join( " " ) ); - if ( describedby ) { - elem.attr( "aria-describedby", describedby ); - } else { - elem.removeAttr( "aria-describedby" ); - } -} - -$.widget( "ui.tooltip", { - version: "1.9.2", - options: { - content: function() { - return $( this ).attr( "title" ); - }, - hide: true, - // Disabled elements have inconsistent behavior across browsers (#8661) - items: "[title]:not([disabled])", - position: { - my: "left top+15", - at: "left bottom", - collision: "flipfit flip" - }, - show: true, - tooltipClass: null, - track: false, - - // callbacks - close: null, - open: null - }, - - _create: function() { - this._on({ - mouseover: "open", - focusin: "open" - }); - - // IDs of generated tooltips, needed for destroy - this.tooltips = {}; - // IDs of parent tooltips where we removed the title attribute - this.parents = {}; - - if ( this.options.disabled ) { - this._disable(); - } - }, - - _setOption: function( key, value ) { - var that = this; - - if ( key === "disabled" ) { - this[ value ? "_disable" : "_enable" ](); - this.options[ key ] = value; - // disable element style changes - return; - } - - this._super( key, value ); - - if ( key === "content" ) { - $.each( this.tooltips, function( id, element ) { - that._updateContent( element ); - }); - } - }, - - _disable: function() { - var that = this; - - // close open tooltips - $.each( this.tooltips, function( id, element ) { - var event = $.Event( "blur" ); - event.target = event.currentTarget = element[0]; - that.close( event, true ); - }); - - // remove title attributes to prevent native tooltips - this.element.find( this.options.items ).andSelf().each(function() { - var element = $( this ); - if ( element.is( "[title]" ) ) { - element - .data( "ui-tooltip-title", element.attr( "title" ) ) - .attr( "title", "" ); - } - }); - }, - - _enable: function() { - // restore title attributes - this.element.find( this.options.items ).andSelf().each(function() { - var element = $( this ); - if ( element.data( "ui-tooltip-title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - } - }); - }, - - open: function( event ) { - var that = this, - target = $( event ? event.target : this.element ) - // we need closest here due to mouseover bubbling, - // but always pointing at the same event target - .closest( this.options.items ); - - // No element to show a tooltip for or the tooltip is already open - if ( !target.length || target.data( "ui-tooltip-id" ) ) { - return; - } - - if ( target.attr( "title" ) ) { - target.data( "ui-tooltip-title", target.attr( "title" ) ); - } - - target.data( "ui-tooltip-open", true ); - - // kill parent tooltips, custom or native, for hover - if ( event && event.type === "mouseover" ) { - target.parents().each(function() { - var parent = $( this ), - blurEvent; - if ( parent.data( "ui-tooltip-open" ) ) { - blurEvent = $.Event( "blur" ); - blurEvent.target = blurEvent.currentTarget = this; - that.close( blurEvent, true ); - } - if ( parent.attr( "title" ) ) { - parent.uniqueId(); - that.parents[ this.id ] = { - element: this, - title: parent.attr( "title" ) - }; - parent.attr( "title", "" ); - } - }); - } - - this._updateContent( target, event ); - }, - - _updateContent: function( target, event ) { - var content, - contentOption = this.options.content, - that = this, - eventType = event ? event.type : null; - - if ( typeof contentOption === "string" ) { - return this._open( event, target, contentOption ); - } - - content = contentOption.call( target[0], function( response ) { - // ignore async response if tooltip was closed already - if ( !target.data( "ui-tooltip-open" ) ) { - return; - } - // IE may instantly serve a cached response for ajax requests - // delay this call to _open so the other call to _open runs first - that._delay(function() { - // jQuery creates a special event for focusin when it doesn't - // exist natively. To improve performance, the native event - // object is reused and the type is changed. Therefore, we can't - // rely on the type being correct after the event finished - // bubbling, so we set it back to the previous value. (#8740) - if ( event ) { - event.type = eventType; - } - this._open( event, target, response ); - }); - }); - if ( content ) { - this._open( event, target, content ); - } - }, - - _open: function( event, target, content ) { - var tooltip, events, delayedShow, - positionOption = $.extend( {}, this.options.position ); - - if ( !content ) { - return; - } - - // Content can be updated multiple times. If the tooltip already - // exists, then just update the content and bail. - tooltip = this._find( target ); - if ( tooltip.length ) { - tooltip.find( ".ui-tooltip-content" ).html( content ); - return; - } - - // if we have a title, clear it to prevent the native tooltip - // we have to check first to avoid defining a title if none exists - // (we don't want to cause an element to start matching [title]) - // - // We use removeAttr only for key events, to allow IE to export the correct - // accessible attributes. For mouse events, set to empty string to avoid - // native tooltip showing up (happens only when removing inside mouseover). - if ( target.is( "[title]" ) ) { - if ( event && event.type === "mouseover" ) { - target.attr( "title", "" ); - } else { - target.removeAttr( "title" ); - } - } - - tooltip = this._tooltip( target ); - addDescribedBy( target, tooltip.attr( "id" ) ); - tooltip.find( ".ui-tooltip-content" ).html( content ); - - function position( event ) { - positionOption.of = event; - if ( tooltip.is( ":hidden" ) ) { - return; - } - tooltip.position( positionOption ); - } - if ( this.options.track && event && /^mouse/.test( event.type ) ) { - this._on( this.document, { - mousemove: position - }); - // trigger once to override element-relative positioning - position( event ); - } else { - tooltip.position( $.extend({ - of: target - }, this.options.position ) ); - } - - tooltip.hide(); - - this._show( tooltip, this.options.show ); - // Handle tracking tooltips that are shown with a delay (#8644). As soon - // as the tooltip is visible, position the tooltip using the most recent - // event. - if ( this.options.show && this.options.show.delay ) { - delayedShow = setInterval(function() { - if ( tooltip.is( ":visible" ) ) { - position( positionOption.of ); - clearInterval( delayedShow ); - } - }, $.fx.interval ); - } - - this._trigger( "open", event, { tooltip: tooltip } ); - - events = { - keyup: function( event ) { - if ( event.keyCode === $.ui.keyCode.ESCAPE ) { - var fakeEvent = $.Event(event); - fakeEvent.currentTarget = target[0]; - this.close( fakeEvent, true ); - } - }, - remove: function() { - this._removeTooltip( tooltip ); - } - }; - if ( !event || event.type === "mouseover" ) { - events.mouseleave = "close"; - } - if ( !event || event.type === "focusin" ) { - events.focusout = "close"; - } - this._on( true, target, events ); - }, - - close: function( event ) { - var that = this, - target = $( event ? event.currentTarget : this.element ), - tooltip = this._find( target ); - - // disabling closes the tooltip, so we need to track when we're closing - // to avoid an infinite loop in case the tooltip becomes disabled on close - if ( this.closing ) { - return; - } - - // only set title if we had one before (see comment in _open()) - if ( target.data( "ui-tooltip-title" ) ) { - target.attr( "title", target.data( "ui-tooltip-title" ) ); - } - - removeDescribedBy( target ); - - tooltip.stop( true ); - this._hide( tooltip, this.options.hide, function() { - that._removeTooltip( $( this ) ); - }); - - target.removeData( "ui-tooltip-open" ); - this._off( target, "mouseleave focusout keyup" ); - // Remove 'remove' binding only on delegated targets - if ( target[0] !== this.element[0] ) { - this._off( target, "remove" ); - } - this._off( this.document, "mousemove" ); - - if ( event && event.type === "mouseleave" ) { - $.each( this.parents, function( id, parent ) { - $( parent.element ).attr( "title", parent.title ); - delete that.parents[ id ]; - }); - } - - this.closing = true; - this._trigger( "close", event, { tooltip: tooltip } ); - this.closing = false; - }, - - _tooltip: function( element ) { - var id = "ui-tooltip-" + increments++, - tooltip = $( "
        " ) - .attr({ - id: id, - role: "tooltip" - }) - .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " + - ( this.options.tooltipClass || "" ) ); - $( "
        " ) - .addClass( "ui-tooltip-content" ) - .appendTo( tooltip ); - tooltip.appendTo( this.document[0].body ); - if ( $.fn.bgiframe ) { - tooltip.bgiframe(); - } - this.tooltips[ id ] = element; - return tooltip; - }, - - _find: function( target ) { - var id = target.data( "ui-tooltip-id" ); - return id ? $( "#" + id ) : $(); - }, - - _removeTooltip: function( tooltip ) { - tooltip.remove(); - delete this.tooltips[ tooltip.attr( "id" ) ]; - }, - - _destroy: function() { - var that = this; - - // close open tooltips - $.each( this.tooltips, function( id, element ) { - // Delegate to close method to handle common cleanup - var event = $.Event( "blur" ); - event.target = event.currentTarget = element[0]; - that.close( event, true ); - - // Remove immediately; destroying an open tooltip doesn't use the - // hide animation - $( "#" + id ).remove(); - - // Restore the title - if ( element.data( "ui-tooltip-title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - element.removeData( "ui-tooltip-title" ); - } - }); - } -}); - -}( jQuery ) ); -;(jQuery.effects || (function($, undefined) { - -var backCompat = $.uiBackCompat !== false, - // prefix used for storing data on .data() - dataSpace = "ui-effects-"; - -$.effects = { - effect: {} -}; - -/*! - * jQuery Color Animations v2.0.0 - * http://jquery.com/ - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * Date: Mon Aug 13 13:41:02 2012 -0500 - */ -(function( jQuery, undefined ) { - - var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "), - - // plusequals test for += 100 -= 100 - rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, - // a set of RE's that can match strings and generate color tuples. - stringParsers = [{ - re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, - parse: function( execResult ) { - return [ - execResult[ 1 ], - execResult[ 2 ], - execResult[ 3 ], - execResult[ 4 ] - ]; - } - }, { - re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, - parse: function( execResult ) { - return [ - execResult[ 1 ] * 2.55, - execResult[ 2 ] * 2.55, - execResult[ 3 ] * 2.55, - execResult[ 4 ] - ]; - } - }, { - // this regex ignores A-F because it's compared against an already lowercased string - re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, - parse: function( execResult ) { - return [ - parseInt( execResult[ 1 ], 16 ), - parseInt( execResult[ 2 ], 16 ), - parseInt( execResult[ 3 ], 16 ) - ]; - } - }, { - // this regex ignores A-F because it's compared against an already lowercased string - re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, - parse: function( execResult ) { - return [ - parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), - parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), - parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) - ]; - } - }, { - re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, - space: "hsla", - parse: function( execResult ) { - return [ - execResult[ 1 ], - execResult[ 2 ] / 100, - execResult[ 3 ] / 100, - execResult[ 4 ] - ]; - } - }], - - // jQuery.Color( ) - color = jQuery.Color = function( color, green, blue, alpha ) { - return new jQuery.Color.fn.parse( color, green, blue, alpha ); - }, - spaces = { - rgba: { - props: { - red: { - idx: 0, - type: "byte" - }, - green: { - idx: 1, - type: "byte" - }, - blue: { - idx: 2, - type: "byte" - } - } - }, - - hsla: { - props: { - hue: { - idx: 0, - type: "degrees" - }, - saturation: { - idx: 1, - type: "percent" - }, - lightness: { - idx: 2, - type: "percent" - } - } - } - }, - propTypes = { - "byte": { - floor: true, - max: 255 - }, - "percent": { - max: 1 - }, - "degrees": { - mod: 360, - floor: true - } - }, - support = color.support = {}, - - // element for support tests - supportElem = jQuery( "

        " )[ 0 ], - - // colors = jQuery.Color.names - colors, - - // local aliases of functions called often - each = jQuery.each; - -// determine rgba support immediately -supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; -support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; - -// define cache name and alpha properties -// for rgba and hsla spaces -each( spaces, function( spaceName, space ) { - space.cache = "_" + spaceName; - space.props.alpha = { - idx: 3, - type: "percent", - def: 1 - }; -}); - -function clamp( value, prop, allowEmpty ) { - var type = propTypes[ prop.type ] || {}; - - if ( value == null ) { - return (allowEmpty || !prop.def) ? null : prop.def; - } - - // ~~ is an short way of doing floor for positive numbers - value = type.floor ? ~~value : parseFloat( value ); - - // IE will pass in empty strings as value for alpha, - // which will hit this case - if ( isNaN( value ) ) { - return prop.def; - } - - if ( type.mod ) { - // we add mod before modding to make sure that negatives values - // get converted properly: -10 -> 350 - return (value + type.mod) % type.mod; - } - - // for now all property types without mod have min and max - return 0 > value ? 0 : type.max < value ? type.max : value; -} - -function stringParse( string ) { - var inst = color(), - rgba = inst._rgba = []; - - string = string.toLowerCase(); - - each( stringParsers, function( i, parser ) { - var parsed, - match = parser.re.exec( string ), - values = match && parser.parse( match ), - spaceName = parser.space || "rgba"; - - if ( values ) { - parsed = inst[ spaceName ]( values ); - - // if this was an rgba parse the assignment might happen twice - // oh well.... - inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; - rgba = inst._rgba = parsed._rgba; - - // exit each( stringParsers ) here because we matched - return false; - } - }); - - // Found a stringParser that handled it - if ( rgba.length ) { - - // if this came from a parsed string, force "transparent" when alpha is 0 - // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) - if ( rgba.join() === "0,0,0,0" ) { - jQuery.extend( rgba, colors.transparent ); - } - return inst; - } - - // named colors - return colors[ string ]; -} - -color.fn = jQuery.extend( color.prototype, { - parse: function( red, green, blue, alpha ) { - if ( red === undefined ) { - this._rgba = [ null, null, null, null ]; - return this; - } - if ( red.jquery || red.nodeType ) { - red = jQuery( red ).css( green ); - green = undefined; - } - - var inst = this, - type = jQuery.type( red ), - rgba = this._rgba = []; - - // more than 1 argument specified - assume ( red, green, blue, alpha ) - if ( green !== undefined ) { - red = [ red, green, blue, alpha ]; - type = "array"; - } - - if ( type === "string" ) { - return this.parse( stringParse( red ) || colors._default ); - } - - if ( type === "array" ) { - each( spaces.rgba.props, function( key, prop ) { - rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); - }); - return this; - } - - if ( type === "object" ) { - if ( red instanceof color ) { - each( spaces, function( spaceName, space ) { - if ( red[ space.cache ] ) { - inst[ space.cache ] = red[ space.cache ].slice(); - } - }); - } else { - each( spaces, function( spaceName, space ) { - var cache = space.cache; - each( space.props, function( key, prop ) { - - // if the cache doesn't exist, and we know how to convert - if ( !inst[ cache ] && space.to ) { - - // if the value was null, we don't need to copy it - // if the key was alpha, we don't need to copy it either - if ( key === "alpha" || red[ key ] == null ) { - return; - } - inst[ cache ] = space.to( inst._rgba ); - } - - // this is the only case where we allow nulls for ALL properties. - // call clamp with alwaysAllowEmpty - inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); - }); - - // everything defined but alpha? - if ( inst[ cache ] && $.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { - // use the default of 1 - inst[ cache ][ 3 ] = 1; - if ( space.from ) { - inst._rgba = space.from( inst[ cache ] ); - } - } - }); - } - return this; - } - }, - is: function( compare ) { - var is = color( compare ), - same = true, - inst = this; - - each( spaces, function( _, space ) { - var localCache, - isCache = is[ space.cache ]; - if (isCache) { - localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; - each( space.props, function( _, prop ) { - if ( isCache[ prop.idx ] != null ) { - same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); - return same; - } - }); - } - return same; - }); - return same; - }, - _space: function() { - var used = [], - inst = this; - each( spaces, function( spaceName, space ) { - if ( inst[ space.cache ] ) { - used.push( spaceName ); - } - }); - return used.pop(); - }, - transition: function( other, distance ) { - var end = color( other ), - spaceName = end._space(), - space = spaces[ spaceName ], - startColor = this.alpha() === 0 ? color( "transparent" ) : this, - start = startColor[ space.cache ] || space.to( startColor._rgba ), - result = start.slice(); - - end = end[ space.cache ]; - each( space.props, function( key, prop ) { - var index = prop.idx, - startValue = start[ index ], - endValue = end[ index ], - type = propTypes[ prop.type ] || {}; - - // if null, don't override start value - if ( endValue === null ) { - return; - } - // if null - use end - if ( startValue === null ) { - result[ index ] = endValue; - } else { - if ( type.mod ) { - if ( endValue - startValue > type.mod / 2 ) { - startValue += type.mod; - } else if ( startValue - endValue > type.mod / 2 ) { - startValue -= type.mod; - } - } - result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); - } - }); - return this[ spaceName ]( result ); - }, - blend: function( opaque ) { - // if we are already opaque - return ourself - if ( this._rgba[ 3 ] === 1 ) { - return this; - } - - var rgb = this._rgba.slice(), - a = rgb.pop(), - blend = color( opaque )._rgba; - - return color( jQuery.map( rgb, function( v, i ) { - return ( 1 - a ) * blend[ i ] + a * v; - })); - }, - toRgbaString: function() { - var prefix = "rgba(", - rgba = jQuery.map( this._rgba, function( v, i ) { - return v == null ? ( i > 2 ? 1 : 0 ) : v; - }); - - if ( rgba[ 3 ] === 1 ) { - rgba.pop(); - prefix = "rgb("; - } - - return prefix + rgba.join() + ")"; - }, - toHslaString: function() { - var prefix = "hsla(", - hsla = jQuery.map( this.hsla(), function( v, i ) { - if ( v == null ) { - v = i > 2 ? 1 : 0; - } - - // catch 1 and 2 - if ( i && i < 3 ) { - v = Math.round( v * 100 ) + "%"; - } - return v; - }); - - if ( hsla[ 3 ] === 1 ) { - hsla.pop(); - prefix = "hsl("; - } - return prefix + hsla.join() + ")"; - }, - toHexString: function( includeAlpha ) { - var rgba = this._rgba.slice(), - alpha = rgba.pop(); - - if ( includeAlpha ) { - rgba.push( ~~( alpha * 255 ) ); - } - - return "#" + jQuery.map( rgba, function( v ) { - - // default to 0 when nulls exist - v = ( v || 0 ).toString( 16 ); - return v.length === 1 ? "0" + v : v; - }).join(""); - }, - toString: function() { - return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); - } -}); -color.fn.parse.prototype = color.fn; - -// hsla conversions adapted from: -// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 - -function hue2rgb( p, q, h ) { - h = ( h + 1 ) % 1; - if ( h * 6 < 1 ) { - return p + (q - p) * h * 6; - } - if ( h * 2 < 1) { - return q; - } - if ( h * 3 < 2 ) { - return p + (q - p) * ((2/3) - h) * 6; - } - return p; -} - -spaces.hsla.to = function ( rgba ) { - if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { - return [ null, null, null, rgba[ 3 ] ]; - } - var r = rgba[ 0 ] / 255, - g = rgba[ 1 ] / 255, - b = rgba[ 2 ] / 255, - a = rgba[ 3 ], - max = Math.max( r, g, b ), - min = Math.min( r, g, b ), - diff = max - min, - add = max + min, - l = add * 0.5, - h, s; - - if ( min === max ) { - h = 0; - } else if ( r === max ) { - h = ( 60 * ( g - b ) / diff ) + 360; - } else if ( g === max ) { - h = ( 60 * ( b - r ) / diff ) + 120; - } else { - h = ( 60 * ( r - g ) / diff ) + 240; - } - - if ( l === 0 || l === 1 ) { - s = l; - } else if ( l <= 0.5 ) { - s = diff / add; - } else { - s = diff / ( 2 - add ); - } - return [ Math.round(h) % 360, s, l, a == null ? 1 : a ]; -}; - -spaces.hsla.from = function ( hsla ) { - if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { - return [ null, null, null, hsla[ 3 ] ]; - } - var h = hsla[ 0 ] / 360, - s = hsla[ 1 ], - l = hsla[ 2 ], - a = hsla[ 3 ], - q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, - p = 2 * l - q; - - return [ - Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), - Math.round( hue2rgb( p, q, h ) * 255 ), - Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), - a - ]; -}; - - -each( spaces, function( spaceName, space ) { - var props = space.props, - cache = space.cache, - to = space.to, - from = space.from; - - // makes rgba() and hsla() - color.fn[ spaceName ] = function( value ) { - - // generate a cache for this space if it doesn't exist - if ( to && !this[ cache ] ) { - this[ cache ] = to( this._rgba ); - } - if ( value === undefined ) { - return this[ cache ].slice(); - } - - var ret, - type = jQuery.type( value ), - arr = ( type === "array" || type === "object" ) ? value : arguments, - local = this[ cache ].slice(); - - each( props, function( key, prop ) { - var val = arr[ type === "object" ? key : prop.idx ]; - if ( val == null ) { - val = local[ prop.idx ]; - } - local[ prop.idx ] = clamp( val, prop ); - }); - - if ( from ) { - ret = color( from( local ) ); - ret[ cache ] = local; - return ret; - } else { - return color( local ); - } - }; - - // makes red() green() blue() alpha() hue() saturation() lightness() - each( props, function( key, prop ) { - // alpha is included in more than one space - if ( color.fn[ key ] ) { - return; - } - color.fn[ key ] = function( value ) { - var vtype = jQuery.type( value ), - fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ), - local = this[ fn ](), - cur = local[ prop.idx ], - match; - - if ( vtype === "undefined" ) { - return cur; - } - - if ( vtype === "function" ) { - value = value.call( this, cur ); - vtype = jQuery.type( value ); - } - if ( value == null && prop.empty ) { - return this; - } - if ( vtype === "string" ) { - match = rplusequals.exec( value ); - if ( match ) { - value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); - } - } - local[ prop.idx ] = value; - return this[ fn ]( local ); - }; - }); -}); - -// add .fx.step functions -each( stepHooks, function( i, hook ) { - jQuery.cssHooks[ hook ] = { - set: function( elem, value ) { - var parsed, curElem, - backgroundColor = ""; - - if ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) { - value = color( parsed || value ); - if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { - curElem = hook === "backgroundColor" ? elem.parentNode : elem; - while ( - (backgroundColor === "" || backgroundColor === "transparent") && - curElem && curElem.style - ) { - try { - backgroundColor = jQuery.css( curElem, "backgroundColor" ); - curElem = curElem.parentNode; - } catch ( e ) { - } - } - - value = value.blend( backgroundColor && backgroundColor !== "transparent" ? - backgroundColor : - "_default" ); - } - - value = value.toRgbaString(); - } - try { - elem.style[ hook ] = value; - } catch( error ) { - // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' - } - } - }; - jQuery.fx.step[ hook ] = function( fx ) { - if ( !fx.colorInit ) { - fx.start = color( fx.elem, hook ); - fx.end = color( fx.end ); - fx.colorInit = true; - } - jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); - }; -}); - -jQuery.cssHooks.borderColor = { - expand: function( value ) { - var expanded = {}; - - each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { - expanded[ "border" + part + "Color" ] = value; - }); - return expanded; - } -}; - -// Basic color names only. -// Usage of any of the other color names requires adding yourself or including -// jquery.color.svg-names.js. -colors = jQuery.Color.names = { - // 4.1. Basic color keywords - aqua: "#00ffff", - black: "#000000", - blue: "#0000ff", - fuchsia: "#ff00ff", - gray: "#808080", - green: "#008000", - lime: "#00ff00", - maroon: "#800000", - navy: "#000080", - olive: "#808000", - purple: "#800080", - red: "#ff0000", - silver: "#c0c0c0", - teal: "#008080", - white: "#ffffff", - yellow: "#ffff00", - - // 4.2.3. "transparent" color keyword - transparent: [ null, null, null, 0 ], - - _default: "#ffffff" -}; - -})( jQuery ); - - - -/******************************************************************************/ -/****************************** CLASS ANIMATIONS ******************************/ -/******************************************************************************/ -(function() { - -var classAnimationActions = [ "add", "remove", "toggle" ], - shorthandStyles = { - border: 1, - borderBottom: 1, - borderColor: 1, - borderLeft: 1, - borderRight: 1, - borderTop: 1, - borderWidth: 1, - margin: 1, - padding: 1 - }; - -$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) { - $.fx.step[ prop ] = function( fx ) { - if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { - jQuery.style( fx.elem, prop, fx.end ); - fx.setAttr = true; - } - }; -}); - -function getElementStyles() { - var style = this.ownerDocument.defaultView ? - this.ownerDocument.defaultView.getComputedStyle( this, null ) : - this.currentStyle, - newStyle = {}, - key, - len; - - // webkit enumerates style porperties - if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { - len = style.length; - while ( len-- ) { - key = style[ len ]; - if ( typeof style[ key ] === "string" ) { - newStyle[ $.camelCase( key ) ] = style[ key ]; - } - } - } else { - for ( key in style ) { - if ( typeof style[ key ] === "string" ) { - newStyle[ key ] = style[ key ]; - } - } - } - - return newStyle; -} - - -function styleDifference( oldStyle, newStyle ) { - var diff = {}, - name, value; - - for ( name in newStyle ) { - value = newStyle[ name ]; - if ( oldStyle[ name ] !== value ) { - if ( !shorthandStyles[ name ] ) { - if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { - diff[ name ] = value; - } - } - } - } - - return diff; -} - -$.effects.animateClass = function( value, duration, easing, callback ) { - var o = $.speed( duration, easing, callback ); - - return this.queue( function() { - var animated = $( this ), - baseClass = animated.attr( "class" ) || "", - applyClassChange, - allAnimations = o.children ? animated.find( "*" ).andSelf() : animated; - - // map the animated objects to store the original styles. - allAnimations = allAnimations.map(function() { - var el = $( this ); - return { - el: el, - start: getElementStyles.call( this ) - }; - }); - - // apply class change - applyClassChange = function() { - $.each( classAnimationActions, function(i, action) { - if ( value[ action ] ) { - animated[ action + "Class" ]( value[ action ] ); - } - }); - }; - applyClassChange(); - - // map all animated objects again - calculate new styles and diff - allAnimations = allAnimations.map(function() { - this.end = getElementStyles.call( this.el[ 0 ] ); - this.diff = styleDifference( this.start, this.end ); - return this; - }); - - // apply original class - animated.attr( "class", baseClass ); - - // map all animated objects again - this time collecting a promise - allAnimations = allAnimations.map(function() { - var styleInfo = this, - dfd = $.Deferred(), - opts = jQuery.extend({}, o, { - queue: false, - complete: function() { - dfd.resolve( styleInfo ); - } - }); - - this.el.animate( this.diff, opts ); - return dfd.promise(); - }); - - // once all animations have completed: - $.when.apply( $, allAnimations.get() ).done(function() { - - // set the final class - applyClassChange(); - - // for each animated element, - // clear all css properties that were animated - $.each( arguments, function() { - var el = this.el; - $.each( this.diff, function(key) { - el.css( key, '' ); - }); - }); - - // this is guarnteed to be there if you use jQuery.speed() - // it also handles dequeuing the next anim... - o.complete.call( animated[ 0 ] ); - }); - }); -}; - -$.fn.extend({ - _addClass: $.fn.addClass, - addClass: function( classNames, speed, easing, callback ) { - return speed ? - $.effects.animateClass.call( this, - { add: classNames }, speed, easing, callback ) : - this._addClass( classNames ); - }, - - _removeClass: $.fn.removeClass, - removeClass: function( classNames, speed, easing, callback ) { - return speed ? - $.effects.animateClass.call( this, - { remove: classNames }, speed, easing, callback ) : - this._removeClass( classNames ); - }, - - _toggleClass: $.fn.toggleClass, - toggleClass: function( classNames, force, speed, easing, callback ) { - if ( typeof force === "boolean" || force === undefined ) { - if ( !speed ) { - // without speed parameter - return this._toggleClass( classNames, force ); - } else { - return $.effects.animateClass.call( this, - (force ? { add: classNames } : { remove: classNames }), - speed, easing, callback ); - } - } else { - // without force parameter - return $.effects.animateClass.call( this, - { toggle: classNames }, force, speed, easing ); - } - }, - - switchClass: function( remove, add, speed, easing, callback) { - return $.effects.animateClass.call( this, { - add: add, - remove: remove - }, speed, easing, callback ); - } -}); - -})(); - -/******************************************************************************/ -/*********************************** EFFECTS **********************************/ -/******************************************************************************/ - -(function() { - -$.extend( $.effects, { - version: "1.9.2", - - // Saves a set of properties in a data storage - save: function( element, set ) { - for( var i=0; i < set.length; i++ ) { - if ( set[ i ] !== null ) { - element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); - } - } - }, - - // Restores a set of previously saved properties from a data storage - restore: function( element, set ) { - var val, i; - for( i=0; i < set.length; i++ ) { - if ( set[ i ] !== null ) { - val = element.data( dataSpace + set[ i ] ); - // support: jQuery 1.6.2 - // http://bugs.jquery.com/ticket/9917 - // jQuery 1.6.2 incorrectly returns undefined for any falsy value. - // We can't differentiate between "" and 0 here, so we just assume - // empty string since it's likely to be a more common value... - if ( val === undefined ) { - val = ""; - } - element.css( set[ i ], val ); - } - } - }, - - setMode: function( el, mode ) { - if (mode === "toggle") { - mode = el.is( ":hidden" ) ? "show" : "hide"; - } - return mode; - }, - - // Translates a [top,left] array into a baseline value - // this should be a little more flexible in the future to handle a string & hash - getBaseline: function( origin, original ) { - var y, x; - switch ( origin[ 0 ] ) { - case "top": y = 0; break; - case "middle": y = 0.5; break; - case "bottom": y = 1; break; - default: y = origin[ 0 ] / original.height; - } - switch ( origin[ 1 ] ) { - case "left": x = 0; break; - case "center": x = 0.5; break; - case "right": x = 1; break; - default: x = origin[ 1 ] / original.width; - } - return { - x: x, - y: y - }; - }, - - // Wraps the element around a wrapper that copies position properties - createWrapper: function( element ) { - - // if the element is already wrapped, return it - if ( element.parent().is( ".ui-effects-wrapper" )) { - return element.parent(); - } - - // wrap the element - var props = { - width: element.outerWidth(true), - height: element.outerHeight(true), - "float": element.css( "float" ) - }, - wrapper = $( "

        " ) - .addClass( "ui-effects-wrapper" ) - .css({ - fontSize: "100%", - background: "transparent", - border: "none", - margin: 0, - padding: 0 - }), - // Store the size in case width/height are defined in % - Fixes #5245 - size = { - width: element.width(), - height: element.height() - }, - active = document.activeElement; - - // support: Firefox - // Firefox incorrectly exposes anonymous content - // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 - try { - active.id; - } catch( e ) { - active = document.body; - } - - element.wrap( wrapper ); - - // Fixes #7595 - Elements lose focus when wrapped. - if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { - $( active ).focus(); - } - - wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element - - // transfer positioning properties to the wrapper - if ( element.css( "position" ) === "static" ) { - wrapper.css({ position: "relative" }); - element.css({ position: "relative" }); - } else { - $.extend( props, { - position: element.css( "position" ), - zIndex: element.css( "z-index" ) - }); - $.each([ "top", "left", "bottom", "right" ], function(i, pos) { - props[ pos ] = element.css( pos ); - if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { - props[ pos ] = "auto"; - } - }); - element.css({ - position: "relative", - top: 0, - left: 0, - right: "auto", - bottom: "auto" - }); - } - element.css(size); - - return wrapper.css( props ).show(); - }, - - removeWrapper: function( element ) { - var active = document.activeElement; - - if ( element.parent().is( ".ui-effects-wrapper" ) ) { - element.parent().replaceWith( element ); - - // Fixes #7595 - Elements lose focus when wrapped. - if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { - $( active ).focus(); - } - } - - - return element; - }, - - setTransition: function( element, list, factor, value ) { - value = value || {}; - $.each( list, function( i, x ) { - var unit = element.cssUnit( x ); - if ( unit[ 0 ] > 0 ) { - value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; - } - }); - return value; - } -}); - -// return an effect options object for the given parameters: -function _normalizeArguments( effect, options, speed, callback ) { - - // allow passing all options as the first parameter - if ( $.isPlainObject( effect ) ) { - options = effect; - effect = effect.effect; - } - - // convert to an object - effect = { effect: effect }; - - // catch (effect, null, ...) - if ( options == null ) { - options = {}; - } - - // catch (effect, callback) - if ( $.isFunction( options ) ) { - callback = options; - speed = null; - options = {}; - } - - // catch (effect, speed, ?) - if ( typeof options === "number" || $.fx.speeds[ options ] ) { - callback = speed; - speed = options; - options = {}; - } - - // catch (effect, options, callback) - if ( $.isFunction( speed ) ) { - callback = speed; - speed = null; - } - - // add options to effect - if ( options ) { - $.extend( effect, options ); - } - - speed = speed || options.duration; - effect.duration = $.fx.off ? 0 : - typeof speed === "number" ? speed : - speed in $.fx.speeds ? $.fx.speeds[ speed ] : - $.fx.speeds._default; - - effect.complete = callback || options.complete; - - return effect; -} - -function standardSpeed( speed ) { - // valid standard speeds - if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { - return true; - } - - // invalid strings - treat as "normal" speed - if ( typeof speed === "string" && !$.effects.effect[ speed ] ) { - // TODO: remove in 2.0 (#7115) - if ( backCompat && $.effects[ speed ] ) { - return false; - } - return true; - } - - return false; -} - -$.fn.extend({ - effect: function( /* effect, options, speed, callback */ ) { - var args = _normalizeArguments.apply( this, arguments ), - mode = args.mode, - queue = args.queue, - effectMethod = $.effects.effect[ args.effect ], - - // DEPRECATED: remove in 2.0 (#7115) - oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ]; - - if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) { - // delegate to the original method (e.g., .show()) if possible - if ( mode ) { - return this[ mode ]( args.duration, args.complete ); - } else { - return this.each( function() { - if ( args.complete ) { - args.complete.call( this ); - } - }); - } - } - - function run( next ) { - var elem = $( this ), - complete = args.complete, - mode = args.mode; - - function done() { - if ( $.isFunction( complete ) ) { - complete.call( elem[0] ); - } - if ( $.isFunction( next ) ) { - next(); - } - } - - // if the element is hiddden and mode is hide, - // or element is visible and mode is show - if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { - done(); - } else { - effectMethod.call( elem[0], args, done ); - } - } - - // TODO: remove this check in 2.0, effectMethod will always be true - if ( effectMethod ) { - return queue === false ? this.each( run ) : this.queue( queue || "fx", run ); - } else { - // DEPRECATED: remove in 2.0 (#7115) - return oldEffectMethod.call(this, { - options: args, - duration: args.duration, - callback: args.complete, - mode: args.mode - }); - } - }, - - _show: $.fn.show, - show: function( speed ) { - if ( standardSpeed( speed ) ) { - return this._show.apply( this, arguments ); - } else { - var args = _normalizeArguments.apply( this, arguments ); - args.mode = "show"; - return this.effect.call( this, args ); - } - }, - - _hide: $.fn.hide, - hide: function( speed ) { - if ( standardSpeed( speed ) ) { - return this._hide.apply( this, arguments ); - } else { - var args = _normalizeArguments.apply( this, arguments ); - args.mode = "hide"; - return this.effect.call( this, args ); - } - }, - - // jQuery core overloads toggle and creates _toggle - __toggle: $.fn.toggle, - toggle: function( speed ) { - if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { - return this.__toggle.apply( this, arguments ); - } else { - var args = _normalizeArguments.apply( this, arguments ); - args.mode = "toggle"; - return this.effect.call( this, args ); - } - }, - - // helper functions - cssUnit: function(key) { - var style = this.css( key ), - val = []; - - $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { - if ( style.indexOf( unit ) > 0 ) { - val = [ parseFloat( style ), unit ]; - } - }); - return val; - } -}); - -})(); - -/******************************************************************************/ -/*********************************** EASING ***********************************/ -/******************************************************************************/ - -(function() { - -// based on easing equations from Robert Penner (http://www.robertpenner.com/easing) - -var baseEasings = {}; - -$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { - baseEasings[ name ] = function( p ) { - return Math.pow( p, i + 2 ); - }; -}); - -$.extend( baseEasings, { - Sine: function ( p ) { - return 1 - Math.cos( p * Math.PI / 2 ); - }, - Circ: function ( p ) { - return 1 - Math.sqrt( 1 - p * p ); - }, - Elastic: function( p ) { - return p === 0 || p === 1 ? p : - -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 ); - }, - Back: function( p ) { - return p * p * ( 3 * p - 2 ); - }, - Bounce: function ( p ) { - var pow2, - bounce = 4; - - while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} - return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); - } -}); - -$.each( baseEasings, function( name, easeIn ) { - $.easing[ "easeIn" + name ] = easeIn; - $.easing[ "easeOut" + name ] = function( p ) { - return 1 - easeIn( 1 - p ); - }; - $.easing[ "easeInOut" + name ] = function( p ) { - return p < 0.5 ? - easeIn( p * 2 ) / 2 : - 1 - easeIn( p * -2 + 2 ) / 2; - }; -}); - -})(); - -})(jQuery)); -(function( $, undefined ) { - -var rvertical = /up|down|vertical/, - rpositivemotion = /up|left|vertical|horizontal/; - -$.effects.effect.blind = function( o, done ) { - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "hide" ), - direction = o.direction || "up", - vertical = rvertical.test( direction ), - ref = vertical ? "height" : "width", - ref2 = vertical ? "top" : "left", - motion = rpositivemotion.test( direction ), - animation = {}, - show = mode === "show", - wrapper, distance, margin; - - // if already wrapped, the wrapper's properties are my property. #6245 - if ( el.parent().is( ".ui-effects-wrapper" ) ) { - $.effects.save( el.parent(), props ); - } else { - $.effects.save( el, props ); - } - el.show(); - wrapper = $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - - distance = wrapper[ ref ](); - margin = parseFloat( wrapper.css( ref2 ) ) || 0; - - animation[ ref ] = show ? distance : 0; - if ( !motion ) { - el - .css( vertical ? "bottom" : "right", 0 ) - .css( vertical ? "top" : "left", "auto" ) - .css({ position: "absolute" }); - - animation[ ref2 ] = show ? margin : distance + margin; - } - - // start at 0 if we are showing - if ( show ) { - wrapper.css( ref, 0 ); - if ( ! motion ) { - wrapper.css( ref2, margin + distance ); - } - } - - // Animate - wrapper.animate( animation, { - duration: o.duration, - easing: o.easing, - queue: false, - complete: function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - } - }); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.bounce = function( o, done ) { - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - - // defaults: - mode = $.effects.setMode( el, o.mode || "effect" ), - hide = mode === "hide", - show = mode === "show", - direction = o.direction || "up", - distance = o.distance, - times = o.times || 5, - - // number of internal animations - anims = times * 2 + ( show || hide ? 1 : 0 ), - speed = o.duration / anims, - easing = o.easing, - - // utility: - ref = ( direction === "up" || direction === "down" ) ? "top" : "left", - motion = ( direction === "up" || direction === "left" ), - i, - upAnim, - downAnim, - - // we will need to re-assemble the queue to stack our animations in place - queue = el.queue(), - queuelen = queue.length; - - // Avoid touching opacity to prevent clearType and PNG issues in IE - if ( show || hide ) { - props.push( "opacity" ); - } - - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); // Create Wrapper - - // default distance for the BIGGEST bounce is the outer Distance / 3 - if ( !distance ) { - distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; - } - - if ( show ) { - downAnim = { opacity: 1 }; - downAnim[ ref ] = 0; - - // if we are showing, force opacity 0 and set the initial position - // then do the "first" animation - el.css( "opacity", 0 ) - .css( ref, motion ? -distance * 2 : distance * 2 ) - .animate( downAnim, speed, easing ); - } - - // start at the smallest distance if we are hiding - if ( hide ) { - distance = distance / Math.pow( 2, times - 1 ); - } - - downAnim = {}; - downAnim[ ref ] = 0; - // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here - for ( i = 0; i < times; i++ ) { - upAnim = {}; - upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; - - el.animate( upAnim, speed, easing ) - .animate( downAnim, speed, easing ); - - distance = hide ? distance * 2 : distance / 2; - } - - // Last Bounce when Hiding - if ( hide ) { - upAnim = { opacity: 0 }; - upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; - - el.animate( upAnim, speed, easing ); - } - - el.queue(function() { - if ( hide ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - - // inject all the animations we just queued to be first in line (after "inprogress") - if ( queuelen > 1) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - el.dequeue(); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.clip = function( o, done ) { - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - direction = o.direction || "vertical", - vert = direction === "vertical", - size = vert ? "height" : "width", - position = vert ? "top" : "left", - animation = {}, - wrapper, animate, distance; - - // Save & Show - $.effects.save( el, props ); - el.show(); - - // Create Wrapper - wrapper = $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - animate = ( el[0].tagName === "IMG" ) ? wrapper : el; - distance = animate[ size ](); - - // Shift - if ( show ) { - animate.css( size, 0 ); - animate.css( position, distance / 2 ); - } - - // Create Animation Object: - animation[ size ] = show ? distance : 0; - animation[ position ] = show ? 0 : distance / 2; - - // Animate - animate.animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( !show ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - } - }); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.drop = function( o, done ) { - - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - direction = o.direction || "left", - ref = ( direction === "up" || direction === "down" ) ? "top" : "left", - motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg", - animation = { - opacity: show ? 1 : 0 - }, - distance; - - // Adjust - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); - - distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2; - - if ( show ) { - el - .css( "opacity", 0 ) - .css( ref, motion === "pos" ? -distance : distance ); - } - - // Animation - animation[ ref ] = ( show ? - ( motion === "pos" ? "+=" : "-=" ) : - ( motion === "pos" ? "-=" : "+=" ) ) + - distance; - - // Animate - el.animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - } - }); -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.explode = function( o, done ) { - - var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3, - cells = rows, - el = $( this ), - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - - // show and then visibility:hidden the element before calculating offset - offset = el.show().css( "visibility", "hidden" ).offset(), - - // width and height of a piece - width = Math.ceil( el.outerWidth() / cells ), - height = Math.ceil( el.outerHeight() / rows ), - pieces = [], - - // loop - i, j, left, top, mx, my; - - // children animate complete: - function childComplete() { - pieces.push( this ); - if ( pieces.length === rows * cells ) { - animComplete(); - } - } - - // clone the element for each row and cell. - for( i = 0; i < rows ; i++ ) { // ===> - top = offset.top + i * height; - my = i - ( rows - 1 ) / 2 ; - - for( j = 0; j < cells ; j++ ) { // ||| - left = offset.left + j * width; - mx = j - ( cells - 1 ) / 2 ; - - // Create a clone of the now hidden main element that will be absolute positioned - // within a wrapper div off the -left and -top equal to size of our pieces - el - .clone() - .appendTo( "body" ) - .wrap( "
        " ) - .css({ - position: "absolute", - visibility: "visible", - left: -j * width, - top: -i * height - }) - - // select the wrapper - make it overflow: hidden and absolute positioned based on - // where the original was located +left and +top equal to the size of pieces - .parent() - .addClass( "ui-effects-explode" ) - .css({ - position: "absolute", - overflow: "hidden", - width: width, - height: height, - left: left + ( show ? mx * width : 0 ), - top: top + ( show ? my * height : 0 ), - opacity: show ? 0 : 1 - }).animate({ - left: left + ( show ? 0 : mx * width ), - top: top + ( show ? 0 : my * height ), - opacity: show ? 1 : 0 - }, o.duration || 500, o.easing, childComplete ); - } - } - - function animComplete() { - el.css({ - visibility: "visible" - }); - $( pieces ).remove(); - if ( !show ) { - el.hide(); - } - done(); - } -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.fade = function( o, done ) { - var el = $( this ), - mode = $.effects.setMode( el, o.mode || "toggle" ); - - el.animate({ - opacity: mode - }, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: done - }); -}; - -})( jQuery ); -(function( $, undefined ) { - -$.effects.effect.fold = function( o, done ) { - - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - hide = mode === "hide", - size = o.size || 15, - percent = /([0-9]+)%/.exec( size ), - horizFirst = !!o.horizFirst, - widthFirst = show !== horizFirst, - ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ], - duration = o.duration / 2, - wrapper, distance, - animation1 = {}, - animation2 = {}; - - $.effects.save( el, props ); - el.show(); - - // Create Wrapper - wrapper = $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - distance = widthFirst ? - [ wrapper.width(), wrapper.height() ] : - [ wrapper.height(), wrapper.width() ]; - - if ( percent ) { - size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; - } - if ( show ) { - wrapper.css( horizFirst ? { - height: 0, - width: size - } : { - height: size, - width: 0 - }); - } - - // Animation - animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size; - animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0; - - // Animate - wrapper - .animate( animation1, duration, o.easing ) - .animate( animation2, duration, o.easing, function() { - if ( hide ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.highlight = function( o, done ) { - var elem = $( this ), - props = [ "backgroundImage", "backgroundColor", "opacity" ], - mode = $.effects.setMode( elem, o.mode || "show" ), - animation = { - backgroundColor: elem.css( "backgroundColor" ) - }; - - if (mode === "hide") { - animation.opacity = 0; - } - - $.effects.save( elem, props ); - - elem - .show() - .css({ - backgroundImage: "none", - backgroundColor: o.color || "#ffff99" - }) - .animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( mode === "hide" ) { - elem.hide(); - } - $.effects.restore( elem, props ); - done(); - } - }); -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.pulsate = function( o, done ) { - var elem = $( this ), - mode = $.effects.setMode( elem, o.mode || "show" ), - show = mode === "show", - hide = mode === "hide", - showhide = ( show || mode === "hide" ), - - // showing or hiding leaves of the "last" animation - anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), - duration = o.duration / anims, - animateTo = 0, - queue = elem.queue(), - queuelen = queue.length, - i; - - if ( show || !elem.is(":visible")) { - elem.css( "opacity", 0 ).show(); - animateTo = 1; - } - - // anims - 1 opacity "toggles" - for ( i = 1; i < anims; i++ ) { - elem.animate({ - opacity: animateTo - }, duration, o.easing ); - animateTo = 1 - animateTo; - } - - elem.animate({ - opacity: animateTo - }, duration, o.easing); - - elem.queue(function() { - if ( hide ) { - elem.hide(); - } - done(); - }); - - // We just queued up "anims" animations, we need to put them next in the queue - if ( queuelen > 1 ) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - elem.dequeue(); -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.puff = function( o, done ) { - var elem = $( this ), - mode = $.effects.setMode( elem, o.mode || "hide" ), - hide = mode === "hide", - percent = parseInt( o.percent, 10 ) || 150, - factor = percent / 100, - original = { - height: elem.height(), - width: elem.width(), - outerHeight: elem.outerHeight(), - outerWidth: elem.outerWidth() - }; - - $.extend( o, { - effect: "scale", - queue: false, - fade: true, - mode: mode, - complete: done, - percent: hide ? percent : 100, - from: hide ? - original : - { - height: original.height * factor, - width: original.width * factor, - outerHeight: original.outerHeight * factor, - outerWidth: original.outerWidth * factor - } - }); - - elem.effect( o ); -}; - -$.effects.effect.scale = function( o, done ) { - - // Create element - var el = $( this ), - options = $.extend( true, {}, o ), - mode = $.effects.setMode( el, o.mode || "effect" ), - percent = parseInt( o.percent, 10 ) || - ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ), - direction = o.direction || "both", - origin = o.origin, - original = { - height: el.height(), - width: el.width(), - outerHeight: el.outerHeight(), - outerWidth: el.outerWidth() - }, - factor = { - y: direction !== "horizontal" ? (percent / 100) : 1, - x: direction !== "vertical" ? (percent / 100) : 1 - }; - - // We are going to pass this effect to the size effect: - options.effect = "size"; - options.queue = false; - options.complete = done; - - // Set default origin and restore for show/hide - if ( mode !== "effect" ) { - options.origin = origin || ["middle","center"]; - options.restore = true; - } - - options.from = o.from || ( mode === "show" ? { - height: 0, - width: 0, - outerHeight: 0, - outerWidth: 0 - } : original ); - options.to = { - height: original.height * factor.y, - width: original.width * factor.x, - outerHeight: original.outerHeight * factor.y, - outerWidth: original.outerWidth * factor.x - }; - - // Fade option to support puff - if ( options.fade ) { - if ( mode === "show" ) { - options.from.opacity = 0; - options.to.opacity = 1; - } - if ( mode === "hide" ) { - options.from.opacity = 1; - options.to.opacity = 0; - } - } - - // Animate - el.effect( options ); - -}; - -$.effects.effect.size = function( o, done ) { - - // Create element - var original, baseline, factor, - el = $( this ), - props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ], - - // Always restore - props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ], - - // Copy for children - props2 = [ "width", "height", "overflow" ], - cProps = [ "fontSize" ], - vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ], - hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ], - - // Set options - mode = $.effects.setMode( el, o.mode || "effect" ), - restore = o.restore || mode !== "effect", - scale = o.scale || "both", - origin = o.origin || [ "middle", "center" ], - position = el.css( "position" ), - props = restore ? props0 : props1, - zero = { - height: 0, - width: 0, - outerHeight: 0, - outerWidth: 0 - }; - - if ( mode === "show" ) { - el.show(); - } - original = { - height: el.height(), - width: el.width(), - outerHeight: el.outerHeight(), - outerWidth: el.outerWidth() - }; - - if ( o.mode === "toggle" && mode === "show" ) { - el.from = o.to || zero; - el.to = o.from || original; - } else { - el.from = o.from || ( mode === "show" ? zero : original ); - el.to = o.to || ( mode === "hide" ? zero : original ); - } - - // Set scaling factor - factor = { - from: { - y: el.from.height / original.height, - x: el.from.width / original.width - }, - to: { - y: el.to.height / original.height, - x: el.to.width / original.width - } - }; - - // Scale the css box - if ( scale === "box" || scale === "both" ) { - - // Vertical props scaling - if ( factor.from.y !== factor.to.y ) { - props = props.concat( vProps ); - el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from ); - el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to ); - } - - // Horizontal props scaling - if ( factor.from.x !== factor.to.x ) { - props = props.concat( hProps ); - el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from ); - el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to ); - } - } - - // Scale the content - if ( scale === "content" || scale === "both" ) { - - // Vertical props scaling - if ( factor.from.y !== factor.to.y ) { - props = props.concat( cProps ).concat( props2 ); - el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from ); - el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to ); - } - } - - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); - el.css( "overflow", "hidden" ).css( el.from ); - - // Adjust - if (origin) { // Calculate baseline shifts - baseline = $.effects.getBaseline( origin, original ); - el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y; - el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x; - el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y; - el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x; - } - el.css( el.from ); // set top & left - - // Animate - if ( scale === "content" || scale === "both" ) { // Scale the children - - // Add margins/font-size - vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps); - hProps = hProps.concat([ "marginLeft", "marginRight" ]); - props2 = props0.concat(vProps).concat(hProps); - - el.find( "*[width]" ).each( function(){ - var child = $( this ), - c_original = { - height: child.height(), - width: child.width(), - outerHeight: child.outerHeight(), - outerWidth: child.outerWidth() - }; - if (restore) { - $.effects.save(child, props2); - } - - child.from = { - height: c_original.height * factor.from.y, - width: c_original.width * factor.from.x, - outerHeight: c_original.outerHeight * factor.from.y, - outerWidth: c_original.outerWidth * factor.from.x - }; - child.to = { - height: c_original.height * factor.to.y, - width: c_original.width * factor.to.x, - outerHeight: c_original.height * factor.to.y, - outerWidth: c_original.width * factor.to.x - }; - - // Vertical props scaling - if ( factor.from.y !== factor.to.y ) { - child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from ); - child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to ); - } - - // Horizontal props scaling - if ( factor.from.x !== factor.to.x ) { - child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from ); - child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to ); - } - - // Animate children - child.css( child.from ); - child.animate( child.to, o.duration, o.easing, function() { - - // Restore children - if ( restore ) { - $.effects.restore( child, props2 ); - } - }); - }); - } - - // Animate - el.animate( el.to, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( el.to.opacity === 0 ) { - el.css( "opacity", el.from.opacity ); - } - if( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - if ( !restore ) { - - // we need to calculate our new positioning based on the scaling - if ( position === "static" ) { - el.css({ - position: "relative", - top: el.to.top, - left: el.to.left - }); - } else { - $.each([ "top", "left" ], function( idx, pos ) { - el.css( pos, function( _, str ) { - var val = parseInt( str, 10 ), - toRef = idx ? el.to.left : el.to.top; - - // if original was "auto", recalculate the new value from wrapper - if ( str === "auto" ) { - return toRef + "px"; - } - - return val + toRef + "px"; - }); - }); - } - } - - $.effects.removeWrapper( el ); - done(); - } - }); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.shake = function( o, done ) { - - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "effect" ), - direction = o.direction || "left", - distance = o.distance || 20, - times = o.times || 3, - anims = times * 2 + 1, - speed = Math.round(o.duration/anims), - ref = (direction === "up" || direction === "down") ? "top" : "left", - positiveMotion = (direction === "up" || direction === "left"), - animation = {}, - animation1 = {}, - animation2 = {}, - i, - - // we will need to re-assemble the queue to stack our animations in place - queue = el.queue(), - queuelen = queue.length; - - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); - - // Animation - animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance; - animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2; - animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2; - - // Animate - el.animate( animation, speed, o.easing ); - - // Shakes - for ( i = 1; i < times; i++ ) { - el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing ); - } - el - .animate( animation1, speed, o.easing ) - .animate( animation, speed / 2, o.easing ) - .queue(function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - - // inject all the animations we just queued to be first in line (after "inprogress") - if ( queuelen > 1) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - el.dequeue(); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.slide = function( o, done ) { - - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "width", "height" ], - mode = $.effects.setMode( el, o.mode || "show" ), - show = mode === "show", - direction = o.direction || "left", - ref = (direction === "up" || direction === "down") ? "top" : "left", - positiveMotion = (direction === "up" || direction === "left"), - distance, - animation = {}; - - // Adjust - $.effects.save( el, props ); - el.show(); - distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ); - - $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - - if ( show ) { - el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance ); - } - - // Animation - animation[ ref ] = ( show ? - ( positiveMotion ? "+=" : "-=") : - ( positiveMotion ? "-=" : "+=")) + - distance; - - // Animate - el.animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - } - }); -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.transfer = function( o, done ) { - var elem = $( this ), - target = $( o.to ), - targetFixed = target.css( "position" ) === "fixed", - body = $("body"), - fixTop = targetFixed ? body.scrollTop() : 0, - fixLeft = targetFixed ? body.scrollLeft() : 0, - endPosition = target.offset(), - animation = { - top: endPosition.top - fixTop , - left: endPosition.left - fixLeft , - height: target.innerHeight(), - width: target.innerWidth() - }, - startPosition = elem.offset(), - transfer = $( '
        ' ) - .appendTo( document.body ) - .addClass( o.className ) - .css({ - top: startPosition.top - fixTop , - left: startPosition.left - fixLeft , - height: elem.innerHeight(), - width: elem.innerWidth(), - position: targetFixed ? "fixed" : "absolute" - }) - .animate( animation, o.duration, o.easing, function() { - transfer.remove(); - done(); - }); -}; - -})(jQuery); +/*! jQuery UI - v1.9.2 - 2012-12-29 +* http://jqueryui.com +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js +* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */ + +(function( $, undefined ) { + +var uuid = 0, + runiqueId = /^ui-id-\d+$/; + +// prevent duplicate loading +// this is only a problem because we proxy existing functions +// and we don't want to double proxy them +$.ui = $.ui || {}; +if ( $.ui.version ) { + return; +} + +$.extend( $.ui, { + version: "1.9.2", + + keyCode: { + BACKSPACE: 8, + COMMA: 188, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + LEFT: 37, + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SPACE: 32, + TAB: 9, + UP: 38 + } +}); + +// plugins +$.fn.extend({ + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + scrollParent: function() { + var scrollParent; + if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x')); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x')); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //
        + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + uniqueId: function() { + return this.each(function() { + if ( !this.id ) { + this.id = "ui-id-" + (++uuid); + } + }); + }, + + removeUniqueId: function() { + return this.each(function() { + if ( runiqueId.test( this.id ) ) { + $( this ).removeAttr( "id" ); + } + }); + } +}); + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var map, mapName, img, + nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + map = element.parentNode; + mapName = map.name; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) ? + !element.disabled : + "a" === nodeName ? + element.href || isTabIndexNotNaN : + isTabIndexNotNaN) && + // the element and all of its ancestors must be visible + visible( element ); +} + +function visible( element ) { + return $.expr.filters.visible( element ) && + !$( element ).parents().andSelf().filter(function() { + return $.css( this, "visibility" ) === "hidden"; + }).length; +} + +$.extend( $.expr[ ":" ], { + data: $.expr.createPseudo ? + $.expr.createPseudo(function( dataName ) { + return function( elem ) { + return !!$.data( elem, dataName ); + }; + }) : + // support: jQuery <1.8 + function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support +$(function() { + var body = document.body, + div = body.appendChild( div = document.createElement( "div" ) ); + + // access offsetHeight before setting the style to prevent a layout bug + // in IE 9 which causes the element to continue to take up space even + // after it is removed from the DOM (#8026) + div.offsetHeight; + + $.extend( div.style, { + minHeight: "100px", + height: "auto", + padding: 0, + borderWidth: 0 + }); + + $.support.minHeight = div.offsetHeight === 100; + $.support.selectstart = "onselectstart" in div; + + // set display to none to avoid a layout bug in IE + // http://dev.jquery.com/ticket/4014 + body.removeChild( div ).style.display = "none"; +}); + +// support: jQuery <1.8 +if ( !$( "" ).outerWidth( 1 ).jquery ) { + $.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; + if ( border ) { + size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; + }); +} + +// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) +if ( $( "" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { + $.fn.removeData = (function( removeData ) { + return function( key ) { + if ( arguments.length ) { + return removeData.call( this, $.camelCase( key ) ); + } else { + return removeData.call( this ); + } + }; + })( $.fn.removeData ); +} + + + + + +// deprecated + +(function() { + var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || []; + $.ui.ie = uaMatch.length ? true : false; + $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6; +})(); + +$.fn.extend({ + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var i, + proto = $.ui[ module ].prototype; + for ( i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var i, + set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) { + return; + } + + for ( i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + contains: $.contains, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + // these are odd functions, fix the API or move into individual plugins + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + } +}); + +})( jQuery ); +(function( $, undefined ) { + +var uuid = 0, + slice = Array.prototype.slice, + _cleanData = $.cleanData; +$.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); +}; + +$.widget = function( name, base, prototype ) { + var fullName, existingConstructor, constructor, basePrototype, + namespace = name.split( "." )[ 0 ]; + + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { + return !!$.data( elem, fullName ); + }; + + $[ namespace ] = $[ namespace ] || {}; + existingConstructor = $[ namespace ][ name ]; + constructor = $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without "new" keyword + if ( !this._createWidget ) { + return new constructor( options, element ); + } + + // allow instantiation without initializing for simple inheritance + // must use "new" keyword (the code above always passes args) + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + // extend with the existing constructor to carry over any static properties + $.extend( constructor, existingConstructor, { + version: prototype.version, + // copy the object used to create the prototype in case we need to + // redefine the widget later + _proto: $.extend( {}, prototype ), + // track widgets that inherit from this widget in case this widget is + // redefined after a widget inherits from it + _childConstructors: [] + }); + + basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from + basePrototype.options = $.widget.extend( {}, basePrototype.options ); + $.each( prototype, function( prop, value ) { + if ( $.isFunction( value ) ) { + prototype[ prop ] = (function() { + var _super = function() { + return base.prototype[ prop ].apply( this, arguments ); + }, + _superApply = function( args ) { + return base.prototype[ prop ].apply( this, args ); + }; + return function() { + var __super = this._super, + __superApply = this._superApply, + returnValue; + + this._super = _super; + this._superApply = _superApply; + + returnValue = value.apply( this, arguments ); + + this._super = __super; + this._superApply = __superApply; + + return returnValue; + }; + })(); + } + }); + constructor.prototype = $.widget.extend( basePrototype, { + // TODO: remove support for widgetEventPrefix + // always use the name + a colon as the prefix, e.g., draggable:start + // don't prefix for widgets that aren't DOM-based + widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name + }, prototype, { + constructor: constructor, + namespace: namespace, + widgetName: name, + // TODO remove widgetBaseClass, see #8155 + widgetBaseClass: fullName, + widgetFullName: fullName + }); + + // If this widget is being redefined then we need to find all widgets that + // are inheriting from it and redefine all of them so that they inherit from + // the new version of this widget. We're essentially trying to replace one + // level in the prototype chain. + if ( existingConstructor ) { + $.each( existingConstructor._childConstructors, function( i, child ) { + var childPrototype = child.prototype; + + // redefine the child widget using the same prototype that was + // originally used, but inherit from the new version of the base + $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); + }); + // remove the list of existing child constructors from the old constructor + // so the old child constructors can be garbage collected + delete existingConstructor._childConstructors; + } else { + base._childConstructors.push( constructor ); + } + + $.widget.bridge( name, constructor ); +}; + +$.widget.extend = function( target ) { + var input = slice.call( arguments, 1 ), + inputIndex = 0, + inputLength = input.length, + key, + value; + for ( ; inputIndex < inputLength; inputIndex++ ) { + for ( key in input[ inputIndex ] ) { + value = input[ inputIndex ][ key ]; + if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { + // Clone objects + if ( $.isPlainObject( value ) ) { + target[ key ] = $.isPlainObject( target[ key ] ) ? + $.widget.extend( {}, target[ key ], value ) : + // Don't extend strings, arrays, etc. with objects + $.widget.extend( {}, value ); + // Copy everything else by reference + } else { + target[ key ] = value; + } + } + } + } + return target; +}; + +$.widget.bridge = function( name, object ) { + var fullName = object.prototype.widgetFullName || name; + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.widget.extend.apply( null, [ options ].concat(args) ) : + options; + + if ( isMethodCall ) { + this.each(function() { + var methodValue, + instance = $.data( this, fullName ); + if ( !instance ) { + return $.error( "cannot call methods on " + name + " prior to initialization; " + + "attempted to call method '" + options + "'" ); + } + if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { + return $.error( "no such method '" + options + "' for " + name + " widget instance" ); + } + methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue && methodValue.jquery ? + returnValue.pushStack( methodValue.get() ) : + methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, fullName ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, fullName, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( /* options, element */ ) {}; +$.Widget._childConstructors = []; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + defaultElement: "
        ", + options: { + disabled: false, + + // callbacks + create: null + }, + _createWidget: function( options, element ) { + element = $( element || this.defaultElement || this )[ 0 ]; + this.element = $( element ); + this.uuid = uuid++; + this.eventNamespace = "." + this.widgetName + this.uuid; + this.options = $.widget.extend( {}, + this.options, + this._getCreateOptions(), + options ); + + this.bindings = $(); + this.hoverable = $(); + this.focusable = $(); + + if ( element !== this ) { + // 1.9 BC for #7810 + // TODO remove dual storage + $.data( element, this.widgetName, this ); + $.data( element, this.widgetFullName, this ); + this._on( true, this.element, { + remove: function( event ) { + if ( event.target === element ) { + this.destroy(); + } + } + }); + this.document = $( element.style ? + // element within the document + element.ownerDocument : + // element is window or document + element.document || element ); + this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); + } + + this._create(); + this._trigger( "create", null, this._getCreateEventData() ); + this._init(); + }, + _getCreateOptions: $.noop, + _getCreateEventData: $.noop, + _create: $.noop, + _init: $.noop, + + destroy: function() { + this._destroy(); + // we can probably remove the unbind calls in 2.0 + // all event bindings should go through this._on() + this.element + .unbind( this.eventNamespace ) + // 1.9 BC for #7810 + // TODO remove dual storage + .removeData( this.widgetName ) + .removeData( this.widgetFullName ) + // support: jquery <1.6.3 + // http://bugs.jquery.com/ticket/9413 + .removeData( $.camelCase( this.widgetFullName ) ); + this.widget() + .unbind( this.eventNamespace ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetFullName + "-disabled " + + "ui-state-disabled" ); + + // clean up events and states + this.bindings.unbind( this.eventNamespace ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + }, + _destroy: $.noop, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key, + parts, + curOption, + i; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.widget.extend( {}, this.options ); + } + + if ( typeof key === "string" ) { + // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } + options = {}; + parts = key.split( "." ); + key = parts.shift(); + if ( parts.length ) { + curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); + for ( i = 0; i < parts.length - 1; i++ ) { + curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; + curOption = curOption[ parts[ i ] ]; + } + key = parts.pop(); + if ( value === undefined ) { + return curOption[ key ] === undefined ? null : curOption[ key ]; + } + curOption[ key ] = value; + } else { + if ( value === undefined ) { + return this.options[ key ] === undefined ? null : this.options[ key ]; + } + options[ key ] = value; + } + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var key; + + for ( key in options ) { + this._setOption( key, options[ key ] ); + } + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _on: function( suppressDisabledCheck, element, handlers ) { + var delegateElement, + instance = this; + + // no suppressDisabledCheck flag, shuffle arguments + if ( typeof suppressDisabledCheck !== "boolean" ) { + handlers = element; + element = suppressDisabledCheck; + suppressDisabledCheck = false; + } + + // no element argument, shuffle and use this.element + if ( !handlers ) { + handlers = element; + element = this.element; + delegateElement = this.widget(); + } else { + // accept selectors, DOM elements + element = delegateElement = $( element ); + this.bindings = this.bindings.add( element ); + } + + $.each( handlers, function( event, handler ) { + function handlerProxy() { + // allow widgets to customize the disabled handling + // - disabled as an array instead of boolean + // - disabled class as method for disabling individual parts + if ( !suppressDisabledCheck && + ( instance.options.disabled === true || + $( this ).hasClass( "ui-state-disabled" ) ) ) { + return; + } + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + + // copy the guid so direct unbinding works + if ( typeof handler !== "string" ) { + handlerProxy.guid = handler.guid = + handler.guid || handlerProxy.guid || $.guid++; + } + + var match = event.match( /^(\w+)\s*(.*)$/ ), + eventName = match[1] + instance.eventNamespace, + selector = match[2]; + if ( selector ) { + delegateElement.delegate( selector, eventName, handlerProxy ); + } else { + element.bind( eventName, handlerProxy ); + } + }); + }, + + _off: function( element, eventName ) { + eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; + element.unbind( eventName ).undelegate( eventName ); + }, + + _delay: function( handler, delay ) { + function handlerProxy() { + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + var instance = this; + return setTimeout( handlerProxy, delay || 0 ); + }, + + _hoverable: function( element ) { + this.hoverable = this.hoverable.add( element ); + this._on( element, { + mouseenter: function( event ) { + $( event.currentTarget ).addClass( "ui-state-hover" ); + }, + mouseleave: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-hover" ); + } + }); + }, + + _focusable: function( element ) { + this.focusable = this.focusable.add( element ); + this._on( element, { + focusin: function( event ) { + $( event.currentTarget ).addClass( "ui-state-focus" ); + }, + focusout: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-focus" ); + } + }); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + return !( $.isFunction( callback ) && + callback.apply( this.element[0], [ event ].concat( data ) ) === false || + event.isDefaultPrevented() ); + } +}; + +$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { + $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { + if ( typeof options === "string" ) { + options = { effect: options }; + } + var hasOptions, + effectName = !options ? + method : + options === true || typeof options === "number" ? + defaultEffect : + options.effect || defaultEffect; + options = options || {}; + if ( typeof options === "number" ) { + options = { duration: options }; + } + hasOptions = !$.isEmptyObject( options ); + options.complete = callback; + if ( options.delay ) { + element.delay( options.delay ); + } + if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) { + element[ method ]( options ); + } else if ( effectName !== method && element[ effectName ] ) { + element[ effectName ]( options.duration, options.easing, callback ); + } else { + element.queue(function( next ) { + $( this )[ method ](); + if ( callback ) { + callback.call( element[ 0 ] ); + } + next(); + }); + } + }; +}); + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + $.Widget.prototype._getCreateOptions = function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }; +} + +})( jQuery ); +(function( $, undefined ) { + +var mouseHandled = false; +$( document ).mouseup( function( e ) { + mouseHandled = false; +}); + +$.widget("ui.mouse", { + version: "1.9.2", + options: { + cancel: 'input,textarea,button,select,option', + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var that = this; + + this.element + .bind('mousedown.'+this.widgetName, function(event) { + return that._mouseDown(event); + }) + .bind('click.'+this.widgetName, function(event) { + if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) { + $.removeData(event.target, that.widgetName + '.preventClickEvent'); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + if ( this._mouseMoveDelegate ) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + } + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + if( mouseHandled ) { return; } + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var that = this, + btnIsLeft = (event.which === 1), + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + that.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) { + $.removeData(event.target, this.widgetName + '.preventClickEvent'); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return that._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return that._mouseUp(event); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + + mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.ui.ie && !(document.documentMode >= 9) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target === this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + '.preventClickEvent', true); + } + + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(event) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(event) {}, + _mouseDrag: function(event) {}, + _mouseStop: function(event) {}, + _mouseCapture: function(event) { return true; } +}); + +})(jQuery); +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var cachedScrollbarWidth, + max = Math.max, + abs = Math.abs, + round = Math.round, + rhorizontal = /left|center|right/, + rvertical = /top|center|bottom/, + roffset = /[\+\-]\d+%?/, + rposition = /^\w+/, + rpercent = /%$/, + _position = $.fn.position; + +function getOffsets( offsets, width, height ) { + return [ + parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), + parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) + ]; +} +function parseCss( element, property ) { + return parseInt( $.css( element, property ), 10 ) || 0; +} + +$.position = { + scrollbarWidth: function() { + if ( cachedScrollbarWidth !== undefined ) { + return cachedScrollbarWidth; + } + var w1, w2, + div = $( "
        " ), + innerDiv = div.children()[0]; + + $( "body" ).append( div ); + w1 = innerDiv.offsetWidth; + div.css( "overflow", "scroll" ); + + w2 = innerDiv.offsetWidth; + + if ( w1 === w2 ) { + w2 = div[0].clientWidth; + } + + div.remove(); + + return (cachedScrollbarWidth = w1 - w2); + }, + getScrollInfo: function( within ) { + var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ), + overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ), + hasOverflowX = overflowX === "scroll" || + ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), + hasOverflowY = overflowY === "scroll" || + ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); + return { + width: hasOverflowX ? $.position.scrollbarWidth() : 0, + height: hasOverflowY ? $.position.scrollbarWidth() : 0 + }; + }, + getWithinInfo: function( element ) { + var withinElement = $( element || window ), + isWindow = $.isWindow( withinElement[0] ); + return { + element: withinElement, + isWindow: isWindow, + offset: withinElement.offset() || { left: 0, top: 0 }, + scrollLeft: withinElement.scrollLeft(), + scrollTop: withinElement.scrollTop(), + width: isWindow ? withinElement.width() : withinElement.outerWidth(), + height: isWindow ? withinElement.height() : withinElement.outerHeight() + }; + } +}; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var atOffset, targetWidth, targetHeight, targetOffset, basePosition, + target = $( options.of ), + within = $.position.getWithinInfo( options.within ), + scrollInfo = $.position.getScrollInfo( within ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offsets = {}; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + targetOffset = { top: 0, left: 0 }; + } else if ( $.isWindow( targetElem ) ) { + targetWidth = target.width(); + targetHeight = target.height(); + targetOffset = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + targetOffset = { top: targetElem.pageY, left: targetElem.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + targetOffset = target.offset(); + } + // clone to reuse original targetOffset later + basePosition = $.extend( {}, targetOffset ); + + // force my and at to have valid horizontal and vertical positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[ this ] || "" ).split( " " ), + horizontalOffset, + verticalOffset; + + if ( pos.length === 1) { + pos = rhorizontal.test( pos[ 0 ] ) ? + pos.concat( [ "center" ] ) : + rvertical.test( pos[ 0 ] ) ? + [ "center" ].concat( pos ) : + [ "center", "center" ]; + } + pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; + pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; + + // calculate offsets + horizontalOffset = roffset.exec( pos[ 0 ] ); + verticalOffset = roffset.exec( pos[ 1 ] ); + offsets[ this ] = [ + horizontalOffset ? horizontalOffset[ 0 ] : 0, + verticalOffset ? verticalOffset[ 0 ] : 0 + ]; + + // reduce to just the positions without the offsets + options[ this ] = [ + rposition.exec( pos[ 0 ] )[ 0 ], + rposition.exec( pos[ 1 ] )[ 0 ] + ]; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + if ( options.at[ 0 ] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[ 0 ] === "center" ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[ 1 ] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[ 1 ] === "center" ) { + basePosition.top += targetHeight / 2; + } + + atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); + basePosition.left += atOffset[ 0 ]; + basePosition.top += atOffset[ 1 ]; + + return this.each(function() { + var collisionPosition, using, + elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseCss( this, "marginLeft" ), + marginTop = parseCss( this, "marginTop" ), + collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, + collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, + position = $.extend( {}, basePosition ), + myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); + + if ( options.my[ 0 ] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[ 0 ] === "center" ) { + position.left -= elemWidth / 2; + } + + if ( options.my[ 1 ] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[ 1 ] === "center" ) { + position.top -= elemHeight / 2; + } + + position.left += myOffset[ 0 ]; + position.top += myOffset[ 1 ]; + + // if the browser doesn't support fractions, then round for consistent results + if ( !$.support.offsetFractions ) { + position.left = round( position.left ); + position.top = round( position.top ); + } + + collisionPosition = { + marginLeft: marginLeft, + marginTop: marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[ i ] ] ) { + $.ui.position[ collision[ i ] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], + my: options.my, + at: options.at, + within: within, + elem : elem + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + + if ( options.using ) { + // adds feedback as second argument to using callback, if present + using = function( props ) { + var left = targetOffset.left - position.left, + right = left + targetWidth - elemWidth, + top = targetOffset.top - position.top, + bottom = top + targetHeight - elemHeight, + feedback = { + target: { + element: target, + left: targetOffset.left, + top: targetOffset.top, + width: targetWidth, + height: targetHeight + }, + element: { + element: elem, + left: position.left, + top: position.top, + width: elemWidth, + height: elemHeight + }, + horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", + vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" + }; + if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { + feedback.horizontal = "center"; + } + if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { + feedback.vertical = "middle"; + } + if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { + feedback.important = "horizontal"; + } else { + feedback.important = "vertical"; + } + options.using.call( this, props, feedback ); + }; + } + + elem.offset( $.extend( position, { using: using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, + outerWidth = within.width, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = withinOffset - collisionPosLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, + newOverRight; + + // element is wider than within + if ( data.collisionWidth > outerWidth ) { + // element is initially over the left side of within + if ( overLeft > 0 && overRight <= 0 ) { + newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; + position.left += overLeft - newOverRight; + // element is initially over right side of within + } else if ( overRight > 0 && overLeft <= 0 ) { + position.left = withinOffset; + // element is initially over both left and right sides of within + } else { + if ( overLeft > overRight ) { + position.left = withinOffset + outerWidth - data.collisionWidth; + } else { + position.left = withinOffset; + } + } + // too far left -> align with left edge + } else if ( overLeft > 0 ) { + position.left += overLeft; + // too far right -> align with right edge + } else if ( overRight > 0 ) { + position.left -= overRight; + // adjust based on position and margin + } else { + position.left = max( position.left - collisionPosLeft, position.left ); + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollTop : within.offset.top, + outerHeight = data.within.height, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = withinOffset - collisionPosTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, + newOverBottom; + + // element is taller than within + if ( data.collisionHeight > outerHeight ) { + // element is initially over the top of within + if ( overTop > 0 && overBottom <= 0 ) { + newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; + position.top += overTop - newOverBottom; + // element is initially over bottom of within + } else if ( overBottom > 0 && overTop <= 0 ) { + position.top = withinOffset; + // element is initially over both top and bottom of within + } else { + if ( overTop > overBottom ) { + position.top = withinOffset + outerHeight - data.collisionHeight; + } else { + position.top = withinOffset; + } + } + // too far up -> align with top + } else if ( overTop > 0 ) { + position.top += overTop; + // too far down -> align with bottom edge + } else if ( overBottom > 0 ) { + position.top -= overBottom; + // adjust based on position and margin + } else { + position.top = max( position.top - collisionPosTop, position.top ); + } + } + }, + flip: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.offset.left + within.scrollLeft, + outerWidth = within.width, + offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = collisionPosLeft - offsetLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + data.at[ 0 ] === "right" ? + -data.targetWidth : + 0, + offset = -2 * data.offset[ 0 ], + newOverRight, + newOverLeft; + + if ( overLeft < 0 ) { + newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; + if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { + position.left += myOffset + atOffset + offset; + } + } + else if ( overRight > 0 ) { + newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; + if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { + position.left += myOffset + atOffset + offset; + } + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.offset.top + within.scrollTop, + outerHeight = within.height, + offsetTop = within.isWindow ? within.scrollTop : within.offset.top, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = collisionPosTop - offsetTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, + top = data.my[ 1 ] === "top", + myOffset = top ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + data.at[ 1 ] === "bottom" ? + -data.targetHeight : + 0, + offset = -2 * data.offset[ 1 ], + newOverTop, + newOverBottom; + if ( overTop < 0 ) { + newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; + if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) { + position.top += myOffset + atOffset + offset; + } + } + else if ( overBottom > 0 ) { + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; + if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) { + position.top += myOffset + atOffset + offset; + } + } + } + }, + flipfit: { + left: function() { + $.ui.position.flip.left.apply( this, arguments ); + $.ui.position.fit.left.apply( this, arguments ); + }, + top: function() { + $.ui.position.flip.top.apply( this, arguments ); + $.ui.position.fit.top.apply( this, arguments ); + } + } +}; + +// fraction support test +(function () { + var testElement, testElementParent, testElementStyle, offsetLeft, i, + body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ); + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px;"; + + offsetLeft = $( div ).offset().left; + $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11; + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); +})(); + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + // offset option + (function( $ ) { + var _position = $.fn.position; + $.fn.position = function( options ) { + if ( !options || !options.offset ) { + return _position.call( this, options ); + } + var offset = options.offset.split( " " ), + at = options.at.split( " " ); + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + if ( /^\d/.test( offset[ 0 ] ) ) { + offset[ 0 ] = "+" + offset[ 0 ]; + } + if ( /^\d/.test( offset[ 1 ] ) ) { + offset[ 1 ] = "+" + offset[ 1 ]; + } + if ( at.length === 1 ) { + if ( /left|center|right/.test( at[ 0 ] ) ) { + at[ 1 ] = "center"; + } else { + at[ 1 ] = at[ 0 ]; + at[ 0 ] = "center"; + } + } + return _position.call( this, $.extend( options, { + at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ], + offset: undefined + } ) ); + }; + }( jQuery ) ); +} + +}( jQuery ) ); +(function( $, undefined ) { + +$.widget("ui.draggable", $.ui.mouse, { + version: "1.9.2", + widgetEventPrefix: "drag", + options: { + addClasses: true, + appendTo: "parent", + axis: false, + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scope: "default", + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false + }, + _create: function() { + + if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) + this.element[0].style.position = 'relative'; + + (this.options.addClasses && this.element.addClass("ui-draggable")); + (this.options.disabled && this.element.addClass("ui-draggable-disabled")); + + this._mouseInit(); + + }, + + _destroy: function() { + this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); + this._mouseDestroy(); + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) + return false; + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) + return false; + + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('
        ') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + this.helper.addClass("ui-draggable-dragging"); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css("position"); + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + + //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) + if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event); + + return true; + }, + + _mouseDrag: function(event, noPropagation) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger('drag', event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.position; + } + + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) + dropped = $.ui.ddmanager.drop(this, event); + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is no longer in the DOM don't bother to continue (see #8269) + var element = this.element[0], elementInDom = false; + while ( element && (element = element.parentNode) ) { + if (element == document ) { + elementInDom = true; + } + } + if ( !elementInDom && this.options.helper === "original" ) + return false; + + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + var that = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(that._trigger("stop", event) !== false) { + that._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + _mouseUp: function(event) { + //Remove frame helpers + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); + + //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) + if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); + + return $.ui.mouse.prototype._mouseUp.call(this, event); + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + $(this.options.handle, this.element) + .find("*") + .andSelf() + .each(function() { + if(this == event.target) handle = true; + }); + + return handle; + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element); + + if(!helper.parents('body').length) + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) + helper.css("position", "absolute"); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.element.css("marginLeft"),10) || 0), + top: (parseInt(this.element.css("marginTop"),10) || 0), + right: (parseInt(this.element.css("marginRight"),10) || 0), + bottom: (parseInt(this.element.css("marginBottom"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, + o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, + (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { + var c = $(o.containment); + var ce = c[0]; if(!ce) return; + var co = c.offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom + ]; + this.relative_container = c; + + } else if(o.containment.constructor == Array) { + this.containment = o.containment; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + var containment; + if(this.containment) { + if (this.relative_container){ + var co = this.relative_container.offset(); + containment = [ this.containment[0] + co.left, + this.containment[1] + co.top, + this.containment[2] + co.left, + this.containment[3] + co.top ]; + } + else { + containment = this.containment; + } + + if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top; + } + + if(o.grid) { + //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) + var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; + pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; + pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); + //if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function(event) { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' + if(this.shouldRevert) this.instance.options.revert = true; + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper == 'original') + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), that = this; + + var checkPos = function(o) { + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; + var itemHeight = o.height, itemWidth = o.width; + var itemTop = o.top, itemLeft = o.left; + + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); + }; + + $.each(inst.sortables, function(i) { + + var innermostIntersecting = false; + var thisSortable = this; + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + innermostIntersecting = true; + $.each(inst.sortables, function () { + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + if (this != thisSortable + && this.instance._intersectsWith(this.instance.containerCache) + && $.ui.contains(thisSortable.instance.element[0], this.instance.element[0])) + innermostIntersecting = false; + return innermostIntersecting; + }); + } + + + if(innermostIntersecting) { + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance._mouseDrag(event); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) this.instance.placeholder.remove(); + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(event, ui) { + var t = $('body'), o = $(this).data('draggable').options; + if (t.css("cursor")) o._cursor = t.css("cursor"); + t.css("cursor", o.cursor); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if (o._cursor) $('body').css("cursor", o._cursor); + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data('draggable').options; + if(t.css("opacity")) o._opacity = t.css("opacity"); + t.css('opacity', o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if(o._opacity) $(ui.helper).css('opacity', o._opacity); + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(event, ui) { + var i = $(this).data("draggable"); + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); + }, + drag: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { + + if(!o.axis || o.axis != 'x') { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if(!o.axis || o.axis != 'y') { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(!o.axis || o.axis != 'x') { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(!o.axis || o.axis != 'y') { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(i, event); + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options; + i.snapElements = []; + + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != i.element[0]) i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options; + var d = o.snapTolerance; + + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + + var first = (ts || bs || ls || rs); + + if(o.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + }; + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(event, ui) { + + var o = $(this).data("draggable").options; + + var group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + if (!group.length) { return; } + + var min = parseInt(group[0].style.zIndex) || 0; + $(group).each(function(i) { + this.style.zIndex = min + i; + }); + + this[0].style.zIndex = min + group.length; + + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("draggable").options; + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); + t.css('zIndex', o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("draggable").options; + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); + } +}); + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.droppable", { + version: "1.9.2", + widgetEventPrefix: "drop", + options: { + accept: '*', + activeClass: false, + addClasses: true, + greedy: false, + hoverClass: false, + scope: 'default', + tolerance: 'intersect' + }, + _create: function() { + + var o = this.options, accept = o.accept; + this.isover = 0; this.isout = 1; + + this.accept = $.isFunction(accept) ? accept : function(d) { + return d.is(accept); + }; + + //Store the droppable's proportions + this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); + + (o.addClasses && this.element.addClass("ui-droppable")); + + }, + + _destroy: function() { + var drop = $.ui.ddmanager.droppables[this.options.scope]; + for ( var i = 0; i < drop.length; i++ ) + if ( drop[i] == this ) + drop.splice(i, 1); + + this.element.removeClass("ui-droppable ui-droppable-disabled"); + }, + + _setOption: function(key, value) { + + if(key == 'accept') { + this.accept = $.isFunction(value) ? value : function(d) { + return d.is(value); + }; + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + _activate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.addClass(this.options.activeClass); + (draggable && this._trigger('activate', event, this.ui(draggable))); + }, + + _deactivate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + (draggable && this._trigger('deactivate', event, this.ui(draggable))); + }, + + _over: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.addClass(this.options.hoverClass); + this._trigger('over', event, this.ui(draggable)); + } + + }, + + _out: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('out', event, this.ui(draggable)); + } + + }, + + _drop: function(event,custom) { + + var draggable = custom || $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element + + var childrenIntersection = false; + this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'droppable'); + if( + inst.options.greedy + && !inst.options.disabled + && inst.options.scope == draggable.options.scope + && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) + && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) + ) { childrenIntersection = true; return false; } + }); + if(childrenIntersection) return false; + + if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('drop', event, this.ui(draggable)); + return this.element; + } + + return false; + + }, + + ui: function(c) { + return { + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + offset: c.positionAbs + }; + } + +}); + +$.ui.intersect = function(draggable, droppable, toleranceMode) { + + if (!droppable.offset) return false; + + var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, + y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; + var l = droppable.offset.left, r = l + droppable.proportions.width, + t = droppable.offset.top, b = t + droppable.proportions.height; + + switch (toleranceMode) { + case 'fit': + return (l <= x1 && x2 <= r + && t <= y1 && y2 <= b); + break; + case 'intersect': + return (l < x1 + (draggable.helperProportions.width / 2) // Right Half + && x2 - (draggable.helperProportions.width / 2) < r // Left Half + && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half + && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half + break; + case 'pointer': + var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left), + draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top), + isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width); + return isOver; + break; + case 'touch': + return ( + (y1 >= t && y1 <= b) || // Top edge touching + (y2 >= t && y2 <= b) || // Bottom edge touching + (y1 < t && y2 > b) // Surrounded vertically + ) && ( + (x1 >= l && x1 <= r) || // Left edge touching + (x2 >= l && x2 <= r) || // Right edge touching + (x1 < l && x2 > r) // Surrounded horizontally + ); + break; + default: + return false; + break; + } + +}; + +/* + This manager tracks offsets of draggables and droppables +*/ +$.ui.ddmanager = { + current: null, + droppables: { 'default': [] }, + prepareOffsets: function(t, event) { + + var m = $.ui.ddmanager.droppables[t.options.scope] || []; + var type = event ? event.type : null; // workaround for #2317 + var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); + + droppablesLoop: for (var i = 0; i < m.length; i++) { + + if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted + for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item + m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue + + if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables + + m[i].offset = m[i].element.offset(); + m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }; + + } + + }, + drop: function(draggable, event) { + + var dropped = false; + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(!this.options) return; + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) + dropped = this._drop.call(this, event) || dropped; + + if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + this.isout = 1; this.isover = 0; + this._deactivate.call(this, event); + } + + }); + return dropped; + + }, + dragStart: function( draggable, event ) { + //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) + draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() { + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + }); + }, + drag: function(draggable, event) { + + //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. + if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event); + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(this.options.disabled || this.greedyChild || !this.visible) return; + var intersects = $.ui.intersect(draggable, this, this.options.tolerance); + + var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null); + if(!c) return; + + var parentInstance; + if (this.options.greedy) { + // find droppable parents with same scope + var scope = this.options.scope; + var parent = this.element.parents(':data(droppable)').filter(function () { + return $.data(this, 'droppable').options.scope === scope; + }); + + if (parent.length) { + parentInstance = $.data(parent[0], 'droppable'); + parentInstance.greedyChild = (c == 'isover' ? 1 : 0); + } + } + + // we just moved into a greedy child + if (parentInstance && c == 'isover') { + parentInstance['isover'] = 0; + parentInstance['isout'] = 1; + parentInstance._out.call(parentInstance, event); + } + + this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; + this[c == "isover" ? "_over" : "_out"].call(this, event); + + // we just moved out of a greedy child + if (parentInstance && c == 'isout') { + parentInstance['isout'] = 0; + parentInstance['isover'] = 1; + parentInstance._over.call(parentInstance, event); + } + }); + + }, + dragStop: function( draggable, event ) { + draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" ); + //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + } +}; + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.resizable", $.ui.mouse, { + version: "1.9.2", + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 + }, + _create: function() { + + var that = this, o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $('
        ').css({ + position: this.element.css('position'), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css('top'), + left: this.element.css('left') + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "resizable", this.element.data('resizable') + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css('resize'); + this.originalElement.css('resize', 'none'); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); + if(this.handles.constructor == String) { + + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; + var n = this.handles.split(","); this.handles = {}; + + for(var i = 0; i < n.length; i++) { + + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; + var axis = $('
        '); + + // Apply zIndex to all handles - see #7960 + axis.css({ zIndex: o.zIndex }); + + //TODO : What's going on here? + if ('se' == handle) { + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); + }; + + //Insert into internal handles object and append to element + this.handles[handle] = '.ui-resizable-'+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + target = target || this.element; + + for(var i in this.handles) { + + if(this.handles[i].constructor == String) + this.handles[i] = $(this.handles[i], this.element).show(); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(this.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) + continue; + + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $('.ui-resizable-handle', this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!that.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + that.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .mouseenter(function() { + if (o.disabled) return; + $(this).removeClass("ui-resizable-autohide"); + that._handles.show(); + }) + .mouseleave(function(){ + if (o.disabled) return; + if (!that.resizing) { + $(this).addClass("ui-resizable-autohide"); + that._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + _destroy: function() { + + this._mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").removeData("ui-resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + var wrapper = this.element; + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }).insertAfter( wrapper ); + wrapper.remove(); + } + + this.originalElement.css('resize', this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var handle = false; + for (var i in this.handles) { + if ($(this.handles[i])[0] == event.target) { + handle = true; + } + } + + return !this.options.disabled && handle; + }, + + _mouseStart: function(event) { + + var o = this.options, iniPos = this.element.position(), el = this.element; + + this.resizing = true; + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix for http://dev.jquery.com/ticket/1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); + } + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + that = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [event, dx, dy]); + + // Put this in the mouseDrag handler since the user can start pressing shift while resizing + this._updateVirtualBoundaries(event.shiftKey); + if (this._aspectRatio || event.shiftKey) + data = this._updateRatio(data, event); + + data = this._respectSize(data, event); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!this._helper && this._proportionallyResizeElements.length) + this._proportionallyResize(); + + this._updateCache(data); + + // calling the user callback at the end + this._trigger('resize', event, this.ui()); + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var o = this.options, that = this; + + if(this._helper) { + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height, + soffsetw = ista ? 0 : that.sizeDiff.width; + + var s = { width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) }, + left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null, + top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + that.helper.height(that.size.height); + that.helper.width(that.size.width); + + if (this._helper && !o.animate) this._proportionallyResize(); + } + + $('body').css('cursor', 'auto'); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) this.helper.remove(); + return false; + + }, + + _updateVirtualBoundaries: function(forceAspectRatio) { + var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b; + + b = { + minWidth: isNumber(o.minWidth) ? o.minWidth : 0, + maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity, + minHeight: isNumber(o.minHeight) ? o.minHeight : 0, + maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity + }; + + if(this._aspectRatio || forceAspectRatio) { + // We want to create an enclosing box whose aspect ration is the requested one + // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension + pMinWidth = b.minHeight * this.aspectRatio; + pMinHeight = b.minWidth / this.aspectRatio; + pMaxWidth = b.maxHeight * this.aspectRatio; + pMaxHeight = b.maxWidth / this.aspectRatio; + + if(pMinWidth > b.minWidth) b.minWidth = pMinWidth; + if(pMinHeight > b.minHeight) b.minHeight = pMinHeight; + if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth; + if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight; + } + this._vBoundaries = b; + }, + + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (isNumber(data.left)) this.position.left = data.left; + if (isNumber(data.top)) this.position.top = data.top; + if (isNumber(data.height)) this.size.height = data.height; + if (isNumber(data.width)) this.size.width = data.width; + }, + + _updateRatio: function(data, event) { + + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); + else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function(data, event) { + + var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + + _proportionallyResize: function() { + + var o = this.options; + if (!this._proportionallyResizeElements.length) return; + var element = this.helper || this.element; + + for (var i=0; i < this._proportionallyResizeElements.length; i++) { + + var prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + this.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + }; + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $('
        '); + + // fix ie6 offset TODO: This seems broken + var ie6offset = ($.ui.ie6 ? 1 : 0), + pxyoffset = ( $.ui.ie6 ? 2 : -1 ); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() + pxyoffset, + height: this.element.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n != "resize" && this._trigger(n, event, this.ui())); + }, + + plugins: {}, + + ui: function() { + return { + originalElement: this.originalElement, + element: this.element, + helper: this.helper, + position: this.position, + size: this.size, + originalSize: this.originalSize, + originalPosition: this.originalPosition + }; + } + +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function (event, ui) { + var that = $(this).data("resizable"), o = that.options; + + var _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10) + }); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var that = $(this).data("resizable"), o = that.options, os = that.originalSize, op = that.originalPosition; + + var delta = { + height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0, + top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function (event, ui) { + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(event, ui) { + var that = $(this).data("resizable"), o = that.options; + + var pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height, + soffsetw = ista ? 0 : that.sizeDiff.width; + + var style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) }, + left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null, + top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null; + + that.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(that.element.css('width'), 10), + height: parseInt(that.element.css('height'), 10), + top: parseInt(that.element.css('top'), 10), + left: parseInt(that.element.css('left'), 10) + }; + + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + that._updateCache(data); + that._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function(event, ui) { + var that = $(this).data("resizable"), o = that.options, el = that.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + that.containerElement = $(ce); + + if (/document/.test(oc) || oc == document) { + that.containerOffset = { left: 0, top: 0 }; + that.containerPosition = { left: 0, top: 0 }; + + that.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + var element = $(ce), p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + that.containerOffset = element.offset(); + that.containerPosition = element.position(); + that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + var co = that.containerOffset, ch = that.containerSize.height, cw = that.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + that.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(event, ui) { + var that = $(this).data("resizable"), o = that.options, + ps = that.containerSize, co = that.containerOffset, cs = that.size, cp = that.position, + pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement; + + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; + + if (cp.left < (that._helper ? co.left : 0)) { + that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left)); + if (pRatio) that.size.height = that.size.width / that.aspectRatio; + that.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (that._helper ? co.top : 0)) { + that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top); + if (pRatio) that.size.width = that.size.height * that.aspectRatio; + that.position.top = that._helper ? co.top : 0; + } + + that.offset.left = that.parentData.left+that.position.left; + that.offset.top = that.parentData.top+that.position.top; + + var woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width ), + hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height ); + + var isParent = that.containerElement.get(0) == that.element.parent().get(0), + isOffsetRelative = /relative|absolute/.test(that.containerElement.css('position')); + + if(isParent && isOffsetRelative) woset -= that.parentData.left; + + if (woset + that.size.width >= that.parentData.width) { + that.size.width = that.parentData.width - woset; + if (pRatio) that.size.height = that.size.width / that.aspectRatio; + } + + if (hoset + that.size.height >= that.parentData.height) { + that.size.height = that.parentData.height - hoset; + if (pRatio) that.size.width = that.size.height * that.aspectRatio; + } + }, + + stop: function(event, ui){ + var that = $(this).data("resizable"), o = that.options, cp = that.position, + co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement; + + var helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height; + + if (that._helper && !o.animate && (/relative/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + if (that._helper && !o.animate && (/static/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(event, ui) { + + var that = $(this).data("resizable"), o = that.options, cs = that.size; + + that.ghost = that.originalElement.clone(); + that.ghost + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass('ui-resizable-ghost') + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + that.ghost.appendTo(that.helper); + + }, + + resize: function(event, ui){ + var that = $(this).data("resizable"), o = that.options; + if (that.ghost) that.ghost.css({ position: 'relative', height: that.size.height, width: that.size.width }); + }, + + stop: function(event, ui){ + var that = $(this).data("resizable"), o = that.options; + if (that.ghost && that.helper) that.helper.get(0).removeChild(that.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(event, ui) { + var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, ratio = o._aspectRatio || event.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + that.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + that.position.left = op.left - ox; + } + else { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + that.position.top = op.top - oy; + that.position.left = op.left - ox; + } + } + +}); + +var num = function(v) { + return parseInt(v, 10) || 0; +}; + +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.selectable", $.ui.mouse, { + version: "1.9.2", + options: { + appendTo: 'body', + autoRefresh: true, + distance: 0, + filter: '*', + tolerance: 'touch' + }, + _create: function() { + var that = this; + + this.element.addClass("ui-selectable"); + + this.dragged = false; + + // cache selectee children based on filter + var selectees; + this.refresh = function() { + selectees = $(that.options.filter, that.element[0]); + selectees.addClass("ui-selectee"); + selectees.each(function() { + var $this = $(this); + var pos = $this.offset(); + $.data(this, "selectable-item", { + element: this, + $element: $this, + left: pos.left, + top: pos.top, + right: pos.left + $this.outerWidth(), + bottom: pos.top + $this.outerHeight(), + startselected: false, + selected: $this.hasClass('ui-selected'), + selecting: $this.hasClass('ui-selecting'), + unselecting: $this.hasClass('ui-unselecting') + }); + }); + }; + this.refresh(); + + this.selectees = selectees.addClass("ui-selectee"); + + this._mouseInit(); + + this.helper = $("
        "); + }, + + _destroy: function() { + this.selectees + .removeClass("ui-selectee") + .removeData("selectable-item"); + this.element + .removeClass("ui-selectable ui-selectable-disabled"); + this._mouseDestroy(); + }, + + _mouseStart: function(event) { + var that = this; + + this.opos = [event.pageX, event.pageY]; + + if (this.options.disabled) + return; + + var options = this.options; + + this.selectees = $(options.filter, this.element[0]); + + this._trigger("start", event); + + $(options.appendTo).append(this.helper); + // position helper (lasso) + this.helper.css({ + "left": event.clientX, + "top": event.clientY, + "width": 0, + "height": 0 + }); + + if (options.autoRefresh) { + this.refresh(); + } + + this.selectees.filter('.ui-selected').each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.startselected = true; + if (!event.metaKey && !event.ctrlKey) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + }); + + $(event.target).parents().andSelf().each(function() { + var selectee = $.data(this, "selectable-item"); + if (selectee) { + var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); + selectee.$element + .removeClass(doSelect ? "ui-unselecting" : "ui-selected") + .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); + selectee.unselecting = !doSelect; + selectee.selecting = doSelect; + selectee.selected = doSelect; + // selectable (UN)SELECTING callback + if (doSelect) { + that._trigger("selecting", event, { + selecting: selectee.element + }); + } else { + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + return false; + } + }); + + }, + + _mouseDrag: function(event) { + var that = this; + this.dragged = true; + + if (this.options.disabled) + return; + + var options = this.options; + + var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; + if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + this.selectees.each(function() { + var selectee = $.data(this, "selectable-item"); + //prevent helper from being selected if appendTo: selectable + if (!selectee || selectee.element == that.element[0]) + return; + var hit = false; + if (options.tolerance == 'touch') { + hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); + } else if (options.tolerance == 'fit') { + hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); + } + + if (hit) { + // SELECT + if (selectee.selected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + } + if (selectee.unselecting) { + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + } + if (!selectee.selecting) { + selectee.$element.addClass('ui-selecting'); + selectee.selecting = true; + // selectable SELECTING callback + that._trigger("selecting", event, { + selecting: selectee.element + }); + } + } else { + // UNSELECT + if (selectee.selecting) { + if ((event.metaKey || event.ctrlKey) && selectee.startselected) { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + selectee.$element.addClass('ui-selected'); + selectee.selected = true; + } else { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + if (selectee.startselected) { + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + } + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + if (selectee.selected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + } + }); + + return false; + }, + + _mouseStop: function(event) { + var that = this; + + this.dragged = false; + + var options = this.options; + + $('.ui-unselecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + selectee.startselected = false; + that._trigger("unselected", event, { + unselected: selectee.element + }); + }); + $('.ui-selecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); + selectee.selecting = false; + selectee.selected = true; + selectee.startselected = true; + that._trigger("selected", event, { + selected: selectee.element + }); + }); + this._trigger("stop", event); + + this.helper.remove(); + + return false; + } + +}); + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.sortable", $.ui.mouse, { + version: "1.9.2", + widgetEventPrefix: "sort", + ready: false, + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: '> *', + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are being displayed horizontally + this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + //We're ready to go + this.ready = true + + }, + + _destroy: function() { + this.element + .removeClass("ui-sortable ui-sortable-disabled"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData(this.widgetName + "-item"); + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget().toggleClass( "ui-sortable-disabled", !!value ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + var that = this; + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type == 'static') return false; + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, nodes = $(event.target).parents().each(function() { + if($.data(this, that.widgetName + '-item') == that) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var o = this.options; + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] != this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + if(o.cursor) { // cursor option + if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); + $('body').css("cursor", o.cursor); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') + this.overflowOffset = this.scrollParent.offset(); + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) + this._cacheHelperProportions(); + + + //Post 'activate' events to possible containers + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); } + } + + //Prepare possible droppables + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + var o = this.options, scrolled = false; + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper position + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + // Only put the placeholder inside the current Container, skip all + // items form other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this moving items in "sub-sortables" can cause the placeholder to jitter + // beetween the outer and inner container. + if (item.instance !== this.currentContainer) continue; + + if (itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) return; + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, event); + + if(this.options.revert) { + var that = this; + var cur = this.placeholder.offset(); + + this.reverting = true; + + $(this.helper).animate({ + left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), + top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) + }, parseInt(this.options.revert, 10) || 500, function() { + that._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + if(this.dragging) { + + this._mouseUp({ target: null }); + + if(this.options.helper == "original") + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + else + this.currentItem.show(); + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, this._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + if (this.placeholder) { + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var str = []; o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); + }); + + if(!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var ret = []; o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function(item) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height; + + var l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height; + + var dyClick = this.offset.click.top, + dxClick = this.offset.click.left; + + var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + + if( this.options.tolerance == "pointer" + || this.options.forcePointerForContainers + || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) + ) { + return isOverElement; + } else { + + return (l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) + return false; + + return this.floating ? + ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta != 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta != 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var items = []; + var queries = []; + var connectWith = this._connectWith(); + + if(connectWith && connected) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); + } + }; + }; + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i][0].each(function() { + items.push(this); + }); + }; + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); + + this.items = $.grep(this.items, function (item) { + for (var j=0; j < list.length; j++) { + if(list[j] == item.item[0]) + return false; + }; + return true; + }); + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + var items = this.items; + var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); + + if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--) { + var targetData = queries[i][1]; + var _queries = queries[i][0]; + + for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { + var item = $(_queries[j]); + + item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + }; + }; + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + for (var i = this.items.length - 1; i >= 0; i--){ + var item = this.items[i]; + + //We ignore calculating positions of all connected containers when we're not over them + if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0]) + continue; + + var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + var p = t.offset(); + item.left = p.left; + item.top = p.top; + }; + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + for (var i = this.containers.length - 1; i >= 0; i--){ + var p = this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + }; + } + + return this; + }, + + _createPlaceholder: function(that) { + that = that || this; + var o = that.options; + + if(!o.placeholder || o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + + var el = $(document.createElement(that.currentItem[0].nodeName)) + .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper")[0]; + + if(!className) + el.style.visibility = "hidden"; + + return el; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) return; + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); }; + if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); }; + } + }; + } + + //Create the placeholder + that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); + + //Append it after the actual current item + that.currentItem.after(that.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(that, that.placeholder); + + }, + + _contactContainers: function(event) { + + // get innermost container that intersects with item + var innermostContainer = null, innermostIndex = null; + + + for (var i = this.containers.length - 1; i >= 0; i--){ + + // never consider a container that's located within the item itself + if($.contains(this.currentItem[0], this.containers[i].element[0])) + continue; + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) + continue; + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) return; + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } else { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; + var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top'; + var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height'; + var base = this.positionAbs[posProperty] + this.offset.click[posProperty]; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; + if(this.items[j].item[0] == this.currentItem[0]) continue; + var cur = this.items[j].item.offset()[posProperty]; + var nearBottom = false; + if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ + nearBottom = true; + cur += this.items[j][sizeProperty]; + } + + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + this.direction = nearBottom ? "up": "down"; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + return; + + this.currentContainer = this.containers[innermostIndex]; + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); + + if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already + $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + + if(helper[0] == this.currentItem[0]) + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + + if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); + if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var counter = this.counter; + + this._delay(function() { + if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + }); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var delayedTriggers = []; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem); + this._noFinalSort = null; + + if(this.helper[0] == this.currentItem[0]) { + for(var i in this._storedCSS) { + if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + + // Check if the items Container has Changed and trigger appropriate + // events. + if (this !== this.currentContainer) { + if(!noPropagation) { + delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + } + } + + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if(this.containers[i].containerCache.over) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor + if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity + if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return false; + } + + if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; + + if(!noPropagation) { + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(_inst) { + var inst = _inst || this; + return { + helper: inst.helper, + placeholder: inst.placeholder || $([]), + position: inst.position, + originalPosition: inst.originalPosition, + offset: inst.positionAbs, + item: inst.currentItem, + sender: _inst ? _inst.element : null + }; + } + +}); + +})(jQuery); +(function( $, undefined ) { + +var uid = 0, + hideProps = {}, + showProps = {}; + +hideProps.height = hideProps.paddingTop = hideProps.paddingBottom = + hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide"; +showProps.height = showProps.paddingTop = showProps.paddingBottom = + showProps.borderTopWidth = showProps.borderBottomWidth = "show"; + +$.widget( "ui.accordion", { + version: "1.9.2", + options: { + active: 0, + animate: {}, + collapsible: false, + event: "click", + header: "> li > :first-child,> :not(li):even", + heightStyle: "auto", + icons: { + activeHeader: "ui-icon-triangle-1-s", + header: "ui-icon-triangle-1-e" + }, + + // callbacks + activate: null, + beforeActivate: null + }, + + _create: function() { + var accordionId = this.accordionId = "ui-accordion-" + + (this.element.attr( "id" ) || ++uid), + options = this.options; + + this.prevShow = this.prevHide = $(); + this.element.addClass( "ui-accordion ui-widget ui-helper-reset" ); + + this.headers = this.element.find( options.header ) + .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" ); + this._hoverable( this.headers ); + this._focusable( this.headers ); + + this.headers.next() + .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ) + .hide(); + + // don't allow collapsible: false and active: false / null + if ( !options.collapsible && (options.active === false || options.active == null) ) { + options.active = 0; + } + // handle negative values + if ( options.active < 0 ) { + options.active += this.headers.length; + } + this.active = this._findActive( options.active ) + .addClass( "ui-accordion-header-active ui-state-active" ) + .toggleClass( "ui-corner-all ui-corner-top" ); + this.active.next() + .addClass( "ui-accordion-content-active" ) + .show(); + + this._createIcons(); + this.refresh(); + + // ARIA + this.element.attr( "role", "tablist" ); + + this.headers + .attr( "role", "tab" ) + .each(function( i ) { + var header = $( this ), + headerId = header.attr( "id" ), + panel = header.next(), + panelId = panel.attr( "id" ); + if ( !headerId ) { + headerId = accordionId + "-header-" + i; + header.attr( "id", headerId ); + } + if ( !panelId ) { + panelId = accordionId + "-panel-" + i; + panel.attr( "id", panelId ); + } + header.attr( "aria-controls", panelId ); + panel.attr( "aria-labelledby", headerId ); + }) + .next() + .attr( "role", "tabpanel" ); + + this.headers + .not( this.active ) + .attr({ + "aria-selected": "false", + tabIndex: -1 + }) + .next() + .attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }) + .hide(); + + // make sure at least one header is in the tab order + if ( !this.active.length ) { + this.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + this.active.attr({ + "aria-selected": "true", + tabIndex: 0 + }) + .next() + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }); + } + + this._on( this.headers, { keydown: "_keydown" }); + this._on( this.headers.next(), { keydown: "_panelKeyDown" }); + this._setupEvents( options.event ); + }, + + _getCreateEventData: function() { + return { + header: this.active, + content: !this.active.length ? $() : this.active.next() + }; + }, + + _createIcons: function() { + var icons = this.options.icons; + if ( icons ) { + $( "" ) + .addClass( "ui-accordion-header-icon ui-icon " + icons.header ) + .prependTo( this.headers ); + this.active.children( ".ui-accordion-header-icon" ) + .removeClass( icons.header ) + .addClass( icons.activeHeader ); + this.headers.addClass( "ui-accordion-icons" ); + } + }, + + _destroyIcons: function() { + this.headers + .removeClass( "ui-accordion-icons" ) + .children( ".ui-accordion-header-icon" ) + .remove(); + }, + + _destroy: function() { + var contents; + + // clean up main element + this.element + .removeClass( "ui-accordion ui-widget ui-helper-reset" ) + .removeAttr( "role" ); + + // clean up headers + this.headers + .removeClass( "ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) + .removeAttr( "role" ) + .removeAttr( "aria-selected" ) + .removeAttr( "aria-controls" ) + .removeAttr( "tabIndex" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + this._destroyIcons(); + + // clean up content panels + contents = this.headers.next() + .css( "display", "" ) + .removeAttr( "role" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-labelledby" ) + .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + if ( this.options.heightStyle !== "content" ) { + contents.css( "height", "" ); + } + }, + + _setOption: function( key, value ) { + if ( key === "active" ) { + // _activate() will handle invalid values and update this.options + this._activate( value ); + return; + } + + if ( key === "event" ) { + if ( this.options.event ) { + this._off( this.headers, this.options.event ); + } + this._setupEvents( value ); + } + + this._super( key, value ); + + // setting collapsible: false while collapsed; open first panel + if ( key === "collapsible" && !value && this.options.active === false ) { + this._activate( 0 ); + } + + if ( key === "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if ( key === "disabled" ) { + this.headers.add( this.headers.next() ) + .toggleClass( "ui-state-disabled", !!value ); + } + }, + + _keydown: function( event ) { + if ( event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._eventHandler( event ); + break; + case keyCode.HOME: + toFocus = this.headers[ 0 ]; + break; + case keyCode.END: + toFocus = this.headers[ length - 1 ]; + break; + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + toFocus.focus(); + event.preventDefault(); + } + }, + + _panelKeyDown : function( event ) { + if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { + $( event.currentTarget ).prev().focus(); + } + }, + + refresh: function() { + var maxHeight, overflow, + heightStyle = this.options.heightStyle, + parent = this.element.parent(); + + + if ( heightStyle === "fill" ) { + // IE 6 treats height like minHeight, so we need to turn off overflow + // in order to get a reliable height + // we use the minHeight support test because we assume that only + // browsers that don't support minHeight will treat height as minHeight + if ( !$.support.minHeight ) { + overflow = parent.css( "overflow" ); + parent.css( "overflow", "hidden"); + } + maxHeight = parent.height(); + this.element.siblings( ":visible" ).each(function() { + var elem = $( this ), + position = elem.css( "position" ); + + if ( position === "absolute" || position === "fixed" ) { + return; + } + maxHeight -= elem.outerHeight( true ); + }); + if ( overflow ) { + parent.css( "overflow", overflow ); + } + + this.headers.each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.headers.next() + .each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( heightStyle === "auto" ) { + maxHeight = 0; + this.headers.next() + .each(function() { + maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); + }) + .height( maxHeight ); + } + }, + + _activate: function( index ) { + var active = this._findActive( index )[ 0 ]; + + // trying to activate the already active panel + if ( active === this.active[ 0 ] ) { + return; + } + + // trying to collapse, simulate a click on the currently active header + active = active || this.active[ 0 ]; + + this._eventHandler({ + target: active, + currentTarget: active, + preventDefault: $.noop + }); + }, + + _findActive: function( selector ) { + return typeof selector === "number" ? this.headers.eq( selector ) : $(); + }, + + _setupEvents: function( event ) { + var events = {}; + if ( !event ) { + return; + } + $.each( event.split(" "), function( index, eventName ) { + events[ eventName ] = "_eventHandler"; + }); + this._on( this.headers, events ); + }, + + _eventHandler: function( event ) { + var options = this.options, + active = this.active, + clicked = $( event.currentTarget ), + clickedIsActive = clicked[ 0 ] === active[ 0 ], + collapsing = clickedIsActive && options.collapsible, + toShow = collapsing ? $() : clicked.next(), + toHide = active.next(), + eventData = { + oldHeader: active, + oldPanel: toHide, + newHeader: collapsing ? $() : clicked, + newPanel: toShow + }; + + event.preventDefault(); + + if ( + // click on active header, but not collapsible + ( clickedIsActive && !options.collapsible ) || + // allow canceling activation + ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { + return; + } + + options.active = collapsing ? false : this.headers.index( clicked ); + + // when the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $() : clicked; + this._toggle( eventData ); + + // switch classes + // corner classes on the previously active header stay after the animation + active.removeClass( "ui-accordion-header-active ui-state-active" ); + if ( options.icons ) { + active.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.activeHeader ) + .addClass( options.icons.header ); + } + + if ( !clickedIsActive ) { + clicked + .removeClass( "ui-corner-all" ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ); + if ( options.icons ) { + clicked.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.header ) + .addClass( options.icons.activeHeader ); + } + + clicked + .next() + .addClass( "ui-accordion-content-active" ); + } + }, + + _toggle: function( data ) { + var toShow = data.newPanel, + toHide = this.prevShow.length ? this.prevShow : data.oldPanel; + + // handle activating a panel during the animation for another activation + this.prevShow.add( this.prevHide ).stop( true, true ); + this.prevShow = toShow; + this.prevHide = toHide; + + if ( this.options.animate ) { + this._animate( toShow, toHide, data ); + } else { + toHide.hide(); + toShow.show(); + this._toggleComplete( data ); + } + + toHide.attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }); + toHide.prev().attr( "aria-selected", "false" ); + // if we're switching panels, remove the old header from the tab order + // if we're opening from collapsed state, remove the previous header from the tab order + // if we're collapsing, then keep the collapsing header in the tab order + if ( toShow.length && toHide.length ) { + toHide.prev().attr( "tabIndex", -1 ); + } else if ( toShow.length ) { + this.headers.filter(function() { + return $( this ).attr( "tabIndex" ) === 0; + }) + .attr( "tabIndex", -1 ); + } + + toShow + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }) + .prev() + .attr({ + "aria-selected": "true", + tabIndex: 0 + }); + }, + + _animate: function( toShow, toHide, data ) { + var total, easing, duration, + that = this, + adjust = 0, + down = toShow.length && + ( !toHide.length || ( toShow.index() < toHide.index() ) ), + animate = this.options.animate || {}, + options = down && animate.down || animate, + complete = function() { + that._toggleComplete( data ); + }; + + if ( typeof options === "number" ) { + duration = options; + } + if ( typeof options === "string" ) { + easing = options; + } + // fall back from options to animation in case of partial down settings + easing = easing || options.easing || animate.easing; + duration = duration || options.duration || animate.duration; + + if ( !toHide.length ) { + return toShow.animate( showProps, duration, easing, complete ); + } + if ( !toShow.length ) { + return toHide.animate( hideProps, duration, easing, complete ); + } + + total = toShow.show().outerHeight(); + toHide.animate( hideProps, { + duration: duration, + easing: easing, + step: function( now, fx ) { + fx.now = Math.round( now ); + } + }); + toShow + .hide() + .animate( showProps, { + duration: duration, + easing: easing, + complete: complete, + step: function( now, fx ) { + fx.now = Math.round( now ); + if ( fx.prop !== "height" ) { + adjust += fx.now; + } else if ( that.options.heightStyle !== "content" ) { + fx.now = Math.round( total - toHide.outerHeight() - adjust ); + adjust = 0; + } + } + }); + }, + + _toggleComplete: function( data ) { + var toHide = data.oldPanel; + + toHide + .removeClass( "ui-accordion-content-active" ) + .prev() + .removeClass( "ui-corner-top" ) + .addClass( "ui-corner-all" ); + + // Work around for rendering bug in IE (#5421) + if ( toHide.length ) { + toHide.parent()[0].className = toHide.parent()[0].className; + } + + this._trigger( "activate", null, data ); + } +}); + + + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + // navigation options + (function( $, prototype ) { + $.extend( prototype.options, { + navigation: false, + navigationFilter: function() { + return this.href.toLowerCase() === location.href.toLowerCase(); + } + }); + + var _create = prototype._create; + prototype._create = function() { + if ( this.options.navigation ) { + var that = this, + headers = this.element.find( this.options.header ), + content = headers.next(), + current = headers.add( content ) + .find( "a" ) + .filter( this.options.navigationFilter ) + [ 0 ]; + if ( current ) { + headers.add( content ).each( function( index ) { + if ( $.contains( this, current ) ) { + that.options.active = Math.floor( index / 2 ); + return false; + } + }); + } + } + _create.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // height options + (function( $, prototype ) { + $.extend( prototype.options, { + heightStyle: null, // remove default so we fall back to old values + autoHeight: true, // use heightStyle: "auto" + clearStyle: false, // use heightStyle: "content" + fillSpace: false // use heightStyle: "fill" + }); + + var _create = prototype._create, + _setOption = prototype._setOption; + + $.extend( prototype, { + _create: function() { + this.options.heightStyle = this.options.heightStyle || + this._mergeHeightStyle(); + + _create.call( this ); + }, + + _setOption: function( key ) { + if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) { + this.options.heightStyle = this._mergeHeightStyle(); + } + _setOption.apply( this, arguments ); + }, + + _mergeHeightStyle: function() { + var options = this.options; + + if ( options.fillSpace ) { + return "fill"; + } + + if ( options.clearStyle ) { + return "content"; + } + + if ( options.autoHeight ) { + return "auto"; + } + } + }); + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // icon options + (function( $, prototype ) { + $.extend( prototype.options.icons, { + activeHeader: null, // remove default so we fall back to old values + headerSelected: "ui-icon-triangle-1-s" + }); + + var _createIcons = prototype._createIcons; + prototype._createIcons = function() { + if ( this.options.icons ) { + this.options.icons.activeHeader = this.options.icons.activeHeader || + this.options.icons.headerSelected; + } + _createIcons.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // expanded active option, activate method + (function( $, prototype ) { + prototype.activate = prototype._activate; + + var _findActive = prototype._findActive; + prototype._findActive = function( index ) { + if ( index === -1 ) { + index = false; + } + if ( index && typeof index !== "number" ) { + index = this.headers.index( this.headers.filter( index ) ); + if ( index === -1 ) { + index = false; + } + } + return _findActive.call( this, index ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // resize method + jQuery.ui.accordion.prototype.resize = jQuery.ui.accordion.prototype.refresh; + + // change events + (function( $, prototype ) { + $.extend( prototype.options, { + change: null, + changestart: null + }); + + var _trigger = prototype._trigger; + prototype._trigger = function( type, event, data ) { + var ret = _trigger.apply( this, arguments ); + if ( !ret ) { + return false; + } + + if ( type === "beforeActivate" ) { + ret = _trigger.call( this, "changestart", event, { + oldHeader: data.oldHeader, + oldContent: data.oldPanel, + newHeader: data.newHeader, + newContent: data.newPanel + }); + } else if ( type === "activate" ) { + ret = _trigger.call( this, "change", event, { + oldHeader: data.oldHeader, + oldContent: data.oldPanel, + newHeader: data.newHeader, + newContent: data.newPanel + }); + } + return ret; + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // animated option + // NOTE: this only provides support for "slide", "bounceslide", and easings + // not the full $.ui.accordion.animations API + (function( $, prototype ) { + $.extend( prototype.options, { + animate: null, + animated: "slide" + }); + + var _create = prototype._create; + prototype._create = function() { + var options = this.options; + if ( options.animate === null ) { + if ( !options.animated ) { + options.animate = false; + } else if ( options.animated === "slide" ) { + options.animate = 300; + } else if ( options.animated === "bounceslide" ) { + options.animate = { + duration: 200, + down: { + easing: "easeOutBounce", + duration: 1000 + } + }; + } else { + options.animate = options.animated; + } + } + + _create.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); +} + +})( jQuery ); +(function( $, undefined ) { + +// used to prevent race conditions with remote data sources +var requestIndex = 0; + +$.widget( "ui.autocomplete", { + version: "1.9.2", + defaultElement: "", + options: { + appendTo: "body", + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null, + + // callbacks + change: null, + close: null, + focus: null, + open: null, + response: null, + search: null, + select: null + }, + + pending: 0, + + _create: function() { + // Some browsers only repeat keydown events, not keypress events, + // so we use the suppressKeyPress flag to determine if we've already + // handled the keydown event. #7269 + // Unfortunately the code for & in keypress is the same as the up arrow, + // so we use the suppressKeyPressRepeat flag to avoid handling keypress + // events when we know the keydown event was used to modify the + // search term. #7799 + var suppressKeyPress, suppressKeyPressRepeat, suppressInput; + + this.isMultiLine = this._isMultiLine(); + this.valueMethod = this.element[ this.element.is( "input,textarea" ) ? "val" : "text" ]; + this.isNewMenu = true; + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ); + + this._on( this.element, { + keydown: function( event ) { + if ( this.element.prop( "readOnly" ) ) { + suppressKeyPress = true; + suppressInput = true; + suppressKeyPressRepeat = true; + return; + } + + suppressKeyPress = false; + suppressInput = false; + suppressKeyPressRepeat = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + suppressKeyPress = true; + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + suppressKeyPress = true; + this._move( "nextPage", event ); + break; + case keyCode.UP: + suppressKeyPress = true; + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + suppressKeyPress = true; + this._keyEvent( "next", event ); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( this.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + this.menu.select( event ); + } + break; + case keyCode.TAB: + if ( this.menu.active ) { + this.menu.select( event ); + } + break; + case keyCode.ESCAPE: + if ( this.menu.element.is( ":visible" ) ) { + this._value( this.term ); + this.close( event ); + // Different browsers have different default behavior for escape + // Single press can mean undo or clear + // Double press in IE means clear the whole form + event.preventDefault(); + } + break; + default: + suppressKeyPressRepeat = true; + // search timeout should be triggered before the input value is changed + this._searchTimeout( event ); + break; + } + }, + keypress: function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + event.preventDefault(); + return; + } + if ( suppressKeyPressRepeat ) { + return; + } + + // replicate some key handlers to allow them to repeat in Firefox and Opera + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + this._move( "nextPage", event ); + break; + case keyCode.UP: + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + this._keyEvent( "next", event ); + break; + } + }, + input: function( event ) { + if ( suppressInput ) { + suppressInput = false; + event.preventDefault(); + return; + } + this._searchTimeout( event ); + }, + focus: function() { + this.selectedItem = null; + this.previous = this._value(); + }, + blur: function( event ) { + if ( this.cancelBlur ) { + delete this.cancelBlur; + return; + } + + clearTimeout( this.searching ); + this.close( event ); + this._change( event ); + } + }); + + this._initSource(); + this.menu = $( "
          " ) + .addClass( "ui-autocomplete" ) + .appendTo( this.document.find( this.options.appendTo || "body" )[ 0 ] ) + .menu({ + // custom key handling for now + input: $(), + // disable ARIA support, the live region takes care of that + role: null + }) + .zIndex( this.element.zIndex() + 1 ) + .hide() + .data( "menu" ); + + this._on( this.menu.element, { + mousedown: function( event ) { + // prevent moving focus out of the text field + event.preventDefault(); + + // IE doesn't prevent moving focus even with event.preventDefault() + // so we set a flag to know when we should ignore the blur event + this.cancelBlur = true; + this._delay(function() { + delete this.cancelBlur; + }); + + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = this.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + this._delay(function() { + var that = this; + this.document.one( "mousedown", function( event ) { + if ( event.target !== that.element[ 0 ] && + event.target !== menuElement && + !$.contains( menuElement, event.target ) ) { + that.close(); + } + }); + }); + } + }, + menufocus: function( event, ui ) { + // #7024 - Prevent accidental activation of menu items in Firefox + if ( this.isNewMenu ) { + this.isNewMenu = false; + if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { + this.menu.blur(); + + this.document.one( "mousemove", function() { + $( event.target ).trigger( event.originalEvent ); + }); + + return; + } + } + + // back compat for _renderItem using item.autocomplete, via #7810 + // TODO remove the fallback, see #8156 + var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" ); + if ( false !== this._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { + this._value( item.value ); + } + } else { + // Normally the input is populated with the item's value as the + // menu is navigated, causing screen readers to notice a change and + // announce the item. Since the focus event was canceled, this doesn't + // happen, so we update the live region so that screen readers can + // still notice the change and announce it. + this.liveRegion.text( item.value ); + } + }, + menuselect: function( event, ui ) { + // back compat for _renderItem using item.autocomplete, via #7810 + // TODO remove the fallback, see #8156 + var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" ), + previous = this.previous; + + // only trigger when focus was lost (click on menu) + if ( this.element[0] !== this.document[0].activeElement ) { + this.element.focus(); + this.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + this._delay(function() { + this.previous = previous; + this.selectedItem = item; + }); + } + + if ( false !== this._trigger( "select", event, { item: item } ) ) { + this._value( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + this.term = this._value(); + + this.close( event ); + this.selectedItem = item; + } + }); + + this.liveRegion = $( "", { + role: "status", + "aria-live": "polite" + }) + .addClass( "ui-helper-hidden-accessible" ) + .insertAfter( this.element ); + + if ( $.fn.bgiframe ) { + this.menu.element.bgiframe(); + } + + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + this._on( this.window, { + beforeunload: function() { + this.element.removeAttr( "autocomplete" ); + } + }); + }, + + _destroy: function() { + clearTimeout( this.searching ); + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ); + this.menu.element.remove(); + this.liveRegion.remove(); + }, + + _setOption: function( key, value ) { + this._super( key, value ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( this.document.find( value || "body" )[0] ); + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _isMultiLine: function() { + // Textareas are always multi-line + if ( this.element.is( "textarea" ) ) { + return true; + } + // Inputs are always single-line, even if inside a contentEditable element + // IE also treats inputs as contentEditable + if ( this.element.is( "input" ) ) { + return false; + } + // All other element types are determined by whether or not they're contentEditable + return this.element.prop( "isContentEditable" ); + }, + + _initSource: function() { + var array, url, + that = this; + if ( $.isArray(this.options.source) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter( array, request.term ) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( that.xhr ) { + that.xhr.abort(); + } + that.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data ) { + response( data ); + }, + error: function() { + response( [] ); + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + _searchTimeout: function( event ) { + clearTimeout( this.searching ); + this.searching = this._delay(function() { + // only search if the value has changed + if ( this.term !== this._value() ) { + this.selectedItem = null; + this.search( null, event ); + } + }, this.options.delay ); + }, + + search: function( value, event ) { + value = value != null ? value : this._value(); + + // always save the actual value, not the one passed as an argument + this.term = this._value(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this.element.addClass( "ui-autocomplete-loading" ); + this.cancelSearch = false; + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var that = this, + index = ++requestIndex; + + return function( content ) { + if ( index === requestIndex ) { + that.__response( content ); + } + + that.pending--; + if ( !that.pending ) { + that.element.removeClass( "ui-autocomplete-loading" ); + } + }; + }, + + __response: function( content ) { + if ( content ) { + content = this._normalize( content ); + } + this._trigger( "response", null, { content: content } ); + if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { + this._suggest( content ); + this._trigger( "open" ); + } else { + // use ._close() instead of .close() so we don't cancel future searches + this._close(); + } + }, + + close: function( event ) { + this.cancelSearch = true; + this._close( event ); + }, + + _close: function( event ) { + if ( this.menu.element.is( ":visible" ) ) { + this.menu.element.hide(); + this.menu.blur(); + this.isNewMenu = true; + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this._value() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[0].label && items[0].value ) { + return items; + } + return $.map( items, function( item ) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend({ + label: item.label || item.value, + value: item.value || item.label + }, item ); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element + .empty() + .zIndex( this.element.zIndex() + 1 ); + this._renderMenu( ul, items ); + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position )); + + if ( this.options.autoFocus ) { + this.menu.next(); + } + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var that = this; + $.each( items, function( index, item ) { + that._renderItemData( ul, item ); + }); + }, + + _renderItemData: function( ul, item ) { + return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); + }, + + _renderItem: function( ul, item ) { + return $( "
        • " ) + .append( $( "" ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is( ":visible" ) ) { + this.search( null, event ); + return; + } + if ( this.menu.isFirstItem() && /^previous/.test( direction ) || + this.menu.isLastItem() && /^next/.test( direction ) ) { + this._value( this.term ); + this.menu.blur(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + + _value: function() { + return this.valueMethod.apply( this.element, arguments ); + }, + + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); + }, + filter: function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + + +// live region extension, adding a `messages` option +// NOTE: This is an experimental API. We are still investigating +// a full solution for string manipulation and internationalization. +$.widget( "ui.autocomplete", $.ui.autocomplete, { + options: { + messages: { + noResults: "No search results.", + results: function( amount ) { + return amount + ( amount > 1 ? " results are" : " result is" ) + + " available, use up and down arrow keys to navigate."; + } + } + }, + + __response: function( content ) { + var message; + this._superApply( arguments ); + if ( this.options.disabled || this.cancelSearch ) { + return; + } + if ( content && content.length ) { + message = this.options.messages.results( content.length ); + } else { + message = this.options.messages.noResults; + } + this.liveRegion.text( message ); + } +}); + + +}( jQuery )); +(function( $, undefined ) { + +var lastActive, startXPos, startYPos, clickDragged, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + stateClasses = "ui-state-hover ui-state-active ", + typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", + formResetHandler = function() { + var buttons = $( this ).find( ":ui-button" ); + setTimeout(function() { + buttons.button( "refresh" ); + }, 1 ); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + if ( form ) { + radios = $( form ).find( "[name='" + name + "']" ); + } else { + radios = $( "[name='" + name + "']", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + version: "1.9.2", + defaultElement: "').addClass(this._triggerClass). + html(buttonImage == '' ? buttonText : $('').attr( + { src:buttonImage, alt:buttonText, title:buttonText }))); + input[isRTL ? 'before' : 'after'](inst.trigger); + inst.trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) + $.datepicker._hideDatepicker(); + else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) { + $.datepicker._hideDatepicker(); + $.datepicker._showDatepicker(input[0]); + } else + $.datepicker._showDatepicker(input[0]); + return false; + }); + } + }, + + /* Apply the maximum length for the date format. */ + _autoSize: function(inst) { + if (this._get(inst, 'autoSize') && !inst.inline) { + var date = new Date(2009, 12 - 1, 20); // Ensure double digits + var dateFormat = this._get(inst, 'dateFormat'); + if (dateFormat.match(/[DM]/)) { + var findMax = function(names) { + var max = 0; + var maxI = 0; + for (var i = 0; i < names.length; i++) { + if (names[i].length > max) { + max = names[i].length; + maxI = i; + } + } + return maxI; + }; + date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? + 'monthNames' : 'monthNamesShort')))); + date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? + 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); + } + inst.input.attr('size', this._formatDate(inst, date).length); + } + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var divSpan = $(target); + if (divSpan.hasClass(this.markerClassName)) + return; + divSpan.addClass(this.markerClassName).append(inst.dpDiv). + bind("setData.datepicker", function(event, key, value){ + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key){ + return this._get(inst, key); + }); + $.data(target, PROP_NAME, inst); + this._setDate(inst, this._getDefaultDate(inst), true); + this._updateDatepicker(inst); + this._updateAlternate(inst); + //If disabled option is true, disable the datepicker before showing it (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements + // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height + inst.dpDiv.css( "display", "block" ); + }, + + /* Pop-up the date picker in a "dialog" box. + @param input element - ignored + @param date string or Date - the initial date to display + @param onSelect function - the function to call when a date is selected + @param settings object - update the dialog date picker instance's settings (anonymous object) + @param pos int[2] - coordinates for the dialog's position within the screen or + event - with x/y coordinates or + leave empty for default (screen centre) + @return the manager object */ + _dialogDatepicker: function(input, date, onSelect, settings, pos) { + var inst = this._dialogInst; // internal instance + if (!inst) { + this.uuid += 1; + var id = 'dp' + this.uuid; + this._dialogInput = $(''); + this._dialogInput.keydown(this._doKeyDown); + $('body').append(this._dialogInput); + inst = this._dialogInst = this._newInst(this._dialogInput, false); + inst.settings = {}; + $.data(this._dialogInput[0], PROP_NAME, inst); + } + extendRemove(inst.settings, settings || {}); + date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); + this._dialogInput.val(date); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + var browserWidth = document.documentElement.clientWidth; + var browserHeight = document.documentElement.clientHeight; + var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; + var scrollY = document.documentElement.scrollTop || document.body.scrollTop; + this._pos = // should use actual width/height below + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; + } + + // move input on screen for focus, but hidden behind dialog + this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); + inst.settings.onSelect = onSelect; + this._inDialog = true; + this.dpDiv.addClass(this._dialogClass); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) + $.blockUI(this.dpDiv); + $.data(this._dialogInput[0], PROP_NAME, inst); + return this; + }, + + /* Detach a datepicker from its control. + @param target element - the target input field or division or span */ + _destroyDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + $.removeData(target, PROP_NAME); + if (nodeName == 'input') { + inst.append.remove(); + inst.trigger.remove(); + $target.removeClass(this.markerClassName). + unbind('focus', this._showDatepicker). + unbind('keydown', this._doKeyDown). + unbind('keypress', this._doKeyPress). + unbind('keyup', this._doKeyUp); + } else if (nodeName == 'div' || nodeName == 'span') + $target.removeClass(this.markerClassName).empty(); + }, + + /* Enable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _enableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = false; + inst.trigger.filter('button'). + each(function() { this.disabled = false; }).end(). + filter('img').css({opacity: '1.0', cursor: ''}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().removeClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", false); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _disableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = true; + inst.trigger.filter('button'). + each(function() { this.disabled = true; }).end(). + filter('img').css({opacity: '0.5', cursor: 'default'}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().addClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", true); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + this._disabledInputs[this._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? + @param target element - the target input field or division or span + @return boolean - true if disabled, false if enabled */ + _isDisabledDatepicker: function(target) { + if (!target) { + return false; + } + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] == target) + return true; + } + return false; + }, + + /* Retrieve the instance data for the target control. + @param target element - the target input field or division or span + @return object - the associated instance data + @throws error if a jQuery problem getting data */ + _getInst: function(target) { + try { + return $.data(target, PROP_NAME); + } + catch (err) { + throw 'Missing instance data for this datepicker'; + } + }, + + /* Update or retrieve the settings for a date picker attached to an input field or division. + @param target element - the target input field or division or span + @param name object - the new settings to update or + string - the name of the setting to change or retrieve, + when retrieving also 'all' for all instance settings or + 'defaults' for all global defaults + @param value any - the new value for the setting + (omit if above is an object or to retrieve a value) */ + _optionDatepicker: function(target, name, value) { + var inst = this._getInst(target); + if (arguments.length == 2 && typeof name == 'string') { + return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : + (inst ? (name == 'all' ? $.extend({}, inst.settings) : + this._get(inst, name)) : null)); + } + var settings = name || {}; + if (typeof name == 'string') { + settings = {}; + settings[name] = value; + } + if (inst) { + if (this._curInst == inst) { + this._hideDatepicker(); + } + var date = this._getDateDatepicker(target, true); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + extendRemove(inst.settings, settings); + // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided + if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined) + inst.settings.minDate = this._formatDate(inst, minDate); + if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined) + inst.settings.maxDate = this._formatDate(inst, maxDate); + this._attachments($(target), inst); + this._autoSize(inst); + this._setDate(inst, date); + this._updateAlternate(inst); + this._updateDatepicker(inst); + } + }, + + // change method deprecated + _changeDatepicker: function(target, name, value) { + this._optionDatepicker(target, name, value); + }, + + /* Redraw the date picker attached to an input field or division. + @param target element - the target input field or division or span */ + _refreshDatepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. + @param target element - the target input field or division or span + @param date Date - the new date */ + _setDateDatepicker: function(target, date) { + var inst = this._getInst(target); + if (inst) { + this._setDate(inst, date); + this._updateDatepicker(inst); + this._updateAlternate(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + @param target element - the target input field or division or span + @param noDefault boolean - true if no default date is to be used + @return Date - the current date */ + _getDateDatepicker: function(target, noDefault) { + var inst = this._getInst(target); + if (inst && !inst.inline) + this._setDateFromField(inst, noDefault); + return (inst ? this._getDate(inst) : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(event) { + var inst = $.datepicker._getInst(event.target); + var handled = true; + var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); + inst._keyEvent = true; + if ($.datepicker._datepickerShowing) + switch (event.keyCode) { + case 9: $.datepicker._hideDatepicker(); + handled = false; + break; // hide on tab out + case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + + $.datepicker._currentClass + ')', inst.dpDiv); + if (sel[0]) + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); + var onSelect = $.datepicker._get(inst, 'onSelect'); + if (onSelect) { + var dateStr = $.datepicker._formatDate(inst); + + // trigger custom callback + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); + } + else + $.datepicker._hideDatepicker(); + return false; // don't submit the form + break; // select the value on enter + case 27: $.datepicker._hideDatepicker(); + break; // hide on escape + case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // next month/year on page down/+ ctrl + case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); + handled = event.ctrlKey || event.metaKey; + break; // clear on ctrl or command +end + case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); + handled = event.ctrlKey || event.metaKey; + break; // current on ctrl or command +home + case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); + handled = event.ctrlKey || event.metaKey; + // -1 day on ctrl or command +left + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +left on Mac + break; + case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // -1 week on ctrl or command +up + case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); + handled = event.ctrlKey || event.metaKey; + // +1 day on ctrl or command +right + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +right + break; + case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // +1 week on ctrl or command +down + default: handled = false; + } + else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + else { + handled = false; + } + if (handled) { + event.preventDefault(); + event.stopPropagation(); + } + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(event) { + var inst = $.datepicker._getInst(event.target); + if ($.datepicker._get(inst, 'constrainInput')) { + var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); + var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); + return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); + } + }, + + /* Synchronise manual entry and field/alternate field. */ + _doKeyUp: function(event) { + var inst = $.datepicker._getInst(event.target); + if (inst.input.val() != inst.lastVal) { + try { + var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + (inst.input ? inst.input.val() : null), + $.datepicker._getFormatConfig(inst)); + if (date) { // only if valid + $.datepicker._setDateFromField(inst); + $.datepicker._updateAlternate(inst); + $.datepicker._updateDatepicker(inst); + } + } + catch (err) { + $.datepicker.log(err); + } + } + return true; + }, + + /* Pop-up the date picker for a given input field. + If false returned from beforeShow event handler do not show. + @param input element - the input field attached to the date picker or + event - if triggered by focus */ + _showDatepicker: function(input) { + input = input.target || input; + if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger + input = $('input', input.parentNode)[0]; + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here + return; + var inst = $.datepicker._getInst(input); + if ($.datepicker._curInst && $.datepicker._curInst != inst) { + $.datepicker._curInst.dpDiv.stop(true, true); + if ( inst && $.datepicker._datepickerShowing ) { + $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] ); + } + } + var beforeShow = $.datepicker._get(inst, 'beforeShow'); + var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; + if(beforeShowSettings === false){ + //false + return; + } + extendRemove(inst.settings, beforeShowSettings); + inst.lastVal = null; + $.datepicker._lastInput = input; + $.datepicker._setDateFromField(inst); + if ($.datepicker._inDialog) // hide cursor + input.value = ''; + if (!$.datepicker._pos) { // position below input + $.datepicker._pos = $.datepicker._findPos(input); + $.datepicker._pos[1] += input.offsetHeight; // add the height + } + var isFixed = false; + $(input).parents().each(function() { + isFixed |= $(this).css('position') == 'fixed'; + return !isFixed; + }); + var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; + $.datepicker._pos = null; + //to avoid flashes on Firefox + inst.dpDiv.empty(); + // determine sizing offscreen + inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); + $.datepicker._updateDatepicker(inst); + // fix width for dynamic number of date pickers + // and adjust position before showing + offset = $.datepicker._checkOffset(inst, offset, isFixed); + inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? + 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', + left: offset.left + 'px', top: offset.top + 'px'}); + if (!inst.inline) { + var showAnim = $.datepicker._get(inst, 'showAnim'); + var duration = $.datepicker._get(inst, 'duration'); + var postProcess = function() { + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !! cover.length ){ + var borders = $.datepicker._getBorders(inst.dpDiv); + cover.css({left: -borders[0], top: -borders[1], + width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); + } + }; + inst.dpDiv.zIndex($(input).zIndex()+1); + $.datepicker._datepickerShowing = true; + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) + inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); + if (!showAnim || !duration) + postProcess(); + if (inst.input.is(':visible') && !inst.input.is(':disabled')) + inst.input.focus(); + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) + var borders = $.datepicker._getBorders(inst.dpDiv); + instActive = inst; // for delegate hover events + inst.dpDiv.empty().append(this._generateHTML(inst)); + this._attachHandlers(inst); + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6 + cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) + } + inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover(); + var numMonths = this._getNumberOfMonths(inst); + var cols = numMonths[1]; + var width = 17; + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); + if (cols > 1) + inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); + inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + + 'Class']('ui-datepicker-multi'); + inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + + 'Class']('ui-datepicker-rtl'); + if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement) + inst.input.focus(); + // deffered render of the years select (to avoid flashes on Firefox) + if( inst.yearshtml ){ + var origyearshtml = inst.yearshtml; + setTimeout(function(){ + //assure that inst.yearshtml didn't change. + if( origyearshtml === inst.yearshtml && inst.yearshtml ){ + inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml); + } + origyearshtml = inst.yearshtml = null; + }, 0); + } + }, + + /* Retrieve the size of left and top borders for an element. + @param elem (jQuery object) the element of interest + @return (number[2]) the left and top borders */ + _getBorders: function(elem) { + var convert = function(value) { + return {thin: 1, medium: 2, thick: 3}[value] || value; + }; + return [parseFloat(convert(elem.css('border-left-width'))), + parseFloat(convert(elem.css('border-top-width')))]; + }, + + /* Check positioning to remain on screen. */ + _checkOffset: function(inst, offset, isFixed) { + var dpWidth = inst.dpDiv.outerWidth(); + var dpHeight = inst.dpDiv.outerHeight(); + var inputWidth = inst.input ? inst.input.outerWidth() : 0; + var inputHeight = inst.input ? inst.input.outerHeight() : 0; + var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()); + var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); + + offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); + offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; + offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; + + // now check if datepicker is showing outside window viewport - move to a better place if so. + offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight) : 0); + + return offset; + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + var inst = this._getInst(obj); + var isRTL = this._get(inst, 'isRTL'); + while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { + obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; + } + var position = $(obj).offset(); + return [position.left, position.top]; + }, + + /* Hide the date picker from view. + @param input element - the input field attached to the date picker */ + _hideDatepicker: function(input) { + var inst = this._curInst; + if (!inst || (input && inst != $.data(input, PROP_NAME))) + return; + if (this._datepickerShowing) { + var showAnim = this._get(inst, 'showAnim'); + var duration = this._get(inst, 'duration'); + var postProcess = function() { + $.datepicker._tidyDialog(inst); + }; + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); + if (!showAnim) + postProcess(); + this._datepickerShowing = false; + var onClose = this._get(inst, 'onClose'); + if (onClose) + onClose.apply((inst.input ? inst.input[0] : null), + [(inst.input ? inst.input.val() : ''), inst]); + this._lastInput = null; + if (this._inDialog) { + this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); + if ($.blockUI) { + $.unblockUI(); + $('body').append(this.dpDiv); + } + } + this._inDialog = false; + } + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) + return; + + var $target = $(event.target), + inst = $.datepicker._getInst($target[0]); + + if ( ( ( $target[0].id != $.datepicker._mainDivId && + $target.parents('#' + $.datepicker._mainDivId).length == 0 && + !$target.hasClass($.datepicker.markerClassName) && + !$target.closest("." + $.datepicker._triggerClass).length && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) || + ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) ) + $.datepicker._hideDatepicker(); + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._isDisabledDatepicker(target[0])) { + return; + } + this._adjustInstDate(inst, offset + + (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning + period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._get(inst, 'gotoCurrent') && inst.currentDay) { + inst.selectedDay = inst.currentDay; + inst.drawMonth = inst.selectedMonth = inst.currentMonth; + inst.drawYear = inst.selectedYear = inst.currentYear; + } + else { + var date = new Date(); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + } + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var target = $(id); + var inst = this._getInst(target[0]); + inst['selected' + (period == 'M' ? 'Month' : 'Year')] = + inst['draw' + (period == 'M' ? 'Month' : 'Year')] = + parseInt(select.options[select.selectedIndex].value,10); + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + var target = $(id); + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { + return; + } + var inst = this._getInst(target[0]); + inst.selectedDay = inst.currentDay = $('a', td).html(); + inst.selectedMonth = inst.currentMonth = month; + inst.selectedYear = inst.currentYear = year; + this._selectDate(id, this._formatDate(inst, + inst.currentDay, inst.currentMonth, inst.currentYear)); + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + this._selectDate(target, ''); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var target = $(id); + var inst = this._getInst(target[0]); + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); + if (inst.input) + inst.input.val(dateStr); + this._updateAlternate(inst); + var onSelect = this._get(inst, 'onSelect'); + if (onSelect) + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback + else if (inst.input) + inst.input.trigger('change'); // fire the change event + if (inst.inline) + this._updateDatepicker(inst); + else { + this._hideDatepicker(); + this._lastInput = inst.input[0]; + if (typeof(inst.input[0]) != 'object') + inst.input.focus(); // restore focus + this._lastInput = null; + } + }, + + /* Update any alternate field to synchronise with the main field. */ + _updateAlternate: function(inst) { + var altField = this._get(inst, 'altField'); + if (altField) { // update alternate field too + var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); + var date = this._getDate(inst); + var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); + $(altField).each(function() { $(this).val(dateStr); }); + } + }, + + /* Set as beforeShowDay function to prevent selection of weekends. + @param date Date - the date to customise + @return [boolean, string] - is this date selectable?, what is its CSS class? */ + noWeekends: function(date) { + var day = date.getDay(); + return [(day > 0 && day < 6), '']; + }, + + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. + @param date Date - the date to get the week for + @return number - the number of the week within the year that contains this date */ + iso8601Week: function(date) { + var checkDate = new Date(date.getTime()); + // Find Thursday of this week starting on Monday + checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); + var time = checkDate.getTime(); + checkDate.setMonth(0); // Compare with Jan 1 + checkDate.setDate(1); + return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; + }, + + /* Parse a string value into a date object. + See formatDate below for the possible formats. + + @param format string - the expected format of the date + @param value string - the date in the above format + @param settings Object - attributes include: + shortYearCutoff number - the cutoff year for determining the century (optional) + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return Date - the extracted date value or null if value is blank */ + parseDate: function (format, value, settings) { + if (format == null || value == null) + throw 'Invalid arguments'; + value = (typeof value == 'object' ? value.toString() : value + ''); + if (value == '') + return null; + var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + var year = -1; + var month = -1; + var day = -1; + var doy = -1; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Extract a number from the string value + var getNumber = function(match) { + var isDoubled = lookAhead(match); + var size = (match == '@' ? 14 : (match == '!' ? 20 : + (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2)))); + var digits = new RegExp('^\\d{1,' + size + '}'); + var num = value.substring(iValue).match(digits); + if (!num) + throw 'Missing number at position ' + iValue; + iValue += num[0].length; + return parseInt(num[0], 10); + }; + // Extract a name from the string value and convert to an index + var getName = function(match, shortNames, longNames) { + var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { + return [ [k, v] ]; + }).sort(function (a, b) { + return -(a[1].length - b[1].length); + }); + var index = -1; + $.each(names, function (i, pair) { + var name = pair[1]; + if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) { + index = pair[0]; + iValue += name.length; + return false; + } + }); + if (index != -1) + return index + 1; + else + throw 'Unknown name at position ' + iValue; + }; + // Confirm that a literal character matches the string value + var checkLiteral = function() { + if (value.charAt(iValue) != format.charAt(iFormat)) + throw 'Unexpected literal at position ' + iValue; + iValue++; + }; + var iValue = 0; + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + checkLiteral(); + else + switch (format.charAt(iFormat)) { + case 'd': + day = getNumber('d'); + break; + case 'D': + getName('D', dayNamesShort, dayNames); + break; + case 'o': + doy = getNumber('o'); + break; + case 'm': + month = getNumber('m'); + break; + case 'M': + month = getName('M', monthNamesShort, monthNames); + break; + case 'y': + year = getNumber('y'); + break; + case '@': + var date = new Date(getNumber('@')); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case '!': + var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "'": + if (lookAhead("'")) + checkLiteral(); + else + literal = true; + break; + default: + checkLiteral(); + } + } + if (iValue < value.length){ + var extra = value.substr(iValue); + if (!/^\s+/.test(extra)) { + throw "Extra/unparsed characters found in date: " + extra; + } + } + if (year == -1) + year = new Date().getFullYear(); + else if (year < 100) + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + if (doy > -1) { + month = 1; + day = doy; + do { + var dim = this._getDaysInMonth(year, month - 1); + if (day <= dim) + break; + month++; + day -= dim; + } while (true); + } + var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); + if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) + throw 'Invalid date'; // E.g. 31/02/00 + return date; + }, + + /* Standard date formats. */ + ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) + COOKIE: 'D, dd M yy', + ISO_8601: 'yy-mm-dd', + RFC_822: 'D, d M y', + RFC_850: 'DD, dd-M-y', + RFC_1036: 'D, d M y', + RFC_1123: 'D, d M yy', + RFC_2822: 'D, d M yy', + RSS: 'D, d M y', // RFC 822 + TICKS: '!', + TIMESTAMP: '@', + W3C: 'yy-mm-dd', // ISO 8601 + + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), + + /* Format a date object into a string value. + The format can be combinations of the following: + d - day of month (no leading zero) + dd - day of month (two digit) + o - day of year (no leading zeros) + oo - day of year (three digit) + D - day name short + DD - day name long + m - month of year (no leading zero) + mm - month of year (two digit) + M - month name short + MM - month name long + y - year (two digit) + yy - year (four digit) + @ - Unix timestamp (ms since 01/01/1970) + ! - Windows ticks (100ns since 01/01/0001) + '...' - literal text + '' - single quote + + @param format string - the desired format of the date + @param date Date - the date value to format + @param settings Object - attributes include: + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return string - the date in the above format */ + formatDate: function (format, date, settings) { + if (!date) + return ''; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Format a number, with leading zero if necessary + var formatNumber = function(match, value, len) { + var num = '' + value; + if (lookAhead(match)) + while (num.length < len) + num = '0' + num; + return num; + }; + // Format a name, short or long as requested + var formatName = function(match, value, shortNames, longNames) { + return (lookAhead(match) ? longNames[value] : shortNames[value]); + }; + var output = ''; + var literal = false; + if (date) + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + output += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': + output += formatNumber('d', date.getDate(), 2); + break; + case 'D': + output += formatName('D', date.getDay(), dayNamesShort, dayNames); + break; + case 'o': + output += formatNumber('o', + Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); + break; + case 'm': + output += formatNumber('m', date.getMonth() + 1, 2); + break; + case 'M': + output += formatName('M', date.getMonth(), monthNamesShort, monthNames); + break; + case 'y': + output += (lookAhead('y') ? date.getFullYear() : + (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); + break; + case '@': + output += date.getTime(); + break; + case '!': + output += date.getTime() * 10000 + this._ticksTo1970; + break; + case "'": + if (lookAhead("'")) + output += "'"; + else + literal = true; + break; + default: + output += format.charAt(iFormat); + } + } + return output; + }, + + /* Extract all possible characters from the date format. */ + _possibleChars: function (format) { + var chars = ''; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + for (var iFormat = 0; iFormat < format.length; iFormat++) + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + chars += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': case 'm': case 'y': case '@': + chars += '0123456789'; + break; + case 'D': case 'M': + return null; // Accept anything + case "'": + if (lookAhead("'")) + chars += "'"; + else + literal = true; + break; + default: + chars += format.charAt(iFormat); + } + return chars; + }, + + /* Get a setting value, defaulting if necessary. */ + _get: function(inst, name) { + return inst.settings[name] !== undefined ? + inst.settings[name] : this._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(inst, noDefault) { + if (inst.input.val() == inst.lastVal) { + return; + } + var dateFormat = this._get(inst, 'dateFormat'); + var dates = inst.lastVal = inst.input ? inst.input.val() : null; + var date, defaultDate; + date = defaultDate = this._getDefaultDate(inst); + var settings = this._getFormatConfig(inst); + try { + date = this.parseDate(dateFormat, dates, settings) || defaultDate; + } catch (event) { + this.log(event); + dates = (noDefault ? '' : dates); + } + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + inst.currentDay = (dates ? date.getDate() : 0); + inst.currentMonth = (dates ? date.getMonth() : 0); + inst.currentYear = (dates ? date.getFullYear() : 0); + this._adjustInstDate(inst); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function(inst) { + return this._restrictMinMax(inst, + this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(inst, date, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }; + var offsetString = function(offset) { + try { + return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + offset, $.datepicker._getFormatConfig(inst)); + } + catch (e) { + // Ignore + } + var date = (offset.toLowerCase().match(/^c/) ? + $.datepicker._getDate(inst) : null) || new Date(); + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; + var matches = pattern.exec(offset); + while (matches) { + switch (matches[2] || 'd') { + case 'd' : case 'D' : + day += parseInt(matches[1],10); break; + case 'w' : case 'W' : + day += parseInt(matches[1],10) * 7; break; + case 'm' : case 'M' : + month += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + case 'y': case 'Y' : + year += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day); + }; + var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) : + (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); + newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate); + if (newDate) { + newDate.setHours(0); + newDate.setMinutes(0); + newDate.setSeconds(0); + newDate.setMilliseconds(0); + } + return this._daylightSavingAdjust(newDate); + }, + + /* Handle switch to/from daylight saving. + Hours may be non-zero on daylight saving cut-over: + > 12 when midnight changeover, but then cannot generate + midnight datetime, so jump to 1AM, otherwise reset. + @param date (Date) the date to check + @return (Date) the corrected date */ + _daylightSavingAdjust: function(date) { + if (!date) return null; + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); + return date; + }, + + /* Set the date(s) directly. */ + _setDate: function(inst, date, noChange) { + var clear = !date; + var origMonth = inst.selectedMonth; + var origYear = inst.selectedYear; + var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); + inst.selectedDay = inst.currentDay = newDate.getDate(); + inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); + inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); + if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) + this._notifyChange(inst); + this._adjustInstDate(inst); + if (inst.input) { + inst.input.val(clear ? '' : this._formatDate(inst)); + } + }, + + /* Retrieve the date(s) directly. */ + _getDate: function(inst) { + var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : + this._daylightSavingAdjust(new Date( + inst.currentYear, inst.currentMonth, inst.currentDay))); + return startDate; + }, + + /* Attach the onxxx handlers. These are declared statically so + * they work with static code transformers like Caja. + */ + _attachHandlers: function(inst) { + var stepMonths = this._get(inst, 'stepMonths'); + var id = '#' + inst.id.replace( /\\\\/g, "\\" ); + inst.dpDiv.find('[data-handler]').map(function () { + var handler = { + prev: function () { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, -stepMonths, 'M'); + }, + next: function () { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, +stepMonths, 'M'); + }, + hide: function () { + window['DP_jQuery_' + dpuuid].datepicker._hideDatepicker(); + }, + today: function () { + window['DP_jQuery_' + dpuuid].datepicker._gotoToday(id); + }, + selectDay: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectDay(id, +this.getAttribute('data-month'), +this.getAttribute('data-year'), this); + return false; + }, + selectMonth: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'M'); + return false; + }, + selectYear: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'Y'); + return false; + } + }; + $(this).bind(this.getAttribute('data-event'), handler[this.getAttribute('data-handler')]); + }); + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateHTML: function(inst) { + var today = new Date(); + today = this._daylightSavingAdjust( + new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time + var isRTL = this._get(inst, 'isRTL'); + var showButtonPanel = this._get(inst, 'showButtonPanel'); + var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); + var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); + var numMonths = this._getNumberOfMonths(inst); + var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); + var stepMonths = this._get(inst, 'stepMonths'); + var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); + var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var drawMonth = inst.drawMonth - showCurrentAtPos; + var drawYear = inst.drawYear; + if (drawMonth < 0) { + drawMonth += 12; + drawYear--; + } + if (maxDate) { + var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), + maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + inst.drawMonth = drawMonth; + inst.drawYear = drawYear; + var prevText = this._get(inst, 'prevText'); + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), + this._getFormatConfig(inst))); + var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? + '' + prevText + '' : + (hideIfNoPrevNext ? '' : '' + prevText + '')); + var nextText = this._get(inst, 'nextText'); + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), + this._getFormatConfig(inst))); + var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? + '' + nextText + '' : + (hideIfNoPrevNext ? '' : '' + nextText + '')); + var currentText = this._get(inst, 'currentText'); + var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); + currentText = (!navigationAsDateFormat ? currentText : + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); + var controls = (!inst.inline ? '' : ''); + var buttonPanel = (showButtonPanel) ? '
          ' + (isRTL ? controls : '') + + (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
          ' : ''; + var firstDay = parseInt(this._get(inst, 'firstDay'),10); + firstDay = (isNaN(firstDay) ? 0 : firstDay); + var showWeek = this._get(inst, 'showWeek'); + var dayNames = this._get(inst, 'dayNames'); + var dayNamesShort = this._get(inst, 'dayNamesShort'); + var dayNamesMin = this._get(inst, 'dayNamesMin'); + var monthNames = this._get(inst, 'monthNames'); + var monthNamesShort = this._get(inst, 'monthNamesShort'); + var beforeShowDay = this._get(inst, 'beforeShowDay'); + var showOtherMonths = this._get(inst, 'showOtherMonths'); + var selectOtherMonths = this._get(inst, 'selectOtherMonths'); + var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; + var defaultDate = this._getDefaultDate(inst); + var html = ''; + for (var row = 0; row < numMonths[0]; row++) { + var group = ''; + this.maxRows = 4; + for (var col = 0; col < numMonths[1]; col++) { + var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); + var cornerClass = ' ui-corner-all'; + var calender = ''; + if (isMultiMonth) { + calender += '
          '; + } + calender += '
          ' + + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, + row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers + '
          ' + + ''; + var thead = (showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // days of the week + var day = (dow + firstDay) % 7; + thead += '= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + + '' + dayNamesMin[day] + ''; + } + calender += thead + ''; + var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); + var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate + var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) + this.maxRows = numRows; + var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); + for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows + calender += ''; + var tbody = (!showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // create date picker days + var daySettings = (beforeShowDay ? + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); + var otherMonth = (printDate.getMonth() != drawMonth); + var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + tbody += ''; // display selectable date + printDate.setDate(printDate.getDate() + 1); + printDate = this._daylightSavingAdjust(printDate); + } + calender += tbody + ''; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + calender += '
          ' + this._get(inst, 'weekHeader') + '
          ' + + this._get(inst, 'calculateWeek')(printDate) + '' + // actions + (otherMonth && !showOtherMonths ? ' ' : // display for other months + (unselectable ? '' + printDate.getDate() + '' : '' + printDate.getDate() + '')) + '
          ' + (isMultiMonth ? '
          ' + + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
          ' : '') : ''); + group += calender; + } + html += group; + } + html += buttonPanel + ($.ui.ie6 && !inst.inline ? + '' : ''); + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + var changeMonth = this._get(inst, 'changeMonth'); + var changeYear = this._get(inst, 'changeYear'); + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); + var html = '
          '; + var monthHtml = ''; + // month selection + if (secondary || !changeMonth) + monthHtml += '' + monthNames[drawMonth] + ''; + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + monthHtml += ''; + } + if (!showMonthAfterYear) + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); + // year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ''; + if (secondary || !changeYear) + html += '' + drawYear + ''; + else { + // determine range of years to display + var years = this._get(inst, 'yearRange').split(':'); + var thisYear = new Date().getFullYear(); + var determineYear = function(value) { + var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + var year = determineYear(years[0]); + var endYear = Math.max(year, determineYear(years[1] || '')); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += ''; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + html += this._get(inst, 'yearSuffix'); + if (showMonthAfterYear) + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; + html += '
          '; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period == 'Y' ? offset : 0); + var month = inst.drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = this._restrictMinMax(inst, + this._daylightSavingAdjust(new Date(year, month, day))); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period == 'M' || period == 'Y') + this._notifyChange(inst); + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var newDate = (minDate && date < minDate ? minDate : date); + newDate = (maxDate && newDate > maxDate ? maxDate : newDate); + return newDate; + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, 'onChangeMonthYear'); + if (onChange) + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, 'numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst); + var date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime())); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), + monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); + } +}); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function bindHover(dpDiv) { + var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; + return dpDiv.delegate(selector, 'mouseout', function() { + $(this).removeClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); + }) + .delegate(selector, 'mouseover', function(){ + if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { + $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + $(this).addClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); + } + }); +} + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null || props[name] == undefined) + target[name] = props[name]; + return target; +}; + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick). + find(document.body).append($.datepicker.dpDiv); + $.datepicker.initialized = true; + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + return this.each(function() { + typeof options == 'string' ? + $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.9.2"; + +// Workaround for #4055 +// Add another global to avoid noConflict issues with inline event handlers +window['DP_jQuery_' + dpuuid] = $; + +})(jQuery); +(function( $, undefined ) { + +var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ", + sizeRelatedOptions = { + buttons: true, + height: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + width: true + }, + resizableRelatedOptions = { + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true + }; + +$.widget("ui.dialog", { + version: "1.9.2", + options: { + autoOpen: true, + buttons: {}, + closeOnEscape: true, + closeText: "close", + dialogClass: "", + draggable: true, + hide: null, + height: "auto", + maxHeight: false, + maxWidth: false, + minHeight: 150, + minWidth: 150, + modal: false, + position: { + my: "center", + at: "center", + of: window, + collision: "fit", + // ensure that the titlebar is never outside the document + using: function( pos ) { + var topOffset = $( this ).css( pos ).offset().top; + if ( topOffset < 0 ) { + $( this ).css( "top", pos.top - topOffset ); + } + } + }, + resizable: true, + show: null, + stack: true, + title: "", + width: 300, + zIndex: 1000 + }, + + _create: function() { + this.originalTitle = this.element.attr( "title" ); + // #5742 - .attr() might return a DOMElement + if ( typeof this.originalTitle !== "string" ) { + this.originalTitle = ""; + } + this.oldPosition = { + parent: this.element.parent(), + index: this.element.parent().children().index( this.element ) + }; + this.options.title = this.options.title || this.originalTitle; + var that = this, + options = this.options, + + title = options.title || " ", + uiDialog, + uiDialogTitlebar, + uiDialogTitlebarClose, + uiDialogTitle, + uiDialogButtonPane; + + uiDialog = ( this.uiDialog = $( "
          " ) ) + .addClass( uiDialogClasses + options.dialogClass ) + .css({ + display: "none", + outline: 0, // TODO: move to stylesheet + zIndex: options.zIndex + }) + // setting tabIndex makes the div focusable + .attr( "tabIndex", -1) + .keydown(function( event ) { + if ( options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + that.close( event ); + event.preventDefault(); + } + }) + .mousedown(function( event ) { + that.moveToTop( false, event ); + }) + .appendTo( "body" ); + + this.element + .show() + .removeAttr( "title" ) + .addClass( "ui-dialog-content ui-widget-content" ) + .appendTo( uiDialog ); + + uiDialogTitlebar = ( this.uiDialogTitlebar = $( "
          " ) ) + .addClass( "ui-dialog-titlebar ui-widget-header " + + "ui-corner-all ui-helper-clearfix" ) + .bind( "mousedown", function() { + // Dialog isn't getting focus when dragging (#8063) + uiDialog.focus(); + }) + .prependTo( uiDialog ); + + uiDialogTitlebarClose = $( "" ) + .addClass( "ui-dialog-titlebar-close ui-corner-all" ) + .attr( "role", "button" ) + .click(function( event ) { + event.preventDefault(); + that.close( event ); + }) + .appendTo( uiDialogTitlebar ); + + ( this.uiDialogTitlebarCloseText = $( "" ) ) + .addClass( "ui-icon ui-icon-closethick" ) + .text( options.closeText ) + .appendTo( uiDialogTitlebarClose ); + + uiDialogTitle = $( "" ) + .uniqueId() + .addClass( "ui-dialog-title" ) + .html( title ) + .prependTo( uiDialogTitlebar ); + + uiDialogButtonPane = ( this.uiDialogButtonPane = $( "
          " ) ) + .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ); + + ( this.uiButtonSet = $( "
          " ) ) + .addClass( "ui-dialog-buttonset" ) + .appendTo( uiDialogButtonPane ); + + uiDialog.attr({ + role: "dialog", + "aria-labelledby": uiDialogTitle.attr( "id" ) + }); + + uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection(); + this._hoverable( uiDialogTitlebarClose ); + this._focusable( uiDialogTitlebarClose ); + + if ( options.draggable && $.fn.draggable ) { + this._makeDraggable(); + } + if ( options.resizable && $.fn.resizable ) { + this._makeResizable(); + } + + this._createButtons( options.buttons ); + this._isOpen = false; + + if ( $.fn.bgiframe ) { + uiDialog.bgiframe(); + } + + // prevent tabbing out of modal dialogs + this._on( uiDialog, { keydown: function( event ) { + if ( !options.modal || event.keyCode !== $.ui.keyCode.TAB ) { + return; + } + + var tabbables = $( ":tabbable", uiDialog ), + first = tabbables.filter( ":first" ), + last = tabbables.filter( ":last" ); + + if ( event.target === last[0] && !event.shiftKey ) { + first.focus( 1 ); + return false; + } else if ( event.target === first[0] && event.shiftKey ) { + last.focus( 1 ); + return false; + } + }}); + }, + + _init: function() { + if ( this.options.autoOpen ) { + this.open(); + } + }, + + _destroy: function() { + var next, + oldPosition = this.oldPosition; + + if ( this.overlay ) { + this.overlay.destroy(); + } + this.uiDialog.hide(); + this.element + .removeClass( "ui-dialog-content ui-widget-content" ) + .hide() + .appendTo( "body" ); + this.uiDialog.remove(); + + if ( this.originalTitle ) { + this.element.attr( "title", this.originalTitle ); + } + + next = oldPosition.parent.children().eq( oldPosition.index ); + // Don't try to place the dialog next to itself (#8613) + if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { + next.before( this.element ); + } else { + oldPosition.parent.append( this.element ); + } + }, + + widget: function() { + return this.uiDialog; + }, + + close: function( event ) { + var that = this, + maxZ, thisZ; + + if ( !this._isOpen ) { + return; + } + + if ( false === this._trigger( "beforeClose", event ) ) { + return; + } + + this._isOpen = false; + + if ( this.overlay ) { + this.overlay.destroy(); + } + + if ( this.options.hide ) { + this._hide( this.uiDialog, this.options.hide, function() { + that._trigger( "close", event ); + }); + } else { + this.uiDialog.hide(); + this._trigger( "close", event ); + } + + $.ui.dialog.overlay.resize(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + if ( this.options.modal ) { + maxZ = 0; + $( ".ui-dialog" ).each(function() { + if ( this !== that.uiDialog[0] ) { + thisZ = $( this ).css( "z-index" ); + if ( !isNaN( thisZ ) ) { + maxZ = Math.max( maxZ, thisZ ); + } + } + }); + $.ui.dialog.maxZ = maxZ; + } + + return this; + }, + + isOpen: function() { + return this._isOpen; + }, + + // the force parameter allows us to move modal dialogs to their correct + // position on open + moveToTop: function( force, event ) { + var options = this.options, + saveScroll; + + if ( ( options.modal && !force ) || + ( !options.stack && !options.modal ) ) { + return this._trigger( "focus", event ); + } + + if ( options.zIndex > $.ui.dialog.maxZ ) { + $.ui.dialog.maxZ = options.zIndex; + } + if ( this.overlay ) { + $.ui.dialog.maxZ += 1; + $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ; + this.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ ); + } + + // Save and then restore scroll + // Opera 9.5+ resets when parent z-index is changed. + // http://bugs.jqueryui.com/ticket/3193 + saveScroll = { + scrollTop: this.element.scrollTop(), + scrollLeft: this.element.scrollLeft() + }; + $.ui.dialog.maxZ += 1; + this.uiDialog.css( "z-index", $.ui.dialog.maxZ ); + this.element.attr( saveScroll ); + this._trigger( "focus", event ); + + return this; + }, + + open: function() { + if ( this._isOpen ) { + return; + } + + var hasFocus, + options = this.options, + uiDialog = this.uiDialog; + + this._size(); + this._position( options.position ); + uiDialog.show( options.show ); + this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null; + this.moveToTop( true ); + + // set focus to the first tabbable element in the content area or the first button + // if there are no tabbable elements, set focus on the dialog itself + hasFocus = this.element.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = uiDialog; + } + } + hasFocus.eq( 0 ).focus(); + + this._isOpen = true; + this._trigger( "open" ); + + return this; + }, + + _createButtons: function( buttons ) { + var that = this, + hasButtons = false; + + // if we already have a button pane, remove it + this.uiDialogButtonPane.remove(); + this.uiButtonSet.empty(); + + if ( typeof buttons === "object" && buttons !== null ) { + $.each( buttons, function() { + return !(hasButtons = true); + }); + } + if ( hasButtons ) { + $.each( buttons, function( name, props ) { + var button, click; + props = $.isFunction( props ) ? + { click: props, text: name } : + props; + // Default to a non-submitting button + props = $.extend( { type: "button" }, props ); + // Change the context for the click callback to be the main element + click = props.click; + props.click = function() { + click.apply( that.element[0], arguments ); + }; + button = $( "", props ) + .appendTo( that.uiButtonSet ); + if ( $.fn.button ) { + button.button(); + } + }); + this.uiDialog.addClass( "ui-dialog-buttons" ); + this.uiDialogButtonPane.appendTo( this.uiDialog ); + } else { + this.uiDialog.removeClass( "ui-dialog-buttons" ); + } + }, + + _makeDraggable: function() { + var that = this, + options = this.options; + + function filteredUi( ui ) { + return { + position: ui.position, + offset: ui.offset + }; + } + + this.uiDialog.draggable({ + cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", + handle: ".ui-dialog-titlebar", + containment: "document", + start: function( event, ui ) { + $( this ) + .addClass( "ui-dialog-dragging" ); + that._trigger( "dragStart", event, filteredUi( ui ) ); + }, + drag: function( event, ui ) { + that._trigger( "drag", event, filteredUi( ui ) ); + }, + stop: function( event, ui ) { + options.position = [ + ui.position.left - that.document.scrollLeft(), + ui.position.top - that.document.scrollTop() + ]; + $( this ) + .removeClass( "ui-dialog-dragging" ); + that._trigger( "dragStop", event, filteredUi( ui ) ); + $.ui.dialog.overlay.resize(); + } + }); + }, + + _makeResizable: function( handles ) { + handles = (handles === undefined ? this.options.resizable : handles); + var that = this, + options = this.options, + // .ui-resizable has position: relative defined in the stylesheet + // but dialogs have to use absolute or fixed positioning + position = this.uiDialog.css( "position" ), + resizeHandles = typeof handles === 'string' ? + handles : + "n,e,s,w,se,sw,ne,nw"; + + function filteredUi( ui ) { + return { + originalPosition: ui.originalPosition, + originalSize: ui.originalSize, + position: ui.position, + size: ui.size + }; + } + + this.uiDialog.resizable({ + cancel: ".ui-dialog-content", + containment: "document", + alsoResize: this.element, + maxWidth: options.maxWidth, + maxHeight: options.maxHeight, + minWidth: options.minWidth, + minHeight: this._minHeight(), + handles: resizeHandles, + start: function( event, ui ) { + $( this ).addClass( "ui-dialog-resizing" ); + that._trigger( "resizeStart", event, filteredUi( ui ) ); + }, + resize: function( event, ui ) { + that._trigger( "resize", event, filteredUi( ui ) ); + }, + stop: function( event, ui ) { + $( this ).removeClass( "ui-dialog-resizing" ); + options.height = $( this ).height(); + options.width = $( this ).width(); + that._trigger( "resizeStop", event, filteredUi( ui ) ); + $.ui.dialog.overlay.resize(); + } + }) + .css( "position", position ) + .find( ".ui-resizable-se" ) + .addClass( "ui-icon ui-icon-grip-diagonal-se" ); + }, + + _minHeight: function() { + var options = this.options; + + if ( options.height === "auto" ) { + return options.minHeight; + } else { + return Math.min( options.minHeight, options.height ); + } + }, + + _position: function( position ) { + var myAt = [], + offset = [ 0, 0 ], + isVisible; + + if ( position ) { + // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( + // if (typeof position == 'string' || $.isArray(position)) { + // myAt = $.isArray(position) ? position : position.split(' '); + + if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) { + myAt = position.split ? position.split( " " ) : [ position[ 0 ], position[ 1 ] ]; + if ( myAt.length === 1 ) { + myAt[ 1 ] = myAt[ 0 ]; + } + + $.each( [ "left", "top" ], function( i, offsetPosition ) { + if ( +myAt[ i ] === myAt[ i ] ) { + offset[ i ] = myAt[ i ]; + myAt[ i ] = offsetPosition; + } + }); + + position = { + my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " + + myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]), + at: myAt.join( " " ) + }; + } + + position = $.extend( {}, $.ui.dialog.prototype.options.position, position ); + } else { + position = $.ui.dialog.prototype.options.position; + } + + // need to show the dialog to get the actual offset in the position plugin + isVisible = this.uiDialog.is( ":visible" ); + if ( !isVisible ) { + this.uiDialog.show(); + } + this.uiDialog.position( position ); + if ( !isVisible ) { + this.uiDialog.hide(); + } + }, + + _setOptions: function( options ) { + var that = this, + resizableOptions = {}, + resize = false; + + $.each( options, function( key, value ) { + that._setOption( key, value ); + + if ( key in sizeRelatedOptions ) { + resize = true; + } + if ( key in resizableRelatedOptions ) { + resizableOptions[ key ] = value; + } + }); + + if ( resize ) { + this._size(); + } + if ( this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", resizableOptions ); + } + }, + + _setOption: function( key, value ) { + var isDraggable, isResizable, + uiDialog = this.uiDialog; + + switch ( key ) { + case "buttons": + this._createButtons( value ); + break; + case "closeText": + // ensure that we always pass a string + this.uiDialogTitlebarCloseText.text( "" + value ); + break; + case "dialogClass": + uiDialog + .removeClass( this.options.dialogClass ) + .addClass( uiDialogClasses + value ); + break; + case "disabled": + if ( value ) { + uiDialog.addClass( "ui-dialog-disabled" ); + } else { + uiDialog.removeClass( "ui-dialog-disabled" ); + } + break; + case "draggable": + isDraggable = uiDialog.is( ":data(draggable)" ); + if ( isDraggable && !value ) { + uiDialog.draggable( "destroy" ); + } + + if ( !isDraggable && value ) { + this._makeDraggable(); + } + break; + case "position": + this._position( value ); + break; + case "resizable": + // currently resizable, becoming non-resizable + isResizable = uiDialog.is( ":data(resizable)" ); + if ( isResizable && !value ) { + uiDialog.resizable( "destroy" ); + } + + // currently resizable, changing handles + if ( isResizable && typeof value === "string" ) { + uiDialog.resizable( "option", "handles", value ); + } + + // currently non-resizable, becoming resizable + if ( !isResizable && value !== false ) { + this._makeResizable( value ); + } + break; + case "title": + // convert whatever was passed in o a string, for html() to not throw up + $( ".ui-dialog-title", this.uiDialogTitlebar ) + .html( "" + ( value || " " ) ); + break; + } + + this._super( key, value ); + }, + + _size: function() { + /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content + * divs will both have width and height set, so we need to reset them + */ + var nonContentHeight, minContentHeight, autoHeight, + options = this.options, + isVisible = this.uiDialog.is( ":visible" ); + + // reset content sizing + this.element.show().css({ + width: "auto", + minHeight: 0, + height: 0 + }); + + if ( options.minWidth > options.width ) { + options.width = options.minWidth; + } + + // reset wrapper sizing + // determine the height of all the non-content elements + nonContentHeight = this.uiDialog.css({ + height: "auto", + width: options.width + }) + .outerHeight(); + minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); + + if ( options.height === "auto" ) { + // only needed for IE6 support + if ( $.support.minHeight ) { + this.element.css({ + minHeight: minContentHeight, + height: "auto" + }); + } else { + this.uiDialog.show(); + autoHeight = this.element.css( "height", "auto" ).height(); + if ( !isVisible ) { + this.uiDialog.hide(); + } + this.element.height( Math.max( autoHeight, minContentHeight ) ); + } + } else { + this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); + } + + if (this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); + } + } +}); + +$.extend($.ui.dialog, { + uuid: 0, + maxZ: 0, + + getTitleId: function($el) { + var id = $el.attr( "id" ); + if ( !id ) { + this.uuid += 1; + id = this.uuid; + } + return "ui-dialog-title-" + id; + }, + + overlay: function( dialog ) { + this.$el = $.ui.dialog.overlay.create( dialog ); + } +}); + +$.extend( $.ui.dialog.overlay, { + instances: [], + // reuse old instances due to IE memory leak with alpha transparency (see #5185) + oldInstances: [], + maxZ: 0, + events: $.map( + "focus,mousedown,mouseup,keydown,keypress,click".split( "," ), + function( event ) { + return event + ".dialog-overlay"; + } + ).join( " " ), + create: function( dialog ) { + if ( this.instances.length === 0 ) { + // prevent use of anchors and inputs + // we use a setTimeout in case the overlay is created from an + // event that we're going to be cancelling (see #2804) + setTimeout(function() { + // handle $(el).dialog().dialog('close') (see #4065) + if ( $.ui.dialog.overlay.instances.length ) { + $( document ).bind( $.ui.dialog.overlay.events, function( event ) { + // stop events if the z-index of the target is < the z-index of the overlay + // we cannot return true when we don't want to cancel the event (#3523) + if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { + return false; + } + }); + } + }, 1 ); + + // handle window resize + $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize ); + } + + var $el = ( this.oldInstances.pop() || $( "
          " ).addClass( "ui-widget-overlay" ) ); + + // allow closing by pressing the escape key + $( document ).bind( "keydown.dialog-overlay", function( event ) { + var instances = $.ui.dialog.overlay.instances; + // only react to the event if we're the top overlay + if ( instances.length !== 0 && instances[ instances.length - 1 ] === $el && + dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + + dialog.close( event ); + event.preventDefault(); + } + }); + + $el.appendTo( document.body ).css({ + width: this.width(), + height: this.height() + }); + + if ( $.fn.bgiframe ) { + $el.bgiframe(); + } + + this.instances.push( $el ); + return $el; + }, + + destroy: function( $el ) { + var indexOf = $.inArray( $el, this.instances ), + maxZ = 0; + + if ( indexOf !== -1 ) { + this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] ); + } + + if ( this.instances.length === 0 ) { + $( [ document, window ] ).unbind( ".dialog-overlay" ); + } + + $el.height( 0 ).width( 0 ).remove(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + $.each( this.instances, function() { + maxZ = Math.max( maxZ, this.css( "z-index" ) ); + }); + this.maxZ = maxZ; + }, + + height: function() { + var scrollHeight, + offsetHeight; + // handle IE + if ( $.ui.ie ) { + scrollHeight = Math.max( + document.documentElement.scrollHeight, + document.body.scrollHeight + ); + offsetHeight = Math.max( + document.documentElement.offsetHeight, + document.body.offsetHeight + ); + + if ( scrollHeight < offsetHeight ) { + return $( window ).height() + "px"; + } else { + return scrollHeight + "px"; + } + // handle "good" browsers + } else { + return $( document ).height() + "px"; + } + }, + + width: function() { + var scrollWidth, + offsetWidth; + // handle IE + if ( $.ui.ie ) { + scrollWidth = Math.max( + document.documentElement.scrollWidth, + document.body.scrollWidth + ); + offsetWidth = Math.max( + document.documentElement.offsetWidth, + document.body.offsetWidth + ); + + if ( scrollWidth < offsetWidth ) { + return $( window ).width() + "px"; + } else { + return scrollWidth + "px"; + } + // handle "good" browsers + } else { + return $( document ).width() + "px"; + } + }, + + resize: function() { + /* If the dialog is draggable and the user drags it past the + * right edge of the window, the document becomes wider so we + * need to stretch the overlay. If the user then drags the + * dialog back to the left, the document will become narrower, + * so we need to shrink the overlay to the appropriate size. + * This is handled by shrinking the overlay before setting it + * to the full document size. + */ + var $overlays = $( [] ); + $.each( $.ui.dialog.overlay.instances, function() { + $overlays = $overlays.add( this ); + }); + + $overlays.css({ + width: 0, + height: 0 + }).css({ + width: $.ui.dialog.overlay.width(), + height: $.ui.dialog.overlay.height() + }); + } +}); + +$.extend( $.ui.dialog.overlay.prototype, { + destroy: function() { + $.ui.dialog.overlay.destroy( this.$el ); + } +}); + +}( jQuery ) ); +(function( $, undefined ) { + +var mouseHandled = false; + +$.widget( "ui.menu", { + version: "1.9.2", + defaultElement: "
          "+(o[0]>0&&I==o[1]-1?'
          ':""):""),F+=U}B+=F}return B+=x+($.ui.ie6&&!e.inline?'':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='
          ',h="";if(s||!a)h+=''+o[t]+"";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='"}l||(c+=h+(s||!a||!f?" ":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+=''+n+"";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?" ":"")+h),c+="
          ",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&tr?r:i,i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$})(jQuery);(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||" ",s,o,u,a,f;s=(this.uiDialog=e("
          ")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("
          ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("
          ")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("
          ")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){var i,s;r=e.isFunction(r)?{click:r,text:t}:r,r=e.extend({type:"button"},r),s=r.click,r.click=function(){s.apply(n.element[0],arguments)},i=e("",r).appendTo(n.uiButtonSet),e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||" "))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),r=t.prev("a"),i=e("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()
          ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(jQuery);(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="",u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("
          ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;tn&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(jQuery);(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.2",defaultElement:"",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""+""+""+""+""},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e1&&e.href.replace(r,"")===location.href.replace(r,"").replace(/\s/g,"%20")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("
          ").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"Loading…"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"
        • #{label}
        • "},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"
          "},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r,i,s=this._superApply(arguments);return s?(e==="beforeActivate"?(r=n.newTab.length?n.newTab:n.oldTab,i=n.newPanel.length?n.newPanel:n.oldPanel,s=this._super("select",t,{tab:r.find(".ui-tabs-anchor")[0],panel:i[0],index:r.closest("li").index()})):e==="activate"&&n.newTab.length&&(s=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),s):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))})(jQuery);(function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return e(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("
          ").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("
          ").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})})(jQuery);jQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n
          ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery);(function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}})(jQuery);(function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h
          ").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}})(jQuery);(function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}})(jQuery);(function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}})(jQuery);(function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}})(jQuery);(function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}})(jQuery);(function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e('
          ').appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}})(jQuery); \ No newline at end of file diff --git a/assets/grocery_crud/themes/twitter-bootstrap/js/jquery.form.js b/assets/grocery_crud/themes/twitter-bootstrap/js/jquery.form.js index 1107cdb..3d36d63 100755 --- a/assets/grocery_crud/themes/twitter-bootstrap/js/jquery.form.js +++ b/assets/grocery_crud/themes/twitter-bootstrap/js/jquery.form.js @@ -1,825 +1,825 @@ -/*! - * jQuery Form Plugin - * version: 2.72 (28-APR-2011) - * @requires jQuery v1.3.2 or later - * - * Examples and documentation at: http://malsup.com/jquery/form/ - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -;(function($) { - -/* - Usage Note: - ----------- - Do not use both ajaxSubmit and ajaxForm on the same form. These - functions are intended to be exclusive. Use ajaxSubmit if you want - to bind your own submit handler to the form. For example, - - $(document).ready(function() { - $('#myForm').bind('submit', function(e) { - e.preventDefault(); // <-- important - $(this).ajaxSubmit({ - target: '#output' - }); - }); - }); - - Use ajaxForm when you want the plugin to manage all the event binding - for you. For example, - - $(document).ready(function() { - $('#myForm').ajaxForm({ - target: '#output' - }); - }); - - When using ajaxForm, the ajaxSubmit function will be invoked for you - at the appropriate time. -*/ - -/** - * ajaxSubmit() provides a mechanism for immediately submitting - * an HTML form using AJAX. - */ -$.fn.ajaxSubmit = function(options) { - // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) - if (!this.length) { - log('ajaxSubmit: skipping submit process - no element selected'); - return this; - } - - if (typeof options == 'function') { - options = { success: options }; - } - - var action = this.attr('action'); - var url = (typeof action === 'string') ? $.trim(action) : ''; - if (url) { - // clean url (don't include hash vaue) - url = (url.match(/^([^#]+)/)||[])[1]; - } - url = url || window.location.href || ''; - - options = $.extend(true, { - url: url, - success: $.ajaxSettings.success, - type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57) - iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' - }, options); - - // hook for manipulating the form data before it is extracted; - // convenient for use with rich editors like tinyMCE or FCKEditor - var veto = {}; - this.trigger('form-pre-serialize', [this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); - return this; - } - - // provide opportunity to alter form data before it is serialized - if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSerialize callback'); - return this; - } - - var n,v,a = this.formToArray(options.semantic); - if (options.data) { - options.extraData = options.data; - for (n in options.data) { - if(options.data[n] instanceof Array) { - for (var k in options.data[n]) { - a.push( { name: n, value: options.data[n][k] } ); - } - } - else { - v = options.data[n]; - v = $.isFunction(v) ? v() : v; // if value is fn, invoke it - a.push( { name: n, value: v } ); - } - } - } - - // give pre-submit callback an opportunity to abort the submit - if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSubmit callback'); - return this; - } - - // fire vetoable 'validate' event - this.trigger('form-submit-validate', [a, this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); - return this; - } - - var q = $.param(a); - - if (options.type.toUpperCase() == 'GET') { - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else { - options.data = q; // data is the query string for 'post' - } - - var $form = this, callbacks = []; - if (options.resetForm) { - callbacks.push(function() { $form.resetForm(); }); - } - if (options.clearForm) { - callbacks.push(function() { $form.clearForm(); }); - } - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function(){}; - callbacks.push(function(data) { - var fn = options.replaceTarget ? 'replaceWith' : 'html'; - $(options.target)[fn](data).each(oldSuccess, arguments); - }); - } - else if (options.success) { - callbacks.push(options.success); - } - - options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg - var context = options.context || options; // jQuery 1.4+ supports scope context - for (var i=0, max=callbacks.length; i < max; i++) { - callbacks[i].apply(context, [data, status, xhr || $form, $form]); - } - }; - - // are there files to upload? - var fileInputs = $('input:file', this).length > 0; - var mp = 'multipart/form-data'; - var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); - - // options.iframe allows user to force iframe mode - // 06-NOV-09: now defaulting to iframe mode if file input is detected - if (options.iframe !== false && (fileInputs || options.iframe || multipart)) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if (options.closeKeepAlive) { - $.get(options.closeKeepAlive, fileUpload); - } - else { - fileUpload(); - } - } - else { - $.ajax(options); - } - - // fire 'notify' event - this.trigger('form-submit-notify', [this, options]); - return this; - - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUpload() { - var form = $form[0]; - - if ($(':input[name=submit],:input[id=submit]', form).length) { - // if there is an input with a name or id of 'submit' then we won't be - // able to invoke the submit fn on the form (at least not x-browser) - alert('Error: Form elements must not have name or id of "submit".'); - return; - } - - var s = $.extend(true, {}, $.ajaxSettings, options); - s.context = s.context || s; - var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id; - var $io = $('':""), -a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
          ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
          ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* - * jQuery UI Progressbar 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
          ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/* - * jQuery UI Effects 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/ - */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c
        ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/* + * jQuery UI Position 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/* + * jQuery UI Draggable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
        ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f=k&&g<=l||h>=k&&h<=l||gl)&&(e>=i&&e<=j||f>=i&&f<=j||ej);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g
        ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e
        ');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d
        ');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/* + * jQuery UI Selectable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
        ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.righth||i.bottome&&i.rightf&&i.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.18",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/* + * jQuery UI Autocomplete 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("
          ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",context:{autocompleteRequest:++c},success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length").data("item.autocomplete",c).append(a("").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()
          ",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/* + * jQuery UI Dialog 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
          ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
          ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("
          ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
          ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()
        ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b
        ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/* + * jQuery UI Tabs 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
        ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
      • #{label}
      • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a
        '))}$.extend($.ui,{datepicker:{version:"1.8.18"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
        ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
        '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
        ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
        '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
        '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
        '+this._get(a,"weekHeader")+"
        '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
        "+(j?"
        "+(g[0]>0&&N==g[1]-1?'
        ':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""), +a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
        ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
        ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* + * jQuery UI Progressbar 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
        ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/* + * jQuery UI Effects 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c
        ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h= 0 ? '+' : '-') + ('0' + Math.abs(i).toString()).slice(-2) + '00'); - if (tp_inst._defaults.timezoneIso8609) - timezoneList = $.map(timezoneList, function(val) { - return val == '+0000' ? 'Z' : (val.substring(0, 3) + ':' + val.substring(3)); - }); - tp_inst._defaults.timezoneList = timezoneList; - } - - tp_inst.hour = tp_inst._defaults.hour; - tp_inst.minute = tp_inst._defaults.minute; - tp_inst.second = tp_inst._defaults.second; - tp_inst.millisec = tp_inst._defaults.millisec; - tp_inst.ampm = ''; - tp_inst.$input = $input; - - if (o.altField) - tp_inst.$altInput = $(o.altField) - .css({ cursor: 'pointer' }) - .focus(function(){ $input.trigger("focus"); }); - - if(tp_inst._defaults.minDate==0 || tp_inst._defaults.minDateTime==0) - { - tp_inst._defaults.minDate=new Date(); - } - if(tp_inst._defaults.maxDate==0 || tp_inst._defaults.maxDateTime==0) - { - tp_inst._defaults.maxDate=new Date(); - } - - // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime.. - if(tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) - tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime()); - if(tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) - tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime()); - if(tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) - tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime()); - if(tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) - tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); - return tp_inst; - }, - - //######################################################################## - // add our sliders to the calendar - //######################################################################## - _addTimePicker: function(dp_inst) { - var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? - this.$input.val() + ' ' + this.$altInput.val() : - this.$input.val(); - - this.timeDefined = this._parseTime(currDT); - this._limitMinMaxDateTime(dp_inst, false); - this._injectTimePicker(); - }, - - //######################################################################## - // parse the time string from input value or _setTime - //######################################################################## - _parseTime: function(timeString, withDate) { - var regstr = this._defaults.timeFormat.toString() - .replace(/h{1,2}/ig, '(\\d?\\d)') - .replace(/m{1,2}/ig, '(\\d?\\d)') - .replace(/s{1,2}/ig, '(\\d?\\d)') - .replace(/l{1}/ig, '(\\d?\\d?\\d)') - .replace(/t{1,2}/ig, this._getPatternAmpm()) - .replace(/z{1}/ig, '(z|[-+]\\d\\d:?\\d\\d)?') - .replace(/\s/g, '\\s?') + this._defaults.timeSuffix + '$', - order = this._getFormatPositions(), - ampm = '', - treg; - - if (!this.inst) this.inst = $.datepicker._getInst(this.$input[0]); - - if (withDate || !this._defaults.timeOnly) { - // the time should come after x number of characters and a space. - // x = at least the length of text specified by the date format - var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat'); - // escape special regex characters in the seperator - var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g"); - regstr = '^.{' + dp_dateFormat.length + ',}?' + this._defaults.separator.replace(specials, "\\$&") + regstr; - } - - treg = timeString.match(new RegExp(regstr, 'i')); - - if (treg) { - if (order.t !== -1) { - if (treg[order.t] === undefined || treg[order.t].length === 0) { - ampm = ''; - this.ampm = ''; - } else { - ampm = $.inArray(treg[order.t].toUpperCase(), this.amNames) !== -1 ? 'AM' : 'PM'; - this.ampm = this._defaults[ampm == 'AM' ? 'amNames' : 'pmNames'][0]; - } - } - - if (order.h !== -1) { - if (ampm == 'AM' && treg[order.h] == '12') - this.hour = 0; // 12am = 0 hour - else if (ampm == 'PM' && treg[order.h] != '12') - this.hour = (parseFloat(treg[order.h]) + 12).toFixed(0); // 12pm = 12 hour, any other pm = hour + 12 - else this.hour = Number(treg[order.h]); - } - - if (order.m !== -1) this.minute = Number(treg[order.m]); - if (order.s !== -1) this.second = Number(treg[order.s]); - if (order.l !== -1) this.millisec = Number(treg[order.l]); - if (order.z !== -1 && treg[order.z] !== undefined) { - var tz = treg[order.z].toUpperCase(); - switch (tz.length) { - case 1: // Z - tz = this._defaults.timezoneIso8609 ? 'Z' : '+0000'; - break; - case 5: // +hhmm - if (this._defaults.timezoneIso8609) - tz = tz.substring(1) == '0000' - ? 'Z' - : tz.substring(0, 3) + ':' + tz.substring(3); - break; - case 6: // +hh:mm - if (!this._defaults.timezoneIso8609) - tz = tz == 'Z' || tz.substring(1) == '00:00' - ? '+0000' - : tz.replace(/:/, ''); - else if (tz.substring(1) == '00:00') - tz = 'Z'; - break; - } - this.timezone = tz; - } - - return true; - - } - return false; - }, - - //######################################################################## - // pattern for standard and localized AM/PM markers - //######################################################################## - _getPatternAmpm: function() { - var markers = []; - o = this._defaults; - if (o.amNames) - $.merge(markers, o.amNames); - if (o.pmNames) - $.merge(markers, o.pmNames); - markers = $.map(markers, function(val) { return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&') }); - return '(' + markers.join('|') + ')?'; - }, - - //######################################################################## - // figure out position of time elements.. cause js cant do named captures - //######################################################################## - _getFormatPositions: function() { - var finds = this._defaults.timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z)/g), - orders = { h: -1, m: -1, s: -1, l: -1, t: -1, z: -1 }; - - if (finds) - for (var i = 0; i < finds.length; i++) - if (orders[finds[i].toString().charAt(0)] == -1) - orders[finds[i].toString().charAt(0)] = i + 1; - - return orders; - }, - - //######################################################################## - // generate and inject html for timepicker into ui datepicker - //######################################################################## - _injectTimePicker: function() { - var $dp = this.inst.dpDiv, - o = this._defaults, - tp_inst = this, - // Added by Peter Medeiros: - // - Figure out what the hour/minute/second max should be based on the step values. - // - Example: if stepMinute is 15, then minMax is 45. - hourMax = parseInt((o.hourMax - ((o.hourMax - o.hourMin) % o.stepHour)) ,10), - minMax = parseInt((o.minuteMax - ((o.minuteMax - o.minuteMin) % o.stepMinute)) ,10), - secMax = parseInt((o.secondMax - ((o.secondMax - o.secondMin) % o.stepSecond)) ,10), - millisecMax = parseInt((o.millisecMax - ((o.millisecMax - o.millisecMin) % o.stepMillisec)) ,10), - dp_id = this.inst.id.toString().replace(/([^A-Za-z0-9_])/g, ''); - - // Prevent displaying twice - //if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0) { - if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0 && o.showTimepicker) { - var noDisplay = ' style="display:none;"', - html = '
        ' + - '
        ' + o.timeText + '
        ' + - '
        ' + - '
        ' + o.hourText + '
        ', - hourGridSize = 0, - minuteGridSize = 0, - secondGridSize = 0, - millisecGridSize = 0, - size; - - // Hours - html += '
        '; - if (o.showHour && o.hourGrid > 0) { - html += '
        '; - - for (var h = o.hourMin; h <= hourMax; h += parseInt(o.hourGrid,10)) { - hourGridSize++; - var tmph = (o.ampm && h > 12) ? h-12 : h; - if (tmph < 10) tmph = '0' + tmph; - if (o.ampm) { - if (h == 0) tmph = 12 +'a'; - else if (h < 12) tmph += 'a'; - else tmph += 'p'; - } - html += ''; - } - - html += '
        ' + tmph + '
        '; - } - html += '
        '; - - // Minutes - html += '
        ' + o.minuteText + '
        '+ - '
        '; - - if (o.showMinute && o.minuteGrid > 0) { - html += '
        '; - - for (var m = o.minuteMin; m <= minMax; m += parseInt(o.minuteGrid,10)) { - minuteGridSize++; - html += ''; - } - - html += '
        ' + ((m < 10) ? '0' : '') + m + '
        '; - } - html += '
        '; - - // Seconds - html += '
        ' + o.secondText + '
        '+ - '
        '; - - if (o.showSecond && o.secondGrid > 0) { - html += '
        '; - - for (var s = o.secondMin; s <= secMax; s += parseInt(o.secondGrid,10)) { - secondGridSize++; - html += ''; - } - - html += '
        ' + ((s < 10) ? '0' : '') + s + '
        '; - } - html += '
        '; - - // Milliseconds - html += '
        ' + o.millisecText + '
        '+ - '
        '; - - if (o.showMillisec && o.millisecGrid > 0) { - html += '
        '; - - for (var l = o.millisecMin; l <= millisecMax; l += parseInt(o.millisecGrid,10)) { - millisecGridSize++; - html += ''; - } - - html += '
        ' + ((l < 10) ? '0' : '') + l + '
        '; - } - html += '
        '; - - // Timezone - html += '
        ' + o.timezoneText + '
        '; - html += '
        '; - - html += '
        '; - $tp = $(html); - - // if we only want time picker... - if (o.timeOnly === true) { - $tp.prepend( - '
        ' + - '
        ' + o.timeOnlyTitle + '
        ' + - '
        '); - $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); - } - - this.hour_slider = $tp.find('#ui_tpicker_hour_'+ dp_id).slider({ - orientation: "horizontal", - value: this.hour, - min: o.hourMin, - max: hourMax, - step: o.stepHour, - slide: function(event, ui) { - tp_inst.hour_slider.slider( "option", "value", ui.value); - tp_inst._onTimeChange(); - } - }); - - - // Updated by Peter Medeiros: - // - Pass in Event and UI instance into slide function - this.minute_slider = $tp.find('#ui_tpicker_minute_'+ dp_id).slider({ - orientation: "horizontal", - value: this.minute, - min: o.minuteMin, - max: minMax, - step: o.stepMinute, - slide: function(event, ui) { - tp_inst.minute_slider.slider( "option", "value", ui.value); - tp_inst._onTimeChange(); - } - }); - - this.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({ - orientation: "horizontal", - value: this.second, - min: o.secondMin, - max: secMax, - step: o.stepSecond, - slide: function(event, ui) { - tp_inst.second_slider.slider( "option", "value", ui.value); - tp_inst._onTimeChange(); - } - }); - - this.millisec_slider = $tp.find('#ui_tpicker_millisec_'+ dp_id).slider({ - orientation: "horizontal", - value: this.millisec, - min: o.millisecMin, - max: millisecMax, - step: o.stepMillisec, - slide: function(event, ui) { - tp_inst.millisec_slider.slider( "option", "value", ui.value); - tp_inst._onTimeChange(); - } - }); - - this.timezone_select = $tp.find('#ui_tpicker_timezone_'+ dp_id).append('').find("select"); - $.fn.append.apply(this.timezone_select, - $.map(o.timezoneList, function(val, idx) { - return $("
        -
        - - -
        - - - - - - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/adminpanel/blue/header.php b/templates/adminpanel/blue/header.php index ca25081..801164f 100755 --- a/templates/adminpanel/blue/header.php +++ b/templates/adminpanel/blue/header.php @@ -1,198 +1,198 @@ - - - - - pH2Date - Admin Control Panel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        -
        -
        -
        - - - - - - -
        -
        -
        - -
        -
        - - -
        - - - - -
        - - -
        -

        Dashboard

        - -
        - - -
        - -
        - - - -
        -
        -
        -
        -

        Admin

        - -
        -
        - close -
        -
        -
        - -
        - \ No newline at end of file + + + + + pH2Date - Admin Control Panel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        +
        +
        + + + + + + +
        +
        +
        + +
        +
        + + +
        + + + + +
        + + +
        +

        Dashboard

        + +
        + + +
        + +
        + + + +
        +
        +
        +
        +

        Admin

        + +
        +
        + close +
        +
        +
        + +
        + diff --git a/templates/adminpanel/blue/view.php b/templates/adminpanel/blue/view.php index 423333e..5266e2c 100755 --- a/templates/adminpanel/blue/view.php +++ b/templates/adminpanel/blue/view.php @@ -1,3 +1,3 @@ -load->view('header') ?> - -load->view('footer') ?> +load->view('header') ?> + +load->view('footer') ?> diff --git a/templates/website/ph2date/auth/change_password.php b/templates/website/ph2date/auth/change_password.php index 626cc7c..294269f 100755 --- a/templates/website/ph2date/auth/change_password.php +++ b/templates/website/ph2date/auth/change_password.php @@ -1,48 +1,48 @@ - -load->view('header'); -?> -
        -
        -
        -
        -
        -
        - - -msg_error_right) ){ ?> -
        msg_error_right;?>
        - -msg_success_right)){ ?> -
        msg_success_right;?>
        - - - -

        - - - -
        -
        - -
        - -
        -
        - -
        - -
        -
        - -
        - - -
        - - -
        -
        -load->view('footer'); + +load->view('header'); +?> +
        +
        +
        +
        +
        +
        + + +msg_error_right) ){ ?> +
        msg_error_right;?>
        + +msg_success_right)){ ?> +
        msg_success_right;?>
        + + + +

        + + + +
        +
        + +
        + +
        +
        + +
        + +
        +
        + +
        + + +
        + + +
        +
        +load->view('footer'); ?> \ No newline at end of file diff --git a/templates/website/ph2date/auth/create_group.php b/templates/website/ph2date/auth/create_group.php index b6917ed..86b07e9 100755 --- a/templates/website/ph2date/auth/create_group.php +++ b/templates/website/ph2date/auth/create_group.php @@ -1,20 +1,20 @@ -

        -

        - -
        - - - -

        -
        - -

        - -

        -
        - -

        - -

        - +

        +

        + +
        + + + +

        +
        + +

        + +

        +
        + +

        + +

        + \ No newline at end of file diff --git a/templates/website/ph2date/auth/deactivate_user.php b/templates/website/ph2date/auth/deactivate_user.php index 6e1915a..ba97259 100755 --- a/templates/website/ph2date/auth/deactivate_user.php +++ b/templates/website/ph2date/auth/deactivate_user.php @@ -1,18 +1,18 @@ -

        -

        username);?>

        - -id);?> - -

        - - - - -

        - - - $user->id)); ?> - -

        - +

        +

        username);?>

        + +id);?> + +

        + + + + +

        + + + $user->id)); ?> + +

        + \ No newline at end of file diff --git a/templates/website/ph2date/auth/edit_group.php b/templates/website/ph2date/auth/edit_group.php index 57fb592..080dad7 100755 --- a/templates/website/ph2date/auth/edit_group.php +++ b/templates/website/ph2date/auth/edit_group.php @@ -1,20 +1,20 @@ -

        -

        - -
        - - - -

        -
        - -

        - -

        -
        - -

        - -

        - +

        +

        + +
        + + + +

        +
        + +

        + +

        +
        + +

        + +

        + \ No newline at end of file diff --git a/templates/website/ph2date/auth/edit_user.php b/templates/website/ph2date/auth/edit_user.php index 7d1975d..932a0d1 100755 --- a/templates/website/ph2date/auth/edit_user.php +++ b/templates/website/ph2date/auth/edit_user.php @@ -1,59 +1,59 @@ -load->view('header'); -?> -
        -
        -
        -
        -
        -
        - -msg_error_right) ){ ?> -
        msg_error_right;?>
        - -msg_success_right)){ ?> -
        msg_success_right;?>
        - - -

        -
        - -
        - - - -
        -
        - -
        - -
        -
        - -
        - -
        -
        - -
        - -
        -
        - -
        - - - - - - id);?> - - -
        - - -
        -
        -load->view('footer'); +load->view('header'); +?> +
        +
        +
        +
        +
        +
        + +msg_error_right) ){ ?> +
        msg_error_right;?>
        + +msg_success_right)){ ?> +
        msg_success_right;?>
        + + +

        +
        + +
        + + + +
        +
        + +
        + +
        +
        + +
        + +
        +
        + +
        + +
        +
        + +
        + + + + + + id);?> + + +
        + + +
        +
        +load->view('footer'); ?> \ No newline at end of file diff --git a/templates/website/ph2date/auth/email/activate.tpl.php b/templates/website/ph2date/auth/email/activate.tpl.php index a63b067..3fb9460 100755 --- a/templates/website/ph2date/auth/email/activate.tpl.php +++ b/templates/website/ph2date/auth/email/activate.tpl.php @@ -1,6 +1,6 @@ - - -

        -

        - + + +

        +

        + \ No newline at end of file diff --git a/templates/website/ph2date/auth/email/forgot_password.tpl.php b/templates/website/ph2date/auth/email/forgot_password.tpl.php index a58af6c..62cf64b 100755 --- a/templates/website/ph2date/auth/email/forgot_password.tpl.php +++ b/templates/website/ph2date/auth/email/forgot_password.tpl.php @@ -1,6 +1,6 @@ - - -

        -

        - + + +

        +

        + \ No newline at end of file diff --git a/templates/website/ph2date/auth/email/new_password.tpl.php b/templates/website/ph2date/auth/email/new_password.tpl.php index a1c15e0..7638388 100755 --- a/templates/website/ph2date/auth/email/new_password.tpl.php +++ b/templates/website/ph2date/auth/email/new_password.tpl.php @@ -1,7 +1,7 @@ - - -

        - -

        - + + +

        + +

        + \ No newline at end of file diff --git a/templates/website/ph2date/auth/forgot_password.php b/templates/website/ph2date/auth/forgot_password.php index f1f6515..63ac3f1 100755 --- a/templates/website/ph2date/auth/forgot_password.php +++ b/templates/website/ph2date/auth/forgot_password.php @@ -1,29 +1,29 @@ -load->view('header') ?> - -
        -
        - -load->view('right_msg') ?> - -

        -

        - -
        - -
        - - - -

        -
        - -

        - -

        - - - -
        -
        - +load->view('header') ?> + +
        +
        + +load->view('right_msg') ?> + +

        +

        + +
        + +
        + + + +

        +
        + +

        + +

        + + + +
        +
        + load->view('footer') ?> \ No newline at end of file diff --git a/templates/website/ph2date/auth/index.php b/templates/website/ph2date/auth/index.php index dd56a04..6be8a30 100755 --- a/templates/website/ph2date/auth/index.php +++ b/templates/website/ph2date/auth/index.php @@ -1,37 +1,37 @@ -load->view('header'); -?> -

        -

        - -
        - - - - - - - - - - - - - - - - - - - - -
        first_name;?>last_name;?>email;?> - groups as $group):?> - id, $group->name) ;?>
        - -
        active) ? anchor("auth/deactivate/".$user->id, lang('index_active_link')) : anchor("auth/activate/". $user->id, lang('index_inactive_link'));?>id, 'Edit') ;?>
        - -

        |

        -load->view('footer'); +load->view('header'); +?> +

        +

        + +
        + + + + + + + + + + + + + + + + + + + + +
        first_name;?>last_name;?>email;?> + groups as $group):?> + id, $group->name) ;?>
        + +
        active) ? anchor("auth/deactivate/".$user->id, lang('index_active_link')) : anchor("auth/activate/". $user->id, lang('index_inactive_link'));?>id, 'Edit') ;?>
        + +

        |

        +load->view('footer'); ?> \ No newline at end of file diff --git a/templates/website/ph2date/auth/login.php b/templates/website/ph2date/auth/login.php index 8dad6d8..26ae33d 100755 --- a/templates/website/ph2date/auth/login.php +++ b/templates/website/ph2date/auth/login.php @@ -1,51 +1,51 @@ -load->view('header') ?> - -promo_text ?> - -
        -
        - -msg_error_left) ): ?> -
        msg_error_left;?>
        - - -msg_success_left)): ?> -
        msg_success_left;?>
        - - - -

        -

        - - - - -
        - - -
        - -
        - - -
        - -
        - -
        - -

        - - - -

        -
        -
        - -load->view('auth/register'); // Add the Register form view as well ?> - -service_description ?> - +load->view('header') ?> + +promo_text ?> + +
        +
        + +msg_error_left) ): ?> +
        msg_error_left;?>
        + + +msg_success_left)): ?> +
        msg_success_left;?>
        + + + +

        +

        + + + + +
        + + +
        + +
        + + +
        + +
        + +
        + +

        + + + +

        +
        +
        + +load->view('auth/register'); // Add the Register form view as well ?> + +service_description ?> + load->view('footer') ?> \ No newline at end of file diff --git a/templates/website/ph2date/auth/register.php b/templates/website/ph2date/auth/register.php index c6da11d..1e05906 100755 --- a/templates/website/ph2date/auth/register.php +++ b/templates/website/ph2date/auth/register.php @@ -1,60 +1,60 @@ -
        -
        - -msg_error_right) ): ?> -
        msg_error_right;?>
        - - -msg_success_right)): ?> -
        msg_success_right;?>
        - - -

        -
        - - - -
        -
        - -
        - -
        -
        - -
        - -
        - - -
        - -
        -
        - -
        - -
        -
        - -
        - -
        -
        - -
        - -
        -
        - -
        - - -
        - - -
        +
        +
        + +msg_error_right) ): ?> +
        msg_error_right;?>
        + + +msg_success_right)): ?> +
        msg_success_right;?>
        + + +

        +
        + + + +
        +
        + +
        + +
        +
        + +
        + +
        + + +
        + +
        +
        + +
        + +
        +
        + +
        + +
        +
        + +
        + +
        +
        + +
        + + +
        + + +
        \ No newline at end of file diff --git a/templates/website/ph2date/auth/reset_password.php b/templates/website/ph2date/auth/reset_password.php index c790deb..78d59e8 100755 --- a/templates/website/ph2date/auth/reset_password.php +++ b/templates/website/ph2date/auth/reset_password.php @@ -1,22 +1,22 @@ -

        - -
        - - - -

        -
        - -

        - -

        -
        - -

        - - - - -

        - +

        + +
        + + + +

        +
        + +

        + +

        +
        + +

        + + + + +

        + \ No newline at end of file diff --git a/templates/website/ph2date/bootstrap.css b/templates/website/ph2date/bootstrap.css index dc93f55..1f7bc6a 100755 --- a/templates/website/ph2date/bootstrap.css +++ b/templates/website/ph2date/bootstrap.css @@ -1,6203 +1,6203 @@ -/*! - * Bootstrap v3.2.0 (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - -/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ -html { - font-family: sans-serif; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} -body { - margin: 0; -} -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -nav, -section, -summary { - display: block; -} -audio, -canvas, -progress, -video { - display: inline-block; - vertical-align: baseline; -} -audio:not([controls]) { - display: none; - height: 0; -} -[hidden], -template { - display: none; -} -a { - background: transparent; -} -a:active, -a:hover { - outline: 0; -} -abbr[title] { - border-bottom: 1px dotted; -} -b, -strong { - font-weight: bold; -} -dfn { - font-style: italic; -} -h1 { - margin: .67em 0; - font-size: 2em; -} -mark { - color: #000; - background: #ff0; -} -small { - font-size: 80%; -} -sub, -sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; -} -sup { - top: -.5em; -} -sub { - bottom: -.25em; -} -img { - border: 0; -} -svg:not(:root) { - overflow: hidden; -} -figure { - margin: 1em 40px; -} -hr { - height: 0; - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; -} -pre { - overflow: auto; -} -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} -button, -input, -optgroup, -select, -textarea { - margin: 0; - font: inherit; - color: inherit; -} -button { - overflow: visible; -} -button, -select { - text-transform: none; -} -button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; -} -button[disabled], -html input[disabled] { - cursor: default; -} -button::-moz-focus-inner, -input::-moz-focus-inner { - padding: 0; - border: 0; -} -input { - line-height: normal; -} -input[type="checkbox"], -input[type="radio"] { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: 0; -} -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} -input[type="search"] { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; - -webkit-appearance: textfield; -} -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} -fieldset { - padding: .35em .625em .75em; - margin: 0 2px; - border: 1px solid #c0c0c0; -} -legend { - padding: 0; - border: 0; -} -textarea { - overflow: auto; -} -optgroup { - font-weight: bold; -} -table { - border-spacing: 0; - border-collapse: collapse; -} -td, -th { - padding: 0; -} -@media print { - * { - color: #000 !important; - text-shadow: none !important; - background: transparent !important; - -webkit-box-shadow: none !important; - box-shadow: none !important; - } - a, - a:visited { - text-decoration: underline; - } - a[href]:after { - content: " (" attr(href) ")"; - } - abbr[title]:after { - content: " (" attr(title) ")"; - } - a[href^="javascript:"]:after, - a[href^="#"]:after { - content: ""; - } - pre, - blockquote { - border: 1px solid #999; - - page-break-inside: avoid; - } - thead { - display: table-header-group; - } - tr, - img { - page-break-inside: avoid; - } - img { - max-width: 100% !important; - } - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - h2, - h3 { - page-break-after: avoid; - } - select { - background: #fff !important; - } - .navbar { - display: none; - } - .table td, - .table th { - background-color: #fff !important; - } - .btn > .caret, - .dropup > .btn > .caret { - border-top-color: #000 !important; - } - .label { - border: 1px solid #000; - } - .table { - border-collapse: collapse !important; - } - .table-bordered th, - .table-bordered td { - border: 1px solid #ddd !important; - } -} -@font-face { - font-family: 'Glyphicons Halflings'; - - src: url('../fonts/glyphicons-halflings-regular.eot'); - src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); -} -.glyphicon { - position: relative; - top: 1px; - display: inline-block; - font-family: 'Glyphicons Halflings'; - font-style: normal; - font-weight: normal; - line-height: 1; - - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.glyphicon-asterisk:before { - content: "\2a"; -} -.glyphicon-plus:before { - content: "\2b"; -} -.glyphicon-euro:before { - content: "\20ac"; -} -.glyphicon-minus:before { - content: "\2212"; -} -.glyphicon-cloud:before { - content: "\2601"; -} -.glyphicon-envelope:before { - content: "\2709"; -} -.glyphicon-pencil:before { - content: "\270f"; -} -.glyphicon-glass:before { - content: "\e001"; -} -.glyphicon-music:before { - content: "\e002"; -} -.glyphicon-search:before { - content: "\e003"; -} -.glyphicon-heart:before { - content: "\e005"; -} -.glyphicon-star:before { - content: "\e006"; -} -.glyphicon-star-empty:before { - content: "\e007"; -} -.glyphicon-user:before { - content: "\e008"; -} -.glyphicon-film:before { - content: "\e009"; -} -.glyphicon-th-large:before { - content: "\e010"; -} -.glyphicon-th:before { - content: "\e011"; -} -.glyphicon-th-list:before { - content: "\e012"; -} -.glyphicon-ok:before { - content: "\e013"; -} -.glyphicon-remove:before { - content: "\e014"; -} -.glyphicon-zoom-in:before { - content: "\e015"; -} -.glyphicon-zoom-out:before { - content: "\e016"; -} -.glyphicon-off:before { - content: "\e017"; -} -.glyphicon-signal:before { - content: "\e018"; -} -.glyphicon-cog:before { - content: "\e019"; -} -.glyphicon-trash:before { - content: "\e020"; -} -.glyphicon-home:before { - content: "\e021"; -} -.glyphicon-file:before { - content: "\e022"; -} -.glyphicon-time:before { - content: "\e023"; -} -.glyphicon-road:before { - content: "\e024"; -} -.glyphicon-download-alt:before { - content: "\e025"; -} -.glyphicon-download:before { - content: "\e026"; -} -.glyphicon-upload:before { - content: "\e027"; -} -.glyphicon-inbox:before { - content: "\e028"; -} -.glyphicon-play-circle:before { - content: "\e029"; -} -.glyphicon-repeat:before { - content: "\e030"; -} -.glyphicon-refresh:before { - content: "\e031"; -} -.glyphicon-list-alt:before { - content: "\e032"; -} -.glyphicon-lock:before { - content: "\e033"; -} -.glyphicon-flag:before { - content: "\e034"; -} -.glyphicon-headphones:before { - content: "\e035"; -} -.glyphicon-volume-off:before { - content: "\e036"; -} -.glyphicon-volume-down:before { - content: "\e037"; -} -.glyphicon-volume-up:before { - content: "\e038"; -} -.glyphicon-qrcode:before { - content: "\e039"; -} -.glyphicon-barcode:before { - content: "\e040"; -} -.glyphicon-tag:before { - content: "\e041"; -} -.glyphicon-tags:before { - content: "\e042"; -} -.glyphicon-book:before { - content: "\e043"; -} -.glyphicon-bookmark:before { - content: "\e044"; -} -.glyphicon-print:before { - content: "\e045"; -} -.glyphicon-camera:before { - content: "\e046"; -} -.glyphicon-font:before { - content: "\e047"; -} -.glyphicon-bold:before { - content: "\e048"; -} -.glyphicon-italic:before { - content: "\e049"; -} -.glyphicon-text-height:before { - content: "\e050"; -} -.glyphicon-text-width:before { - content: "\e051"; -} -.glyphicon-align-left:before { - content: "\e052"; -} -.glyphicon-align-center:before { - content: "\e053"; -} -.glyphicon-align-right:before { - content: "\e054"; -} -.glyphicon-align-justify:before { - content: "\e055"; -} -.glyphicon-list:before { - content: "\e056"; -} -.glyphicon-indent-left:before { - content: "\e057"; -} -.glyphicon-indent-right:before { - content: "\e058"; -} -.glyphicon-facetime-video:before { - content: "\e059"; -} -.glyphicon-picture:before { - content: "\e060"; -} -.glyphicon-map-marker:before { - content: "\e062"; -} -.glyphicon-adjust:before { - content: "\e063"; -} -.glyphicon-tint:before { - content: "\e064"; -} -.glyphicon-edit:before { - content: "\e065"; -} -.glyphicon-share:before { - content: "\e066"; -} -.glyphicon-check:before { - content: "\e067"; -} -.glyphicon-move:before { - content: "\e068"; -} -.glyphicon-step-backward:before { - content: "\e069"; -} -.glyphicon-fast-backward:before { - content: "\e070"; -} -.glyphicon-backward:before { - content: "\e071"; -} -.glyphicon-play:before { - content: "\e072"; -} -.glyphicon-pause:before { - content: "\e073"; -} -.glyphicon-stop:before { - content: "\e074"; -} -.glyphicon-forward:before { - content: "\e075"; -} -.glyphicon-fast-forward:before { - content: "\e076"; -} -.glyphicon-step-forward:before { - content: "\e077"; -} -.glyphicon-eject:before { - content: "\e078"; -} -.glyphicon-chevron-left:before { - content: "\e079"; -} -.glyphicon-chevron-right:before { - content: "\e080"; -} -.glyphicon-plus-sign:before { - content: "\e081"; -} -.glyphicon-minus-sign:before { - content: "\e082"; -} -.glyphicon-remove-sign:before { - content: "\e083"; -} -.glyphicon-ok-sign:before { - content: "\e084"; -} -.glyphicon-question-sign:before { - content: "\e085"; -} -.glyphicon-info-sign:before { - content: "\e086"; -} -.glyphicon-screenshot:before { - content: "\e087"; -} -.glyphicon-remove-circle:before { - content: "\e088"; -} -.glyphicon-ok-circle:before { - content: "\e089"; -} -.glyphicon-ban-circle:before { - content: "\e090"; -} -.glyphicon-arrow-left:before { - content: "\e091"; -} -.glyphicon-arrow-right:before { - content: "\e092"; -} -.glyphicon-arrow-up:before { - content: "\e093"; -} -.glyphicon-arrow-down:before { - content: "\e094"; -} -.glyphicon-share-alt:before { - content: "\e095"; -} -.glyphicon-resize-full:before { - content: "\e096"; -} -.glyphicon-resize-small:before { - content: "\e097"; -} -.glyphicon-exclamation-sign:before { - content: "\e101"; -} -.glyphicon-gift:before { - content: "\e102"; -} -.glyphicon-leaf:before { - content: "\e103"; -} -.glyphicon-fire:before { - content: "\e104"; -} -.glyphicon-eye-open:before { - content: "\e105"; -} -.glyphicon-eye-close:before { - content: "\e106"; -} -.glyphicon-warning-sign:before { - content: "\e107"; -} -.glyphicon-plane:before { - content: "\e108"; -} -.glyphicon-calendar:before { - content: "\e109"; -} -.glyphicon-random:before { - content: "\e110"; -} -.glyphicon-comment:before { - content: "\e111"; -} -.glyphicon-magnet:before { - content: "\e112"; -} -.glyphicon-chevron-up:before { - content: "\e113"; -} -.glyphicon-chevron-down:before { - content: "\e114"; -} -.glyphicon-retweet:before { - content: "\e115"; -} -.glyphicon-shopping-cart:before { - content: "\e116"; -} -.glyphicon-folder-close:before { - content: "\e117"; -} -.glyphicon-folder-open:before { - content: "\e118"; -} -.glyphicon-resize-vertical:before { - content: "\e119"; -} -.glyphicon-resize-horizontal:before { - content: "\e120"; -} -.glyphicon-hdd:before { - content: "\e121"; -} -.glyphicon-bullhorn:before { - content: "\e122"; -} -.glyphicon-bell:before { - content: "\e123"; -} -.glyphicon-certificate:before { - content: "\e124"; -} -.glyphicon-thumbs-up:before { - content: "\e125"; -} -.glyphicon-thumbs-down:before { - content: "\e126"; -} -.glyphicon-hand-right:before { - content: "\e127"; -} -.glyphicon-hand-left:before { - content: "\e128"; -} -.glyphicon-hand-up:before { - content: "\e129"; -} -.glyphicon-hand-down:before { - content: "\e130"; -} -.glyphicon-circle-arrow-right:before { - content: "\e131"; -} -.glyphicon-circle-arrow-left:before { - content: "\e132"; -} -.glyphicon-circle-arrow-up:before { - content: "\e133"; -} -.glyphicon-circle-arrow-down:before { - content: "\e134"; -} -.glyphicon-globe:before { - content: "\e135"; -} -.glyphicon-wrench:before { - content: "\e136"; -} -.glyphicon-tasks:before { - content: "\e137"; -} -.glyphicon-filter:before { - content: "\e138"; -} -.glyphicon-briefcase:before { - content: "\e139"; -} -.glyphicon-fullscreen:before { - content: "\e140"; -} -.glyphicon-dashboard:before { - content: "\e141"; -} -.glyphicon-paperclip:before { - content: "\e142"; -} -.glyphicon-heart-empty:before { - content: "\e143"; -} -.glyphicon-link:before { - content: "\e144"; -} -.glyphicon-phone:before { - content: "\e145"; -} -.glyphicon-pushpin:before { - content: "\e146"; -} -.glyphicon-usd:before { - content: "\e148"; -} -.glyphicon-gbp:before { - content: "\e149"; -} -.glyphicon-sort:before { - content: "\e150"; -} -.glyphicon-sort-by-alphabet:before { - content: "\e151"; -} -.glyphicon-sort-by-alphabet-alt:before { - content: "\e152"; -} -.glyphicon-sort-by-order:before { - content: "\e153"; -} -.glyphicon-sort-by-order-alt:before { - content: "\e154"; -} -.glyphicon-sort-by-attributes:before { - content: "\e155"; -} -.glyphicon-sort-by-attributes-alt:before { - content: "\e156"; -} -.glyphicon-unchecked:before { - content: "\e157"; -} -.glyphicon-expand:before { - content: "\e158"; -} -.glyphicon-collapse-down:before { - content: "\e159"; -} -.glyphicon-collapse-up:before { - content: "\e160"; -} -.glyphicon-log-in:before { - content: "\e161"; -} -.glyphicon-flash:before { - content: "\e162"; -} -.glyphicon-log-out:before { - content: "\e163"; -} -.glyphicon-new-window:before { - content: "\e164"; -} -.glyphicon-record:before { - content: "\e165"; -} -.glyphicon-save:before { - content: "\e166"; -} -.glyphicon-open:before { - content: "\e167"; -} -.glyphicon-saved:before { - content: "\e168"; -} -.glyphicon-import:before { - content: "\e169"; -} -.glyphicon-export:before { - content: "\e170"; -} -.glyphicon-send:before { - content: "\e171"; -} -.glyphicon-floppy-disk:before { - content: "\e172"; -} -.glyphicon-floppy-saved:before { - content: "\e173"; -} -.glyphicon-floppy-remove:before { - content: "\e174"; -} -.glyphicon-floppy-save:before { - content: "\e175"; -} -.glyphicon-floppy-open:before { - content: "\e176"; -} -.glyphicon-credit-card:before { - content: "\e177"; -} -.glyphicon-transfer:before { - content: "\e178"; -} -.glyphicon-cutlery:before { - content: "\e179"; -} -.glyphicon-header:before { - content: "\e180"; -} -.glyphicon-compressed:before { - content: "\e181"; -} -.glyphicon-earphone:before { - content: "\e182"; -} -.glyphicon-phone-alt:before { - content: "\e183"; -} -.glyphicon-tower:before { - content: "\e184"; -} -.glyphicon-stats:before { - content: "\e185"; -} -.glyphicon-sd-video:before { - content: "\e186"; -} -.glyphicon-hd-video:before { - content: "\e187"; -} -.glyphicon-subtitles:before { - content: "\e188"; -} -.glyphicon-sound-stereo:before { - content: "\e189"; -} -.glyphicon-sound-dolby:before { - content: "\e190"; -} -.glyphicon-sound-5-1:before { - content: "\e191"; -} -.glyphicon-sound-6-1:before { - content: "\e192"; -} -.glyphicon-sound-7-1:before { - content: "\e193"; -} -.glyphicon-copyright-mark:before { - content: "\e194"; -} -.glyphicon-registration-mark:before { - content: "\e195"; -} -.glyphicon-cloud-download:before { - content: "\e197"; -} -.glyphicon-cloud-upload:before { - content: "\e198"; -} -.glyphicon-tree-conifer:before { - content: "\e199"; -} -.glyphicon-tree-deciduous:before { - content: "\e200"; -} -* { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -*:before, -*:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -html { - font-size: 10px; - - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -} -body { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 1.42857143; - color: #333; - background-color: #fff; -} -input, -button, -select, -textarea { - font-family: inherit; - font-size: inherit; - line-height: inherit; -} -a { - color: #428bca; - text-decoration: none; -} -a:hover, -a:focus { - color: #2a6496; - text-decoration: underline; -} -a:focus { - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -figure { - margin: 0; -} -img { - vertical-align: middle; -} -.img-responsive, -.thumbnail > img, -.thumbnail a > img, -.carousel-inner > .item > img, -.carousel-inner > .item > a > img { - display: block; - width: 100% \9; - max-width: 100%; - height: auto; -} -.img-rounded { - border-radius: 6px; -} -.img-thumbnail { - display: inline-block; - width: 100% \9; - max-width: 100%; - height: auto; - padding: 4px; - line-height: 1.42857143; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 4px; - -webkit-transition: all .2s ease-in-out; - -o-transition: all .2s ease-in-out; - transition: all .2s ease-in-out; -} -.img-circle { - border-radius: 50%; -} -hr { - margin-top: 20px; - margin-bottom: 20px; - border: 0; - border-top: 1px solid #eee; -} -.sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - border: 0; -} -.sr-only-focusable:active, -.sr-only-focusable:focus { - position: static; - width: auto; - height: auto; - margin: 0; - overflow: visible; - clip: auto; -} -h1, -h2, -h3, -h4, -h5, -h6, -.h1, -.h2, -.h3, -.h4, -.h5, -.h6 { - font-family: inherit; - font-weight: 500; - line-height: 1.1; - color: inherit; -} -h1 small, -h2 small, -h3 small, -h4 small, -h5 small, -h6 small, -.h1 small, -.h2 small, -.h3 small, -.h4 small, -.h5 small, -.h6 small, -h1 .small, -h2 .small, -h3 .small, -h4 .small, -h5 .small, -h6 .small, -.h1 .small, -.h2 .small, -.h3 .small, -.h4 .small, -.h5 .small, -.h6 .small { - font-weight: normal; - line-height: 1; - color: #777; -} -h1, -.h1, -h2, -.h2, -h3, -.h3 { - margin-top: 20px; - margin-bottom: 10px; -} -h1 small, -.h1 small, -h2 small, -.h2 small, -h3 small, -.h3 small, -h1 .small, -.h1 .small, -h2 .small, -.h2 .small, -h3 .small, -.h3 .small { - font-size: 65%; -} -h4, -.h4, -h5, -.h5, -h6, -.h6 { - margin-top: 10px; - margin-bottom: 10px; -} -h4 small, -.h4 small, -h5 small, -.h5 small, -h6 small, -.h6 small, -h4 .small, -.h4 .small, -h5 .small, -.h5 .small, -h6 .small, -.h6 .small { - font-size: 75%; -} -h1, -.h1 { - font-size: 36px; -} -h2, -.h2 { - font-size: 30px; -} -h3, -.h3 { - font-size: 24px; -} -h4, -.h4 { - font-size: 18px; -} -h5, -.h5 { - font-size: 14px; -} -h6, -.h6 { - font-size: 12px; -} -p { - margin: 0 0 10px; -} -.lead { - margin-bottom: 20px; - font-size: 16px; - font-weight: 300; - line-height: 1.4; -} -@media (min-width: 768px) { - .lead { - font-size: 21px; - } -} -small, -.small { - font-size: 85%; -} -cite { - font-style: normal; -} -mark, -.mark { - padding: .2em; - background-color: #fcf8e3; -} -.text-left { - text-align: left; -} -.text-right { - text-align: right; -} -.text-center { - text-align: center; -} -.text-justify { - text-align: justify; -} -.text-nowrap { - white-space: nowrap; -} -.text-lowercase { - text-transform: lowercase; -} -.text-uppercase { - text-transform: uppercase; -} -.text-capitalize { - text-transform: capitalize; -} -.text-muted { - color: #777; -} -.text-primary { - color: #428bca; -} -a.text-primary:hover { - color: #3071a9; -} -.text-success { - color: #3c763d; -} -a.text-success:hover { - color: #2b542c; -} -.text-info { - color: #31708f; -} -a.text-info:hover { - color: #245269; -} -.text-warning { - color: #8a6d3b; -} -a.text-warning:hover { - color: #66512c; -} -.text-danger { - color: #a94442; -} -a.text-danger:hover { - color: #843534; -} -.bg-primary { - color: #fff; - background-color: #428bca; -} -a.bg-primary:hover { - background-color: #3071a9; -} -.bg-success { - background-color: #dff0d8; -} -a.bg-success:hover { - background-color: #c1e2b3; -} -.bg-info { - background-color: #d9edf7; -} -a.bg-info:hover { - background-color: #afd9ee; -} -.bg-warning { - background-color: #fcf8e3; -} -a.bg-warning:hover { - background-color: #f7ecb5; -} -.bg-danger { - background-color: #f2dede; -} -a.bg-danger:hover { - background-color: #e4b9b9; -} -.page-header { - padding-bottom: 9px; - margin: 40px 0 20px; - border-bottom: 1px solid #eee; -} -ul, -ol { - margin-top: 0; - margin-bottom: 10px; -} -ul ul, -ol ul, -ul ol, -ol ol { - margin-bottom: 0; -} -.list-unstyled { - padding-left: 0; - list-style: none; -} -.list-inline { - padding-left: 0; - margin-left: -5px; - list-style: none; -} -.list-inline > li { - display: inline-block; - padding-right: 5px; - padding-left: 5px; -} -dl { - margin-top: 0; - margin-bottom: 20px; -} -dt, -dd { - line-height: 1.42857143; -} -dt { - font-weight: bold; -} -dd { - margin-left: 0; -} -@media (min-width: 768px) { - .dl-horizontal dt { - float: left; - width: 160px; - overflow: hidden; - clear: left; - text-align: right; - text-overflow: ellipsis; - white-space: nowrap; - } - .dl-horizontal dd { - margin-left: 180px; - } -} -abbr[title], -abbr[data-original-title] { - cursor: help; - border-bottom: 1px dotted #777; -} -.initialism { - font-size: 90%; - text-transform: uppercase; -} -blockquote { - padding: 10px 20px; - margin: 0 0 20px; - font-size: 17.5px; - border-left: 5px solid #eee; -} -blockquote p:last-child, -blockquote ul:last-child, -blockquote ol:last-child { - margin-bottom: 0; -} -blockquote footer, -blockquote small, -blockquote .small { - display: block; - font-size: 80%; - line-height: 1.42857143; - color: #777; -} -blockquote footer:before, -blockquote small:before, -blockquote .small:before { - content: '\2014 \00A0'; -} -.blockquote-reverse, -blockquote.pull-right { - padding-right: 15px; - padding-left: 0; - text-align: right; - border-right: 5px solid #eee; - border-left: 0; -} -.blockquote-reverse footer:before, -blockquote.pull-right footer:before, -.blockquote-reverse small:before, -blockquote.pull-right small:before, -.blockquote-reverse .small:before, -blockquote.pull-right .small:before { - content: ''; -} -.blockquote-reverse footer:after, -blockquote.pull-right footer:after, -.blockquote-reverse small:after, -blockquote.pull-right small:after, -.blockquote-reverse .small:after, -blockquote.pull-right .small:after { - content: '\00A0 \2014'; -} -blockquote:before, -blockquote:after { - content: ""; -} -address { - margin-bottom: 20px; - font-style: normal; - line-height: 1.42857143; -} -code, -kbd, -pre, -samp { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; -} -code { - padding: 2px 4px; - font-size: 90%; - color: #c7254e; - background-color: #f9f2f4; - border-radius: 4px; -} -kbd { - padding: 2px 4px; - font-size: 90%; - color: #fff; - background-color: #333; - border-radius: 3px; - -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); - box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); -} -kbd kbd { - padding: 0; - font-size: 100%; - -webkit-box-shadow: none; - box-shadow: none; -} -pre { - display: block; - padding: 9.5px; - margin: 0 0 10px; - font-size: 13px; - line-height: 1.42857143; - color: #333; - word-break: break-all; - word-wrap: break-word; - background-color: #f5f5f5; - border: 1px solid #ccc; - border-radius: 4px; -} -pre code { - padding: 0; - font-size: inherit; - color: inherit; - white-space: pre-wrap; - background-color: transparent; - border-radius: 0; -} -.pre-scrollable { - max-height: 340px; - overflow-y: scroll; -} -.container { - padding-right: 15px; - padding-left: 15px; - margin-right: auto; - margin-left: auto; -} -@media (min-width: 768px) { - .container { - width: 750px; - } -} -@media (min-width: 992px) { - .container { - width: 970px; - } -} -@media (min-width: 1200px) { - .container { - width: 1170px; - } -} -.container-fluid { - padding-right: 15px; - padding-left: 15px; - margin-right: auto; - margin-left: auto; -} -.row { - margin-right: -15px; - margin-left: -15px; -} -.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { - position: relative; - min-height: 1px; - padding-right: 15px; - padding-left: 15px; -} -.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { - float: left; -} -.col-xs-12 { - width: 100%; -} -.col-xs-11 { - width: 91.66666667%; -} -.col-xs-10 { - width: 83.33333333%; -} -.col-xs-9 { - width: 75%; -} -.col-xs-8 { - width: 66.66666667%; -} -.col-xs-7 { - width: 58.33333333%; -} -.col-xs-6 { - width: 50%; -} -.col-xs-5 { - width: 41.66666667%; -} -.col-xs-4 { - width: 33.33333333%; -} -.col-xs-3 { - width: 25%; -} -.col-xs-2 { - width: 16.66666667%; -} -.col-xs-1 { - width: 8.33333333%; -} -.col-xs-pull-12 { - right: 100%; -} -.col-xs-pull-11 { - right: 91.66666667%; -} -.col-xs-pull-10 { - right: 83.33333333%; -} -.col-xs-pull-9 { - right: 75%; -} -.col-xs-pull-8 { - right: 66.66666667%; -} -.col-xs-pull-7 { - right: 58.33333333%; -} -.col-xs-pull-6 { - right: 50%; -} -.col-xs-pull-5 { - right: 41.66666667%; -} -.col-xs-pull-4 { - right: 33.33333333%; -} -.col-xs-pull-3 { - right: 25%; -} -.col-xs-pull-2 { - right: 16.66666667%; -} -.col-xs-pull-1 { - right: 8.33333333%; -} -.col-xs-pull-0 { - right: auto; -} -.col-xs-push-12 { - left: 100%; -} -.col-xs-push-11 { - left: 91.66666667%; -} -.col-xs-push-10 { - left: 83.33333333%; -} -.col-xs-push-9 { - left: 75%; -} -.col-xs-push-8 { - left: 66.66666667%; -} -.col-xs-push-7 { - left: 58.33333333%; -} -.col-xs-push-6 { - left: 50%; -} -.col-xs-push-5 { - left: 41.66666667%; -} -.col-xs-push-4 { - left: 33.33333333%; -} -.col-xs-push-3 { - left: 25%; -} -.col-xs-push-2 { - left: 16.66666667%; -} -.col-xs-push-1 { - left: 8.33333333%; -} -.col-xs-push-0 { - left: auto; -} -.col-xs-offset-12 { - margin-left: 100%; -} -.col-xs-offset-11 { - margin-left: 91.66666667%; -} -.col-xs-offset-10 { - margin-left: 83.33333333%; -} -.col-xs-offset-9 { - margin-left: 75%; -} -.col-xs-offset-8 { - margin-left: 66.66666667%; -} -.col-xs-offset-7 { - margin-left: 58.33333333%; -} -.col-xs-offset-6 { - margin-left: 50%; -} -.col-xs-offset-5 { - margin-left: 41.66666667%; -} -.col-xs-offset-4 { - margin-left: 33.33333333%; -} -.col-xs-offset-3 { - margin-left: 25%; -} -.col-xs-offset-2 { - margin-left: 16.66666667%; -} -.col-xs-offset-1 { - margin-left: 8.33333333%; -} -.col-xs-offset-0 { - margin-left: 0; -} -@media (min-width: 768px) { - .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { - float: left; - } - .col-sm-12 { - width: 100%; - } - .col-sm-11 { - width: 91.66666667%; - } - .col-sm-10 { - width: 83.33333333%; - } - .col-sm-9 { - width: 75%; - } - .col-sm-8 { - width: 66.66666667%; - } - .col-sm-7 { - width: 58.33333333%; - } - .col-sm-6 { - width: 50%; - } - .col-sm-5 { - width: 41.66666667%; - } - .col-sm-4 { - width: 33.33333333%; - } - .col-sm-3 { - width: 25%; - } - .col-sm-2 { - width: 16.66666667%; - } - .col-sm-1 { - width: 8.33333333%; - } - .col-sm-pull-12 { - right: 100%; - } - .col-sm-pull-11 { - right: 91.66666667%; - } - .col-sm-pull-10 { - right: 83.33333333%; - } - .col-sm-pull-9 { - right: 75%; - } - .col-sm-pull-8 { - right: 66.66666667%; - } - .col-sm-pull-7 { - right: 58.33333333%; - } - .col-sm-pull-6 { - right: 50%; - } - .col-sm-pull-5 { - right: 41.66666667%; - } - .col-sm-pull-4 { - right: 33.33333333%; - } - .col-sm-pull-3 { - right: 25%; - } - .col-sm-pull-2 { - right: 16.66666667%; - } - .col-sm-pull-1 { - right: 8.33333333%; - } - .col-sm-pull-0 { - right: auto; - } - .col-sm-push-12 { - left: 100%; - } - .col-sm-push-11 { - left: 91.66666667%; - } - .col-sm-push-10 { - left: 83.33333333%; - } - .col-sm-push-9 { - left: 75%; - } - .col-sm-push-8 { - left: 66.66666667%; - } - .col-sm-push-7 { - left: 58.33333333%; - } - .col-sm-push-6 { - left: 50%; - } - .col-sm-push-5 { - left: 41.66666667%; - } - .col-sm-push-4 { - left: 33.33333333%; - } - .col-sm-push-3 { - left: 25%; - } - .col-sm-push-2 { - left: 16.66666667%; - } - .col-sm-push-1 { - left: 8.33333333%; - } - .col-sm-push-0 { - left: auto; - } - .col-sm-offset-12 { - margin-left: 100%; - } - .col-sm-offset-11 { - margin-left: 91.66666667%; - } - .col-sm-offset-10 { - margin-left: 83.33333333%; - } - .col-sm-offset-9 { - margin-left: 75%; - } - .col-sm-offset-8 { - margin-left: 66.66666667%; - } - .col-sm-offset-7 { - margin-left: 58.33333333%; - } - .col-sm-offset-6 { - margin-left: 50%; - } - .col-sm-offset-5 { - margin-left: 41.66666667%; - } - .col-sm-offset-4 { - margin-left: 33.33333333%; - } - .col-sm-offset-3 { - margin-left: 25%; - } - .col-sm-offset-2 { - margin-left: 16.66666667%; - } - .col-sm-offset-1 { - margin-left: 8.33333333%; - } - .col-sm-offset-0 { - margin-left: 0; - } -} -@media (min-width: 992px) { - .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { - float: left; - } - .col-md-12 { - width: 100%; - } - .col-md-11 { - width: 91.66666667%; - } - .col-md-10 { - width: 83.33333333%; - } - .col-md-9 { - width: 75%; - } - .col-md-8 { - width: 66.66666667%; - } - .col-md-7 { - width: 58.33333333%; - } - .col-md-6 { - width: 50%; - } - .col-md-5 { - width: 41.66666667%; - } - .col-md-4 { - width: 33.33333333%; - } - .col-md-3 { - width: 25%; - } - .col-md-2 { - width: 16.66666667%; - } - .col-md-1 { - width: 8.33333333%; - } - .col-md-pull-12 { - right: 100%; - } - .col-md-pull-11 { - right: 91.66666667%; - } - .col-md-pull-10 { - right: 83.33333333%; - } - .col-md-pull-9 { - right: 75%; - } - .col-md-pull-8 { - right: 66.66666667%; - } - .col-md-pull-7 { - right: 58.33333333%; - } - .col-md-pull-6 { - right: 50%; - } - .col-md-pull-5 { - right: 41.66666667%; - } - .col-md-pull-4 { - right: 33.33333333%; - } - .col-md-pull-3 { - right: 25%; - } - .col-md-pull-2 { - right: 16.66666667%; - } - .col-md-pull-1 { - right: 8.33333333%; - } - .col-md-pull-0 { - right: auto; - } - .col-md-push-12 { - left: 100%; - } - .col-md-push-11 { - left: 91.66666667%; - } - .col-md-push-10 { - left: 83.33333333%; - } - .col-md-push-9 { - left: 75%; - } - .col-md-push-8 { - left: 66.66666667%; - } - .col-md-push-7 { - left: 58.33333333%; - } - .col-md-push-6 { - left: 50%; - } - .col-md-push-5 { - left: 41.66666667%; - } - .col-md-push-4 { - left: 33.33333333%; - } - .col-md-push-3 { - left: 25%; - } - .col-md-push-2 { - left: 16.66666667%; - } - .col-md-push-1 { - left: 8.33333333%; - } - .col-md-push-0 { - left: auto; - } - .col-md-offset-12 { - margin-left: 100%; - } - .col-md-offset-11 { - margin-left: 91.66666667%; - } - .col-md-offset-10 { - margin-left: 83.33333333%; - } - .col-md-offset-9 { - margin-left: 75%; - } - .col-md-offset-8 { - margin-left: 66.66666667%; - } - .col-md-offset-7 { - margin-left: 58.33333333%; - } - .col-md-offset-6 { - margin-left: 50%; - } - .col-md-offset-5 { - margin-left: 41.66666667%; - } - .col-md-offset-4 { - margin-left: 33.33333333%; - } - .col-md-offset-3 { - margin-left: 25%; - } - .col-md-offset-2 { - margin-left: 16.66666667%; - } - .col-md-offset-1 { - margin-left: 8.33333333%; - } - .col-md-offset-0 { - margin-left: 0; - } -} -@media (min-width: 1200px) { - .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { - float: left; - } - .col-lg-12 { - width: 100%; - } - .col-lg-11 { - width: 91.66666667%; - } - .col-lg-10 { - width: 83.33333333%; - } - .col-lg-9 { - width: 75%; - } - .col-lg-8 { - width: 66.66666667%; - } - .col-lg-7 { - width: 58.33333333%; - } - .col-lg-6 { - width: 50%; - } - .col-lg-5 { - width: 41.66666667%; - } - .col-lg-4 { - width: 33.33333333%; - } - .col-lg-3 { - width: 25%; - } - .col-lg-2 { - width: 16.66666667%; - } - .col-lg-1 { - width: 8.33333333%; - } - .col-lg-pull-12 { - right: 100%; - } - .col-lg-pull-11 { - right: 91.66666667%; - } - .col-lg-pull-10 { - right: 83.33333333%; - } - .col-lg-pull-9 { - right: 75%; - } - .col-lg-pull-8 { - right: 66.66666667%; - } - .col-lg-pull-7 { - right: 58.33333333%; - } - .col-lg-pull-6 { - right: 50%; - } - .col-lg-pull-5 { - right: 41.66666667%; - } - .col-lg-pull-4 { - right: 33.33333333%; - } - .col-lg-pull-3 { - right: 25%; - } - .col-lg-pull-2 { - right: 16.66666667%; - } - .col-lg-pull-1 { - right: 8.33333333%; - } - .col-lg-pull-0 { - right: auto; - } - .col-lg-push-12 { - left: 100%; - } - .col-lg-push-11 { - left: 91.66666667%; - } - .col-lg-push-10 { - left: 83.33333333%; - } - .col-lg-push-9 { - left: 75%; - } - .col-lg-push-8 { - left: 66.66666667%; - } - .col-lg-push-7 { - left: 58.33333333%; - } - .col-lg-push-6 { - left: 50%; - } - .col-lg-push-5 { - left: 41.66666667%; - } - .col-lg-push-4 { - left: 33.33333333%; - } - .col-lg-push-3 { - left: 25%; - } - .col-lg-push-2 { - left: 16.66666667%; - } - .col-lg-push-1 { - left: 8.33333333%; - } - .col-lg-push-0 { - left: auto; - } - .col-lg-offset-12 { - margin-left: 100%; - } - .col-lg-offset-11 { - margin-left: 91.66666667%; - } - .col-lg-offset-10 { - margin-left: 83.33333333%; - } - .col-lg-offset-9 { - margin-left: 75%; - } - .col-lg-offset-8 { - margin-left: 66.66666667%; - } - .col-lg-offset-7 { - margin-left: 58.33333333%; - } - .col-lg-offset-6 { - margin-left: 50%; - } - .col-lg-offset-5 { - margin-left: 41.66666667%; - } - .col-lg-offset-4 { - margin-left: 33.33333333%; - } - .col-lg-offset-3 { - margin-left: 25%; - } - .col-lg-offset-2 { - margin-left: 16.66666667%; - } - .col-lg-offset-1 { - margin-left: 8.33333333%; - } - .col-lg-offset-0 { - margin-left: 0; - } -} -table { - background-color: transparent; -} -th { - text-align: left; -} -.table { - width: 100%; - max-width: 100%; - margin-bottom: 20px; -} -.table > thead > tr > th, -.table > tbody > tr > th, -.table > tfoot > tr > th, -.table > thead > tr > td, -.table > tbody > tr > td, -.table > tfoot > tr > td { - padding: 8px; - line-height: 1.42857143; - vertical-align: top; - border-top: 1px solid #ddd; -} -.table > thead > tr > th { - vertical-align: bottom; - border-bottom: 2px solid #ddd; -} -.table > caption + thead > tr:first-child > th, -.table > colgroup + thead > tr:first-child > th, -.table > thead:first-child > tr:first-child > th, -.table > caption + thead > tr:first-child > td, -.table > colgroup + thead > tr:first-child > td, -.table > thead:first-child > tr:first-child > td { - border-top: 0; -} -.table > tbody + tbody { - border-top: 2px solid #ddd; -} -.table .table { - background-color: #fff; -} -.table-condensed > thead > tr > th, -.table-condensed > tbody > tr > th, -.table-condensed > tfoot > tr > th, -.table-condensed > thead > tr > td, -.table-condensed > tbody > tr > td, -.table-condensed > tfoot > tr > td { - padding: 5px; -} -.table-bordered { - border: 1px solid #ddd; -} -.table-bordered > thead > tr > th, -.table-bordered > tbody > tr > th, -.table-bordered > tfoot > tr > th, -.table-bordered > thead > tr > td, -.table-bordered > tbody > tr > td, -.table-bordered > tfoot > tr > td { - border: 1px solid #ddd; -} -.table-bordered > thead > tr > th, -.table-bordered > thead > tr > td { - border-bottom-width: 2px; -} -.table-striped > tbody > tr:nth-child(odd) > td, -.table-striped > tbody > tr:nth-child(odd) > th { - background-color: #f9f9f9; -} -.table-hover > tbody > tr:hover > td, -.table-hover > tbody > tr:hover > th { - background-color: #f5f5f5; -} -table col[class*="col-"] { - position: static; - display: table-column; - float: none; -} -table td[class*="col-"], -table th[class*="col-"] { - position: static; - display: table-cell; - float: none; -} -.table > thead > tr > td.active, -.table > tbody > tr > td.active, -.table > tfoot > tr > td.active, -.table > thead > tr > th.active, -.table > tbody > tr > th.active, -.table > tfoot > tr > th.active, -.table > thead > tr.active > td, -.table > tbody > tr.active > td, -.table > tfoot > tr.active > td, -.table > thead > tr.active > th, -.table > tbody > tr.active > th, -.table > tfoot > tr.active > th { - background-color: #f5f5f5; -} -.table-hover > tbody > tr > td.active:hover, -.table-hover > tbody > tr > th.active:hover, -.table-hover > tbody > tr.active:hover > td, -.table-hover > tbody > tr:hover > .active, -.table-hover > tbody > tr.active:hover > th { - background-color: #e8e8e8; -} -.table > thead > tr > td.success, -.table > tbody > tr > td.success, -.table > tfoot > tr > td.success, -.table > thead > tr > th.success, -.table > tbody > tr > th.success, -.table > tfoot > tr > th.success, -.table > thead > tr.success > td, -.table > tbody > tr.success > td, -.table > tfoot > tr.success > td, -.table > thead > tr.success > th, -.table > tbody > tr.success > th, -.table > tfoot > tr.success > th { - background-color: #dff0d8; -} -.table-hover > tbody > tr > td.success:hover, -.table-hover > tbody > tr > th.success:hover, -.table-hover > tbody > tr.success:hover > td, -.table-hover > tbody > tr:hover > .success, -.table-hover > tbody > tr.success:hover > th { - background-color: #d0e9c6; -} -.table > thead > tr > td.info, -.table > tbody > tr > td.info, -.table > tfoot > tr > td.info, -.table > thead > tr > th.info, -.table > tbody > tr > th.info, -.table > tfoot > tr > th.info, -.table > thead > tr.info > td, -.table > tbody > tr.info > td, -.table > tfoot > tr.info > td, -.table > thead > tr.info > th, -.table > tbody > tr.info > th, -.table > tfoot > tr.info > th { - background-color: #d9edf7; -} -.table-hover > tbody > tr > td.info:hover, -.table-hover > tbody > tr > th.info:hover, -.table-hover > tbody > tr.info:hover > td, -.table-hover > tbody > tr:hover > .info, -.table-hover > tbody > tr.info:hover > th { - background-color: #c4e3f3; -} -.table > thead > tr > td.warning, -.table > tbody > tr > td.warning, -.table > tfoot > tr > td.warning, -.table > thead > tr > th.warning, -.table > tbody > tr > th.warning, -.table > tfoot > tr > th.warning, -.table > thead > tr.warning > td, -.table > tbody > tr.warning > td, -.table > tfoot > tr.warning > td, -.table > thead > tr.warning > th, -.table > tbody > tr.warning > th, -.table > tfoot > tr.warning > th { - background-color: #fcf8e3; -} -.table-hover > tbody > tr > td.warning:hover, -.table-hover > tbody > tr > th.warning:hover, -.table-hover > tbody > tr.warning:hover > td, -.table-hover > tbody > tr:hover > .warning, -.table-hover > tbody > tr.warning:hover > th { - background-color: #faf2cc; -} -.table > thead > tr > td.danger, -.table > tbody > tr > td.danger, -.table > tfoot > tr > td.danger, -.table > thead > tr > th.danger, -.table > tbody > tr > th.danger, -.table > tfoot > tr > th.danger, -.table > thead > tr.danger > td, -.table > tbody > tr.danger > td, -.table > tfoot > tr.danger > td, -.table > thead > tr.danger > th, -.table > tbody > tr.danger > th, -.table > tfoot > tr.danger > th { - background-color: #f2dede; -} -.table-hover > tbody > tr > td.danger:hover, -.table-hover > tbody > tr > th.danger:hover, -.table-hover > tbody > tr.danger:hover > td, -.table-hover > tbody > tr:hover > .danger, -.table-hover > tbody > tr.danger:hover > th { - background-color: #ebcccc; -} -@media screen and (max-width: 767px) { - .table-responsive { - width: 100%; - margin-bottom: 15px; - overflow-x: auto; - overflow-y: hidden; - -webkit-overflow-scrolling: touch; - -ms-overflow-style: -ms-autohiding-scrollbar; - border: 1px solid #ddd; - } - .table-responsive > .table { - margin-bottom: 0; - } - .table-responsive > .table > thead > tr > th, - .table-responsive > .table > tbody > tr > th, - .table-responsive > .table > tfoot > tr > th, - .table-responsive > .table > thead > tr > td, - .table-responsive > .table > tbody > tr > td, - .table-responsive > .table > tfoot > tr > td { - white-space: nowrap; - } - .table-responsive > .table-bordered { - border: 0; - } - .table-responsive > .table-bordered > thead > tr > th:first-child, - .table-responsive > .table-bordered > tbody > tr > th:first-child, - .table-responsive > .table-bordered > tfoot > tr > th:first-child, - .table-responsive > .table-bordered > thead > tr > td:first-child, - .table-responsive > .table-bordered > tbody > tr > td:first-child, - .table-responsive > .table-bordered > tfoot > tr > td:first-child { - border-left: 0; - } - .table-responsive > .table-bordered > thead > tr > th:last-child, - .table-responsive > .table-bordered > tbody > tr > th:last-child, - .table-responsive > .table-bordered > tfoot > tr > th:last-child, - .table-responsive > .table-bordered > thead > tr > td:last-child, - .table-responsive > .table-bordered > tbody > tr > td:last-child, - .table-responsive > .table-bordered > tfoot > tr > td:last-child { - border-right: 0; - } - .table-responsive > .table-bordered > tbody > tr:last-child > th, - .table-responsive > .table-bordered > tfoot > tr:last-child > th, - .table-responsive > .table-bordered > tbody > tr:last-child > td, - .table-responsive > .table-bordered > tfoot > tr:last-child > td { - border-bottom: 0; - } -} -fieldset { - min-width: 0; - padding: 0; - margin: 0; - border: 0; -} -legend { - display: block; - width: 100%; - padding: 0; - margin-bottom: 20px; - font-size: 21px; - line-height: inherit; - color: #333; - border: 0; - border-bottom: 1px solid #e5e5e5; -} -label { - display: inline-block; - max-width: 100%; - margin-bottom: 5px; - font-weight: bold; -} -input[type="search"] { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -input[type="radio"], -input[type="checkbox"] { - margin: 4px 0 0; - margin-top: 1px \9; - line-height: normal; -} -input[type="file"] { - display: block; -} -input[type="range"] { - display: block; - width: 100%; -} -select[multiple], -select[size] { - height: auto; -} -input[type="file"]:focus, -input[type="radio"]:focus, -input[type="checkbox"]:focus { - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -output { - display: block; - padding-top: 7px; - font-size: 14px; - line-height: 1.42857143; - color: #555; -} -.form-control { - display: block; - width: 100%; - height: 34px; - padding: 6px 12px; - font-size: 14px; - line-height: 1.42857143; - color: #555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; - -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -} -.form-control:focus { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); - box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); -} -.form-control::-moz-placeholder { - color: #777; - opacity: 1; -} -.form-control:-ms-input-placeholder { - color: #777; -} -.form-control::-webkit-input-placeholder { - color: #777; -} -.form-control[disabled], -.form-control[readonly], -fieldset[disabled] .form-control { - cursor: not-allowed; - background-color: #eee; - opacity: 1; -} -textarea.form-control { - height: auto; -} -input[type="search"] { - -webkit-appearance: none; -} -input[type="date"], -input[type="time"], -input[type="datetime-local"], -input[type="month"] { - line-height: 34px; - line-height: 1.42857143 \0; -} -input[type="date"].input-sm, -input[type="time"].input-sm, -input[type="datetime-local"].input-sm, -input[type="month"].input-sm { - line-height: 30px; -} -input[type="date"].input-lg, -input[type="time"].input-lg, -input[type="datetime-local"].input-lg, -input[type="month"].input-lg { - line-height: 46px; -} -.form-group { - margin-bottom: 15px; -} -.radio, -.checkbox { - position: relative; - display: block; - min-height: 20px; - margin-top: 10px; - margin-bottom: 10px; -} -.radio label, -.checkbox label { - padding-left: 20px; - margin-bottom: 0; - font-weight: normal; - cursor: pointer; -} -.radio input[type="radio"], -.radio-inline input[type="radio"], -.checkbox input[type="checkbox"], -.checkbox-inline input[type="checkbox"] { - position: absolute; - margin-top: 4px \9; - margin-left: -20px; -} -.radio + .radio, -.checkbox + .checkbox { - margin-top: -5px; -} -.radio-inline, -.checkbox-inline { - display: inline-block; - padding-left: 20px; - margin-bottom: 0; - font-weight: normal; - vertical-align: middle; - cursor: pointer; -} -.radio-inline + .radio-inline, -.checkbox-inline + .checkbox-inline { - margin-top: 0; - margin-left: 10px; -} -input[type="radio"][disabled], -input[type="checkbox"][disabled], -input[type="radio"].disabled, -input[type="checkbox"].disabled, -fieldset[disabled] input[type="radio"], -fieldset[disabled] input[type="checkbox"] { - cursor: not-allowed; -} -.radio-inline.disabled, -.checkbox-inline.disabled, -fieldset[disabled] .radio-inline, -fieldset[disabled] .checkbox-inline { - cursor: not-allowed; -} -.radio.disabled label, -.checkbox.disabled label, -fieldset[disabled] .radio label, -fieldset[disabled] .checkbox label { - cursor: not-allowed; -} -.form-control-static { - padding-top: 7px; - padding-bottom: 7px; - margin-bottom: 0; -} -.form-control-static.input-lg, -.form-control-static.input-sm { - padding-right: 0; - padding-left: 0; -} -.input-sm, -.form-horizontal .form-group-sm .form-control { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -select.input-sm { - height: 30px; - line-height: 30px; -} -textarea.input-sm, -select[multiple].input-sm { - height: auto; -} -.input-lg, -.form-horizontal .form-group-lg .form-control { - height: 46px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.33; - border-radius: 6px; -} -select.input-lg { - height: 46px; - line-height: 46px; -} -textarea.input-lg, -select[multiple].input-lg { - height: auto; -} -.has-feedback { - position: relative; -} -.has-feedback .form-control { - padding-right: 42.5px; -} -.form-control-feedback { - position: absolute; - top: 25px; - right: 0; - z-index: 2; - display: block; - width: 34px; - height: 34px; - line-height: 34px; - text-align: center; -} -.input-lg + .form-control-feedback { - width: 46px; - height: 46px; - line-height: 46px; -} -.input-sm + .form-control-feedback { - width: 30px; - height: 30px; - line-height: 30px; -} -.has-success .help-block, -.has-success .control-label, -.has-success .radio, -.has-success .checkbox, -.has-success .radio-inline, -.has-success .checkbox-inline { - color: #3c763d; -} -.has-success .form-control { - border-color: #3c763d; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); -} -.has-success .form-control:focus { - border-color: #2b542c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; -} -.has-success .input-group-addon { - color: #3c763d; - background-color: #dff0d8; - border-color: #3c763d; -} -.has-success .form-control-feedback { - color: #3c763d; -} -.has-warning .help-block, -.has-warning .control-label, -.has-warning .radio, -.has-warning .checkbox, -.has-warning .radio-inline, -.has-warning .checkbox-inline { - color: #8a6d3b; -} -.has-warning .form-control { - border-color: #8a6d3b; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); -} -.has-warning .form-control:focus { - border-color: #66512c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; -} -.has-warning .input-group-addon { - color: #8a6d3b; - background-color: #fcf8e3; - border-color: #8a6d3b; -} -.has-warning .form-control-feedback { - color: #8a6d3b; -} -.has-error .help-block, -.has-error .control-label, -.has-error .radio, -.has-error .checkbox, -.has-error .radio-inline, -.has-error .checkbox-inline { - color: #a94442; -} -.has-error .form-control { - border-color: #a94442; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); -} -.has-error .form-control:focus { - border-color: #843534; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; -} -.has-error .input-group-addon { - color: #a94442; - background-color: #f2dede; - border-color: #a94442; -} -.has-error .form-control-feedback { - color: #a94442; -} -.has-feedback label.sr-only ~ .form-control-feedback { - top: 0; -} -.help-block { - display: block; - margin-top: 5px; - margin-bottom: 10px; - color: #737373; -} -@media (min-width: 768px) { - .form-inline .form-group { - display: inline-block; - margin-bottom: 0; - vertical-align: middle; - } - .form-inline .form-control { - display: inline-block; - width: auto; - vertical-align: middle; - } - .form-inline .input-group { - display: inline-table; - vertical-align: middle; - } - .form-inline .input-group .input-group-addon, - .form-inline .input-group .input-group-btn, - .form-inline .input-group .form-control { - width: auto; - } - .form-inline .input-group > .form-control { - width: 100%; - } - .form-inline .control-label { - margin-bottom: 0; - vertical-align: middle; - } - .form-inline .radio, - .form-inline .checkbox { - display: inline-block; - margin-top: 0; - margin-bottom: 0; - vertical-align: middle; - } - .form-inline .radio label, - .form-inline .checkbox label { - padding-left: 0; - } - .form-inline .radio input[type="radio"], - .form-inline .checkbox input[type="checkbox"] { - position: relative; - margin-left: 0; - } - .form-inline .has-feedback .form-control-feedback { - top: 0; - } -} -.form-horizontal .radio, -.form-horizontal .checkbox, -.form-horizontal .radio-inline, -.form-horizontal .checkbox-inline { - padding-top: 7px; - margin-top: 0; - margin-bottom: 0; -} -.form-horizontal .radio, -.form-horizontal .checkbox { - min-height: 27px; -} -.form-horizontal .form-group { - margin-right: -15px; - margin-left: -15px; -} -@media (min-width: 768px) { - .form-horizontal .control-label { - padding-top: 7px; - margin-bottom: 0; - text-align: right; - } -} -.form-horizontal .has-feedback .form-control-feedback { - top: 0; - right: 15px; -} -@media (min-width: 768px) { - .form-horizontal .form-group-lg .control-label { - padding-top: 14.3px; - } -} -@media (min-width: 768px) { - .form-horizontal .form-group-sm .control-label { - padding-top: 6px; - } -} -.btn { - display: inline-block; - padding: 6px 12px; - margin-bottom: 0; - font-size: 14px; - font-weight: normal; - line-height: 1.42857143; - text-align: center; - white-space: nowrap; - vertical-align: middle; - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - background-image: none; - border: 1px solid transparent; - border-radius: 4px; -} -.btn:focus, -.btn:active:focus, -.btn.active:focus { - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -.btn:hover, -.btn:focus { - color: #333; - text-decoration: none; -} -.btn:active, -.btn.active { - background-image: none; - outline: 0; - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); -} -.btn.disabled, -.btn[disabled], -fieldset[disabled] .btn { - pointer-events: none; - cursor: not-allowed; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - box-shadow: none; - opacity: .65; -} -.btn-default { - color: #333; - background-color: #fff; - border-color: #ccc; -} -.btn-default:hover, -.btn-default:focus, -.btn-default:active, -.btn-default.active, -.open > .dropdown-toggle.btn-default { - color: #333; - background-color: #e6e6e6; - border-color: #adadad; -} -.btn-default:active, -.btn-default.active, -.open > .dropdown-toggle.btn-default { - background-image: none; -} -.btn-default.disabled, -.btn-default[disabled], -fieldset[disabled] .btn-default, -.btn-default.disabled:hover, -.btn-default[disabled]:hover, -fieldset[disabled] .btn-default:hover, -.btn-default.disabled:focus, -.btn-default[disabled]:focus, -fieldset[disabled] .btn-default:focus, -.btn-default.disabled:active, -.btn-default[disabled]:active, -fieldset[disabled] .btn-default:active, -.btn-default.disabled.active, -.btn-default[disabled].active, -fieldset[disabled] .btn-default.active { - background-color: #fff; - border-color: #ccc; -} -.btn-default .badge { - color: #fff; - background-color: #333; -} -.btn-primary { - color: #fff; - background-color: #428bca; - border-color: #357ebd; -} -.btn-primary:hover, -.btn-primary:focus, -.btn-primary:active, -.btn-primary.active, -.open > .dropdown-toggle.btn-primary { - color: #fff; - background-color: #3071a9; - border-color: #285e8e; -} -.btn-primary:active, -.btn-primary.active, -.open > .dropdown-toggle.btn-primary { - background-image: none; -} -.btn-primary.disabled, -.btn-primary[disabled], -fieldset[disabled] .btn-primary, -.btn-primary.disabled:hover, -.btn-primary[disabled]:hover, -fieldset[disabled] .btn-primary:hover, -.btn-primary.disabled:focus, -.btn-primary[disabled]:focus, -fieldset[disabled] .btn-primary:focus, -.btn-primary.disabled:active, -.btn-primary[disabled]:active, -fieldset[disabled] .btn-primary:active, -.btn-primary.disabled.active, -.btn-primary[disabled].active, -fieldset[disabled] .btn-primary.active { - background-color: #428bca; - border-color: #357ebd; -} -.btn-primary .badge { - color: #428bca; - background-color: #fff; -} -.btn-success { - color: #fff; - background-color: #5cb85c; - border-color: #4cae4c; -} -.btn-success:hover, -.btn-success:focus, -.btn-success:active, -.btn-success.active, -.open > .dropdown-toggle.btn-success { - color: #fff; - background-color: #449d44; - border-color: #398439; -} -.btn-success:active, -.btn-success.active, -.open > .dropdown-toggle.btn-success { - background-image: none; -} -.btn-success.disabled, -.btn-success[disabled], -fieldset[disabled] .btn-success, -.btn-success.disabled:hover, -.btn-success[disabled]:hover, -fieldset[disabled] .btn-success:hover, -.btn-success.disabled:focus, -.btn-success[disabled]:focus, -fieldset[disabled] .btn-success:focus, -.btn-success.disabled:active, -.btn-success[disabled]:active, -fieldset[disabled] .btn-success:active, -.btn-success.disabled.active, -.btn-success[disabled].active, -fieldset[disabled] .btn-success.active { - background-color: #5cb85c; - border-color: #4cae4c; -} -.btn-success .badge { - color: #5cb85c; - background-color: #fff; -} -.btn-info { - color: #fff; - background-color: #5bc0de; - border-color: #46b8da; -} -.btn-info:hover, -.btn-info:focus, -.btn-info:active, -.btn-info.active, -.open > .dropdown-toggle.btn-info { - color: #fff; - background-color: #31b0d5; - border-color: #269abc; -} -.btn-info:active, -.btn-info.active, -.open > .dropdown-toggle.btn-info { - background-image: none; -} -.btn-info.disabled, -.btn-info[disabled], -fieldset[disabled] .btn-info, -.btn-info.disabled:hover, -.btn-info[disabled]:hover, -fieldset[disabled] .btn-info:hover, -.btn-info.disabled:focus, -.btn-info[disabled]:focus, -fieldset[disabled] .btn-info:focus, -.btn-info.disabled:active, -.btn-info[disabled]:active, -fieldset[disabled] .btn-info:active, -.btn-info.disabled.active, -.btn-info[disabled].active, -fieldset[disabled] .btn-info.active { - background-color: #5bc0de; - border-color: #46b8da; -} -.btn-info .badge { - color: #5bc0de; - background-color: #fff; -} -.btn-warning { - color: #fff; - background-color: #f0ad4e; - border-color: #eea236; -} -.btn-warning:hover, -.btn-warning:focus, -.btn-warning:active, -.btn-warning.active, -.open > .dropdown-toggle.btn-warning { - color: #fff; - background-color: #ec971f; - border-color: #d58512; -} -.btn-warning:active, -.btn-warning.active, -.open > .dropdown-toggle.btn-warning { - background-image: none; -} -.btn-warning.disabled, -.btn-warning[disabled], -fieldset[disabled] .btn-warning, -.btn-warning.disabled:hover, -.btn-warning[disabled]:hover, -fieldset[disabled] .btn-warning:hover, -.btn-warning.disabled:focus, -.btn-warning[disabled]:focus, -fieldset[disabled] .btn-warning:focus, -.btn-warning.disabled:active, -.btn-warning[disabled]:active, -fieldset[disabled] .btn-warning:active, -.btn-warning.disabled.active, -.btn-warning[disabled].active, -fieldset[disabled] .btn-warning.active { - background-color: #f0ad4e; - border-color: #eea236; -} -.btn-warning .badge { - color: #f0ad4e; - background-color: #fff; -} -.btn-danger { - color: #fff; - background-color: #d9534f; - border-color: #d43f3a; -} -.btn-danger:hover, -.btn-danger:focus, -.btn-danger:active, -.btn-danger.active, -.open > .dropdown-toggle.btn-danger { - color: #fff; - background-color: #c9302c; - border-color: #ac2925; -} -.btn-danger:active, -.btn-danger.active, -.open > .dropdown-toggle.btn-danger { - background-image: none; -} -.btn-danger.disabled, -.btn-danger[disabled], -fieldset[disabled] .btn-danger, -.btn-danger.disabled:hover, -.btn-danger[disabled]:hover, -fieldset[disabled] .btn-danger:hover, -.btn-danger.disabled:focus, -.btn-danger[disabled]:focus, -fieldset[disabled] .btn-danger:focus, -.btn-danger.disabled:active, -.btn-danger[disabled]:active, -fieldset[disabled] .btn-danger:active, -.btn-danger.disabled.active, -.btn-danger[disabled].active, -fieldset[disabled] .btn-danger.active { - background-color: #d9534f; - border-color: #d43f3a; -} -.btn-danger .badge { - color: #d9534f; - background-color: #fff; -} -.btn-link { - font-weight: normal; - color: #428bca; - cursor: pointer; - border-radius: 0; -} -.btn-link, -.btn-link:active, -.btn-link[disabled], -fieldset[disabled] .btn-link { - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; -} -.btn-link, -.btn-link:hover, -.btn-link:focus, -.btn-link:active { - border-color: transparent; -} -.btn-link:hover, -.btn-link:focus { - color: #2a6496; - text-decoration: underline; - background-color: transparent; -} -.btn-link[disabled]:hover, -fieldset[disabled] .btn-link:hover, -.btn-link[disabled]:focus, -fieldset[disabled] .btn-link:focus { - color: #777; - text-decoration: none; -} -.btn-lg, -.btn-group-lg > .btn { - padding: 10px 16px; - font-size: 18px; - line-height: 1.33; - border-radius: 6px; -} -.btn-sm, -.btn-group-sm > .btn { - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -.btn-xs, -.btn-group-xs > .btn { - padding: 1px 5px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -.btn-block { - display: block; - width: 100%; -} -.btn-block + .btn-block { - margin-top: 5px; -} -input[type="submit"].btn-block, -input[type="reset"].btn-block, -input[type="button"].btn-block { - width: 100%; -} -.fade { - opacity: 0; - -webkit-transition: opacity .15s linear; - -o-transition: opacity .15s linear; - transition: opacity .15s linear; -} -.fade.in { - opacity: 1; -} -.collapse { - display: none; -} -.collapse.in { - display: block; -} -tr.collapse.in { - display: table-row; -} -tbody.collapse.in { - display: table-row-group; -} -.collapsing { - position: relative; - height: 0; - overflow: hidden; - -webkit-transition: height .35s ease; - -o-transition: height .35s ease; - transition: height .35s ease; -} -.caret { - display: inline-block; - width: 0; - height: 0; - margin-left: 2px; - vertical-align: middle; - border-top: 4px solid; - border-right: 4px solid transparent; - border-left: 4px solid transparent; -} -.dropdown { - position: relative; -} -.dropdown-toggle:focus { - outline: 0; -} -.dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 160px; - padding: 5px 0; - margin: 2px 0 0; - font-size: 14px; - text-align: left; - list-style: none; - background-color: #fff; - -webkit-background-clip: padding-box; - background-clip: padding-box; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, .15); - border-radius: 4px; - -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); - box-shadow: 0 6px 12px rgba(0, 0, 0, .175); -} -.dropdown-menu.pull-right { - right: 0; - left: auto; -} -.dropdown-menu .divider { - height: 1px; - margin: 9px 0; - overflow: hidden; - background-color: #e5e5e5; -} -.dropdown-menu > li > a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 1.42857143; - color: #333; - white-space: nowrap; -} -.dropdown-menu > li > a:hover, -.dropdown-menu > li > a:focus { - color: #262626; - text-decoration: none; - background-color: #f5f5f5; -} -.dropdown-menu > .active > a, -.dropdown-menu > .active > a:hover, -.dropdown-menu > .active > a:focus { - color: #fff; - text-decoration: none; - background-color: #428bca; - outline: 0; -} -.dropdown-menu > .disabled > a, -.dropdown-menu > .disabled > a:hover, -.dropdown-menu > .disabled > a:focus { - color: #777; -} -.dropdown-menu > .disabled > a:hover, -.dropdown-menu > .disabled > a:focus { - text-decoration: none; - cursor: not-allowed; - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); -} -.open > .dropdown-menu { - display: block; -} -.open > a { - outline: 0; -} -.dropdown-menu-right { - right: 0; - left: auto; -} -.dropdown-menu-left { - right: auto; - left: 0; -} -.dropdown-header { - display: block; - padding: 3px 20px; - font-size: 12px; - line-height: 1.42857143; - color: #777; - white-space: nowrap; -} -.dropdown-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 990; -} -.pull-right > .dropdown-menu { - right: 0; - left: auto; -} -.dropup .caret, -.navbar-fixed-bottom .dropdown .caret { - content: ""; - border-top: 0; - border-bottom: 4px solid; -} -.dropup .dropdown-menu, -.navbar-fixed-bottom .dropdown .dropdown-menu { - top: auto; - bottom: 100%; - margin-bottom: 1px; -} -@media (min-width: 768px) { - .navbar-right .dropdown-menu { - right: 0; - left: auto; - } - .navbar-right .dropdown-menu-left { - right: auto; - left: 0; - } -} -.btn-group, -.btn-group-vertical { - position: relative; - display: inline-block; - vertical-align: middle; -} -.btn-group > .btn, -.btn-group-vertical > .btn { - position: relative; - float: left; -} -.btn-group > .btn:hover, -.btn-group-vertical > .btn:hover, -.btn-group > .btn:focus, -.btn-group-vertical > .btn:focus, -.btn-group > .btn:active, -.btn-group-vertical > .btn:active, -.btn-group > .btn.active, -.btn-group-vertical > .btn.active { - z-index: 2; -} -.btn-group > .btn:focus, -.btn-group-vertical > .btn:focus { - outline: 0; -} -.btn-group .btn + .btn, -.btn-group .btn + .btn-group, -.btn-group .btn-group + .btn, -.btn-group .btn-group + .btn-group { - margin-left: -1px; -} -.btn-toolbar { - margin-left: -5px; -} -.btn-toolbar .btn-group, -.btn-toolbar .input-group { - float: left; -} -.btn-toolbar > .btn, -.btn-toolbar > .btn-group, -.btn-toolbar > .input-group { - margin-left: 5px; -} -.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { - border-radius: 0; -} -.btn-group > .btn:first-child { - margin-left: 0; -} -.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.btn-group > .btn:last-child:not(:first-child), -.btn-group > .dropdown-toggle:not(:first-child) { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group > .btn-group { - float: left; -} -.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.btn-group > .btn-group:first-child > .btn:last-child, -.btn-group > .btn-group:first-child > .dropdown-toggle { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.btn-group > .btn-group:last-child > .btn:first-child { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group .dropdown-toggle:active, -.btn-group.open .dropdown-toggle { - outline: 0; -} -.btn-group > .btn + .dropdown-toggle { - padding-right: 8px; - padding-left: 8px; -} -.btn-group > .btn-lg + .dropdown-toggle { - padding-right: 12px; - padding-left: 12px; -} -.btn-group.open .dropdown-toggle { - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); -} -.btn-group.open .dropdown-toggle.btn-link { - -webkit-box-shadow: none; - box-shadow: none; -} -.btn .caret { - margin-left: 0; -} -.btn-lg .caret { - border-width: 5px 5px 0; - border-bottom-width: 0; -} -.dropup .btn-lg .caret { - border-width: 0 5px 5px; -} -.btn-group-vertical > .btn, -.btn-group-vertical > .btn-group, -.btn-group-vertical > .btn-group > .btn { - display: block; - float: none; - width: 100%; - max-width: 100%; -} -.btn-group-vertical > .btn-group > .btn { - float: none; -} -.btn-group-vertical > .btn + .btn, -.btn-group-vertical > .btn + .btn-group, -.btn-group-vertical > .btn-group + .btn, -.btn-group-vertical > .btn-group + .btn-group { - margin-top: -1px; - margin-left: 0; -} -.btn-group-vertical > .btn:not(:first-child):not(:last-child) { - border-radius: 0; -} -.btn-group-vertical > .btn:first-child:not(:last-child) { - border-top-right-radius: 4px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group-vertical > .btn:last-child:not(:first-child) { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-left-radius: 4px; -} -.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, -.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.btn-group-justified { - display: table; - width: 100%; - table-layout: fixed; - border-collapse: separate; -} -.btn-group-justified > .btn, -.btn-group-justified > .btn-group { - display: table-cell; - float: none; - width: 1%; -} -.btn-group-justified > .btn-group .btn { - width: 100%; -} -.btn-group-justified > .btn-group .dropdown-menu { - left: auto; -} -[data-toggle="buttons"] > .btn > input[type="radio"], -[data-toggle="buttons"] > .btn > input[type="checkbox"] { - position: absolute; - z-index: -1; - filter: alpha(opacity=0); - opacity: 0; -} -.input-group { - position: relative; - display: table; - border-collapse: separate; -} -.input-group[class*="col-"] { - float: none; - padding-right: 0; - padding-left: 0; -} -.input-group .form-control { - position: relative; - z-index: 2; - float: left; - width: 100%; - margin-bottom: 0; -} -.input-group-lg > .form-control, -.input-group-lg > .input-group-addon, -.input-group-lg > .input-group-btn > .btn { - height: 46px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.33; - border-radius: 6px; -} -select.input-group-lg > .form-control, -select.input-group-lg > .input-group-addon, -select.input-group-lg > .input-group-btn > .btn { - height: 46px; - line-height: 46px; -} -textarea.input-group-lg > .form-control, -textarea.input-group-lg > .input-group-addon, -textarea.input-group-lg > .input-group-btn > .btn, -select[multiple].input-group-lg > .form-control, -select[multiple].input-group-lg > .input-group-addon, -select[multiple].input-group-lg > .input-group-btn > .btn { - height: auto; -} -.input-group-sm > .form-control, -.input-group-sm > .input-group-addon, -.input-group-sm > .input-group-btn > .btn { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -select.input-group-sm > .form-control, -select.input-group-sm > .input-group-addon, -select.input-group-sm > .input-group-btn > .btn { - height: 30px; - line-height: 30px; -} -textarea.input-group-sm > .form-control, -textarea.input-group-sm > .input-group-addon, -textarea.input-group-sm > .input-group-btn > .btn, -select[multiple].input-group-sm > .form-control, -select[multiple].input-group-sm > .input-group-addon, -select[multiple].input-group-sm > .input-group-btn > .btn { - height: auto; -} -.input-group-addon, -.input-group-btn, -.input-group .form-control { - display: table-cell; -} -.input-group-addon:not(:first-child):not(:last-child), -.input-group-btn:not(:first-child):not(:last-child), -.input-group .form-control:not(:first-child):not(:last-child) { - border-radius: 0; -} -.input-group-addon, -.input-group-btn { - width: 1%; - white-space: nowrap; - vertical-align: middle; -} -.input-group-addon { - padding: 6px 12px; - font-size: 14px; - font-weight: normal; - line-height: 1; - color: #555; - text-align: center; - background-color: #eee; - border: 1px solid #ccc; - border-radius: 4px; -} -.input-group-addon.input-sm { - padding: 5px 10px; - font-size: 12px; - border-radius: 3px; -} -.input-group-addon.input-lg { - padding: 10px 16px; - font-size: 18px; - border-radius: 6px; -} -.input-group-addon input[type="radio"], -.input-group-addon input[type="checkbox"] { - margin-top: 0; -} -.input-group .form-control:first-child, -.input-group-addon:first-child, -.input-group-btn:first-child > .btn, -.input-group-btn:first-child > .btn-group > .btn, -.input-group-btn:first-child > .dropdown-toggle, -.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), -.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.input-group-addon:first-child { - border-right: 0; -} -.input-group .form-control:last-child, -.input-group-addon:last-child, -.input-group-btn:last-child > .btn, -.input-group-btn:last-child > .btn-group > .btn, -.input-group-btn:last-child > .dropdown-toggle, -.input-group-btn:first-child > .btn:not(:first-child), -.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} -.input-group-addon:last-child { - border-left: 0; -} -.input-group-btn { - position: relative; - font-size: 0; - white-space: nowrap; -} -.input-group-btn > .btn { - position: relative; -} -.input-group-btn > .btn + .btn { - margin-left: -1px; -} -.input-group-btn > .btn:hover, -.input-group-btn > .btn:focus, -.input-group-btn > .btn:active { - z-index: 2; -} -.input-group-btn:first-child > .btn, -.input-group-btn:first-child > .btn-group { - margin-right: -1px; -} -.input-group-btn:last-child > .btn, -.input-group-btn:last-child > .btn-group { - margin-left: -1px; -} -.nav { - padding-left: 0; - margin-bottom: 0; - list-style: none; -} -.nav > li { - position: relative; - display: block; -} -.nav > li > a { - position: relative; - display: block; - padding: 10px 15px; -} -.nav > li > a:hover, -.nav > li > a:focus { - text-decoration: none; - background-color: #eee; -} -.nav > li.disabled > a { - color: #777; -} -.nav > li.disabled > a:hover, -.nav > li.disabled > a:focus { - color: #777; - text-decoration: none; - cursor: not-allowed; - background-color: transparent; -} -.nav .open > a, -.nav .open > a:hover, -.nav .open > a:focus { - background-color: #eee; - border-color: #428bca; -} -.nav .nav-divider { - height: 1px; - margin: 9px 0; - overflow: hidden; - background-color: #e5e5e5; -} -.nav > li > a > img { - max-width: none; -} -.nav-tabs { - border-bottom: 1px solid #ddd; -} -.nav-tabs > li { - float: left; - margin-bottom: -1px; -} -.nav-tabs > li > a { - margin-right: 2px; - line-height: 1.42857143; - border: 1px solid transparent; - border-radius: 4px 4px 0 0; -} -.nav-tabs > li > a:hover { - border-color: #eee #eee #ddd; -} -.nav-tabs > li.active > a, -.nav-tabs > li.active > a:hover, -.nav-tabs > li.active > a:focus { - color: #555; - cursor: default; - background-color: #fff; - border: 1px solid #ddd; - border-bottom-color: transparent; -} -.nav-tabs.nav-justified { - width: 100%; - border-bottom: 0; -} -.nav-tabs.nav-justified > li { - float: none; -} -.nav-tabs.nav-justified > li > a { - margin-bottom: 5px; - text-align: center; -} -.nav-tabs.nav-justified > .dropdown .dropdown-menu { - top: auto; - left: auto; -} -@media (min-width: 768px) { - .nav-tabs.nav-justified > li { - display: table-cell; - width: 1%; - } - .nav-tabs.nav-justified > li > a { - margin-bottom: 0; - } -} -.nav-tabs.nav-justified > li > a { - margin-right: 0; - border-radius: 4px; -} -.nav-tabs.nav-justified > .active > a, -.nav-tabs.nav-justified > .active > a:hover, -.nav-tabs.nav-justified > .active > a:focus { - border: 1px solid #ddd; -} -@media (min-width: 768px) { - .nav-tabs.nav-justified > li > a { - border-bottom: 1px solid #ddd; - border-radius: 4px 4px 0 0; - } - .nav-tabs.nav-justified > .active > a, - .nav-tabs.nav-justified > .active > a:hover, - .nav-tabs.nav-justified > .active > a:focus { - border-bottom-color: #fff; - } -} -.nav-pills > li { - float: left; -} -.nav-pills > li > a { - border-radius: 4px; -} -.nav-pills > li + li { - margin-left: 2px; -} -.nav-pills > li.active > a, -.nav-pills > li.active > a:hover, -.nav-pills > li.active > a:focus { - color: #fff; - background-color: #428bca; -} -.nav-stacked > li { - float: none; -} -.nav-stacked > li + li { - margin-top: 2px; - margin-left: 0; -} -.nav-justified { - width: 100%; -} -.nav-justified > li { - float: none; -} -.nav-justified > li > a { - margin-bottom: 5px; - text-align: center; -} -.nav-justified > .dropdown .dropdown-menu { - top: auto; - left: auto; -} -@media (min-width: 768px) { - .nav-justified > li { - display: table-cell; - width: 1%; - } - .nav-justified > li > a { - margin-bottom: 0; - } -} -.nav-tabs-justified { - border-bottom: 0; -} -.nav-tabs-justified > li > a { - margin-right: 0; - border-radius: 4px; -} -.nav-tabs-justified > .active > a, -.nav-tabs-justified > .active > a:hover, -.nav-tabs-justified > .active > a:focus { - border: 1px solid #ddd; -} -@media (min-width: 768px) { - .nav-tabs-justified > li > a { - border-bottom: 1px solid #ddd; - border-radius: 4px 4px 0 0; - } - .nav-tabs-justified > .active > a, - .nav-tabs-justified > .active > a:hover, - .nav-tabs-justified > .active > a:focus { - border-bottom-color: #fff; - } -} -.tab-content > .tab-pane { - display: none; -} -.tab-content > .active { - display: block; -} -.nav-tabs .dropdown-menu { - margin-top: -1px; - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.navbar { - position: relative; - min-height: 50px; - margin-bottom: 20px; - border: 1px solid transparent; -} -@media (min-width: 768px) { - .navbar { - border-radius: 4px; - } -} -@media (min-width: 768px) { - .navbar-header { - float: left; - } -} -.navbar-collapse { - padding-right: 15px; - padding-left: 15px; - overflow-x: visible; - -webkit-overflow-scrolling: touch; - border-top: 1px solid transparent; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); -} -.navbar-collapse.in { - overflow-y: auto; -} -@media (min-width: 768px) { - .navbar-collapse { - width: auto; - border-top: 0; - -webkit-box-shadow: none; - box-shadow: none; - } - .navbar-collapse.collapse { - display: block !important; - height: auto !important; - padding-bottom: 0; - overflow: visible !important; - } - .navbar-collapse.in { - overflow-y: visible; - } - .navbar-fixed-top .navbar-collapse, - .navbar-static-top .navbar-collapse, - .navbar-fixed-bottom .navbar-collapse { - padding-right: 0; - padding-left: 0; - } -} -.navbar-fixed-top .navbar-collapse, -.navbar-fixed-bottom .navbar-collapse { - max-height: 340px; -} -@media (max-width: 480px) and (orientation: landscape) { - .navbar-fixed-top .navbar-collapse, - .navbar-fixed-bottom .navbar-collapse { - max-height: 200px; - } -} -.container > .navbar-header, -.container-fluid > .navbar-header, -.container > .navbar-collapse, -.container-fluid > .navbar-collapse { - margin-right: -15px; - margin-left: -15px; -} -@media (min-width: 768px) { - .container > .navbar-header, - .container-fluid > .navbar-header, - .container > .navbar-collapse, - .container-fluid > .navbar-collapse { - margin-right: 0; - margin-left: 0; - } -} -.navbar-static-top { - z-index: 1000; - border-width: 0 0 1px; -} -@media (min-width: 768px) { - .navbar-static-top { - border-radius: 0; - } -} -.navbar-fixed-top, -.navbar-fixed-bottom { - position: fixed; - right: 0; - left: 0; - z-index: 1030; - -webkit-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} -@media (min-width: 768px) { - .navbar-fixed-top, - .navbar-fixed-bottom { - border-radius: 0; - } -} -.navbar-fixed-top { - top: 0; - border-width: 0 0 1px; -} -.navbar-fixed-bottom { - bottom: 0; - margin-bottom: 0; - border-width: 1px 0 0; -} -.navbar-brand { - float: left; - height: 50px; - padding: 15px 15px; - font-size: 18px; - line-height: 20px; -} -.navbar-brand:hover, -.navbar-brand:focus { - text-decoration: none; -} -@media (min-width: 768px) { - .navbar > .container .navbar-brand, - .navbar > .container-fluid .navbar-brand { - margin-left: -15px; - } -} -.navbar-toggle { - position: relative; - float: right; - padding: 9px 10px; - margin-top: 8px; - margin-right: 15px; - margin-bottom: 8px; - background-color: transparent; - background-image: none; - border: 1px solid transparent; - border-radius: 4px; -} -.navbar-toggle:focus { - outline: 0; -} -.navbar-toggle .icon-bar { - display: block; - width: 22px; - height: 2px; - border-radius: 1px; -} -.navbar-toggle .icon-bar + .icon-bar { - margin-top: 4px; -} -@media (min-width: 768px) { - .navbar-toggle { - display: none; - } -} -.navbar-nav { - margin: 7.5px -15px; -} -.navbar-nav > li > a { - padding-top: 10px; - padding-bottom: 10px; - line-height: 20px; -} -@media (max-width: 767px) { - .navbar-nav .open .dropdown-menu { - position: static; - float: none; - width: auto; - margin-top: 0; - background-color: transparent; - border: 0; - -webkit-box-shadow: none; - box-shadow: none; - } - .navbar-nav .open .dropdown-menu > li > a, - .navbar-nav .open .dropdown-menu .dropdown-header { - padding: 5px 15px 5px 25px; - } - .navbar-nav .open .dropdown-menu > li > a { - line-height: 20px; - } - .navbar-nav .open .dropdown-menu > li > a:hover, - .navbar-nav .open .dropdown-menu > li > a:focus { - background-image: none; - } -} -@media (min-width: 768px) { - .navbar-nav { - float: left; - margin: 0; - } - .navbar-nav > li { - float: left; - } - .navbar-nav > li > a { - padding-top: 15px; - padding-bottom: 15px; - } - .navbar-nav.navbar-right:last-child { - margin-right: -15px; - } -} -@media (min-width: 768px) { - .navbar-left { - float: left !important; - } - .navbar-right { - float: right !important; - } -} -.navbar-form { - padding: 10px 15px; - margin-top: 8px; - margin-right: -15px; - margin-bottom: 8px; - margin-left: -15px; - border-top: 1px solid transparent; - border-bottom: 1px solid transparent; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); -} -@media (min-width: 768px) { - .navbar-form .form-group { - display: inline-block; - margin-bottom: 0; - vertical-align: middle; - } - .navbar-form .form-control { - display: inline-block; - width: auto; - vertical-align: middle; - } - .navbar-form .input-group { - display: inline-table; - vertical-align: middle; - } - .navbar-form .input-group .input-group-addon, - .navbar-form .input-group .input-group-btn, - .navbar-form .input-group .form-control { - width: auto; - } - .navbar-form .input-group > .form-control { - width: 100%; - } - .navbar-form .control-label { - margin-bottom: 0; - vertical-align: middle; - } - .navbar-form .radio, - .navbar-form .checkbox { - display: inline-block; - margin-top: 0; - margin-bottom: 0; - vertical-align: middle; - } - .navbar-form .radio label, - .navbar-form .checkbox label { - padding-left: 0; - } - .navbar-form .radio input[type="radio"], - .navbar-form .checkbox input[type="checkbox"] { - position: relative; - margin-left: 0; - } - .navbar-form .has-feedback .form-control-feedback { - top: 0; - } -} -@media (max-width: 767px) { - .navbar-form .form-group { - margin-bottom: 5px; - } -} -@media (min-width: 768px) { - .navbar-form { - width: auto; - padding-top: 0; - padding-bottom: 0; - margin-right: 0; - margin-left: 0; - border: 0; - -webkit-box-shadow: none; - box-shadow: none; - } - .navbar-form.navbar-right:last-child { - margin-right: -15px; - } -} -.navbar-nav > li > .dropdown-menu { - margin-top: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.navbar-btn { - margin-top: 8px; - margin-bottom: 8px; -} -.navbar-btn.btn-sm { - margin-top: 10px; - margin-bottom: 10px; -} -.navbar-btn.btn-xs { - margin-top: 14px; - margin-bottom: 14px; -} -.navbar-text { - margin-top: 15px; - margin-bottom: 15px; -} -@media (min-width: 768px) { - .navbar-text { - float: left; - margin-right: 15px; - margin-left: 15px; - } - .navbar-text.navbar-right:last-child { - margin-right: 0; - } -} -.navbar-default { - background-color: #f8f8f8; - border-color: #e7e7e7; -} -.navbar-default .navbar-brand { - color: #777; -} -.navbar-default .navbar-brand:hover, -.navbar-default .navbar-brand:focus { - color: #5e5e5e; - background-color: transparent; -} -.navbar-default .navbar-text { - color: #777; -} -.navbar-default .navbar-nav > li > a { - color: #777; -} -.navbar-default .navbar-nav > li > a:hover, -.navbar-default .navbar-nav > li > a:focus { - color: #333; - background-color: transparent; -} -.navbar-default .navbar-nav > .active > a, -.navbar-default .navbar-nav > .active > a:hover, -.navbar-default .navbar-nav > .active > a:focus { - color: #555; - background-color: #e7e7e7; -} -.navbar-default .navbar-nav > .disabled > a, -.navbar-default .navbar-nav > .disabled > a:hover, -.navbar-default .navbar-nav > .disabled > a:focus { - color: #ccc; - background-color: transparent; -} -.navbar-default .navbar-toggle { - border-color: #ddd; -} -.navbar-default .navbar-toggle:hover, -.navbar-default .navbar-toggle:focus { - background-color: #ddd; -} -.navbar-default .navbar-toggle .icon-bar { - background-color: #888; -} -.navbar-default .navbar-collapse, -.navbar-default .navbar-form { - border-color: #e7e7e7; -} -.navbar-default .navbar-nav > .open > a, -.navbar-default .navbar-nav > .open > a:hover, -.navbar-default .navbar-nav > .open > a:focus { - color: #555; - background-color: #e7e7e7; -} -@media (max-width: 767px) { - .navbar-default .navbar-nav .open .dropdown-menu > li > a { - color: #777; - } - .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, - .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { - color: #333; - background-color: transparent; - } - .navbar-default .navbar-nav .open .dropdown-menu > .active > a, - .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, - .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { - color: #555; - background-color: #e7e7e7; - } - .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, - .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, - .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { - color: #ccc; - background-color: transparent; - } -} -.navbar-default .navbar-link { - color: #777; -} -.navbar-default .navbar-link:hover { - color: #333; -} -.navbar-default .btn-link { - color: #777; -} -.navbar-default .btn-link:hover, -.navbar-default .btn-link:focus { - color: #333; -} -.navbar-default .btn-link[disabled]:hover, -fieldset[disabled] .navbar-default .btn-link:hover, -.navbar-default .btn-link[disabled]:focus, -fieldset[disabled] .navbar-default .btn-link:focus { - color: #ccc; -} -.navbar-inverse { - background-color: #222; - border-color: #080808; -} -.navbar-inverse .navbar-brand { - color: #777; -} -.navbar-inverse .navbar-brand:hover, -.navbar-inverse .navbar-brand:focus { - color: #fff; - background-color: transparent; -} -.navbar-inverse .navbar-text { - color: #777; -} -.navbar-inverse .navbar-nav > li > a { - color: #777; -} -.navbar-inverse .navbar-nav > li > a:hover, -.navbar-inverse .navbar-nav > li > a:focus { - color: #fff; - background-color: transparent; -} -.navbar-inverse .navbar-nav > .active > a, -.navbar-inverse .navbar-nav > .active > a:hover, -.navbar-inverse .navbar-nav > .active > a:focus { - color: #fff; - background-color: #080808; -} -.navbar-inverse .navbar-nav > .disabled > a, -.navbar-inverse .navbar-nav > .disabled > a:hover, -.navbar-inverse .navbar-nav > .disabled > a:focus { - color: #444; - background-color: transparent; -} -.navbar-inverse .navbar-toggle { - border-color: #333; -} -.navbar-inverse .navbar-toggle:hover, -.navbar-inverse .navbar-toggle:focus { - background-color: #333; -} -.navbar-inverse .navbar-toggle .icon-bar { - background-color: #fff; -} -.navbar-inverse .navbar-collapse, -.navbar-inverse .navbar-form { - border-color: #101010; -} -.navbar-inverse .navbar-nav > .open > a, -.navbar-inverse .navbar-nav > .open > a:hover, -.navbar-inverse .navbar-nav > .open > a:focus { - color: #fff; - background-color: #080808; -} -@media (max-width: 767px) { - .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { - border-color: #080808; - } - .navbar-inverse .navbar-nav .open .dropdown-menu .divider { - background-color: #080808; - } - .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { - color: #777; - } - .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, - .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { - color: #fff; - background-color: transparent; - } - .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, - .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, - .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { - color: #fff; - background-color: #080808; - } - .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, - .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, - .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { - color: #444; - background-color: transparent; - } -} -.navbar-inverse .navbar-link { - color: #777; -} -.navbar-inverse .navbar-link:hover { - color: #fff; -} -.navbar-inverse .btn-link { - color: #777; -} -.navbar-inverse .btn-link:hover, -.navbar-inverse .btn-link:focus { - color: #fff; -} -.navbar-inverse .btn-link[disabled]:hover, -fieldset[disabled] .navbar-inverse .btn-link:hover, -.navbar-inverse .btn-link[disabled]:focus, -fieldset[disabled] .navbar-inverse .btn-link:focus { - color: #444; -} -.breadcrumb { - padding: 8px 15px; - margin-bottom: 20px; - list-style: none; - background-color: #f5f5f5; - border-radius: 4px; -} -.breadcrumb > li { - display: inline-block; -} -.breadcrumb > li + li:before { - padding: 0 5px; - color: #ccc; - content: "/\00a0"; -} -.breadcrumb > .active { - color: #777; -} -.pagination { - display: inline-block; - padding-left: 0; - margin: 20px 0; - border-radius: 4px; -} -.pagination > li { - display: inline; -} -.pagination > li > a, -.pagination > li > span { - position: relative; - float: left; - padding: 6px 12px; - margin-left: -1px; - line-height: 1.42857143; - color: #428bca; - text-decoration: none; - background-color: #fff; - border: 1px solid #ddd; -} -.pagination > li:first-child > a, -.pagination > li:first-child > span { - margin-left: 0; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} -.pagination > li:last-child > a, -.pagination > li:last-child > span { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} -.pagination > li > a:hover, -.pagination > li > span:hover, -.pagination > li > a:focus, -.pagination > li > span:focus { - color: #2a6496; - background-color: #eee; - border-color: #ddd; -} -.pagination > .active > a, -.pagination > .active > span, -.pagination > .active > a:hover, -.pagination > .active > span:hover, -.pagination > .active > a:focus, -.pagination > .active > span:focus { - z-index: 2; - color: #fff; - cursor: default; - background-color: #428bca; - border-color: #428bca; -} -.pagination > .disabled > span, -.pagination > .disabled > span:hover, -.pagination > .disabled > span:focus, -.pagination > .disabled > a, -.pagination > .disabled > a:hover, -.pagination > .disabled > a:focus { - color: #777; - cursor: not-allowed; - background-color: #fff; - border-color: #ddd; -} -.pagination-lg > li > a, -.pagination-lg > li > span { - padding: 10px 16px; - font-size: 18px; -} -.pagination-lg > li:first-child > a, -.pagination-lg > li:first-child > span { - border-top-left-radius: 6px; - border-bottom-left-radius: 6px; -} -.pagination-lg > li:last-child > a, -.pagination-lg > li:last-child > span { - border-top-right-radius: 6px; - border-bottom-right-radius: 6px; -} -.pagination-sm > li > a, -.pagination-sm > li > span { - padding: 5px 10px; - font-size: 12px; -} -.pagination-sm > li:first-child > a, -.pagination-sm > li:first-child > span { - border-top-left-radius: 3px; - border-bottom-left-radius: 3px; -} -.pagination-sm > li:last-child > a, -.pagination-sm > li:last-child > span { - border-top-right-radius: 3px; - border-bottom-right-radius: 3px; -} -.pager { - padding-left: 0; - margin: 20px 0; - text-align: center; - list-style: none; -} -.pager li { - display: inline; -} -.pager li > a, -.pager li > span { - display: inline-block; - padding: 5px 14px; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 15px; -} -.pager li > a:hover, -.pager li > a:focus { - text-decoration: none; - background-color: #eee; -} -.pager .next > a, -.pager .next > span { - float: right; -} -.pager .previous > a, -.pager .previous > span { - float: left; -} -.pager .disabled > a, -.pager .disabled > a:hover, -.pager .disabled > a:focus, -.pager .disabled > span { - color: #777; - cursor: not-allowed; - background-color: #fff; -} -.label { - display: inline; - padding: .2em .6em .3em; - font-size: 75%; - font-weight: bold; - line-height: 1; - color: #fff; - text-align: center; - white-space: nowrap; - vertical-align: baseline; - border-radius: .25em; -} -a.label:hover, -a.label:focus { - color: #fff; - text-decoration: none; - cursor: pointer; -} -.label:empty { - display: none; -} -.btn .label { - position: relative; - top: -1px; -} -.label-default { - background-color: #777; -} -.label-default[href]:hover, -.label-default[href]:focus { - background-color: #5e5e5e; -} -.label-primary { - background-color: #428bca; -} -.label-primary[href]:hover, -.label-primary[href]:focus { - background-color: #3071a9; -} -.label-success { - background-color: #5cb85c; -} -.label-success[href]:hover, -.label-success[href]:focus { - background-color: #449d44; -} -.label-info { - background-color: #5bc0de; -} -.label-info[href]:hover, -.label-info[href]:focus { - background-color: #31b0d5; -} -.label-warning { - background-color: #f0ad4e; -} -.label-warning[href]:hover, -.label-warning[href]:focus { - background-color: #ec971f; -} -.label-danger { - background-color: #d9534f; -} -.label-danger[href]:hover, -.label-danger[href]:focus { - background-color: #c9302c; -} -.badge { - display: inline-block; - min-width: 10px; - padding: 3px 7px; - font-size: 12px; - font-weight: bold; - line-height: 1; - color: #fff; - text-align: center; - white-space: nowrap; - vertical-align: baseline; - background-color: #777; - border-radius: 10px; -} -.badge:empty { - display: none; -} -.btn .badge { - position: relative; - top: -1px; -} -.btn-xs .badge { - top: 0; - padding: 1px 5px; -} -a.badge:hover, -a.badge:focus { - color: #fff; - text-decoration: none; - cursor: pointer; -} -a.list-group-item.active > .badge, -.nav-pills > .active > a > .badge { - color: #428bca; - background-color: #fff; -} -.nav-pills > li > a > .badge { - margin-left: 3px; -} -.jumbotron { - padding: 30px; - margin-bottom: 30px; - color: inherit; - background-color: #eee; -} -.jumbotron h1, -.jumbotron .h1 { - color: inherit; -} -.jumbotron p { - margin-bottom: 15px; - font-size: 21px; - font-weight: 200; -} -.jumbotron > hr { - border-top-color: #d5d5d5; -} -.container .jumbotron { - border-radius: 6px; -} -.jumbotron .container { - max-width: 100%; -} -@media screen and (min-width: 768px) { - .jumbotron { - padding-top: 48px; - padding-bottom: 48px; - } - .container .jumbotron { - padding-right: 60px; - padding-left: 60px; - } - .jumbotron h1, - .jumbotron .h1 { - font-size: 63px; - } -} -.thumbnail { - display: block; - padding: 4px; - margin-bottom: 20px; - line-height: 1.42857143; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 4px; - -webkit-transition: all .2s ease-in-out; - -o-transition: all .2s ease-in-out; - transition: all .2s ease-in-out; -} -.thumbnail > img, -.thumbnail a > img { - margin-right: auto; - margin-left: auto; -} -a.thumbnail:hover, -a.thumbnail:focus, -a.thumbnail.active { - border-color: #428bca; -} -.thumbnail .caption { - padding: 9px; - color: #333; -} -.alert { - padding: 15px; - margin-bottom: 20px; - border: 1px solid transparent; - border-radius: 4px; -} -.alert h4 { - margin-top: 0; - color: inherit; -} -.alert .alert-link { - font-weight: bold; -} -.alert > p, -.alert > ul { - margin-bottom: 0; -} -.alert > p + p { - margin-top: 5px; -} -.alert-dismissable, -.alert-dismissible { - padding-right: 35px; -} -.alert-dismissable .close, -.alert-dismissible .close { - position: relative; - top: -2px; - right: -21px; - color: inherit; -} -.alert-success { - color: #3c763d; - background-color: #dff0d8; - border-color: #d6e9c6; -} -.alert-success hr { - border-top-color: #c9e2b3; -} -.alert-success .alert-link { - color: #2b542c; -} -.alert-info { - color: #31708f; - background-color: #d9edf7; - border-color: #bce8f1; -} -.alert-info hr { - border-top-color: #a6e1ec; -} -.alert-info .alert-link { - color: #245269; -} -.alert-warning { - color: #8a6d3b; - background-color: #fcf8e3; - border-color: #faebcc; -} -.alert-warning hr { - border-top-color: #f7e1b5; -} -.alert-warning .alert-link { - color: #66512c; -} -.alert-danger { - color: #a94442; - background-color: #f2dede; - border-color: #ebccd1; -} -.alert-danger hr { - border-top-color: #e4b9c0; -} -.alert-danger .alert-link { - color: #843534; -} -@-webkit-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} -@-o-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} -@keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} -.progress { - height: 20px; - margin-bottom: 20px; - overflow: hidden; - background-color: #f5f5f5; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); -} -.progress-bar { - float: left; - width: 0; - height: 100%; - font-size: 12px; - line-height: 20px; - color: #fff; - text-align: center; - background-color: #428bca; - -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); - box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); - -webkit-transition: width .6s ease; - -o-transition: width .6s ease; - transition: width .6s ease; -} -.progress-striped .progress-bar, -.progress-bar-striped { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - -webkit-background-size: 40px 40px; - background-size: 40px 40px; -} -.progress.active .progress-bar, -.progress-bar.active { - -webkit-animation: progress-bar-stripes 2s linear infinite; - -o-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; -} -.progress-bar[aria-valuenow="1"], -.progress-bar[aria-valuenow="2"] { - min-width: 30px; -} -.progress-bar[aria-valuenow="0"] { - min-width: 30px; - color: #777; - background-color: transparent; - background-image: none; - -webkit-box-shadow: none; - box-shadow: none; -} -.progress-bar-success { - background-color: #5cb85c; -} -.progress-striped .progress-bar-success { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -} -.progress-bar-info { - background-color: #5bc0de; -} -.progress-striped .progress-bar-info { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -} -.progress-bar-warning { - background-color: #f0ad4e; -} -.progress-striped .progress-bar-warning { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -} -.progress-bar-danger { - background-color: #d9534f; -} -.progress-striped .progress-bar-danger { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -} -.media, -.media-body { - overflow: hidden; - zoom: 1; -} -.media, -.media .media { - margin-top: 15px; -} -.media:first-child { - margin-top: 0; -} -.media-object { - display: block; -} -.media-heading { - margin: 0 0 5px; -} -.media > .pull-left { - margin-right: 10px; -} -.media > .pull-right { - margin-left: 10px; -} -.media-list { - padding-left: 0; - list-style: none; -} -.list-group { - padding-left: 0; - margin-bottom: 20px; -} -.list-group-item { - position: relative; - display: block; - padding: 10px 15px; - margin-bottom: -1px; - background-color: #fff; - border: 1px solid #ddd; -} -.list-group-item:first-child { - border-top-left-radius: 4px; - border-top-right-radius: 4px; -} -.list-group-item:last-child { - margin-bottom: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.list-group-item > .badge { - float: right; -} -.list-group-item > .badge + .badge { - margin-right: 5px; -} -a.list-group-item { - color: #555; -} -a.list-group-item .list-group-item-heading { - color: #333; -} -a.list-group-item:hover, -a.list-group-item:focus { - color: #555; - text-decoration: none; - background-color: #f5f5f5; -} -.list-group-item.disabled, -.list-group-item.disabled:hover, -.list-group-item.disabled:focus { - color: #777; - background-color: #eee; -} -.list-group-item.disabled .list-group-item-heading, -.list-group-item.disabled:hover .list-group-item-heading, -.list-group-item.disabled:focus .list-group-item-heading { - color: inherit; -} -.list-group-item.disabled .list-group-item-text, -.list-group-item.disabled:hover .list-group-item-text, -.list-group-item.disabled:focus .list-group-item-text { - color: #777; -} -.list-group-item.active, -.list-group-item.active:hover, -.list-group-item.active:focus { - z-index: 2; - color: #fff; - background-color: #428bca; - border-color: #428bca; -} -.list-group-item.active .list-group-item-heading, -.list-group-item.active:hover .list-group-item-heading, -.list-group-item.active:focus .list-group-item-heading, -.list-group-item.active .list-group-item-heading > small, -.list-group-item.active:hover .list-group-item-heading > small, -.list-group-item.active:focus .list-group-item-heading > small, -.list-group-item.active .list-group-item-heading > .small, -.list-group-item.active:hover .list-group-item-heading > .small, -.list-group-item.active:focus .list-group-item-heading > .small { - color: inherit; -} -.list-group-item.active .list-group-item-text, -.list-group-item.active:hover .list-group-item-text, -.list-group-item.active:focus .list-group-item-text { - color: #e1edf7; -} -.list-group-item-success { - color: #3c763d; - background-color: #dff0d8; -} -a.list-group-item-success { - color: #3c763d; -} -a.list-group-item-success .list-group-item-heading { - color: inherit; -} -a.list-group-item-success:hover, -a.list-group-item-success:focus { - color: #3c763d; - background-color: #d0e9c6; -} -a.list-group-item-success.active, -a.list-group-item-success.active:hover, -a.list-group-item-success.active:focus { - color: #fff; - background-color: #3c763d; - border-color: #3c763d; -} -.list-group-item-info { - color: #31708f; - background-color: #d9edf7; -} -a.list-group-item-info { - color: #31708f; -} -a.list-group-item-info .list-group-item-heading { - color: inherit; -} -a.list-group-item-info:hover, -a.list-group-item-info:focus { - color: #31708f; - background-color: #c4e3f3; -} -a.list-group-item-info.active, -a.list-group-item-info.active:hover, -a.list-group-item-info.active:focus { - color: #fff; - background-color: #31708f; - border-color: #31708f; -} -.list-group-item-warning { - color: #8a6d3b; - background-color: #fcf8e3; -} -a.list-group-item-warning { - color: #8a6d3b; -} -a.list-group-item-warning .list-group-item-heading { - color: inherit; -} -a.list-group-item-warning:hover, -a.list-group-item-warning:focus { - color: #8a6d3b; - background-color: #faf2cc; -} -a.list-group-item-warning.active, -a.list-group-item-warning.active:hover, -a.list-group-item-warning.active:focus { - color: #fff; - background-color: #8a6d3b; - border-color: #8a6d3b; -} -.list-group-item-danger { - color: #a94442; - background-color: #f2dede; -} -a.list-group-item-danger { - color: #a94442; -} -a.list-group-item-danger .list-group-item-heading { - color: inherit; -} -a.list-group-item-danger:hover, -a.list-group-item-danger:focus { - color: #a94442; - background-color: #ebcccc; -} -a.list-group-item-danger.active, -a.list-group-item-danger.active:hover, -a.list-group-item-danger.active:focus { - color: #fff; - background-color: #a94442; - border-color: #a94442; -} -.list-group-item-heading { - margin-top: 0; - margin-bottom: 5px; -} -.list-group-item-text { - margin-bottom: 0; - line-height: 1.3; -} -.panel { - margin-bottom: 20px; - background-color: #fff; - border: 1px solid transparent; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); - box-shadow: 0 1px 1px rgba(0, 0, 0, .05); -} -.panel-body { - padding: 15px; -} -.panel-heading { - padding: 10px 15px; - border-bottom: 1px solid transparent; - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} -.panel-heading > .dropdown .dropdown-toggle { - color: inherit; -} -.panel-title { - margin-top: 0; - margin-bottom: 0; - font-size: 16px; - color: inherit; -} -.panel-title > a { - color: inherit; -} -.panel-footer { - padding: 10px 15px; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; -} -.panel > .list-group { - margin-bottom: 0; -} -.panel > .list-group .list-group-item { - border-width: 1px 0; - border-radius: 0; -} -.panel > .list-group:first-child .list-group-item:first-child { - border-top: 0; - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} -.panel > .list-group:last-child .list-group-item:last-child { - border-bottom: 0; - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; -} -.panel-heading + .list-group .list-group-item:first-child { - border-top-width: 0; -} -.list-group + .panel-footer { - border-top-width: 0; -} -.panel > .table, -.panel > .table-responsive > .table, -.panel > .panel-collapse > .table { - margin-bottom: 0; -} -.panel > .table:first-child, -.panel > .table-responsive:first-child > .table:first-child { - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} -.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, -.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, -.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, -.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, -.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, -.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, -.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, -.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { - border-top-left-radius: 3px; -} -.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, -.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, -.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, -.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, -.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, -.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, -.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, -.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { - border-top-right-radius: 3px; -} -.panel > .table:last-child, -.panel > .table-responsive:last-child > .table:last-child { - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; -} -.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, -.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, -.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, -.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, -.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, -.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, -.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, -.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { - border-bottom-left-radius: 3px; -} -.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, -.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, -.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, -.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, -.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, -.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, -.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, -.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { - border-bottom-right-radius: 3px; -} -.panel > .panel-body + .table, -.panel > .panel-body + .table-responsive { - border-top: 1px solid #ddd; -} -.panel > .table > tbody:first-child > tr:first-child th, -.panel > .table > tbody:first-child > tr:first-child td { - border-top: 0; -} -.panel > .table-bordered, -.panel > .table-responsive > .table-bordered { - border: 0; -} -.panel > .table-bordered > thead > tr > th:first-child, -.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, -.panel > .table-bordered > tbody > tr > th:first-child, -.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, -.panel > .table-bordered > tfoot > tr > th:first-child, -.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, -.panel > .table-bordered > thead > tr > td:first-child, -.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, -.panel > .table-bordered > tbody > tr > td:first-child, -.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, -.panel > .table-bordered > tfoot > tr > td:first-child, -.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { - border-left: 0; -} -.panel > .table-bordered > thead > tr > th:last-child, -.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, -.panel > .table-bordered > tbody > tr > th:last-child, -.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, -.panel > .table-bordered > tfoot > tr > th:last-child, -.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, -.panel > .table-bordered > thead > tr > td:last-child, -.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, -.panel > .table-bordered > tbody > tr > td:last-child, -.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, -.panel > .table-bordered > tfoot > tr > td:last-child, -.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { - border-right: 0; -} -.panel > .table-bordered > thead > tr:first-child > td, -.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, -.panel > .table-bordered > tbody > tr:first-child > td, -.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, -.panel > .table-bordered > thead > tr:first-child > th, -.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, -.panel > .table-bordered > tbody > tr:first-child > th, -.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { - border-bottom: 0; -} -.panel > .table-bordered > tbody > tr:last-child > td, -.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, -.panel > .table-bordered > tfoot > tr:last-child > td, -.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, -.panel > .table-bordered > tbody > tr:last-child > th, -.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, -.panel > .table-bordered > tfoot > tr:last-child > th, -.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { - border-bottom: 0; -} -.panel > .table-responsive { - margin-bottom: 0; - border: 0; -} -.panel-group { - margin-bottom: 20px; -} -.panel-group .panel { - margin-bottom: 0; - border-radius: 4px; -} -.panel-group .panel + .panel { - margin-top: 5px; -} -.panel-group .panel-heading { - border-bottom: 0; -} -.panel-group .panel-heading + .panel-collapse > .panel-body { - border-top: 1px solid #ddd; -} -.panel-group .panel-footer { - border-top: 0; -} -.panel-group .panel-footer + .panel-collapse .panel-body { - border-bottom: 1px solid #ddd; -} -.panel-default { - border-color: #ddd; -} -.panel-default > .panel-heading { - color: #333; - background-color: #f5f5f5; - border-color: #ddd; -} -.panel-default > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #ddd; -} -.panel-default > .panel-heading .badge { - color: #f5f5f5; - background-color: #333; -} -.panel-default > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #ddd; -} -.panel-primary { - border-color: #428bca; -} -.panel-primary > .panel-heading { - color: #fff; - background-color: #428bca; - border-color: #428bca; -} -.panel-primary > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #428bca; -} -.panel-primary > .panel-heading .badge { - color: #428bca; - background-color: #fff; -} -.panel-primary > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #428bca; -} -.panel-success { - border-color: #d6e9c6; -} -.panel-success > .panel-heading { - color: #3c763d; - background-color: #dff0d8; - border-color: #d6e9c6; -} -.panel-success > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #d6e9c6; -} -.panel-success > .panel-heading .badge { - color: #dff0d8; - background-color: #3c763d; -} -.panel-success > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #d6e9c6; -} -.panel-info { - border-color: #bce8f1; -} -.panel-info > .panel-heading { - color: #31708f; - background-color: #d9edf7; - border-color: #bce8f1; -} -.panel-info > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #bce8f1; -} -.panel-info > .panel-heading .badge { - color: #d9edf7; - background-color: #31708f; -} -.panel-info > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #bce8f1; -} -.panel-warning { - border-color: #faebcc; -} -.panel-warning > .panel-heading { - color: #8a6d3b; - background-color: #fcf8e3; - border-color: #faebcc; -} -.panel-warning > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #faebcc; -} -.panel-warning > .panel-heading .badge { - color: #fcf8e3; - background-color: #8a6d3b; -} -.panel-warning > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #faebcc; -} -.panel-danger { - border-color: #ebccd1; -} -.panel-danger > .panel-heading { - color: #a94442; - background-color: #f2dede; - border-color: #ebccd1; -} -.panel-danger > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #ebccd1; -} -.panel-danger > .panel-heading .badge { - color: #f2dede; - background-color: #a94442; -} -.panel-danger > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #ebccd1; -} -.embed-responsive { - position: relative; - display: block; - height: 0; - padding: 0; - overflow: hidden; -} -.embed-responsive .embed-responsive-item, -.embed-responsive iframe, -.embed-responsive embed, -.embed-responsive object { - position: absolute; - top: 0; - bottom: 0; - left: 0; - width: 100%; - height: 100%; - border: 0; -} -.embed-responsive.embed-responsive-16by9 { - padding-bottom: 56.25%; -} -.embed-responsive.embed-responsive-4by3 { - padding-bottom: 75%; -} -.well { - min-height: 20px; - padding: 19px; - margin-bottom: 20px; - background-color: #f5f5f5; - border: 1px solid #e3e3e3; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); -} -.well blockquote { - border-color: #ddd; - border-color: rgba(0, 0, 0, .15); -} -.well-lg { - padding: 24px; - border-radius: 6px; -} -.well-sm { - padding: 9px; - border-radius: 3px; -} -.close { - float: right; - font-size: 21px; - font-weight: bold; - line-height: 1; - color: #000; - text-shadow: 0 1px 0 #fff; - filter: alpha(opacity=20); - opacity: .2; -} -.close:hover, -.close:focus { - color: #000; - text-decoration: none; - cursor: pointer; - filter: alpha(opacity=50); - opacity: .5; -} -button.close { - -webkit-appearance: none; - padding: 0; - cursor: pointer; - background: transparent; - border: 0; -} -.modal-open { - overflow: hidden; -} -.modal { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1050; - display: none; - overflow: hidden; - -webkit-overflow-scrolling: touch; - outline: 0; -} -.modal.fade .modal-dialog { - -webkit-transition: -webkit-transform .3s ease-out; - -o-transition: -o-transform .3s ease-out; - transition: transform .3s ease-out; - -webkit-transform: translate3d(0, -25%, 0); - -o-transform: translate3d(0, -25%, 0); - transform: translate3d(0, -25%, 0); -} -.modal.in .modal-dialog { - -webkit-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} -.modal-open .modal { - overflow-x: hidden; - overflow-y: auto; -} -.modal-dialog { - position: relative; - width: auto; - margin: 10px; -} -.modal-content { - position: relative; - background-color: #fff; - -webkit-background-clip: padding-box; - background-clip: padding-box; - border: 1px solid #999; - border: 1px solid rgba(0, 0, 0, .2); - border-radius: 6px; - outline: 0; - -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); - box-shadow: 0 3px 9px rgba(0, 0, 0, .5); -} -.modal-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1040; - background-color: #000; -} -.modal-backdrop.fade { - filter: alpha(opacity=0); - opacity: 0; -} -.modal-backdrop.in { - filter: alpha(opacity=50); - opacity: .5; -} -.modal-header { - min-height: 16.42857143px; - padding: 15px; - border-bottom: 1px solid #e5e5e5; -} -.modal-header .close { - margin-top: -2px; -} -.modal-title { - margin: 0; - line-height: 1.42857143; -} -.modal-body { - position: relative; - padding: 15px; -} -.modal-footer { - padding: 15px; - text-align: right; - border-top: 1px solid #e5e5e5; -} -.modal-footer .btn + .btn { - margin-bottom: 0; - margin-left: 5px; -} -.modal-footer .btn-group .btn + .btn { - margin-left: -1px; -} -.modal-footer .btn-block + .btn-block { - margin-left: 0; -} -.modal-scrollbar-measure { - position: absolute; - top: -9999px; - width: 50px; - height: 50px; - overflow: scroll; -} -@media (min-width: 768px) { - .modal-dialog { - width: 600px; - margin: 30px auto; - } - .modal-content { - -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5); - box-shadow: 0 5px 15px rgba(0, 0, 0, .5); - } - .modal-sm { - width: 300px; - } -} -@media (min-width: 992px) { - .modal-lg { - width: 900px; - } -} -.tooltip { - position: absolute; - z-index: 1070; - display: block; - font-size: 12px; - line-height: 1.4; - visibility: visible; - filter: alpha(opacity=0); - opacity: 0; -} -.tooltip.in { - filter: alpha(opacity=90); - opacity: .9; -} -.tooltip.top { - padding: 5px 0; - margin-top: -3px; -} -.tooltip.right { - padding: 0 5px; - margin-left: 3px; -} -.tooltip.bottom { - padding: 5px 0; - margin-top: 3px; -} -.tooltip.left { - padding: 0 5px; - margin-left: -3px; -} -.tooltip-inner { - max-width: 200px; - padding: 3px 8px; - color: #fff; - text-align: center; - text-decoration: none; - background-color: #000; - border-radius: 4px; -} -.tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} -.tooltip.top .tooltip-arrow { - bottom: 0; - left: 50%; - margin-left: -5px; - border-width: 5px 5px 0; - border-top-color: #000; -} -.tooltip.top-left .tooltip-arrow { - bottom: 0; - left: 5px; - border-width: 5px 5px 0; - border-top-color: #000; -} -.tooltip.top-right .tooltip-arrow { - right: 5px; - bottom: 0; - border-width: 5px 5px 0; - border-top-color: #000; -} -.tooltip.right .tooltip-arrow { - top: 50%; - left: 0; - margin-top: -5px; - border-width: 5px 5px 5px 0; - border-right-color: #000; -} -.tooltip.left .tooltip-arrow { - top: 50%; - right: 0; - margin-top: -5px; - border-width: 5px 0 5px 5px; - border-left-color: #000; -} -.tooltip.bottom .tooltip-arrow { - top: 0; - left: 50%; - margin-left: -5px; - border-width: 0 5px 5px; - border-bottom-color: #000; -} -.tooltip.bottom-left .tooltip-arrow { - top: 0; - left: 5px; - border-width: 0 5px 5px; - border-bottom-color: #000; -} -.tooltip.bottom-right .tooltip-arrow { - top: 0; - right: 5px; - border-width: 0 5px 5px; - border-bottom-color: #000; -} -.popover { - position: absolute; - top: 0; - left: 0; - z-index: 1060; - display: none; - max-width: 276px; - padding: 1px; - text-align: left; - white-space: normal; - background-color: #fff; - -webkit-background-clip: padding-box; - background-clip: padding-box; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, .2); - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); - box-shadow: 0 5px 10px rgba(0, 0, 0, .2); -} -.popover.top { - margin-top: -10px; -} -.popover.right { - margin-left: 10px; -} -.popover.bottom { - margin-top: 10px; -} -.popover.left { - margin-left: -10px; -} -.popover-title { - padding: 8px 14px; - margin: 0; - font-size: 14px; - font-weight: normal; - line-height: 18px; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; - border-radius: 5px 5px 0 0; -} -.popover-content { - padding: 9px 14px; -} -.popover > .arrow, -.popover > .arrow:after { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} -.popover > .arrow { - border-width: 11px; -} -.popover > .arrow:after { - content: ""; - border-width: 10px; -} -.popover.top > .arrow { - bottom: -11px; - left: 50%; - margin-left: -11px; - border-top-color: #999; - border-top-color: rgba(0, 0, 0, .25); - border-bottom-width: 0; -} -.popover.top > .arrow:after { - bottom: 1px; - margin-left: -10px; - content: " "; - border-top-color: #fff; - border-bottom-width: 0; -} -.popover.right > .arrow { - top: 50%; - left: -11px; - margin-top: -11px; - border-right-color: #999; - border-right-color: rgba(0, 0, 0, .25); - border-left-width: 0; -} -.popover.right > .arrow:after { - bottom: -10px; - left: 1px; - content: " "; - border-right-color: #fff; - border-left-width: 0; -} -.popover.bottom > .arrow { - top: -11px; - left: 50%; - margin-left: -11px; - border-top-width: 0; - border-bottom-color: #999; - border-bottom-color: rgba(0, 0, 0, .25); -} -.popover.bottom > .arrow:after { - top: 1px; - margin-left: -10px; - content: " "; - border-top-width: 0; - border-bottom-color: #fff; -} -.popover.left > .arrow { - top: 50%; - right: -11px; - margin-top: -11px; - border-right-width: 0; - border-left-color: #999; - border-left-color: rgba(0, 0, 0, .25); -} -.popover.left > .arrow:after { - right: 1px; - bottom: -10px; - content: " "; - border-right-width: 0; - border-left-color: #fff; -} -.carousel { - position: relative; -} -.carousel-inner { - position: relative; - width: 100%; - overflow: hidden; -} -.carousel-inner > .item { - position: relative; - display: none; - -webkit-transition: .6s ease-in-out left; - -o-transition: .6s ease-in-out left; - transition: .6s ease-in-out left; -} -.carousel-inner > .item > img, -.carousel-inner > .item > a > img { - line-height: 1; -} -.carousel-inner > .active, -.carousel-inner > .next, -.carousel-inner > .prev { - display: block; -} -.carousel-inner > .active { - left: 0; -} -.carousel-inner > .next, -.carousel-inner > .prev { - position: absolute; - top: 0; - width: 100%; -} -.carousel-inner > .next { - left: 100%; -} -.carousel-inner > .prev { - left: -100%; -} -.carousel-inner > .next.left, -.carousel-inner > .prev.right { - left: 0; -} -.carousel-inner > .active.left { - left: -100%; -} -.carousel-inner > .active.right { - left: 100%; -} -.carousel-control { - position: absolute; - top: 0; - bottom: 0; - left: 0; - width: 15%; - font-size: 20px; - color: #fff; - text-align: center; - text-shadow: 0 1px 2px rgba(0, 0, 0, .6); - filter: alpha(opacity=50); - opacity: .5; -} -.carousel-control.left { - background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); - background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); - background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001))); - background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); - background-repeat: repeat-x; -} -.carousel-control.right { - right: 0; - left: auto; - background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); - background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); - background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5))); - background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); - background-repeat: repeat-x; -} -.carousel-control:hover, -.carousel-control:focus { - color: #fff; - text-decoration: none; - filter: alpha(opacity=90); - outline: 0; - opacity: .9; -} -.carousel-control .icon-prev, -.carousel-control .icon-next, -.carousel-control .glyphicon-chevron-left, -.carousel-control .glyphicon-chevron-right { - position: absolute; - top: 50%; - z-index: 5; - display: inline-block; -} -.carousel-control .icon-prev, -.carousel-control .glyphicon-chevron-left { - left: 50%; - margin-left: -10px; -} -.carousel-control .icon-next, -.carousel-control .glyphicon-chevron-right { - right: 50%; - margin-right: -10px; -} -.carousel-control .icon-prev, -.carousel-control .icon-next { - width: 20px; - height: 20px; - margin-top: -10px; - font-family: serif; -} -.carousel-control .icon-prev:before { - content: '\2039'; -} -.carousel-control .icon-next:before { - content: '\203a'; -} -.carousel-indicators { - position: absolute; - bottom: 10px; - left: 50%; - z-index: 15; - width: 60%; - padding-left: 0; - margin-left: -30%; - text-align: center; - list-style: none; -} -.carousel-indicators li { - display: inline-block; - width: 10px; - height: 10px; - margin: 1px; - text-indent: -999px; - cursor: pointer; - background-color: #000 \9; - background-color: rgba(0, 0, 0, 0); - border: 1px solid #fff; - border-radius: 10px; -} -.carousel-indicators .active { - width: 12px; - height: 12px; - margin: 0; - background-color: #fff; -} -.carousel-caption { - position: absolute; - right: 15%; - bottom: 20px; - left: 15%; - z-index: 10; - padding-top: 20px; - padding-bottom: 20px; - color: #fff; - text-align: center; - text-shadow: 0 1px 2px rgba(0, 0, 0, .6); -} -.carousel-caption .btn { - text-shadow: none; -} -@media screen and (min-width: 768px) { - .carousel-control .glyphicon-chevron-left, - .carousel-control .glyphicon-chevron-right, - .carousel-control .icon-prev, - .carousel-control .icon-next { - width: 30px; - height: 30px; - margin-top: -15px; - font-size: 30px; - } - .carousel-control .glyphicon-chevron-left, - .carousel-control .icon-prev { - margin-left: -15px; - } - .carousel-control .glyphicon-chevron-right, - .carousel-control .icon-next { - margin-right: -15px; - } - .carousel-caption { - right: 20%; - left: 20%; - padding-bottom: 30px; - } - .carousel-indicators { - bottom: 20px; - } -} -.clearfix:before, -.clearfix:after, -.dl-horizontal dd:before, -.dl-horizontal dd:after, -.container:before, -.container:after, -.container-fluid:before, -.container-fluid:after, -.row:before, -.row:after, -.form-horizontal .form-group:before, -.form-horizontal .form-group:after, -.btn-toolbar:before, -.btn-toolbar:after, -.btn-group-vertical > .btn-group:before, -.btn-group-vertical > .btn-group:after, -.nav:before, -.nav:after, -.navbar:before, -.navbar:after, -.navbar-header:before, -.navbar-header:after, -.navbar-collapse:before, -.navbar-collapse:after, -.pager:before, -.pager:after, -.panel-body:before, -.panel-body:after, -.modal-footer:before, -.modal-footer:after { - display: table; - content: " "; -} -.clearfix:after, -.dl-horizontal dd:after, -.container:after, -.container-fluid:after, -.row:after, -.form-horizontal .form-group:after, -.btn-toolbar:after, -.btn-group-vertical > .btn-group:after, -.nav:after, -.navbar:after, -.navbar-header:after, -.navbar-collapse:after, -.pager:after, -.panel-body:after, -.modal-footer:after { - clear: both; -} -.center-block { - display: block; - margin-right: auto; - margin-left: auto; -} -.pull-right { - float: right !important; -} -.pull-left { - float: left !important; -} -.hide { - display: none !important; -} -.show { - display: block !important; -} -.invisible { - visibility: hidden; -} -.text-hide { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} -.hidden { - display: none !important; - visibility: hidden !important; -} -.affix { - position: fixed; - -webkit-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} -@-ms-viewport { - width: device-width; -} -.visible-xs, -.visible-sm, -.visible-md, -.visible-lg { - display: none !important; -} -.visible-xs-block, -.visible-xs-inline, -.visible-xs-inline-block, -.visible-sm-block, -.visible-sm-inline, -.visible-sm-inline-block, -.visible-md-block, -.visible-md-inline, -.visible-md-inline-block, -.visible-lg-block, -.visible-lg-inline, -.visible-lg-inline-block { - display: none !important; -} -@media (max-width: 767px) { - .visible-xs { - display: block !important; - } - table.visible-xs { - display: table; - } - tr.visible-xs { - display: table-row !important; - } - th.visible-xs, - td.visible-xs { - display: table-cell !important; - } -} -@media (max-width: 767px) { - .visible-xs-block { - display: block !important; - } -} -@media (max-width: 767px) { - .visible-xs-inline { - display: inline !important; - } -} -@media (max-width: 767px) { - .visible-xs-inline-block { - display: inline-block !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm { - display: block !important; - } - table.visible-sm { - display: table; - } - tr.visible-sm { - display: table-row !important; - } - th.visible-sm, - td.visible-sm { - display: table-cell !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm-block { - display: block !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm-inline { - display: inline !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm-inline-block { - display: inline-block !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md { - display: block !important; - } - table.visible-md { - display: table; - } - tr.visible-md { - display: table-row !important; - } - th.visible-md, - td.visible-md { - display: table-cell !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md-block { - display: block !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md-inline { - display: inline !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md-inline-block { - display: inline-block !important; - } -} -@media (min-width: 1200px) { - .visible-lg { - display: block !important; - } - table.visible-lg { - display: table; - } - tr.visible-lg { - display: table-row !important; - } - th.visible-lg, - td.visible-lg { - display: table-cell !important; - } -} -@media (min-width: 1200px) { - .visible-lg-block { - display: block !important; - } -} -@media (min-width: 1200px) { - .visible-lg-inline { - display: inline !important; - } -} -@media (min-width: 1200px) { - .visible-lg-inline-block { - display: inline-block !important; - } -} -@media (max-width: 767px) { - .hidden-xs { - display: none !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .hidden-sm { - display: none !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .hidden-md { - display: none !important; - } -} -@media (min-width: 1200px) { - .hidden-lg { - display: none !important; - } -} -.visible-print { - display: none !important; -} -@media print { - .visible-print { - display: block !important; - } - table.visible-print { - display: table; - } - tr.visible-print { - display: table-row !important; - } - th.visible-print, - td.visible-print { - display: table-cell !important; - } -} -.visible-print-block { - display: none !important; -} -@media print { - .visible-print-block { - display: block !important; - } -} -.visible-print-inline { - display: none !important; -} -@media print { - .visible-print-inline { - display: inline !important; - } -} -.visible-print-inline-block { - display: none !important; -} -@media print { - .visible-print-inline-block { - display: inline-block !important; - } -} -@media print { - .hidden-print { - display: none !important; - } -} - +/*! + * Bootstrap v3.2.0 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + margin: .67em 0; + font-size: 2em; +} +mark { + color: #000; + background: #ff0; +} +small { + font-size: 80%; +} +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -.5em; +} +sub { + bottom: -.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + height: 0; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + margin: 0; + font: inherit; + color: inherit; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + padding: .35em .625em .75em; + margin: 0 2px; + border: 1px solid #c0c0c0; +} +legend { + padding: 0; + border: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-spacing: 0; + border-collapse: collapse; +} +td, +th { + padding: 0; +} +@media print { + * { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + select { + background: #fff !important; + } + .navbar { + display: none; + } + .table td, + .table th { + background-color: #fff !important; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +@font-face { + font-family: 'Glyphicons Halflings'; + + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\2a"; +} +.glyphicon-plus:before { + content: "\2b"; +} +.glyphicon-euro:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 10px; + + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.42857143; + color: #333; + background-color: #fff; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #428bca; + text-decoration: none; +} +a:hover, +a:focus { + color: #2a6496; + text-decoration: underline; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + width: 100% \9; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + display: inline-block; + width: 100% \9; + max-width: 100%; + height: auto; + padding: 4px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eee; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #777; +} +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 20px; + margin-bottom: 10px; +} +h1 small, +.h1 small, +h2 small, +.h2 small, +h3 small, +.h3 small, +h1 .small, +.h1 .small, +h2 .small, +.h2 .small, +h3 .small, +.h3 .small { + font-size: 65%; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 10px; + margin-bottom: 10px; +} +h4 small, +.h4 small, +h5 small, +.h5 small, +h6 small, +.h6 small, +h4 .small, +.h4 .small, +h5 .small, +.h5 .small, +h6 .small, +.h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 36px; +} +h2, +.h2 { + font-size: 30px; +} +h3, +.h3 { + font-size: 24px; +} +h4, +.h4 { + font-size: 18px; +} +h5, +.h5 { + font-size: 14px; +} +h6, +.h6 { + font-size: 12px; +} +p { + margin: 0 0 10px; +} +.lead { + margin-bottom: 20px; + font-size: 16px; + font-weight: 300; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 21px; + } +} +small, +.small { + font-size: 85%; +} +cite { + font-style: normal; +} +mark, +.mark { + padding: .2em; + background-color: #fcf8e3; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} +.text-muted { + color: #777; +} +.text-primary { + color: #428bca; +} +a.text-primary:hover { + color: #3071a9; +} +.text-success { + color: #3c763d; +} +a.text-success:hover { + color: #2b542c; +} +.text-info { + color: #31708f; +} +a.text-info:hover { + color: #245269; +} +.text-warning { + color: #8a6d3b; +} +a.text-warning:hover { + color: #66512c; +} +.text-danger { + color: #a94442; +} +a.text-danger:hover { + color: #843534; +} +.bg-primary { + color: #fff; + background-color: #428bca; +} +a.bg-primary:hover { + background-color: #3071a9; +} +.bg-success { + background-color: #dff0d8; +} +a.bg-success:hover { + background-color: #c1e2b3; +} +.bg-info { + background-color: #d9edf7; +} +a.bg-info:hover { + background-color: #afd9ee; +} +.bg-warning { + background-color: #fcf8e3; +} +a.bg-warning:hover { + background-color: #f7ecb5; +} +.bg-danger { + background-color: #f2dede; +} +a.bg-danger:hover { + background-color: #e4b9b9; +} +.page-header { + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eee; +} +ul, +ol { + margin-top: 0; + margin-bottom: 10px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + margin-left: -5px; + list-style: none; +} +.list-inline > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; +} +dl { + margin-top: 0; + margin-bottom: 20px; +} +dt, +dd { + line-height: 1.42857143; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #777; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + font-size: 17.5px; + border-left: 5px solid #eee; +} +blockquote p:last-child, +blockquote ul:last-child, +blockquote ol:last-child { + margin-bottom: 0; +} +blockquote footer, +blockquote small, +blockquote .small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #777; +} +blockquote footer:before, +blockquote small:before, +blockquote .small:before { + content: '\2014 \00A0'; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + text-align: right; + border-right: 5px solid #eee; + border-left: 0; +} +.blockquote-reverse footer:before, +blockquote.pull-right footer:before, +.blockquote-reverse small:before, +blockquote.pull-right small:before, +.blockquote-reverse .small:before, +blockquote.pull-right .small:before { + content: ''; +} +.blockquote-reverse footer:after, +blockquote.pull-right footer:after, +.blockquote-reverse small:after, +blockquote.pull-right small:after, +.blockquote-reverse .small:after, +blockquote.pull-right .small:after { + content: '\00A0 \2014'; +} +blockquote:before, +blockquote:after { + content: ""; +} +address { + margin-bottom: 20px; + font-style: normal; + line-height: 1.42857143; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + border-radius: 4px; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #fff; + background-color: #333; + border-radius: 3px; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); +} +kbd kbd { + padding: 0; + font-size: 100%; + -webkit-box-shadow: none; + box-shadow: none; +} +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 1.42857143; + color: #333; + word-break: break-all; + word-wrap: break-word; + background-color: #f5f5f5; + border: 1px solid #ccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +.row { + margin-right: -15px; + margin-left: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0; + } +} +table { + background-color: transparent; +} +th { + text-align: left; +} +.table { + width: 100%; + max-width: 100%; + margin-bottom: 20px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; + border-top: 1px solid #ddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #ddd; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #ddd; +} +.table .table { + background-color: #fff; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #ddd; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #ddd; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-child(odd) > td, +.table-striped > tbody > tr:nth-child(odd) > th { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover > td, +.table-hover > tbody > tr:hover > th { + background-color: #f5f5f5; +} +table col[class*="col-"] { + position: static; + display: table-column; + float: none; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + display: table-cell; + float: none; +} +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #f5f5f5; +} +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr:hover > .active, +.table-hover > tbody > tr.active:hover > th { + background-color: #e8e8e8; +} +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #dff0d8; +} +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr:hover > .success, +.table-hover > tbody > tr.success:hover > th { + background-color: #d0e9c6; +} +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #d9edf7; +} +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr:hover > .info, +.table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; +} +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; +} +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr:hover > .warning, +.table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; +} +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #f2dede; +} +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr:hover > .danger, +.table-hover > tbody > tr.danger:hover > th { + background-color: #ebcccc; +} +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-x: auto; + overflow-y: hidden; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #ddd; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + min-width: 0; + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: inherit; + color: #333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 7px; + font-size: 14px; + line-height: 1.42857143; + color: #555; +} +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); +} +.form-control::-moz-placeholder { + color: #777; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #777; +} +.form-control::-webkit-input-placeholder { + color: #777; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + cursor: not-allowed; + background-color: #eee; + opacity: 1; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +input[type="date"], +input[type="time"], +input[type="datetime-local"], +input[type="month"] { + line-height: 34px; + line-height: 1.42857143 \0; +} +input[type="date"].input-sm, +input[type="time"].input-sm, +input[type="datetime-local"].input-sm, +input[type="month"].input-sm { + line-height: 30px; +} +input[type="date"].input-lg, +input[type="time"].input-lg, +input[type="datetime-local"].input-lg, +input[type="month"].input-lg { + line-height: 46px; +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + position: relative; + display: block; + min-height: 20px; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-top: 4px \9; + margin-left: -20px; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + vertical-align: middle; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-right: 0; + padding-left: 0; +} +.input-sm, +.form-horizontal .form-group-sm .form-control { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 30px; + line-height: 30px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.input-lg, +.form-horizontal .form-group-lg .form-control { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-lg { + height: 46px; + line-height: 46px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 42.5px; +} +.form-control-feedback { + position: absolute; + top: 25px; + right: 0; + z-index: 2; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; +} +.input-lg + .form-control-feedback { + width: 46px; + height: 46px; + line-height: 46px; +} +.input-sm + .form-control-feedback { + width: 30px; + height: 30px; + line-height: 30px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + background-color: #dff0d8; + border-color: #3c763d; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #8a6d3b; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + background-color: #f2dede; + border-color: #a94442; +} +.has-error .form-control-feedback { + color: #a94442; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + padding-top: 7px; + margin-top: 0; + margin-bottom: 0; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; +} +.form-horizontal .form-group { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + padding-top: 7px; + margin-bottom: 0; + text-align: right; + } +} +.form-horizontal .has-feedback .form-control-feedback { + top: 0; + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 14.3px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + } +} +.btn { + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: normal; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus { + color: #333; + text-decoration: none; +} +.btn:active, +.btn.active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + pointer-events: none; + cursor: not-allowed; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; + opacity: .65; +} +.btn-default { + color: #333; + background-color: #fff; + border-color: #ccc; +} +.btn-default:hover, +.btn-default:focus, +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #fff; + border-color: #ccc; +} +.btn-default .badge { + color: #fff; + background-color: #333; +} +.btn-primary { + color: #fff; + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #fff; + background-color: #3071a9; + border-color: #285e8e; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary .badge { + color: #428bca; + background-color: #fff; +} +.btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:hover, +.btn-success:focus, +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #fff; + background-color: #449d44; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #fff; +} +.btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:hover, +.btn-info:focus, +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #fff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #fff; +} +.btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:hover, +.btn-warning:focus, +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #fff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #fff; +} +.btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:hover, +.btn-danger:focus, +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #fff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #fff; +} +.btn-link { + font-weight: normal; + color: #428bca; + cursor: pointer; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #2a6496; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #777; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity .15s linear; + -o-transition: opacity .15s linear; + transition: opacity .15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height .35s ease; + -o-transition: height .35s ease; + transition: height .35s ease; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px solid; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 14px; + text-align: left; + list-style: none; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + box-shadow: 0 6px 12px rgba(0, 0, 0, .175); +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #333; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + color: #262626; + text-decoration: none; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #fff; + text-decoration: none; + background-color: #428bca; + outline: 0; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #777; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + cursor: not-allowed; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + right: 0; + left: auto; +} +.dropdown-menu-left { + right: auto; + left: 0; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #777; + white-space: nowrap; +} +.dropdown-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + content: ""; + border-top: 0; + border-bottom: 4px solid; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + right: 0; + left: auto; + } + .navbar-right .dropdown-menu-left { + right: auto; + left: 0; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus { + outline: 0; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child > .btn:last-child, +.btn-group > .btn-group:first-child > .dropdown-toggle { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn-group:last-child > .btn:first-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-right: 8px; + padding-left: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-right: 12px; + padding-left: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-left-radius: 4px; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + display: table-cell; + float: none; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn > input[type="radio"], +[data-toggle="buttons"] > .btn > input[type="checkbox"] { + position: absolute; + z-index: -1; + filter: alpha(opacity=0); + opacity: 0; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-right: 0; + padding-left: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555; + text-align: center; + background-color: #eee; + border: 1px solid #ccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + margin-left: -1px; +} +.nav { + padding-left: 0; + margin-bottom: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eee; +} +.nav > li.disabled > a { + color: #777; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #777; + text-decoration: none; + cursor: not-allowed; + background-color: transparent; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #eee; + border-color: #428bca; +} +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #ddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eee #eee #ddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #555; + cursor: default; + background-color: #fff; + border: 1px solid #ddd; + border-bottom-color: transparent; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #fff; + background-color: #428bca; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + padding-right: 15px; + padding-left: 15px; + overflow-x: visible; + -webkit-overflow-scrolling: touch; + border-top: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-right: 0; + padding-left: 0; + } +} +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; +} +@media (max-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; + -webkit-transform: translate3d(0, 0, 0); + -o-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + height: 50px; + padding: 15px 15px; + font-size: 18px; + line-height: 20px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + padding: 9px 10px; + margin-top: 8px; + margin-right: 15px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: 0; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 7.5px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + } + .navbar-nav.navbar-right:last-child { + margin-right: -15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + } +} +.navbar-form { + padding: 10px 15px; + margin-top: 8px; + margin-right: -15px; + margin-bottom: 8px; + margin-left: -15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn, + .navbar-form .input-group .form-control { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio label, + .navbar-form .checkbox label { + padding-left: 0; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + padding-top: 0; + padding-bottom: 0; + margin-right: 0; + margin-left: 0; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-form.navbar-right:last-child { + margin-right: -15px; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; +} +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; +} +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; +} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-right: 15px; + margin-left: 15px; + } + .navbar-text.navbar-right:last-child { + margin-right: 0; + } +} +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navbar-default .navbar-brand { + color: #777; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #5e5e5e; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777; +} +.navbar-default .navbar-nav > li > a { + color: #777; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #333; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #555; + background-color: #e7e7e7; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #ccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #ddd; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #ddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #888; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #e7e7e7; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + color: #555; + background-color: #e7e7e7; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #333; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #555; + background-color: #e7e7e7; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #ccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777; +} +.navbar-default .navbar-link:hover { + color: #333; +} +.navbar-default .btn-link { + color: #777; +} +.navbar-default .btn-link:hover, +.navbar-default .btn-link:focus { + color: #333; +} +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:hover, +.navbar-default .btn-link[disabled]:focus, +fieldset[disabled] .navbar-default .btn-link:focus { + color: #ccc; +} +.navbar-inverse { + background-color: #222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #777; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #777; +} +.navbar-inverse .navbar-nav > li > a { + color: #777; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #fff; + background-color: #080808; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #333; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #333; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #fff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + color: #fff; + background-color: #080808; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #777; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #fff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #fff; + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #777; +} +.navbar-inverse .navbar-link:hover { + color: #fff; +} +.navbar-inverse .btn-link { + color: #777; +} +.navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link:focus { + color: #fff; +} +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link[disabled]:focus, +fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #444; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + padding: 0 5px; + color: #ccc; + content: "/\00a0"; +} +.breadcrumb > .active { + color: #777; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #428bca; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + color: #2a6496; + background-color: #eee; + border-color: #ddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 2; + color: #fff; + cursor: default; + background-color: #428bca; + border-color: #428bca; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + text-align: center; + list-style: none; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #777; + cursor: not-allowed; + background-color: #fff; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +a.label:hover, +a.label:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #777; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #5e5e5e; +} +.label-primary { + background-color: #428bca; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #3071a9; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #c9302c; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + background-color: #777; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +a.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #428bca; + background-color: #fff; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding: 30px; + margin-bottom: 30px; + color: inherit; + background-color: #eee; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 21px; + font-weight: 200; +} +.jumbotron > hr { + border-top-color: #d5d5d5; +} +.container .jumbotron { + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; + } + .container .jumbotron { + padding-right: 60px; + padding-left: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 63px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-right: auto; + margin-left: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #428bca; +} +.thumbnail .caption { + padding: 9px; + color: #333; +} +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} +.alert-danger .alert-link { + color: #843534; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); +} +.progress-bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #fff; + text-align: center; + background-color: #428bca; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + -webkit-transition: width .6s ease; + -o-transition: width .6s ease; + transition: width .6s ease; +} +.progress-striped .progress-bar, +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress.active .progress-bar, +.progress-bar.active { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar[aria-valuenow="1"], +.progress-bar[aria-valuenow="2"] { + min-width: 30px; +} +.progress-bar[aria-valuenow="0"] { + min-width: 30px; + color: #777; + background-color: transparent; + background-image: none; + -webkit-box-shadow: none; + box-shadow: none; +} +.progress-bar-success { + background-color: #5cb85c; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f0ad4e; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #d9534f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.media, +.media-body { + overflow: hidden; + zoom: 1; +} +.media, +.media .media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media-object { + display: block; +} +.media-heading { + margin: 0 0 5px; +} +.media > .pull-left { + margin-right: 10px; +} +.media > .pull-right { + margin-left: 10px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + padding-left: 0; + margin-bottom: 20px; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #fff; + border: 1px solid #ddd; +} +.list-group-item:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +a.list-group-item { + color: #555; +} +a.list-group-item .list-group-item-heading { + color: #333; +} +a.list-group-item:hover, +a.list-group-item:focus { + color: #555; + text-decoration: none; + background-color: #f5f5f5; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + color: #777; + background-color: #eee; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #777; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #fff; + background-color: #428bca; + border-color: #428bca; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #e1edf7; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +a.list-group-item-success:focus { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +a.list-group-item-success.active:hover, +a.list-group-item-success.active:focus { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +a.list-group-item-info:focus { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +a.list-group-item-info.active:hover, +a.list-group-item-info.active:focus { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +a.list-group-item-warning:focus { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +a.list-group-item-danger:focus { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: 0 1px 1px rgba(0, 0, 0, .05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive { + border-top: 1px solid #ddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + margin-bottom: 0; + border: 0; +} +.panel-group { + margin-bottom: 20px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .panel-body { + border-top: 1px solid #ddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #ddd; +} +.panel-default { + border-color: #ddd; +} +.panel-default > .panel-heading { + color: #333; + background-color: #f5f5f5; + border-color: #ddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ddd; +} +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ddd; +} +.panel-primary { + border-color: #428bca; +} +.panel-primary > .panel-heading { + color: #fff; + background-color: #428bca; + border-color: #428bca; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #428bca; +} +.panel-primary > .panel-heading .badge { + color: #428bca; + background-color: #fff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #428bca; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-heading .badge { + color: #dff0d8; + background-color: #3c763d; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #bce8f1; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #8a6d3b; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-heading .badge { + color: #f2dede; + background-color: #a94442; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ebccd1; +} +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; +} +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; +} +.embed-responsive.embed-responsive-16by9 { + padding-bottom: 56.25%; +} +.embed-responsive.embed-responsive-4by3 { + padding-bottom: 75%; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, .15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #fff; + filter: alpha(opacity=20); + opacity: .2; +} +.close:hover, +.close:focus { + color: #000; + text-decoration: none; + cursor: pointer; + filter: alpha(opacity=50); + opacity: .5; +} +button.close { + -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: transparent; + border: 0; +} +.modal-open { + overflow: hidden; +} +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + display: none; + overflow: hidden; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transition: -webkit-transform .3s ease-out; + -o-transition: -o-transform .3s ease-out; + transition: transform .3s ease-out; + -webkit-transform: translate3d(0, -25%, 0); + -o-transform: translate3d(0, -25%, 0); + transform: translate3d(0, -25%, 0); +} +.modal.in .modal-dialog { + -webkit-transform: translate3d(0, 0, 0); + -o-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + outline: 0; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + box-shadow: 0 3px 9px rgba(0, 0, 0, .5); +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000; +} +.modal-backdrop.fade { + filter: alpha(opacity=0); + opacity: 0; +} +.modal-backdrop.in { + filter: alpha(opacity=50); + opacity: .5; +} +.modal-header { + min-height: 16.42857143px; + padding: 15px; + border-bottom: 1px solid #e5e5e5; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 15px; +} +.modal-footer { + padding: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + font-size: 12px; + line-height: 1.4; + visibility: visible; + filter: alpha(opacity=0); + opacity: 0; +} +.tooltip.in { + filter: alpha(opacity=90); + opacity: .9; +} +.tooltip.top { + padding: 5px 0; + margin-top: -3px; +} +.tooltip.right { + padding: 0 5px; + margin-left: 3px; +} +.tooltip.bottom { + padding: 5px 0; + margin-top: 3px; +} +.tooltip.left { + padding: 0 5px; + margin-left: -3px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #fff; + text-align: center; + text-decoration: none; + background-color: #000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + left: 5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-right .tooltip-arrow { + right: 5px; + bottom: 0; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + left: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + right: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: none; + max-width: 276px; + padding: 1px; + text-align: left; + white-space: normal; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + box-shadow: 0 5px 10px rgba(0, 0, 0, .2); +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + content: ""; + border-width: 10px; +} +.popover.top > .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, .25); + border-bottom-width: 0; +} +.popover.top > .arrow:after { + bottom: 1px; + margin-left: -10px; + content: " "; + border-top-color: #fff; + border-bottom-width: 0; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, .25); + border-left-width: 0; +} +.popover.right > .arrow:after { + bottom: -10px; + left: 1px; + content: " "; + border-right-color: #fff; + border-left-width: 0; +} +.popover.bottom > .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, .25); +} +.popover.bottom > .arrow:after { + top: 1px; + margin-left: -10px; + content: " "; + border-top-width: 0; + border-bottom-color: #fff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, .25); +} +.popover.left > .arrow:after { + right: 1px; + bottom: -10px; + content: " "; + border-right-width: 0; + border-left-color: #fff; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} +.carousel-inner > .item { + position: relative; + display: none; + -webkit-transition: .6s ease-in-out left; + -o-transition: .6s ease-in-out left; + transition: .6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + line-height: 1; +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 15%; + font-size: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, .6); + filter: alpha(opacity=50); + opacity: .5; +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001))); + background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control.right { + right: 0; + left: auto; + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5))); + background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control:hover, +.carousel-control:focus { + color: #fff; + text-decoration: none; + filter: alpha(opacity=90); + outline: 0; + opacity: .9; +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; + margin-left: -10px; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; + margin-right: -10px; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + margin-top: -10px; + font-family: serif; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203a'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + padding-left: 0; + margin-left: -30%; + text-align: center; + list-style: none; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); + border: 1px solid #fff; + border-radius: 10px; +} +.carousel-indicators .active { + width: 12px; + height: 12px; + margin: 0; + background-color: #fff; +} +.carousel-caption { + position: absolute; + right: 15%; + bottom: 20px; + left: 15%; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, .6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + font-size: 30px; + } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -15px; + } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -15px; + } + .carousel-caption { + right: 20%; + left: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after { + display: table; + content: " "; +} +.clearfix:after, +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-right: auto; + margin-left: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; + visibility: hidden !important; +} +.affix { + position: fixed; + -webkit-transform: translate3d(0, 0, 0); + -o-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} + diff --git a/templates/website/ph2date/bootstrap.min.js b/templates/website/ph2date/bootstrap.min.js index fc51ad7..b04a0e8 100755 --- a/templates/website/ph2date/bootstrap.min.js +++ b/templates/website/ph2date/bootstrap.min.js @@ -1,6 +1,6 @@ -/*! - * Bootstrap v3.1.1 (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ +/*! + * Bootstrap v3.1.1 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);!e&&f.toggle&&"show"==c&&(c=!c),e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); \ No newline at end of file diff --git a/templates/website/ph2date/change_password.php b/templates/website/ph2date/change_password.php index c0903e1..f27d081 100755 --- a/templates/website/ph2date/change_password.php +++ b/templates/website/ph2date/change_password.php @@ -1,40 +1,40 @@ -load->view('header'); -$this->load->view('loged_in_side'); -?> -
        -
        - -

        -
        -
        - -load->view('right_msg') ?> - - - -
        -
        - -
        - -
        -
        - -
        - -
        -
        - -
        - - -
        - -
        - - - -
        -
        +load->view('header'); +$this->load->view('loged_in_side'); +?> +
        +
        + +

        +
        +
        + +load->view('right_msg') ?> + + + +
        +
        + +
        + +
        +
        + +
        + +
        +
        + +
        + + +
        + +
        + + + +
        +
        load->view('footer') ?> \ No newline at end of file diff --git a/templates/website/ph2date/chat.php b/templates/website/ph2date/chat.php index 0eadb32..7e2d04f 100755 --- a/templates/website/ph2date/chat.php +++ b/templates/website/ph2date/chat.php @@ -1,300 +1,300 @@ -query("SELECT * FROM video"); -// $s = $stmt->fetchAll(PDO::FETCH_ASSOC); -//print_r($s);die; -if ($_GET['action'] == "chatheartbeat") { chatHeartbeat(); } -if ($_GET['action'] == "sendchat") { sendChat(); } -if ($_GET['action'] == "sendchat2") { sendChat2(); } - -if ($_GET['action'] == "closechat") { closeChat(); } -if ($_GET['action'] == "startchatsession") { startChatSession(); } - -if (!isset($_SESSION['chatHistory'])) { - $_SESSION['chatHistory'] = array(); -} - -if (!isset($_SESSION['openChatBoxes'])) { - $_SESSION['openChatBoxes'] = array(); -} - -function chatHeartbeat() { - global $db; - $sql = "select * from chat where (chat.to =? AND recd = 0) order by id ASC"; - $stmt = $db->prepare($sql); - - - $stmt->execute(array($_SESSION['username'])); - $items = ''; - - $chatBoxes = array(); -$chats = $stmt->fetchAll(PDO::FETCH_ASSOC); - foreach ($chats AS $chat) { -//print_r($chat);die; - if (!isset($_SESSION['openChatBoxes'][$chat['from']]) && isset($_SESSION['chatHistory'][$chat['from']])) { - $items = $_SESSION['chatHistory'][$chat['from']]; - } - - $chat['message'] = smile($chat['message']); - - $items .= << $time) { - if (!isset($_SESSION['tsChatBoxes'][$chatbox])) { - $now = time()-strtotime($time); - $time = date('g:iA M dS', strtotime($time)); - - $message = "Sent at $time"; - if ($now > 180) { - $items .= <<prepare($sql); - $stmt->execute( array($_SESSION['username']) ); - - if ($items != '') { - $items = substr($items, 0, -1); - } -header('Content-type: application/json'); -?> -{ - "items": [ - - ] -} - - $void) { - $items .= chatBoxSession($chatbox); - } - } - - - if ($items != '') { - $items = substr($items, 0, -1); - } - -header('Content-type: application/json'); -?> -{ - "username": "", - "items": [ - - ] -} - -prepare($sql); - - - $stmt->execute( array($from, $to,$message ) ); - - echo "1"; - exit(0); -} - - -function sendChat() { - global $db; - $from = $_SESSION['username']; - $to = $_POST['to']; - $message = $_POST['message']; - - - $_SESSION['openChatBoxes'][$_POST['to']] = date('Y-m-d H:i:s', time()); - - $messagesan = smile($message); - - if (!isset($_SESSION['chatHistory'][$_POST['to']])) { - $_SESSION['chatHistory'][$_POST['to']] = ''; - } - - $_SESSION['chatHistory'][$_POST['to']] .= <<prepare($sql); - - - $stmt->execute( array($from, $to,$message ) ); - - echo "$messagesan"; - exit(0); -} - -function closeChat() { - - unset($_SESSION['openChatBoxes'][$_POST['chatbox']]); - - echo "1"; - exit(0); -} - -function sanitize($text) { - $text = htmlspecialchars($text, ENT_QUOTES); - $text = str_replace("\n\r","\n",$text); - $text = str_replace("\r\n","\n",$text); - $text = str_replace("\n","
        ",$text); - return $text; -} - -function smile($text) { - global $db; - - $text = sanitize($text); - $sql = "select * from emotions"; - $stmt = $db->prepare($sql); - $stmt->execute(); - while ($emotions = $stmt->fetchAll(PDO::FETCH_ASSOC) ) - { - foreach ($emotions as $emotion) - { - $word = $emotion['word']; - $img = $emotion['img']; - $image = ''; - $text = str_replace($word, $image, $text); - } - - } - return $text; -} +query("SELECT * FROM video"); +// $s = $stmt->fetchAll(PDO::FETCH_ASSOC); +//print_r($s);die; +if ($_GET['action'] == "chatheartbeat") { chatHeartbeat(); } +if ($_GET['action'] == "sendchat") { sendChat(); } +if ($_GET['action'] == "sendchat2") { sendChat2(); } + +if ($_GET['action'] == "closechat") { closeChat(); } +if ($_GET['action'] == "startchatsession") { startChatSession(); } + +if (!isset($_SESSION['chatHistory'])) { + $_SESSION['chatHistory'] = array(); +} + +if (!isset($_SESSION['openChatBoxes'])) { + $_SESSION['openChatBoxes'] = array(); +} + +function chatHeartbeat() { + global $db; + $sql = "select * from chat where (chat.to =? AND recd = 0) order by id ASC"; + $stmt = $db->prepare($sql); + + + $stmt->execute(array($_SESSION['username'])); + $items = ''; + + $chatBoxes = array(); +$chats = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach ($chats AS $chat) { +//print_r($chat);die; + if (!isset($_SESSION['openChatBoxes'][$chat['from']]) && isset($_SESSION['chatHistory'][$chat['from']])) { + $items = $_SESSION['chatHistory'][$chat['from']]; + } + + $chat['message'] = smile($chat['message']); + + $items .= << $time) { + if (!isset($_SESSION['tsChatBoxes'][$chatbox])) { + $now = time()-strtotime($time); + $time = date('g:iA M dS', strtotime($time)); + + $message = "Sent at $time"; + if ($now > 180) { + $items .= <<prepare($sql); + $stmt->execute( array($_SESSION['username']) ); + + if ($items != '') { + $items = substr($items, 0, -1); + } +header('Content-type: application/json'); +?> +{ + "items": [ + + ] +} + + $void) { + $items .= chatBoxSession($chatbox); + } + } + + + if ($items != '') { + $items = substr($items, 0, -1); + } + +header('Content-type: application/json'); +?> +{ + "username": "", + "items": [ + + ] +} + +prepare($sql); + + + $stmt->execute( array($from, $to,$message ) ); + + echo "1"; + exit(0); +} + + +function sendChat() { + global $db; + $from = $_SESSION['username']; + $to = $_POST['to']; + $message = $_POST['message']; + + + $_SESSION['openChatBoxes'][$_POST['to']] = date('Y-m-d H:i:s', time()); + + $messagesan = smile($message); + + if (!isset($_SESSION['chatHistory'][$_POST['to']])) { + $_SESSION['chatHistory'][$_POST['to']] = ''; + } + + $_SESSION['chatHistory'][$_POST['to']] .= <<prepare($sql); + + + $stmt->execute( array($from, $to,$message ) ); + + echo "$messagesan"; + exit(0); +} + +function closeChat() { + + unset($_SESSION['openChatBoxes'][$_POST['chatbox']]); + + echo "1"; + exit(0); +} + +function sanitize($text) { + $text = htmlspecialchars($text, ENT_QUOTES); + $text = str_replace("\n\r","\n",$text); + $text = str_replace("\r\n","\n",$text); + $text = str_replace("\n","
        ",$text); + return $text; +} + +function smile($text) { + global $db; + + $text = sanitize($text); + $sql = "select * from emotions"; + $stmt = $db->prepare($sql); + $stmt->execute(); + while ($emotions = $stmt->fetchAll(PDO::FETCH_ASSOC) ) + { + foreach ($emotions as $emotion) + { + $word = $emotion['word']; + $img = $emotion['img']; + $image = ''; + $text = str_replace($word, $image, $text); + } + + } + return $text; +} diff --git a/templates/website/ph2date/chat_assets/css/chat.css b/templates/website/ph2date/chat_assets/css/chat.css index f3fa2b5..e9960e0 100755 --- a/templates/website/ph2date/chat_assets/css/chat.css +++ b/templates/website/ph2date/chat_assets/css/chat.css @@ -1,98 +1,98 @@ -.chatbox { - margin-right: 10px; - width: 225px; - position:fixed; -} - -.chatboxhead { - background-color: #ACC9FD; - padding:7px; - color: #ffffff; - - border-right:1px solid #ACC9FD; - border-left:1px solid #ACC9FD; -} - -.chatboxblink { - /*background-color: #176689;*/ - background-color: #6992FC; - border-right:1px solid #176689; - border-left:1px solid #176689; -} - -.chatboxcontent { - font-family: arial,sans-serif; - font-size: 13px; - color: #333333; - height:200px; - width:209px; - overflow-y:auto; - overflow-x:auto; - padding:7px; - border-left:1px solid #cccccc; - border-right:1px solid #cccccc; - border-bottom:1px solid #eeeeee; - background-color: #ffffff; - line-height: 1.3em; -} - -.chatboxinput { - padding: 5px; - background-color: #ffffff; - border-left:1px solid #cccccc; - border-right:1px solid #cccccc; - border-bottom:1px solid #cccccc; -} - -.chatboxtextarea { - width: 206px; - height:44px; - padding:3px 0pt 3px 3px; - border: 1px solid #0066FF; - margin: 1px; - overflow:hidden; -} - -.chatboxtextareaselected { - border: 2px solid #ACC9FD; - margin:0; -} - -.chatboxmessage { - margin-left:1em; -} - -.chatboxinfo { - margin-left:-1em; - color:#666666; - -} - -.chatboxmessagefrom { - margin-left:-1em; - font-weight: bold; -} - -.chatboxmessagecontent { -} - -.chatboxoptions { - float: right; -} - -.chatboxoptions a { - text-decoration: none; - color: white; - font-weight:bold; - font-family:Verdana,Arial,"Bitstream Vera Sans",sans-serif; -} - -.chatboxtitle { - float: left; - font-size:13px; -} - -.chatboxhead { - /*cursor:move !important;*/ -} - +.chatbox { + margin-right: 10px; + width: 225px; + position:fixed; +} + +.chatboxhead { + background-color: #ACC9FD; + padding:7px; + color: #ffffff; + + border-right:1px solid #ACC9FD; + border-left:1px solid #ACC9FD; +} + +.chatboxblink { + /*background-color: #176689;*/ + background-color: #6992FC; + border-right:1px solid #176689; + border-left:1px solid #176689; +} + +.chatboxcontent { + font-family: arial,sans-serif; + font-size: 13px; + color: #333333; + height:200px; + width:209px; + overflow-y:auto; + overflow-x:auto; + padding:7px; + border-left:1px solid #cccccc; + border-right:1px solid #cccccc; + border-bottom:1px solid #eeeeee; + background-color: #ffffff; + line-height: 1.3em; +} + +.chatboxinput { + padding: 5px; + background-color: #ffffff; + border-left:1px solid #cccccc; + border-right:1px solid #cccccc; + border-bottom:1px solid #cccccc; +} + +.chatboxtextarea { + width: 206px; + height:44px; + padding:3px 0pt 3px 3px; + border: 1px solid #0066FF; + margin: 1px; + overflow:hidden; +} + +.chatboxtextareaselected { + border: 2px solid #ACC9FD; + margin:0; +} + +.chatboxmessage { + margin-left:1em; +} + +.chatboxinfo { + margin-left:-1em; + color:#666666; + +} + +.chatboxmessagefrom { + margin-left:-1em; + font-weight: bold; +} + +.chatboxmessagecontent { +} + +.chatboxoptions { + float: right; +} + +.chatboxoptions a { + text-decoration: none; + color: white; + font-weight:bold; + font-family:Verdana,Arial,"Bitstream Vera Sans",sans-serif; +} + +.chatboxtitle { + float: left; + font-size:13px; +} + +.chatboxhead { + /*cursor:move !important;*/ +} + diff --git a/templates/website/ph2date/chat_assets/css/screen.css b/templates/website/ph2date/chat_assets/css/screen.css index 257d45b..b32acc6 100755 --- a/templates/website/ph2date/chat_assets/css/screen.css +++ b/templates/website/ph2date/chat_assets/css/screen.css @@ -1,21 +1,21 @@ -@charset "utf-8"; -/* - * CSS Document - * Written by Ryan Yonzon - * http://ryan.rawswift.com/ - */ - -html, body { - margin:0px; /* FF hack: or we'll have double scrollbar showing on the browser */ - /*overflow:hidden;*/ /* hide browser's main scrollbar */ - -} - -#main_container { - width:100%; - background-color:#ffffff; /* DO NOT REMOVE THIS; or you'll have issue w/ the scrollbar, when the mouse pointer is on a white space */ - overflow-x: hidden; - overflow-y: scroll; - height:100%; /* this will make sure that the height will extend at the bottom */ - position:absolute; /* container div must be absolute, for our fixed bar to work */ +@charset "utf-8"; +/* + * CSS Document + * Written by Ryan Yonzon + * http://ryan.rawswift.com/ + */ + +html, body { + margin:0px; /* FF hack: or we'll have double scrollbar showing on the browser */ + /*overflow:hidden;*/ /* hide browser's main scrollbar */ + +} + +#main_container { + width:100%; + background-color:#ffffff; /* DO NOT REMOVE THIS; or you'll have issue w/ the scrollbar, when the mouse pointer is on a white space */ + overflow-x: hidden; + overflow-y: scroll; + height:100%; /* this will make sure that the height will extend at the bottom */ + position:absolute; /* container div must be absolute, for our fixed bar to work */ } \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/css/screen_ie.css b/templates/website/ph2date/chat_assets/css/screen_ie.css index 5f419d6..ba6498e 100755 --- a/templates/website/ph2date/chat_assets/css/screen_ie.css +++ b/templates/website/ph2date/chat_assets/css/screen_ie.css @@ -1,22 +1,22 @@ -@charset "utf-8"; -/* - * CSS Document - * Written by Ryan Yonzon - * http://ryan.rawswift.com/ - */ - -/* - * IE hack - */ -html, body { - margin:0px; - overflow:hidden; /* hide browser's main scrollbar */ - height:100%; /* make sure we'll use 100% of the page's height */ -} - -#main_container { - width:100%; /* make sure we'll use 100% of page's width */ - background-color:#ffffff; /* DO NOT REMOVE THIS; or you'll have issue w/ the scrollbar, when the mouse pointer is on a white space */ - overflow-x: hidden; - overflow-y: scroll; -} +@charset "utf-8"; +/* + * CSS Document + * Written by Ryan Yonzon + * http://ryan.rawswift.com/ + */ + +/* + * IE hack + */ +html, body { + margin:0px; + overflow:hidden; /* hide browser's main scrollbar */ + height:100%; /* make sure we'll use 100% of the page's height */ +} + +#main_container { + width:100%; /* make sure we'll use 100% of page's width */ + background-color:#ffffff; /* DO NOT REMOVE THIS; or you'll have issue w/ the scrollbar, when the mouse pointer is on a white space */ + overflow-x: hidden; + overflow-y: scroll; +} diff --git a/templates/website/ph2date/chat_assets/js/AC_RunActiveContent.js b/templates/website/ph2date/chat_assets/js/AC_RunActiveContent.js index ffe0732..919218c 100755 --- a/templates/website/ph2date/chat_assets/js/AC_RunActiveContent.js +++ b/templates/website/ph2date/chat_assets/js/AC_RunActiveContent.js @@ -1,293 +1,293 @@ -//v1.7 -// Flash Player Version Detection -// Detect Client Browser type -// Copyright 2005-2007 Adobe Systems Incorporated. All rights reserved. -var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; -var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; -var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; - -function ControlVersion() -{ -var version; -var axo; -var e; - -// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry - -try { -// version will be set for 7.X or greater players -axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); -version = axo.GetVariable("$version"); -} catch (e) { -} - -if (!version) -{ -try { -// version will be set for 6.X players only -axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); - -// installed player is some revision of 6.0 -// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29, -// so we have to be careful. - -// default to the first public version -version = "WIN 6,0,21,0"; - -// throws if AllowScripAccess does not exist (introduced in 6.0r47) -axo.AllowScriptAccess = "always"; - -// safe to call for 6.0r47 or greater -version = axo.GetVariable("$version"); - -} catch (e) { -} -} - -if (!version) -{ -try { -// version will be set for 4.X or 5.X player -axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); -version = axo.GetVariable("$version"); -} catch (e) { -} -} - -if (!version) -{ -try { -// version will be set for 3.X player -axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); -version = "WIN 3,0,18,0"; -} catch (e) { -} -} - -if (!version) -{ -try { -// version will be set for 2.X player -axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); -version = "WIN 2,0,0,11"; -} catch (e) { -version = -1; -} -} - -return version; -} - -// JavaScript helper required to detect Flash Player PlugIn version information -function GetSwfVer(){ -// NS/Opera version >= 3 check for Flash plugin in plugin array -var flashVer = -1; - -if (navigator.plugins != null && navigator.plugins.length > 0) { -if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) { -var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; -var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description; -var descArray = flashDescription.split(" "); -var tempArrayMajor = descArray[2].split("."); -var versionMajor = tempArrayMajor[0]; -var versionMinor = tempArrayMajor[1]; -var versionRevision = descArray[3]; -if (versionRevision == "") { -versionRevision = descArray[4]; -} -if (versionRevision[0] == "d") { -versionRevision = versionRevision.substring(1); -} else if (versionRevision[0] == "r") { -versionRevision = versionRevision.substring(1); -if (versionRevision.indexOf("d") > 0) { - versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")); -} -} -var flashVer = versionMajor + "." + versionMinor + "." + versionRevision; -} -} -// MSN/WebTV 2.6 supports Flash 4 -else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4; -// WebTV 2.5 supports Flash 3 -else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3; -// older WebTV supports Flash 2 -else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; -else if ( isIE && isWin && !isOpera ) { -flashVer = ControlVersion(); -} -return flashVer; -} - -// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available -function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) -{ -versionStr = GetSwfVer(); -if (versionStr == -1 ) { -return false; -} else if (versionStr != 0) { -if(isIE && isWin && !isOpera) { -// Given "WIN 2,0,0,11" -tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"] -tempString = tempArray[1]; // "2,0,0,11" -versionArray = tempString.split(","); // ['2', '0', '0', '11'] -} else { -versionArray = versionStr.split("."); -} -var versionMajor = versionArray[0]; -var versionMinor = versionArray[1]; -var versionRevision = versionArray[2]; - -// is the major.revision >= requested major.revision AND the minor version >= requested minor -if (versionMajor > parseFloat(reqMajorVer)) { -return true; -} else if (versionMajor == parseFloat(reqMajorVer)) { -if (versionMinor > parseFloat(reqMinorVer)) -return true; -else if (versionMinor == parseFloat(reqMinorVer)) { -if (versionRevision >= parseFloat(reqRevision)) - return true; -} -} -return false; -} -} - -function AC_AddExtension(src, ext) -{ -if (src.indexOf('?') != -1) -return src.replace(/\?/, ext+'?'); -else -return src + ext; -} - -function AC_Generateobj(objAttrs, params, embedAttrs) -{ -var str = ''; -if (isIE && isWin && !isOpera) -{ -str += ' '; -} -str += ''; -} -else -{ -str += '= 3 check for Flash plugin in plugin array +var flashVer = -1; + +if (navigator.plugins != null && navigator.plugins.length > 0) { +if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) { +var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; +var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description; +var descArray = flashDescription.split(" "); +var tempArrayMajor = descArray[2].split("."); +var versionMajor = tempArrayMajor[0]; +var versionMinor = tempArrayMajor[1]; +var versionRevision = descArray[3]; +if (versionRevision == "") { +versionRevision = descArray[4]; +} +if (versionRevision[0] == "d") { +versionRevision = versionRevision.substring(1); +} else if (versionRevision[0] == "r") { +versionRevision = versionRevision.substring(1); +if (versionRevision.indexOf("d") > 0) { + versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")); +} +} +var flashVer = versionMajor + "." + versionMinor + "." + versionRevision; +} +} +// MSN/WebTV 2.6 supports Flash 4 +else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4; +// WebTV 2.5 supports Flash 3 +else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3; +// older WebTV supports Flash 2 +else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; +else if ( isIE && isWin && !isOpera ) { +flashVer = ControlVersion(); +} +return flashVer; +} + +// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available +function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) +{ +versionStr = GetSwfVer(); +if (versionStr == -1 ) { +return false; +} else if (versionStr != 0) { +if(isIE && isWin && !isOpera) { +// Given "WIN 2,0,0,11" +tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"] +tempString = tempArray[1]; // "2,0,0,11" +versionArray = tempString.split(","); // ['2', '0', '0', '11'] +} else { +versionArray = versionStr.split("."); +} +var versionMajor = versionArray[0]; +var versionMinor = versionArray[1]; +var versionRevision = versionArray[2]; + +// is the major.revision >= requested major.revision AND the minor version >= requested minor +if (versionMajor > parseFloat(reqMajorVer)) { +return true; +} else if (versionMajor == parseFloat(reqMajorVer)) { +if (versionMinor > parseFloat(reqMinorVer)) +return true; +else if (versionMinor == parseFloat(reqMinorVer)) { +if (versionRevision >= parseFloat(reqRevision)) + return true; +} +} +return false; +} +} + +function AC_AddExtension(src, ext) +{ +if (src.indexOf('?') != -1) +return src.replace(/\?/, ext+'?'); +else +return src + ext; +} + +function AC_Generateobj(objAttrs, params, embedAttrs) +{ +var str = ''; +if (isIE && isWin && !isOpera) +{ +str += ' '; +} +str += ''; +} +else +{ +str += '0)? this.currentTabIndex-1 : this.hottabspositions.length-1 - } - if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function - this.cancelautorun() //stop auto cycling of tabs (if running) - this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]]) - }, - - setpersist:function(bool){ //PUBLIC function to toggle persistence feature - this.enabletabpersistence=bool - }, - - loadajaxpage:function(pageurl){ //PUBLIC function to fetch a page via Ajax and display it within the Tab Content instance's container - ddajaxtabs.connect(pageurl, this) - }, - - loadiframepage:function(pageurl){ //PUBLIC function to fetch a page and load it into the IFRAME of the Tab Content instance's container - this.iframedisplay(pageurl, this.contentdivid) - }, - - setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link") - this.selectedClassTarget=objstr || "link" - }, - - getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to - return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref - }, - - urlparamselect:function(tabinterfaceid){ - var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL - return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index - }, - - onajaxpageload:function(pageurl){ //PUBLIC Event handler that can invoke custom code whenever an Ajax page has been fetched and displayed - //do nothing by default - }, - - expandtab:function(tabref){ - var relattrvalue=tabref.getAttribute("rel") - //Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easy searching through - var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : "" - if (relattrvalue=="#default") - document.getElementById(this.contentdivid).innerHTML=this.defaultHTML - else if (relattrvalue=="#iframe") - this.iframedisplay(tabref.getAttribute("href"), this.contentdivid) - else - ddajaxtabs.connect(tabref.getAttribute("href"), this) - this.expandrevcontent(associatedrevids) - for (var i=0; i500 && this.hottabspositions.length>1){ - this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod) - } - } //END int() function - +//** Ajax Tabs Content script v2.0- Dynamic Drive DHTML code library (http://www.dynamicdrive.com) +//** Updated Oct 21st, 07 to version 2.0. Contains numerous improvements +//** Updated Feb 18th, 08 to version 2.1: Adds a public "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically. Only .js file changed from v2.0. +//** Updated April 8th, 08 to version 2.2: +// -Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0) +// -Modified Ajax routine so testing the script out locally in IE7 now works + +var ddajaxtabssettings={} +ddajaxtabssettings.bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no) +ddajaxtabssettings.loadstatustext=" Requesting content..." + + +////NO NEED TO EDIT BELOW//////////////////////// + +function ddajaxtabs(tabinterfaceid, contentdivid){ + this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container + this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container + this.enabletabpersistence=true + this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container + this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array + this.contentdivid=contentdivid + this.defaultHTML="" + this.defaultIframe='' + this.defaultIframe=this.defaultIframe.replace(/'); - this.iefix = $(this.update.id+'_iefix'); - } - if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); - }, - - fixIEOverlapping: function() { - Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); - this.iefix.style.zIndex = 1; - this.update.style.zIndex = 2; - Element.show(this.iefix); - }, - - hide: function() { - this.stopIndicator(); - if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); - if(this.iefix) Element.hide(this.iefix); - }, - - startIndicator: function() { - if(this.options.indicator) Element.show(this.options.indicator); - }, - - stopIndicator: function() { - if(this.options.indicator) Element.hide(this.options.indicator); - }, - - onKeyPress: function(event) { - if(this.active) - switch(event.keyCode) { - case Event.KEY_TAB: - case Event.KEY_RETURN: - this.selectEntry(); - Event.stop(event); - case Event.KEY_ESC: - this.hide(); - this.active = false; - Event.stop(event); - return; - case Event.KEY_LEFT: - case Event.KEY_RIGHT: - return; - case Event.KEY_UP: - this.markPrevious(); - this.render(); - Event.stop(event); - return; - case Event.KEY_DOWN: - this.markNext(); - this.render(); - Event.stop(event); - return; - } - else - if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || - (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; - - this.changed = true; - this.hasFocus = true; - - if(this.observer) clearTimeout(this.observer); - this.observer = - setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); - }, - - activate: function() { - this.changed = false; - this.hasFocus = true; - this.getUpdatedChoices(); - }, - - onHover: function(event) { - var element = Event.findElement(event, 'LI'); - if(this.index != element.autocompleteIndex) - { - this.index = element.autocompleteIndex; - this.render(); - } - Event.stop(event); - }, - - onClick: function(event) { - var element = Event.findElement(event, 'LI'); - this.index = element.autocompleteIndex; - this.selectEntry(); - this.hide(); - }, - - onBlur: function(event) { - // needed to make click events working - setTimeout(this.hide.bind(this), 250); - this.hasFocus = false; - this.active = false; - }, - - render: function() { - if(this.entryCount > 0) { - for (var i = 0; i < this.entryCount; i++) - this.index==i ? - Element.addClassName(this.getEntry(i),"selected") : - Element.removeClassName(this.getEntry(i),"selected"); - if(this.hasFocus) { - this.show(); - this.active = true; - } - } else { - this.active = false; - this.hide(); - } - }, - - markPrevious: function() { - if(this.index > 0) this.index-- - else this.index = this.entryCount-1; - this.getEntry(this.index).scrollIntoView(true); - }, - - markNext: function() { - if(this.index < this.entryCount-1) this.index++ - else this.index = 0; - this.getEntry(this.index).scrollIntoView(false); - }, - - getEntry: function(index) { - return this.update.firstChild.childNodes[index]; - }, - - getCurrentEntry: function() { - return this.getEntry(this.index); - }, - - selectEntry: function() { - this.active = false; - this.updateElement(this.getCurrentEntry()); - }, - - updateElement: function(selectedElement) { - if (this.options.updateElement) { - this.options.updateElement(selectedElement); - return; - } - var value = ''; - if (this.options.select) { - var nodes = $(selectedElement).select('.' + this.options.select) || []; - if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); - } else - value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); - - var bounds = this.getTokenBounds(); - if (bounds[0] != -1) { - var newValue = this.element.value.substr(0, bounds[0]); - var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); - if (whitespace) - newValue += whitespace[0]; - this.element.value = newValue + value + this.element.value.substr(bounds[1]); - } else { - this.element.value = value; - } - this.oldElementValue = this.element.value; - this.element.focus(); - - if (this.options.afterUpdateElement) - this.options.afterUpdateElement(this.element, selectedElement); - }, - - updateChoices: function(choices) { - if(!this.changed && this.hasFocus) { - this.update.innerHTML = choices; - Element.cleanWhitespace(this.update); - Element.cleanWhitespace(this.update.down()); - - if(this.update.firstChild && this.update.down().childNodes) { - this.entryCount = - this.update.down().childNodes.length; - for (var i = 0; i < this.entryCount; i++) { - var entry = this.getEntry(i); - entry.autocompleteIndex = i; - this.addObservers(entry); - } - } else { - this.entryCount = 0; - } - - this.stopIndicator(); - this.index = 0; - - if(this.entryCount==1 && this.options.autoSelect) { - this.selectEntry(); - this.hide(); - } else { - this.render(); - } - } - }, - - addObservers: function(element) { - Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); - Event.observe(element, "click", this.onClick.bindAsEventListener(this)); - }, - - onObserverEvent: function() { - this.changed = false; - this.tokenBounds = null; - if(this.getToken().length>=this.options.minChars) { - this.getUpdatedChoices(); - } else { - this.active = false; - this.hide(); - } - this.oldElementValue = this.element.value; - }, - - getToken: function() { - var bounds = this.getTokenBounds(); - return this.element.value.substring(bounds[0], bounds[1]).strip(); - }, - - getTokenBounds: function() { - if (null != this.tokenBounds) return this.tokenBounds; - var value = this.element.value; - if (value.strip().empty()) return [-1, 0]; - var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); - var offset = (diff == this.oldElementValue.length ? 1 : 0); - var prevTokenPos = -1, nextTokenPos = value.length; - var tp; - for (var index = 0, l = this.options.tokens.length; index < l; ++index) { - tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); - if (tp > prevTokenPos) prevTokenPos = tp; - tp = value.indexOf(this.options.tokens[index], diff + offset); - if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; - } - return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); - } -}); - -Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { - var boundary = Math.min(newS.length, oldS.length); - for (var index = 0; index < boundary; ++index) - if (newS[index] != oldS[index]) - return index; - return boundary; -}; - -Ajax.Autocompleter = Class.create(Autocompleter.Base, { - initialize: function(element, update, url, options) { - this.baseInitialize(element, update, options); - this.options.asynchronous = true; - this.options.onComplete = this.onComplete.bind(this); - this.options.defaultParams = this.options.parameters || null; - this.url = url; - }, - - getUpdatedChoices: function() { - this.startIndicator(); - - var entry = encodeURIComponent(this.options.paramName) + '=' + - encodeURIComponent(this.getToken()); - - this.options.parameters = this.options.callback ? - this.options.callback(this.element, entry) : entry; - - if(this.options.defaultParams) - this.options.parameters += '&' + this.options.defaultParams; - - new Ajax.Request(this.url, this.options); - }, - - onComplete: function(request) { - this.updateChoices(request.responseText); - } -}); - -// The local array autocompleter. Used when you'd prefer to -// inject an array of autocompletion options into the page, rather -// than sending out Ajax queries, which can be quite slow sometimes. -// -// The constructor takes four parameters. The first two are, as usual, -// the id of the monitored textbox, and id of the autocompletion menu. -// The third is the array you want to autocomplete from, and the fourth -// is the options block. -// -// Extra local autocompletion options: -// - choices - How many autocompletion choices to offer -// -// - partialSearch - If false, the autocompleter will match entered -// text only at the beginning of strings in the -// autocomplete array. Defaults to true, which will -// match text at the beginning of any *word* in the -// strings in the autocomplete array. If you want to -// search anywhere in the string, additionally set -// the option fullSearch to true (default: off). -// -// - fullSsearch - Search anywhere in autocomplete array strings. -// -// - partialChars - How many characters to enter before triggering -// a partial match (unlike minChars, which defines -// how many characters are required to do any match -// at all). Defaults to 2. -// -// - ignoreCase - Whether to ignore case when autocompleting. -// Defaults to true. -// -// It's possible to pass in a custom function as the 'selector' -// option, if you prefer to write your own autocompletion logic. -// In that case, the other options above will not apply unless -// you support them. - -Autocompleter.Local = Class.create(Autocompleter.Base, { - initialize: function(element, update, array, options) { - this.baseInitialize(element, update, options); - this.options.array = array; - }, - - getUpdatedChoices: function() { - this.updateChoices(this.options.selector(this)); - }, - - setOptions: function(options) { - this.options = Object.extend({ - choices: 10, - partialSearch: true, - partialChars: 2, - ignoreCase: true, - fullSearch: false, - selector: function(instance) { - var ret = []; // Beginning matches - var partial = []; // Inside matches - var entry = instance.getToken(); - var count = 0; - - for (var i = 0; i < instance.options.array.length && - ret.length < instance.options.choices ; i++) { - - var elem = instance.options.array[i]; - var foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase()) : - elem.indexOf(entry); - - while (foundPos != -1) { - if (foundPos == 0 && elem.length != entry.length) { - ret.push("
      • " + elem.substr(0, entry.length) + "" + - elem.substr(entry.length) + "
      • "); - break; - } else if (entry.length >= instance.options.partialChars && - instance.options.partialSearch && foundPos != -1) { - if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { - partial.push("
      • " + elem.substr(0, foundPos) + "" + - elem.substr(foundPos, entry.length) + "" + elem.substr( - foundPos + entry.length) + "
      • "); - break; - } - } - - foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : - elem.indexOf(entry, foundPos + 1); - - } - } - if (partial.length) - ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) - return "
          " + ret.join('') + "
        "; - } - }, options || { }); - } -}); - -// AJAX in-place editor and collection editor -// Full rewrite by Christophe Porteneuve (April 2007). - -// Use this if you notice weird scrolling problems on some browsers, -// the DOM might be a bit confused when this gets called so do this -// waits 1 ms (with setTimeout) until it does the activation -Field.scrollFreeActivate = function(field) { - setTimeout(function() { - Field.activate(field); - }, 1); -} - -Ajax.InPlaceEditor = Class.create({ - initialize: function(element, url, options) { - this.url = url; - this.element = element = $(element); - this.prepareOptions(); - this._controls = { }; - arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! - Object.extend(this.options, options || { }); - if (!this.options.formId && this.element.id) { - this.options.formId = this.element.id + '-inplaceeditor'; - if ($(this.options.formId)) - this.options.formId = ''; - } - if (this.options.externalControl) - this.options.externalControl = $(this.options.externalControl); - if (!this.options.externalControl) - this.options.externalControlOnly = false; - this._originalBackground = this.element.getStyle('background-color') || 'transparent'; - this.element.title = this.options.clickToEditText; - this._boundCancelHandler = this.handleFormCancellation.bind(this); - this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); - this._boundFailureHandler = this.handleAJAXFailure.bind(this); - this._boundSubmitHandler = this.handleFormSubmission.bind(this); - this._boundWrapperHandler = this.wrapUp.bind(this); - this.registerListeners(); - }, - checkForEscapeOrReturn: function(e) { - if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; - if (Event.KEY_ESC == e.keyCode) - this.handleFormCancellation(e); - else if (Event.KEY_RETURN == e.keyCode) - this.handleFormSubmission(e); - }, - createControl: function(mode, handler, extraClasses) { - var control = this.options[mode + 'Control']; - var text = this.options[mode + 'Text']; - if ('button' == control) { - var btn = document.createElement('input'); - btn.type = 'submit'; - btn.value = text; - btn.className = 'editor_' + mode + '_button'; - if ('cancel' == mode) - btn.onclick = this._boundCancelHandler; - this._form.appendChild(btn); - this._controls[mode] = btn; - } else if ('link' == control) { - var link = document.createElement('a'); - link.href = '#'; - link.appendChild(document.createTextNode(text)); - link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; - link.className = 'editor_' + mode + '_link'; - if (extraClasses) - link.className += ' ' + extraClasses; - this._form.appendChild(link); - this._controls[mode] = link; - } - }, - createEditField: function() { - var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); - var fld; - if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { - fld = document.createElement('input'); - fld.type = 'text'; - var size = this.options.size || this.options.cols || 0; - if (0 < size) fld.size = size; - } else { - fld = document.createElement('textarea'); - fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); - fld.cols = this.options.cols || 40; - } - fld.name = this.options.paramName; - fld.value = text; // No HTML breaks conversion anymore - fld.className = 'editor_field'; - if (this.options.submitOnBlur) - fld.onblur = this._boundSubmitHandler; - this._controls.editor = fld; - if (this.options.loadTextURL) - this.loadExternalText(); - this._form.appendChild(this._controls.editor); - }, - createForm: function() { - var ipe = this; - function addText(mode, condition) { - var text = ipe.options['text' + mode + 'Controls']; - if (!text || condition === false) return; - ipe._form.appendChild(document.createTextNode(text)); - }; - this._form = $(document.createElement('form')); - this._form.id = this.options.formId; - this._form.addClassName(this.options.formClassName); - this._form.onsubmit = this._boundSubmitHandler; - this.createEditField(); - if ('textarea' == this._controls.editor.tagName.toLowerCase()) - this._form.appendChild(document.createElement('br')); - if (this.options.onFormCustomization) - this.options.onFormCustomization(this, this._form); - addText('Before', this.options.okControl || this.options.cancelControl); - this.createControl('ok', this._boundSubmitHandler); - addText('Between', this.options.okControl && this.options.cancelControl); - this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); - addText('After', this.options.okControl || this.options.cancelControl); - }, - destroy: function() { - if (this._oldInnerHTML) - this.element.innerHTML = this._oldInnerHTML; - this.leaveEditMode(); - this.unregisterListeners(); - }, - enterEditMode: function(e) { - if (this._saving || this._editing) return; - this._editing = true; - this.triggerCallback('onEnterEditMode'); - if (this.options.externalControl) - this.options.externalControl.hide(); - this.element.hide(); - this.createForm(); - this.element.parentNode.insertBefore(this._form, this.element); - if (!this.options.loadTextURL) - this.postProcessEditField(); - if (e) Event.stop(e); - }, - enterHover: function(e) { - if (this.options.hoverClassName) - this.element.addClassName(this.options.hoverClassName); - if (this._saving) return; - this.triggerCallback('onEnterHover'); - }, - getText: function() { - return this.element.innerHTML; - }, - handleAJAXFailure: function(transport) { - this.triggerCallback('onFailure', transport); - if (this._oldInnerHTML) { - this.element.innerHTML = this._oldInnerHTML; - this._oldInnerHTML = null; - } - }, - handleFormCancellation: function(e) { - this.wrapUp(); - if (e) Event.stop(e); - }, - handleFormSubmission: function(e) { - var form = this._form; - var value = $F(this._controls.editor); - this.prepareSubmission(); - var params = this.options.callback(form, value) || ''; - if (Object.isString(params)) - params = params.toQueryParams(); - params.editorId = this.element.id; - if (this.options.htmlResponse) { - var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); - Object.extend(options, { - parameters: params, - onComplete: this._boundWrapperHandler, - onFailure: this._boundFailureHandler - }); - new Ajax.Updater({ success: this.element }, this.url, options); - } else { - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: params, - onComplete: this._boundWrapperHandler, - onFailure: this._boundFailureHandler - }); - new Ajax.Request(this.url, options); - } - if (e) Event.stop(e); - }, - leaveEditMode: function() { - this.element.removeClassName(this.options.savingClassName); - this.removeForm(); - this.leaveHover(); - this.element.style.backgroundColor = this._originalBackground; - this.element.show(); - if (this.options.externalControl) - this.options.externalControl.show(); - this._saving = false; - this._editing = false; - this._oldInnerHTML = null; - this.triggerCallback('onLeaveEditMode'); - }, - leaveHover: function(e) { - if (this.options.hoverClassName) - this.element.removeClassName(this.options.hoverClassName); - if (this._saving) return; - this.triggerCallback('onLeaveHover'); - }, - loadExternalText: function() { - this._form.addClassName(this.options.loadingClassName); - this._controls.editor.disabled = true; - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: 'editorId=' + encodeURIComponent(this.element.id), - onComplete: Prototype.emptyFunction, - onSuccess: function(transport) { - this._form.removeClassName(this.options.loadingClassName); - var text = transport.responseText; - if (this.options.stripLoadedTextTags) - text = text.stripTags(); - this._controls.editor.value = text; - this._controls.editor.disabled = false; - this.postProcessEditField(); - }.bind(this), - onFailure: this._boundFailureHandler - }); - new Ajax.Request(this.options.loadTextURL, options); - }, - postProcessEditField: function() { - var fpc = this.options.fieldPostCreation; - if (fpc) - $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); - }, - prepareOptions: function() { - this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); - Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); - [this._extraDefaultOptions].flatten().compact().each(function(defs) { - Object.extend(this.options, defs); - }.bind(this)); - }, - prepareSubmission: function() { - this._saving = true; - this.removeForm(); - this.leaveHover(); - this.showSaving(); - }, - registerListeners: function() { - this._listeners = { }; - var listener; - $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { - listener = this[pair.value].bind(this); - this._listeners[pair.key] = listener; - if (!this.options.externalControlOnly) - this.element.observe(pair.key, listener); - if (this.options.externalControl) - this.options.externalControl.observe(pair.key, listener); - }.bind(this)); - }, - removeForm: function() { - if (!this._form) return; - this._form.remove(); - this._form = null; - this._controls = { }; - }, - showSaving: function() { - this._oldInnerHTML = this.element.innerHTML; - this.element.innerHTML = this.options.savingText; - this.element.addClassName(this.options.savingClassName); - this.element.style.backgroundColor = this._originalBackground; - this.element.show(); - }, - triggerCallback: function(cbName, arg) { - if ('function' == typeof this.options[cbName]) { - this.options[cbName](this, arg); - } - }, - unregisterListeners: function() { - $H(this._listeners).each(function(pair) { - if (!this.options.externalControlOnly) - this.element.stopObserving(pair.key, pair.value); - if (this.options.externalControl) - this.options.externalControl.stopObserving(pair.key, pair.value); - }.bind(this)); - }, - wrapUp: function(transport) { - this.leaveEditMode(); - // Can't use triggerCallback due to backward compatibility: requires - // binding + direct element - this._boundComplete(transport, this.element); - } -}); - -Object.extend(Ajax.InPlaceEditor.prototype, { - dispose: Ajax.InPlaceEditor.prototype.destroy -}); - -Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { - initialize: function($super, element, url, options) { - this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; - $super(element, url, options); - }, - - createEditField: function() { - var list = document.createElement('select'); - list.name = this.options.paramName; - list.size = 1; - this._controls.editor = list; - this._collection = this.options.collection || []; - if (this.options.loadCollectionURL) - this.loadCollection(); - else - this.checkForExternalText(); - this._form.appendChild(this._controls.editor); - }, - - loadCollection: function() { - this._form.addClassName(this.options.loadingClassName); - this.showLoadingText(this.options.loadingCollectionText); - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: 'editorId=' + encodeURIComponent(this.element.id), - onComplete: Prototype.emptyFunction, - onSuccess: function(transport) { - var js = transport.responseText.strip(); - if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check - throw 'Server returned an invalid collection representation.'; - this._collection = eval(js); - this.checkForExternalText(); - }.bind(this), - onFailure: this.onFailure - }); - new Ajax.Request(this.options.loadCollectionURL, options); - }, - - showLoadingText: function(text) { - this._controls.editor.disabled = true; - var tempOption = this._controls.editor.firstChild; - if (!tempOption) { - tempOption = document.createElement('option'); - tempOption.value = ''; - this._controls.editor.appendChild(tempOption); - tempOption.selected = true; - } - tempOption.update((text || '').stripScripts().stripTags()); - }, - - checkForExternalText: function() { - this._text = this.getText(); - if (this.options.loadTextURL) - this.loadExternalText(); - else - this.buildOptionList(); - }, - - loadExternalText: function() { - this.showLoadingText(this.options.loadingText); - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: 'editorId=' + encodeURIComponent(this.element.id), - onComplete: Prototype.emptyFunction, - onSuccess: function(transport) { - this._text = transport.responseText.strip(); - this.buildOptionList(); - }.bind(this), - onFailure: this.onFailure - }); - new Ajax.Request(this.options.loadTextURL, options); - }, - - buildOptionList: function() { - this._form.removeClassName(this.options.loadingClassName); - this._collection = this._collection.map(function(entry) { - return 2 === entry.length ? entry : [entry, entry].flatten(); - }); - var marker = ('value' in this.options) ? this.options.value : this._text; - var textFound = this._collection.any(function(entry) { - return entry[0] == marker; - }.bind(this)); - this._controls.editor.update(''); - var option; - this._collection.each(function(entry, index) { - option = document.createElement('option'); - option.value = entry[0]; - option.selected = textFound ? entry[0] == marker : 0 == index; - option.appendChild(document.createTextNode(entry[1])); - this._controls.editor.appendChild(option); - }.bind(this)); - this._controls.editor.disabled = false; - Field.scrollFreeActivate(this._controls.editor); - } -}); - -//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** -//**** This only exists for a while, in order to let **** -//**** users adapt to the new API. Read up on the new **** -//**** API and convert your code to it ASAP! **** - -Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { - if (!options) return; - function fallback(name, expr) { - if (name in options || expr === undefined) return; - options[name] = expr; - }; - fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : - options.cancelLink == options.cancelButton == false ? false : undefined))); - fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : - options.okLink == options.okButton == false ? false : undefined))); - fallback('highlightColor', options.highlightcolor); - fallback('highlightEndColor', options.highlightendcolor); -}; - -Object.extend(Ajax.InPlaceEditor, { - DefaultOptions: { - ajaxOptions: { }, - autoRows: 3, // Use when multi-line w/ rows == 1 - cancelControl: 'link', // 'link'|'button'|false - cancelText: 'cancel', - clickToEditText: 'Click to edit', - externalControl: null, // id|elt - externalControlOnly: false, - fieldPostCreation: 'activate', // 'activate'|'focus'|false - formClassName: 'inplaceeditor-form', - formId: null, // id|elt - highlightColor: '#ffff99', - highlightEndColor: '#ffffff', - hoverClassName: '', - htmlResponse: true, - loadingClassName: 'inplaceeditor-loading', - loadingText: 'Loading...', - okControl: 'button', // 'link'|'button'|false - okText: 'ok', - paramName: 'value', - rows: 1, // If 1 and multi-line, uses autoRows - savingClassName: 'inplaceeditor-saving', - savingText: 'Saving...', - size: 0, - stripLoadedTextTags: false, - submitOnBlur: false, - textAfterControls: '', - textBeforeControls: '', - textBetweenControls: '' - }, - DefaultCallbacks: { - callback: function(form) { - return Form.serialize(form); - }, - onComplete: function(transport, element) { - // For backward compatibility, this one is bound to the IPE, and passes - // the element directly. It was too often customized, so we don't break it. - new Effect.Highlight(element, { - startcolor: this.options.highlightColor, keepBackgroundImage: true }); - }, - onEnterEditMode: null, - onEnterHover: function(ipe) { - ipe.element.style.backgroundColor = ipe.options.highlightColor; - if (ipe._effect) - ipe._effect.cancel(); - }, - onFailure: function(transport, ipe) { - alert('Error communication with the server: ' + transport.responseText.stripTags()); - }, - onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. - onLeaveEditMode: null, - onLeaveHover: function(ipe) { - ipe._effect = new Effect.Highlight(ipe.element, { - startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, - restorecolor: ipe._originalBackground, keepBackgroundImage: true - }); - } - }, - Listeners: { - click: 'enterEditMode', - keydown: 'checkForEscapeOrReturn', - mouseover: 'enterHover', - mouseout: 'leaveHover' - } -}); - -Ajax.InPlaceCollectionEditor.DefaultOptions = { - loadingCollectionText: 'Loading options...' -}; - -// Delayed observer, like Form.Element.Observer, -// but waits for delay after last key input -// Ideal for live-search fields - -Form.Element.DelayedObserver = Class.create({ - initialize: function(element, delay, callback) { - this.delay = delay || 0.5; - this.element = $(element); - this.callback = callback; - this.timer = null; - this.lastValue = $F(this.element); - Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); - }, - delayedListener: function(event) { - if(this.lastValue == $F(this.element)) return; - if(this.timer) clearTimeout(this.timer); - this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); - this.lastValue = $F(this.element); - }, - onTimerEvent: function() { - this.timer = null; - this.callback(this.element, $F(this.element)); - } -}); +// script.aculo.us controls.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 + +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan) +// (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) +// Contributors: +// Richard Livsey +// Rahul Bhargava +// Rob Wills +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// Autocompleter.Base handles all the autocompletion functionality +// that's independent of the data source for autocompletion. This +// includes drawing the autocompletion menu, observing keyboard +// and mouse events, and similar. +// +// Specific autocompleters need to provide, at the very least, +// a getUpdatedChoices function that will be invoked every time +// the text inside the monitored textbox changes. This method +// should get the text for which to provide autocompletion by +// invoking this.getToken(), NOT by directly accessing +// this.element.value. This is to allow incremental tokenized +// autocompletion. Specific auto-completion logic (AJAX, etc) +// belongs in getUpdatedChoices. +// +// Tokenized incremental autocompletion is enabled automatically +// when an autocompleter is instantiated with the 'tokens' option +// in the options parameter, e.g.: +// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); +// will incrementally autocomplete with a comma as the token. +// Additionally, ',' in the above example can be replaced with +// a token array, e.g. { tokens: [',', '\n'] } which +// enables autocompletion on multiple tokens. This is most +// useful when one of the tokens is \n (a newline), as it +// allows smart autocompletion after linebreaks. + +if(typeof Effect == 'undefined') + throw("controls.js requires including script.aculo.us' effects.js library"); + +var Autocompleter = { } +Autocompleter.Base = Class.create({ + baseInitialize: function(element, update, options) { + element = $(element) + this.element = element; + this.update = $(update); + this.hasFocus = false; + this.changed = false; + this.active = false; + this.index = 0; + this.entryCount = 0; + this.oldElementValue = this.element.value; + + if(this.setOptions) + this.setOptions(options); + else + this.options = options || { }; + + this.options.paramName = this.options.paramName || this.element.name; + this.options.tokens = this.options.tokens || []; + this.options.frequency = this.options.frequency || 0.4; + this.options.minChars = this.options.minChars || 1; + this.options.onShow = this.options.onShow || + function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, { + setHeight: false, + offsetTop: element.offsetHeight + }); + } + Effect.Appear(update,{duration:0.15}); + }; + this.options.onHide = this.options.onHide || + function(element, update){ new Effect.Fade(update,{duration:0.15}) }; + + if(typeof(this.options.tokens) == 'string') + this.options.tokens = new Array(this.options.tokens); + // Force carriage returns as token delimiters anyway + if (!this.options.tokens.include('\n')) + this.options.tokens.push('\n'); + + this.observer = null; + + this.element.setAttribute('autocomplete','off'); + + Element.hide(this.update); + + Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this)); + Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this)); + }, + + show: function() { + if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); + if(!this.iefix && + (Prototype.Browser.IE) && + (Element.getStyle(this.update, 'position')=='absolute')) { + new Insertion.After(this.update, + ''); + this.iefix = $(this.update.id+'_iefix'); + } + if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); + }, + + fixIEOverlapping: function() { + Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); + this.iefix.style.zIndex = 1; + this.update.style.zIndex = 2; + Element.show(this.iefix); + }, + + hide: function() { + this.stopIndicator(); + if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); + if(this.iefix) Element.hide(this.iefix); + }, + + startIndicator: function() { + if(this.options.indicator) Element.show(this.options.indicator); + }, + + stopIndicator: function() { + if(this.options.indicator) Element.hide(this.options.indicator); + }, + + onKeyPress: function(event) { + if(this.active) + switch(event.keyCode) { + case Event.KEY_TAB: + case Event.KEY_RETURN: + this.selectEntry(); + Event.stop(event); + case Event.KEY_ESC: + this.hide(); + this.active = false; + Event.stop(event); + return; + case Event.KEY_LEFT: + case Event.KEY_RIGHT: + return; + case Event.KEY_UP: + this.markPrevious(); + this.render(); + Event.stop(event); + return; + case Event.KEY_DOWN: + this.markNext(); + this.render(); + Event.stop(event); + return; + } + else + if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || + (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; + + this.changed = true; + this.hasFocus = true; + + if(this.observer) clearTimeout(this.observer); + this.observer = + setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); + }, + + activate: function() { + this.changed = false; + this.hasFocus = true; + this.getUpdatedChoices(); + }, + + onHover: function(event) { + var element = Event.findElement(event, 'LI'); + if(this.index != element.autocompleteIndex) + { + this.index = element.autocompleteIndex; + this.render(); + } + Event.stop(event); + }, + + onClick: function(event) { + var element = Event.findElement(event, 'LI'); + this.index = element.autocompleteIndex; + this.selectEntry(); + this.hide(); + }, + + onBlur: function(event) { + // needed to make click events working + setTimeout(this.hide.bind(this), 250); + this.hasFocus = false; + this.active = false; + }, + + render: function() { + if(this.entryCount > 0) { + for (var i = 0; i < this.entryCount; i++) + this.index==i ? + Element.addClassName(this.getEntry(i),"selected") : + Element.removeClassName(this.getEntry(i),"selected"); + if(this.hasFocus) { + this.show(); + this.active = true; + } + } else { + this.active = false; + this.hide(); + } + }, + + markPrevious: function() { + if(this.index > 0) this.index-- + else this.index = this.entryCount-1; + this.getEntry(this.index).scrollIntoView(true); + }, + + markNext: function() { + if(this.index < this.entryCount-1) this.index++ + else this.index = 0; + this.getEntry(this.index).scrollIntoView(false); + }, + + getEntry: function(index) { + return this.update.firstChild.childNodes[index]; + }, + + getCurrentEntry: function() { + return this.getEntry(this.index); + }, + + selectEntry: function() { + this.active = false; + this.updateElement(this.getCurrentEntry()); + }, + + updateElement: function(selectedElement) { + if (this.options.updateElement) { + this.options.updateElement(selectedElement); + return; + } + var value = ''; + if (this.options.select) { + var nodes = $(selectedElement).select('.' + this.options.select) || []; + if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); + } else + value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); + + var bounds = this.getTokenBounds(); + if (bounds[0] != -1) { + var newValue = this.element.value.substr(0, bounds[0]); + var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); + if (whitespace) + newValue += whitespace[0]; + this.element.value = newValue + value + this.element.value.substr(bounds[1]); + } else { + this.element.value = value; + } + this.oldElementValue = this.element.value; + this.element.focus(); + + if (this.options.afterUpdateElement) + this.options.afterUpdateElement(this.element, selectedElement); + }, + + updateChoices: function(choices) { + if(!this.changed && this.hasFocus) { + this.update.innerHTML = choices; + Element.cleanWhitespace(this.update); + Element.cleanWhitespace(this.update.down()); + + if(this.update.firstChild && this.update.down().childNodes) { + this.entryCount = + this.update.down().childNodes.length; + for (var i = 0; i < this.entryCount; i++) { + var entry = this.getEntry(i); + entry.autocompleteIndex = i; + this.addObservers(entry); + } + } else { + this.entryCount = 0; + } + + this.stopIndicator(); + this.index = 0; + + if(this.entryCount==1 && this.options.autoSelect) { + this.selectEntry(); + this.hide(); + } else { + this.render(); + } + } + }, + + addObservers: function(element) { + Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); + Event.observe(element, "click", this.onClick.bindAsEventListener(this)); + }, + + onObserverEvent: function() { + this.changed = false; + this.tokenBounds = null; + if(this.getToken().length>=this.options.minChars) { + this.getUpdatedChoices(); + } else { + this.active = false; + this.hide(); + } + this.oldElementValue = this.element.value; + }, + + getToken: function() { + var bounds = this.getTokenBounds(); + return this.element.value.substring(bounds[0], bounds[1]).strip(); + }, + + getTokenBounds: function() { + if (null != this.tokenBounds) return this.tokenBounds; + var value = this.element.value; + if (value.strip().empty()) return [-1, 0]; + var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); + var offset = (diff == this.oldElementValue.length ? 1 : 0); + var prevTokenPos = -1, nextTokenPos = value.length; + var tp; + for (var index = 0, l = this.options.tokens.length; index < l; ++index) { + tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); + if (tp > prevTokenPos) prevTokenPos = tp; + tp = value.indexOf(this.options.tokens[index], diff + offset); + if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; + } + return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); + } +}); + +Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { + var boundary = Math.min(newS.length, oldS.length); + for (var index = 0; index < boundary; ++index) + if (newS[index] != oldS[index]) + return index; + return boundary; +}; + +Ajax.Autocompleter = Class.create(Autocompleter.Base, { + initialize: function(element, update, url, options) { + this.baseInitialize(element, update, options); + this.options.asynchronous = true; + this.options.onComplete = this.onComplete.bind(this); + this.options.defaultParams = this.options.parameters || null; + this.url = url; + }, + + getUpdatedChoices: function() { + this.startIndicator(); + + var entry = encodeURIComponent(this.options.paramName) + '=' + + encodeURIComponent(this.getToken()); + + this.options.parameters = this.options.callback ? + this.options.callback(this.element, entry) : entry; + + if(this.options.defaultParams) + this.options.parameters += '&' + this.options.defaultParams; + + new Ajax.Request(this.url, this.options); + }, + + onComplete: function(request) { + this.updateChoices(request.responseText); + } +}); + +// The local array autocompleter. Used when you'd prefer to +// inject an array of autocompletion options into the page, rather +// than sending out Ajax queries, which can be quite slow sometimes. +// +// The constructor takes four parameters. The first two are, as usual, +// the id of the monitored textbox, and id of the autocompletion menu. +// The third is the array you want to autocomplete from, and the fourth +// is the options block. +// +// Extra local autocompletion options: +// - choices - How many autocompletion choices to offer +// +// - partialSearch - If false, the autocompleter will match entered +// text only at the beginning of strings in the +// autocomplete array. Defaults to true, which will +// match text at the beginning of any *word* in the +// strings in the autocomplete array. If you want to +// search anywhere in the string, additionally set +// the option fullSearch to true (default: off). +// +// - fullSsearch - Search anywhere in autocomplete array strings. +// +// - partialChars - How many characters to enter before triggering +// a partial match (unlike minChars, which defines +// how many characters are required to do any match +// at all). Defaults to 2. +// +// - ignoreCase - Whether to ignore case when autocompleting. +// Defaults to true. +// +// It's possible to pass in a custom function as the 'selector' +// option, if you prefer to write your own autocompletion logic. +// In that case, the other options above will not apply unless +// you support them. + +Autocompleter.Local = Class.create(Autocompleter.Base, { + initialize: function(element, update, array, options) { + this.baseInitialize(element, update, options); + this.options.array = array; + }, + + getUpdatedChoices: function() { + this.updateChoices(this.options.selector(this)); + }, + + setOptions: function(options) { + this.options = Object.extend({ + choices: 10, + partialSearch: true, + partialChars: 2, + ignoreCase: true, + fullSearch: false, + selector: function(instance) { + var ret = []; // Beginning matches + var partial = []; // Inside matches + var entry = instance.getToken(); + var count = 0; + + for (var i = 0; i < instance.options.array.length && + ret.length < instance.options.choices ; i++) { + + var elem = instance.options.array[i]; + var foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase()) : + elem.indexOf(entry); + + while (foundPos != -1) { + if (foundPos == 0 && elem.length != entry.length) { + ret.push("
      • " + elem.substr(0, entry.length) + "" + + elem.substr(entry.length) + "
      • "); + break; + } else if (entry.length >= instance.options.partialChars && + instance.options.partialSearch && foundPos != -1) { + if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { + partial.push("
      • " + elem.substr(0, foundPos) + "" + + elem.substr(foundPos, entry.length) + "" + elem.substr( + foundPos + entry.length) + "
      • "); + break; + } + } + + foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : + elem.indexOf(entry, foundPos + 1); + + } + } + if (partial.length) + ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) + return "
          " + ret.join('') + "
        "; + } + }, options || { }); + } +}); + +// AJAX in-place editor and collection editor +// Full rewrite by Christophe Porteneuve (April 2007). + +// Use this if you notice weird scrolling problems on some browsers, +// the DOM might be a bit confused when this gets called so do this +// waits 1 ms (with setTimeout) until it does the activation +Field.scrollFreeActivate = function(field) { + setTimeout(function() { + Field.activate(field); + }, 1); +} + +Ajax.InPlaceEditor = Class.create({ + initialize: function(element, url, options) { + this.url = url; + this.element = element = $(element); + this.prepareOptions(); + this._controls = { }; + arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! + Object.extend(this.options, options || { }); + if (!this.options.formId && this.element.id) { + this.options.formId = this.element.id + '-inplaceeditor'; + if ($(this.options.formId)) + this.options.formId = ''; + } + if (this.options.externalControl) + this.options.externalControl = $(this.options.externalControl); + if (!this.options.externalControl) + this.options.externalControlOnly = false; + this._originalBackground = this.element.getStyle('background-color') || 'transparent'; + this.element.title = this.options.clickToEditText; + this._boundCancelHandler = this.handleFormCancellation.bind(this); + this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); + this._boundFailureHandler = this.handleAJAXFailure.bind(this); + this._boundSubmitHandler = this.handleFormSubmission.bind(this); + this._boundWrapperHandler = this.wrapUp.bind(this); + this.registerListeners(); + }, + checkForEscapeOrReturn: function(e) { + if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; + if (Event.KEY_ESC == e.keyCode) + this.handleFormCancellation(e); + else if (Event.KEY_RETURN == e.keyCode) + this.handleFormSubmission(e); + }, + createControl: function(mode, handler, extraClasses) { + var control = this.options[mode + 'Control']; + var text = this.options[mode + 'Text']; + if ('button' == control) { + var btn = document.createElement('input'); + btn.type = 'submit'; + btn.value = text; + btn.className = 'editor_' + mode + '_button'; + if ('cancel' == mode) + btn.onclick = this._boundCancelHandler; + this._form.appendChild(btn); + this._controls[mode] = btn; + } else if ('link' == control) { + var link = document.createElement('a'); + link.href = '#'; + link.appendChild(document.createTextNode(text)); + link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; + link.className = 'editor_' + mode + '_link'; + if (extraClasses) + link.className += ' ' + extraClasses; + this._form.appendChild(link); + this._controls[mode] = link; + } + }, + createEditField: function() { + var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); + var fld; + if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { + fld = document.createElement('input'); + fld.type = 'text'; + var size = this.options.size || this.options.cols || 0; + if (0 < size) fld.size = size; + } else { + fld = document.createElement('textarea'); + fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); + fld.cols = this.options.cols || 40; + } + fld.name = this.options.paramName; + fld.value = text; // No HTML breaks conversion anymore + fld.className = 'editor_field'; + if (this.options.submitOnBlur) + fld.onblur = this._boundSubmitHandler; + this._controls.editor = fld; + if (this.options.loadTextURL) + this.loadExternalText(); + this._form.appendChild(this._controls.editor); + }, + createForm: function() { + var ipe = this; + function addText(mode, condition) { + var text = ipe.options['text' + mode + 'Controls']; + if (!text || condition === false) return; + ipe._form.appendChild(document.createTextNode(text)); + }; + this._form = $(document.createElement('form')); + this._form.id = this.options.formId; + this._form.addClassName(this.options.formClassName); + this._form.onsubmit = this._boundSubmitHandler; + this.createEditField(); + if ('textarea' == this._controls.editor.tagName.toLowerCase()) + this._form.appendChild(document.createElement('br')); + if (this.options.onFormCustomization) + this.options.onFormCustomization(this, this._form); + addText('Before', this.options.okControl || this.options.cancelControl); + this.createControl('ok', this._boundSubmitHandler); + addText('Between', this.options.okControl && this.options.cancelControl); + this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); + addText('After', this.options.okControl || this.options.cancelControl); + }, + destroy: function() { + if (this._oldInnerHTML) + this.element.innerHTML = this._oldInnerHTML; + this.leaveEditMode(); + this.unregisterListeners(); + }, + enterEditMode: function(e) { + if (this._saving || this._editing) return; + this._editing = true; + this.triggerCallback('onEnterEditMode'); + if (this.options.externalControl) + this.options.externalControl.hide(); + this.element.hide(); + this.createForm(); + this.element.parentNode.insertBefore(this._form, this.element); + if (!this.options.loadTextURL) + this.postProcessEditField(); + if (e) Event.stop(e); + }, + enterHover: function(e) { + if (this.options.hoverClassName) + this.element.addClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onEnterHover'); + }, + getText: function() { + return this.element.innerHTML; + }, + handleAJAXFailure: function(transport) { + this.triggerCallback('onFailure', transport); + if (this._oldInnerHTML) { + this.element.innerHTML = this._oldInnerHTML; + this._oldInnerHTML = null; + } + }, + handleFormCancellation: function(e) { + this.wrapUp(); + if (e) Event.stop(e); + }, + handleFormSubmission: function(e) { + var form = this._form; + var value = $F(this._controls.editor); + this.prepareSubmission(); + var params = this.options.callback(form, value) || ''; + if (Object.isString(params)) + params = params.toQueryParams(); + params.editorId = this.element.id; + if (this.options.htmlResponse) { + var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Updater({ success: this.element }, this.url, options); + } else { + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.url, options); + } + if (e) Event.stop(e); + }, + leaveEditMode: function() { + this.element.removeClassName(this.options.savingClassName); + this.removeForm(); + this.leaveHover(); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + if (this.options.externalControl) + this.options.externalControl.show(); + this._saving = false; + this._editing = false; + this._oldInnerHTML = null; + this.triggerCallback('onLeaveEditMode'); + }, + leaveHover: function(e) { + if (this.options.hoverClassName) + this.element.removeClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onLeaveHover'); + }, + loadExternalText: function() { + this._form.addClassName(this.options.loadingClassName); + this._controls.editor.disabled = true; + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._form.removeClassName(this.options.loadingClassName); + var text = transport.responseText; + if (this.options.stripLoadedTextTags) + text = text.stripTags(); + this._controls.editor.value = text; + this._controls.editor.disabled = false; + this.postProcessEditField(); + }.bind(this), + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + postProcessEditField: function() { + var fpc = this.options.fieldPostCreation; + if (fpc) + $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); + }, + prepareOptions: function() { + this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); + Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); + [this._extraDefaultOptions].flatten().compact().each(function(defs) { + Object.extend(this.options, defs); + }.bind(this)); + }, + prepareSubmission: function() { + this._saving = true; + this.removeForm(); + this.leaveHover(); + this.showSaving(); + }, + registerListeners: function() { + this._listeners = { }; + var listener; + $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { + listener = this[pair.value].bind(this); + this._listeners[pair.key] = listener; + if (!this.options.externalControlOnly) + this.element.observe(pair.key, listener); + if (this.options.externalControl) + this.options.externalControl.observe(pair.key, listener); + }.bind(this)); + }, + removeForm: function() { + if (!this._form) return; + this._form.remove(); + this._form = null; + this._controls = { }; + }, + showSaving: function() { + this._oldInnerHTML = this.element.innerHTML; + this.element.innerHTML = this.options.savingText; + this.element.addClassName(this.options.savingClassName); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + }, + triggerCallback: function(cbName, arg) { + if ('function' == typeof this.options[cbName]) { + this.options[cbName](this, arg); + } + }, + unregisterListeners: function() { + $H(this._listeners).each(function(pair) { + if (!this.options.externalControlOnly) + this.element.stopObserving(pair.key, pair.value); + if (this.options.externalControl) + this.options.externalControl.stopObserving(pair.key, pair.value); + }.bind(this)); + }, + wrapUp: function(transport) { + this.leaveEditMode(); + // Can't use triggerCallback due to backward compatibility: requires + // binding + direct element + this._boundComplete(transport, this.element); + } +}); + +Object.extend(Ajax.InPlaceEditor.prototype, { + dispose: Ajax.InPlaceEditor.prototype.destroy +}); + +Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { + initialize: function($super, element, url, options) { + this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; + $super(element, url, options); + }, + + createEditField: function() { + var list = document.createElement('select'); + list.name = this.options.paramName; + list.size = 1; + this._controls.editor = list; + this._collection = this.options.collection || []; + if (this.options.loadCollectionURL) + this.loadCollection(); + else + this.checkForExternalText(); + this._form.appendChild(this._controls.editor); + }, + + loadCollection: function() { + this._form.addClassName(this.options.loadingClassName); + this.showLoadingText(this.options.loadingCollectionText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + var js = transport.responseText.strip(); + if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check + throw 'Server returned an invalid collection representation.'; + this._collection = eval(js); + this.checkForExternalText(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadCollectionURL, options); + }, + + showLoadingText: function(text) { + this._controls.editor.disabled = true; + var tempOption = this._controls.editor.firstChild; + if (!tempOption) { + tempOption = document.createElement('option'); + tempOption.value = ''; + this._controls.editor.appendChild(tempOption); + tempOption.selected = true; + } + tempOption.update((text || '').stripScripts().stripTags()); + }, + + checkForExternalText: function() { + this._text = this.getText(); + if (this.options.loadTextURL) + this.loadExternalText(); + else + this.buildOptionList(); + }, + + loadExternalText: function() { + this.showLoadingText(this.options.loadingText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._text = transport.responseText.strip(); + this.buildOptionList(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + + buildOptionList: function() { + this._form.removeClassName(this.options.loadingClassName); + this._collection = this._collection.map(function(entry) { + return 2 === entry.length ? entry : [entry, entry].flatten(); + }); + var marker = ('value' in this.options) ? this.options.value : this._text; + var textFound = this._collection.any(function(entry) { + return entry[0] == marker; + }.bind(this)); + this._controls.editor.update(''); + var option; + this._collection.each(function(entry, index) { + option = document.createElement('option'); + option.value = entry[0]; + option.selected = textFound ? entry[0] == marker : 0 == index; + option.appendChild(document.createTextNode(entry[1])); + this._controls.editor.appendChild(option); + }.bind(this)); + this._controls.editor.disabled = false; + Field.scrollFreeActivate(this._controls.editor); + } +}); + +//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** +//**** This only exists for a while, in order to let **** +//**** users adapt to the new API. Read up on the new **** +//**** API and convert your code to it ASAP! **** + +Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { + if (!options) return; + function fallback(name, expr) { + if (name in options || expr === undefined) return; + options[name] = expr; + }; + fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : + options.cancelLink == options.cancelButton == false ? false : undefined))); + fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : + options.okLink == options.okButton == false ? false : undefined))); + fallback('highlightColor', options.highlightcolor); + fallback('highlightEndColor', options.highlightendcolor); +}; + +Object.extend(Ajax.InPlaceEditor, { + DefaultOptions: { + ajaxOptions: { }, + autoRows: 3, // Use when multi-line w/ rows == 1 + cancelControl: 'link', // 'link'|'button'|false + cancelText: 'cancel', + clickToEditText: 'Click to edit', + externalControl: null, // id|elt + externalControlOnly: false, + fieldPostCreation: 'activate', // 'activate'|'focus'|false + formClassName: 'inplaceeditor-form', + formId: null, // id|elt + highlightColor: '#ffff99', + highlightEndColor: '#ffffff', + hoverClassName: '', + htmlResponse: true, + loadingClassName: 'inplaceeditor-loading', + loadingText: 'Loading...', + okControl: 'button', // 'link'|'button'|false + okText: 'ok', + paramName: 'value', + rows: 1, // If 1 and multi-line, uses autoRows + savingClassName: 'inplaceeditor-saving', + savingText: 'Saving...', + size: 0, + stripLoadedTextTags: false, + submitOnBlur: false, + textAfterControls: '', + textBeforeControls: '', + textBetweenControls: '' + }, + DefaultCallbacks: { + callback: function(form) { + return Form.serialize(form); + }, + onComplete: function(transport, element) { + // For backward compatibility, this one is bound to the IPE, and passes + // the element directly. It was too often customized, so we don't break it. + new Effect.Highlight(element, { + startcolor: this.options.highlightColor, keepBackgroundImage: true }); + }, + onEnterEditMode: null, + onEnterHover: function(ipe) { + ipe.element.style.backgroundColor = ipe.options.highlightColor; + if (ipe._effect) + ipe._effect.cancel(); + }, + onFailure: function(transport, ipe) { + alert('Error communication with the server: ' + transport.responseText.stripTags()); + }, + onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. + onLeaveEditMode: null, + onLeaveHover: function(ipe) { + ipe._effect = new Effect.Highlight(ipe.element, { + startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, + restorecolor: ipe._originalBackground, keepBackgroundImage: true + }); + } + }, + Listeners: { + click: 'enterEditMode', + keydown: 'checkForEscapeOrReturn', + mouseover: 'enterHover', + mouseout: 'leaveHover' + } +}); + +Ajax.InPlaceCollectionEditor.DefaultOptions = { + loadingCollectionText: 'Loading options...' +}; + +// Delayed observer, like Form.Element.Observer, +// but waits for delay after last key input +// Ideal for live-search fields + +Form.Element.DelayedObserver = Class.create({ + initialize: function(element, delay, callback) { + this.delay = delay || 0.5; + this.element = $(element); + this.callback = callback; + this.timer = null; + this.lastValue = $F(this.element); + Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); + }, + delayedListener: function(event) { + if(this.lastValue == $F(this.element)) return; + if(this.timer) clearTimeout(this.timer); + this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); + this.lastValue = $F(this.element); + }, + onTimerEvent: function() { + this.timer = null; + this.callback(this.element, $F(this.element)); + } +}); diff --git a/templates/website/ph2date/chat_assets/js/cross_framing_protection.js b/templates/website/ph2date/chat_assets/js/cross_framing_protection.js index 4afa476..2b6dcc8 100755 --- a/templates/website/ph2date/chat_assets/js/cross_framing_protection.js +++ b/templates/website/ph2date/chat_assets/js/cross_framing_protection.js @@ -1 +1 @@ -try{var topdomain=top.document.domain;if(topdomain!=self.document.domain){alert("Redirecting...");top.location.replace(self.document.URL.substring(0,self.document.URL.lastIndexOf("/")+1))}}catch(e$$5){alert("Redirecting... (error: "+e$$5);top.location.replace(self.document.URL.substring(0,self.document.URL.lastIndexOf("/")+1))}; +try{var topdomain=top.document.domain;if(topdomain!=self.document.domain){alert("Redirecting...");top.location.replace(self.document.URL.substring(0,self.document.URL.lastIndexOf("/")+1))}}catch(e$$5){alert("Redirecting... (error: "+e$$5);top.location.replace(self.document.URL.substring(0,self.document.URL.lastIndexOf("/")+1))}; diff --git a/templates/website/ph2date/chat_assets/js/db_operations.js b/templates/website/ph2date/chat_assets/js/db_operations.js index 4476ccd..ff62905 100755 --- a/templates/website/ph2date/chat_assets/js/db_operations.js +++ b/templates/website/ph2date/chat_assets/js/db_operations.js @@ -1,4 +1,4 @@ -$(document).ready(function(){$("#rename_db_form.ajax").live("submit",function(a){a.preventDefault();a=$(this);var d=escapeHtml("CREATE DATABASE "+$("#new_db_name").val()+" / DROP DATABASE "+window.parent.db);PMA_prepareForAjaxRequest(a);var b={};b[PMA_messages.strYes]=function(){$(this).dialog("close").remove();window.parent.refreshMain();window.parent.refreshNavigation()};b[PMA_messages.strNo]=function(){$(this).dialog("close").remove()};a.PMA_confirm(d,a.attr("action"),function(e){PMA_ajaxShowMessage(PMA_messages.strRenamingDatabases); -$.get(e,$("#rename_db_form").serialize()+"&is_js_confirmed=1",function(c){if(c.success==true){PMA_ajaxShowMessage(c.message);window.parent.db=c.newname;$("#topmenucontainer").next("div").remove().end().after(c.sql_query);c=$("#topmenucontainer").next("div").find(".notice");c.text()==""&&c.remove();$(""+PMA_messages.strReloadDatabase+"?").dialog({buttons:b})}else PMA_ajaxShowMessage(c.error)})})});$("#copy_db_form.ajax").live("submit",function(a){a.preventDefault();var d=PMA_ajaxShowMessage(PMA_messages.strCopyingDatabase); -a=$(this);PMA_prepareForAjaxRequest(a);$.get(a.attr("action"),a.serialize(),function(b){$(".success").fadeOut();$(".error").fadeOut();if(b.success==true){$("#topmenucontainer").after(b.message);if($("#checkbox_switch").is(":checked")){window.parent.db=b.newname;window.parent.refreshMain();window.parent.refreshNavigation()}else window.parent.refreshNavigation(true)}else $("#topmenucontainer").after(b.error);PMA_ajaxRemoveMessage(d)})});$("#change_db_charset_form.ajax").live("submit",function(a){a.preventDefault(); -a=$(this);PMA_prepareForAjaxRequest(a);PMA_ajaxShowMessage(PMA_messages.strChangingCharset);$.get(a.attr("action"),a.serialize()+"&submitcollation="+a.find("input[name=submitcollation]").attr("value"),function(d){d.success==true?PMA_ajaxShowMessage(d.message):PMA_ajaxShowMessage(d.error)})})},"top.frame_content"); +$(document).ready(function(){$("#rename_db_form.ajax").live("submit",function(a){a.preventDefault();a=$(this);var d=escapeHtml("CREATE DATABASE "+$("#new_db_name").val()+" / DROP DATABASE "+window.parent.db);PMA_prepareForAjaxRequest(a);var b={};b[PMA_messages.strYes]=function(){$(this).dialog("close").remove();window.parent.refreshMain();window.parent.refreshNavigation()};b[PMA_messages.strNo]=function(){$(this).dialog("close").remove()};a.PMA_confirm(d,a.attr("action"),function(e){PMA_ajaxShowMessage(PMA_messages.strRenamingDatabases); +$.get(e,$("#rename_db_form").serialize()+"&is_js_confirmed=1",function(c){if(c.success==true){PMA_ajaxShowMessage(c.message);window.parent.db=c.newname;$("#topmenucontainer").next("div").remove().end().after(c.sql_query);c=$("#topmenucontainer").next("div").find(".notice");c.text()==""&&c.remove();$(""+PMA_messages.strReloadDatabase+"?").dialog({buttons:b})}else PMA_ajaxShowMessage(c.error)})})});$("#copy_db_form.ajax").live("submit",function(a){a.preventDefault();var d=PMA_ajaxShowMessage(PMA_messages.strCopyingDatabase); +a=$(this);PMA_prepareForAjaxRequest(a);$.get(a.attr("action"),a.serialize(),function(b){$(".success").fadeOut();$(".error").fadeOut();if(b.success==true){$("#topmenucontainer").after(b.message);if($("#checkbox_switch").is(":checked")){window.parent.db=b.newname;window.parent.refreshMain();window.parent.refreshNavigation()}else window.parent.refreshNavigation(true)}else $("#topmenucontainer").after(b.error);PMA_ajaxRemoveMessage(d)})});$("#change_db_charset_form.ajax").live("submit",function(a){a.preventDefault(); +a=$(this);PMA_prepareForAjaxRequest(a);PMA_ajaxShowMessage(PMA_messages.strChangingCharset);$.get(a.attr("action"),a.serialize()+"&submitcollation="+a.find("input[name=submitcollation]").attr("value"),function(d){d.success==true?PMA_ajaxShowMessage(d.message):PMA_ajaxShowMessage(d.error)})})},"top.frame_content"); diff --git a/templates/website/ph2date/chat_assets/js/db_search.js b/templates/website/ph2date/chat_assets/js/db_search.js index 3804781..1dbd1ec 100755 --- a/templates/website/ph2date/chat_assets/js/db_search.js +++ b/templates/website/ph2date/chat_assets/js/db_search.js @@ -1,6 +1,6 @@ -function loadResult(a,c,b,d){$(document).ready(function(){if(d){$("#sqlqueryform").hide();$("#togglequerybox").hide();$("#table-info").show();$("#table-link").attr({href:"sql.php?"+b}).text(c);$("#browse-results").load(a+" '#sqlqueryresults'").show()}else event.preventDefault()})} -function deleteResult(a,c,b){$(document).ready(function(){$("#table-info").hide();$("#browse-results").hide();$("#sqlqueryform").hide();$("#togglequerybox").hide();if(confirm(c))if(b){var d=PMA_ajaxShowMessage(PMA_messages.strDeleting);$("#browse-results").load(a+" '#result_query'",function(){$("#sqlqueryform").load(a+" '#sqlqueryform'",function(){document.getElementById("buttonGo").click();$("#togglequerybox").html(PMA_messages.strHideQueryBox);PMA_ajaxRemoveMessage(d);$("#browse-results").show(); -$("#sqlqueryform").show();$("#togglequerybox").show()})})}else event.preventDefault()})} -$(document).ready(function(){$.ajaxSetup({cache:"false"});$("#table-info").prepend('').hide();$("#buttonGo").click(function(){$("#table-info").hide();$("#browse-results").hide();$("#sqlqueryform").hide();$("#togglequerybox").hide()});$('
        ').insertAfter("#db_search_form").hide();$("#togglequerybox").hide();$("#togglequerybox").bind("click",function(){var a=$(this);$("#sqlqueryform").slideToggle("medium"); -a.text()==PMA_messages.strHideQueryBox?a.text(PMA_messages.strShowQueryBox):a.text(PMA_messages.strHideQueryBox);return false});$("#togglesearchformlink").html(PMA_messages.strShowSearchCriteria).bind("click",function(){var a=$(this);$("#db_search_form").slideToggle();a.text()==PMA_messages.strHideSearchCriteria?a.text(PMA_messages.strShowSearchCriteria):a.text(PMA_messages.strHideSearchCriteria);return false});$("#db_search_form.ajax").live("submit",function(a){a.preventDefault();var c=PMA_ajaxShowMessage(PMA_messages.strSearching); -$form=$(this);PMA_prepareForAjaxRequest($form);$.post($form.attr("action"),$form.serialize()+"&submit_search="+$("#buttonGo").val(),function(b){if(typeof b=="string"){$("#searchresults").html(b);$("#sqlqueryresults").trigger("appendAnchor");$("#db_search_form").slideToggle().hide();$("#togglesearchformlink").text(PMA_messages.strShowSearchCriteria);$("#togglesearchformdiv").show()}else $("#sqlqueryresults").html(b.message);PMA_ajaxRemoveMessage(c)})})},"top.frame_content"); +function loadResult(a,c,b,d){$(document).ready(function(){if(d){$("#sqlqueryform").hide();$("#togglequerybox").hide();$("#table-info").show();$("#table-link").attr({href:"sql.php?"+b}).text(c);$("#browse-results").load(a+" '#sqlqueryresults'").show()}else event.preventDefault()})} +function deleteResult(a,c,b){$(document).ready(function(){$("#table-info").hide();$("#browse-results").hide();$("#sqlqueryform").hide();$("#togglequerybox").hide();if(confirm(c))if(b){var d=PMA_ajaxShowMessage(PMA_messages.strDeleting);$("#browse-results").load(a+" '#result_query'",function(){$("#sqlqueryform").load(a+" '#sqlqueryform'",function(){document.getElementById("buttonGo").click();$("#togglequerybox").html(PMA_messages.strHideQueryBox);PMA_ajaxRemoveMessage(d);$("#browse-results").show(); +$("#sqlqueryform").show();$("#togglequerybox").show()})})}else event.preventDefault()})} +$(document).ready(function(){$.ajaxSetup({cache:"false"});$("#table-info").prepend('').hide();$("#buttonGo").click(function(){$("#table-info").hide();$("#browse-results").hide();$("#sqlqueryform").hide();$("#togglequerybox").hide()});$('
        ').insertAfter("#db_search_form").hide();$("#togglequerybox").hide();$("#togglequerybox").bind("click",function(){var a=$(this);$("#sqlqueryform").slideToggle("medium"); +a.text()==PMA_messages.strHideQueryBox?a.text(PMA_messages.strShowQueryBox):a.text(PMA_messages.strHideQueryBox);return false});$("#togglesearchformlink").html(PMA_messages.strShowSearchCriteria).bind("click",function(){var a=$(this);$("#db_search_form").slideToggle();a.text()==PMA_messages.strHideSearchCriteria?a.text(PMA_messages.strShowSearchCriteria):a.text(PMA_messages.strHideSearchCriteria);return false});$("#db_search_form.ajax").live("submit",function(a){a.preventDefault();var c=PMA_ajaxShowMessage(PMA_messages.strSearching); +$form=$(this);PMA_prepareForAjaxRequest($form);$.post($form.attr("action"),$form.serialize()+"&submit_search="+$("#buttonGo").val(),function(b){if(typeof b=="string"){$("#searchresults").html(b);$("#sqlqueryresults").trigger("appendAnchor");$("#db_search_form").slideToggle().hide();$("#togglesearchformlink").text(PMA_messages.strShowSearchCriteria);$("#togglesearchformdiv").show()}else $("#sqlqueryresults").html(b.message);PMA_ajaxRemoveMessage(c)})})},"top.frame_content"); diff --git a/templates/website/ph2date/chat_assets/js/db_structure.js b/templates/website/ph2date/chat_assets/js/db_structure.js index 477e2a7..06a2ea8 100755 --- a/templates/website/ph2date/chat_assets/js/db_structure.js +++ b/templates/website/ph2date/chat_assets/js/db_structure.js @@ -1,7 +1,7 @@ -function PMA_adjustTotals(a){var b=a.closest("tr");a=b.find(".tbl_rows");var d=b.find(".tbl_size");b=parseInt(a.text());a.text("0");d.text("-");if(!isNaN(b)){$total_rows_td=$("#tbl_summary_row").find(".tbl_rows");a=parseInt($total_rows_td.text());isNaN(a)||$total_rows_td.text(a-b)}a=$("#tbl_summary_row").find(".tbl_size");a.text(a.text().replace(/^/,"~"))} -$(document).ready(function(){$(".truncate_table_anchor").live("click",function(a){a.preventDefault();var b=$(this);a="TRUNCATE "+b.parents("tr").children("th").children("a").text();b.PMA_confirm(a,b.attr("href"),function(d){PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);$.get(d,{is_js_confirmed:1,ajax_request:true},function(c){if(c.success==true){PMA_ajaxShowMessage(c.message);c=b.html().replace(/b_empty.png/,"bd_empty.png");PMA_adjustTotals(b);b.replaceWith(c).removeClass("truncate_table_anchor")}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+ -" : "+c.error)})})});$(".drop_table_anchor").live("click",function(a){a.preventDefault();var b=$(this),d=b.parents("tr");a="DROP TABLE "+d.children("th").children("a").text();b.PMA_confirm(a,b.attr("href"),function(c){PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);$.get(c,{is_js_confirmed:1,ajax_request:true},function(e){if(e.success==true){PMA_ajaxShowMessage(e.message);PMA_adjustTotals(b);d.hide("medium").remove();window.parent&&window.parent.frame_navigation&&window.parent.frame_navigation.location.reload()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+ -" : "+e.error)})})});$(".drop_event_anchor").live("click",function(a){a.preventDefault();var b=$(this).parents("tr");a="DROP EVENT "+$(b).children("td:first").text();$(this).PMA_confirm(a,$(this).attr("href"),function(d){PMA_ajaxShowMessage(PMA_messages.strDroppingEvent);$.get(d,{is_js_confirmed:1,ajax_request:true},function(c){if(c.success==true){PMA_ajaxShowMessage(c.message);$(b).hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+c.error)})})});$(".drop_procedure_anchor").live("click", -function(a){a.preventDefault();a=$(this).parents("tr");a=$(a).children("td").children(".drop_procedure_sql").val();$(this).PMA_confirm(a,$(this).attr("href"),function(b){PMA_ajaxShowMessage(PMA_messages.strDroppingProcedure);$.get(b,{is_js_confirmed:1,ajax_request:true},function(d){if(d.success==true){PMA_ajaxShowMessage(d.message);$(curr_event_row).hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+d.error)})})});$(".drop_tracking_anchor").live("click", -function(a){a.preventDefault();a=$(this);var b=a.parents("tr");a.PMA_confirm(PMA_messages.strDeleteTrackingData,a.attr("href"),function(d){PMA_ajaxShowMessage(PMA_messages.strDeletingTrackingData);$.get(d,{is_js_confirmed:1,ajax_request:true},function(c){if(c.success==true){PMA_ajaxShowMessage(c.message);$(b).hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+c.error)})})});$("#real_end_input").live("click",function(a){a.preventDefault();a=PMA_messages.strOperationTakesLongTime; -$(this).PMA_confirm(a,"",function(){return true});return false})},"top.frame_content"); +function PMA_adjustTotals(a){var b=a.closest("tr");a=b.find(".tbl_rows");var d=b.find(".tbl_size");b=parseInt(a.text());a.text("0");d.text("-");if(!isNaN(b)){$total_rows_td=$("#tbl_summary_row").find(".tbl_rows");a=parseInt($total_rows_td.text());isNaN(a)||$total_rows_td.text(a-b)}a=$("#tbl_summary_row").find(".tbl_size");a.text(a.text().replace(/^/,"~"))} +$(document).ready(function(){$(".truncate_table_anchor").live("click",function(a){a.preventDefault();var b=$(this);a="TRUNCATE "+b.parents("tr").children("th").children("a").text();b.PMA_confirm(a,b.attr("href"),function(d){PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);$.get(d,{is_js_confirmed:1,ajax_request:true},function(c){if(c.success==true){PMA_ajaxShowMessage(c.message);c=b.html().replace(/b_empty.png/,"bd_empty.png");PMA_adjustTotals(b);b.replaceWith(c).removeClass("truncate_table_anchor")}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+ +" : "+c.error)})})});$(".drop_table_anchor").live("click",function(a){a.preventDefault();var b=$(this),d=b.parents("tr");a="DROP TABLE "+d.children("th").children("a").text();b.PMA_confirm(a,b.attr("href"),function(c){PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);$.get(c,{is_js_confirmed:1,ajax_request:true},function(e){if(e.success==true){PMA_ajaxShowMessage(e.message);PMA_adjustTotals(b);d.hide("medium").remove();window.parent&&window.parent.frame_navigation&&window.parent.frame_navigation.location.reload()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+ +" : "+e.error)})})});$(".drop_event_anchor").live("click",function(a){a.preventDefault();var b=$(this).parents("tr");a="DROP EVENT "+$(b).children("td:first").text();$(this).PMA_confirm(a,$(this).attr("href"),function(d){PMA_ajaxShowMessage(PMA_messages.strDroppingEvent);$.get(d,{is_js_confirmed:1,ajax_request:true},function(c){if(c.success==true){PMA_ajaxShowMessage(c.message);$(b).hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+c.error)})})});$(".drop_procedure_anchor").live("click", +function(a){a.preventDefault();a=$(this).parents("tr");a=$(a).children("td").children(".drop_procedure_sql").val();$(this).PMA_confirm(a,$(this).attr("href"),function(b){PMA_ajaxShowMessage(PMA_messages.strDroppingProcedure);$.get(b,{is_js_confirmed:1,ajax_request:true},function(d){if(d.success==true){PMA_ajaxShowMessage(d.message);$(curr_event_row).hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+d.error)})})});$(".drop_tracking_anchor").live("click", +function(a){a.preventDefault();a=$(this);var b=a.parents("tr");a.PMA_confirm(PMA_messages.strDeleteTrackingData,a.attr("href"),function(d){PMA_ajaxShowMessage(PMA_messages.strDeletingTrackingData);$.get(d,{is_js_confirmed:1,ajax_request:true},function(c){if(c.success==true){PMA_ajaxShowMessage(c.message);$(b).hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+c.error)})})});$("#real_end_input").live("click",function(a){a.preventDefault();a=PMA_messages.strOperationTakesLongTime; +$(this).PMA_confirm(a,"",function(){return true});return false})},"top.frame_content"); diff --git a/templates/website/ph2date/chat_assets/js/demo.js b/templates/website/ph2date/chat_assets/js/demo.js index 1bb0618..2a06ad7 100755 --- a/templates/website/ph2date/chat_assets/js/demo.js +++ b/templates/website/ph2date/chat_assets/js/demo.js @@ -1,49 +1,49 @@ -/*! - * Scripts for the demo pages on the jScrollPane website. - * - * You do not need to include this script or use it on your site. - * - * Copyright (c) 2010 Kelvin Luck - * Dual licensed under the MIT and GPL licenses. - */ - -$(function() -{ - // Copy the pages javascript sourcecode to the display block on the page for easy viewing... - var sourcecodeDisplay = $('#sourcecode-display'); - if (sourcecodeDisplay.length) { - sourcecodeDisplay.empty().append( - $('').append( - $('
        ').html(
        -					$('#sourcecode').html().replace(/\n\t\t\t/gm, '\n').replace('>', '>').replace('<', '<')
        -				)
        -			)
        -		);
        -		$('#css-display').empty().append(
        -			$('').append(
        -				$('
        ').html(
        -					$('#page-css').html().replace(/\n\t\t\t/gm, '\n')
        -				)
        -			)
        -		);
        -	}
        -});
        -
        -// It seems some people copy this file and put it on their sites despite the message at the top
        -// So let's make sure they don't end up in my stats...
        -if (window.location.hostname == 'jscrollpane.kelvinluck.com') { 
        -	// Google analytics tracking code for demo site 
        -	var _gaq = _gaq || [];
        -	_gaq.push(['_setAccount', 'UA-17828883-1']);
        -	_gaq.push(['_trackPageview']);
        -	
        -	(function() {
        -		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        -		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        -		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        -	})();
        -} else if(window.location.protocol == 'file:') {
        -	// Allow local testing without annoying alerts
        -} else {
        -	alert('Do not include demo.js on your site!');
        -}
        +/*!
        + * Scripts for the demo pages on the jScrollPane website.
        + *
        + * You do not need to include this script or use it on your site.
        + *
        + * Copyright (c) 2010 Kelvin Luck
        + * Dual licensed under the MIT and GPL licenses.
        + */
        +
        +$(function()
        +{
        +    // Copy the pages javascript sourcecode to the display block on the page for easy viewing...
        +    var sourcecodeDisplay = $('#sourcecode-display');
        +    if (sourcecodeDisplay.length) {
        +        sourcecodeDisplay.empty().append(
        +            $('').append(
        +                $('
        ').html(
        +                    $('#sourcecode').html().replace(/\n\t\t\t/gm, '\n').replace('>', '>').replace('<', '<')
        +                )
        +            )
        +        );
        +        $('#css-display').empty().append(
        +            $('').append(
        +                $('
        ').html(
        +                    $('#page-css').html().replace(/\n\t\t\t/gm, '\n')
        +                )
        +            )
        +        );
        +    }
        +});
        +
        +// It seems some people copy this file and put it on their sites despite the message at the top
        +// So let's make sure they don't end up in my stats...
        +if (window.location.hostname == 'jscrollpane.kelvinluck.com') {
        +    // Google analytics tracking code for demo site
        +    var _gaq = _gaq || [];
        +    _gaq.push(['_setAccount', 'UA-17828883-1']);
        +    _gaq.push(['_trackPageview']);
        +
        +    (function() {
        +        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        +        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        +        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        +    })();
        +} else if(window.location.protocol == 'file:') {
        +    // Allow local testing without annoying alerts
        +} else {
        +    alert('Do not include demo.js on your site!');
        +}
        diff --git a/templates/website/ph2date/chat_assets/js/dom-drag.js b/templates/website/ph2date/chat_assets/js/dom-drag.js
        index 8fd10fa..a9dbfbc 100755
        --- a/templates/website/ph2date/chat_assets/js/dom-drag.js
        +++ b/templates/website/ph2date/chat_assets/js/dom-drag.js
        @@ -1,6 +1,6 @@
        -var Drag={obj:null,init:function(b,a,c,d,g,e,f,j,h,i){b.onmousedown=Drag.start;b.hmode=f?false:true;b.vmode=j?false:true;b.root=a&&a!=null?a:b;if(b.hmode&&isNaN(parseInt(b.root.style.left)))b.root.style.left="0px";if(b.vmode&&isNaN(parseInt(b.root.style.top)))b.root.style.top="0px";if(!b.hmode&&isNaN(parseInt(b.root.style.right)))b.root.style.right="0px";if(!b.vmode&&isNaN(parseInt(b.root.style.bottom)))b.root.style.bottom="0px";b.minX=typeof c!="undefined"?c:null;b.minY=typeof g!="undefined"?g:null;
        -b.maxX=typeof d!="undefined"?d:null;b.maxY=typeof e!="undefined"?e:null;b.xMapper=h?h:null;b.yMapper=i?i:null;b.root.onDragStart=new Function;b.root.onDragEnd=new Function;b.root.onDrag=new Function},start:function(b){var a=Drag.obj=this;b=Drag.fixE(b);var c=parseInt(a.vmode?a.root.style.top:a.root.style.bottom),d=parseInt(a.hmode?a.root.style.left:a.root.style.right);a.root.onDragStart(d,c);a.lastMouseX=b.clientX;a.lastMouseY=b.clientY;if(a.hmode){if(a.minX!=null)a.minMouseX=b.clientX-d+a.minX;if(a.maxX!=
        -null)a.maxMouseX=a.minMouseX+a.maxX-a.minX}else{if(a.minX!=null)a.maxMouseX=-a.minX+b.clientX+d;if(a.maxX!=null)a.minMouseX=-a.maxX+b.clientX+d}if(a.vmode){if(a.minY!=null)a.minMouseY=b.clientY-c+a.minY;if(a.maxY!=null)a.maxMouseY=a.minMouseY+a.maxY-a.minY}else{if(a.minY!=null)a.maxMouseY=-a.minY+b.clientY+c;if(a.maxY!=null)a.minMouseY=-a.maxY+b.clientY+c}document.onmousemove=Drag.drag;document.onmouseup=Drag.end;return false},drag:function(b){b=Drag.fixE(b);var a=Drag.obj,c=b.clientY;b=b.clientX;
        -var d=parseInt(a.vmode?a.root.style.top:a.root.style.bottom),g=parseInt(a.hmode?a.root.style.left:a.root.style.right),e,f;if(a.minX!=null)b=a.hmode?Math.max(b,a.minMouseX):Math.min(b,a.maxMouseX);if(a.maxX!=null)b=a.hmode?Math.min(b,a.maxMouseX):Math.max(b,a.minMouseX);if(a.minY!=null)c=a.vmode?Math.max(c,a.minMouseY):Math.min(c,a.maxMouseY);if(a.maxY!=null)c=a.vmode?Math.min(c,a.maxMouseY):Math.max(c,a.minMouseY);e=g+(b-a.lastMouseX)*(a.hmode?1:-1);f=d+(c-a.lastMouseY)*(a.vmode?1:-1);if(a.xMapper)e=
        -a.xMapper(d);else if(a.yMapper)f=a.yMapper(g);Drag.obj.root.style[a.hmode?"left":"right"]=e+"px";Drag.obj.root.style[a.vmode?"top":"bottom"]=f+"px";Drag.obj.lastMouseX=b;Drag.obj.lastMouseY=c;Drag.obj.root.onDrag(e,f);return false},end:function(){document.onmousemove=null;document.onmouseup=null;Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style[Drag.obj.hmode?"left":"right"]),parseInt(Drag.obj.root.style[Drag.obj.vmode?"top":"bottom"]));Drag.obj=null},fixE:function(b){if(typeof b=="undefined")b=
        -window.event;if(typeof b.layerX=="undefined")b.layerX=b.offsetX;if(typeof b.layerY=="undefined")b.layerY=b.offsetY;return b}};
        +var Drag={obj:null,init:function(b,a,c,d,g,e,f,j,h,i){b.onmousedown=Drag.start;b.hmode=f?false:true;b.vmode=j?false:true;b.root=a&&a!=null?a:b;if(b.hmode&&isNaN(parseInt(b.root.style.left)))b.root.style.left="0px";if(b.vmode&&isNaN(parseInt(b.root.style.top)))b.root.style.top="0px";if(!b.hmode&&isNaN(parseInt(b.root.style.right)))b.root.style.right="0px";if(!b.vmode&&isNaN(parseInt(b.root.style.bottom)))b.root.style.bottom="0px";b.minX=typeof c!="undefined"?c:null;b.minY=typeof g!="undefined"?g:null;
        +b.maxX=typeof d!="undefined"?d:null;b.maxY=typeof e!="undefined"?e:null;b.xMapper=h?h:null;b.yMapper=i?i:null;b.root.onDragStart=new Function;b.root.onDragEnd=new Function;b.root.onDrag=new Function},start:function(b){var a=Drag.obj=this;b=Drag.fixE(b);var c=parseInt(a.vmode?a.root.style.top:a.root.style.bottom),d=parseInt(a.hmode?a.root.style.left:a.root.style.right);a.root.onDragStart(d,c);a.lastMouseX=b.clientX;a.lastMouseY=b.clientY;if(a.hmode){if(a.minX!=null)a.minMouseX=b.clientX-d+a.minX;if(a.maxX!=
        +null)a.maxMouseX=a.minMouseX+a.maxX-a.minX}else{if(a.minX!=null)a.maxMouseX=-a.minX+b.clientX+d;if(a.maxX!=null)a.minMouseX=-a.maxX+b.clientX+d}if(a.vmode){if(a.minY!=null)a.minMouseY=b.clientY-c+a.minY;if(a.maxY!=null)a.maxMouseY=a.minMouseY+a.maxY-a.minY}else{if(a.minY!=null)a.maxMouseY=-a.minY+b.clientY+c;if(a.maxY!=null)a.minMouseY=-a.maxY+b.clientY+c}document.onmousemove=Drag.drag;document.onmouseup=Drag.end;return false},drag:function(b){b=Drag.fixE(b);var a=Drag.obj,c=b.clientY;b=b.clientX;
        +var d=parseInt(a.vmode?a.root.style.top:a.root.style.bottom),g=parseInt(a.hmode?a.root.style.left:a.root.style.right),e,f;if(a.minX!=null)b=a.hmode?Math.max(b,a.minMouseX):Math.min(b,a.maxMouseX);if(a.maxX!=null)b=a.hmode?Math.min(b,a.maxMouseX):Math.max(b,a.minMouseX);if(a.minY!=null)c=a.vmode?Math.max(c,a.minMouseY):Math.min(c,a.maxMouseY);if(a.maxY!=null)c=a.vmode?Math.min(c,a.maxMouseY):Math.max(c,a.minMouseY);e=g+(b-a.lastMouseX)*(a.hmode?1:-1);f=d+(c-a.lastMouseY)*(a.vmode?1:-1);if(a.xMapper)e=
        +a.xMapper(d);else if(a.yMapper)f=a.yMapper(g);Drag.obj.root.style[a.hmode?"left":"right"]=e+"px";Drag.obj.root.style[a.vmode?"top":"bottom"]=f+"px";Drag.obj.lastMouseX=b;Drag.obj.lastMouseY=c;Drag.obj.root.onDrag(e,f);return false},end:function(){document.onmousemove=null;document.onmouseup=null;Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style[Drag.obj.hmode?"left":"right"]),parseInt(Drag.obj.root.style[Drag.obj.vmode?"top":"bottom"]));Drag.obj=null},fixE:function(b){if(typeof b=="undefined")b=
        +window.event;if(typeof b.layerX=="undefined")b.layerX=b.offsetX;if(typeof b.layerY=="undefined")b.layerY=b.offsetY;return b}};
        diff --git a/templates/website/ph2date/chat_assets/js/dragdrop.js b/templates/website/ph2date/chat_assets/js/dragdrop.js
        index a2bdf09..4281ea3 100755
        --- a/templates/website/ph2date/chat_assets/js/dragdrop.js
        +++ b/templates/website/ph2date/chat_assets/js/dragdrop.js
        @@ -1,974 +1,974 @@
        -// script.aculo.us dragdrop.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
        -
        -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
        -//           (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
        -// 
        -// script.aculo.us is freely distributable under the terms of an MIT-style license.
        -// For details, see the script.aculo.us web site: http://script.aculo.us/
        -
        -if(Object.isUndefined(Effect))
        -  throw("dragdrop.js requires including script.aculo.us' effects.js library");
        -
        -var Droppables = {
        -  drops: [],
        -
        -  remove: function(element) {
        -    this.drops = this.drops.reject(function(d) { return d.element==$(element) });
        -  },
        -
        -  add: function(element) {
        -    element = $(element);
        -    var options = Object.extend({
        -      greedy:     true,
        -      hoverclass: null,
        -      tree:       false
        -    }, arguments[1] || { });
        -
        -    // cache containers
        -    if(options.containment) {
        -      options._containers = [];
        -      var containment = options.containment;
        -      if(Object.isArray(containment)) {
        -        containment.each( function(c) { options._containers.push($(c)) });
        -      } else {
        -        options._containers.push($(containment));
        -      }
        -    }
        -    
        -    if(options.accept) options.accept = [options.accept].flatten();
        -
        -    Element.makePositioned(element); // fix IE
        -    options.element = element;
        -
        -    this.drops.push(options);
        -  },
        -  
        -  findDeepestChild: function(drops) {
        -    deepest = drops[0];
        -      
        -    for (i = 1; i < drops.length; ++i)
        -      if (Element.isParent(drops[i].element, deepest.element))
        -        deepest = drops[i];
        -    
        -    return deepest;
        -  },
        -
        -  isContained: function(element, drop) {
        -    var containmentNode;
        -    if(drop.tree) {
        -      containmentNode = element.treeNode; 
        -    } else {
        -      containmentNode = element.parentNode;
        -    }
        -    return drop._containers.detect(function(c) { return containmentNode == c });
        -  },
        -  
        -  isAffected: function(point, element, drop) {
        -    return (
        -      (drop.element!=element) &&
        -      ((!drop._containers) ||
        -        this.isContained(element, drop)) &&
        -      ((!drop.accept) ||
        -        (Element.classNames(element).detect( 
        -          function(v) { return drop.accept.include(v) } ) )) &&
        -      Position.within(drop.element, point[0], point[1]) );
        -  },
        -
        -  deactivate: function(drop) {
        -    if(drop.hoverclass)
        -      Element.removeClassName(drop.element, drop.hoverclass);
        -    this.last_active = null;
        -  },
        -
        -  activate: function(drop) {
        -    if(drop.hoverclass)
        -      Element.addClassName(drop.element, drop.hoverclass);
        -    this.last_active = drop;
        -  },
        -
        -  show: function(point, element) {
        -    if(!this.drops.length) return;
        -    var drop, affected = [];
        -    
        -    this.drops.each( function(drop) {
        -      if(Droppables.isAffected(point, element, drop))
        -        affected.push(drop);
        -    });
        -        
        -    if(affected.length>0)
        -      drop = Droppables.findDeepestChild(affected);
        -
        -    if(this.last_active && this.last_active != drop) this.deactivate(this.last_active);
        -    if (drop) {
        -      Position.within(drop.element, point[0], point[1]);
        -      if(drop.onHover)
        -        drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
        -      
        -      if (drop != this.last_active) Droppables.activate(drop);
        -    }
        -  },
        -
        -  fire: function(event, element) {
        -    if(!this.last_active) return;
        -    Position.prepare();
        -
        -    if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
        -      if (this.last_active.onDrop) {
        -        this.last_active.onDrop(element, this.last_active.element, event); 
        -        return true; 
        -      }
        -  },
        -
        -  reset: function() {
        -    if(this.last_active)
        -      this.deactivate(this.last_active);
        -  }
        -}
        -
        -var Draggables = {
        -  drags: [],
        -  observers: [],
        -  
        -  register: function(draggable) {
        -    if(this.drags.length == 0) {
        -      this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
        -      this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
        -      this.eventKeypress  = this.keyPress.bindAsEventListener(this);
        -      
        -      Event.observe(document, "mouseup", this.eventMouseUp);
        -      Event.observe(document, "mousemove", this.eventMouseMove);
        -      Event.observe(document, "keypress", this.eventKeypress);
        -    }
        -    this.drags.push(draggable);
        -  },
        -  
        -  unregister: function(draggable) {
        -    this.drags = this.drags.reject(function(d) { return d==draggable });
        -    if(this.drags.length == 0) {
        -      Event.stopObserving(document, "mouseup", this.eventMouseUp);
        -      Event.stopObserving(document, "mousemove", this.eventMouseMove);
        -      Event.stopObserving(document, "keypress", this.eventKeypress);
        -    }
        -  },
        -  
        -  activate: function(draggable) {
        -    if(draggable.options.delay) { 
        -      this._timeout = setTimeout(function() { 
        -        Draggables._timeout = null; 
        -        window.focus(); 
        -        Draggables.activeDraggable = draggable; 
        -      }.bind(this), draggable.options.delay); 
        -    } else {
        -      window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
        -      this.activeDraggable = draggable;
        -    }
        -  },
        -  
        -  deactivate: function() {
        -    this.activeDraggable = null;
        -  },
        -  
        -  updateDrag: function(event) {
        -    if(!this.activeDraggable) return;
        -    var pointer = [Event.pointerX(event), Event.pointerY(event)];
        -    // Mozilla-based browsers fire successive mousemove events with
        -    // the same coordinates, prevent needless redrawing (moz bug?)
        -    if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
        -    this._lastPointer = pointer;
        -    
        -    this.activeDraggable.updateDrag(event, pointer);
        -  },
        -  
        -  endDrag: function(event) {
        -    if(this._timeout) { 
        -      clearTimeout(this._timeout); 
        -      this._timeout = null; 
        -    }
        -    if(!this.activeDraggable) return;
        -    this._lastPointer = null;
        -    this.activeDraggable.endDrag(event);
        -    this.activeDraggable = null;
        -  },
        -  
        -  keyPress: function(event) {
        -    if(this.activeDraggable)
        -      this.activeDraggable.keyPress(event);
        -  },
        -  
        -  addObserver: function(observer) {
        -    this.observers.push(observer);
        -    this._cacheObserverCallbacks();
        -  },
        -  
        -  removeObserver: function(element) {  // element instead of observer fixes mem leaks
        -    this.observers = this.observers.reject( function(o) { return o.element==element });
        -    this._cacheObserverCallbacks();
        -  },
        -  
        -  notify: function(eventName, draggable, event) {  // 'onStart', 'onEnd', 'onDrag'
        -    if(this[eventName+'Count'] > 0)
        -      this.observers.each( function(o) {
        -        if(o[eventName]) o[eventName](eventName, draggable, event);
        -      });
        -    if(draggable.options[eventName]) draggable.options[eventName](draggable, event);
        -  },
        -  
        -  _cacheObserverCallbacks: function() {
        -    ['onStart','onEnd','onDrag'].each( function(eventName) {
        -      Draggables[eventName+'Count'] = Draggables.observers.select(
        -        function(o) { return o[eventName]; }
        -      ).length;
        -    });
        -  }
        -}
        -
        -/*--------------------------------------------------------------------------*/
        -
        -var Draggable = Class.create({
        -  initialize: function(element) {
        -    var defaults = {
        -      handle: false,
        -      reverteffect: function(element, top_offset, left_offset) {
        -        var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
        -        new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur,
        -          queue: {scope:'_draggable', position:'end'}
        -        });
        -      },
        -      endeffect: function(element) {
        -        var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0;
        -        new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, 
        -          queue: {scope:'_draggable', position:'end'},
        -          afterFinish: function(){ 
        -            Draggable._dragging[element] = false 
        -          }
        -        }); 
        -      },
        -      zindex: 1000,
        -      revert: false,
        -      quiet: false,
        -      scroll: false,
        -      scrollSensitivity: 20,
        -      scrollSpeed: 15,
        -      snap: false,  // false, or xy or [x,y] or function(x,y){ return [x,y] }
        -      delay: 0
        -    };
        -    
        -    if(!arguments[1] || Object.isUndefined(arguments[1].endeffect))
        -      Object.extend(defaults, {
        -        starteffect: function(element) {
        -          element._opacity = Element.getOpacity(element);
        -          Draggable._dragging[element] = true;
        -          new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); 
        -        }
        -      });
        -    
        -    var options = Object.extend(defaults, arguments[1] || { });
        -
        -    this.element = $(element);
        -    
        -    if(options.handle && Object.isString(options.handle))
        -      this.handle = this.element.down('.'+options.handle, 0);
        -    
        -    if(!this.handle) this.handle = $(options.handle);
        -    if(!this.handle) this.handle = this.element;
        -    
        -    if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
        -      options.scroll = $(options.scroll);
        -      this._isScrollChild = Element.childOf(this.element, options.scroll);
        -    }
        -
        -    Element.makePositioned(this.element); // fix IE    
        -
        -    this.options  = options;
        -    this.dragging = false;   
        -
        -    this.eventMouseDown = this.initDrag.bindAsEventListener(this);
        -    Event.observe(this.handle, "mousedown", this.eventMouseDown);
        -    
        -    Draggables.register(this);
        -  },
        -  
        -  destroy: function() {
        -    Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
        -    Draggables.unregister(this);
        -  },
        -  
        -  currentDelta: function() {
        -    return([
        -      parseInt(Element.getStyle(this.element,'left') || '0'),
        -      parseInt(Element.getStyle(this.element,'top') || '0')]);
        -  },
        -  
        -  initDrag: function(event) {
        -    if(!Object.isUndefined(Draggable._dragging[this.element]) &&
        -      Draggable._dragging[this.element]) return;
        -    if(Event.isLeftClick(event)) {    
        -      // abort on form elements, fixes a Firefox issue
        -      var src = Event.element(event);
        -      if((tag_name = src.tagName.toUpperCase()) && (
        -        tag_name=='INPUT' ||
        -        tag_name=='SELECT' ||
        -        tag_name=='OPTION' ||
        -        tag_name=='BUTTON' ||
        -        tag_name=='TEXTAREA')) return;
        -        
        -      var pointer = [Event.pointerX(event), Event.pointerY(event)];
        -      var pos     = Position.cumulativeOffset(this.element);
        -      this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
        -      
        -      Draggables.activate(this);
        -      Event.stop(event);
        -    }
        -  },
        -  
        -  startDrag: function(event) {
        -    this.dragging = true;
        -    if(!this.delta)
        -      this.delta = this.currentDelta();
        -    
        -    if(this.options.zindex) {
        -      this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
        -      this.element.style.zIndex = this.options.zindex;
        -    }
        -    
        -    if(this.options.ghosting) {
        -      this._clone = this.element.cloneNode(true);
        -      this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
        -      if (!this.element._originallyAbsolute)
        -        Position.absolutize(this.element);
        -      this.element.parentNode.insertBefore(this._clone, this.element);
        -    }
        -    
        -    if(this.options.scroll) {
        -      if (this.options.scroll == window) {
        -        var where = this._getWindowScroll(this.options.scroll);
        -        this.originalScrollLeft = where.left;
        -        this.originalScrollTop = where.top;
        -      } else {
        -        this.originalScrollLeft = this.options.scroll.scrollLeft;
        -        this.originalScrollTop = this.options.scroll.scrollTop;
        -      }
        -    }
        -    
        -    Draggables.notify('onStart', this, event);
        -        
        -    if(this.options.starteffect) this.options.starteffect(this.element);
        -  },
        -  
        -  updateDrag: function(event, pointer) {
        -    if(!this.dragging) this.startDrag(event);
        -    
        -    if(!this.options.quiet){
        -      Position.prepare();
        -      Droppables.show(pointer, this.element);
        -    }
        -    
        -    Draggables.notify('onDrag', this, event);
        -    
        -    this.draw(pointer);
        -    if(this.options.change) this.options.change(this);
        -    
        -    if(this.options.scroll) {
        -      this.stopScrolling();
        -      
        -      var p;
        -      if (this.options.scroll == window) {
        -        with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
        -      } else {
        -        p = Position.page(this.options.scroll);
        -        p[0] += this.options.scroll.scrollLeft + Position.deltaX;
        -        p[1] += this.options.scroll.scrollTop + Position.deltaY;
        -        p.push(p[0]+this.options.scroll.offsetWidth);
        -        p.push(p[1]+this.options.scroll.offsetHeight);
        -      }
        -      var speed = [0,0];
        -      if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity);
        -      if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity);
        -      if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity);
        -      if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
        -      this.startScrolling(speed);
        -    }
        -    
        -    // fix AppleWebKit rendering
        -    if(Prototype.Browser.WebKit) window.scrollBy(0,0);
        -    
        -    Event.stop(event);
        -  },
        -  
        -  finishDrag: function(event, success) {
        -    this.dragging = false;
        -    
        -    if(this.options.quiet){
        -      Position.prepare();
        -      var pointer = [Event.pointerX(event), Event.pointerY(event)];
        -      Droppables.show(pointer, this.element);
        -    }
        -
        -    if(this.options.ghosting) {
        -      if (!this.element._originallyAbsolute)
        -        Position.relativize(this.element);
        -      delete this.element._originallyAbsolute;
        -      Element.remove(this._clone);
        -      this._clone = null;
        -    }
        -
        -    var dropped = false; 
        -    if(success) { 
        -      dropped = Droppables.fire(event, this.element); 
        -      if (!dropped) dropped = false; 
        -    }
        -    if(dropped && this.options.onDropped) this.options.onDropped(this.element);
        -    Draggables.notify('onEnd', this, event);
        -
        -    var revert = this.options.revert;
        -    if(revert && Object.isFunction(revert)) revert = revert(this.element);
        -    
        -    var d = this.currentDelta();
        -    if(revert && this.options.reverteffect) {
        -      if (dropped == 0 || revert != 'failure')
        -        this.options.reverteffect(this.element,
        -          d[1]-this.delta[1], d[0]-this.delta[0]);
        -    } else {
        -      this.delta = d;
        -    }
        -
        -    if(this.options.zindex)
        -      this.element.style.zIndex = this.originalZ;
        -
        -    if(this.options.endeffect) 
        -      this.options.endeffect(this.element);
        -      
        -    Draggables.deactivate(this);
        -    Droppables.reset();
        -  },
        -  
        -  keyPress: function(event) {
        -    if(event.keyCode!=Event.KEY_ESC) return;
        -    this.finishDrag(event, false);
        -    Event.stop(event);
        -  },
        -  
        -  endDrag: function(event) {
        -    if(!this.dragging) return;
        -    this.stopScrolling();
        -    this.finishDrag(event, true);
        -    Event.stop(event);
        -  },
        -  
        -  draw: function(point) {
        -    var pos = Position.cumulativeOffset(this.element);
        -    if(this.options.ghosting) {
        -      var r   = Position.realOffset(this.element);
        -      pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
        -    }
        -    
        -    var d = this.currentDelta();
        -    pos[0] -= d[0]; pos[1] -= d[1];
        -    
        -    if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) {
        -      pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
        -      pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
        -    }
        -    
        -    var p = [0,1].map(function(i){ 
        -      return (point[i]-pos[i]-this.offset[i]) 
        -    }.bind(this));
        -    
        -    if(this.options.snap) {
        -      if(Object.isFunction(this.options.snap)) {
        -        p = this.options.snap(p[0],p[1],this);
        -      } else {
        -      if(Object.isArray(this.options.snap)) {
        -        p = p.map( function(v, i) {
        -          return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this))
        -      } else {
        -        p = p.map( function(v) {
        -          return (v/this.options.snap).round()*this.options.snap }.bind(this))
        -      }
        -    }}
        -    
        -    var style = this.element.style;
        -    if((!this.options.constraint) || (this.options.constraint=='horizontal'))
        -      style.left = p[0] + "px";
        -    if((!this.options.constraint) || (this.options.constraint=='vertical'))
        -      style.top  = p[1] + "px";
        -    
        -    if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
        -  },
        -  
        -  stopScrolling: function() {
        -    if(this.scrollInterval) {
        -      clearInterval(this.scrollInterval);
        -      this.scrollInterval = null;
        -      Draggables._lastScrollPointer = null;
        -    }
        -  },
        -  
        -  startScrolling: function(speed) {
        -    if(!(speed[0] || speed[1])) return;
        -    this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
        -    this.lastScrolled = new Date();
        -    this.scrollInterval = setInterval(this.scroll.bind(this), 10);
        -  },
        -  
        -  scroll: function() {
        -    var current = new Date();
        -    var delta = current - this.lastScrolled;
        -    this.lastScrolled = current;
        -    if(this.options.scroll == window) {
        -      with (this._getWindowScroll(this.options.scroll)) {
        -        if (this.scrollSpeed[0] || this.scrollSpeed[1]) {
        -          var d = delta / 1000;
        -          this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] );
        -        }
        -      }
        -    } else {
        -      this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
        -      this.options.scroll.scrollTop  += this.scrollSpeed[1] * delta / 1000;
        -    }
        -    
        -    Position.prepare();
        -    Droppables.show(Draggables._lastPointer, this.element);
        -    Draggables.notify('onDrag', this);
        -    if (this._isScrollChild) {
        -      Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer);
        -      Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000;
        -      Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000;
        -      if (Draggables._lastScrollPointer[0] < 0)
        -        Draggables._lastScrollPointer[0] = 0;
        -      if (Draggables._lastScrollPointer[1] < 0)
        -        Draggables._lastScrollPointer[1] = 0;
        -      this.draw(Draggables._lastScrollPointer);
        -    }
        -    
        -    if(this.options.change) this.options.change(this);
        -  },
        -  
        -  _getWindowScroll: function(w) {
        -    var T, L, W, H;
        -    with (w.document) {
        -      if (w.document.documentElement && documentElement.scrollTop) {
        -        T = documentElement.scrollTop;
        -        L = documentElement.scrollLeft;
        -      } else if (w.document.body) {
        -        T = body.scrollTop;
        -        L = body.scrollLeft;
        -      }
        -      if (w.innerWidth) {
        -        W = w.innerWidth;
        -        H = w.innerHeight;
        -      } else if (w.document.documentElement && documentElement.clientWidth) {
        -        W = documentElement.clientWidth;
        -        H = documentElement.clientHeight;
        -      } else {
        -        W = body.offsetWidth;
        -        H = body.offsetHeight
        -      }
        -    }
        -    return { top: T, left: L, width: W, height: H };
        -  }
        -});
        -
        -Draggable._dragging = { };
        -
        -/*--------------------------------------------------------------------------*/
        -
        -var SortableObserver = Class.create({
        -  initialize: function(element, observer) {
        -    this.element   = $(element);
        -    this.observer  = observer;
        -    this.lastValue = Sortable.serialize(this.element);
        -  },
        -  
        -  onStart: function() {
        -    this.lastValue = Sortable.serialize(this.element);
        -  },
        -  
        -  onEnd: function() {
        -    Sortable.unmark();
        -    if(this.lastValue != Sortable.serialize(this.element))
        -      this.observer(this.element)
        -  }
        -});
        -
        -var Sortable = {
        -  SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
        -  
        -  sortables: { },
        -  
        -  _findRootElement: function(element) {
        -    while (element.tagName.toUpperCase() != "BODY") {  
        -      if(element.id && Sortable.sortables[element.id]) return element;
        -      element = element.parentNode;
        -    }
        -  },
        -
        -  options: function(element) {
        -    element = Sortable._findRootElement($(element));
        -    if(!element) return;
        -    return Sortable.sortables[element.id];
        -  },
        -  
        -  destroy: function(element){
        -    var s = Sortable.options(element);
        -    
        -    if(s) {
        -      Draggables.removeObserver(s.element);
        -      s.droppables.each(function(d){ Droppables.remove(d) });
        -      s.draggables.invoke('destroy');
        -      
        -      delete Sortable.sortables[s.element.id];
        -    }
        -  },
        -
        -  create: function(element) {
        -    element = $(element);
        -    var options = Object.extend({ 
        -      element:     element,
        -      tag:         'li',       // assumes li children, override with tag: 'tagname'
        -      dropOnEmpty: false,
        -      tree:        false,
        -      treeTag:     'ul',
        -      overlap:     'vertical', // one of 'vertical', 'horizontal'
        -      constraint:  'vertical', // one of 'vertical', 'horizontal', false
        -      containment: element,    // also takes array of elements (or id's); or false
        -      handle:      false,      // or a CSS class
        -      only:        false,
        -      delay:       0,
        -      hoverclass:  null,
        -      ghosting:    false,
        -      quiet:       false, 
        -      scroll:      false,
        -      scrollSensitivity: 20,
        -      scrollSpeed: 15,
        -      format:      this.SERIALIZE_RULE,
        -      
        -      // these take arrays of elements or ids and can be 
        -      // used for better initialization performance
        -      elements:    false,
        -      handles:     false,
        -      
        -      onChange:    Prototype.emptyFunction,
        -      onUpdate:    Prototype.emptyFunction
        -    }, arguments[1] || { });
        -
        -    // clear any old sortable with same element
        -    this.destroy(element);
        -
        -    // build options for the draggables
        -    var options_for_draggable = {
        -      revert:      true,
        -      quiet:       options.quiet,
        -      scroll:      options.scroll,
        -      scrollSpeed: options.scrollSpeed,
        -      scrollSensitivity: options.scrollSensitivity,
        -      delay:       options.delay,
        -      ghosting:    options.ghosting,
        -      constraint:  options.constraint,
        -      handle:      options.handle };
        -
        -    if(options.starteffect)
        -      options_for_draggable.starteffect = options.starteffect;
        -
        -    if(options.reverteffect)
        -      options_for_draggable.reverteffect = options.reverteffect;
        -    else
        -      if(options.ghosting) options_for_draggable.reverteffect = function(element) {
        -        element.style.top  = 0;
        -        element.style.left = 0;
        -      };
        -
        -    if(options.endeffect)
        -      options_for_draggable.endeffect = options.endeffect;
        -
        -    if(options.zindex)
        -      options_for_draggable.zindex = options.zindex;
        -
        -    // build options for the droppables  
        -    var options_for_droppable = {
        -      overlap:     options.overlap,
        -      containment: options.containment,
        -      tree:        options.tree,
        -      hoverclass:  options.hoverclass,
        -      onHover:     Sortable.onHover
        -    }
        -    
        -    var options_for_tree = {
        -      onHover:      Sortable.onEmptyHover,
        -      overlap:      options.overlap,
        -      containment:  options.containment,
        -      hoverclass:   options.hoverclass
        -    }
        -
        -    // fix for gecko engine
        -    Element.cleanWhitespace(element); 
        -
        -    options.draggables = [];
        -    options.droppables = [];
        -
        -    // drop on empty handling
        -    if(options.dropOnEmpty || options.tree) {
        -      Droppables.add(element, options_for_tree);
        -      options.droppables.push(element);
        -    }
        -
        -    (options.elements || this.findElements(element, options) || []).each( function(e,i) {
        -      var handle = options.handles ? $(options.handles[i]) :
        -        (options.handle ? $(e).select('.' + options.handle)[0] : e); 
        -      options.draggables.push(
        -        new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
        -      Droppables.add(e, options_for_droppable);
        -      if(options.tree) e.treeNode = element;
        -      options.droppables.push(e);      
        -    });
        -    
        -    if(options.tree) {
        -      (Sortable.findTreeElements(element, options) || []).each( function(e) {
        -        Droppables.add(e, options_for_tree);
        -        e.treeNode = element;
        -        options.droppables.push(e);
        -      });
        -    }
        -
        -    // keep reference
        -    this.sortables[element.id] = options;
        -
        -    // for onupdate
        -    Draggables.addObserver(new SortableObserver(element, options.onUpdate));
        -
        -  },
        -
        -  // return all suitable-for-sortable elements in a guaranteed order
        -  findElements: function(element, options) {
        -    return Element.findChildren(
        -      element, options.only, options.tree ? true : false, options.tag);
        -  },
        -  
        -  findTreeElements: function(element, options) {
        -    return Element.findChildren(
        -      element, options.only, options.tree ? true : false, options.treeTag);
        -  },
        -
        -  onHover: function(element, dropon, overlap) {
        -    if(Element.isParent(dropon, element)) return;
        -
        -    if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) {
        -      return;
        -    } else if(overlap>0.5) {
        -      Sortable.mark(dropon, 'before');
        -      if(dropon.previousSibling != element) {
        -        var oldParentNode = element.parentNode;
        -        element.style.visibility = "hidden"; // fix gecko rendering
        -        dropon.parentNode.insertBefore(element, dropon);
        -        if(dropon.parentNode!=oldParentNode) 
        -          Sortable.options(oldParentNode).onChange(element);
        -        Sortable.options(dropon.parentNode).onChange(element);
        -      }
        -    } else {
        -      Sortable.mark(dropon, 'after');
        -      var nextElement = dropon.nextSibling || null;
        -      if(nextElement != element) {
        -        var oldParentNode = element.parentNode;
        -        element.style.visibility = "hidden"; // fix gecko rendering
        -        dropon.parentNode.insertBefore(element, nextElement);
        -        if(dropon.parentNode!=oldParentNode) 
        -          Sortable.options(oldParentNode).onChange(element);
        -        Sortable.options(dropon.parentNode).onChange(element);
        -      }
        -    }
        -  },
        -  
        -  onEmptyHover: function(element, dropon, overlap) {
        -    var oldParentNode = element.parentNode;
        -    var droponOptions = Sortable.options(dropon);
        -        
        -    if(!Element.isParent(dropon, element)) {
        -      var index;
        -      
        -      var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only});
        -      var child = null;
        -            
        -      if(children) {
        -        var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
        -        
        -        for (index = 0; index < children.length; index += 1) {
        -          if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
        -            offset -= Element.offsetSize (children[index], droponOptions.overlap);
        -          } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) {
        -            child = index + 1 < children.length ? children[index + 1] : null;
        -            break;
        -          } else {
        -            child = children[index];
        -            break;
        -          }
        -        }
        -      }
        -      
        -      dropon.insertBefore(element, child);
        -      
        -      Sortable.options(oldParentNode).onChange(element);
        -      droponOptions.onChange(element);
        -    }
        -  },
        -
        -  unmark: function() {
        -    if(Sortable._marker) Sortable._marker.hide();
        -  },
        -
        -  mark: function(dropon, position) {
        -    // mark on ghosting only
        -    var sortable = Sortable.options(dropon.parentNode);
        -    if(sortable && !sortable.ghosting) return; 
        -
        -    if(!Sortable._marker) {
        -      Sortable._marker = 
        -        ($('dropmarker') || Element.extend(document.createElement('DIV'))).
        -          hide().addClassName('dropmarker').setStyle({position:'absolute'});
        -      document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
        -    }    
        -    var offsets = Position.cumulativeOffset(dropon);
        -    Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
        -    
        -    if(position=='after')
        -      if(sortable.overlap == 'horizontal') 
        -        Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'});
        -      else
        -        Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'});
        -    
        -    Sortable._marker.show();
        -  },
        -  
        -  _tree: function(element, options, parent) {
        -    var children = Sortable.findElements(element, options) || [];
        -  
        -    for (var i = 0; i < children.length; ++i) {
        -      var match = children[i].id.match(options.format);
        -
        -      if (!match) continue;
        -      
        -      var child = {
        -        id: encodeURIComponent(match ? match[1] : null),
        -        element: element,
        -        parent: parent,
        -        children: [],
        -        position: parent.children.length,
        -        container: $(children[i]).down(options.treeTag)
        -      }
        -      
        -      /* Get the element containing the children and recurse over it */
        -      if (child.container)
        -        this._tree(child.container, options, child)
        -      
        -      parent.children.push (child);
        -    }
        -
        -    return parent; 
        -  },
        -
        -  tree: function(element) {
        -    element = $(element);
        -    var sortableOptions = this.options(element);
        -    var options = Object.extend({
        -      tag: sortableOptions.tag,
        -      treeTag: sortableOptions.treeTag,
        -      only: sortableOptions.only,
        -      name: element.id,
        -      format: sortableOptions.format
        -    }, arguments[1] || { });
        -    
        -    var root = {
        -      id: null,
        -      parent: null,
        -      children: [],
        -      container: element,
        -      position: 0
        -    }
        -    
        -    return Sortable._tree(element, options, root);
        -  },
        -
        -  /* Construct a [i] index for a particular node */
        -  _constructIndex: function(node) {
        -    var index = '';
        -    do {
        -      if (node.id) index = '[' + node.position + ']' + index;
        -    } while ((node = node.parent) != null);
        -    return index;
        -  },
        -
        -  sequence: function(element) {
        -    element = $(element);
        -    var options = Object.extend(this.options(element), arguments[1] || { });
        -    
        -    return $(this.findElements(element, options) || []).map( function(item) {
        -      return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
        -    });
        -  },
        -
        -  setSequence: function(element, new_sequence) {
        -    element = $(element);
        -    var options = Object.extend(this.options(element), arguments[2] || { });
        -    
        -    var nodeMap = { };
        -    this.findElements(element, options).each( function(n) {
        -        if (n.id.match(options.format))
        -            nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
        -        n.parentNode.removeChild(n);
        -    });
        -   
        -    new_sequence.each(function(ident) {
        -      var n = nodeMap[ident];
        -      if (n) {
        -        n[1].appendChild(n[0]);
        -        delete nodeMap[ident];
        -      }
        -    });
        -  },
        -  
        -  serialize: function(element) {
        -    element = $(element);
        -    var options = Object.extend(Sortable.options(element), arguments[1] || { });
        -    var name = encodeURIComponent(
        -      (arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
        -    
        -    if (options.tree) {
        -      return Sortable.tree(element, arguments[1]).children.map( function (item) {
        -        return [name + Sortable._constructIndex(item) + "[id]=" + 
        -                encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
        -      }).flatten().join('&');
        -    } else {
        -      return Sortable.sequence(element, arguments[1]).map( function(item) {
        -        return name + "[]=" + encodeURIComponent(item);
        -      }).join('&');
        -    }
        -  }
        -}
        -
        -// Returns true if child is contained within element
        -Element.isParent = function(child, element) {
        -  if (!child.parentNode || child == element) return false;
        -  if (child.parentNode == element) return true;
        -  return Element.isParent(child.parentNode, element);
        -}
        -
        -Element.findChildren = function(element, only, recursive, tagName) {   
        -  if(!element.hasChildNodes()) return null;
        -  tagName = tagName.toUpperCase();
        -  if(only) only = [only].flatten();
        -  var elements = [];
        -  $A(element.childNodes).each( function(e) {
        -    if(e.tagName && e.tagName.toUpperCase()==tagName &&
        -      (!only || (Element.classNames(e).detect(function(v) { return only.include(v) }))))
        -        elements.push(e);
        -    if(recursive) {
        -      var grandchildren = Element.findChildren(e, only, recursive, tagName);
        -      if(grandchildren) elements.push(grandchildren);
        -    }
        -  });
        -
        -  return (elements.length>0 ? elements.flatten() : []);
        -}
        -
        -Element.offsetSize = function (element, type) {
        -  return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
        -}
        +// script.aculo.us dragdrop.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
        +
        +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
        +//           (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
        +//
        +// script.aculo.us is freely distributable under the terms of an MIT-style license.
        +// For details, see the script.aculo.us web site: http://script.aculo.us/
        +
        +if(Object.isUndefined(Effect))
        +  throw("dragdrop.js requires including script.aculo.us' effects.js library");
        +
        +var Droppables = {
        +  drops: [],
        +
        +  remove: function(element) {
        +    this.drops = this.drops.reject(function(d) { return d.element==$(element) });
        +  },
        +
        +  add: function(element) {
        +    element = $(element);
        +    var options = Object.extend({
        +      greedy:     true,
        +      hoverclass: null,
        +      tree:       false
        +    }, arguments[1] || { });
        +
        +    // cache containers
        +    if(options.containment) {
        +      options._containers = [];
        +      var containment = options.containment;
        +      if(Object.isArray(containment)) {
        +        containment.each( function(c) { options._containers.push($(c)) });
        +      } else {
        +        options._containers.push($(containment));
        +      }
        +    }
        +
        +    if(options.accept) options.accept = [options.accept].flatten();
        +
        +    Element.makePositioned(element); // fix IE
        +    options.element = element;
        +
        +    this.drops.push(options);
        +  },
        +
        +  findDeepestChild: function(drops) {
        +    deepest = drops[0];
        +
        +    for (i = 1; i < drops.length; ++i)
        +      if (Element.isParent(drops[i].element, deepest.element))
        +        deepest = drops[i];
        +
        +    return deepest;
        +  },
        +
        +  isContained: function(element, drop) {
        +    var containmentNode;
        +    if(drop.tree) {
        +      containmentNode = element.treeNode;
        +    } else {
        +      containmentNode = element.parentNode;
        +    }
        +    return drop._containers.detect(function(c) { return containmentNode == c });
        +  },
        +
        +  isAffected: function(point, element, drop) {
        +    return (
        +      (drop.element!=element) &&
        +      ((!drop._containers) ||
        +        this.isContained(element, drop)) &&
        +      ((!drop.accept) ||
        +        (Element.classNames(element).detect(
        +          function(v) { return drop.accept.include(v) } ) )) &&
        +      Position.within(drop.element, point[0], point[1]) );
        +  },
        +
        +  deactivate: function(drop) {
        +    if(drop.hoverclass)
        +      Element.removeClassName(drop.element, drop.hoverclass);
        +    this.last_active = null;
        +  },
        +
        +  activate: function(drop) {
        +    if(drop.hoverclass)
        +      Element.addClassName(drop.element, drop.hoverclass);
        +    this.last_active = drop;
        +  },
        +
        +  show: function(point, element) {
        +    if(!this.drops.length) return;
        +    var drop, affected = [];
        +
        +    this.drops.each( function(drop) {
        +      if(Droppables.isAffected(point, element, drop))
        +        affected.push(drop);
        +    });
        +
        +    if(affected.length>0)
        +      drop = Droppables.findDeepestChild(affected);
        +
        +    if(this.last_active && this.last_active != drop) this.deactivate(this.last_active);
        +    if (drop) {
        +      Position.within(drop.element, point[0], point[1]);
        +      if(drop.onHover)
        +        drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
        +
        +      if (drop != this.last_active) Droppables.activate(drop);
        +    }
        +  },
        +
        +  fire: function(event, element) {
        +    if(!this.last_active) return;
        +    Position.prepare();
        +
        +    if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
        +      if (this.last_active.onDrop) {
        +        this.last_active.onDrop(element, this.last_active.element, event);
        +        return true;
        +      }
        +  },
        +
        +  reset: function() {
        +    if(this.last_active)
        +      this.deactivate(this.last_active);
        +  }
        +}
        +
        +var Draggables = {
        +  drags: [],
        +  observers: [],
        +
        +  register: function(draggable) {
        +    if(this.drags.length == 0) {
        +      this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
        +      this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
        +      this.eventKeypress  = this.keyPress.bindAsEventListener(this);
        +
        +      Event.observe(document, "mouseup", this.eventMouseUp);
        +      Event.observe(document, "mousemove", this.eventMouseMove);
        +      Event.observe(document, "keypress", this.eventKeypress);
        +    }
        +    this.drags.push(draggable);
        +  },
        +
        +  unregister: function(draggable) {
        +    this.drags = this.drags.reject(function(d) { return d==draggable });
        +    if(this.drags.length == 0) {
        +      Event.stopObserving(document, "mouseup", this.eventMouseUp);
        +      Event.stopObserving(document, "mousemove", this.eventMouseMove);
        +      Event.stopObserving(document, "keypress", this.eventKeypress);
        +    }
        +  },
        +
        +  activate: function(draggable) {
        +    if(draggable.options.delay) {
        +      this._timeout = setTimeout(function() {
        +        Draggables._timeout = null;
        +        window.focus();
        +        Draggables.activeDraggable = draggable;
        +      }.bind(this), draggable.options.delay);
        +    } else {
        +      window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
        +      this.activeDraggable = draggable;
        +    }
        +  },
        +
        +  deactivate: function() {
        +    this.activeDraggable = null;
        +  },
        +
        +  updateDrag: function(event) {
        +    if(!this.activeDraggable) return;
        +    var pointer = [Event.pointerX(event), Event.pointerY(event)];
        +    // Mozilla-based browsers fire successive mousemove events with
        +    // the same coordinates, prevent needless redrawing (moz bug?)
        +    if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
        +    this._lastPointer = pointer;
        +
        +    this.activeDraggable.updateDrag(event, pointer);
        +  },
        +
        +  endDrag: function(event) {
        +    if(this._timeout) {
        +      clearTimeout(this._timeout);
        +      this._timeout = null;
        +    }
        +    if(!this.activeDraggable) return;
        +    this._lastPointer = null;
        +    this.activeDraggable.endDrag(event);
        +    this.activeDraggable = null;
        +  },
        +
        +  keyPress: function(event) {
        +    if(this.activeDraggable)
        +      this.activeDraggable.keyPress(event);
        +  },
        +
        +  addObserver: function(observer) {
        +    this.observers.push(observer);
        +    this._cacheObserverCallbacks();
        +  },
        +
        +  removeObserver: function(element) {  // element instead of observer fixes mem leaks
        +    this.observers = this.observers.reject( function(o) { return o.element==element });
        +    this._cacheObserverCallbacks();
        +  },
        +
        +  notify: function(eventName, draggable, event) {  // 'onStart', 'onEnd', 'onDrag'
        +    if(this[eventName+'Count'] > 0)
        +      this.observers.each( function(o) {
        +        if(o[eventName]) o[eventName](eventName, draggable, event);
        +      });
        +    if(draggable.options[eventName]) draggable.options[eventName](draggable, event);
        +  },
        +
        +  _cacheObserverCallbacks: function() {
        +    ['onStart','onEnd','onDrag'].each( function(eventName) {
        +      Draggables[eventName+'Count'] = Draggables.observers.select(
        +        function(o) { return o[eventName]; }
        +      ).length;
        +    });
        +  }
        +}
        +
        +/*--------------------------------------------------------------------------*/
        +
        +var Draggable = Class.create({
        +  initialize: function(element) {
        +    var defaults = {
        +      handle: false,
        +      reverteffect: function(element, top_offset, left_offset) {
        +        var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
        +        new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur,
        +          queue: {scope:'_draggable', position:'end'}
        +        });
        +      },
        +      endeffect: function(element) {
        +        var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0;
        +        new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
        +          queue: {scope:'_draggable', position:'end'},
        +          afterFinish: function(){
        +            Draggable._dragging[element] = false
        +          }
        +        });
        +      },
        +      zindex: 1000,
        +      revert: false,
        +      quiet: false,
        +      scroll: false,
        +      scrollSensitivity: 20,
        +      scrollSpeed: 15,
        +      snap: false,  // false, or xy or [x,y] or function(x,y){ return [x,y] }
        +      delay: 0
        +    };
        +
        +    if(!arguments[1] || Object.isUndefined(arguments[1].endeffect))
        +      Object.extend(defaults, {
        +        starteffect: function(element) {
        +          element._opacity = Element.getOpacity(element);
        +          Draggable._dragging[element] = true;
        +          new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
        +        }
        +      });
        +
        +    var options = Object.extend(defaults, arguments[1] || { });
        +
        +    this.element = $(element);
        +
        +    if(options.handle && Object.isString(options.handle))
        +      this.handle = this.element.down('.'+options.handle, 0);
        +
        +    if(!this.handle) this.handle = $(options.handle);
        +    if(!this.handle) this.handle = this.element;
        +
        +    if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
        +      options.scroll = $(options.scroll);
        +      this._isScrollChild = Element.childOf(this.element, options.scroll);
        +    }
        +
        +    Element.makePositioned(this.element); // fix IE
        +
        +    this.options  = options;
        +    this.dragging = false;
        +
        +    this.eventMouseDown = this.initDrag.bindAsEventListener(this);
        +    Event.observe(this.handle, "mousedown", this.eventMouseDown);
        +
        +    Draggables.register(this);
        +  },
        +
        +  destroy: function() {
        +    Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
        +    Draggables.unregister(this);
        +  },
        +
        +  currentDelta: function() {
        +    return([
        +      parseInt(Element.getStyle(this.element,'left') || '0'),
        +      parseInt(Element.getStyle(this.element,'top') || '0')]);
        +  },
        +
        +  initDrag: function(event) {
        +    if(!Object.isUndefined(Draggable._dragging[this.element]) &&
        +      Draggable._dragging[this.element]) return;
        +    if(Event.isLeftClick(event)) {
        +      // abort on form elements, fixes a Firefox issue
        +      var src = Event.element(event);
        +      if((tag_name = src.tagName.toUpperCase()) && (
        +        tag_name=='INPUT' ||
        +        tag_name=='SELECT' ||
        +        tag_name=='OPTION' ||
        +        tag_name=='BUTTON' ||
        +        tag_name=='TEXTAREA')) return;
        +
        +      var pointer = [Event.pointerX(event), Event.pointerY(event)];
        +      var pos     = Position.cumulativeOffset(this.element);
        +      this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
        +
        +      Draggables.activate(this);
        +      Event.stop(event);
        +    }
        +  },
        +
        +  startDrag: function(event) {
        +    this.dragging = true;
        +    if(!this.delta)
        +      this.delta = this.currentDelta();
        +
        +    if(this.options.zindex) {
        +      this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
        +      this.element.style.zIndex = this.options.zindex;
        +    }
        +
        +    if(this.options.ghosting) {
        +      this._clone = this.element.cloneNode(true);
        +      this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
        +      if (!this.element._originallyAbsolute)
        +        Position.absolutize(this.element);
        +      this.element.parentNode.insertBefore(this._clone, this.element);
        +    }
        +
        +    if(this.options.scroll) {
        +      if (this.options.scroll == window) {
        +        var where = this._getWindowScroll(this.options.scroll);
        +        this.originalScrollLeft = where.left;
        +        this.originalScrollTop = where.top;
        +      } else {
        +        this.originalScrollLeft = this.options.scroll.scrollLeft;
        +        this.originalScrollTop = this.options.scroll.scrollTop;
        +      }
        +    }
        +
        +    Draggables.notify('onStart', this, event);
        +
        +    if(this.options.starteffect) this.options.starteffect(this.element);
        +  },
        +
        +  updateDrag: function(event, pointer) {
        +    if(!this.dragging) this.startDrag(event);
        +
        +    if(!this.options.quiet){
        +      Position.prepare();
        +      Droppables.show(pointer, this.element);
        +    }
        +
        +    Draggables.notify('onDrag', this, event);
        +
        +    this.draw(pointer);
        +    if(this.options.change) this.options.change(this);
        +
        +    if(this.options.scroll) {
        +      this.stopScrolling();
        +
        +      var p;
        +      if (this.options.scroll == window) {
        +        with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
        +      } else {
        +        p = Position.page(this.options.scroll);
        +        p[0] += this.options.scroll.scrollLeft + Position.deltaX;
        +        p[1] += this.options.scroll.scrollTop + Position.deltaY;
        +        p.push(p[0]+this.options.scroll.offsetWidth);
        +        p.push(p[1]+this.options.scroll.offsetHeight);
        +      }
        +      var speed = [0,0];
        +      if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity);
        +      if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity);
        +      if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity);
        +      if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
        +      this.startScrolling(speed);
        +    }
        +
        +    // fix AppleWebKit rendering
        +    if(Prototype.Browser.WebKit) window.scrollBy(0,0);
        +
        +    Event.stop(event);
        +  },
        +
        +  finishDrag: function(event, success) {
        +    this.dragging = false;
        +
        +    if(this.options.quiet){
        +      Position.prepare();
        +      var pointer = [Event.pointerX(event), Event.pointerY(event)];
        +      Droppables.show(pointer, this.element);
        +    }
        +
        +    if(this.options.ghosting) {
        +      if (!this.element._originallyAbsolute)
        +        Position.relativize(this.element);
        +      delete this.element._originallyAbsolute;
        +      Element.remove(this._clone);
        +      this._clone = null;
        +    }
        +
        +    var dropped = false;
        +    if(success) {
        +      dropped = Droppables.fire(event, this.element);
        +      if (!dropped) dropped = false;
        +    }
        +    if(dropped && this.options.onDropped) this.options.onDropped(this.element);
        +    Draggables.notify('onEnd', this, event);
        +
        +    var revert = this.options.revert;
        +    if(revert && Object.isFunction(revert)) revert = revert(this.element);
        +
        +    var d = this.currentDelta();
        +    if(revert && this.options.reverteffect) {
        +      if (dropped == 0 || revert != 'failure')
        +        this.options.reverteffect(this.element,
        +          d[1]-this.delta[1], d[0]-this.delta[0]);
        +    } else {
        +      this.delta = d;
        +    }
        +
        +    if(this.options.zindex)
        +      this.element.style.zIndex = this.originalZ;
        +
        +    if(this.options.endeffect)
        +      this.options.endeffect(this.element);
        +
        +    Draggables.deactivate(this);
        +    Droppables.reset();
        +  },
        +
        +  keyPress: function(event) {
        +    if(event.keyCode!=Event.KEY_ESC) return;
        +    this.finishDrag(event, false);
        +    Event.stop(event);
        +  },
        +
        +  endDrag: function(event) {
        +    if(!this.dragging) return;
        +    this.stopScrolling();
        +    this.finishDrag(event, true);
        +    Event.stop(event);
        +  },
        +
        +  draw: function(point) {
        +    var pos = Position.cumulativeOffset(this.element);
        +    if(this.options.ghosting) {
        +      var r   = Position.realOffset(this.element);
        +      pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
        +    }
        +
        +    var d = this.currentDelta();
        +    pos[0] -= d[0]; pos[1] -= d[1];
        +
        +    if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) {
        +      pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
        +      pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
        +    }
        +
        +    var p = [0,1].map(function(i){
        +      return (point[i]-pos[i]-this.offset[i])
        +    }.bind(this));
        +
        +    if(this.options.snap) {
        +      if(Object.isFunction(this.options.snap)) {
        +        p = this.options.snap(p[0],p[1],this);
        +      } else {
        +      if(Object.isArray(this.options.snap)) {
        +        p = p.map( function(v, i) {
        +          return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this))
        +      } else {
        +        p = p.map( function(v) {
        +          return (v/this.options.snap).round()*this.options.snap }.bind(this))
        +      }
        +    }}
        +
        +    var style = this.element.style;
        +    if((!this.options.constraint) || (this.options.constraint=='horizontal'))
        +      style.left = p[0] + "px";
        +    if((!this.options.constraint) || (this.options.constraint=='vertical'))
        +      style.top  = p[1] + "px";
        +
        +    if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
        +  },
        +
        +  stopScrolling: function() {
        +    if(this.scrollInterval) {
        +      clearInterval(this.scrollInterval);
        +      this.scrollInterval = null;
        +      Draggables._lastScrollPointer = null;
        +    }
        +  },
        +
        +  startScrolling: function(speed) {
        +    if(!(speed[0] || speed[1])) return;
        +    this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
        +    this.lastScrolled = new Date();
        +    this.scrollInterval = setInterval(this.scroll.bind(this), 10);
        +  },
        +
        +  scroll: function() {
        +    var current = new Date();
        +    var delta = current - this.lastScrolled;
        +    this.lastScrolled = current;
        +    if(this.options.scroll == window) {
        +      with (this._getWindowScroll(this.options.scroll)) {
        +        if (this.scrollSpeed[0] || this.scrollSpeed[1]) {
        +          var d = delta / 1000;
        +          this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] );
        +        }
        +      }
        +    } else {
        +      this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
        +      this.options.scroll.scrollTop  += this.scrollSpeed[1] * delta / 1000;
        +    }
        +
        +    Position.prepare();
        +    Droppables.show(Draggables._lastPointer, this.element);
        +    Draggables.notify('onDrag', this);
        +    if (this._isScrollChild) {
        +      Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer);
        +      Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000;
        +      Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000;
        +      if (Draggables._lastScrollPointer[0] < 0)
        +        Draggables._lastScrollPointer[0] = 0;
        +      if (Draggables._lastScrollPointer[1] < 0)
        +        Draggables._lastScrollPointer[1] = 0;
        +      this.draw(Draggables._lastScrollPointer);
        +    }
        +
        +    if(this.options.change) this.options.change(this);
        +  },
        +
        +  _getWindowScroll: function(w) {
        +    var T, L, W, H;
        +    with (w.document) {
        +      if (w.document.documentElement && documentElement.scrollTop) {
        +        T = documentElement.scrollTop;
        +        L = documentElement.scrollLeft;
        +      } else if (w.document.body) {
        +        T = body.scrollTop;
        +        L = body.scrollLeft;
        +      }
        +      if (w.innerWidth) {
        +        W = w.innerWidth;
        +        H = w.innerHeight;
        +      } else if (w.document.documentElement && documentElement.clientWidth) {
        +        W = documentElement.clientWidth;
        +        H = documentElement.clientHeight;
        +      } else {
        +        W = body.offsetWidth;
        +        H = body.offsetHeight
        +      }
        +    }
        +    return { top: T, left: L, width: W, height: H };
        +  }
        +});
        +
        +Draggable._dragging = { };
        +
        +/*--------------------------------------------------------------------------*/
        +
        +var SortableObserver = Class.create({
        +  initialize: function(element, observer) {
        +    this.element   = $(element);
        +    this.observer  = observer;
        +    this.lastValue = Sortable.serialize(this.element);
        +  },
        +
        +  onStart: function() {
        +    this.lastValue = Sortable.serialize(this.element);
        +  },
        +
        +  onEnd: function() {
        +    Sortable.unmark();
        +    if(this.lastValue != Sortable.serialize(this.element))
        +      this.observer(this.element)
        +  }
        +});
        +
        +var Sortable = {
        +  SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
        +
        +  sortables: { },
        +
        +  _findRootElement: function(element) {
        +    while (element.tagName.toUpperCase() != "BODY") {
        +      if(element.id && Sortable.sortables[element.id]) return element;
        +      element = element.parentNode;
        +    }
        +  },
        +
        +  options: function(element) {
        +    element = Sortable._findRootElement($(element));
        +    if(!element) return;
        +    return Sortable.sortables[element.id];
        +  },
        +
        +  destroy: function(element){
        +    var s = Sortable.options(element);
        +
        +    if(s) {
        +      Draggables.removeObserver(s.element);
        +      s.droppables.each(function(d){ Droppables.remove(d) });
        +      s.draggables.invoke('destroy');
        +
        +      delete Sortable.sortables[s.element.id];
        +    }
        +  },
        +
        +  create: function(element) {
        +    element = $(element);
        +    var options = Object.extend({
        +      element:     element,
        +      tag:         'li',       // assumes li children, override with tag: 'tagname'
        +      dropOnEmpty: false,
        +      tree:        false,
        +      treeTag:     'ul',
        +      overlap:     'vertical', // one of 'vertical', 'horizontal'
        +      constraint:  'vertical', // one of 'vertical', 'horizontal', false
        +      containment: element,    // also takes array of elements (or id's); or false
        +      handle:      false,      // or a CSS class
        +      only:        false,
        +      delay:       0,
        +      hoverclass:  null,
        +      ghosting:    false,
        +      quiet:       false,
        +      scroll:      false,
        +      scrollSensitivity: 20,
        +      scrollSpeed: 15,
        +      format:      this.SERIALIZE_RULE,
        +
        +      // these take arrays of elements or ids and can be
        +      // used for better initialization performance
        +      elements:    false,
        +      handles:     false,
        +
        +      onChange:    Prototype.emptyFunction,
        +      onUpdate:    Prototype.emptyFunction
        +    }, arguments[1] || { });
        +
        +    // clear any old sortable with same element
        +    this.destroy(element);
        +
        +    // build options for the draggables
        +    var options_for_draggable = {
        +      revert:      true,
        +      quiet:       options.quiet,
        +      scroll:      options.scroll,
        +      scrollSpeed: options.scrollSpeed,
        +      scrollSensitivity: options.scrollSensitivity,
        +      delay:       options.delay,
        +      ghosting:    options.ghosting,
        +      constraint:  options.constraint,
        +      handle:      options.handle };
        +
        +    if(options.starteffect)
        +      options_for_draggable.starteffect = options.starteffect;
        +
        +    if(options.reverteffect)
        +      options_for_draggable.reverteffect = options.reverteffect;
        +    else
        +      if(options.ghosting) options_for_draggable.reverteffect = function(element) {
        +        element.style.top  = 0;
        +        element.style.left = 0;
        +      };
        +
        +    if(options.endeffect)
        +      options_for_draggable.endeffect = options.endeffect;
        +
        +    if(options.zindex)
        +      options_for_draggable.zindex = options.zindex;
        +
        +    // build options for the droppables
        +    var options_for_droppable = {
        +      overlap:     options.overlap,
        +      containment: options.containment,
        +      tree:        options.tree,
        +      hoverclass:  options.hoverclass,
        +      onHover:     Sortable.onHover
        +    }
        +
        +    var options_for_tree = {
        +      onHover:      Sortable.onEmptyHover,
        +      overlap:      options.overlap,
        +      containment:  options.containment,
        +      hoverclass:   options.hoverclass
        +    }
        +
        +    // fix for gecko engine
        +    Element.cleanWhitespace(element);
        +
        +    options.draggables = [];
        +    options.droppables = [];
        +
        +    // drop on empty handling
        +    if(options.dropOnEmpty || options.tree) {
        +      Droppables.add(element, options_for_tree);
        +      options.droppables.push(element);
        +    }
        +
        +    (options.elements || this.findElements(element, options) || []).each( function(e,i) {
        +      var handle = options.handles ? $(options.handles[i]) :
        +        (options.handle ? $(e).select('.' + options.handle)[0] : e);
        +      options.draggables.push(
        +        new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
        +      Droppables.add(e, options_for_droppable);
        +      if(options.tree) e.treeNode = element;
        +      options.droppables.push(e);
        +    });
        +
        +    if(options.tree) {
        +      (Sortable.findTreeElements(element, options) || []).each( function(e) {
        +        Droppables.add(e, options_for_tree);
        +        e.treeNode = element;
        +        options.droppables.push(e);
        +      });
        +    }
        +
        +    // keep reference
        +    this.sortables[element.id] = options;
        +
        +    // for onupdate
        +    Draggables.addObserver(new SortableObserver(element, options.onUpdate));
        +
        +  },
        +
        +  // return all suitable-for-sortable elements in a guaranteed order
        +  findElements: function(element, options) {
        +    return Element.findChildren(
        +      element, options.only, options.tree ? true : false, options.tag);
        +  },
        +
        +  findTreeElements: function(element, options) {
        +    return Element.findChildren(
        +      element, options.only, options.tree ? true : false, options.treeTag);
        +  },
        +
        +  onHover: function(element, dropon, overlap) {
        +    if(Element.isParent(dropon, element)) return;
        +
        +    if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) {
        +      return;
        +    } else if(overlap>0.5) {
        +      Sortable.mark(dropon, 'before');
        +      if(dropon.previousSibling != element) {
        +        var oldParentNode = element.parentNode;
        +        element.style.visibility = "hidden"; // fix gecko rendering
        +        dropon.parentNode.insertBefore(element, dropon);
        +        if(dropon.parentNode!=oldParentNode)
        +          Sortable.options(oldParentNode).onChange(element);
        +        Sortable.options(dropon.parentNode).onChange(element);
        +      }
        +    } else {
        +      Sortable.mark(dropon, 'after');
        +      var nextElement = dropon.nextSibling || null;
        +      if(nextElement != element) {
        +        var oldParentNode = element.parentNode;
        +        element.style.visibility = "hidden"; // fix gecko rendering
        +        dropon.parentNode.insertBefore(element, nextElement);
        +        if(dropon.parentNode!=oldParentNode)
        +          Sortable.options(oldParentNode).onChange(element);
        +        Sortable.options(dropon.parentNode).onChange(element);
        +      }
        +    }
        +  },
        +
        +  onEmptyHover: function(element, dropon, overlap) {
        +    var oldParentNode = element.parentNode;
        +    var droponOptions = Sortable.options(dropon);
        +
        +    if(!Element.isParent(dropon, element)) {
        +      var index;
        +
        +      var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only});
        +      var child = null;
        +
        +      if(children) {
        +        var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
        +
        +        for (index = 0; index < children.length; index += 1) {
        +          if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
        +            offset -= Element.offsetSize (children[index], droponOptions.overlap);
        +          } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) {
        +            child = index + 1 < children.length ? children[index + 1] : null;
        +            break;
        +          } else {
        +            child = children[index];
        +            break;
        +          }
        +        }
        +      }
        +
        +      dropon.insertBefore(element, child);
        +
        +      Sortable.options(oldParentNode).onChange(element);
        +      droponOptions.onChange(element);
        +    }
        +  },
        +
        +  unmark: function() {
        +    if(Sortable._marker) Sortable._marker.hide();
        +  },
        +
        +  mark: function(dropon, position) {
        +    // mark on ghosting only
        +    var sortable = Sortable.options(dropon.parentNode);
        +    if(sortable && !sortable.ghosting) return;
        +
        +    if(!Sortable._marker) {
        +      Sortable._marker =
        +        ($('dropmarker') || Element.extend(document.createElement('DIV'))).
        +          hide().addClassName('dropmarker').setStyle({position:'absolute'});
        +      document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
        +    }
        +    var offsets = Position.cumulativeOffset(dropon);
        +    Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
        +
        +    if(position=='after')
        +      if(sortable.overlap == 'horizontal')
        +        Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'});
        +      else
        +        Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'});
        +
        +    Sortable._marker.show();
        +  },
        +
        +  _tree: function(element, options, parent) {
        +    var children = Sortable.findElements(element, options) || [];
        +
        +    for (var i = 0; i < children.length; ++i) {
        +      var match = children[i].id.match(options.format);
        +
        +      if (!match) continue;
        +
        +      var child = {
        +        id: encodeURIComponent(match ? match[1] : null),
        +        element: element,
        +        parent: parent,
        +        children: [],
        +        position: parent.children.length,
        +        container: $(children[i]).down(options.treeTag)
        +      }
        +
        +      /* Get the element containing the children and recurse over it */
        +      if (child.container)
        +        this._tree(child.container, options, child)
        +
        +      parent.children.push (child);
        +    }
        +
        +    return parent;
        +  },
        +
        +  tree: function(element) {
        +    element = $(element);
        +    var sortableOptions = this.options(element);
        +    var options = Object.extend({
        +      tag: sortableOptions.tag,
        +      treeTag: sortableOptions.treeTag,
        +      only: sortableOptions.only,
        +      name: element.id,
        +      format: sortableOptions.format
        +    }, arguments[1] || { });
        +
        +    var root = {
        +      id: null,
        +      parent: null,
        +      children: [],
        +      container: element,
        +      position: 0
        +    }
        +
        +    return Sortable._tree(element, options, root);
        +  },
        +
        +  /* Construct a [i] index for a particular node */
        +  _constructIndex: function(node) {
        +    var index = '';
        +    do {
        +      if (node.id) index = '[' + node.position + ']' + index;
        +    } while ((node = node.parent) != null);
        +    return index;
        +  },
        +
        +  sequence: function(element) {
        +    element = $(element);
        +    var options = Object.extend(this.options(element), arguments[1] || { });
        +
        +    return $(this.findElements(element, options) || []).map( function(item) {
        +      return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
        +    });
        +  },
        +
        +  setSequence: function(element, new_sequence) {
        +    element = $(element);
        +    var options = Object.extend(this.options(element), arguments[2] || { });
        +
        +    var nodeMap = { };
        +    this.findElements(element, options).each( function(n) {
        +        if (n.id.match(options.format))
        +            nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
        +        n.parentNode.removeChild(n);
        +    });
        +
        +    new_sequence.each(function(ident) {
        +      var n = nodeMap[ident];
        +      if (n) {
        +        n[1].appendChild(n[0]);
        +        delete nodeMap[ident];
        +      }
        +    });
        +  },
        +
        +  serialize: function(element) {
        +    element = $(element);
        +    var options = Object.extend(Sortable.options(element), arguments[1] || { });
        +    var name = encodeURIComponent(
        +      (arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
        +
        +    if (options.tree) {
        +      return Sortable.tree(element, arguments[1]).children.map( function (item) {
        +        return [name + Sortable._constructIndex(item) + "[id]=" +
        +                encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
        +      }).flatten().join('&');
        +    } else {
        +      return Sortable.sequence(element, arguments[1]).map( function(item) {
        +        return name + "[]=" + encodeURIComponent(item);
        +      }).join('&');
        +    }
        +  }
        +}
        +
        +// Returns true if child is contained within element
        +Element.isParent = function(child, element) {
        +  if (!child.parentNode || child == element) return false;
        +  if (child.parentNode == element) return true;
        +  return Element.isParent(child.parentNode, element);
        +}
        +
        +Element.findChildren = function(element, only, recursive, tagName) {
        +  if(!element.hasChildNodes()) return null;
        +  tagName = tagName.toUpperCase();
        +  if(only) only = [only].flatten();
        +  var elements = [];
        +  $A(element.childNodes).each( function(e) {
        +    if(e.tagName && e.tagName.toUpperCase()==tagName &&
        +      (!only || (Element.classNames(e).detect(function(v) { return only.include(v) }))))
        +        elements.push(e);
        +    if(recursive) {
        +      var grandchildren = Element.findChildren(e, only, recursive, tagName);
        +      if(grandchildren) elements.push(grandchildren);
        +    }
        +  });
        +
        +  return (elements.length>0 ? elements.flatten() : []);
        +}
        +
        +Element.offsetSize = function (element, type) {
        +  return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
        +}
        diff --git a/templates/website/ph2date/chat_assets/js/easySlider1.js b/templates/website/ph2date/chat_assets/js/easySlider1.js
        index cab3cbb..f822f99 100755
        --- a/templates/website/ph2date/chat_assets/js/easySlider1.js
        +++ b/templates/website/ph2date/chat_assets/js/easySlider1.js
        @@ -1,226 +1,226 @@
        -/*
        - * 	Easy Slider 1.7 - jQuery plugin
        - *	written by Alen Grakalic	
        - *	http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding
        - *
        - *	Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
        - *	Dual licensed under the MIT (MIT-LICENSE.txt)
        - *	and GPL (GPL-LICENSE.txt) licenses.
        - *
        - *	Built for jQuery library
        - *	http://jquery.com
        - *
        - */
        - 
        -/*
        - *	markup example for $("#slider").easySlider();
        - *	
        - * 	
        - *
          - *
        • - *
        • - *
        • - *
        • - *
        • - *
        - *
        - * - */ - -(function($) { - - $.fn.easySlider = function(options){ - - // default configuration properties - var defaults = { - prevId: 'prevBtn', - prevText: 'Previous', - nextId: 'nextBtn', - nextText: 'Next', - controlsShow: true, - controlsBefore: '', - controlsAfter: '', - controlsFade: true, - firstId: 'firstBtn', - firstText: 'First', - firstShow: false, - lastId: 'lastBtn', - lastText: 'Last', - lastShow: false, - vertical: false, - speed: 800, - auto: false, - pause: 2000, - continuous: false, - numeric: false, - numericId: 'controls' - }; - - var options = $.extend(defaults, options); - - this.each(function() { - var obj = $(this); - var s = $("li", obj).length; - var w = $("li", obj).width(); - var h = $("li", obj).height(); - var clickable = true; - obj.width(w); - obj.height(h); - obj.css("overflow","hidden"); - var ts = s-1; - var t = 0; - $("ul", obj).css('width',s*w); - - if(options.continuous){ - $("ul", obj).prepend($("ul li:last-child", obj).clone().css("margin-left","-"+ w +"px")); - $("ul", obj).append($("ul li:nth-child(2)", obj).clone()); - $("ul", obj).css('width',(s+1)*w); - }; - - if(!options.vertical) $("li", obj).css('float','left'); - - if(options.controlsShow){ - var html = options.controlsBefore; - if(options.numeric){ - html += '
          '; - } else { - if(options.firstShow) html += ''+ options.firstText +''; - html += ' '+ options.prevText +''; - html += ' '+ options.nextText +''; - if(options.lastShow) html += ' '+ options.lastText +''; - }; - - html += options.controlsAfter; - $(obj).after(html); - }; - - if(options.numeric){ - for(var i=0;i'+ (i+1) +'') - .appendTo($("#"+ options.numericId)) - .click(function(){ - animate($("a",$(this)).attr('rel'),true); - }); - }; - } else { - $("a","#"+options.nextId).click(function(){ - animate("next",true); - }); - $("a","#"+options.prevId).click(function(){ - animate("prev",true); - }); - $("a","#"+options.firstId).click(function(){ - animate("first",true); - }); - $("a","#"+options.lastId).click(function(){ - animate("last",true); - }); - }; - - function setCurrent(i){ - i = parseInt(i)+1; - $("li", "#" + options.numericId).removeClass("current"); - $("li#" + options.numericId + i).addClass("current"); - }; - - function adjust(){ - if(t>ts) t=0; - if(t<0) t=ts; - if(!options.vertical) { - $("ul",obj).css("margin-left",(t*w*-1)); - } else { - $("ul",obj).css("margin-left",(t*h*-1)); - } - clickable = true; - if(options.numeric) setCurrent(t); - }; - - function animate(dir,clicked){ - if (clickable){ - clickable = false; - var ot = t; - switch(dir){ - case "next": - t = (ot>=ts) ? (options.continuous ? t+1 : ts) : t+1; - break; - case "prev": - t = (t<=0) ? (options.continuous ? t-1 : 0) : t-1; - break; - case "first": - t = 0; - break; - case "last": - t = ts; - break; - default: - t = dir; - break; - }; - var diff = Math.abs(ot-t); - var speed = diff*options.speed; - if(!options.vertical) { - p = (t*w*-1); - $("ul",obj).animate( - { marginLeft: p }, - { queue:false, duration:speed, complete:adjust } - ); - } else { - p = (t*h*-1); - $("ul",obj).animate( - { marginTop: p }, - { queue:false, duration:speed, complete:adjust } - ); - }; - - if(!options.continuous && options.controlsFade){ - if(t==ts){ - $("a","#"+options.nextId).hide(); - $("a","#"+options.lastId).hide(); - } else { - $("a","#"+options.nextId).show(); - $("a","#"+options.lastId).show(); - }; - if(t==0){ - $("a","#"+options.prevId).hide(); - $("a","#"+options.firstId).hide(); - } else { - $("a","#"+options.prevId).show(); - $("a","#"+options.firstId).show(); - }; - }; - - if(clicked) clearTimeout(timeout); - if(options.auto && dir=="next" && !clicked){; - timeout = setTimeout(function(){ - animate("next",false); - },diff*options.speed+options.pause); - }; - - }; - - }; - // init - var timeout; - if(options.auto){; - timeout = setTimeout(function(){ - animate("next",false); - },options.pause); - }; - - if(options.numeric) setCurrent(0); - - if(!options.continuous && options.controlsFade){ - $("a","#"+options.prevId).hide(); - $("a","#"+options.firstId).hide(); - }; - - }); - - }; - -})(jQuery); - - - +/* + * Easy Slider 1.7 - jQuery plugin + * written by Alen Grakalic + * http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding + * + * Copyright (c) 2009 Alen Grakalic (http://cssglobe.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * Built for jQuery library + * http://jquery.com + * + */ + +/* + * markup example for $("#slider").easySlider(); + * + *
          + *
            + *
          • + *
          • + *
          • + *
          • + *
          • + *
          + *
          + * + */ + +(function($) { + + $.fn.easySlider = function(options){ + + // default configuration properties + var defaults = { + prevId: 'prevBtn', + prevText: 'Previous', + nextId: 'nextBtn', + nextText: 'Next', + controlsShow: true, + controlsBefore: '', + controlsAfter: '', + controlsFade: true, + firstId: 'firstBtn', + firstText: 'First', + firstShow: false, + lastId: 'lastBtn', + lastText: 'Last', + lastShow: false, + vertical: false, + speed: 800, + auto: false, + pause: 2000, + continuous: false, + numeric: false, + numericId: 'controls' + }; + + var options = $.extend(defaults, options); + + this.each(function() { + var obj = $(this); + var s = $("li", obj).length; + var w = $("li", obj).width(); + var h = $("li", obj).height(); + var clickable = true; + obj.width(w); + obj.height(h); + obj.css("overflow","hidden"); + var ts = s-1; + var t = 0; + $("ul", obj).css('width',s*w); + + if(options.continuous){ + $("ul", obj).prepend($("ul li:last-child", obj).clone().css("margin-left","-"+ w +"px")); + $("ul", obj).append($("ul li:nth-child(2)", obj).clone()); + $("ul", obj).css('width',(s+1)*w); + }; + + if(!options.vertical) $("li", obj).css('float','left'); + + if(options.controlsShow){ + var html = options.controlsBefore; + if(options.numeric){ + html += '
            '; + } else { + if(options.firstShow) html += ''+ options.firstText +''; + html += ' '+ options.prevText +''; + html += ' '+ options.nextText +''; + if(options.lastShow) html += ' '+ options.lastText +''; + }; + + html += options.controlsAfter; + $(obj).after(html); + }; + + if(options.numeric){ + for(var i=0;i'+ (i+1) +'') + .appendTo($("#"+ options.numericId)) + .click(function(){ + animate($("a",$(this)).attr('rel'),true); + }); + }; + } else { + $("a","#"+options.nextId).click(function(){ + animate("next",true); + }); + $("a","#"+options.prevId).click(function(){ + animate("prev",true); + }); + $("a","#"+options.firstId).click(function(){ + animate("first",true); + }); + $("a","#"+options.lastId).click(function(){ + animate("last",true); + }); + }; + + function setCurrent(i){ + i = parseInt(i)+1; + $("li", "#" + options.numericId).removeClass("current"); + $("li#" + options.numericId + i).addClass("current"); + }; + + function adjust(){ + if(t>ts) t=0; + if(t<0) t=ts; + if(!options.vertical) { + $("ul",obj).css("margin-left",(t*w*-1)); + } else { + $("ul",obj).css("margin-left",(t*h*-1)); + } + clickable = true; + if(options.numeric) setCurrent(t); + }; + + function animate(dir,clicked){ + if (clickable){ + clickable = false; + var ot = t; + switch(dir){ + case "next": + t = (ot>=ts) ? (options.continuous ? t+1 : ts) : t+1; + break; + case "prev": + t = (t<=0) ? (options.continuous ? t-1 : 0) : t-1; + break; + case "first": + t = 0; + break; + case "last": + t = ts; + break; + default: + t = dir; + break; + }; + var diff = Math.abs(ot-t); + var speed = diff*options.speed; + if(!options.vertical) { + p = (t*w*-1); + $("ul",obj).animate( + { marginLeft: p }, + { queue:false, duration:speed, complete:adjust } + ); + } else { + p = (t*h*-1); + $("ul",obj).animate( + { marginTop: p }, + { queue:false, duration:speed, complete:adjust } + ); + }; + + if(!options.continuous && options.controlsFade){ + if(t==ts){ + $("a","#"+options.nextId).hide(); + $("a","#"+options.lastId).hide(); + } else { + $("a","#"+options.nextId).show(); + $("a","#"+options.lastId).show(); + }; + if(t==0){ + $("a","#"+options.prevId).hide(); + $("a","#"+options.firstId).hide(); + } else { + $("a","#"+options.prevId).show(); + $("a","#"+options.firstId).show(); + }; + }; + + if(clicked) clearTimeout(timeout); + if(options.auto && dir=="next" && !clicked){; + timeout = setTimeout(function(){ + animate("next",false); + },diff*options.speed+options.pause); + }; + + }; + + }; + // init + var timeout; + if(options.auto){; + timeout = setTimeout(function(){ + animate("next",false); + },options.pause); + }; + + if(options.numeric) setCurrent(0); + + if(!options.continuous && options.controlsFade){ + $("a","#"+options.prevId).hide(); + $("a","#"+options.firstId).hide(); + }; + + }); + + }; + +})(jQuery); + + + diff --git a/templates/website/ph2date/chat_assets/js/effects.js b/templates/website/ph2date/chat_assets/js/effects.js index b7f3f0a..efa128f 100755 --- a/templates/website/ph2date/chat_assets/js/effects.js +++ b/templates/website/ph2date/chat_assets/js/effects.js @@ -1,1122 +1,1122 @@ -// script.aculo.us effects.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 - -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// Contributors: -// Justin Palmer (http://encytemedia.com/) -// Mark Pilgrim (http://diveintomark.org/) -// Martin Bialasinki -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -// converts rgb() and #xxx to #xxxxxx format, -// returns self (or first argument) if not convertable -String.prototype.parseColor = function() { - var color = '#'; - if (this.slice(0,4) == 'rgb(') { - var cols = this.slice(4,this.length-1).split(','); - var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); - } else { - if (this.slice(0,1) == '#') { - if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); - if (this.length==7) color = this.toLowerCase(); - } - } - return (color.length==7 ? color : (arguments[0] || this)); -}; - -/*--------------------------------------------------------------------------*/ - -Element.collectTextNodes = function(element) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); - }).flatten().join(''); -}; - -Element.collectTextNodesIgnoreClass = function(element, className) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? - Element.collectTextNodesIgnoreClass(node, className) : '')); - }).flatten().join(''); -}; - -Element.setContentZoom = function(element, percent) { - element = $(element); - element.setStyle({fontSize: (percent/100) + 'em'}); - if (Prototype.Browser.WebKit) window.scrollBy(0,0); - return element; -}; - -Element.getInlineOpacity = function(element){ - return $(element).style.opacity || ''; -}; - -Element.forceRerendering = function(element) { - try { - element = $(element); - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch(e) { } -}; - -/*--------------------------------------------------------------------------*/ - -var Effect = { - _elementDoesNotExistError: { - name: 'ElementDoesNotExistError', - message: 'The specified DOM element does not exist, but is required for this effect to operate' - }, - Transitions: { - linear: Prototype.K, - sinoidal: function(pos) { - return (-Math.cos(pos*Math.PI)/2) + 0.5; - }, - reverse: function(pos) { - return 1-pos; - }, - flicker: function(pos) { - var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; - return pos > 1 ? 1 : pos; - }, - wobble: function(pos) { - return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; - }, - pulse: function(pos, pulses) { - pulses = pulses || 5; - return ( - ((pos % (1/pulses)) * pulses).round() == 0 ? - ((pos * pulses * 2) - (pos * pulses * 2).floor()) : - 1 - ((pos * pulses * 2) - (pos * pulses * 2).floor()) - ); - }, - spring: function(pos) { - return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); - }, - none: function(pos) { - return 0; - }, - full: function(pos) { - return 1; - } - }, - DefaultOptions: { - duration: 1.0, // seconds - fps: 100, // 100= assume 66fps max. - sync: false, // true for combining - from: 0.0, - to: 1.0, - delay: 0.0, - queue: 'parallel' - }, - tagifyText: function(element) { - var tagifyStyle = 'position:relative'; - if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; - - element = $(element); - $A(element.childNodes).each( function(child) { - if (child.nodeType==3) { - child.nodeValue.toArray().each( function(character) { - element.insertBefore( - new Element('span', {style: tagifyStyle}).update( - character == ' ' ? String.fromCharCode(160) : character), - child); - }); - Element.remove(child); - } - }); - }, - multiple: function(element, effect) { - var elements; - if (((typeof element == 'object') || - Object.isFunction(element)) && - (element.length)) - elements = element; - else - elements = $(element).childNodes; - - var options = Object.extend({ - speed: 0.1, - delay: 0.0 - }, arguments[2] || { }); - var masterDelay = options.delay; - - $A(elements).each( function(element, index) { - new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); - }); - }, - PAIRS: { - 'slide': ['SlideDown','SlideUp'], - 'blind': ['BlindDown','BlindUp'], - 'appear': ['Appear','Fade'] - }, - toggle: function(element, effect) { - element = $(element); - effect = (effect || 'appear').toLowerCase(); - var options = Object.extend({ - queue: { position:'end', scope:(element.id || 'global'), limit: 1 } - }, arguments[2] || { }); - Effect[element.visible() ? - Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); - } -}; - -Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; - -/* ------------- core effects ------------- */ - -Effect.ScopedQueue = Class.create(Enumerable, { - initialize: function() { - this.effects = []; - this.interval = null; - }, - _each: function(iterator) { - this.effects._each(iterator); - }, - add: function(effect) { - var timestamp = new Date().getTime(); - - var position = Object.isString(effect.options.queue) ? - effect.options.queue : effect.options.queue.position; - - switch(position) { - case 'front': - // move unstarted effects after this effect - this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { - e.startOn += effect.finishOn; - e.finishOn += effect.finishOn; - }); - break; - case 'with-last': - timestamp = this.effects.pluck('startOn').max() || timestamp; - break; - case 'end': - // start effect after last queued effect has finished - timestamp = this.effects.pluck('finishOn').max() || timestamp; - break; - } - - effect.startOn += timestamp; - effect.finishOn += timestamp; - - if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) - this.effects.push(effect); - - if (!this.interval) - this.interval = setInterval(this.loop.bind(this), 15); - }, - remove: function(effect) { - this.effects = this.effects.reject(function(e) { return e==effect }); - if (this.effects.length == 0) { - clearInterval(this.interval); - this.interval = null; - } - }, - loop: function() { - var timePos = new Date().getTime(); - for(var i=0, len=this.effects.length;i= this.startOn) { - if (timePos >= this.finishOn) { - this.render(1.0); - this.cancel(); - this.event('beforeFinish'); - if (this.finish) this.finish(); - this.event('afterFinish'); - return; - } - var pos = (timePos - this.startOn) / this.totalTime, - frame = (pos * this.totalFrames).round(); - if (frame > this.currentFrame) { - this.render(pos); - this.currentFrame = frame; - } - } - }, - cancel: function() { - if (!this.options.sync) - Effect.Queues.get(Object.isString(this.options.queue) ? - 'global' : this.options.queue.scope).remove(this); - this.state = 'finished'; - }, - event: function(eventName) { - if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); - if (this.options[eventName]) this.options[eventName](this); - }, - inspect: function() { - var data = $H(); - for(property in this) - if (!Object.isFunction(this[property])) data.set(property, this[property]); - return '#'; - } -}); - -Effect.Parallel = Class.create(Effect.Base, { - initialize: function(effects) { - this.effects = effects || []; - this.start(arguments[1]); - }, - update: function(position) { - this.effects.invoke('render', position); - }, - finish: function(position) { - this.effects.each( function(effect) { - effect.render(1.0); - effect.cancel(); - effect.event('beforeFinish'); - if (effect.finish) effect.finish(position); - effect.event('afterFinish'); - }); - } -}); - -Effect.Tween = Class.create(Effect.Base, { - initialize: function(object, from, to) { - object = Object.isString(object) ? $(object) : object; - var args = $A(arguments), method = args.last(), - options = args.length == 5 ? args[3] : null; - this.method = Object.isFunction(method) ? method.bind(object) : - Object.isFunction(object[method]) ? object[method].bind(object) : - function(value) { object[method] = value }; - this.start(Object.extend({ from: from, to: to }, options || { })); - }, - update: function(position) { - this.method(position); - } -}); - -Effect.Event = Class.create(Effect.Base, { - initialize: function() { - this.start(Object.extend({ duration: 0 }, arguments[0] || { })); - }, - update: Prototype.emptyFunction -}); - -Effect.Opacity = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - // make this work on IE on elements without 'layout' - if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) - this.element.setStyle({zoom: 1}); - var options = Object.extend({ - from: this.element.getOpacity() || 0.0, - to: 1.0 - }, arguments[1] || { }); - this.start(options); - }, - update: function(position) { - this.element.setOpacity(position); - } -}); - -Effect.Move = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - x: 0, - y: 0, - mode: 'relative' - }, arguments[1] || { }); - this.start(options); - }, - setup: function() { - this.element.makePositioned(); - this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); - this.originalTop = parseFloat(this.element.getStyle('top') || '0'); - if (this.options.mode == 'absolute') { - this.options.x = this.options.x - this.originalLeft; - this.options.y = this.options.y - this.originalTop; - } - }, - update: function(position) { - this.element.setStyle({ - left: (this.options.x * position + this.originalLeft).round() + 'px', - top: (this.options.y * position + this.originalTop).round() + 'px' - }); - } -}); - -// for backwards compatibility -Effect.MoveBy = function(element, toTop, toLeft) { - return new Effect.Move(element, - Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); -}; - -Effect.Scale = Class.create(Effect.Base, { - initialize: function(element, percent) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - scaleX: true, - scaleY: true, - scaleContent: true, - scaleFromCenter: false, - scaleMode: 'box', // 'box' or 'contents' or { } with provided values - scaleFrom: 100.0, - scaleTo: percent - }, arguments[2] || { }); - this.start(options); - }, - setup: function() { - this.restoreAfterFinish = this.options.restoreAfterFinish || false; - this.elementPositioning = this.element.getStyle('position'); - - this.originalStyle = { }; - ['top','left','width','height','fontSize'].each( function(k) { - this.originalStyle[k] = this.element.style[k]; - }.bind(this)); - - this.originalTop = this.element.offsetTop; - this.originalLeft = this.element.offsetLeft; - - var fontSize = this.element.getStyle('font-size') || '100%'; - ['em','px','%','pt'].each( function(fontSizeType) { - if (fontSize.indexOf(fontSizeType)>0) { - this.fontSize = parseFloat(fontSize); - this.fontSizeType = fontSizeType; - } - }.bind(this)); - - this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; - - this.dims = null; - if (this.options.scaleMode=='box') - this.dims = [this.element.offsetHeight, this.element.offsetWidth]; - if (/^content/.test(this.options.scaleMode)) - this.dims = [this.element.scrollHeight, this.element.scrollWidth]; - if (!this.dims) - this.dims = [this.options.scaleMode.originalHeight, - this.options.scaleMode.originalWidth]; - }, - update: function(position) { - var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); - if (this.options.scaleContent && this.fontSize) - this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); - this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); - }, - finish: function(position) { - if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); - }, - setDimensions: function(height, width) { - var d = { }; - if (this.options.scaleX) d.width = width.round() + 'px'; - if (this.options.scaleY) d.height = height.round() + 'px'; - if (this.options.scaleFromCenter) { - var topd = (height - this.dims[0])/2; - var leftd = (width - this.dims[1])/2; - if (this.elementPositioning == 'absolute') { - if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; - if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; - } else { - if (this.options.scaleY) d.top = -topd + 'px'; - if (this.options.scaleX) d.left = -leftd + 'px'; - } - } - this.element.setStyle(d); - } -}); - -Effect.Highlight = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); - this.start(options); - }, - setup: function() { - // Prevent executing on elements not in the layout flow - if (this.element.getStyle('display')=='none') { this.cancel(); return; } - // Disable background image during the effect - this.oldStyle = { }; - if (!this.options.keepBackgroundImage) { - this.oldStyle.backgroundImage = this.element.getStyle('background-image'); - this.element.setStyle({backgroundImage: 'none'}); - } - if (!this.options.endcolor) - this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); - if (!this.options.restorecolor) - this.options.restorecolor = this.element.getStyle('background-color'); - // init color calculations - this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); - this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); - }, - update: function(position) { - this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ - return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); - }, - finish: function() { - this.element.setStyle(Object.extend(this.oldStyle, { - backgroundColor: this.options.restorecolor - })); - } -}); - -Effect.ScrollTo = function(element) { - var options = arguments[1] || { }, - scrollOffsets = document.viewport.getScrollOffsets(), - elementOffsets = $(element).cumulativeOffset(), - max = (window.height || document.body.scrollHeight) - document.viewport.getHeight(); - - if (options.offset) elementOffsets[1] += options.offset; - - return new Effect.Tween(null, - scrollOffsets.top, - elementOffsets[1] > max ? max : elementOffsets[1], - options, - function(p){ scrollTo(scrollOffsets.left, p.round()) } - ); -}; - -/* ------------- combination effects ------------- */ - -Effect.Fade = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - var options = Object.extend({ - from: element.getOpacity() || 1.0, - to: 0.0, - afterFinishInternal: function(effect) { - if (effect.options.to!=0) return; - effect.element.hide().setStyle({opacity: oldOpacity}); - } - }, arguments[1] || { }); - return new Effect.Opacity(element,options); -}; - -Effect.Appear = function(element) { - element = $(element); - var options = Object.extend({ - from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), - to: 1.0, - // force Safari to render floated elements properly - afterFinishInternal: function(effect) { - effect.element.forceRerendering(); - }, - beforeSetup: function(effect) { - effect.element.setOpacity(effect.options.from).show(); - }}, arguments[1] || { }); - return new Effect.Opacity(element,options); -}; - -Effect.Puff = function(element) { - element = $(element); - var oldStyle = { - opacity: element.getInlineOpacity(), - position: element.getStyle('position'), - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height - }; - return new Effect.Parallel( - [ new Effect.Scale(element, 200, - { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], - Object.extend({ duration: 1.0, - beforeSetupInternal: function(effect) { - Position.absolutize(effect.effects[0].element) - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().setStyle(oldStyle); } - }, arguments[1] || { }) - ); -}; - -Effect.BlindUp = function(element) { - element = $(element); - element.makeClipping(); - return new Effect.Scale(element, 0, - Object.extend({ scaleContent: false, - scaleX: false, - restoreAfterFinish: true, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }, arguments[1] || { }) - ); -}; - -Effect.BlindDown = function(element) { - element = $(element); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: 0, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping(); - } - }, arguments[1] || { })); -}; - -Effect.SwitchOff = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - return new Effect.Appear(element, Object.extend({ - duration: 0.4, - from: 0, - transition: Effect.Transitions.flicker, - afterFinishInternal: function(effect) { - new Effect.Scale(effect.element, 1, { - duration: 0.3, scaleFromCenter: true, - scaleX: false, scaleContent: false, restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); - } - }) - } - }, arguments[1] || { })); -}; - -Effect.DropOut = function(element) { - element = $(element); - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left'), - opacity: element.getInlineOpacity() }; - return new Effect.Parallel( - [ new Effect.Move(element, {x: 0, y: 100, sync: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 }) ], - Object.extend( - { duration: 0.5, - beforeSetup: function(effect) { - effect.effects[0].element.makePositioned(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); - } - }, arguments[1] || { })); -}; - -Effect.Shake = function(element) { - element = $(element); - var options = Object.extend({ - distance: 20, - duration: 0.5 - }, arguments[1] || {}); - var distance = parseFloat(options.distance); - var split = parseFloat(options.duration) / 10.0; - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left') }; - return new Effect.Move(element, - { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { - effect.element.undoPositioned().setStyle(oldStyle); - }}) }}) }}) }}) }}) }}); -}; - -Effect.SlideDown = function(element) { - element = $(element).cleanWhitespace(); - // SlideDown need to have the content of the element wrapped in a container element with fixed height! - var oldInnerBottom = element.down().getStyle('bottom'); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: window.opera ? 0 : 1, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if (window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping().undoPositioned(); - effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } - }, arguments[1] || { }) - ); -}; - -Effect.SlideUp = function(element) { - element = $(element).cleanWhitespace(); - var oldInnerBottom = element.down().getStyle('bottom'); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, window.opera ? 0 : 1, - Object.extend({ scaleContent: false, - scaleX: false, - scaleMode: 'box', - scaleFrom: 100, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if (window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned(); - effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); - } - }, arguments[1] || { }) - ); -}; - -// Bug in opera makes the TD containing this element expand for a instance after finish -Effect.Squish = function(element) { - return new Effect.Scale(element, window.opera ? 1 : 0, { - restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }); -}; - -Effect.Grow = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.full - }, arguments[1] || { }); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var initialMoveX, initialMoveY; - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - initialMoveX = initialMoveY = moveX = moveY = 0; - break; - case 'top-right': - initialMoveX = dims.width; - initialMoveY = moveY = 0; - moveX = -dims.width; - break; - case 'bottom-left': - initialMoveX = moveX = 0; - initialMoveY = dims.height; - moveY = -dims.height; - break; - case 'bottom-right': - initialMoveX = dims.width; - initialMoveY = dims.height; - moveX = -dims.width; - moveY = -dims.height; - break; - case 'center': - initialMoveX = dims.width / 2; - initialMoveY = dims.height / 2; - moveX = -dims.width / 2; - moveY = -dims.height / 2; - break; - } - - return new Effect.Move(element, { - x: initialMoveX, - y: initialMoveY, - duration: 0.01, - beforeSetup: function(effect) { - effect.element.hide().makeClipping().makePositioned(); - }, - afterFinishInternal: function(effect) { - new Effect.Parallel( - [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), - new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), - new Effect.Scale(effect.element, 100, { - scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, - sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) - ], Object.extend({ - beforeSetup: function(effect) { - effect.effects[0].element.setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); - } - }, options) - ) - } - }); -}; - -Effect.Shrink = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.none - }, arguments[1] || { }); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - moveX = moveY = 0; - break; - case 'top-right': - moveX = dims.width; - moveY = 0; - break; - case 'bottom-left': - moveX = 0; - moveY = dims.height; - break; - case 'bottom-right': - moveX = dims.width; - moveY = dims.height; - break; - case 'center': - moveX = dims.width / 2; - moveY = dims.height / 2; - break; - } - - return new Effect.Parallel( - [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), - new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), - new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) - ], Object.extend({ - beforeStartInternal: function(effect) { - effect.effects[0].element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } - }, options) - ); -}; - -Effect.Pulsate = function(element) { - element = $(element); - var options = arguments[1] || { }; - var oldOpacity = element.getInlineOpacity(); - var transition = options.transition || Effect.Transitions.sinoidal; - var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; - reverser.bind(transition); - return new Effect.Opacity(element, - Object.extend(Object.extend({ duration: 2.0, from: 0, - afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } - }, options), {transition: reverser})); -}; - -Effect.Fold = function(element) { - element = $(element); - var oldStyle = { - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height }; - element.makeClipping(); - return new Effect.Scale(element, 5, Object.extend({ - scaleContent: false, - scaleX: false, - afterFinishInternal: function(effect) { - new Effect.Scale(element, 1, { - scaleContent: false, - scaleY: false, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().setStyle(oldStyle); - } }); - }}, arguments[1] || { })); -}; - -Effect.Morph = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - style: { } - }, arguments[1] || { }); - - if (!Object.isString(options.style)) this.style = $H(options.style); - else { - if (options.style.include(':')) - this.style = options.style.parseStyle(); - else { - this.element.addClassName(options.style); - this.style = $H(this.element.getStyles()); - this.element.removeClassName(options.style); - var css = this.element.getStyles(); - this.style = this.style.reject(function(style) { - return style.value == css[style.key]; - }); - options.afterFinishInternal = function(effect) { - effect.element.addClassName(effect.options.style); - effect.transforms.each(function(transform) { - effect.element.style[transform.style] = ''; - }); - } - } - } - this.start(options); - }, - - setup: function(){ - function parseColor(color){ - if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; - color = color.parseColor(); - return $R(0,2).map(function(i){ - return parseInt( color.slice(i*2+1,i*2+3), 16 ) - }); - } - this.transforms = this.style.map(function(pair){ - var property = pair[0], value = pair[1], unit = null; - - if (value.parseColor('#zzzzzz') != '#zzzzzz') { - value = value.parseColor(); - unit = 'color'; - } else if (property == 'opacity') { - value = parseFloat(value); - if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) - this.element.setStyle({zoom: 1}); - } else if (Element.CSS_LENGTH.test(value)) { - var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); - value = parseFloat(components[1]); - unit = (components.length == 3) ? components[2] : null; - } - - var originalValue = this.element.getStyle(property); - return { - style: property.camelize(), - originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), - targetValue: unit=='color' ? parseColor(value) : value, - unit: unit - }; - }.bind(this)).reject(function(transform){ - return ( - (transform.originalValue == transform.targetValue) || - ( - transform.unit != 'color' && - (isNaN(transform.originalValue) || isNaN(transform.targetValue)) - ) - ) - }); - }, - update: function(position) { - var style = { }, transform, i = this.transforms.length; - while(i--) - style[(transform = this.transforms[i]).style] = - transform.unit=='color' ? '#'+ - (Math.round(transform.originalValue[0]+ - (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + - (Math.round(transform.originalValue[1]+ - (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + - (Math.round(transform.originalValue[2]+ - (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : - (transform.originalValue + - (transform.targetValue - transform.originalValue) * position).toFixed(3) + - (transform.unit === null ? '' : transform.unit); - this.element.setStyle(style, true); - } -}); - -Effect.Transform = Class.create({ - initialize: function(tracks){ - this.tracks = []; - this.options = arguments[1] || { }; - this.addTracks(tracks); - }, - addTracks: function(tracks){ - tracks.each(function(track){ - track = $H(track); - var data = track.values().first(); - this.tracks.push($H({ - ids: track.keys().first(), - effect: Effect.Morph, - options: { style: data } - })); - }.bind(this)); - return this; - }, - play: function(){ - return new Effect.Parallel( - this.tracks.map(function(track){ - var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); - var elements = [$(ids) || $$(ids)].flatten(); - return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); - }).flatten(), - this.options - ); - } -}); - -Element.CSS_PROPERTIES = $w( - 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + - 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + - 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + - 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + - 'fontSize fontWeight height left letterSpacing lineHeight ' + - 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ - 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + - 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + - 'right textIndent top width wordSpacing zIndex'); - -Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; - -String.__parseStyleElement = document.createElement('div'); -String.prototype.parseStyle = function(){ - var style, styleRules = $H(); - if (Prototype.Browser.WebKit) - style = new Element('div',{style:this}).style; - else { - String.__parseStyleElement.innerHTML = '
            '; - style = String.__parseStyleElement.childNodes[0].style; - } - - Element.CSS_PROPERTIES.each(function(property){ - if (style[property]) styleRules.set(property, style[property]); - }); - - if (Prototype.Browser.IE && this.include('opacity')) - styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); - - return styleRules; -}; - -if (document.defaultView && document.defaultView.getComputedStyle) { - Element.getStyles = function(element) { - var css = document.defaultView.getComputedStyle($(element), null); - return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { - styles[property] = css[property]; - return styles; - }); - }; -} else { - Element.getStyles = function(element) { - element = $(element); - var css = element.currentStyle, styles; - styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) { - results[property] = css[property]; - return results; - }); - if (!styles.opacity) styles.opacity = element.getOpacity(); - return styles; - }; -}; - -Effect.Methods = { - morph: function(element, style) { - element = $(element); - new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); - return element; - }, - visualEffect: function(element, effect, options) { - element = $(element) - var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); - new Effect[klass](element, options); - return element; - }, - highlight: function(element, options) { - element = $(element); - new Effect.Highlight(element, options); - return element; - } -}; - -$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ - 'pulsate shake puff squish switchOff dropOut').each( - function(effect) { - Effect.Methods[effect] = function(element, options){ - element = $(element); - Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); - return element; - } - } -); - -$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( - function(f) { Effect.Methods[f] = Element[f]; } -); - -Element.addMethods(Effect.Methods); +// script.aculo.us effects.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 + +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Contributors: +// Justin Palmer (http://encytemedia.com/) +// Mark Pilgrim (http://diveintomark.org/) +// Martin Bialasinki +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// converts rgb() and #xxx to #xxxxxx format, +// returns self (or first argument) if not convertable +String.prototype.parseColor = function() { + var color = '#'; + if (this.slice(0,4) == 'rgb(') { + var cols = this.slice(4,this.length-1).split(','); + var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); + } else { + if (this.slice(0,1) == '#') { + if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); + if (this.length==7) color = this.toLowerCase(); + } + } + return (color.length==7 ? color : (arguments[0] || this)); +}; + +/*--------------------------------------------------------------------------*/ + +Element.collectTextNodes = function(element) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); + }).flatten().join(''); +}; + +Element.collectTextNodesIgnoreClass = function(element, className) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? + Element.collectTextNodesIgnoreClass(node, className) : '')); + }).flatten().join(''); +}; + +Element.setContentZoom = function(element, percent) { + element = $(element); + element.setStyle({fontSize: (percent/100) + 'em'}); + if (Prototype.Browser.WebKit) window.scrollBy(0,0); + return element; +}; + +Element.getInlineOpacity = function(element){ + return $(element).style.opacity || ''; +}; + +Element.forceRerendering = function(element) { + try { + element = $(element); + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch(e) { } +}; + +/*--------------------------------------------------------------------------*/ + +var Effect = { + _elementDoesNotExistError: { + name: 'ElementDoesNotExistError', + message: 'The specified DOM element does not exist, but is required for this effect to operate' + }, + Transitions: { + linear: Prototype.K, + sinoidal: function(pos) { + return (-Math.cos(pos*Math.PI)/2) + 0.5; + }, + reverse: function(pos) { + return 1-pos; + }, + flicker: function(pos) { + var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; + return pos > 1 ? 1 : pos; + }, + wobble: function(pos) { + return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; + }, + pulse: function(pos, pulses) { + pulses = pulses || 5; + return ( + ((pos % (1/pulses)) * pulses).round() == 0 ? + ((pos * pulses * 2) - (pos * pulses * 2).floor()) : + 1 - ((pos * pulses * 2) - (pos * pulses * 2).floor()) + ); + }, + spring: function(pos) { + return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); + }, + none: function(pos) { + return 0; + }, + full: function(pos) { + return 1; + } + }, + DefaultOptions: { + duration: 1.0, // seconds + fps: 100, // 100= assume 66fps max. + sync: false, // true for combining + from: 0.0, + to: 1.0, + delay: 0.0, + queue: 'parallel' + }, + tagifyText: function(element) { + var tagifyStyle = 'position:relative'; + if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; + + element = $(element); + $A(element.childNodes).each( function(child) { + if (child.nodeType==3) { + child.nodeValue.toArray().each( function(character) { + element.insertBefore( + new Element('span', {style: tagifyStyle}).update( + character == ' ' ? String.fromCharCode(160) : character), + child); + }); + Element.remove(child); + } + }); + }, + multiple: function(element, effect) { + var elements; + if (((typeof element == 'object') || + Object.isFunction(element)) && + (element.length)) + elements = element; + else + elements = $(element).childNodes; + + var options = Object.extend({ + speed: 0.1, + delay: 0.0 + }, arguments[2] || { }); + var masterDelay = options.delay; + + $A(elements).each( function(element, index) { + new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); + }); + }, + PAIRS: { + 'slide': ['SlideDown','SlideUp'], + 'blind': ['BlindDown','BlindUp'], + 'appear': ['Appear','Fade'] + }, + toggle: function(element, effect) { + element = $(element); + effect = (effect || 'appear').toLowerCase(); + var options = Object.extend({ + queue: { position:'end', scope:(element.id || 'global'), limit: 1 } + }, arguments[2] || { }); + Effect[element.visible() ? + Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); + } +}; + +Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; + +/* ------------- core effects ------------- */ + +Effect.ScopedQueue = Class.create(Enumerable, { + initialize: function() { + this.effects = []; + this.interval = null; + }, + _each: function(iterator) { + this.effects._each(iterator); + }, + add: function(effect) { + var timestamp = new Date().getTime(); + + var position = Object.isString(effect.options.queue) ? + effect.options.queue : effect.options.queue.position; + + switch(position) { + case 'front': + // move unstarted effects after this effect + this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { + e.startOn += effect.finishOn; + e.finishOn += effect.finishOn; + }); + break; + case 'with-last': + timestamp = this.effects.pluck('startOn').max() || timestamp; + break; + case 'end': + // start effect after last queued effect has finished + timestamp = this.effects.pluck('finishOn').max() || timestamp; + break; + } + + effect.startOn += timestamp; + effect.finishOn += timestamp; + + if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) + this.effects.push(effect); + + if (!this.interval) + this.interval = setInterval(this.loop.bind(this), 15); + }, + remove: function(effect) { + this.effects = this.effects.reject(function(e) { return e==effect }); + if (this.effects.length == 0) { + clearInterval(this.interval); + this.interval = null; + } + }, + loop: function() { + var timePos = new Date().getTime(); + for(var i=0, len=this.effects.length;i= this.startOn) { + if (timePos >= this.finishOn) { + this.render(1.0); + this.cancel(); + this.event('beforeFinish'); + if (this.finish) this.finish(); + this.event('afterFinish'); + return; + } + var pos = (timePos - this.startOn) / this.totalTime, + frame = (pos * this.totalFrames).round(); + if (frame > this.currentFrame) { + this.render(pos); + this.currentFrame = frame; + } + } + }, + cancel: function() { + if (!this.options.sync) + Effect.Queues.get(Object.isString(this.options.queue) ? + 'global' : this.options.queue.scope).remove(this); + this.state = 'finished'; + }, + event: function(eventName) { + if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); + if (this.options[eventName]) this.options[eventName](this); + }, + inspect: function() { + var data = $H(); + for(property in this) + if (!Object.isFunction(this[property])) data.set(property, this[property]); + return '#'; + } +}); + +Effect.Parallel = Class.create(Effect.Base, { + initialize: function(effects) { + this.effects = effects || []; + this.start(arguments[1]); + }, + update: function(position) { + this.effects.invoke('render', position); + }, + finish: function(position) { + this.effects.each( function(effect) { + effect.render(1.0); + effect.cancel(); + effect.event('beforeFinish'); + if (effect.finish) effect.finish(position); + effect.event('afterFinish'); + }); + } +}); + +Effect.Tween = Class.create(Effect.Base, { + initialize: function(object, from, to) { + object = Object.isString(object) ? $(object) : object; + var args = $A(arguments), method = args.last(), + options = args.length == 5 ? args[3] : null; + this.method = Object.isFunction(method) ? method.bind(object) : + Object.isFunction(object[method]) ? object[method].bind(object) : + function(value) { object[method] = value }; + this.start(Object.extend({ from: from, to: to }, options || { })); + }, + update: function(position) { + this.method(position); + } +}); + +Effect.Event = Class.create(Effect.Base, { + initialize: function() { + this.start(Object.extend({ duration: 0 }, arguments[0] || { })); + }, + update: Prototype.emptyFunction +}); + +Effect.Opacity = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + // make this work on IE on elements without 'layout' + if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + var options = Object.extend({ + from: this.element.getOpacity() || 0.0, + to: 1.0 + }, arguments[1] || { }); + this.start(options); + }, + update: function(position) { + this.element.setOpacity(position); + } +}); + +Effect.Move = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + x: 0, + y: 0, + mode: 'relative' + }, arguments[1] || { }); + this.start(options); + }, + setup: function() { + this.element.makePositioned(); + this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); + this.originalTop = parseFloat(this.element.getStyle('top') || '0'); + if (this.options.mode == 'absolute') { + this.options.x = this.options.x - this.originalLeft; + this.options.y = this.options.y - this.originalTop; + } + }, + update: function(position) { + this.element.setStyle({ + left: (this.options.x * position + this.originalLeft).round() + 'px', + top: (this.options.y * position + this.originalTop).round() + 'px' + }); + } +}); + +// for backwards compatibility +Effect.MoveBy = function(element, toTop, toLeft) { + return new Effect.Move(element, + Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); +}; + +Effect.Scale = Class.create(Effect.Base, { + initialize: function(element, percent) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + scaleX: true, + scaleY: true, + scaleContent: true, + scaleFromCenter: false, + scaleMode: 'box', // 'box' or 'contents' or { } with provided values + scaleFrom: 100.0, + scaleTo: percent + }, arguments[2] || { }); + this.start(options); + }, + setup: function() { + this.restoreAfterFinish = this.options.restoreAfterFinish || false; + this.elementPositioning = this.element.getStyle('position'); + + this.originalStyle = { }; + ['top','left','width','height','fontSize'].each( function(k) { + this.originalStyle[k] = this.element.style[k]; + }.bind(this)); + + this.originalTop = this.element.offsetTop; + this.originalLeft = this.element.offsetLeft; + + var fontSize = this.element.getStyle('font-size') || '100%'; + ['em','px','%','pt'].each( function(fontSizeType) { + if (fontSize.indexOf(fontSizeType)>0) { + this.fontSize = parseFloat(fontSize); + this.fontSizeType = fontSizeType; + } + }.bind(this)); + + this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; + + this.dims = null; + if (this.options.scaleMode=='box') + this.dims = [this.element.offsetHeight, this.element.offsetWidth]; + if (/^content/.test(this.options.scaleMode)) + this.dims = [this.element.scrollHeight, this.element.scrollWidth]; + if (!this.dims) + this.dims = [this.options.scaleMode.originalHeight, + this.options.scaleMode.originalWidth]; + }, + update: function(position) { + var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); + if (this.options.scaleContent && this.fontSize) + this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); + this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); + }, + finish: function(position) { + if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); + }, + setDimensions: function(height, width) { + var d = { }; + if (this.options.scaleX) d.width = width.round() + 'px'; + if (this.options.scaleY) d.height = height.round() + 'px'; + if (this.options.scaleFromCenter) { + var topd = (height - this.dims[0])/2; + var leftd = (width - this.dims[1])/2; + if (this.elementPositioning == 'absolute') { + if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; + if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; + } else { + if (this.options.scaleY) d.top = -topd + 'px'; + if (this.options.scaleX) d.left = -leftd + 'px'; + } + } + this.element.setStyle(d); + } +}); + +Effect.Highlight = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); + this.start(options); + }, + setup: function() { + // Prevent executing on elements not in the layout flow + if (this.element.getStyle('display')=='none') { this.cancel(); return; } + // Disable background image during the effect + this.oldStyle = { }; + if (!this.options.keepBackgroundImage) { + this.oldStyle.backgroundImage = this.element.getStyle('background-image'); + this.element.setStyle({backgroundImage: 'none'}); + } + if (!this.options.endcolor) + this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); + if (!this.options.restorecolor) + this.options.restorecolor = this.element.getStyle('background-color'); + // init color calculations + this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); + this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); + }, + update: function(position) { + this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ + return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); + }, + finish: function() { + this.element.setStyle(Object.extend(this.oldStyle, { + backgroundColor: this.options.restorecolor + })); + } +}); + +Effect.ScrollTo = function(element) { + var options = arguments[1] || { }, + scrollOffsets = document.viewport.getScrollOffsets(), + elementOffsets = $(element).cumulativeOffset(), + max = (window.height || document.body.scrollHeight) - document.viewport.getHeight(); + + if (options.offset) elementOffsets[1] += options.offset; + + return new Effect.Tween(null, + scrollOffsets.top, + elementOffsets[1] > max ? max : elementOffsets[1], + options, + function(p){ scrollTo(scrollOffsets.left, p.round()) } + ); +}; + +/* ------------- combination effects ------------- */ + +Effect.Fade = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + var options = Object.extend({ + from: element.getOpacity() || 1.0, + to: 0.0, + afterFinishInternal: function(effect) { + if (effect.options.to!=0) return; + effect.element.hide().setStyle({opacity: oldOpacity}); + } + }, arguments[1] || { }); + return new Effect.Opacity(element,options); +}; + +Effect.Appear = function(element) { + element = $(element); + var options = Object.extend({ + from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), + to: 1.0, + // force Safari to render floated elements properly + afterFinishInternal: function(effect) { + effect.element.forceRerendering(); + }, + beforeSetup: function(effect) { + effect.element.setOpacity(effect.options.from).show(); + }}, arguments[1] || { }); + return new Effect.Opacity(element,options); +}; + +Effect.Puff = function(element) { + element = $(element); + var oldStyle = { + opacity: element.getInlineOpacity(), + position: element.getStyle('position'), + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height + }; + return new Effect.Parallel( + [ new Effect.Scale(element, 200, + { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], + Object.extend({ duration: 1.0, + beforeSetupInternal: function(effect) { + Position.absolutize(effect.effects[0].element) + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().setStyle(oldStyle); } + }, arguments[1] || { }) + ); +}; + +Effect.BlindUp = function(element) { + element = $(element); + element.makeClipping(); + return new Effect.Scale(element, 0, + Object.extend({ scaleContent: false, + scaleX: false, + restoreAfterFinish: true, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }, arguments[1] || { }) + ); +}; + +Effect.BlindDown = function(element) { + element = $(element); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: 0, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping(); + } + }, arguments[1] || { })); +}; + +Effect.SwitchOff = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + return new Effect.Appear(element, Object.extend({ + duration: 0.4, + from: 0, + transition: Effect.Transitions.flicker, + afterFinishInternal: function(effect) { + new Effect.Scale(effect.element, 1, { + duration: 0.3, scaleFromCenter: true, + scaleX: false, scaleContent: false, restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); + } + }) + } + }, arguments[1] || { })); +}; + +Effect.DropOut = function(element) { + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left'), + opacity: element.getInlineOpacity() }; + return new Effect.Parallel( + [ new Effect.Move(element, {x: 0, y: 100, sync: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 }) ], + Object.extend( + { duration: 0.5, + beforeSetup: function(effect) { + effect.effects[0].element.makePositioned(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); + } + }, arguments[1] || { })); +}; + +Effect.Shake = function(element) { + element = $(element); + var options = Object.extend({ + distance: 20, + duration: 0.5 + }, arguments[1] || {}); + var distance = parseFloat(options.distance); + var split = parseFloat(options.duration) / 10.0; + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left') }; + return new Effect.Move(element, + { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { + effect.element.undoPositioned().setStyle(oldStyle); + }}) }}) }}) }}) }}) }}); +}; + +Effect.SlideDown = function(element) { + element = $(element).cleanWhitespace(); + // SlideDown need to have the content of the element wrapped in a container element with fixed height! + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: window.opera ? 0 : 1, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if (window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } + }, arguments[1] || { }) + ); +}; + +Effect.SlideUp = function(element) { + element = $(element).cleanWhitespace(); + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, window.opera ? 0 : 1, + Object.extend({ scaleContent: false, + scaleX: false, + scaleMode: 'box', + scaleFrom: 100, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if (window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); + } + }, arguments[1] || { }) + ); +}; + +// Bug in opera makes the TD containing this element expand for a instance after finish +Effect.Squish = function(element) { + return new Effect.Scale(element, window.opera ? 1 : 0, { + restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }); +}; + +Effect.Grow = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.full + }, arguments[1] || { }); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var initialMoveX, initialMoveY; + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + initialMoveX = initialMoveY = moveX = moveY = 0; + break; + case 'top-right': + initialMoveX = dims.width; + initialMoveY = moveY = 0; + moveX = -dims.width; + break; + case 'bottom-left': + initialMoveX = moveX = 0; + initialMoveY = dims.height; + moveY = -dims.height; + break; + case 'bottom-right': + initialMoveX = dims.width; + initialMoveY = dims.height; + moveX = -dims.width; + moveY = -dims.height; + break; + case 'center': + initialMoveX = dims.width / 2; + initialMoveY = dims.height / 2; + moveX = -dims.width / 2; + moveY = -dims.height / 2; + break; + } + + return new Effect.Move(element, { + x: initialMoveX, + y: initialMoveY, + duration: 0.01, + beforeSetup: function(effect) { + effect.element.hide().makeClipping().makePositioned(); + }, + afterFinishInternal: function(effect) { + new Effect.Parallel( + [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), + new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), + new Effect.Scale(effect.element, 100, { + scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, + sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) + ], Object.extend({ + beforeSetup: function(effect) { + effect.effects[0].element.setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); + } + }, options) + ) + } + }); +}; + +Effect.Shrink = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.none + }, arguments[1] || { }); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + moveX = moveY = 0; + break; + case 'top-right': + moveX = dims.width; + moveY = 0; + break; + case 'bottom-left': + moveX = 0; + moveY = dims.height; + break; + case 'bottom-right': + moveX = dims.width; + moveY = dims.height; + break; + case 'center': + moveX = dims.width / 2; + moveY = dims.height / 2; + break; + } + + return new Effect.Parallel( + [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), + new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), + new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) + ], Object.extend({ + beforeStartInternal: function(effect) { + effect.effects[0].element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } + }, options) + ); +}; + +Effect.Pulsate = function(element) { + element = $(element); + var options = arguments[1] || { }; + var oldOpacity = element.getInlineOpacity(); + var transition = options.transition || Effect.Transitions.sinoidal; + var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; + reverser.bind(transition); + return new Effect.Opacity(element, + Object.extend(Object.extend({ duration: 2.0, from: 0, + afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } + }, options), {transition: reverser})); +}; + +Effect.Fold = function(element) { + element = $(element); + var oldStyle = { + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height }; + element.makeClipping(); + return new Effect.Scale(element, 5, Object.extend({ + scaleContent: false, + scaleX: false, + afterFinishInternal: function(effect) { + new Effect.Scale(element, 1, { + scaleContent: false, + scaleY: false, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().setStyle(oldStyle); + } }); + }}, arguments[1] || { })); +}; + +Effect.Morph = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + style: { } + }, arguments[1] || { }); + + if (!Object.isString(options.style)) this.style = $H(options.style); + else { + if (options.style.include(':')) + this.style = options.style.parseStyle(); + else { + this.element.addClassName(options.style); + this.style = $H(this.element.getStyles()); + this.element.removeClassName(options.style); + var css = this.element.getStyles(); + this.style = this.style.reject(function(style) { + return style.value == css[style.key]; + }); + options.afterFinishInternal = function(effect) { + effect.element.addClassName(effect.options.style); + effect.transforms.each(function(transform) { + effect.element.style[transform.style] = ''; + }); + } + } + } + this.start(options); + }, + + setup: function(){ + function parseColor(color){ + if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; + color = color.parseColor(); + return $R(0,2).map(function(i){ + return parseInt( color.slice(i*2+1,i*2+3), 16 ) + }); + } + this.transforms = this.style.map(function(pair){ + var property = pair[0], value = pair[1], unit = null; + + if (value.parseColor('#zzzzzz') != '#zzzzzz') { + value = value.parseColor(); + unit = 'color'; + } else if (property == 'opacity') { + value = parseFloat(value); + if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + } else if (Element.CSS_LENGTH.test(value)) { + var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); + value = parseFloat(components[1]); + unit = (components.length == 3) ? components[2] : null; + } + + var originalValue = this.element.getStyle(property); + return { + style: property.camelize(), + originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), + targetValue: unit=='color' ? parseColor(value) : value, + unit: unit + }; + }.bind(this)).reject(function(transform){ + return ( + (transform.originalValue == transform.targetValue) || + ( + transform.unit != 'color' && + (isNaN(transform.originalValue) || isNaN(transform.targetValue)) + ) + ) + }); + }, + update: function(position) { + var style = { }, transform, i = this.transforms.length; + while(i--) + style[(transform = this.transforms[i]).style] = + transform.unit=='color' ? '#'+ + (Math.round(transform.originalValue[0]+ + (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + + (Math.round(transform.originalValue[1]+ + (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + + (Math.round(transform.originalValue[2]+ + (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : + (transform.originalValue + + (transform.targetValue - transform.originalValue) * position).toFixed(3) + + (transform.unit === null ? '' : transform.unit); + this.element.setStyle(style, true); + } +}); + +Effect.Transform = Class.create({ + initialize: function(tracks){ + this.tracks = []; + this.options = arguments[1] || { }; + this.addTracks(tracks); + }, + addTracks: function(tracks){ + tracks.each(function(track){ + track = $H(track); + var data = track.values().first(); + this.tracks.push($H({ + ids: track.keys().first(), + effect: Effect.Morph, + options: { style: data } + })); + }.bind(this)); + return this; + }, + play: function(){ + return new Effect.Parallel( + this.tracks.map(function(track){ + var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); + var elements = [$(ids) || $$(ids)].flatten(); + return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); + }).flatten(), + this.options + ); + } +}); + +Element.CSS_PROPERTIES = $w( + 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + + 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + + 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + + 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + + 'fontSize fontWeight height left letterSpacing lineHeight ' + + 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ + 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + + 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + + 'right textIndent top width wordSpacing zIndex'); + +Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; + +String.__parseStyleElement = document.createElement('div'); +String.prototype.parseStyle = function(){ + var style, styleRules = $H(); + if (Prototype.Browser.WebKit) + style = new Element('div',{style:this}).style; + else { + String.__parseStyleElement.innerHTML = '
            '; + style = String.__parseStyleElement.childNodes[0].style; + } + + Element.CSS_PROPERTIES.each(function(property){ + if (style[property]) styleRules.set(property, style[property]); + }); + + if (Prototype.Browser.IE && this.include('opacity')) + styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); + + return styleRules; +}; + +if (document.defaultView && document.defaultView.getComputedStyle) { + Element.getStyles = function(element) { + var css = document.defaultView.getComputedStyle($(element), null); + return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { + styles[property] = css[property]; + return styles; + }); + }; +} else { + Element.getStyles = function(element) { + element = $(element); + var css = element.currentStyle, styles; + styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) { + results[property] = css[property]; + return results; + }); + if (!styles.opacity) styles.opacity = element.getOpacity(); + return styles; + }; +}; + +Effect.Methods = { + morph: function(element, style) { + element = $(element); + new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); + return element; + }, + visualEffect: function(element, effect, options) { + element = $(element) + var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); + new Effect[klass](element, options); + return element; + }, + highlight: function(element, options) { + element = $(element); + new Effect.Highlight(element, options); + return element; + } +}; + +$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ + 'pulsate shake puff squish switchOff dropOut').each( + function(effect) { + Effect.Methods[effect] = function(element, options){ + element = $(element); + Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); + return element; + } + } +); + +$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( + function(f) { Effect.Methods[f] = Element[f]; } +); + +Element.addMethods(Effect.Methods); diff --git a/templates/website/ph2date/chat_assets/js/export.js b/templates/website/ph2date/chat_assets/js/export.js index 681870d..352d424 100755 --- a/templates/website/ph2date/chat_assets/js/export.js +++ b/templates/website/ph2date/chat_assets/js/export.js @@ -1,13 +1,13 @@ -$(document).ready(function(){$("#plugins").change(function(){$(".format_specific_options").each(function(){$(this).hide()});var a=$("#plugins option:selected").attr("value");$("#"+a+"_options").show()})}); -$(document).ready(function(){$("input[type='radio'][name$='sql_structure_or_data']").change(function(){if($("input[type='radio'][name$='sql_structure_or_data']:checked").attr("value")=="data"){$("#checkbox_sql_dates").parent().fadeTo("fast",0.4);$("#checkbox_sql_dates").attr("disabled","disabled");$("#checkbox_sql_relation").parent().fadeTo("fast",0.4);$("#checkbox_sql_relation").attr("disabled","disabled");$("#checkbox_sql_mime").parent().fadeTo("fast",0.4);$("#checkbox_sql_mime").attr("disabled", -"disabled")}else{$("#checkbox_sql_dates").parent().fadeTo("fast",1);$("#checkbox_sql_dates").removeAttr("disabled");$("#checkbox_sql_relation").parent().fadeTo("fast",1);$("#checkbox_sql_relation").removeAttr("disabled");$("#checkbox_sql_mime").parent().fadeTo("fast",1);$("#checkbox_sql_mime").removeAttr("disabled")}})}); -function toggle_structure_data_opts(a){var b="#"+a+"_data",c="#"+a+"_structure";a=$("input[type='radio'][name='"+(a+"_structure_or_data")+"']:checked").attr("value");if(a=="data"){$(b).slideDown("slow");$(c).slideUp("slow")}else{$(c).slideDown("slow");a=="structure"?$(b).slideUp("slow"):$(b).slideDown("slow")}} -$(document).ready(function(){$("input[type='radio'][name='latex_structure_or_data']").change(function(){toggle_structure_data_opts("latex")});$("input[type='radio'][name='odt_structure_or_data']").change(function(){toggle_structure_data_opts("odt")});$("input[type='radio'][name='texytext_structure_or_data']").change(function(){toggle_structure_data_opts("texytext")});$("input[type='radio'][name='htmlword_structure_or_data']").change(function(){toggle_structure_data_opts("htmlword")});$("input[type='radio'][name='sql_structure_or_data']").change(function(){toggle_structure_data_opts("sql")})}); -function toggle_save_to_file(){if($("#radio_dump_asfile:checked").length==0){$("#ul_save_asfile > li").fadeTo("fast",0.4);$("#ul_save_asfile > li > input").attr("disabled","disabled");$("#ul_save_asfile > li> select").attr("disabled","disabled")}else{$("#ul_save_asfile > li").fadeTo("fast",1);$("#ul_save_asfile > li > input").removeAttr("disabled");$("#ul_save_asfile > li> select").removeAttr("disabled")}}$(document).ready(function(){toggle_save_to_file();$("input[type='radio'][name='output_format']").change(function(){toggle_save_to_file()})}); -function toggle_sql_include_comments(){$("#checkbox_sql_include_comments").change(function(){if($("#checkbox_sql_include_comments:checked").length==0){$("#ul_include_comments > li").fadeTo("fast",0.4);$("#ul_include_comments > li > input").attr("disabled","disabled")}else if($("#radio_sql_structure_or_data_data:checked").length==1){$("#text_sql_header_comment").parent("li").fadeTo("fast",1);$("#text_sql_header_comment").removeAttr("disabled")}else{$("#ul_include_comments > li").fadeTo("fast",1);$("#ul_include_comments > li > input").removeAttr("disabled")}})} -$(document).ready(function(){$("#checkbox_sql_create_table_statements").change(function(){if($("#checkbox_sql_create_table_statements:checked").length==0){$("#checkbox_sql_if_not_exists").removeAttr("checked");$("#checkbox_sql_auto_increment").removeAttr("checked")}else{$("#checkbox_sql_if_not_exists").attr("checked","checked");$("#checkbox_sql_auto_increment").attr("checked","checked")}})}); -$(document).ready(function(){$("#plugins").change(function(){var a=$("#plugins option:selected").attr("value");if($("#force_file_"+a).attr("value")=="true"){$("#radio_view_as_text").attr("disabled","disabled");$("#radio_view_as_text").parent().fadeTo("fast",0.4)}else{$("#radio_view_as_text").removeAttr("disabled");$("#radio_view_as_text").parent().fadeTo("fast",1)}})}); -function toggle_quick_or_custom(){if($("$(this):checked").attr("value")=="custom"){$("#databases_and_tables").show();$("#rows").show();$("#output").show();$("#format_specific_opts").show();$("#output_quick_export").hide();var a=$("#plugins option:selected").attr("value");$("#"+a+"_options").show()}else{$("#databases_and_tables").hide();$("#rows").hide();$("#output").hide();$("#format_specific_opts").hide();$("#output_quick_export").show()}}$(document).ready(function(){$("input[type='radio'][name='quick_or_custom']").change(function(){toggle_quick_or_custom()})}); -$(document).ready(function(){$("input[type='hidden'][name='export_method']").attr("value")!="custom-no-form"&&$("#quick_or_custom").show();$("#scroll_to_options_msg").hide();$(".format_specific_options").hide();$(".format_specific_options").css({border:0,margin:0,padding:0});$(".format_specific_options h3").remove();toggle_quick_or_custom();toggle_structure_data_opts($("select[id='plugins']").attr("value"));toggle_sql_include_comments()}); -$(document).ready(function(){$("input[type='radio'][name='allrows']").change(function(){if($("input[type='radio'][name='allrows']:checked").attr("value")=="1"){$("label[for='limit_to']").fadeTo("fast",0.4);$("label[for='limit_from']").fadeTo("fast",0.4);$("input[type='text'][name='limit_to']").attr("disabled","disabled");$("input[type='text'][name='limit_from']").attr("disabled","disabled")}else{$("label[for='limit_to']").fadeTo("fast",1);$("label[for='limit_from']").fadeTo("fast",1);$("input[type='text'][name='limit_to']").removeAttr("disabled"); -$("input[type='text'][name='limit_from']").removeAttr("disabled")}})}); +$(document).ready(function(){$("#plugins").change(function(){$(".format_specific_options").each(function(){$(this).hide()});var a=$("#plugins option:selected").attr("value");$("#"+a+"_options").show()})}); +$(document).ready(function(){$("input[type='radio'][name$='sql_structure_or_data']").change(function(){if($("input[type='radio'][name$='sql_structure_or_data']:checked").attr("value")=="data"){$("#checkbox_sql_dates").parent().fadeTo("fast",0.4);$("#checkbox_sql_dates").attr("disabled","disabled");$("#checkbox_sql_relation").parent().fadeTo("fast",0.4);$("#checkbox_sql_relation").attr("disabled","disabled");$("#checkbox_sql_mime").parent().fadeTo("fast",0.4);$("#checkbox_sql_mime").attr("disabled", +"disabled")}else{$("#checkbox_sql_dates").parent().fadeTo("fast",1);$("#checkbox_sql_dates").removeAttr("disabled");$("#checkbox_sql_relation").parent().fadeTo("fast",1);$("#checkbox_sql_relation").removeAttr("disabled");$("#checkbox_sql_mime").parent().fadeTo("fast",1);$("#checkbox_sql_mime").removeAttr("disabled")}})}); +function toggle_structure_data_opts(a){var b="#"+a+"_data",c="#"+a+"_structure";a=$("input[type='radio'][name='"+(a+"_structure_or_data")+"']:checked").attr("value");if(a=="data"){$(b).slideDown("slow");$(c).slideUp("slow")}else{$(c).slideDown("slow");a=="structure"?$(b).slideUp("slow"):$(b).slideDown("slow")}} +$(document).ready(function(){$("input[type='radio'][name='latex_structure_or_data']").change(function(){toggle_structure_data_opts("latex")});$("input[type='radio'][name='odt_structure_or_data']").change(function(){toggle_structure_data_opts("odt")});$("input[type='radio'][name='texytext_structure_or_data']").change(function(){toggle_structure_data_opts("texytext")});$("input[type='radio'][name='htmlword_structure_or_data']").change(function(){toggle_structure_data_opts("htmlword")});$("input[type='radio'][name='sql_structure_or_data']").change(function(){toggle_structure_data_opts("sql")})}); +function toggle_save_to_file(){if($("#radio_dump_asfile:checked").length==0){$("#ul_save_asfile > li").fadeTo("fast",0.4);$("#ul_save_asfile > li > input").attr("disabled","disabled");$("#ul_save_asfile > li> select").attr("disabled","disabled")}else{$("#ul_save_asfile > li").fadeTo("fast",1);$("#ul_save_asfile > li > input").removeAttr("disabled");$("#ul_save_asfile > li> select").removeAttr("disabled")}}$(document).ready(function(){toggle_save_to_file();$("input[type='radio'][name='output_format']").change(function(){toggle_save_to_file()})}); +function toggle_sql_include_comments(){$("#checkbox_sql_include_comments").change(function(){if($("#checkbox_sql_include_comments:checked").length==0){$("#ul_include_comments > li").fadeTo("fast",0.4);$("#ul_include_comments > li > input").attr("disabled","disabled")}else if($("#radio_sql_structure_or_data_data:checked").length==1){$("#text_sql_header_comment").parent("li").fadeTo("fast",1);$("#text_sql_header_comment").removeAttr("disabled")}else{$("#ul_include_comments > li").fadeTo("fast",1);$("#ul_include_comments > li > input").removeAttr("disabled")}})} +$(document).ready(function(){$("#checkbox_sql_create_table_statements").change(function(){if($("#checkbox_sql_create_table_statements:checked").length==0){$("#checkbox_sql_if_not_exists").removeAttr("checked");$("#checkbox_sql_auto_increment").removeAttr("checked")}else{$("#checkbox_sql_if_not_exists").attr("checked","checked");$("#checkbox_sql_auto_increment").attr("checked","checked")}})}); +$(document).ready(function(){$("#plugins").change(function(){var a=$("#plugins option:selected").attr("value");if($("#force_file_"+a).attr("value")=="true"){$("#radio_view_as_text").attr("disabled","disabled");$("#radio_view_as_text").parent().fadeTo("fast",0.4)}else{$("#radio_view_as_text").removeAttr("disabled");$("#radio_view_as_text").parent().fadeTo("fast",1)}})}); +function toggle_quick_or_custom(){if($("$(this):checked").attr("value")=="custom"){$("#databases_and_tables").show();$("#rows").show();$("#output").show();$("#format_specific_opts").show();$("#output_quick_export").hide();var a=$("#plugins option:selected").attr("value");$("#"+a+"_options").show()}else{$("#databases_and_tables").hide();$("#rows").hide();$("#output").hide();$("#format_specific_opts").hide();$("#output_quick_export").show()}}$(document).ready(function(){$("input[type='radio'][name='quick_or_custom']").change(function(){toggle_quick_or_custom()})}); +$(document).ready(function(){$("input[type='hidden'][name='export_method']").attr("value")!="custom-no-form"&&$("#quick_or_custom").show();$("#scroll_to_options_msg").hide();$(".format_specific_options").hide();$(".format_specific_options").css({border:0,margin:0,padding:0});$(".format_specific_options h3").remove();toggle_quick_or_custom();toggle_structure_data_opts($("select[id='plugins']").attr("value"));toggle_sql_include_comments()}); +$(document).ready(function(){$("input[type='radio'][name='allrows']").change(function(){if($("input[type='radio'][name='allrows']:checked").attr("value")=="1"){$("label[for='limit_to']").fadeTo("fast",0.4);$("label[for='limit_from']").fadeTo("fast",0.4);$("input[type='text'][name='limit_to']").attr("disabled","disabled");$("input[type='text'][name='limit_from']").attr("disabled","disabled")}else{$("label[for='limit_to']").fadeTo("fast",1);$("label[for='limit_from']").fadeTo("fast",1);$("input[type='text'][name='limit_to']").removeAttr("disabled"); +$("input[type='text'][name='limit_from']").removeAttr("disabled")}})}); diff --git a/templates/website/ph2date/chat_assets/js/functions.js b/templates/website/ph2date/chat_assets/js/functions.js index a24b394..3bee980 100755 --- a/templates/website/ph2date/chat_assets/js/functions.js +++ b/templates/website/ph2date/chat_assets/js/functions.js @@ -1,67 +1,67 @@ -var captionLength = 0; -var caption = ""; - -$(document).ready(function() -{ - setInterval ( "cursorAnimation()", 600 ); -}); - -function testTypingEffect() -{ - caption = $("input#userCaption").val(); - type(); -} - -function type() -{ - $('p.caption').html(caption.substr(0, captionLength++)); - if(captionLength < caption.length+1) - { - setTimeout("type()", 100); - } - else - { - captionLength = 0; - caption = ""; - testTypingEffect(); - } -} - -function testErasingEffect() -{ - caption = $("p.caption").html(); - captionLength = caption.length; - if (captionLength>0) - { - erase(); - } - else - { - $('p.caption').html("You didn't write anything to erase, but ok!"); - setTimeout("testErasingEffect()", 1000); - } -} - -function erase() -{ - $('p.caption').html(caption.substr(0, captionLength--)); - if(captionLength >= 0) - { - setTimeout("erase()", 100); - } - else { - captionLength = 0; - caption = ""; - } -} - -function cursorAnimation() -{ - $("p.cursor").animate( - { - opacity: 0 - }, "fast", "swing").animate( - { - opacity: 1 - }, "fast", "swing"); -} +var captionLength = 0; +var caption = ""; + +$(document).ready(function() +{ + setInterval ( "cursorAnimation()", 600 ); +}); + +function testTypingEffect() +{ + caption = $("input#userCaption").val(); + type(); +} + +function type() +{ + $('p.caption').html(caption.substr(0, captionLength++)); + if(captionLength < caption.length+1) + { + setTimeout("type()", 100); + } + else + { + captionLength = 0; + caption = ""; + testTypingEffect(); + } +} + +function testErasingEffect() +{ + caption = $("p.caption").html(); + captionLength = caption.length; + if (captionLength>0) + { + erase(); + } + else + { + $('p.caption').html("You didn't write anything to erase, but ok!"); + setTimeout("testErasingEffect()", 1000); + } +} + +function erase() +{ + $('p.caption').html(caption.substr(0, captionLength--)); + if(captionLength >= 0) + { + setTimeout("erase()", 100); + } + else { + captionLength = 0; + caption = ""; + } +} + +function cursorAnimation() +{ + $("p.cursor").animate( + { + opacity: 0 + }, "fast", "swing").animate( + { + opacity: 1 + }, "fast", "swing"); +} diff --git a/templates/website/ph2date/chat_assets/js/ga.js b/templates/website/ph2date/chat_assets/js/ga.js index 4e9862c..541e574 100755 --- a/templates/website/ph2date/chat_assets/js/ga.js +++ b/templates/website/ph2date/chat_assets/js/ga.js @@ -1,42 +1,42 @@ -(function(){var k=void 0,aa=encodeURIComponent,m=window,o=String,p=Math,ba="push",ca="cookie",q="charAt",r="indexOf",t="gaGlobal",da="getTime",v="toString",w="window",x="length",y="document",z="split",A="location",ea="protocol",fa="href",C="substring",D="join",E="toLowerCase";var ga="_gat",ha="_gaq",ia="4.9.2",ja="_gaUserPrefs",ka="ioo",F="&",H="=",I="__utma=",la="__utmb=",ma="__utmc=",na="__utmk=",J="__utmv=",K="__utmz=",oa="__utmx=",pa="GASO=";var qa=function(){var c=this,f=[],b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";c.set=function(b){f[b]=!0};c.Kc=function(){for(var c=[],e=0;e=0};b.Uc=function(){return b.Kb("Firefox")&&![].reduce};b.mb=function(c){if(!c||!b.Kb("Firefox"))return c;for(var c=c.replace(/\n|\r/g," "),e=0,f=c[x];e-1&&(b=c[r](b,e),b<0&&(b=c[x]),i=c[C](e+f[r](H)+1,b)));return i},wa=function(c){var f=!1,b=0,i,e;if(!O(c)){f= -!0;for(i=0;i-1)}return f},Q=function(c,f){var b=aa;return b instanceof Function?f?encodeURI(c):b(c):(L(68),escape(c))},za=function(c,f){var b=decodeURIComponent,i,c=c[z]("+")[D](" ");if(b instanceof Function)try{i=f?decodeURI(c):b(c)}catch(e){L(17),i=unescape(c)}else L(68),i=unescape(c);return i},R=function(c,f){return c[r](f)>-1}; -function Aa(c){if(!c||""==c)return"";for(;c[q](0)[x]>0&&" \n\r\t"[r](c[q](0))>-1;)c=c[C](1);for(;c[q](c[x]-1)[x]>0&&" \n\r\t"[r](c[q](c[x]-1))>-1;)c=c[C](0,c[x]-1);return c}var T=function(c,f){c[ba]||L(94);c[c[x]]=f},Ba=function(c){var f=1,b=0,i;if(!O(c)){f=0;for(i=c[x]-1;i>=0;i--)b=c.charCodeAt(i),f=(f<<6&268435455)+b+(b<<14),b=f&266338304,f=b!=0?f^b>>21:f}return f},Ca=function(){return p.round(p.random()*2147483647)},Da=function(){};var Ea=function(c,f){this.fb=c;this.gb=f},Fa=function(){function c(b){for(var c=[],b=b[z](","),e,f=0;f0&&(h=h[z]("^")[0]);b=h[z](":");h=b[1];c=parseInt(b[0],10);!j&&c0?i(b):"";l.o&&(d=e.Gc(M[y][ca],a,l.o,d,b),a="2"+a,j=b>0?i(l.s):"");a+=d;a=M.mb(a);a[x]>2E3&&(L(69),a=a[C](0,2E3));j=a+"; path="+l.f+"; "+j+e.eb();M[y].cookie=j};e.Gc=function(a,d,c,j,h){var g="",h=h||l.s,j=b([j,e.m+h*1],c),g=P(a,"2"+d,";");if(!O(g))return a=b(f(a,d,c,!0),c),g=g[z](a)[D](""),g=j+g;return j};e.eb=function(){return O(l.b)?"":"domain="+l.b+ -";"}};var Ha=function(c){function f(a){a=va(a)?a[D]("."):"";return O(a)?"-":a}function b(a,n){var d=[],b;if(!O(a)&&(d=a[z]("."),n))for(b=0;b')}catch(l){e=i.createElement("iframe"),e.name=f}e.height="0";e.width="0";e.style.display="none";e.style.visibility="hidden";var g=i[A], -g=g[ea]+"//"+g.host+"/favicon.ico",g=Ia+"u/post_iframe.html#"+aa(g),a=function(){e.src="";e.parentNode&&e.parentNode.removeChild(e)};ua(M[w],"beforeunload",a);var d=!1,u=0,j=function(){if(!d){try{if(u>9||e.contentWindow[A].host==i[A].host){d=!0;a();var c=M[w],g="beforeunload",n=a;c.removeEventListener?c.removeEventListener(g,n,!1):c.detachEvent&&c.detachEvent("on"+g,n);b&&b();return}}catch(f){}u++;M.setTimeout(j,200)}};ua(e,"load",j);i.body.appendChild(e);e.src=g}else M.setTimeout(function(){c.Jb(f, -b)},100)}};var Ma=function(c){var f=this,b=c,i=new Ha(b),e=new La,l=!V.Ec(),g=function(){};f.Mc=function(){return"https:"==M[y][A][ea]?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif"};f.B=function(a,d,c,j,h,s){var n=b.A,N=M[y][A];i.Z(c);var B=i.z()[z](".");if(B[1]<500||j){if(h){var S=(new Date)[da](),Y;Y=(S-B[3])*(b.uc/1E3);Y>=1&&(B[2]=p.min(p.floor(B[2]*1+Y),b.tc),B[3]=S)}if(j||!h||B[2]>=1){!j&&h&&(B[2]=B[2]*1-1);j=B[1]*1+1;B[1]=j;h="utmwv="+ia;S="&utms="+j;Y="&utmn="+ -Ca();j=h+"e"+S+Y;a=h+S+Y+(O(N.hostname)?"":"&utmhn="+Q(N.hostname))+(b.L==100?"":"&utmsp="+Q(b.L))+a;if(0==n||2==n)N=2==n?g:s||g,l&&e.xb(b.ha,a,j,N,!0);if(1==n||2==n)d="&utmac="+d,j+=d,a+=d+"&utmcc="+f.Lc(c),V.wb&&(c="&aip=1",j+=c,a+=c),a+="&utmu="+ra.Kc(),l&&e.xb(f.Mc(),a,j,s)}}i.$(B[D]("."));i.aa()};f.Lc=function(a){for(var d=[],b=[I,K,J,oa],c=i.g(),h,g=0;g0)for(b=0;b0;)c+=a--^d++;return Ba(c)}};var X=function(c,f,b,i){function e(a){var d="",d=a[z]("://")[1][E]();R(d,"/")&&(d=d[z]("/")[0]);return d}var l=i,g=this;g.a=c;g.lb=f;g.m=b;g.jb=function(a){var d=g.ta();return new X.v(P(a,l.Ca+H,F),P(a,l.Fa+H,F),P(a,l.Ha+H,F),g.R(a,l.Aa,"(not set)"),g.R(a,l.Da,"(not set)"),g.R(a,l.Ga,d&&!O(d.G)?za(d.G):k),g.R(a,l.Ba,k))};g.kb=function(a){var d=e(a),b;b=a;var c="";b=b[z]("://")[1][E]();R(b,"/")&&(b=b[z]("/")[1],R(b,"?")&&(c=b[z]("?")[0]));b=c;if(R(d,"google")&&(a=a[z]("?")[D](F),R(a,F+l.rc+H)&&b== -l.qc))return!0;return!1};g.ta=function(){var a,d=g.lb,b,c=l.J;if(!O(d)&&"0"!=d&&R(d,"://")&&!g.kb(d)){a=e(d);for(var h=0;h9?i[C](n+1)*1:0,f++,i=0==i?1:i,a.ab([B,g.m,i,f,e.H()][D](".")),a.ra()}}}}; -X.v=function(c,f,b,i,e,l,g){var a=this;a.q=c;a.Q=f;a.wa=b;a.n=i;a.P=e;a.G=l;a.Cb=g;a.H=function(){var b=[],c=[["cid",a.q],["csr",a.Q],["gclid",a.wa],["ccn",a.n],["cmd",a.P],["ctr",a.G],["cct",a.Cb]],e,g;if(a.bb())for(e=0;e0&&b<=a.Ra&&(d=Q(d),c=Q(c),d[x]+c[x]<=64&&(e.r[b]=[d,c,g],e.T(),n=!0));return n};e.Ub=function(a){if((a=e.r[a])&&1===a[2])return a[1]};e.Tb=function(a){var b=e.r;b[a]&&(delete b[a],e.T())};e.Hc=function(){d.t(8);d.t(9);d.t(11);var a=e.r,b,c;for(c in a)if(b=a[c])d.j(8,c,b[0]),d.j(9,c,b[1]),(b=b[2])&&3!=b&&d.j(11,c,""+b)}};var Pa=function(){function c(a,b,c,d){k==g[a]&&(g[a]={});k==g[a][b]&&(g[a][b]=[]);g[a][b][c]=d}function f(a,b,c){if(k!=g[a]&&k!=g[a][b])return g[a][b][c]}function b(a,b){if(k!=g[a]&&k!=g[a][b]){g[a][b]=k;var c=!0,d;for(d=0;d0?b+"00":"0"};b.vb=function(){var c=b.Bc();if(c==k||isNaN(c))return!1;if(c<=0)return!0;if(c>2147483648)return!1; -var a=b.ub;a.t(14);a.ia(14);var d=b.Ac(c);a.j(14,1,d)&&a.ma(14,1,c)&&b.Cc();i&&i.isValidLoadTime!=k&&i.setPageReadyTime();return!1};b.Ua=function(){if(!b.Dc())return!1;if(M[w].top!=M[w])return!1;b.vb()&&ua(M[w],"load",b.vb,!1);return!0}};var $=function(){};$.Pc=function(c){var f="gaso=",b=M[y][A].hash;c=b&&1==b[r](f)?P(b,f,F):(b=M[w].name)&&0<=b[r](f)?P(b,f,F):P(c.g(),pa,";");return c};$.Rc=function(c,f){var b=(f||"www")+".google.com",b="https://"+b+"/analytics/reporting/overlay_js?gaso="+c+F+Ca(),i="_gasojs",e=M[y].createElement("script");e.type="text/javascript";e.src=b;if(i)e.id=i;(M[y].getElementsByTagName("head")[0]||M[y].getElementsByTagName("body")[0]).appendChild(e)}; -$.load=function(c,f){if(!$.Qc){var b=$.Pc(f),i=b&&b.match(/^(?:\|([-0-9a-z.]{1,30})\|)?([-.\w]{10,1200})$/i);if(i)f.xc(b),f.yc(),V._gasoDomain=c.b,V._gasoCPath=c.f,$.Rc(i[2],i[1]);$.Qc=!0}};var Sa=function(c,f,b){function i(){if("auto"==j.b){var a=M[y].domain;"www."==a[C](0,4)&&(a=a[C](4));j.b=a}j.b=j.b[E]()}function e(){i();var a=j.b,b=a[r]("www.google.")*a[r](".google.")*a[r]("google.");return b||"/"!=j.f||a[r]("google.org")>-1}function l(b,c,d){if(O(b)||O(c)||O(d))return"-";b=P(b,I+a.a+".",c);O(b)||(b=b[z]("."),b[5]=""+(b[5]?b[5]*1+1:1),b[3]=b[4],b[4]=d,b=b[D]("."));return b}function g(){return"file:"!=M[y][A][ea]&&e()}var a=this,d=ta(a),u=k,j=new Fa,h=!1,s=k;a.n=c;a.m=p.round((new Date)[da]()/ -1E3);a.p=f||"UA-XXXXX-X";a.Ya=M[y].referrer;a.oa=k;a.d=k;a.F=!1;a.O=k;a.e=k;a.Za=k;a.pa=k;a.a=k;a.k=k;j.o=b?Q(b):k;a.hc=function(){return Ca()^a.O.Zb()&2147483647};a.gc=function(){if(!j.b||""==j.b||"none"==j.b)return j.b="",1;i();return j.Ta?Ba(j.b):1};a.fc=function(a,b){if(O(a))a="-";else{b+=j.f&&"/"!=j.f?j.f:"";var c=a[r](b),a=c>=0&&c<=8?"0":"["==a[q](0)&&"]"==a[q](a[x]-1)?"-":a}return a};a.na=function(b){var c="";c+=j.ja?a.O.$b():"";c+=j.ka&&!O(M[y].title)?"&utmdt="+Q(M[y].title):"";var d;d=k; -M[w]&&M[w][t]&&M[w][t].hid?d=M[w][t].hid:(d=Ca(),M[w].gaGlobal=M[w][t]?M[w][t]:{},M[w][t].hid=d);c+="&utmhid="+d+"&utmr="+Q(o(a.oa))+"&utmp="+Q(a.kc(b));return c};a.kc=function(a){var b=M[y][A];a&&L(13);return a=k!=a&&""!=a?Q(a,!0):Q(b.pathname+b.search,!0)};a.pc=function(b){if(a.D()){var c="";a.e!=k&&a.e.C()[x]>0&&(c+="&utme="+Q(a.e.C()));c+=a.na(b);u.B(c,a.p,a.a)}};a.ec=function(){var b=new Ha(j);return b.Z(a.a)?b.Pb():k};a.$a=d("_getLinkerUrl",52,function(b,c){var d=b[z]("#"),e=b,f=a.ec();if(f)if(c&& -1>=d[x])e+="#"+f;else if(!c||1>=d[x])1>=d[x]?e+=(R(b,"?")?F:"?")+f:e=d[0]+(R(b,"?")?F:"?")+f+"#"+d[1];return e});a.ic=function(){var b=a.m,c=a.k,d=c.g(),e=a.a+"",f=M[w]?M[w][t]:k,g,i=R(d,I+e+"."),h=R(d,la+e),u=R(d,ma+e),s,G=[],Z="",Ka=!1,d=O(d)?"":d;if(j.w){g=M[y][A]&&M[y][A].hash?M[y][A][fa][C](M[y][A][fa][r]("#")):"";j.U&&!O(g)&&(Z=g+F);Z+=M[y][A].search;!O(Z)&&R(Z,I)&&(c.Ob(Z),c.za()||c.Mb(),s=c.ba());g=c.ea;var xa=c.Na,U=c.Qa;O(g())||(xa(za(g())),R(g(),";")||U());g=c.da;xa=c.X;U=c.Y;O(g())||(xa(g()), -R(g(),";")||U())}O(s)?i?(s=!h||!u)?(s=l(d,";",o(b)),a.F=!0):(s=P(d,I+e+".",";"),G=P(d,la+e,";")[z](".")):(s=[e,a.hc(),b,b,b,1][D]("."),Ka=a.F=!0):O(c.z())||O(c.ca())?(s=l(Z,F,o(b)),a.F=!0):(G=c.z()[z]("."),e=G[0]);s=s[z](".");M[w]&&f&&f.dh==e&&!j.o&&(s[4]=f.sid?f.sid:s[4],Ka&&(s[3]=f.sid?f.sid:s[4],f.vid&&(b=f.vid[z]("."),s[1]=b[0],s[2]=b[1])));c.La(s[D]("."));G[0]=e;G[1]=G[1]?G[1]:0;G[2]=k!=G[2]?G[2]:j.Yb;G[3]=G[3]?G[3]:s[4];c.$(G[D]("."));c.Ma(e);O(c.Nb())||c.fa(c.K());c.Oa();c.aa();c.Pa()};a.jc= -function(){u=new Ma(j)};a.getName=d("_getName",58,function(){return a.n});a.c=d("_initData",2,function(){var b;if(!h){if(!a.O)a.O=new Na(j.la);a.a=a.gc();a.k=new Ha(j);a.e=new Pa;s=new Oa(j,o(a.a),a.k,a.e);a.jc()}if(g()){if(!h)a.oa=a.fc(a.Ya,M[y].domain),b=new X(o(a.a),a.oa,a.m,j);a.ic(b);s.Vb()}if(!h)g()&&b.Lb(a.k,a.F),a.Za=new Pa,$.load(j,a.k),h=!0});a.Va=d("_visitCode",54,function(){a.c();var b=P(a.k.g(),I+a.a+".",";"),b=b[z](".");return b[x]<4?"":b[1]});a.gd=d("_cookiePathCopy",30,function(b){a.c(); -a.k&&a.k.Qb(a.a,b)});a.D=function(){return a.Va()%1E40&&(f=g[C](0,a),g=g[C](a+1));var d=f==ga?V:f==ha?Ua:V.Db(f);d[g].apply(d,b[e].slice(1))}}catch(u){c++}return c}};var V=new Ta;var Wa=m[ga];Wa&&typeof Wa._getTracker=="function"?V=Wa:m[ga]=V;var Ua=new Va;a:{var Xa=m[ha],Ya=!1;if(Xa&&typeof Xa[ba]=="function"&&(Ya=va(Xa),!Ya))break a;m[ha]=Ua;Ya&&Ua[ba].apply(Ua,Xa)};})() +(function(){var k=void 0,aa=encodeURIComponent,m=window,o=String,p=Math,ba="push",ca="cookie",q="charAt",r="indexOf",t="gaGlobal",da="getTime",v="toString",w="window",x="length",y="document",z="split",A="location",ea="protocol",fa="href",C="substring",D="join",E="toLowerCase";var ga="_gat",ha="_gaq",ia="4.9.2",ja="_gaUserPrefs",ka="ioo",F="&",H="=",I="__utma=",la="__utmb=",ma="__utmc=",na="__utmk=",J="__utmv=",K="__utmz=",oa="__utmx=",pa="GASO=";var qa=function(){var c=this,f=[],b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";c.set=function(b){f[b]=!0};c.Kc=function(){for(var c=[],e=0;e=0};b.Uc=function(){return b.Kb("Firefox")&&![].reduce};b.mb=function(c){if(!c||!b.Kb("Firefox"))return c;for(var c=c.replace(/\n|\r/g," "),e=0,f=c[x];e-1&&(b=c[r](b,e),b<0&&(b=c[x]),i=c[C](e+f[r](H)+1,b)));return i},wa=function(c){var f=!1,b=0,i,e;if(!O(c)){f= +!0;for(i=0;i-1)}return f},Q=function(c,f){var b=aa;return b instanceof Function?f?encodeURI(c):b(c):(L(68),escape(c))},za=function(c,f){var b=decodeURIComponent,i,c=c[z]("+")[D](" ");if(b instanceof Function)try{i=f?decodeURI(c):b(c)}catch(e){L(17),i=unescape(c)}else L(68),i=unescape(c);return i},R=function(c,f){return c[r](f)>-1}; +function Aa(c){if(!c||""==c)return"";for(;c[q](0)[x]>0&&" \n\r\t"[r](c[q](0))>-1;)c=c[C](1);for(;c[q](c[x]-1)[x]>0&&" \n\r\t"[r](c[q](c[x]-1))>-1;)c=c[C](0,c[x]-1);return c}var T=function(c,f){c[ba]||L(94);c[c[x]]=f},Ba=function(c){var f=1,b=0,i;if(!O(c)){f=0;for(i=c[x]-1;i>=0;i--)b=c.charCodeAt(i),f=(f<<6&268435455)+b+(b<<14),b=f&266338304,f=b!=0?f^b>>21:f}return f},Ca=function(){return p.round(p.random()*2147483647)},Da=function(){};var Ea=function(c,f){this.fb=c;this.gb=f},Fa=function(){function c(b){for(var c=[],b=b[z](","),e,f=0;f0&&(h=h[z]("^")[0]);b=h[z](":");h=b[1];c=parseInt(b[0],10);!j&&c0?i(b):"";l.o&&(d=e.Gc(M[y][ca],a,l.o,d,b),a="2"+a,j=b>0?i(l.s):"");a+=d;a=M.mb(a);a[x]>2E3&&(L(69),a=a[C](0,2E3));j=a+"; path="+l.f+"; "+j+e.eb();M[y].cookie=j};e.Gc=function(a,d,c,j,h){var g="",h=h||l.s,j=b([j,e.m+h*1],c),g=P(a,"2"+d,";");if(!O(g))return a=b(f(a,d,c,!0),c),g=g[z](a)[D](""),g=j+g;return j};e.eb=function(){return O(l.b)?"":"domain="+l.b+ +";"}};var Ha=function(c){function f(a){a=va(a)?a[D]("."):"";return O(a)?"-":a}function b(a,n){var d=[],b;if(!O(a)&&(d=a[z]("."),n))for(b=0;b')}catch(l){e=i.createElement("iframe"),e.name=f}e.height="0";e.width="0";e.style.display="none";e.style.visibility="hidden";var g=i[A], +g=g[ea]+"//"+g.host+"/favicon.ico",g=Ia+"u/post_iframe.html#"+aa(g),a=function(){e.src="";e.parentNode&&e.parentNode.removeChild(e)};ua(M[w],"beforeunload",a);var d=!1,u=0,j=function(){if(!d){try{if(u>9||e.contentWindow[A].host==i[A].host){d=!0;a();var c=M[w],g="beforeunload",n=a;c.removeEventListener?c.removeEventListener(g,n,!1):c.detachEvent&&c.detachEvent("on"+g,n);b&&b();return}}catch(f){}u++;M.setTimeout(j,200)}};ua(e,"load",j);i.body.appendChild(e);e.src=g}else M.setTimeout(function(){c.Jb(f, +b)},100)}};var Ma=function(c){var f=this,b=c,i=new Ha(b),e=new La,l=!V.Ec(),g=function(){};f.Mc=function(){return"https:"==M[y][A][ea]?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif"};f.B=function(a,d,c,j,h,s){var n=b.A,N=M[y][A];i.Z(c);var B=i.z()[z](".");if(B[1]<500||j){if(h){var S=(new Date)[da](),Y;Y=(S-B[3])*(b.uc/1E3);Y>=1&&(B[2]=p.min(p.floor(B[2]*1+Y),b.tc),B[3]=S)}if(j||!h||B[2]>=1){!j&&h&&(B[2]=B[2]*1-1);j=B[1]*1+1;B[1]=j;h="utmwv="+ia;S="&utms="+j;Y="&utmn="+ +Ca();j=h+"e"+S+Y;a=h+S+Y+(O(N.hostname)?"":"&utmhn="+Q(N.hostname))+(b.L==100?"":"&utmsp="+Q(b.L))+a;if(0==n||2==n)N=2==n?g:s||g,l&&e.xb(b.ha,a,j,N,!0);if(1==n||2==n)d="&utmac="+d,j+=d,a+=d+"&utmcc="+f.Lc(c),V.wb&&(c="&aip=1",j+=c,a+=c),a+="&utmu="+ra.Kc(),l&&e.xb(f.Mc(),a,j,s)}}i.$(B[D]("."));i.aa()};f.Lc=function(a){for(var d=[],b=[I,K,J,oa],c=i.g(),h,g=0;g0)for(b=0;b0;)c+=a--^d++;return Ba(c)}};var X=function(c,f,b,i){function e(a){var d="",d=a[z]("://")[1][E]();R(d,"/")&&(d=d[z]("/")[0]);return d}var l=i,g=this;g.a=c;g.lb=f;g.m=b;g.jb=function(a){var d=g.ta();return new X.v(P(a,l.Ca+H,F),P(a,l.Fa+H,F),P(a,l.Ha+H,F),g.R(a,l.Aa,"(not set)"),g.R(a,l.Da,"(not set)"),g.R(a,l.Ga,d&&!O(d.G)?za(d.G):k),g.R(a,l.Ba,k))};g.kb=function(a){var d=e(a),b;b=a;var c="";b=b[z]("://")[1][E]();R(b,"/")&&(b=b[z]("/")[1],R(b,"?")&&(c=b[z]("?")[0]));b=c;if(R(d,"google")&&(a=a[z]("?")[D](F),R(a,F+l.rc+H)&&b== +l.qc))return!0;return!1};g.ta=function(){var a,d=g.lb,b,c=l.J;if(!O(d)&&"0"!=d&&R(d,"://")&&!g.kb(d)){a=e(d);for(var h=0;h9?i[C](n+1)*1:0,f++,i=0==i?1:i,a.ab([B,g.m,i,f,e.H()][D](".")),a.ra()}}}}; +X.v=function(c,f,b,i,e,l,g){var a=this;a.q=c;a.Q=f;a.wa=b;a.n=i;a.P=e;a.G=l;a.Cb=g;a.H=function(){var b=[],c=[["cid",a.q],["csr",a.Q],["gclid",a.wa],["ccn",a.n],["cmd",a.P],["ctr",a.G],["cct",a.Cb]],e,g;if(a.bb())for(e=0;e0&&b<=a.Ra&&(d=Q(d),c=Q(c),d[x]+c[x]<=64&&(e.r[b]=[d,c,g],e.T(),n=!0));return n};e.Ub=function(a){if((a=e.r[a])&&1===a[2])return a[1]};e.Tb=function(a){var b=e.r;b[a]&&(delete b[a],e.T())};e.Hc=function(){d.t(8);d.t(9);d.t(11);var a=e.r,b,c;for(c in a)if(b=a[c])d.j(8,c,b[0]),d.j(9,c,b[1]),(b=b[2])&&3!=b&&d.j(11,c,""+b)}};var Pa=function(){function c(a,b,c,d){k==g[a]&&(g[a]={});k==g[a][b]&&(g[a][b]=[]);g[a][b][c]=d}function f(a,b,c){if(k!=g[a]&&k!=g[a][b])return g[a][b][c]}function b(a,b){if(k!=g[a]&&k!=g[a][b]){g[a][b]=k;var c=!0,d;for(d=0;d0?b+"00":"0"};b.vb=function(){var c=b.Bc();if(c==k||isNaN(c))return!1;if(c<=0)return!0;if(c>2147483648)return!1; +var a=b.ub;a.t(14);a.ia(14);var d=b.Ac(c);a.j(14,1,d)&&a.ma(14,1,c)&&b.Cc();i&&i.isValidLoadTime!=k&&i.setPageReadyTime();return!1};b.Ua=function(){if(!b.Dc())return!1;if(M[w].top!=M[w])return!1;b.vb()&&ua(M[w],"load",b.vb,!1);return!0}};var $=function(){};$.Pc=function(c){var f="gaso=",b=M[y][A].hash;c=b&&1==b[r](f)?P(b,f,F):(b=M[w].name)&&0<=b[r](f)?P(b,f,F):P(c.g(),pa,";");return c};$.Rc=function(c,f){var b=(f||"www")+".google.com",b="https://"+b+"/analytics/reporting/overlay_js?gaso="+c+F+Ca(),i="_gasojs",e=M[y].createElement("script");e.type="text/javascript";e.src=b;if(i)e.id=i;(M[y].getElementsByTagName("head")[0]||M[y].getElementsByTagName("body")[0]).appendChild(e)}; +$.load=function(c,f){if(!$.Qc){var b=$.Pc(f),i=b&&b.match(/^(?:\|([-0-9a-z.]{1,30})\|)?([-.\w]{10,1200})$/i);if(i)f.xc(b),f.yc(),V._gasoDomain=c.b,V._gasoCPath=c.f,$.Rc(i[2],i[1]);$.Qc=!0}};var Sa=function(c,f,b){function i(){if("auto"==j.b){var a=M[y].domain;"www."==a[C](0,4)&&(a=a[C](4));j.b=a}j.b=j.b[E]()}function e(){i();var a=j.b,b=a[r]("www.google.")*a[r](".google.")*a[r]("google.");return b||"/"!=j.f||a[r]("google.org")>-1}function l(b,c,d){if(O(b)||O(c)||O(d))return"-";b=P(b,I+a.a+".",c);O(b)||(b=b[z]("."),b[5]=""+(b[5]?b[5]*1+1:1),b[3]=b[4],b[4]=d,b=b[D]("."));return b}function g(){return"file:"!=M[y][A][ea]&&e()}var a=this,d=ta(a),u=k,j=new Fa,h=!1,s=k;a.n=c;a.m=p.round((new Date)[da]()/ +1E3);a.p=f||"UA-XXXXX-X";a.Ya=M[y].referrer;a.oa=k;a.d=k;a.F=!1;a.O=k;a.e=k;a.Za=k;a.pa=k;a.a=k;a.k=k;j.o=b?Q(b):k;a.hc=function(){return Ca()^a.O.Zb()&2147483647};a.gc=function(){if(!j.b||""==j.b||"none"==j.b)return j.b="",1;i();return j.Ta?Ba(j.b):1};a.fc=function(a,b){if(O(a))a="-";else{b+=j.f&&"/"!=j.f?j.f:"";var c=a[r](b),a=c>=0&&c<=8?"0":"["==a[q](0)&&"]"==a[q](a[x]-1)?"-":a}return a};a.na=function(b){var c="";c+=j.ja?a.O.$b():"";c+=j.ka&&!O(M[y].title)?"&utmdt="+Q(M[y].title):"";var d;d=k; +M[w]&&M[w][t]&&M[w][t].hid?d=M[w][t].hid:(d=Ca(),M[w].gaGlobal=M[w][t]?M[w][t]:{},M[w][t].hid=d);c+="&utmhid="+d+"&utmr="+Q(o(a.oa))+"&utmp="+Q(a.kc(b));return c};a.kc=function(a){var b=M[y][A];a&&L(13);return a=k!=a&&""!=a?Q(a,!0):Q(b.pathname+b.search,!0)};a.pc=function(b){if(a.D()){var c="";a.e!=k&&a.e.C()[x]>0&&(c+="&utme="+Q(a.e.C()));c+=a.na(b);u.B(c,a.p,a.a)}};a.ec=function(){var b=new Ha(j);return b.Z(a.a)?b.Pb():k};a.$a=d("_getLinkerUrl",52,function(b,c){var d=b[z]("#"),e=b,f=a.ec();if(f)if(c&& +1>=d[x])e+="#"+f;else if(!c||1>=d[x])1>=d[x]?e+=(R(b,"?")?F:"?")+f:e=d[0]+(R(b,"?")?F:"?")+f+"#"+d[1];return e});a.ic=function(){var b=a.m,c=a.k,d=c.g(),e=a.a+"",f=M[w]?M[w][t]:k,g,i=R(d,I+e+"."),h=R(d,la+e),u=R(d,ma+e),s,G=[],Z="",Ka=!1,d=O(d)?"":d;if(j.w){g=M[y][A]&&M[y][A].hash?M[y][A][fa][C](M[y][A][fa][r]("#")):"";j.U&&!O(g)&&(Z=g+F);Z+=M[y][A].search;!O(Z)&&R(Z,I)&&(c.Ob(Z),c.za()||c.Mb(),s=c.ba());g=c.ea;var xa=c.Na,U=c.Qa;O(g())||(xa(za(g())),R(g(),";")||U());g=c.da;xa=c.X;U=c.Y;O(g())||(xa(g()), +R(g(),";")||U())}O(s)?i?(s=!h||!u)?(s=l(d,";",o(b)),a.F=!0):(s=P(d,I+e+".",";"),G=P(d,la+e,";")[z](".")):(s=[e,a.hc(),b,b,b,1][D]("."),Ka=a.F=!0):O(c.z())||O(c.ca())?(s=l(Z,F,o(b)),a.F=!0):(G=c.z()[z]("."),e=G[0]);s=s[z](".");M[w]&&f&&f.dh==e&&!j.o&&(s[4]=f.sid?f.sid:s[4],Ka&&(s[3]=f.sid?f.sid:s[4],f.vid&&(b=f.vid[z]("."),s[1]=b[0],s[2]=b[1])));c.La(s[D]("."));G[0]=e;G[1]=G[1]?G[1]:0;G[2]=k!=G[2]?G[2]:j.Yb;G[3]=G[3]?G[3]:s[4];c.$(G[D]("."));c.Ma(e);O(c.Nb())||c.fa(c.K());c.Oa();c.aa();c.Pa()};a.jc= +function(){u=new Ma(j)};a.getName=d("_getName",58,function(){return a.n});a.c=d("_initData",2,function(){var b;if(!h){if(!a.O)a.O=new Na(j.la);a.a=a.gc();a.k=new Ha(j);a.e=new Pa;s=new Oa(j,o(a.a),a.k,a.e);a.jc()}if(g()){if(!h)a.oa=a.fc(a.Ya,M[y].domain),b=new X(o(a.a),a.oa,a.m,j);a.ic(b);s.Vb()}if(!h)g()&&b.Lb(a.k,a.F),a.Za=new Pa,$.load(j,a.k),h=!0});a.Va=d("_visitCode",54,function(){a.c();var b=P(a.k.g(),I+a.a+".",";"),b=b[z](".");return b[x]<4?"":b[1]});a.gd=d("_cookiePathCopy",30,function(b){a.c(); +a.k&&a.k.Qb(a.a,b)});a.D=function(){return a.Va()%1E40&&(f=g[C](0,a),g=g[C](a+1));var d=f==ga?V:f==ha?Ua:V.Db(f);d[g].apply(d,b[e].slice(1))}}catch(u){c++}return c}};var V=new Ta;var Wa=m[ga];Wa&&typeof Wa._getTracker=="function"?V=Wa:m[ga]=V;var Ua=new Va;a:{var Xa=m[ha],Ya=!1;if(Xa&&typeof Xa[ba]=="function"&&(Ya=va(Xa),!Ya))break a;m[ha]=Ua;Ya&&Ua[ba].apply(Ua,Xa)};})() diff --git a/templates/website/ph2date/chat_assets/js/homejs.js b/templates/website/ph2date/chat_assets/js/homejs.js index c475135..f2e5ed0 100755 --- a/templates/website/ph2date/chat_assets/js/homejs.js +++ b/templates/website/ph2date/chat_assets/js/homejs.js @@ -1,68 +1,68 @@ -function formSubmit1() -{ - document.myform.action=''; -} -function formSubmit2() -{ -document.myform.action=''; -} - -new Ajax.Request('', - { - method:'get', - onSuccess: function(transport){ - var response = transport.responseText || "no response text"; - document.getElementById('test').innerHTML = response - }, - onFailure: function(){ alert('Something went wrong...') } - }); - -function checkFind(type){ - - if(type == 'work'){ - document.getElementById("work").setAttribute("class", "selected"); - document.getElementById("prof").setAttribute("class", ""); - } - else{ - document.getElementById("work").setAttribute("class", ""); - document.getElementById("prof").setAttribute("class", "selected"); - } - new Ajax.Request(''+type, - { - method:'get', - onSuccess: function(transport){ - var response = transport.responseText || "no response text"; - document.getElementById('innerContent').innerHTML = response - }, - onFailure: function(){ alert('Something went wrong...') } - }); -} - -function getCat(catid){ - - new Ajax.Request(''+catid, - { - method:'get', - onSuccess: function(transport){ - var response = transport.responseText || "no response text"; - document.getElementById('catInner').innerHTML = response - }, - onFailure: function(){ alert('Something went wrong...') } - }); -} - - function getProjects(type){ - - new Ajax.Request(''+type, - { - method:'get', - onSuccess: function(transport){ - - var response = transport.responseText || "no response text"; - document.getElementById('test').innerHTML = response - }, - onFailure: function(){ alert('Something went wrong...') } - }); - } - checkFind('work') +function formSubmit1() +{ + document.myform.action=''; +} +function formSubmit2() +{ +document.myform.action=''; +} + +new Ajax.Request('', + { + method:'get', + onSuccess: function(transport){ + var response = transport.responseText || "no response text"; + document.getElementById('test').innerHTML = response + }, + onFailure: function(){ alert('Something went wrong...') } + }); + +function checkFind(type){ + + if(type == 'work'){ + document.getElementById("work").setAttribute("class", "selected"); + document.getElementById("prof").setAttribute("class", ""); + } + else{ + document.getElementById("work").setAttribute("class", ""); + document.getElementById("prof").setAttribute("class", "selected"); + } + new Ajax.Request(''+type, + { + method:'get', + onSuccess: function(transport){ + var response = transport.responseText || "no response text"; + document.getElementById('innerContent').innerHTML = response + }, + onFailure: function(){ alert('Something went wrong...') } + }); +} + +function getCat(catid){ + + new Ajax.Request(''+catid, + { + method:'get', + onSuccess: function(transport){ + var response = transport.responseText || "no response text"; + document.getElementById('catInner').innerHTML = response + }, + onFailure: function(){ alert('Something went wrong...') } + }); +} + + function getProjects(type){ + + new Ajax.Request(''+type, + { + method:'get', + onSuccess: function(transport){ + + var response = transport.responseText || "no response text"; + document.getElementById('test').innerHTML = response + }, + onFailure: function(){ alert('Something went wrong...') } + }); + } + checkFind('work') getCat(id;?>); \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/js/import.js b/templates/website/ph2date/chat_assets/js/import.js index a077c8b..0d0bd72 100755 --- a/templates/website/ph2date/chat_assets/js/import.js +++ b/templates/website/ph2date/chat_assets/js/import.js @@ -1,4 +1,4 @@ -function changePluginOpts(){$(".format_specific_options").each(function(){$(this).hide()});var a=$("#plugins option:selected").attr("value");$("#"+a+"_options").fadeIn("slow");a=="csv"?$("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one"):$("#import_notification").text("")} -function matchFile(a){a=a.toLowerCase().split(".");var b=a.length;if(b!=0){var c=a[b-1];if(c=="gz"||c=="bz2"||c=="zip")b--;if($("select[name='format'] option[value='"+a[b-1]+"']").length==1){$("#plugins option:selected").removeAttr("selected");$("select[name='format'] option[value='"+a[b-1]+"']").attr("selected","selected");changePluginOpts()}}} -$(document).ready(function(){changePluginOpts();$("#plugins").change(function(){changePluginOpts()});$("#input_import_file").change(function(){matchFile($(this).attr("value"))});$("#select_local_import_file").change(function(){matchFile($(this).attr("value"))});$("#input_import_file").focus(function(){$("#radio_import_file").attr("checked","checked");$("#radio_local_import_file").removeAttr("checked")});$("#select_local_import_file").focus(function(){$("#radio_local_import_file").attr("checked","checked"); -$("#radio_import_file").removeAttr("checked")});$("#scroll_to_options_msg").hide();$(".format_specific_options").css({border:0,margin:0,padding:0});$(".format_specific_options h3").remove()}); +function changePluginOpts(){$(".format_specific_options").each(function(){$(this).hide()});var a=$("#plugins option:selected").attr("value");$("#"+a+"_options").fadeIn("slow");a=="csv"?$("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one"):$("#import_notification").text("")} +function matchFile(a){a=a.toLowerCase().split(".");var b=a.length;if(b!=0){var c=a[b-1];if(c=="gz"||c=="bz2"||c=="zip")b--;if($("select[name='format'] option[value='"+a[b-1]+"']").length==1){$("#plugins option:selected").removeAttr("selected");$("select[name='format'] option[value='"+a[b-1]+"']").attr("selected","selected");changePluginOpts()}}} +$(document).ready(function(){changePluginOpts();$("#plugins").change(function(){changePluginOpts()});$("#input_import_file").change(function(){matchFile($(this).attr("value"))});$("#select_local_import_file").change(function(){matchFile($(this).attr("value"))});$("#input_import_file").focus(function(){$("#radio_import_file").attr("checked","checked");$("#radio_local_import_file").removeAttr("checked")});$("#select_local_import_file").focus(function(){$("#radio_local_import_file").attr("checked","checked"); +$("#radio_import_file").removeAttr("checked")});$("#scroll_to_options_msg").hide();$(".format_specific_options").css({border:0,margin:0,padding:0});$(".format_specific_options h3").remove()}); diff --git a/templates/website/ph2date/chat_assets/js/index.js b/templates/website/ph2date/chat_assets/js/index.js index 215c2bb..8db8ce4 100755 --- a/templates/website/ph2date/chat_assets/js/index.js +++ b/templates/website/ph2date/chat_assets/js/index.js @@ -1,334 +1,334 @@ -function createCookie(name,value,days) { - if (days) { - var date = new Date(); - date.setTime(date.getTime() + (days * 24 * 60 * 60)); - var expires = "; expires=" + date.toGMTString(); - } - else { - var expires = ""; - } - document.cookie = name+"="+value+expires+"; path=/"; -} - -function readCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)===' '){ c = c.substring(1,c.length); } - if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); - } - return null; -} - -function eraseCookie(name) { - createCookie(name,"",-1); -} - - var startingSlide = 0; - // If we find a cookie with the name that we previously saved, use it. - if(readCookie('ineCurrentSlide')){ - // This overrides the default value of 0 if we find a cookie. - startingSlide = readCookie('ineCurrentSlide'); - } - - var myDeck = $('.slidedeck').slidedeck({ - speed: 250, - start: startingSlide, // tell the Deck where to start - complete: function(deck){ - // Here we will set a cookie for one week. - // This cookie will store the deck.current value. - //createCookie(name,value,days) - createCookie('ineCurrentSlide',deck.current,7) - } - }); - -//$ ( '.slidedeck' ).css ( { width: '914px', height: '300px' } ); - -$ ( '.learn-more' ).hover ( function() { - $ ( this ).attr ( 'src', '/assets/img/slidedeck/learn-more-hover.png' ); -}, function() { - $ ( this ).attr ( 'src', '/assets/img/slidedeck/learn-more-std.png' ); -} ); - -$ ( '.rs_slide_steps_list li' ).hover ( - - function() { - if ( !$ ( this ).hasClass ( 'selected-element' ) ) - { - $ ( this ).removeClass ( 'inactive' ); - $ ( this ).addClass ( 'active' ); - } - else { - $ ( this ).addClass ( 'selected-element' ); - } - - }, - function() { - if ( !$ ( this ).hasClass ( 'selected-element' ) ) - { - $ ( this ).removeClass ( 'active' ); - $ ( this ).addClass ( 'inactive' ); - } - } - ); - -$ ( '#rs-slide-1' ).click ( function() { - $ ( '#rs2' ).hide (); - $ ( '#rs3' ).hide (); - $ ( '#rs1' ).fadeIn ( 'slow', function() { - $ ( '.rs_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.rs_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.rs_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#rs-slide-1' ).addClass ( 'active' ); - $ ( '#rs-slide-1' ).addClass ( 'selected-element' ); - $ ( '#rs-slide-2' ).addClass ( 'inactive' ); - $ ( '#rs-slide-3' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '#rs-slide-2' ).click ( function() { - $ ( '#rs1' ).hide (); - $ ( '#rs3' ).hide (); - $ ( '#rs2' ).fadeIn ( 'slow', function() { - $ ( '.rs_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.rs_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.rs_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#rs-slide-2' ).addClass ( 'active' ); - $ ( '#rs-slide-2' ).addClass ( 'selected-element' ); - $ ( '#rs-slide-1' ).addClass ( 'inactive' ); - $ ( '#rs-slide-3' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '#rs-slide-3' ).click ( function() { - $ ( '#rs1' ).hide (); - $ ( '#rs2' ).hide (); - $ ( '#rs3' ).fadeIn ( 'slow', function() { - $ ( '.rs_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.rs_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.rs_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#rs-slide-3' ).addClass ( 'active' ); - $ ( '#rs-slide-3' ).addClass ( 'selected-element' ); - $ ( '#rs-slide-1' ).addClass ( 'inactive' ); - $ ( '#rs-slide-2' ).addClass ( 'inactive' ); - } ); -} ); - - -$ ( '#vo-slide-1' ).click ( function() { - $ ( '#vo2' ).hide (); - $ ( '#vo3' ).hide (); - $ ( '#vo1' ).fadeIn ( 'slow', function() { - $ ( '.vo_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.vo_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.vo_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#vo-slide-1' ).addClass ( 'active' ); - $ ( '#vo-slide-1' ).addClass ( 'selected-element' ); - $ ( '#vo-slide-2' ).addClass ( 'inactive' ); - $ ( '#vo-slide-3' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '#vo-slide-2' ).click ( function() { - $ ( '#vo1' ).hide (); - $ ( '#vo3' ).hide (); - $ ( '#vo2' ).fadeIn ( 'slow', function() { - $ ( '.vo_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.vo_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.vo_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#vo-slide-2' ).addClass ( 'active' ); - $ ( '#vo-slide-2' ).addClass ( 'selected-element' ); - $ ( '#vo-slide-1' ).addClass ( 'inactive' ); - $ ( '#vo-slide-3' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '#vo-slide-3' ).click ( function() { - $ ( '#vo1' ).hide (); - $ ( '#vo2' ).hide (); - $ ( '#vo3' ).fadeIn ( 'slow', function() { - $ ( '.vo_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.vo_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.vo_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#vo-slide-3' ).addClass ( 'active' ); - $ ( '#vo-slide-3' ).addClass ( 'selected-element' ); - $ ( '#vo-slide-1' ).addClass ( 'inactive' ); - $ ( '#vo-slide-2' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '.vo_slide_steps_list li' ).hover ( - function() { - if ( !$ ( this ).hasClass ( 'selected-element' ) ) - { - $ ( this ).removeClass ( 'inactive' ); - $ ( this ).addClass ( 'active' ); - } - else { - $ ( this ).addClass ( 'selected-element' ); - } - - }, - function() { - if ( !$ ( this ).hasClass ( 'selected-element' ) ) - { - $ ( this ).removeClass ( 'active' ); - $ ( this ).addClass ( 'inactive' ); - } - } - ); - -$ ( '#sc-slide-1' ).click ( function() { - $ ( '#sc2' ).hide (); - $ ( '#sc3' ).hide (); - $ ( '#sc1' ).fadeIn ( 'slow', function() { - $ ( '.sc_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.sc_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.sc_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#sc-slide-1' ).addClass ( 'active' ); - $ ( '#sc-slide-1' ).addClass ( 'selected-element' ); - $ ( '#sc-slide-2' ).addClass ( 'inactive' ); - $ ( '#sc-slide-3' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '#sc-slide-2' ).click ( function() { - $ ( '#sc1' ).hide (); - $ ( '#sc3' ).hide (); - $ ( '#sc2' ).fadeIn ( 'slow', function() { - $ ( '.sc_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.sc_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.sc_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#sc-slide-2' ).addClass ( 'active' ); - $ ( '#sc-slide-2' ).addClass ( 'selected-element' ); - $ ( '#sc-slide-1' ).addClass ( 'inactive' ); - $ ( '#sc-slide-3' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '#sc-slide-3' ).click ( function() { - $ ( '#sc1' ).hide (); - $ ( '#sc2' ).hide (); - $ ( '#sc3' ).fadeIn ( 'slow', function() { - $ ( '.sc_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.sc_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.sc_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#sc-slide-3' ).addClass ( 'active' ); - $ ( '#sc-slide-3' ).addClass ( 'selected-element' ); - $ ( '#sc-slide-1' ).addClass ( 'inactive' ); - $ ( '#sc-slide-2' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '.sc_slide_steps_list li' ).hover ( - function() { - if ( !$ ( this ).hasClass ( 'selected-element' ) ) - { - $ ( this ).removeClass ( 'inactive' ); - $ ( this ).addClass ( 'active' ); - } - else { - $ ( this ).addClass ( 'selected-element' ); - } - - }, - function() { - if ( !$ ( this ).hasClass ( 'selected-element' ) ) - { - $ ( this ).removeClass ( 'active' ); - $ ( this ).addClass ( 'inactive' ); - } - } - ); - -$ ( '#sp-slide-1' ).click ( function() { - $ ( '#sp2' ).hide (); - $ ( '#sp3' ).hide (); - $ ( '#sp1' ).fadeIn ( 'slow', function() { - $ ( '.sp_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.sp_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.sp_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#sp-slide-1' ).addClass ( 'active' ); - $ ( '#sp-slide-1' ).addClass ( 'selected-element' ); - $ ( '#sp-slide-2' ).addClass ( 'inactive' ); - $ ( '#sp-slide-3' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '#sp-slide-2' ).click ( function() { - $ ( '#sp1' ).hide (); - $ ( '#sp3' ).hide (); - $ ( '#sp2' ).fadeIn ( 'slow', function() { - $ ( '.sp_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.sp_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.sp_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#sp-slide-2' ).addClass ( 'active' ); - $ ( '#sp-slide-2' ).addClass ( 'selected-element' ); - $ ( '#sp-slide-1' ).addClass ( 'inactive' ); - $ ( '#sp-slide-3' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '#sp-slide-3' ).click ( function() { - $ ( '#sp1' ).hide (); - $ ( '#sp2' ).hide (); - $ ( '#sp3' ).fadeIn ( 'slow', function() { - $ ( '.sp_slide_steps_list li' ).removeClass ( 'active' ); - $ ( '.sp_slide_steps_list li' ).removeClass ( 'inactive' ); - $ ( '.sp_slide_steps_list li' ).removeClass ( 'selected-element' ); - $ ( '#sp-slide-3' ).addClass ( 'active' ); - $ ( '#sp-slide-3' ).addClass ( 'selected-element' ); - $ ( '#sp-slide-1' ).addClass ( 'inactive' ); - $ ( '#sp-slide-2' ).addClass ( 'inactive' ); - } ); -} ); - -$ ( '.sp_slide_steps_list li' ).hover ( - function() { - if ( !$ ( this ).hasClass ( 'selected-element' ) ) - { - $ ( this ).removeClass ( 'inactive' ); - $ ( this ).addClass ( 'active' ); - } - else { - $ ( this ).addClass ( 'selected-element' ); - } - - }, - function() { - if ( !$ ( this ).hasClass ( 'selected-element' ) ) - { - $ ( this ).removeClass ( 'active' ); - $ ( this ).addClass ( 'inactive' ); - } - } - ); - - -(function( $ ) { - var cache = []; - // Arguments are image paths relative to the current page. - $.preLoadImages = function() { - var args_len = arguments.length; - for ( var i = args_len; i--; ) { - var cacheImage = document.createElement ( 'img' ); - cacheImage.src = arguments[i]; - cache.push ( cacheImage ); - } - } -}) ( jQuery ) - -jQuery.preLoadImages ( "/assets/img/slidedeck/learn-more-hover.gif" ); - -/*$(document).ready(function(){ - $("#slider").easySlider({ - auto: true, - continuous: true, - prevText: '', - nextText: '', - speed: 800, - pause: 7000 - }); - }); +function createCookie(name,value,days) { + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60)); + var expires = "; expires=" + date.toGMTString(); + } + else { + var expires = ""; + } + document.cookie = name+"="+value+expires+"; path=/"; +} + +function readCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)===' '){ c = c.substring(1,c.length); } + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); + } + return null; +} + +function eraseCookie(name) { + createCookie(name,"",-1); +} + + var startingSlide = 0; + // If we find a cookie with the name that we previously saved, use it. + if(readCookie('ineCurrentSlide')){ + // This overrides the default value of 0 if we find a cookie. + startingSlide = readCookie('ineCurrentSlide'); + } + + var myDeck = $('.slidedeck').slidedeck({ + speed: 250, + start: startingSlide, // tell the Deck where to start + complete: function(deck){ + // Here we will set a cookie for one week. + // This cookie will store the deck.current value. + //createCookie(name,value,days) + createCookie('ineCurrentSlide',deck.current,7) + } + }); + +//$ ( '.slidedeck' ).css ( { width: '914px', height: '300px' } ); + +$ ( '.learn-more' ).hover ( function() { + $ ( this ).attr ( 'src', '/assets/img/slidedeck/learn-more-hover.png' ); +}, function() { + $ ( this ).attr ( 'src', '/assets/img/slidedeck/learn-more-std.png' ); +} ); + +$ ( '.rs_slide_steps_list li' ).hover ( + + function() { + if ( !$ ( this ).hasClass ( 'selected-element' ) ) + { + $ ( this ).removeClass ( 'inactive' ); + $ ( this ).addClass ( 'active' ); + } + else { + $ ( this ).addClass ( 'selected-element' ); + } + + }, + function() { + if ( !$ ( this ).hasClass ( 'selected-element' ) ) + { + $ ( this ).removeClass ( 'active' ); + $ ( this ).addClass ( 'inactive' ); + } + } + ); + +$ ( '#rs-slide-1' ).click ( function() { + $ ( '#rs2' ).hide (); + $ ( '#rs3' ).hide (); + $ ( '#rs1' ).fadeIn ( 'slow', function() { + $ ( '.rs_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.rs_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.rs_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#rs-slide-1' ).addClass ( 'active' ); + $ ( '#rs-slide-1' ).addClass ( 'selected-element' ); + $ ( '#rs-slide-2' ).addClass ( 'inactive' ); + $ ( '#rs-slide-3' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '#rs-slide-2' ).click ( function() { + $ ( '#rs1' ).hide (); + $ ( '#rs3' ).hide (); + $ ( '#rs2' ).fadeIn ( 'slow', function() { + $ ( '.rs_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.rs_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.rs_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#rs-slide-2' ).addClass ( 'active' ); + $ ( '#rs-slide-2' ).addClass ( 'selected-element' ); + $ ( '#rs-slide-1' ).addClass ( 'inactive' ); + $ ( '#rs-slide-3' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '#rs-slide-3' ).click ( function() { + $ ( '#rs1' ).hide (); + $ ( '#rs2' ).hide (); + $ ( '#rs3' ).fadeIn ( 'slow', function() { + $ ( '.rs_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.rs_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.rs_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#rs-slide-3' ).addClass ( 'active' ); + $ ( '#rs-slide-3' ).addClass ( 'selected-element' ); + $ ( '#rs-slide-1' ).addClass ( 'inactive' ); + $ ( '#rs-slide-2' ).addClass ( 'inactive' ); + } ); +} ); + + +$ ( '#vo-slide-1' ).click ( function() { + $ ( '#vo2' ).hide (); + $ ( '#vo3' ).hide (); + $ ( '#vo1' ).fadeIn ( 'slow', function() { + $ ( '.vo_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.vo_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.vo_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#vo-slide-1' ).addClass ( 'active' ); + $ ( '#vo-slide-1' ).addClass ( 'selected-element' ); + $ ( '#vo-slide-2' ).addClass ( 'inactive' ); + $ ( '#vo-slide-3' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '#vo-slide-2' ).click ( function() { + $ ( '#vo1' ).hide (); + $ ( '#vo3' ).hide (); + $ ( '#vo2' ).fadeIn ( 'slow', function() { + $ ( '.vo_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.vo_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.vo_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#vo-slide-2' ).addClass ( 'active' ); + $ ( '#vo-slide-2' ).addClass ( 'selected-element' ); + $ ( '#vo-slide-1' ).addClass ( 'inactive' ); + $ ( '#vo-slide-3' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '#vo-slide-3' ).click ( function() { + $ ( '#vo1' ).hide (); + $ ( '#vo2' ).hide (); + $ ( '#vo3' ).fadeIn ( 'slow', function() { + $ ( '.vo_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.vo_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.vo_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#vo-slide-3' ).addClass ( 'active' ); + $ ( '#vo-slide-3' ).addClass ( 'selected-element' ); + $ ( '#vo-slide-1' ).addClass ( 'inactive' ); + $ ( '#vo-slide-2' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '.vo_slide_steps_list li' ).hover ( + function() { + if ( !$ ( this ).hasClass ( 'selected-element' ) ) + { + $ ( this ).removeClass ( 'inactive' ); + $ ( this ).addClass ( 'active' ); + } + else { + $ ( this ).addClass ( 'selected-element' ); + } + + }, + function() { + if ( !$ ( this ).hasClass ( 'selected-element' ) ) + { + $ ( this ).removeClass ( 'active' ); + $ ( this ).addClass ( 'inactive' ); + } + } + ); + +$ ( '#sc-slide-1' ).click ( function() { + $ ( '#sc2' ).hide (); + $ ( '#sc3' ).hide (); + $ ( '#sc1' ).fadeIn ( 'slow', function() { + $ ( '.sc_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.sc_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.sc_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#sc-slide-1' ).addClass ( 'active' ); + $ ( '#sc-slide-1' ).addClass ( 'selected-element' ); + $ ( '#sc-slide-2' ).addClass ( 'inactive' ); + $ ( '#sc-slide-3' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '#sc-slide-2' ).click ( function() { + $ ( '#sc1' ).hide (); + $ ( '#sc3' ).hide (); + $ ( '#sc2' ).fadeIn ( 'slow', function() { + $ ( '.sc_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.sc_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.sc_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#sc-slide-2' ).addClass ( 'active' ); + $ ( '#sc-slide-2' ).addClass ( 'selected-element' ); + $ ( '#sc-slide-1' ).addClass ( 'inactive' ); + $ ( '#sc-slide-3' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '#sc-slide-3' ).click ( function() { + $ ( '#sc1' ).hide (); + $ ( '#sc2' ).hide (); + $ ( '#sc3' ).fadeIn ( 'slow', function() { + $ ( '.sc_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.sc_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.sc_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#sc-slide-3' ).addClass ( 'active' ); + $ ( '#sc-slide-3' ).addClass ( 'selected-element' ); + $ ( '#sc-slide-1' ).addClass ( 'inactive' ); + $ ( '#sc-slide-2' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '.sc_slide_steps_list li' ).hover ( + function() { + if ( !$ ( this ).hasClass ( 'selected-element' ) ) + { + $ ( this ).removeClass ( 'inactive' ); + $ ( this ).addClass ( 'active' ); + } + else { + $ ( this ).addClass ( 'selected-element' ); + } + + }, + function() { + if ( !$ ( this ).hasClass ( 'selected-element' ) ) + { + $ ( this ).removeClass ( 'active' ); + $ ( this ).addClass ( 'inactive' ); + } + } + ); + +$ ( '#sp-slide-1' ).click ( function() { + $ ( '#sp2' ).hide (); + $ ( '#sp3' ).hide (); + $ ( '#sp1' ).fadeIn ( 'slow', function() { + $ ( '.sp_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.sp_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.sp_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#sp-slide-1' ).addClass ( 'active' ); + $ ( '#sp-slide-1' ).addClass ( 'selected-element' ); + $ ( '#sp-slide-2' ).addClass ( 'inactive' ); + $ ( '#sp-slide-3' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '#sp-slide-2' ).click ( function() { + $ ( '#sp1' ).hide (); + $ ( '#sp3' ).hide (); + $ ( '#sp2' ).fadeIn ( 'slow', function() { + $ ( '.sp_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.sp_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.sp_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#sp-slide-2' ).addClass ( 'active' ); + $ ( '#sp-slide-2' ).addClass ( 'selected-element' ); + $ ( '#sp-slide-1' ).addClass ( 'inactive' ); + $ ( '#sp-slide-3' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '#sp-slide-3' ).click ( function() { + $ ( '#sp1' ).hide (); + $ ( '#sp2' ).hide (); + $ ( '#sp3' ).fadeIn ( 'slow', function() { + $ ( '.sp_slide_steps_list li' ).removeClass ( 'active' ); + $ ( '.sp_slide_steps_list li' ).removeClass ( 'inactive' ); + $ ( '.sp_slide_steps_list li' ).removeClass ( 'selected-element' ); + $ ( '#sp-slide-3' ).addClass ( 'active' ); + $ ( '#sp-slide-3' ).addClass ( 'selected-element' ); + $ ( '#sp-slide-1' ).addClass ( 'inactive' ); + $ ( '#sp-slide-2' ).addClass ( 'inactive' ); + } ); +} ); + +$ ( '.sp_slide_steps_list li' ).hover ( + function() { + if ( !$ ( this ).hasClass ( 'selected-element' ) ) + { + $ ( this ).removeClass ( 'inactive' ); + $ ( this ).addClass ( 'active' ); + } + else { + $ ( this ).addClass ( 'selected-element' ); + } + + }, + function() { + if ( !$ ( this ).hasClass ( 'selected-element' ) ) + { + $ ( this ).removeClass ( 'active' ); + $ ( this ).addClass ( 'inactive' ); + } + } + ); + + +(function( $ ) { + var cache = []; + // Arguments are image paths relative to the current page. + $.preLoadImages = function() { + var args_len = arguments.length; + for ( var i = args_len; i--; ) { + var cacheImage = document.createElement ( 'img' ); + cacheImage.src = arguments[i]; + cache.push ( cacheImage ); + } + } +}) ( jQuery ) + +jQuery.preLoadImages ( "/assets/img/slidedeck/learn-more-hover.gif" ); + +/*$(document).ready(function(){ + $("#slider").easySlider({ + auto: true, + continuous: true, + prevText: '', + nextText: '', + speed: 800, + pause: 7000 + }); + }); */ \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/js/indexes.js b/templates/website/ph2date/chat_assets/js/indexes.js index 239d7ae..cff5aac 100755 --- a/templates/website/ph2date/chat_assets/js/indexes.js +++ b/templates/website/ph2date/chat_assets/js/indexes.js @@ -1,2 +1,2 @@ -function checkIndexName(){if(typeof document.forms.index_frm=="undefined")return false;var a=document.forms.index_frm.elements["index[Key_name]"],b=document.forms.index_frm.elements["index[Index_type]"];if(b.options[0].value=="PRIMARY"&&b.options[0].selected){document.forms.index_frm.elements["index[Key_name]"].value="PRIMARY";if(typeof a.disabled!="undefined")document.forms.index_frm.elements["index[Key_name]"].disabled=true}else{if(a.value=="PRIMARY")document.forms.index_frm.elements["index[Key_name]"].value= -"";if(typeof a.disabled!="undefined")document.forms.index_frm.elements["index[Key_name]"].disabled=false}return true}onload=checkIndexName; +function checkIndexName(){if(typeof document.forms.index_frm=="undefined")return false;var a=document.forms.index_frm.elements["index[Key_name]"],b=document.forms.index_frm.elements["index[Index_type]"];if(b.options[0].value=="PRIMARY"&&b.options[0].selected){document.forms.index_frm.elements["index[Key_name]"].value="PRIMARY";if(typeof a.disabled!="undefined")document.forms.index_frm.elements["index[Key_name]"].disabled=true}else{if(a.value=="PRIMARY")document.forms.index_frm.elements["index[Key_name]"].value= +"";if(typeof a.disabled!="undefined")document.forms.index_frm.elements["index[Key_name]"].disabled=false}return true}onload=checkIndexName; diff --git a/templates/website/ph2date/chat_assets/js/jquery-1.3.2.min.js b/templates/website/ph2date/chat_assets/js/jquery-1.3.2.min.js index 55c2e6d..b1ae21d 100755 --- a/templates/website/ph2date/chat_assets/js/jquery-1.3.2.min.js +++ b/templates/website/ph2date/chat_assets/js/jquery-1.3.2.min.js @@ -1,19 +1,19 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
            "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
            ","
            "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
            "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
            ","
            "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ (function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

            ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
            ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
            ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
            ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/js/jquery-1.js b/templates/website/ph2date/chat_assets/js/jquery-1.js index 55c2e6d..b1ae21d 100755 --- a/templates/website/ph2date/chat_assets/js/jquery-1.js +++ b/templates/website/ph2date/chat_assets/js/jquery-1.js @@ -1,19 +1,19 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
            "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
            ","
            "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
            "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
            ","
            "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ (function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

            ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
            ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
            ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
            ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/js/jquery-ui-1.7.custom.min.js b/templates/website/ph2date/chat_assets/js/jquery-ui-1.7.custom.min.js index 4518896..b098616 100755 --- a/templates/website/ph2date/chat_assets/js/jquery-ui-1.7.custom.min.js +++ b/templates/website/ph2date/chat_assets/js/jquery-ui-1.7.custom.min.js @@ -1,20 +1,20 @@ -/* - * jQuery UI 1.7 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* - * jQuery UI Tabs 1.7 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * ui.core.js +/* + * jQuery UI 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* + * jQuery UI Tabs 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * ui.core.js */(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"
            ",spinner:"Loading…",tabTemplate:'
          1. #{label}
          2. '}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* - * jQuery UI Draggable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.leftthis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left
            ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y=p&&n<=k)||(m>=p&&m<=k)||(nk))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(ec));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d
            ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f
            ');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e
            ');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/* - * jQuery UI Selectable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.rightg||j.bottomd&&j.righth&&j.bottom=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)f&&(e+h)m[this.floating?"width":"height"])){return g}else{return(f0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/* - * jQuery UI Accordion 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Accordion - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/* - * jQuery UI Dialog 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * ui.core.js - * ui.draggable.js - * ui.resizable.js - */ -(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("
            ")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("
            ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("
            ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("
            ").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e
            ");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("
            ")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('
            ').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(bthis._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(cthis._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/* - * jQuery UI Tabs 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"
            ",spinner:"Loading…",tabTemplate:'
          3. #{label}
          4. '}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i
            ')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('
            '))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$(''+appendText+"");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDatenew Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)0&&iValue="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j0&&iValue-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormatmaxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDrawmaxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?''+prevText+"":(hideIfNoPrevNext?"":''+prevText+""));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?''+nextText+"":(hideIfNoPrevNext?"":''+nextText+""));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'":"");var buttonPanel=(showButtonPanel)?'
            '+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'":"")+(isRTL?"":controls)+"
            ":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'
            ';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="=5?' class="ui-datepicker-week-end"':"")+'>'+dayNamesMin[day]+""}calender+=thead+"";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDatemaxDate);tbody+='";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+""}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="
            =currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?''+printDate.getDate()+"":'=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+""))+"
            "+(isMultiMonth?"
            "+((numMonths[0]>0&&col==numMonths[1]-1)?'
            ':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=''+drawYear+""}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="
            ";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&datemaxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);;/* - * jQuery UI Progressbar 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('
            ').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(bthis._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/* - * jQuery UI Effects 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f
            ');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h
            ").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/* - * jQuery UI Effects Fold 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/* - * jQuery UI Effects Highlight 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Pulsate 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* + * jQuery UI Draggable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.leftthis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left
            ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y=p&&n<=k)||(m>=p&&m<=k)||(nk))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(ec));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d
            ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f
            ');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e
            ');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/* + * jQuery UI Selectable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.rightg||j.bottomd&&j.righth&&j.bottom=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)f&&(e+h)m[this.floating?"width":"height"])){return g}else{return(f0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/* + * jQuery UI Accordion 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Accordion + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/* + * jQuery UI Dialog 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * ui.core.js + * ui.draggable.js + * ui.resizable.js + */ +(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("
            ")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("
            ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("
            ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("
            ").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e
            ");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("
            ")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('
            ').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(bthis._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(cthis._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/* + * jQuery UI Tabs 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"
            ",spinner:"Loading…",tabTemplate:'
          5. #{label}
          6. '}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i
            ')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('
            '))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$(''+appendText+"");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDatenew Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)0&&iValue="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j0&&iValue-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormatmaxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDrawmaxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?''+prevText+"":(hideIfNoPrevNext?"":''+prevText+""));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?''+nextText+"":(hideIfNoPrevNext?"":''+nextText+""));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'":"");var buttonPanel=(showButtonPanel)?'
            '+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'":"")+(isRTL?"":controls)+"
            ":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="=5?' class="ui-datepicker-week-end"':"")+'>'+dayNamesMin[day]+""}calender+=thead+"";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDatemaxDate);tbody+='";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+""}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="
            =currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?''+printDate.getDate()+"":'=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+""))+"
            "+(isMultiMonth?""+((numMonths[0]>0&&col==numMonths[1]-1)?'
            ':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=''+drawYear+""}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&datemaxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);;/* + * jQuery UI Progressbar 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('
            ').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(bthis._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/* + * jQuery UI Effects 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/* + * jQuery UI Effects Fold 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/* + * jQuery UI Effects Highlight 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Pulsate 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/js/jquery.js b/templates/website/ph2date/chat_assets/js/jquery.js index 72f32c9..82b98e1 100755 --- a/templates/website/ph2date/chat_assets/js/jquery.js +++ b/templates/website/ph2date/chat_assets/js/jquery.js @@ -1,32 +1,32 @@ -/* - * jQuery 1.2.6 - New Wave Javascript - * - * Copyright (c) 2008 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ - * $Rev: 5685 $ - */ -(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else -return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else -return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else -selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else -this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else -return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else -jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else -jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
            "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
            ","
            "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else -ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else -while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else -for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
            ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else -xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else -jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else -for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else -s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ + * $Rev: 5685 $ + */ +(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
            "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
            ","
            "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else +while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
            ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else +xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/js/jquery.jscrollpane.min.js b/templates/website/ph2date/chat_assets/js/jquery.jscrollpane.min.js index 2eebb93..87e776c 100755 --- a/templates/website/ph2date/chat_assets/js/jquery.jscrollpane.min.js +++ b/templates/website/ph2date/chat_assets/js/jquery.jscrollpane.min.js @@ -1,11 +1,11 @@ -/* - * jScrollPane - v2.0.0beta11 - 2011-05-02 - * http://jscrollpane.kelvinluck.com/ - * - * Copyright (c) 2010 Kelvin Luck - * Dual licensed under the MIT and GPL licenses. - */ -(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var az,Q=this,Y,ak,v,am,T,Z,y,q,aA,aF,av,i,I,h,j,aa,U,aq,X,t,A,ar,af,an,G,l,au,ay,x,aw,aI,f,L,aj=true,P=true,aH=false,k=false,ap=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aI=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function at(aR){var aM,aO,aN,aK,aJ,aQ,aP=false,aL=false;az=aR;if(Y===c){aJ=D.scrollTop();aQ=D.scrollLeft();D.css({overflow:"hidden",padding:0});ak=D.innerWidth()+f;v=D.innerHeight();D.width(ak);Y=b('
            ').css("padding",aI).append(D.children());am=b('
            ').css({width:ak+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aP=az.stickToBottom&&K();aL=az.stickToRight&&B();aK=D.innerWidth()+f!=ak||D.outerHeight()!=v;if(aK){ak=D.innerWidth()+f;v=D.innerHeight();am.css({width:ak+"px",height:v+"px"})}if(!aK&&L==T&&Y.outerHeight()==Z){D.width(ak);return}L=T;Y.css("width","");D.width(ak);am.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aR.contentWidth){T=aR.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/ak;q=Z/v;aA=q>1;aF=y>1;if(!(aF||aA)){D.removeClass("jspScrollable");Y.css({top:0,width:am.width()-f});n();E();R();w();ai()}else{D.addClass("jspScrollable");aM=az.maintainPosition&&(I||aa);if(aM){aO=aD();aN=aB()}aG();z();F();if(aM){N(aL?(T-ak):aO,false);M(aP?(Z-v):aN,false)}J();ag();ao();if(az.enableKeyboardNavigation){S()}if(az.clickOnTrack){p()}C();if(az.hijackInternalLinks){m()}}if(az.autoReinitialise&&!aw){aw=setInterval(function(){at(az)},az.autoReinitialiseDelay)}else{if(!az.autoReinitialise&&aw){clearInterval(aw)}}aJ&&D.scrollTop(0)&&M(aJ,false);aQ&&D.scrollLeft(0)&&N(aQ,false);D.trigger("jsp-initialised",[aF||aA])}function aG(){if(aA){am.append(b('
            ').append(b('
            '),b('
            ').append(b('
            ').append(b('
            '),b('
            '))),b('
            ')));U=am.find(">.jspVerticalBar");aq=U.find(">.jspTrack");av=aq.find(">.jspDrag");if(az.showArrows){ar=b('').bind("mousedown.jsp",aE(0,-1)).bind("click.jsp",aC);af=b('').bind("mousedown.jsp",aE(0,1)).bind("click.jsp",aC);if(az.arrowScrollOnHover){ar.bind("mouseover.jsp",aE(0,-1,ar));af.bind("mouseover.jsp",aE(0,1,af))}al(aq,az.verticalArrowPositions,ar,af)}t=v;am.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});av.hover(function(){av.addClass("jspHover")},function(){av.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);av.addClass("jspActive");var s=aJ.pageY-av.position().top;b("html").bind("mousemove.jsp",function(aK){V(aK.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});o()}}function o(){aq.height(t+"px");I=0;X=az.verticalGutter+aq.outerWidth();Y.width(ak-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aF){am.append(b('
            ').append(b('
            '),b('
            ').append(b('
            ').append(b('
            '),b('
            '))),b('
            ')));an=am.find(">.jspHorizontalBar");G=an.find(">.jspTrack");h=G.find(">.jspDrag");if(az.showArrows){ay=b('').bind("mousedown.jsp",aE(-1,0)).bind("click.jsp",aC);x=b('').bind("mousedown.jsp",aE(1,0)).bind("click.jsp",aC); -if(az.arrowScrollOnHover){ay.bind("mouseover.jsp",aE(-1,0,ay));x.bind("mouseover.jsp",aE(1,0,x))}al(G,az.horizontalArrowPositions,ay,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);h.addClass("jspActive");var s=aJ.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aK){W(aK.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});l=am.innerWidth();ah()}}function ah(){am.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aF&&aA){var aJ=G.outerHeight(),s=aq.outerWidth();t-=aJ;b(an).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;ak-=aJ;G.parent().append(b('
            ').css("width",aJ+"px"));o();ah()}if(aF){Y.width((am.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aF){au=Math.ceil(1/y*l);if(au>az.horizontalDragMaxWidth){au=az.horizontalDragMaxWidth}else{if(auaz.verticalDragMaxHeight){A=az.verticalDragMaxHeight}else{if(AaT){Q.scrollByY(-aQ)}else{V(aT)}}else{if(aN>0){if(I+aRaT){Q.scrollByX(-aQ)}else{W(aT)}}else{if(aN>0){if(aa+aRi){s=i}}if(aJ===c){aJ=az.animateScroll}if(aJ){Q.animate(av,"top",s,ad)}else{av.css("top",s);ad(s)}}function ad(aJ){if(aJ===c){aJ=av.position().top}am.scrollTop(0);I=aJ;var aM=I===0,aK=I==i,aL=aJ/i,s=-aL*(Z-v);if(aj!=aM||aH!=aK){aj=aM;aH=aK;D.trigger("jsp-arrow-change",[aj,aH,P,k])}u(aM,aK);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aM,aK]).trigger("scroll")}function W(aJ,s){if(!aF){return}if(aJ<0){aJ=0}else{if(aJ>j){aJ=j}}if(s===c){s=az.animateScroll}if(s){Q.animate(h,"left",aJ,ae) -}else{h.css("left",aJ);ae(aJ)}}function ae(aJ){if(aJ===c){aJ=h.position().left}am.scrollTop(0);aa=aJ;var aM=aa===0,aL=aa==j,aK=aJ/j,s=-aK*(T-ak);if(P!=aM||k!=aL){P=aM;k=aL;D.trigger("jsp-arrow-change",[aj,aH,P,k])}r(aM,aL);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aM,aL]).trigger("scroll")}function u(aJ,s){if(az.showArrows){ar[aJ?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aJ,s){if(az.showArrows){ay[aJ?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aJ){var aK=s/(Z-v);V(aK*i,aJ)}function N(aJ,s){var aK=aJ/(T-ak);W(aK*j,s)}function ab(aW,aR,aK){var aO,aL,aM,s=0,aV=0,aJ,aQ,aP,aT,aS,aU;try{aO=b(aW)}catch(aN){return}aL=aO.outerHeight();aM=aO.outerWidth();am.scrollTop(0);am.scrollLeft(0);while(!aO.is(".jspPane")){s+=aO.position().top;aV+=aO.position().left;aO=aO.offsetParent();if(/^body|html$/i.test(aO[0].nodeName)){return}}aJ=aB();aP=aJ+v;if(saP){aS=s-v+aL+az.verticalGutter}}if(aS){M(aS,aK)}aQ=aD();aT=aQ+ak;if(aVaT){aU=aV-ak+aM+az.horizontalGutter}}if(aU){N(aU,aK)}}function aD(){return -Y.position().left}function aB(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aB()<10)}function B(){var s=T-ak;return(s>20)&&(s-aD()<10)}function ag(){am.unbind(ac).bind(ac,function(aM,aN,aL,aJ){var aK=aa,s=I;Q.scrollBy(aL*az.mouseWheelSpeed,-aJ*az.mouseWheelSpeed,false);return aK==aa&&s==I})}function n(){am.unbind(ac)}function aC(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aJ,aL=[];aF&&aL.push(an[0]);aA&&aL.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aO){if(aO.target!==this&&!(aL.length&&b(aO.target).closest(aL).length)){return}var aN=aa,aM=I;switch(aO.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aO.keyCode;aK();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aJ=aO.keyCode==s&&aN!=aa||aM!=I;return !aJ}).bind("keypress.jsp",function(aM){if(aM.keyCode==s){aK()}return !aJ});if(az.hideFocus){D.css("outline","none");if("hideFocus" in am[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in am[0]){D.attr("hideFocus",false)}}function aK(){var aN=aa,aM=I;switch(s){case 40:Q.scrollByY(az.keyboardSpeed,false);break;case 38:Q.scrollByY(-az.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*az.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*az.scrollPagePercent,false);break;case 39:Q.scrollByX(az.keyboardSpeed,false);break;case 37:Q.scrollByX(-az.keyboardSpeed,false);break}aJ=aN!=aa||aM!=I;return aJ}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aK,aJ;try{aK=b(location.hash)}catch(s){return}if(aK.length&&Y.find(location.hash)){if(am.scrollTop()===0){aJ=setInterval(function(){if(am.scrollTop()>0){ab(location.hash,true);b(document).scrollTop(am.position().top);clearInterval(aJ)}},50)}else{ab(location.hash,true);b(document).scrollTop(am.position().top)}}}}function ai(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function m(){ai();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aJ;if(s.length>1){aJ=s[1];if(aJ.length>0&&Y.find("#"+aJ).length>0){ab("#"+aJ,true);return false}}})}function ao(){var aK,aJ,aM,aL,aN,s=false;am.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aO){var aP=aO.originalEvent.touches[0];aK=aD();aJ=aB();aM=aP.pageX;aL=aP.pageY;aN=false;s=true}).bind("touchmove.jsp",function(aR){if(!s){return}var aQ=aR.originalEvent.touches[0],aP=aa,aO=I;Q.scrollTo(aK+aM-aQ.pageX,aJ+aL-aQ.pageY);aN=aN||Math.abs(aM-aQ.pageX)>5||Math.abs(aL-aQ.pageY)>5; +/* + * jScrollPane - v2.0.0beta11 - 2011-05-02 + * http://jscrollpane.kelvinluck.com/ + * + * Copyright (c) 2010 Kelvin Luck + * Dual licensed under the MIT and GPL licenses. + */ +(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var az,Q=this,Y,ak,v,am,T,Z,y,q,aA,aF,av,i,I,h,j,aa,U,aq,X,t,A,ar,af,an,G,l,au,ay,x,aw,aI,f,L,aj=true,P=true,aH=false,k=false,ap=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aI=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function at(aR){var aM,aO,aN,aK,aJ,aQ,aP=false,aL=false;az=aR;if(Y===c){aJ=D.scrollTop();aQ=D.scrollLeft();D.css({overflow:"hidden",padding:0});ak=D.innerWidth()+f;v=D.innerHeight();D.width(ak);Y=b('
            ').css("padding",aI).append(D.children());am=b('
            ').css({width:ak+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aP=az.stickToBottom&&K();aL=az.stickToRight&&B();aK=D.innerWidth()+f!=ak||D.outerHeight()!=v;if(aK){ak=D.innerWidth()+f;v=D.innerHeight();am.css({width:ak+"px",height:v+"px"})}if(!aK&&L==T&&Y.outerHeight()==Z){D.width(ak);return}L=T;Y.css("width","");D.width(ak);am.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aR.contentWidth){T=aR.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/ak;q=Z/v;aA=q>1;aF=y>1;if(!(aF||aA)){D.removeClass("jspScrollable");Y.css({top:0,width:am.width()-f});n();E();R();w();ai()}else{D.addClass("jspScrollable");aM=az.maintainPosition&&(I||aa);if(aM){aO=aD();aN=aB()}aG();z();F();if(aM){N(aL?(T-ak):aO,false);M(aP?(Z-v):aN,false)}J();ag();ao();if(az.enableKeyboardNavigation){S()}if(az.clickOnTrack){p()}C();if(az.hijackInternalLinks){m()}}if(az.autoReinitialise&&!aw){aw=setInterval(function(){at(az)},az.autoReinitialiseDelay)}else{if(!az.autoReinitialise&&aw){clearInterval(aw)}}aJ&&D.scrollTop(0)&&M(aJ,false);aQ&&D.scrollLeft(0)&&N(aQ,false);D.trigger("jsp-initialised",[aF||aA])}function aG(){if(aA){am.append(b('
            ').append(b('
            '),b('
            ').append(b('
            ').append(b('
            '),b('
            '))),b('
            ')));U=am.find(">.jspVerticalBar");aq=U.find(">.jspTrack");av=aq.find(">.jspDrag");if(az.showArrows){ar=b('').bind("mousedown.jsp",aE(0,-1)).bind("click.jsp",aC);af=b('').bind("mousedown.jsp",aE(0,1)).bind("click.jsp",aC);if(az.arrowScrollOnHover){ar.bind("mouseover.jsp",aE(0,-1,ar));af.bind("mouseover.jsp",aE(0,1,af))}al(aq,az.verticalArrowPositions,ar,af)}t=v;am.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});av.hover(function(){av.addClass("jspHover")},function(){av.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);av.addClass("jspActive");var s=aJ.pageY-av.position().top;b("html").bind("mousemove.jsp",function(aK){V(aK.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});o()}}function o(){aq.height(t+"px");I=0;X=az.verticalGutter+aq.outerWidth();Y.width(ak-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aF){am.append(b('
            ').append(b('
            '),b('
            ').append(b('
            ').append(b('
            '),b('
            '))),b('
            ')));an=am.find(">.jspHorizontalBar");G=an.find(">.jspTrack");h=G.find(">.jspDrag");if(az.showArrows){ay=b('').bind("mousedown.jsp",aE(-1,0)).bind("click.jsp",aC);x=b('').bind("mousedown.jsp",aE(1,0)).bind("click.jsp",aC); +if(az.arrowScrollOnHover){ay.bind("mouseover.jsp",aE(-1,0,ay));x.bind("mouseover.jsp",aE(1,0,x))}al(G,az.horizontalArrowPositions,ay,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);h.addClass("jspActive");var s=aJ.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aK){W(aK.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});l=am.innerWidth();ah()}}function ah(){am.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aF&&aA){var aJ=G.outerHeight(),s=aq.outerWidth();t-=aJ;b(an).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;ak-=aJ;G.parent().append(b('
            ').css("width",aJ+"px"));o();ah()}if(aF){Y.width((am.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aF){au=Math.ceil(1/y*l);if(au>az.horizontalDragMaxWidth){au=az.horizontalDragMaxWidth}else{if(auaz.verticalDragMaxHeight){A=az.verticalDragMaxHeight}else{if(AaT){Q.scrollByY(-aQ)}else{V(aT)}}else{if(aN>0){if(I+aRaT){Q.scrollByX(-aQ)}else{W(aT)}}else{if(aN>0){if(aa+aRi){s=i}}if(aJ===c){aJ=az.animateScroll}if(aJ){Q.animate(av,"top",s,ad)}else{av.css("top",s);ad(s)}}function ad(aJ){if(aJ===c){aJ=av.position().top}am.scrollTop(0);I=aJ;var aM=I===0,aK=I==i,aL=aJ/i,s=-aL*(Z-v);if(aj!=aM||aH!=aK){aj=aM;aH=aK;D.trigger("jsp-arrow-change",[aj,aH,P,k])}u(aM,aK);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aM,aK]).trigger("scroll")}function W(aJ,s){if(!aF){return}if(aJ<0){aJ=0}else{if(aJ>j){aJ=j}}if(s===c){s=az.animateScroll}if(s){Q.animate(h,"left",aJ,ae) +}else{h.css("left",aJ);ae(aJ)}}function ae(aJ){if(aJ===c){aJ=h.position().left}am.scrollTop(0);aa=aJ;var aM=aa===0,aL=aa==j,aK=aJ/j,s=-aK*(T-ak);if(P!=aM||k!=aL){P=aM;k=aL;D.trigger("jsp-arrow-change",[aj,aH,P,k])}r(aM,aL);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aM,aL]).trigger("scroll")}function u(aJ,s){if(az.showArrows){ar[aJ?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aJ,s){if(az.showArrows){ay[aJ?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aJ){var aK=s/(Z-v);V(aK*i,aJ)}function N(aJ,s){var aK=aJ/(T-ak);W(aK*j,s)}function ab(aW,aR,aK){var aO,aL,aM,s=0,aV=0,aJ,aQ,aP,aT,aS,aU;try{aO=b(aW)}catch(aN){return}aL=aO.outerHeight();aM=aO.outerWidth();am.scrollTop(0);am.scrollLeft(0);while(!aO.is(".jspPane")){s+=aO.position().top;aV+=aO.position().left;aO=aO.offsetParent();if(/^body|html$/i.test(aO[0].nodeName)){return}}aJ=aB();aP=aJ+v;if(saP){aS=s-v+aL+az.verticalGutter}}if(aS){M(aS,aK)}aQ=aD();aT=aQ+ak;if(aVaT){aU=aV-ak+aM+az.horizontalGutter}}if(aU){N(aU,aK)}}function aD(){return -Y.position().left}function aB(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aB()<10)}function B(){var s=T-ak;return(s>20)&&(s-aD()<10)}function ag(){am.unbind(ac).bind(ac,function(aM,aN,aL,aJ){var aK=aa,s=I;Q.scrollBy(aL*az.mouseWheelSpeed,-aJ*az.mouseWheelSpeed,false);return aK==aa&&s==I})}function n(){am.unbind(ac)}function aC(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aJ,aL=[];aF&&aL.push(an[0]);aA&&aL.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aO){if(aO.target!==this&&!(aL.length&&b(aO.target).closest(aL).length)){return}var aN=aa,aM=I;switch(aO.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aO.keyCode;aK();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aJ=aO.keyCode==s&&aN!=aa||aM!=I;return !aJ}).bind("keypress.jsp",function(aM){if(aM.keyCode==s){aK()}return !aJ});if(az.hideFocus){D.css("outline","none");if("hideFocus" in am[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in am[0]){D.attr("hideFocus",false)}}function aK(){var aN=aa,aM=I;switch(s){case 40:Q.scrollByY(az.keyboardSpeed,false);break;case 38:Q.scrollByY(-az.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*az.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*az.scrollPagePercent,false);break;case 39:Q.scrollByX(az.keyboardSpeed,false);break;case 37:Q.scrollByX(-az.keyboardSpeed,false);break}aJ=aN!=aa||aM!=I;return aJ}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aK,aJ;try{aK=b(location.hash)}catch(s){return}if(aK.length&&Y.find(location.hash)){if(am.scrollTop()===0){aJ=setInterval(function(){if(am.scrollTop()>0){ab(location.hash,true);b(document).scrollTop(am.position().top);clearInterval(aJ)}},50)}else{ab(location.hash,true);b(document).scrollTop(am.position().top)}}}}function ai(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function m(){ai();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aJ;if(s.length>1){aJ=s[1];if(aJ.length>0&&Y.find("#"+aJ).length>0){ab("#"+aJ,true);return false}}})}function ao(){var aK,aJ,aM,aL,aN,s=false;am.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aO){var aP=aO.originalEvent.touches[0];aK=aD();aJ=aB();aM=aP.pageX;aL=aP.pageY;aN=false;s=true}).bind("touchmove.jsp",function(aR){if(!s){return}var aQ=aR.originalEvent.touches[0],aP=aa,aO=I;Q.scrollTo(aK+aM-aQ.pageX,aJ+aL-aQ.pageY);aN=aN||Math.abs(aM-aQ.pageX)>5||Math.abs(aL-aQ.pageY)>5; return aP==aa&&aO==I}).bind("touchend.jsp",function(aO){s=false}).bind("click.jsp-touchclick",function(aO){if(aN){aN=false;return false}})}function g(){var s=aB(),aJ=aD();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ap.append(Y.children()));ap.scrollTop(s);ap.scrollLeft(aJ)}b.extend(Q,{reinitialise:function(aJ){aJ=b.extend({},az,aJ);at(aJ)},scrollToElement:function(aK,aJ,s){ab(aK,aJ,s)},scrollTo:function(aK,s,aJ){N(aK,aJ);M(s,aJ)},scrollToX:function(aJ,s){N(aJ,s)},scrollToY:function(s,aJ){M(s,aJ)},scrollToPercentX:function(aJ,s){N(aJ*(T-ak),s)},scrollToPercentY:function(aJ,s){M(aJ*(Z-v),s)},scrollBy:function(aJ,s,aK){Q.scrollByX(aJ,aK);Q.scrollByY(s,aK)},scrollByX:function(s,aK){s=(s>=0)?Math.max(s,1):Math.min(s,-1);var aJ=aD()+s,aL=aJ/(T-ak);W(aL*j,aK)},scrollByY:function(s,aK){s=(s>=0)?Math.max(s,1):Math.min(s,-1);var aJ=aB()+s,aL=aJ/(Z-v);V(aL*i,aK)},positionDragX:function(s,aJ){W(s,aJ)},positionDragY:function(aJ,s){V(aJ,s)},animate:function(aJ,aM,s,aL){var aK={};aK[aM]=s;aJ.animate(aK,{duration:az.animateDuration,ease:az.animateEase,queue:false,step:aL})},getContentPositionX:function(){return aD()},getContentPositionY:function(){return aB()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aD()/(T-ak)},getPercentScrolledY:function(){return aB()/(Z-v)},getIsScrollableH:function(){return aF},getIsScrollableV:function(){return aA},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:function(){m()},destroy:function(){g()}});at(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{g=new d(f,e);f.data("jsp",g)}})};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this); \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/js/jquery.mousewheel.js b/templates/website/ph2date/chat_assets/js/jquery.mousewheel.js index dbf8f4b..cec056b 100755 --- a/templates/website/ph2date/chat_assets/js/jquery.mousewheel.js +++ b/templates/website/ph2date/chat_assets/js/jquery.mousewheel.js @@ -1,78 +1,78 @@ -/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) - * Licensed under the MIT License (LICENSE.txt). - * - * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. - * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. - * Thanks to: Seamus Leahy for adding deltaX and deltaY - * - * Version: 3.0.4 - * - * Requires: 1.2.2+ - */ - -(function($) { - -var types = ['DOMMouseScroll', 'mousewheel']; - -$.event.special.mousewheel = { - setup: function() { - if ( this.addEventListener ) { - for ( var i=types.length; i; ) { - this.addEventListener( types[--i], handler, false ); - } - } else { - this.onmousewheel = handler; - } - }, - - teardown: function() { - if ( this.removeEventListener ) { - for ( var i=types.length; i; ) { - this.removeEventListener( types[--i], handler, false ); - } - } else { - this.onmousewheel = null; - } - } -}; - -$.fn.extend({ - mousewheel: function(fn) { - return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); - }, - - unmousewheel: function(fn) { - return this.unbind("mousewheel", fn); - } -}); - - -function handler(event) { - var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; - event = $.event.fix(orgEvent); - event.type = "mousewheel"; - - // Old school scrollwheel delta - if ( event.wheelDelta ) { delta = event.wheelDelta/120; } - if ( event.detail ) { delta = -event.detail/3; } - - // New school multidimensional scroll (touchpads) deltas - deltaY = delta; - - // Gecko - if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { - deltaY = 0; - deltaX = -1*delta; - } - - // Webkit - if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } - if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } - - // Add event and delta to the front of the arguments - args.unshift(event, delta, deltaX, deltaY); - - return $.event.handle.apply(this, args); -} - +/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) + * Licensed under the MIT License (LICENSE.txt). + * + * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. + * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. + * Thanks to: Seamus Leahy for adding deltaX and deltaY + * + * Version: 3.0.4 + * + * Requires: 1.2.2+ + */ + +(function($) { + +var types = ['DOMMouseScroll', 'mousewheel']; + +$.event.special.mousewheel = { + setup: function() { + if ( this.addEventListener ) { + for ( var i=types.length; i; ) { + this.addEventListener( types[--i], handler, false ); + } + } else { + this.onmousewheel = handler; + } + }, + + teardown: function() { + if ( this.removeEventListener ) { + for ( var i=types.length; i; ) { + this.removeEventListener( types[--i], handler, false ); + } + } else { + this.onmousewheel = null; + } + } +}; + +$.fn.extend({ + mousewheel: function(fn) { + return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); + }, + + unmousewheel: function(fn) { + return this.unbind("mousewheel", fn); + } +}); + + +function handler(event) { + var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; + event = $.event.fix(orgEvent); + event.type = "mousewheel"; + + // Old school scrollwheel delta + if ( event.wheelDelta ) { delta = event.wheelDelta/120; } + if ( event.detail ) { delta = -event.detail/3; } + + // New school multidimensional scroll (touchpads) deltas + deltaY = delta; + + // Gecko + if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { + deltaY = 0; + deltaX = -1*delta; + } + + // Webkit + if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } + if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } + + // Add event and delta to the front of the arguments + args.unshift(event, delta, deltaX, deltaY); + + return $.event.handle.apply(this, args); +} + })(jQuery); \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/js/jquery.ticker.js b/templates/website/ph2date/chat_assets/js/jquery.ticker.js index 9ac55ae..154850e 100755 --- a/templates/website/ph2date/chat_assets/js/jquery.ticker.js +++ b/templates/website/ph2date/chat_assets/js/jquery.ticker.js @@ -1,398 +1,398 @@ -/* - jQuery News Ticker 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, version 2 of the License. - - jQuery News Ticker 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 jQuery News Ticker. If not, see . -*/ -(function($){ - $.fn.ticker = function(options) { - // Extend our default options with those provided. - // Note that the first arg to extend is an empty object - - // this is to keep from overriding our "defaults" object. - var opts = $.extend({}, $.fn.ticker.defaults, options); - - /* Get the id of the UL to get our news content from */ - var newsID = '#' + $(this).attr('id'); - - /* Get the tag type - we will check this later to makde sure it is a UL tag */ - var tagType = $(this).get(0).tagName; - - return this.each(function() { - /* Internal vars */ - var settings = { - position: 0, - time: 0, - distance: 0, - newsArr: {}, - play: true, - paused: false, - contentLoaded: false, - dom: { - contentID: '#ticker-content', - titleID: '#ticker-title', - titleElem: '#ticker-title SPAN', - tickerID : '#ticker', - wrapperID: '#ticker-wrapper', - revealID: '#ticker-swipe', - revealElem: '#ticker-swipe SPAN', - controlsID: '#ticker-controls', - prevID: '#prev', - nextID: '#next', - playPauseID: '#play-pause' - } - }; - - // if we are not using a UL, display an error message and stop any further execution - if (tagType != 'UL' && tagType != 'OL' && opts.htmlFeed === true) { - debugError('Cannot use <' + tagType.toLowerCase() + '> type of element for this plugin - must of type
              or
                '); - return false; - } - - // set the ticker direction - opts.direction == 'rtl' ? opts.direction = 'right' : opts.direction = 'left'; - - // lets go... - initialisePage(); - /* Function to get the size of an Object*/ - function countSize(obj) { - var size = 0, key; - for (key in obj) { - if (obj.hasOwnProperty(key)) size++; - } - return size; - }; - - /* Function for handling debug and error messages */ - function debugError(obj) { - if (opts.debugMode) { - if (window.console && window.console.log) { - window.console.log(obj); - } - else { - alert(obj); - } - } - } - - /* Function to setup the page */ - function initialisePage() { - // add our HTML structure for the ticker to the DOM - $(settings.dom.wrapperID).append('

                '); - $(settings.dom.wrapperID).removeClass('no-js').addClass('has-js ' + opts.direction); - // hide the ticker - $(settings.dom.tickerElem + ',' + settings.dom.contentID).hide(); - // add the controls to the DOM if required - if (opts.controls) { - // add related events - set functions to run on given event - $(settings.dom.controlsID).live('click mouseover mousedown mouseout mouseup', function (e) { - var button = e.target.id; - if (e.type == 'click') { - switch (button) { - case settings.dom.prevID.replace('#', ''): - // show previous item - settings.paused = true; - $(settings.dom.playPauseID).addClass('paused'); - manualChangeContent(button); - break; - case settings.dom.nextID.replace('#', ''): - // show next item - settings.paused = true; - $(settings.dom.playPauseID).addClass('paused'); - manualChangeContent(button); - break; - case settings.dom.playPauseID.replace('#', ''): - // play or pause the ticker - if (settings.play == true) { - settings.paused = true; - $(settings.dom.playPauseID).addClass('paused'); - pauseTicker(); - } - else { - settings.paused = false; - $(settings.dom.playPauseID).removeClass('paused'); - restartTicker(); - } - break; - } - } - else if (e.type == 'mouseover' && $('#' + button).hasClass('controls')) { - $('#' + button).addClass('over'); - } - else if (e.type == 'mousedown' && $('#' + button).hasClass('controls')) { - $('#' + button).addClass('down'); - } - else if (e.type == 'mouseup' && $('#' + button).hasClass('controls')) { - $('#' + button).removeClass('down'); - } - else if (e.type == 'mouseout' && $('#' + button).hasClass('controls')) { - $('#' + button).removeClass('over'); - } - }); - // add controls HTML to DOM - $(settings.dom.wrapperID).append('
                '); - } - if (opts.displayType != 'fade') { - // add mouse over on the content - $(settings.dom.contentID).mouseover(function () { - if (settings.paused == false) { - pauseTicker(); - } - }).mouseout(function () { - if (settings.paused == false) { - restartTicker(); - } - }); - } - // process the content for this ticker - processContent(); - } - - /* Start to process the content for this ticker */ - function processContent() { - // check to see if we need to load content - if (settings.contentLoaded == false) { - // construct content - if (opts.ajaxFeed) { - if (opts.feedType == 'xml') { - $.ajax({ - url: opts.feedUrl, - cache: false, - dataType: opts.feedType, - async: true, - success: function(data){ - count = 0; - // get the 'root' node - for (var a = 0; a < data.childNodes.length; a++) { - if (data.childNodes[a].nodeName == 'rss') { - xmlContent = data.childNodes[a]; - } - } - // find the channel node - for (var i = 0; i < xmlContent.childNodes.length; i++) { - if (xmlContent.childNodes[i].nodeName == 'channel') { - xmlChannel = xmlContent.childNodes[i]; - } - } - // for each item create a link and add the article title as the link text - for (var x = 0; x < xmlChannel.childNodes.length; x++) { - if (xmlChannel.childNodes[x].nodeName == 'item') { - xmlItems = xmlChannel.childNodes[x]; - var title, link = false; - for (var y = 0; y < xmlItems.childNodes.length; y++) { - if (xmlItems.childNodes[y].nodeName == 'title') { - title = xmlItems.childNodes[y].lastChild.nodeValue; - } - else if (xmlItems.childNodes[y].nodeName == 'link') { - link = xmlItems.childNodes[y].lastChild.nodeValue; - } - if ((title !== false && title != '') && link !== false) { - settings.newsArr['item-' + count] = { type: opts.titleText, content: '
                ' + title + '' }; count++; title = false; link = false; - } - } - } - } - // quick check here to see if we actually have any content - log error if not - if (countSize(settings.newsArr < 1)) { - debugError('Couldn\'t find any content from the XML feed for the ticker to use!'); - return false; - } - setupContentAndTriggerDisplay(); - settings.contentLoaded = true; - } - }); - } - else { - debugError('Code Me!'); - } - } - else if (opts.htmlFeed) { - if($(newsID + ' LI').length > 0) { - $(newsID + ' LI').each(function (i) { - // maybe this could be one whole object and not an array of objects? - settings.newsArr['item-' + i] = { type: opts.titleText, content: $(this).html()}; - }); - setupContentAndTriggerDisplay(); - } - else { - debugError('Couldn\'t find HTML any content for the ticker to use!'); - return false; - } - } - else { - debugError('The ticker is set to not use any types of content! Check the settings for the ticker.'); - return false; - } - } - } - - function setupContentAndTriggerDisplay() { - - settings.contentLoaded = true; - - // update the ticker content with the correct item - // insert news content into DOM - $(settings.dom.titleElem).html(settings.newsArr['item-' + settings.position].type); - $(settings.dom.contentID).html(settings.newsArr['item-' + settings.position].content); - - // set the next content item to be used - loop round if we are at the end of the content - if (settings.position == (countSize(settings.newsArr) -1)) { - settings.position = 0; - } - else { - settings.position++; - } - - // get the values of content and set the time of the reveal (so all reveals have the same speed regardless of content size) - distance = $(settings.dom.contentID).width(); - time = distance / opts.speed; - - // start the ticker animation - revealContent(); - } - - // slide back cover or fade in content - function revealContent() { - if(settings.play) { - // get the width of the title element to offset the content and reveal - var offset = $(settings.dom.titleElem).width() + 20; - $(settings.dom.revealID).css(opts.direction, offset + 'px'); - // show the reveal element and start the animation - if (opts.displayType == 'fade') { - // fade in effect ticker - $(settings.dom.revealID).hide(0, function () { - $(settings.dom.contentID).css(opts.direction, offset + 'px').fadeIn(opts.fadeInSpeed, postReveal); - }); - } - else if (opts.displayType == 'scroll') { - // to code - } - else { - // default bbc scroll effect - $(settings.dom.revealElem).show(0, function () { - $(settings.dom.contentID).css(opts.direction, offset + 'px').show(); - // set our animation direction - animationAction = opts.direction == 'right' ? { marginRight: distance + 'px'} : { marginLeft: distance + 'px' }; - $(settings.dom.revealID).css('margin-' + opts.direction, '0px').delay(20).animate(animationAction, time, 'linear', postReveal); - }); - } - } - else { - return false; - } - }; - - // here we hide the current content and reset the ticker elements to a default state ready for the next ticker item - function postReveal() { - if(settings.play) { - // we have to separately fade the content out here to get around an IE bug - needs further investigation - $(settings.dom.contentID).delay(opts.pauseOnItems).fadeOut(opts.fadeOutSpeed); - // deal with the rest of the content, prepare the DOM and trigger the next ticker - if (opts.displayType == 'fade') { - $(settings.dom.contentID).fadeOut(opts.fadeOutSpeed, function () { - $(settings.dom.wrapperID) - .find(settings.dom.revealElem + ',' + settings.dom.contentID) - .hide() - .end().find(settings.dom.tickerID + ',' + settings.dom.revealID) - .show() - .end().find(settings.dom.tickerID + ',' + settings.dom.revealID) - .removeAttr('style'); - setupContentAndTriggerDisplay(); - }); - } - else { - $(settings.dom.revealID).hide(0, function () { - $(settings.dom.contentID).fadeOut(opts.fadeOutSpeed, function () { - $(settings.dom.wrapperID) - .find(settings.dom.revealElem + ',' + settings.dom.contentID) - .hide() - .end().find(settings.dom.tickerID + ',' + settings.dom.revealID) - .show() - .end().find(settings.dom.tickerID + ',' + settings.dom.revealID) - .removeAttr('style'); - setupContentAndTriggerDisplay(); - }); - }); - } - } - else { - $(settings.dom.revealElem).hide(); - } - } - - // pause ticker - function pauseTicker() { - settings.play = false; - // stop animation and show content - must pass "true, true" to the stop function, or we can get some funky behaviour - $(settings.dom.tickerID + ',' + settings.dom.revealID + ',' + settings.dom.titleID + ',' + settings.dom.titleElem + ',' + settings.dom.revealElem + ',' + settings.dom.contentID).stop(true, true); - $(settings.dom.revealID + ',' + settings.dom.revealElem).hide(); - $(settings.dom.wrapperID) - .find(settings.dom.titleID + ',' + settings.dom.titleElem).show() - .end().find(settings.dom.contentID).show(); - } - - // play ticker - function restartTicker() { - settings.play = true; - settings.paused = false; - // start the ticker again - postReveal(); - } - - // change the content on user input - function manualChangeContent(direction) { - pauseTicker(); - switch (direction) { - case 'prev': - if (settings.position == 0) { - settings.position = countSize(settings.newsArr) -2; - } - else if (settings.position == 1) { - settings.position = countSize(settings.newsArr) -1; - } - else { - settings.position = settings.position - 2; - } - $(settings.dom.titleElem).html(settings.newsArr['item-' + settings.position].type); - $(settings.dom.contentID).html(settings.newsArr['item-' + settings.position].content); - break; - case 'next': - $(settings.dom.titleElem).html(settings.newsArr['item-' + settings.position].type); - $(settings.dom.contentID).html(settings.newsArr['item-' + settings.position].content); - break; - } - // set the next content item to be used - loop round if we are at the end of the content - if (settings.position == (countSize(settings.newsArr) -1)) { - settings.position = 0; - } - else { - settings.position++; - } - } - }); - }; - - // plugin defaults - added as a property on our plugin function - $.fn.ticker.defaults = { - speed: 0.10, - ajaxFeed: false, - feedUrl: '', - feedType: 'xml', - displayType: 'reveal', - htmlFeed: true, - debugMode: true, - controls: true, - titleText: 'Latest NewsFeeds From Blog:', - - direction: 'ltr', - pauseOnItems: 3000, - fadeInSpeed: 600, - fadeOutSpeed: 300 - }; +/* + jQuery News Ticker 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, version 2 of the License. + + jQuery News Ticker 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 jQuery News Ticker. If not, see . +*/ +(function($){ + $.fn.ticker = function(options) { + // Extend our default options with those provided. + // Note that the first arg to extend is an empty object - + // this is to keep from overriding our "defaults" object. + var opts = $.extend({}, $.fn.ticker.defaults, options); + + /* Get the id of the UL to get our news content from */ + var newsID = '#' + $(this).attr('id'); + + /* Get the tag type - we will check this later to makde sure it is a UL tag */ + var tagType = $(this).get(0).tagName; + + return this.each(function() { + /* Internal vars */ + var settings = { + position: 0, + time: 0, + distance: 0, + newsArr: {}, + play: true, + paused: false, + contentLoaded: false, + dom: { + contentID: '#ticker-content', + titleID: '#ticker-title', + titleElem: '#ticker-title SPAN', + tickerID : '#ticker', + wrapperID: '#ticker-wrapper', + revealID: '#ticker-swipe', + revealElem: '#ticker-swipe SPAN', + controlsID: '#ticker-controls', + prevID: '#prev', + nextID: '#next', + playPauseID: '#play-pause' + } + }; + + // if we are not using a UL, display an error message and stop any further execution + if (tagType != 'UL' && tagType != 'OL' && opts.htmlFeed === true) { + debugError('Cannot use <' + tagType.toLowerCase() + '> type of element for this plugin - must of type
                  or
                    '); + return false; + } + + // set the ticker direction + opts.direction == 'rtl' ? opts.direction = 'right' : opts.direction = 'left'; + + // lets go... + initialisePage(); + /* Function to get the size of an Object*/ + function countSize(obj) { + var size = 0, key; + for (key in obj) { + if (obj.hasOwnProperty(key)) size++; + } + return size; + }; + + /* Function for handling debug and error messages */ + function debugError(obj) { + if (opts.debugMode) { + if (window.console && window.console.log) { + window.console.log(obj); + } + else { + alert(obj); + } + } + } + + /* Function to setup the page */ + function initialisePage() { + // add our HTML structure for the ticker to the DOM + $(settings.dom.wrapperID).append('

                    '); + $(settings.dom.wrapperID).removeClass('no-js').addClass('has-js ' + opts.direction); + // hide the ticker + $(settings.dom.tickerElem + ',' + settings.dom.contentID).hide(); + // add the controls to the DOM if required + if (opts.controls) { + // add related events - set functions to run on given event + $(settings.dom.controlsID).live('click mouseover mousedown mouseout mouseup', function (e) { + var button = e.target.id; + if (e.type == 'click') { + switch (button) { + case settings.dom.prevID.replace('#', ''): + // show previous item + settings.paused = true; + $(settings.dom.playPauseID).addClass('paused'); + manualChangeContent(button); + break; + case settings.dom.nextID.replace('#', ''): + // show next item + settings.paused = true; + $(settings.dom.playPauseID).addClass('paused'); + manualChangeContent(button); + break; + case settings.dom.playPauseID.replace('#', ''): + // play or pause the ticker + if (settings.play == true) { + settings.paused = true; + $(settings.dom.playPauseID).addClass('paused'); + pauseTicker(); + } + else { + settings.paused = false; + $(settings.dom.playPauseID).removeClass('paused'); + restartTicker(); + } + break; + } + } + else if (e.type == 'mouseover' && $('#' + button).hasClass('controls')) { + $('#' + button).addClass('over'); + } + else if (e.type == 'mousedown' && $('#' + button).hasClass('controls')) { + $('#' + button).addClass('down'); + } + else if (e.type == 'mouseup' && $('#' + button).hasClass('controls')) { + $('#' + button).removeClass('down'); + } + else if (e.type == 'mouseout' && $('#' + button).hasClass('controls')) { + $('#' + button).removeClass('over'); + } + }); + // add controls HTML to DOM + $(settings.dom.wrapperID).append('
                    '); + } + if (opts.displayType != 'fade') { + // add mouse over on the content + $(settings.dom.contentID).mouseover(function () { + if (settings.paused == false) { + pauseTicker(); + } + }).mouseout(function () { + if (settings.paused == false) { + restartTicker(); + } + }); + } + // process the content for this ticker + processContent(); + } + + /* Start to process the content for this ticker */ + function processContent() { + // check to see if we need to load content + if (settings.contentLoaded == false) { + // construct content + if (opts.ajaxFeed) { + if (opts.feedType == 'xml') { + $.ajax({ + url: opts.feedUrl, + cache: false, + dataType: opts.feedType, + async: true, + success: function(data){ + count = 0; + // get the 'root' node + for (var a = 0; a < data.childNodes.length; a++) { + if (data.childNodes[a].nodeName == 'rss') { + xmlContent = data.childNodes[a]; + } + } + // find the channel node + for (var i = 0; i < xmlContent.childNodes.length; i++) { + if (xmlContent.childNodes[i].nodeName == 'channel') { + xmlChannel = xmlContent.childNodes[i]; + } + } + // for each item create a link and add the article title as the link text + for (var x = 0; x < xmlChannel.childNodes.length; x++) { + if (xmlChannel.childNodes[x].nodeName == 'item') { + xmlItems = xmlChannel.childNodes[x]; + var title, link = false; + for (var y = 0; y < xmlItems.childNodes.length; y++) { + if (xmlItems.childNodes[y].nodeName == 'title') { + title = xmlItems.childNodes[y].lastChild.nodeValue; + } + else if (xmlItems.childNodes[y].nodeName == 'link') { + link = xmlItems.childNodes[y].lastChild.nodeValue; + } + if ((title !== false && title != '') && link !== false) { + settings.newsArr['item-' + count] = { type: opts.titleText, content: '' + title + '' }; count++; title = false; link = false; + } + } + } + } + // quick check here to see if we actually have any content - log error if not + if (countSize(settings.newsArr < 1)) { + debugError('Couldn\'t find any content from the XML feed for the ticker to use!'); + return false; + } + setupContentAndTriggerDisplay(); + settings.contentLoaded = true; + } + }); + } + else { + debugError('Code Me!'); + } + } + else if (opts.htmlFeed) { + if($(newsID + ' LI').length > 0) { + $(newsID + ' LI').each(function (i) { + // maybe this could be one whole object and not an array of objects? + settings.newsArr['item-' + i] = { type: opts.titleText, content: $(this).html()}; + }); + setupContentAndTriggerDisplay(); + } + else { + debugError('Couldn\'t find HTML any content for the ticker to use!'); + return false; + } + } + else { + debugError('The ticker is set to not use any types of content! Check the settings for the ticker.'); + return false; + } + } + } + + function setupContentAndTriggerDisplay() { + + settings.contentLoaded = true; + + // update the ticker content with the correct item + // insert news content into DOM + $(settings.dom.titleElem).html(settings.newsArr['item-' + settings.position].type); + $(settings.dom.contentID).html(settings.newsArr['item-' + settings.position].content); + + // set the next content item to be used - loop round if we are at the end of the content + if (settings.position == (countSize(settings.newsArr) -1)) { + settings.position = 0; + } + else { + settings.position++; + } + + // get the values of content and set the time of the reveal (so all reveals have the same speed regardless of content size) + distance = $(settings.dom.contentID).width(); + time = distance / opts.speed; + + // start the ticker animation + revealContent(); + } + + // slide back cover or fade in content + function revealContent() { + if(settings.play) { + // get the width of the title element to offset the content and reveal + var offset = $(settings.dom.titleElem).width() + 20; + $(settings.dom.revealID).css(opts.direction, offset + 'px'); + // show the reveal element and start the animation + if (opts.displayType == 'fade') { + // fade in effect ticker + $(settings.dom.revealID).hide(0, function () { + $(settings.dom.contentID).css(opts.direction, offset + 'px').fadeIn(opts.fadeInSpeed, postReveal); + }); + } + else if (opts.displayType == 'scroll') { + // to code + } + else { + // default bbc scroll effect + $(settings.dom.revealElem).show(0, function () { + $(settings.dom.contentID).css(opts.direction, offset + 'px').show(); + // set our animation direction + animationAction = opts.direction == 'right' ? { marginRight: distance + 'px'} : { marginLeft: distance + 'px' }; + $(settings.dom.revealID).css('margin-' + opts.direction, '0px').delay(20).animate(animationAction, time, 'linear', postReveal); + }); + } + } + else { + return false; + } + }; + + // here we hide the current content and reset the ticker elements to a default state ready for the next ticker item + function postReveal() { + if(settings.play) { + // we have to separately fade the content out here to get around an IE bug - needs further investigation + $(settings.dom.contentID).delay(opts.pauseOnItems).fadeOut(opts.fadeOutSpeed); + // deal with the rest of the content, prepare the DOM and trigger the next ticker + if (opts.displayType == 'fade') { + $(settings.dom.contentID).fadeOut(opts.fadeOutSpeed, function () { + $(settings.dom.wrapperID) + .find(settings.dom.revealElem + ',' + settings.dom.contentID) + .hide() + .end().find(settings.dom.tickerID + ',' + settings.dom.revealID) + .show() + .end().find(settings.dom.tickerID + ',' + settings.dom.revealID) + .removeAttr('style'); + setupContentAndTriggerDisplay(); + }); + } + else { + $(settings.dom.revealID).hide(0, function () { + $(settings.dom.contentID).fadeOut(opts.fadeOutSpeed, function () { + $(settings.dom.wrapperID) + .find(settings.dom.revealElem + ',' + settings.dom.contentID) + .hide() + .end().find(settings.dom.tickerID + ',' + settings.dom.revealID) + .show() + .end().find(settings.dom.tickerID + ',' + settings.dom.revealID) + .removeAttr('style'); + setupContentAndTriggerDisplay(); + }); + }); + } + } + else { + $(settings.dom.revealElem).hide(); + } + } + + // pause ticker + function pauseTicker() { + settings.play = false; + // stop animation and show content - must pass "true, true" to the stop function, or we can get some funky behaviour + $(settings.dom.tickerID + ',' + settings.dom.revealID + ',' + settings.dom.titleID + ',' + settings.dom.titleElem + ',' + settings.dom.revealElem + ',' + settings.dom.contentID).stop(true, true); + $(settings.dom.revealID + ',' + settings.dom.revealElem).hide(); + $(settings.dom.wrapperID) + .find(settings.dom.titleID + ',' + settings.dom.titleElem).show() + .end().find(settings.dom.contentID).show(); + } + + // play ticker + function restartTicker() { + settings.play = true; + settings.paused = false; + // start the ticker again + postReveal(); + } + + // change the content on user input + function manualChangeContent(direction) { + pauseTicker(); + switch (direction) { + case 'prev': + if (settings.position == 0) { + settings.position = countSize(settings.newsArr) -2; + } + else if (settings.position == 1) { + settings.position = countSize(settings.newsArr) -1; + } + else { + settings.position = settings.position - 2; + } + $(settings.dom.titleElem).html(settings.newsArr['item-' + settings.position].type); + $(settings.dom.contentID).html(settings.newsArr['item-' + settings.position].content); + break; + case 'next': + $(settings.dom.titleElem).html(settings.newsArr['item-' + settings.position].type); + $(settings.dom.contentID).html(settings.newsArr['item-' + settings.position].content); + break; + } + // set the next content item to be used - loop round if we are at the end of the content + if (settings.position == (countSize(settings.newsArr) -1)) { + settings.position = 0; + } + else { + settings.position++; + } + } + }); + }; + + // plugin defaults - added as a property on our plugin function + $.fn.ticker.defaults = { + speed: 0.10, + ajaxFeed: false, + feedUrl: '', + feedType: 'xml', + displayType: 'reveal', + htmlFeed: true, + debugMode: true, + controls: true, + titleText: 'Latest NewsFeeds From Blog:', + + direction: 'ltr', + pauseOnItems: 3000, + fadeInSpeed: 600, + fadeOutSpeed: 300 + }; })(jQuery); \ No newline at end of file diff --git a/templates/website/ph2date/chat_assets/js/jquery/jquery-1.4.4.js b/templates/website/ph2date/chat_assets/js/jquery/jquery-1.4.4.js index a4a6d50..c0d16d5 100755 --- a/templates/website/ph2date/chat_assets/js/jquery/jquery-1.4.4.js +++ b/templates/website/ph2date/chat_assets/js/jquery/jquery-1.4.4.js @@ -1,153 +1,153 @@ -(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= -h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;kd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, -"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, -e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, -"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ -a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, -C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, -s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, -j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, -toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== --1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; -if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", -b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& -!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& -l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H
                    a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), -k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, -scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= -false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div"),A=t.getElementsByTagName("body")[0];if(A){r.style.width=r.style.paddingLeft="1px";A.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display= -"inline";r.style.zoom=1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="
                    ";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="
                    t
                    ";var C=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=C[0].offsetHeight===0;C[0].style.display="";C[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&C[0].offsetHeight===0;r.innerHTML= -"";A.removeChild(r).style.display="none"}});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e= -a.nodeType,f=e?a[c.expando]:null,h=c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando]; -else if(a.removeAttribute)a.removeAttribute(c.expando);else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e= -b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true, -data:true,width:true,height:true,offset:true},attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue; -if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g, -Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!== -"undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a, -h);if(!h.handler.guid)h.handler.guid=d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o= -f.split(".");f=o.shift();x=RegExp("(^|\\.)"+c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a, -b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l; -e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k==="click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split("."); -a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b= -a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type==="file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)}, -teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d, -e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, -e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+= -D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y|| -k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]= -false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])|| -"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild}, -has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()=== -"button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]-0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent|| -g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g): -g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source); -o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m, -p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m= -n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&function(){var g=k,i=t.createElement("div");i.innerHTML="

                    ";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m, -p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector|| -g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=t.createElement("div");g.innerHTML="
                    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length=== -0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument|| -g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e --1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]|| -!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")}, -nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f): -f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a, -b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1,""],legend:[1,"
                    ","
                    "],thead:[1,"","
                    "],tr:[2,"","
                    "], -td:[3,"","
                    "],col:[2,"","
                    "],area:[1,"",""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
                    ","
                    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument|| -t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b= -c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&& -this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}}, -remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML, -e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a= -a.replace(Aa,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable|| -this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before", -insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||t; -for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length-1;o>=0;--o)c.nodeName(k[o], -"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); -d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, -jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, -zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), -h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); -if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= -d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; -e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/)<[^<]*)*<\/script>/gi, -ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== -"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("
                    ").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& -!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, -getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", -script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| -!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= -false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; -A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", -b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& -c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| -c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= -encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", -[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), -e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); -if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", -3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, -d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* -Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} -var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; -this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| -this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= -c.timers,b=0;b-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, -e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& -c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); -c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ -b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); +(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= +h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;kd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, +"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, +e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, +"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ +a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, +C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, +s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, +j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, +toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== +-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; +if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", +b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& +!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& +l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H
                    a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), +k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, +scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= +false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div"),A=t.getElementsByTagName("body")[0];if(A){r.style.width=r.style.paddingLeft="1px";A.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display= +"inline";r.style.zoom=1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="
                    ";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="
                    t
                    ";var C=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=C[0].offsetHeight===0;C[0].style.display="";C[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&C[0].offsetHeight===0;r.innerHTML= +"";A.removeChild(r).style.display="none"}});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e= +a.nodeType,f=e?a[c.expando]:null,h=c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando]; +else if(a.removeAttribute)a.removeAttribute(c.expando);else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e= +b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true, +data:true,width:true,height:true,offset:true},attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue; +if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g, +Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!== +"undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a, +h);if(!h.handler.guid)h.handler.guid=d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o= +f.split(".");f=o.shift();x=RegExp("(^|\\.)"+c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a, +b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l; +e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k==="click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split("."); +a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b= +a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type==="file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)}, +teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d, +e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+= +D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y|| +k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]= +false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])|| +"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild}, +has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()=== +"button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]-0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent|| +g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g): +g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source); +o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m, +p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m= +n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&function(){var g=k,i=t.createElement("div");i.innerHTML="

                    ";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m, +p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector|| +g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=t.createElement("div");g.innerHTML="
                    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length=== +0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument|| +g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e +-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]|| +!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")}, +nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f): +f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a, +b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1,""],legend:[1,"
                    ","
                    "],thead:[1,"","
                    "],tr:[2,"","
                    "], +td:[3,"","
                    "],col:[2,"","
                    "],area:[1,"",""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
                    ","
                    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument|| +t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b= +c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&& +this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}}, +remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML, +e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a= +a.replace(Aa,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable|| +this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before", +insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||t; +for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length-1;o>=0;--o)c.nodeName(k[o], +"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); +d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, +jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, +zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), +h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); +if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= +d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; +e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/)<[^<]*)*<\/script>/gi, +ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== +"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("
                    ").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& +!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, +getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", +script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| +!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= +false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; +A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", +b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& +c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| +c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= +encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", +[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), +e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); +if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", +3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, +d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* +Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} +var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; +this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| +this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= +c.timers,b=0;b-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, +e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& +c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); +c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ +b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/templates/website/ph2date/chat_assets/js/jquery/jquery-ui-1.8.custom.js b/templates/website/ph2date/chat_assets/js/jquery/jquery-ui-1.8.custom.js index 2b6361f..5cbb2e0 100755 --- a/templates/website/ph2date/chat_assets/js/jquery/jquery-ui-1.8.custom.js +++ b/templates/website/ph2date/chat_assets/js/jquery/jquery-ui-1.8.custom.js @@ -1,383 +1,383 @@ -jQuery.ui||function(b){b.ui={version:"1.8",plugin:{add:function(c,f,d){c=b.ui[c].prototype;for(var a in d){c.plugins[a]=c.plugins[a]||[];c.plugins[a].push([f,d[a]])}},call:function(c,f,d){if((f=c.plugins[f])&&c.element[0].parentNode)for(var a=0;a0)return true;c[d]=1;a=c[d]>0;c[d]=0;return a},isOverAxis:function(c,f,d){return c>f&&c=0)&&b(c).is(":focusable")}})}(jQuery); -(function(b){var c=b.fn.remove;b.fn.remove=function(f,d){return this.each(function(){if(!d)if(!f||b.filter(f,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return c.call(b(this),f,d)})};b.widget=function(f,d,a){var e=f.split(".")[0],g;f=f.split(".")[1];g=e+"-"+f;if(!a){a=d;d=b.Widget}b.expr[":"][g]=function(i){return!!b.data(i,f)};b[e]=b[e]||{};b[e][f]=function(i,k){arguments.length&&this._createWidget(i,k)};d=new d;d.options=b.extend({},d.options);b[e][f].prototype= -b.extend(true,d,{namespace:e,widgetName:f,widgetEventPrefix:b[e][f].prototype.widgetEventPrefix||f,widgetBaseClass:g},a);b.widget.bridge(f,b[e][f])};b.widget.bridge=function(f,d){b.fn[f]=function(a){var e=typeof a==="string",g=Array.prototype.slice.call(arguments,1),i=this;a=!e&&g.length?b.extend.apply(null,[true,a].concat(g)):a;if(e&&a.substring(0,1)==="_")return i;e?this.each(function(){var k=b.data(this,f),j=k&&b.isFunction(k[a])?k[a].apply(k,g):k;if(j!==k&&j!==undefined){i=j;return false}}):this.each(function(){var k= -b.data(this,f);if(k){a&&k.option(a);k._init()}else b.data(this,f,new d(a,this))});return i}};b.Widget=function(f,d){arguments.length&&this._createWidget(f,d)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,d){this.element=b(d).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(d)[this.widgetName],f);var a=this;this.element.bind("remove."+this.widgetName,function(){a.destroy()});this._create(); -this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled")},widget:function(){return this.element},option:function(f,d){var a=f,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof f==="string"){if(d===undefined)return this.options[f];a={};a[f]=d}b.each(a, -function(g,i){e._setOption(g,i)});return e},_setOption:function(f,d){this.options[f]=d;if(f==="disabled")this.widget()[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",d);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(f,d,a){var e=this.options[f];d=b.Event(d);d.type=(f===this.widgetEventPrefix?f:this.widgetEventPrefix+f).toLowerCase(); -a=a||{};if(d.originalEvent){f=b.event.props.length;for(var g;f;){g=b.event.props[--f];d[g]=d.originalEvent[g]}}this.element.trigger(d,a);return!(b.isFunction(e)&&e.call(this.element[0],d,a)===false||d.isDefaultPrevented())}}})(jQuery); -(function(b){b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(f){return c._mouseDown(f)}).bind("click."+this.widgetName,function(f){if(c._preventClickEvent){c._preventClickEvent=false;f.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(c){c.originalEvent=c.originalEvent||{};if(!c.originalEvent.mouseHandled){this._mouseStarted&& -this._mouseUp(c);this._mouseDownEvent=c;var f=this,d=c.which==1,a=typeof this.options.cancel=="string"?b(c.target).parents().add(c.target).filter(this.options.cancel).length:false;if(!d||a||!this._mouseCapture(c))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){f.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=this._mouseStart(c)!==false;if(!this._mouseStarted){c.preventDefault(); -return true}}this._mouseMoveDelegate=function(e){return f._mouseMove(e)};this._mouseUpDelegate=function(e){return f._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.browser.safari||c.preventDefault();return c.originalEvent.mouseHandled=true}},_mouseMove:function(c){if(b.browser.msie&&!c.button)return this._mouseUp(c);if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&& -this._mouseDelayMet(c))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==false)?this._mouseDrag(c):this._mouseUp(c);return!this._mouseStarted},_mouseUp:function(c){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=c.target==this._mouseDownEvent.target;this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX- -c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -(function(b){b.ui=b.ui||{};var c=/left|center|right/,f=/top|center|bottom/,d=b.fn.position,a=b.fn.offset;b.fn.position=function(e){if(!e||!e.of)return d.apply(this,arguments);e=b.extend({},e);var g=b(e.of),i=(e.collision||"flip").split(" "),k=e.offset?e.offset.split(" "):[0,0],j,h,l;if(e.of.nodeType===9){j=g.width();h=g.height();l={top:0,left:0}}else if(e.of.scrollTo&&e.of.document){j=g.width();h=g.height();l={top:g.scrollTop(),left:g.scrollLeft()}}else if(e.of.preventDefault){e.at="left top";j=h= -0;l={top:e.of.pageY,left:e.of.pageX}}else{j=g.outerWidth();h=g.outerHeight();l=g.offset()}b.each(["my","at"],function(){var m=(e[this]||"").split(" ");if(m.length===1)m=c.test(m[0])?m.concat(["center"]):f.test(m[0])?["center"].concat(m):["center","center"];m[0]=c.test(m[0])?m[0]:"center";m[1]=f.test(m[1])?m[1]:"center";e[this]=m});if(i.length===1)i[1]=i[0];k[0]=parseInt(k[0],10)||0;if(k.length===1)k[1]=k[0];k[1]=parseInt(k[1],10)||0;if(e.at[0]==="right")l.left+=j;else if(e.at[0]==="center")l.left+= -j/2;if(e.at[1]==="bottom")l.top+=h;else if(e.at[1]==="center")l.top+=h/2;l.left+=k[0];l.top+=k[1];return this.each(function(){var m=b(this),n=m.outerWidth(),o=m.outerHeight(),p=b.extend({},l);if(e.my[0]==="right")p.left-=n;else if(e.my[0]==="center")p.left-=n/2;if(e.my[1]==="bottom")p.top-=o;else if(e.my[1]==="center")p.top-=o/2;b.each(["left","top"],function(q,r){b.ui.position[i[q]]&&b.ui.position[i[q]][r](p,{targetWidth:j,targetHeight:h,elemWidth:n,elemHeight:o,offset:k,my:e.my,at:e.at})});b.fn.bgiframe&& -m.bgiframe();m.offset(b.extend(p,{using:e.using}))})};b.ui.position={fit:{left:function(e,g){var i=b(window);i=e.left+g.elemWidth-i.width()-i.scrollLeft();e.left=i>0?e.left-i:Math.max(0,e.left)},top:function(e,g){var i=b(window);i=e.top+g.elemHeight-i.height()-i.scrollTop();e.top=i>0?e.top-i:Math.max(0,e.top)}},flip:{left:function(e,g){if(g.at[0]!=="center"){var i=b(window);i=e.left+g.elemWidth-i.width()-i.scrollLeft();var k=g.my[0]==="left"?-g.elemWidth:g.my[0]==="right"?g.elemWidth:0,j=-2*g.offset[0]; -e.left+=e.left<0?k+g.targetWidth+j:i>0?k-g.targetWidth+j:0}},top:function(e,g){if(g.at[1]!=="center"){var i=b(window);i=e.top+g.elemHeight-i.height()-i.scrollTop();var k=g.my[1]==="top"?-g.elemHeight:g.my[1]==="bottom"?g.elemHeight:0,j=g.at[1]==="top"?g.targetHeight:-g.targetHeight,h=-2*g.offset[1];e.top+=e.top<0?k+g.targetHeight+h:i>0?k+j+h:0}}}};if(!b.offset.setOffset){b.offset.setOffset=function(e,g){if(/static/.test(b.curCSS(e,"position")))e.style.position="relative";var i=b(e),k=i.offset(),j= -parseInt(b.curCSS(e,"top",true),10)||0,h=parseInt(b.curCSS(e,"left",true),10)||0;k={top:g.top-k.top+j,left:g.left-k.left+h};"using"in g?g.using.call(e,k):i.css(k)};b.fn.offset=function(e){var g=this[0];if(!g||!g.ownerDocument)return null;if(e)return this.each(function(){b.offset.setOffset(this,e)});return a.call(this)}}})(jQuery); -(function(b){b.widget("ui.draggable",b.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(c){var f= -this.options;if(this.helper||f.disabled||b(c.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(c);if(!this.handle)return false;return true},_mouseStart:function(c){var f=this.options;this.helper=this._createHelper(c);this._cacheHelperProportions();if(b.ui.ddmanager)b.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};b.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;f.cursorAt&&this._adjustOffsetFromHelper(f.cursorAt);f.containment&&this._setContainment();if(this._trigger("start",c)===false){this._clear();return false}this._cacheHelperProportions(); -b.ui.ddmanager&&!f.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(c,true);return true},_mouseDrag:function(c,f){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");if(!f){var d=this._uiHash();if(this._trigger("drag",c,d)===false){this._mouseUp({});return false}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";b.ui.ddmanager&&b.ui.ddmanager.drag(this,c);return false},_mouseStop:function(c){var f=false;if(b.ui.ddmanager&&!this.options.dropBehaviour)f=b.ui.ddmanager.drop(this,c);if(this.dropped){f=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!f||this.options.revert=="valid"&&f||this.options.revert===true||b.isFunction(this.options.revert)&&this.options.revert.call(this.element, -f)){var d=this;b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",c)!==false&&d._clear()})}else this._trigger("stop",c)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(c){var f=!this.options.handle||!b(this.options.handle,this.element).length?true:false;b(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -c.target)f=true});return f},_createHelper:function(c){var f=this.options;c=b.isFunction(f.helper)?b(f.helper.apply(this.element[0],[c])):f.helper=="clone"?this.element.clone():this.element;c.parents("body").length||c.appendTo(f.appendTo=="parent"?this.element[0].parentNode:f.appendTo);c[0]!=this.element[0]&&!/(fixed|absolute)/.test(c.css("position"))&&c.css("position","absolute");return c},_adjustOffsetFromHelper:function(c){if(typeof c=="string")c=c.split(" ");if(b.isArray(c))c={left:+c[0],top:+c[1]|| -0};if("left"in c)this.offset.click.left=c.left+this.margins.left;if("right"in c)this.offset.click.left=this.helperProportions.width-c.right+this.margins.left;if("top"in c)this.offset.click.top=c.top+this.margins.top;if("bottom"in c)this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0], -this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)c={top:0,left:0};return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.element.position();return{top:c.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var c=this.options;if(c.containment== -"parent")c.containment=this.helper[0].parentNode;if(c.containment=="document"||c.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(c.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b(c.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(c.containment)&& -c.containment.constructor!=Array){var f=b(c.containment)[0];if(f){c=b(c.containment).offset();var d=b(f).css("overflow")!="hidden";this.containment=[c.left+(parseInt(b(f).css("borderLeftWidth"),10)||0)+(parseInt(b(f).css("paddingLeft"),10)||0)-this.margins.left,c.top+(parseInt(b(f).css("borderTopWidth"),10)||0)+(parseInt(b(f).css("paddingTop"),10)||0)-this.margins.top,c.left+(d?Math.max(f.scrollWidth,f.offsetWidth):f.offsetWidth)-(parseInt(b(f).css("borderLeftWidth"),10)||0)-(parseInt(b(f).css("paddingRight"), -10)||0)-this.helperProportions.width-this.margins.left,c.top+(d?Math.max(f.scrollHeight,f.offsetHeight):f.offsetHeight)-(parseInt(b(f).css("borderTopWidth"),10)||0)-(parseInt(b(f).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(c.containment.constructor==Array)this.containment=c.containment},_convertPositionTo:function(c,f){if(!f)f=this.position;var d=c=="absolute"?1:-1,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0], -this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(a[0].tagName);return{top:f.top+this.offset.relative.top*d+this.offset.parent.top*d-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:a.scrollTop())*d),left:f.left+this.offset.relative.left*d+this.offset.parent.left*d-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft(): -e?0:a.scrollLeft())*d)}},_generatePosition:function(c){var f=this.options,d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,a=/(html|body)/i.test(d[0].tagName),e=c.pageX,g=c.pageY;if(this.originalPosition){if(this.containment){if(c.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(c.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(f.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/f.grid[1])*f.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left
                    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(b(this).offset()).appendTo("body")})},stop:function(){b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});b.ui.plugin.add("draggable","opacity",{start:function(c,f){var d=b(f.helper), -a=b(this).data("draggable").options;if(d.css("opacity"))a._opacity=d.css("opacity");d.css("opacity",a.opacity)},stop:function(c,f){var d=b(this).data("draggable").options;d._opacity&&b(f.helper).css("opacity",d._opacity)}});b.ui.plugin.add("draggable","scroll",{start:function(){var c=b(this).data("draggable");if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML")c.overflowOffset=c.scrollParent.offset()},drag:function(c){var f=b(this).data("draggable"),d=f.options,a=false;if(f.scrollParent[0]!= -document&&f.scrollParent[0].tagName!="HTML"){if(!d.axis||d.axis!="x")if(f.overflowOffset.top+f.scrollParent[0].offsetHeight-c.pageY=0;h--){var l=d.snapElements[h].left,m=l+d.snapElements[h].width,n=d.snapElements[h].top,o=n+d.snapElements[h].height;if(l-e=h&&g<=l||i>=h&&i<=l||gl)&&(a>=k&&a<=j||e>=k&&e<=j||aj);default:return false}}; -b.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(c,f){var d=b.ui.ddmanager.droppables[c.options.scope]||[],a=f?f.type:null,e=(c.currentItem||c.element).find(":data(droppable)").andSelf(),g=0;a:for(;g').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!b(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var e=this.handles.split(",");this.handles={};for(var g=0;g');/sw|se|ne|nw/.test(i)&&k.css({zIndex:++a.zIndex});"se"==i&&k.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[i]=".ui-resizable-"+i;this.element.append(k)}}this._renderAxis=function(j){j=j||this.element;for(var h in this.handles){if(this.handles[h].constructor== -String)this.handles[h]=b(this.handles[h],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var l=b(this.handles[h],this.element),m=0;m=/sw|ne|nw|se|n|s/.test(h)?l.outerHeight():l.outerWidth();l=["padding",/ne|nw|n/.test(h)?"Top":/se|sw|s/.test(h)?"Bottom":/^e$/.test(h)?"Right":"Left"].join("");j.css(l,m);this._proportionallyResize()}b(this.handles[h])}};this._renderAxis(this.element);this._handles=b(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!d.resizing){if(this.className)var j=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);d.axis=j&&j[1]?j[1]:"se"}});if(a.autoHide){this._handles.hide();b(this.element).addClass("ui-resizable-autohide").hover(function(){b(this).removeClass("ui-resizable-autohide");d._handles.show()},function(){if(!d.resizing){b(this).addClass("ui-resizable-autohide");d._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(e){b(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; -if(this.elementIsWrapper){d(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement);return this},_mouseCapture:function(d){var a=false,e;for(e in this.handles)if(b(this.handles[e])[0]==d.target)a=true;return!this.options.disabled&&a},_mouseStart:function(d){var a=this.options,e=this.element.position(), -g=this.element;this.resizing=true;this.documentScroll={top:b(document).scrollTop(),left:b(document).scrollLeft()};if(g.is(".ui-draggable")||/absolute/.test(g.css("position")))g.css({position:"absolute",top:e.top,left:e.left});b.browser.opera&&/relative/.test(g.css("position"))&&g.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();e=c(this.helper.css("left"));var i=c(this.helper.css("top"));if(a.containment){e+=b(a.containment).scrollLeft()||0;i+=b(a.containment).scrollTop()||0}this.offset= -this.helper.offset();this.position={left:e,top:i};this.size=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()};this.originalSize=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()};this.originalPosition={left:e,top:i};this.sizeDiff={width:g.outerWidth()-g.width(),height:g.outerHeight()-g.height()};this.originalMousePosition={left:d.pageX,top:d.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: -this.originalSize.width/this.originalSize.height||1;a=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",a=="auto"?this.axis+"-resize":a);g.addClass("ui-resizable-resizing");this._propagate("start",d);return true},_mouseDrag:function(d){var a=this.helper,e=this.originalMousePosition,g=this._change[this.axis];if(!g)return false;e=g.apply(this,[d,d.pageX-e.left||0,d.pageY-e.top||0]);if(this._aspectRatio||d.shiftKey)e=this._updateRatio(e,d);e=this._respectSize(e,d);this._propagate("resize", -d);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(e);this._trigger("resize",d,this.ui());return false},_mouseStop:function(d){this.resizing=false;var a=this.options;if(this._helper){var e=this._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName);e=g&&b.ui.hasScroll(e[0],"left")?0:this.sizeDiff.height; -g={width:this.size.width-(g?0:this.sizeDiff.width),height:this.size.height-e};e=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null;var i=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;a.animate||this.element.css(b.extend(g,{top:i,left:e}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!a.animate&&this._proportionallyResize()}b("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing"); -this._propagate("stop",d);this._helper&&this.helper.remove();return false},_updateCache:function(d){this.offset=this.helper.offset();if(f(d.left))this.position.left=d.left;if(f(d.top))this.position.top=d.top;if(f(d.height))this.size.height=d.height;if(f(d.width))this.size.width=d.width},_updateRatio:function(d){var a=this.position,e=this.size,g=this.axis;if(d.height)d.width=e.height*this.aspectRatio;else if(d.width)d.height=e.width/this.aspectRatio;if(g=="sw"){d.left=a.left+(e.width-d.width);d.top= -null}if(g=="nw"){d.top=a.top+(e.height-d.height);d.left=a.left+(e.width-d.width)}return d},_respectSize:function(d){var a=this.options,e=this.axis,g=f(d.width)&&a.maxWidth&&a.maxWidthd.width,j=f(d.height)&&a.minHeight&&a.minHeight>d.height;if(k)d.width=a.minWidth;if(j)d.height=a.minHeight;if(g)d.width=a.maxWidth;if(i)d.height=a.maxHeight;var h=this.originalPosition.left+this.originalSize.width,l=this.position.top+ -this.size.height,m=/sw|nw|w/.test(e);e=/nw|ne|n/.test(e);if(k&&m)d.left=h-a.minWidth;if(g&&m)d.left=h-a.maxWidth;if(j&&e)d.top=l-a.minHeight;if(i&&e)d.top=l-a.maxHeight;if((a=!d.width&&!d.height)&&!d.left&&d.top)d.top=null;else if(a&&!d.top&&d.left)d.left=null;return d},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var d=this.helper||this.element,a=0;a');var a=b.browser.msie&&b.browser.version<7,e=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++d.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(d, -a){return{width:this.originalSize.width+a}},w:function(d,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(d,a,e){return{top:this.originalPosition.top+e,height:this.originalSize.height-e}},s:function(d,a,e){return{height:this.originalSize.height+e}},se:function(d,a,e){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[d,a,e]))},sw:function(d,a,e){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[d,a, -e]))},ne:function(d,a,e){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[d,a,e]))},nw:function(d,a,e){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[d,a,e]))}},_propagate:function(d,a){b.ui.plugin.call(this,d,[a,this.ui()]);d!="resize"&&this._trigger(d,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize, -originalPosition:this.originalPosition}}});b.extend(b.ui.resizable,{version:"1.8"});b.ui.plugin.add("resizable","alsoResize",{start:function(){var d=b(this).data("resizable").options,a=function(e){b(e).each(function(){b(this).data("resizable-alsoresize",{width:parseInt(b(this).width(),10),height:parseInt(b(this).height(),10),left:parseInt(b(this).css("left"),10),top:parseInt(b(this).css("top"),10)})})};if(typeof d.alsoResize=="object"&&!d.alsoResize.parentNode)if(d.alsoResize.length){d.alsoResize= -d.alsoResize[0];a(d.alsoResize)}else b.each(d.alsoResize,function(e){a(e)});else a(d.alsoResize)},resize:function(){var d=b(this).data("resizable"),a=d.options,e=d.originalSize,g=d.originalPosition,i={height:d.size.height-e.height||0,width:d.size.width-e.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},k=function(j,h){b(j).each(function(){var l=b(this),m=b(this).data("resizable-alsoresize"),n={};b.each((h&&h.length?h:["width","height","top","left"])||["width","height","top","left"], -function(o,p){var q=(m[p]||0)+(i[p]||0);if(q&&q>=0)n[p]=q||null});if(/relative/.test(l.css("position"))&&b.browser.opera){d._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(n)})};typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?b.each(a.alsoResize,function(j,h){k(j,h)}):k(a.alsoResize)},stop:function(){var d=b(this).data("resizable");if(d._revertToRelativePosition&&b.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}b(this).removeData("resizable-alsoresize-start")}}); -b.ui.plugin.add("resizable","animate",{stop:function(d){var a=b(this).data("resizable"),e=a.options,g=a._proportionallyResizeElements,i=g.length&&/textarea/i.test(g[0].nodeName),k=i&&b.ui.hasScroll(g[0],"left")?0:a.sizeDiff.height;i={width:a.size.width-(i?0:a.sizeDiff.width),height:a.size.height-k};k=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var j=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(b.extend(i,j&& -k?{top:j,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var h={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};g&&g.length&&b(g[0]).css({width:h.width,height:h.height});a._updateCache(h);a._propagate("resize",d)}})}});b.ui.plugin.add("resizable","containment",{start:function(){var d=b(this).data("resizable"),a=d.element,e=d.options.containment;if(a=e instanceof -b?e.get(0):/parent/.test(e)?a.parent().get(0):e){d.containerElement=b(a);if(/document/.test(e)||e==document){d.containerOffset={left:0,top:0};d.containerPosition={left:0,top:0};d.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{var g=b(a),i=[];b(["Top","Right","Left","Bottom"]).each(function(h,l){i[h]=c(g.css("padding"+l))});d.containerOffset=g.offset();d.containerPosition=g.position();d.containerSize={height:g.innerHeight()- -i[3],width:g.innerWidth()-i[1]};e=d.containerOffset;var k=d.containerSize.height,j=d.containerSize.width;j=b.ui.hasScroll(a,"left")?a.scrollWidth:j;k=b.ui.hasScroll(a)?a.scrollHeight:k;d.parentData={element:a,left:e.left,top:e.top,width:j,height:k}}}},resize:function(d){var a=b(this).data("resizable"),e=a.options,g=a.containerOffset,i=a.position;d=a._aspectRatio||d.shiftKey;var k={top:0,left:0},j=a.containerElement;if(j[0]!=document&&/static/.test(j.css("position")))k=g;if(i.left<(a._helper?g.left: -0)){a.size.width+=a._helper?a.position.left-g.left:a.position.left-k.left;if(d)a.size.height=a.size.width/e.aspectRatio;a.position.left=e.helper?g.left:0}if(i.top<(a._helper?g.top:0)){a.size.height+=a._helper?a.position.top-g.top:a.position.top;if(d)a.size.width=a.size.height*e.aspectRatio;a.position.top=a._helper?g.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;e=Math.abs((a._helper?a.offset.left-k.left:a.offset.left-k.left)+a.sizeDiff.width);g= -Math.abs((a._helper?a.offset.top-k.top:a.offset.top-g.top)+a.sizeDiff.height);i=a.containerElement.get(0)==a.element.parent().get(0);k=/relative|absolute/.test(a.containerElement.css("position"));if(i&&k)e-=a.parentData.left;if(e+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-e;if(d)a.size.height=a.size.width/a.aspectRatio}if(g+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-g;if(d)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var d=b(this).data("resizable"), -a=d.options,e=d.containerOffset,g=d.containerPosition,i=d.containerElement,k=b(d.helper),j=k.offset(),h=k.outerWidth()-d.sizeDiff.width;k=k.outerHeight()-d.sizeDiff.height;d._helper&&!a.animate&&/relative/.test(i.css("position"))&&b(this).css({left:j.left-g.left-e.left,width:h,height:k});d._helper&&!a.animate&&/static/.test(i.css("position"))&&b(this).css({left:j.left-g.left-e.left,width:h,height:k})}});b.ui.plugin.add("resizable","ghost",{start:function(){var d=b(this).data("resizable"),a=d.options, -e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");d.ghost.appendTo(d.helper)},resize:function(){var d=b(this).data("resizable");d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(){var d=b(this).data("resizable");d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}); -b.ui.plugin.add("resizable","grid",{resize:function(){var d=b(this).data("resizable"),a=d.options,e=d.size,g=d.originalSize,i=d.originalPosition,k=d.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var j=Math.round((e.width-g.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((e.height-g.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(k)){d.size.width=g.width+j;d.size.height=g.height+a}else if(/^(ne)$/.test(k)){d.size.width=g.width+j;d.size.height=g.height+a;d.position.top=i.top- -a}else{if(/^(sw)$/.test(k)){d.size.width=g.width+j;d.size.height=g.height+a}else{d.size.width=g.width+j;d.size.height=g.height+a;d.position.top=i.top-a}d.position.left=i.left-j}}});var c=function(d){return parseInt(d,10)||0},f=function(d){return!isNaN(parseInt(d,10))}})(jQuery); -(function(b){b.widget("ui.selectable",b.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=b(c.options.filter,c.element[0]);f.each(function(){var d=b(this),a=d.offset();b.data(this,"selectable-item",{element:this,$element:d,left:a.left,top:a.top,right:a.left+d.outerWidth(),bottom:a.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), -selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=b(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this}, -_mouseStart:function(c){var f=this;this.opos=[c.pageX,c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=b(d.filter,this.element[0]);this._trigger("start",c);b(d.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var a=b.data(this,"selectable-item");a.startselected=true;if(!c.metaKey){a.$element.removeClass("ui-selected"); -a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}});b(c.target).parents().andSelf().each(function(){var a=b.data(this,"selectable-item");if(a){a.$element.removeClass("ui-unselecting").addClass("ui-selecting");a.unselecting=false;a.selecting=true;a.selected=true;f._trigger("selecting",c,{selecting:a.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=this.options, -a=this.opos[0],e=this.opos[1],g=c.pageX,i=c.pageY;if(a>g){var k=g;g=a;a=k}if(e>i){k=i;i=e;e=k}this.helper.css({left:a,top:e,width:g-a,height:i-e});this.selectees.each(function(){var j=b.data(this,"selectable-item");if(!(!j||j.element==f.element[0])){var h=false;if(d.tolerance=="touch")h=!(j.left>g||j.righti||j.bottoma&&j.righte&&j.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var c=this.items.length-1;c>=0;c--)this.items[c].item.removeData("sortable-item");return this},_mouseCapture:function(c,f){if(this.reverting)return false;if(this.options.disabled||this.options.type== -"static")return false;this._refreshItems(c);var d=null,a=this;b(c.target).parents().each(function(){if(b.data(this,"sortable-item")==a){d=b(this);return false}});if(b.data(c.target,"sortable-item")==a)d=b(c.target);if(!d)return false;if(this.options.handle&&!f){var e=false;b(this.options.handle,d).find("*").andSelf().each(function(){if(this==c.target)e=true});if(!e)return false}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(c,f,d){f=this.options;this.currentContainer= -this;this.refreshPositions();this.helper=this._createHelper(c);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");b.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); -this.originalPosition=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;f.cursorAt&&this._adjustOffsetFromHelper(f.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();f.containment&&this._setContainment();if(f.cursor){if(b("body").css("cursor"))this._storedCursor=b("body").css("cursor");b("body").css("cursor",f.cursor)}if(f.opacity){if(this.helper.css("opacity"))this._storedOpacity= -this.helper.css("opacity");this.helper.css("opacity",f.opacity)}if(f.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",f.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",c,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(d=this.containers.length-1;d>=0;d--)this.containers[d]._trigger("activate",c,this._uiHash(this)); -if(b.ui.ddmanager)b.ui.ddmanager.current=this;b.ui.ddmanager&&!f.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(c);return true},_mouseDrag:function(c){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var f=this.options,d=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!= -"HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-c.pageY=0;f--){d=this.items[f];var a= -d.item[0],e=this._intersectsWithPointer(d);if(e)if(a!=this.currentItem[0]&&this.placeholder[e==1?"next":"prev"]()[0]!=a&&!b.ui.contains(this.placeholder[0],a)&&(this.options.type=="semi-dynamic"?!b.ui.contains(this.element[0],a):true)){this.direction=e==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(d))this._rearrange(c,d);else break;this._trigger("change",c,this._uiHash());break}}this._contactContainers(c);b.ui.ddmanager&&b.ui.ddmanager.drag(this,c);this._trigger("sort", -c,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,f){if(c){b.ui.ddmanager&&!this.options.dropBehaviour&&b.ui.ddmanager.drop(this,c);if(this.options.revert){var d=this,a=d.placeholder.offset();d.reverting=true;b(this.helper).animate({left:a.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:a.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)}, -parseInt(this.options.revert,10)||500,function(){d._clear(c)})}else this._clear(c,f);return false}},cancel:function(){if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,this._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,this._uiHash(this));this.containers[c].containerCache.over= -0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();b.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?b(this.domPosition.prev).after(this.currentItem):b(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(c){var f=this._getItemsAsjQuery(c&&c.connected),d=[];c=c||{};b(f).each(function(){var a= -(b(c.item||this).attr(c.attribute||"id")||"").match(c.expression||/(.+)[-=_](.+)/);if(a)d.push((c.key||a[1]+"[]")+"="+(c.key&&c.expression?a[1]:a[2]))});return d.join("&")},toArray:function(c){var f=this._getItemsAsjQuery(c&&c.connected),d=[];c=c||{};f.each(function(){d.push(b(c.item||this).attr(c.attribute||"id")||"")});return d},_intersectsWith:function(c){var f=this.positionAbs.left,d=f+this.helperProportions.width,a=this.positionAbs.top,e=a+this.helperProportions.height,g=c.left,i=g+c.width,k= -c.top,j=k+c.height,h=this.offset.click.top,l=this.offset.click.left;h=a+h>k&&a+hg&&f+lc[this.floating?"width":"height"]?h:g0?"down":"up")},_getDragHorizontalDirection:function(){var c=this.positionAbs.left-this.lastPositionAbs.left;return c!=0&&(c>0?"right":"left")},refresh:function(c){this._refreshItems(c);this.refreshPositions();return this},_connectWith:function(){var c= -this.options;return c.connectWith.constructor==String?[c.connectWith]:c.connectWith},_getItemsAsjQuery:function(c){var f=[],d=[],a=this._connectWith();if(a&&c)for(c=a.length-1;c>=0;c--)for(var e=b(a[c]),g=e.length-1;g>=0;g--){var i=b.data(e[g],"sortable");if(i&&i!=this&&!i.options.disabled)d.push([b.isFunction(i.options.items)?i.options.items.call(i.element):b(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i])}d.push([b.isFunction(this.options.items)?this.options.items.call(this.element, -null,{options:this.options,item:this.currentItem}):b(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(c=d.length-1;c>=0;c--)d[c][0].each(function(){f.push(this)});return b(f)},_removeCurrentsFromItems:function(){for(var c=this.currentItem.find(":data(sortable-item)"),f=0;f=0;e--)for(var g=b(a[e]),i=g.length-1;i>=0;i--){var k=b.data(g[i],"sortable");if(k&&k!=this&&!k.options.disabled){d.push([b.isFunction(k.options.items)?k.options.items.call(k.element[0],c,{item:this.currentItem}):b(k.options.items,k.element),k]);this.containers.push(k)}}for(e=d.length-1;e>=0;e--){c=d[e][1]; -a=d[e][0];i=0;for(g=a.length;i=0;f--){var d=this.items[f],a=this.options.toleranceElement?b(this.options.toleranceElement,d.item):d.item;if(!c){d.width=a.outerWidth();d.height=a.outerHeight()}a=a.offset();d.left=a.left;d.top=a.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this); -else for(f=this.containers.length-1;f>=0;f--){a=this.containers[f].element.offset();this.containers[f].containerCache.left=a.left;this.containers[f].containerCache.top=a.top;this.containers[f].containerCache.width=this.containers[f].element.outerWidth();this.containers[f].containerCache.height=this.containers[f].element.outerHeight()}return this},_createPlaceholder:function(c){var f=c||this,d=f.options;if(!d.placeholder||d.placeholder.constructor==String){var a=d.placeholder;d.placeholder={element:function(){var e= -b(document.createElement(f.currentItem[0].nodeName)).addClass(a||f.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!a)e.style.visibility="hidden";return e},update:function(e,g){if(!(a&&!d.forcePlaceholderSize)){g.height()||g.height(f.currentItem.innerHeight()-parseInt(f.currentItem.css("paddingTop")||0,10)-parseInt(f.currentItem.css("paddingBottom")||0,10));g.width()||g.width(f.currentItem.innerWidth()-parseInt(f.currentItem.css("paddingLeft")||0,10)-parseInt(f.currentItem.css("paddingRight")|| -0,10))}}}}f.placeholder=b(d.placeholder.element.call(f.element,f.currentItem));f.currentItem.after(f.placeholder);d.placeholder.update(f,f.placeholder)},_contactContainers:function(c){for(var f=null,d=null,a=this.containers.length-1;a>=0;a--)if(!b.ui.contains(this.currentItem[0],this.containers[a].element[0]))if(this._intersectsWith(this.containers[a].containerCache)){if(!(f&&b.ui.contains(this.containers[a].element[0],f.element[0]))){f=this.containers[a];d=a}}else if(this.containers[a].containerCache.over){this.containers[a]._trigger("out", -c,this._uiHash(this));this.containers[a].containerCache.over=0}if(f)if(this.containers.length===1){this.containers[d]._trigger("over",c,this._uiHash(this));this.containers[d].containerCache.over=1}else if(this.currentContainer!=this.containers[d]){f=1E4;a=null;for(var e=this.positionAbs[this.containers[d].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(b.ui.contains(this.containers[d].element[0],this.items[g].item[0])){var i=this.items[g][this.containers[d].floating?"left":"top"];if(Math.abs(i- -e)this.containment[2])e=this.containment[2]+this.offset.click.left;if(c.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(f.grid){g=this.originalPageY+Math.round((g- -this.originalPageY)/f.grid[1])*f.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left=0;a--)if(b.ui.contains(this.containers[a].element[0],this.currentItem[0])&&!f){d.push(function(e){return function(g){e._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[a]));d.push(function(e){return function(g){e._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[a]))}}for(a=this.containers.length-1;a>=0;a--){f||d.push(function(e){return function(g){e._trigger("deactivate",g,this._uiHash(this))}}.call(this, -this.containers[a]));if(this.containers[a].containerCache.over){d.push(function(e){return function(g){e._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[a]));this.containers[a].containerCache.over=0}}this._storedCursor&&b("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!f){this._trigger("beforeStop", -c,this._uiHash());for(a=0;a li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},_create:function(){var c=this.options,f=this;this.running=0;this.element.addClass("ui-accordion ui-widget ui-helper-reset"); -this.element[0].nodeName=="UL"&&this.element.children("li").addClass("ui-accordion-li-fix");this.headers=this.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b(this).removeClass("ui-state-focus")}); -this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=this.element.find("a").filter(c.navigationFilter);if(d.length){var a=d.closest(".ui-accordion-header");this.active=a.length?a:d.closest(".ui-accordion-content").prev()}}this.active=this._findActive(this.active||c.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active"); -this._createIcons();b.browser.msie&&this.element.find("a").css("zoom","1");this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return f._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();this.active.length?this.active.attr("aria-expanded","true").attr("tabIndex","0"):this.headers.eq(0).attr("tabIndex","0");b.browser.safari||this.headers.find("a").attr("tabIndex", -"-1");c.event&&this.headers.bind(c.event+".accordion",function(e){f._clickHandler.call(f,e,this);e.preventDefault()})},_createIcons:function(){var c=this.options;if(c.icons){b("").addClass("ui-icon "+c.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(c.icons.header).toggleClass(c.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")}, -destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this._destroyIcons();var f=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active"); -if(c.autoHeight||c.fillHeight)f.css("height","");return this},_setOption:function(c,f){b.Widget.prototype._setOption.apply(this,arguments);c=="active"&&this.activate(f);if(c=="icons"){this._destroyIcons();f&&this._createIcons()}},_keydown:function(c){var f=b.ui.keyCode;if(!(this.options.disabled||c.altKey||c.ctrlKey)){var d=this.headers.length,a=this.headers.index(c.target),e=false;switch(c.keyCode){case f.RIGHT:case f.DOWN:e=this.headers[(a+1)%d];break;case f.LEFT:case f.UP:e=this.headers[(a-1+d)% -d];break;case f.SPACE:case f.ENTER:this._clickHandler({target:c.target},c.target);c.preventDefault()}if(e){b(c.target).attr("tabIndex","-1");b(e).attr("tabIndex","0");e.focus();return false}return true}},resize:function(){var c=this.options,f;if(c.fillSpace){if(b.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}f=this.element.parent().height();b.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){f-=b(this).outerHeight(true)}); -this.headers.next().each(function(){b(this).height(Math.max(0,f-b(this).innerHeight()+b(this).height()))}).css("overflow","auto")}else if(c.autoHeight){f=0;this.headers.next().each(function(){f=Math.max(f,b(this).height())}).height(f)}return this},activate:function(c){this.options.active=c;c=this._findActive(c)[0];this._clickHandler({target:c},c);return this},_findActive:function(c){return c?typeof c=="number"?this.headers.filter(":eq("+c+")"):this.headers.not(this.headers.not(c)):c===false?b([]): -this.headers.filter(":eq(0)")},_clickHandler:function(c,f){var d=this.options;if(!d.disabled)if(c.target){var a=b(c.currentTarget||f),e=a[0]==this.active[0];d.active=d.collapsible&&e?false:b(".ui-accordion-header",this.element).index(a);if(!(this.running||!d.collapsible&&e)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!e){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); -a.next().addClass("ui-accordion-content-active")}k=a.next();g=this.active.next();i={options:d,newHeader:e&&d.collapsible?b([]):a,oldHeader:this.active,newContent:e&&d.collapsible?b([]):k,oldContent:g};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=e?b([]):a;this._toggle(k,g,i,e,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); -this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),i={options:d,newHeader:b([]),oldHeader:d.active,newContent:b([]),oldContent:g},k=this.active=b([]);this._toggle(k,g,i)}},_toggle:function(c,f,d,a,e){var g=this.options,i=this;this.toShow=c;this.toHide=f;this.data=d;var k=function(){if(i)return i._completed.apply(i,arguments)};this._trigger("changestart",null,this.data);this.running=f.size()===0?c.size():f.size();if(g.animated){d={};d=g.collapsible&&a?{toShow:b([]), -toHide:f,complete:k,down:e,autoHeight:g.autoHeight||g.fillSpace}:{toShow:c,toHide:f,complete:k,down:e,autoHeight:g.autoHeight||g.fillSpace};if(!g.proxied)g.proxied=g.animated;if(!g.proxiedDuration)g.proxiedDuration=g.duration;g.animated=b.isFunction(g.proxied)?g.proxied(d):g.proxied;g.duration=b.isFunction(g.proxiedDuration)?g.proxiedDuration(d):g.proxiedDuration;a=b.ui.accordion.animations;var j=g.duration,h=g.animated;if(h&&!a[h]&&!b.easing[h])h="slide";a[h]||(a[h]=function(l){this.slide(l,{easing:h, -duration:j||700})});a[h](d)}else{if(g.collapsible&&a)c.toggle();else{f.hide();c.show()}k(true)}f.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();c.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(c){var f=this.options;this.running=c?0:--this.running;if(!this.running){f.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});b.extend(b.ui.accordion, -{version:"1.8",animations:{slide:function(c,f){c=b.extend({easing:"swing",duration:300},c,f);if(c.toHide.size())if(c.toShow.size()){var d=c.toShow.css("overflow"),a=0,e={},g={},i,k=c.toShow;i=k[0].style.width;k.width(parseInt(k.parent().width(),10)-parseInt(k.css("paddingLeft"),10)-parseInt(k.css("paddingRight"),10)-(parseInt(k.css("borderLeftWidth"),10)||0)-(parseInt(k.css("borderRightWidth"),10)||0));b.each(["height","paddingTop","paddingBottom"],function(j,h){g[h]="hide";var l=(""+b.css(c.toShow[0], -h)).match(/^([\d+-.]+)(.*)$/);e[h]={value:l[1],unit:l[2]||"px"}});c.toShow.css({height:0,overflow:"hidden"}).show();c.toHide.filter(":hidden").each(c.complete).end().filter(":visible").animate(g,{step:function(j,h){if(h.prop=="height")a=h.end-h.start===0?0:(h.now-h.start)/(h.end-h.start);c.toShow[0].style[h.prop]=a*e[h.prop].value+e[h.prop].unit},duration:c.duration,easing:c.easing,complete:function(){c.autoHeight||c.toShow.css("height","");c.toShow.css("width",i);c.toShow.css({overflow:d});c.complete()}})}else c.toHide.animate({height:"hide"}, -c);else c.toShow.animate({height:"show"},c)},bounceslide:function(c){this.slide(c,{easing:c.down?"easeOutBounce":"swing",duration:c.down?1E3:200})}}})})(jQuery); -(function(b){b.widget("ui.autocomplete",{options:{minLength:1,delay:300},_create:function(){var c=this,f=this.element[0].ownerDocument;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(d){var a=b.ui.keyCode;switch(d.keyCode){case a.PAGE_UP:c._move("previousPage",d);break;case a.PAGE_DOWN:c._move("nextPage",d);break;case a.UP:c._move("previous",d);d.preventDefault(); -break;case a.DOWN:c._move("next",d);d.preventDefault();break;case a.ENTER:c.menu.active&&d.preventDefault();case a.TAB:if(!c.menu.active)break;c.menu.select();break;case a.ESCAPE:c.element.val(c.term);c.close(d);break;case a.SHIFT:case a.CONTROL:case 18:break;default:clearTimeout(c.searching);c.searching=setTimeout(function(){c.search(null,d)},c.options.delay)}}).bind("focus.autocomplete",function(){c.previous=c.element.val()}).bind("blur.autocomplete",function(d){clearTimeout(c.searching);c.closing= -setTimeout(function(){c.close(d)},150)});this._initSource();this.response=function(){return c._response.apply(c,arguments)};this.menu=b("
                      ").addClass("ui-autocomplete").appendTo("body",f).menu({focus:function(d,a){var e=a.item.data("item.autocomplete");false!==c._trigger("focus",null,{item:e})&&c.element.val(e.value)},selected:function(d,a){var e=a.item.data("item.autocomplete");false!==c._trigger("select",d,{item:e})&&c.element.val(e.value);c.close(d);c.previous=c.element.val();c.element[0]!== -f.activeElement&&c.element.focus()},blur:function(){c.menu.element.is(":visible")&&c.element.val(c.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");b.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input ui-widget ui-widget-content").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();b.Widget.prototype.destroy.call(this)},_setOption:function(c){b.Widget.prototype._setOption.apply(this, -arguments);c==="source"&&this._initSource()},_initSource:function(){var c,f;if(b.isArray(this.options.source)){c=this.options.source;this.source=function(d,a){var e=RegExp(b.ui.autocomplete.escapeRegex(d.term),"i");a(b.grep(c,function(g){return e.test(g.label||g.value||g)}))}}else if(typeof this.options.source==="string"){f=this.options.source;this.source=function(d,a){b.getJSON(f,d,a)}}else this.source=this.options.source},search:function(c,f){c=c!=null?c:this.element.val();if(c.length").data("item.autocomplete",f).append(""+f.label+"").appendTo(c)},_move:function(c,f){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(c)||this.menu.last()&&/^next/.test(c)){this.element.val(this.term);this.menu.deactivate()}else this.menu[c](); -else this.search(null,f)},widget:function(){return this.menu.element}});b.extend(b.ui.autocomplete,{escapeRegex:function(c){return c.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")}})})(jQuery); -(function(b){b.widget("ui.menu",{_create:function(){var c=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(f){f.preventDefault();c.select()});this.refresh()},refresh:function(){var c=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(){c.activate(b(this).parent())}).mouseleave(function(){c.deactivate()})}, -activate:function(c){this.deactivate();if(this.hasScroll()){var f=c.offset().top-this.element.offset().top,d=this.element.attr("scrollTop"),a=this.element.height();if(f<0)this.element.attr("scrollTop",d+f);else f>a&&this.element.attr("scrollTop",d+f-a+c.height())}this.active=c.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",null,{item:c})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); -this._trigger("blur");this.active=null}},next:function(){this.move("next","li:first")},previous:function(){this.move("prev","li:last")},first:function(){return this.active&&!this.active.prev().length},last:function(){return this.active&&!this.active.next().length},move:function(c,f){if(this.active){var d=this.active[c]();d.length?this.activate(d):this.activate(this.element.children(f))}else this.activate(this.element.children(f))},nextPage:function(){if(this.hasScroll())if(!this.active||this.last())this.activate(this.element.children(":first")); -else{var c=this.active.offset().top,f=this.element.height(),d=this.element.children("li").filter(function(){var a=b(this).offset().top-c-f+b(this).height();return a<10&&a>-10});d.length||(d=this.element.children(":last"));this.activate(d)}else this.activate(this.element.children(!this.active||this.last()?":first":":last"))},previousPage:function(){if(this.hasScroll())if(!this.active||this.first())this.activate(this.element.children(":last"));else{var c=this.active.offset().top,f=this.element.height(); -result=this.element.children("li").filter(function(){var d=b(this).offset().top-c+f-b(this).height();return d<10&&d>-10});result.length||(result=this.element.children(":first"));this.activate(result)}else this.activate(this.element.children(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()
                      ").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(), -g=this.options.icons,i=g.primary&&g.secondary;if(g.primary||g.secondary){a.addClass("ui-button-text-icon"+(i?"s":""));g.primary&&a.prepend("");g.secondary&&a.append("");if(!this.options.text){a.addClass(i?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon");this.hasTitle||a.attr("title",e)}}else a.addClass("ui-button-text-only")}}}); -b.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(a,e){a==="disabled"&&this.buttons.button("option",a,e);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, -destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");b.Widget.prototype.destroy.call(this)}})})(jQuery); -(function(b){b.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");var c=this,f=c.options,d=f.title||c.originalTitle||" ",a=b.ui.dialog.getTitleId(c.element),e=(c.uiDialog=b("
                      ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ -f.dialogClass).css({zIndex:f.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(k){if(f.closeOnEscape&&k.keyCode&&k.keyCode===b.ui.keyCode.ESCAPE){c.close(k);k.preventDefault()}}).attr({role:"dialog","aria-labelledby":a}).mousedown(function(k){c.moveToTop(false,k)});c.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(e);var g=(c.uiDialogTitlebar=b("
                      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(e), -i=b('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).click(function(k){c.close(k);return false}).appendTo(g);(c.uiDialogTitlebarCloseText=b("")).addClass("ui-icon ui-icon-closethick").text(f.closeText).appendTo(i);b("").addClass("ui-dialog-title").attr("id", -a).html(d).prependTo(g);if(b.isFunction(f.beforeclose)&&!b.isFunction(f.beforeClose))f.beforeClose=f.beforeclose;g.find("*").add(g).disableSelection();f.draggable&&b.fn.draggable&&c._makeDraggable();f.resizable&&b.fn.resizable&&c._makeResizable();c._createButtons(f.buttons);c._isOpen=false;b.fn.bgiframe&&e.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){this.overlay&&this.overlay.destroy();this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); -this.uiDialog.remove();this.originalTitle&&this.element.attr("title",this.originalTitle);return this},widget:function(){return this.uiDialog},close:function(c){var f=this,d;if(false!==f._trigger("beforeClose",c)){f.overlay&&f.overlay.destroy();f.uiDialog.unbind("keypress.ui-dialog");f._isOpen=false;if(f.options.hide)f.uiDialog.hide(f.options.hide,function(){f._trigger("close",c)});else{f.uiDialog.hide();f._trigger("close",c)}b.ui.dialog.overlay.resize();if(f.options.modal){d=0;b(".ui-dialog").each(function(){if(this!== -f.uiDialog[0])d=Math.max(d,b(this).css("z-index"))});b.ui.dialog.maxZ=d}return f}},isOpen:function(){return this._isOpen},moveToTop:function(c,f){var d=this.options;if(d.modal&&!c||!d.stack&&!d.modal)return this._trigger("focus",f);if(d.zIndex>b.ui.dialog.maxZ)b.ui.dialog.maxZ=d.zIndex;if(this.overlay){b.ui.dialog.maxZ+=1;this.overlay.$el.css("z-index",b.ui.dialog.overlay.maxZ=b.ui.dialog.maxZ)}d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};b.ui.dialog.maxZ+= -1;this.uiDialog.css("z-index",b.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",f);return this},open:function(){if(!this._isOpen){var c=this.options,f=this.uiDialog;this.overlay=c.modal?new b.ui.dialog.overlay(this):null;f.next().length&&f.appendTo("body");this._size();this._position(c.position);f.show(c.show);this.moveToTop(true);c.modal&&f.bind("keypress.ui-dialog",function(d){if(d.keyCode===b.ui.keyCode.TAB){var a=b(":tabbable",this),e=a.filter(":first");a=a.filter(":last");if(d.target=== -a[0]&&!d.shiftKey){e.focus(1);return false}else if(d.target===e[0]&&d.shiftKey){a.focus(1);return false}}});b([]).add(f.find(".ui-dialog-content :tabbable:first")).add(f.find(".ui-dialog-buttonpane :tabbable:first")).add(f).filter(":first").focus();this._trigger("open");this._isOpen=true;return this}},_createButtons:function(c){var f=this,d=false,a=b("
                      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");f.uiDialog.find(".ui-dialog-buttonpane").remove();typeof c==="object"&& -c!==null&&b.each(c,function(){return!(d=true)});if(d){b.each(c,function(e,g){var i=b('').text(e).click(function(){g.apply(f.element[0],arguments)}).appendTo(a);b.fn.button&&i.button()});a.appendTo(f.uiDialog)}},_makeDraggable:function(){function c(g){return{position:g.position,offset:g.offset}}var f=this,d=f.options,a=b(document),e;f.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(g, -i){e=d.height==="auto"?"auto":b(this).height();b(this).height(b(this).height()).addClass("ui-dialog-dragging");f._trigger("dragStart",g,c(i))},drag:function(g,i){f._trigger("drag",g,c(i))},stop:function(g,i){d.position=[i.position.left-a.scrollLeft(),i.position.top-a.scrollTop()];b(this).removeClass("ui-dialog-dragging").height(e);f._trigger("dragStop",g,c(i));b.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function f(g){return{originalPosition:g.originalPosition,originalSize:g.originalSize, -position:g.position,size:g.size}}c=c===undefined?this.options.resizable:c;var d=this,a=d.options,e=d.uiDialog.css("position");c=typeof c==="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:d._minHeight(),handles:c,start:function(g,i){b(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",g,f(i))},resize:function(g,i){d._trigger("resize",g,f(i))}, -stop:function(g,i){b(this).removeClass("ui-dialog-resizing");a.height=b(this).height();a.width=b(this).width();d._trigger("resizeStop",g,f(i));b.ui.dialog.overlay.resize()}}).css("position",e).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var c=this.options;return c.height==="auto"?c.minHeight:Math.min(c.minHeight,c.height)},_position:function(c){var f=[],d=[0,0];c=c||b.ui.dialog.prototype.options.position;if(typeof c==="string"||typeof c==="object"&& -"0"in c){f=c.split?c.split(" "):[c[0],c[1]];if(f.length===1)f[1]=f[0];b.each(["left","top"],function(a,e){if(+f[a]===f[a]){d[a]=f[a];f[a]=e}})}else if(typeof c==="object"){if("left"in c){f[0]="left";d[0]=c.left}else if("right"in c){f[0]="right";d[0]=-c.right}if("top"in c){f[1]="top";d[1]=c.top}else if("bottom"in c){f[1]="bottom";d[1]=-c.bottom}}(c=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position({my:f.join(" "),at:f.join(" "),offset:d.join(" "),of:window, -collision:"fit",using:function(a){var e=b(this).css(a).offset().top;e<0&&b(this).css("top",a.top-e)}});c||this.uiDialog.hide()},_setOption:function(c,f){var d=this.uiDialog,a=d.is(":data(resizable)"),e=false;switch(c){case "beforeclose":c="beforeClose";break;case "buttons":this._createButtons(f);break;case "closeText":this.uiDialogTitlebarCloseText.text(""+f);break;case "dialogClass":d.removeClass(this.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+f);break;case "disabled":f? -d.addClass("ui-dialog-disabled"):d.removeClass("ui-dialog-disabled");break;case "draggable":f?this._makeDraggable():d.draggable("destroy");break;case "height":e=true;break;case "maxHeight":a&&d.resizable("option","maxHeight",f);e=true;break;case "maxWidth":a&&d.resizable("option","maxWidth",f);e=true;break;case "minHeight":a&&d.resizable("option","minHeight",f);e=true;break;case "minWidth":a&&d.resizable("option","minWidth",f);e=true;break;case "position":this._position(f);break;case "resizable":a&& -!f&&d.resizable("destroy");a&&typeof f==="string"&&d.resizable("option","handles",f);!a&&f!==false&&this._makeResizable(f);break;case "title":b(".ui-dialog-title",this.uiDialogTitlebar).html(""+(f||" "));break;case "width":e=true}b.Widget.prototype._setOption.apply(this,arguments);e&&this._size()},_size:function(){var c=this.options,f;this.element.css("width","auto").hide();f=this.uiDialog.css({height:"auto",width:c.width}).height();this.element.css(c.height==="auto"?{minHeight:Math.max(c.minHeight- -f,0),height:"auto"}:{minHeight:0,height:Math.max(c.height-f,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});b.extend(b.ui.dialog,{version:"1.8",uuid:0,maxZ:0,getTitleId:function(c){c=c.attr("id");if(!c){this.uuid+=1;c=this.uuid}return"ui-dialog-title-"+c},overlay:function(c){this.$el=b.ui.dialog.overlay.create(c)}});b.extend(b.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), -function(c){return c+".dialog-overlay"}).join(" "),create:function(c){if(this.instances.length===0){setTimeout(function(){b.ui.dialog.overlay.instances.length&&b(document).bind(b.ui.dialog.overlay.events,function(d){return b(d.target).zIndex()>=b.ui.dialog.overlay.maxZ})},1);b(document).bind("keydown.dialog-overlay",function(d){if(c.options.closeOnEscape&&d.keyCode&&d.keyCode===b.ui.keyCode.ESCAPE){c.close(d);d.preventDefault()}});b(window).bind("resize.dialog-overlay",b.ui.dialog.overlay.resize)}var f= -(this.oldInstances.pop()||b("
                      ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});b.fn.bgiframe&&f.bgiframe();this.instances.push(f);return f},destroy:function(c){this.oldInstances.push(this.instances.splice(b.inArray(c,this.instances),1)[0]);this.instances.length===0&&b([document,window]).unbind(".dialog-overlay");c.remove();var f=0;b.each(this.instances,function(){f=Math.max(f,this.css("z-index"))});this.maxZ=f},height:function(){var c, -f;if(b.browser.msie&&b.browser.version<7){c=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);f=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return c");if(!f.values)f.values=[this._valueMin(),this._valueMin()];if(f.values.length&&f.values.length!=2)f.values=[f.values[0],f.values[0]]}else this.range=b("
                      ");this.range.appendTo(this.element).addClass("ui-slider-range");if(f.range=="min"||f.range=="max")this.range.addClass("ui-slider-range-"+f.range);this.range.addClass("ui-widget-header")}b(".ui-slider-handle",this.element).length==0&&b('').appendTo(this.element).addClass("ui-slider-handle"); -if(f.values&&f.values.length)for(;b(".ui-slider-handle",this.element).length').appendTo(this.element).addClass("ui-slider-handle");this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){f.disabled||b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(f.disabled)b(this).blur(); -else{b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(d){b(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(d){var a=true,e=b(this).data("index.ui-slider-handle");if(!c.options.disabled){switch(d.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:a= -false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");c._start(d,e)}}var g,i,k=c._step();g=c.options.values&&c.options.values.length?i=c.values(e):i=c.value();switch(d.keyCode){case b.ui.keyCode.HOME:i=c._valueMin();break;case b.ui.keyCode.END:i=c._valueMax();break;case b.ui.keyCode.PAGE_UP:i=g+(c._valueMax()-c._valueMin())/5;break;case b.ui.keyCode.PAGE_DOWN:i=g-(c._valueMax()-c._valueMin())/5;break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(g==c._valueMax())return; -i=g+k;break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(g==c._valueMin())return;i=g-k}c._slide(d,e,i);return a}}).keyup(function(d){var a=b(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(d,a);c._change(d,a);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); -this._mouseDestroy();return this},_mouseCapture:function(c){var f=this.options;if(f.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var d={x:c.pageX,y:c.pageY},a=this._normValueFromMouse(d),e=this._valueMax()-this._valueMin()+1,g,i=this,k;this.handles.each(function(j){var h=Math.abs(a-i.values(j));if(e>h){e=h;g=b(this);k=j}});if(f.range==true&&this.values(1)==f.min)g=b(this.handles[++k]);this._start(c, -k);this._mouseSliding=true;i._handleIndex=k;g.addClass("ui-state-active").focus();f=g.offset();this._clickOffset=!b(c.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:c.pageX-f.left-g.width()/2,top:c.pageY-f.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};a=this._normValueFromMouse(d);this._slide(c,k,a);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(c){var f= -this._normValueFromMouse({x:c.pageX,y:c.pageY});this._slide(c,this._handleIndex,f);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(c){var f;if("horizontal"==this.orientation){f= -this.elementSize.width;c=c.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{f=this.elementSize.height;c=c.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}f=c/f;if(f>1)f=1;if(f<0)f=0;if("vertical"==this.orientation)f=1-f;c=this._valueMax()-this._valueMin();c=f*c;f=c%this.options.step;c=this._valueMin()+c-f;if(f>this.options.step/2)c+=this.options.step;return parseFloat(c.toFixed(5))},_start:function(c,f){var d={handle:this.handles[f],value:this.value()}; -if(this.options.values&&this.options.values.length){d.value=this.values(f);d.values=this.values()}this._trigger("start",c,d)},_slide:function(c,f,d){if(this.options.values&&this.options.values.length){var a=this.values(f?0:1);if(this.options.values.length==2&&this.options.range===true&&(f==0&&d>a||f==1&&d1){this.options.values[c]=this._trimValue(f);this._refreshValue();this._change(null,c)}if(arguments.length)if(b.isArray(arguments[0])){for(var d=this.options.values,a=arguments[0],e=0,g=d.length;ethis._valueMax())c=this._valueMax();return c},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var c=this.options.range,f=this.options,d=this,a=!this._animateOff?f.animate:false;if(this.options.values&&this.options.values.length)this.handles.each(function(k){var j= -(d.values(k)-d._valueMin())/(d._valueMax()-d._valueMin())*100,h={};h[d.orientation=="horizontal"?"left":"bottom"]=j+"%";b(this).stop(1,1)[a?"animate":"css"](h,f.animate);if(d.options.range===true)if(d.orientation=="horizontal"){k==0&&d.range.stop(1,1)[a?"animate":"css"]({left:j+"%"},f.animate);k==1&&d.range[a?"animate":"css"]({width:j-lastValPercent+"%"},{queue:false,duration:f.animate})}else{k==0&&d.range.stop(1,1)[a?"animate":"css"]({bottom:j+"%"},f.animate);k==1&&d.range[a?"animate":"css"]({height:j- -lastValPercent+"%"},{queue:false,duration:f.animate})}lastValPercent=j});else{var e=this.value(),g=this._valueMin(),i=this._valueMax();e=i!=g?(e-g)/(i-g)*100:0;g={};g[d.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[a?"animate":"css"](g,f.animate);c=="min"&&this.orientation=="horizontal"&&this.range.stop(1,1)[a?"animate":"css"]({width:e+"%"},f.animate);c=="max"&&this.orientation=="horizontal"&&this.range[a?"animate":"css"]({width:100-e+"%"},{queue:false,duration:f.animate}); -c=="min"&&this.orientation=="vertical"&&this.range.stop(1,1)[a?"animate":"css"]({height:e+"%"},f.animate);c=="max"&&this.orientation=="vertical"&&this.range[a?"animate":"css"]({height:100-e+"%"},{queue:false,duration:f.animate})}}});b.extend(b.ui.slider,{version:"1.8"})})(jQuery); -(function(b){var c=0,f=0;b.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
                      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:'
                    • #{label}
                    • '},_create:function(){this._tabify(true)},_setOption:function(d,a){if(d=="selected")this.options.collapsible&&a==this.options.selected|| -this.select(a);else{this.options[d]=a;this._tabify()}},_tabId:function(d){return d.title&&d.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+ ++c},_sanitizeSelector:function(d){return d.replace(/:/g,"\\:")},_cookie:function(){var d=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++f);return b.cookie.apply(null,[d].concat(b.makeArray(arguments)))},_ui:function(d,a){return{tab:d,panel:a,index:this.anchors.index(d)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var d= -b(this);d.html(d.data("label.tabs")).removeData("label.tabs")})},_tabify:function(d){function a(o,p){o.css({display:""});!b.support.opacity&&p.opacity&&o[0].style.removeAttribute("filter")}this.list=this.element.find("ol,ul").eq(0);this.lis=b("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return b("a",this)[0]});this.panels=b([]);var e=this,g=this.options,i=/^#.+/;this.anchors.each(function(o,p){var q=b(p).attr("href"),r=q.split("#")[0],s;if(r&&(r===location.toString().split("#")[0]|| -(s=b("base")[0])&&r===s.href)){q=p.hash;p.href=q}if(i.test(q))e.panels=e.panels.add(e._sanitizeSelector(q));else if(q!="#"){b.data(p,"href.tabs",q);b.data(p,"load.tabs",q.replace(/#.*$/,""));q=e._tabId(p);p.href="#"+q;r=b("#"+q);if(!r.length){r=b(g.panelTemplate).attr("id",q).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(e.panels[o-1]||e.list);r.data("destroy.tabs",true)}e.panels=e.panels.add(r)}else g.disabled.push(o)});if(d){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(g.selected===undefined){location.hash&&this.anchors.each(function(o,p){if(p.hash==location.hash){g.selected=o;return false}});if(typeof g.selected!="number"&&g.cookie)g.selected=parseInt(e._cookie(),10);if(typeof g.selected!="number"&&this.lis.filter(".ui-tabs-selected").length)g.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));g.selected=g.selected||(this.lis.length?0:-1)}else if(g.selected===null)g.selected=-1;g.selected=g.selected>=0&&this.anchors[g.selected]||g.selected<0?g.selected:0;g.disabled=b.unique(g.disabled.concat(b.map(this.lis.filter(".ui-state-disabled"),function(o){return e.lis.index(o)}))).sort();b.inArray(g.selected,g.disabled)!=-1&&g.disabled.splice(b.inArray(g.selected,g.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(g.selected>=0&&this.anchors.length){this.panels.eq(g.selected).removeClass("ui-tabs-hide");this.lis.eq(g.selected).addClass("ui-tabs-selected ui-state-active");e.element.queue("tabs",function(){e._trigger("show",null,e._ui(e.anchors[g.selected],e.panels[g.selected]))});this.load(g.selected)}b(window).bind("unload",function(){e.lis.add(e.anchors).unbind(".tabs");e.lis=e.anchors=e.panels=null})}else g.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));this.element[g.collapsible?"addClass": -"removeClass"]("ui-tabs-collapsible");g.cookie&&this._cookie(g.selected,g.cookie);d=0;for(var k;k=this.lis[d];d++)b(k)[b.inArray(d,g.disabled)!=-1&&!b(k).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");g.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(g.event!="mouseover"){var j=function(o,p){p.is(":not(.ui-state-disabled)")&&p.addClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){j("hover",b(this))});this.lis.bind("mouseout.tabs", -function(){b(this).removeClass("ui-state-hover")});this.anchors.bind("focus.tabs",function(){j("focus",b(this).closest("li"))});this.anchors.bind("blur.tabs",function(){b(this).closest("li").removeClass("ui-state-focus")})}var h,l;if(g.fx)if(b.isArray(g.fx)){h=g.fx[0];l=g.fx[1]}else h=l=g.fx;var m=l?function(o,p){b(o).closest("li").addClass("ui-tabs-selected ui-state-active");p.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){a(p,l);e._trigger("show",null,e._ui(o,p[0]))})}: -function(o,p){b(o).closest("li").addClass("ui-tabs-selected ui-state-active");p.removeClass("ui-tabs-hide");e._trigger("show",null,e._ui(o,p[0]))},n=h?function(o,p){p.animate(h,h.duration||"normal",function(){e.lis.removeClass("ui-tabs-selected ui-state-active");p.addClass("ui-tabs-hide");a(p,h);e.element.dequeue("tabs")})}:function(o,p){e.lis.removeClass("ui-tabs-selected ui-state-active");p.addClass("ui-tabs-hide");e.element.dequeue("tabs")};this.anchors.bind(g.event+".tabs",function(){var o=this, -p=b(this).closest("li"),q=e.panels.filter(":not(.ui-tabs-hide)"),r=b(e._sanitizeSelector(this.hash));if(p.hasClass("ui-tabs-selected")&&!g.collapsible||p.hasClass("ui-state-disabled")||p.hasClass("ui-state-processing")||e._trigger("select",null,e._ui(this,r[0]))===false){this.blur();return false}g.selected=e.anchors.index(this);e.abort();if(g.collapsible)if(p.hasClass("ui-tabs-selected")){g.selected=-1;g.cookie&&e._cookie(g.selected,g.cookie);e.element.queue("tabs",function(){n(o,q)}).dequeue("tabs"); -this.blur();return false}else if(!q.length){g.cookie&&e._cookie(g.selected,g.cookie);e.element.queue("tabs",function(){m(o,r)});e.load(e.anchors.index(this));this.blur();return false}g.cookie&&e._cookie(g.selected,g.cookie);if(r.length){q.length&&e.element.queue("tabs",function(){n(o,q)});e.element.queue("tabs",function(){m(o,r)});e.load(e.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";b.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})}, -destroy:function(){var d=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var a=b.data(this,"href.tabs");if(a)this.href=a;var e=b(this).unbind(".tabs");b.each(["href","load","cache"],function(g,i){e.removeData(i+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){b.data(this, -"destroy.tabs")?b(this).remove():b(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});d.cookie&&this._cookie(null,d.cookie);return this},add:function(d,a,e){if(e===undefined)e=this.anchors.length;var g=this,i=this.options;a=b(i.tabTemplate.replace(/#\{href\}/g,d).replace(/#\{label\}/g,a));d=!d.indexOf("#")?d.replace("#",""):this._tabId(b("a",a)[0]);a.addClass("ui-state-default ui-corner-top").data("destroy.tabs", -true);var k=b("#"+d);k.length||(k=b(i.panelTemplate).attr("id",d).data("destroy.tabs",true));k.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(e>=this.lis.length){a.appendTo(this.list);k.appendTo(this.list[0].parentNode)}else{a.insertBefore(this.lis[e]);k.insertBefore(this.panels[e])}i.disabled=b.map(i.disabled,function(j){return j>=e?++j:j});this._tabify();if(this.anchors.length==1){i.selected=0;a.addClass("ui-tabs-selected ui-state-active");k.removeClass("ui-tabs-hide"); -this.element.queue("tabs",function(){g._trigger("show",null,g._ui(g.anchors[0],g.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(d){var a=this.options,e=this.lis.eq(d).remove(),g=this.panels.eq(d).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(d+(d+1=d?--i:i});this._tabify();this._trigger("remove", -null,this._ui(e.find("a")[0],g[0]));return this},enable:function(d){var a=this.options;if(b.inArray(d,a.disabled)!=-1){this.lis.eq(d).removeClass("ui-state-disabled");a.disabled=b.grep(a.disabled,function(e){return e!=d});this._trigger("enable",null,this._ui(this.anchors[d],this.panels[d]));return this}},disable:function(d){var a=this.options;if(d!=a.selected){this.lis.eq(d).addClass("ui-state-disabled");a.disabled.push(d);a.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[d],this.panels[d]))}return this}, -select:function(d){if(typeof d=="string")d=this.anchors.index(this.anchors.filter("[href$="+d+"]"));else if(d===null)d=-1;if(d==-1&&this.options.collapsible)d=this.options.selected;this.anchors.eq(d).trigger(this.options.event+".tabs");return this},load:function(d){var a=this,e=this.options,g=this.anchors.eq(d)[0],i=b.data(g,"load.tabs");this.abort();if(!i||this.element.queue("tabs").length!==0&&b.data(g,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(d).addClass("ui-state-processing"); -if(e.spinner){var k=b("span",g);k.data("label.tabs",k.html()).html(e.spinner)}this.xhr=b.ajax(b.extend({},e.ajaxOptions,{url:i,success:function(j,h){b(a._sanitizeSelector(g.hash)).html(j);a._cleanup();e.cache&&b.data(g,"cache.tabs",true);a._trigger("load",null,a._ui(a.anchors[d],a.panels[d]));try{e.ajaxOptions.success(j,h)}catch(l){}},error:function(j,h){a._cleanup();a._trigger("load",null,a._ui(a.anchors[d],a.panels[d]));try{e.ajaxOptions.error(j,h,d,g)}catch(l){}}}));a.element.dequeue("tabs");return this}}, -abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(d,a){this.anchors.eq(d).removeData("cache.tabs").data("load.tabs",a);return this},length:function(){return this.anchors.length}});b.extend(b.ui.tabs,{version:"1.8"});b.extend(b.ui.tabs.prototype,{rotation:null,rotate:function(d,a){var e=this,g=this.options,i=e._rotate||(e._rotate= -function(j){clearTimeout(e.rotation);e.rotation=setTimeout(function(){var h=g.selected;e.select(++h')}function f(a,e){b.extend(a, -e);for(var g in e)if(e[g]==null||e[g]==undefined)a[g]=e[g];return a}b.extend(b.ui,{datepicker:{version:"1.8"}});var d=(new Date).getTime();b.extend(c.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){f(this._defaults,a||{});return this},_attachDatepicker:function(a,e){var g=null,i;for(i in this._defaults){var k=a.getAttribute("date:"+i);if(k){g=g||{};try{g[i]=eval(k)}catch(j){g[i]= -k}}}i=a.nodeName.toLowerCase();k=i=="div"||i=="span";if(!a.id)a.id="dp"+ ++this.uuid;var h=this._newInst(b(a),k);h.settings=b.extend({},e||{},g||{});if(i=="input")this._connectDatepicker(a,h);else k&&this._inlineDatepicker(a,h)},_newInst:function(a,e){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:!e?this.dpDiv:b('
                      ')}}, -_connectDatepicker:function(a,e){var g=b(a);e.append=b([]);e.trigger=b([]);if(!g.hasClass(this.markerClassName)){this._attachments(g,e);g.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(i,k,j){e.settings[k]=j}).bind("getData.datepicker",function(i,k){return this._get(e,k)});this._autoSize(e);b.data(a,"datepicker",e)}},_attachments:function(a,e){var g=this._get(e,"appendText"),i=this._get(e,"isRTL");e.append&& -e.append.remove();if(g){e.append=b(''+g+"");a[i?"before":"after"](e.append)}a.unbind("focus",this._showDatepicker);e.trigger&&e.trigger.remove();g=this._get(e,"showOn");if(g=="focus"||g=="both")a.focus(this._showDatepicker);if(g=="button"||g=="both"){g=this._get(e,"buttonText");var k=this._get(e,"buttonImage");e.trigger=b(this._get(e,"buttonImageOnly")?b("").addClass(this._triggerClass).attr({src:k,alt:g,title:g}):b('').addClass(this._triggerClass).html(k== -""?g:b("").attr({src:k,alt:g,title:g})));a[i?"before":"after"](e.trigger);e.trigger.click(function(){b.datepicker._datepickerShowing&&b.datepicker._lastInput==a[0]?b.datepicker._hideDatepicker():b.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var e=new Date(2009,11,20),g=this._get(a,"dateFormat");if(g.match(/[DM]/)){var i=function(k){for(var j=0,h=0,l=0;lj){j=k[l].length;h=l}return h};e.setMonth(i(this._get(a, -g.match(/MM/)?"monthNames":"monthNamesShort")));e.setDate(i(this._get(a,g.match(/DD/)?"dayNames":"dayNamesShort"))+20-e.getDay())}a.input.attr("size",this._formatDate(a,e).length)}},_inlineDatepicker:function(a,e){var g=b(a);if(!g.hasClass(this.markerClassName)){g.addClass(this.markerClassName).append(e.dpDiv).bind("setData.datepicker",function(i,k,j){e.settings[k]=j}).bind("getData.datepicker",function(i,k){return this._get(e,k)});b.data(a,"datepicker",e);this._setDate(e,this._getDefaultDate(e), -true);this._updateDatepicker(e);this._updateAlternate(e)}},_dialogDatepicker:function(a,e,g,i,k){a=this._dialogInst;if(!a){a="dp"+ ++this.uuid;this._dialogInput=b('');this._dialogInput.keydown(this._doKeyDown);b("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};b.data(this._dialogInput[0],"datepicker",a)}f(a.settings,i||{});e=e&&e.constructor==Date? -this._formatDate(a,e):e;this._dialogInput.val(e);this._pos=k?k.length?k:[k.pageX,k.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=g;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]); -b.blockUI&&b.blockUI(this.dpDiv);b.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var e=b(a),g=b.data(a,"datepicker");if(e.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();b.removeData(a,"datepicker");if(i=="input"){g.append.remove();g.trigger.remove();e.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(i=="div"||i=="span")e.removeClass(this.markerClassName).empty()}}, -_enableDatepicker:function(a){var e=b(a),g=b.data(a,"datepicker");if(e.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();if(i=="input"){a.disabled=false;g.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(i=="div"||i=="span")e.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=b.map(this._disabledInputs,function(k){return k==a?null:k})}},_disableDatepicker:function(a){var e= -b(a),g=b.data(a,"datepicker");if(e.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();if(i=="input"){a.disabled=true;g.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(i=="div"||i=="span")e.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=b.map(this._disabledInputs,function(k){return k==a?null:k});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false; -for(var e=0;e-1}},_doKeyUp:function(a){a=b.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(b.datepicker.parseDate(b.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,b.datepicker._getFormatConfig(a))){b.datepicker._setDateFromField(a);b.datepicker._updateAlternate(a);b.datepicker._updateDatepicker(a)}}catch(e){b.datepicker.log(e)}return true},_showDatepicker:function(a){a=a.target|| -a;if(a.nodeName.toLowerCase()!="input")a=b("input",a.parentNode)[0];if(!(b.datepicker._isDisabledDatepicker(a)||b.datepicker._lastInput==a)){var e=b.datepicker._getInst(a);b.datepicker._curInst&&b.datepicker._curInst!=e&&b.datepicker._curInst.dpDiv.stop(true,true);var g=b.datepicker._get(e,"beforeShow");f(e.settings,g?g.apply(a,[a,e]):{});e.lastVal=null;b.datepicker._lastInput=a;b.datepicker._setDateFromField(e);if(b.datepicker._inDialog)a.value="";if(!b.datepicker._pos){b.datepicker._pos=b.datepicker._findPos(a); -b.datepicker._pos[1]+=a.offsetHeight}var i=false;b(a).parents().each(function(){i|=b(this).css("position")=="fixed";return!i});if(i&&b.browser.opera){b.datepicker._pos[0]-=document.documentElement.scrollLeft;b.datepicker._pos[1]-=document.documentElement.scrollTop}g={left:b.datepicker._pos[0],top:b.datepicker._pos[1]};b.datepicker._pos=null;e.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});b.datepicker._updateDatepicker(e);g=b.datepicker._checkOffset(e,g,i);e.dpDiv.css({position:b.datepicker._inDialog&& -b.blockUI?"static":i?"fixed":"absolute",display:"none",left:g.left+"px",top:g.top+"px"});if(!e.inline){g=b.datepicker._get(e,"showAnim");var k=b.datepicker._get(e,"duration"),j=function(){b.datepicker._datepickerShowing=true;var h=b.datepicker._getBorders(e.dpDiv);e.dpDiv.find("iframe.ui-datepicker-cover").css({left:-h[0],top:-h[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()})};e.dpDiv.zIndex(b(a).zIndex()+1);b.effects&&b.effects[g]?e.dpDiv.show(g,b.datepicker._get(e,"showOptions"),k, -j):e.dpDiv[g||"show"](g?k:null,j);if(!g||!k)j();e.input.is(":visible")&&!e.input.is(":disabled")&&e.input.focus();b.datepicker._curInst=e}}},_updateDatepicker:function(a){var e=this,g=b.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-g[0],top:-g[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){b(this).removeClass("ui-state-hover"); -this.className.indexOf("ui-datepicker-prev")!=-1&&b(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&b(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!e._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){b(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&b(this).addClass("ui-datepicker-prev-hover"); -this.className.indexOf("ui-datepicker-next")!=-1&&b(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();g=this._getNumberOfMonths(a);var i=g[1];i>1?a.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",17*i+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(g[0]!=1||g[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"); -a==b.datepicker._curInst&&b.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var e=function(g){return{thin:1,medium:2,thick:3}[g]||g};return[parseFloat(e(a.css("border-left-width"))),parseFloat(e(a.css("border-top-width")))]},_checkOffset:function(a,e,g){var i=a.dpDiv.outerWidth(),k=a.dpDiv.outerHeight(),j=a.input?a.input.outerWidth():0,h=a.input?a.input.outerHeight():0,l=document.documentElement.clientWidth+b(document).scrollLeft(), -m=document.documentElement.clientHeight+b(document).scrollTop();e.left-=this._get(a,"isRTL")?i-j:0;e.left-=g&&e.left==a.input.offset().left?b(document).scrollLeft():0;e.top-=g&&e.top==a.input.offset().top+h?b(document).scrollTop():0;e.left-=Math.min(e.left,e.left+i>l&&l>i?Math.abs(e.left+i-l):0);e.top-=Math.min(e.top,e.top+k>m&&m>k?Math.abs(k+h):0);return e},_findPos:function(a){for(var e=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[e?"previousSibling":"nextSibling"]; -a=b(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var e=this._curInst;if(!(!e||a&&e!=b.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(e,"showAnim");var g=this._get(e,"duration"),i=function(){b.datepicker._tidyDialog(e);this._curInst=null};b.effects&&b.effects[a]?e.dpDiv.hide(a,b.datepicker._get(e,"showOptions"),g,i):e.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?g:null,i);a||i();if(a=this._get(e,"onClose"))a.apply(e.input?e.input[0]:null,[e.input?e.input.val(): -"",e]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(b.blockUI){b.unblockUI();b("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(b.datepicker._curInst){a=b(a.target);a[0].id!=b.datepicker._mainDivId&&a.parents("#"+b.datepicker._mainDivId).length==0&&!a.hasClass(b.datepicker.markerClassName)&& -!a.hasClass(b.datepicker._triggerClass)&&b.datepicker._datepickerShowing&&!(b.datepicker._inDialog&&b.blockUI)&&b.datepicker._hideDatepicker()}},_adjustDate:function(a,e,g){a=b(a);var i=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(i,e+(g=="M"?this._get(i,"showCurrentAtPos"):0),g);this._updateDatepicker(i)}},_gotoToday:function(a){a=b(a);var e=this._getInst(a[0]);if(this._get(e,"gotoCurrent")&&e.currentDay){e.selectedDay=e.currentDay;e.drawMonth=e.selectedMonth=e.currentMonth; -e.drawYear=e.selectedYear=e.currentYear}else{var g=new Date;e.selectedDay=g.getDate();e.drawMonth=e.selectedMonth=g.getMonth();e.drawYear=e.selectedYear=g.getFullYear()}this._notifyChange(e);this._adjustDate(a)},_selectMonthYear:function(a,e,g){a=b(a);var i=this._getInst(a[0]);i._selectingMonthYear=false;i["selected"+(g=="M"?"Month":"Year")]=i["draw"+(g=="M"?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10);this._notifyChange(i);this._adjustDate(a)},_clickMonthYear:function(a){a=this._getInst(b(a)[0]); -a.input&&a._selectingMonthYear&&!b.browser.msie&&a.input.focus();a._selectingMonthYear=!a._selectingMonthYear},_selectDay:function(a,e,g,i){var k=b(a);if(!(b(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(k[0]))){k=this._getInst(k[0]);k.selectedDay=k.currentDay=b("a",i).html();k.selectedMonth=k.currentMonth=e;k.selectedYear=k.currentYear=g;this._selectDate(a,this._formatDate(k,k.currentDay,k.currentMonth,k.currentYear))}},_clearDate:function(a){a=b(a);this._getInst(a[0]);this._selectDate(a, -"")},_selectDate:function(a,e){var g=this._getInst(b(a)[0]);e=e!=null?e:this._formatDate(g);g.input&&g.input.val(e);this._updateAlternate(g);var i=this._get(g,"onSelect");if(i)i.apply(g.input?g.input[0]:null,[e,g]);else g.input&&g.input.trigger("change");if(g.inline)this._updateDatepicker(g);else{this._hideDatepicker();this._lastInput=g.input[0];typeof g.input[0]!="object"&&g.input.focus();this._lastInput=null}},_updateAlternate:function(a){var e=this._get(a,"altField");if(e){var g=this._get(a,"altFormat")|| -this._get(a,"dateFormat"),i=this._getDate(a),k=this.formatDate(g,i,this._getFormatConfig(a));b(e).each(function(){b(this).val(k)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var e=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((e-a)/864E5)/7)+1},parseDate:function(a,e,g){if(a==null||e==null)throw"Invalid arguments";e=typeof e=="object"?e.toString():e+"";if(e=="")return null; -for(var i=(g?g.shortYearCutoff:null)||this._defaults.shortYearCutoff,k=(g?g.dayNamesShort:null)||this._defaults.dayNamesShort,j=(g?g.dayNames:null)||this._defaults.dayNames,h=(g?g.monthNamesShort:null)||this._defaults.monthNamesShort,l=(g?g.monthNames:null)||this._defaults.monthNames,m=g=-1,n=-1,o=-1,p=false,q=function(v){(v=C+1-1){m=1;n=o;do{i=this._getDaysInMonth(g,m-1);if(n<=i)break;m++;n-=i}while(1)}z=this._daylightSavingAdjust(new Date(g, -m-1,n));if(z.getFullYear()!=g||z.getMonth()+1!=m||z.getDate()!=n)throw"Invalid date";return z},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,e,g){if(!e)return"";var i=(g?g.dayNamesShort:null)||this._defaults.dayNamesShort,k=(g? -g.dayNames:null)||this._defaults.dayNames,j=(g?g.monthNamesShort:null)||this._defaults.monthNamesShort;g=(g?g.monthNames:null)||this._defaults.monthNames;var h=function(q){(q=p+1 -12?a.getHours()+2:0);return a},_setDate:function(a,e,g){var i=!e,k=a.selectedMonth,j=a.selectedYear;e=this._restrictMinMax(a,this._determineDate(a,e,new Date));a.selectedDay=a.currentDay=e.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=e.getMonth();a.drawYear=a.selectedYear=a.currentYear=e.getFullYear();if((k!=a.selectedMonth||j!=a.selectedYear)&&!g)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(i?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&& -a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var e=new Date;e=this._daylightSavingAdjust(new Date(e.getFullYear(),e.getMonth(),e.getDate()));var g=this._get(a,"isRTL"),i=this._get(a,"showButtonPanel"),k=this._get(a,"hideIfNoPrevNext"),j=this._get(a,"navigationAsDateFormat"),h=this._getNumberOfMonths(a),l=this._get(a,"showCurrentAtPos"),m=this._get(a,"stepMonths"),n=h[0]!=1||h[1]!=1,o=this._daylightSavingAdjust(!a.currentDay? -new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),p=this._getMinMaxDate(a,"min"),q=this._getMinMaxDate(a,"max");l=a.drawMonth-l;var r=a.drawYear;if(l<0){l+=12;r--}if(q){var s=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth()-h[0]*h[1]+1,q.getDate()));for(s=p&&ss;){l--;if(l<0){l=11;r--}}}a.drawMonth=l;a.drawYear=r;s=this._get(a,"prevText");s=!j?s:this.formatDate(s,this._daylightSavingAdjust(new Date(r,l-m,1)),this._getFormatConfig(a)); -s=this._canAdjustMonth(a,-1,r,l)?''+s+"":k?"":''+s+"";var u=this._get(a,"nextText");u=!j?u:this.formatDate(u,this._daylightSavingAdjust(new Date(r, -l+m,1)),this._getFormatConfig(a));k=this._canAdjustMonth(a,+1,r,l)?''+u+"":k?"":''+u+"";m=this._get(a,"currentText");u=this._get(a,"gotoCurrent")&& -a.currentDay?o:e;m=!j?m:this.formatDate(m,u,this._getFormatConfig(a));j=!a.inline?'":"";i=i?'
                      '+(g?j:"")+(this._isInRange(a,u)?'":"")+(g?"":j)+"
                      ":"";j=parseInt(this._get(a,"firstDay"),10);j=isNaN(j)?0:j;m=this._get(a,"showWeek");u=this._get(a,"dayNames");this._get(a,"dayNamesShort");var x=this._get(a,"dayNamesMin"),C=this._get(a,"monthNames"),z=this._get(a,"monthNamesShort"),v=this._get(a,"beforeShowDay"),A=this._get(a,"showOtherMonths"),I=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),J="",F=0;F1)switch(G){case 0:B+=" ui-datepicker-group-first";y=" ui-corner-"+(g?"right":"left");break;case h[1]-1:B+=" ui-datepicker-group-last";y=" ui-corner-"+(g?"left":"right");break;default:B+=" ui-datepicker-group-middle";y=""}B+='">'}B+='
                      '+(/all|left/.test(y)&&F==0?g?k:s:"")+ -(/all|right/.test(y)&&F==0?g?s:k:"")+this._generateMonthYearHeader(a,l,r,p,q,F>0||G>0,C,z)+'
                      ';var D=m?'":"";for(y=0;y<7;y++){var w=(y+j)%7;D+="=5?' class="ui-datepicker-week-end"':"")+'>'+x[w]+""}B+=D+"";D=this._getDaysInMonth(r,l);if(r==a.selectedYear&&l==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, -D);y=(this._getFirstDayOfMonth(r,l)-j+7)%7;D=n?6:Math.ceil((y+D)/7);w=this._daylightSavingAdjust(new Date(r,l,1-y));for(var O=0;O";var P=!m?"":'";for(y=0;y<7;y++){var H=v?v.apply(a.input?a.input[0]:null,[w]):[true,""],E=w.getMonth()!=l,K=E&&!I||!H[0]||p&&wq;P+='";w.setDate(w.getDate()+1);w=this._daylightSavingAdjust(w)}B+=P+""}l++;if(l>11){l=0;r++}B+="
                      '+this._get(a,"weekHeader")+"
                      '+this._get(a,"calculateWeek")(w)+""+(E&&!A?" ":K?''+w.getDate()+ -"":''+w.getDate()+"")+"
                      "+(n?"
              "+(h[0]>0&&G==h[1]-1?'
              ':""):"");M+=B}J+=M}J+=i+(b.browser.msie&&parseInt(b.browser.version,10)<7&&!a.inline?'': -"");a._keyEvent=false;return J},_generateMonthYearHeader:function(a,e,g,i,k,j,h,l){var m=this._get(a,"changeMonth"),n=this._get(a,"changeYear"),o=this._get(a,"showMonthAfterYear"),p='
              ',q="";if(j||!m)q+=''+h[e]+"";else{h=i&&i.getFullYear()==g;var r=k&&k.getFullYear()==g;q+='"}o||(p+=q+(j||!(m&&n)?" ":""));if(j||!n)p+=''+g+"";else{l=this._get(a,"yearRange").split(":");var u=(new Date).getFullYear();h=function(x){x=x.match(/c[+-].*/)?g+parseInt(x.substring(1),10):x.match(/[+-].*/)?u+parseInt(x,10):parseInt(x,10);return isNaN(x)?u:x};e=h(l[0]);l=Math.max(e, -h(l[1]||""));e=i?Math.max(e,i.getFullYear()):e;l=k?Math.min(l,k.getFullYear()):l;for(p+='"}p+=this._get(a,"yearSuffix");if(o)p+=(j||!(m&&n)?" ":"")+q;p+="
              ";return p},_adjustInstDate:function(a,e,g){var i= -a.drawYear+(g=="Y"?e:0),k=a.drawMonth+(g=="M"?e:0);e=Math.min(a.selectedDay,this._getDaysInMonth(i,k))+(g=="D"?e:0);i=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(i,k,e)));a.selectedDay=i.getDate();a.drawMonth=a.selectedMonth=i.getMonth();a.drawYear=a.selectedYear=i.getFullYear();if(g=="M"||g=="Y")this._notifyChange(a)},_restrictMinMax:function(a,e){var g=this._getMinMaxDate(a,"min"),i=this._getMinMaxDate(a,"max");e=g&&ei?i:e},_notifyChange:function(a){var e=this._get(a, -"onChangeMonthYear");if(e)e.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,e){return this._determineDate(a,this._get(a,e+"Date"),null)},_getDaysInMonth:function(a,e){return 32-(new Date(a,e,32)).getDate()},_getFirstDayOfMonth:function(a,e){return(new Date(a,e,1)).getDay()},_canAdjustMonth:function(a,e,g,i){var k=this._getNumberOfMonths(a); -g=this._daylightSavingAdjust(new Date(g,i+(e<0?e:k[0]*k[1]),1));e<0&&g.setDate(this._getDaysInMonth(g.getFullYear(),g.getMonth()));return this._isInRange(a,g)},_isInRange:function(a,e){var g=this._getMinMaxDate(a,"min"),i=this._getMinMaxDate(a,"max");return(!g||e.getTime()>=g.getTime())&&(!i||e.getTime()<=i.getTime())},_getFormatConfig:function(a){var e=this._get(a,"shortYearCutoff");e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);return{shortYearCutoff:e,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,e,g,i){if(!e){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}e=e?typeof e=="object"?e:this._daylightSavingAdjust(new Date(i,g,e)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}});b.fn.datepicker= -function(a){if(!b.datepicker.initialized){b(document).mousedown(b.datepicker._checkExternalClick).find("body").append(b.datepicker.dpDiv);b.datepicker.initialized=true}var e=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this[0]].concat(e));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this[0]].concat(e)); -return this.each(function(){typeof a=="string"?b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this].concat(e)):b.datepicker._attachDatepicker(this,a)})};b.datepicker=new c;b.datepicker.initialized=false;b.datepicker.uuid=(new Date).getTime();b.datepicker.version="1.8";window["DP_jQuery_"+d]=b})(jQuery); -(function(b){b.widget("ui.progressbar",{options:{value:0},_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=b("
              ").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(c){if(c===undefined)return this._value();this._setOption("value",c);return this},_setOption:function(c,f){switch(c){case "value":this.options.value=f;this._refreshValue();this._trigger("change")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var c=this.options.value;if(typeof c!=="number")c=0;if(cthis._valueMax())c=this._valueMax();return c},_valueMin:function(){return 0}, -_valueMax:function(){return 100},_refreshValue:function(){var c=this.value();this.valueDiv[c===this._valueMax()?"addClass":"removeClass"]("ui-corner-right").width(c+"%");this.element.attr("aria-valuenow",c)}});b.extend(b.ui.progressbar,{version:"1.8"})})(jQuery); -jQuery.effects||function(b){function c(j){var h;if(j&&j.constructor==Array&&j.length==3)return j;if(h=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(j))return[parseInt(h[1],10),parseInt(h[2],10),parseInt(h[3],10)];if(h=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(j))return[parseFloat(h[1])*2.55,parseFloat(h[2])*2.55,parseFloat(h[3])*2.55];if(h=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(j))return[parseInt(h[1], -16),parseInt(h[2],16),parseInt(h[3],16)];if(h=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(j))return[parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16),parseInt(h[3]+h[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(j))return g.transparent;return g[b.trim(j).toLowerCase()]}function f(){var j=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,h={},l,m;if(j&&j.length&&j[0]&&j[j[0]])for(var n=j.length;n--;){l=j[n];if(typeof j[l]=="string"){m=l.replace(/\-(\w)/g,function(o,p){return p.toUpperCase()}); -h[m]=j[l]}}else for(l in j)if(typeof j[l]==="string")h[l]=j[l];return h}function d(j){var h,l;for(h in j){l=j[h];if(l==null||b.isFunction(l)||h in k||/scrollbar/.test(h)||!/color/i.test(h)&&isNaN(parseFloat(l)))delete j[h]}return j}function a(j,h){var l={_:0},m;for(m in h)if(j[m]!=h[m])l[m]=h[m];return l}function e(j,h,l,m){if(typeof j=="object"){m=h;l=null;h=j;j=h.effect}if(b.isFunction(h)){m=h;l=null;h={}}if(b.isFunction(l)){m=l;l=null}if(typeof h=="number"||b.fx.speeds[h]){m=l;l=h;h={}}h=h||{}; -l=l||h.duration;l=b.fx.off?0:typeof l=="number"?l:b.fx.speeds[l]||b.fx.speeds._default;m=m||h.complete;return[j,h,l,m]}b.effects={};b.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(j,h){b.fx.step[h]=function(l){if(!l.colorInit){var m;m=l.elem;var n=h,o;do{o=b.curCSS(m,n);if(o!=""&&o!="transparent"||b.nodeName(m,"body"))break;n="backgroundColor"}while(m=m.parentNode);m=c(o);l.start=m;l.end=c(l.end);l.colorInit=true}l.elem.style[h]= -"rgb("+Math.max(Math.min(parseInt(l.pos*(l.end[0]-l.start[0])+l.start[0],10),255),0)+","+Math.max(Math.min(parseInt(l.pos*(l.end[1]-l.start[1])+l.start[1],10),255),0)+","+Math.max(Math.min(parseInt(l.pos*(l.end[2]-l.start[2])+l.start[2],10),255),0)+")"}});var g={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139, -0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192, -203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},i=["add","remove","toggle"],k={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};b.effects.animateClass=function(j,h,l,m){if(b.isFunction(l)){m=l;l=null}return this.each(function(){var n=b(this),o=n.attr("style")||" ",p=d(f.call(this)),q,r=n.attr("className");b.each(i,function(s,u){j[u]&&n[u+"Class"](j[u])}); -q=d(f.call(this));n.attr("className",r);n.animate(a(p,q),h,l,function(){b.each(i,function(s,u){j[u]&&n[u+"Class"](j[u])});if(typeof n.attr("style")=="object"){n.attr("style").cssText="";n.attr("style").cssText=o}else n.attr("style",o);m&&m.apply(this,arguments)})})};b.fn.extend({_addClass:b.fn.addClass,addClass:function(j,h,l,m){return h?b.effects.animateClass.apply(this,[{add:j},h,l,m]):this._addClass(j)},_removeClass:b.fn.removeClass,removeClass:function(j,h,l,m){return h?b.effects.animateClass.apply(this, -[{remove:j},h,l,m]):this._removeClass(j)},_toggleClass:b.fn.toggleClass,toggleClass:function(j,h,l,m,n){return typeof h=="boolean"||h===undefined?l?b.effects.animateClass.apply(this,[h?{add:j}:{remove:j},l,m,n]):this._toggleClass(j,h):b.effects.animateClass.apply(this,[{toggle:j},h,l,m])},switchClass:function(j,h,l,m,n){return b.effects.animateClass.apply(this,[{add:h,remove:j},l,m,n])}});b.extend(b.effects,{version:"1.8",save:function(j,h){for(var l=0;l
              ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});j.wrap(l);l=j.parent();if(j.css("position")=="static"){l.css({position:"relative"});j.css({position:"relative"})}else{b.extend(h,{position:j.css("position"),zIndex:j.css("z-index")});b.each(["top","left","bottom","right"],function(m,n){h[n]=j.css(n);if(isNaN(parseInt(h[n],10)))h[n]="auto"}); -j.css({position:"relative",top:0,left:0})}return l.css(h).show()},removeWrapper:function(j){if(j.parent().is(".ui-effects-wrapper"))return j.parent().replaceWith(j);return j},setTransition:function(j,h,l,m){m=m||{};b.each(h,function(n,o){unit=j.cssUnit(o);if(unit[0]>0)m[o]=unit[0]*l+unit[1]});return m}});b.fn.extend({effect:function(j){var h=e.apply(this,arguments);h={options:h[1],duration:h[2],callback:h[3]};var l=b.effects[j];return l&&!b.fx.off?l.call(this,h):this},_show:b.fn.show,show:function(j){if(!j|| -typeof j=="number"||b.fx.speeds[j])return this._show.apply(this,arguments);else{var h=e.apply(this,arguments);h[1].mode="show";return this.effect.apply(this,h)}},_hide:b.fn.hide,hide:function(j){if(!j||typeof j=="number"||b.fx.speeds[j])return this._hide.apply(this,arguments);else{var h=e.apply(this,arguments);h[1].mode="hide";return this.effect.apply(this,h)}},__toggle:b.fn.toggle,toggle:function(j){if(!j||typeof j=="number"||b.fx.speeds[j]||typeof j=="boolean"||b.isFunction(j))return this.__toggle.apply(this, -arguments);else{var h=e.apply(this,arguments);h[1].mode="toggle";return this.effect.apply(this,h)}},cssUnit:function(j){var h=this.css(j),l=[];b.each(["em","px","%","pt"],function(m,n){if(h.indexOf(n)>0)l=[parseFloat(h),n]});return l}});b.easing.jswing=b.easing.swing;b.extend(b.easing,{def:"easeOutQuad",swing:function(j,h,l,m,n){return b.easing[b.easing.def](j,h,l,m,n)},easeInQuad:function(j,h,l,m,n){return m*(h/=n)*h+l},easeOutQuad:function(j,h,l,m,n){return-m*(h/=n)*(h-2)+l},easeInOutQuad:function(j, -h,l,m,n){if((h/=n/2)<1)return m/2*h*h+l;return-m/2*(--h*(h-2)-1)+l},easeInCubic:function(j,h,l,m,n){return m*(h/=n)*h*h+l},easeOutCubic:function(j,h,l,m,n){return m*((h=h/n-1)*h*h+1)+l},easeInOutCubic:function(j,h,l,m,n){if((h/=n/2)<1)return m/2*h*h*h+l;return m/2*((h-=2)*h*h+2)+l},easeInQuart:function(j,h,l,m,n){return m*(h/=n)*h*h*h+l},easeOutQuart:function(j,h,l,m,n){return-m*((h=h/n-1)*h*h*h-1)+l},easeInOutQuart:function(j,h,l,m,n){if((h/=n/2)<1)return m/2*h*h*h*h+l;return-m/2*((h-=2)*h*h*h-2)+ -l},easeInQuint:function(j,h,l,m,n){return m*(h/=n)*h*h*h*h+l},easeOutQuint:function(j,h,l,m,n){return m*((h=h/n-1)*h*h*h*h+1)+l},easeInOutQuint:function(j,h,l,m,n){if((h/=n/2)<1)return m/2*h*h*h*h*h+l;return m/2*((h-=2)*h*h*h*h+2)+l},easeInSine:function(j,h,l,m,n){return-m*Math.cos(h/n*(Math.PI/2))+m+l},easeOutSine:function(j,h,l,m,n){return m*Math.sin(h/n*(Math.PI/2))+l},easeInOutSine:function(j,h,l,m,n){return-m/2*(Math.cos(Math.PI*h/n)-1)+l},easeInExpo:function(j,h,l,m,n){return h==0?l:m*Math.pow(2, -10*(h/n-1))+l},easeOutExpo:function(j,h,l,m,n){return h==n?l+m:m*(-Math.pow(2,-10*h/n)+1)+l},easeInOutExpo:function(j,h,l,m,n){if(h==0)return l;if(h==n)return l+m;if((h/=n/2)<1)return m/2*Math.pow(2,10*(h-1))+l;return m/2*(-Math.pow(2,-10*--h)+2)+l},easeInCirc:function(j,h,l,m,n){return-m*(Math.sqrt(1-(h/=n)*h)-1)+l},easeOutCirc:function(j,h,l,m,n){return m*Math.sqrt(1-(h=h/n-1)*h)+l},easeInOutCirc:function(j,h,l,m,n){if((h/=n/2)<1)return-m/2*(Math.sqrt(1-h*h)-1)+l;return m/2*(Math.sqrt(1-(h-=2)* -h)+1)+l},easeInElastic:function(j,h,l,m,n){j=1.70158;var o=0,p=m;if(h==0)return l;if((h/=n)==1)return l+m;o||(o=n*0.3);if(p
              ").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-k*(i/f)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:i/f,left:e.left+j*(g/d)+(c.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:e.top+k*(i/f)+(c.options.mode=="show"?(k-Math.floor(f/2))*(i/f):0),opacity:c.options.mode=="show"?0:1}).animate({left:e.left+j*(g/d)+(c.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:e.top+ -k*(i/f)+(c.options.mode=="show"?0:(k-Math.floor(f/2))*(i/f)),opacity:c.options.mode=="show"?1:0},c.duration||500);setTimeout(function(){c.options.mode=="show"?a.css({visibility:"visible"}):a.css({visibility:"visible"}).hide();c.callback&&c.callback.apply(a[0]);a.dequeue();b("div.ui-effects-explode").remove()},c.duration||500)})}})(jQuery); -(function(b){b.effects.fold=function(c){return this.queue(function(){var f=b(this),d=["position","top","left"],a=b.effects.setMode(f,c.options.mode||"hide"),e=c.options.size||15,g=!!c.options.horizFirst,i=c.duration?c.duration/2:b.fx.speeds._default/2;b.effects.save(f,d);f.show();var k=b.effects.createWrapper(f).css({overflow:"hidden"}),j=a=="show"!=g,h=j?["width","height"]:["height","width"];j=j?[k.width(),k.height()]:[k.height(),k.width()];var l=/([0-9]+)%/.exec(e);if(l)e=parseInt(l[1],10)/100* -j[a=="hide"?0:1];if(a=="show")k.css(g?{height:0,width:e}:{height:e,width:0});g={};l={};g[h[0]]=a=="show"?j[0]:e;l[h[1]]=a=="show"?j[1]:0;k.animate(g,i,c.options.easing).animate(l,i,c.options.easing,function(){a=="hide"&&f.hide();b.effects.restore(f,d);b.effects.removeWrapper(f);c.callback&&c.callback.apply(f[0],arguments);f.dequeue()})})}})(jQuery); -(function(b){b.effects.highlight=function(c){return this.queue(function(){var f=b(this),d=["backgroundImage","backgroundColor","opacity"],a=b.effects.setMode(f,c.options.mode||"show"),e={backgroundColor:f.css("backgroundColor")};if(a=="hide")e.opacity=0;b.effects.save(f,d);f.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(e,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){a=="hide"&&f.hide();b.effects.restore(f,d);a=="show"&&!b.support.opacity&& -this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);f.dequeue()}})})}})(jQuery); -(function(b){b.effects.pulsate=function(c){return this.queue(function(){var f=b(this),d=b.effects.setMode(f,c.options.mode||"show");times=(c.options.times||5)*2-1;duration=c.duration?c.duration/2:b.fx.speeds._default/2;isVisible=f.is(":visible");animateTo=0;if(!isVisible){f.css("opacity",0).show();animateTo=1}if(d=="hide"&&isVisible||d=="show"&&!isVisible)times--;for(d=0;d
              ').appendTo(document.body).addClass(c.options.className).css({top:a.top,left:a.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(d,c.duration,c.options.easing,function(){e.remove();c.callback&&c.callback.apply(f[0],arguments); -f.dequeue()})})}})(jQuery); +jQuery.ui||function(b){b.ui={version:"1.8",plugin:{add:function(c,f,d){c=b.ui[c].prototype;for(var a in d){c.plugins[a]=c.plugins[a]||[];c.plugins[a].push([f,d[a]])}},call:function(c,f,d){if((f=c.plugins[f])&&c.element[0].parentNode)for(var a=0;a0)return true;c[d]=1;a=c[d]>0;c[d]=0;return a},isOverAxis:function(c,f,d){return c>f&&c=0)&&b(c).is(":focusable")}})}(jQuery); +(function(b){var c=b.fn.remove;b.fn.remove=function(f,d){return this.each(function(){if(!d)if(!f||b.filter(f,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return c.call(b(this),f,d)})};b.widget=function(f,d,a){var e=f.split(".")[0],g;f=f.split(".")[1];g=e+"-"+f;if(!a){a=d;d=b.Widget}b.expr[":"][g]=function(i){return!!b.data(i,f)};b[e]=b[e]||{};b[e][f]=function(i,k){arguments.length&&this._createWidget(i,k)};d=new d;d.options=b.extend({},d.options);b[e][f].prototype= +b.extend(true,d,{namespace:e,widgetName:f,widgetEventPrefix:b[e][f].prototype.widgetEventPrefix||f,widgetBaseClass:g},a);b.widget.bridge(f,b[e][f])};b.widget.bridge=function(f,d){b.fn[f]=function(a){var e=typeof a==="string",g=Array.prototype.slice.call(arguments,1),i=this;a=!e&&g.length?b.extend.apply(null,[true,a].concat(g)):a;if(e&&a.substring(0,1)==="_")return i;e?this.each(function(){var k=b.data(this,f),j=k&&b.isFunction(k[a])?k[a].apply(k,g):k;if(j!==k&&j!==undefined){i=j;return false}}):this.each(function(){var k= +b.data(this,f);if(k){a&&k.option(a);k._init()}else b.data(this,f,new d(a,this))});return i}};b.Widget=function(f,d){arguments.length&&this._createWidget(f,d)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,d){this.element=b(d).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(d)[this.widgetName],f);var a=this;this.element.bind("remove."+this.widgetName,function(){a.destroy()});this._create(); +this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled")},widget:function(){return this.element},option:function(f,d){var a=f,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof f==="string"){if(d===undefined)return this.options[f];a={};a[f]=d}b.each(a, +function(g,i){e._setOption(g,i)});return e},_setOption:function(f,d){this.options[f]=d;if(f==="disabled")this.widget()[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",d);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(f,d,a){var e=this.options[f];d=b.Event(d);d.type=(f===this.widgetEventPrefix?f:this.widgetEventPrefix+f).toLowerCase(); +a=a||{};if(d.originalEvent){f=b.event.props.length;for(var g;f;){g=b.event.props[--f];d[g]=d.originalEvent[g]}}this.element.trigger(d,a);return!(b.isFunction(e)&&e.call(this.element[0],d,a)===false||d.isDefaultPrevented())}}})(jQuery); +(function(b){b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(f){return c._mouseDown(f)}).bind("click."+this.widgetName,function(f){if(c._preventClickEvent){c._preventClickEvent=false;f.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(c){c.originalEvent=c.originalEvent||{};if(!c.originalEvent.mouseHandled){this._mouseStarted&& +this._mouseUp(c);this._mouseDownEvent=c;var f=this,d=c.which==1,a=typeof this.options.cancel=="string"?b(c.target).parents().add(c.target).filter(this.options.cancel).length:false;if(!d||a||!this._mouseCapture(c))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){f.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=this._mouseStart(c)!==false;if(!this._mouseStarted){c.preventDefault(); +return true}}this._mouseMoveDelegate=function(e){return f._mouseMove(e)};this._mouseUpDelegate=function(e){return f._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.browser.safari||c.preventDefault();return c.originalEvent.mouseHandled=true}},_mouseMove:function(c){if(b.browser.msie&&!c.button)return this._mouseUp(c);if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&& +this._mouseDelayMet(c))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==false)?this._mouseDrag(c):this._mouseUp(c);return!this._mouseStarted},_mouseUp:function(c){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=c.target==this._mouseDownEvent.target;this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX- +c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +(function(b){b.ui=b.ui||{};var c=/left|center|right/,f=/top|center|bottom/,d=b.fn.position,a=b.fn.offset;b.fn.position=function(e){if(!e||!e.of)return d.apply(this,arguments);e=b.extend({},e);var g=b(e.of),i=(e.collision||"flip").split(" "),k=e.offset?e.offset.split(" "):[0,0],j,h,l;if(e.of.nodeType===9){j=g.width();h=g.height();l={top:0,left:0}}else if(e.of.scrollTo&&e.of.document){j=g.width();h=g.height();l={top:g.scrollTop(),left:g.scrollLeft()}}else if(e.of.preventDefault){e.at="left top";j=h= +0;l={top:e.of.pageY,left:e.of.pageX}}else{j=g.outerWidth();h=g.outerHeight();l=g.offset()}b.each(["my","at"],function(){var m=(e[this]||"").split(" ");if(m.length===1)m=c.test(m[0])?m.concat(["center"]):f.test(m[0])?["center"].concat(m):["center","center"];m[0]=c.test(m[0])?m[0]:"center";m[1]=f.test(m[1])?m[1]:"center";e[this]=m});if(i.length===1)i[1]=i[0];k[0]=parseInt(k[0],10)||0;if(k.length===1)k[1]=k[0];k[1]=parseInt(k[1],10)||0;if(e.at[0]==="right")l.left+=j;else if(e.at[0]==="center")l.left+= +j/2;if(e.at[1]==="bottom")l.top+=h;else if(e.at[1]==="center")l.top+=h/2;l.left+=k[0];l.top+=k[1];return this.each(function(){var m=b(this),n=m.outerWidth(),o=m.outerHeight(),p=b.extend({},l);if(e.my[0]==="right")p.left-=n;else if(e.my[0]==="center")p.left-=n/2;if(e.my[1]==="bottom")p.top-=o;else if(e.my[1]==="center")p.top-=o/2;b.each(["left","top"],function(q,r){b.ui.position[i[q]]&&b.ui.position[i[q]][r](p,{targetWidth:j,targetHeight:h,elemWidth:n,elemHeight:o,offset:k,my:e.my,at:e.at})});b.fn.bgiframe&& +m.bgiframe();m.offset(b.extend(p,{using:e.using}))})};b.ui.position={fit:{left:function(e,g){var i=b(window);i=e.left+g.elemWidth-i.width()-i.scrollLeft();e.left=i>0?e.left-i:Math.max(0,e.left)},top:function(e,g){var i=b(window);i=e.top+g.elemHeight-i.height()-i.scrollTop();e.top=i>0?e.top-i:Math.max(0,e.top)}},flip:{left:function(e,g){if(g.at[0]!=="center"){var i=b(window);i=e.left+g.elemWidth-i.width()-i.scrollLeft();var k=g.my[0]==="left"?-g.elemWidth:g.my[0]==="right"?g.elemWidth:0,j=-2*g.offset[0]; +e.left+=e.left<0?k+g.targetWidth+j:i>0?k-g.targetWidth+j:0}},top:function(e,g){if(g.at[1]!=="center"){var i=b(window);i=e.top+g.elemHeight-i.height()-i.scrollTop();var k=g.my[1]==="top"?-g.elemHeight:g.my[1]==="bottom"?g.elemHeight:0,j=g.at[1]==="top"?g.targetHeight:-g.targetHeight,h=-2*g.offset[1];e.top+=e.top<0?k+g.targetHeight+h:i>0?k+j+h:0}}}};if(!b.offset.setOffset){b.offset.setOffset=function(e,g){if(/static/.test(b.curCSS(e,"position")))e.style.position="relative";var i=b(e),k=i.offset(),j= +parseInt(b.curCSS(e,"top",true),10)||0,h=parseInt(b.curCSS(e,"left",true),10)||0;k={top:g.top-k.top+j,left:g.left-k.left+h};"using"in g?g.using.call(e,k):i.css(k)};b.fn.offset=function(e){var g=this[0];if(!g||!g.ownerDocument)return null;if(e)return this.each(function(){b.offset.setOffset(this,e)});return a.call(this)}}})(jQuery); +(function(b){b.widget("ui.draggable",b.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(c){var f= +this.options;if(this.helper||f.disabled||b(c.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(c);if(!this.handle)return false;return true},_mouseStart:function(c){var f=this.options;this.helper=this._createHelper(c);this._cacheHelperProportions();if(b.ui.ddmanager)b.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- +this.margins.top,left:this.offset.left-this.margins.left};b.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;f.cursorAt&&this._adjustOffsetFromHelper(f.cursorAt);f.containment&&this._setContainment();if(this._trigger("start",c)===false){this._clear();return false}this._cacheHelperProportions(); +b.ui.ddmanager&&!f.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(c,true);return true},_mouseDrag:function(c,f){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");if(!f){var d=this._uiHash();if(this._trigger("drag",c,d)===false){this._mouseUp({});return false}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| +this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";b.ui.ddmanager&&b.ui.ddmanager.drag(this,c);return false},_mouseStop:function(c){var f=false;if(b.ui.ddmanager&&!this.options.dropBehaviour)f=b.ui.ddmanager.drop(this,c);if(this.dropped){f=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!f||this.options.revert=="valid"&&f||this.options.revert===true||b.isFunction(this.options.revert)&&this.options.revert.call(this.element, +f)){var d=this;b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",c)!==false&&d._clear()})}else this._trigger("stop",c)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(c){var f=!this.options.handle||!b(this.options.handle,this.element).length?true:false;b(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== +c.target)f=true});return f},_createHelper:function(c){var f=this.options;c=b.isFunction(f.helper)?b(f.helper.apply(this.element[0],[c])):f.helper=="clone"?this.element.clone():this.element;c.parents("body").length||c.appendTo(f.appendTo=="parent"?this.element[0].parentNode:f.appendTo);c[0]!=this.element[0]&&!/(fixed|absolute)/.test(c.css("position"))&&c.css("position","absolute");return c},_adjustOffsetFromHelper:function(c){if(typeof c=="string")c=c.split(" ");if(b.isArray(c))c={left:+c[0],top:+c[1]|| +0};if("left"in c)this.offset.click.left=c.left+this.margins.left;if("right"in c)this.offset.click.left=this.helperProportions.width-c.right+this.margins.left;if("top"in c)this.offset.click.top=c.top+this.margins.top;if("bottom"in c)this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0], +this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)c={top:0,left:0};return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.element.position();return{top:c.top- +(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var c=this.options;if(c.containment== +"parent")c.containment=this.helper[0].parentNode;if(c.containment=="document"||c.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(c.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b(c.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(c.containment)&& +c.containment.constructor!=Array){var f=b(c.containment)[0];if(f){c=b(c.containment).offset();var d=b(f).css("overflow")!="hidden";this.containment=[c.left+(parseInt(b(f).css("borderLeftWidth"),10)||0)+(parseInt(b(f).css("paddingLeft"),10)||0)-this.margins.left,c.top+(parseInt(b(f).css("borderTopWidth"),10)||0)+(parseInt(b(f).css("paddingTop"),10)||0)-this.margins.top,c.left+(d?Math.max(f.scrollWidth,f.offsetWidth):f.offsetWidth)-(parseInt(b(f).css("borderLeftWidth"),10)||0)-(parseInt(b(f).css("paddingRight"), +10)||0)-this.helperProportions.width-this.margins.left,c.top+(d?Math.max(f.scrollHeight,f.offsetHeight):f.offsetHeight)-(parseInt(b(f).css("borderTopWidth"),10)||0)-(parseInt(b(f).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(c.containment.constructor==Array)this.containment=c.containment},_convertPositionTo:function(c,f){if(!f)f=this.position;var d=c=="absolute"?1:-1,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0], +this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(a[0].tagName);return{top:f.top+this.offset.relative.top*d+this.offset.parent.top*d-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:a.scrollTop())*d),left:f.left+this.offset.relative.left*d+this.offset.parent.left*d-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft(): +e?0:a.scrollLeft())*d)}},_generatePosition:function(c){var f=this.options,d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,a=/(html|body)/i.test(d[0].tagName),e=c.pageX,g=c.pageY;if(this.originalPosition){if(this.containment){if(c.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(c.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(f.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/f.grid[1])*f.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left
              ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(b(this).offset()).appendTo("body")})},stop:function(){b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});b.ui.plugin.add("draggable","opacity",{start:function(c,f){var d=b(f.helper), +a=b(this).data("draggable").options;if(d.css("opacity"))a._opacity=d.css("opacity");d.css("opacity",a.opacity)},stop:function(c,f){var d=b(this).data("draggable").options;d._opacity&&b(f.helper).css("opacity",d._opacity)}});b.ui.plugin.add("draggable","scroll",{start:function(){var c=b(this).data("draggable");if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML")c.overflowOffset=c.scrollParent.offset()},drag:function(c){var f=b(this).data("draggable"),d=f.options,a=false;if(f.scrollParent[0]!= +document&&f.scrollParent[0].tagName!="HTML"){if(!d.axis||d.axis!="x")if(f.overflowOffset.top+f.scrollParent[0].offsetHeight-c.pageY=0;h--){var l=d.snapElements[h].left,m=l+d.snapElements[h].width,n=d.snapElements[h].top,o=n+d.snapElements[h].height;if(l-e=h&&g<=l||i>=h&&i<=l||gl)&&(a>=k&&a<=j||e>=k&&e<=j||aj);default:return false}}; +b.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(c,f){var d=b.ui.ddmanager.droppables[c.options.scope]||[],a=f?f.type:null,e=(c.currentItem||c.element).find(":data(droppable)").andSelf(),g=0;a:for(;g
              ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!b(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var e=this.handles.split(",");this.handles={};for(var g=0;g
              ');/sw|se|ne|nw/.test(i)&&k.css({zIndex:++a.zIndex});"se"==i&&k.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[i]=".ui-resizable-"+i;this.element.append(k)}}this._renderAxis=function(j){j=j||this.element;for(var h in this.handles){if(this.handles[h].constructor== +String)this.handles[h]=b(this.handles[h],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var l=b(this.handles[h],this.element),m=0;m=/sw|ne|nw|se|n|s/.test(h)?l.outerHeight():l.outerWidth();l=["padding",/ne|nw|n/.test(h)?"Top":/se|sw|s/.test(h)?"Bottom":/^e$/.test(h)?"Right":"Left"].join("");j.css(l,m);this._proportionallyResize()}b(this.handles[h])}};this._renderAxis(this.element);this._handles=b(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!d.resizing){if(this.className)var j=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);d.axis=j&&j[1]?j[1]:"se"}});if(a.autoHide){this._handles.hide();b(this.element).addClass("ui-resizable-autohide").hover(function(){b(this).removeClass("ui-resizable-autohide");d._handles.show()},function(){if(!d.resizing){b(this).addClass("ui-resizable-autohide");d._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(e){b(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; +if(this.elementIsWrapper){d(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement);return this},_mouseCapture:function(d){var a=false,e;for(e in this.handles)if(b(this.handles[e])[0]==d.target)a=true;return!this.options.disabled&&a},_mouseStart:function(d){var a=this.options,e=this.element.position(), +g=this.element;this.resizing=true;this.documentScroll={top:b(document).scrollTop(),left:b(document).scrollLeft()};if(g.is(".ui-draggable")||/absolute/.test(g.css("position")))g.css({position:"absolute",top:e.top,left:e.left});b.browser.opera&&/relative/.test(g.css("position"))&&g.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();e=c(this.helper.css("left"));var i=c(this.helper.css("top"));if(a.containment){e+=b(a.containment).scrollLeft()||0;i+=b(a.containment).scrollTop()||0}this.offset= +this.helper.offset();this.position={left:e,top:i};this.size=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()};this.originalSize=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()};this.originalPosition={left:e,top:i};this.sizeDiff={width:g.outerWidth()-g.width(),height:g.outerHeight()-g.height()};this.originalMousePosition={left:d.pageX,top:d.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: +this.originalSize.width/this.originalSize.height||1;a=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",a=="auto"?this.axis+"-resize":a);g.addClass("ui-resizable-resizing");this._propagate("start",d);return true},_mouseDrag:function(d){var a=this.helper,e=this.originalMousePosition,g=this._change[this.axis];if(!g)return false;e=g.apply(this,[d,d.pageX-e.left||0,d.pageY-e.top||0]);if(this._aspectRatio||d.shiftKey)e=this._updateRatio(e,d);e=this._respectSize(e,d);this._propagate("resize", +d);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(e);this._trigger("resize",d,this.ui());return false},_mouseStop:function(d){this.resizing=false;var a=this.options;if(this._helper){var e=this._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName);e=g&&b.ui.hasScroll(e[0],"left")?0:this.sizeDiff.height; +g={width:this.size.width-(g?0:this.sizeDiff.width),height:this.size.height-e};e=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null;var i=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;a.animate||this.element.css(b.extend(g,{top:i,left:e}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!a.animate&&this._proportionallyResize()}b("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing"); +this._propagate("stop",d);this._helper&&this.helper.remove();return false},_updateCache:function(d){this.offset=this.helper.offset();if(f(d.left))this.position.left=d.left;if(f(d.top))this.position.top=d.top;if(f(d.height))this.size.height=d.height;if(f(d.width))this.size.width=d.width},_updateRatio:function(d){var a=this.position,e=this.size,g=this.axis;if(d.height)d.width=e.height*this.aspectRatio;else if(d.width)d.height=e.width/this.aspectRatio;if(g=="sw"){d.left=a.left+(e.width-d.width);d.top= +null}if(g=="nw"){d.top=a.top+(e.height-d.height);d.left=a.left+(e.width-d.width)}return d},_respectSize:function(d){var a=this.options,e=this.axis,g=f(d.width)&&a.maxWidth&&a.maxWidthd.width,j=f(d.height)&&a.minHeight&&a.minHeight>d.height;if(k)d.width=a.minWidth;if(j)d.height=a.minHeight;if(g)d.width=a.maxWidth;if(i)d.height=a.maxHeight;var h=this.originalPosition.left+this.originalSize.width,l=this.position.top+ +this.size.height,m=/sw|nw|w/.test(e);e=/nw|ne|n/.test(e);if(k&&m)d.left=h-a.minWidth;if(g&&m)d.left=h-a.maxWidth;if(j&&e)d.top=l-a.minHeight;if(i&&e)d.top=l-a.maxHeight;if((a=!d.width&&!d.height)&&!d.left&&d.top)d.top=null;else if(a&&!d.top&&d.left)d.left=null;return d},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var d=this.helper||this.element,a=0;a
              ');var a=b.browser.msie&&b.browser.version<7,e=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++d.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(d, +a){return{width:this.originalSize.width+a}},w:function(d,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(d,a,e){return{top:this.originalPosition.top+e,height:this.originalSize.height-e}},s:function(d,a,e){return{height:this.originalSize.height+e}},se:function(d,a,e){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[d,a,e]))},sw:function(d,a,e){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[d,a, +e]))},ne:function(d,a,e){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[d,a,e]))},nw:function(d,a,e){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[d,a,e]))}},_propagate:function(d,a){b.ui.plugin.call(this,d,[a,this.ui()]);d!="resize"&&this._trigger(d,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize, +originalPosition:this.originalPosition}}});b.extend(b.ui.resizable,{version:"1.8"});b.ui.plugin.add("resizable","alsoResize",{start:function(){var d=b(this).data("resizable").options,a=function(e){b(e).each(function(){b(this).data("resizable-alsoresize",{width:parseInt(b(this).width(),10),height:parseInt(b(this).height(),10),left:parseInt(b(this).css("left"),10),top:parseInt(b(this).css("top"),10)})})};if(typeof d.alsoResize=="object"&&!d.alsoResize.parentNode)if(d.alsoResize.length){d.alsoResize= +d.alsoResize[0];a(d.alsoResize)}else b.each(d.alsoResize,function(e){a(e)});else a(d.alsoResize)},resize:function(){var d=b(this).data("resizable"),a=d.options,e=d.originalSize,g=d.originalPosition,i={height:d.size.height-e.height||0,width:d.size.width-e.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},k=function(j,h){b(j).each(function(){var l=b(this),m=b(this).data("resizable-alsoresize"),n={};b.each((h&&h.length?h:["width","height","top","left"])||["width","height","top","left"], +function(o,p){var q=(m[p]||0)+(i[p]||0);if(q&&q>=0)n[p]=q||null});if(/relative/.test(l.css("position"))&&b.browser.opera){d._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(n)})};typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?b.each(a.alsoResize,function(j,h){k(j,h)}):k(a.alsoResize)},stop:function(){var d=b(this).data("resizable");if(d._revertToRelativePosition&&b.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}b(this).removeData("resizable-alsoresize-start")}}); +b.ui.plugin.add("resizable","animate",{stop:function(d){var a=b(this).data("resizable"),e=a.options,g=a._proportionallyResizeElements,i=g.length&&/textarea/i.test(g[0].nodeName),k=i&&b.ui.hasScroll(g[0],"left")?0:a.sizeDiff.height;i={width:a.size.width-(i?0:a.sizeDiff.width),height:a.size.height-k};k=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var j=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(b.extend(i,j&& +k?{top:j,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var h={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};g&&g.length&&b(g[0]).css({width:h.width,height:h.height});a._updateCache(h);a._propagate("resize",d)}})}});b.ui.plugin.add("resizable","containment",{start:function(){var d=b(this).data("resizable"),a=d.element,e=d.options.containment;if(a=e instanceof +b?e.get(0):/parent/.test(e)?a.parent().get(0):e){d.containerElement=b(a);if(/document/.test(e)||e==document){d.containerOffset={left:0,top:0};d.containerPosition={left:0,top:0};d.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{var g=b(a),i=[];b(["Top","Right","Left","Bottom"]).each(function(h,l){i[h]=c(g.css("padding"+l))});d.containerOffset=g.offset();d.containerPosition=g.position();d.containerSize={height:g.innerHeight()- +i[3],width:g.innerWidth()-i[1]};e=d.containerOffset;var k=d.containerSize.height,j=d.containerSize.width;j=b.ui.hasScroll(a,"left")?a.scrollWidth:j;k=b.ui.hasScroll(a)?a.scrollHeight:k;d.parentData={element:a,left:e.left,top:e.top,width:j,height:k}}}},resize:function(d){var a=b(this).data("resizable"),e=a.options,g=a.containerOffset,i=a.position;d=a._aspectRatio||d.shiftKey;var k={top:0,left:0},j=a.containerElement;if(j[0]!=document&&/static/.test(j.css("position")))k=g;if(i.left<(a._helper?g.left: +0)){a.size.width+=a._helper?a.position.left-g.left:a.position.left-k.left;if(d)a.size.height=a.size.width/e.aspectRatio;a.position.left=e.helper?g.left:0}if(i.top<(a._helper?g.top:0)){a.size.height+=a._helper?a.position.top-g.top:a.position.top;if(d)a.size.width=a.size.height*e.aspectRatio;a.position.top=a._helper?g.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;e=Math.abs((a._helper?a.offset.left-k.left:a.offset.left-k.left)+a.sizeDiff.width);g= +Math.abs((a._helper?a.offset.top-k.top:a.offset.top-g.top)+a.sizeDiff.height);i=a.containerElement.get(0)==a.element.parent().get(0);k=/relative|absolute/.test(a.containerElement.css("position"));if(i&&k)e-=a.parentData.left;if(e+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-e;if(d)a.size.height=a.size.width/a.aspectRatio}if(g+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-g;if(d)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var d=b(this).data("resizable"), +a=d.options,e=d.containerOffset,g=d.containerPosition,i=d.containerElement,k=b(d.helper),j=k.offset(),h=k.outerWidth()-d.sizeDiff.width;k=k.outerHeight()-d.sizeDiff.height;d._helper&&!a.animate&&/relative/.test(i.css("position"))&&b(this).css({left:j.left-g.left-e.left,width:h,height:k});d._helper&&!a.animate&&/static/.test(i.css("position"))&&b(this).css({left:j.left-g.left-e.left,width:h,height:k})}});b.ui.plugin.add("resizable","ghost",{start:function(){var d=b(this).data("resizable"),a=d.options, +e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");d.ghost.appendTo(d.helper)},resize:function(){var d=b(this).data("resizable");d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(){var d=b(this).data("resizable");d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}); +b.ui.plugin.add("resizable","grid",{resize:function(){var d=b(this).data("resizable"),a=d.options,e=d.size,g=d.originalSize,i=d.originalPosition,k=d.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var j=Math.round((e.width-g.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((e.height-g.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(k)){d.size.width=g.width+j;d.size.height=g.height+a}else if(/^(ne)$/.test(k)){d.size.width=g.width+j;d.size.height=g.height+a;d.position.top=i.top- +a}else{if(/^(sw)$/.test(k)){d.size.width=g.width+j;d.size.height=g.height+a}else{d.size.width=g.width+j;d.size.height=g.height+a;d.position.top=i.top-a}d.position.left=i.left-j}}});var c=function(d){return parseInt(d,10)||0},f=function(d){return!isNaN(parseInt(d,10))}})(jQuery); +(function(b){b.widget("ui.selectable",b.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=b(c.options.filter,c.element[0]);f.each(function(){var d=b(this),a=d.offset();b.data(this,"selectable-item",{element:this,$element:d,left:a.left,top:a.top,right:a.left+d.outerWidth(),bottom:a.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), +selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=b(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this}, +_mouseStart:function(c){var f=this;this.opos=[c.pageX,c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=b(d.filter,this.element[0]);this._trigger("start",c);b(d.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var a=b.data(this,"selectable-item");a.startselected=true;if(!c.metaKey){a.$element.removeClass("ui-selected"); +a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}});b(c.target).parents().andSelf().each(function(){var a=b.data(this,"selectable-item");if(a){a.$element.removeClass("ui-unselecting").addClass("ui-selecting");a.unselecting=false;a.selecting=true;a.selected=true;f._trigger("selecting",c,{selecting:a.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=this.options, +a=this.opos[0],e=this.opos[1],g=c.pageX,i=c.pageY;if(a>g){var k=g;g=a;a=k}if(e>i){k=i;i=e;e=k}this.helper.css({left:a,top:e,width:g-a,height:i-e});this.selectees.each(function(){var j=b.data(this,"selectable-item");if(!(!j||j.element==f.element[0])){var h=false;if(d.tolerance=="touch")h=!(j.left>g||j.righti||j.bottoma&&j.righte&&j.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var c=this.items.length-1;c>=0;c--)this.items[c].item.removeData("sortable-item");return this},_mouseCapture:function(c,f){if(this.reverting)return false;if(this.options.disabled||this.options.type== +"static")return false;this._refreshItems(c);var d=null,a=this;b(c.target).parents().each(function(){if(b.data(this,"sortable-item")==a){d=b(this);return false}});if(b.data(c.target,"sortable-item")==a)d=b(c.target);if(!d)return false;if(this.options.handle&&!f){var e=false;b(this.options.handle,d).find("*").andSelf().each(function(){if(this==c.target)e=true});if(!e)return false}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(c,f,d){f=this.options;this.currentContainer= +this;this.refreshPositions();this.helper=this._createHelper(c);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");b.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); +this.originalPosition=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;f.cursorAt&&this._adjustOffsetFromHelper(f.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();f.containment&&this._setContainment();if(f.cursor){if(b("body").css("cursor"))this._storedCursor=b("body").css("cursor");b("body").css("cursor",f.cursor)}if(f.opacity){if(this.helper.css("opacity"))this._storedOpacity= +this.helper.css("opacity");this.helper.css("opacity",f.opacity)}if(f.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",f.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",c,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(d=this.containers.length-1;d>=0;d--)this.containers[d]._trigger("activate",c,this._uiHash(this)); +if(b.ui.ddmanager)b.ui.ddmanager.current=this;b.ui.ddmanager&&!f.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(c);return true},_mouseDrag:function(c){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var f=this.options,d=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!= +"HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-c.pageY=0;f--){d=this.items[f];var a= +d.item[0],e=this._intersectsWithPointer(d);if(e)if(a!=this.currentItem[0]&&this.placeholder[e==1?"next":"prev"]()[0]!=a&&!b.ui.contains(this.placeholder[0],a)&&(this.options.type=="semi-dynamic"?!b.ui.contains(this.element[0],a):true)){this.direction=e==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(d))this._rearrange(c,d);else break;this._trigger("change",c,this._uiHash());break}}this._contactContainers(c);b.ui.ddmanager&&b.ui.ddmanager.drag(this,c);this._trigger("sort", +c,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,f){if(c){b.ui.ddmanager&&!this.options.dropBehaviour&&b.ui.ddmanager.drop(this,c);if(this.options.revert){var d=this,a=d.placeholder.offset();d.reverting=true;b(this.helper).animate({left:a.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:a.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)}, +parseInt(this.options.revert,10)||500,function(){d._clear(c)})}else this._clear(c,f);return false}},cancel:function(){if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,this._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,this._uiHash(this));this.containers[c].containerCache.over= +0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();b.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?b(this.domPosition.prev).after(this.currentItem):b(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(c){var f=this._getItemsAsjQuery(c&&c.connected),d=[];c=c||{};b(f).each(function(){var a= +(b(c.item||this).attr(c.attribute||"id")||"").match(c.expression||/(.+)[-=_](.+)/);if(a)d.push((c.key||a[1]+"[]")+"="+(c.key&&c.expression?a[1]:a[2]))});return d.join("&")},toArray:function(c){var f=this._getItemsAsjQuery(c&&c.connected),d=[];c=c||{};f.each(function(){d.push(b(c.item||this).attr(c.attribute||"id")||"")});return d},_intersectsWith:function(c){var f=this.positionAbs.left,d=f+this.helperProportions.width,a=this.positionAbs.top,e=a+this.helperProportions.height,g=c.left,i=g+c.width,k= +c.top,j=k+c.height,h=this.offset.click.top,l=this.offset.click.left;h=a+h>k&&a+hg&&f+lc[this.floating?"width":"height"]?h:g0?"down":"up")},_getDragHorizontalDirection:function(){var c=this.positionAbs.left-this.lastPositionAbs.left;return c!=0&&(c>0?"right":"left")},refresh:function(c){this._refreshItems(c);this.refreshPositions();return this},_connectWith:function(){var c= +this.options;return c.connectWith.constructor==String?[c.connectWith]:c.connectWith},_getItemsAsjQuery:function(c){var f=[],d=[],a=this._connectWith();if(a&&c)for(c=a.length-1;c>=0;c--)for(var e=b(a[c]),g=e.length-1;g>=0;g--){var i=b.data(e[g],"sortable");if(i&&i!=this&&!i.options.disabled)d.push([b.isFunction(i.options.items)?i.options.items.call(i.element):b(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i])}d.push([b.isFunction(this.options.items)?this.options.items.call(this.element, +null,{options:this.options,item:this.currentItem}):b(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(c=d.length-1;c>=0;c--)d[c][0].each(function(){f.push(this)});return b(f)},_removeCurrentsFromItems:function(){for(var c=this.currentItem.find(":data(sortable-item)"),f=0;f=0;e--)for(var g=b(a[e]),i=g.length-1;i>=0;i--){var k=b.data(g[i],"sortable");if(k&&k!=this&&!k.options.disabled){d.push([b.isFunction(k.options.items)?k.options.items.call(k.element[0],c,{item:this.currentItem}):b(k.options.items,k.element),k]);this.containers.push(k)}}for(e=d.length-1;e>=0;e--){c=d[e][1]; +a=d[e][0];i=0;for(g=a.length;i=0;f--){var d=this.items[f],a=this.options.toleranceElement?b(this.options.toleranceElement,d.item):d.item;if(!c){d.width=a.outerWidth();d.height=a.outerHeight()}a=a.offset();d.left=a.left;d.top=a.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this); +else for(f=this.containers.length-1;f>=0;f--){a=this.containers[f].element.offset();this.containers[f].containerCache.left=a.left;this.containers[f].containerCache.top=a.top;this.containers[f].containerCache.width=this.containers[f].element.outerWidth();this.containers[f].containerCache.height=this.containers[f].element.outerHeight()}return this},_createPlaceholder:function(c){var f=c||this,d=f.options;if(!d.placeholder||d.placeholder.constructor==String){var a=d.placeholder;d.placeholder={element:function(){var e= +b(document.createElement(f.currentItem[0].nodeName)).addClass(a||f.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!a)e.style.visibility="hidden";return e},update:function(e,g){if(!(a&&!d.forcePlaceholderSize)){g.height()||g.height(f.currentItem.innerHeight()-parseInt(f.currentItem.css("paddingTop")||0,10)-parseInt(f.currentItem.css("paddingBottom")||0,10));g.width()||g.width(f.currentItem.innerWidth()-parseInt(f.currentItem.css("paddingLeft")||0,10)-parseInt(f.currentItem.css("paddingRight")|| +0,10))}}}}f.placeholder=b(d.placeholder.element.call(f.element,f.currentItem));f.currentItem.after(f.placeholder);d.placeholder.update(f,f.placeholder)},_contactContainers:function(c){for(var f=null,d=null,a=this.containers.length-1;a>=0;a--)if(!b.ui.contains(this.currentItem[0],this.containers[a].element[0]))if(this._intersectsWith(this.containers[a].containerCache)){if(!(f&&b.ui.contains(this.containers[a].element[0],f.element[0]))){f=this.containers[a];d=a}}else if(this.containers[a].containerCache.over){this.containers[a]._trigger("out", +c,this._uiHash(this));this.containers[a].containerCache.over=0}if(f)if(this.containers.length===1){this.containers[d]._trigger("over",c,this._uiHash(this));this.containers[d].containerCache.over=1}else if(this.currentContainer!=this.containers[d]){f=1E4;a=null;for(var e=this.positionAbs[this.containers[d].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(b.ui.contains(this.containers[d].element[0],this.items[g].item[0])){var i=this.items[g][this.containers[d].floating?"left":"top"];if(Math.abs(i- +e)this.containment[2])e=this.containment[2]+this.offset.click.left;if(c.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(f.grid){g=this.originalPageY+Math.round((g- +this.originalPageY)/f.grid[1])*f.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left=0;a--)if(b.ui.contains(this.containers[a].element[0],this.currentItem[0])&&!f){d.push(function(e){return function(g){e._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[a]));d.push(function(e){return function(g){e._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[a]))}}for(a=this.containers.length-1;a>=0;a--){f||d.push(function(e){return function(g){e._trigger("deactivate",g,this._uiHash(this))}}.call(this, +this.containers[a]));if(this.containers[a].containerCache.over){d.push(function(e){return function(g){e._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[a]));this.containers[a].containerCache.over=0}}this._storedCursor&&b("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!f){this._trigger("beforeStop", +c,this._uiHash());for(a=0;a li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},_create:function(){var c=this.options,f=this;this.running=0;this.element.addClass("ui-accordion ui-widget ui-helper-reset"); +this.element[0].nodeName=="UL"&&this.element.children("li").addClass("ui-accordion-li-fix");this.headers=this.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b(this).removeClass("ui-state-focus")}); +this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=this.element.find("a").filter(c.navigationFilter);if(d.length){var a=d.closest(".ui-accordion-header");this.active=a.length?a:d.closest(".ui-accordion-content").prev()}}this.active=this._findActive(this.active||c.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active"); +this._createIcons();b.browser.msie&&this.element.find("a").css("zoom","1");this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return f._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();this.active.length?this.active.attr("aria-expanded","true").attr("tabIndex","0"):this.headers.eq(0).attr("tabIndex","0");b.browser.safari||this.headers.find("a").attr("tabIndex", +"-1");c.event&&this.headers.bind(c.event+".accordion",function(e){f._clickHandler.call(f,e,this);e.preventDefault()})},_createIcons:function(){var c=this.options;if(c.icons){b("").addClass("ui-icon "+c.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(c.icons.header).toggleClass(c.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")}, +destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this._destroyIcons();var f=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active"); +if(c.autoHeight||c.fillHeight)f.css("height","");return this},_setOption:function(c,f){b.Widget.prototype._setOption.apply(this,arguments);c=="active"&&this.activate(f);if(c=="icons"){this._destroyIcons();f&&this._createIcons()}},_keydown:function(c){var f=b.ui.keyCode;if(!(this.options.disabled||c.altKey||c.ctrlKey)){var d=this.headers.length,a=this.headers.index(c.target),e=false;switch(c.keyCode){case f.RIGHT:case f.DOWN:e=this.headers[(a+1)%d];break;case f.LEFT:case f.UP:e=this.headers[(a-1+d)% +d];break;case f.SPACE:case f.ENTER:this._clickHandler({target:c.target},c.target);c.preventDefault()}if(e){b(c.target).attr("tabIndex","-1");b(e).attr("tabIndex","0");e.focus();return false}return true}},resize:function(){var c=this.options,f;if(c.fillSpace){if(b.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}f=this.element.parent().height();b.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){f-=b(this).outerHeight(true)}); +this.headers.next().each(function(){b(this).height(Math.max(0,f-b(this).innerHeight()+b(this).height()))}).css("overflow","auto")}else if(c.autoHeight){f=0;this.headers.next().each(function(){f=Math.max(f,b(this).height())}).height(f)}return this},activate:function(c){this.options.active=c;c=this._findActive(c)[0];this._clickHandler({target:c},c);return this},_findActive:function(c){return c?typeof c=="number"?this.headers.filter(":eq("+c+")"):this.headers.not(this.headers.not(c)):c===false?b([]): +this.headers.filter(":eq(0)")},_clickHandler:function(c,f){var d=this.options;if(!d.disabled)if(c.target){var a=b(c.currentTarget||f),e=a[0]==this.active[0];d.active=d.collapsible&&e?false:b(".ui-accordion-header",this.element).index(a);if(!(this.running||!d.collapsible&&e)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!e){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); +a.next().addClass("ui-accordion-content-active")}k=a.next();g=this.active.next();i={options:d,newHeader:e&&d.collapsible?b([]):a,oldHeader:this.active,newContent:e&&d.collapsible?b([]):k,oldContent:g};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=e?b([]):a;this._toggle(k,g,i,e,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); +this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),i={options:d,newHeader:b([]),oldHeader:d.active,newContent:b([]),oldContent:g},k=this.active=b([]);this._toggle(k,g,i)}},_toggle:function(c,f,d,a,e){var g=this.options,i=this;this.toShow=c;this.toHide=f;this.data=d;var k=function(){if(i)return i._completed.apply(i,arguments)};this._trigger("changestart",null,this.data);this.running=f.size()===0?c.size():f.size();if(g.animated){d={};d=g.collapsible&&a?{toShow:b([]), +toHide:f,complete:k,down:e,autoHeight:g.autoHeight||g.fillSpace}:{toShow:c,toHide:f,complete:k,down:e,autoHeight:g.autoHeight||g.fillSpace};if(!g.proxied)g.proxied=g.animated;if(!g.proxiedDuration)g.proxiedDuration=g.duration;g.animated=b.isFunction(g.proxied)?g.proxied(d):g.proxied;g.duration=b.isFunction(g.proxiedDuration)?g.proxiedDuration(d):g.proxiedDuration;a=b.ui.accordion.animations;var j=g.duration,h=g.animated;if(h&&!a[h]&&!b.easing[h])h="slide";a[h]||(a[h]=function(l){this.slide(l,{easing:h, +duration:j||700})});a[h](d)}else{if(g.collapsible&&a)c.toggle();else{f.hide();c.show()}k(true)}f.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();c.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(c){var f=this.options;this.running=c?0:--this.running;if(!this.running){f.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});b.extend(b.ui.accordion, +{version:"1.8",animations:{slide:function(c,f){c=b.extend({easing:"swing",duration:300},c,f);if(c.toHide.size())if(c.toShow.size()){var d=c.toShow.css("overflow"),a=0,e={},g={},i,k=c.toShow;i=k[0].style.width;k.width(parseInt(k.parent().width(),10)-parseInt(k.css("paddingLeft"),10)-parseInt(k.css("paddingRight"),10)-(parseInt(k.css("borderLeftWidth"),10)||0)-(parseInt(k.css("borderRightWidth"),10)||0));b.each(["height","paddingTop","paddingBottom"],function(j,h){g[h]="hide";var l=(""+b.css(c.toShow[0], +h)).match(/^([\d+-.]+)(.*)$/);e[h]={value:l[1],unit:l[2]||"px"}});c.toShow.css({height:0,overflow:"hidden"}).show();c.toHide.filter(":hidden").each(c.complete).end().filter(":visible").animate(g,{step:function(j,h){if(h.prop=="height")a=h.end-h.start===0?0:(h.now-h.start)/(h.end-h.start);c.toShow[0].style[h.prop]=a*e[h.prop].value+e[h.prop].unit},duration:c.duration,easing:c.easing,complete:function(){c.autoHeight||c.toShow.css("height","");c.toShow.css("width",i);c.toShow.css({overflow:d});c.complete()}})}else c.toHide.animate({height:"hide"}, +c);else c.toShow.animate({height:"show"},c)},bounceslide:function(c){this.slide(c,{easing:c.down?"easeOutBounce":"swing",duration:c.down?1E3:200})}}})})(jQuery); +(function(b){b.widget("ui.autocomplete",{options:{minLength:1,delay:300},_create:function(){var c=this,f=this.element[0].ownerDocument;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(d){var a=b.ui.keyCode;switch(d.keyCode){case a.PAGE_UP:c._move("previousPage",d);break;case a.PAGE_DOWN:c._move("nextPage",d);break;case a.UP:c._move("previous",d);d.preventDefault(); +break;case a.DOWN:c._move("next",d);d.preventDefault();break;case a.ENTER:c.menu.active&&d.preventDefault();case a.TAB:if(!c.menu.active)break;c.menu.select();break;case a.ESCAPE:c.element.val(c.term);c.close(d);break;case a.SHIFT:case a.CONTROL:case 18:break;default:clearTimeout(c.searching);c.searching=setTimeout(function(){c.search(null,d)},c.options.delay)}}).bind("focus.autocomplete",function(){c.previous=c.element.val()}).bind("blur.autocomplete",function(d){clearTimeout(c.searching);c.closing= +setTimeout(function(){c.close(d)},150)});this._initSource();this.response=function(){return c._response.apply(c,arguments)};this.menu=b("
                ").addClass("ui-autocomplete").appendTo("body",f).menu({focus:function(d,a){var e=a.item.data("item.autocomplete");false!==c._trigger("focus",null,{item:e})&&c.element.val(e.value)},selected:function(d,a){var e=a.item.data("item.autocomplete");false!==c._trigger("select",d,{item:e})&&c.element.val(e.value);c.close(d);c.previous=c.element.val();c.element[0]!== +f.activeElement&&c.element.focus()},blur:function(){c.menu.element.is(":visible")&&c.element.val(c.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");b.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input ui-widget ui-widget-content").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();b.Widget.prototype.destroy.call(this)},_setOption:function(c){b.Widget.prototype._setOption.apply(this, +arguments);c==="source"&&this._initSource()},_initSource:function(){var c,f;if(b.isArray(this.options.source)){c=this.options.source;this.source=function(d,a){var e=RegExp(b.ui.autocomplete.escapeRegex(d.term),"i");a(b.grep(c,function(g){return e.test(g.label||g.value||g)}))}}else if(typeof this.options.source==="string"){f=this.options.source;this.source=function(d,a){b.getJSON(f,d,a)}}else this.source=this.options.source},search:function(c,f){c=c!=null?c:this.element.val();if(c.length").data("item.autocomplete",f).append(""+f.label+"").appendTo(c)},_move:function(c,f){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(c)||this.menu.last()&&/^next/.test(c)){this.element.val(this.term);this.menu.deactivate()}else this.menu[c](); +else this.search(null,f)},widget:function(){return this.menu.element}});b.extend(b.ui.autocomplete,{escapeRegex:function(c){return c.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")}})})(jQuery); +(function(b){b.widget("ui.menu",{_create:function(){var c=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(f){f.preventDefault();c.select()});this.refresh()},refresh:function(){var c=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(){c.activate(b(this).parent())}).mouseleave(function(){c.deactivate()})}, +activate:function(c){this.deactivate();if(this.hasScroll()){var f=c.offset().top-this.element.offset().top,d=this.element.attr("scrollTop"),a=this.element.height();if(f<0)this.element.attr("scrollTop",d+f);else f>a&&this.element.attr("scrollTop",d+f-a+c.height())}this.active=c.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",null,{item:c})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); +this._trigger("blur");this.active=null}},next:function(){this.move("next","li:first")},previous:function(){this.move("prev","li:last")},first:function(){return this.active&&!this.active.prev().length},last:function(){return this.active&&!this.active.next().length},move:function(c,f){if(this.active){var d=this.active[c]();d.length?this.activate(d):this.activate(this.element.children(f))}else this.activate(this.element.children(f))},nextPage:function(){if(this.hasScroll())if(!this.active||this.last())this.activate(this.element.children(":first")); +else{var c=this.active.offset().top,f=this.element.height(),d=this.element.children("li").filter(function(){var a=b(this).offset().top-c-f+b(this).height();return a<10&&a>-10});d.length||(d=this.element.children(":last"));this.activate(d)}else this.activate(this.element.children(!this.active||this.last()?":first":":last"))},previousPage:function(){if(this.hasScroll())if(!this.active||this.first())this.activate(this.element.children(":last"));else{var c=this.active.offset().top,f=this.element.height(); +result=this.element.children("li").filter(function(){var d=b(this).offset().top-c+f-b(this).height();return d<10&&d>-10});result.length||(result=this.element.children(":first"));this.activate(result)}else this.activate(this.element.children(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()
                ").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(), +g=this.options.icons,i=g.primary&&g.secondary;if(g.primary||g.secondary){a.addClass("ui-button-text-icon"+(i?"s":""));g.primary&&a.prepend("");g.secondary&&a.append("");if(!this.options.text){a.addClass(i?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon");this.hasTitle||a.attr("title",e)}}else a.addClass("ui-button-text-only")}}}); +b.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(a,e){a==="disabled"&&this.buttons.button("option",a,e);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, +destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");b.Widget.prototype.destroy.call(this)}})})(jQuery); +(function(b){b.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");var c=this,f=c.options,d=f.title||c.originalTitle||" ",a=b.ui.dialog.getTitleId(c.element),e=(c.uiDialog=b("
                ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ +f.dialogClass).css({zIndex:f.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(k){if(f.closeOnEscape&&k.keyCode&&k.keyCode===b.ui.keyCode.ESCAPE){c.close(k);k.preventDefault()}}).attr({role:"dialog","aria-labelledby":a}).mousedown(function(k){c.moveToTop(false,k)});c.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(e);var g=(c.uiDialogTitlebar=b("
                ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(e), +i=b('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).click(function(k){c.close(k);return false}).appendTo(g);(c.uiDialogTitlebarCloseText=b("")).addClass("ui-icon ui-icon-closethick").text(f.closeText).appendTo(i);b("").addClass("ui-dialog-title").attr("id", +a).html(d).prependTo(g);if(b.isFunction(f.beforeclose)&&!b.isFunction(f.beforeClose))f.beforeClose=f.beforeclose;g.find("*").add(g).disableSelection();f.draggable&&b.fn.draggable&&c._makeDraggable();f.resizable&&b.fn.resizable&&c._makeResizable();c._createButtons(f.buttons);c._isOpen=false;b.fn.bgiframe&&e.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){this.overlay&&this.overlay.destroy();this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); +this.uiDialog.remove();this.originalTitle&&this.element.attr("title",this.originalTitle);return this},widget:function(){return this.uiDialog},close:function(c){var f=this,d;if(false!==f._trigger("beforeClose",c)){f.overlay&&f.overlay.destroy();f.uiDialog.unbind("keypress.ui-dialog");f._isOpen=false;if(f.options.hide)f.uiDialog.hide(f.options.hide,function(){f._trigger("close",c)});else{f.uiDialog.hide();f._trigger("close",c)}b.ui.dialog.overlay.resize();if(f.options.modal){d=0;b(".ui-dialog").each(function(){if(this!== +f.uiDialog[0])d=Math.max(d,b(this).css("z-index"))});b.ui.dialog.maxZ=d}return f}},isOpen:function(){return this._isOpen},moveToTop:function(c,f){var d=this.options;if(d.modal&&!c||!d.stack&&!d.modal)return this._trigger("focus",f);if(d.zIndex>b.ui.dialog.maxZ)b.ui.dialog.maxZ=d.zIndex;if(this.overlay){b.ui.dialog.maxZ+=1;this.overlay.$el.css("z-index",b.ui.dialog.overlay.maxZ=b.ui.dialog.maxZ)}d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};b.ui.dialog.maxZ+= +1;this.uiDialog.css("z-index",b.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",f);return this},open:function(){if(!this._isOpen){var c=this.options,f=this.uiDialog;this.overlay=c.modal?new b.ui.dialog.overlay(this):null;f.next().length&&f.appendTo("body");this._size();this._position(c.position);f.show(c.show);this.moveToTop(true);c.modal&&f.bind("keypress.ui-dialog",function(d){if(d.keyCode===b.ui.keyCode.TAB){var a=b(":tabbable",this),e=a.filter(":first");a=a.filter(":last");if(d.target=== +a[0]&&!d.shiftKey){e.focus(1);return false}else if(d.target===e[0]&&d.shiftKey){a.focus(1);return false}}});b([]).add(f.find(".ui-dialog-content :tabbable:first")).add(f.find(".ui-dialog-buttonpane :tabbable:first")).add(f).filter(":first").focus();this._trigger("open");this._isOpen=true;return this}},_createButtons:function(c){var f=this,d=false,a=b("
                ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");f.uiDialog.find(".ui-dialog-buttonpane").remove();typeof c==="object"&& +c!==null&&b.each(c,function(){return!(d=true)});if(d){b.each(c,function(e,g){var i=b('').text(e).click(function(){g.apply(f.element[0],arguments)}).appendTo(a);b.fn.button&&i.button()});a.appendTo(f.uiDialog)}},_makeDraggable:function(){function c(g){return{position:g.position,offset:g.offset}}var f=this,d=f.options,a=b(document),e;f.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(g, +i){e=d.height==="auto"?"auto":b(this).height();b(this).height(b(this).height()).addClass("ui-dialog-dragging");f._trigger("dragStart",g,c(i))},drag:function(g,i){f._trigger("drag",g,c(i))},stop:function(g,i){d.position=[i.position.left-a.scrollLeft(),i.position.top-a.scrollTop()];b(this).removeClass("ui-dialog-dragging").height(e);f._trigger("dragStop",g,c(i));b.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function f(g){return{originalPosition:g.originalPosition,originalSize:g.originalSize, +position:g.position,size:g.size}}c=c===undefined?this.options.resizable:c;var d=this,a=d.options,e=d.uiDialog.css("position");c=typeof c==="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:d._minHeight(),handles:c,start:function(g,i){b(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",g,f(i))},resize:function(g,i){d._trigger("resize",g,f(i))}, +stop:function(g,i){b(this).removeClass("ui-dialog-resizing");a.height=b(this).height();a.width=b(this).width();d._trigger("resizeStop",g,f(i));b.ui.dialog.overlay.resize()}}).css("position",e).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var c=this.options;return c.height==="auto"?c.minHeight:Math.min(c.minHeight,c.height)},_position:function(c){var f=[],d=[0,0];c=c||b.ui.dialog.prototype.options.position;if(typeof c==="string"||typeof c==="object"&& +"0"in c){f=c.split?c.split(" "):[c[0],c[1]];if(f.length===1)f[1]=f[0];b.each(["left","top"],function(a,e){if(+f[a]===f[a]){d[a]=f[a];f[a]=e}})}else if(typeof c==="object"){if("left"in c){f[0]="left";d[0]=c.left}else if("right"in c){f[0]="right";d[0]=-c.right}if("top"in c){f[1]="top";d[1]=c.top}else if("bottom"in c){f[1]="bottom";d[1]=-c.bottom}}(c=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position({my:f.join(" "),at:f.join(" "),offset:d.join(" "),of:window, +collision:"fit",using:function(a){var e=b(this).css(a).offset().top;e<0&&b(this).css("top",a.top-e)}});c||this.uiDialog.hide()},_setOption:function(c,f){var d=this.uiDialog,a=d.is(":data(resizable)"),e=false;switch(c){case "beforeclose":c="beforeClose";break;case "buttons":this._createButtons(f);break;case "closeText":this.uiDialogTitlebarCloseText.text(""+f);break;case "dialogClass":d.removeClass(this.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+f);break;case "disabled":f? +d.addClass("ui-dialog-disabled"):d.removeClass("ui-dialog-disabled");break;case "draggable":f?this._makeDraggable():d.draggable("destroy");break;case "height":e=true;break;case "maxHeight":a&&d.resizable("option","maxHeight",f);e=true;break;case "maxWidth":a&&d.resizable("option","maxWidth",f);e=true;break;case "minHeight":a&&d.resizable("option","minHeight",f);e=true;break;case "minWidth":a&&d.resizable("option","minWidth",f);e=true;break;case "position":this._position(f);break;case "resizable":a&& +!f&&d.resizable("destroy");a&&typeof f==="string"&&d.resizable("option","handles",f);!a&&f!==false&&this._makeResizable(f);break;case "title":b(".ui-dialog-title",this.uiDialogTitlebar).html(""+(f||" "));break;case "width":e=true}b.Widget.prototype._setOption.apply(this,arguments);e&&this._size()},_size:function(){var c=this.options,f;this.element.css("width","auto").hide();f=this.uiDialog.css({height:"auto",width:c.width}).height();this.element.css(c.height==="auto"?{minHeight:Math.max(c.minHeight- +f,0),height:"auto"}:{minHeight:0,height:Math.max(c.height-f,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});b.extend(b.ui.dialog,{version:"1.8",uuid:0,maxZ:0,getTitleId:function(c){c=c.attr("id");if(!c){this.uuid+=1;c=this.uuid}return"ui-dialog-title-"+c},overlay:function(c){this.$el=b.ui.dialog.overlay.create(c)}});b.extend(b.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), +function(c){return c+".dialog-overlay"}).join(" "),create:function(c){if(this.instances.length===0){setTimeout(function(){b.ui.dialog.overlay.instances.length&&b(document).bind(b.ui.dialog.overlay.events,function(d){return b(d.target).zIndex()>=b.ui.dialog.overlay.maxZ})},1);b(document).bind("keydown.dialog-overlay",function(d){if(c.options.closeOnEscape&&d.keyCode&&d.keyCode===b.ui.keyCode.ESCAPE){c.close(d);d.preventDefault()}});b(window).bind("resize.dialog-overlay",b.ui.dialog.overlay.resize)}var f= +(this.oldInstances.pop()||b("
                ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});b.fn.bgiframe&&f.bgiframe();this.instances.push(f);return f},destroy:function(c){this.oldInstances.push(this.instances.splice(b.inArray(c,this.instances),1)[0]);this.instances.length===0&&b([document,window]).unbind(".dialog-overlay");c.remove();var f=0;b.each(this.instances,function(){f=Math.max(f,this.css("z-index"))});this.maxZ=f},height:function(){var c, +f;if(b.browser.msie&&b.browser.version<7){c=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);f=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return c
                ");if(!f.values)f.values=[this._valueMin(),this._valueMin()];if(f.values.length&&f.values.length!=2)f.values=[f.values[0],f.values[0]]}else this.range=b("
                ");this.range.appendTo(this.element).addClass("ui-slider-range");if(f.range=="min"||f.range=="max")this.range.addClass("ui-slider-range-"+f.range);this.range.addClass("ui-widget-header")}b(".ui-slider-handle",this.element).length==0&&b('').appendTo(this.element).addClass("ui-slider-handle"); +if(f.values&&f.values.length)for(;b(".ui-slider-handle",this.element).length').appendTo(this.element).addClass("ui-slider-handle");this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){f.disabled||b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(f.disabled)b(this).blur(); +else{b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(d){b(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(d){var a=true,e=b(this).data("index.ui-slider-handle");if(!c.options.disabled){switch(d.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:a= +false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");c._start(d,e)}}var g,i,k=c._step();g=c.options.values&&c.options.values.length?i=c.values(e):i=c.value();switch(d.keyCode){case b.ui.keyCode.HOME:i=c._valueMin();break;case b.ui.keyCode.END:i=c._valueMax();break;case b.ui.keyCode.PAGE_UP:i=g+(c._valueMax()-c._valueMin())/5;break;case b.ui.keyCode.PAGE_DOWN:i=g-(c._valueMax()-c._valueMin())/5;break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(g==c._valueMax())return; +i=g+k;break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(g==c._valueMin())return;i=g-k}c._slide(d,e,i);return a}}).keyup(function(d){var a=b(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(d,a);c._change(d,a);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); +this._mouseDestroy();return this},_mouseCapture:function(c){var f=this.options;if(f.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var d={x:c.pageX,y:c.pageY},a=this._normValueFromMouse(d),e=this._valueMax()-this._valueMin()+1,g,i=this,k;this.handles.each(function(j){var h=Math.abs(a-i.values(j));if(e>h){e=h;g=b(this);k=j}});if(f.range==true&&this.values(1)==f.min)g=b(this.handles[++k]);this._start(c, +k);this._mouseSliding=true;i._handleIndex=k;g.addClass("ui-state-active").focus();f=g.offset();this._clickOffset=!b(c.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:c.pageX-f.left-g.width()/2,top:c.pageY-f.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};a=this._normValueFromMouse(d);this._slide(c,k,a);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(c){var f= +this._normValueFromMouse({x:c.pageX,y:c.pageY});this._slide(c,this._handleIndex,f);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(c){var f;if("horizontal"==this.orientation){f= +this.elementSize.width;c=c.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{f=this.elementSize.height;c=c.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}f=c/f;if(f>1)f=1;if(f<0)f=0;if("vertical"==this.orientation)f=1-f;c=this._valueMax()-this._valueMin();c=f*c;f=c%this.options.step;c=this._valueMin()+c-f;if(f>this.options.step/2)c+=this.options.step;return parseFloat(c.toFixed(5))},_start:function(c,f){var d={handle:this.handles[f],value:this.value()}; +if(this.options.values&&this.options.values.length){d.value=this.values(f);d.values=this.values()}this._trigger("start",c,d)},_slide:function(c,f,d){if(this.options.values&&this.options.values.length){var a=this.values(f?0:1);if(this.options.values.length==2&&this.options.range===true&&(f==0&&d>a||f==1&&d1){this.options.values[c]=this._trimValue(f);this._refreshValue();this._change(null,c)}if(arguments.length)if(b.isArray(arguments[0])){for(var d=this.options.values,a=arguments[0],e=0,g=d.length;ethis._valueMax())c=this._valueMax();return c},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var c=this.options.range,f=this.options,d=this,a=!this._animateOff?f.animate:false;if(this.options.values&&this.options.values.length)this.handles.each(function(k){var j= +(d.values(k)-d._valueMin())/(d._valueMax()-d._valueMin())*100,h={};h[d.orientation=="horizontal"?"left":"bottom"]=j+"%";b(this).stop(1,1)[a?"animate":"css"](h,f.animate);if(d.options.range===true)if(d.orientation=="horizontal"){k==0&&d.range.stop(1,1)[a?"animate":"css"]({left:j+"%"},f.animate);k==1&&d.range[a?"animate":"css"]({width:j-lastValPercent+"%"},{queue:false,duration:f.animate})}else{k==0&&d.range.stop(1,1)[a?"animate":"css"]({bottom:j+"%"},f.animate);k==1&&d.range[a?"animate":"css"]({height:j- +lastValPercent+"%"},{queue:false,duration:f.animate})}lastValPercent=j});else{var e=this.value(),g=this._valueMin(),i=this._valueMax();e=i!=g?(e-g)/(i-g)*100:0;g={};g[d.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[a?"animate":"css"](g,f.animate);c=="min"&&this.orientation=="horizontal"&&this.range.stop(1,1)[a?"animate":"css"]({width:e+"%"},f.animate);c=="max"&&this.orientation=="horizontal"&&this.range[a?"animate":"css"]({width:100-e+"%"},{queue:false,duration:f.animate}); +c=="min"&&this.orientation=="vertical"&&this.range.stop(1,1)[a?"animate":"css"]({height:e+"%"},f.animate);c=="max"&&this.orientation=="vertical"&&this.range[a?"animate":"css"]({height:100-e+"%"},{queue:false,duration:f.animate})}}});b.extend(b.ui.slider,{version:"1.8"})})(jQuery); +(function(b){var c=0,f=0;b.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
                ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:'
              • #{label}
              • '},_create:function(){this._tabify(true)},_setOption:function(d,a){if(d=="selected")this.options.collapsible&&a==this.options.selected|| +this.select(a);else{this.options[d]=a;this._tabify()}},_tabId:function(d){return d.title&&d.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+ ++c},_sanitizeSelector:function(d){return d.replace(/:/g,"\\:")},_cookie:function(){var d=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++f);return b.cookie.apply(null,[d].concat(b.makeArray(arguments)))},_ui:function(d,a){return{tab:d,panel:a,index:this.anchors.index(d)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var d= +b(this);d.html(d.data("label.tabs")).removeData("label.tabs")})},_tabify:function(d){function a(o,p){o.css({display:""});!b.support.opacity&&p.opacity&&o[0].style.removeAttribute("filter")}this.list=this.element.find("ol,ul").eq(0);this.lis=b("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return b("a",this)[0]});this.panels=b([]);var e=this,g=this.options,i=/^#.+/;this.anchors.each(function(o,p){var q=b(p).attr("href"),r=q.split("#")[0],s;if(r&&(r===location.toString().split("#")[0]|| +(s=b("base")[0])&&r===s.href)){q=p.hash;p.href=q}if(i.test(q))e.panels=e.panels.add(e._sanitizeSelector(q));else if(q!="#"){b.data(p,"href.tabs",q);b.data(p,"load.tabs",q.replace(/#.*$/,""));q=e._tabId(p);p.href="#"+q;r=b("#"+q);if(!r.length){r=b(g.panelTemplate).attr("id",q).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(e.panels[o-1]||e.list);r.data("destroy.tabs",true)}e.panels=e.panels.add(r)}else g.disabled.push(o)});if(d){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(g.selected===undefined){location.hash&&this.anchors.each(function(o,p){if(p.hash==location.hash){g.selected=o;return false}});if(typeof g.selected!="number"&&g.cookie)g.selected=parseInt(e._cookie(),10);if(typeof g.selected!="number"&&this.lis.filter(".ui-tabs-selected").length)g.selected= +this.lis.index(this.lis.filter(".ui-tabs-selected"));g.selected=g.selected||(this.lis.length?0:-1)}else if(g.selected===null)g.selected=-1;g.selected=g.selected>=0&&this.anchors[g.selected]||g.selected<0?g.selected:0;g.disabled=b.unique(g.disabled.concat(b.map(this.lis.filter(".ui-state-disabled"),function(o){return e.lis.index(o)}))).sort();b.inArray(g.selected,g.disabled)!=-1&&g.disabled.splice(b.inArray(g.selected,g.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); +if(g.selected>=0&&this.anchors.length){this.panels.eq(g.selected).removeClass("ui-tabs-hide");this.lis.eq(g.selected).addClass("ui-tabs-selected ui-state-active");e.element.queue("tabs",function(){e._trigger("show",null,e._ui(e.anchors[g.selected],e.panels[g.selected]))});this.load(g.selected)}b(window).bind("unload",function(){e.lis.add(e.anchors).unbind(".tabs");e.lis=e.anchors=e.panels=null})}else g.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));this.element[g.collapsible?"addClass": +"removeClass"]("ui-tabs-collapsible");g.cookie&&this._cookie(g.selected,g.cookie);d=0;for(var k;k=this.lis[d];d++)b(k)[b.inArray(d,g.disabled)!=-1&&!b(k).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");g.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(g.event!="mouseover"){var j=function(o,p){p.is(":not(.ui-state-disabled)")&&p.addClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){j("hover",b(this))});this.lis.bind("mouseout.tabs", +function(){b(this).removeClass("ui-state-hover")});this.anchors.bind("focus.tabs",function(){j("focus",b(this).closest("li"))});this.anchors.bind("blur.tabs",function(){b(this).closest("li").removeClass("ui-state-focus")})}var h,l;if(g.fx)if(b.isArray(g.fx)){h=g.fx[0];l=g.fx[1]}else h=l=g.fx;var m=l?function(o,p){b(o).closest("li").addClass("ui-tabs-selected ui-state-active");p.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){a(p,l);e._trigger("show",null,e._ui(o,p[0]))})}: +function(o,p){b(o).closest("li").addClass("ui-tabs-selected ui-state-active");p.removeClass("ui-tabs-hide");e._trigger("show",null,e._ui(o,p[0]))},n=h?function(o,p){p.animate(h,h.duration||"normal",function(){e.lis.removeClass("ui-tabs-selected ui-state-active");p.addClass("ui-tabs-hide");a(p,h);e.element.dequeue("tabs")})}:function(o,p){e.lis.removeClass("ui-tabs-selected ui-state-active");p.addClass("ui-tabs-hide");e.element.dequeue("tabs")};this.anchors.bind(g.event+".tabs",function(){var o=this, +p=b(this).closest("li"),q=e.panels.filter(":not(.ui-tabs-hide)"),r=b(e._sanitizeSelector(this.hash));if(p.hasClass("ui-tabs-selected")&&!g.collapsible||p.hasClass("ui-state-disabled")||p.hasClass("ui-state-processing")||e._trigger("select",null,e._ui(this,r[0]))===false){this.blur();return false}g.selected=e.anchors.index(this);e.abort();if(g.collapsible)if(p.hasClass("ui-tabs-selected")){g.selected=-1;g.cookie&&e._cookie(g.selected,g.cookie);e.element.queue("tabs",function(){n(o,q)}).dequeue("tabs"); +this.blur();return false}else if(!q.length){g.cookie&&e._cookie(g.selected,g.cookie);e.element.queue("tabs",function(){m(o,r)});e.load(e.anchors.index(this));this.blur();return false}g.cookie&&e._cookie(g.selected,g.cookie);if(r.length){q.length&&e.element.queue("tabs",function(){n(o,q)});e.element.queue("tabs",function(){m(o,r)});e.load(e.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";b.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})}, +destroy:function(){var d=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var a=b.data(this,"href.tabs");if(a)this.href=a;var e=b(this).unbind(".tabs");b.each(["href","load","cache"],function(g,i){e.removeData(i+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){b.data(this, +"destroy.tabs")?b(this).remove():b(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});d.cookie&&this._cookie(null,d.cookie);return this},add:function(d,a,e){if(e===undefined)e=this.anchors.length;var g=this,i=this.options;a=b(i.tabTemplate.replace(/#\{href\}/g,d).replace(/#\{label\}/g,a));d=!d.indexOf("#")?d.replace("#",""):this._tabId(b("a",a)[0]);a.addClass("ui-state-default ui-corner-top").data("destroy.tabs", +true);var k=b("#"+d);k.length||(k=b(i.panelTemplate).attr("id",d).data("destroy.tabs",true));k.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(e>=this.lis.length){a.appendTo(this.list);k.appendTo(this.list[0].parentNode)}else{a.insertBefore(this.lis[e]);k.insertBefore(this.panels[e])}i.disabled=b.map(i.disabled,function(j){return j>=e?++j:j});this._tabify();if(this.anchors.length==1){i.selected=0;a.addClass("ui-tabs-selected ui-state-active");k.removeClass("ui-tabs-hide"); +this.element.queue("tabs",function(){g._trigger("show",null,g._ui(g.anchors[0],g.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(d){var a=this.options,e=this.lis.eq(d).remove(),g=this.panels.eq(d).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(d+(d+1=d?--i:i});this._tabify();this._trigger("remove", +null,this._ui(e.find("a")[0],g[0]));return this},enable:function(d){var a=this.options;if(b.inArray(d,a.disabled)!=-1){this.lis.eq(d).removeClass("ui-state-disabled");a.disabled=b.grep(a.disabled,function(e){return e!=d});this._trigger("enable",null,this._ui(this.anchors[d],this.panels[d]));return this}},disable:function(d){var a=this.options;if(d!=a.selected){this.lis.eq(d).addClass("ui-state-disabled");a.disabled.push(d);a.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[d],this.panels[d]))}return this}, +select:function(d){if(typeof d=="string")d=this.anchors.index(this.anchors.filter("[href$="+d+"]"));else if(d===null)d=-1;if(d==-1&&this.options.collapsible)d=this.options.selected;this.anchors.eq(d).trigger(this.options.event+".tabs");return this},load:function(d){var a=this,e=this.options,g=this.anchors.eq(d)[0],i=b.data(g,"load.tabs");this.abort();if(!i||this.element.queue("tabs").length!==0&&b.data(g,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(d).addClass("ui-state-processing"); +if(e.spinner){var k=b("span",g);k.data("label.tabs",k.html()).html(e.spinner)}this.xhr=b.ajax(b.extend({},e.ajaxOptions,{url:i,success:function(j,h){b(a._sanitizeSelector(g.hash)).html(j);a._cleanup();e.cache&&b.data(g,"cache.tabs",true);a._trigger("load",null,a._ui(a.anchors[d],a.panels[d]));try{e.ajaxOptions.success(j,h)}catch(l){}},error:function(j,h){a._cleanup();a._trigger("load",null,a._ui(a.anchors[d],a.panels[d]));try{e.ajaxOptions.error(j,h,d,g)}catch(l){}}}));a.element.dequeue("tabs");return this}}, +abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(d,a){this.anchors.eq(d).removeData("cache.tabs").data("load.tabs",a);return this},length:function(){return this.anchors.length}});b.extend(b.ui.tabs,{version:"1.8"});b.extend(b.ui.tabs.prototype,{rotation:null,rotate:function(d,a){var e=this,g=this.options,i=e._rotate||(e._rotate= +function(j){clearTimeout(e.rotation);e.rotation=setTimeout(function(){var h=g.selected;e.select(++h
                ')}function f(a,e){b.extend(a, +e);for(var g in e)if(e[g]==null||e[g]==undefined)a[g]=e[g];return a}b.extend(b.ui,{datepicker:{version:"1.8"}});var d=(new Date).getTime();b.extend(c.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){f(this._defaults,a||{});return this},_attachDatepicker:function(a,e){var g=null,i;for(i in this._defaults){var k=a.getAttribute("date:"+i);if(k){g=g||{};try{g[i]=eval(k)}catch(j){g[i]= +k}}}i=a.nodeName.toLowerCase();k=i=="div"||i=="span";if(!a.id)a.id="dp"+ ++this.uuid;var h=this._newInst(b(a),k);h.settings=b.extend({},e||{},g||{});if(i=="input")this._connectDatepicker(a,h);else k&&this._inlineDatepicker(a,h)},_newInst:function(a,e){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:!e?this.dpDiv:b('
                ')}}, +_connectDatepicker:function(a,e){var g=b(a);e.append=b([]);e.trigger=b([]);if(!g.hasClass(this.markerClassName)){this._attachments(g,e);g.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(i,k,j){e.settings[k]=j}).bind("getData.datepicker",function(i,k){return this._get(e,k)});this._autoSize(e);b.data(a,"datepicker",e)}},_attachments:function(a,e){var g=this._get(e,"appendText"),i=this._get(e,"isRTL");e.append&& +e.append.remove();if(g){e.append=b(''+g+"");a[i?"before":"after"](e.append)}a.unbind("focus",this._showDatepicker);e.trigger&&e.trigger.remove();g=this._get(e,"showOn");if(g=="focus"||g=="both")a.focus(this._showDatepicker);if(g=="button"||g=="both"){g=this._get(e,"buttonText");var k=this._get(e,"buttonImage");e.trigger=b(this._get(e,"buttonImageOnly")?b("").addClass(this._triggerClass).attr({src:k,alt:g,title:g}):b('').addClass(this._triggerClass).html(k== +""?g:b("").attr({src:k,alt:g,title:g})));a[i?"before":"after"](e.trigger);e.trigger.click(function(){b.datepicker._datepickerShowing&&b.datepicker._lastInput==a[0]?b.datepicker._hideDatepicker():b.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var e=new Date(2009,11,20),g=this._get(a,"dateFormat");if(g.match(/[DM]/)){var i=function(k){for(var j=0,h=0,l=0;lj){j=k[l].length;h=l}return h};e.setMonth(i(this._get(a, +g.match(/MM/)?"monthNames":"monthNamesShort")));e.setDate(i(this._get(a,g.match(/DD/)?"dayNames":"dayNamesShort"))+20-e.getDay())}a.input.attr("size",this._formatDate(a,e).length)}},_inlineDatepicker:function(a,e){var g=b(a);if(!g.hasClass(this.markerClassName)){g.addClass(this.markerClassName).append(e.dpDiv).bind("setData.datepicker",function(i,k,j){e.settings[k]=j}).bind("getData.datepicker",function(i,k){return this._get(e,k)});b.data(a,"datepicker",e);this._setDate(e,this._getDefaultDate(e), +true);this._updateDatepicker(e);this._updateAlternate(e)}},_dialogDatepicker:function(a,e,g,i,k){a=this._dialogInst;if(!a){a="dp"+ ++this.uuid;this._dialogInput=b('');this._dialogInput.keydown(this._doKeyDown);b("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};b.data(this._dialogInput[0],"datepicker",a)}f(a.settings,i||{});e=e&&e.constructor==Date? +this._formatDate(a,e):e;this._dialogInput.val(e);this._pos=k?k.length?k:[k.pageX,k.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=g;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]); +b.blockUI&&b.blockUI(this.dpDiv);b.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var e=b(a),g=b.data(a,"datepicker");if(e.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();b.removeData(a,"datepicker");if(i=="input"){g.append.remove();g.trigger.remove();e.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(i=="div"||i=="span")e.removeClass(this.markerClassName).empty()}}, +_enableDatepicker:function(a){var e=b(a),g=b.data(a,"datepicker");if(e.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();if(i=="input"){a.disabled=false;g.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(i=="div"||i=="span")e.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=b.map(this._disabledInputs,function(k){return k==a?null:k})}},_disableDatepicker:function(a){var e= +b(a),g=b.data(a,"datepicker");if(e.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();if(i=="input"){a.disabled=true;g.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(i=="div"||i=="span")e.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=b.map(this._disabledInputs,function(k){return k==a?null:k});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false; +for(var e=0;e-1}},_doKeyUp:function(a){a=b.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(b.datepicker.parseDate(b.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,b.datepicker._getFormatConfig(a))){b.datepicker._setDateFromField(a);b.datepicker._updateAlternate(a);b.datepicker._updateDatepicker(a)}}catch(e){b.datepicker.log(e)}return true},_showDatepicker:function(a){a=a.target|| +a;if(a.nodeName.toLowerCase()!="input")a=b("input",a.parentNode)[0];if(!(b.datepicker._isDisabledDatepicker(a)||b.datepicker._lastInput==a)){var e=b.datepicker._getInst(a);b.datepicker._curInst&&b.datepicker._curInst!=e&&b.datepicker._curInst.dpDiv.stop(true,true);var g=b.datepicker._get(e,"beforeShow");f(e.settings,g?g.apply(a,[a,e]):{});e.lastVal=null;b.datepicker._lastInput=a;b.datepicker._setDateFromField(e);if(b.datepicker._inDialog)a.value="";if(!b.datepicker._pos){b.datepicker._pos=b.datepicker._findPos(a); +b.datepicker._pos[1]+=a.offsetHeight}var i=false;b(a).parents().each(function(){i|=b(this).css("position")=="fixed";return!i});if(i&&b.browser.opera){b.datepicker._pos[0]-=document.documentElement.scrollLeft;b.datepicker._pos[1]-=document.documentElement.scrollTop}g={left:b.datepicker._pos[0],top:b.datepicker._pos[1]};b.datepicker._pos=null;e.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});b.datepicker._updateDatepicker(e);g=b.datepicker._checkOffset(e,g,i);e.dpDiv.css({position:b.datepicker._inDialog&& +b.blockUI?"static":i?"fixed":"absolute",display:"none",left:g.left+"px",top:g.top+"px"});if(!e.inline){g=b.datepicker._get(e,"showAnim");var k=b.datepicker._get(e,"duration"),j=function(){b.datepicker._datepickerShowing=true;var h=b.datepicker._getBorders(e.dpDiv);e.dpDiv.find("iframe.ui-datepicker-cover").css({left:-h[0],top:-h[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()})};e.dpDiv.zIndex(b(a).zIndex()+1);b.effects&&b.effects[g]?e.dpDiv.show(g,b.datepicker._get(e,"showOptions"),k, +j):e.dpDiv[g||"show"](g?k:null,j);if(!g||!k)j();e.input.is(":visible")&&!e.input.is(":disabled")&&e.input.focus();b.datepicker._curInst=e}}},_updateDatepicker:function(a){var e=this,g=b.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-g[0],top:-g[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){b(this).removeClass("ui-state-hover"); +this.className.indexOf("ui-datepicker-prev")!=-1&&b(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&b(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!e._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){b(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&b(this).addClass("ui-datepicker-prev-hover"); +this.className.indexOf("ui-datepicker-next")!=-1&&b(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();g=this._getNumberOfMonths(a);var i=g[1];i>1?a.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",17*i+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(g[0]!=1||g[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"); +a==b.datepicker._curInst&&b.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var e=function(g){return{thin:1,medium:2,thick:3}[g]||g};return[parseFloat(e(a.css("border-left-width"))),parseFloat(e(a.css("border-top-width")))]},_checkOffset:function(a,e,g){var i=a.dpDiv.outerWidth(),k=a.dpDiv.outerHeight(),j=a.input?a.input.outerWidth():0,h=a.input?a.input.outerHeight():0,l=document.documentElement.clientWidth+b(document).scrollLeft(), +m=document.documentElement.clientHeight+b(document).scrollTop();e.left-=this._get(a,"isRTL")?i-j:0;e.left-=g&&e.left==a.input.offset().left?b(document).scrollLeft():0;e.top-=g&&e.top==a.input.offset().top+h?b(document).scrollTop():0;e.left-=Math.min(e.left,e.left+i>l&&l>i?Math.abs(e.left+i-l):0);e.top-=Math.min(e.top,e.top+k>m&&m>k?Math.abs(k+h):0);return e},_findPos:function(a){for(var e=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[e?"previousSibling":"nextSibling"]; +a=b(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var e=this._curInst;if(!(!e||a&&e!=b.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(e,"showAnim");var g=this._get(e,"duration"),i=function(){b.datepicker._tidyDialog(e);this._curInst=null};b.effects&&b.effects[a]?e.dpDiv.hide(a,b.datepicker._get(e,"showOptions"),g,i):e.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?g:null,i);a||i();if(a=this._get(e,"onClose"))a.apply(e.input?e.input[0]:null,[e.input?e.input.val(): +"",e]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(b.blockUI){b.unblockUI();b("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(b.datepicker._curInst){a=b(a.target);a[0].id!=b.datepicker._mainDivId&&a.parents("#"+b.datepicker._mainDivId).length==0&&!a.hasClass(b.datepicker.markerClassName)&& +!a.hasClass(b.datepicker._triggerClass)&&b.datepicker._datepickerShowing&&!(b.datepicker._inDialog&&b.blockUI)&&b.datepicker._hideDatepicker()}},_adjustDate:function(a,e,g){a=b(a);var i=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(i,e+(g=="M"?this._get(i,"showCurrentAtPos"):0),g);this._updateDatepicker(i)}},_gotoToday:function(a){a=b(a);var e=this._getInst(a[0]);if(this._get(e,"gotoCurrent")&&e.currentDay){e.selectedDay=e.currentDay;e.drawMonth=e.selectedMonth=e.currentMonth; +e.drawYear=e.selectedYear=e.currentYear}else{var g=new Date;e.selectedDay=g.getDate();e.drawMonth=e.selectedMonth=g.getMonth();e.drawYear=e.selectedYear=g.getFullYear()}this._notifyChange(e);this._adjustDate(a)},_selectMonthYear:function(a,e,g){a=b(a);var i=this._getInst(a[0]);i._selectingMonthYear=false;i["selected"+(g=="M"?"Month":"Year")]=i["draw"+(g=="M"?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10);this._notifyChange(i);this._adjustDate(a)},_clickMonthYear:function(a){a=this._getInst(b(a)[0]); +a.input&&a._selectingMonthYear&&!b.browser.msie&&a.input.focus();a._selectingMonthYear=!a._selectingMonthYear},_selectDay:function(a,e,g,i){var k=b(a);if(!(b(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(k[0]))){k=this._getInst(k[0]);k.selectedDay=k.currentDay=b("a",i).html();k.selectedMonth=k.currentMonth=e;k.selectedYear=k.currentYear=g;this._selectDate(a,this._formatDate(k,k.currentDay,k.currentMonth,k.currentYear))}},_clearDate:function(a){a=b(a);this._getInst(a[0]);this._selectDate(a, +"")},_selectDate:function(a,e){var g=this._getInst(b(a)[0]);e=e!=null?e:this._formatDate(g);g.input&&g.input.val(e);this._updateAlternate(g);var i=this._get(g,"onSelect");if(i)i.apply(g.input?g.input[0]:null,[e,g]);else g.input&&g.input.trigger("change");if(g.inline)this._updateDatepicker(g);else{this._hideDatepicker();this._lastInput=g.input[0];typeof g.input[0]!="object"&&g.input.focus();this._lastInput=null}},_updateAlternate:function(a){var e=this._get(a,"altField");if(e){var g=this._get(a,"altFormat")|| +this._get(a,"dateFormat"),i=this._getDate(a),k=this.formatDate(g,i,this._getFormatConfig(a));b(e).each(function(){b(this).val(k)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var e=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((e-a)/864E5)/7)+1},parseDate:function(a,e,g){if(a==null||e==null)throw"Invalid arguments";e=typeof e=="object"?e.toString():e+"";if(e=="")return null; +for(var i=(g?g.shortYearCutoff:null)||this._defaults.shortYearCutoff,k=(g?g.dayNamesShort:null)||this._defaults.dayNamesShort,j=(g?g.dayNames:null)||this._defaults.dayNames,h=(g?g.monthNamesShort:null)||this._defaults.monthNamesShort,l=(g?g.monthNames:null)||this._defaults.monthNames,m=g=-1,n=-1,o=-1,p=false,q=function(v){(v=C+1-1){m=1;n=o;do{i=this._getDaysInMonth(g,m-1);if(n<=i)break;m++;n-=i}while(1)}z=this._daylightSavingAdjust(new Date(g, +m-1,n));if(z.getFullYear()!=g||z.getMonth()+1!=m||z.getDate()!=n)throw"Invalid date";return z},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,e,g){if(!e)return"";var i=(g?g.dayNamesShort:null)||this._defaults.dayNamesShort,k=(g? +g.dayNames:null)||this._defaults.dayNames,j=(g?g.monthNamesShort:null)||this._defaults.monthNamesShort;g=(g?g.monthNames:null)||this._defaults.monthNames;var h=function(q){(q=p+1 +12?a.getHours()+2:0);return a},_setDate:function(a,e,g){var i=!e,k=a.selectedMonth,j=a.selectedYear;e=this._restrictMinMax(a,this._determineDate(a,e,new Date));a.selectedDay=a.currentDay=e.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=e.getMonth();a.drawYear=a.selectedYear=a.currentYear=e.getFullYear();if((k!=a.selectedMonth||j!=a.selectedYear)&&!g)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(i?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&& +a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var e=new Date;e=this._daylightSavingAdjust(new Date(e.getFullYear(),e.getMonth(),e.getDate()));var g=this._get(a,"isRTL"),i=this._get(a,"showButtonPanel"),k=this._get(a,"hideIfNoPrevNext"),j=this._get(a,"navigationAsDateFormat"),h=this._getNumberOfMonths(a),l=this._get(a,"showCurrentAtPos"),m=this._get(a,"stepMonths"),n=h[0]!=1||h[1]!=1,o=this._daylightSavingAdjust(!a.currentDay? +new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),p=this._getMinMaxDate(a,"min"),q=this._getMinMaxDate(a,"max");l=a.drawMonth-l;var r=a.drawYear;if(l<0){l+=12;r--}if(q){var s=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth()-h[0]*h[1]+1,q.getDate()));for(s=p&&ss;){l--;if(l<0){l=11;r--}}}a.drawMonth=l;a.drawYear=r;s=this._get(a,"prevText");s=!j?s:this.formatDate(s,this._daylightSavingAdjust(new Date(r,l-m,1)),this._getFormatConfig(a)); +s=this._canAdjustMonth(a,-1,r,l)?''+s+"":k?"":''+s+"";var u=this._get(a,"nextText");u=!j?u:this.formatDate(u,this._daylightSavingAdjust(new Date(r, +l+m,1)),this._getFormatConfig(a));k=this._canAdjustMonth(a,+1,r,l)?''+u+"":k?"":''+u+"";m=this._get(a,"currentText");u=this._get(a,"gotoCurrent")&& +a.currentDay?o:e;m=!j?m:this.formatDate(m,u,this._getFormatConfig(a));j=!a.inline?'":"";i=i?'
                '+(g?j:"")+(this._isInRange(a,u)?'":"")+(g?"":j)+"
                ":"";j=parseInt(this._get(a,"firstDay"),10);j=isNaN(j)?0:j;m=this._get(a,"showWeek");u=this._get(a,"dayNames");this._get(a,"dayNamesShort");var x=this._get(a,"dayNamesMin"),C=this._get(a,"monthNames"),z=this._get(a,"monthNamesShort"),v=this._get(a,"beforeShowDay"),A=this._get(a,"showOtherMonths"),I=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),J="",F=0;F1)switch(G){case 0:B+=" ui-datepicker-group-first";y=" ui-corner-"+(g?"right":"left");break;case h[1]-1:B+=" ui-datepicker-group-last";y=" ui-corner-"+(g?"left":"right");break;default:B+=" ui-datepicker-group-middle";y=""}B+='">'}B+='
                '+(/all|left/.test(y)&&F==0?g?k:s:"")+ +(/all|right/.test(y)&&F==0?g?s:k:"")+this._generateMonthYearHeader(a,l,r,p,q,F>0||G>0,C,z)+'
                ';var D=m?'":"";for(y=0;y<7;y++){var w=(y+j)%7;D+="=5?' class="ui-datepicker-week-end"':"")+'>'+x[w]+""}B+=D+"";D=this._getDaysInMonth(r,l);if(r==a.selectedYear&&l==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, +D);y=(this._getFirstDayOfMonth(r,l)-j+7)%7;D=n?6:Math.ceil((y+D)/7);w=this._daylightSavingAdjust(new Date(r,l,1-y));for(var O=0;O";var P=!m?"":'";for(y=0;y<7;y++){var H=v?v.apply(a.input?a.input[0]:null,[w]):[true,""],E=w.getMonth()!=l,K=E&&!I||!H[0]||p&&wq;P+='";w.setDate(w.getDate()+1);w=this._daylightSavingAdjust(w)}B+=P+""}l++;if(l>11){l=0;r++}B+="
                '+this._get(a,"weekHeader")+"
                '+this._get(a,"calculateWeek")(w)+""+(E&&!A?" ":K?''+w.getDate()+ +"":''+w.getDate()+"")+"
                "+(n?"
                "+(h[0]>0&&G==h[1]-1?'
                ':""):"");M+=B}J+=M}J+=i+(b.browser.msie&&parseInt(b.browser.version,10)<7&&!a.inline?'': +"");a._keyEvent=false;return J},_generateMonthYearHeader:function(a,e,g,i,k,j,h,l){var m=this._get(a,"changeMonth"),n=this._get(a,"changeYear"),o=this._get(a,"showMonthAfterYear"),p='
                ',q="";if(j||!m)q+=''+h[e]+"";else{h=i&&i.getFullYear()==g;var r=k&&k.getFullYear()==g;q+='"}o||(p+=q+(j||!(m&&n)?" ":""));if(j||!n)p+=''+g+"";else{l=this._get(a,"yearRange").split(":");var u=(new Date).getFullYear();h=function(x){x=x.match(/c[+-].*/)?g+parseInt(x.substring(1),10):x.match(/[+-].*/)?u+parseInt(x,10):parseInt(x,10);return isNaN(x)?u:x};e=h(l[0]);l=Math.max(e, +h(l[1]||""));e=i?Math.max(e,i.getFullYear()):e;l=k?Math.min(l,k.getFullYear()):l;for(p+='"}p+=this._get(a,"yearSuffix");if(o)p+=(j||!(m&&n)?" ":"")+q;p+="
                ";return p},_adjustInstDate:function(a,e,g){var i= +a.drawYear+(g=="Y"?e:0),k=a.drawMonth+(g=="M"?e:0);e=Math.min(a.selectedDay,this._getDaysInMonth(i,k))+(g=="D"?e:0);i=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(i,k,e)));a.selectedDay=i.getDate();a.drawMonth=a.selectedMonth=i.getMonth();a.drawYear=a.selectedYear=i.getFullYear();if(g=="M"||g=="Y")this._notifyChange(a)},_restrictMinMax:function(a,e){var g=this._getMinMaxDate(a,"min"),i=this._getMinMaxDate(a,"max");e=g&&ei?i:e},_notifyChange:function(a){var e=this._get(a, +"onChangeMonthYear");if(e)e.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,e){return this._determineDate(a,this._get(a,e+"Date"),null)},_getDaysInMonth:function(a,e){return 32-(new Date(a,e,32)).getDate()},_getFirstDayOfMonth:function(a,e){return(new Date(a,e,1)).getDay()},_canAdjustMonth:function(a,e,g,i){var k=this._getNumberOfMonths(a); +g=this._daylightSavingAdjust(new Date(g,i+(e<0?e:k[0]*k[1]),1));e<0&&g.setDate(this._getDaysInMonth(g.getFullYear(),g.getMonth()));return this._isInRange(a,g)},_isInRange:function(a,e){var g=this._getMinMaxDate(a,"min"),i=this._getMinMaxDate(a,"max");return(!g||e.getTime()>=g.getTime())&&(!i||e.getTime()<=i.getTime())},_getFormatConfig:function(a){var e=this._get(a,"shortYearCutoff");e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);return{shortYearCutoff:e,dayNamesShort:this._get(a, +"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,e,g,i){if(!e){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}e=e?typeof e=="object"?e:this._daylightSavingAdjust(new Date(i,g,e)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}});b.fn.datepicker= +function(a){if(!b.datepicker.initialized){b(document).mousedown(b.datepicker._checkExternalClick).find("body").append(b.datepicker.dpDiv);b.datepicker.initialized=true}var e=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this[0]].concat(e));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this[0]].concat(e)); +return this.each(function(){typeof a=="string"?b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this].concat(e)):b.datepicker._attachDatepicker(this,a)})};b.datepicker=new c;b.datepicker.initialized=false;b.datepicker.uuid=(new Date).getTime();b.datepicker.version="1.8";window["DP_jQuery_"+d]=b})(jQuery); +(function(b){b.widget("ui.progressbar",{options:{value:0},_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=b("
                ").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(c){if(c===undefined)return this._value();this._setOption("value",c);return this},_setOption:function(c,f){switch(c){case "value":this.options.value=f;this._refreshValue();this._trigger("change")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var c=this.options.value;if(typeof c!=="number")c=0;if(cthis._valueMax())c=this._valueMax();return c},_valueMin:function(){return 0}, +_valueMax:function(){return 100},_refreshValue:function(){var c=this.value();this.valueDiv[c===this._valueMax()?"addClass":"removeClass"]("ui-corner-right").width(c+"%");this.element.attr("aria-valuenow",c)}});b.extend(b.ui.progressbar,{version:"1.8"})})(jQuery); +jQuery.effects||function(b){function c(j){var h;if(j&&j.constructor==Array&&j.length==3)return j;if(h=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(j))return[parseInt(h[1],10),parseInt(h[2],10),parseInt(h[3],10)];if(h=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(j))return[parseFloat(h[1])*2.55,parseFloat(h[2])*2.55,parseFloat(h[3])*2.55];if(h=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(j))return[parseInt(h[1], +16),parseInt(h[2],16),parseInt(h[3],16)];if(h=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(j))return[parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16),parseInt(h[3]+h[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(j))return g.transparent;return g[b.trim(j).toLowerCase()]}function f(){var j=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,h={},l,m;if(j&&j.length&&j[0]&&j[j[0]])for(var n=j.length;n--;){l=j[n];if(typeof j[l]=="string"){m=l.replace(/\-(\w)/g,function(o,p){return p.toUpperCase()}); +h[m]=j[l]}}else for(l in j)if(typeof j[l]==="string")h[l]=j[l];return h}function d(j){var h,l;for(h in j){l=j[h];if(l==null||b.isFunction(l)||h in k||/scrollbar/.test(h)||!/color/i.test(h)&&isNaN(parseFloat(l)))delete j[h]}return j}function a(j,h){var l={_:0},m;for(m in h)if(j[m]!=h[m])l[m]=h[m];return l}function e(j,h,l,m){if(typeof j=="object"){m=h;l=null;h=j;j=h.effect}if(b.isFunction(h)){m=h;l=null;h={}}if(b.isFunction(l)){m=l;l=null}if(typeof h=="number"||b.fx.speeds[h]){m=l;l=h;h={}}h=h||{}; +l=l||h.duration;l=b.fx.off?0:typeof l=="number"?l:b.fx.speeds[l]||b.fx.speeds._default;m=m||h.complete;return[j,h,l,m]}b.effects={};b.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(j,h){b.fx.step[h]=function(l){if(!l.colorInit){var m;m=l.elem;var n=h,o;do{o=b.curCSS(m,n);if(o!=""&&o!="transparent"||b.nodeName(m,"body"))break;n="backgroundColor"}while(m=m.parentNode);m=c(o);l.start=m;l.end=c(l.end);l.colorInit=true}l.elem.style[h]= +"rgb("+Math.max(Math.min(parseInt(l.pos*(l.end[0]-l.start[0])+l.start[0],10),255),0)+","+Math.max(Math.min(parseInt(l.pos*(l.end[1]-l.start[1])+l.start[1],10),255),0)+","+Math.max(Math.min(parseInt(l.pos*(l.end[2]-l.start[2])+l.start[2],10),255),0)+")"}});var g={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139, +0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192, +203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},i=["add","remove","toggle"],k={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};b.effects.animateClass=function(j,h,l,m){if(b.isFunction(l)){m=l;l=null}return this.each(function(){var n=b(this),o=n.attr("style")||" ",p=d(f.call(this)),q,r=n.attr("className");b.each(i,function(s,u){j[u]&&n[u+"Class"](j[u])}); +q=d(f.call(this));n.attr("className",r);n.animate(a(p,q),h,l,function(){b.each(i,function(s,u){j[u]&&n[u+"Class"](j[u])});if(typeof n.attr("style")=="object"){n.attr("style").cssText="";n.attr("style").cssText=o}else n.attr("style",o);m&&m.apply(this,arguments)})})};b.fn.extend({_addClass:b.fn.addClass,addClass:function(j,h,l,m){return h?b.effects.animateClass.apply(this,[{add:j},h,l,m]):this._addClass(j)},_removeClass:b.fn.removeClass,removeClass:function(j,h,l,m){return h?b.effects.animateClass.apply(this, +[{remove:j},h,l,m]):this._removeClass(j)},_toggleClass:b.fn.toggleClass,toggleClass:function(j,h,l,m,n){return typeof h=="boolean"||h===undefined?l?b.effects.animateClass.apply(this,[h?{add:j}:{remove:j},l,m,n]):this._toggleClass(j,h):b.effects.animateClass.apply(this,[{toggle:j},h,l,m])},switchClass:function(j,h,l,m,n){return b.effects.animateClass.apply(this,[{add:h,remove:j},l,m,n])}});b.extend(b.effects,{version:"1.8",save:function(j,h){for(var l=0;l
                ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});j.wrap(l);l=j.parent();if(j.css("position")=="static"){l.css({position:"relative"});j.css({position:"relative"})}else{b.extend(h,{position:j.css("position"),zIndex:j.css("z-index")});b.each(["top","left","bottom","right"],function(m,n){h[n]=j.css(n);if(isNaN(parseInt(h[n],10)))h[n]="auto"}); +j.css({position:"relative",top:0,left:0})}return l.css(h).show()},removeWrapper:function(j){if(j.parent().is(".ui-effects-wrapper"))return j.parent().replaceWith(j);return j},setTransition:function(j,h,l,m){m=m||{};b.each(h,function(n,o){unit=j.cssUnit(o);if(unit[0]>0)m[o]=unit[0]*l+unit[1]});return m}});b.fn.extend({effect:function(j){var h=e.apply(this,arguments);h={options:h[1],duration:h[2],callback:h[3]};var l=b.effects[j];return l&&!b.fx.off?l.call(this,h):this},_show:b.fn.show,show:function(j){if(!j|| +typeof j=="number"||b.fx.speeds[j])return this._show.apply(this,arguments);else{var h=e.apply(this,arguments);h[1].mode="show";return this.effect.apply(this,h)}},_hide:b.fn.hide,hide:function(j){if(!j||typeof j=="number"||b.fx.speeds[j])return this._hide.apply(this,arguments);else{var h=e.apply(this,arguments);h[1].mode="hide";return this.effect.apply(this,h)}},__toggle:b.fn.toggle,toggle:function(j){if(!j||typeof j=="number"||b.fx.speeds[j]||typeof j=="boolean"||b.isFunction(j))return this.__toggle.apply(this, +arguments);else{var h=e.apply(this,arguments);h[1].mode="toggle";return this.effect.apply(this,h)}},cssUnit:function(j){var h=this.css(j),l=[];b.each(["em","px","%","pt"],function(m,n){if(h.indexOf(n)>0)l=[parseFloat(h),n]});return l}});b.easing.jswing=b.easing.swing;b.extend(b.easing,{def:"easeOutQuad",swing:function(j,h,l,m,n){return b.easing[b.easing.def](j,h,l,m,n)},easeInQuad:function(j,h,l,m,n){return m*(h/=n)*h+l},easeOutQuad:function(j,h,l,m,n){return-m*(h/=n)*(h-2)+l},easeInOutQuad:function(j, +h,l,m,n){if((h/=n/2)<1)return m/2*h*h+l;return-m/2*(--h*(h-2)-1)+l},easeInCubic:function(j,h,l,m,n){return m*(h/=n)*h*h+l},easeOutCubic:function(j,h,l,m,n){return m*((h=h/n-1)*h*h+1)+l},easeInOutCubic:function(j,h,l,m,n){if((h/=n/2)<1)return m/2*h*h*h+l;return m/2*((h-=2)*h*h+2)+l},easeInQuart:function(j,h,l,m,n){return m*(h/=n)*h*h*h+l},easeOutQuart:function(j,h,l,m,n){return-m*((h=h/n-1)*h*h*h-1)+l},easeInOutQuart:function(j,h,l,m,n){if((h/=n/2)<1)return m/2*h*h*h*h+l;return-m/2*((h-=2)*h*h*h-2)+ +l},easeInQuint:function(j,h,l,m,n){return m*(h/=n)*h*h*h*h+l},easeOutQuint:function(j,h,l,m,n){return m*((h=h/n-1)*h*h*h*h+1)+l},easeInOutQuint:function(j,h,l,m,n){if((h/=n/2)<1)return m/2*h*h*h*h*h+l;return m/2*((h-=2)*h*h*h*h+2)+l},easeInSine:function(j,h,l,m,n){return-m*Math.cos(h/n*(Math.PI/2))+m+l},easeOutSine:function(j,h,l,m,n){return m*Math.sin(h/n*(Math.PI/2))+l},easeInOutSine:function(j,h,l,m,n){return-m/2*(Math.cos(Math.PI*h/n)-1)+l},easeInExpo:function(j,h,l,m,n){return h==0?l:m*Math.pow(2, +10*(h/n-1))+l},easeOutExpo:function(j,h,l,m,n){return h==n?l+m:m*(-Math.pow(2,-10*h/n)+1)+l},easeInOutExpo:function(j,h,l,m,n){if(h==0)return l;if(h==n)return l+m;if((h/=n/2)<1)return m/2*Math.pow(2,10*(h-1))+l;return m/2*(-Math.pow(2,-10*--h)+2)+l},easeInCirc:function(j,h,l,m,n){return-m*(Math.sqrt(1-(h/=n)*h)-1)+l},easeOutCirc:function(j,h,l,m,n){return m*Math.sqrt(1-(h=h/n-1)*h)+l},easeInOutCirc:function(j,h,l,m,n){if((h/=n/2)<1)return-m/2*(Math.sqrt(1-h*h)-1)+l;return m/2*(Math.sqrt(1-(h-=2)* +h)+1)+l},easeInElastic:function(j,h,l,m,n){j=1.70158;var o=0,p=m;if(h==0)return l;if((h/=n)==1)return l+m;o||(o=n*0.3);if(p
                ").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-k*(i/f)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:i/f,left:e.left+j*(g/d)+(c.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:e.top+k*(i/f)+(c.options.mode=="show"?(k-Math.floor(f/2))*(i/f):0),opacity:c.options.mode=="show"?0:1}).animate({left:e.left+j*(g/d)+(c.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:e.top+ +k*(i/f)+(c.options.mode=="show"?0:(k-Math.floor(f/2))*(i/f)),opacity:c.options.mode=="show"?1:0},c.duration||500);setTimeout(function(){c.options.mode=="show"?a.css({visibility:"visible"}):a.css({visibility:"visible"}).hide();c.callback&&c.callback.apply(a[0]);a.dequeue();b("div.ui-effects-explode").remove()},c.duration||500)})}})(jQuery); +(function(b){b.effects.fold=function(c){return this.queue(function(){var f=b(this),d=["position","top","left"],a=b.effects.setMode(f,c.options.mode||"hide"),e=c.options.size||15,g=!!c.options.horizFirst,i=c.duration?c.duration/2:b.fx.speeds._default/2;b.effects.save(f,d);f.show();var k=b.effects.createWrapper(f).css({overflow:"hidden"}),j=a=="show"!=g,h=j?["width","height"]:["height","width"];j=j?[k.width(),k.height()]:[k.height(),k.width()];var l=/([0-9]+)%/.exec(e);if(l)e=parseInt(l[1],10)/100* +j[a=="hide"?0:1];if(a=="show")k.css(g?{height:0,width:e}:{height:e,width:0});g={};l={};g[h[0]]=a=="show"?j[0]:e;l[h[1]]=a=="show"?j[1]:0;k.animate(g,i,c.options.easing).animate(l,i,c.options.easing,function(){a=="hide"&&f.hide();b.effects.restore(f,d);b.effects.removeWrapper(f);c.callback&&c.callback.apply(f[0],arguments);f.dequeue()})})}})(jQuery); +(function(b){b.effects.highlight=function(c){return this.queue(function(){var f=b(this),d=["backgroundImage","backgroundColor","opacity"],a=b.effects.setMode(f,c.options.mode||"show"),e={backgroundColor:f.css("backgroundColor")};if(a=="hide")e.opacity=0;b.effects.save(f,d);f.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(e,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){a=="hide"&&f.hide();b.effects.restore(f,d);a=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);f.dequeue()}})})}})(jQuery); +(function(b){b.effects.pulsate=function(c){return this.queue(function(){var f=b(this),d=b.effects.setMode(f,c.options.mode||"show");times=(c.options.times||5)*2-1;duration=c.duration?c.duration/2:b.fx.speeds._default/2;isVisible=f.is(":visible");animateTo=0;if(!isVisible){f.css("opacity",0).show();animateTo=1}if(d=="hide"&&isVisible||d=="show"&&!isVisible)times--;for(d=0;d
                ').appendTo(document.body).addClass(c.options.className).css({top:a.top,left:a.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(d,c.duration,c.options.easing,function(){e.remove();c.callback&&c.callback.apply(f[0],arguments); +f.dequeue()})})}})(jQuery); diff --git a/templates/website/ph2date/chat_assets/js/jquery/jquery.json-2.2.js b/templates/website/ph2date/chat_assets/js/jquery/jquery.json-2.2.js index 40defc8..4f15516 100755 --- a/templates/website/ph2date/chat_assets/js/jquery/jquery.json-2.2.js +++ b/templates/website/ph2date/chat_assets/js/jquery/jquery.json-2.2.js @@ -1,4 +1,4 @@ -(function(e){e.toJSON=function(a){if(typeof JSON=="object"&&JSON.stringify)return JSON.stringify(a);var b=typeof a;if(a===null)return"null";if(b!="undefined"){if(b=="number"||b=="boolean")return a+"";if(b=="string")return e.quoteString(a);if(b=="object"){if(typeof a.toJSON=="function")return e.toJSON(a.toJSON());if(a.constructor===Date){var c=a.getUTCMonth()+1;if(c<10)c="0"+c;var d=a.getUTCDate();if(d<10)d="0"+d;b=a.getUTCFullYear();var f=a.getUTCHours();if(f<10)f="0"+f;var g=a.getUTCMinutes();if(g< -10)g="0"+g;var h=a.getUTCSeconds();if(h<10)h="0"+h;a=a.getUTCMilliseconds();if(a<100)a="0"+a;if(a<10)a="0"+a;return'"'+b+"-"+c+"-"+d+"T"+f+":"+g+":"+h+"."+a+'Z"'}if(a.constructor===Array){c=[];for(d=0;d0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;CG.dimensions.width){G.dimensions.width=J[C]}if(J[C]G.dimensions.height){G.dimensions.height=J[C]}if(J[C]0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","
                ");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","
                ");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='
                ';if(f("").get(0).getContext){u[z]+=''}else{if(f.browser.msie){G=B*2+3;u[z]+=''}}u[z]+="
                "}D=F.getDimensions().width-(Math.max(t,B)*2);y='
                ';w='
                '+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='
                '+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='
                ';if(f("").get(0).getContext){t.elements.tip+=''}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='';t.elements.tip+='';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"
                ");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('
                ').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='