diff --git a/3rdparty/Archive/Tar.php b/3rdparty/Archive/Tar.php index e9969501a0..33c7d395d0 100644 --- a/3rdparty/Archive/Tar.php +++ b/3rdparty/Archive/Tar.php @@ -35,7 +35,7 @@ * @author Vincent Blavet * @copyright 1997-2010 The Authors * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Tar.php 323476 2012-02-24 15:27:26Z mrook $ + * @version CVS: $Id: Tar.php 324840 2012-04-05 08:44:41Z mrook $ * @link http://pear.php.net/package/Archive_Tar */ @@ -50,7 +50,7 @@ define('ARCHIVE_TAR_END_BLOCK', pack("a512", '')); * @package Archive_Tar * @author Vincent Blavet * @license http://www.opensource.org/licenses/bsd-license.php New BSD License -* @version $Revision: 323476 $ +* @version $Revision: 324840 $ */ class Archive_Tar extends PEAR { @@ -577,7 +577,7 @@ class Archive_Tar extends PEAR } // ----- Get the arguments - $v_att_list = func_get_args(); + $v_att_list = &func_get_args(); // ----- Read the attributes $i=0; @@ -649,14 +649,14 @@ class Archive_Tar extends PEAR // {{{ _error() function _error($p_message) { - $this->error_object = $this->raiseError($p_message); + $this->error_object = &$this->raiseError($p_message); } // }}} // {{{ _warning() function _warning($p_message) { - $this->error_object = $this->raiseError($p_message); + $this->error_object = &$this->raiseError($p_message); } // }}} @@ -981,7 +981,7 @@ class Archive_Tar extends PEAR // }}} // {{{ _addFile() - function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir,$v_stored_filename=null) + function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir) { if (!$this->_file) { $this->_error('Invalid file descriptor'); @@ -992,31 +992,29 @@ class Archive_Tar extends PEAR $this->_error('Invalid file name'); return false; } - if(is_null($v_stored_filename)){ - // ----- Calculate the stored filename - $p_filename = $this->_translateWinPath($p_filename, false); - $v_stored_filename = $p_filename; - if (strcmp($p_filename, $p_remove_dir) == 0) { - return true; - } - if ($p_remove_dir != '') { - if (substr($p_remove_dir, -1) != '/') - $p_remove_dir .= '/'; + // ----- Calculate the stored filename + $p_filename = $this->_translateWinPath($p_filename, false);; + $v_stored_filename = $p_filename; + if (strcmp($p_filename, $p_remove_dir) == 0) { + return true; + } + if ($p_remove_dir != '') { + if (substr($p_remove_dir, -1) != '/') + $p_remove_dir .= '/'; - if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir) - $v_stored_filename = substr($p_filename, strlen($p_remove_dir)); - } - $v_stored_filename = $this->_translateWinPath($v_stored_filename); - if ($p_add_dir != '') { - if (substr($p_add_dir, -1) == '/') - $v_stored_filename = $p_add_dir.$v_stored_filename; - else - $v_stored_filename = $p_add_dir.'/'.$v_stored_filename; - } + if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir) + $v_stored_filename = substr($p_filename, strlen($p_remove_dir)); + } + $v_stored_filename = $this->_translateWinPath($v_stored_filename); + if ($p_add_dir != '') { + if (substr($p_add_dir, -1) == '/') + $v_stored_filename = $p_add_dir.$v_stored_filename; + else + $v_stored_filename = $p_add_dir.'/'.$v_stored_filename; + } - $v_stored_filename = $this->_pathReduction($v_stored_filename); - } + $v_stored_filename = $this->_pathReduction($v_stored_filename); if ($this->_isArchive($p_filename)) { if (($v_file = @fopen($p_filename, "rb")) == 0) { @@ -1775,12 +1773,20 @@ class Archive_Tar extends PEAR } if ($this->_compress_type == 'gz') { + $end_blocks = 0; + while (!@gzeof($v_temp_tar)) { $v_buffer = @gzread($v_temp_tar, 512); if ($v_buffer == ARCHIVE_TAR_END_BLOCK || strlen($v_buffer) == 0) { + $end_blocks++; // do not copy end blocks, we will re-make them // after appending continue; + } elseif ($end_blocks > 0) { + for ($i = 0; $i < $end_blocks; $i++) { + $this->_writeBlock(ARCHIVE_TAR_END_BLOCK); + } + $end_blocks = 0; } $v_binary_data = pack("a512", $v_buffer); $this->_writeBlock($v_binary_data); @@ -1789,9 +1795,19 @@ class Archive_Tar extends PEAR @gzclose($v_temp_tar); } elseif ($this->_compress_type == 'bz2') { + $end_blocks = 0; + while (strlen($v_buffer = @bzread($v_temp_tar, 512)) > 0) { - if ($v_buffer == ARCHIVE_TAR_END_BLOCK) { + if ($v_buffer == ARCHIVE_TAR_END_BLOCK || strlen($v_buffer) == 0) { + $end_blocks++; + // do not copy end blocks, we will re-make them + // after appending continue; + } elseif ($end_blocks > 0) { + for ($i = 0; $i < $end_blocks; $i++) { + $this->_writeBlock(ARCHIVE_TAR_END_BLOCK); + } + $end_blocks = 0; } $v_binary_data = pack("a512", $v_buffer); $this->_writeBlock($v_binary_data); diff --git a/3rdparty/class.phpmailer.php b/3rdparty/class.phpmailer.php index 4589cd791e..af089d5978 100644 --- a/3rdparty/class.phpmailer.php +++ b/3rdparty/class.phpmailer.php @@ -2,7 +2,7 @@ /*~ class.phpmailer.php .---------------------------------------------------------------------------. | Software: PHPMailer - PHP email class | -| Version: 5.2 | +| Version: 5.2.1 | | Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ | | ------------------------------------------------------------------------- | | Admin: Jim Jagielski (project admininistrator) | @@ -10,7 +10,7 @@ | : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | | : Jim Jagielski (jimjag) jimjag@gmail.com | | Founder: Brent R. Matzelle (original founder) | -| Copyright (c) 2010-2011, Jim Jagielski. All Rights Reserved. | +| Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved. | | Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | | Copyright (c) 2001-2003, Brent R. Matzelle | | ------------------------------------------------------------------------- | @@ -29,7 +29,7 @@ * @author Andy Prevost * @author Marcus Bointon * @author Jim Jagielski - * @copyright 2010 - 2011 Jim Jagielski + * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @version $Id: class.phpmailer.php 450 2010-06-23 16:46:33Z coolbru $ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License @@ -129,6 +129,13 @@ class PHPMailer { */ protected $MIMEHeader = ''; + /** + * Stores the complete sent MIME message (Body and Headers) + * @var string + * @access protected + */ + protected $SentMIMEMessage = ''; + /** * Sets word wrapping on the body of the message to a given number of * characters. @@ -317,7 +324,7 @@ class PHPMailer { * Sets the PHPMailer Version number * @var string */ - public $Version = '5.2'; + public $Version = '5.2.1'; /** * What to use in the X-Mailer header @@ -460,7 +467,7 @@ class PHPMailer { * @return boolean */ public function AddReplyTo($address, $name = '') { - return $this->AddAnAddress('ReplyTo', $address, $name); + return $this->AddAnAddress('Reply-To', $address, $name); } /** @@ -473,12 +480,14 @@ class PHPMailer { * @access protected */ protected function AddAnAddress($kind, $address, $name = '') { - if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) { + if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) { $this->SetError($this->Lang('Invalid recipient array').': '.$kind); if ($this->exceptions) { throw new phpmailerException('Invalid recipient array: ' . $kind); } - echo $this->Lang('Invalid recipient array').': '.$kind; + if ($this->SMTPDebug) { + echo $this->Lang('Invalid recipient array').': '.$kind; + } return false; } $address = trim($address); @@ -488,10 +497,12 @@ class PHPMailer { if ($this->exceptions) { throw new phpmailerException($this->Lang('invalid_address').': '.$address); } - echo $this->Lang('invalid_address').': '.$address; + if ($this->SMTPDebug) { + echo $this->Lang('invalid_address').': '.$address; + } return false; } - if ($kind != 'ReplyTo') { + if ($kind != 'Reply-To') { if (!isset($this->all_recipients[strtolower($address)])) { array_push($this->$kind, array($address, $name)); $this->all_recipients[strtolower($address)] = true; @@ -520,14 +531,16 @@ class PHPMailer { if ($this->exceptions) { throw new phpmailerException($this->Lang('invalid_address').': '.$address); } - echo $this->Lang('invalid_address').': '.$address; + if ($this->SMTPDebug) { + echo $this->Lang('invalid_address').': '.$address; + } return false; } $this->From = $address; $this->FromName = $name; if ($auto) { if (empty($this->ReplyTo)) { - $this->AddAnAddress('ReplyTo', $address, $name); + $this->AddAnAddress('Reply-To', $address, $name); } if (empty($this->Sender)) { $this->Sender = $address; @@ -574,6 +587,7 @@ class PHPMailer { if(!$this->PreSend()) return false; return $this->PostSend(); } catch (phpmailerException $e) { + $this->SentMIMEMessage = ''; $this->SetError($e->getMessage()); if ($this->exceptions) { throw $e; @@ -584,6 +598,7 @@ class PHPMailer { protected function PreSend() { try { + $mailHeader = ""; if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL); } @@ -603,6 +618,19 @@ class PHPMailer { $this->MIMEHeader = $this->CreateHeader(); $this->MIMEBody = $this->CreateBody(); + // To capture the complete message when using mail(), create + // an extra header list which CreateHeader() doesn't fold in + if ($this->Mailer == 'mail') { + if (count($this->to) > 0) { + $mailHeader .= $this->AddrAppend("To", $this->to); + } else { + $mailHeader .= $this->HeaderLine("To", "undisclosed-recipients:;"); + } + $mailHeader .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader(trim($this->Subject)))); + // if(count($this->cc) > 0) { + // $mailHeader .= $this->AddrAppend("Cc", $this->cc); + // } + } // digitally sign with DKIM if enabled if ($this->DKIM_domain && $this->DKIM_private) { @@ -610,7 +638,9 @@ class PHPMailer { $this->MIMEHeader = str_replace("\r\n", "\n", $header_dkim) . $this->MIMEHeader; } + $this->SentMIMEMessage = sprintf("%s%s\r\n\r\n%s",$this->MIMEHeader,$mailHeader,$this->MIMEBody); return true; + } catch (phpmailerException $e) { $this->SetError($e->getMessage()); if ($this->exceptions) { @@ -628,6 +658,8 @@ class PHPMailer { return $this->SendmailSend($this->MIMEHeader, $this->MIMEBody); case 'smtp': return $this->SmtpSend($this->MIMEHeader, $this->MIMEBody); + case 'mail': + return $this->MailSend($this->MIMEHeader, $this->MIMEBody); default: return $this->MailSend($this->MIMEHeader, $this->MIMEBody); } @@ -637,7 +669,9 @@ class PHPMailer { if ($this->exceptions) { throw $e; } - echo $e->getMessage()."\n"; + if ($this->SMTPDebug) { + echo $e->getMessage()."\n"; + } return false; } } @@ -703,7 +737,7 @@ class PHPMailer { $to = implode(', ', $toArr); if (empty($this->Sender)) { - $params = "-oi -f %s"; + $params = "-oi "; } else { $params = sprintf("-oi -f %s", $this->Sender); } @@ -732,7 +766,7 @@ class PHPMailer { $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body); } } else { - $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header); + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); // implement call back function if it exists $isSent = ($rt == 1) ? 1 : 0; $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body); @@ -880,7 +914,9 @@ class PHPMailer { } } catch (phpmailerException $e) { $this->smtp->Reset(); - throw $e; + if ($this->exceptions) { + throw $e; + } } return true; } @@ -1159,7 +1195,7 @@ class PHPMailer { $result .= $this->HeaderLine('To', 'undisclosed-recipients:;'); } } - } + } $from = array(); $from[0][0] = trim($this->From); @@ -1177,7 +1213,7 @@ class PHPMailer { } if(count($this->ReplyTo) > 0) { - $result .= $this->AddrAppend('Reply-to', $this->ReplyTo); + $result .= $this->AddrAppend('Reply-To', $this->ReplyTo); } // mail() sets the subject itself @@ -1250,6 +1286,16 @@ class PHPMailer { return $result; } + /** + * Returns the MIME message (headers and body). Only really valid post PreSend(). + * @access public + * @return string + */ + public function GetSentMIMEMessage() { + return $this->SentMIMEMessage; + } + + /** * Assembles the message body. Returns an empty string on failure. * @access public @@ -1363,8 +1409,8 @@ class PHPMailer { $signed = tempnam("", "signed"); if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), NULL)) { @unlink($file); - @unlink($signed); $body = file_get_contents($signed); + @unlink($signed); } else { @unlink($file); @unlink($signed); @@ -1487,7 +1533,9 @@ class PHPMailer { if ($this->exceptions) { throw $e; } - echo $e->getMessage()."\n"; + if ($this->SMTPDebug) { + echo $e->getMessage()."\n"; + } if ( $e->getCode() == self::STOP_CRITICAL ) { return false; } @@ -1590,15 +1638,23 @@ class PHPMailer { return false; } } - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - $magic_quotes = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); - } + $magic_quotes = get_magic_quotes_runtime(); + if ($magic_quotes) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + set_magic_quotes_runtime(0); + } else { + ini_set('magic_quotes_runtime', 0); + } + } $file_buffer = file_get_contents($path); $file_buffer = $this->EncodeString($file_buffer, $encoding); - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - set_magic_quotes_runtime($magic_quotes); - } + if ($magic_quotes) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + set_magic_quotes_runtime($magic_quotes); + } else { + ini_set('magic_quotes_runtime', $magic_quotes); + } + } return $file_buffer; } catch (Exception $e) { $this->SetError($e->getMessage()); @@ -2154,7 +2210,7 @@ class PHPMailer { * @return $message */ public function MsgHTML($message, $basedir = '') { - preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images); + preg_match_all("/(src|background)=[\"'](.*)[\"']/Ui", $message, $images); if(isset($images[2])) { foreach($images[2] as $i => $url) { // do not change urls for absolute images (thanks to corvuscorax) @@ -2168,20 +2224,23 @@ class PHPMailer { if ( strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; } if ( strlen($directory) > 1 && substr($directory, -1) != '/') { $directory .= '/'; } if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64', $mimeType) ) { - $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message); + $message = preg_replace("/".$images[1][$i]."=[\"']".preg_quote($url, '/')."[\"']/Ui", $images[1][$i]."=\"".$cid."\"", $message); } } } } $this->IsHTML(true); $this->Body = $message; - $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s', '', $message))); - if (!empty($textMsg) && empty($this->AltBody)) { - $this->AltBody = html_entity_decode($textMsg); - } + if (empty($this->AltBody)) { + $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s', '', $message))); + if (!empty($textMsg)) { + $this->AltBody = html_entity_decode($textMsg, ENT_QUOTES, $this->CharSet); + } + } if (empty($this->AltBody)) { $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n"; } + return $message; } /** diff --git a/3rdparty/class.smtp.php b/3rdparty/class.smtp.php index 07c275936c..6977bffad1 100644 --- a/3rdparty/class.smtp.php +++ b/3rdparty/class.smtp.php @@ -2,7 +2,7 @@ /*~ class.smtp.php .---------------------------------------------------------------------------. | Software: PHPMailer - PHP email class | -| Version: 5.2 | +| Version: 5.2.1 | | Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ | | ------------------------------------------------------------------------- | | Admin: Jim Jagielski (project admininistrator) | @@ -10,7 +10,7 @@ | : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | | : Jim Jagielski (jimjag) jimjag@gmail.com | | Founder: Brent R. Matzelle (original founder) | -| Copyright (c) 2010-2011, Jim Jagielski. All Rights Reserved. | +| Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved. | | Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | | Copyright (c) 2001-2003, Brent R. Matzelle | | ------------------------------------------------------------------------- | @@ -30,7 +30,7 @@ * @author Marcus Bointon * @copyright 2004 - 2008 Andy Prevost * @author Jim Jagielski - * @copyright 2010 - 2011 Jim Jagielski + * @copyright 2010 - 2012 Jim Jagielski * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) * @version $Id: class.smtp.php 450 2010-06-23 16:46:33Z coolbru $ */ @@ -72,7 +72,7 @@ class SMTP { * Sets the SMTP PHPMailer Version number * @var string */ - public $Version = '5.2'; + public $Version = '5.2.1'; ///////////////////////////////////////////////// // PROPERTIES, PRIVATE AND PROTECTED @@ -797,7 +797,8 @@ class SMTP { */ private function get_lines() { $data = ""; - while($str = @fgets($this->smtp_conn,515)) { + while(!feof($this->smtp_conn)) { + $str = @fgets($this->smtp_conn,515); if($this->do_debug >= 4) { echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '
'; echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '
'; diff --git a/3rdparty/css/chosen-sprite.png b/3rdparty/css/chosen-sprite.png old mode 100644 new mode 100755 index f20db4439e..113dc9885a Binary files a/3rdparty/css/chosen-sprite.png and b/3rdparty/css/chosen-sprite.png differ diff --git a/3rdparty/css/chosen.css b/3rdparty/css/chosen.css old mode 100644 new mode 100755 index 96bae0fe95..89b5970e57 --- a/3rdparty/css/chosen.css +++ b/3rdparty/css/chosen.css @@ -1,16 +1,10 @@ /* @group Base */ -select.chzn-select { - visibility: hidden; - height: 28px !important; - min-height: 28px !important; -} .chzn-container { font-size: 13px; position: relative; display: inline-block; zoom: 1; *display: inline; - vertical-align: bottom; } .chzn-container .chzn-drop { background: #fff; @@ -29,31 +23,37 @@ select.chzn-select { /* @group Single Chosen */ .chzn-container-single .chzn-single { - background-color: #fff; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white)); - background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%); - background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%); - background-image: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%); - background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); - background-image: linear-gradient(top, #eeeeee 0%,#ffffff 50%); - -webkit-border-radius: 4px; - -moz-border-radius : 4px; - border-radius : 4px; + 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 #aaa; + 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: 26px; - line-height: 26px; + height: 23px; + line-height: 24px; padding: 0 0 0 8px; - color: #444; + color: #444444; text-decoration: none; } +.chzn-container-single .chzn-default { + color: #999; +} .chzn-container-single .chzn-single span { margin-right: 26px; display: block; @@ -61,25 +61,22 @@ select.chzn-select { white-space: nowrap; -o-text-overflow: ellipsis; -ms-text-overflow: ellipsis; - -moz-binding: url('/xml/ellipsis.xml#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 { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius : 0 4px 4px 0; - border-radius : 0 4px 4px 0; - -moz-background-clip : padding; - -webkit-background-clip: padding-box; - background-clip : padding-box; - 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%); - border-left: 1px solid #aaa; position: absolute; right: 0; top: 0; @@ -88,25 +85,26 @@ select.chzn-select { width: 18px; } .chzn-container-single .chzn-single div b { - background: url('chosen-sprite.png') no-repeat 0 1px; + 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% -20px; - background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); + 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; @@ -124,16 +122,20 @@ select.chzn-select { } /* @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, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background-image: -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background-image: -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); - background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%); + 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; @@ -156,6 +158,9 @@ select.chzn-select { color: #666; background: transparent !important; border: 0 !important; + font-family: sans-serif; + font-size: 100%; + height: 15px; padding: 5px; margin: 1px 0; outline: 0; @@ -175,21 +180,22 @@ select.chzn-select { -webkit-background-clip: padding-box; background-clip : padding-box; background-color: #e4e4e4; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #e4e4e4), color-stop(0.7, #eeeeee)); - background-image: -webkit-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); - background-image: -moz-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); - background-image: -o-linear-gradient(bottom, #e4e4e4 0%, #eeeeee 70%); - background-image: -ms-linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4e4e4', endColorstr='#eeeeee',GradientType=0 ); - background-image: linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); + 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 #b4b4b4; + border: 1px solid #aaaaaa; line-height: 13px; - padding: 3px 19px 3px 6px; + padding: 3px 20px 3px 5px; margin: 3px 0 3px 5px; position: relative; -} -.chzn-container-multi .chzn-choices .search-choice span { cursor: default; } .chzn-container-multi .chzn-choices .search-choice-focus { @@ -198,25 +204,25 @@ select.chzn-select { .chzn-container-multi .chzn-choices .search-choice .search-choice-close { display: block; position: absolute; - right: 5px; - top: 6px; - width: 8px; - height: 9px; + 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 -9px; + background-position: right -11px; } .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close { - background-position: right -9px; + background-position: right -11px; } /* @end */ /* @group Results */ .chzn-container .chzn-results { margin: 0 4px 4px 0; - max-height: 190px; + max-height: 240px; padding: 0 0 0 4px; position: relative; overflow-x: hidden; @@ -227,16 +233,25 @@ select.chzn-select { padding: 0; } .chzn-container .chzn-results li { - line-height: 80%; - padding: 7px 7px 8px; + 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: #3875d7; + 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 { @@ -248,6 +263,7 @@ select.chzn-select { } .chzn-container .chzn-results .no-results { background: #f4f4f4; + display: list-item; } .chzn-container .chzn-results .group-result { cursor: default; @@ -255,11 +271,34 @@ select.chzn-select { font-weight: bold; } .chzn-container .chzn-results .group-option { - padding-left: 20px; + 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 */ @@ -277,13 +316,13 @@ select.chzn-select { -o-box-shadow : 0 1px 0 #fff inset; box-shadow : 0 1px 0 #fff inset; background-color: #eee; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee)); - background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%); - background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%); - background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%); - background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); - background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%); + 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; @@ -310,32 +349,44 @@ select.chzn-select { } /* @end */ -/* @group Right to Left */ -.chzn-rtl { direction:rtl;text-align: right; } -.chzn-rtl .chzn-single { padding-left: 0; padding-right: 8px; } -.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; } -.chzn-rtl .chzn-single div { - left: 0; right: auto; - border-left: none; border-right: 1px solid #aaaaaa; - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius : 4px 0 0 4px; - border-radius : 4px 0 0 4px; +/* @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 6px 3px 19px; margin: 3px 5px 3px 0; } -.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 5px; right: auto; background-position: right top;} -.chzn-rtl.chzn-container-single .chzn-results { margin-left: 4px; margin-right: 0; padding-left: 0; padding-right: 4px; } -.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 20px; } +.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: url('chosen-sprite.png') no-repeat -38px -20px, #ffffff; - background: url('chosen-sprite.png') no-repeat -38px -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('chosen-sprite.png') no-repeat -38px -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); + 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 */ \ No newline at end of file +/* @end */ diff --git a/3rdparty/css/chosen/chosen.css b/3rdparty/css/chosen/chosen.css old mode 100644 new mode 100755 index b9c6d88028..89b5970e57 --- a/3rdparty/css/chosen/chosen.css +++ b/3rdparty/css/chosen/chosen.css @@ -23,31 +23,37 @@ /* @group Single Chosen */ .chzn-container-single .chzn-single { - background-color: #fff; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white)); - background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%); - background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%); - background-image: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%); - background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); - background-image: linear-gradient(top, #eeeeee 0%,#ffffff 50%); - -webkit-border-radius: 4px; - -moz-border-radius : 4px; - border-radius : 4px; + 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 #aaa; + 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: 26px; - line-height: 26px; + height: 23px; + line-height: 24px; padding: 0 0 0 8px; - color: #444; + color: #444444; text-decoration: none; } +.chzn-container-single .chzn-default { + color: #999; +} .chzn-container-single .chzn-single span { margin-right: 26px; display: block; @@ -61,7 +67,7 @@ display: block; position: absolute; right: 26px; - top: 8px; + top: 6px; width: 12px; height: 13px; font-size: 1px; @@ -71,21 +77,6 @@ background-position: right -11px; } .chzn-container-single .chzn-single div { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius : 0 4px 4px 0; - border-radius : 0 4px 4px 0; - -moz-background-clip : padding; - -webkit-background-clip: padding-box; - background-clip : padding-box; - 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%); - border-left: 1px solid #aaa; position: absolute; right: 0; top: 0; @@ -94,7 +85,7 @@ width: 18px; } .chzn-container-single .chzn-single div b { - background: url('chosen-sprite.png') no-repeat 0 1px; + background: url('chosen-sprite.png') no-repeat 0 0; display: block; width: 100%; height: 100%; @@ -104,16 +95,16 @@ 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, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); + 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; @@ -139,13 +130,12 @@ /* @group Multi Chosen */ .chzn-container-multi .chzn-choices { background-color: #fff; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background-image: -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background-image: -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); - background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%); + 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; @@ -168,6 +158,9 @@ color: #666; background: transparent !important; border: 0 !important; + font-family: sans-serif; + font-size: 100%; + height: 15px; padding: 5px; margin: 1px 0; outline: 0; @@ -187,21 +180,22 @@ -webkit-background-clip: padding-box; background-clip : padding-box; background-color: #e4e4e4; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #e4e4e4), color-stop(0.7, #eeeeee)); - background-image: -webkit-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); - background-image: -moz-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); - background-image: -o-linear-gradient(bottom, #e4e4e4 0%, #eeeeee 70%); - background-image: -ms-linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4e4e4', endColorstr='#eeeeee',GradientType=0 ); - background-image: linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); + 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 #b4b4b4; + border: 1px solid #aaaaaa; line-height: 13px; - padding: 3px 19px 3px 6px; + padding: 3px 20px 3px 5px; margin: 3px 0 3px 5px; position: relative; -} -.chzn-container-multi .chzn-choices .search-choice span { cursor: default; } .chzn-container-multi .chzn-choices .search-choice-focus { @@ -228,7 +222,7 @@ /* @group Results */ .chzn-container .chzn-results { margin: 0 4px 4px 0; - max-height: 190px; + max-height: 240px; padding: 0 0 0 4px; position: relative; overflow-x: hidden; @@ -240,8 +234,8 @@ } .chzn-container .chzn-results li { display: none; - line-height: 80%; - padding: 7px 7px 8px; + line-height: 15px; + padding: 5px 6px; margin: 0; list-style: none; } @@ -250,7 +244,14 @@ display: list-item; } .chzn-container .chzn-results .highlighted { - background: #3875d7; + 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 { @@ -270,11 +271,34 @@ font-weight: bold; } .chzn-container .chzn-results .group-option { - padding-left: 20px; + 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 */ @@ -292,13 +316,13 @@ -o-box-shadow : 0 1px 0 #fff inset; box-shadow : 0 1px 0 #fff inset; background-color: #eee; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee)); - background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%); - background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%); - background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%); - background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); - background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%); + 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; @@ -338,31 +362,31 @@ } /* @group Right to Left */ -.chzn-rtl { direction:rtl;text-align: right; } -.chzn-rtl .chzn-single { padding-left: 0; padding-right: 8px; } -.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; } -.chzn-rtl .chzn-single div { - left: 0; right: auto; - border-left: none; border-right: 1px solid #aaaaaa; - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius : 4px 0 0 4px; - border-radius : 4px 0 0 4px; +.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 6px 3px 19px; margin: 3px 5px 3px 0; } -.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 5px; right: auto; background-position: right top;} -.chzn-rtl.chzn-container-single .chzn-results { margin-left: 4px; margin-right: 0; padding-left: 0; padding-right: 4px; } -.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 20px; } +.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: url('chosen-sprite.png') no-repeat -38px -22px, #ffffff; - background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); + 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 */ \ No newline at end of file +/* @end */ diff --git a/3rdparty/fullcalendar/css/fullcalendar.css b/3rdparty/fullcalendar/css/fullcalendar.css index 04f118493a..1f02ba428e 100644 --- a/3rdparty/fullcalendar/css/fullcalendar.css +++ b/3rdparty/fullcalendar/css/fullcalendar.css @@ -1,11 +1,11 @@ /* - * FullCalendar v1.5.3 Stylesheet + * FullCalendar v1.5.4 Stylesheet * * Copyright (c) 2011 Adam Shaw * Dual licensed under the MIT and GPL licenses, located in * MIT-LICENSE.txt and GPL-LICENSE.txt respectively. * - * Date: Mon Feb 6 22:40:40 2012 -0800 + * Date: Tue Sep 4 23:38:33 2012 -0700 * */ diff --git a/3rdparty/fullcalendar/css/fullcalendar.print.css b/3rdparty/fullcalendar/css/fullcalendar.print.css index e11c181637..227b80e0bc 100644 --- a/3rdparty/fullcalendar/css/fullcalendar.print.css +++ b/3rdparty/fullcalendar/css/fullcalendar.print.css @@ -1,5 +1,5 @@ /* - * FullCalendar v1.5.3 Print Stylesheet + * FullCalendar v1.5.4 Print Stylesheet * * Include this stylesheet on your page to get a more printer-friendly calendar. * When including this stylesheet, use the media='print' attribute of the tag. @@ -9,7 +9,7 @@ * Dual licensed under the MIT and GPL licenses, located in * MIT-LICENSE.txt and GPL-LICENSE.txt respectively. * - * Date: Mon Feb 6 22:40:40 2012 -0800 + * Date: Tue Sep 4 23:38:33 2012 -0700 * */ diff --git a/3rdparty/fullcalendar/js/fullcalendar.js b/3rdparty/fullcalendar/js/fullcalendar.js index 314f8c8a1a..d59de77c84 100644 --- a/3rdparty/fullcalendar/js/fullcalendar.js +++ b/3rdparty/fullcalendar/js/fullcalendar.js @@ -1,6 +1,6 @@ /** * @preserve - * FullCalendar v1.5.3 + * FullCalendar v1.5.4 * http://arshaw.com/fullcalendar/ * * Use fullcalendar.css for basic styling. @@ -11,7 +11,7 @@ * Dual licensed under the MIT and GPL licenses, located in * MIT-LICENSE.txt and GPL-LICENSE.txt respectively. * - * Date: Mon Feb 6 22:40:40 2012 -0800 + * Date: Tue Sep 4 23:38:33 2012 -0700 * */ @@ -111,7 +111,7 @@ var rtlDefaults = { -var fc = $.fullCalendar = { version: "1.5.3" }; +var fc = $.fullCalendar = { version: "1.5.4" }; var fcViews = fc.views = {}; @@ -1658,7 +1658,7 @@ function sliceSegs(events, visEventEnds, start, end) { msLength: segEnd - segStart }); } - } + } return segs.sort(segCmp); } @@ -1742,29 +1742,26 @@ function setOuterHeight(element, height, includeMargins) { } -// TODO: curCSS has been deprecated (jQuery 1.4.3 - 10/16/2010) - - function hsides(element, includeMargins) { return hpadding(element) + hborders(element) + (includeMargins ? hmargins(element) : 0); } function hpadding(element) { - return (parseFloat($.curCSS(element[0], 'paddingLeft', true)) || 0) + - (parseFloat($.curCSS(element[0], 'paddingRight', true)) || 0); + return (parseFloat($.css(element[0], 'paddingLeft', true)) || 0) + + (parseFloat($.css(element[0], 'paddingRight', true)) || 0); } function hmargins(element) { - return (parseFloat($.curCSS(element[0], 'marginLeft', true)) || 0) + - (parseFloat($.curCSS(element[0], 'marginRight', true)) || 0); + return (parseFloat($.css(element[0], 'marginLeft', true)) || 0) + + (parseFloat($.css(element[0], 'marginRight', true)) || 0); } function hborders(element) { - return (parseFloat($.curCSS(element[0], 'borderLeftWidth', true)) || 0) + - (parseFloat($.curCSS(element[0], 'borderRightWidth', true)) || 0); + return (parseFloat($.css(element[0], 'borderLeftWidth', true)) || 0) + + (parseFloat($.css(element[0], 'borderRightWidth', true)) || 0); } @@ -1774,20 +1771,20 @@ function vsides(element, includeMargins) { function vpadding(element) { - return (parseFloat($.curCSS(element[0], 'paddingTop', true)) || 0) + - (parseFloat($.curCSS(element[0], 'paddingBottom', true)) || 0); + return (parseFloat($.css(element[0], 'paddingTop', true)) || 0) + + (parseFloat($.css(element[0], 'paddingBottom', true)) || 0); } function vmargins(element) { - return (parseFloat($.curCSS(element[0], 'marginTop', true)) || 0) + - (parseFloat($.curCSS(element[0], 'marginBottom', true)) || 0); + return (parseFloat($.css(element[0], 'marginTop', true)) || 0) + + (parseFloat($.css(element[0], 'marginBottom', true)) || 0); } function vborders(element) { - return (parseFloat($.curCSS(element[0], 'borderTopWidth', true)) || 0) + - (parseFloat($.curCSS(element[0], 'borderBottomWidth', true)) || 0); + return (parseFloat($.css(element[0], 'borderTopWidth', true)) || 0) + + (parseFloat($.css(element[0], 'borderBottomWidth', true)) || 0); } @@ -1956,7 +1953,6 @@ function firstDefined() { } - fcViews.month = MonthView; function MonthView(element, calendar) { @@ -4662,7 +4658,7 @@ function DayEventRenderer() { ""; } html += - "" + event.title + "" + + "" + htmlEscape(event.title) + "" + ""; if (seg.isEnd && isEventResizable(event)) { html += diff --git a/3rdparty/fullcalendar/js/fullcalendar.min.js b/3rdparty/fullcalendar/js/fullcalendar.min.js index df37bdfd80..da6c7c09fd 100644 --- a/3rdparty/fullcalendar/js/fullcalendar.min.js +++ b/3rdparty/fullcalendar/js/fullcalendar.min.js @@ -1,6 +1,6 @@ /* - FullCalendar v1.5.3 + FullCalendar v1.5.4 http://arshaw.com/fullcalendar/ Use fullcalendar.css for basic styling. @@ -11,7 +11,7 @@ Dual licensed under the MIT and GPL licenses, located in MIT-LICENSE.txt and GPL-LICENSE.txt respectively. - Date: Mon Feb 6 22:40:40 2012 -0800 + Date: Tue Sep 4 23:38:33 2012 -0700 */ (function(m,ma){function wb(a){m.extend(true,Ya,a)}function Yb(a,b,e){function d(k){if(E){u();q();na();S(k)}else f()}function f(){B=b.theme?"ui":"fc";a.addClass("fc");b.isRTL&&a.addClass("fc-rtl");b.theme&&a.addClass("ui-widget");E=m("
").prependTo(a);C=new Zb(X,b);(P=C.render())&&a.prepend(P);y(b.defaultView);m(window).resize(oa);t()||g()}function g(){setTimeout(function(){!n.start&&t()&&S()},0)}function l(){m(window).unbind("resize",oa);C.destroy(); @@ -39,10 +39,10 @@ a[12])*1E3);lb(e,b)}else{e.setUTCFullYear(a[1],a[3]?a[3]-1:0,a[5]||1);e.setUTCHo 10):0)}}function Oa(a,b,e){return ib(a,null,b,e)}function ib(a,b,e,d){d=d||Ya;var f=a,g=b,l,j=e.length,t,y,S,Q="";for(l=0;ll;y--)if(S=dc[e.substring(l,y)]){if(f)Q+=S(f,d);l=y-1;break}if(y==l)if(f)Q+=t}}return Q}function Ua(a){return a.end?ec(a.end,a.allDay):ba(N(a.start),1)}function ec(a,b){a=N(a);return b||a.getHours()||a.getMinutes()?ba(a,1):Ka(a)}function fc(a,b){return(b.msLength-a.msLength)*100+(a.event.start-b.event.start)}function Cb(a,b){return a.end>b.start&&a.starte&&td){y=N(d);Q=false}else{y=y;Q=true}f.push({event:j,start:t,end:y,isStart:S,isEnd:Q,msLength:y-t})}}return f.sort(fc)}function ob(a){var b=[],e,d=a.length,f,g,l,j;for(e=0;e=0;e--){d=a[b[e].toLowerCase()];if(d!== -ma)return d}return a[""]}function Qa(a){return a.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function Ib(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function qb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}function ab(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")} +g._fci)!==ma){g._fci=ma;g=b[f];e(g.event,g.element,g);m(d.target).trigger(d)}d.stopPropagation()})}function Va(a,b,e){for(var d=0,f;d=0;e--){d=a[b[e].toLowerCase()];if(d!==ma)return d}return a[""]}function Qa(a){return a.replace(/&/g, +"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function Ib(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function qb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}function ab(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")} function rb(a,b){a.each(function(e,d){d.className=d.className.replace(/^fc-\w*/,"fc-"+lc[b.getDay()])})}function Jb(a,b){var e=a.source||{},d=a.color,f=e.color,g=b("eventColor"),l=a.backgroundColor||d||e.backgroundColor||f||b("eventBackgroundColor")||g;d=a.borderColor||d||e.borderColor||f||b("eventBorderColor")||g;a=a.textColor||e.textColor||b("eventTextColor");b=[];l&&b.push("background-color:"+l);d&&b.push("border-color:"+d);a&&b.push("color:"+a);return b.join(";")}function $a(a,b,e){if(m.isFunction(a))a= [a];if(a){var d,f;for(d=0;d=e[t][0]&&g' + option.html + ''; + } else { + return ""; + } + }; + + AbstractChosen.prototype.results_update_field = function() { + this.result_clear_highlight(); + this.result_single_selected = null; + return this.results_build(); + }; + + AbstractChosen.prototype.results_toggle = function() { + if (this.results_showing) { + return this.results_hide(); + } else { + return this.results_show(); + } + }; + + AbstractChosen.prototype.results_search = function(evt) { + if (this.results_showing) { + return this.winnow_results(); + } else { + return this.results_show(); + } + }; + + AbstractChosen.prototype.keyup_checker = function(evt) { + var stroke, _ref; + stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; + this.search_field_scale(); + switch (stroke) { + case 8: + if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) { + return this.keydown_backstroke(); + } else if (!this.pending_backstroke) { + this.result_clear_highlight(); + return this.results_search(); + } + break; + case 13: + evt.preventDefault(); + if (this.results_showing) return this.result_select(evt); + break; + case 27: + if (this.results_showing) this.results_hide(); + return true; + case 9: + case 38: + case 40: + case 16: + case 91: + case 17: + break; + default: + return this.results_search(); + } + }; + + AbstractChosen.prototype.generate_field_id = function() { + var new_id; + new_id = this.generate_random_id(); + this.form_field.id = new_id; + return new_id; + }; + + AbstractChosen.prototype.generate_random_char = function() { + var chars, newchar, rand; + chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ"; + rand = Math.floor(Math.random() * chars.length); + return newchar = chars.substring(rand, rand + 1); + }; + + return AbstractChosen; + + })(); + + root.AbstractChosen = AbstractChosen; + +}).call(this); + +/* +Chosen source: generate output using 'cake build' +Copyright (c) 2011 by Harvest +*/ + +(function() { + var $, Chosen, get_side_border_padding, root, + __hasProp = Object.prototype.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }; + + root = this; + + $ = jQuery; + + $.fn.extend({ + chosen: function(options) { + if ($.browser.msie && ($.browser.version === "6.0" || $.browser.version === "7.0")) { + return this; + } + return $(this).each(function(input_field) { + if (!($(this)).hasClass("chzn-done")) return new Chosen(this, options); + }); + } + }); + + Chosen = (function(_super) { + + __extends(Chosen, _super); + + function Chosen() { + Chosen.__super__.constructor.apply(this, arguments); + } + + Chosen.prototype.setup = function() { + this.form_field_jq = $(this.form_field); + return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl"); + }; + + Chosen.prototype.finish_setup = function() { + return this.form_field_jq.addClass("chzn-done"); + }; + Chosen.prototype.set_up_html = function() { var container_div, dd_top, dd_width, sf_width; this.container_id = this.form_field.id.length ? this.form_field.id.replace(/(:|\.)/g, '_') : this.generate_field_id(); @@ -71,14 +308,11 @@ if (this.is_multiple) { container_div.html('
    '); } else { - container_div.html('' + this.default_text + '
      '); + container_div.html('' + this.default_text + '
        '); } this.form_field_jq.hide().after(container_div); this.container = $('#' + this.container_id); this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single")); - if (!this.is_multiple && this.form_field.options.length <= this.disable_search_threshold) { - this.container.addClass("chzn-container-single-nosearch"); - } this.dropdown = this.container.find('div.chzn-drop').first(); dd_top = this.container.height(); dd_width = this.f_width - get_side_border_padding(this.dropdown); @@ -102,83 +336,92 @@ }); } this.results_build(); - return this.set_tab_index(); + this.set_tab_index(); + return this.form_field_jq.trigger("liszt:ready", { + chosen: this + }); }; + Chosen.prototype.register_observers = function() { - this.container.mousedown(__bind(function(evt) { - return this.container_mousedown(evt); - }, this)); - this.container.mouseup(__bind(function(evt) { - return this.container_mouseup(evt); - }, this)); - this.container.mouseenter(__bind(function(evt) { - return this.mouse_enter(evt); - }, this)); - this.container.mouseleave(__bind(function(evt) { - return this.mouse_leave(evt); - }, this)); - this.search_results.mouseup(__bind(function(evt) { - return this.search_results_mouseup(evt); - }, this)); - this.search_results.mouseover(__bind(function(evt) { - return this.search_results_mouseover(evt); - }, this)); - this.search_results.mouseout(__bind(function(evt) { - return this.search_results_mouseout(evt); - }, this)); - this.form_field_jq.bind("liszt:updated", __bind(function(evt) { - return this.results_update_field(evt); - }, this)); - this.search_field.blur(__bind(function(evt) { - return this.input_blur(evt); - }, this)); - this.search_field.keyup(__bind(function(evt) { - return this.keyup_checker(evt); - }, this)); - this.search_field.keydown(__bind(function(evt) { - return this.keydown_checker(evt); - }, this)); + var _this = this; + this.container.mousedown(function(evt) { + return _this.container_mousedown(evt); + }); + this.container.mouseup(function(evt) { + return _this.container_mouseup(evt); + }); + this.container.mouseenter(function(evt) { + return _this.mouse_enter(evt); + }); + this.container.mouseleave(function(evt) { + return _this.mouse_leave(evt); + }); + this.search_results.mouseup(function(evt) { + return _this.search_results_mouseup(evt); + }); + this.search_results.mouseover(function(evt) { + return _this.search_results_mouseover(evt); + }); + this.search_results.mouseout(function(evt) { + return _this.search_results_mouseout(evt); + }); + this.form_field_jq.bind("liszt:updated", function(evt) { + return _this.results_update_field(evt); + }); + this.search_field.blur(function(evt) { + return _this.input_blur(evt); + }); + this.search_field.keyup(function(evt) { + return _this.keyup_checker(evt); + }); + this.search_field.keydown(function(evt) { + return _this.keydown_checker(evt); + }); if (this.is_multiple) { - this.search_choices.click(__bind(function(evt) { - return this.choices_click(evt); - }, this)); - return this.search_field.focus(__bind(function(evt) { - return this.input_focus(evt); - }, this)); + this.search_choices.click(function(evt) { + return _this.choices_click(evt); + }); + return this.search_field.focus(function(evt) { + return _this.input_focus(evt); + }); + } else { + return this.container.click(function(evt) { + return evt.preventDefault(); + }); } }; + Chosen.prototype.search_field_disabled = function() { - this.is_disabled = this.form_field_jq.attr('disabled'); + this.is_disabled = this.form_field_jq[0].disabled; if (this.is_disabled) { this.container.addClass('chzn-disabled'); - this.search_field.attr('disabled', true); + this.search_field[0].disabled = true; if (!this.is_multiple) { this.selected_item.unbind("focus", this.activate_action); } return this.close_field(); } else { this.container.removeClass('chzn-disabled'); - this.search_field.attr('disabled', false); + this.search_field[0].disabled = false; if (!this.is_multiple) { return this.selected_item.bind("focus", this.activate_action); } } }; + Chosen.prototype.container_mousedown = function(evt) { var target_closelink; if (!this.is_disabled) { target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false; - if (evt && evt.type === "mousedown") { + if (evt && evt.type === "mousedown" && !this.results_showing) { evt.stopPropagation(); } if (!this.pending_destroy_click && !target_closelink) { if (!this.active_field) { - if (this.is_multiple) { - this.search_field.val(""); - } + if (this.is_multiple) this.search_field.val(""); $(document).click(this.click_test_action); this.results_show(); - } else if (!this.is_multiple && evt && ($(evt.target) === this.selected_item || $(evt.target).parents("a.chzn-single").length)) { + } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) { evt.preventDefault(); this.results_toggle(); } @@ -188,37 +431,17 @@ } } }; + Chosen.prototype.container_mouseup = function(evt) { - if (evt.target.nodeName === "ABBR") { - return this.results_reset(evt); - } - }; - Chosen.prototype.mouse_enter = function() { - return this.mouse_on_container = true; - }; - Chosen.prototype.mouse_leave = function() { - return this.mouse_on_container = false; - }; - Chosen.prototype.input_focus = function(evt) { - if (!this.active_field) { - return setTimeout((__bind(function() { - return this.container_mousedown(); - }, this)), 50); - } - }; - Chosen.prototype.input_blur = function(evt) { - if (!this.mouse_on_container) { - this.active_field = false; - return setTimeout((__bind(function() { - return this.blur_test(); - }, this)), 100); - } + if (evt.target.nodeName === "ABBR") return this.results_reset(evt); }; + Chosen.prototype.blur_test = function(evt) { if (!this.active_field && this.container.hasClass("chzn-container-active")) { return this.close_field(); } }; + Chosen.prototype.close_field = function() { $(document).unbind("click", this.click_test_action); if (!this.is_multiple) { @@ -233,6 +456,7 @@ this.show_search_field_default(); return this.search_field_scale(); }; + Chosen.prototype.activate_field = function() { if (!this.is_multiple && !this.active_field) { this.search_field.attr("tabindex", this.selected_item.attr("tabindex")); @@ -243,6 +467,7 @@ this.search_field.val(this.search_field.val()); return this.search_field.focus(); }; + Chosen.prototype.test_active_click = function(evt) { if ($(evt.target).parents('#' + this.container_id).length) { return this.active_field = true; @@ -250,9 +475,9 @@ return this.close_field(); } }; + Chosen.prototype.results_build = function() { - var content, data, startTime, _i, _len, _ref; - startTime = new Date(); + var content, data, _i, _len, _ref; this.parsing = true; this.results_data = root.SelectParser.select_to_array(this.form_field); if (this.is_multiple && this.choices > 0) { @@ -260,6 +485,11 @@ this.choices = 0; } else if (!this.is_multiple) { this.selected_item.find("span").text(this.default_text); + if (this.form_field.options.length <= this.disable_search_threshold) { + this.container.addClass("chzn-container-single-nosearch"); + } else { + this.container.removeClass("chzn-container-single-nosearch"); + } } content = ''; _ref = this.results_data; @@ -272,10 +502,8 @@ if (data.selected && this.is_multiple) { this.choice_build(data); } else if (data.selected && !this.is_multiple) { - this.selected_item.find("span").text(data.text); - if (this.allow_single_deselect) { - this.selected_item.find("span").first().after(""); - } + this.selected_item.removeClass("chzn-default").find("span").text(data.text); + if (this.allow_single_deselect) this.single_deselect_control_build(); } } } @@ -285,6 +513,7 @@ this.search_results.html(content); return this.parsing = false; }; + Chosen.prototype.result_add_group = function(group) { if (!group.disabled) { group.dom_id = this.container_id + "_g_" + group.array_index; @@ -293,31 +522,7 @@ return ""; } }; - Chosen.prototype.result_add_option = function(option) { - var classes, style; - if (!option.disabled) { - option.dom_id = this.container_id + "_o_" + option.array_index; - classes = option.selected && this.is_multiple ? [] : ["active-result"]; - if (option.selected) { - classes.push("result-selected"); - } - if (option.group_array_index != null) { - classes.push("group-option"); - } - if (option.classes !== "") { - classes.push(option.classes); - } - style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : ""; - return '
      • ' + option.html + '
      • '; - } else { - return ""; - } - }; - Chosen.prototype.results_update_field = function() { - this.result_clear_highlight(); - this.result_single_selected = null; - return this.results_build(); - }; + Chosen.prototype.result_do_highlight = function(el) { var high_bottom, high_top, maxHeight, visible_bottom, visible_top; if (el.length) { @@ -336,19 +541,12 @@ } } }; + Chosen.prototype.result_clear_highlight = function() { - if (this.result_highlight) { - this.result_highlight.removeClass("highlighted"); - } + if (this.result_highlight) this.result_highlight.removeClass("highlighted"); return this.result_highlight = null; }; - Chosen.prototype.results_toggle = function() { - if (this.results_showing) { - return this.results_hide(); - } else { - return this.results_show(); - } - }; + Chosen.prototype.results_show = function() { var dd_top; if (!this.is_multiple) { @@ -367,6 +565,7 @@ this.search_field.val(this.search_field.val()); return this.winnow_results(); }; + Chosen.prototype.results_hide = function() { if (!this.is_multiple) { this.selected_item.removeClass("chzn-single-with-drop"); @@ -377,6 +576,7 @@ }); return this.results_showing = false; }; + Chosen.prototype.set_tab_index = function(el) { var ti; if (this.form_field_jq.attr("tabindex")) { @@ -390,6 +590,7 @@ } } }; + Chosen.prototype.show_search_field_default = function() { if (this.is_multiple && this.choices < 1 && !this.active_field) { this.search_field.val(this.default_text); @@ -399,6 +600,7 @@ return this.search_field.removeClass("default"); } }; + Chosen.prototype.search_results_mouseup = function(evt) { var target; target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); @@ -407,34 +609,38 @@ return this.result_select(evt); } }; + Chosen.prototype.search_results_mouseover = function(evt) { var target; target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); - if (target) { - return this.result_do_highlight(target); - } + if (target) return this.result_do_highlight(target); }; + Chosen.prototype.search_results_mouseout = function(evt) { if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) { return this.result_clear_highlight(); } }; + Chosen.prototype.choices_click = function(evt) { evt.preventDefault(); if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) { return this.results_show(); } }; + Chosen.prototype.choice_build = function(item) { - var choice_id, link; + var choice_id, link, + _this = this; choice_id = this.container_id + "_c_" + item.array_index; this.choices += 1; this.search_container.before('
      • ' + item.html + '
      • '); link = $('#' + choice_id).find("a").first(); - return link.click(__bind(function(evt) { - return this.choice_destroy_link_click(evt); - }, this)); + return link.click(function(evt) { + return _this.choice_destroy_link_click(evt); + }); }; + Chosen.prototype.choice_destroy_link_click = function(evt) { evt.preventDefault(); if (!this.is_disabled) { @@ -444,6 +650,7 @@ return evt.stopPropagation; } }; + Chosen.prototype.choice_destroy = function(link) { this.choices -= 1; this.show_search_field_default(); @@ -453,16 +660,17 @@ this.result_deselect(link.attr("rel")); return link.parents('li').first().remove(); }; + Chosen.prototype.results_reset = function(evt) { this.form_field.options[0].selected = true; this.selected_item.find("span").text(this.default_text); + if (!this.is_multiple) this.selected_item.addClass("chzn-default"); this.show_search_field_default(); $(evt.target).remove(); this.form_field_jq.trigger("change"); - if (this.active_field) { - return this.results_hide(); - } + if (this.active_field) return this.results_hide(); }; + Chosen.prototype.result_select = function(evt) { var high, high_id, item, position; if (this.result_highlight) { @@ -474,6 +682,7 @@ } else { this.search_results.find(".result-selected").removeClass("result-selected"); this.result_single_selected = high; + this.selected_item.removeClass("chzn-default"); } high.addClass("result-selected"); position = high_id.substr(high_id.lastIndexOf("_") + 1); @@ -484,24 +693,23 @@ this.choice_build(item); } else { this.selected_item.find("span").first().text(item.text); - if (this.allow_single_deselect) { - this.selected_item.find("span").first().after(""); - } - } - if (!(evt.metaKey && this.is_multiple)) { - this.results_hide(); + if (this.allow_single_deselect) this.single_deselect_control_build(); } + if (!(evt.metaKey && this.is_multiple)) this.results_hide(); this.search_field.val(""); this.form_field_jq.trigger("change"); return this.search_field_scale(); } }; + Chosen.prototype.result_activate = function(el) { return el.addClass("active-result"); }; + Chosen.prototype.result_deactivate = function(el) { return el.removeClass("active-result"); }; + Chosen.prototype.result_deselect = function(pos) { var result, result_data; result_data = this.results_data[pos]; @@ -514,30 +722,31 @@ this.form_field_jq.trigger("change"); return this.search_field_scale(); }; - Chosen.prototype.results_search = function(evt) { - if (this.results_showing) { - return this.winnow_results(); - } else { - return this.results_show(); + + Chosen.prototype.single_deselect_control_build = function() { + if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) { + return this.selected_item.find("span").first().after(""); } }; + Chosen.prototype.winnow_results = function() { - var found, option, part, parts, regex, result_id, results, searchText, startTime, startpos, text, zregex, _i, _j, _len, _len2, _ref; - startTime = new Date(); + var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref; this.no_results_clear(); results = 0; searchText = this.search_field.val() === this.default_text ? "" : $('
        ').text($.trim(this.search_field.val())).html(); - regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); + regexAnchor = this.search_contains ? "" : "^"; + regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); _ref = this.results_data; for (_i = 0, _len = _ref.length; _i < _len; _i++) { option = _ref[_i]; if (!option.disabled && !option.empty) { if (option.group) { - $('#' + option.dom_id).hide(); + $('#' + option.dom_id).css('display', 'none'); } else if (!(this.is_multiple && option.selected)) { found = false; result_id = option.dom_id; + result = $("#" + result_id); if (regex.test(option.html)) { found = true; results += 1; @@ -561,18 +770,16 @@ } else { text = option.html; } - if ($("#" + result_id).html !== text) { - $("#" + result_id).html(text); - } - this.result_activate($("#" + result_id)); + result.html(text); + this.result_activate(result); if (option.group_array_index != null) { - $("#" + this.results_data[option.group_array_index].dom_id).show(); + $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item'); } } else { if (this.result_highlight && result_id === this.result_highlight.attr('id')) { this.result_clear_highlight(); } - this.result_deactivate($("#" + result_id)); + this.result_deactivate(result); } } } @@ -583,6 +790,7 @@ return this.winnow_results_set_highlight(); } }; + Chosen.prototype.winnow_results_clear = function() { var li, lis, _i, _len, _results; this.search_field.val(""); @@ -591,46 +799,49 @@ for (_i = 0, _len = lis.length; _i < _len; _i++) { li = lis[_i]; li = $(li); - _results.push(li.hasClass("group-result") ? li.show() : !this.is_multiple || !li.hasClass("result-selected") ? this.result_activate(li) : void 0); + if (li.hasClass("group-result")) { + _results.push(li.css('display', 'auto')); + } else if (!this.is_multiple || !li.hasClass("result-selected")) { + _results.push(this.result_activate(li)); + } else { + _results.push(void 0); + } } return _results; }; + Chosen.prototype.winnow_results_set_highlight = function() { var do_high, selected_results; if (!this.result_highlight) { selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : []; do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first(); - if (do_high != null) { - return this.result_do_highlight(do_high); - } + if (do_high != null) return this.result_do_highlight(do_high); } }; + Chosen.prototype.no_results = function(terms) { var no_results_html; no_results_html = $('
      • ' + this.results_none_found + ' ""
      • '); no_results_html.find("span").first().html(terms); return this.search_results.append(no_results_html); }; + Chosen.prototype.no_results_clear = function() { return this.search_results.find(".no-results").remove(); }; + Chosen.prototype.keydown_arrow = function() { var first_active, next_sib; if (!this.result_highlight) { first_active = this.search_results.find("li.active-result").first(); - if (first_active) { - this.result_do_highlight($(first_active)); - } + if (first_active) this.result_do_highlight($(first_active)); } else if (this.results_showing) { next_sib = this.result_highlight.nextAll("li.active-result").first(); - if (next_sib) { - this.result_do_highlight(next_sib); - } - } - if (!this.results_showing) { - return this.results_show(); + if (next_sib) this.result_do_highlight(next_sib); } + if (!this.results_showing) return this.results_show(); }; + Chosen.prototype.keyup_arrow = function() { var prev_sibs; if (!this.results_showing && !this.is_multiple) { @@ -640,13 +851,12 @@ if (prev_sibs.length) { return this.result_do_highlight(prev_sibs.first()); } else { - if (this.choices > 0) { - this.results_hide(); - } + if (this.choices > 0) this.results_hide(); return this.result_clear_highlight(); } } }; + Chosen.prototype.keydown_backstroke = function() { if (this.pending_backstroke) { this.choice_destroy(this.pending_backstroke.find("a").first()); @@ -656,59 +866,25 @@ return this.pending_backstroke.addClass("search-choice-focus"); } }; + Chosen.prototype.clear_backstroke = function() { if (this.pending_backstroke) { this.pending_backstroke.removeClass("search-choice-focus"); } return this.pending_backstroke = null; }; - Chosen.prototype.keyup_checker = function(evt) { - var stroke, _ref; - stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; - this.search_field_scale(); - switch (stroke) { - case 8: - if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) { - return this.keydown_backstroke(); - } else if (!this.pending_backstroke) { - this.result_clear_highlight(); - return this.results_search(); - } - break; - case 13: - evt.preventDefault(); - if (this.results_showing) { - return this.result_select(evt); - } - break; - case 27: - if (this.results_showing) { - return this.results_hide(); - } - break; - case 9: - case 38: - case 40: - case 16: - case 91: - case 17: - break; - default: - return this.results_search(); - } - }; + Chosen.prototype.keydown_checker = function(evt) { var stroke, _ref; stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; this.search_field_scale(); - if (stroke !== 8 && this.pending_backstroke) { - this.clear_backstroke(); - } + if (stroke !== 8 && this.pending_backstroke) this.clear_backstroke(); switch (stroke) { case 8: this.backstroke_length = this.search_field.val().length; break; case 9: + if (this.results_showing && !this.is_multiple) this.result_select(evt); this.mouse_on_container = false; break; case 13: @@ -723,6 +899,7 @@ break; } }; + Chosen.prototype.search_field_scale = function() { var dd_top, div, h, style, style_block, styles, w, _i, _len; if (this.is_multiple) { @@ -741,9 +918,7 @@ $('body').append(div); w = div.width() + 25; div.remove(); - if (w > this.f_width - 10) { - w = this.f_width - 10; - } + if (w > this.f_width - 10) w = this.f_width - 10; this.search_field.css({ 'width': w + 'px' }); @@ -753,12 +928,7 @@ }); } }; - Chosen.prototype.generate_field_id = function() { - var new_id; - new_id = this.generate_random_id(); - this.form_field.id = new_id; - return new_id; - }; + Chosen.prototype.generate_random_id = function() { var string; string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char(); @@ -767,91 +937,16 @@ } return string; }; - Chosen.prototype.generate_random_char = function() { - var chars, newchar, rand; - chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ"; - rand = Math.floor(Math.random() * chars.length); - return newchar = chars.substring(rand, rand + 1); - }; + return Chosen; - })(); + + })(AbstractChosen); + get_side_border_padding = function(elmt) { var side_border_padding; return side_border_padding = elmt.outerWidth() - elmt.width(); }; + root.get_side_border_padding = get_side_border_padding; -}).call(this); -(function() { - var SelectParser; - SelectParser = (function() { - function SelectParser() { - this.options_index = 0; - this.parsed = []; - } - SelectParser.prototype.add_node = function(child) { - if (child.nodeName === "OPTGROUP") { - return this.add_group(child); - } else { - return this.add_option(child); - } - }; - SelectParser.prototype.add_group = function(group) { - var group_position, option, _i, _len, _ref, _results; - group_position = this.parsed.length; - this.parsed.push({ - array_index: group_position, - group: true, - label: group.label, - children: 0, - disabled: group.disabled - }); - _ref = group.childNodes; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - option = _ref[_i]; - _results.push(this.add_option(option, group_position, group.disabled)); - } - return _results; - }; - SelectParser.prototype.add_option = function(option, group_position, group_disabled) { - if (option.nodeName === "OPTION") { - if (option.text !== "") { - if (group_position != null) { - this.parsed[group_position].children += 1; - } - this.parsed.push({ - array_index: this.parsed.length, - options_index: this.options_index, - value: option.value, - text: option.text, - html: option.innerHTML, - selected: option.selected, - disabled: group_disabled === true ? group_disabled : option.disabled, - group_array_index: group_position, - classes: option.className, - style: option.style.cssText - }); - } else { - this.parsed.push({ - array_index: this.parsed.length, - options_index: this.options_index, - empty: true - }); - } - return this.options_index += 1; - } - }; - return SelectParser; - })(); - SelectParser.select_to_array = function(select) { - var child, parser, _i, _len, _ref; - parser = new SelectParser(); - _ref = select.childNodes; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - child = _ref[_i]; - parser.add_node(child); - } - return parser.parsed; - }; - this.SelectParser = SelectParser; + }).call(this); diff --git a/3rdparty/js/chosen/chosen.jquery.min.js b/3rdparty/js/chosen/chosen.jquery.min.js old mode 100644 new mode 100755 index 371ee53e7a..9ba164cc47 --- a/3rdparty/js/chosen/chosen.jquery.min.js +++ b/3rdparty/js/chosen/chosen.jquery.min.js @@ -1,10 +1,10 @@ // Chosen, a Select Box Enhancer for jQuery and Protoype // by Patrick Filler for Harvest, http://getharvest.com // -// Version 0.9.5 +// Version 0.9.8 // Full source at https://github.com/harvesthq/chosen // Copyright (c) 2011 Harvest http://getharvest.com // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md // This file is generated by `cake build`, do not edit it by hand. -(function(){var a,b,c,d,e=function(a,b){return function(){return a.apply(b,arguments)}};d=this,a=jQuery,a.fn.extend({chosen:function(c){return a.browser!=="msie"||a.browser.version!=="6.0"&&a.browser.version!=="7.0"?a(this).each(function(d){if(!a(this).hasClass("chzn-done"))return new b(this,c)}):this}}),b=function(){function b(b,c){this.form_field=b,this.options=c!=null?c:{},this.set_default_values(),this.form_field_jq=a(this.form_field),this.is_multiple=this.form_field.multiple,this.is_rtl=this.form_field_jq.hasClass("chzn-rtl"),this.default_text_default=this.form_field.multiple?"Select Some Options":"Select an Option",this.set_up_html(),this.register_observers(),this.form_field_jq.addClass("chzn-done")}b.prototype.set_default_values=function(){this.click_test_action=e(function(a){return this.test_active_click(a)},this),this.activate_action=e(function(a){return this.activate_field(a)},this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.choices=0;return this.results_none_found=this.options.no_results_text||"No results match"},b.prototype.set_up_html=function(){var b,d,e,f;this.container_id=this.form_field.id.length?this.form_field.id.replace(/(:|\.)/g,"_"):this.generate_field_id(),this.container_id+="_chzn",this.f_width=this.form_field_jq.outerWidth(),this.default_text=this.form_field_jq.data("placeholder")?this.form_field_jq.data("placeholder"):this.default_text_default,b=a("
        ",{id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+this.f_width+"px;"}),this.is_multiple?b.html('
          '):b.html(''+this.default_text+'
            '),this.form_field_jq.hide().after(b),this.container=a("#"+this.container_id),this.container.addClass("chzn-container-"+(this.is_multiple?"multi":"single")),!this.is_multiple&&this.form_field.options.length<=this.disable_search_threshold&&this.container.addClass("chzn-container-single-nosearch"),this.dropdown=this.container.find("div.chzn-drop").first(),d=this.container.height(),e=this.f_width-c(this.dropdown),this.dropdown.css({width:e+"px",top:d+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),f=e-c(this.search_container)-c(this.search_field),this.search_field.css({width:f+"px"})),this.results_build();return this.set_tab_index()},b.prototype.register_observers=function(){this.container.mousedown(e(function(a){return this.container_mousedown(a)},this)),this.container.mouseup(e(function(a){return this.container_mouseup(a)},this)),this.container.mouseenter(e(function(a){return this.mouse_enter(a)},this)),this.container.mouseleave(e(function(a){return this.mouse_leave(a)},this)),this.search_results.mouseup(e(function(a){return this.search_results_mouseup(a)},this)),this.search_results.mouseover(e(function(a){return this.search_results_mouseover(a)},this)),this.search_results.mouseout(e(function(a){return this.search_results_mouseout(a)},this)),this.form_field_jq.bind("liszt:updated",e(function(a){return this.results_update_field(a)},this)),this.search_field.blur(e(function(a){return this.input_blur(a)},this)),this.search_field.keyup(e(function(a){return this.keyup_checker(a)},this)),this.search_field.keydown(e(function(a){return this.keydown_checker(a)},this));if(this.is_multiple){this.search_choices.click(e(function(a){return this.choices_click(a)},this));return this.search_field.focus(e(function(a){return this.input_focus(a)},this))}},b.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq.attr("disabled");if(this.is_disabled){this.container.addClass("chzn-disabled"),this.search_field.attr("disabled",!0),this.is_multiple||this.selected_item.unbind("focus",this.activate_action);return this.close_field()}this.container.removeClass("chzn-disabled"),this.search_field.attr("disabled",!1);if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},b.prototype.container_mousedown=function(b){var c;if(!this.is_disabled){c=b!=null?a(b.target).hasClass("search-choice-close"):!1,b&&b.type==="mousedown"&&b.stopPropagation();if(!this.pending_destroy_click&&!c){this.active_field?!this.is_multiple&&b&&(a(b.target)===this.selected_item||a(b.target).parents("a.chzn-single").length)&&(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(document).click(this.click_test_action),this.results_show());return this.activate_field()}return this.pending_destroy_click=!1}},b.prototype.container_mouseup=function(a){if(a.target.nodeName==="ABBR")return this.results_reset(a)},b.prototype.mouse_enter=function(){return this.mouse_on_container=!0},b.prototype.mouse_leave=function(){return this.mouse_on_container=!1},b.prototype.input_focus=function(a){if(!this.active_field)return setTimeout(e(function(){return this.container_mousedown()},this),50)},b.prototype.input_blur=function(a){if(!this.mouse_on_container){this.active_field=!1;return setTimeout(e(function(){return this.blur_test()},this),100)}},b.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},b.prototype.close_field=function(){a(document).unbind("click",this.click_test_action),this.is_multiple||(this.selected_item.attr("tabindex",this.search_field.attr("tabindex")),this.search_field.attr("tabindex",-1)),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default();return this.search_field_scale()},b.prototype.activate_field=function(){!this.is_multiple&&!this.active_field&&(this.search_field.attr("tabindex",this.selected_item.attr("tabindex")),this.selected_item.attr("tabindex",-1)),this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val());return this.search_field.focus()},b.prototype.test_active_click=function(b){return a(b.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},b.prototype.results_build=function(){var a,b,c,e,f,g;c=new Date,this.parsing=!0,this.results_data=d.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||this.selected_item.find("span").text(this.default_text),a="",g=this.results_data;for(e=0,f=g.length;e')));this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(a);return this.parsing=!1},b.prototype.result_add_group=function(b){if(!b.disabled){b.dom_id=this.container_id+"_g_"+b.array_index;return'
          • '+a("
            ").text(b.label).html()+"
          • "}return""},b.prototype.result_add_option=function(a){var b,c;if(!a.disabled){a.dom_id=this.container_id+"_o_"+a.array_index,b=a.selected&&this.is_multiple?[]:["active-result"],a.selected&&b.push("result-selected"),a.group_array_index!=null&&b.push("group-option"),a.classes!==""&&b.push(a.classes),c=a.style.cssText!==""?' style="'+a.style+'"':"";return'
          • "+a.html+"
          • "}return""},b.prototype.results_update_field=function(){this.result_clear_highlight(),this.result_single_selected=null;return this.results_build()},b.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight();if(b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(c'+b.html+''),d=a("#"+c).find("a").first();return d.click(e(function(a){return this.choice_destroy_link_click(a)},this))},b.prototype.choice_destroy_link_click=function(b){b.preventDefault();if(!this.is_disabled){this.pending_destroy_click=!0;return this.choice_destroy(a(b.target))}return b.stopPropagation},b.prototype.choice_destroy=function(a){this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),this.result_deselect(a.attr("rel"));return a.parents("li").first().remove()},b.prototype.results_reset=function(b){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.show_search_field_default(),a(b.target).remove(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},b.prototype.result_select=function(a){var b,c,d,e;if(this.result_highlight){b=this.result_highlight,c=b.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(b):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=b),b.addClass("result-selected"),e=c.substr(c.lastIndexOf("_")+1),d=this.results_data[e],d.selected=!0,this.form_field.options[d.options_index].selected=!0,this.is_multiple?this.choice_build(d):(this.selected_item.find("span").first().text(d.text),this.allow_single_deselect&&this.selected_item.find("span").first().after('')),(!a.metaKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),this.form_field_jq.trigger("change");return this.search_field_scale()}},b.prototype.result_activate=function(a){return a.addClass("active-result")},b.prototype.result_deactivate=function(a){return a.removeClass("active-result")},b.prototype.result_deselect=function(b){var c,d;d=this.results_data[b],d.selected=!1,this.form_field.options[d.options_index].selected=!1,c=a("#"+this.container_id+"_o_"+b),c.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change");return this.search_field_scale()},b.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},b.prototype.winnow_results=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;j=new Date,this.no_results_clear(),h=0,i=this.search_field.val()===this.default_text?"":a("
            ").text(a.trim(this.search_field.val())).html(),f=new RegExp("^"+i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),m=new RegExp(i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),r=this.results_data;for(n=0,p=r.length;n=0||c.html.indexOf("[")===0){e=c.html.replace(/\[|\]/g,"").split(" ");if(e.length)for(o=0,q=e.length;o"+c.html.substr(k+i.length),l=l.substr(0,k)+""+l.substr(k)):l=c.html,a("#"+g).html!==l&&a("#"+g).html(l),this.result_activate(a("#"+g)),c.group_array_index!=null&&a("#"+this.results_data[c.group_array_index].dom_id).show()):(this.result_highlight&&g===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(a("#"+g)))}}return h<1&&i.length?this.no_results(i):this.winnow_results_set_highlight()},b.prototype.winnow_results_clear=function(){var b,c,d,e,f;this.search_field.val(""),c=this.search_results.find("li"),f=[];for(d=0,e=c.length;d'+this.results_none_found+' ""'),c.find("span").first().html(b);return this.search_results.append(c)},b.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},b.prototype.keydown_arrow=function(){var b,c;this.result_highlight?this.results_showing&&(c=this.result_highlight.nextAll("li.active-result").first(),c&&this.result_do_highlight(c)):(b=this.search_results.find("li.active-result").first(),b&&this.result_do_highlight(a(b)));if(!this.results_showing)return this.results_show()},b.prototype.keyup_arrow=function(){var a;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight){a=this.result_highlight.prevAll("li.active-result");if(a.length)return this.result_do_highlight(a.first());this.choices>0&&this.results_hide();return this.result_clear_highlight()}},b.prototype.keydown_backstroke=function(){if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke()}this.pending_backstroke=this.search_container.siblings("li.search-choice").last();return this.pending_backstroke.addClass("search-choice-focus")},b.prototype.clear_backstroke=function(){this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus");return this.pending_backstroke=null},b.prototype.keyup_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale();switch(b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke){this.result_clear_highlight();return this.results_search()}break;case 13:a.preventDefault();if(this.results_showing)return this.result_select(a);break;case 27:if(this.results_showing)return this.results_hide();break;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},b.prototype.keydown_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale(),b!==8&&this.pending_backstroke&&this.clear_backstroke();switch(b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},b.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(i=0,j=g.length;i",{style:f}),c.text(this.search_field.val()),a("body").append(c),h=c.width()+25,c.remove(),h>this.f_width-10&&(h=this.f_width-10),this.search_field.css({width:h+"px"}),b=this.container.height();return this.dropdown.css({top:b+"px"})}},b.prototype.generate_field_id=function(){var a;a=this.generate_random_id(),this.form_field.id=a;return a},b.prototype.generate_random_id=function(){var b;b="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(a("#"+b).length>0)b+=this.generate_random_char();return b},b.prototype.generate_random_char=function(){var a,b,c;a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ",c=Math.floor(Math.random()*a.length);return b=a.substring(c,c+1)};return b}(),c=function(a){var b;return b=a.outerWidth()-a.width()},d.get_side_border_padding=c}).call(this),function(){var a;a=function(){function a(){this.options_index=0,this.parsed=[]}a.prototype.add_node=function(a){return a.nodeName==="OPTGROUP"?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:a.label,children:0,disabled:a.disabled}),f=a.childNodes,g=[];for(d=0,e=f.length;d"+a.html+"")},a.prototype.results_update_field=function(){return this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.keyup_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale();switch(b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:a.preventDefault();if(this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.generate_field_id=function(){var a;return a=this.generate_random_id(),this.form_field.id=a,a},a.prototype.generate_random_char=function(){var a,b,c;return a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ",c=Math.floor(Math.random()*a.length),b=a.substring(c,c+1)},a}(),b.AbstractChosen=a}.call(this),function(){var a,b,c,d,e=Object.prototype.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=this,a=jQuery,a.fn.extend({chosen:function(c){return!a.browser.msie||a.browser.version!=="6.0"&&a.browser.version!=="7.0"?a(this).each(function(d){if(!a(this).hasClass("chzn-done"))return new b(this,c)}):this}}),b=function(b){function e(){e.__super__.constructor.apply(this,arguments)}return f(e,b),e.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},e.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},e.prototype.set_up_html=function(){var b,d,e,f;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/(:|\.)/g,"_"):this.generate_field_id(),this.container_id+="_chzn",this.f_width=this.form_field_jq.outerWidth(),this.default_text=this.form_field_jq.data("placeholder")?this.form_field_jq.data("placeholder"):this.default_text_default,b=a("
            ",{id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+this.f_width+"px;"}),this.is_multiple?b.html('
              '):b.html(''+this.default_text+'
                '),this.form_field_jq.hide().after(b),this.container=a("#"+this.container_id),this.container.addClass("chzn-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.find("div.chzn-drop").first(),d=this.container.height(),e=this.f_width-c(this.dropdown),this.dropdown.css({width:e+"px",top:d+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),f=e-c(this.search_container)-c(this.search_field),this.search_field.css({width:f+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},e.prototype.register_observers=function(){var a=this;return this.container.mousedown(function(b){return a.container_mousedown(b)}),this.container.mouseup(function(b){return a.container_mouseup(b)}),this.container.mouseenter(function(b){return a.mouse_enter(b)}),this.container.mouseleave(function(b){return a.mouse_leave(b)}),this.search_results.mouseup(function(b){return a.search_results_mouseup(b)}),this.search_results.mouseover(function(b){return a.search_results_mouseover(b)}),this.search_results.mouseout(function(b){return a.search_results_mouseout(b)}),this.form_field_jq.bind("liszt:updated",function(b){return a.results_update_field(b)}),this.search_field.blur(function(b){return a.input_blur(b)}),this.search_field.keyup(function(b){return a.keyup_checker(b)}),this.search_field.keydown(function(b){return a.keydown_checker(b)}),this.is_multiple?(this.search_choices.click(function(b){return a.choices_click(b)}),this.search_field.focus(function(b){return a.input_focus(b)})):this.container.click(function(a){return a.preventDefault()})},e.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},e.prototype.container_mousedown=function(b){var c;if(!this.is_disabled)return c=b!=null?a(b.target).hasClass("search-choice-close"):!1,b&&b.type==="mousedown"&&!this.results_showing&&b.stopPropagation(),!this.pending_destroy_click&&!c?(this.active_field?!this.is_multiple&&b&&(a(b.target)[0]===this.selected_item[0]||a(b.target).parents("a.chzn-single").length)&&(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},e.prototype.container_mouseup=function(a){if(a.target.nodeName==="ABBR")return this.results_reset(a)},e.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},e.prototype.close_field=function(){return a(document).unbind("click",this.click_test_action),this.is_multiple||(this.selected_item.attr("tabindex",this.search_field.attr("tabindex")),this.search_field.attr("tabindex",-1)),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},e.prototype.activate_field=function(){return!this.is_multiple&&!this.active_field&&(this.search_field.attr("tabindex",this.selected_item.attr("tabindex")),this.selected_item.attr("tabindex",-1)),this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},e.prototype.test_active_click=function(b){return a(b.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},e.prototype.results_build=function(){var a,b,c,e,f;this.parsing=!0,this.results_data=d.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.find("span").text(this.default_text),this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),a="",f=this.results_data;for(c=0,e=f.length;c'+a("
                ").text(b.label).html()+"")},e.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight();if(b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(c'+b.html+''),d=a("#"+c).find("a").first(),d.click(function(a){return e.choice_destroy_link_click(a)})},e.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),this.is_disabled?b.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(a(b.target)))},e.prototype.choice_destroy=function(a){return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),this.result_deselect(a.attr("rel")),a.parents("li").first().remove()},e.prototype.results_reset=function(b){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),a(b.target).remove(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},e.prototype.result_select=function(a){var b,c,d,e;if(this.result_highlight)return b=this.result_highlight,c=b.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(b):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=b,this.selected_item.removeClass("chzn-default")),b.addClass("result-selected"),e=c.substr(c.lastIndexOf("_")+1),d=this.results_data[e],d.selected=!0,this.form_field.options[d.options_index].selected=!0,this.is_multiple?this.choice_build(d):(this.selected_item.find("span").first().text(d.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!a.metaKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.result_activate=function(a){return a.addClass("active-result")},e.prototype.result_deactivate=function(a){return a.removeClass("active-result")},e.prototype.result_deselect=function(b){var c,d;return d=this.results_data[b],d.selected=!1,this.form_field.options[d.options_index].selected=!1,c=a("#"+this.container_id+"_o_"+b),c.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('')},e.prototype.winnow_results=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;this.no_results_clear(),j=0,k=this.search_field.val()===this.default_text?"":a("
                ").text(a.trim(this.search_field.val())).html(),g=this.search_contains?"":"^",f=new RegExp(g+k.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),n=new RegExp(k.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),s=this.results_data;for(o=0,q=s.length;o=0||c.html.indexOf("[")===0){e=c.html.replace(/\[|\]/g,"").split(" ");if(e.length)for(p=0,r=e.length;p"+c.html.substr(l+k.length),m=m.substr(0,l)+""+m.substr(l)):m=c.html,h.html(m),this.result_activate(h),c.group_array_index!=null&&a("#"+this.results_data[c.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&i===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(h))}}return j<1&&k.length?this.no_results(k):this.winnow_results_set_highlight()},e.prototype.winnow_results_clear=function(){var b,c,d,e,f;this.search_field.val(""),c=this.search_results.find("li"),f=[];for(d=0,e=c.length;d'+this.results_none_found+' ""'),c.find("span").first().html(b),this.search_results.append(c)},e.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},e.prototype.keydown_arrow=function(){var b,c;this.result_highlight?this.results_showing&&(c=this.result_highlight.nextAll("li.active-result").first(),c&&this.result_do_highlight(c)):(b=this.search_results.find("li.active-result").first(),b&&this.result_do_highlight(a(b)));if(!this.results_showing)return this.results_show()},e.prototype.keyup_arrow=function(){var a;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},e.prototype.keydown_backstroke=function(){return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(this.pending_backstroke=this.search_container.siblings("li.search-choice").last(),this.pending_backstroke.addClass("search-choice-focus"))},e.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},e.prototype.keydown_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale(),b!==8&&this.pending_backstroke&&this.clear_backstroke();switch(b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},e.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(i=0,j=g.length;i",{style:f}),c.text(this.search_field.val()),a("body").append(c),h=c.width()+25,c.remove(),h>this.f_width-10&&(h=this.f_width-10),this.search_field.css({width:h+"px"}),b=this.container.height(),this.dropdown.css({top:b+"px"})}},e.prototype.generate_random_id=function(){var b;b="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(a("#"+b).length>0)b+=this.generate_random_char();return b},e}(AbstractChosen),c=function(a){var b;return b=a.outerWidth()-a.width()},d.get_side_border_padding=c}.call(this) \ No newline at end of file diff --git a/3rdparty/miniColors/css/images/colors.png b/3rdparty/miniColors/css/images/colors.png index 1b4f819d8d..deb50a9ae1 100755 Binary files a/3rdparty/miniColors/css/images/colors.png and b/3rdparty/miniColors/css/images/colors.png differ diff --git a/3rdparty/miniColors/css/images/trigger.png b/3rdparty/miniColors/css/images/trigger.png index 8c169fd605..96c91294f3 100755 Binary files a/3rdparty/miniColors/css/images/trigger.png and b/3rdparty/miniColors/css/images/trigger.png differ diff --git a/3rdparty/miniColors/css/jquery.miniColors.css b/3rdparty/miniColors/css/jquery.miniColors.css index 381bc1dc06..592f44894d 100755 --- a/3rdparty/miniColors/css/jquery.miniColors.css +++ b/3rdparty/miniColors/css/jquery.miniColors.css @@ -1,19 +1,13 @@ -.miniColors-trigger { - height: 22px; - width: 22px; - background: url(images/trigger.png) center no-repeat; - vertical-align: middle; - margin: 0 .25em; - display: inline-block; - outline: none; +INPUT.miniColors { + margin-right: 4px; } .miniColors-selector { position: absolute; width: 175px; height: 150px; - background: #FFF; - border: solid 1px #BBB; + background: white; + border: solid 1px #bababa; -moz-box-shadow: 0 0 6px rgba(0, 0, 0, .25); -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, .25); box-shadow: 0 0 6px rgba(0, 0, 0, .25); @@ -24,9 +18,13 @@ z-index: 999999; } +.miniColors.opacity.miniColors-selector { + width: 200px; +} + .miniColors-selector.black { - background: #000; - border-color: #000; + background: black; + border-color: black; } .miniColors-colors { @@ -35,25 +33,43 @@ left: 5px; width: 150px; height: 150px; - background: url(images/colors.png) right no-repeat; + background: url(images/colors.png) -40px 0 no-repeat; cursor: crosshair; } +.miniColors.opacity .miniColors-colors { + left: 30px; +} + .miniColors-hues { position: absolute; top: 5px; left: 160px; width: 20px; height: 150px; - background: url(images/colors.png) left no-repeat; + background: url(images/colors.png) 0 0 no-repeat; + cursor: crosshair; +} + +.miniColors.opacity .miniColors-hues { + left: 185px; +} + +.miniColors-opacity { + position: absolute; + top: 5px; + left: 5px; + width: 20px; + height: 150px; + background: url(images/colors.png) -20px 0 no-repeat; cursor: crosshair; } .miniColors-colorPicker { position: absolute; - width: 9px; - height: 9px; - border: 1px solid #fff; + width: 11px; + height: 11px; + border: 1px solid black; -moz-border-radius: 11px; -webkit-border-radius: 11px; border-radius: 11px; @@ -64,18 +80,46 @@ left: 0; width: 7px; height: 7px; - border: 1px solid #000; + border: 2px solid white; -moz-border-radius: 9px; -webkit-border-radius: 9px; border-radius: 9px; } -.miniColors-huePicker { +.miniColors-huePicker, +.miniColors-opacityPicker { position: absolute; - left: -3px; - width: 24px; - height: 1px; - border: 1px solid #fff; + left: -2px; + width: 22px; + height: 2px; + border: 1px solid black; + background: white; + margin-top: -1px; border-radius: 2px; - background: #000; +} + +.miniColors-trigger, +.miniColors-triggerWrap { + width: 22px; + height: 22px; + display: inline-block; +} + +.miniColors-triggerWrap { + background: url(images/trigger.png) -22px 0 no-repeat; +} + +.miniColors-triggerWrap.disabled { + filter: alpha(opacity=50); + opacity: .5; +} + +.miniColors-trigger { + vertical-align: middle; + outline: none; + background: url(images/trigger.png) 0 0 no-repeat; +} + +.miniColors-triggerWrap.disabled .miniColors-trigger { + cursor: default; } \ No newline at end of file diff --git a/3rdparty/miniColors/js/jquery.miniColors.js b/3rdparty/miniColors/js/jquery.miniColors.js index 187db3fa84..a0f439c2c4 100755 --- a/3rdparty/miniColors/js/jquery.miniColors.js +++ b/3rdparty/miniColors/js/jquery.miniColors.js @@ -1,7 +1,7 @@ /* * jQuery miniColors: A small color selector * - * Copyright 2011 Cory LaViska for A Beautiful Site, LLC. (http://abeautifulsite.net/) + * Copyright 2012 Cory LaViska for A Beautiful Site, LLC. (http://www.abeautifulsite.net/) * * Dual licensed under the MIT or GPL Version 2 licenses * @@ -18,20 +18,30 @@ if(jQuery) (function($) { // // Determine initial color (defaults to white) - var color = expandHex(input.val()); - if( !color ) color = 'ffffff'; - var hsb = hex2hsb(color); + var color = expandHex(input.val()) || 'ffffff', + hsb = hex2hsb(color), + rgb = hsb2rgb(hsb), + alpha = parseFloat(input.attr('data-opacity')).toFixed(2); + + if( alpha > 1 ) alpha = 1; + if( alpha < 0 ) alpha = 0; // Create trigger var trigger = $(''); trigger.insertAfter(input); + trigger.wrap(''); + if( o.opacity ) { + trigger.css('backgroundColor', 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + alpha + ')'); + } // Set input data and update attributes input .addClass('miniColors') .data('original-maxlength', input.attr('maxlength') || null) .data('original-autocomplete', input.attr('autocomplete') || null) - .data('letterCase', 'uppercase') + .data('letterCase', o.letterCase === 'uppercase' ? 'uppercase' : 'lowercase') + .data('opacity', o.opacity ? true : false) + .data('alpha', alpha) .data('trigger', trigger) .data('hsb', hsb) .data('change', o.change ? o.change : null) @@ -42,11 +52,11 @@ if(jQuery) (function($) { .val('#' + convertCase(color, o.letterCase)); // Handle options - if( o.readonly ) input.prop('readonly', true); - if( o.disabled ) disable(input); + if( o.readonly || input.prop('readonly') ) input.prop('readonly', true); + if( o.disabled || input.prop('disabled') ) disable(input); // Show selector when trigger is clicked - trigger.bind('click.miniColors', function(event) { + trigger.on('click.miniColors', function(event) { event.preventDefault(); if( input.val() === '' ) input.val('#'); show(input); @@ -54,29 +64,29 @@ if(jQuery) (function($) { }); // Show selector when input receives focus - input.bind('focus.miniColors', function(event) { + input.on('focus.miniColors', function(event) { if( input.val() === '' ) input.val('#'); show(input); }); // Hide on blur - input.bind('blur.miniColors', function(event) { + input.on('blur.miniColors', function(event) { var hex = expandHex( hsb2hex(input.data('hsb')) ); input.val( hex ? '#' + convertCase(hex, input.data('letterCase')) : '' ); }); // Hide when tabbing out of the input - input.bind('keydown.miniColors', function(event) { + input.on('keydown.miniColors', function(event) { if( event.keyCode === 9 ) hide(input); }); // Update when color is typed in - input.bind('keyup.miniColors', function(event) { + input.on('keyup.miniColors', function(event) { setColorFromInput(input); }); // Handle pasting - input.bind('paste.miniColors', function(event) { + input.on('paste.miniColors', function(event) { // Short pause to wait for paste to complete setTimeout( function() { setColorFromInput(input); @@ -89,19 +99,18 @@ if(jQuery) (function($) { // // Destroys an active instance of the miniColors selector // - hide(); input = $(input); // Restore to original state - input.data('trigger').remove(); + input.data('trigger').parent().remove(); input .attr('autocomplete', input.data('original-autocomplete')) .attr('maxlength', input.data('original-maxlength')) .removeData() .removeClass('miniColors') - .unbind('.miniColors'); - $(document).unbind('.miniColors'); + .off('.miniColors'); + $(document).off('.miniColors'); }; var enable = function(input) { @@ -110,8 +119,7 @@ if(jQuery) (function($) { // input .prop('disabled', false) - .data('trigger') - .css('opacity', 1); + .data('trigger').parent().removeClass('disabled'); }; var disable = function(input) { @@ -121,8 +129,7 @@ if(jQuery) (function($) { hide(input); input .prop('disabled', true) - .data('trigger') - .css('opacity', 0.5); + .data('trigger').parent().addClass('disabled'); }; var show = function(input) { @@ -133,24 +140,27 @@ if(jQuery) (function($) { // Hide all other instances hide(); - + // Generate the selector var selector = $('
                '); selector - .append('
                ') .append('
                ') - .css({ - top: input.is(':visible') ? input.offset().top + input.outerHeight() : input.data('trigger').offset().top + input.data('trigger').outerHeight(), - left: input.is(':visible') ? input.offset().left : input.data('trigger').offset().left, - display: 'none' - }) + .append('
                ') + .css('display', 'none') .addClass( input.attr('class') ); + // Opacity + if( input.data('opacity') ) { + selector + .addClass('opacity') + .prepend('
                '); + } + // Set background for colors var hsb = input.data('hsb'); selector - .find('.miniColors-colors') - .css('backgroundColor', '#' + hsb2hex({ h: hsb.h, s: 100, b: 100 })); + .find('.miniColors-colors').css('backgroundColor', '#' + hsb2hex({ h: hsb.h, s: 100, b: 100 })).end() + .find('.miniColors-opacity').css('backgroundColor', '#' + hsb2hex({ h: hsb.h, s: hsb.s, b: hsb.b })).end(); // Set colorPicker position var colorPosition = input.data('colorPosition'); @@ -162,64 +172,106 @@ if(jQuery) (function($) { // Set huePicker position var huePosition = input.data('huePosition'); if( !huePosition ) huePosition = getHuePositionFromHSB(hsb); - selector.find('.miniColors-huePicker').css('top', huePosition.y + 'px'); + selector.find('.miniColors-huePicker').css('top', huePosition + 'px'); + + // Set opacity position + var opacityPosition = input.data('opacityPosition'); + if( !opacityPosition ) opacityPosition = getOpacityPositionFromAlpha(input.attr('data-opacity')); + selector.find('.miniColors-opacityPicker').css('top', opacityPosition + 'px'); // Set input data input .data('selector', selector) .data('huePicker', selector.find('.miniColors-huePicker')) + .data('opacityPicker', selector.find('.miniColors-opacityPicker')) .data('colorPicker', selector.find('.miniColors-colorPicker')) .data('mousebutton', 0); - + $('BODY').append(selector); - selector.fadeIn(100); + + // Position the selector + var trigger = input.data('trigger'), + hidden = !input.is(':visible'), + top = hidden ? trigger.offset().top + trigger.outerHeight() : input.offset().top + input.outerHeight(), + left = hidden ? trigger.offset().left : input.offset().left, + selectorWidth = selector.outerWidth(), + selectorHeight = selector.outerHeight(), + triggerWidth = trigger.outerWidth(), + triggerHeight = trigger.outerHeight(), + windowHeight = $(window).height(), + windowWidth = $(window).width(), + scrollTop = $(window).scrollTop(), + scrollLeft = $(window).scrollLeft(); + + // Adjust based on viewport + if( (top + selectorHeight) > windowHeight + scrollTop ) top = top - selectorHeight - triggerHeight; + if( (left + selectorWidth) > windowWidth + scrollLeft ) left = left - selectorWidth + triggerWidth; + + // Set position and show + selector.css({ + top: top, + left: left + }).fadeIn(100); // Prevent text selection in IE - selector.bind('selectstart', function() { return false; }); + selector.on('selectstart', function() { return false; }); - $(document).bind('mousedown.miniColors touchstart.miniColors', function(event) { - - input.data('mousebutton', 1); - var testSubject = $(event.target).parents().andSelf(); - - if( testSubject.hasClass('miniColors-colors') ) { - event.preventDefault(); - input.data('moving', 'colors'); - moveColor(input, event); - } - - if( testSubject.hasClass('miniColors-hues') ) { - event.preventDefault(); - input.data('moving', 'hues'); - moveHue(input, event); - } - - if( testSubject.hasClass('miniColors-selector') ) { - event.preventDefault(); - return; - } - - if( testSubject.hasClass('miniColors') ) return; - - hide(input); - }); + // Hide on resize (IE7/8 trigger this when any element is resized...) + if( !$.browser.msie || ($.browser.msie && $.browser.version >= 9) ) { + $(window).on('resize.miniColors', function(event) { + hide(input); + }); + } $(document) - .bind('mouseup.miniColors touchend.miniColors', function(event) { + .on('mousedown.miniColors touchstart.miniColors', function(event) { + + input.data('mousebutton', 1); + var testSubject = $(event.target).parents().andSelf(); + + if( testSubject.hasClass('miniColors-colors') ) { + event.preventDefault(); + input.data('moving', 'colors'); + moveColor(input, event); + } + + if( testSubject.hasClass('miniColors-hues') ) { + event.preventDefault(); + input.data('moving', 'hues'); + moveHue(input, event); + } + + if( testSubject.hasClass('miniColors-opacity') ) { + event.preventDefault(); + input.data('moving', 'opacity'); + moveOpacity(input, event); + } + + if( testSubject.hasClass('miniColors-selector') ) { + event.preventDefault(); + return; + } + + if( testSubject.hasClass('miniColors') ) return; + + hide(input); + }) + .on('mouseup.miniColors touchend.miniColors', function(event) { event.preventDefault(); input.data('mousebutton', 0).removeData('moving'); }) - .bind('mousemove.miniColors touchmove.miniColors', function(event) { + .on('mousemove.miniColors touchmove.miniColors', function(event) { event.preventDefault(); if( input.data('mousebutton') === 1 ) { if( input.data('moving') === 'colors' ) moveColor(input, event); if( input.data('moving') === 'hues' ) moveHue(input, event); + if( input.data('moving') === 'opacity' ) moveOpacity(input, event); } }); // Fire open callback if( input.data('open') ) { - input.data('open').call(input.get(0), '#' + hsb2hex(hsb), hsb2rgb(hsb)); + input.data('open').call(input.get(0), '#' + hsb2hex(hsb), $.extend(hsb2rgb(hsb), { a: parseFloat(input.attr('data-opacity')) })); } }; @@ -231,22 +283,22 @@ if(jQuery) (function($) { // // Hide all other instances if input isn't specified - if( !input ) input = '.miniColors'; + if( !input ) input = $('.miniColors'); - $(input).each( function() { + input.each( function() { var selector = $(this).data('selector'); $(this).removeData('selector'); $(selector).fadeOut(100, function() { // Fire close callback if( input.data('close') ) { var hsb = input.data('hsb'), hex = hsb2hex(hsb); - input.data('close').call(input.get(0), '#' + hex, hsb2rgb(hsb)); + input.data('close').call(input.get(0), '#' + hex, $.extend(hsb2rgb(hsb), { a: parseFloat(input.attr('data-opacity')) })); } $(this).remove(); }); }); - $(document).unbind('.miniColors'); + $(document).off('.miniColors'); }; @@ -266,8 +318,8 @@ if(jQuery) (function($) { position.x = event.originalEvent.changedTouches[0].pageX; position.y = event.originalEvent.changedTouches[0].pageY; } - position.x = position.x - input.data('selector').find('.miniColors-colors').offset().left - 5; - position.y = position.y - input.data('selector').find('.miniColors-colors').offset().top - 5; + position.x = position.x - input.data('selector').find('.miniColors-colors').offset().left - 6; + position.y = position.y - input.data('selector').find('.miniColors-colors').offset().top - 6; if( position.x <= -5 ) position.x = -5; if( position.x >= 144 ) position.x = 144; if( position.y <= -5 ) position.y = -5; @@ -301,23 +353,21 @@ if(jQuery) (function($) { huePicker.hide(); - var position = { - y: event.pageY - }; + var position = event.pageY; // Touch support if( event.originalEvent.changedTouches ) { - position.y = event.originalEvent.changedTouches[0].pageY; + position = event.originalEvent.changedTouches[0].pageY; } - position.y = position.y - input.data('selector').find('.miniColors-colors').offset().top - 1; - if( position.y <= -1 ) position.y = -1; - if( position.y >= 149 ) position.y = 149; + position = position - input.data('selector').find('.miniColors-colors').offset().top - 1; + if( position <= -1 ) position = -1; + if( position >= 149 ) position = 149; input.data('huePosition', position); - huePicker.css('top', position.y).show(); + huePicker.css('top', position).show(); // Calculate hue - var h = Math.round((150 - position.y - 1) * 2.4); + var h = Math.round((150 - position - 1) * 2.4); if( h < 0 ) h = 0; if( h > 360 ) h = 360; @@ -330,18 +380,65 @@ if(jQuery) (function($) { }; + var moveOpacity = function(input, event) { + + var opacityPicker = input.data('opacityPicker'); + + opacityPicker.hide(); + + var position = event.pageY; + + // Touch support + if( event.originalEvent.changedTouches ) { + position = event.originalEvent.changedTouches[0].pageY; + } + + position = position - input.data('selector').find('.miniColors-colors').offset().top - 1; + if( position <= -1 ) position = -1; + if( position >= 149 ) position = 149; + input.data('opacityPosition', position); + opacityPicker.css('top', position).show(); + + // Calculate opacity + var alpha = parseFloat((150 - position - 1) / 150).toFixed(2); + if( alpha < 0 ) alpha = 0; + if( alpha > 1 ) alpha = 1; + + // Update opacity + input + .data('alpha', alpha) + .attr('data-opacity', alpha); + + // Set color + setColor(input, input.data('hsb'), true); + + }; + var setColor = function(input, hsb, updateInput) { input.data('hsb', hsb); - var hex = hsb2hex(hsb); + var hex = hsb2hex(hsb), + selector = $(input.data('selector')); if( updateInput ) input.val( '#' + convertCase(hex, input.data('letterCase')) ); + + selector + .find('.miniColors-colors').css('backgroundColor', '#' + hsb2hex({ h: hsb.h, s: 100, b: 100 })).end() + .find('.miniColors-opacity').css('backgroundColor', '#' + hex).end(); + + var rgb = hsb2rgb(hsb); + + // Set background color (also fallback for non RGBA browsers) input.data('trigger').css('backgroundColor', '#' + hex); - if( input.data('selector') ) input.data('selector').find('.miniColors-colors').css('backgroundColor', '#' + hsb2hex({ h: hsb.h, s: 100, b: 100 })); + + // Set background color + opacity + if( input.data('opacity') ) { + input.data('trigger').css('backgroundColor', 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + input.attr('data-opacity') + ')'); + } // Fire change callback if( input.data('change') ) { - if( hex === input.data('lastChange') ) return; - input.data('change').call(input.get(0), '#' + hex, hsb2rgb(hsb)); - input.data('lastChange', hex); + if( (hex + ',' + input.attr('data-opacity')) === input.data('lastChange') ) return; + input.data('change').call(input.get(0), '#' + hex, $.extend(hsb2rgb(hsb), { a: parseFloat(input.attr('data-opacity')) })); + input.data('lastChange', hex + ',' + input.attr('data-opacity')); } }; @@ -355,10 +452,6 @@ if(jQuery) (function($) { // Get HSB equivalent var hsb = hex2hsb(hex); - // If color is the same, no change required - var currentHSB = input.data('hsb'); - if( hsb.h === currentHSB.h && hsb.s === currentHSB.s && hsb.b === currentHSB.b ) return true; - // Set colorPicker position var colorPosition = getColorPositionFromHSB(hsb); var colorPicker = $(input.data('colorPicker')); @@ -368,9 +461,14 @@ if(jQuery) (function($) { // Set huePosition position var huePosition = getHuePositionFromHSB(hsb); var huePicker = $(input.data('huePicker')); - huePicker.css('top', huePosition.y + 'px'); + huePicker.css('top', huePosition + 'px'); input.data('huePosition', huePosition); + // Set opacity position + var opacityPosition = getOpacityPositionFromAlpha(input.attr('data-opacity')); + var opacityPicker = $(input.data('opacityPicker')); + opacityPicker.css('top', opacityPosition + 'px'); + input.data('opacityPosition', opacityPosition); setColor(input, hsb); return true; @@ -378,9 +476,11 @@ if(jQuery) (function($) { }; var convertCase = function(string, letterCase) { - if( letterCase === 'lowercase' ) return string.toLowerCase(); - if( letterCase === 'uppercase' ) return string.toUpperCase(); - return string; + if( letterCase === 'uppercase' ) { + return string.toUpperCase(); + } else { + return string.toLowerCase(); + } }; var getColorPositionFromHSB = function(hsb) { @@ -397,7 +497,14 @@ if(jQuery) (function($) { var y = 150 - (hsb.h / 2.4); if( y < 0 ) h = 0; if( y > 150 ) h = 150; - return { y: y - 1 }; + return y; + }; + + var getOpacityPositionFromAlpha = function(alpha) { + var y = 150 * alpha; + if( y < 0 ) y = 0; + if( y > 150 ) y = 150; + return 150 - y; }; var cleanHex = function(hex) { @@ -542,6 +649,29 @@ if(jQuery) (function($) { }); return $(this); + + case 'opacity': + + // Getter + if( data === undefined ) { + if( !$(this).hasClass('miniColors') ) return; + if( $(this).data('opacity') ) { + return parseFloat($(this).attr('data-opacity')); + } else { + return null; + } + } + + // Setter + $(this).each( function() { + if( !$(this).hasClass('miniColors') ) return; + if( data < 0 ) data = 0; + if( data > 1 ) data = 1; + $(this).attr('data-opacity', data).data('alpha', data); + setColorFromInput($(this)); + }); + + return $(this); case 'destroy': diff --git a/3rdparty/miniColors/js/jquery.miniColors.min.js b/3rdparty/miniColors/js/jquery.miniColors.min.js index c00e0ace6b..1d3346455b 100755 --- a/3rdparty/miniColors/js/jquery.miniColors.min.js +++ b/3rdparty/miniColors/js/jquery.miniColors.min.js @@ -1,9 +1,9 @@ /* * jQuery miniColors: A small color selector * - * Copyright 2011 Cory LaViska for A Beautiful Site, LLC. (http://abeautifulsite.net/) + * Copyright 2012 Cory LaViska for A Beautiful Site, LLC. (http://www.abeautifulsite.net/) * * Dual licensed under the MIT or GPL Version 2 licenses * */ -if(jQuery)(function($){$.extend($.fn,{miniColors:function(o,data){var create=function(input,o,data){var color=expandHex(input.val());if(!color)color='ffffff';var hsb=hex2hsb(color);var trigger=$('');trigger.insertAfter(input);input.addClass('miniColors').data('original-maxlength',input.attr('maxlength')||null).data('original-autocomplete',input.attr('autocomplete')||null).data('letterCase','uppercase').data('trigger',trigger).data('hsb',hsb).data('change',o.change?o.change:null).data('close',o.close?o.close:null).data('open',o.open?o.open:null).attr('maxlength',7).attr('autocomplete','off').val('#'+convertCase(color,o.letterCase));if(o.readonly)input.prop('readonly',true);if(o.disabled)disable(input);trigger.bind('click.miniColors',function(event){event.preventDefault();if(input.val()==='')input.val('#');show(input)});input.bind('focus.miniColors',function(event){if(input.val()==='')input.val('#');show(input)});input.bind('blur.miniColors',function(event){var hex=expandHex(hsb2hex(input.data('hsb')));input.val(hex?'#'+convertCase(hex,input.data('letterCase')):'')});input.bind('keydown.miniColors',function(event){if(event.keyCode===9)hide(input)});input.bind('keyup.miniColors',function(event){setColorFromInput(input)});input.bind('paste.miniColors',function(event){setTimeout(function(){setColorFromInput(input)},5)})};var destroy=function(input){hide();input=$(input);input.data('trigger').remove();input.attr('autocomplete',input.data('original-autocomplete')).attr('maxlength',input.data('original-maxlength')).removeData().removeClass('miniColors').unbind('.miniColors');$(document).unbind('.miniColors')};var enable=function(input){input.prop('disabled',false).data('trigger').css('opacity',1)};var disable=function(input){hide(input);input.prop('disabled',true).data('trigger').css('opacity',0.5)};var show=function(input){if(input.prop('disabled'))return false;hide();var selector=$('
                ');selector.append('
                ').append('
                ').css({top:input.is(':visible')?input.offset().top+input.outerHeight():input.data('trigger').offset().top+input.data('trigger').outerHeight(),left:input.is(':visible')?input.offset().left:input.data('trigger').offset().left,display:'none'}).addClass(input.attr('class'));var hsb=input.data('hsb');selector.find('.miniColors-colors').css('backgroundColor','#'+hsb2hex({h:hsb.h,s:100,b:100}));var colorPosition=input.data('colorPosition');if(!colorPosition)colorPosition=getColorPositionFromHSB(hsb);selector.find('.miniColors-colorPicker').css('top',colorPosition.y+'px').css('left',colorPosition.x+'px');var huePosition=input.data('huePosition');if(!huePosition)huePosition=getHuePositionFromHSB(hsb);selector.find('.miniColors-huePicker').css('top',huePosition.y+'px');input.data('selector',selector).data('huePicker',selector.find('.miniColors-huePicker')).data('colorPicker',selector.find('.miniColors-colorPicker')).data('mousebutton',0);$('BODY').append(selector);selector.fadeIn(100);selector.bind('selectstart',function(){return false});$(document).bind('mousedown.miniColors touchstart.miniColors',function(event){input.data('mousebutton',1);var testSubject=$(event.target).parents().andSelf();if(testSubject.hasClass('miniColors-colors')){event.preventDefault();input.data('moving','colors');moveColor(input,event)}if(testSubject.hasClass('miniColors-hues')){event.preventDefault();input.data('moving','hues');moveHue(input,event)}if(testSubject.hasClass('miniColors-selector')){event.preventDefault();return}if(testSubject.hasClass('miniColors'))return;hide(input)});$(document).bind('mouseup.miniColors touchend.miniColors',function(event){event.preventDefault();input.data('mousebutton',0).removeData('moving')}).bind('mousemove.miniColors touchmove.miniColors',function(event){event.preventDefault();if(input.data('mousebutton')===1){if(input.data('moving')==='colors')moveColor(input,event);if(input.data('moving')==='hues')moveHue(input,event)}});if(input.data('open')){input.data('open').call(input.get(0),'#'+hsb2hex(hsb),hsb2rgb(hsb))}};var hide=function(input){if(!input)input='.miniColors';$(input).each(function(){var selector=$(this).data('selector');$(this).removeData('selector');$(selector).fadeOut(100,function(){if(input.data('close')){var hsb=input.data('hsb'),hex=hsb2hex(hsb);input.data('close').call(input.get(0),'#'+hex,hsb2rgb(hsb))}$(this).remove()})});$(document).unbind('.miniColors')};var moveColor=function(input,event){var colorPicker=input.data('colorPicker');colorPicker.hide();var position={x:event.pageX,y:event.pageY};if(event.originalEvent.changedTouches){position.x=event.originalEvent.changedTouches[0].pageX;position.y=event.originalEvent.changedTouches[0].pageY}position.x=position.x-input.data('selector').find('.miniColors-colors').offset().left-5;position.y=position.y-input.data('selector').find('.miniColors-colors').offset().top-5;if(position.x<=-5)position.x=-5;if(position.x>=144)position.x=144;if(position.y<=-5)position.y=-5;if(position.y>=144)position.y=144;input.data('colorPosition',position);colorPicker.css('left',position.x).css('top',position.y).show();var s=Math.round((position.x+5)*0.67);if(s<0)s=0;if(s>100)s=100;var b=100-Math.round((position.y+5)*0.67);if(b<0)b=0;if(b>100)b=100;var hsb=input.data('hsb');hsb.s=s;hsb.b=b;setColor(input,hsb,true)};var moveHue=function(input,event){var huePicker=input.data('huePicker');huePicker.hide();var position={y:event.pageY};if(event.originalEvent.changedTouches){position.y=event.originalEvent.changedTouches[0].pageY}position.y=position.y-input.data('selector').find('.miniColors-colors').offset().top-1;if(position.y<=-1)position.y=-1;if(position.y>=149)position.y=149;input.data('huePosition',position);huePicker.css('top',position.y).show();var h=Math.round((150-position.y-1)*2.4);if(h<0)h=0;if(h>360)h=360;var hsb=input.data('hsb');hsb.h=h;setColor(input,hsb,true)};var setColor=function(input,hsb,updateInput){input.data('hsb',hsb);var hex=hsb2hex(hsb);if(updateInput)input.val('#'+convertCase(hex,input.data('letterCase')));input.data('trigger').css('backgroundColor','#'+hex);if(input.data('selector'))input.data('selector').find('.miniColors-colors').css('backgroundColor','#'+hsb2hex({h:hsb.h,s:100,b:100}));if(input.data('change')){if(hex===input.data('lastChange'))return;input.data('change').call(input.get(0),'#'+hex,hsb2rgb(hsb));input.data('lastChange',hex)}};var setColorFromInput=function(input){input.val('#'+cleanHex(input.val()));var hex=expandHex(input.val());if(!hex)return false;var hsb=hex2hsb(hex);var currentHSB=input.data('hsb');if(hsb.h===currentHSB.h&&hsb.s===currentHSB.s&&hsb.b===currentHSB.b)return true;var colorPosition=getColorPositionFromHSB(hsb);var colorPicker=$(input.data('colorPicker'));colorPicker.css('top',colorPosition.y+'px').css('left',colorPosition.x+'px');input.data('colorPosition',colorPosition);var huePosition=getHuePositionFromHSB(hsb);var huePicker=$(input.data('huePicker'));huePicker.css('top',huePosition.y+'px');input.data('huePosition',huePosition);setColor(input,hsb);return true};var convertCase=function(string,letterCase){if(letterCase==='lowercase')return string.toLowerCase();if(letterCase==='uppercase')return string.toUpperCase();return string};var getColorPositionFromHSB=function(hsb){var x=Math.ceil(hsb.s/0.67);if(x<0)x=0;if(x>150)x=150;var y=150-Math.ceil(hsb.b/0.67);if(y<0)y=0;if(y>150)y=150;return{x:x-5,y:y-5}};var getHuePositionFromHSB=function(hsb){var y=150-(hsb.h/2.4);if(y<0)h=0;if(y>150)h=150;return{y:y-1}};var cleanHex=function(hex){return hex.replace(/[^A-F0-9]/ig,'')};var expandHex=function(hex){hex=cleanHex(hex);if(!hex)return null;if(hex.length===3)hex=hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];return hex.length===6?hex:null};var hsb2rgb=function(hsb){var rgb={};var h=Math.round(hsb.h);var s=Math.round(hsb.s*255/100);var v=Math.round(hsb.b*255/100);if(s===0){rgb.r=rgb.g=rgb.b=v}else{var t1=v;var t2=(255-s)*v/255;var t3=(t1-t2)*(h%60)/60;if(h===360)h=0;if(h<60){rgb.r=t1;rgb.b=t2;rgb.g=t2+t3}else if(h<120){rgb.g=t1;rgb.b=t2;rgb.r=t1-t3}else if(h<180){rgb.g=t1;rgb.r=t2;rgb.b=t2+t3}else if(h<240){rgb.b=t1;rgb.r=t2;rgb.g=t1-t3}else if(h<300){rgb.b=t1;rgb.g=t2;rgb.r=t2+t3}else if(h<360){rgb.r=t1;rgb.g=t2;rgb.b=t1-t3}else{rgb.r=0;rgb.g=0;rgb.b=0}}return{r:Math.round(rgb.r),g:Math.round(rgb.g),b:Math.round(rgb.b)}};var rgb2hex=function(rgb){var hex=[rgb.r.toString(16),rgb.g.toString(16),rgb.b.toString(16)];$.each(hex,function(nr,val){if(val.length===1)hex[nr]='0'+val});return hex.join('')};var hex2rgb=function(hex){hex=parseInt(((hex.indexOf('#')>-1)?hex.substring(1):hex),16);return{r:hex>>16,g:(hex&0x00FF00)>>8,b:(hex&0x0000FF)}};var rgb2hsb=function(rgb){var hsb={h:0,s:0,b:0};var min=Math.min(rgb.r,rgb.g,rgb.b);var max=Math.max(rgb.r,rgb.g,rgb.b);var delta=max-min;hsb.b=max;hsb.s=max!==0?255*delta/max:0;if(hsb.s!==0){if(rgb.r===max){hsb.h=(rgb.g-rgb.b)/delta}else if(rgb.g===max){hsb.h=2+(rgb.b-rgb.r)/delta}else{hsb.h=4+(rgb.r-rgb.g)/delta}}else{hsb.h=-1}hsb.h*=60;if(hsb.h<0){hsb.h+=360}hsb.s*=100/255;hsb.b*=100/255;return hsb};var hex2hsb=function(hex){var hsb=rgb2hsb(hex2rgb(hex));if(hsb.s===0)hsb.h=360;return hsb};var hsb2hex=function(hsb){return rgb2hex(hsb2rgb(hsb))};switch(o){case'readonly':$(this).each(function(){if(!$(this).hasClass('miniColors'))return;$(this).prop('readonly',data)});return $(this);case'disabled':$(this).each(function(){if(!$(this).hasClass('miniColors'))return;if(data){disable($(this))}else{enable($(this))}});return $(this);case'value':if(data===undefined){if(!$(this).hasClass('miniColors'))return;var input=$(this),hex=expandHex(input.val());return hex?'#'+convertCase(hex,input.data('letterCase')):null}$(this).each(function(){if(!$(this).hasClass('miniColors'))return;$(this).val(data);setColorFromInput($(this))});return $(this);case'destroy':$(this).each(function(){if(!$(this).hasClass('miniColors'))return;destroy($(this))});return $(this);default:if(!o)o={};$(this).each(function(){if($(this)[0].tagName.toLowerCase()!=='input')return;if($(this).data('trigger'))return;create($(this),o,data)});return $(this)}}})})(jQuery); \ No newline at end of file +if(jQuery)(function($){$.extend($.fn,{miniColors:function(o,data){var create=function(input,o,data){var color=expandHex(input.val())||'ffffff',hsb=hex2hsb(color),rgb=hsb2rgb(hsb),alpha=parseFloat(input.attr('data-opacity')).toFixed(2);if(alpha>1)alpha=1;if(alpha<0)alpha=0;var trigger=$('');trigger.insertAfter(input);trigger.wrap('');if(o.opacity){trigger.css('backgroundColor','rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+alpha+')')}input.addClass('miniColors').data('original-maxlength',input.attr('maxlength')||null).data('original-autocomplete',input.attr('autocomplete')||null).data('letterCase',o.letterCase==='uppercase'?'uppercase':'lowercase').data('opacity',o.opacity?true:false).data('alpha',alpha).data('trigger',trigger).data('hsb',hsb).data('change',o.change?o.change:null).data('close',o.close?o.close:null).data('open',o.open?o.open:null).attr('maxlength',7).attr('autocomplete','off').val('#'+convertCase(color,o.letterCase));if(o.readonly||input.prop('readonly'))input.prop('readonly',true);if(o.disabled||input.prop('disabled'))disable(input);trigger.on('click.miniColors',function(event){event.preventDefault();if(input.val()==='')input.val('#');show(input)});input.on('focus.miniColors',function(event){if(input.val()==='')input.val('#');show(input)});input.on('blur.miniColors',function(event){var hex=expandHex(hsb2hex(input.data('hsb')));input.val(hex?'#'+convertCase(hex,input.data('letterCase')):'')});input.on('keydown.miniColors',function(event){if(event.keyCode===9)hide(input)});input.on('keyup.miniColors',function(event){setColorFromInput(input)});input.on('paste.miniColors',function(event){setTimeout(function(){setColorFromInput(input)},5)})};var destroy=function(input){hide();input=$(input);input.data('trigger').parent().remove();input.attr('autocomplete',input.data('original-autocomplete')).attr('maxlength',input.data('original-maxlength')).removeData().removeClass('miniColors').off('.miniColors');$(document).off('.miniColors')};var enable=function(input){input.prop('disabled',false).data('trigger').parent().removeClass('disabled')};var disable=function(input){hide(input);input.prop('disabled',true).data('trigger').parent().addClass('disabled')};var show=function(input){if(input.prop('disabled'))return false;hide();var selector=$('
                ');selector.append('
                ').append('
                ').css('display','none').addClass(input.attr('class'));if(input.data('opacity')){selector.addClass('opacity').prepend('
                ')}var hsb=input.data('hsb');selector.find('.miniColors-colors').css('backgroundColor','#'+hsb2hex({h:hsb.h,s:100,b:100})).end().find('.miniColors-opacity').css('backgroundColor','#'+hsb2hex({h:hsb.h,s:hsb.s,b:hsb.b})).end();var colorPosition=input.data('colorPosition');if(!colorPosition)colorPosition=getColorPositionFromHSB(hsb);selector.find('.miniColors-colorPicker').css('top',colorPosition.y+'px').css('left',colorPosition.x+'px');var huePosition=input.data('huePosition');if(!huePosition)huePosition=getHuePositionFromHSB(hsb);selector.find('.miniColors-huePicker').css('top',huePosition+'px');var opacityPosition=input.data('opacityPosition');if(!opacityPosition)opacityPosition=getOpacityPositionFromAlpha(input.attr('data-opacity'));selector.find('.miniColors-opacityPicker').css('top',opacityPosition+'px');input.data('selector',selector).data('huePicker',selector.find('.miniColors-huePicker')).data('opacityPicker',selector.find('.miniColors-opacityPicker')).data('colorPicker',selector.find('.miniColors-colorPicker')).data('mousebutton',0);$('BODY').append(selector);var trigger=input.data('trigger'),hidden=!input.is(':visible'),top=hidden?trigger.offset().top+trigger.outerHeight():input.offset().top+input.outerHeight(),left=hidden?trigger.offset().left:input.offset().left,selectorWidth=selector.outerWidth(),selectorHeight=selector.outerHeight(),triggerWidth=trigger.outerWidth(),triggerHeight=trigger.outerHeight(),windowHeight=$(window).height(),windowWidth=$(window).width(),scrollTop=$(window).scrollTop(),scrollLeft=$(window).scrollLeft();if((top+selectorHeight)>windowHeight+scrollTop)top=top-selectorHeight-triggerHeight;if((left+selectorWidth)>windowWidth+scrollLeft)left=left-selectorWidth+triggerWidth;selector.css({top:top,left:left}).fadeIn(100);selector.on('selectstart',function(){return false});if(!$.browser.msie||($.browser.msie&&$.browser.version>=9)){$(window).on('resize.miniColors',function(event){hide(input)})}$(document).on('mousedown.miniColors touchstart.miniColors',function(event){input.data('mousebutton',1);var testSubject=$(event.target).parents().andSelf();if(testSubject.hasClass('miniColors-colors')){event.preventDefault();input.data('moving','colors');moveColor(input,event)}if(testSubject.hasClass('miniColors-hues')){event.preventDefault();input.data('moving','hues');moveHue(input,event)}if(testSubject.hasClass('miniColors-opacity')){event.preventDefault();input.data('moving','opacity');moveOpacity(input,event)}if(testSubject.hasClass('miniColors-selector')){event.preventDefault();return}if(testSubject.hasClass('miniColors'))return;hide(input)}).on('mouseup.miniColors touchend.miniColors',function(event){event.preventDefault();input.data('mousebutton',0).removeData('moving')}).on('mousemove.miniColors touchmove.miniColors',function(event){event.preventDefault();if(input.data('mousebutton')===1){if(input.data('moving')==='colors')moveColor(input,event);if(input.data('moving')==='hues')moveHue(input,event);if(input.data('moving')==='opacity')moveOpacity(input,event)}});if(input.data('open')){input.data('open').call(input.get(0),'#'+hsb2hex(hsb),$.extend(hsb2rgb(hsb),{a:parseFloat(input.attr('data-opacity'))}))}};var hide=function(input){if(!input)input=$('.miniColors');input.each(function(){var selector=$(this).data('selector');$(this).removeData('selector');$(selector).fadeOut(100,function(){if(input.data('close')){var hsb=input.data('hsb'),hex=hsb2hex(hsb);input.data('close').call(input.get(0),'#'+hex,$.extend(hsb2rgb(hsb),{a:parseFloat(input.attr('data-opacity'))}))}$(this).remove()})});$(document).off('.miniColors')};var moveColor=function(input,event){var colorPicker=input.data('colorPicker');colorPicker.hide();var position={x:event.pageX,y:event.pageY};if(event.originalEvent.changedTouches){position.x=event.originalEvent.changedTouches[0].pageX;position.y=event.originalEvent.changedTouches[0].pageY}position.x=position.x-input.data('selector').find('.miniColors-colors').offset().left-6;position.y=position.y-input.data('selector').find('.miniColors-colors').offset().top-6;if(position.x<=-5)position.x=-5;if(position.x>=144)position.x=144;if(position.y<=-5)position.y=-5;if(position.y>=144)position.y=144;input.data('colorPosition',position);colorPicker.css('left',position.x).css('top',position.y).show();var s=Math.round((position.x+5)*0.67);if(s<0)s=0;if(s>100)s=100;var b=100-Math.round((position.y+5)*0.67);if(b<0)b=0;if(b>100)b=100;var hsb=input.data('hsb');hsb.s=s;hsb.b=b;setColor(input,hsb,true)};var moveHue=function(input,event){var huePicker=input.data('huePicker');huePicker.hide();var position=event.pageY;if(event.originalEvent.changedTouches){position=event.originalEvent.changedTouches[0].pageY}position=position-input.data('selector').find('.miniColors-colors').offset().top-1;if(position<=-1)position=-1;if(position>=149)position=149;input.data('huePosition',position);huePicker.css('top',position).show();var h=Math.round((150-position-1)*2.4);if(h<0)h=0;if(h>360)h=360;var hsb=input.data('hsb');hsb.h=h;setColor(input,hsb,true)};var moveOpacity=function(input,event){var opacityPicker=input.data('opacityPicker');opacityPicker.hide();var position=event.pageY;if(event.originalEvent.changedTouches){position=event.originalEvent.changedTouches[0].pageY}position=position-input.data('selector').find('.miniColors-colors').offset().top-1;if(position<=-1)position=-1;if(position>=149)position=149;input.data('opacityPosition',position);opacityPicker.css('top',position).show();var alpha=parseFloat((150-position-1)/150).toFixed(2);if(alpha<0)alpha=0;if(alpha>1)alpha=1;input.data('alpha',alpha).attr('data-opacity',alpha);setColor(input,input.data('hsb'),true)};var setColor=function(input,hsb,updateInput){input.data('hsb',hsb);var hex=hsb2hex(hsb),selector=$(input.data('selector'));if(updateInput)input.val('#'+convertCase(hex,input.data('letterCase')));selector.find('.miniColors-colors').css('backgroundColor','#'+hsb2hex({h:hsb.h,s:100,b:100})).end().find('.miniColors-opacity').css('backgroundColor','#'+hex).end();var rgb=hsb2rgb(hsb);input.data('trigger').css('backgroundColor','#'+hex);if(input.data('opacity')){input.data('trigger').css('backgroundColor','rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+input.attr('data-opacity')+')')}if(input.data('change')){if((hex+','+input.attr('data-opacity'))===input.data('lastChange'))return;input.data('change').call(input.get(0),'#'+hex,$.extend(hsb2rgb(hsb),{a:parseFloat(input.attr('data-opacity'))}));input.data('lastChange',hex+','+input.attr('data-opacity'))}};var setColorFromInput=function(input){input.val('#'+cleanHex(input.val()));var hex=expandHex(input.val());if(!hex)return false;var hsb=hex2hsb(hex);var colorPosition=getColorPositionFromHSB(hsb);var colorPicker=$(input.data('colorPicker'));colorPicker.css('top',colorPosition.y+'px').css('left',colorPosition.x+'px');input.data('colorPosition',colorPosition);var huePosition=getHuePositionFromHSB(hsb);var huePicker=$(input.data('huePicker'));huePicker.css('top',huePosition+'px');input.data('huePosition',huePosition);var opacityPosition=getOpacityPositionFromAlpha(input.attr('data-opacity'));var opacityPicker=$(input.data('opacityPicker'));opacityPicker.css('top',opacityPosition+'px');input.data('opacityPosition',opacityPosition);setColor(input,hsb);return true};var convertCase=function(string,letterCase){if(letterCase==='uppercase'){return string.toUpperCase()}else{return string.toLowerCase()}};var getColorPositionFromHSB=function(hsb){var x=Math.ceil(hsb.s/0.67);if(x<0)x=0;if(x>150)x=150;var y=150-Math.ceil(hsb.b/0.67);if(y<0)y=0;if(y>150)y=150;return{x:x-5,y:y-5}};var getHuePositionFromHSB=function(hsb){var y=150-(hsb.h/2.4);if(y<0)h=0;if(y>150)h=150;return y};var getOpacityPositionFromAlpha=function(alpha){var y=150*alpha;if(y<0)y=0;if(y>150)y=150;return 150-y};var cleanHex=function(hex){return hex.replace(/[^A-F0-9]/ig,'')};var expandHex=function(hex){hex=cleanHex(hex);if(!hex)return null;if(hex.length===3)hex=hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];return hex.length===6?hex:null};var hsb2rgb=function(hsb){var rgb={};var h=Math.round(hsb.h);var s=Math.round(hsb.s*255/100);var v=Math.round(hsb.b*255/100);if(s===0){rgb.r=rgb.g=rgb.b=v}else{var t1=v;var t2=(255-s)*v/255;var t3=(t1-t2)*(h%60)/60;if(h===360)h=0;if(h<60){rgb.r=t1;rgb.b=t2;rgb.g=t2+t3}else if(h<120){rgb.g=t1;rgb.b=t2;rgb.r=t1-t3}else if(h<180){rgb.g=t1;rgb.r=t2;rgb.b=t2+t3}else if(h<240){rgb.b=t1;rgb.r=t2;rgb.g=t1-t3}else if(h<300){rgb.b=t1;rgb.g=t2;rgb.r=t2+t3}else if(h<360){rgb.r=t1;rgb.g=t2;rgb.b=t1-t3}else{rgb.r=0;rgb.g=0;rgb.b=0}}return{r:Math.round(rgb.r),g:Math.round(rgb.g),b:Math.round(rgb.b)}};var rgb2hex=function(rgb){var hex=[rgb.r.toString(16),rgb.g.toString(16),rgb.b.toString(16)];$.each(hex,function(nr,val){if(val.length===1)hex[nr]='0'+val});return hex.join('')};var hex2rgb=function(hex){hex=parseInt(((hex.indexOf('#')>-1)?hex.substring(1):hex),16);return{r:hex>>16,g:(hex&0x00FF00)>>8,b:(hex&0x0000FF)}};var rgb2hsb=function(rgb){var hsb={h:0,s:0,b:0};var min=Math.min(rgb.r,rgb.g,rgb.b);var max=Math.max(rgb.r,rgb.g,rgb.b);var delta=max-min;hsb.b=max;hsb.s=max!==0?255*delta/max:0;if(hsb.s!==0){if(rgb.r===max){hsb.h=(rgb.g-rgb.b)/delta}else if(rgb.g===max){hsb.h=2+(rgb.b-rgb.r)/delta}else{hsb.h=4+(rgb.r-rgb.g)/delta}}else{hsb.h=-1}hsb.h*=60;if(hsb.h<0){hsb.h+=360}hsb.s*=100/255;hsb.b*=100/255;return hsb};var hex2hsb=function(hex){var hsb=rgb2hsb(hex2rgb(hex));if(hsb.s===0)hsb.h=360;return hsb};var hsb2hex=function(hsb){return rgb2hex(hsb2rgb(hsb))};switch(o){case'readonly':$(this).each(function(){if(!$(this).hasClass('miniColors'))return;$(this).prop('readonly',data)});return $(this);case'disabled':$(this).each(function(){if(!$(this).hasClass('miniColors'))return;if(data){disable($(this))}else{enable($(this))}});return $(this);case'value':if(data===undefined){if(!$(this).hasClass('miniColors'))return;var input=$(this),hex=expandHex(input.val());return hex?'#'+convertCase(hex,input.data('letterCase')):null}$(this).each(function(){if(!$(this).hasClass('miniColors'))return;$(this).val(data);setColorFromInput($(this))});return $(this);case'opacity':if(data===undefined){if(!$(this).hasClass('miniColors'))return;if($(this).data('opacity')){return parseFloat($(this).attr('data-opacity'))}else{return null}}$(this).each(function(){if(!$(this).hasClass('miniColors'))return;if(data<0)data=0;if(data>1)data=1;$(this).attr('data-opacity',data).data('alpha',data);setColorFromInput($(this))});return $(this);case'destroy':$(this).each(function(){if(!$(this).hasClass('miniColors'))return;destroy($(this))});return $(this);default:if(!o)o={};$(this).each(function(){if($(this)[0].tagName.toLowerCase()!=='input')return;if($(this).data('trigger'))return;create($(this),o,data)});return $(this)}}})})(jQuery); \ No newline at end of file diff --git a/3rdparty/timepicker/GPL-LICENSE.txt b/3rdparty/timepicker/GPL-LICENSE.txt old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/MIT-LICENSE.txt b/3rdparty/timepicker/MIT-LICENSE.txt old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/3rdparty/timepicker/css/include/images/ui-bg_diagonals-thick_18_b81900_40x40.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-bg_diagonals-thick_20_666666_40x40.png b/3rdparty/timepicker/css/include/images/ui-bg_diagonals-thick_20_666666_40x40.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-bg_flat_10_000000_40x100.png b/3rdparty/timepicker/css/include/images/ui-bg_flat_10_000000_40x100.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-bg_glass_100_f6f6f6_1x400.png b/3rdparty/timepicker/css/include/images/ui-bg_glass_100_f6f6f6_1x400.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-bg_glass_100_fdf5ce_1x400.png b/3rdparty/timepicker/css/include/images/ui-bg_glass_100_fdf5ce_1x400.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-bg_glass_65_ffffff_1x400.png b/3rdparty/timepicker/css/include/images/ui-bg_glass_65_ffffff_1x400.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/3rdparty/timepicker/css/include/images/ui-bg_gloss-wave_35_f6a828_500x100.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/3rdparty/timepicker/css/include/images/ui-bg_highlight-soft_100_eeeeee_1x100.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/3rdparty/timepicker/css/include/images/ui-bg_highlight-soft_75_ffe45c_1x100.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-icons_222222_256x240.png b/3rdparty/timepicker/css/include/images/ui-icons_222222_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-icons_228ef1_256x240.png b/3rdparty/timepicker/css/include/images/ui-icons_228ef1_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-icons_ef8c08_256x240.png b/3rdparty/timepicker/css/include/images/ui-icons_ef8c08_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-icons_ffd27a_256x240.png b/3rdparty/timepicker/css/include/images/ui-icons_ffd27a_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/images/ui-icons_ffffff_256x240.png b/3rdparty/timepicker/css/include/images/ui-icons_ffffff_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/jquery-1.5.1.min.js b/3rdparty/timepicker/css/include/jquery-1.5.1.min.js old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/jquery-ui-1.8.14.custom.css b/3rdparty/timepicker/css/include/jquery-ui-1.8.14.custom.css old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/jquery.ui.core.min.js b/3rdparty/timepicker/css/include/jquery.ui.core.min.js old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/jquery.ui.position.min.js b/3rdparty/timepicker/css/include/jquery.ui.position.min.js old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/jquery.ui.tabs.min.js b/3rdparty/timepicker/css/include/jquery.ui.tabs.min.js old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/jquery.ui.widget.min.js b/3rdparty/timepicker/css/include/jquery.ui.widget.min.js old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_flat_10_000000_40x100.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_222222_256x240.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_222222_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_228ef1_256x240.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_228ef1_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_ef8c08_256x240.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_ef8c08_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_ffd27a_256x240.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_ffd27a_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_ffffff_256x240.png b/3rdparty/timepicker/css/include/ui-lightness/images/ui-icons_ffffff_256x240.png old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/css/jquery.ui.timepicker.css b/3rdparty/timepicker/css/jquery.ui.timepicker.css old mode 100644 new mode 100755 index 08b442a7e5..1efbacb7c3 --- a/3rdparty/timepicker/css/jquery.ui.timepicker.css +++ b/3rdparty/timepicker/css/jquery.ui.timepicker.css @@ -10,7 +10,7 @@ .ui-timepicker-inline { display: inline; } -#ui-timepicker-div { padding: 0.2em } +#ui-timepicker-div { padding: 0.2em; background-color: #fff; } .ui-timepicker-table { display: inline-table; width: 0; } .ui-timepicker-table table { margin:0.15em 0 0 0; border-collapse: collapse; } diff --git a/3rdparty/timepicker/js/i18n/i18n.html b/3rdparty/timepicker/js/i18n/i18n.html old mode 100644 new mode 100755 index 83cb5e3f30..4ba56cf8a9 --- a/3rdparty/timepicker/js/i18n/i18n.html +++ b/3rdparty/timepicker/js/i18n/i18n.html @@ -1,6 +1,11 @@ + + + + + Internationalisation page for the jquery ui timepicker @@ -14,10 +19,20 @@ - + + + + + + + + + + + @@ -32,18 +47,35 @@ showDeselectButton: true }); - $('#locale').change(function() { - $('#timepicker').timepicker( "option", - $.timepicker.regional[ $( this ).val() ] ); - }); + $('#locale').change(updateLocale).keyup(updateLocale); + }); + + function updateLocale() + { + $('#timepicker').timepicker( "option", + $.timepicker.regional[ $( '#locale' ).val() ] ); + } + Select a localisation :
                @@ -56,18 +88,60 @@ List of localisations : - \ No newline at end of file + + \ No newline at end of file diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-cs.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-cs.js new file mode 100755 index 0000000000..23a43444cf --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-cs.js @@ -0,0 +1,12 @@ +/* Czech initialisation for the timepicker plugin */ +/* Written by David Spohr (spohr.david at gmail). */ +jQuery(function($){ + $.timepicker.regional['cs'] = { + hourText: 'Hodiny', + minuteText: 'Minuty', + amPmText: ['AM', 'PM'] , + closeButtonText: 'Zavřít', + nowButtonText: 'Nyní', + deselectButtonText: 'Odoznačit' } + $.timepicker.setDefaults($.timepicker.regional['cs']); +}); \ No newline at end of file diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-de.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-de.js old mode 100644 new mode 100755 index c010a498e1..e3bf859ee6 --- a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-de.js +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-de.js @@ -1,9 +1,12 @@ -/* Deutsch initialisation for the timepicker plugin */ -/* Written by Bernd Plagge (bplagge@choicenet.ne.jp). */ +/* German initialisation for the timepicker plugin */ +/* Written by Lowie Hulzinga. */ jQuery(function($){ $.timepicker.regional['de'] = { hourText: 'Stunde', minuteText: 'Minuten', - amPmText: ['AM', 'PM'] } + amPmText: ['AM', 'PM'] , + closeButtonText: 'Beenden', + nowButtonText: 'Aktuelle Zeit', + deselectButtonText: 'Wischen' } $.timepicker.setDefaults($.timepicker.regional['de']); -}); \ No newline at end of file +}); diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-es.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-es.js new file mode 100755 index 0000000000..b8bcbf859a --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-es.js @@ -0,0 +1,12 @@ +/* Spanish initialisation for the jQuery time picker plugin. */ +/* Writen by Jandro González (agonzalezalves@gmail.com) */ +jQuery(function($){ + $.timepicker.regional['es'] = { + hourText: 'Hora', + minuteText: 'Minuto', + amPmText: ['AM', 'PM'], + closeButtonText: 'Aceptar', + nowButtonText: 'Ahora', + deselectButtonText: 'Deseleccionar' } + $.timepicker.setDefaults($.timepicker.regional['es']); +}); diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-fr.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-fr.js old mode 100644 new mode 100755 diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-hr.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-hr.js new file mode 100755 index 0000000000..6950a16939 --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-hr.js @@ -0,0 +1,13 @@ +/* Croatian/Bosnian initialisation for the timepicker plugin */ +/* Written by Rene Brakus (rene.brakus@infobip.com). */ +jQuery(function($){ + $.timepicker.regional['hr'] = { + hourText: 'Sat', + minuteText: 'Minuta', + amPmText: ['Prijepodne', 'Poslijepodne'], + closeButtonText: 'Zatvoriti', + nowButtonText: 'Sada', + deselectButtonText: 'Poništite'} + + $.timepicker.setDefaults($.timepicker.regional['hr']); +}); \ No newline at end of file diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-it.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-it.js new file mode 100755 index 0000000000..ad20df3053 --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-it.js @@ -0,0 +1,12 @@ +/* Italian initialisation for the jQuery time picker plugin. */ +/* Written by Serge Margarita (serge.margarita@gmail.com) */ +jQuery(function($){ + $.timepicker.regional['it'] = { + hourText: 'Ore', + minuteText: 'Minuti', + amPmText: ['AM', 'PM'], + closeButtonText: 'Chiudi', + nowButtonText: 'Adesso', + deselectButtonText: 'Svuota' } + $.timepicker.setDefaults($.timepicker.regional['it']); +}); \ No newline at end of file diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-ja.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-ja.js old mode 100644 new mode 100755 index 01b2c8a3de..b38cf6e596 --- a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-ja.js +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-ja.js @@ -4,6 +4,9 @@ jQuery(function($){ $.timepicker.regional['ja'] = { hourText: '時間', minuteText: '分', - amPmText: ['午前', '午後'] } + amPmText: ['午前', '午後'], + closeButtonText: '閉じる', + nowButtonText: '現時', + deselectButtonText: '選択解除' } $.timepicker.setDefaults($.timepicker.regional['ja']); }); diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-nl.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-nl.js new file mode 100755 index 0000000000..945d55ea0b --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-nl.js @@ -0,0 +1,12 @@ +/* Nederlands initialisation for the timepicker plugin */ +/* Written by Lowie Hulzinga. */ +jQuery(function($){ + $.timepicker.regional['nl'] = { + hourText: 'Uren', + minuteText: 'Minuten', + amPmText: ['AM', 'PM'], + closeButtonText: 'Sluiten', + nowButtonText: 'Actuele tijd', + deselectButtonText: 'Wissen' } + $.timepicker.setDefaults($.timepicker.regional['nl']); +}); \ No newline at end of file diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-pl.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-pl.js new file mode 100755 index 0000000000..9f401c5ad1 --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-pl.js @@ -0,0 +1,12 @@ +/* Polish initialisation for the timepicker plugin */ +/* Written by Mateusz Wadolkowski (mw@pcdoctor.pl). */ +jQuery(function($){ + $.timepicker.regional['pl'] = { + hourText: 'Godziny', + minuteText: 'Minuty', + amPmText: ['', ''], + closeButtonText: 'Zamknij', + nowButtonText: 'Teraz', + deselectButtonText: 'Odznacz'} + $.timepicker.setDefaults($.timepicker.regional['pl']); +}); \ No newline at end of file diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-pt-BR.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-pt-BR.js new file mode 100755 index 0000000000..9027332268 --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-pt-BR.js @@ -0,0 +1,12 @@ +/* Brazilan initialisation for the timepicker plugin */ +/* Written by Daniel Almeida (quantodaniel@gmail.com). */ +jQuery(function($){ + $.timepicker.regional['pt-BR'] = { + hourText: 'Hora', + minuteText: 'Minuto', + amPmText: ['AM', 'PM'], + closeButtonText: 'Fechar', + nowButtonText: 'Agora', + deselectButtonText: 'Limpar' } + $.timepicker.setDefaults($.timepicker.regional['pt-BR']); +}); \ No newline at end of file diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-sl.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-sl.js new file mode 100755 index 0000000000..0b7d9c9f6c --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-sl.js @@ -0,0 +1,12 @@ +/* Slovenian localization for the jQuery time picker plugin. */ +/* Written by Blaž Maležič (blaz@malezic.si) */ +jQuery(function($){ + $.timepicker.regional['sl'] = { + hourText: 'Ure', + minuteText: 'Minute', + amPmText: ['AM', 'PM'], + closeButtonText: 'Zapri', + nowButtonText: 'Zdaj', + deselectButtonText: 'Pobriši' } + $.timepicker.setDefaults($.timepicker.regional['sl']); +}); diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-sv.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-sv.js new file mode 100755 index 0000000000..d6d798ef38 --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-sv.js @@ -0,0 +1,12 @@ +/* Swedish initialisation for the timepicker plugin */ +/* Written by Björn Westlin (bjorn.westlin@su.se). */ +jQuery(function($){ + $.timepicker.regional['sv'] = { + hourText: 'Timme', + minuteText: 'Minut', + amPmText: ['AM', 'PM'] , + closeButtonText: 'Stäng', + nowButtonText: 'Nu', + deselectButtonText: 'Rensa' } + $.timepicker.setDefaults($.timepicker.regional['sv']); +}); diff --git a/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-tr.js b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-tr.js new file mode 100755 index 0000000000..4de447c474 --- /dev/null +++ b/3rdparty/timepicker/js/i18n/jquery.ui.timepicker-tr.js @@ -0,0 +1,12 @@ +/* Turkish initialisation for the jQuery time picker plugin. */ +/* Written by Mutlu Tevfik Koçak (mtkocak@gmail.com) */ +jQuery(function($){ + $.timepicker.regional['tr'] = { + hourText: 'Saat', + minuteText: 'Dakika', + amPmText: ['AM', 'PM'], + closeButtonText: 'Kapat', + nowButtonText: 'Şu anda', + deselectButtonText: 'Seçimi temizle' } + $.timepicker.setDefaults($.timepicker.regional['tr']); +}); \ No newline at end of file diff --git a/3rdparty/timepicker/js/jquery.ui.timepicker.js b/3rdparty/timepicker/js/jquery.ui.timepicker.js old mode 100644 new mode 100755 index d086b674b7..728841fa7a --- a/3rdparty/timepicker/js/jquery.ui.timepicker.js +++ b/3rdparty/timepicker/js/jquery.ui.timepicker.js @@ -1,5 +1,5 @@ /* - * jQuery UI Timepicker 0.2.9 + * jQuery UI Timepicker 0.3.1 * * Copyright 2010-2011, Francois Gelinas * Dual licensed under the MIT or GPL Version 2 licenses. @@ -38,12 +38,12 @@ ->T-Rex<- */ -(function ($, undefined) { +(function ($) { - $.extend($.ui, { timepicker: { version: "0.2.9"} }); + $.extend($.ui, { timepicker: { version: "0.3.1"} }); - var PROP_NAME = 'timepicker'; - var tpuuid = new Date().getTime(); + var PROP_NAME = 'timepicker', + tpuuid = new Date().getTime(); /* Time picker manager. Use the singleton instance of this class, $.timepicker, to interact with the time picker. @@ -53,7 +53,6 @@ function Timepicker() { this.debug = true; // Change this to true to start debugging this._curInst = null; // The current instance in use - this._isInline = false; // true if the instance is displayed inline this._disabledInputs = []; // List of time picker inputs that have been disabled this._timepickerShowing = false; // True if the popup picker is showing , false if not this._inDialog = false; // True if showing within a "dialog", false if not @@ -267,17 +266,23 @@ input[isRTL ? 'before' : 'after'](inst.append); } input.unbind('focus.timepicker', this._showTimepicker); + input.unbind('click.timepicker', this._adjustZIndex); + if (inst.trigger) { inst.trigger.remove(); } var showOn = this._get(inst, 'showOn'); if (showOn == 'focus' || showOn == 'both') { // pop-up time picker when in the marked field input.bind("focus.timepicker", this._showTimepicker); + input.bind("click.timepicker", this._adjustZIndex); } if (showOn == 'button' || showOn == 'both') { // pop-up time picker when 'button' element is clicked var button = this._get(inst, 'button'); $(button).bind("click.timepicker", function () { - if ($.timepicker._timepickerShowing && $.timepicker._lastInput == input[0]) { $.timepicker._hideTimepicker(); } - else { $.timepicker._showTimepicker(input[0]); } + if ($.timepicker._timepickerShowing && $.timepicker._lastInput == input[0]) { + $.timepicker._hideTimepicker(); + } else if (!inst.input.is(':disabled')) { + $.timepicker._showTimepicker(input[0]); + } return false; }); @@ -303,12 +308,19 @@ inst.tpDiv.show(); }, + _adjustZIndex: function(input) { + input = input.target || input; + var inst = $.timepicker._getInst(input); + inst.tpDiv.css('zIndex', $.timepicker._getZIndex(input) +1); + }, + /* Pop-up the time picker for a given input field. @param input element - the input field attached to the time picker or event - if triggered by focus */ _showTimepicker: function (input) { input = input.target || input; if (input.nodeName.toLowerCase() != 'input') { input = $('input', input.parentNode)[0]; } // find from button/image trigger + if ($.timepicker._isDisabledTimepicker(input) || $.timepicker._lastInput == input) { return; } // already here // fix v 0.0.8 - close current timepicker before showing another one @@ -389,7 +401,8 @@ }; // Fixed the zIndex problem for real (I hope) - FG - v 0.2.9 - inst.tpDiv.css('zIndex', $.timepicker._getZIndex(input) +1); + $.timepicker._adjustZIndex(input); + //inst.tpDiv.css('zIndex', $.timepicker._getZIndex(input) +1); if ($.effects && $.effects[showAnim]) { inst.tpDiv.show(showAnim, $.timepicker._get(inst, 'showOptions'), duration, postProcess); @@ -419,6 +432,16 @@ } }, + /* Refresh the time picker + @param target element - The target input field or inline container element. */ + _refreshTimepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + this._updateTimepicker(inst); + } + }, + + /* Generate the time picker content. */ _updateTimepicker: function (inst) { inst.tpDiv.empty().append(this._generateHTML(inst)); @@ -467,7 +490,7 @@ .find('.' + this._dayOverClass + ' a') .trigger('mouseover') .end() - .find('.ui-timepicker-now').bind("click",function(e) { + .find('.ui-timepicker-now').bind("click", function(e) { $.timepicker.selectNow(e); }).end() .find('.ui-timepicker-deselect').bind("click",function(e) { @@ -786,6 +809,26 @@ }, + /* Detach a timepicker from its control. + @param target element - the target input field or division or span */ + _destroyTimepicker: 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.timepicker', this._showTimepicker) + .unbind('click.timepicker', this._adjustZIndex); + } 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 */ _enableTimepicker: function(target) { @@ -799,12 +842,17 @@ var nodeName = target.nodeName.toLowerCase(); if (nodeName == 'input') { target.disabled = false; + var button = this._get(inst, 'button'); + $(button).removeClass('ui-state-disabled').disabled = false; inst.trigger.filter('button'). each(function() { this.disabled = false; }).end(); } else if (nodeName == 'div' || nodeName == 'span') { var inline = $target.children('.' + this._inlineClass); inline.children().removeClass('ui-state-disabled'); + inline.find('button').each( + function() { this.disabled = false } + ) } this._disabledInputs = $.map(this._disabledInputs, function(value) { return (value == target_id ? null : value); }); // delete entry @@ -820,6 +868,9 @@ } var nodeName = target.nodeName.toLowerCase(); if (nodeName == 'input') { + var button = this._get(inst, 'button'); + + $(button).addClass('ui-state-disabled').disabled = true; target.disabled = true; inst.trigger.filter('button'). @@ -829,6 +880,10 @@ else if (nodeName == 'div' || nodeName == 'span') { var inline = $target.children('.' + this._inlineClass); inline.children().addClass('ui-state-disabled'); + inline.find('button').each( + function() { this.disabled = true } + ) + } this._disabledInputs = $.map(this._disabledInputs, function(value) { return (value == target ? null : value); }); // delete entry @@ -923,13 +978,9 @@ (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); } if (!showAnim) { postProcess(); } - var onClose = this._get(inst, 'onClose'); - if (onClose) { - onClose.apply( - (inst.input ? inst.input[0] : null), - [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback - } + this._timepickerShowing = false; + this._lastInput = null; if (this._inDialog) { this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); @@ -939,6 +990,14 @@ } } this._inDialog = false; + + var onClose = this._get(inst, 'onClose'); + if (onClose) { + onClose.apply( + (inst.input ? inst.input[0] : null), + [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback + } + } }, @@ -1106,12 +1165,10 @@ return retVal; }, - selectNow: function(e) { - - var id = $(e.target).attr("data-timepicker-instance-id"), + selectNow: function(event) { + var id = $(event.target).attr("data-timepicker-instance-id"), $target = $(id), inst = this._getInst($target[0]); - //if (!inst || (input && inst != $.data(input, PROP_NAME))) { return; } var currentTime = new Date(); inst.hours = currentTime.getHours(); @@ -1121,8 +1178,8 @@ this._hideTimepicker(); }, - deselectTime: function(e) { - var id = $(e.target).attr("data-timepicker-instance-id"), + deselectTime: function(event) { + var id = $(event.target).attr("data-timepicker-instance-id"), $target = $(id), inst = this._getInst($target[0]); inst.hours = -1; @@ -1135,7 +1192,7 @@ selectHours: function (event) { var $td = $(event.currentTarget), id = $td.attr("data-timepicker-instance-id"), - newHours = $td.attr("data-hour"), + newHours = parseInt($td.attr("data-hour")), fromDoubleClick = event.data.fromDoubleClick, $target = $(id), inst = this._getInst($target[0]), @@ -1168,7 +1225,7 @@ selectMinutes: function (event) { var $td = $(event.currentTarget), id = $td.attr("data-timepicker-instance-id"), - newMinutes = $td.attr("data-minute"), + newMinutes = parseInt($td.attr("data-minute")), fromDoubleClick = event.data.fromDoubleClick, $target = $(id), inst = this._getInst($target[0]), @@ -1213,8 +1270,10 @@ return ''; } - if ((inst.hours < 0) || (inst.hours > 23)) { inst.hours = 12; } - if ((inst.minutes < 0) || (inst.minutes > 59)) { inst.minutes = 0; } + // default to 0 AM if hours is not valid + if ((inst.hours < inst.hours.starts) || (inst.hours > inst.hours.ends )) { inst.hours = 0; } + // default to 0 minutes if minute is not valid + if ((inst.minutes < inst.minutes.starts) || (inst.minutes > inst.minutes.ends)) { inst.minutes = 0; } var period = "", showPeriod = (this._get(inst, 'showPeriod') == true), @@ -1309,6 +1368,8 @@ $.timepicker.initialized = true; } + + var otherArgs = Array.prototype.slice.call(arguments, 1); if (typeof options == 'string' && (options == 'getTime' || options == 'getHour' || options == 'getMinute' )) return $.timepicker['_' + options + 'Timepicker']. @@ -1336,7 +1397,7 @@ $.timepicker = new Timepicker(); // singleton instance $.timepicker.initialized = false; $.timepicker.uuid = new Date().getTime(); - $.timepicker.version = "0.2.9"; + $.timepicker.version = "0.3.1"; // Workaround for #4055 // Add another global to avoid noConflict issues with inline event handlers diff --git a/3rdparty/timepicker/releases.txt b/3rdparty/timepicker/releases.txt old mode 100644 new mode 100755 index 64622d4942..99ecbafdac --- a/3rdparty/timepicker/releases.txt +++ b/3rdparty/timepicker/releases.txt @@ -1,3 +1,13 @@ +Release 0.3.0 - 27 March 2012 +Fixed a zIndex problem in jQuery Dialog when the user clicked on the input while the timepicker was still visible. +Added Czech translation, thanks David Spohr +Added Swedish translation, thanks Björn Westlin +Added Dutch translation, thanks Lowie Hulzinga +Prevent showing the timepicker dialog with the button when disabled(Thanks ruhley. ref #38) +Add ui-state-disabled class to button trigger when disabled. +Fixed onClose function on first time passes the hours variable as string (Thanks Zanisimo, ref #39) +Added "refresh" method $('selector').timepicker('refresh'); + Release 0.2.9 - November 13, 2011 Fixed the zIndex problem and removed the zIndex option (Thanks everyone who reported the problem) Fix a bug where repeatedly clicking on hour cells made the timepicker very slow. diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index de73357907..100a236872 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -15,9 +15,9 @@ var FileList={ extension=false; } html+=''; - html+=''+basename; + html+=''+escapeHTML(basename); if(extension){ - html+=''+extension+''; + html+=''+escapeHTML(extension)+''; } html+=''; if(size!='Pending'){ @@ -189,9 +189,9 @@ var FileList={ checkName:function(oldName, newName, isNewFile) { if (isNewFile || $('tr').filterAttr('data-file', newName).length > 0) { if (isNewFile) { - $('#notification').html(newName+' '+t('files', 'already exists')+''+t('files', 'replace')+''+t('files', 'suggest name')+''+t('files', 'cancel')+''); + $('#notification').html(escapeHTML(newName)+' '+t('files', 'already exists')+''+t('files', 'replace')+''+t('files', 'suggest name')+''+t('files', 'cancel')+''); } else { - $('#notification').html(newName+' '+t('files', 'already exists')+''+t('files', 'replace')+''+t('files', 'cancel')+''); + $('#notification').html(escapeHTML(newName)+' '+t('files', 'already exists')+''+t('files', 'replace')+''+t('files', 'cancel')+''); } $('#notification').data('oldName', oldName); $('#notification').data('newName', newName); @@ -272,9 +272,9 @@ var FileList={ } else { // NOTE: Temporary fix to change the text to unshared for files in root of Shared folder if ($('#dir').val() == '/Shared') { - $('#notification').html(t('files', 'unshared')+' '+files+''+t('files', 'undo')+''); + $('#notification').html(t('files', 'unshared')+' '+ escapeHTML(files) +''+t('files', 'undo')+''); } else { - $('#notification').html(t('files', 'deleted')+' '+files+''+t('files', 'undo')+''); + $('#notification').html(t('files', 'deleted')+' '+ escapeHTML(files)+''+t('files', 'undo')+''); } $('#notification').fadeIn(); } diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 64919acb5d..c5333f2faf 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -209,7 +209,7 @@ $(document).ready(function() { var totalSize=0; if(files){ for(var i=0;i "Kunne ikke uploade din fil, da det enten er en mappe eller er tom", "Upload Error" => "Fejl ved upload", "Pending" => "Afventer", +"1 file uploading" => "1 fil uploades", +"files uploading" => "filer uploades", "Upload cancelled." => "Upload afbrudt.", "File upload is in progress. Leaving the page now will cancel the upload." => "Fil upload kører. Hvis du forlader siden nu, vil uploadet blive annuleret.", "Invalid name, '/' is not allowed." => "Ugyldigt navn, '/' er ikke tilladt.", @@ -35,6 +37,16 @@ "folders" => "mapper", "file" => "fil", "files" => "filer", +"seconds ago" => "sekunder siden", +"minute ago" => "minut siden", +"minutes ago" => "minutter", +"today" => "i dag", +"yesterday" => "i går", +"days ago" => "dage siden", +"last month" => "sidste måned", +"months ago" => "måneder siden", +"last year" => "sidste år", +"years ago" => "år siden", "File handling" => "Filhåndtering", "Maximum upload size" => "Maksimal upload-størrelse", "max. possible: " => "max. mulige: ", diff --git a/apps/files/l10n/zh_CN.GB2312.php b/apps/files/l10n/zh_CN.GB2312.php index b60ad3d4cd..8d4ae972b9 100644 --- a/apps/files/l10n/zh_CN.GB2312.php +++ b/apps/files/l10n/zh_CN.GB2312.php @@ -9,6 +9,7 @@ "Files" => "文件", "Unshare" => "取消共享", "Delete" => "删除", +"Rename" => "重命名", "already exists" => "已经存在了", "replace" => "替换", "suggest name" => "推荐名称", @@ -22,6 +23,8 @@ "Unable to upload your file as it is a directory or has 0 bytes" => "不能上传你指定的文件,可能因为它是个文件夹或者大小为0", "Upload Error" => "上传错误", "Pending" => "Pending", +"1 file uploading" => "1 个文件正在上传", +"files uploading" => "个文件正在上传", "Upload cancelled." => "上传取消了", "File upload is in progress. Leaving the page now will cancel the upload." => "文件正在上传。关闭页面会取消上传。", "Invalid name, '/' is not allowed." => "非法文件名,\"/\"是不被许可的", @@ -34,6 +37,16 @@ "folders" => "文件夹", "file" => "文件", "files" => "文件", +"seconds ago" => "秒前", +"minute ago" => "分钟前", +"minutes ago" => "分钟前", +"today" => "今天", +"yesterday" => "昨天", +"days ago" => "天前", +"last month" => "上个月", +"months ago" => "月前", +"last year" => "去年", +"years ago" => "年前", "File handling" => "文件处理中", "Maximum upload size" => "最大上传大小", "max. possible: " => "最大可能", diff --git a/apps/files_external/l10n/da.php b/apps/files_external/l10n/da.php index e4f1b9bb5e..00a81f3da1 100644 --- a/apps/files_external/l10n/da.php +++ b/apps/files_external/l10n/da.php @@ -1,4 +1,10 @@ "Adgang godkendt", +"Error configuring Dropbox storage" => "Fejl ved konfiguration af Dropbox plads", +"Grant access" => "Godkend adgang", +"Fill out all required fields" => "Udfyld alle nødvendige felter", +"Please provide a valid Dropbox app key and secret." => "Angiv venligst en valid Dropbox app nøgle og hemmelighed", +"Error configuring Google Drive storage" => "Fejl ved konfiguration af Google Drive plads", "External Storage" => "Ekstern opbevaring", "Mount point" => "Monteringspunkt", "Backend" => "Backend", diff --git a/apps/files_external/l10n/de.php b/apps/files_external/l10n/de.php index cf9968bf92..5d57e5e459 100644 --- a/apps/files_external/l10n/de.php +++ b/apps/files_external/l10n/de.php @@ -1,9 +1,9 @@ "Zugriff erlaubt", +"Access granted" => "Zugriff gestattet", "Error configuring Dropbox storage" => "Fehler beim Einrichten von Dropbox", -"Grant access" => "Zugriff erlauben", -"Fill out all required fields" => "Alle notwendigen Felder füllen", -"Please provide a valid Dropbox app key and secret." => "Bitte geben Sie einen gültigen Dropbox-App-Key mit Secret ein.", +"Grant access" => "Zugriff gestatten", +"Fill out all required fields" => "Bitte alle notwendigen Felder füllen", +"Please provide a valid Dropbox app key and secret." => "Bitte trage einen gültigen Dropbox-App-Key mit Secret ein.", "Error configuring Google Drive storage" => "Fehler beim Einrichten von Google Drive", "External Storage" => "Externer Speicher", "Mount point" => "Mount-Point", diff --git a/apps/files_external/l10n/fi_FI.php b/apps/files_external/l10n/fi_FI.php index c8c93306e1..d7b16e0d3e 100644 --- a/apps/files_external/l10n/fi_FI.php +++ b/apps/files_external/l10n/fi_FI.php @@ -1,4 +1,9 @@ "Pääsy sallittu", +"Error configuring Dropbox storage" => "Virhe Dropbox levyn asetuksia tehtäessä", +"Grant access" => "Salli pääsy", +"Fill out all required fields" => "Täytä kaikki vaaditut kentät", +"Error configuring Google Drive storage" => "Virhe Google Drive levyn asetuksia tehtäessä", "External Storage" => "Erillinen tallennusväline", "Mount point" => "Liitospiste", "Backend" => "Taustaosa", diff --git a/apps/files_external/l10n/nl.php b/apps/files_external/l10n/nl.php index fee60e66aa..87ab87cfc9 100644 --- a/apps/files_external/l10n/nl.php +++ b/apps/files_external/l10n/nl.php @@ -1,4 +1,10 @@ "Toegang toegestaan", +"Error configuring Dropbox storage" => "Fout tijdens het configureren van Dropbox opslag", +"Grant access" => "Sta toegang toe", +"Fill out all required fields" => "Vul alle verplichte in", +"Please provide a valid Dropbox app key and secret." => "Geef een geldige Dropbox key en secret.", +"Error configuring Google Drive storage" => "Fout tijdens het configureren van Google Drive opslag", "External Storage" => "Externe opslag", "Mount point" => "Aankoppelpunt", "Backend" => "Backend", diff --git a/apps/files_external/l10n/ru_RU.php b/apps/files_external/l10n/ru_RU.php index 4bd2e2e964..493e3f5bee 100644 --- a/apps/files_external/l10n/ru_RU.php +++ b/apps/files_external/l10n/ru_RU.php @@ -3,6 +3,8 @@ "Error configuring Dropbox storage" => "Ошибка при конфигурировании хранилища Dropbox", "Grant access" => "Предоставить доступ", "Fill out all required fields" => "Заполните все требуемые поля", +"Please provide a valid Dropbox app key and secret." => "Пожалуйста представьте допустимый ключ приложения Dropbox и пароль.", +"Error configuring Google Drive storage" => "Ошибка настройки хранилища Google Drive", "External Storage" => "Внешние системы хранения данных", "Mount point" => "Точка монтирования", "Backend" => "Бэкэнд", diff --git a/apps/files_external/l10n/zh_CN.GB2312.php b/apps/files_external/l10n/zh_CN.GB2312.php index 62ac77ada0..47983d3d7d 100644 --- a/apps/files_external/l10n/zh_CN.GB2312.php +++ b/apps/files_external/l10n/zh_CN.GB2312.php @@ -1,4 +1,10 @@ "已授予权限", +"Error configuring Dropbox storage" => "配置 Dropbox 存储出错", +"Grant access" => "授予权限", +"Fill out all required fields" => "填充全部必填字段", +"Please provide a valid Dropbox app key and secret." => "请提供一个有效的 Dropbox app key 和 secret。", +"Error configuring Google Drive storage" => "配置 Google Drive 存储失败", "External Storage" => "外部存储", "Mount point" => "挂载点", "Backend" => "后端", diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 7be2336019..3ba86cf148 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -288,6 +288,9 @@ class OC_Mount_Config { if (!is_dir($path)) mkdir($path); $result = array(); $handle = opendir($path); + if (!$handle) { + return array(); + } while (false !== ($file = readdir($handle))) { if($file != '.' && $file != '..') $result[] = $file; } diff --git a/apps/files_sharing/l10n/ru_RU.php b/apps/files_sharing/l10n/ru_RU.php index a1579efc8f..36e4b2fd0e 100644 --- a/apps/files_sharing/l10n/ru_RU.php +++ b/apps/files_sharing/l10n/ru_RU.php @@ -1,6 +1,8 @@ "Пароль", "Submit" => "Передать", +"%s shared the folder %s with you" => "%s имеет общий с Вами доступ к папке %s ", +"%s shared the file %s with you" => "%s имеет общий с Вами доступ к файлу %s ", "Download" => "Загрузка", "No preview available for" => "Предварительный просмотр недоступен", "web services under your control" => "веб-сервисы под Вашим контролем" diff --git a/apps/files_sharing/l10n/zh_CN.GB2312.php b/apps/files_sharing/l10n/zh_CN.GB2312.php index fdde2c641f..117ec8f406 100644 --- a/apps/files_sharing/l10n/zh_CN.GB2312.php +++ b/apps/files_sharing/l10n/zh_CN.GB2312.php @@ -1,6 +1,8 @@ "密码", "Submit" => "提交", +"%s shared the folder %s with you" => "%s 与您分享了文件夹 %s", +"%s shared the file %s with you" => "%s 与您分享了文件 %s", "Download" => "下载", "No preview available for" => "没有预览可用于", "web services under your control" => "您控制的网络服务" diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index 87396cd0ba..07c5655560 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -45,7 +45,7 @@ function createVersionsDropdown(filename, files) { var historyUrl = OC.linkTo('files_versions', 'history.php') + '?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename ); - var html = '