增加了/htdocs/static /htdocs/upload /htdocs/plugins 3个目录
|
@ -0,0 +1,806 @@
|
||||||
|
<?php
|
||||||
|
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts to and from JSON format.
|
||||||
|
*
|
||||||
|
* JSON (JavaScript Object Notation) is a lightweight data-interchange
|
||||||
|
* format. It is easy for humans to read and write. It is easy for machines
|
||||||
|
* to parse and generate. It is based on a subset of the JavaScript
|
||||||
|
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
|
||||||
|
* This feature can also be found in Python. JSON is a text format that is
|
||||||
|
* completely language independent but uses conventions that are familiar
|
||||||
|
* to programmers of the C-family of languages, including C, C++, C#, Java,
|
||||||
|
* JavaScript, Perl, TCL, and many others. These properties make JSON an
|
||||||
|
* ideal data-interchange language.
|
||||||
|
*
|
||||||
|
* This package provides a simple encoder and decoder for JSON notation. It
|
||||||
|
* is intended for use with client-side Javascript applications that make
|
||||||
|
* use of HTTPRequest to perform server communication functions - data can
|
||||||
|
* be encoded into JSON notation for use in a client-side javascript, or
|
||||||
|
* decoded from incoming Javascript requests. JSON format is native to
|
||||||
|
* Javascript, and can be directly eval()'ed with no further parsing
|
||||||
|
* overhead
|
||||||
|
*
|
||||||
|
* All strings should be in ASCII or UTF-8 format!
|
||||||
|
*
|
||||||
|
* LICENSE: Redistribution and use in source and binary forms, with or
|
||||||
|
* without modification, are permitted provided that the following
|
||||||
|
* conditions are met: Redistributions of source code must retain the
|
||||||
|
* above copyright notice, this list of conditions and the following
|
||||||
|
* disclaimer. Redistributions in binary form must reproduce the above
|
||||||
|
* copyright notice, this list of conditions and the following disclaimer
|
||||||
|
* in the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||||
|
* NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||||
|
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||||
|
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
* DAMAGE.
|
||||||
|
*
|
||||||
|
* @category
|
||||||
|
* @package Services_JSON
|
||||||
|
* @author Michal Migurski <mike-json@teczno.com>
|
||||||
|
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
|
||||||
|
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
|
||||||
|
* @copyright 2005 Michal Migurski
|
||||||
|
* @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
|
||||||
|
* @license http://www.opensource.org/licenses/bsd-license.php
|
||||||
|
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||||
|
*/
|
||||||
|
define('SERVICES_JSON_SLICE', 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||||
|
*/
|
||||||
|
define('SERVICES_JSON_IN_STR', 2);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||||
|
*/
|
||||||
|
define('SERVICES_JSON_IN_ARR', 3);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||||
|
*/
|
||||||
|
define('SERVICES_JSON_IN_OBJ', 4);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||||
|
*/
|
||||||
|
define('SERVICES_JSON_IN_CMT', 5);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Behavior switch for Services_JSON::decode()
|
||||||
|
*/
|
||||||
|
define('SERVICES_JSON_LOOSE_TYPE', 16);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Behavior switch for Services_JSON::decode()
|
||||||
|
*/
|
||||||
|
define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts to and from JSON format.
|
||||||
|
*
|
||||||
|
* Brief example of use:
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* // create a new instance of Services_JSON
|
||||||
|
* $json = new Services_JSON();
|
||||||
|
*
|
||||||
|
* // convert a complexe value to JSON notation, and send it to the browser
|
||||||
|
* $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
|
||||||
|
* $output = $json->encode($value);
|
||||||
|
*
|
||||||
|
* print($output);
|
||||||
|
* // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
|
||||||
|
*
|
||||||
|
* // accept incoming POST data, assumed to be in JSON notation
|
||||||
|
* $input = file_get_contents('php://input', 1000000);
|
||||||
|
* $value = $json->decode($input);
|
||||||
|
* </code>
|
||||||
|
*/
|
||||||
|
class Services_JSON
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* constructs a new JSON instance
|
||||||
|
*
|
||||||
|
* @param int $use object behavior flags; combine with boolean-OR
|
||||||
|
*
|
||||||
|
* possible values:
|
||||||
|
* - SERVICES_JSON_LOOSE_TYPE: loose typing.
|
||||||
|
* "{...}" syntax creates associative arrays
|
||||||
|
* instead of objects in decode().
|
||||||
|
* - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
|
||||||
|
* Values which can't be encoded (e.g. resources)
|
||||||
|
* appear as NULL instead of throwing errors.
|
||||||
|
* By default, a deeply-nested resource will
|
||||||
|
* bubble up with an error, so all return values
|
||||||
|
* from encode() should be checked with isError()
|
||||||
|
*/
|
||||||
|
function Services_JSON($use = 0)
|
||||||
|
{
|
||||||
|
$this->use = $use;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* convert a string from one UTF-16 char to one UTF-8 char
|
||||||
|
*
|
||||||
|
* Normally should be handled by mb_convert_encoding, but
|
||||||
|
* provides a slower PHP-only method for installations
|
||||||
|
* that lack the multibye string extension.
|
||||||
|
*
|
||||||
|
* @param string $utf16 UTF-16 character
|
||||||
|
* @return string UTF-8 character
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
function utf162utf8($utf16)
|
||||||
|
{
|
||||||
|
// oh please oh please oh please oh please oh please
|
||||||
|
if(function_exists('mb_convert_encoding')) {
|
||||||
|
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
||||||
|
}
|
||||||
|
|
||||||
|
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
|
||||||
|
|
||||||
|
switch(true) {
|
||||||
|
case ((0x7F & $bytes) == $bytes):
|
||||||
|
// this case should never be reached, because we are in ASCII range
|
||||||
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
return chr(0x7F & $bytes);
|
||||||
|
|
||||||
|
case (0x07FF & $bytes) == $bytes:
|
||||||
|
// return a 2-byte UTF-8 character
|
||||||
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
return chr(0xC0 | (($bytes >> 6) & 0x1F))
|
||||||
|
. chr(0x80 | ($bytes & 0x3F));
|
||||||
|
|
||||||
|
case (0xFFFF & $bytes) == $bytes:
|
||||||
|
// return a 3-byte UTF-8 character
|
||||||
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
return chr(0xE0 | (($bytes >> 12) & 0x0F))
|
||||||
|
. chr(0x80 | (($bytes >> 6) & 0x3F))
|
||||||
|
. chr(0x80 | ($bytes & 0x3F));
|
||||||
|
}
|
||||||
|
|
||||||
|
// ignoring UTF-32 for now, sorry
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* convert a string from one UTF-8 char to one UTF-16 char
|
||||||
|
*
|
||||||
|
* Normally should be handled by mb_convert_encoding, but
|
||||||
|
* provides a slower PHP-only method for installations
|
||||||
|
* that lack the multibye string extension.
|
||||||
|
*
|
||||||
|
* @param string $utf8 UTF-8 character
|
||||||
|
* @return string UTF-16 character
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
function utf82utf16($utf8)
|
||||||
|
{
|
||||||
|
// oh please oh please oh please oh please oh please
|
||||||
|
if(function_exists('mb_convert_encoding')) {
|
||||||
|
return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(strlen($utf8)) {
|
||||||
|
case 1:
|
||||||
|
// this case should never be reached, because we are in ASCII range
|
||||||
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
return $utf8;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
// return a UTF-16 character from a 2-byte UTF-8 char
|
||||||
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
return chr(0x07 & (ord($utf8{0}) >> 2))
|
||||||
|
. chr((0xC0 & (ord($utf8{0}) << 6))
|
||||||
|
| (0x3F & ord($utf8{1})));
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
// return a UTF-16 character from a 3-byte UTF-8 char
|
||||||
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
return chr((0xF0 & (ord($utf8{0}) << 4))
|
||||||
|
| (0x0F & (ord($utf8{1}) >> 2)))
|
||||||
|
. chr((0xC0 & (ord($utf8{1}) << 6))
|
||||||
|
| (0x7F & ord($utf8{2})));
|
||||||
|
}
|
||||||
|
|
||||||
|
// ignoring UTF-32 for now, sorry
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* encodes an arbitrary variable into JSON format
|
||||||
|
*
|
||||||
|
* @param mixed $var any number, boolean, string, array, or object to be encoded.
|
||||||
|
* see argument 1 to Services_JSON() above for array-parsing behavior.
|
||||||
|
* if var is a strng, note that encode() always expects it
|
||||||
|
* to be in ASCII or UTF-8 format!
|
||||||
|
*
|
||||||
|
* @return mixed JSON string representation of input var or an error if a problem occurs
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
function encode($var)
|
||||||
|
{
|
||||||
|
switch (gettype($var)) {
|
||||||
|
case 'boolean':
|
||||||
|
return $var ? 'true' : 'false';
|
||||||
|
|
||||||
|
case 'NULL':
|
||||||
|
return 'null';
|
||||||
|
|
||||||
|
case 'integer':
|
||||||
|
return (int) $var;
|
||||||
|
|
||||||
|
case 'double':
|
||||||
|
case 'float':
|
||||||
|
return (float) $var;
|
||||||
|
|
||||||
|
case 'string':
|
||||||
|
// STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
|
||||||
|
$ascii = '';
|
||||||
|
$strlen_var = strlen($var);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Iterate over every character in the string,
|
||||||
|
* escaping with a slash or encoding to UTF-8 where necessary
|
||||||
|
*/
|
||||||
|
for ($c = 0; $c < $strlen_var; ++$c) {
|
||||||
|
|
||||||
|
$ord_var_c = ord($var{$c});
|
||||||
|
|
||||||
|
switch (true) {
|
||||||
|
case $ord_var_c == 0x08:
|
||||||
|
$ascii .= '\b';
|
||||||
|
break;
|
||||||
|
case $ord_var_c == 0x09:
|
||||||
|
$ascii .= '\t';
|
||||||
|
break;
|
||||||
|
case $ord_var_c == 0x0A:
|
||||||
|
$ascii .= '\n';
|
||||||
|
break;
|
||||||
|
case $ord_var_c == 0x0C:
|
||||||
|
$ascii .= '\f';
|
||||||
|
break;
|
||||||
|
case $ord_var_c == 0x0D:
|
||||||
|
$ascii .= '\r';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case $ord_var_c == 0x22:
|
||||||
|
case $ord_var_c == 0x2F:
|
||||||
|
case $ord_var_c == 0x5C:
|
||||||
|
// double quote, slash, slosh
|
||||||
|
$ascii .= '\\'.$var{$c};
|
||||||
|
break;
|
||||||
|
|
||||||
|
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
|
||||||
|
// characters U-00000000 - U-0000007F (same as ASCII)
|
||||||
|
$ascii .= $var{$c};
|
||||||
|
break;
|
||||||
|
|
||||||
|
case (($ord_var_c & 0xE0) == 0xC0):
|
||||||
|
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||||
|
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
|
||||||
|
$c += 1;
|
||||||
|
$utf16 = $this->utf82utf16($char);
|
||||||
|
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case (($ord_var_c & 0xF0) == 0xE0):
|
||||||
|
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
||||||
|
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$char = pack('C*', $ord_var_c,
|
||||||
|
ord($var{$c + 1}),
|
||||||
|
ord($var{$c + 2}));
|
||||||
|
$c += 2;
|
||||||
|
$utf16 = $this->utf82utf16($char);
|
||||||
|
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case (($ord_var_c & 0xF8) == 0xF0):
|
||||||
|
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
||||||
|
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$char = pack('C*', $ord_var_c,
|
||||||
|
ord($var{$c + 1}),
|
||||||
|
ord($var{$c + 2}),
|
||||||
|
ord($var{$c + 3}));
|
||||||
|
$c += 3;
|
||||||
|
$utf16 = $this->utf82utf16($char);
|
||||||
|
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case (($ord_var_c & 0xFC) == 0xF8):
|
||||||
|
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
||||||
|
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$char = pack('C*', $ord_var_c,
|
||||||
|
ord($var{$c + 1}),
|
||||||
|
ord($var{$c + 2}),
|
||||||
|
ord($var{$c + 3}),
|
||||||
|
ord($var{$c + 4}));
|
||||||
|
$c += 4;
|
||||||
|
$utf16 = $this->utf82utf16($char);
|
||||||
|
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case (($ord_var_c & 0xFE) == 0xFC):
|
||||||
|
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
||||||
|
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$char = pack('C*', $ord_var_c,
|
||||||
|
ord($var{$c + 1}),
|
||||||
|
ord($var{$c + 2}),
|
||||||
|
ord($var{$c + 3}),
|
||||||
|
ord($var{$c + 4}),
|
||||||
|
ord($var{$c + 5}));
|
||||||
|
$c += 5;
|
||||||
|
$utf16 = $this->utf82utf16($char);
|
||||||
|
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return '"'.$ascii.'"';
|
||||||
|
|
||||||
|
case 'array':
|
||||||
|
/*
|
||||||
|
* As per JSON spec if any array key is not an integer
|
||||||
|
* we must treat the the whole array as an object. We
|
||||||
|
* also try to catch a sparsely populated associative
|
||||||
|
* array with numeric keys here because some JS engines
|
||||||
|
* will create an array with empty indexes up to
|
||||||
|
* max_index which can cause memory issues and because
|
||||||
|
* the keys, which may be relevant, will be remapped
|
||||||
|
* otherwise.
|
||||||
|
*
|
||||||
|
* As per the ECMA and JSON specification an object may
|
||||||
|
* have any string as a property. Unfortunately due to
|
||||||
|
* a hole in the ECMA specification if the key is a
|
||||||
|
* ECMA reserved word or starts with a digit the
|
||||||
|
* parameter is only accessible using ECMAScript's
|
||||||
|
* bracket notation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// treat as a JSON object
|
||||||
|
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
|
||||||
|
$properties = array_map(array($this, 'name_value'),
|
||||||
|
array_keys($var),
|
||||||
|
array_values($var));
|
||||||
|
|
||||||
|
foreach($properties as $property) {
|
||||||
|
if(Services_JSON::isError($property)) {
|
||||||
|
return $property;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return '{' . join(',', $properties) . '}';
|
||||||
|
}
|
||||||
|
|
||||||
|
// treat it like a regular array
|
||||||
|
$elements = array_map(array($this, 'encode'), $var);
|
||||||
|
|
||||||
|
foreach($elements as $element) {
|
||||||
|
if(Services_JSON::isError($element)) {
|
||||||
|
return $element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return '[' . join(',', $elements) . ']';
|
||||||
|
|
||||||
|
case 'object':
|
||||||
|
$vars = get_object_vars($var);
|
||||||
|
|
||||||
|
$properties = array_map(array($this, 'name_value'),
|
||||||
|
array_keys($vars),
|
||||||
|
array_values($vars));
|
||||||
|
|
||||||
|
foreach($properties as $property) {
|
||||||
|
if(Services_JSON::isError($property)) {
|
||||||
|
return $property;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return '{' . join(',', $properties) . '}';
|
||||||
|
|
||||||
|
default:
|
||||||
|
return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
|
||||||
|
? 'null'
|
||||||
|
: new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* array-walking function for use in generating JSON-formatted name-value pairs
|
||||||
|
*
|
||||||
|
* @param string $name name of key to use
|
||||||
|
* @param mixed $value reference to an array element to be encoded
|
||||||
|
*
|
||||||
|
* @return string JSON-formatted name-value pair, like '"name":value'
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
function name_value($name, $value)
|
||||||
|
{
|
||||||
|
$encoded_value = $this->encode($value);
|
||||||
|
|
||||||
|
if(Services_JSON::isError($encoded_value)) {
|
||||||
|
return $encoded_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->encode(strval($name)) . ':' . $encoded_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reduce a string by removing leading and trailing comments and whitespace
|
||||||
|
*
|
||||||
|
* @param $str string string value to strip of comments and whitespace
|
||||||
|
*
|
||||||
|
* @return string string value stripped of comments and whitespace
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
function reduce_string($str)
|
||||||
|
{
|
||||||
|
$str = preg_replace(array(
|
||||||
|
|
||||||
|
// eliminate single line comments in '// ...' form
|
||||||
|
'#^\s*//(.+)$#m',
|
||||||
|
|
||||||
|
// eliminate multi-line comments in '/* ... */' form, at start of string
|
||||||
|
'#^\s*/\*(.+)\*/#Us',
|
||||||
|
|
||||||
|
// eliminate multi-line comments in '/* ... */' form, at end of string
|
||||||
|
'#/\*(.+)\*/\s*$#Us'
|
||||||
|
|
||||||
|
), '', $str);
|
||||||
|
|
||||||
|
// eliminate extraneous space
|
||||||
|
return trim($str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* decodes a JSON string into appropriate variable
|
||||||
|
*
|
||||||
|
* @param string $str JSON-formatted string
|
||||||
|
*
|
||||||
|
* @return mixed number, boolean, string, array, or object
|
||||||
|
* corresponding to given JSON input string.
|
||||||
|
* See argument 1 to Services_JSON() above for object-output behavior.
|
||||||
|
* Note that decode() always returns strings
|
||||||
|
* in ASCII or UTF-8 format!
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
function decode($str)
|
||||||
|
{
|
||||||
|
$str = $this->reduce_string($str);
|
||||||
|
|
||||||
|
switch (strtolower($str)) {
|
||||||
|
case 'true':
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case 'false':
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case 'null':
|
||||||
|
return null;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$m = array();
|
||||||
|
|
||||||
|
if (is_numeric($str)) {
|
||||||
|
// Lookie-loo, it's a number
|
||||||
|
|
||||||
|
// This would work on its own, but I'm trying to be
|
||||||
|
// good about returning integers where appropriate:
|
||||||
|
// return (float)$str;
|
||||||
|
|
||||||
|
// Return float or int, as appropriate
|
||||||
|
return ((float)$str == (integer)$str)
|
||||||
|
? (integer)$str
|
||||||
|
: (float)$str;
|
||||||
|
|
||||||
|
} elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
|
||||||
|
// STRINGS RETURNED IN UTF-8 FORMAT
|
||||||
|
$delim = substr($str, 0, 1);
|
||||||
|
$chrs = substr($str, 1, -1);
|
||||||
|
$utf8 = '';
|
||||||
|
$strlen_chrs = strlen($chrs);
|
||||||
|
|
||||||
|
for ($c = 0; $c < $strlen_chrs; ++$c) {
|
||||||
|
|
||||||
|
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||||
|
$ord_chrs_c = ord($chrs{$c});
|
||||||
|
|
||||||
|
switch (true) {
|
||||||
|
case $substr_chrs_c_2 == '\b':
|
||||||
|
$utf8 .= chr(0x08);
|
||||||
|
++$c;
|
||||||
|
break;
|
||||||
|
case $substr_chrs_c_2 == '\t':
|
||||||
|
$utf8 .= chr(0x09);
|
||||||
|
++$c;
|
||||||
|
break;
|
||||||
|
case $substr_chrs_c_2 == '\n':
|
||||||
|
$utf8 .= chr(0x0A);
|
||||||
|
++$c;
|
||||||
|
break;
|
||||||
|
case $substr_chrs_c_2 == '\f':
|
||||||
|
$utf8 .= chr(0x0C);
|
||||||
|
++$c;
|
||||||
|
break;
|
||||||
|
case $substr_chrs_c_2 == '\r':
|
||||||
|
$utf8 .= chr(0x0D);
|
||||||
|
++$c;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case $substr_chrs_c_2 == '\\"':
|
||||||
|
case $substr_chrs_c_2 == '\\\'':
|
||||||
|
case $substr_chrs_c_2 == '\\\\':
|
||||||
|
case $substr_chrs_c_2 == '\\/':
|
||||||
|
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
|
||||||
|
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
|
||||||
|
$utf8 .= $chrs{++$c};
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
|
||||||
|
// single, escaped unicode character
|
||||||
|
$utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
|
||||||
|
. chr(hexdec(substr($chrs, ($c + 4), 2)));
|
||||||
|
$utf8 .= $this->utf162utf8($utf16);
|
||||||
|
$c += 5;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
|
||||||
|
$utf8 .= $chrs{$c};
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ($ord_chrs_c & 0xE0) == 0xC0:
|
||||||
|
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||||
|
//see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$utf8 .= substr($chrs, $c, 2);
|
||||||
|
++$c;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ($ord_chrs_c & 0xF0) == 0xE0:
|
||||||
|
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
||||||
|
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$utf8 .= substr($chrs, $c, 3);
|
||||||
|
$c += 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ($ord_chrs_c & 0xF8) == 0xF0:
|
||||||
|
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
||||||
|
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$utf8 .= substr($chrs, $c, 4);
|
||||||
|
$c += 3;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ($ord_chrs_c & 0xFC) == 0xF8:
|
||||||
|
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
||||||
|
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$utf8 .= substr($chrs, $c, 5);
|
||||||
|
$c += 4;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ($ord_chrs_c & 0xFE) == 0xFC:
|
||||||
|
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
||||||
|
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
|
$utf8 .= substr($chrs, $c, 6);
|
||||||
|
$c += 5;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $utf8;
|
||||||
|
|
||||||
|
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
|
||||||
|
// array, or object notation
|
||||||
|
|
||||||
|
if ($str{0} == '[') {
|
||||||
|
$stk = array(SERVICES_JSON_IN_ARR);
|
||||||
|
$arr = array();
|
||||||
|
} else {
|
||||||
|
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||||
|
$stk = array(SERVICES_JSON_IN_OBJ);
|
||||||
|
$obj = array();
|
||||||
|
} else {
|
||||||
|
$stk = array(SERVICES_JSON_IN_OBJ);
|
||||||
|
$obj = new stdClass();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
array_push($stk, array('what' => SERVICES_JSON_SLICE,
|
||||||
|
'where' => 0,
|
||||||
|
'delim' => false));
|
||||||
|
|
||||||
|
$chrs = substr($str, 1, -1);
|
||||||
|
$chrs = $this->reduce_string($chrs);
|
||||||
|
|
||||||
|
if ($chrs == '') {
|
||||||
|
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||||
|
return $arr;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return $obj;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//print("\nparsing {$chrs}\n");
|
||||||
|
|
||||||
|
$strlen_chrs = strlen($chrs);
|
||||||
|
|
||||||
|
for ($c = 0; $c <= $strlen_chrs; ++$c) {
|
||||||
|
|
||||||
|
$top = end($stk);
|
||||||
|
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||||
|
|
||||||
|
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
|
||||||
|
// found a comma that is not inside a string, array, etc.,
|
||||||
|
// OR we've reached the end of the character list
|
||||||
|
$slice = substr($chrs, $top['where'], ($c - $top['where']));
|
||||||
|
array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
|
||||||
|
//print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||||
|
|
||||||
|
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||||
|
// we are in an array, so just push an element onto the stack
|
||||||
|
array_push($arr, $this->decode($slice));
|
||||||
|
|
||||||
|
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||||
|
// we are in an object, so figure
|
||||||
|
// out the property name and set an
|
||||||
|
// element in an associative array,
|
||||||
|
// for now
|
||||||
|
$parts = array();
|
||||||
|
|
||||||
|
if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
||||||
|
// "name":value pair
|
||||||
|
$key = $this->decode($parts[1]);
|
||||||
|
$val = $this->decode($parts[2]);
|
||||||
|
|
||||||
|
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||||
|
$obj[$key] = $val;
|
||||||
|
} else {
|
||||||
|
$obj->$key = $val;
|
||||||
|
}
|
||||||
|
} elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
||||||
|
// name:value pair, where name is unquoted
|
||||||
|
$key = $parts[1];
|
||||||
|
$val = $this->decode($parts[2]);
|
||||||
|
|
||||||
|
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||||
|
$obj[$key] = $val;
|
||||||
|
} else {
|
||||||
|
$obj->$key = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
|
||||||
|
// found a quote, and we are not inside a string
|
||||||
|
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
|
||||||
|
//print("Found start of string at {$c}\n");
|
||||||
|
|
||||||
|
} elseif (($chrs{$c} == $top['delim']) &&
|
||||||
|
($top['what'] == SERVICES_JSON_IN_STR) &&
|
||||||
|
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
|
||||||
|
// found a quote, we're in a string, and it's not escaped
|
||||||
|
// we know that it's not escaped becase there is _not_ an
|
||||||
|
// odd number of backslashes at the end of the string so far
|
||||||
|
array_pop($stk);
|
||||||
|
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
|
||||||
|
|
||||||
|
} elseif (($chrs{$c} == '[') &&
|
||||||
|
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||||
|
// found a left-bracket, and we are in an array, object, or slice
|
||||||
|
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
|
||||||
|
//print("Found start of array at {$c}\n");
|
||||||
|
|
||||||
|
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
|
||||||
|
// found a right-bracket, and we're in an array
|
||||||
|
array_pop($stk);
|
||||||
|
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||||
|
|
||||||
|
} elseif (($chrs{$c} == '{') &&
|
||||||
|
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||||
|
// found a left-brace, and we are in an array, object, or slice
|
||||||
|
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
|
||||||
|
//print("Found start of object at {$c}\n");
|
||||||
|
|
||||||
|
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
|
||||||
|
// found a right-brace, and we're in an object
|
||||||
|
array_pop($stk);
|
||||||
|
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||||
|
|
||||||
|
} elseif (($substr_chrs_c_2 == '/*') &&
|
||||||
|
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||||
|
// found a comment start, and we are in an array, object, or slice
|
||||||
|
array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
|
||||||
|
$c++;
|
||||||
|
//print("Found start of comment at {$c}\n");
|
||||||
|
|
||||||
|
} elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
|
||||||
|
// found a comment end, and we're in one now
|
||||||
|
array_pop($stk);
|
||||||
|
$c++;
|
||||||
|
|
||||||
|
for ($i = $top['where']; $i <= $c; ++$i)
|
||||||
|
$chrs = substr_replace($chrs, ' ', $i, 1);
|
||||||
|
|
||||||
|
//print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||||
|
return $arr;
|
||||||
|
|
||||||
|
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||||
|
return $obj;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo Ultimately, this should just call PEAR::isError()
|
||||||
|
*/
|
||||||
|
function isError($data, $code = null)
|
||||||
|
{
|
||||||
|
if (class_exists('pear')) {
|
||||||
|
return PEAR::isError($data, $code);
|
||||||
|
} elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
|
||||||
|
is_subclass_of($data, 'services_json_error'))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (class_exists('PEAR_Error')) {
|
||||||
|
|
||||||
|
class Services_JSON_Error extends PEAR_Error
|
||||||
|
{
|
||||||
|
function Services_JSON_Error($message = 'unknown error', $code = null,
|
||||||
|
$mode = null, $options = null, $userinfo = null)
|
||||||
|
{
|
||||||
|
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo Ultimately, this class shall be descended from PEAR_Error
|
||||||
|
*/
|
||||||
|
class Services_JSON_Error
|
||||||
|
{
|
||||||
|
function Services_JSON_Error($message = 'unknown error', $code = null,
|
||||||
|
$mode = null, $options = null, $userinfo = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
|
@ -0,0 +1,138 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* KindEditor PHP
|
||||||
|
*
|
||||||
|
* 本PHP程序是演示程序,建议不要直接在实际项目中使用。
|
||||||
|
* 如果您确定直接使用本程序,使用之前请仔细确认相关安全设置。
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once 'JSON.php';
|
||||||
|
|
||||||
|
$php_path = dirname(__FILE__) . '/';
|
||||||
|
$php_url = dirname($_SERVER['PHP_SELF']) . '/';
|
||||||
|
|
||||||
|
//根目录路径,可以指定绝对路径,比如 /var/www/attached/
|
||||||
|
$root_path = $php_path . '../upload/';
|
||||||
|
//根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/
|
||||||
|
$root_url = $php_url . '../upload/';
|
||||||
|
//图片扩展名
|
||||||
|
$ext_arr = array('gif', 'jpg', 'jpeg', 'png', 'bmp');
|
||||||
|
|
||||||
|
//目录名
|
||||||
|
$dir_name = empty($_GET['dir']) ? '' : trim($_GET['dir']);
|
||||||
|
if (!in_array($dir_name, array('', 'image', 'flash', 'media', 'file'))) {
|
||||||
|
echo "Invalid Directory name.";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if ($dir_name !== '') {
|
||||||
|
$root_path .= $dir_name . "/";
|
||||||
|
$root_url .= $dir_name . "/";
|
||||||
|
if (!file_exists($root_path)) {
|
||||||
|
mkdir($root_path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据path参数,设置各路径和URL
|
||||||
|
if (empty($_GET['path'])) {
|
||||||
|
$current_path = realpath($root_path) . '/';
|
||||||
|
$current_url = $root_url;
|
||||||
|
$current_dir_path = '';
|
||||||
|
$moveup_dir_path = '';
|
||||||
|
} else {
|
||||||
|
$current_path = realpath($root_path) . '/' . $_GET['path'];
|
||||||
|
$current_url = $root_url . $_GET['path'];
|
||||||
|
$current_dir_path = $_GET['path'];
|
||||||
|
$moveup_dir_path = preg_replace('/(.*?)[^\/]+\/$/', '$1', $current_dir_path);
|
||||||
|
}
|
||||||
|
echo realpath($root_path);
|
||||||
|
//排序形式,name or size or type
|
||||||
|
$order = empty($_GET['order']) ? 'name' : strtolower($_GET['order']);
|
||||||
|
|
||||||
|
//不允许使用..移动到上一级目录
|
||||||
|
if (preg_match('/\.\./', $current_path)) {
|
||||||
|
echo 'Access is not allowed.';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//最后一个字符不是/
|
||||||
|
if (!preg_match('/\/$/', $current_path)) {
|
||||||
|
echo 'Parameter is not valid.';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//目录不存在或不是目录
|
||||||
|
if (!file_exists($current_path) || !is_dir($current_path)) {
|
||||||
|
echo 'Directory does not exist.';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
//遍历目录取得文件信息
|
||||||
|
$file_list = array();
|
||||||
|
if ($handle = opendir($current_path)) {
|
||||||
|
$i = 0;
|
||||||
|
while (false !== ($filename = readdir($handle))) {
|
||||||
|
if ($filename{0} == '.') continue;
|
||||||
|
$file = $current_path . $filename;
|
||||||
|
if (is_dir($file)) {
|
||||||
|
$file_list[$i]['is_dir'] = true; //是否文件夹
|
||||||
|
$file_list[$i]['has_file'] = (count(scandir($file)) > 2); //文件夹是否包含文件
|
||||||
|
$file_list[$i]['filesize'] = 0; //文件大小
|
||||||
|
$file_list[$i]['is_photo'] = false; //是否图片
|
||||||
|
$file_list[$i]['filetype'] = ''; //文件类别,用扩展名判断
|
||||||
|
} else {
|
||||||
|
$file_list[$i]['is_dir'] = false;
|
||||||
|
$file_list[$i]['has_file'] = false;
|
||||||
|
$file_list[$i]['filesize'] = filesize($file);
|
||||||
|
$file_list[$i]['dir_path'] = '';
|
||||||
|
$file_ext = strtolower(array_pop(explode('.', trim($file))));
|
||||||
|
$file_list[$i]['is_photo'] = in_array($file_ext, $ext_arr);
|
||||||
|
$file_list[$i]['filetype'] = $file_ext;
|
||||||
|
}
|
||||||
|
$file_list[$i]['filename'] = $filename; //文件名,包含扩展名
|
||||||
|
$file_list[$i]['datetime'] = date('Y-m-d H:i:s', filemtime($file)); //文件最后修改时间
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
//排序
|
||||||
|
function cmp_func($a, $b) {
|
||||||
|
global $order;
|
||||||
|
if ($a['is_dir'] && !$b['is_dir']) {
|
||||||
|
return -1;
|
||||||
|
} else if (!$a['is_dir'] && $b['is_dir']) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
if ($order == 'size') {
|
||||||
|
if ($a['filesize'] > $b['filesize']) {
|
||||||
|
return 1;
|
||||||
|
} else if ($a['filesize'] < $b['filesize']) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} else if ($order == 'type') {
|
||||||
|
return strcmp($a['filetype'], $b['filetype']);
|
||||||
|
} else {
|
||||||
|
return strcmp($a['filename'], $b['filename']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
usort($file_list, 'cmp_func');
|
||||||
|
|
||||||
|
$result = array();
|
||||||
|
//相对于根目录的上一级目录
|
||||||
|
$result['moveup_dir_path'] = $moveup_dir_path;
|
||||||
|
//相对于根目录的当前目录
|
||||||
|
$result['current_dir_path'] = $current_dir_path;
|
||||||
|
//当前目录的URL
|
||||||
|
$result['current_url'] = $current_url;
|
||||||
|
//文件数
|
||||||
|
$result['total_count'] = count($file_list);
|
||||||
|
//文件列表数组
|
||||||
|
$result['file_list'] = $file_list;
|
||||||
|
|
||||||
|
//输出JSON字符串
|
||||||
|
header('Content-type: application/json; charset=UTF-8');
|
||||||
|
$json = new Services_JSON();
|
||||||
|
echo $json->encode($result);
|
||||||
|
?>
|
|
@ -0,0 +1,111 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* KindEditor PHP
|
||||||
|
*
|
||||||
|
* 本PHP程序是演示程序,建议不要直接在实际项目中使用。
|
||||||
|
* 如果您确定直接使用本程序,使用之前请仔细确认相关安全设置。
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once 'JSON.php';
|
||||||
|
|
||||||
|
$php_path = dirname(__FILE__) . '/';
|
||||||
|
$php_url = dirname($_SERVER['PHP_SELF']) . '/';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//文件保存目录路径
|
||||||
|
$save_path = $php_path . '../upload/';
|
||||||
|
//文件保存目录URL
|
||||||
|
$save_url = $php_url . '../upload/';
|
||||||
|
//定义允许上传的文件扩展名
|
||||||
|
$ext_arr = array(
|
||||||
|
'image' => array('gif', 'jpg', 'jpeg', 'png', 'bmp'),
|
||||||
|
'flash' => array('swf', 'flv'),
|
||||||
|
'media' => array('swf', 'flv', 'mp3', 'wav', 'wma', 'wmv', 'mid', 'avi', 'mpg', 'asf', 'rm', 'rmvb'),
|
||||||
|
'file' => array('doc', 'docx', 'xls', 'xlsx', 'ppt', 'htm', 'html', 'txt', 'zip', 'rar', 'gz', 'bz2'),
|
||||||
|
);
|
||||||
|
//最大文件大小
|
||||||
|
$max_size = 1000000;
|
||||||
|
|
||||||
|
$save_path = realpath($save_path) . '/';
|
||||||
|
|
||||||
|
//有上传文件时
|
||||||
|
if (empty($_FILES) === false) {
|
||||||
|
//原文件名
|
||||||
|
$file_name = $_FILES['imgFile']['name'];
|
||||||
|
//服务器上临时文件名
|
||||||
|
$tmp_name = $_FILES['imgFile']['tmp_name'];
|
||||||
|
//文件大小
|
||||||
|
$file_size = $_FILES['imgFile']['size'];
|
||||||
|
//检查文件名
|
||||||
|
if (!$file_name) {
|
||||||
|
alert("请选择文件。");
|
||||||
|
}
|
||||||
|
//检查目录
|
||||||
|
if (@is_dir($save_path) === false) {
|
||||||
|
alert("上传目录不存在。");
|
||||||
|
}
|
||||||
|
//检查目录写权限
|
||||||
|
if (@is_writable($save_path) === false) {
|
||||||
|
alert("上传目录没有写权限。");
|
||||||
|
}
|
||||||
|
//检查是否已上传
|
||||||
|
if (@is_uploaded_file($tmp_name) === false) {
|
||||||
|
alert("临时文件可能不是上传文件。");
|
||||||
|
}
|
||||||
|
//检查文件大小
|
||||||
|
if ($file_size > $max_size) {
|
||||||
|
alert("上传文件大小超过限制。");
|
||||||
|
}
|
||||||
|
//检查目录名
|
||||||
|
$dir_name = empty($_GET['dir']) ? 'image' : trim($_GET['dir']);
|
||||||
|
if (empty($ext_arr[$dir_name])) {
|
||||||
|
alert("目录名不正确。");
|
||||||
|
}
|
||||||
|
//获得文件扩展名
|
||||||
|
$temp_arr = explode(".", $file_name);
|
||||||
|
$file_ext = array_pop($temp_arr);
|
||||||
|
$file_ext = trim($file_ext);
|
||||||
|
$file_ext = strtolower($file_ext);
|
||||||
|
//检查扩展名
|
||||||
|
if (in_array($file_ext, $ext_arr[$dir_name]) === false) {
|
||||||
|
alert("上传文件扩展名是不允许的扩展名。\n只允许" . implode(",", $ext_arr[$dir_name]) . "格式。");
|
||||||
|
}
|
||||||
|
//创建文件夹
|
||||||
|
if ($dir_name !== '') {
|
||||||
|
$save_path .= $dir_name . "/";
|
||||||
|
$save_url .= $dir_name . "/";
|
||||||
|
if (!file_exists($save_path)) {
|
||||||
|
mkdir($save_path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$ymd = date("Ymd");
|
||||||
|
$save_path .= $ymd . "/";
|
||||||
|
$save_url .= $ymd . "/";
|
||||||
|
if (!file_exists($save_path)) {
|
||||||
|
mkdir($save_path);
|
||||||
|
}
|
||||||
|
//新文件名
|
||||||
|
$new_file_name = date("YmdHis") . '_' . rand(10000, 99999) . '.' . $file_ext;
|
||||||
|
//移动文件
|
||||||
|
$file_path = $save_path . $new_file_name;
|
||||||
|
if (move_uploaded_file($tmp_name, $file_path) === false) {
|
||||||
|
alert("上传文件失败。");
|
||||||
|
}
|
||||||
|
@chmod($file_path, 0644);
|
||||||
|
$file_url = $save_url . $new_file_name;
|
||||||
|
|
||||||
|
header('Content-type: text/html; charset=UTF-8');
|
||||||
|
$json = new Services_JSON();
|
||||||
|
echo $json->encode(array('error' => 0, 'url' => $file_url));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
function alert($msg) {
|
||||||
|
header('Content-type: text/html; charset=UTF-8');
|
||||||
|
$json = new Services_JSON();
|
||||||
|
echo $json->encode(array('error' => 1, 'message' => $msg));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
?>
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
CUSTOM STYLESHEET
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* paginationControl
|
||||||
|
*/
|
||||||
|
.paginationControl{float:right;padding-left:30px;margin:10px auto;}
|
||||||
|
.paginationControl A {border:#9aafe5 1px solid;padding:2px 5px;color:#2e6ab1;margin-right:2px;TEXT-DECORATION:none}
|
||||||
|
.paginationControl A:hover {border:#2b66a5 1px solid;COLOR: #000;BACKGROUND-COLOR:lightyellow}
|
||||||
|
.paginationControl A:active {border:#2b66a5 1px solid;COLOR: #000;BACKGROUND-COLOR:lightyellow}
|
||||||
|
.paginationControl SPAN.current {border:navy 1px solid;margin-right:2px;padding:2px 5px;FONT-WEIGHT: bold;COLOR: #fff;BACKGROUND-COLOR: #2e6ab1}
|
||||||
|
.paginationControl SPAN.disabled {border:#929292 1px solid;padding:2px 5px;COLOR: #929292; MARGIN-RIGHT: 2px;}
|
After Width: | Height: | Size: 43 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 847 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 989 B |
After Width: | Height: | Size: 616 B |
|
@ -0,0 +1,942 @@
|
||||||
|
/* common */
|
||||||
|
.ke-inline-block {
|
||||||
|
display: -moz-inline-stack;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
zoom: 1;
|
||||||
|
*display: inline;
|
||||||
|
}
|
||||||
|
.ke-clearfix {
|
||||||
|
zoom: 1;
|
||||||
|
}
|
||||||
|
.ke-clearfix:after {
|
||||||
|
content: ".";
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
font-size: 0;
|
||||||
|
height: 0;
|
||||||
|
line-height: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
.ke-menu a,
|
||||||
|
.ke-menu a:hover,
|
||||||
|
.ke-dialog a,
|
||||||
|
.ke-dialog a:hover {
|
||||||
|
color: #337FE5;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
/* icons */
|
||||||
|
.ke-icon-source {
|
||||||
|
background-position: 0px 0px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-preview {
|
||||||
|
background-position: 0px -16px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-print {
|
||||||
|
background-position: 0px -32px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-undo {
|
||||||
|
background-position: 0px -48px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-redo {
|
||||||
|
background-position: 0px -64px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-cut {
|
||||||
|
background-position: 0px -80px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-copy {
|
||||||
|
background-position: 0px -96px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-paste {
|
||||||
|
background-position: 0px -112px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-selectall {
|
||||||
|
background-position: 0px -128px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-justifyleft {
|
||||||
|
background-position: 0px -144px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-justifycenter {
|
||||||
|
background-position: 0px -160px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-justifyright {
|
||||||
|
background-position: 0px -176px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-justifyfull {
|
||||||
|
background-position: 0px -192px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-insertorderedlist {
|
||||||
|
background-position: 0px -208px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-insertunorderedlist {
|
||||||
|
background-position: 0px -224px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-indent {
|
||||||
|
background-position: 0px -240px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-outdent {
|
||||||
|
background-position: 0px -256px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-subscript {
|
||||||
|
background-position: 0px -272px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-superscript {
|
||||||
|
background-position: 0px -288px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-formatblock {
|
||||||
|
background-position: 0px -336px;
|
||||||
|
width: 25px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-fontname {
|
||||||
|
background-position: 0px -352px;
|
||||||
|
width: 21px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-fontsize {
|
||||||
|
background-position: 0px -368px;
|
||||||
|
width: 23px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-forecolor {
|
||||||
|
background-position: 0px -384px;
|
||||||
|
width: 20px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-hilitecolor {
|
||||||
|
background-position: 0px -400px;
|
||||||
|
width: 20px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-bold {
|
||||||
|
background-position: 0px -416px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-italic {
|
||||||
|
background-position: 0px -432px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-underline {
|
||||||
|
background-position: 0px -448px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-strikethrough {
|
||||||
|
background-position: 0px -464px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-removeformat {
|
||||||
|
background-position: 0px -480px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-image {
|
||||||
|
background-position: 0px -496px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-flash {
|
||||||
|
background-position: 0px -512px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-media {
|
||||||
|
background-position: 0px -528px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-hr {
|
||||||
|
background-position: 0px -592px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-emoticons {
|
||||||
|
background-position: 0px -608px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-link {
|
||||||
|
background-position: 0px -624px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-unlink {
|
||||||
|
background-position: 0px -640px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-fullscreen {
|
||||||
|
background-position: 0px -656px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-about {
|
||||||
|
background-position: 0px -672px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-plainpaste {
|
||||||
|
background-position: 0px -704px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-wordpaste {
|
||||||
|
background-position: 0px -720px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-table {
|
||||||
|
background-position: 0px -784px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablemenu {
|
||||||
|
background-position: 0px -768px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tableinsert {
|
||||||
|
background-position: 0px -784px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tabledelete {
|
||||||
|
background-position: 0px -800px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablecolinsertleft {
|
||||||
|
background-position: 0px -816px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablecolinsertright {
|
||||||
|
background-position: 0px -832px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablerowinsertabove {
|
||||||
|
background-position: 0px -848px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablerowinsertbelow {
|
||||||
|
background-position: 0px -864px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablecoldelete {
|
||||||
|
background-position: 0px -880px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablerowdelete {
|
||||||
|
background-position: 0px -896px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablecellprop {
|
||||||
|
background-position: 0px -912px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tableprop {
|
||||||
|
background-position: 0px -928px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-checked {
|
||||||
|
background-position: 0px -944px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-code {
|
||||||
|
background-position: 0px -960px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-map {
|
||||||
|
background-position: 0px -976px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-lineheight {
|
||||||
|
background-position: 0px -992px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-clearhtml {
|
||||||
|
background-position: 0px -1008px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-pagebreak {
|
||||||
|
background-position: 0px -1024px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-insertfile {
|
||||||
|
background-position: 0px -1040px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-quickformat {
|
||||||
|
background-position: 0px -1056px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-template {
|
||||||
|
background-position: 0px -1072px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablecellsplit {
|
||||||
|
background-position: 0px -1088px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablerowmerge {
|
||||||
|
background-position: 0px -1104px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablerowsplit {
|
||||||
|
background-position: 0px -1120px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablecolmerge {
|
||||||
|
background-position: 0px -1136px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
.ke-icon-tablecolsplit {
|
||||||
|
background-position: 0px -1152px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
/* container */
|
||||||
|
.ke-container {
|
||||||
|
display: block;
|
||||||
|
border: 1px solid #CCCCCC;
|
||||||
|
background-color: #FFF;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
/* toolbar */
|
||||||
|
.ke-toolbar {
|
||||||
|
border-bottom: 1px solid #CCC;
|
||||||
|
background-color: #F0F0EE;
|
||||||
|
padding: 2px 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-toolbar-icon {
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-toolbar-icon-url {
|
||||||
|
background-image: url(default.gif);
|
||||||
|
}
|
||||||
|
.ke-toolbar .ke-outline {
|
||||||
|
border: 1px solid #F0F0EE;
|
||||||
|
margin: 1px;
|
||||||
|
padding: 1px 2px;
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.ke-toolbar .ke-on {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
}
|
||||||
|
.ke-toolbar .ke-selected {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
background-color: #E9EFF6;
|
||||||
|
}
|
||||||
|
.ke-toolbar .ke-disabled {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
.ke-toolbar .ke-separator {
|
||||||
|
height: 16px;
|
||||||
|
margin: 2px 3px;
|
||||||
|
border-left: 1px solid #A0A0A0;
|
||||||
|
border-right: 1px solid #FFFFFF;
|
||||||
|
border-top:0;
|
||||||
|
border-bottom:0;
|
||||||
|
width: 0;
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
/* edit */
|
||||||
|
.ke-edit {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.ke-edit-iframe,
|
||||||
|
.ke-edit-textarea {
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.ke-edit-textarea {
|
||||||
|
font: 12px/1.5 "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
|
||||||
|
color: #000;
|
||||||
|
overflow: auto;
|
||||||
|
resize: none;
|
||||||
|
}
|
||||||
|
.ke-edit-textarea:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
/* statusbar */
|
||||||
|
.ke-statusbar {
|
||||||
|
position: relative;
|
||||||
|
background-color: #F0F0EE;
|
||||||
|
border-top: 1px solid #CCCCCC;
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
*height: 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: center;
|
||||||
|
cursor: s-resize;
|
||||||
|
}
|
||||||
|
.ke-statusbar-center-icon {
|
||||||
|
background-position: -0px -754px;
|
||||||
|
width: 15px;
|
||||||
|
height: 11px;
|
||||||
|
background-image: url(default.gif);
|
||||||
|
}
|
||||||
|
.ke-statusbar-right-icon {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
cursor: se-resize;
|
||||||
|
background-position: -5px -741px;
|
||||||
|
width: 11px;
|
||||||
|
height: 11px;
|
||||||
|
background-image: url(default.gif);
|
||||||
|
}
|
||||||
|
/* menu */
|
||||||
|
.ke-menu {
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
background-color: #F1F1F1;
|
||||||
|
color: #222222;
|
||||||
|
padding: 2px;
|
||||||
|
font-family: "sans serif",tahoma,verdana,helvetica;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: left;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-menu-item {
|
||||||
|
border: 1px solid #F1F1F1;
|
||||||
|
background-color: #F1F1F1;
|
||||||
|
color: #222222;
|
||||||
|
height: 24px;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.ke-menu-item-on {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
background-color: #E9EFF6;
|
||||||
|
}
|
||||||
|
.ke-menu-item-left {
|
||||||
|
width: 27px;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-menu-item-center {
|
||||||
|
width: 0;
|
||||||
|
height: 24px;
|
||||||
|
border-left: 1px solid #E3E3E3;
|
||||||
|
border-right: 1px solid #FFFFFF;
|
||||||
|
border-top: 0;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.ke-menu-item-center-on {
|
||||||
|
border-left: 1px solid #E9EFF6;
|
||||||
|
border-right: 1px solid #E9EFF6;
|
||||||
|
}
|
||||||
|
.ke-menu-item-right {
|
||||||
|
border: 0;
|
||||||
|
padding: 0 0 0 5px;
|
||||||
|
line-height: 24px;
|
||||||
|
text-align: left;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-menu-separator {
|
||||||
|
margin: 2px 0;
|
||||||
|
height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border-top: 1px solid #CCCCCC;
|
||||||
|
border-bottom: 1px solid #FFFFFF;
|
||||||
|
border-left: 0;
|
||||||
|
border-right: 0;
|
||||||
|
}
|
||||||
|
/* colorpicker */
|
||||||
|
.ke-colorpicker {
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
background-color: #F1F1F1;
|
||||||
|
color: #222222;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-table {
|
||||||
|
border:0;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
border-collapse: separate;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-cell {
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
border: 1px solid #F0F0EE;
|
||||||
|
cursor: pointer;
|
||||||
|
margin:3px;
|
||||||
|
padding:0;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-cell-top {
|
||||||
|
font-family: "sans serif",tahoma,verdana,helvetica;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 24px;
|
||||||
|
border: 1px solid #F0F0EE;
|
||||||
|
cursor: pointer;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-cell-on {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-cell-selected {
|
||||||
|
border: 1px solid #2446AB;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-cell-color {
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
margin: 3px;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
/* dialog */
|
||||||
|
.ke-dialog {
|
||||||
|
position: absolute;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
color: #333;
|
||||||
|
background-color: #F0F0EE;
|
||||||
|
}
|
||||||
|
.ke-dialog-shadow {
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
border-radius: 0 0 4px 4px;
|
||||||
|
box-shadow: 0 4px 16px #A0A0A0;
|
||||||
|
}
|
||||||
|
.ke-dialog-no-shadow {
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
}
|
||||||
|
.ke-dialog-header {
|
||||||
|
border:0;
|
||||||
|
margin:0;
|
||||||
|
background-color: #F0F0EE;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: left;
|
||||||
|
font: 14px/1 "sans serif",tahoma,verdana,helvetica;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #222222;
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
.ke-dialog-icon-close {
|
||||||
|
display: block;
|
||||||
|
background-position: 0px -688px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
position: absolute;
|
||||||
|
right: 15px;
|
||||||
|
top: 15px;
|
||||||
|
cursor: pointer;
|
||||||
|
background-image: url(default.gif);
|
||||||
|
overflow: hidden;
|
||||||
|
right: 10px;
|
||||||
|
top: 10px;
|
||||||
|
}
|
||||||
|
.ke-dialog-body {
|
||||||
|
font: 12px/1.5 "sans serif",tahoma,verdana,helvetica;
|
||||||
|
text-align: left;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-dialog-body textarea {
|
||||||
|
display: block;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 0;
|
||||||
|
resize: none;
|
||||||
|
}
|
||||||
|
.ke-dialog-body textarea:focus,
|
||||||
|
.ke-dialog-body input:focus,
|
||||||
|
.ke-dialog-body select:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
.ke-dialog-body label {
|
||||||
|
margin-right: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
display: -moz-inline-stack;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
zoom: 1;
|
||||||
|
*display: inline;
|
||||||
|
}
|
||||||
|
.ke-dialog-body img {
|
||||||
|
display: -moz-inline-stack;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
zoom: 1;
|
||||||
|
*display: inline;
|
||||||
|
}
|
||||||
|
.ke-dialog-body select {
|
||||||
|
display: -moz-inline-stack;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
zoom: 1;
|
||||||
|
*display: inline;
|
||||||
|
}
|
||||||
|
.ke-dialog-body .ke-textarea {
|
||||||
|
display: block;
|
||||||
|
width: 408px;
|
||||||
|
height: 260px;
|
||||||
|
font-family: "sans serif",tahoma,verdana,helvetica;
|
||||||
|
font-size: 12px;
|
||||||
|
border-color: #848484 #E0E0E0 #E0E0E0 #848484;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
|
.ke-dialog-body .ke-form {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.ke-dialog-row {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.ke-dialog-footer {
|
||||||
|
font: 12px/1 "sans serif",tahoma,verdana,helvetica;
|
||||||
|
text-align: right;
|
||||||
|
padding:0 0 5px 0;
|
||||||
|
}
|
||||||
|
.ke-dialog-preview,
|
||||||
|
.ke-dialog-yes {
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
.ke-dialog-no {
|
||||||
|
margin: 5px 10px 5px 5px;
|
||||||
|
}
|
||||||
|
.ke-dialog-mask {
|
||||||
|
background-color:#FFF;
|
||||||
|
filter:alpha(opacity=50);
|
||||||
|
opacity:0.5;
|
||||||
|
}
|
||||||
|
.ke-button-common {
|
||||||
|
background: url(bg.gif) no-repeat scroll 0 0 transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
|
overflow: visible;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.ke-button-outer {
|
||||||
|
background-position: 0 0;
|
||||||
|
padding: 0;
|
||||||
|
position: relative;
|
||||||
|
display: -moz-inline-stack;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
zoom: 1;
|
||||||
|
*display: inline;
|
||||||
|
}
|
||||||
|
.ke-button {
|
||||||
|
background-position: right 0;
|
||||||
|
padding: 0 12px;
|
||||||
|
margin: 0;
|
||||||
|
font-family: "sans serif",tahoma,verdana,helvetica;
|
||||||
|
border: 0 none;
|
||||||
|
color: #333;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
|
left: 2px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
/* inputbox */
|
||||||
|
.ke-input-text {
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
font-family: "sans serif",tahoma,verdana,helvetica;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 17px;
|
||||||
|
height: 17px;
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-color: #848484 #E0E0E0 #E0E0E0 #848484;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
display: -moz-inline-stack;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
zoom: 1;
|
||||||
|
*display: inline;
|
||||||
|
}
|
||||||
|
.ke-input-number {
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
.ke-input-color {
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
font-size: 12px;
|
||||||
|
width: 60px;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
padding-left: 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
display: -moz-inline-stack;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
zoom: 1;
|
||||||
|
*display: inline;
|
||||||
|
}
|
||||||
|
.ke-upload-area {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-upload-area .ke-upload-file {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 25px;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
z-index: 811212;
|
||||||
|
border: 0 none;
|
||||||
|
opacity:0;
|
||||||
|
filter:alpha(opacity=0);
|
||||||
|
}
|
||||||
|
/* tabs */
|
||||||
|
.ke-tabs {
|
||||||
|
font: 12px/1 "sans serif",tahoma,verdana,helvetica;
|
||||||
|
border-bottom:1px solid #A0A0A0;
|
||||||
|
padding-left:5px;
|
||||||
|
margin-bottom:10px;
|
||||||
|
}
|
||||||
|
.ke-tabs-ul {
|
||||||
|
list-style-image:none;
|
||||||
|
list-style-position:outside;
|
||||||
|
list-style-type:none;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
}
|
||||||
|
.ke-tabs-li {
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
background-color: #E0E0E0;
|
||||||
|
margin: 0 2px -1px 0;
|
||||||
|
padding: 0 20px;
|
||||||
|
float: left;
|
||||||
|
line-height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
color: #555555;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.ke-tabs-li-selected {
|
||||||
|
background-color: #F0F0EE;
|
||||||
|
border-bottom: 1px solid #F0F0EE;
|
||||||
|
color: #000;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
.ke-tabs-li-on {
|
||||||
|
background-color: #F0F0EE;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
/* emoticons */
|
||||||
|
.ke-plugin-emoticons {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.ke-plugin-emoticons .ke-preview {
|
||||||
|
position: absolute;
|
||||||
|
text-align: center;
|
||||||
|
margin: 2px;
|
||||||
|
padding: 10px;
|
||||||
|
top: 0;
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.ke-plugin-emoticons .ke-preview-img {
|
||||||
|
border:0;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
}
|
||||||
|
.ke-plugin-emoticons .ke-table {
|
||||||
|
border:0;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
border-collapse:separate;
|
||||||
|
}
|
||||||
|
.ke-plugin-emoticons .ke-cell {
|
||||||
|
margin:0;
|
||||||
|
padding:1px;
|
||||||
|
border:1px solid #F0F0EE;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
.ke-plugin-emoticons .ke-on {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
background-color: #E9EFF6;
|
||||||
|
}
|
||||||
|
.ke-plugin-emoticons .ke-img {
|
||||||
|
display:block;
|
||||||
|
background-repeat:no-repeat;
|
||||||
|
overflow:hidden;
|
||||||
|
margin:2px;
|
||||||
|
width:24px;
|
||||||
|
height:24px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
.ke-plugin-emoticons .ke-page {
|
||||||
|
text-align: right;
|
||||||
|
margin: 5px;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
font: 12px/1 "sans serif",tahoma,verdana,helvetica;
|
||||||
|
color: #333;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.ke-plugin-plainpaste-textarea,
|
||||||
|
.ke-plugin-wordpaste-iframe {
|
||||||
|
display: block;
|
||||||
|
width: 408px;
|
||||||
|
height: 260px;
|
||||||
|
font-family: "sans serif",tahoma,verdana,helvetica;
|
||||||
|
font-size: 12px;
|
||||||
|
border-color: #848484 #E0E0E0 #E0E0E0 #848484;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
|
/* filemanager */
|
||||||
|
.ke-plugin-filemanager-header {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-header .ke-left {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-header .ke-right {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body {
|
||||||
|
overflow: scroll;
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
border-color: #848484 #E0E0E0 #E0E0E0 #848484;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
width: 470px;
|
||||||
|
height: 370px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body .ke-item {
|
||||||
|
width: 100px;
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body .ke-photo {
|
||||||
|
border: 1px solid #DDDDDD;
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body .ke-name {
|
||||||
|
width: 100px;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body .ke-on {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
background-color: #E9EFF6;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body .ke-table {
|
||||||
|
width: 95%;
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border-collapse: separate;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body .ke-table .ke-cell {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body .ke-table .ke-name {
|
||||||
|
width: 55%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body .ke-table .ke-size {
|
||||||
|
width: 15%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.ke-plugin-filemanager-body .ke-table .ke-datetime {
|
||||||
|
width: 30%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
/* template */
|
||||||
|
.ke-plugin-template .ke-header {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.ke-plugin-template label {
|
||||||
|
margin-right: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: normal;
|
||||||
|
display: inline;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.ke-plugin-template .ke-left {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.ke-plugin-template .ke-right {
|
||||||
|
float: right;
|
||||||
|
}
|
After Width: | Height: | Size: 9.6 KiB |
|
@ -0,0 +1,148 @@
|
||||||
|
/* container */
|
||||||
|
.ke-container-simple {
|
||||||
|
display: block;
|
||||||
|
border: 1px solid #CCC;
|
||||||
|
background-color: #FFF;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
/* toolbar */
|
||||||
|
.ke-container-simple .ke-toolbar {
|
||||||
|
border-bottom: 1px solid #CCC;
|
||||||
|
background-color: #FFF;
|
||||||
|
padding: 2px 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-container-simple .ke-toolbar .ke-outline {
|
||||||
|
border: 1px solid #FFF;
|
||||||
|
background-color: transparent;
|
||||||
|
margin: 1px;
|
||||||
|
padding: 1px 2px;
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.ke-container-simple .ke-toolbar .ke-on {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
}
|
||||||
|
.ke-container-simple .ke-toolbar .ke-selected {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
background-color: #E9EFF6;
|
||||||
|
}
|
||||||
|
.ke-container-simple .ke-toolbar .ke-disabled {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
/* statusbar */
|
||||||
|
.ke-container-simple .ke-statusbar {
|
||||||
|
position: relative;
|
||||||
|
background-color: #FFF;
|
||||||
|
border-top: 1px solid #CCCCCC;
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
*height: 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: center;
|
||||||
|
cursor: s-resize;
|
||||||
|
}
|
||||||
|
/* menu */
|
||||||
|
.ke-menu-simple {
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
background-color: #FFF;
|
||||||
|
color: #222222;
|
||||||
|
padding: 2px;
|
||||||
|
font-family: "sans serif",tahoma,verdana,helvetica;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: left;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.ke-menu-simple .ke-menu-item {
|
||||||
|
border: 1px solid #FFF;
|
||||||
|
background-color: #FFF;
|
||||||
|
color: #222222;
|
||||||
|
height: 24px;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.ke-menu-simple .ke-menu-item-on {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
background-color: #FFF;
|
||||||
|
}
|
||||||
|
/* colorpicker */
|
||||||
|
.ke-colorpicker-simple {
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
background-color: #FEFEFE;
|
||||||
|
color: #222222;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-simple .ke-colorpicker-cell {
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
border: 1px solid #FEFEFE;
|
||||||
|
cursor: pointer;
|
||||||
|
margin:3px;
|
||||||
|
padding:0;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-simple .ke-colorpicker-cell-top {
|
||||||
|
font-family: "sans serif",tahoma,verdana,helvetica;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 24px;
|
||||||
|
border: 1px solid #FEFEFE;
|
||||||
|
cursor: pointer;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-simple .ke-colorpicker-cell-on {
|
||||||
|
border: 1px solid #5690D2;
|
||||||
|
}
|
||||||
|
.ke-colorpicker-simple .ke-colorpicker-cell-selected {
|
||||||
|
border: 1px solid #2446AB;
|
||||||
|
}
|
||||||
|
/* dialog */
|
||||||
|
.ke-dialog-simple {
|
||||||
|
position: absolute;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
color: #333;
|
||||||
|
background-color: #FFF;
|
||||||
|
}
|
||||||
|
.ke-dialog-simple .ke-dialog-header {
|
||||||
|
border:0;
|
||||||
|
margin:0;
|
||||||
|
background-color: #FFF;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: left;
|
||||||
|
font: 14px/1 "sans serif",tahoma,verdana,helvetica;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #222222;
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
/* tabs */
|
||||||
|
.ke-dialog-simple .ke-tabs {
|
||||||
|
font: 12px/1 "sans serif",tahoma,verdana,helvetica;
|
||||||
|
border-bottom:1px solid #A0A0A0;
|
||||||
|
padding-left:5px;
|
||||||
|
margin-bottom:10px;
|
||||||
|
}
|
||||||
|
.ke-dialog-simple .ke-tabs-li {
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid #A0A0A0;
|
||||||
|
background-color: #F0F0EE;
|
||||||
|
margin: 0 2px -1px 0;
|
||||||
|
padding: 0 20px;
|
||||||
|
float: left;
|
||||||
|
line-height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
color: #555;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.ke-dialog-simple .ke-tabs-li-selected {
|
||||||
|
background-color: #FFF;
|
||||||
|
border-bottom: 1px solid #FFF;
|
||||||
|
color: #000;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
.ke-dialog-simple .ke-tabs-li-on {
|
||||||
|
background-color: #FFF;
|
||||||
|
color: #000;
|
||||||
|
}
|
After Width: | Height: | Size: 373 B |
After Width: | Height: | Size: 313 B |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 781 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 244 B |
After Width: | Height: | Size: 593 B |
After Width: | Height: | Size: 214 B |
After Width: | Height: | Size: 587 B |
After Width: | Height: | Size: 159 B |
After Width: | Height: | Size: 159 B |
After Width: | Height: | Size: 154 B |
After Width: | Height: | Size: 154 B |
After Width: | Height: | Size: 170 B |
After Width: | Height: | Size: 151 B |
After Width: | Height: | Size: 174 B |
After Width: | Height: | Size: 164 B |
After Width: | Height: | Size: 162 B |
After Width: | Height: | Size: 715 B |
After Width: | Height: | Size: 666 B |
After Width: | Height: | Size: 701 B |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 786 B |
After Width: | Height: | Size: 778 B |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 612 B |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 70 B |
After Width: | Height: | Size: 197 B |
After Width: | Height: | Size: 197 B |
After Width: | Height: | Size: 774 B |
After Width: | Height: | Size: 612 B |
After Width: | Height: | Size: 326 B |
After Width: | Height: | Size: 374 B |
After Width: | Height: | Size: 261 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 813 B |
After Width: | Height: | Size: 92 B |
After Width: | Height: | Size: 160 B |
After Width: | Height: | Size: 49 B |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 72 B |
|
@ -0,0 +1,189 @@
|
||||||
|
/*---------------------------------------------------------------------
|
||||||
|
|
||||||
|
Template Name: Administry
|
||||||
|
Version: 1.0
|
||||||
|
Release Date: July 12, 2010
|
||||||
|
|
||||||
|
File: administry.js
|
||||||
|
Updated: 2010-07-12
|
||||||
|
|
||||||
|
Copyright (c) 2010 Zoran Juric - http://themeforest.net/user/zoranjuric
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
WARNING! DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING!
|
||||||
|
|
||||||
|
---------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// Preload images
|
||||||
|
imageObj = new Image();
|
||||||
|
imgs = ["img/toggle.gif", "img/nyro/ajaxLoader.gif", "img/nyro/prev.gif", "img/nyro/next.gif"];
|
||||||
|
for (i = 0; i <= imgs.length; i++) imageObj.src = imgs[i];
|
||||||
|
|
||||||
|
// Administry object setup
|
||||||
|
if (!Administry) var Administry = {}
|
||||||
|
|
||||||
|
// scrollToTop() - scroll window to the top
|
||||||
|
Administry.scrollToTop = function (e) {
|
||||||
|
$(e).hide().removeAttr("href");
|
||||||
|
if ($(window).scrollTop() != "0") {
|
||||||
|
$(e).fadeIn("slow")
|
||||||
|
}
|
||||||
|
var scrollDiv = $(e);
|
||||||
|
$(window).scroll(function () {
|
||||||
|
if ($(window).scrollTop() == "0") {
|
||||||
|
$(scrollDiv).fadeOut("slow")
|
||||||
|
} else {
|
||||||
|
$(scrollDiv).fadeIn("slow")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(e).click(function () {
|
||||||
|
$("html, body").animate({
|
||||||
|
scrollTop: 0
|
||||||
|
}, "slow")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup() - Administry init and setup
|
||||||
|
Administry.setup = function () {
|
||||||
|
// Open an external link in a new window
|
||||||
|
$('a[href^="http://"]').filter(function () {
|
||||||
|
return this.hostname && this.hostname !== location.hostname;
|
||||||
|
}).attr('target', '_blank');
|
||||||
|
|
||||||
|
// build animated dropdown navigation
|
||||||
|
$('#menu ul').supersubs({
|
||||||
|
minWidth: 12, // minimum width of sub-menus in em units
|
||||||
|
maxWidth: 27, // maximum width of sub-menus in em units
|
||||||
|
extraWidth: 1 // extra width can ensure lines don't sometimes turn over
|
||||||
|
// due to slight rounding differences and font-family
|
||||||
|
}).superfish();
|
||||||
|
|
||||||
|
// build an animated footer
|
||||||
|
$('#animated').each(function () {
|
||||||
|
$(this).hover(function () {
|
||||||
|
$(this).stop().animate({
|
||||||
|
opacity: 0.9
|
||||||
|
}, 400);
|
||||||
|
}, function () {
|
||||||
|
$(this).stop().animate({
|
||||||
|
opacity: 0.0
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// scroll to top on request
|
||||||
|
if ($("a#totop").length) Administry.scrollToTop("a#totop");
|
||||||
|
|
||||||
|
// setup content boxes
|
||||||
|
if ($(".content-box").length) {
|
||||||
|
$(".content-box header").css({
|
||||||
|
"cursor": "s-resize"
|
||||||
|
});
|
||||||
|
// Give the header in content-box a different cursor
|
||||||
|
$(".content-box header").click(
|
||||||
|
function () {
|
||||||
|
$(this).parent().find('section').toggle(); // Toggle the content
|
||||||
|
$(this).parent().toggleClass("content-box-closed"); // Toggle the class "content-box-closed" on the content
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup nyro popup window
|
||||||
|
$.nyroModalSettings({
|
||||||
|
debug: false,
|
||||||
|
processHandler: function(settings) {
|
||||||
|
var url = settings.url;
|
||||||
|
if (url && url.indexOf('http://www.youtube.com/watch?v=') == 0) {
|
||||||
|
$.nyroModalSettings({
|
||||||
|
type: 'swf',
|
||||||
|
height: 355,
|
||||||
|
width: 425,
|
||||||
|
url: url.replace(new RegExp("watch\\?v=", "i"), 'v/')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
endShowContent: function(elts, settings) {
|
||||||
|
$('.resizeLink', elts.contentWrapper).click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$.nyroModalSettings({
|
||||||
|
width: Math.random()*1000,
|
||||||
|
height: Math.random()*1000
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$('.bgLink', elts.contentWrapper).click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$.nyroModalSettings({
|
||||||
|
bgColor: '#'+parseInt(255*Math.random()).toString(16)+parseInt(255*Math.random()).toString(16)+parseInt(255*Math.random()).toString(16)
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// custom tooltips to replace the default browser tooltips for <a title=""> <div title=""> and <span title="">
|
||||||
|
$("a[title], div[title], span[title]").tipTip();
|
||||||
|
}
|
||||||
|
|
||||||
|
// progress() - animate a progress bar "el" to the value "val"
|
||||||
|
Administry.progress = function (el, val, max) {
|
||||||
|
var duration = 400;
|
||||||
|
var span = $(el).find("span");
|
||||||
|
var b = $(el).find("b");
|
||||||
|
var w = Math.round((val / max) * 100);
|
||||||
|
$(b).fadeOut('fast');
|
||||||
|
$(span).animate({
|
||||||
|
width: w + '%'
|
||||||
|
}, duration, function () {
|
||||||
|
$(el).attr("value", val);
|
||||||
|
$(b).text(w + '%').fadeIn('fast');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// videoSupport() - <video> tag support for older browsers through flash player embedding
|
||||||
|
Administry.videoSupport = function (wrapper, videoURL, width, height) {
|
||||||
|
var v = document.createElement("video"); // Are we dealing with a browser that supports <video> tag?
|
||||||
|
if (!v.play) { // If no, use Flash.
|
||||||
|
var vobj = $('#' + wrapper).find('video');
|
||||||
|
var poster = $(vobj).attr("poster");
|
||||||
|
var params = {
|
||||||
|
allowfullscreen: "true",
|
||||||
|
allowscriptaccess: "always"
|
||||||
|
};
|
||||||
|
var flashvars = {
|
||||||
|
file: videoURL,
|
||||||
|
image: poster
|
||||||
|
};
|
||||||
|
swfobject.embedSWF("player.swf", wrapper, width, height, "9.0.0", "expressInstall.swf", flashvars, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// expandableRows() - expandable table rows
|
||||||
|
Administry.expandableRows = function () {
|
||||||
|
var titles_total = $('td.title').length;
|
||||||
|
if (titles_total) { /* setting z-index for IE7 */
|
||||||
|
$('td.title').each(function (i, e) {
|
||||||
|
$(e).children('div').css('z-index', String(titles_total - i));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('td.title').find('a').click(function () {
|
||||||
|
// hide previously opened containers
|
||||||
|
$('.opened').hide();
|
||||||
|
// remove highlighted class from rows
|
||||||
|
$('td.highlighted').removeClass('highlighted');
|
||||||
|
|
||||||
|
// locate the row we clicked onto
|
||||||
|
var tr = $(this).parents("tr");
|
||||||
|
var div = $(this).parent().find('.listingDetails');
|
||||||
|
|
||||||
|
if (!$(div).hasClass('opened')) {
|
||||||
|
$(div).addClass('opened').width($(tr).width() - 2).show();
|
||||||
|
$(tr).find('td').addClass('highlighted');
|
||||||
|
} else {
|
||||||
|
$(div).removeClass('opened');
|
||||||
|
$(tr).find('td').removeClass('highlighted');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
(function(A){function B(J){var O={first:{x:-1,y:-1},second:{x:-1,y:-1},show:false,active:false};var L={};function D(Q){if(O.active){J.getPlaceholder().trigger("plotselecting",[F()]);K(Q)}}function M(Q){if(Q.which!=1){return }document.body.focus();if(document.onselectstart!==undefined&&L.onselectstart==null){L.onselectstart=document.onselectstart;document.onselectstart=function(){return false}}if(document.ondrag!==undefined&&L.ondrag==null){L.ondrag=document.ondrag;document.ondrag=function(){return false}}C(O.first,Q);O.active=true;A(document).one("mouseup",I)}function I(Q){if(document.onselectstart!==undefined){document.onselectstart=L.onselectstart}if(document.ondrag!==undefined){document.ondrag=L.ondrag}O.active=false;K(Q);if(E()){H()}else{J.getPlaceholder().trigger("plotunselected",[]);J.getPlaceholder().trigger("plotselecting",[null])}return false}function F(){if(!E()){return null}var R=Math.min(O.first.x,O.second.x),Q=Math.max(O.first.x,O.second.x),T=Math.max(O.first.y,O.second.y),S=Math.min(O.first.y,O.second.y);var U={};var V=J.getAxes();if(V.xaxis.used){U.xaxis={from:V.xaxis.c2p(R),to:V.xaxis.c2p(Q)}}if(V.x2axis.used){U.x2axis={from:V.x2axis.c2p(R),to:V.x2axis.c2p(Q)}}if(V.yaxis.used){U.yaxis={from:V.yaxis.c2p(T),to:V.yaxis.c2p(S)}}if(V.y2axis.used){U.y2axis={from:V.y2axis.c2p(T),to:V.y2axis.c2p(S)}}return U}function H(){var Q=F();J.getPlaceholder().trigger("plotselected",[Q]);var R=J.getAxes();if(R.xaxis.used&&R.yaxis.used){J.getPlaceholder().trigger("selected",[{x1:Q.xaxis.from,y1:Q.yaxis.from,x2:Q.xaxis.to,y2:Q.yaxis.to}])}}function G(R,S,Q){return S<R?R:(S>Q?Q:S)}function C(U,R){var T=J.getOptions();var S=J.getPlaceholder().offset();var Q=J.getPlotOffset();U.x=G(0,R.pageX-S.left-Q.left,J.width());U.y=G(0,R.pageY-S.top-Q.top,J.height());if(T.selection.mode=="y"){U.x=U==O.first?0:J.width()}if(T.selection.mode=="x"){U.y=U==O.first?0:J.height()}}function K(Q){if(Q.pageX==null){return }C(O.second,Q);if(E()){O.show=true;J.triggerRedrawOverlay()}else{P(true)}}function P(Q){if(O.show){O.show=false;J.triggerRedrawOverlay();if(!Q){J.getPlaceholder().trigger("plotunselected",[])}}}function N(R,Q){var T,S,U=J.getAxes();var V=J.getOptions();if(V.selection.mode=="y"){O.first.x=0;O.second.x=J.width()}else{T=R.xaxis?U.xaxis:(R.x2axis?U.x2axis:U.xaxis);S=R.xaxis||R.x2axis||{from:R.x1,to:R.x2};O.first.x=T.p2c(Math.min(S.from,S.to));O.second.x=T.p2c(Math.max(S.from,S.to))}if(V.selection.mode=="x"){O.first.y=0;O.second.y=J.height()}else{T=R.yaxis?U.yaxis:(R.y2axis?U.y2axis:U.yaxis);S=R.yaxis||R.y2axis||{from:R.y1,to:R.y2};O.first.y=T.p2c(Math.min(S.from,S.to));O.second.y=T.p2c(Math.max(S.from,S.to))}O.show=true;J.triggerRedrawOverlay();if(!Q){H()}}function E(){var Q=5;return Math.abs(O.second.x-O.first.x)>=Q&&Math.abs(O.second.y-O.first.y)>=Q}J.clearSelection=P;J.setSelection=N;J.getSelection=F;J.hooks.bindEvents.push(function(R,Q){var S=R.getOptions();if(S.selection.mode!=null){Q.mousemove(D)}if(S.selection.mode!=null){Q.mousedown(M)}});J.hooks.drawOverlay.push(function(T,Y){if(O.show&&E()){var R=T.getPlotOffset();var Q=T.getOptions();Y.save();Y.translate(R.left,R.top);var U=A.color.parse(Q.selection.color);Y.strokeStyle=U.scale("a",0.8).toString();Y.lineWidth=1;Y.lineJoin="round";Y.fillStyle=U.scale("a",0.4).toString();var W=Math.min(O.first.x,O.second.x),V=Math.min(O.first.y,O.second.y),X=Math.abs(O.second.x-O.first.x),S=Math.abs(O.second.y-O.first.y);Y.fillRect(W,V,X,S);Y.strokeRect(W,V,X,S);Y.restore()}})}A.plot.plugins.push({init:B,options:{selection:{mode:null,color:"#e8cfac"}},name:"selection",version:"1.0"})})(jQuery);
|
|
@ -0,0 +1,154 @@
|
||||||
|
/*!
|
||||||
|
* jQuery JavaScript Library v1.4.2
|
||||||
|
* http://jquery.com/
|
||||||
|
*
|
||||||
|
* Copyright 2010, John Resig
|
||||||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* Includes Sizzle.js
|
||||||
|
* http://sizzlejs.com/
|
||||||
|
* Copyright 2010, The Dojo Foundation
|
||||||
|
* Released under the MIT, BSD, and GPL Licenses.
|
||||||
|
*
|
||||||
|
* Date: Sat Feb 13 22:33:48 2010 -0500
|
||||||
|
*/
|
||||||
|
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
|
||||||
|
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
|
||||||
|
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
|
||||||
|
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
|
||||||
|
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
|
||||||
|
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
|
||||||
|
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
|
||||||
|
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
|
||||||
|
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
|
||||||
|
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
|
||||||
|
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
|
||||||
|
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
|
||||||
|
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
|
||||||
|
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
|
||||||
|
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
|
||||||
|
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
|
||||||
|
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
|
||||||
|
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
|
||||||
|
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
|
||||||
|
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
|
||||||
|
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
|
||||||
|
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
|
||||||
|
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
|
||||||
|
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
|
||||||
|
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
|
||||||
|
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
|
||||||
|
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
|
||||||
|
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
|
||||||
|
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
|
||||||
|
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
|
||||||
|
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
|
||||||
|
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
|
||||||
|
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
|
||||||
|
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
|
||||||
|
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
|
||||||
|
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
|
||||||
|
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
|
||||||
|
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
|
||||||
|
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
|
||||||
|
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
|
||||||
|
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
|
||||||
|
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
|
||||||
|
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
|
||||||
|
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
|
||||||
|
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
|
||||||
|
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
|
||||||
|
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
|
||||||
|
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
|
||||||
|
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
|
||||||
|
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
|
||||||
|
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
|
||||||
|
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
|
||||||
|
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
|
||||||
|
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
|
||||||
|
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
|
||||||
|
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
|
||||||
|
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
|
||||||
|
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
|
||||||
|
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
|
||||||
|
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
|
||||||
|
CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
|
||||||
|
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
|
||||||
|
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
|
||||||
|
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
|
||||||
|
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
|
||||||
|
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
|
||||||
|
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
|
||||||
|
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
|
||||||
|
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
|
||||||
|
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
|
||||||
|
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
|
||||||
|
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
|
||||||
|
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
|
||||||
|
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
|
||||||
|
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
|
||||||
|
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
|
||||||
|
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
|
||||||
|
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
|
||||||
|
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
|
||||||
|
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
|
||||||
|
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
|
||||||
|
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
|
||||||
|
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
|
||||||
|
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
|
||||||
|
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
|
||||||
|
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
|
||||||
|
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
|
||||||
|
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
|
||||||
|
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
|
||||||
|
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
|
||||||
|
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
|
||||||
|
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
|
||||||
|
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
|
||||||
|
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
|
||||||
|
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
|
||||||
|
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
|
||||||
|
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
|
||||||
|
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
|
||||||
|
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
|
||||||
|
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
|
||||||
|
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
|
||||||
|
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
|
||||||
|
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
|
||||||
|
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
|
||||||
|
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
|
||||||
|
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
|
||||||
|
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
|
||||||
|
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
|
||||||
|
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
|
||||||
|
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
|
||||||
|
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
|
||||||
|
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
|
||||||
|
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
|
||||||
|
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
|
||||||
|
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
|
||||||
|
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
|
||||||
|
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
|
||||||
|
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
|
||||||
|
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
|
||||||
|
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
|
||||||
|
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
|
||||||
|
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
|
||||||
|
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
|
||||||
|
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
|
||||||
|
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
|
||||||
|
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
|
||||||
|
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
|
||||||
|
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
|
||||||
|
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
|
||||||
|
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
|
||||||
|
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
|
||||||
|
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
|
||||||
|
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
|
||||||
|
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
|
||||||
|
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
|
||||||
|
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
|
||||||
|
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
|
||||||
|
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
|
||||||
|
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
|
|
@ -0,0 +1,587 @@
|
||||||
|
/*
|
||||||
|
* File: jquery.dataTables.min.js
|
||||||
|
* Version: 1.6.2
|
||||||
|
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||||
|
* Info: www.datatables.net
|
||||||
|
*
|
||||||
|
* Copyright 2008-2010 Allan Jardine, all rights reserved.
|
||||||
|
*
|
||||||
|
* This source file is free software, under either the GPL v2 license or a
|
||||||
|
* BSD style license, as supplied with this software.
|
||||||
|
*
|
||||||
|
* This source file is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||||
|
*/
|
||||||
|
(function($){$.fn.dataTableSettings=[];var _aoSettings=$.fn.dataTableSettings;$.fn.dataTableExt={};
|
||||||
|
var _oExt=$.fn.dataTableExt;_oExt.sVersion="1.6.2";_oExt.iApiIndex=0;_oExt.oApi={};
|
||||||
|
_oExt.afnFiltering=[];_oExt.aoFeatures=[];_oExt.ofnSearch={};_oExt.afnSortData=[];
|
||||||
|
_oExt.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:""};
|
||||||
|
_oExt.oJUIClasses={sPagePrevEnabled:"fg-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-state-default",sPageButtonActive:"fg-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last ui-corner-tr ui-corner-br",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset fg-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortColumn:"sorting_",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s"};
|
||||||
|
_oExt.oPagination={two_button:{fnInit:function(oSettings,nPaging,fnCallbackDraw){var nPrevious,nNext,nPreviousInner,nNextInner;
|
||||||
|
if(!oSettings.bJUI){nPrevious=document.createElement("div");nNext=document.createElement("div")
|
||||||
|
}else{nPrevious=document.createElement("a");nNext=document.createElement("a");nNextInner=document.createElement("span");
|
||||||
|
nNextInner.className=oSettings.oClasses.sPageJUINext;nNext.appendChild(nNextInner);
|
||||||
|
nPreviousInner=document.createElement("span");nPreviousInner.className=oSettings.oClasses.sPageJUIPrev;
|
||||||
|
nPrevious.appendChild(nPreviousInner)}nPrevious.className=oSettings.oClasses.sPagePrevDisabled;
|
||||||
|
nNext.className=oSettings.oClasses.sPageNextDisabled;nPrevious.title=oSettings.oLanguage.oPaginate.sPrevious;
|
||||||
|
nNext.title=oSettings.oLanguage.oPaginate.sNext;nPaging.appendChild(nPrevious);nPaging.appendChild(nNext);
|
||||||
|
$(nPrevious).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"previous")){fnCallbackDraw(oSettings)
|
||||||
|
}});$(nNext).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"next")){fnCallbackDraw(oSettings)
|
||||||
|
}});$(nPrevious).bind("selectstart",function(){return false});$(nNext).bind("selectstart",function(){return false
|
||||||
|
});if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.p=="undefined"){nPaging.setAttribute("id",oSettings.sTableId+"_paginate");
|
||||||
|
nPrevious.setAttribute("id",oSettings.sTableId+"_previous");nNext.setAttribute("id",oSettings.sTableId+"_next")
|
||||||
|
}},fnUpdate:function(oSettings,fnCallbackDraw){if(!oSettings.aanFeatures.p){return
|
||||||
|
}var an=oSettings.aanFeatures.p;for(var i=0,iLen=an.length;i<iLen;i++){if(an[i].childNodes.length!==0){an[i].childNodes[0].className=(oSettings._iDisplayStart===0)?oSettings.oClasses.sPagePrevDisabled:oSettings.oClasses.sPagePrevEnabled;
|
||||||
|
an[i].childNodes[1].className=(oSettings.fnDisplayEnd()==oSettings.fnRecordsDisplay())?oSettings.oClasses.sPageNextDisabled:oSettings.oClasses.sPageNextEnabled
|
||||||
|
}}}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(oSettings,nPaging,fnCallbackDraw){var nFirst=document.createElement("span");
|
||||||
|
var nPrevious=document.createElement("span");var nList=document.createElement("span");
|
||||||
|
var nNext=document.createElement("span");var nLast=document.createElement("span");
|
||||||
|
nFirst.innerHTML=oSettings.oLanguage.oPaginate.sFirst;nPrevious.innerHTML=oSettings.oLanguage.oPaginate.sPrevious;
|
||||||
|
nNext.innerHTML=oSettings.oLanguage.oPaginate.sNext;nLast.innerHTML=oSettings.oLanguage.oPaginate.sLast;
|
||||||
|
var oClasses=oSettings.oClasses;nFirst.className=oClasses.sPageButton+" "+oClasses.sPageFirst;
|
||||||
|
nPrevious.className=oClasses.sPageButton+" "+oClasses.sPagePrevious;nNext.className=oClasses.sPageButton+" "+oClasses.sPageNext;
|
||||||
|
nLast.className=oClasses.sPageButton+" "+oClasses.sPageLast;nPaging.appendChild(nFirst);
|
||||||
|
nPaging.appendChild(nPrevious);nPaging.appendChild(nList);nPaging.appendChild(nNext);
|
||||||
|
nPaging.appendChild(nLast);$(nFirst).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"first")){fnCallbackDraw(oSettings)
|
||||||
|
}});$(nPrevious).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"previous")){fnCallbackDraw(oSettings)
|
||||||
|
}});$(nNext).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"next")){fnCallbackDraw(oSettings)
|
||||||
|
}});$(nLast).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"last")){fnCallbackDraw(oSettings)
|
||||||
|
}});$("span",nPaging).bind("mousedown",function(){return false}).bind("selectstart",function(){return false
|
||||||
|
});if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.p=="undefined"){nPaging.setAttribute("id",oSettings.sTableId+"_paginate");
|
||||||
|
nFirst.setAttribute("id",oSettings.sTableId+"_first");nPrevious.setAttribute("id",oSettings.sTableId+"_previous");
|
||||||
|
nNext.setAttribute("id",oSettings.sTableId+"_next");nLast.setAttribute("id",oSettings.sTableId+"_last")
|
||||||
|
}},fnUpdate:function(oSettings,fnCallbackDraw){if(!oSettings.aanFeatures.p){return
|
||||||
|
}var iPageCount=_oExt.oPagination.iFullNumbersShowPages;var iPageCountHalf=Math.floor(iPageCount/2);
|
||||||
|
var iPages=Math.ceil((oSettings.fnRecordsDisplay())/oSettings._iDisplayLength);var iCurrentPage=Math.ceil(oSettings._iDisplayStart/oSettings._iDisplayLength)+1;
|
||||||
|
var sList="";var iStartButton,iEndButton,i,iLen;var oClasses=oSettings.oClasses;if(iPages<iPageCount){iStartButton=1;
|
||||||
|
iEndButton=iPages}else{if(iCurrentPage<=iPageCountHalf){iStartButton=1;iEndButton=iPageCount
|
||||||
|
}else{if(iCurrentPage>=(iPages-iPageCountHalf)){iStartButton=iPages-iPageCount+1;
|
||||||
|
iEndButton=iPages}else{iStartButton=iCurrentPage-Math.ceil(iPageCount/2)+1;iEndButton=iStartButton+iPageCount-1
|
||||||
|
}}}for(i=iStartButton;i<=iEndButton;i++){if(iCurrentPage!=i){sList+='<span class="'+oClasses.sPageButton+'">'+i+"</span>"
|
||||||
|
}else{sList+='<span class="'+oClasses.sPageButtonActive+'">'+i+"</span>"}}var an=oSettings.aanFeatures.p;
|
||||||
|
var anButtons,anStatic,nPaginateList;var fnClick=function(){var iTarget=(this.innerHTML*1)-1;
|
||||||
|
oSettings._iDisplayStart=iTarget*oSettings._iDisplayLength;fnCallbackDraw(oSettings);
|
||||||
|
return false};var fnFalse=function(){return false};for(i=0,iLen=an.length;i<iLen;
|
||||||
|
i++){if(an[i].childNodes.length===0){continue}nPaginateList=an[i].childNodes[2];nPaginateList.innerHTML=sList;
|
||||||
|
$("span",nPaginateList).click(fnClick).bind("mousedown",fnFalse).bind("selectstart",fnFalse);
|
||||||
|
anButtons=an[i].getElementsByTagName("span");anStatic=[anButtons[0],anButtons[1],anButtons[anButtons.length-2],anButtons[anButtons.length-1]];
|
||||||
|
$(anStatic).removeClass(oClasses.sPageButton+" "+oClasses.sPageButtonActive+" "+oClasses.sPageButtonStaticDisabled);
|
||||||
|
if(iCurrentPage==1){anStatic[0].className+=" "+oClasses.sPageButtonStaticDisabled;
|
||||||
|
anStatic[1].className+=" "+oClasses.sPageButtonStaticDisabled}else{anStatic[0].className+=" "+oClasses.sPageButton;
|
||||||
|
anStatic[1].className+=" "+oClasses.sPageButton}if(iPages===0||iCurrentPage==iPages||oSettings._iDisplayLength==-1){anStatic[2].className+=" "+oClasses.sPageButtonStaticDisabled;
|
||||||
|
anStatic[3].className+=" "+oClasses.sPageButtonStaticDisabled}else{anStatic[2].className+=" "+oClasses.sPageButton;
|
||||||
|
anStatic[3].className+=" "+oClasses.sPageButton}}}}};_oExt.oSort={"string-asc":function(a,b){var x=a.toLowerCase();
|
||||||
|
var y=b.toLowerCase();return((x<y)?-1:((x>y)?1:0))},"string-desc":function(a,b){var x=a.toLowerCase();
|
||||||
|
var y=b.toLowerCase();return((x<y)?1:((x>y)?-1:0))},"html-asc":function(a,b){var x=a.replace(/<.*?>/g,"").toLowerCase();
|
||||||
|
var y=b.replace(/<.*?>/g,"").toLowerCase();return((x<y)?-1:((x>y)?1:0))},"html-desc":function(a,b){var x=a.replace(/<.*?>/g,"").toLowerCase();
|
||||||
|
var y=b.replace(/<.*?>/g,"").toLowerCase();return((x<y)?1:((x>y)?-1:0))},"date-asc":function(a,b){var x=Date.parse(a);
|
||||||
|
var y=Date.parse(b);if(isNaN(x)){x=Date.parse("01/01/1970 00:00:00")}if(isNaN(y)){y=Date.parse("01/01/1970 00:00:00")
|
||||||
|
}return x-y},"date-desc":function(a,b){var x=Date.parse(a);var y=Date.parse(b);if(isNaN(x)){x=Date.parse("01/01/1970 00:00:00")
|
||||||
|
}if(isNaN(y)){y=Date.parse("01/01/1970 00:00:00")}return y-x},"numeric-asc":function(a,b){var x=a=="-"?0:a;
|
||||||
|
var y=b=="-"?0:b;return x-y},"numeric-desc":function(a,b){var x=a=="-"?0:a;var y=b=="-"?0:b;
|
||||||
|
return y-x}};_oExt.aTypes=[function(sData){if(typeof sData=="number"){return"numeric"
|
||||||
|
}else{if(typeof sData.charAt!="function"){return null}}var sValidFirstChars="0123456789-";
|
||||||
|
var sValidChars="0123456789.";var Char;var bDecimal=false;Char=sData.charAt(0);if(sValidFirstChars.indexOf(Char)==-1){return null
|
||||||
|
}for(var i=1;i<sData.length;i++){Char=sData.charAt(i);if(sValidChars.indexOf(Char)==-1){return null
|
||||||
|
}if(Char=="."){if(bDecimal){return null}bDecimal=true}}return"numeric"},function(sData){var iParse=Date.parse(sData);
|
||||||
|
if(iParse!==null&&!isNaN(iParse)){return"date"}return null}];_oExt._oExternConfig={iNextUnique:0};
|
||||||
|
$.fn.dataTable=function(oInit){function classSettings(){this.fnRecordsTotal=function(){if(this.oFeatures.bServerSide){return this._iRecordsTotal
|
||||||
|
}else{return this.aiDisplayMaster.length}};this.fnRecordsDisplay=function(){if(this.oFeatures.bServerSide){return this._iRecordsDisplay
|
||||||
|
}else{return this.aiDisplay.length}};this.fnDisplayEnd=function(){if(this.oFeatures.bServerSide){return this._iDisplayStart+this.aiDisplay.length
|
||||||
|
}else{return this._iDisplayEnd}};this.sInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false};
|
||||||
|
this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"}};
|
||||||
|
this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.iNextId=0;
|
||||||
|
this.asDataSearch=[];this.oPreviousSearch={sSearch:"",bEscapeRegex:true};this.aoPreSearchCols=[];
|
||||||
|
this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.fnRowCallback=null;
|
||||||
|
this.fnHeaderCallback=null;this.fnFooterCallback=null;this.aoDrawCallback=[];this.fnInitComplete=null;
|
||||||
|
this.sTableId="";this.nTable=null;this.iDefaultSortIndex=0;this.bInitialised=false;
|
||||||
|
this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType="two_button";this.iCookieDuration=60*60*2;
|
||||||
|
this.sAjaxSource=null;this.bAjaxDataGet=true;this.fnServerData=$.getJSON;this.iServerDraw=0;
|
||||||
|
this._iDisplayLength=10;this._iDisplayStart=0;this._iDisplayEnd=10;this._iRecordsTotal=0;
|
||||||
|
this._iRecordsDisplay=0;this.bJUI=false;this.oClasses=_oExt.oStdClasses;this.bFiltered=false;
|
||||||
|
this.bSorted=false}this.oApi={};this.fnDraw=function(bComplete){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
if(typeof bComplete!="undefined"&&bComplete===false){_fnCalculateEnd(oSettings);_fnDraw(oSettings)
|
||||||
|
}else{_fnReDraw(oSettings)}};this.fnFilter=function(sInput,iColumn,bEscapeRegex){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
if(typeof bEscapeRegex=="undefined"){bEscapeRegex=true}if(typeof iColumn=="undefined"||iColumn===null){_fnFilterComplete(oSettings,{sSearch:sInput,bEscapeRegex:bEscapeRegex},1)
|
||||||
|
}else{oSettings.aoPreSearchCols[iColumn].sSearch=sInput;oSettings.aoPreSearchCols[iColumn].bEscapeRegex=bEscapeRegex;
|
||||||
|
_fnFilterComplete(oSettings,oSettings.oPreviousSearch,1)}};this.fnSettings=function(nNode){return _fnSettingsFromNode(this[_oExt.iApiIndex])
|
||||||
|
};this.fnVersionCheck=function(sVersion){var fnZPad=function(Zpad,count){while(Zpad.length<count){Zpad+="0"
|
||||||
|
}return Zpad};var aThis=_oExt.sVersion.split(".");var aThat=sVersion.split(".");var sThis="",sThat="";
|
||||||
|
for(var i=0,iLen=aThat.length;i<iLen;i++){sThis+=fnZPad(aThis[i],3);sThat+=fnZPad(aThat[i],3)
|
||||||
|
}return parseInt(sThis,10)>=parseInt(sThat,10)};this.fnSort=function(aaSort){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
oSettings.aaSorting=aaSort;_fnSort(oSettings)};this.fnSortListener=function(nNode,iColumn,fnCallback){_fnSortAttachListener(_fnSettingsFromNode(this[_oExt.iApiIndex]),nNode,iColumn,fnCallback)
|
||||||
|
};this.fnAddData=function(mData,bRedraw){if(mData.length===0){return[]}var aiReturn=[];
|
||||||
|
var iTest;var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);if(typeof mData[0]=="object"){for(var i=0;
|
||||||
|
i<mData.length;i++){iTest=_fnAddData(oSettings,mData[i]);if(iTest==-1){return aiReturn
|
||||||
|
}aiReturn.push(iTest)}}else{iTest=_fnAddData(oSettings,mData);if(iTest==-1){return aiReturn
|
||||||
|
}aiReturn.push(iTest)}oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();_fnBuildSearchArray(oSettings,1);
|
||||||
|
if(typeof bRedraw=="undefined"||bRedraw){_fnReDraw(oSettings)}return aiReturn};this.fnDeleteRow=function(mTarget,fnCallBack,bNullRow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
var i,iAODataIndex;iAODataIndex=(typeof mTarget=="object")?_fnNodeToDataIndex(oSettings,mTarget):mTarget;
|
||||||
|
for(i=0;i<oSettings.aiDisplayMaster.length;i++){if(oSettings.aiDisplayMaster[i]==iAODataIndex){oSettings.aiDisplayMaster.splice(i,1);
|
||||||
|
break}}for(i=0;i<oSettings.aiDisplay.length;i++){if(oSettings.aiDisplay[i]==iAODataIndex){oSettings.aiDisplay.splice(i,1);
|
||||||
|
break}}_fnBuildSearchArray(oSettings,1);if(typeof fnCallBack=="function"){fnCallBack.call(this)
|
||||||
|
}if(oSettings._iDisplayStart>=oSettings.aiDisplay.length){oSettings._iDisplayStart-=oSettings._iDisplayLength;
|
||||||
|
if(oSettings._iDisplayStart<0){oSettings._iDisplayStart=0}}_fnCalculateEnd(oSettings);
|
||||||
|
_fnDraw(oSettings);var aData=oSettings.aoData[iAODataIndex]._aData.slice();if(typeof bNullRow!="undefined"&&bNullRow===true){oSettings.aoData[iAODataIndex]=null
|
||||||
|
}return aData};this.fnClearTable=function(bRedraw){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
_fnClearTable(oSettings);if(typeof bRedraw=="undefined"||bRedraw){_fnDraw(oSettings)
|
||||||
|
}};this.fnOpen=function(nTr,sHtml,sClass){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
this.fnClose(nTr);var nNewRow=document.createElement("tr");var nNewCell=document.createElement("td");
|
||||||
|
nNewRow.appendChild(nNewCell);nNewCell.className=sClass;nNewCell.colSpan=_fnVisbleColumns(oSettings);
|
||||||
|
nNewCell.innerHTML=sHtml;var nTrs=$("tbody tr",oSettings.nTable);if($.inArray(nTr,nTrs)!=-1){$(nNewRow).insertAfter(nTr)
|
||||||
|
}if(!oSettings.oFeatures.bServerSide){oSettings.aoOpenRows.push({nTr:nNewRow,nParent:nTr})
|
||||||
|
}return nNewRow};this.fnClose=function(nTr){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
for(var i=0;i<oSettings.aoOpenRows.length;i++){if(oSettings.aoOpenRows[i].nParent==nTr){var nTrParent=oSettings.aoOpenRows[i].nTr.parentNode;
|
||||||
|
if(nTrParent){nTrParent.removeChild(oSettings.aoOpenRows[i].nTr)}oSettings.aoOpenRows.splice(i,1);
|
||||||
|
return 0}}return 1};this.fnGetData=function(mRow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
if(typeof mRow!="undefined"){var iRow=(typeof mRow=="object")?_fnNodeToDataIndex(oSettings,mRow):mRow;
|
||||||
|
return oSettings.aoData[iRow]._aData}return _fnGetDataMaster(oSettings)};this.fnGetNodes=function(iRow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
if(typeof iRow!="undefined"){return oSettings.aoData[iRow].nTr}return _fnGetTrNodes(oSettings)
|
||||||
|
};this.fnGetPosition=function(nNode){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
var i;if(nNode.nodeName=="TR"){return _fnNodeToDataIndex(oSettings,nNode)}else{if(nNode.nodeName=="TD"){var iDataIndex=_fnNodeToDataIndex(oSettings,nNode.parentNode);
|
||||||
|
var iCorrector=0;for(var j=0;j<oSettings.aoColumns.length;j++){if(oSettings.aoColumns[j].bVisible){if(oSettings.aoData[iDataIndex].nTr.getElementsByTagName("td")[j-iCorrector]==nNode){return[iDataIndex,j-iCorrector,j]
|
||||||
|
}}else{iCorrector++}}}}return null};this.fnUpdate=function(mData,mRow,iColumn,bRedraw){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
var iVisibleColumn;var sDisplay;var iRow=(typeof mRow=="object")?_fnNodeToDataIndex(oSettings,mRow):mRow;
|
||||||
|
if(typeof mData!="object"){sDisplay=mData;oSettings.aoData[iRow]._aData[iColumn]=sDisplay;
|
||||||
|
if(oSettings.aoColumns[iColumn].fnRender!==null){sDisplay=oSettings.aoColumns[iColumn].fnRender({iDataRow:iRow,iDataColumn:iColumn,aData:oSettings.aoData[iRow]._aData,oSettings:oSettings});
|
||||||
|
if(oSettings.aoColumns[iColumn].bUseRendered){oSettings.aoData[iRow]._aData[iColumn]=sDisplay
|
||||||
|
}}iVisibleColumn=_fnColumnIndexToVisible(oSettings,iColumn);if(iVisibleColumn!==null){oSettings.aoData[iRow].nTr.getElementsByTagName("td")[iVisibleColumn].innerHTML=sDisplay
|
||||||
|
}}else{if(mData.length!=oSettings.aoColumns.length){alert("DataTables warning: An array passed to fnUpdate must have the same number of columns as the table in question - in this case "+oSettings.aoColumns.length);
|
||||||
|
return 1}for(var i=0;i<mData.length;i++){sDisplay=mData[i];oSettings.aoData[iRow]._aData[i]=sDisplay;
|
||||||
|
if(oSettings.aoColumns[i].fnRender!==null){sDisplay=oSettings.aoColumns[i].fnRender({iDataRow:iRow,iDataColumn:i,aData:oSettings.aoData[iRow]._aData,oSettings:oSettings});
|
||||||
|
if(oSettings.aoColumns[i].bUseRendered){oSettings.aoData[iRow]._aData[i]=sDisplay
|
||||||
|
}}iVisibleColumn=_fnColumnIndexToVisible(oSettings,i);if(iVisibleColumn!==null){oSettings.aoData[iRow].nTr.getElementsByTagName("td")[iVisibleColumn].innerHTML=sDisplay
|
||||||
|
}}}_fnBuildSearchArray(oSettings,1);if(typeof bRedraw!="undefined"&&bRedraw){_fnReDraw(oSettings)
|
||||||
|
}return 0};this.fnSetColumnVis=function(iCol,bShow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
var i,iLen;var iColumns=oSettings.aoColumns.length;var nTd,anTds;if(oSettings.aoColumns[iCol].bVisible==bShow){return
|
||||||
|
}var nTrHead=$("thead:eq(0)>tr",oSettings.nTable)[0];var nTrFoot=$("tfoot:eq(0)>tr",oSettings.nTable)[0];
|
||||||
|
var anTheadTh=[];var anTfootTh=[];for(i=0;i<iColumns;i++){anTheadTh.push(oSettings.aoColumns[i].nTh);
|
||||||
|
anTfootTh.push(oSettings.aoColumns[i].nTf)}if(bShow){var iInsert=0;for(i=0;i<iCol;
|
||||||
|
i++){if(oSettings.aoColumns[i].bVisible){iInsert++}}if(iInsert>=_fnVisbleColumns(oSettings)){nTrHead.appendChild(anTheadTh[iCol]);
|
||||||
|
if(nTrFoot){nTrFoot.appendChild(anTfootTh[iCol])}for(i=0,iLen=oSettings.aoData.length;
|
||||||
|
i<iLen;i++){nTd=oSettings.aoData[i]._anHidden[iCol];oSettings.aoData[i].nTr.appendChild(nTd)
|
||||||
|
}}else{var iBefore;for(i=iCol;i<iColumns;i++){iBefore=_fnColumnIndexToVisible(oSettings,i);
|
||||||
|
if(iBefore!==null){break}}nTrHead.insertBefore(anTheadTh[iCol],nTrHead.getElementsByTagName("th")[iBefore]);
|
||||||
|
if(nTrFoot){nTrFoot.insertBefore(anTfootTh[iCol],nTrFoot.getElementsByTagName("th")[iBefore])
|
||||||
|
}anTds=_fnGetTdNodes(oSettings);for(i=0,iLen=oSettings.aoData.length;i<iLen;i++){nTd=oSettings.aoData[i]._anHidden[iCol];
|
||||||
|
oSettings.aoData[i].nTr.insertBefore(nTd,$(">td:eq("+iBefore+")",oSettings.aoData[i].nTr)[0])
|
||||||
|
}}oSettings.aoColumns[iCol].bVisible=true}else{nTrHead.removeChild(anTheadTh[iCol]);
|
||||||
|
if(nTrFoot){nTrFoot.removeChild(anTfootTh[iCol])}anTds=_fnGetTdNodes(oSettings);for(i=0,iLen=oSettings.aoData.length;
|
||||||
|
i<iLen;i++){nTd=anTds[(i*oSettings.aoColumns.length)+iCol];oSettings.aoData[i]._anHidden[iCol]=nTd;
|
||||||
|
nTd.parentNode.removeChild(nTd)}oSettings.aoColumns[iCol].bVisible=false}for(i=0,iLen=oSettings.aoOpenRows.length;
|
||||||
|
i<iLen;i++){oSettings.aoOpenRows[i].nTr.colSpan=_fnVisbleColumns(oSettings)}_fnSaveState(oSettings)
|
||||||
|
};this.fnPageChange=function(sAction,bRedraw){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
|
||||||
|
_fnPageChange(oSettings,sAction);_fnCalculateEnd(oSettings);if(typeof bRedraw=="undefined"||bRedraw){_fnDraw(oSettings)
|
||||||
|
}};function _fnExternApiFunc(sFunc){return function(){var aArgs=[_fnSettingsFromNode(this[_oExt.iApiIndex])].concat(Array.prototype.slice.call(arguments));
|
||||||
|
return _oExt.oApi[sFunc].apply(this,aArgs)}}for(var sFunc in _oExt.oApi){if(sFunc){this[sFunc]=_fnExternApiFunc(sFunc)
|
||||||
|
}}function _fnInitalise(oSettings){if(oSettings.bInitialised===false){setTimeout(function(){_fnInitalise(oSettings)
|
||||||
|
},200);return}_fnAddOptionsHtml(oSettings);_fnDrawHead(oSettings);if(oSettings.oFeatures.bSort){_fnSort(oSettings,false);
|
||||||
|
_fnSortingClasses(oSettings)}else{oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();
|
||||||
|
_fnCalculateEnd(oSettings);_fnDraw(oSettings)}if(oSettings.sAjaxSource!==null&&!oSettings.oFeatures.bServerSide){_fnProcessingDisplay(oSettings,true);
|
||||||
|
oSettings.fnServerData(oSettings.sAjaxSource,null,function(json){for(var i=0;i<json.aaData.length;
|
||||||
|
i++){_fnAddData(oSettings,json.aaData[i])}oSettings.iInitDisplayStart=oSettings._iDisplayStart;
|
||||||
|
if(oSettings.oFeatures.bSort){_fnSort(oSettings)}else{oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();
|
||||||
|
_fnCalculateEnd(oSettings);_fnDraw(oSettings)}_fnProcessingDisplay(oSettings,false);
|
||||||
|
if(typeof oSettings.fnInitComplete=="function"){oSettings.fnInitComplete(oSettings,json)
|
||||||
|
}});return}if(typeof oSettings.fnInitComplete=="function"){oSettings.fnInitComplete(oSettings)
|
||||||
|
}if(!oSettings.oFeatures.bServerSide){_fnProcessingDisplay(oSettings,false)}}function _fnLanguageProcess(oSettings,oLanguage,bInit){_fnMap(oSettings.oLanguage,oLanguage,"sProcessing");
|
||||||
|
_fnMap(oSettings.oLanguage,oLanguage,"sLengthMenu");_fnMap(oSettings.oLanguage,oLanguage,"sZeroRecords");
|
||||||
|
_fnMap(oSettings.oLanguage,oLanguage,"sInfo");_fnMap(oSettings.oLanguage,oLanguage,"sInfoEmpty");
|
||||||
|
_fnMap(oSettings.oLanguage,oLanguage,"sInfoFiltered");_fnMap(oSettings.oLanguage,oLanguage,"sInfoPostFix");
|
||||||
|
_fnMap(oSettings.oLanguage,oLanguage,"sSearch");if(typeof oLanguage.oPaginate!="undefined"){_fnMap(oSettings.oLanguage.oPaginate,oLanguage.oPaginate,"sFirst");
|
||||||
|
_fnMap(oSettings.oLanguage.oPaginate,oLanguage.oPaginate,"sPrevious");_fnMap(oSettings.oLanguage.oPaginate,oLanguage.oPaginate,"sNext");
|
||||||
|
_fnMap(oSettings.oLanguage.oPaginate,oLanguage.oPaginate,"sLast")}if(bInit){_fnInitalise(oSettings)
|
||||||
|
}}function _fnAddColumn(oSettings,oOptions,nTh){oSettings.aoColumns[oSettings.aoColumns.length++]={sType:null,_bAutoType:true,bVisible:true,bSearchable:true,bSortable:true,asSorting:["asc","desc"],sSortingClass:oSettings.oClasses.sSortable,sSortingClassJUI:oSettings.oClasses.sSortJUI,sTitle:nTh?nTh.innerHTML:"",sName:"",sWidth:null,sClass:null,fnRender:null,bUseRendered:true,iDataSort:oSettings.aoColumns.length-1,sSortDataType:"std",nTh:nTh?nTh:document.createElement("th"),nTf:null};
|
||||||
|
var iLength=oSettings.aoColumns.length-1;var oCol=oSettings.aoColumns[iLength];if(typeof oOptions!="undefined"&&oOptions!==null){if(typeof oOptions.sType!="undefined"){oCol.sType=oOptions.sType;
|
||||||
|
oCol._bAutoType=false}_fnMap(oCol,oOptions,"bVisible");_fnMap(oCol,oOptions,"bSearchable");
|
||||||
|
_fnMap(oCol,oOptions,"bSortable");_fnMap(oCol,oOptions,"sTitle");_fnMap(oCol,oOptions,"sName");
|
||||||
|
_fnMap(oCol,oOptions,"sWidth");_fnMap(oCol,oOptions,"sClass");_fnMap(oCol,oOptions,"fnRender");
|
||||||
|
_fnMap(oCol,oOptions,"bUseRendered");_fnMap(oCol,oOptions,"iDataSort");_fnMap(oCol,oOptions,"asSorting");
|
||||||
|
_fnMap(oCol,oOptions,"sSortDataType")}if(!oSettings.oFeatures.bSort){oCol.bSortable=false
|
||||||
|
}if(!oCol.bSortable||($.inArray("asc",oCol.asSorting)==-1&&$.inArray("desc",oCol.asSorting)==-1)){oCol.sSortingClass=oSettings.oClasses.sSortableNone;
|
||||||
|
oCol.sSortingClassJUI=""}else{if($.inArray("asc",oCol.asSorting)!=-1&&$.inArray("desc",oCol.asSorting)==-1){oCol.sSortingClass=oSettings.oClasses.sSortableAsc;
|
||||||
|
oCol.sSortingClassJUI=oSettings.oClasses.sSortJUIAscAllowed}else{if($.inArray("asc",oCol.asSorting)==-1&&$.inArray("desc",oCol.asSorting)!=-1){oCol.sSortingClass=oSettings.oClasses.sSortableDesc;
|
||||||
|
oCol.sSortingClassJUI=oSettings.oClasses.sSortJUIDescAllowed}}}if(typeof oSettings.aoPreSearchCols[iLength]=="undefined"||oSettings.aoPreSearchCols[iLength]===null){oSettings.aoPreSearchCols[iLength]={sSearch:"",bEscapeRegex:true}
|
||||||
|
}else{if(typeof oSettings.aoPreSearchCols[iLength].bEscapeRegex=="undefined"){oSettings.aoPreSearchCols[iLength].bEscapeRegex=true
|
||||||
|
}}}function _fnAddData(oSettings,aData){if(aData.length!=oSettings.aoColumns.length){alert("DataTables warning: Added data does not match known number of columns");
|
||||||
|
return -1}var iThisIndex=oSettings.aoData.length;oSettings.aoData.push({nTr:document.createElement("tr"),_iId:oSettings.iNextId++,_aData:aData.slice(),_anHidden:[],_sRowStripe:""});
|
||||||
|
var nTd,sThisType;for(var i=0;i<aData.length;i++){nTd=document.createElement("td");
|
||||||
|
if(typeof oSettings.aoColumns[i].fnRender=="function"){var sRendered=oSettings.aoColumns[i].fnRender({iDataRow:iThisIndex,iDataColumn:i,aData:aData,oSettings:oSettings});
|
||||||
|
nTd.innerHTML=sRendered;if(oSettings.aoColumns[i].bUseRendered){oSettings.aoData[iThisIndex]._aData[i]=sRendered
|
||||||
|
}}else{nTd.innerHTML=aData[i]}if(oSettings.aoColumns[i].sClass!==null){nTd.className=oSettings.aoColumns[i].sClass
|
||||||
|
}if(oSettings.aoColumns[i]._bAutoType&&oSettings.aoColumns[i].sType!="string"){sThisType=_fnDetectType(oSettings.aoData[iThisIndex]._aData[i]);
|
||||||
|
if(oSettings.aoColumns[i].sType===null){oSettings.aoColumns[i].sType=sThisType}else{if(oSettings.aoColumns[i].sType!=sThisType){oSettings.aoColumns[i].sType="string"
|
||||||
|
}}}if(oSettings.aoColumns[i].bVisible){oSettings.aoData[iThisIndex].nTr.appendChild(nTd)
|
||||||
|
}else{oSettings.aoData[iThisIndex]._anHidden[i]=nTd}}oSettings.aiDisplayMaster.push(iThisIndex);
|
||||||
|
return iThisIndex}function _fnGatherData(oSettings){var iLoop,i,iLen,j,jLen,jInner,nTds,nTrs,nTd,aLocalData,iThisIndex,iRow,iRows,iColumn,iColumns;
|
||||||
|
if(oSettings.sAjaxSource===null){nTrs=oSettings.nTable.getElementsByTagName("tbody")[0].childNodes;
|
||||||
|
for(i=0,iLen=nTrs.length;i<iLen;i++){if(nTrs[i].nodeName=="TR"){iThisIndex=oSettings.aoData.length;
|
||||||
|
oSettings.aoData.push({nTr:nTrs[i],_iId:oSettings.iNextId++,_aData:[],_anHidden:[],_sRowStripe:""});
|
||||||
|
oSettings.aiDisplayMaster.push(iThisIndex);aLocalData=oSettings.aoData[iThisIndex]._aData;
|
||||||
|
nTds=nTrs[i].childNodes;jInner=0;for(j=0,jLen=nTds.length;j<jLen;j++){if(nTds[j].nodeName=="TD"){aLocalData[jInner]=nTds[j].innerHTML;
|
||||||
|
jInner++}}}}}nTrs=_fnGetTrNodes(oSettings);nTds=[];for(i=0,iLen=nTrs.length;i<iLen;
|
||||||
|
i++){for(j=0,jLen=nTrs[i].childNodes.length;j<jLen;j++){nTd=nTrs[i].childNodes[j];
|
||||||
|
if(nTd.nodeName=="TD"){nTds.push(nTd)}}}if(nTds.length!=nTrs.length*oSettings.aoColumns.length){alert("DataTables warning: Unexpected number of TD elements. Expected "+(nTrs.length*oSettings.aoColumns.length)+" and got "+nTds.length+". DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.")
|
||||||
|
}for(iColumn=0,iColumns=oSettings.aoColumns.length;iColumn<iColumns;iColumn++){if(oSettings.aoColumns[iColumn].sTitle===null){oSettings.aoColumns[iColumn].sTitle=oSettings.aoColumns[iColumn].nTh.innerHTML
|
||||||
|
}var bAutoType=oSettings.aoColumns[iColumn]._bAutoType,bRender=typeof oSettings.aoColumns[iColumn].fnRender=="function",bClass=oSettings.aoColumns[iColumn].sClass!==null,bVisible=oSettings.aoColumns[iColumn].bVisible,nCell,sThisType,sRendered;
|
||||||
|
if(bAutoType||bRender||bClass||!bVisible){for(iRow=0,iRows=oSettings.aoData.length;
|
||||||
|
iRow<iRows;iRow++){nCell=nTds[(iRow*iColumns)+iColumn];if(bAutoType){if(oSettings.aoColumns[iColumn].sType!="string"){sThisType=_fnDetectType(oSettings.aoData[iRow]._aData[iColumn]);
|
||||||
|
if(oSettings.aoColumns[iColumn].sType===null){oSettings.aoColumns[iColumn].sType=sThisType
|
||||||
|
}else{if(oSettings.aoColumns[iColumn].sType!=sThisType){oSettings.aoColumns[iColumn].sType="string"
|
||||||
|
}}}}if(bRender){sRendered=oSettings.aoColumns[iColumn].fnRender({iDataRow:iRow,iDataColumn:iColumn,aData:oSettings.aoData[iRow]._aData,oSettings:oSettings});
|
||||||
|
nCell.innerHTML=sRendered;if(oSettings.aoColumns[iColumn].bUseRendered){oSettings.aoData[iRow]._aData[iColumn]=sRendered
|
||||||
|
}}if(bClass){nCell.className+=" "+oSettings.aoColumns[iColumn].sClass}if(!bVisible){oSettings.aoData[iRow]._anHidden[iColumn]=nCell;
|
||||||
|
nCell.parentNode.removeChild(nCell)}}}}}function _fnDrawHead(oSettings){var i,nTh,iLen;
|
||||||
|
var iThs=oSettings.nTable.getElementsByTagName("thead")[0].getElementsByTagName("th").length;
|
||||||
|
var iCorrector=0;if(iThs!==0){for(i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){nTh=oSettings.aoColumns[i].nTh;
|
||||||
|
if(oSettings.aoColumns[i].bVisible){if(oSettings.aoColumns[i].sWidth!==null){nTh.style.width=oSettings.aoColumns[i].sWidth
|
||||||
|
}if(oSettings.aoColumns[i].sTitle!=nTh.innerHTML){nTh.innerHTML=oSettings.aoColumns[i].sTitle
|
||||||
|
}}else{nTh.parentNode.removeChild(nTh);iCorrector++}}}else{var nTr=document.createElement("tr");
|
||||||
|
for(i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){nTh=oSettings.aoColumns[i].nTh;
|
||||||
|
nTh.innerHTML=oSettings.aoColumns[i].sTitle;if(oSettings.aoColumns[i].bVisible){if(oSettings.aoColumns[i].sClass!==null){nTh.className=oSettings.aoColumns[i].sClass
|
||||||
|
}if(oSettings.aoColumns[i].sWidth!==null){nTh.style.width=oSettings.aoColumns[i].sWidth
|
||||||
|
}nTr.appendChild(nTh)}}$("thead:eq(0)",oSettings.nTable).html("")[0].appendChild(nTr)
|
||||||
|
}if(oSettings.bJUI){for(i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){oSettings.aoColumns[i].nTh.insertBefore(document.createElement("span"),oSettings.aoColumns[i].nTh.firstChild)
|
||||||
|
}}if(oSettings.oFeatures.bSort){for(i=0;i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bSortable!==false){_fnSortAttachListener(oSettings,oSettings.aoColumns[i].nTh,i)
|
||||||
|
}else{$(oSettings.aoColumns[i].nTh).addClass(oSettings.oClasses.sSortableNone)}}$("thead:eq(0) th",oSettings.nTable).mousedown(function(e){if(e.shiftKey){this.onselectstart=function(){return false
|
||||||
|
};return false}})}var nTfoot=oSettings.nTable.getElementsByTagName("tfoot");if(nTfoot.length!==0){iCorrector=0;
|
||||||
|
var nTfs=nTfoot[0].getElementsByTagName("th");for(i=0,iLen=nTfs.length;i<iLen;i++){oSettings.aoColumns[i].nTf=nTfs[i-iCorrector];
|
||||||
|
if(!oSettings.aoColumns[i].bVisible){nTfs[i-iCorrector].parentNode.removeChild(nTfs[i-iCorrector]);
|
||||||
|
iCorrector++}}}}function _fnDraw(oSettings){var i,iLen;var anRows=[];var iRowCount=0;
|
||||||
|
var bRowError=false;var iStrips=oSettings.asStripClasses.length;var iOpenRows=oSettings.aoOpenRows.length;
|
||||||
|
if(oSettings.oFeatures.bServerSide&&!_fnAjaxUpdate(oSettings)){return}if(typeof oSettings.iInitDisplayStart!="undefined"&&oSettings.iInitDisplayStart!=-1){oSettings._iDisplayStart=(oSettings.iInitDisplayStart>=oSettings.fnRecordsDisplay())?0:oSettings.iInitDisplayStart;
|
||||||
|
oSettings.iInitDisplayStart=-1;_fnCalculateEnd(oSettings)}if(oSettings.aiDisplay.length!==0){var iStart=oSettings._iDisplayStart;
|
||||||
|
var iEnd=oSettings._iDisplayEnd;if(oSettings.oFeatures.bServerSide){iStart=0;iEnd=oSettings.aoData.length
|
||||||
|
}for(var j=iStart;j<iEnd;j++){var aoData=oSettings.aoData[oSettings.aiDisplay[j]];
|
||||||
|
var nRow=aoData.nTr;if(iStrips!==0){var sStrip=oSettings.asStripClasses[iRowCount%iStrips];
|
||||||
|
if(aoData._sRowStripe!=sStrip){$(nRow).removeClass(aoData._sRowStripe).addClass(sStrip);
|
||||||
|
aoData._sRowStripe=sStrip}}if(typeof oSettings.fnRowCallback=="function"){nRow=oSettings.fnRowCallback(nRow,oSettings.aoData[oSettings.aiDisplay[j]]._aData,iRowCount,j);
|
||||||
|
if(!nRow&&!bRowError){alert("DataTables warning: A node was not returned by fnRowCallback");
|
||||||
|
bRowError=true}}anRows.push(nRow);iRowCount++;if(iOpenRows!==0){for(var k=0;k<iOpenRows;
|
||||||
|
k++){if(nRow==oSettings.aoOpenRows[k].nParent){anRows.push(oSettings.aoOpenRows[k].nTr)
|
||||||
|
}}}}}else{anRows[0]=document.createElement("tr");if(typeof oSettings.asStripClasses[0]!="undefined"){anRows[0].className=oSettings.asStripClasses[0]
|
||||||
|
}var nTd=document.createElement("td");nTd.setAttribute("valign","top");nTd.colSpan=oSettings.aoColumns.length;
|
||||||
|
nTd.className=oSettings.oClasses.sRowEmpty;nTd.innerHTML=oSettings.oLanguage.sZeroRecords;
|
||||||
|
anRows[iRowCount].appendChild(nTd)}if(typeof oSettings.fnHeaderCallback=="function"){oSettings.fnHeaderCallback($("thead:eq(0)>tr",oSettings.nTable)[0],_fnGetDataMaster(oSettings),oSettings._iDisplayStart,oSettings.fnDisplayEnd(),oSettings.aiDisplay)
|
||||||
|
}if(typeof oSettings.fnFooterCallback=="function"){oSettings.fnFooterCallback($("tfoot:eq(0)>tr",oSettings.nTable)[0],_fnGetDataMaster(oSettings),oSettings._iDisplayStart,oSettings.fnDisplayEnd(),oSettings.aiDisplay)
|
||||||
|
}var nBody=oSettings.nTable.getElementsByTagName("tbody");if(nBody[0]){var nTrs=nBody[0].childNodes;
|
||||||
|
for(i=nTrs.length-1;i>=0;i--){nTrs[i].parentNode.removeChild(nTrs[i])}for(i=0,iLen=anRows.length;
|
||||||
|
i<iLen;i++){nBody[0].appendChild(anRows[i])}}for(i=0,iLen=oSettings.aoDrawCallback.length;
|
||||||
|
i<iLen;i++){oSettings.aoDrawCallback[i].fn(oSettings)}oSettings.bSorted=false;oSettings.bFiltered=false;
|
||||||
|
if(typeof oSettings._bInitComplete=="undefined"){oSettings._bInitComplete=true;if(oSettings.oFeatures.bAutoWidth&&oSettings.nTable.offsetWidth!==0){oSettings.nTable.style.width=oSettings.nTable.offsetWidth+"px"
|
||||||
|
}}}function _fnReDraw(oSettings){if(oSettings.oFeatures.bSort){_fnSort(oSettings,oSettings.oPreviousSearch)
|
||||||
|
}else{if(oSettings.oFeatures.bFilter){_fnFilterComplete(oSettings,oSettings.oPreviousSearch)
|
||||||
|
}else{_fnCalculateEnd(oSettings);_fnDraw(oSettings)}}}function _fnAjaxUpdate(oSettings){if(oSettings.bAjaxDataGet){_fnProcessingDisplay(oSettings,true);
|
||||||
|
var iColumns=oSettings.aoColumns.length;var aoData=[];var i;oSettings.iServerDraw++;
|
||||||
|
aoData.push({name:"sEcho",value:oSettings.iServerDraw});aoData.push({name:"iColumns",value:iColumns});
|
||||||
|
aoData.push({name:"sColumns",value:_fnColumnOrdering(oSettings)});aoData.push({name:"iDisplayStart",value:oSettings._iDisplayStart});
|
||||||
|
aoData.push({name:"iDisplayLength",value:oSettings.oFeatures.bPaginate!==false?oSettings._iDisplayLength:-1});
|
||||||
|
if(oSettings.oFeatures.bFilter!==false){aoData.push({name:"sSearch",value:oSettings.oPreviousSearch.sSearch});
|
||||||
|
aoData.push({name:"bEscapeRegex",value:oSettings.oPreviousSearch.bEscapeRegex});for(i=0;
|
||||||
|
i<iColumns;i++){aoData.push({name:"sSearch_"+i,value:oSettings.aoPreSearchCols[i].sSearch});
|
||||||
|
aoData.push({name:"bEscapeRegex_"+i,value:oSettings.aoPreSearchCols[i].bEscapeRegex});
|
||||||
|
aoData.push({name:"bSearchable_"+i,value:oSettings.aoColumns[i].bSearchable})}}if(oSettings.oFeatures.bSort!==false){var iFixed=oSettings.aaSortingFixed!==null?oSettings.aaSortingFixed.length:0;
|
||||||
|
var iUser=oSettings.aaSorting.length;aoData.push({name:"iSortingCols",value:iFixed+iUser});
|
||||||
|
for(i=0;i<iFixed;i++){aoData.push({name:"iSortCol_"+i,value:oSettings.aaSortingFixed[i][0]});
|
||||||
|
aoData.push({name:"sSortDir_"+i,value:oSettings.aaSortingFixed[i][1]})}for(i=0;i<iUser;
|
||||||
|
i++){aoData.push({name:"iSortCol_"+(i+iFixed),value:oSettings.aaSorting[i][0]});aoData.push({name:"sSortDir_"+(i+iFixed),value:oSettings.aaSorting[i][1]})
|
||||||
|
}for(i=0;i<iColumns;i++){aoData.push({name:"bSortable_"+i,value:oSettings.aoColumns[i].bSortable})
|
||||||
|
}}oSettings.fnServerData(oSettings.sAjaxSource,aoData,function(json){_fnAjaxUpdateDraw(oSettings,json)
|
||||||
|
});return false}else{return true}}function _fnAjaxUpdateDraw(oSettings,json){if(typeof json.sEcho!="undefined"){if(json.sEcho*1<oSettings.iServerDraw){return
|
||||||
|
}else{oSettings.iServerDraw=json.sEcho*1}}_fnClearTable(oSettings);oSettings._iRecordsTotal=json.iTotalRecords;
|
||||||
|
oSettings._iRecordsDisplay=json.iTotalDisplayRecords;var sOrdering=_fnColumnOrdering(oSettings);
|
||||||
|
var bReOrder=(typeof json.sColumns!="undefined"&&sOrdering!==""&&json.sColumns!=sOrdering);
|
||||||
|
if(bReOrder){var aiIndex=_fnReOrderIndex(oSettings,json.sColumns)}for(var i=0,iLen=json.aaData.length;
|
||||||
|
i<iLen;i++){if(bReOrder){var aData=[];for(var j=0,jLen=oSettings.aoColumns.length;
|
||||||
|
j<jLen;j++){aData.push(json.aaData[i][aiIndex[j]])}_fnAddData(oSettings,aData)}else{_fnAddData(oSettings,json.aaData[i])
|
||||||
|
}}oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();oSettings.bAjaxDataGet=false;
|
||||||
|
_fnDraw(oSettings);oSettings.bAjaxDataGet=true;_fnProcessingDisplay(oSettings,false)
|
||||||
|
}function _fnAddOptionsHtml(oSettings){var nHolding=document.createElement("div");
|
||||||
|
oSettings.nTable.parentNode.insertBefore(nHolding,oSettings.nTable);var nWrapper=document.createElement("div");
|
||||||
|
nWrapper.className=oSettings.oClasses.sWrapper;if(oSettings.sTableId!==""){nWrapper.setAttribute("id",oSettings.sTableId+"_wrapper")
|
||||||
|
}var nInsertNode=nWrapper;var sDom=oSettings.sDom.replace("H","fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix");
|
||||||
|
sDom=sDom.replace("F","fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix");
|
||||||
|
var aDom=sDom.split("");var nTmp,iPushFeature,cOption,nNewNode,cNext,sClass,j;for(var i=0;
|
||||||
|
i<aDom.length;i++){iPushFeature=0;cOption=aDom[i];if(cOption=="<"){nNewNode=document.createElement("div");
|
||||||
|
cNext=aDom[i+1];if(cNext=="'"||cNext=='"'){sClass="";j=2;while(aDom[i+j]!=cNext){sClass+=aDom[i+j];
|
||||||
|
j++}nNewNode.className=sClass;i+=j}nInsertNode.appendChild(nNewNode);nInsertNode=nNewNode
|
||||||
|
}else{if(cOption==">"){nInsertNode=nInsertNode.parentNode}else{if(cOption=="l"&&oSettings.oFeatures.bPaginate&&oSettings.oFeatures.bLengthChange){nTmp=_fnFeatureHtmlLength(oSettings);
|
||||||
|
iPushFeature=1}else{if(cOption=="f"&&oSettings.oFeatures.bFilter){nTmp=_fnFeatureHtmlFilter(oSettings);
|
||||||
|
iPushFeature=1}else{if(cOption=="r"&&oSettings.oFeatures.bProcessing){nTmp=_fnFeatureHtmlProcessing(oSettings);
|
||||||
|
iPushFeature=1}else{if(cOption=="t"){nTmp=oSettings.nTable;iPushFeature=1}else{if(cOption=="i"&&oSettings.oFeatures.bInfo){nTmp=_fnFeatureHtmlInfo(oSettings);
|
||||||
|
iPushFeature=1}else{if(cOption=="p"&&oSettings.oFeatures.bPaginate){nTmp=_fnFeatureHtmlPaginate(oSettings);
|
||||||
|
iPushFeature=1}else{if(_oExt.aoFeatures.length!==0){var aoFeatures=_oExt.aoFeatures;
|
||||||
|
for(var k=0,kLen=aoFeatures.length;k<kLen;k++){if(cOption==aoFeatures[k].cFeature){nTmp=aoFeatures[k].fnInit(oSettings);
|
||||||
|
if(nTmp){iPushFeature=1}break}}}}}}}}}}}if(iPushFeature==1){if(typeof oSettings.aanFeatures[cOption]!="object"){oSettings.aanFeatures[cOption]=[]
|
||||||
|
}oSettings.aanFeatures[cOption].push(nTmp);nInsertNode.appendChild(nTmp)}}nHolding.parentNode.replaceChild(nWrapper,nHolding)
|
||||||
|
}function _fnFeatureHtmlFilter(oSettings){var nFilter=document.createElement("div");
|
||||||
|
if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.f=="undefined"){nFilter.setAttribute("id",oSettings.sTableId+"_filter")
|
||||||
|
}nFilter.className=oSettings.oClasses.sFilter;var sSpace=oSettings.oLanguage.sSearch===""?"":" ";
|
||||||
|
nFilter.innerHTML=oSettings.oLanguage.sSearch+sSpace+'<input type="text" />';var jqFilter=$("input",nFilter);
|
||||||
|
jqFilter.val(oSettings.oPreviousSearch.sSearch.replace('"',"""));jqFilter.keyup(function(e){var n=oSettings.aanFeatures.f;
|
||||||
|
for(var i=0,iLen=n.length;i<iLen;i++){if(n[i]!=this.parentNode){$("input",n[i]).val(this.value)
|
||||||
|
}}_fnFilterComplete(oSettings,{sSearch:this.value,bEscapeRegex:oSettings.oPreviousSearch.bEscapeRegex})
|
||||||
|
});jqFilter.keypress(function(e){if(e.keyCode==13){return false}});return nFilter
|
||||||
|
}function _fnFilterComplete(oSettings,oInput,iForce){_fnFilter(oSettings,oInput.sSearch,iForce,oInput.bEscapeRegex);
|
||||||
|
for(var i=0;i<oSettings.aoPreSearchCols.length;i++){_fnFilterColumn(oSettings,oSettings.aoPreSearchCols[i].sSearch,i,oSettings.aoPreSearchCols[i].bEscapeRegex)
|
||||||
|
}if(_oExt.afnFiltering.length!==0){_fnFilterCustom(oSettings)}oSettings.bFiltered=true;
|
||||||
|
oSettings._iDisplayStart=0;_fnCalculateEnd(oSettings);_fnDraw(oSettings);_fnBuildSearchArray(oSettings,0)
|
||||||
|
}function _fnFilterCustom(oSettings){var afnFilters=_oExt.afnFiltering;for(var i=0,iLen=afnFilters.length;
|
||||||
|
i<iLen;i++){var iCorrector=0;for(var j=0,jLen=oSettings.aiDisplay.length;j<jLen;j++){var iDisIndex=oSettings.aiDisplay[j-iCorrector];
|
||||||
|
if(!afnFilters[i](oSettings,oSettings.aoData[iDisIndex]._aData,iDisIndex)){oSettings.aiDisplay.splice(j-iCorrector,1);
|
||||||
|
iCorrector++}}}}function _fnFilterColumn(oSettings,sInput,iColumn,bEscapeRegex){if(sInput===""){return
|
||||||
|
}var iIndexCorrector=0;var sRegexMatch=bEscapeRegex?_fnEscapeRegex(sInput):sInput;
|
||||||
|
var rpSearch=new RegExp(sRegexMatch,"i");for(var i=oSettings.aiDisplay.length-1;i>=0;
|
||||||
|
i--){var sData=_fnDataToSearch(oSettings.aoData[oSettings.aiDisplay[i]]._aData[iColumn],oSettings.aoColumns[iColumn].sType);
|
||||||
|
if(!rpSearch.test(sData)){oSettings.aiDisplay.splice(i,1);iIndexCorrector++}}}function _fnFilter(oSettings,sInput,iForce,bEscapeRegex){var i;
|
||||||
|
if(typeof iForce=="undefined"||iForce===null){iForce=0}if(_oExt.afnFiltering.length!==0){iForce=1
|
||||||
|
}var asSearch=bEscapeRegex?_fnEscapeRegex(sInput).split(" "):sInput.split(" ");var sRegExpString="^(?=.*?"+asSearch.join(")(?=.*?")+").*$";
|
||||||
|
var rpSearch=new RegExp(sRegExpString,"i");if(sInput.length<=0){oSettings.aiDisplay.splice(0,oSettings.aiDisplay.length);
|
||||||
|
oSettings.aiDisplay=oSettings.aiDisplayMaster.slice()}else{if(oSettings.aiDisplay.length==oSettings.aiDisplayMaster.length||oSettings.oPreviousSearch.sSearch.length>sInput.length||iForce==1||sInput.indexOf(oSettings.oPreviousSearch.sSearch)!==0){oSettings.aiDisplay.splice(0,oSettings.aiDisplay.length);
|
||||||
|
_fnBuildSearchArray(oSettings,1);for(i=0;i<oSettings.aiDisplayMaster.length;i++){if(rpSearch.test(oSettings.asDataSearch[i])){oSettings.aiDisplay.push(oSettings.aiDisplayMaster[i])
|
||||||
|
}}}else{var iIndexCorrector=0;for(i=0;i<oSettings.asDataSearch.length;i++){if(!rpSearch.test(oSettings.asDataSearch[i])){oSettings.aiDisplay.splice(i-iIndexCorrector,1);
|
||||||
|
iIndexCorrector++}}}}oSettings.oPreviousSearch.sSearch=sInput;oSettings.oPreviousSearch.bEscapeRegex=bEscapeRegex
|
||||||
|
}function _fnBuildSearchArray(oSettings,iMaster){oSettings.asDataSearch.splice(0,oSettings.asDataSearch.length);
|
||||||
|
var aArray=(typeof iMaster!="undefined"&&iMaster==1)?oSettings.aiDisplayMaster:oSettings.aiDisplay;
|
||||||
|
for(var i=0,iLen=aArray.length;i<iLen;i++){oSettings.asDataSearch[i]="";for(var j=0,jLen=oSettings.aoColumns.length;
|
||||||
|
j<jLen;j++){if(oSettings.aoColumns[j].bSearchable){var sData=oSettings.aoData[aArray[i]]._aData[j];
|
||||||
|
oSettings.asDataSearch[i]+=_fnDataToSearch(sData,oSettings.aoColumns[j].sType)+" "
|
||||||
|
}}}}function _fnDataToSearch(sData,sType){if(typeof _oExt.ofnSearch[sType]=="function"){return _oExt.ofnSearch[sType](sData)
|
||||||
|
}else{if(sType=="html"){return sData.replace(/\n/g," ").replace(/<.*?>/g,"")}else{if(typeof sData=="string"){return sData.replace(/\n/g," ")
|
||||||
|
}}}return sData}function _fnSort(oSettings,bApplyClasses){var aaSort=[];var oSort=_oExt.oSort;
|
||||||
|
var aoData=oSettings.aoData;var iDataSort;var iDataType;var i,j,jLen;if(!oSettings.oFeatures.bServerSide&&(oSettings.aaSorting.length!==0||oSettings.aaSortingFixed!==null)){if(oSettings.aaSortingFixed!==null){aaSort=oSettings.aaSortingFixed.concat(oSettings.aaSorting)
|
||||||
|
}else{aaSort=oSettings.aaSorting.slice()}for(i=0;i<aaSort.length;i++){var iColumn=aaSort[i][0];
|
||||||
|
var sDataType=oSettings.aoColumns[iColumn].sSortDataType;if(typeof _oExt.afnSortData[sDataType]!="undefined"){var iCorrector=0;
|
||||||
|
var aData=_oExt.afnSortData[sDataType](oSettings,iColumn);for(j=0,jLen=aoData.length;
|
||||||
|
j<jLen;j++){if(aoData[j]!==null){aoData[j]._aData[iColumn]=aData[iCorrector];iCorrector++
|
||||||
|
}}}}if(!window.runtime){var fnLocalSorting;var sDynamicSort="fnLocalSorting = function(a,b){var iTest;";
|
||||||
|
for(i=0;i<aaSort.length-1;i++){iDataSort=oSettings.aoColumns[aaSort[i][0]].iDataSort;
|
||||||
|
iDataType=oSettings.aoColumns[iDataSort].sType;sDynamicSort+="iTest = oSort['"+iDataType+"-"+aaSort[i][1]+"']( aoData[a]._aData["+iDataSort+"], aoData[b]._aData["+iDataSort+"] ); if ( iTest === 0 )"
|
||||||
|
}iDataSort=oSettings.aoColumns[aaSort[aaSort.length-1][0]].iDataSort;iDataType=oSettings.aoColumns[iDataSort].sType;
|
||||||
|
sDynamicSort+="iTest = oSort['"+iDataType+"-"+aaSort[aaSort.length-1][1]+"']( aoData[a]._aData["+iDataSort+"], aoData[b]._aData["+iDataSort+"] );if (iTest===0) return oSort['numeric-"+aaSort[aaSort.length-1][1]+"'](a, b); return iTest;}";
|
||||||
|
eval(sDynamicSort);oSettings.aiDisplayMaster.sort(fnLocalSorting)}else{var aAirSort=[];
|
||||||
|
var iLen=aaSort.length;for(i=0;i<iLen;i++){iDataSort=oSettings.aoColumns[aaSort[i][0]].iDataSort;
|
||||||
|
aAirSort.push([iDataSort,oSettings.aoColumns[iDataSort].sType+"-"+aaSort[i][1]])}oSettings.aiDisplayMaster.sort(function(a,b){var iTest;
|
||||||
|
for(var i=0;i<iLen;i++){iTest=oSort[aAirSort[i][1]](aoData[a]._aData[aAirSort[i][0]],aoData[b]._aData[aAirSort[i][0]]);
|
||||||
|
if(iTest!==0){return iTest}}return 0})}}if(typeof bApplyClasses=="undefined"||bApplyClasses){_fnSortingClasses(oSettings)
|
||||||
|
}oSettings.bSorted=true;if(oSettings.oFeatures.bFilter){_fnFilterComplete(oSettings,oSettings.oPreviousSearch,1)
|
||||||
|
}else{oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();oSettings._iDisplayStart=0;
|
||||||
|
_fnCalculateEnd(oSettings);_fnDraw(oSettings)}}function _fnSortAttachListener(oSettings,nNode,iDataIndex,fnCallback){$(nNode).click(function(e){if(oSettings.aoColumns[iDataIndex].bSortable===false){return
|
||||||
|
}var fnInnerSorting=function(){var iColumn,iNextSort;if(e.shiftKey){var bFound=false;
|
||||||
|
for(var i=0;i<oSettings.aaSorting.length;i++){if(oSettings.aaSorting[i][0]==iDataIndex){bFound=true;
|
||||||
|
iColumn=oSettings.aaSorting[i][0];iNextSort=oSettings.aaSorting[i][2]+1;if(typeof oSettings.aoColumns[iColumn].asSorting[iNextSort]=="undefined"){oSettings.aaSorting.splice(i,1)
|
||||||
|
}else{oSettings.aaSorting[i][1]=oSettings.aoColumns[iColumn].asSorting[iNextSort];
|
||||||
|
oSettings.aaSorting[i][2]=iNextSort}break}}if(bFound===false){oSettings.aaSorting.push([iDataIndex,oSettings.aoColumns[iDataIndex].asSorting[0],0])
|
||||||
|
}}else{if(oSettings.aaSorting.length==1&&oSettings.aaSorting[0][0]==iDataIndex){iColumn=oSettings.aaSorting[0][0];
|
||||||
|
iNextSort=oSettings.aaSorting[0][2]+1;if(typeof oSettings.aoColumns[iColumn].asSorting[iNextSort]=="undefined"){iNextSort=0
|
||||||
|
}oSettings.aaSorting[0][1]=oSettings.aoColumns[iColumn].asSorting[iNextSort];oSettings.aaSorting[0][2]=iNextSort
|
||||||
|
}else{oSettings.aaSorting.splice(0,oSettings.aaSorting.length);oSettings.aaSorting.push([iDataIndex,oSettings.aoColumns[iDataIndex].asSorting[0],0])
|
||||||
|
}}_fnSort(oSettings)};if(!oSettings.oFeatures.bProcessing){fnInnerSorting()}else{_fnProcessingDisplay(oSettings,true);
|
||||||
|
setTimeout(function(){fnInnerSorting();if(!oSettings.oFeatures.bServerSide){_fnProcessingDisplay(oSettings,false)
|
||||||
|
}},0)}if(typeof fnCallback=="function"){fnCallback(oSettings)}})}function _fnSortingClasses(oSettings){var i,iLen,j,jLen,iFound;
|
||||||
|
var aaSort,sClass;var iColumns=oSettings.aoColumns.length;var oClasses=oSettings.oClasses;
|
||||||
|
for(i=0;i<iColumns;i++){if(oSettings.aoColumns[i].bSortable){$(oSettings.aoColumns[i].nTh).removeClass(oClasses.sSortAsc+" "+oClasses.sSortDesc+" "+oSettings.aoColumns[i].sSortingClass)
|
||||||
|
}}if(oSettings.aaSortingFixed!==null){aaSort=oSettings.aaSortingFixed.concat(oSettings.aaSorting)
|
||||||
|
}else{aaSort=oSettings.aaSorting.slice()}for(i=0;i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bSortable){sClass=oSettings.aoColumns[i].sSortingClass;
|
||||||
|
iFound=-1;for(j=0;j<aaSort.length;j++){if(aaSort[j][0]==i){sClass=(aaSort[j][1]=="asc")?oClasses.sSortAsc:oClasses.sSortDesc;
|
||||||
|
iFound=j;break}}$(oSettings.aoColumns[i].nTh).addClass(sClass);if(oSettings.bJUI){var jqSpan=$("span",oSettings.aoColumns[i].nTh);
|
||||||
|
jqSpan.removeClass(oClasses.sSortJUIAsc+" "+oClasses.sSortJUIDesc+" "+oClasses.sSortJUI+" "+oClasses.sSortJUIAscAllowed+" "+oClasses.sSortJUIDescAllowed);
|
||||||
|
var sSpanClass;if(iFound==-1){sSpanClass=oSettings.aoColumns[i].sSortingClassJUI}else{if(aaSort[iFound][1]=="asc"){sSpanClass=oClasses.sSortJUIAsc
|
||||||
|
}else{sSpanClass=oClasses.sSortJUIDesc}}jqSpan.addClass(sSpanClass)}}else{$(oSettings.aoColumns[i].nTh).addClass(oSettings.aoColumns[i].sSortingClass)
|
||||||
|
}}sClass=oClasses.sSortColumn;if(oSettings.oFeatures.bSort&&oSettings.oFeatures.bSortClasses){var nTds=_fnGetTdNodes(oSettings);
|
||||||
|
if(nTds.length>=iColumns){for(i=0;i<iColumns;i++){if(nTds[i].className.indexOf(sClass+"1")!=-1){for(j=0,jLen=(nTds.length/iColumns);
|
||||||
|
j<jLen;j++){nTds[(iColumns*j)+i].className=nTds[(iColumns*j)+i].className.replace(" "+sClass+"1","")
|
||||||
|
}}else{if(nTds[i].className.indexOf(sClass+"2")!=-1){for(j=0,jLen=(nTds.length/iColumns);
|
||||||
|
j<jLen;j++){nTds[(iColumns*j)+i].className=nTds[(iColumns*j)+i].className.replace(" "+sClass+"2","")
|
||||||
|
}}else{if(nTds[i].className.indexOf(sClass+"3")!=-1){for(j=0,jLen=(nTds.length/iColumns);
|
||||||
|
j<jLen;j++){nTds[(iColumns*j)+i].className=nTds[(iColumns*j)+i].className.replace(" "+sClass+"3","")
|
||||||
|
}}}}}}var iClass=1,iTargetCol;for(i=0;i<aaSort.length;i++){iTargetCol=parseInt(aaSort[i][0],10);
|
||||||
|
for(j=0,jLen=(nTds.length/iColumns);j<jLen;j++){nTds[(iColumns*j)+iTargetCol].className+=" "+sClass+iClass
|
||||||
|
}if(iClass<3){iClass++}}}}function _fnFeatureHtmlPaginate(oSettings){var nPaginate=document.createElement("div");
|
||||||
|
nPaginate.className=oSettings.oClasses.sPaging+oSettings.sPaginationType;_oExt.oPagination[oSettings.sPaginationType].fnInit(oSettings,nPaginate,function(oSettings){_fnCalculateEnd(oSettings);
|
||||||
|
_fnDraw(oSettings)});if(typeof oSettings.aanFeatures.p=="undefined"){oSettings.aoDrawCallback.push({fn:function(oSettings){_oExt.oPagination[oSettings.sPaginationType].fnUpdate(oSettings,function(oSettings){_fnCalculateEnd(oSettings);
|
||||||
|
_fnDraw(oSettings)})},sName:"pagination"})}return nPaginate}function _fnPageChange(oSettings,sAction){var iOldStart=oSettings._iDisplayStart;
|
||||||
|
if(sAction=="first"){oSettings._iDisplayStart=0}else{if(sAction=="previous"){oSettings._iDisplayStart=oSettings._iDisplayLength>=0?oSettings._iDisplayStart-oSettings._iDisplayLength:0;
|
||||||
|
if(oSettings._iDisplayStart<0){oSettings._iDisplayStart=0}}else{if(sAction=="next"){if(oSettings._iDisplayLength>=0){if(oSettings._iDisplayStart+oSettings._iDisplayLength<oSettings.fnRecordsDisplay()){oSettings._iDisplayStart+=oSettings._iDisplayLength
|
||||||
|
}}else{oSettings._iDisplayStart=0}}else{if(sAction=="last"){if(oSettings._iDisplayLength>=0){var iPages=parseInt((oSettings.fnRecordsDisplay()-1)/oSettings._iDisplayLength,10)+1;
|
||||||
|
oSettings._iDisplayStart=(iPages-1)*oSettings._iDisplayLength}else{oSettings._iDisplayStart=0
|
||||||
|
}}else{alert("DataTables warning: unknown paging action: "+sAction)}}}}return iOldStart!=oSettings._iDisplayStart
|
||||||
|
}function _fnFeatureHtmlInfo(oSettings){var nInfo=document.createElement("div");nInfo.className=oSettings.oClasses.sInfo;
|
||||||
|
if(typeof oSettings.aanFeatures.i=="undefined"){oSettings.aoDrawCallback.push({fn:_fnUpdateInfo,sName:"information"});
|
||||||
|
if(oSettings.sTableId!==""){nInfo.setAttribute("id",oSettings.sTableId+"_info")}}return nInfo
|
||||||
|
}function _fnUpdateInfo(oSettings){if(!oSettings.oFeatures.bInfo||oSettings.aanFeatures.i.length===0){return
|
||||||
|
}var nFirst=oSettings.aanFeatures.i[0];if(oSettings.fnRecordsDisplay()===0&&oSettings.fnRecordsDisplay()==oSettings.fnRecordsTotal()){nFirst.innerHTML=oSettings.oLanguage.sInfoEmpty+oSettings.oLanguage.sInfoPostFix
|
||||||
|
}else{if(oSettings.fnRecordsDisplay()===0){nFirst.innerHTML=oSettings.oLanguage.sInfoEmpty+" "+oSettings.oLanguage.sInfoFiltered.replace("_MAX_",oSettings.fnRecordsTotal())+oSettings.oLanguage.sInfoPostFix
|
||||||
|
}else{if(oSettings.fnRecordsDisplay()==oSettings.fnRecordsTotal()){nFirst.innerHTML=oSettings.oLanguage.sInfo.replace("_START_",oSettings._iDisplayStart+1).replace("_END_",oSettings.fnDisplayEnd()).replace("_TOTAL_",oSettings.fnRecordsDisplay())+oSettings.oLanguage.sInfoPostFix
|
||||||
|
}else{nFirst.innerHTML=oSettings.oLanguage.sInfo.replace("_START_",oSettings._iDisplayStart+1).replace("_END_",oSettings.fnDisplayEnd()).replace("_TOTAL_",oSettings.fnRecordsDisplay())+" "+oSettings.oLanguage.sInfoFiltered.replace("_MAX_",oSettings.fnRecordsTotal())+oSettings.oLanguage.sInfoPostFix
|
||||||
|
}}}var n=oSettings.aanFeatures.i;if(n.length>1){var sInfo=nFirst.innerHTML;for(var i=1,iLen=n.length;
|
||||||
|
i<iLen;i++){n[i].innerHTML=sInfo}}}function _fnFeatureHtmlLength(oSettings){var sName=(oSettings.sTableId==="")?"":'name="'+oSettings.sTableId+'_length"';
|
||||||
|
var sStdMenu='<select size="1" '+sName+'><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select>';
|
||||||
|
var nLength=document.createElement("div");if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.l=="undefined"){nLength.setAttribute("id",oSettings.sTableId+"_length")
|
||||||
|
}nLength.className=oSettings.oClasses.sLength;nLength.innerHTML=oSettings.oLanguage.sLengthMenu.replace("_MENU_",sStdMenu);
|
||||||
|
$('select option[value="'+oSettings._iDisplayLength+'"]',nLength).attr("selected",true);
|
||||||
|
$("select",nLength).change(function(e){var iVal=$(this).val();var n=oSettings.aanFeatures.l;
|
||||||
|
for(var i=0,iLen=n.length;i<iLen;i++){if(n[i]!=this.parentNode){$("select",n[i]).val(iVal)
|
||||||
|
}}oSettings._iDisplayLength=parseInt(iVal,10);_fnCalculateEnd(oSettings);if(oSettings._iDisplayEnd==oSettings.aiDisplay.length){oSettings._iDisplayStart=oSettings._iDisplayEnd-oSettings._iDisplayLength;
|
||||||
|
if(oSettings._iDisplayStart<0){oSettings._iDisplayStart=0}}if(oSettings._iDisplayLength==-1){oSettings._iDisplayStart=0
|
||||||
|
}_fnDraw(oSettings)});return nLength}function _fnFeatureHtmlProcessing(oSettings){var nProcessing=document.createElement("div");
|
||||||
|
if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.r=="undefined"){nProcessing.setAttribute("id",oSettings.sTableId+"_processing")
|
||||||
|
}nProcessing.innerHTML=oSettings.oLanguage.sProcessing;nProcessing.className=oSettings.oClasses.sProcessing;
|
||||||
|
oSettings.nTable.parentNode.insertBefore(nProcessing,oSettings.nTable);return nProcessing
|
||||||
|
}function _fnProcessingDisplay(oSettings,bShow){if(oSettings.oFeatures.bProcessing){var an=oSettings.aanFeatures.r;
|
||||||
|
for(var i=0,iLen=an.length;i<iLen;i++){an[i].style.visibility=bShow?"visible":"hidden"
|
||||||
|
}}}function _fnVisibleToColumnIndex(oSettings,iMatch){var iColumn=-1;for(var i=0;
|
||||||
|
i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bVisible===true){iColumn++
|
||||||
|
}if(iColumn==iMatch){return i}}return null}function _fnColumnIndexToVisible(oSettings,iMatch){var iVisible=-1;
|
||||||
|
for(var i=0;i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bVisible===true){iVisible++
|
||||||
|
}if(i==iMatch){return oSettings.aoColumns[i].bVisible===true?iVisible:null}}return null
|
||||||
|
}function _fnNodeToDataIndex(s,n){for(var i=0,iLen=s.aoData.length;i<iLen;i++){if(s.aoData[i]!==null&&s.aoData[i].nTr==n){return i
|
||||||
|
}}return null}function _fnVisbleColumns(oS){var iVis=0;for(var i=0;i<oS.aoColumns.length;
|
||||||
|
i++){if(oS.aoColumns[i].bVisible===true){iVis++}}return iVis}function _fnCalculateEnd(oSettings){if(oSettings.oFeatures.bPaginate===false){oSettings._iDisplayEnd=oSettings.aiDisplay.length
|
||||||
|
}else{if(oSettings._iDisplayStart+oSettings._iDisplayLength>oSettings.aiDisplay.length||oSettings._iDisplayLength==-1){oSettings._iDisplayEnd=oSettings.aiDisplay.length
|
||||||
|
}else{oSettings._iDisplayEnd=oSettings._iDisplayStart+oSettings._iDisplayLength}}}function _fnConvertToWidth(sWidth,nParent){if(!sWidth||sWidth===null||sWidth===""){return 0
|
||||||
|
}if(typeof nParent=="undefined"){nParent=document.getElementsByTagName("body")[0]
|
||||||
|
}var iWidth;var nTmp=document.createElement("div");nTmp.style.width=sWidth;nParent.appendChild(nTmp);
|
||||||
|
iWidth=nTmp.offsetWidth;nParent.removeChild(nTmp);return(iWidth)}function _fnCalculateColumnWidths(oSettings){var iTableWidth=oSettings.nTable.offsetWidth;
|
||||||
|
var iTotalUserIpSize=0;var iTmpWidth;var iVisibleColumns=0;var iColums=oSettings.aoColumns.length;
|
||||||
|
var i;var oHeaders=$("thead:eq(0)>th",oSettings.nTable);for(i=0;i<iColums;i++){if(oSettings.aoColumns[i].bVisible){iVisibleColumns++;
|
||||||
|
if(oSettings.aoColumns[i].sWidth!==null){iTmpWidth=_fnConvertToWidth(oSettings.aoColumns[i].sWidth,oSettings.nTable.parentNode);
|
||||||
|
iTotalUserIpSize+=iTmpWidth;oSettings.aoColumns[i].sWidth=iTmpWidth+"px"}}}if(iColums==oHeaders.length&&iTotalUserIpSize===0&&iVisibleColumns==iColums){for(i=0;
|
||||||
|
i<oSettings.aoColumns.length;i++){oSettings.aoColumns[i].sWidth=oHeaders[i].offsetWidth+"px"
|
||||||
|
}}else{var nCalcTmp=oSettings.nTable.cloneNode(false);nCalcTmp.setAttribute("id","");
|
||||||
|
var sTableTmp='<table class="'+nCalcTmp.className+'">';var sCalcHead="<tr>";var sCalcHtml="<tr>";
|
||||||
|
for(i=0;i<iColums;i++){if(oSettings.aoColumns[i].bVisible){sCalcHead+="<th>"+oSettings.aoColumns[i].sTitle+"</th>";
|
||||||
|
if(oSettings.aoColumns[i].sWidth!==null){var sWidth="";if(oSettings.aoColumns[i].sWidth!==null){sWidth=' style="width:'+oSettings.aoColumns[i].sWidth+';"'
|
||||||
|
}sCalcHtml+="<td"+sWidth+' tag_index="'+i+'">'+fnGetMaxLenString(oSettings,i)+"</td>"
|
||||||
|
}else{sCalcHtml+='<td tag_index="'+i+'">'+fnGetMaxLenString(oSettings,i)+"</td>"}}}sCalcHead+="</tr>";
|
||||||
|
sCalcHtml+="</tr>";nCalcTmp=$(sTableTmp+sCalcHead+sCalcHtml+"</table>")[0];nCalcTmp.style.width=iTableWidth+"px";
|
||||||
|
nCalcTmp.style.visibility="hidden";nCalcTmp.style.position="absolute";oSettings.nTable.parentNode.appendChild(nCalcTmp);
|
||||||
|
var oNodes=$("tr:eq(1)>td",nCalcTmp);var iIndex;for(i=0;i<oNodes.length;i++){iIndex=oNodes[i].getAttribute("tag_index");
|
||||||
|
var iContentWidth=$("td",nCalcTmp).eq(i).width();var iSetWidth=oSettings.aoColumns[i].sWidth?oSettings.aoColumns[i].sWidth.slice(0,-2):0;
|
||||||
|
oSettings.aoColumns[iIndex].sWidth=Math.max(iContentWidth,iSetWidth)+"px"}oSettings.nTable.parentNode.removeChild(nCalcTmp)
|
||||||
|
}}function fnGetMaxLenString(oSettings,iCol){var iMax=0;var iMaxIndex=-1;for(var i=0;
|
||||||
|
i<oSettings.aoData.length;i++){if(oSettings.aoData[i]._aData[iCol].length>iMax){iMax=oSettings.aoData[i]._aData[iCol].length;
|
||||||
|
iMaxIndex=i}}if(iMaxIndex>=0){return oSettings.aoData[iMaxIndex]._aData[iCol]}return""
|
||||||
|
}function _fnArrayCmp(aArray1,aArray2){if(aArray1.length!=aArray2.length){return 1
|
||||||
|
}for(var i=0;i<aArray1.length;i++){if(aArray1[i]!=aArray2[i]){return 2}}return 0}function _fnDetectType(sData){var aTypes=_oExt.aTypes;
|
||||||
|
var iLen=aTypes.length;for(var i=0;i<iLen;i++){var sType=aTypes[i](sData);if(sType!==null){return sType
|
||||||
|
}}return"string"}function _fnSettingsFromNode(nTable){for(var i=0;i<_aoSettings.length;
|
||||||
|
i++){if(_aoSettings[i].nTable==nTable){return _aoSettings[i]}}return null}function _fnGetDataMaster(oSettings){var aData=[];
|
||||||
|
var iLen=oSettings.aoData.length;for(var i=0;i<iLen;i++){if(oSettings.aoData[i]===null){aData.push(null)
|
||||||
|
}else{aData.push(oSettings.aoData[i]._aData)}}return aData}function _fnGetTrNodes(oSettings){var aNodes=[];
|
||||||
|
var iLen=oSettings.aoData.length;for(var i=0;i<iLen;i++){if(oSettings.aoData[i]===null){aNodes.push(null)
|
||||||
|
}else{aNodes.push(oSettings.aoData[i].nTr)}}return aNodes}function _fnGetTdNodes(oSettings){var nTrs=_fnGetTrNodes(oSettings);
|
||||||
|
var nTds=[],nTd;var anReturn=[];var iCorrector;var iRow,iRows,iColumn,iColumns;for(iRow=0,iRows=nTrs.length;
|
||||||
|
iRow<iRows;iRow++){nTds=[];for(iColumn=0,iColumns=nTrs[iRow].childNodes.length;iColumn<iColumns;
|
||||||
|
iColumn++){nTd=nTrs[iRow].childNodes[iColumn];if(nTd.nodeName=="TD"){nTds.push(nTd)
|
||||||
|
}}iCorrector=0;for(iColumn=0,iColumns=oSettings.aoColumns.length;iColumn<iColumns;
|
||||||
|
iColumn++){if(oSettings.aoColumns[iColumn].bVisible){anReturn.push(nTds[iColumn-iCorrector])
|
||||||
|
}else{anReturn.push(oSettings.aoData[iRow]._anHidden[iColumn]);iCorrector++}}}return anReturn
|
||||||
|
}function _fnEscapeRegex(sVal){var acEscape=["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^"];
|
||||||
|
var reReplace=new RegExp("(\\"+acEscape.join("|\\")+")","g");return sVal.replace(reReplace,"\\$1")
|
||||||
|
}function _fnReOrderIndex(oSettings,sColumns){var aColumns=sColumns.split(",");var aiReturn=[];
|
||||||
|
for(var i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){for(var j=0;j<iLen;j++){if(oSettings.aoColumns[i].sName==aColumns[j]){aiReturn.push(j);
|
||||||
|
break}}}return aiReturn}function _fnColumnOrdering(oSettings){var sNames="";for(var i=0,iLen=oSettings.aoColumns.length;
|
||||||
|
i<iLen;i++){sNames+=oSettings.aoColumns[i].sName+","}if(sNames.length==iLen){return""
|
||||||
|
}return sNames.slice(0,-1)}function _fnClearTable(oSettings){oSettings.aoData.length=0;
|
||||||
|
oSettings.aiDisplayMaster.length=0;oSettings.aiDisplay.length=0;_fnCalculateEnd(oSettings)
|
||||||
|
}function _fnSaveState(oSettings){if(!oSettings.oFeatures.bStateSave){return}var i;
|
||||||
|
var sValue="{";sValue+='"iStart": '+oSettings._iDisplayStart+",";sValue+='"iEnd": '+oSettings._iDisplayEnd+",";
|
||||||
|
sValue+='"iLength": '+oSettings._iDisplayLength+",";sValue+='"sFilter": "'+oSettings.oPreviousSearch.sSearch.replace('"','\\"')+'",';
|
||||||
|
sValue+='"sFilterEsc": '+oSettings.oPreviousSearch.bEscapeRegex+",";sValue+='"aaSorting": [ ';
|
||||||
|
for(i=0;i<oSettings.aaSorting.length;i++){sValue+="["+oSettings.aaSorting[i][0]+",'"+oSettings.aaSorting[i][1]+"'],"
|
||||||
|
}sValue=sValue.substring(0,sValue.length-1);sValue+="],";sValue+='"aaSearchCols": [ ';
|
||||||
|
for(i=0;i<oSettings.aoPreSearchCols.length;i++){sValue+="['"+oSettings.aoPreSearchCols[i].sSearch.replace("'","'")+"',"+oSettings.aoPreSearchCols[i].bEscapeRegex+"],"
|
||||||
|
}sValue=sValue.substring(0,sValue.length-1);sValue+="],";sValue+='"abVisCols": [ ';
|
||||||
|
for(i=0;i<oSettings.aoColumns.length;i++){sValue+=oSettings.aoColumns[i].bVisible+","
|
||||||
|
}sValue=sValue.substring(0,sValue.length-1);sValue+="]";sValue+="}";_fnCreateCookie("SpryMedia_DataTables_"+oSettings.sInstance,sValue,oSettings.iCookieDuration)
|
||||||
|
}function _fnLoadState(oSettings,oInit){if(!oSettings.oFeatures.bStateSave){return
|
||||||
|
}var oData;var sData=_fnReadCookie("SpryMedia_DataTables_"+oSettings.sInstance);if(sData!==null&&sData!==""){try{if(typeof JSON=="object"&&typeof JSON.parse=="function"){oData=JSON.parse(sData.replace(/'/g,'"'))
|
||||||
|
}else{oData=eval("("+sData+")")}}catch(e){return}oSettings._iDisplayStart=oData.iStart;
|
||||||
|
oSettings.iInitDisplayStart=oData.iStart;oSettings._iDisplayEnd=oData.iEnd;oSettings._iDisplayLength=oData.iLength;
|
||||||
|
oSettings.oPreviousSearch.sSearch=oData.sFilter;oSettings.aaSorting=oData.aaSorting.slice();
|
||||||
|
oSettings.saved_aaSorting=oData.aaSorting.slice();if(typeof oData.sFilterEsc!="undefined"){oSettings.oPreviousSearch.bEscapeRegex=oData.sFilterEsc
|
||||||
|
}if(typeof oData.aaSearchCols!="undefined"){for(var i=0;i<oData.aaSearchCols.length;
|
||||||
|
i++){oSettings.aoPreSearchCols[i]={sSearch:oData.aaSearchCols[i][0],bEscapeRegex:oData.aaSearchCols[i][1]}
|
||||||
|
}}if(typeof oData.abVisCols!="undefined"){oInit.saved_aoColumns=[];for(i=0;i<oData.abVisCols.length;
|
||||||
|
i++){oInit.saved_aoColumns[i]={};oInit.saved_aoColumns[i].bVisible=oData.abVisCols[i]
|
||||||
|
}}}}function _fnCreateCookie(sName,sValue,iSecs){var date=new Date();date.setTime(date.getTime()+(iSecs*1000));
|
||||||
|
sName+="_"+window.location.pathname.replace(/[\/:]/g,"").toLowerCase();document.cookie=sName+"="+encodeURIComponent(sValue)+"; expires="+date.toGMTString()+"; path=/"
|
||||||
|
}function _fnReadCookie(sName){var sNameEQ=sName+"_"+window.location.pathname.replace(/[\/:]/g,"").toLowerCase()+"=";
|
||||||
|
var sCookieContents=document.cookie.split(";");for(var i=0;i<sCookieContents.length;
|
||||||
|
i++){var c=sCookieContents[i];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf(sNameEQ)===0){return decodeURIComponent(c.substring(sNameEQ.length,c.length))
|
||||||
|
}}return null}function _fnGetUniqueThs(nThead){var nTrs=nThead.getElementsByTagName("tr");
|
||||||
|
if(nTrs.length==1){return nTrs[0].getElementsByTagName("th")}var aLayout=[],aReturn=[];
|
||||||
|
var ROWSPAN=2,COLSPAN=3,TDELEM=4;var i,j,k,iLen,jLen,iColumnShifted;var fnShiftCol=function(a,i,j){while(typeof a[i][j]!="undefined"){j++
|
||||||
|
}return j};var fnAddRow=function(i){if(typeof aLayout[i]=="undefined"){aLayout[i]=[]
|
||||||
|
}};for(i=0,iLen=nTrs.length;i<iLen;i++){fnAddRow(i);var iColumn=0;var nTds=[];for(j=0,jLen=nTrs[i].childNodes.length;
|
||||||
|
j<jLen;j++){if(nTrs[i].childNodes[j].nodeName=="TD"||nTrs[i].childNodes[j].nodeName=="TH"){nTds.push(nTrs[i].childNodes[j])
|
||||||
|
}}for(j=0,jLen=nTds.length;j<jLen;j++){var iColspan=nTds[j].getAttribute("colspan")*1;
|
||||||
|
var iRowspan=nTds[j].getAttribute("rowspan")*1;if(!iColspan||iColspan===0||iColspan===1){iColumnShifted=fnShiftCol(aLayout,i,iColumn);
|
||||||
|
aLayout[i][iColumnShifted]=(nTds[j].nodeName=="TD")?TDELEM:nTds[j];if(iRowspan||iRowspan===0||iRowspan===1){for(k=1;
|
||||||
|
k<iRowspan;k++){fnAddRow(i+k);aLayout[i+k][iColumnShifted]=ROWSPAN}}iColumn++}else{iColumnShifted=fnShiftCol(aLayout,i,iColumn);
|
||||||
|
for(k=0;k<iColspan;k++){aLayout[i][iColumnShifted+k]=COLSPAN}iColumn+=iColspan}}}for(i=0,iLen=aLayout[0].length;
|
||||||
|
i<iLen;i++){for(j=0,jLen=aLayout.length;j<jLen;j++){if(typeof aLayout[j][i]=="object"){aReturn.push(aLayout[j][i])
|
||||||
|
}}}return aReturn}function _fnMap(oRet,oSrc,sName,sMappedName){if(typeof sMappedName=="undefined"){sMappedName=sName
|
||||||
|
}if(typeof oSrc[sName]!="undefined"){oRet[sMappedName]=oSrc[sName]}}this.oApi._fnInitalise=_fnInitalise;
|
||||||
|
this.oApi._fnLanguageProcess=_fnLanguageProcess;this.oApi._fnAddColumn=_fnAddColumn;
|
||||||
|
this.oApi._fnAddData=_fnAddData;this.oApi._fnGatherData=_fnGatherData;this.oApi._fnDrawHead=_fnDrawHead;
|
||||||
|
this.oApi._fnDraw=_fnDraw;this.oApi._fnAjaxUpdate=_fnAjaxUpdate;this.oApi._fnAddOptionsHtml=_fnAddOptionsHtml;
|
||||||
|
this.oApi._fnFeatureHtmlFilter=_fnFeatureHtmlFilter;this.oApi._fnFeatureHtmlInfo=_fnFeatureHtmlInfo;
|
||||||
|
this.oApi._fnFeatureHtmlPaginate=_fnFeatureHtmlPaginate;this.oApi._fnPageChange=_fnPageChange;
|
||||||
|
this.oApi._fnFeatureHtmlLength=_fnFeatureHtmlLength;this.oApi._fnFeatureHtmlProcessing=_fnFeatureHtmlProcessing;
|
||||||
|
this.oApi._fnProcessingDisplay=_fnProcessingDisplay;this.oApi._fnFilterComplete=_fnFilterComplete;
|
||||||
|
this.oApi._fnFilterColumn=_fnFilterColumn;this.oApi._fnFilter=_fnFilter;this.oApi._fnSortingClasses=_fnSortingClasses;
|
||||||
|
this.oApi._fnVisibleToColumnIndex=_fnVisibleToColumnIndex;this.oApi._fnColumnIndexToVisible=_fnColumnIndexToVisible;
|
||||||
|
this.oApi._fnNodeToDataIndex=_fnNodeToDataIndex;this.oApi._fnVisbleColumns=_fnVisbleColumns;
|
||||||
|
this.oApi._fnBuildSearchArray=_fnBuildSearchArray;this.oApi._fnDataToSearch=_fnDataToSearch;
|
||||||
|
this.oApi._fnCalculateEnd=_fnCalculateEnd;this.oApi._fnConvertToWidth=_fnConvertToWidth;
|
||||||
|
this.oApi._fnCalculateColumnWidths=_fnCalculateColumnWidths;this.oApi._fnArrayCmp=_fnArrayCmp;
|
||||||
|
this.oApi._fnDetectType=_fnDetectType;this.oApi._fnGetDataMaster=_fnGetDataMaster;
|
||||||
|
this.oApi._fnGetTrNodes=_fnGetTrNodes;this.oApi._fnGetTdNodes=_fnGetTdNodes;this.oApi._fnEscapeRegex=_fnEscapeRegex;
|
||||||
|
this.oApi._fnReOrderIndex=_fnReOrderIndex;this.oApi._fnColumnOrdering=_fnColumnOrdering;
|
||||||
|
this.oApi._fnClearTable=_fnClearTable;this.oApi._fnSaveState=_fnSaveState;this.oApi._fnLoadState=_fnLoadState;
|
||||||
|
this.oApi._fnCreateCookie=_fnCreateCookie;this.oApi._fnReadCookie=_fnReadCookie;this.oApi._fnGetUniqueThs=_fnGetUniqueThs;
|
||||||
|
this.oApi._fnReDraw=_fnReDraw;var _that=this;return this.each(function(){var i=0,iLen,j,jLen;
|
||||||
|
for(i=0,iLen=_aoSettings.length;i<iLen;i++){if(_aoSettings[i].nTable==this){alert("DataTables warning: Unable to re-initialise DataTable. Please use the API to make any configuration changes required.");
|
||||||
|
return _aoSettings[i]}}var oSettings=new classSettings();_aoSettings.push(oSettings);
|
||||||
|
var bInitHandedOff=false;var bUsePassedData=false;var sId=this.getAttribute("id");
|
||||||
|
if(sId!==null){oSettings.sTableId=sId;oSettings.sInstance=sId}else{oSettings.sInstance=_oExt._oExternConfig.iNextUnique++
|
||||||
|
}oSettings.nTable=this;oSettings.oApi=_that.oApi;if(typeof oInit!="undefined"&&oInit!==null){_fnMap(oSettings.oFeatures,oInit,"bPaginate");
|
||||||
|
_fnMap(oSettings.oFeatures,oInit,"bLengthChange");_fnMap(oSettings.oFeatures,oInit,"bFilter");
|
||||||
|
_fnMap(oSettings.oFeatures,oInit,"bSort");_fnMap(oSettings.oFeatures,oInit,"bInfo");
|
||||||
|
_fnMap(oSettings.oFeatures,oInit,"bProcessing");_fnMap(oSettings.oFeatures,oInit,"bAutoWidth");
|
||||||
|
_fnMap(oSettings.oFeatures,oInit,"bSortClasses");_fnMap(oSettings.oFeatures,oInit,"bServerSide");
|
||||||
|
_fnMap(oSettings,oInit,"asStripClasses");_fnMap(oSettings,oInit,"fnRowCallback");
|
||||||
|
_fnMap(oSettings,oInit,"fnHeaderCallback");_fnMap(oSettings,oInit,"fnFooterCallback");
|
||||||
|
_fnMap(oSettings,oInit,"fnInitComplete");_fnMap(oSettings,oInit,"fnServerData");_fnMap(oSettings,oInit,"aaSorting");
|
||||||
|
_fnMap(oSettings,oInit,"aaSortingFixed");_fnMap(oSettings,oInit,"sPaginationType");
|
||||||
|
_fnMap(oSettings,oInit,"sAjaxSource");_fnMap(oSettings,oInit,"iCookieDuration");_fnMap(oSettings,oInit,"sDom");
|
||||||
|
_fnMap(oSettings,oInit,"oSearch","oPreviousSearch");_fnMap(oSettings,oInit,"aoSearchCols","aoPreSearchCols");
|
||||||
|
_fnMap(oSettings,oInit,"iDisplayLength","_iDisplayLength");_fnMap(oSettings,oInit,"bJQueryUI","bJUI");
|
||||||
|
if(typeof oInit.fnDrawCallback=="function"){oSettings.aoDrawCallback.push({fn:oInit.fnDrawCallback,sName:"user"})
|
||||||
|
}if(oSettings.oFeatures.bServerSide&&oSettings.oFeatures.bSort&&oSettings.oFeatures.bSortClasses){oSettings.aoDrawCallback.push({fn:_fnSortingClasses,sName:"server_side_sort_classes"})
|
||||||
|
}if(typeof oInit.bJQueryUI!="undefined"&&oInit.bJQueryUI){oSettings.oClasses=_oExt.oJUIClasses;
|
||||||
|
if(typeof oInit.sDom=="undefined"){oSettings.sDom='<"H"lfr>t<"F"ip>'}}if(typeof oInit.iDisplayStart!="undefined"&&typeof oSettings.iInitDisplayStart=="undefined"){oSettings.iInitDisplayStart=oInit.iDisplayStart;
|
||||||
|
oSettings._iDisplayStart=oInit.iDisplayStart}if(typeof oInit.bStateSave!="undefined"){oSettings.oFeatures.bStateSave=oInit.bStateSave;
|
||||||
|
_fnLoadState(oSettings,oInit);oSettings.aoDrawCallback.push({fn:_fnSaveState,sName:"state_save"})
|
||||||
|
}if(typeof oInit.aaData!="undefined"){bUsePassedData=true}if(typeof oInit!="undefined"&&typeof oInit.aoData!="undefined"){oInit.aoColumns=oInit.aoData
|
||||||
|
}if(typeof oInit.oLanguage!="undefined"){if(typeof oInit.oLanguage.sUrl!="undefined"&&oInit.oLanguage.sUrl!==""){oSettings.oLanguage.sUrl=oInit.oLanguage.sUrl;
|
||||||
|
$.getJSON(oSettings.oLanguage.sUrl,null,function(json){_fnLanguageProcess(oSettings,json,true)
|
||||||
|
});bInitHandedOff=true}else{_fnLanguageProcess(oSettings,oInit.oLanguage,false)}}}else{oInit={}
|
||||||
|
}if(typeof oInit.asStripClasses=="undefined"){oSettings.asStripClasses.push(oSettings.oClasses.sStripOdd);
|
||||||
|
oSettings.asStripClasses.push(oSettings.oClasses.sStripEven)}var nThead=this.getElementsByTagName("thead");
|
||||||
|
var nThs=nThead.length===0?null:_fnGetUniqueThs(nThead[0]);var bUseCols=typeof oInit.aoColumns!="undefined";
|
||||||
|
for(i=0,iLen=bUseCols?oInit.aoColumns.length:nThs.length;i<iLen;i++){var oCol=bUseCols?oInit.aoColumns[i]:null;
|
||||||
|
var nTh=nThs?nThs[i]:null;if(typeof oInit.saved_aoColumns!="undefined"&&oInit.saved_aoColumns.length==iLen){if(oCol===null){oCol={}
|
||||||
|
}oCol.bVisible=oInit.saved_aoColumns[i].bVisible}_fnAddColumn(oSettings,oCol,nTh)
|
||||||
|
}for(i=0,iLen=oSettings.aaSorting.length;i<iLen;i++){var oColumn=oSettings.aoColumns[oSettings.aaSorting[i][0]];
|
||||||
|
if(typeof oSettings.aaSorting[i][2]=="undefined"){oSettings.aaSorting[i][2]=0}if(typeof oInit.aaSorting=="undefined"&&typeof oSettings.saved_aaSorting=="undefined"){oSettings.aaSorting[i][1]=oColumn.asSorting[0]
|
||||||
|
}for(j=0,jLen=oColumn.asSorting.length;j<jLen;j++){if(oSettings.aaSorting[i][1]==oColumn.asSorting[j]){oSettings.aaSorting[i][2]=j;
|
||||||
|
break}}}if(this.getElementsByTagName("thead").length===0){this.appendChild(document.createElement("thead"))
|
||||||
|
}if(this.getElementsByTagName("tbody").length===0){this.appendChild(document.createElement("tbody"))
|
||||||
|
}if(bUsePassedData){for(i=0;i<oInit.aaData.length;i++){_fnAddData(oSettings,oInit.aaData[i])
|
||||||
|
}}else{_fnGatherData(oSettings)}oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();
|
||||||
|
if(oSettings.oFeatures.bAutoWidth){_fnCalculateColumnWidths(oSettings)}oSettings.bInitialised=true;
|
||||||
|
if(bInitHandedOff===false){_fnInitalise(oSettings)}})}})(jQuery);
|
|
@ -0,0 +1,85 @@
|
||||||
|
/* jquery.sparkline 1.5.1 - http://omnipotent.net/jquery.sparkline/ */
|
||||||
|
|
||||||
|
(function($){$.fn.simpledraw=function(width,height,use_existing){if(use_existing&&this[0].vcanvas)return this[0].vcanvas;if(width==undefined)width=$(this).innerWidth();if(height==undefined)height=$(this).innerHeight();if($.browser.hasCanvas){return new vcanvas_canvas(width,height,this);}else if($.browser.msie){return new vcanvas_vml(width,height,this);}else{return false;}};var pending=[];$.fn.sparkline=function(uservalues,options){var options=$.extend({type:'line',lineColor:'#00f',fillColor:'#cdf',defaultPixelsPerValue:3,width:'auto',height:'auto',composite:false},options?options:{});return this.each(function(){var render=function(){var values=(uservalues=='html'||uservalues==undefined)?$(this).text().split(','):uservalues;var width=options.width=='auto'?values.length*options.defaultPixelsPerValue:options.width;if(options.height=='auto'){if(!options.composite||!this.vcanvas){var tmp=document.createElement('span');tmp.innerHTML='a';$(this).html(tmp);height=$(tmp).innerHeight();$(tmp).remove();}}else{height=options.height;}
|
||||||
|
$.fn.sparkline[options.type].call(this,values,options,width,height);}
|
||||||
|
if(($(this).html()&&$(this).is(':hidden'))||($.fn.jquery<"1.3.0"&&$(this).parents().is(':hidden'))){pending.push([this,render]);}else{render.call(this);}});};$.sparkline_display_visible=function(){for(var i=pending.length-1;i>=0;i--){var el=pending[i][0];if($(el).is(':visible')&&!$(el).parents().is(':hidden')){pending[i][1].call(el);pending.splice(i,1);}}};$.fn.sparkline.line=function(values,options,width,height){var options=$.extend({spotColor:'#f80',spotRadius:1.5,minSpotColor:'#f80',maxSpotColor:'#f80',lineWidth:1,normalRangeMin:undefined,normalRangeMax:undefined,normalRangeColor:'#ccc',chartRangeMin:undefined,chartRangeMax:undefined,chartRangeMinX:undefined,chartRangeMaxX:undefined},options?options:{});var xvalues=[],yvalues=[],yminmax=[];for(i=0;i<values.length;i++){var v=values[i];var isstr=typeof(values[i])=='string';var isarray=typeof(values[i])=='object'&&values[i]instanceof Array;var sp=isstr&&values[i].split(':');if(isstr&&sp.length==2){xvalues.push(Number(sp[0]));yvalues.push(Number(sp[1]));yminmax.push(Number(sp[1]));}else if(isarray){xvalues.push(values[i][0]);yvalues.push(values[i][1]);yminmax.push(values[i][1]);}else{xvalues.push(i);if(values[i]===null||values[i]=='null'){yvalues.push(null);}else{yvalues.push(Number(values[i]));yminmax.push(Number(values[i]));}}}
|
||||||
|
if(options.xvalues){xvalues=options.xvalues;}
|
||||||
|
var maxy=Math.max.apply(Math,yminmax);var maxyval=maxy;var miny=Math.min.apply(Math,yminmax);var minyval=miny;var maxx=Math.max.apply(Math,xvalues);var maxxval=maxx;var minx=Math.min.apply(Math,xvalues);var minxval=minx;if(options.normalRangeMin!=undefined){if(options.normalRangeMin<miny)
|
||||||
|
miny=options.normalRangeMin;if(options.normalRangeMax>maxy)
|
||||||
|
maxy=options.normalRangeMax;}
|
||||||
|
if(options.chartRangeMin!=undefined&&(options.chartRangeClip||options.chartRangeMin<miny)){miny=options.chartRangeMin;}
|
||||||
|
if(options.chartRangeMax!=undefined&&(options.chartRangeClip||options.chartRangeMax>maxy)){maxy=options.chartRangeMax;}
|
||||||
|
if(options.chartRangeMinX!=undefined&&(options.chartRangeClipX||options.chartRangeMinX<minx)){minx=options.chartRangeMinX;}
|
||||||
|
if(options.chartRangeMaxX!=undefined&&(options.chartRangeClipX||options.chartRangeMaxX>maxx)){maxx=options.chartRangeMaxX;}
|
||||||
|
var rangex=maxx-minx==0?1:maxx-minx;var rangey=maxy-miny==0?1:maxy-miny;var vl=yvalues.length-1;if(vl<1){this.innerHTML='';return;}
|
||||||
|
var target=$(this).simpledraw(width,height,options.composite);if(target){var canvas_width=target.pixel_width;var canvas_height=target.pixel_height;var canvas_top=0;var canvas_left=0;if(options.spotRadius&&(canvas_width<(options.spotRadius*4)||canvas_height<(options.spotRadius*4))){options.spotRadius=0;}
|
||||||
|
if(options.spotRadius){if(options.minSpotColor||(options.spotColor&&yvalues[vl]==miny))
|
||||||
|
canvas_height-=Math.ceil(options.spotRadius);if(options.maxSpotColor||(options.spotColor&&yvalues[vl]==maxy)){canvas_height-=Math.ceil(options.spotRadius);canvas_top+=Math.ceil(options.spotRadius);}
|
||||||
|
if(options.minSpotColor||options.maxSpotColor&&(yvalues[0]==miny||yvalues[0]==maxy)){canvas_left+=Math.ceil(options.spotRadius);canvas_width-=Math.ceil(options.spotRadius);}
|
||||||
|
if(options.spotColor||(options.minSpotColor||options.maxSpotColor&&(yvalues[vl]==miny||yvalues[vl]==maxy)))
|
||||||
|
canvas_width-=Math.ceil(options.spotRadius);}
|
||||||
|
canvas_height--;if(options.normalRangeMin!=undefined){var ytop=canvas_top+Math.round(canvas_height-(canvas_height*((options.normalRangeMax-miny)/rangey)));var height=Math.round((canvas_height*(options.normalRangeMax-options.normalRangeMin))/rangey);target.drawRect(canvas_left,ytop,canvas_width,height,undefined,options.normalRangeColor);}
|
||||||
|
var path=[];var paths=[path];for(var i=0,vlen=yvalues.length;i<vlen;i++){var x=xvalues[i],y=yvalues[i];if(y===null){if(i){if(yvalues[i-1]!==null){path=[];paths.push(path);}}}else{if(y<miny)y=miny;if(y>maxy)y=maxy;if(!path.length){path.push([canvas_left+Math.round((x-minx)*(canvas_width/rangex)),canvas_top+canvas_height]);}
|
||||||
|
path.push([canvas_left+Math.round((x-minx)*(canvas_width/rangex)),canvas_top+Math.round(canvas_height-(canvas_height*((y-miny)/rangey)))]);}}
|
||||||
|
for(var i=0,plen=paths.length;i<plen;i++){path=paths[i];if(!path.length)
|
||||||
|
continue;if(options.fillColor){path.push([path[path.length-1][0],canvas_top+canvas_height-1]);target.drawShape(path,undefined,options.fillColor);path.pop();}
|
||||||
|
if(path.length>2){path[0]=[path[0][0],path[1][1]];}
|
||||||
|
target.drawShape(path,options.lineColor,undefined,options.lineWidth);}
|
||||||
|
if(options.spotRadius&&options.spotColor){target.drawCircle(canvas_left+Math.round(xvalues[xvalues.length-1]*(canvas_width/rangex)),canvas_top+Math.round(canvas_height-(canvas_height*((yvalues[vl]-miny)/rangey))),options.spotRadius,undefined,options.spotColor);}
|
||||||
|
if(maxy!=minyval){if(options.spotRadius&&options.minSpotColor){var x=xvalues[yvalues.indexOf(minyval)];target.drawCircle(canvas_left+Math.round((x-minx)*(canvas_width/rangex)),canvas_top+Math.round(canvas_height-(canvas_height*((minyval-miny)/rangey))),options.spotRadius,undefined,options.minSpotColor);}
|
||||||
|
if(options.spotRadius&&options.maxSpotColor){var x=xvalues[yvalues.indexOf(maxyval)];target.drawCircle(canvas_left+Math.round((x-minx)*(canvas_width/rangex)),canvas_top+Math.round(canvas_height-(canvas_height*((maxyval-miny)/rangey))),options.spotRadius,undefined,options.maxSpotColor);}}}else{this.innerHTML='';}};$.fn.sparkline.bar=function(values,options,width,height){var options=$.extend({type:'bar',barColor:'#00f',negBarColor:'#f44',zeroColor:undefined,nullColor:undefined,zeroAxis:undefined,barWidth:4,barSpacing:1,chartRangeMax:undefined,chartRangeMin:undefined,chartRangeClip:false,colorMap:undefined},options?options:{});var width=(values.length*options.barWidth)+((values.length-1)*options.barSpacing);var num_values=[];for(var i=0,vlen=values.length;i<vlen;i++){if(values[i]=='null'||values[i]===null){values[i]=null;}else{values[i]=Number(values[i]);num_values.push(Number(values[i]));}}
|
||||||
|
var max=Math.max.apply(Math,num_values);var min=Math.min.apply(Math,num_values);if(options.chartRangeMin!=undefined&&(options.chartRangeClip||options.chartRangeMin<min)){min=options.chartRangeMin;}
|
||||||
|
if(options.chartRangeMax!=undefined&&(options.chartRangeClip||options.chartRangeMax>max)){max=options.chartRangeMax;}
|
||||||
|
if(options.zeroAxis==undefined)options.zeroAxis=min<0;var range=max-min==0?1:max-min;if($.isArray(options.colorMap)){var colorMapByIndex=options.colorMap;var colorMapByValue=null;}else{var colorMapByIndex=null;var colorMapByValue=options.colorMap;}
|
||||||
|
var target=$(this).simpledraw(width,height,options.composite);if(target){var canvas_width=target.pixel_width;var canvas_height=target.pixel_height;var yzero=min<0&&options.zeroAxis?canvas_height-Math.round(canvas_height*(Math.abs(min)/range))-1:canvas_height-1;for(var i=0,vlen=values.length;i<vlen;i++){var x=i*(options.barWidth+options.barSpacing);var val=values[i];if(val===null){if(options.nullColor){color=options.nullColor;val=(options.zeroAxis&&min<0)?0:min;var height=1;var y=(options.zeroAxis&&min<0)?yzero:canvas_height-height;}else{continue;}}else{if(val<min)val=min;if(val>max)val=max;var color=(val<0)?options.negBarColor:options.barColor;if(options.zeroAxis&&min<0){var height=Math.round(canvas_height*((Math.abs(val)/range)))+1;var y=(val<0)?yzero:yzero-height;}else{var height=Math.round(canvas_height*((val-min)/range))+1;var y=canvas_height-height;}
|
||||||
|
if(val==0&&options.zeroColor!=undefined){color=options.zeroColor;}
|
||||||
|
if(colorMapByValue&&colorMapByValue[val]){color=colorMapByValue[val];}else if(colorMapByIndex&&colorMapByIndex.length>i){color=colorMapByIndex[i];}
|
||||||
|
if(color===null){continue;}}
|
||||||
|
target.drawRect(x,y,options.barWidth-1,height-1,color,color);}}else{this.innerHTML='';}};$.fn.sparkline.tristate=function(values,options,width,height){values=$.map(values,Number);var options=$.extend({barWidth:4,barSpacing:1,posBarColor:'#6f6',negBarColor:'#f44',zeroBarColor:'#999',colorMap:{}},options);var width=(values.length*options.barWidth)+((values.length-1)*options.barSpacing);if($.isArray(options.colorMap)){var colorMapByIndex=options.colorMap;var colorMapByValue=null;}else{var colorMapByIndex=null;var colorMapByValue=options.colorMap;}
|
||||||
|
var target=$(this).simpledraw(width,height,options.composite);if(target){var canvas_width=target.pixel_width;var canvas_height=target.pixel_height;var half_height=Math.round(canvas_height/2);for(var i=0,vlen=values.length;i<vlen;i++){var x=i*(options.barWidth+options.barSpacing);if(values[i]<0){var y=half_height;var height=half_height-1;var color=options.negBarColor;}else if(values[i]>0){var y=0;var height=half_height-1;var color=options.posBarColor;}else{var y=half_height-1;var height=2;var color=options.zeroBarColor;}
|
||||||
|
if(colorMapByValue&&colorMapByValue[values[i]]){color=colorMapByValue[values[i]];}else if(colorMapByIndex&&colorMapByIndex.length>i){color=colorMapByIndex[i];}
|
||||||
|
if(color===null){continue;}
|
||||||
|
target.drawRect(x,y,options.barWidth-1,height-1,color,color);}}else{this.innerHTML='';}};$.fn.sparkline.discrete=function(values,options,width,height){values=$.map(values,Number);var options=$.extend({lineHeight:'auto',thresholdColor:undefined,thresholdValue:0,chartRangeMax:undefined,chartRangeMin:undefined,chartRangeClip:false},options);width=options.width=='auto'?values.length*2:width;var interval=Math.floor(width/values.length);var target=$(this).simpledraw(width,height,options.composite);if(target){var canvas_width=target.pixel_width;var canvas_height=target.pixel_height;var line_height=options.lineHeight=='auto'?Math.round(canvas_height*0.3):options.lineHeight;var pheight=canvas_height-line_height;var min=Math.min.apply(Math,values);var max=Math.max.apply(Math,values);if(options.chartRangeMin!=undefined&&(options.chartRangeClip||options.chartRangeMin<min)){min=options.chartRangeMin;}
|
||||||
|
if(options.chartRangeMax!=undefined&&(options.chartRangeClip||options.chartRangeMax>max)){max=options.chartRangeMax;}
|
||||||
|
var range=max-min;for(var i=0,vlen=values.length;i<vlen;i++){var val=values[i];if(val<min)val=min;if(val>max)val=max;var x=(i*interval);var ytop=Math.round(pheight-pheight*((val-min)/range));target.drawLine(x,ytop,x,ytop+line_height,(options.thresholdColor&&val<options.thresholdValue)?options.thresholdColor:options.lineColor);}}else{this.innerHTML='';}};$.fn.sparkline.bullet=function(values,options,width,height){values=$.map(values,Number);var options=$.extend({targetColor:'red',targetWidth:3,performanceColor:'blue',rangeColors:['#D3DAFE','#A8B6FF','#7F94FF'],base:undefined},options);width=options.width=='auto'?'4.0em':width;var target=$(this).simpledraw(width,height,options.composite);if(target&&values.length>1){var canvas_width=target.pixel_width-Math.ceil(options.targetWidth/2);var canvas_height=target.pixel_height;var min=Math.min.apply(Math,values);var max=Math.max.apply(Math,values);if(options.base==undefined){var min=min<0?min:0;}else{min=options.base;}
|
||||||
|
var range=max-min;for(i=2,vlen=values.length;i<vlen;i++){var rangeval=parseInt(values[i]);var rangewidth=Math.round(canvas_width*((rangeval-min)/range));target.drawRect(0,0,rangewidth-1,canvas_height-1,options.rangeColors[i-2],options.rangeColors[i-2]);}
|
||||||
|
var perfval=parseInt(values[1]);var perfwidth=Math.round(canvas_width*((perfval-min)/range));target.drawRect(0,Math.round(canvas_height*0.3),perfwidth-1,Math.round(canvas_height*0.4)-1,options.performanceColor,options.performanceColor);var targetval=parseInt(values[0]);var x=Math.round(canvas_width*((targetval-min)/range)-(options.targetWidth/2));var targettop=Math.round(canvas_height*0.10);var targetheight=canvas_height-(targettop*2);target.drawRect(x,targettop,options.targetWidth-1,targetheight-1,options.targetColor,options.targetColor);}else{this.innerHTML='';}};$.fn.sparkline.pie=function(values,options,width,height){values=$.map(values,Number);var options=$.extend({sliceColors:['#f00','#0f0','#00f']},options);width=options.width=='auto'?height:width;var target=$(this).simpledraw(width,height,options.composite);if(target&&values.length>1){var canvas_width=target.pixel_width;var canvas_height=target.pixel_height;var radius=Math.floor(Math.min(canvas_width,canvas_height)/2);var total=0;for(var i=0,vlen=values.length;i<vlen;i++)
|
||||||
|
total+=values[i];var next=0;if(options.offset){next+=(2*Math.PI)*(options.offset/360);}
|
||||||
|
var circle=2*Math.PI;for(var i=0,vlen=values.length;i<vlen;i++){var start=next;var end=next;if(total>0){end=next+(circle*(values[i]/total));}
|
||||||
|
target.drawPieSlice(radius,radius,radius,start,end,undefined,options.sliceColors[i%options.sliceColors.length]);next=end;}}};function quartile(values,q){if(q==2){var vl2=Math.floor(values.length/2);return values.length%2?values[vl2]:(values[vl2]+values[vl2+1])/2;}else{var vl4=Math.floor(values.length/4);return values.length%2?(values[vl4*q]+values[vl4*q+1])/2:values[vl4*q];}};$.fn.sparkline.box=function(values,options,width,height){values=$.map(values,Number);var options=$.extend({raw:false,boxLineColor:'black',boxFillColor:'#cdf',whiskerColor:'black',outlierLineColor:'#333',outlierFillColor:'white',medianColor:'red',showOutliers:true,outlierIQR:1.5,spotRadius:1.5,target:undefined,targetColor:'#4a2',chartRangeMax:undefined,chartRangeMin:undefined},options);width=options.width=='auto'?'4.0em':width;minvalue=options.chartRangeMin==undefined?Math.min.apply(Math,values):options.chartRangeMin;maxvalue=options.chartRangeMax==undefined?Math.max.apply(Math,values):options.chartRangeMax;var target=$(this).simpledraw(width,height,options.composite);if(target&&values.length>1){var canvas_width=target.pixel_width;var canvas_height=target.pixel_height;if(options.raw){if(options.showOutliers&&values.length>5){var loutlier=values[0],lwhisker=values[1],q1=values[2],q2=values[3],q3=values[4],rwhisker=values[5],routlier=values[6];}else{var lwhisker=values[0],q1=values[1],q2=values[2],q3=values[3],rwhisker=values[4];}}else{values.sort(function(a,b){return a-b;});var q1=quartile(values,1);var q2=quartile(values,2);var q3=quartile(values,3);var iqr=q3-q1;if(options.showOutliers){var lwhisker=undefined,rwhisker=undefined;for(var i=0,vlen=values.length;i<vlen;i++){if(lwhisker==undefined&&values[i]>q1-(iqr*options.outlierIQR))
|
||||||
|
lwhisker=values[i];if(values[i]<q3+(iqr*options.outlierIQR))
|
||||||
|
rwhisker=values[i];}
|
||||||
|
var loutlier=values[0];var routlier=values[values.length-1];}else{var lwhisker=values[0];var rwhisker=values[values.length-1];}}
|
||||||
|
var unitsize=canvas_width/(maxvalue-minvalue+1);var canvas_left=0;if(options.showOutliers){canvas_left=Math.ceil(options.spotRadius);canvas_width-=2*Math.ceil(options.spotRadius);var unitsize=canvas_width/(maxvalue-minvalue+1);if(loutlier<lwhisker)
|
||||||
|
target.drawCircle((loutlier-minvalue)*unitsize+canvas_left,canvas_height/2,options.spotRadius,options.outlierLineColor,options.outlierFillColor);if(routlier>rwhisker)
|
||||||
|
target.drawCircle((routlier-minvalue)*unitsize+canvas_left,canvas_height/2,options.spotRadius,options.outlierLineColor,options.outlierFillColor);}
|
||||||
|
target.drawRect(Math.round((q1-minvalue)*unitsize+canvas_left),Math.round(canvas_height*0.1),Math.round((q3-q1)*unitsize),Math.round(canvas_height*0.8),options.boxLineColor,options.boxFillColor);target.drawLine(Math.round((lwhisker-minvalue)*unitsize+canvas_left),Math.round(canvas_height/2),Math.round((q1-minvalue)*unitsize+canvas_left),Math.round(canvas_height/2),options.lineColor);target.drawLine(Math.round((lwhisker-minvalue)*unitsize+canvas_left),Math.round(canvas_height/4),Math.round((lwhisker-minvalue)*unitsize+canvas_left),Math.round(canvas_height-canvas_height/4),options.whiskerColor);target.drawLine(Math.round((rwhisker-minvalue)*unitsize+canvas_left),Math.round(canvas_height/2),Math.round((q3-minvalue)*unitsize+canvas_left),Math.round(canvas_height/2),options.lineColor);target.drawLine(Math.round((rwhisker-minvalue)*unitsize+canvas_left),Math.round(canvas_height/4),Math.round((rwhisker-minvalue)*unitsize+canvas_left),Math.round(canvas_height-canvas_height/4),options.whiskerColor);target.drawLine(Math.round((q2-minvalue)*unitsize+canvas_left),Math.round(canvas_height*0.1),Math.round((q2-minvalue)*unitsize+canvas_left),Math.round(canvas_height*0.9),options.medianColor);if(options.target){var size=Math.ceil(options.spotRadius);target.drawLine(Math.round((options.target-minvalue)*unitsize+canvas_left),Math.round((canvas_height/2)-size),Math.round((options.target-minvalue)*unitsize+canvas_left),Math.round((canvas_height/2)+size),options.targetColor);target.drawLine(Math.round((options.target-minvalue)*unitsize+canvas_left-size),Math.round(canvas_height/2),Math.round((options.target-minvalue)*unitsize+canvas_left+size),Math.round(canvas_height/2),options.targetColor);}}else{this.innerHTML='';}};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(entry){for(var i=0,vlen=this.length;i<vlen;i++){if(this[i]==entry)
|
||||||
|
return i;}
|
||||||
|
return-1;}}
|
||||||
|
if($.browser.msie&&!document.namespaces['v']){document.namespaces.add('v','urn:schemas-microsoft-com:vml','#default#VML');}
|
||||||
|
if($.browser.hasCanvas==undefined){var t=document.createElement('canvas');$.browser.hasCanvas=t.getContext!=undefined;}
|
||||||
|
var vcanvas_base=function(width,height,target){};vcanvas_base.prototype={init:function(width,height,target){this.width=width;this.height=height;this.target=target;if(target[0])target=target[0];target.vcanvas=this;},drawShape:function(path,lineColor,fillColor,lineWidth){alert('drawShape not implemented');},drawLine:function(x1,y1,x2,y2,lineColor,lineWidth){return this.drawShape([[x1,y1],[x2,y2]],lineColor,lineWidth);},drawCircle:function(x,y,radius,lineColor,fillColor){alert('drawCircle not implemented');},drawPieSlice:function(x,y,radius,startAngle,endAngle,lineColor,fillColor){alert('drawPieSlice not implemented');},drawRect:function(x,y,width,height,lineColor,fillColor){alert('drawRect not implemented');},getElement:function(){return this.canvas;},_insert:function(el,target){$(target).html(el);}};var vcanvas_canvas=function(width,height,target){return this.init(width,height,target);};vcanvas_canvas.prototype=$.extend(new vcanvas_base,{_super:vcanvas_base.prototype,init:function(width,height,target){this._super.init(width,height,target);this.canvas=document.createElement('canvas');if(target[0])target=target[0];target.vcanvas=this;$(this.canvas).css({display:'inline-block',width:width,height:height,verticalAlign:'top'});this._insert(this.canvas,target);this.pixel_height=$(this.canvas).height();this.pixel_width=$(this.canvas).width();this.canvas.width=this.pixel_width;this.canvas.height=this.pixel_height;$(this.canvas).css({width:this.pixel_width,height:this.pixel_height});},_getContext:function(lineColor,fillColor,lineWidth){var context=this.canvas.getContext('2d');if(lineColor!=undefined)
|
||||||
|
context.strokeStyle=lineColor;context.lineWidth=lineWidth==undefined?1:lineWidth;if(fillColor!=undefined)
|
||||||
|
context.fillStyle=fillColor;return context;},drawShape:function(path,lineColor,fillColor,lineWidth){var context=this._getContext(lineColor,fillColor,lineWidth);context.beginPath();context.moveTo(path[0][0]+0.5,path[0][1]+0.5);for(var i=1,plen=path.length;i<plen;i++){context.lineTo(path[i][0]+0.5,path[i][1]+0.5);}
|
||||||
|
if(lineColor!=undefined){context.stroke();}
|
||||||
|
if(fillColor!=undefined){context.fill();}},drawCircle:function(x,y,radius,lineColor,fillColor){var context=this._getContext(lineColor,fillColor);context.beginPath();context.arc(x,y,radius,0,2*Math.PI,false);if(lineColor!=undefined){context.stroke();}
|
||||||
|
if(fillColor!=undefined){context.fill();}},drawPieSlice:function(x,y,radius,startAngle,endAngle,lineColor,fillColor){var context=this._getContext(lineColor,fillColor);context.beginPath();context.moveTo(x,y);context.arc(x,y,radius,startAngle,endAngle,false);context.lineTo(x,y);context.closePath();if(lineColor!=undefined){context.stroke();}
|
||||||
|
if(fillColor){context.fill();}},drawRect:function(x,y,width,height,lineColor,fillColor){return this.drawShape([[x,y],[x+width,y],[x+width,y+height],[x,y+height],[x,y]],lineColor,fillColor);}});var vcanvas_vml=function(width,height,target){return this.init(width,height,target);};vcanvas_vml.prototype=$.extend(new vcanvas_base,{_super:vcanvas_base.prototype,init:function(width,height,target){this._super.init(width,height,target);if(target[0])target=target[0];target.vcanvas=this;this.canvas=document.createElement('span');$(this.canvas).css({display:'inline-block',position:'relative',overflow:'hidden',width:width,height:height,margin:'0px',padding:'0px',verticalAlign:'top'});this._insert(this.canvas,target);this.pixel_height=$(this.canvas).height();this.pixel_width=$(this.canvas).width();this.canvas.width=this.pixel_width;this.canvas.height=this.pixel_height;;var groupel='<v:group coordorigin="0 0" coordsize="'+this.pixel_width+' '+this.pixel_height+'"'
|
||||||
|
+' style="position:absolute;top:0;left:0;width:'+this.pixel_width+'px;height='+this.pixel_height+'px;"></v:group>';this.canvas.insertAdjacentHTML('beforeEnd',groupel);this.group=$(this.canvas).children()[0];},drawShape:function(path,lineColor,fillColor,lineWidth){var vpath=[];for(var i=0,plen=path.length;i<plen;i++){vpath[i]=''+(path[i][0])+','+(path[i][1]);}
|
||||||
|
var initial=vpath.splice(0,1);lineWidth=lineWidth==undefined?1:lineWidth;var stroke=lineColor==undefined?' stroked="false" ':' strokeWeight="'+lineWidth+'" strokeColor="'+lineColor+'" ';var fill=fillColor==undefined?' filled="false"':' fillColor="'+fillColor+'" filled="true" ';var closed=vpath[0]==vpath[vpath.length-1]?'x ':'';var vel='<v:shape coordorigin="0 0" coordsize="'+this.pixel_width+' '+this.pixel_height+'" '
|
||||||
|
+stroke
|
||||||
|
+fill
|
||||||
|
+' style="position:absolute;left:0px;top:0px;height:'+this.pixel_height+'px;width:'+this.pixel_width+'px;padding:0px;margin:0px;" '
|
||||||
|
+' path="m '+initial+' l '+vpath.join(', ')+' '+closed+'e">'
|
||||||
|
+' </v:shape>';this.group.insertAdjacentHTML('beforeEnd',vel);},drawCircle:function(x,y,radius,lineColor,fillColor){x-=radius+1;y-=radius+1;var stroke=lineColor==undefined?' stroked="false" ':' strokeWeight="1" strokeColor="'+lineColor+'" ';var fill=fillColor==undefined?' filled="false"':' fillColor="'+fillColor+'" filled="true" ';var vel='<v:oval '
|
||||||
|
+stroke
|
||||||
|
+fill
|
||||||
|
+' style="position:absolute;top:'+y+'px; left:'+x+'px; width:'+(radius*2)+'px; height:'+(radius*2)+'px"></v:oval>';this.group.insertAdjacentHTML('beforeEnd',vel);},drawPieSlice:function(x,y,radius,startAngle,endAngle,lineColor,fillColor){if(startAngle==endAngle){return;}
|
||||||
|
if((endAngle-startAngle)==(2*Math.PI)){startAngle=0.0;endAngle=(2*Math.PI);}
|
||||||
|
var startx=x+Math.round(Math.cos(startAngle)*radius);var starty=y+Math.round(Math.sin(startAngle)*radius);var endx=x+Math.round(Math.cos(endAngle)*radius);var endy=y+Math.round(Math.sin(endAngle)*radius);if(startx==endx&&starty==endy&&(endAngle-startAngle)<Math.PI)
|
||||||
|
return;var vpath=[x-radius,y-radius,x+radius,y+radius,startx,starty,endx,endy];var stroke=lineColor==undefined?' stroked="false" ':' strokeWeight="1" strokeColor="'+lineColor+'" ';var fill=fillColor==undefined?' filled="false"':' fillColor="'+fillColor+'" filled="true" ';var vel='<v:shape coordorigin="0 0" coordsize="'+this.pixel_width+' '+this.pixel_height+'" '
|
||||||
|
+stroke
|
||||||
|
+fill
|
||||||
|
+' style="position:absolute;left:0px;top:0px;height:'+this.pixel_height+'px;width:'+this.pixel_width+'px;padding:0px;margin:0px;" '
|
||||||
|
+' path="m '+x+','+y+' wa '+vpath.join(', ')+' x e">'
|
||||||
|
+' </v:shape>';this.group.insertAdjacentHTML('beforeEnd',vel);},drawRect:function(x,y,width,height,lineColor,fillColor){return this.drawShape([[x,y],[x,y+height],[x+width,y+height],[x+width,y],[x,y]],lineColor,fillColor);}});})(jQuery);
|
|
@ -0,0 +1,15 @@
|
||||||
|
/*
|
||||||
|
* Superfish v1.4.8 - jQuery menu widget
|
||||||
|
* Copyright (c) 2008 Joel Birch
|
||||||
|
*
|
||||||
|
* Dual licensed under the MIT and GPL licenses:
|
||||||
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
* http://www.gnu.org/licenses/gpl.html
|
||||||
|
*
|
||||||
|
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
|
||||||
|
*/
|
||||||
|
(function(a){a.fn.superfish=function(d){var b=a.fn.superfish,h=b.c,n=a(['<span class="',h.arrowClass,'"> »</span>'].join("")),i=function(){var c=a(this),e=j(c);clearTimeout(e.sfTimer);c.showSuperfishUl().siblings().hideSuperfishUl()},k=function(){var c=a(this),e=j(c),g=b.op;clearTimeout(e.sfTimer);e.sfTimer=setTimeout(function(){g.retainPath=a.inArray(c[0],g.$path)>-1;c.hideSuperfishUl();g.$path.length&&c.parents(["li.",g.hoverClass].join("")).length<1&&i.call(g.$path)},g.delay)},j=function(c){c=
|
||||||
|
c.parents(["ul.",h.menuClass,":first"].join(""))[0];b.op=b.o[c.serial];return c},o=function(c){c.addClass(h.anchorClass).append(n.clone())};return this.each(function(){var c=this.serial=b.o.length,e=a.extend({},b.defaults,d);e.$path=a("li."+e.pathClass,this).slice(0,e.pathLevels).each(function(){a(this).addClass([e.hoverClass,h.bcClass].join(" ")).filter("li:has(ul)").removeClass(e.pathClass)});b.o[c]=b.op=e;a("li:has(ul)",this)[a.fn.hoverIntent&&!e.disableHI?"hoverIntent":"hover"](i,k).each(function(){e.autoArrows&&
|
||||||
|
o(a(">a:first-child",this))}).not("."+h.bcClass).hideSuperfishUl();var g=a("a",this);g.each(function(l){var m=g.eq(l).parents("li");g.eq(l).focus(function(){i.call(m)}).blur(function(){k.call(m)})});e.onInit.call(this)}).each(function(){var c=[h.menuClass];b.op.dropShadows&&!(a.browser.msie&&a.browser.version<7)&&c.push(h.shadowClass);a(this).addClass(c.join(" "))})};var f=a.fn.superfish;f.o=[];f.op={};f.IE7fix=function(){var d=f.op;a.browser.msie&&a.browser.version>6&&d.dropShadows&&d.animation.opacity!=
|
||||||
|
undefined&&this.toggleClass(f.c.shadowClass+"-off")};f.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};f.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};a.fn.extend({hideSuperfishUl:function(){var d=f.op,
|
||||||
|
b=d.retainPath===true?d.$path:"";d.retainPath=false;b=a(["li.",d.hoverClass].join(""),this).add(this).not(b).removeClass(d.hoverClass).find(">ul").hide().css("visibility","hidden");d.onHide.call(b);return this},showSuperfishUl:function(){var d=f.op,b=this.addClass(d.hoverClass).find(">ul:hidden").css("visibility","visible");f.IE7fix.call(b);d.onBeforeShow.call(b);b.animate(d.animation,d.speed,function(){f.IE7fix.call(b);d.onShow.call(b)});return this}})})(jQuery);
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* Supersubs v0.2b - jQuery plugin
|
||||||
|
* Copyright (c) 2008 Joel Birch
|
||||||
|
*
|
||||||
|
* Dual licensed under the MIT and GPL licenses:
|
||||||
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
* http://www.gnu.org/licenses/gpl.html
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
|
||||||
|
* their longest list item children. If you use this, please expect bugs and report them
|
||||||
|
* to the jQuery Google Group with the word 'Superfish' in the subject line.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
(function(a){a.fn.supersubs=function(i){var g=a.extend({},a.fn.supersubs.defaults,i);return this.each(function(){var f=a(this),c=a.meta?a.extend({},g,f.data()):g,j=a('<li id="menu-fontsize">—</li>').css({padding:0,position:"absolute",top:"-999em",width:"auto"}).appendTo(f).width();a("#menu-fontsize").remove();$ULs=f.find("ul");$ULs.each(function(d){d=$ULs.eq(d);var e=d.children(),k=e.children("a"),l=e.css("white-space","nowrap").css("float"),b=d.add(e).add(k).css({"float":"none",width:"auto"}).end().end()[0].clientWidth/
|
||||||
|
j;b+=c.extraWidth;if(b>c.maxWidth)b=c.maxWidth;else if(b<c.minWidth)b=c.minWidth;b+="em";d.css("width",b);e.css({"float":l,width:"100%","white-space":"normal"}).each(function(){var h=a(">ul",this),m=h.css("left")!==undefined?"left":"right";h.css(m,b)})})})};a.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0}})(jQuery);
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
Copyright (c) 2009 Open Lab, http://www.open-lab.com/
|
||||||
|
Written by Roberto Bicchierai http://roberto.open-lab.com.
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
if(typeof String.prototype.trim=="undefined")String.prototype.trim=function(){return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1")};
|
||||||
|
jQuery.fn.tagInput=function(a){if(!a.tags&&!a.jsonUrl)a.tags=[{tag:"tag1",freq:1},{tag:"tag2",freq:2},{tag:"tag3",freq:3},{tag:"tag4",freq:4}];if(typeof a.tagSeparator=="undefined")a.tagSeparator=",";if(typeof a.autoFilter=="undefined")a.autoFilter=true;if(typeof a.autoStart=="undefined")a.autoStart=false;if(typeof a.boldify=="undefined")a.boldify=true;if(typeof a.sortBy=="undefined")a.sortBy="tag";this.each(function(){var c=$(this),b;c.addClass("tagInput");c.tagOptions=a;var g=a.suggestedTagsPlaceHolder;
|
||||||
|
if(a.suggestedTags){if(!g){var h=$("<div class='tagInputSuggestedTags'><span class='label'>suggested tags: </span><span class='tagInputSuggestedTagList'></span></div>");g=h.find(".tagInputSuggestedTagList");c.after(h)}for(var k in a.suggestedTags)g.append($("<span class='tag'>"+a.suggestedTags[k]+"</span>"));g.find(".tag").click(function(){var f=$(this),d=c.val(),e=f.text(),j=new RegExp(e+"\\b","g");if(s(d,e)){d=d.replace(j,"");f.removeClass("tagUsed")}else{d=d+a.tagSeparator+e;f.addClass("tagUsed")}c.val(t(d))})}var l=
|
||||||
|
function(f,d){if(f.size()>0){var e=b.get(0),j=f.get(0);if(d)b.scrollTop()>j.offsetTop&&b.scrollTop(j.offsetTop);else if(j.offsetTop+j.offsetHeight>e.scrollTop+e.offsetHeight)e.scrollTop=j.offsetTop+j.offsetHeight-e.offsetHeight;b.find("div.tagInputSel").removeClass("tagInputSel");f.addClass("tagInputSel")}},m=function(f){var d=c.val().lastIndexOf(a.tagSeparator),e=d<=0?"":a.tagSeparator+(a.tagSeparator==" "?"":" ");f=(c.val().substr(0,d)+e+f.find(".tagInputLineTag").text()).trim();c.val(f);b.hide();
|
||||||
|
$().oneTime(200,function(){c.focus()})},v=function(){var f=c.val().lastIndexOf(a.tagSeparator),d=c.val().substr(f+1).trim();f=function(e){if(a.sortBy=="frequency")e=e.sort(function(n,o){if(n.freq<o.freq)return 1;if(n.freq>o.freq)return-1;return 0});else if(a.sortBy=="tag")e=e.sort(function(n,o){if(n.tag<o.tag)return-1;if(n.tag>o.tag)return 1;return 0});for(var j in e){var p=e[j],u=p.tag.toLocaleLowerCase().indexOf(d.toLocaleLowerCase())==0;if(!a.autoFilter||u){var r=$("<div class='tagInputLine'></div>"),
|
||||||
|
q=p.tag;if(a.boldify&&u)q="<b>"+q.substring(0,d.length)+"</b>"+q.substring(d.length);r.append("<div class='tagInputLineTag'>"+q+"</div>");p.freq&&r.append("<div class='tagInputLineFreq'>"+p.freq+"</div>");b.append(r)}}b.html()!=""&&b.fadeIn();b.find("div:first").addClass("tagInputSel");b.find("div.tagInputLine").bind("click",function(){m($(this))})};if(d!=""||a.autoStart){b.html("");a.tags?f(a.tags):$.getJSON(a.jsonUrl,{search:d},f)}else b.fadeOut(200)},t=function(f){f=f.split(a.tagSeparator);for(var d=
|
||||||
|
"",e=true,j=0;j<f.length;j++)if(f[j].trim()!="")if(e){e=false;d+=f[j].trim()}else d=d+a.tagSeparator+(a.tagSeparator==" "?"":" ")+f[j].trim();return d},s=function(f,d){f=f.split(a.tagSeparator);var e=false;d=d.trim();for(i=0;i<f.length;i++)if(f[i].trim()==d){e=true;break}return e};h=function(){$(this);$().stopTime("suggTagRefresh");$().oneTime(400,"suggTagRefresh",function(){w()})};var w=function(){var f=c.val();g.find(".tag").each(function(){var d=$(this),e=d.text();s(f,e)?d.addClass("tagUsed"):
|
||||||
|
d.removeClass("tagUsed")})};$(this).bind("focus",function(){b=$("#__tagInputDiv");if(b.size()<=0){b=$("<div id='__tagInputDiv' class='tagInputDiv' style='width:"+c.get(0).clientWidth+";display:none; '></div>");c.after(b);b.css({left:c.position().left})}a.autoStart&&v(c,b)}).bind("blur",function(){b=$("#__tagInputDiv");c.val(t(c.val()));b.fadeOut(200,function(){b.remove()})}).bind("keydown",function(f){var d=b.find("div.tagInputLine"),e=d.index(b.find("div.tagInputSel")),j=true;switch(f.which){case 38:e=
|
||||||
|
e<1?0:e-1;l(d.eq(e),true);break;case 40:e=e<d.size()-1?e+1:d.size()-1;l(d.eq(e),false);break;case 9:case 13:if(b.is(":visible")){f=d.eq(e);m(f);j=false}break;case 27:b.fadeOut(200);break;default:$(document).stopTime("tagInputRefresh");$(document).oneTime(400,"tagInputRefresh",function(){v()});break}return j});a.suggestedTags&&$(this).bind("keyup",h)});return this};
|
||||||
|
jQuery.fn.extend({everyTime:function(a,c,b,g,h){return this.each(function(){jQuery.timer.add(this,a,c,b,g,h)})},oneTime:function(a,c,b){return this.each(function(){jQuery.timer.add(this,a,c,b,1)})},stopTime:function(a,c){return this.each(function(){jQuery.timer.remove(this,a,c)})}});
|
||||||
|
jQuery.extend({timer:{guid:1,global:{},regex:/^([0-9]+)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1E3,das:1E4,hs:1E5,ks:1E6},timeParse:function(a){if(a==undefined||a==null)return null;var c=this.regex.exec(jQuery.trim(a.toString()));return c[2]?parseInt(c[1],10)*(this.powers[c[2]]||1):a},add:function(a,c,b,g,h,k){var l=0;if(jQuery.isFunction(b)){h||(h=g);g=b;b=c}c=jQuery.timer.timeParse(c);if(!(typeof c!="number"||isNaN(c)||c<=0)){if(h&&h.constructor!=Number){k=!!h;h=0}h=h||0;k=k||false;if(!a.$timers)a.$timers=
|
||||||
|
{};a.$timers[b]||(a.$timers[b]={});g.$timerID=g.$timerID||this.guid++;var m=function(){if(!(k&&this.inProgress)){this.inProgress=true;if(++l>h&&h!==0||g.call(a,l)===false)jQuery.timer.remove(a,b,g);this.inProgress=false}};m.$timerID=g.$timerID;a.$timers[b][g.$timerID]||(a.$timers[b][g.$timerID]=window.setInterval(m,c));this.global[b]||(this.global[b]=[]);this.global[b].push(a)}},remove:function(a,c,b){var g=a.$timers,h;if(g){if(c){if(g[c]){if(b){if(b.$timerID){window.clearInterval(g[c][b.$timerID]);
|
||||||
|
delete g[c][b.$timerID]}}else for(b in g[c]){window.clearInterval(g[c][b]);delete g[c][b]}for(h in g[c])break;if(!h){h=null;delete g[c]}}}else for(c in g)this.remove(a,c,b);for(h in g)break;if(!h)a.$timers=null}}}});jQuery.browser.msie&&jQuery(window).one("unload",function(){var a=jQuery.timer.global;for(var c in a)for(var b=a[c],g=b.length;--g;)jQuery.timer.remove(b[g],c)});
|
|
@ -0,0 +1,21 @@
|
||||||
|
/*
|
||||||
|
* TipTip
|
||||||
|
* Copyright 2010 Drew Wilson
|
||||||
|
* www.drewwilson.com
|
||||||
|
* code.drewwilson.com/entry/tiptip-jquery-plugin
|
||||||
|
*
|
||||||
|
* Version 1.3 - Updated: Mar. 23, 2010
|
||||||
|
*
|
||||||
|
* This Plug-In will create a custom tooltip to replace the default
|
||||||
|
* browser tooltip. It is extremely lightweight and very smart in
|
||||||
|
* that it detects the edges of the browser window and will make sure
|
||||||
|
* the tooltip stays within the current window size. As a result the
|
||||||
|
* tooltip will adjust itself to be displayed above, below, to the left
|
||||||
|
* or to the right depending on what is necessary to stay within the
|
||||||
|
* browser window. It is completely customizable as well via CSS.
|
||||||
|
*
|
||||||
|
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
|
||||||
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
* http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*!
|
||||||
|
* jQuery UI 1.8
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||||
|
* and GPL (GPL-LICENSE.txt) licenses.
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI
|
||||||
|
*/
/*
|
||||||
|
* jQuery UI 1.8
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||||
|
* and GPL (GPL-LICENSE.txt) licenses.
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI
|
||||||
|
*/
|
||||||
|
jQuery.ui||(function(a){a.ui={version:"1.8",plugin:{add:function(c,d,f){var e=a.ui[c].prototype;for(var b in f){e.plugins[b]=e.plugins[b]||[];e.plugins[b].push([d,f[b]])}},call:function(b,d,c){var f=b.plugins[d];if(!f||!b.element[0].parentNode){return}for(var e=0;e<f.length;e++){if(b.options[f[e][0]]){f[e][1].apply(b.element,c)}}}},contains:function(d,c){return document.compareDocumentPosition?d.compareDocumentPosition(c)&16:d!==c&&d.contains(c)},hasScroll:function(e,c){if(a(e).css("overflow")=="hidden"){return false}var b=(c&&c=="left")?"scrollLeft":"scrollTop",d=false;if(e[b]>0){return true}e[b]=1;d=(e[b]>0);e[b]=0;return d},isOverAxis:function(c,b,d){return(c>b)&&(c<(b+d))},isOver:function(g,c,f,e,b,d){return a.ui.isOverAxis(g,f,b)&&a.ui.isOverAxis(c,e,d)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return typeof b==="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus();(c&&c.call(d))},b)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var b;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){b=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{b=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!b.length?a(document):b},zIndex:function(e){if(e!==undefined){return this.css("zIndex",e)}if(this.length){var c=a(this[0]),b,d;while(c.length&&c[0]!==document){b=c.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){d=parseInt(c.css("zIndex"));if(!isNaN(d)&&d!=0){return d}}c=c.parent()}}return 0}});a.extend(a.expr[":"],{data:function(d,c,b){return !!a.data(d,b[3])},focusable:function(c){var d=c.nodeName.toLowerCase(),b=a.attr(c,"tabindex");return(/input|select|textarea|button|object/.test(d)?!c.disabled:"a"==d||"area"==d?c.href||!isNaN(b):!isNaN(b))&&!a(c)["area"==d?"parents":"closest"](":hidden").length},tabbable:function(c){var b=a.attr(c,"tabindex");return(isNaN(b)||b>=0)&&a(c).is(":focusable")}})})(jQuery);
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*!
|
||||||
|
* jQuery UI Widget 1.8
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||||
|
* and GPL (GPL-LICENSE.txt) licenses.
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Widget
|
||||||
|
*/
/*
|
||||||
|
* jQuery UI Widget 1.8
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||||
|
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||||
|
* and GPL (GPL-LICENSE.txt) licenses.
|
||||||
|
*
|
||||||
|
* http://docs.jquery.com/UI/Widget
|
||||||
|
*/
|
||||||
|
(function(b){var a=b.fn.remove;b.fn.remove=function(c,d){return this.each(function(){if(!d){if(!c||b.filter(c,[this]).length){b("*",this).add(this).each(function(){b(this).triggerHandler("remove")})}}return a.call(b(this),c,d)})};b.widget=function(d,f,c){var e=d.split(".")[0],h;d=d.split(".")[1];h=e+"-"+d;if(!c){c=f;f=b.Widget}b.expr[":"][h]=function(i){return !!b.data(i,d)};b[e]=b[e]||{};b[e][d]=function(i,j){if(arguments.length){this._createWidget(i,j)}};var g=new f();g.options=b.extend({},g.options);b[e][d].prototype=b.extend(true,g,{namespace:e,widgetName:d,widgetEventPrefix:b[e][d].prototype.widgetEventPrefix||d,widgetBaseClass:h},c);b.widget.bridge(d,b[e][d])};b.widget.bridge=function(d,c){b.fn[d]=function(g){var e=typeof g==="string",f=Array.prototype.slice.call(arguments,1),h=this;g=!e&&f.length?b.extend.apply(null,[true,g].concat(f)):g;if(e&&g.substring(0,1)==="_"){return h}if(e){this.each(function(){var i=b.data(this,d),j=i&&b.isFunction(i[g])?i[g].apply(i,f):i;if(j!==i&&j!==undefined){h=j;return false}})}else{this.each(function(){var i=b.data(this,d);if(i){if(g){i.option(g)}i._init()}else{b.data(this,d,new c(g,this))}})}return h}};b.Widget=function(c,d){if(arguments.length){this._createWidget(c,d)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(d,e){this.element=b(e).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(e)[this.widgetName],d);var c=this;this.element.bind("remove."+this.widgetName,function(){c.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled")},widget:function(){return this.element},option:function(e,f){var d=e,c=this;if(arguments.length===0){return b.extend({},c.options)}if(typeof e==="string"){if(f===undefined){return this.options[e]}d={};d[e]=f}b.each(d,function(g,h){c._setOption(g,h)});return c},_setOption:function(c,d){this.options[c]=d;if(c==="disabled"){this.widget()[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",d)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(d,e,f){var h=this.options[d];e=b.Event(e);e.type=(d===this.widgetEventPrefix?d:this.widgetEventPrefix+d).toLowerCase();f=f||{};if(e.originalEvent){for(var c=b.event.props.length,g;c;){g=b.event.props[--c];e[g]=e.originalEvent[g]}}this.element.trigger(e,f);return !(b.isFunction(h)&&h.call(this.element[0],e,f)===false||e.isDefaultPrevented())}}})(jQuery);
|
|
@ -0,0 +1,158 @@
|
||||||
|
/* KindEditor 4.0 beta (2011-08-17), Copyright (C) kindsoft.net, Licence: http://www.kindsoft.net/license.php */(function(A,m){function ca(a){if(!a)return!1;return Object.prototype.toString.call(a)==="[object Array]"}function Ua(a){if(!a)return!1;return Object.prototype.toString.call(a)==="[object Function]"}function I(a,b){for(var c=0,d=b.length;c<d;c++)if(a===b[c])return c;return-1}function k(a,b){if(ca(a))for(var c=0,d=a.length;c<d;c++){if(b.call(a[c],c,a[c])===!1)break}else for(c in a)if(a.hasOwnProperty(c)&&b.call(a[c],c,a[c])===!1)break}function B(a){return a.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,
|
||||||
|
"")}function la(a,b,c){c=c===m?",":c;return(c+b+c).indexOf(c+a+c)>=0}function s(a){return a&&/^\d+$/.test(a)?a+"px":a}function w(a){var b;return a&&(b=/(\d+)/.exec(a))?parseInt(b[1],10):0}function Va(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function da(a){var b=a.split("-"),a="";k(b,function(b,d){a+=b>0?d.charAt(0).toUpperCase()+d.substr(1):d});return a}function ma(a){function b(a){a=parseInt(a,10).toString(16).toUpperCase();return a.length>
|
||||||
|
1?a:"0"+a}return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(a,d,e,g){return"#"+b(d)+b(e)+b(g)})}function v(a,b){var b=b===m?",":b,c={},d=ca(a)?a:a.split(b),e;k(d,function(a,b){if(e=/^(\d+)\.\.(\d+)$/.exec(b))for(var d=parseInt(e[1],10);d<=parseInt(e[2],10);d++)c[d.toString()]=!0;else c[b]=!0});return c}function Aa(a,b){return Array.prototype.slice.call(a,b||0)}function o(a,b){return a===m?b:a}function C(a,b,c){c||(c=b,b=null);var d;if(b){var e=function(){};e.prototype=b.prototype;
|
||||||
|
d=new e;k(c,function(a,b){d[a]=b})}else d=c;d.constructor=a;a.prototype=d;a.parent=b?b.prototype:null}function Wa(a){var b;if(b=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(a))a=b[0];b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;b.lastIndex=0;b.test(a)&&(a=a.replace(b,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||||
|
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+a+")");throw"JSON parse error";}function Hb(a,b,c){a.addEventListener?a.addEventListener(b,c,Xa):a.attachEvent&&a.attachEvent("on"+b,c)}function na(a,b,c){a.removeEventListener?a.removeEventListener(b,c,Xa):a.detachEvent&&a.detachEvent("on"+b,c)}function Ya(a,b){this.init(a,b)}function Za(a){try{delete a[W]}catch(b){a.removeAttribute&&a.removeAttribute(W)}}function X(a,b,c){if(b.indexOf(",")>=0)k(b.split(","),function(){X(a,this,c)});else{var d=
|
||||||
|
a[W]||null;d||(a[W]=++$a,d=$a);t[d]===m&&(t[d]={});var e=t[d][b];e&&e.length>0?na(a,b,e[0]):(t[d][b]=[],t[d].el=a);e=t[d][b];e.length===0&&(e[0]=function(b){var c=b?new Ya(a,b):m;k(e,function(b,d){b>0&&d&&d.call(a,c)})});I(c,e)<0&&e.push(c);Hb(a,b,e[0])}}function M(a,b,c){if(b&&b.indexOf(",")>=0)k(b.split(","),function(){M(a,this,c)});else{var d=a[W]||null;if(d)if(b===m)d in t&&(k(t[d],function(b,c){b!="el"&&c.length>0&&na(a,b,c[0])}),delete t[d],Za(a));else if(t[d]){var e=t[d][b];if(e&&e.length>
|
||||||
|
0){c===m?(na(a,b,e[0]),delete t[d][b]):(k(e,function(a,b){a>0&&b===c&&e.splice(a,1)}),e.length==1&&(na(a,b,e[0]),delete t[d][b]));var g=0;k(t[d],function(){g++});g<2&&(delete t[d],Za(a))}}}}function ab(a,b){if(b.indexOf(",")>=0)k(b.split(","),function(){ab(a,this)});else{var c=a[W]||null;if(c){var d=t[c][b];if(t[c]&&d&&d.length>0)d[0]()}}}function Ba(a,b,c){b=/^\d{2,}$/.test(b)?b:b.toUpperCase().charCodeAt(0);X(a,"keydown",function(d){d.ctrlKey&&d.which==b&&!d.shiftKey&&!d.altKey&&(c.call(a),d.stop())})}
|
||||||
|
function oa(a){for(var b={},c=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g,d;d=c.exec(a);){var e=B(d[1].toLowerCase());d=B(ma(d[2]));b[e]=d}return b}function N(a){for(var b={},c=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,d;d=c.exec(a);){var e=(d[1]||d[2]||d[4]||d[6]).toLowerCase();b[e]=(d[2]?d[3]:d[4]?d[5]:d[7])||""}return b}function Ib(a,b){return a=/\s+class\s*=/.test(a)?a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(a,d,e,
|
||||||
|
g){return(" "+e+" ").indexOf(" "+b+" ")<0?e===""?d+b+g:d+e+" "+b+g:a}):a.substr(0,a.length-1)+' class="'+b+'">'}function Jb(a){var b="";k(oa(a),function(a,d){b+=a+":"+d+";"});return b}function bb(a,b,c,d){function e(a){for(var a=a.split("/"),b=[],c=0,d=a.length;c<d;c++){var e=a[c];e==".."?b.length>0&&b.pop():e!==""&&e!="."&&b.push(e)}return"/"+b.join("/")}function g(b,c){if(a.substr(0,b.length)===b){for(var e=[],f=0;f<c;f++)e.push("..");f=".";e.length>0&&(f+="/"+e.join("/"));d=="/"&&(f+="/");return f+
|
||||||
|
a.substr(b.length)}else if(h=/^(.*)\//.exec(b))return g(h[1],++c)}b=o(b,"").toLowerCase();if(I(b,["absolute","relative","domain"])<0)return a;c=c||location.protocol+"//"+location.host;if(d===m)var f=location.pathname.match(/^(\/.*)\//),d=f?f[1]:"";var h;if(h=/^(\w+:\/\/[^\/]*)/.exec(a)){if(h[1]!==c)return a}else if(/^\w+:/.test(a))return a;/^\//.test(a)?a=c+e(a.substr(1)):/^\w+:\/\//.test(a)||(a=c+e(d+"/"+a));b==="relative"?a=g(c+d,0).substr(2):b==="absolute"&&a.substr(0,c.length)===c&&(a=a.substr(c.length));
|
||||||
|
return a}function Y(a,b,c,d,e){var c=c||"",d=o(d,!1),e=o(e,"\t"),f="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,b,c,d){return b+c.replace(/<(?:br|br\s[^>]*)>/ig,"\n")+d}),a=a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig,"</p>"),a=a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig,function(a,b,c){return b+" "+c}),a=a.replace(/\u200B/g,""),i={};b&&k(b,function(a,b){for(var c=a.split(","),d=0,e=c.length;d<e;d++)i[c[d]]=
|
||||||
|
v(b)});var h=[],a=a.replace(/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g,function(a,l,p,q,J,m,D){var l=l||"",p=p||"",r=q.toLowerCase(),n=J||"",q=m?" "+m:"",D=D||"";if(b&&!i[r])return"";q===""&&cb[r]&&(q=" /");db[r]&&(l&&(l=" "),D&&(D=" "));Ca[r]&&(p?D="\n":l="\n");d&&r=="br"&&(D="\n");if(eb[r]&&!Ca[r])if(d){p&&h.length>0&&h[h.length-1]===r?h.pop():h.push(r);D=l="\n";J=0;for(m=p?h.length:h.length-1;J<m;J++)l+=
|
||||||
|
e,p||(D+=e);q?h.pop():p||(D+=e)}else l=D="";if(n!==""){var u=N(a);if(r==="font"){var K={},E="";k(u,function(a,b){if(a==="color")K.color=b,delete u[a];a==="size"&&(K["font-size"]=f[parseInt(b,10)-1]||"",delete u[a]);a==="face"&&(K["font-family"]=b,delete u[a]);a==="style"&&(E=b)});E&&!/;$/.test(E)&&(E+=";");k(K,function(a,b){b!==""&&(/\s/.test(b)&&(b="'"+b+"'"),E+=a+":"+b+";")});u.style=E}k(u,function(a,d){Kb[a]&&(u[a]=a);I(a,["src","href"])>=0&&(u[a]=bb(d,c));(b&&a!=="style"&&!i[r]["*"]&&!i[r][a]||
|
||||||
|
r==="body"&&a==="contenteditable"||/^kindeditor_\d+$/.test(a))&&delete u[a];if(a==="style"&&d!==""){var e=oa(d);k(e,function(a){b&&!i[r].style&&!i[r]["."+a]&&delete e[a]});var f="";k(e,function(a,b){f+=a+":"+b+";"});u.style=f}});n="";k(u,function(a,b){a==="style"&&b===""||(n+=" "+a+'="'+b+'"')})}r==="font"&&(r="span");return l+"<"+p+r+n+q+">"+D}),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,b,c,d){return b+c.replace(/\n/g,'<span id="__kindeditor_pre_newline__">\n')+d}),a=a.replace(/\n\s*\n/g,
|
||||||
|
"\n"),a=a.replace(/<span id="__kindeditor_pre_newline__">\n/g,"\n");return B(a)}function fb(a){if(/\.(rm|rmvb)(\?|$)/i.test(a))return"audio/x-pn-realaudio-plugin";if(/\.(swf|flv)(\?|$)/i.test(a))return"application/x-shockwave-flash";return"video/x-ms-asf-plugin"}function gb(a){return N(unescape(a))}function Da(a){var b="<embed ";k(a,function(a,d){b+=a+'="'+d+'" '});b+="/>";return b}function hb(a,b){var c=b.width,d=b.height,e=b.type||fb(b.src),f=Da(b),i="";c>0&&(i+="width:"+c+"px;");d>0&&(i+="height:"+
|
||||||
|
d+"px;");c=/realaudio/i.test(e)?"ke-rm":/flash/i.test(e)?"ke-flash":"ke-media";c='<img class="'+c+'" src="'+a+'" ';i!==""&&(c+='style="'+i+'" ');c+='data-ke-tag="'+escape(f)+'" alt="" />';return c}function pa(a,b){if(a.nodeType==9&&b.nodeType!=9)return!0;for(;b=b.parentNode;)if(b==a)return!0;return!1}function qa(a,b){var b=b.toLowerCase(),c=null;if(n&&F<8){var d=a.ownerDocument.createElement("div");d.appendChild(a.cloneNode(!1));d=N(d.innerHTML.toLowerCase());b in d&&(c=d[b])}else c=a.getAttribute(b,
|
||||||
|
2);b==="style"&&c!==null&&(c=Jb(c));return c}function ra(a,b){function c(a){if(typeof a!="string")return a;return a.replace(/([^\w\-])/g,"\\$1")}function d(a,b){return a==="*"||a.toLowerCase()===c(b.toLowerCase())}function e(a,b,c){var e=[];(a=(c.ownerDocument||c).getElementById(a.replace(/\\/g,"")))&&d(b,a.nodeName)&&pa(c,a)&&e.push(a);return e}function f(a,b,c){var e=c.ownerDocument||c,h=[],g,j,i;if(c.getElementsByClassName){e=c.getElementsByClassName(a.replace(/\\/g,""));g=0;for(j=e.length;g<j;g++)i=
|
||||||
|
e[g],d(b,i.nodeName)&&h.push(i)}else if(e.querySelectorAll){e=e.querySelectorAll((c.nodeName!=="#document"?c.nodeName+" ":"")+b+"."+a);g=0;for(j=e.length;g<j;g++)i=e[g],pa(c,i)&&h.push(i)}else{e=c.getElementsByTagName(b);a=" "+a+" ";g=0;for(j=e.length;g<j;g++)if(i=e[g],i.nodeType==1)(b=i.className)&&(" "+b+" ").indexOf(a)>-1&&h.push(i)}return h}function i(a,b,d,e){for(var f=[],d=e.getElementsByTagName(d),g=0,h=d.length;g<h;g++)e=d[g],e.nodeType==1&&(b===null?qa(e,a)!==null&&f.push(e):b===c(qa(e,a))&&
|
||||||
|
f.push(e));return f}function h(a,b){var c=[],h,j=(h=/^((?:\\.|[^.#\s\[<>])+)/.exec(a))?h[1]:"*";if(h=/#((?:[\w\-]|\\.)+)$/.exec(a))c=e(h[1],j,b);else if(h=/\.((?:[\w\-]|\\.)+)$/.exec(a))c=f(h[1],j,b);else if(h=/\[((?:[\w\-]|\\.)+)\]/.exec(a))c=i(h[1].toLowerCase(),null,j,b);else if(h=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(a)){c=h[1].toLowerCase();h=h[2];if(c==="id")j=e(h,j,b);else if(c==="class")j=f(h,j,b);else if(c==="name"){c=[];h=(b.ownerDocument||b).getElementsByName(h.replace(/\\/g,
|
||||||
|
""));for(var l,q=0,p=h.length;q<p;q++)l=h[q],d(j,l.nodeName)&&pa(b,l)&&l.getAttributeNode("name")&&c.push(l);j=c}else j=i(c,h,j,b);c=j}else{j=b.getElementsByTagName(j);l=0;for(q=j.length;l<q;l++)h=j[l],h.nodeType==1&&c.push(h)}return c}var j=a.split(",");if(j.length>1){var l=[];k(j,function(){k(ra(this,b),function(){I(this,l)<0&&l.push(this)})});return l}for(var b=b||document,j=[],p,q=/((?:\\.|[^\s>])+|[\s>])/g;p=q.exec(a);)p[1]!==" "&&j.push(p[1]);p=[];if(j.length==1)return h(j[0],b);var q=!1,J,
|
||||||
|
m,n,r,o,u,K,E,s,t;u=0;for(lenth=j.length;u<lenth;u++)if(J=j[u],J===">")q=!0;else{if(u>0){m=[];K=0;for(s=p.length;K<s;K++){r=p[K];n=h(J,r);E=0;for(t=n.length;E<t;E++)o=n[E],q?r===o.parentNode&&m.push(o):m.push(o)}p=m}else p=h(J,b);if(p.length===0)return[]}return p}function ea(a){if(!a)return document;return a.ownerDocument||a.document||a}function R(a){if(!a)return A;a=ea(a);return a.parentWindow||a.defaultView}function Ea(a,b,c){n&&F<8&&b.toLowerCase()=="class"&&(b="className");a.setAttribute(b,""+
|
||||||
|
c)}function Fa(a){if(!a||!a.nodeName)return"";return a.nodeName.toLowerCase()}function Lb(a,b){var c=R(a),d=da(b),e="";c.getComputedStyle?(c=c.getComputedStyle(a,null),e=c[d]||c.getPropertyValue(b)||a.style[d]):a.currentStyle&&(e=a.currentStyle[d]||a.style[d]);return e}function G(a){a=a||document;return Z?a.body:a.documentElement}function fa(a){var a=a||document,b;n||Ga?(b=G(a).scrollLeft,a=G(a).scrollTop):(b=R(a).scrollX,a=R(a).scrollY);return{x:b,y:a}}function H(a){this.init(a)}function ib(a){a.collapsed=
|
||||||
|
a.startContainer===a.endContainer&&a.startOffset===a.endOffset;return a}function Ha(a,b,c){function d(d,e,f){var j=d.nodeValue.length,g;b&&(g=d.cloneNode(!0),g=e>0?g.splitText(e):g,f<j&&g.splitText(f-e));if(c){var i=d;e>0&&(i=d.splitText(e),a.setStart(d,e));f<j&&(d=i.splitText(f-e),a.setEnd(d,0));h.push(i)}return g}function e(){c&&a.up().collapse(!0);for(var b=0,d=h.length;b<d;b++){var e=h[b];e.parentNode&&e.parentNode.removeChild(e)}}function f(e,m){for(var n=e.firstChild,o;n;){o=(new S(i)).selectNode(n);
|
||||||
|
l<=0&&(l=o.compareBoundaryPoints(ga,a));l>=0&&p<=0&&(p=o.compareBoundaryPoints(ha,a));p>=0&&q<=0&&(q=o.compareBoundaryPoints($,a));q>=0&&k<=0&&(k=o.compareBoundaryPoints(ia,a));if(k>=0)return!1;o=n.nextSibling;if(l>0)if(n.nodeType==1)if(p>=0&&q<=0)b&&m.appendChild(n.cloneNode(!0)),c&&h.push(n);else{var r;b&&(r=n.cloneNode(!1),m.appendChild(r));if(f(n,r)===!1)return!1}else if(n.nodeType==3&&(n=n==j.startContainer?d(n,j.startOffset,n.nodeValue.length):n==j.endContainer?d(n,0,j.endOffset):d(n,0,n.nodeValue.length),
|
||||||
|
b))try{m.appendChild(n)}catch(D){}n=o}}var i=a.doc,h=[],j=a.cloneRange().down(),l=-1,p=-1,q=-1,k=-1,m=a.commonAncestor(),n=i.createDocumentFragment();if(m.nodeType==3)return m=d(m,a.startOffset,a.endOffset),b&&n.appendChild(m),e(),b?n:a;f(m,n);c&&a.up().collapse(!0);for(var m=0,r=h.length;m<r;m++){var o=h[m];o.parentNode&&o.parentNode.removeChild(o)}return b?n:a}function ja(a,b){for(var c=b;c;){var d=f(c);if(d.name=="marquee"||d.name=="select")return;c=c.parentNode}try{a.moveToElementText(b)}catch(e){}}
|
||||||
|
function jb(a,b){var c=a.parentElement().ownerDocument,d=a.duplicate();d.collapse(b);var e=d.parentElement(),g=e.childNodes;if(g.length===0)return{node:e.parentNode,offset:f(e).index()};var i=c,h=0,j=-1,l=a.duplicate();ja(l,e);for(var p=0,q=g.length;p<q;p++){var k=g[p],j=l.compareEndPoints("StartToStart",d);if(j===0)return{node:k.parentNode,offset:p};if(k.nodeType==1){var n=a.duplicate(),m,o=f(k);o.isControl()&&(m=c.createElement("span"),o.after(m),k=m,h+=o.text().replace(/\r\n|\n|\r/g,"").length);
|
||||||
|
ja(n,k);l.setEndPoint("StartToEnd",n);j>0?h+=n.text.replace(/\r\n|\n|\r/g,"").length:h=0;m&&f(m).remove()}else k.nodeType==3&&(l.moveStart("character",k.nodeValue.length),h+=k.nodeValue.length);j<0&&(i=k)}if(j<0&&i.nodeType==1)return{node:e,offset:f(e.lastChild).index()+1};if(j>0)for(;i.nodeType==1;)i=i.nextSibling;l=a.duplicate();ja(l,e);l.setEndPoint("StartToEnd",d);h-=l.text.replace(/\r\n|\n|\r/g,"").length;return{node:i,offset:h}}function kb(a,b){var c=a.ownerDocument||a,d=c.body.createTextRange();
|
||||||
|
if(c==a)return d.collapse(!0),d;if(a.nodeType==1&&a.childNodes.length>0){var e=a.childNodes,g;b===0?(g=e[0],e=!0):(g=e[b-1],e=!1);if(!g)return d;if(f(g).name==="head")return b===1&&(e=!0),b===2&&(e=!1),d.collapse(e),d;if(g.nodeType==1){var i=f(g),h;i.isControl()&&(h=c.createElement("span"),e?i.before(h):i.after(h),g=h);ja(d,g);d.collapse(e);h&&f(h).remove();return d}a=g;b=e?0:g.nodeValue.length}c=c.createElement("span");f(a).before(c);ja(d,c);d.moveStart("character",b);f(c).remove();return d}function Mb(a){function b(a){if(f(a.node).name==
|
||||||
|
"tr")a.node=a.node.cells[a.offset],a.offset=0}var c;if(n){if(a.item)return c=ea(a.item(0)),c=new S(c),c.selectNode(a.item(0)),c;c=a.parentElement().ownerDocument;var d=jb(a,!0),a=jb(a,!1);b(d);b(a);c=new S(c);c.setStart(d.node,d.offset);c.setEnd(a.node,a.offset);return c}d=a.startContainer;c=d.ownerDocument||d;c=new S(c);c.setStart(d,a.startOffset);c.setEnd(a.endContainer,a.endOffset);return c}function S(a){this.init(a)}function Ia(a){if(!a.nodeName)return a.get?a:Mb(a);return new S(a)}function T(a,
|
||||||
|
b,c){try{a.execCommand(b,!1,c)}catch(d){}}function lb(a,b){var c="";try{c=a.queryCommandValue(b)}catch(d){}typeof c!=="string"&&(c="");return c}function Ja(a){var b=R(a);return a.selection||b.getSelection()}function mb(a){var b={},c,d;k(a,function(a,f){c=a.split(",");for(var i=0,h=c.length;i<h;i++)d=c[i],b[d]=f});return b}function sa(a,b){return nb(a,b,"*")||nb(a,b)}function nb(a,b,c){c=c||a.name;if(a.type!==1)return!1;b=mb(b);if(!b[c])return!1;for(var c=b[c].split(","),b=0,d=c.length;b<d;b++){var e=
|
||||||
|
c[b];if(e==="*")return!0;var f=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(e),i=f[1]?"css":"attr",e=f[2],f=f[3]||"";if(f===""&&a[i](e)!=="")return!0;if(f!==""&&a[i](e)===f)return!0}return!1}function Ka(a,b){ob(a,b,"*");ob(a,b)}function ob(a,b,c){c=c||a.name;if(a.type===1&&(b=mb(b),b[c])){for(var c=b[c].split(","),b=!1,d=0,e=c.length;d<e;d++){var f=c[d];if(f==="*"){b=!0;break}var i=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(f),f=i[2];i[1]?(f=da(f),a[0].style[f]&&(a[0].style[f]="")):a.removeAttr(f)}b&&a.remove(!0)}}
|
||||||
|
function aa(a){for(;a.first();)a=a.first();return a}function Nb(a,b,c){k(b,function(b,c){b!=="style"&&a.attr(b,c)});k(c,function(b,c){a.css(b,c)})}function pb(a){for(;a&&a.name!="body";){if(Ca[a.name]||a.name=="div"&&a.hasClass("ke-script"))return!0;a=a.parent()}return!1}function ta(a){this.init(a)}function qb(a){a.nodeName&&(a=ea(a),a=Ia(a).selectNodeContents(a.body).collapse(!1));return new ta(a)}function La(a){var b=a.moveEl,c=a.moveFn,d=a.clickEl||b,e=a.beforeDrag,g=[document],i=[{x:0,y:0}],h=
|
||||||
|
[];(a.iframeFix===m||a.iframeFix)&&f("iframe").each(function(){try{g.push(Ma(this))}catch(a){}i.push(f(this).pos())});d.mousedown(function(a){var l=d.get(),p=w(b.css("left")),q=w(b.css("top")),m=b.width(),n=b.height(),o=a.pageX,r=a.pageY,s=!0;e&&e();k(g,function(a,b){function e(b){if(s){var f=O(i[a].x+b.pageX-o),h=O(i[a].y+b.pageY-r);c.call(d,p,q,m,n,f,h)}b.stop()}function j(a){a.stop()}function g(a){s=!1;l.releaseCapture&&l.releaseCapture();k(h,function(){f(this.doc).unbind("mousemove",this.move).unbind("mouseup",
|
||||||
|
this.up).unbind("selectstart",this.select)});a.stop()}f(b).mousemove(e).mouseup(g).bind("selectstart",j);h.push({doc:b,move:e,up:g,select:j})});l.setCapture&&l.setCapture();a.stop()})}function U(a){this.init(a)}function Na(a){return new U(a)}function Ma(a){a=f(a)[0];return a.contentDocument||a.contentWindow.document}function Ob(a,b,c,d){var e=['<html><head><meta charset="utf-8" /><title>KindEditor</title>',"<style>","html {margin:0;padding:0;}","body {margin:0;padding:5px;}",'body, td {font:12px/1.5 "sans serif",tahoma,verdana,helvetica;}',
|
||||||
|
"body, p, div {word-wrap: break-word;}","p {margin:5px 0;}","table {border-collapse:collapse;}",".ke-zeroborder td {border:1px dotted #AAAAAA;}",".ke-flash {","\tborder:1px solid #AAAAAA;","\tbackground-image:url("+a+"common/flash.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}",".ke-rm {","\tborder:1px solid #AAAAAA;","\tbackground-image:url("+a+"common/rm.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;",
|
||||||
|
"\twidth:100px;","\theight:100px;","}",".ke-media {","\tborder:1px solid #AAAAAA;","\tbackground-image:url("+a+"common/media.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}",".ke-script {","\tdisplay:none;","\tfont-size:0;","\twidth:0;","\theight:0;","}",".ke-pagebreak {","\tborder:1px dotted #AAAAAA;","\tfont-size:0;","\theight:2px;","}","</style>"];ca(c)||(c=[c]);k(c,function(a,b){b&&e.push('<link href="'+b+'" rel="stylesheet" />')});
|
||||||
|
d&&e.push("<style>"+d+"</style>");e.push("</head><body "+(b?'class="'+b+'"':"")+"></body></html>");return e.join("\n")}function ba(a,b){return a.hasVal()?a.val(b):a.html(b)}function ua(a){this.init(a)}function rb(a){return new ua(a)}function sb(a,b){var c=this.get(a);c&&!c.hasClass("ke-disabled")&&b(c)}function Oa(a){this.init(a)}function tb(a){return new Oa(a)}function va(a){this.init(a)}function Pa(a){return new va(a)}function wa(a){this.init(a)}function ub(a){return new wa(a)}function vb(a){this.init(a)}
|
||||||
|
function xa(a){this.init(a)}function wb(a){return new xa(a)}function Qa(a,b){var c=document.getElementsByTagName("head")[0]||(Z?document.body:document.documentElement),d=document.createElement("script");c.appendChild(d);d.src=a;d.charset="utf-8";d.onload=d.onreadystatechange=function(){if(!this.readyState||this.readyState==="loaded")b&&b(),d.onload=d.onreadystatechange=null,c.removeChild(d)}}function xb(a,b){ka[a]=b}function yb(a){var b,c="core";if(b=/^(\w+)\.(\w+)$/.exec(a))c=b[1],a=b[2];return{ns:c,
|
||||||
|
key:a}}function zb(a,b){b=b===m?P.langType:b;if(typeof a==="string"){if(!L[b])return"no language";var c=a.length-1;if(a.substr(c)===".")return L[b][a.substr(0,c)];c=yb(a);return L[b][c.ns][c.key]}k(a,function(a,c){var f=yb(a);L[b]||(L[b]={});L[b][f.ns]||(L[b][f.ns]={});L[b][f.ns][f.key]=c})}function Pb(){var a=this;f(a.edit.doc).contextmenu(function(b){a.menu&&a.hideMenu();if(a.useContextmenu){if(a._contextmenus.length!==0){var c=0,d=[];for(k(a._contextmenus,function(){if(this.title=="-")d.push(this);
|
||||||
|
else if(this.cond&&this.cond()&&(d.push(this),this.width&&this.width>c))c=this.width});d.length>0&&d[0].title=="-";)d.shift();for(;d.length>0&&d[d.length-1].title=="-";)d.pop();var e=null;k(d,function(a){this.title=="-"&&e.title=="-"&&delete d[a];e=this});if(d.length>0){b.preventDefault();var g=f(a.edit.iframe).pos(),i=Pa({x:g.x+b.clientX,y:g.y+b.clientY,width:c,css:{visibility:"hidden"}});k(d,function(){this.title&&i.addItem(this)});var g=G(i.doc),h=i.div.height();b.clientY+h>=g.clientHeight-100&&
|
||||||
|
i.pos(i.x,w(i.y)-h);i.div.css("visibility","visible");a.menu=i}}}else b.preventDefault()})}function Qb(){var a=this,b=a.edit.doc,c=a.newlineTag;if(!(n&&c!=="br")&&(!Ra||!(F<3&&c!=="p")))Ga||f(b).keydown(function(d){if(!(d.which!=13||d.shiftKey||d.ctrlKey||d.altKey)){a.cmd.selection();var e=f(a.cmd.range.commonAncestor());e.type==3&&(e=e.parent());e=e.name;e=="marquee"||e=="select"||(c==="br"&&I(e,"h1,h2,h3,h4,h5,h6,pre,li".split(","))<0?(d.preventDefault(),a.insertHtml("<br />")):I(e,"p,h1,h2,h3,h4,h5,h6,pre,div,li,blockquote".split(","))<
|
||||||
|
0&&T(b,"formatblock","<P>"))}})}function Rb(){var a=this;f(a.edit.doc).keydown(function(b){b.which==9&&(b.preventDefault(),a.afterTab?a.afterTab.call(a,b):a.insertHtml(" "))})}function Sb(){var a=this;f(a.edit.textarea[0],a.edit.win).focus(function(b){a.afterFocus&&a.afterFocus.call(a,b)}).blur(function(b){a.afterBlur&&a.afterBlur.call(a,b)})}function V(a){return B(a.replace(/<span [^>]*id="__kindeditor_bookmark_\w+_\d+__"[^>]*><\/span>/i,""))}function Ab(a,b){if(a.length===
|
||||||
|
0)a.push(b);else{var c=a[a.length-1];V(b.html)!==V(c.html)&&a.push(b)}}function Bb(a,b){var c=this.edit,d,e;if(a.length===0)return this;c.designMode?(d=this.cmd.range,e=d.createBookmark(!0),e.html=c.html()):e={html:c.html()};Ab(b,e);var f=a.pop();V(e.html)===V(f.html)&&a.length>0&&(f=a.pop());c.designMode?(c.html(f.html),f.start&&(d.moveToBookmark(f),this.select())):c.html(V(f.html));return this}function Sa(a){function b(a,b){Sa.prototype[a]===m&&(c[a]=b);c.options[a]=b}var c=this;c.options={};k(a,
|
||||||
|
function(c){b(c,a[c]);c==="basePath"&&(b("themesPath",a[c]+"themes/"),b("langPath",a[c]+"lang/"),b("pluginsPath",a[c]+"plugins/"))});k(P,function(a,d){c[a]===m&&b(a,d)});var d=f(c.srcElement);c.width||b("width",d.width()||c.minWidth);c.height||b("height",d.height()||c.minHeight);b("width",s(c.width));b("height",s(c.height));if(Cb)c.designMode=!1;c.srcElement=d;c.initContent=ba(d);c.plugin={};c.isCreated=!1;c._handlers={};c._contextmenus=[];c._undoStack=[];c._redoStack=[];c._calledPlugins={};c._firstAddBookmark=
|
||||||
|
!0}if(!A.KindEditor){var z=navigator.userAgent.toLowerCase(),n=z.indexOf("msie")>-1&&z.indexOf("opera")==-1,Ra=z.indexOf("gecko")>-1&&z.indexOf("khtml")==-1,Q=z.indexOf("applewebkit")>-1,Ga=z.indexOf("opera")>-1,Cb=z.indexOf("mobile")>-1,Z=document.compatMode!="CSS1Compat",F=(z=/(?:msie|firefox|webkit|opera)[\/:\s](\d+)/.exec(z))?z[1]:"0",ya=(new Date).getTime(),O=Math.round,f={DEBUG:!1,VERSION:"4.0 beta (2011-08-17)",IE:n,GECKO:Ra,WEBKIT:Q,OPERA:Ga,V:F,TIME:ya,each:k,isArray:ca,isFunction:Ua,inArray:I,
|
||||||
|
inString:la,trim:B,addUnit:s,removeUnit:w,escape:Va,unescape:function(a){return a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")},toCamel:da,toHex:ma,toMap:v,toArray:Aa,undef:o,extend:C,json:Wa},db=v("a,abbr,acronym,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,img,input,ins,kbd,label,map,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),eb=v("address,applet,blockquote,body,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,head,hr,html,iframe,ins,isindex,li,map,menu,meta,noframes,noscript,object,ol,p,pre,script,style,table,tbody,td,tfoot,th,thead,title,tr,ul"),
|
||||||
|
cb=v("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),Db=v("b,basefont,big,del,em,font,i,s,small,span,strike,strong,sub,sup,u"),Tb=v("img,table,input,textarea,button"),Ca=v("pre,style,script"),za=v("html,head,body,td,tr,table,ol,ul,li");v("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");var Kb=v("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),Eb=v("input,button,textarea,select"),P={designMode:!0,fullscreenMode:!1,
|
||||||
|
filterMode:!1,wellFormatMode:!0,shadowMode:!0,basePath:function(){for(var a=document.getElementsByTagName("script"),b,c=0,d=a.length;c<d;c++)if(b=a[c].src||"",/kindeditor[\w\-\.]*\.js/.test(b))return b.substring(0,b.lastIndexOf("/")+1);return""}(),themeType:"default",langType:"zh_CN",urlType:"",newlineTag:"p",resizeType:2,syncType:"form",pasteType:2,dialogAlignType:"page",useContextmenu:!0,bodyClass:"ke-content",indentChar:"\t",cssPath:"",cssData:"",minWidth:650,minHeight:100,minChangeSize:5,items:["source",
|
||||||
|
"|","undo","redo","|","preview","print","template","cut","copy","paste","plainpaste","wordpaste","|","justifyleft","justifycenter","justifyright","justifyfull","insertorderedlist","insertunorderedlist","indent","outdent","subscript","superscript","clearhtml","quickformat","selectall","|","fullscreen","/","formatblock","fontname","fontsize","|","forecolor","hilitecolor","bold","italic","underline","strikethrough","lineheight","removeformat","|","image","flash","media","insertfile","table","hr","emoticons",
|
||||||
|
"map","code","pagebreak","link","unlink","|","about"],noDisableItems:["source","fullscreen"],colorTable:[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100","#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000"]],fontSizeTable:["9px","10px","12px","14px","16px","18px","24px","32px"],htmlTags:{font:["color","size","face",".background-color"],span:[".color",".background-color",
|
||||||
|
".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".line-height"],div:["align",".border",".margin",".padding",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".background",".font-style",".text-decoration",".vertical-align",".margin-left"],table:["border","cellspacing","cellpadding","width","height","align","bordercolor",".padding",".margin",".border","bgcolor",".text-align",".color",".background-color",
|
||||||
|
".font-size",".font-family",".font-weight",".font-style",".text-decoration",".background",".width",".height"],"td,th":["align","valign","width","height","colspan","rowspan","bgcolor",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".vertical-align",".background"],a:["href","target","name"],embed:["src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess"],img:["src","width","height",
|
||||||
|
"border","alt","title",".width",".height"],"p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":["align",".text-align",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".text-indent",".margin-left"],pre:["class"],"hr,br,tbody,tr,strong,b,sub,sup,em,i,u,strike":[]},layout:'<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>'};P.themesPath=P.basePath+"themes/";P.langPath=
|
||||||
|
P.basePath+"lang/";P.pluginsPath=P.basePath+"plugins/";var Xa=!1,Fb=v("8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222"),z=v("33..40"),Ta={};k(Fb,function(a,b){Ta[a]=b});k(z,function(a,b){Ta[a]=b});var Ub="altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,data,detail,eventPhase,fromElement,handler,keyCode,layerX,layerY,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which".split(",");
|
||||||
|
C(Ya,{init:function(a,b){var c=this,d=a.ownerDocument||a.document||a;c.event=b;k(Ub,function(a,d){c[d]=b[d]});if(!c.target)c.target=c.srcElement||d;if(c.target.nodeType===3)c.target=c.target.parentNode;if(!c.relatedTarget&&c.fromElement)c.relatedTarget=c.fromElement===c.target?c.toElement:c.fromElement;if(c.pageX==null&&c.clientX!=null){var e=d.documentElement,d=d.body;c.pageX=c.clientX+(e&&e.scrollLeft||d&&d.scrollLeft||0)-(e&&e.clientLeft||d&&d.clientLeft||0);c.pageY=c.clientY+(e&&e.scrollTop||
|
||||||
|
d&&d.scrollTop||0)-(e&&e.clientTop||d&&d.clientTop||0)}if(!c.which&&(c.charCode||c.charCode===0?c.charCode:c.keyCode))c.which=c.charCode||c.keyCode;if(!c.metaKey&&c.ctrlKey)c.metaKey=c.ctrlKey;if(!c.which&&c.button!==m)c.which=c.button&1?1:c.button&2?3:c.button&4?2:0;switch(c.which){case 186:c.which=59;break;case 187:case 107:case 43:c.which=61;break;case 189:case 45:c.which=109;break;case 42:c.which=106;break;case 47:c.which=111;break;case 78:c.which=110}c.which>=96&&c.which<=105&&(c.which-=48)},
|
||||||
|
preventDefault:function(){var a=this.event;a.preventDefault&&a.preventDefault();a.returnValue=!1},stopPropagation:function(){var a=this.event;a.stopPropagation&&a.stopPropagation();a.cancelBubble=!0},stop:function(){this.preventDefault();this.stopPropagation()}});var W="kindeditor_"+ya,$a=0,t={};n&&A.attachEvent("onunload",function(){k(t,function(a,b){b.el&&M(b.el)})});f.ctrl=Ba;f.ready=function(a){function b(){e||(e=!0,a(KindEditor),document.addEventListener?M(document,"DOMContentLoaded",b):document.attachEvent&&
|
||||||
|
M(document,"readystatechange",d),M(A,"load",b))}function c(){if(!e){try{document.documentElement.doScroll("left")}catch(a){setTimeout(c,0);return}b()}}function d(){document.readyState==="complete"&&b()}var e=!1;document.addEventListener?X(document,"DOMContentLoaded",b):document.attachEvent&&(X(document,"readystatechange",d),document.documentElement.doScroll&&A.frameElement===m&&c());X(A,"load",b)};f.formatUrl=bb;f.formatHtml=Y;f.getCssList=oa;f.getAttrList=N;f.mediaType=fb;f.mediaAttrs=gb;f.mediaEmbed=
|
||||||
|
Da;f.mediaImg=hb;f.query=function(a,b){var c=ra(a,b);return c.length>0?c[0]:null};f.queryAll=ra;C(H,{init:function(a){for(var b=0,c=a.length;b<c;b++)this[b]=a[b].get?a[b][0]:a[b];this.length=a.length;this.doc=ea(this[0]);this.name=Fa(this[0]);this.type=this.length>0?this[0].nodeType:null;this.win=R(this[0]);this._data={}},each:function(a){for(var b=0;b<this.length;b++)if(a.call(this[b],b,this[b])===!1)break;return this},bind:function(a,b){this.each(function(){X(this,a,b)});return this},unbind:function(a,
|
||||||
|
b){this.each(function(){M(this,a,b)});return this},fire:function(a){if(this.length<1)return this;ab(this[0],a);return this},hasAttr:function(a){if(this.length<1)return!1;return!!qa(this[0],a)},attr:function(a,b){var c=this;if(a===m)return N(c.outer());if(typeof a==="object")return k(a,function(a,b){c.attr(a,b)}),c;if(b===m)return b=c.length<1?null:qa(c[0],a),b===null?"":b;c.each(function(){Ea(this,a,b)});return c},removeAttr:function(a){this.each(function(){var b=a;n&&F<8&&b.toLowerCase()=="class"&&
|
||||||
|
(b="className");Ea(this,b,"");this.removeAttribute(b)});return this},get:function(a){if(this.length<1)return null;return this[a||0]},hasClass:function(a){if(this.length<1)return!1;return la(a,this[0].className," ")},addClass:function(a){this.each(function(){if(!la(a,this.className," "))this.className=B(this.className+" "+a)});return this},removeClass:function(a){this.each(function(){if(la(a,this.className," "))this.className=B(this.className.replace(RegExp("(^|\\s)"+a+"(\\s|$)")," "))});return this},
|
||||||
|
html:function(a){if(a===m){if(this.length<1)return"";return Y(this[0].innerHTML)}this.each(function(){if(this.nodeType==1)this.innerHTML=a});return this},text:function(){if(this.length<1)return"";return n?this[0].innerText:this[0].textContent},hasVal:function(){if(this.length<1)return!1;return!!Eb[Fa(this[0])]},val:function(a){if(a===m){if(this.length<1)return"";return this.hasVal()?this[0].value:this.attr("value")}else return this.each(function(){Eb[Fa(this)]?this.value=a:Ea(this,"value",a)}),this},
|
||||||
|
css:function(a,b){var c=this;if(a===m)return oa(c.attr("style"));if(typeof a==="object")return k(a,function(a,b){c.css(a,b)}),c;if(b===m){if(c.length<1)return"";return c[0].style[da(a)]||Lb(c[0],a)||""}c.each(function(){this.style[da(a)]=b});return c},width:function(a){if(a===m){if(this.length<1)return 0;return this[0].offsetWidth}return this.css("width",s(a))},height:function(a){if(a===m){if(this.length<1)return 0;return this[0].offsetHeight}return this.css("height",s(a))},opacity:function(a){this.each(function(){this.style.opacity===
|
||||||
|
m?this.style.filter=a==1?"":"alpha(opacity="+a*100+")":this.style.opacity=a==1?"":a});return this},data:function(a,b){if(b===m)return this._data[a];this._data[a]=b;return this},pos:function(){var a=this[0],b=0,c=0;if(a)if(a.getBoundingClientRect)a=a.getBoundingClientRect(),c=fa(this.doc),b=a.left+c.x,c=a.top+c.y;else for(;a;)b+=a.offsetLeft,c+=a.offsetTop,a=a.offsetParent;return{x:O(b),y:O(c)}},clone:function(a){if(this.length<1)return new H([]);return new H([this[0].cloneNode(a)])},append:function(a){this.each(function(){this.appendChild&&
|
||||||
|
this.appendChild(f(a)[0])});return this},before:function(a){this.each(function(){this.parentNode.insertBefore(f(a)[0],this)});return this},after:function(a){this.each(function(){this.nextSibling?this.parentNode.insertBefore(f(a)[0],this.nextSibling):this.parentNode.appendChild(f(a)[0])});return this},replaceWith:function(a){var b=[];this.each(function(c,d){M(d);var e=f(a)[0];d.parentNode.replaceChild(e,d);b.push(e)});return f(b)},remove:function(a){var b=this;b.each(function(c,d){d.parentNode&&(M(d),
|
||||||
|
a&&(new H(d.childNodes)).each(function(){(new H([d])).after(this)}),d.parentNode.removeChild(d),delete b[c])});b.length=0;b._data={};return b},show:function(a){return this.css("display",a===m?"block":a)},hide:function(){return this.css("display","none")},outer:function(){if(this.length<1)return"";var a=this.doc.createElement("div");a.appendChild(this[0].cloneNode(!0));return Y(a.innerHTML)},isSingle:function(){return!!cb[this.name]},isInline:function(){return!!db[this.name]},isBlock:function(){return!!eb[this.name]},
|
||||||
|
isStyle:function(){return!!Db[this.name]},isControl:function(){return!!Tb[this.name]},contains:function(a){if(this.length<1)return!1;return pa(this[0],f(a)[0])},parent:function(){if(this.length<1)return null;var a=this[0].parentNode;return a?new H([a]):null},children:function(){if(this.length<1)return[];for(var a=[],b=this[0].firstChild;b;)(b.nodeType!=3||B(b.nodeValue)!=="")&&a.push(new H([b])),b=b.nextSibling;return a},first:function(){var a=this.children();return a.length>0?a[0]:null},last:function(){var a=
|
||||||
|
this.children();return a.length>0?a[a.length-1]:null},index:function(){if(this.length<1)return-1;for(var a=-1,b=this[0];b;)a++,b=b.previousSibling;return a},prev:function(){if(this.length<1)return null;var a=this[0].previousSibling;return a?new H([a]):null},next:function(){if(this.length<1)return null;var a=this[0].nextSibling;return a?new H([a]):null},scan:function(a,b){function c(d){for(d=b?d.firstChild:d.lastChild;d;){var e=b?d.nextSibling:d.previousSibling;if(a(d)===!1)return!1;if(c(d)===!1)return!1;
|
||||||
|
d=e}}if(!(this.length<1))return b=b===m?!0:b,c(this[0]),this}});k("blur,focus,focusin,focusout,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error,contextmenu".split(","),function(a,b){H.prototype[b]=function(a){return a?this.bind(b,a):this.fire(b)}});z=f;f=function(a,b){function c(a){a[0]||(a=[]);return new H(a)}if(!(a===m||a===null)){if(typeof a==="string"){b&&(b=f(b)[0]);var d=a.length;a.charAt(0)===
|
||||||
|
"@"&&(a=a.substr(1));if(a.length!==d||/<.+>/.test(a)){var d=(b?b.ownerDocument||b:document).createElement("div"),e=[];if(d.nodeType==1)d.innerHTML=a;for(var g=0,i=d.childNodes.length;g<i;g++)e.push(d.childNodes[g]);return c(e)}return c(ra(a,b))}if(a&&a.get)return a;if(ca(a))return c(a);return c(Aa(arguments))}};k(z,function(a,b){f[a]=b});A.KindEditor=f;var ha=0,ga=1,$=2,ia=3,Gb=0;C(S,{init:function(a){this.startContainer=a;this.startOffset=0;this.endContainer=a;this.endOffset=0;this.collapsed=!0;
|
||||||
|
this.doc=a},commonAncestor:function(){function a(a){for(var b=[];a;)b.push(a),a=a.parentNode;return b}for(var b=a(this.startContainer),c=a(this.endContainer),d=0,e=b.length,f=c.length,i,h;++d;)if(i=b[e-d],h=c[f-d],!i||!h||i!==h)break;return b[e-d+1]},setStart:function(a,b){var c=this.doc;this.startContainer=a;this.startOffset=b;if(this.endContainer===c)this.endContainer=a,this.endOffset=b;return ib(this)},setEnd:function(a,b){var c=this.doc;this.endContainer=a;this.endOffset=b;if(this.startContainer===
|
||||||
|
c)this.startContainer=a,this.startOffset=b;return ib(this)},setStartBefore:function(a){return this.setStart(a.parentNode||this.doc,f(a).index())},setStartAfter:function(a){return this.setStart(a.parentNode||this.doc,f(a).index()+1)},setEndBefore:function(a){return this.setEnd(a.parentNode||this.doc,f(a).index())},setEndAfter:function(a){return this.setEnd(a.parentNode||this.doc,f(a).index()+1)},selectNode:function(a){return this.setStartBefore(a).setEndAfter(a)},selectNodeContents:function(a){var b=
|
||||||
|
f(a);if(b.type==3||b.isSingle())return this.selectNode(a);b=b.children();if(b.length>0)return this.setStartBefore(b[0][0]).setEndAfter(b[b.length-1][0]);return this.setStart(a,0).setEnd(a,0)},collapse:function(a){if(a)return this.setEnd(this.startContainer,this.startOffset);return this.setStart(this.endContainer,this.endOffset)},compareBoundaryPoints:function(a,b){var c=this.get(),d=b.get();if(n){var e={};e[ha]="StartToStart";e[ga]="EndToStart";e[$]="EndToEnd";e[ia]="StartToEnd";c=c.compareEndPoints(e[a],
|
||||||
|
d);if(c!==0)return c;var g,i,h,j;if(a===ha||a===ia)g=this.startContainer,h=this.startOffset;if(a===ga||a===$)g=this.endContainer,h=this.endOffset;if(a===ha||a===ga)i=b.startContainer,j=b.startOffset;if(a===$||a===ia)i=b.endContainer,j=b.endOffset;if(g===i)return g=h-j,g>0?1:g<0?-1:0;for(c=i;c&&c.parentNode!==g;)c=c.parentNode;if(c)return f(c).index()>=h?-1:1;for(c=g;c&&c.parentNode!==i;)c=c.parentNode;if(c)return f(c).index()>=j?1:-1;if((c=f(i).next())&&c.contains(g))return 1;if((c=f(g).next())&&
|
||||||
|
c.contains(i))return-1}else return c.compareBoundaryPoints(a,d)},cloneRange:function(){return(new S(this.doc)).setStart(this.startContainer,this.startOffset).setEnd(this.endContainer,this.endOffset)},toString:function(){var a=this.get();return(n?a.text:a.toString()).replace(/\r\n|\n|\r/g,"")},cloneContents:function(){return Ha(this,!0,!1)},deleteContents:function(){return Ha(this,!1,!0)},extractContents:function(){return Ha(this,!0,!0)},insertNode:function(a){var b=this.startContainer,c=this.startOffset,
|
||||||
|
d=this.endContainer,e=this.endOffset,f,i,h,j=1;if(a.nodeName.toLowerCase()==="#document-fragment")f=a.firstChild,i=a.lastChild,j=a.childNodes.length;b.nodeType==1?(h=b.childNodes[c])?(b.insertBefore(a,h),b===d&&(e+=j)):b.appendChild(a):b.nodeType==3&&(c===0?(b.parentNode.insertBefore(a,b),b.parentNode===d&&(e+=j)):c>=b.nodeValue.length?b.nextSibling?b.parentNode.insertBefore(a,b.nextSibling):b.parentNode.appendChild(a):(h=c>0?b.splitText(c):b,b.parentNode.insertBefore(a,h),b===d&&(d=h,e-=c)));f?this.setStartBefore(f).setEndAfter(i):
|
||||||
|
this.selectNode(a);if(this.compareBoundaryPoints($,this.cloneRange().setEnd(d,e))>=1)return this;return this.setEnd(d,e)},surroundContents:function(a){a.appendChild(this.extractContents());return this.insertNode(a).selectNode(a)},isControl:function(){var a=this.startContainer,b=this.startOffset,c=this.endContainer,d=this.endOffset;return a.nodeType==1&&a===c&&b+1===d&&f(a.childNodes[b]).isControl()},get:function(a){var b=this.doc;if(!n){b=b.createRange();try{b.setStart(this.startContainer,this.startOffset),
|
||||||
|
b.setEnd(this.endContainer,this.endOffset)}catch(c){}return b}if(a&&this.isControl())return b=b.body.createControlRange(),b.addElement(this.startContainer.childNodes[this.startOffset]),b;a=this.cloneRange().down();b=b.body.createTextRange();b.setEndPoint("StartToStart",kb(a.startContainer,a.startOffset));b.setEndPoint("EndToStart",kb(a.endContainer,a.endOffset));return b},html:function(){return f(this.cloneContents()).outer()},down:function(){function a(a,d,e){if(a.nodeType==1&&(a=f(a).children(),
|
||||||
|
a.length!==0)){var g,i,h,j;d>0&&(g=a[d-1]);d<a.length&&(i=a[d]);if(g&&g.type==3)h=g[0],j=h.nodeValue.length;i&&i.type==3&&(h=i[0],j=0);h&&(e?b.setStart(h,j):b.setEnd(h,j))}}var b=this;a(b.startContainer,b.startOffset,!0);a(b.endContainer,b.endOffset,!1);return b},up:function(){function a(a,d,e){a.nodeType==3&&(d===0?e?b.setStartBefore(a):b.setEndBefore(a):d==a.nodeValue.length&&(e?b.setStartAfter(a):b.setEndAfter(a)))}var b=this;a(b.startContainer,b.startOffset,!0);a(b.endContainer,b.endOffset,!1);
|
||||||
|
return b},enlarge:function(a){function b(b,e,g){b=f(b);if(!(b.type==3||za[b.name]||!a&&b.isBlock()))if(e===0){for(;!b.prev();){e=b.parent();if(!e||za[e.name]||!a&&e.isBlock())break;b=e}g?c.setStartBefore(b[0]):c.setEndBefore(b[0])}else if(e==b.children().length){for(;!b.next();){e=b.parent();if(!e||za[e.name]||!a&&e.isBlock())break;b=e}g?c.setStartAfter(b[0]):c.setEndAfter(b[0])}}var c=this;c.up();b(c.startContainer,c.startOffset,!0);b(c.endContainer,c.endOffset,!1);return c},createBookmark:function(a){var b,
|
||||||
|
c=f('<span style="display:none;"></span>',this.doc)[0];c.id="__kindeditor_bookmark_start_"+Gb++ +"__";if(!this.collapsed)b=c.cloneNode(!0),b.id="__kindeditor_bookmark_end_"+Gb++ +"__";b&&this.cloneRange().collapse(!1).insertNode(b).setEndBefore(b);this.insertNode(c).setStartAfter(c);return{start:a?"#"+c.id:c,end:b?a?"#"+b.id:b:null}},moveToBookmark:function(a){var b=this.doc,c=f(a.start,b),a=a.end?f(a.end,b):null;if(!c||c.length<1)return this;this.setStartBefore(c[0]);c.remove();a?(this.setEndBefore(a[0]),
|
||||||
|
a.remove()):this.collapse(!0);return this}});f.range=Ia;f.START_TO_START=ha;f.START_TO_END=ga;f.END_TO_END=$;f.END_TO_START=ia;C(ta,{init:function(a){var b=a.doc;this.doc=b;this.win=R(b);this.sel=Ja(b);this.range=a},selection:function(a){var b=this.doc,c;c=Ja(b);var d;try{d=c.rangeCount>0?c.getRangeAt(0):c.createRange()}catch(e){}c=n&&(!d||!d.item&&d.parentElement().ownerDocument!==b)?null:d;this.sel=Ja(b);if(c)return this.range=Ia(c),f(this.range.startContainer).name=="html"&&this.range.selectNodeContents(b.body).collapse(!1),
|
||||||
|
this;a&&this.range.selectNodeContents(b.body).collapse(!1);return this},select:function(){var a=this.sel,b=this.range.cloneRange(),c=b.startContainer,d=ea(c),e=this.win;if(c.nodeType==1&&b.collapsed){if(n)return a=f("<span> </span>",d),b.insertNode(a[0]),b=d.body.createTextRange(),b.moveToElementText(a[0]),b.collapse(!1),b.select(),a.remove(),e.focus(),this;Q&&b.insertNode(d.createTextNode("\u200b"))}b=b.get(!0);if(n)try{b.select()}catch(g){}else a.removeAllRanges(),a.addRange(b);e.focus();return this},
|
||||||
|
wrap:function(a){var b=this.range,c;c=f(a,this.doc);if(b.collapsed)return b.insertNode(c[0]).selectNodeContents(c[0]),this;if(c.isBlock()){for(var d=a=c.clone(!0);d.first();)d=d.first();d.append(b.extractContents());b.insertNode(a[0]).selectNode(a[0]);return this}b.enlarge();var e=b.createBookmark(),a=b.commonAncestor(),g=!1;f(a).scan(function(a){if(!g&&a==e.start)g=!0;else if(g){if(a==e.end)return!1;var b=f(a);if(!pb(b)&&b.type==3&&B(a.nodeValue).length>0){for(var d;(d=b.parent())&&d.isStyle()&&
|
||||||
|
d.children().length==1;)b=d;d=c;d=d.clone(!0);if(b.type==3)aa(d).append(b.clone(!1)),b.replaceWith(d);else{for(var a=b,l;(l=b.first())&&l.children().length==1;)b=l;l=b.first();for(b=b.doc.createDocumentFragment();l;)b.appendChild(l[0]),l=l.next();l=a.clone(!0);for(var p=aa(l),q=l,k=!1;d;){for(;q;)q.name===d.name&&(Nb(q,d.attr(),d.css()),k=!0),q=q.first();k||p.append(d.clone(!1));k=!1;d=d.first()}d=l;b.firstChild&&aa(d).append(b);a.replaceWith(d)}}}});b.moveToBookmark(e);return this},split:function(a,
|
||||||
|
b){for(var c=this.range,d=c.doc,e=c.cloneRange().collapse(a),g=e.startContainer,i=e.startOffset,h=g.nodeType==3?g.parentNode:g,j=!1,l;h&&h.parentNode;){l=f(h);if(b){if(!l.isStyle())break;if(!sa(l,b))break}else if(za[l.name])break;j=!0;h=h.parentNode}if(j)d=d.createElement("span"),c.cloneRange().collapse(!a).insertNode(d),a?e.setStartBefore(h.firstChild).setEnd(g,i):e.setStart(g,i).setEndAfter(h.lastChild),g=e.extractContents(),i=g.firstChild,j=g.lastChild,a?(e.insertNode(g),c.setStartAfter(j).setEndBefore(d)):
|
||||||
|
(h.appendChild(g),c.setStartBefore(d).setEndBefore(i)),e=d.parentNode,e==c.endContainer&&(h=f(d).prev(),g=f(d).next(),h&&g&&h.type==3&&g.type==3?c.setEnd(h[0],h[0].nodeValue.length):a||c.setEnd(c.endContainer,c.endOffset-1)),e.removeChild(d);return this},remove:function(a){var b=this.doc,c=this.range;if(c.collapsed)return this.split(!0,a),c.collapse(!0),this;if(c.startOffset===0){for(var d=f(c.startContainer),e;(e=d.parent())&&e.isStyle()&&e.children().length==1;)d=e;c.setStart(d[0],0);d=f(c.startContainer);
|
||||||
|
d.isBlock()&&Ka(d,a);(d=d.parent())&&d.isBlock()&&Ka(d,a)}this.split(!0,a);this.split(!1,a);var g=b.createElement("span"),i=b.createElement("span");c.cloneRange().collapse(!1).insertNode(i);c.cloneRange().collapse(!0).insertNode(g);var h=[],j=!1;f(c.commonAncestor()).scan(function(a){if(!j&&a==g)j=!0;else{if(a==i)return!1;j&&h.push(a)}});f(g).remove();f(i).remove();var b=c.startContainer,l=c.startOffset,d=c.endContainer;e=c.endOffset;if(l>0){var p=f(b.childNodes[l-1]);p&&aa(p).isStyle()&&(p.remove(),
|
||||||
|
c.setStart(b,l-1),b==d&&c.setEnd(d,e-1));if((l=f(b.childNodes[l]))&&aa(l).isStyle())l.remove(),b==d&&c.setEnd(d,e-1)}(c=f(d.childNodes[c.endOffset]))&&aa(c).isStyle()&&c.remove();k(h,function(b,c){var d=f(c);Ka(d,a)});return this},commonNode:function(a){for(var b=this.range,c=b.endContainer,b=b.endOffset,d=c.nodeType==3||b===0?c:c.childNodes[b-1],e=d,g=d;g;){if(sa(f(g),a))return f(g);g=g.parentNode}for(;e&&(e=e.firstChild)&&e.childNodes.length==1;)if(sa(f(e),a))return f(e);if(d.nodeType==1||c.nodeType==
|
||||||
|
3&&b===0)if((c=f(d).prev())&&sa(c,a))return c;return null},commonAncestor:function(a){function b(b){for(;b;){if(b.nodeType==1&&b.tagName.toLowerCase()===a)return b;b=b.parentNode}return null}var c=this.range,d=c.startContainer,e=c.startOffset,g=c.endContainer,c=c.endOffset,g=g.nodeType==3||c===0?g:g.childNodes[c-1],d=b(d.nodeType==3||e===0?d:d.childNodes[e-1]),e=b(g);if(d&&e&&d===e)return f(d);return null},state:function(a){var b=this.doc,c=!1;try{c=b.queryCommandState(a)}catch(d){}return c},val:function(a){var b=
|
||||||
|
this.doc,a=a.toLowerCase(),c="";if(a==="fontfamily"||a==="fontname")return c=lb(b,"fontname"),c=c.replace(/['"]/g,""),c.toLowerCase();if(a==="formatblock"){c=lb(b,a);if(c===""&&(a=this.commonNode({"h1,h2,h3,h4,h5,h6,p,div,pre,address":"*"})))c=a.name;c==="Normal"&&(c="p");return c.toLowerCase()}if(a==="fontsize")return(a=this.commonNode({"*":".font-size"}))&&(c=a.css("font-size")),c.toLowerCase();if(a==="forecolor")return(a=this.commonNode({"*":".color"}))&&(c=a.css("color")),c=ma(c),c===""&&(c="default"),
|
||||||
|
c.toLowerCase();if(a==="hilitecolor")return(a=this.commonNode({"*":".background-color"}))&&(c=a.css("background-color")),c=ma(c),c===""&&(c="default"),c.toLowerCase();return c},toggle:function(a,b){this.commonNode(b)?this.remove(b):this.wrap(a);return this.select()},bold:function(){return this.toggle("<strong></strong>",{span:".font-weight=bold",strong:"*",b:"*"})},italic:function(){return this.toggle("<em></em>",{span:".font-style=italic",em:"*",i:"*"})},underline:function(){return this.toggle("<u></u>",
|
||||||
|
{span:".text-decoration=underline",u:"*"})},strikethrough:function(){return this.toggle("<s></s>",{span:".text-decoration=line-through",s:"*"})},forecolor:function(a){return this.toggle('<span style="color:'+a+';"></span>',{span:".color="+a,font:"color"})},hilitecolor:function(a){return this.toggle('<span style="background-color:'+a+';"></span>',{span:".background-color="+a})},fontsize:function(a){return this.toggle('<span style="font-size:'+a+';"></span>',{span:".font-size="+a,font:"size"})},fontname:function(a){return this.fontfamily(a)},
|
||||||
|
fontfamily:function(a){return this.toggle('<span style="font-family:'+a+';"></span>',{span:".font-family="+a,font:"face"})},removeformat:function(){var a={"*":".font-weight,.font-style,.text-decoration,.color,.background-color,.font-size,.font-family"};k(Db,function(b){a[b]="*"});this.remove(a);return this.select()},inserthtml:function(a){var b=this.doc,c=this.range;if(a==="")return this;if(pb(f(c.startContainer)))return this;var d=b.createDocumentFragment();f("@"+a,b).each(function(){d.appendChild(this)});
|
||||||
|
c.deleteContents();c.insertNode(d);c.collapse(!1);return this.select()},hr:function(){return this.inserthtml("<hr />")},print:function(){this.win.print();return this},insertimage:function(a,b,c,d,e,f){b=o(b,"");o(e,0);a='<img src="'+a+'" data-ke-src="'+a+'" ';c&&(a+='width="'+c+'" ');d&&(a+='height="'+d+'" ');b&&(a+='title="'+b+'" ');f&&(a+='align="'+f+'" ');a+='alt="'+b+'" ';a+="/>";return this.inserthtml(a)},createlink:function(a,b){var c=this.doc,d=this.range;this.select();var e=this.commonNode({a:"*"});
|
||||||
|
e&&!d.isControl()&&(d.selectNode(e.get()),this.select());d.collapsed?(c='<a href="'+a+'" data-ke-src="'+a+'" ',b&&(c+=' target="'+b+'"'),c+=">"+a+"</a>",this.inserthtml(c)):(T(c,"createlink","__kindeditor_temp_url__"),e=this.commonNode({a:"*"}),f('a[href="__kindeditor_temp_url__"]',e?e.parent():c).each(function(){f(this).attr("href",a).attr("data-ke-src",a);b?f(this).attr("target",b):f(this).removeAttr("target")}));return this},unlink:function(){var a=this.doc,b=this.range;this.select();if(b.collapsed){var c=
|
||||||
|
this.commonNode({a:"*"});c&&(b.selectNode(c.get()),this.select());T(a,"unlink",null);Q&&f(b.startContainer).name==="img"&&(a=f(b.startContainer).parent(),a.name==="a"&&a.remove(!0))}else T(a,"unlink",null);return this}});k("formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript".split(","),function(a,b){ta.prototype[b]=function(a){if(n){rng=this.range.get(!0);try{rng.select()}catch(d){}}T(this.doc,b,a);(!n||
|
||||||
|
I(b,"formatblock,selectall,insertorderedlist,insertunorderedlist".split(","))>=0)&&this.selection();return this}});k("cut,copy,paste".split(","),function(a,b){ta.prototype[b]=function(){if(!this.doc.queryCommandSupported(b))throw"not supported";T(this.doc,b,null);return this}});f.cmd=qb;C(U,{init:function(a){var b=this;b.name=a.name||"";b.doc=a.doc||document;b.win=R(b.doc);b.x=s(a.x);b.y=s(a.y);b.z=a.z;b.width=s(a.width);b.height=s(a.height);b.div=f('<div style="display:block;"></div>');b.options=
|
||||||
|
a;b._alignEl=a.alignEl;b.width&&b.div.css("width",b.width);b.height&&b.div.css("height",b.height);b.z&&b.div.css({position:"absolute",left:b.x,top:b.y,"z-index":b.z});b.z&&(b.x===m||b.y===m)&&b.autoPos(b.width,b.height);a.cls&&b.div.addClass(a.cls);a.css&&b.div.css(a.css);a.src?f(a.src).hide().after(b.div):f(b.doc.body).append(b.div);a.html&&b.div.html(a.html);if(a.autoScroll)if(n&&F<7||Z){var c=fa();f(b.win).bind("scroll",function(){var a=fa(),e=a.x-c.x,a=a.y-c.y;b.pos(w(b.x)+e,w(b.y)+a,!1)})}else b.div.css("position",
|
||||||
|
"fixed")},pos:function(a,b,c){c=o(c,!0);if(a!==null&&(a=a<0?0:s(a),this.div.css("left",a),c))this.x=a;if(b!==null&&(b=b<0?0:s(b),this.div.css("top",b),c))this.y=b;return this},autoPos:function(a,b){var c=w(a)||0,d=w(b)||0,e=fa();if(this._alignEl){var g=f(this._alignEl),i=g.pos(),c=O(g[0].clientWidth/2-c/2),d=O(g[0].clientHeight/2-d/2);x=c<0?i.x:i.x+c;y=d<0?i.y:i.y+d}else i=G(this.doc),x=O(e.x+(i.clientWidth-c)/2),y=O(e.y+(i.clientHeight-d)/2);n&&F<7||Z||(x-=e.x,y-=e.y);return this.pos(x,y)},remove:function(){var a=
|
||||||
|
this;n&&F<7&&f(a.win).unbind("scroll");a.div.remove();k(a,function(b){a[b]=null});return this},show:function(){this.div.show();return this},hide:function(){this.div.hide();return this},draggable:function(a){var b=this,a=a||{};a.moveEl=b.div;a.moveFn=function(a,d,e,f,i,h){if((a+=i)<0)a=0;if((d+=h)<0)d=0;b.pos(a,d)};La(a);return b}});f.widget=Na;C(ua,U,{init:function(a){function b(){var b=Ma(c.iframe);b.open();if(h)b.domain=document.domain;b.write(Ob(d,e,g,i));b.close();c.win=c.iframe[0].contentWindow;
|
||||||
|
c.doc=b;var j=qb(b);c.afterChange(function(){j.selection()});Q&&f(b).click(function(a){f(a.target).name==="img"&&(j.selection(!0),j.range.selectNode(a.target),j.select())});n&&f(b).keydown(function(a){if(a.which==8){j.selection();var b=j.range;b.isControl()&&(b.collapse(!0),f(b.startContainer.childNodes[b.startOffset]).remove(),a.preventDefault())}});c.cmd=j;c.html(ba(c.srcElement));n?(b.body.disabled=!0,b.body.contentEditable=!0,b.body.removeAttribute("disabled")):b.designMode="on";a.afterCreate&&
|
||||||
|
a.afterCreate.call(c)}var c=this;ua.parent.init.call(c,a);c.srcElement=f(a.srcElement);c.div.addClass("ke-edit");c.designMode=o(a.designMode,!0);c.beforeGetHtml=a.beforeGetHtml;c.beforeSetHtml=a.beforeSetHtml;c.afterSetHtml=a.afterSetHtml;var d=o(a.themesPath,""),e=a.bodyClass,g=a.cssPath,i=a.cssData,h=location.host.replace(/:\d+/,"")!==document.domain,j="document.open();"+(h?'document.domain="'+document.domain+'";':"")+"document.close();",j=n?' src="javascript:void(function(){'+encodeURIComponent(j)+
|
||||||
|
'}())"':"";c.iframe=f('<iframe class="ke-edit-iframe" hidefocus="true" frameborder="0"'+j+"></iframe>").css("width","100%");c.textarea=f('<textarea class="ke-edit-textarea" hidefocus="true"></textarea>').css("width","100%");c.width&&c.setWidth(c.width);c.height&&c.setHeight(c.height);c.designMode?c.textarea.hide():c.iframe.hide();h&&c.iframe.bind("load",function(){c.iframe.unbind("load");n?b():setTimeout(b,0)});c.div.append(c.iframe);c.div.append(c.textarea);c.srcElement.hide();!h&&b()},setWidth:function(a){this.div.css("width",
|
||||||
|
s(a));return this},setHeight:function(a){a=s(a);this.div.css("height",a);this.iframe.css("height",a);if(n&&F<8||Z)a=s(w(a)-2);this.textarea.css("height",a);return this},remove:function(){var a=this.doc;f(a.body).unbind();f(a).unbind();f(this.win).unbind();ba(this.srcElement,this.html());this.srcElement.show();a.write("");this.iframe.unbind();this.textarea.unbind();ua.parent.remove.call(this)},html:function(a,b){var c=this.doc;if(this.designMode){var d=c.body;if(a===m)return a=b?"<!doctype html><html>"+
|
||||||
|
d.parentNode.innerHTML+"</html>":d.innerHTML,this.beforeGetHtml&&(a=this.beforeGetHtml(a)),Ra&&a=="<br />"&&(a=""),a;this.beforeSetHtml&&(a=this.beforeSetHtml(a));n?(d.innerHTML='<img id="__kindeditor_temp_tag__" width="0" height="0" />'+a,(c=f("#__kindeditor_temp_tag__",c))&&c.remove()):d.innerHTML=a;this.afterSetHtml&&this.afterSetHtml();return this}if(a===m)return this.textarea.val();this.textarea.val(a);return this},design:function(a){if(a===m?!this.designMode:a){if(!this.designMode)a=this.html(),
|
||||||
|
this.designMode=!0,this.html(a),this.textarea.hide(),this.iframe.show()}else if(this.designMode)a=this.html(),this.designMode=!1,this.html(a),this.iframe.hide(),this.textarea.show();return this.focus()},focus:function(){this.designMode?this.win.focus():this.textarea[0].focus();return this},blur:function(){if(n){var a=f('<input type="text" style="float:left;width:0;height:0;padding:0;margin:0;border:0;" value="" />',this.div);this.div.append(a);a[0].focus();a.remove()}else this.designMode?this.win.blur():
|
||||||
|
this.textarea[0].blur();return this},afterChange:function(a){function b(b){setTimeout(function(){a(b)},1)}var c=this.doc,d=c.body;f(c).keyup(function(b){!b.ctrlKey&&!b.altKey&&Ta[b.which]&&a(b)});f(c).mouseup(a).contextmenu(a);f(this.win).blur(a);f(d).bind("paste",b);f(d).bind("cut",b);return this}});f.edit=rb;f.iframeDoc=Ma;C(Oa,U,{init:function(a){function b(a){a=f(a);if(a.hasClass("ke-outline"))return a;if(a.hasClass("ke-toolbar-icon"))return a.parent()}function c(a,c){var d=b(a.target);if(d&&
|
||||||
|
!d.hasClass("ke-disabled")&&!d.hasClass("ke-selected"))d[c]("ke-on")}var d=this;Oa.parent.init.call(d,a);d.disableMode=o(a.disableMode,!1);d.noDisableItemMap=v(o(a.noDisableItems,[]));d._itemMap={};d.div.addClass("ke-toolbar").bind("contextmenu,mousedown,mousemove",function(a){a.preventDefault()});d.div.mouseover(function(a){c(a,"addClass")}).mouseout(function(a){c(a,"removeClass")}).click(function(a){var c=b(a.target);c&&!c.hasClass("ke-disabled")&&d.options.click.call(this,a,c.attr("data-name"))})},
|
||||||
|
get:function(a){if(this._itemMap[a])return this._itemMap[a];return this._itemMap[a]=f("span.ke-icon-"+a,this.div).parent()},select:function(a){sb.call(this,a,function(a){a.addClass("ke-selected")});return self},unselect:function(a){sb.call(this,a,function(a){a.removeClass("ke-selected").removeClass("ke-on")});return self},enable:function(a){if(a=a.get?a:this.get(a))a.removeClass("ke-disabled"),a.opacity(1);return this},disable:function(a){if(a=a.get?a:this.get(a))a.removeClass("ke-selected").addClass("ke-disabled"),
|
||||||
|
a.opacity(0.5);return this},disableAll:function(a,b){var c=this,d=c.noDisableItemMap;b&&(d=v(b));(a===m?!c.disableMode:a)?(f("span.ke-outline",c.div).each(function(){var a=f(this);name=a[0].getAttribute("data-name",2);d[name]||c.disable(a)}),c.disableMode=!0):(f("span.ke-outline",c.div).each(function(){var a=f(this);name=a[0].getAttribute("data-name",2);d[name]||c.enable(a)}),c.disableMode=!1);return c}});f.toolbar=tb;C(va,U,{init:function(a){a.z=a.z||811213;va.parent.init.call(this,a);this.centerLineMode=
|
||||||
|
o(a.centerLineMode,!0);this.div.addClass("ke-menu").bind("click,mousedown",function(a){a.stopPropagation()})},addItem:function(a){if(a.title==="-")this.div.append(f('<div class="ke-menu-separator"></div>'));else{var b=f('<div class="ke-menu-item"></div>'),c=f('<div class="ke-inline-block ke-menu-item-left"></div>'),d=f('<div class="ke-inline-block ke-menu-item-right"></div>'),e=s(a.height),g=a.iconClass;this.div.append(b);e&&(b.css("height",e),d.css("line-height",e));var i;this.centerLineMode&&(i=
|
||||||
|
f('<div class="ke-inline-block ke-menu-item-center"></div>'),e&&i.css("height",e));b.mouseover(function(){f(this).addClass("ke-menu-item-on");i&&i.addClass("ke-menu-item-center-on")}).mouseout(function(){f(this).removeClass("ke-menu-item-on");i&&i.removeClass("ke-menu-item-center-on")}).click(function(b){a.click.call(f(this));b.stopPropagation()}).append(c);i&&b.append(i);b.append(d);a.checked&&(g="ke-icon-checked");c.html('<span class="ke-inline-block ke-toolbar-icon ke-toolbar-icon-url '+g+'"></span>');
|
||||||
|
d.html(a.title);return this}},remove:function(){this.options.beforeRemove&&this.options.beforeRemove.call(this);f(".ke-menu-item",this.div[0]).unbind();va.parent.remove.call(this);return this}});f.menu=Pa;C(wa,U,{init:function(a){a.z=a.z||811213;wa.parent.init.call(this,a);var b=a.colors||[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100","#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999",
|
||||||
|
"#666666","#333333","#000000"]];this.selectedColor=(a.selectedColor||"").toLowerCase();this._cells=[];this.div.addClass("ke-colorpicker").bind("click,mousedown",function(a){a.stopPropagation()});a=this.doc.createElement("table");this.div.append(a);a.className="ke-colorpicker-table";a.cellPadding=0;a.cellSpacing=0;a.border=0;var c=a.insertRow(0),d=c.insertCell(0);d.colSpan=b[0].length;this._addAttr(d,"","ke-colorpicker-cell-top");for(var e=0;e<b.length;e++)for(var c=a.insertRow(e+1),f=0;f<b[e].length;f++)d=
|
||||||
|
c.insertCell(f),this._addAttr(d,b[e][f],"ke-colorpicker-cell")},_addAttr:function(a,b,c){var d=this,a=f(a).addClass(c);d.selectedColor===b.toLowerCase()&&a.addClass("ke-colorpicker-cell-selected");a.attr("title",b||d.options.noColor);a.mouseover(function(){f(this).addClass("ke-colorpicker-cell-on")});a.mouseout(function(){f(this).removeClass("ke-colorpicker-cell-on")});a.click(function(a){a.stop();d.options.click.call(f(this),b)});b?a.append(f('<div class="ke-colorpicker-cell-color"></div>').css("background-color",
|
||||||
|
b)):a.html(d.options.noColor);d._cells.push(a)},remove:function(){k(this._cells,function(){this.unbind()});wa.parent.remove.call(this);return this}});f.colorpicker=ub;C(vb,{init:function(a){var b=f(a.button),c=a.fieldName||"file",d=a.url||"",e=b.val(),g=b[0].className||"",i="kindeditor_upload_iframe_"+(new Date).getTime(),c=['<div class="ke-inline-block '+g+'">','<iframe name="'+i+'" style="display:none;"></iframe>','<form class="ke-inline-block ke-form" method="post" enctype="multipart/form-data" target="'+
|
||||||
|
i+'" action="'+d+'">','<span class="ke-inline-block ke-upload-area"><span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" value="'+e+'" />',"</span>",'<input type="file" class="ke-upload-file" name="'+c+'" tabindex="-1" />',"</span></form></div>"].join(""),c=f(c,b.doc);b.hide();b.before(c);this.div=c;this.button=b;this.iframe=f("iframe",c);this.form=f("form",c);this.fileBox=f(".ke-upload-file",c).width(f(".ke-button-outer").width());this.options=
|
||||||
|
a},submit:function(){var a=this,b=a.iframe;b.bind("load",function(){b.unbind();var c,d=f.iframeDoc(b).body.innerHTML;try{c=f.json(d)}catch(e){alert(f.DEBUG?d:a.lang("invalidJson"))}c&&a.options.afterUpload.call(a,c)});a.form[0].submit();return a},remove:function(){this.fileBox&&this.fileBox.unbind();this.div.remove();this.button.show();return this}});f.uploadbutton=function(a){return new vb(a)};C(xa,U,{init:function(a){a.z=a.z||811213;xa.parent.init.call(this,a);var b=a.title,c=f(a.body,this.doc),
|
||||||
|
d=a.previewBtn,e=a.yesBtn,g=a.noBtn,i=a.closeBtn,h=o(a.shadowMode,!0),j=o(a.showMask,!0);this.div.addClass("ke-dialog").bind("click,mousedown",function(a){a.stopPropagation()}).addClass("ke-dialog-"+(h?"":"no-")+"shadow");h=f('<div class="ke-dialog-header"></div>');this.div.append(h);h.html(b);this.closeIcon=f('<span class="ke-dialog-icon-close" title="'+i.name+'"></span>').click(i.click);h.append(this.closeIcon);this.draggable({clickEl:h,beforeDrag:a.beforeDrag});a=f('<div class="ke-dialog-body"></div>');
|
||||||
|
this.div.append(a);a.append(c);var l=f('<div class="ke-dialog-footer"></div>');(d||e||g)&&this.div.append(l);k([{btn:d,name:"preview"},{btn:e,name:"yes"},{btn:g,name:"no"}],function(){if(this.btn){var a=this.btn,a=a||{},b=a.name||"",c=f('<span class="ke-button-common ke-button-outer" title="'+b+'"></span>'),b=f('<input class="ke-button-common ke-button" type="button" value="'+b+'" />');a.click&&b.click(a.click);c.append(b);c.addClass("ke-dialog-"+this.name);l.append(c)}});this.height&&a.height(w(this.height)-
|
||||||
|
h.height()-l.height());this.mask=null;if(j)c=G(this.doc),this.mask=Na({x:0,y:0,z:this.z-1,cls:"ke-dialog-mask",width:Math.max(c.scrollWidth,c.clientWidth),height:Math.max(c.scrollHeight,c.clientHeight)});this.autoPos(this.div.width(),this.div.height());this.footerDiv=l;this.bodyDiv=a;this.headerDiv=h},remove:function(){this.options.beforeRemove&&this.options.beforeRemove.call(this);this.mask&&this.mask.remove();this.closeIcon.unbind();f("input",this.div).unbind();this.footerDiv.unbind();this.bodyDiv.unbind();
|
||||||
|
this.headerDiv.unbind();xa.parent.remove.call(this);return this}});f.dialog=wb;f.tabs=function(a){var b=Na(a),c=b.remove,d=a.afterSelect,a=b.div,e=[];a.addClass("ke-tabs").bind("contextmenu,mousedown,mousemove",function(a){a.preventDefault()});var g=f('<ul class="ke-tabs-ul ke-clearfix"></ul>');a.append(g);b.add=function(a){var b=f('<li class="ke-tabs-li">'+a.title+"</li>");b.data("tab",a);e.push(b);g.append(b)};b.selectedIndex=0;b.select=function(a){b.selectedIndex=a;k(e,function(c,d){d.unbind();
|
||||||
|
c===a?(d.addClass("ke-tabs-li-selected"),f(d.data("tab").panel).show("")):(d.removeClass("ke-tabs-li-selected").removeClass("ke-tabs-li-on").mouseover(function(){f(this).addClass("ke-tabs-li-on")}).mouseout(function(){f(this).removeClass("ke-tabs-li-on")}).click(function(){b.select(c)}),f(d.data("tab").panel).hide())});d&&d.call(b,a)};b.remove=function(){k(e,function(){this.remove()});g.remove();c.call(b)};return b};f.loadScript=Qa;f.ajax=function(a,b,c,d){var c=c||"GET",e=A.XMLHttpRequest?new A.XMLHttpRequest:
|
||||||
|
new ActiveXObject("Microsoft.XMLHTTP");e.open(c,a,!0);e.onreadystatechange=function(){e.readyState==4&&e.status==200&&b&&(d=Wa(B(e.responseText)),b(d))};if(c=="POST"){var f=[];k(d,function(a,b){f.push(encodeURIComponent(a)+"="+encodeURIComponent(b))});try{e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(i){}e.send(f.join("&"))}else e.send(null)};var ka={},L={};Sa.prototype={lang:function(a){return zb(a,this.langType)},loadPlugin:function(a,b){var c=this;if(ka[a]){if(c._calledPlugins[a])return b&&
|
||||||
|
b.call(c),c;ka[a].call(c,KindEditor);b&&b.call(c);c._calledPlugins[a]=!0;return c}Qa(c.pluginsPath+a+"/"+a+".js?ver="+encodeURIComponent(f.DEBUG?ya:"4.0 beta (2011-08-17)"),function(){ka[a]&&c.loadPlugin(a,b)});return c},handler:function(a,b){var c=this;c._handlers[a]||(c._handlers[a]=[]);if(Ua(b))return c._handlers[a].push(b),c;k(c._handlers[a],function(){b=this.call(c,b)});return b},clickToolbar:function(a,b){var c=this,d="clickToolbar"+a;if(b===m){if(c._handlers[d])return c.handler(d);c.loadPlugin(a,
|
||||||
|
function(){c.handler(d)});return c}return c.handler(d,b)},updateState:function(){var a=this;k("justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,subscript,superscript,bold,italic,underline,strikethrough".split(","),function(b,c){a.cmd.state(c)?a.toolbar.select(c):a.toolbar.unselect(c)});return a},addContextmenu:function(a){this._contextmenus.push(a);return this},afterCreate:function(a){return this.handler("afterCreate",a)},beforeRemove:function(a){return this.handler("beforeRemove",
|
||||||
|
a)},beforeGetHtml:function(a){return this.handler("beforeGetHtml",a)},beforeSetHtml:function(a){return this.handler("beforeSetHtml",a)},afterSetHtml:function(a){return this.handler("afterSetHtml",a)},create:function(){function a(a,c,d){d=o(d,!0);if(a&&a>=b.minWidth&&(b.resize(a,null),d))b.width=s(a);if(c&&c>=b.minHeight&&(b.resize(null,c),d))b.height=s(c)}var b=this,c=b.fullscreenMode;if(b.isCreated)return b;c?G().style.overflow="hidden":G().style.overflow="";var d=c?G().clientWidth+"px":b.width,
|
||||||
|
e=c?G().clientHeight+"px":b.height;if(n&&F<8||Z)e=s(w(e)+2);var g=b.container=f(b.layout);c?f(document.body).append(g):b.srcElement.before(g);var i=f(".toolbar",g),h=f(".edit",g),j=b.statusbar=f(".statusbar",g);g.removeClass("container").addClass("ke-container ke-container-"+b.themeType).css("width",d);c?(g.css({position:"absolute",left:0,top:0,"z-index":811211}),b._scrollPos=fa(),A.scrollTo(0,0),f(document.body).css({height:"1px",overflow:"hidden"}),f(document.body.parentNode).css("overflow","hidden")):
|
||||||
|
b._scrollPos&&(f(document.body).css({height:"",overflow:""}),f(document.body.parentNode).css("overflow",""),A.scrollTo(b._scrollPos.x,b._scrollPos.y));var l=[];f.each(b.items,function(a,c){c=="|"?l.push('<span class="ke-inline-block ke-separator"></span>'):c=="/"?l.push("<br />"):(l.push('<span class="ke-inline-block ke-outline" data-name="'+c+'" title="'+b.lang(c)+'">'),l.push('<span class="ke-inline-block ke-toolbar-icon ke-toolbar-icon-url ke-icon-'+c+'"></span></span>'))});var i=b.toolbar=tb({src:i,
|
||||||
|
html:l.join(""),noDisableItems:b.noDisableItems,click:function(a,c){a.stop();if(b.menu){var d=b.menu.name;b.hideMenu();if(d===c)return}b.clickToolbar(c)}}),k=b.edit=rb({height:w(e)-i.div.height(),src:h,srcElement:b.srcElement,designMode:b.designMode,themesPath:b.themesPath,bodyClass:b.bodyClass,cssPath:b.cssPath,cssData:b.cssData,beforeGetHtml:function(a){a=b.beforeGetHtml(a);return Y(a,b.filterMode?b.htmlTags:null,b.urlType,b.wellFormatMode,b.indentChar)},beforeSetHtml:function(a){a=b.beforeSetHtml(a);
|
||||||
|
return Y(a,b.filterMode?b.htmlTags:null,"",!1)},afterSetHtml:function(){b.afterSetHtml()},afterCreate:function(){b.edit=k=this;b.cmd=k.cmd;b._docMousedownFn=function(){b.menu&&b.hideMenu()};f(k.doc,document).mousedown(b._docMousedownFn);Pb.call(b);Qb.call(b);Rb.call(b);Sb.call(b);k.afterChange(function(){k.designMode&&(b.updateState(),b.addBookmark(),b.options.afterChange&&b.options.afterChange.call(b))});k.textarea.keyup(function(a){!a.ctrlKey&&!a.altKey&&Fb[a.which]&&b.options.afterChange&&b.options.afterChange.call(b)});
|
||||||
|
b.readonlyMode&&b.readonly();b.isCreated=!0;b.afterCreate();b.options.afterCreate&&b.options.afterCreate.call(b)}});j.removeClass("statusbar").addClass("ke-statusbar").append('<span class="ke-inline-block ke-statusbar-center-icon"></span>').append('<span class="ke-inline-block ke-statusbar-right-icon"></span>');b.menu=b.contextmenu=null;b.dialogs=[];f(A).unbind("resize");b.resize(d,e);c?(f(A).bind("resize",function(){b.isCreated&&a(G().clientWidth,G().clientHeight,!1)}),i.select("fullscreen"),j.first().css("visibility",
|
||||||
|
"hidden"),j.last().css("visibility","hidden")):(b.resizeType>0?La({moveEl:g,clickEl:j,moveFn:function(b,c,d,e,f,h){e+=h;a(null,e)}}):j.first().css("visibility","hidden"),b.resizeType===2?La({moveEl:g,clickEl:j.last(),moveFn:function(b,c,d,e,f,h){d+=f;e+=h;a(d,e)}}):j.last().css("visibility","hidden"));return b},remove:function(){var a=this;if(!a.isCreated)return a;a.beforeRemove();a.menu&&a.hideMenu();k(a.dialogs,function(){a.hideDialog()});f(document).unbind("mousedown",a._docMousedownFn);a.toolbar.remove();
|
||||||
|
a.edit.remove();a.statusbar.last().unbind();a.statusbar.unbind();a.container.remove();a.container=a.toolbar=a.edit=a.menu=null;a.dialogs=[];a.isCreated=!1;return a},resize:function(a,b){a!==null&&this.container.css("width",s(a));b!==null&&(b=w(b)-this.toolbar.div.height()-this.statusbar.height(),b>0&&this.edit.setHeight(b));return this},select:function(){this.isCreated&&this.cmd.select();return this},html:function(a){if(a===m)return this.isCreated?this.edit.html():ba(this.srcElement);this.isCreated?
|
||||||
|
this.edit.html(a):ba(this.srcElement,a);return this},fullHtml:function(){return this.isCreated?this.edit.html(m,!0):""},text:function(a){return a===m?B(this.html().replace(/<(?!img|embed).*?>/ig,"").replace(/ /ig," ")):this.html(Va(a))},isEmpty:function(){return B(this.text().replace(/\r\n|\n|\r/,""))===""},selectedHtml:function(){return this.isCreated?this.cmd.range.html():""},count:function(a){a=(a||"html").toLowerCase();if(a==="html")return V(this.html()).length;if(a==="text")return this.text().replace(/<(?:img|embed).*?>/ig,
|
||||||
|
"K").replace(/\r\n|\n|\r/g,"").length;return 0},exec:function(a){var a=a.toLowerCase(),b=this.cmd,c=I(a,"selectall,copy,paste,print".split(","))<0;c&&this.addBookmark(!1);b[a].apply(b,Aa(arguments,1));c&&(this.updateState(),this.addBookmark(!1),this.options.afterChange&&this.options.afterChange.call(this));return this},insertHtml:function(a){if(!this.isCreated)return this;a=this.beforeSetHtml(a);this.exec("inserthtml",a);return this},appendHtml:function(a){this.html(this.html()+a);if(this.isCreated)a=
|
||||||
|
this.cmd,a.range.selectNodeContents(a.doc.body).collapse(!1),a.select();return this},sync:function(){ba(this.srcElement,this.html());return this},focus:function(){this.isCreated?this.edit.focus():this.srcElement[0].focus();return this},blur:function(){this.isCreated?this.edit.blur():this.srcElement[0].blur();return this},addBookmark:function(a){var a=o(a,!0),b=this.edit,c=b.html();if(a&&this._undoStack.length>0&&Math.abs(c.length-V(this._undoStack[this._undoStack.length-1].html).length)<this.minChangeSize)return this;
|
||||||
|
b.designMode&&!this._firstAddBookmark?(c=this.cmd.range,a=c.createBookmark(!0),a.html=b.html(),c.moveToBookmark(a)):a={html:b.html()};this._firstAddBookmark=!1;Ab(this._undoStack,a);return this},undo:function(){return Bb.call(this,this._undoStack,this._redoStack)},redo:function(){return Bb.call(this,this._redoStack,this._undoStack)},fullscreen:function(a){this.fullscreenMode=a===m?!this.fullscreenMode:a;return this.remove().create()},readonly:function(a){var a=o(a,!0),b=this,c=b.edit,d=c.doc;b.designMode?
|
||||||
|
b.toolbar.disableAll(a,[]):k(b.noDisableItems,function(){b.toolbar[a?"disable":"enable"](this)});n?d.body.contentEditable=!a:d.designMode=a?"off":"on";c.textarea[0].disabled=a},createMenu:function(a){var b=this.toolbar.get(a.name),c=b.pos();a.x=c.x;a.y=c.y+b.height();a.selectedColor!==m?(a.cls="ke-colorpicker-"+this.themeType,a.noColor=this.lang("noColor"),this.menu=ub(a)):(a.cls="ke-menu-"+this.themeType,a.centerLineMode=!1,this.menu=Pa(a));return this.menu},hideMenu:function(){this.menu.remove();
|
||||||
|
this.menu=null;return this},hideContextmenu:function(){this.contextmenu.remove();this.contextmenu=null;return this},createDialog:function(a){var b=this;a.autoScroll=o(a.autoScroll,!0);a.shadowMode=o(a.shadowMode,b.shadowMode);a.closeBtn=o(a.closeBtn,{name:b.lang("close"),click:function(){b.hideDialog().focus()}});a.noBtn=o(a.noBtn,{name:b.lang(a.yesBtn?"no":"close"),click:function(){b.hideDialog().focus()}});if(b.dialogAlignType!="page")a.alignEl=b.container;a.cls="ke-dialog-"+b.themeType;if(b.dialogs.length>
|
||||||
|
0){var c=b.dialogs[b.dialogs.length-1];b.dialogs[0].mask.div.css("z-index",c.z+1);a.z=c.z+2;a.showMask=!1}a=wb(a);b.dialogs.push(a);return a},hideDialog:function(){this.dialogs.length>0&&this.dialogs.pop().remove();this.dialogs.length>0&&this.dialogs[0].mask.div.css("z-index",this.dialogs[this.dialogs.length-1].z-1);return this}};n&&F<7&&T(document,"BackgroundImageCache",!0);xb("core",function(a){var b=this,c={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"};b.afterSetHtml(function(){b.options.afterChange&&
|
||||||
|
b.options.afterChange.call(b)});if(b.syncType=="form"){for(var d=a(b.srcElement),e=!1;d=d.parent();)if(d.name=="form"){e=!0;break}if(e){d.bind("submit",function(){b.sync()});var f=a('[type="reset"]',d);f.click(function(){b.html(b.initContent)});b.beforeRemove(function(){d.unbind();f.unbind()})}}b.clickToolbar("source",function(){if(!Cb)b.edit.designMode?(b.toolbar.disableAll(!0),b.edit.design(!1),b.toolbar.select("source")):(b.toolbar.disableAll(!1),b.edit.design(!0),b.toolbar.unselect("source")),
|
||||||
|
b.designMode=b.edit.designMode});b.afterCreate(function(){b.designMode||b.toolbar.disableAll(!0).select("source")});b.clickToolbar("fullscreen",function(){b.fullscreen()});var i=!1;b.afterCreate(function(){a(b.edit.doc,b.edit.textarea).keyup(function(a){a.which==27&&setTimeout(function(){b.fullscreen()},0)});if(i){if(n&&!b.designMode)return;b.focus()}i||(i=!0)});k("undo,redo".split(","),function(a,d){c[d]&&b.afterCreate(function(){Ba(this.edit.doc,c[d],function(){b.clickToolbar(d)})});b.clickToolbar(d,
|
||||||
|
function(){b[d]()})});b.clickToolbar("formatblock",function(){var a=b.lang("formatblock.formatBlock"),c={h1:28,h2:24,h3:18,H4:14,p:12},d=b.cmd.val("formatblock"),e=b.createMenu({name:"formatblock",width:b.langType=="en"?200:150});k(a,function(a,f){var h="font-size:"+c[a]+"px;";a.charAt(0)==="h"&&(h+="font-weight:bold;");e.addItem({title:'<span style="'+h+'">'+f+"</span>",height:c[a]+12,checked:d===a||d===f,click:function(){b.select().exec("formatblock","<"+a.toUpperCase()+">").hideMenu()}})})});b.clickToolbar("fontname",
|
||||||
|
function(){var a=b.cmd.val("fontname"),c=b.createMenu({name:"fontname",width:150});k(b.lang("fontname.fontName"),function(d,e){c.addItem({title:'<span style="font-family: '+d+';">'+e+"</span>",checked:a===d.toLowerCase()||a===e.toLowerCase(),click:function(){b.exec("fontname",d).hideMenu()}})})});b.clickToolbar("fontsize",function(){var a=b.cmd.val("fontsize");menu=b.createMenu({name:"fontsize",width:150});k(b.fontSizeTable,function(c,d){menu.addItem({title:'<span style="font-size:'+d+';">'+d+"</span>",
|
||||||
|
height:w(d)+12,checked:a===d,click:function(){b.exec("fontsize",d).hideMenu()}})})});k("forecolor,hilitecolor".split(","),function(a,c){b.clickToolbar(c,function(){b.createMenu({name:c,selectedColor:b.cmd.val(c)||"default",colors:b.colorTable,click:function(a){b.exec(c,a).hideMenu()}})})});k("cut,copy,paste".split(","),function(a,c){b.clickToolbar(c,function(){b.focus();try{b.exec(c,null)}catch(a){alert(b.lang(c+"Error"))}})});b.clickToolbar("about",function(){b.createDialog({name:"about",width:300,
|
||||||
|
title:b.lang("about"),body:'<div style="margin:20px;"><div>KindEditor 4.0 beta (2011-08-17)</div><div>Copyright © <a href="http://www.kindsoft.net/" target="_blank">kindsoft.net</a> All rights reserved.</div></div>'})});b.plugin.getSelectedLink=function(){return b.cmd.commonAncestor("a")};b.plugin.getSelectedImage=function(){var c=b.edit.cmd.range,d=c.startContainer,e=c.startOffset;if(!Q&&!c.isControl())return null;c=a(d.childNodes[e]);if(!c||c.name!=="img"||/^ke-\w+$/i.test(c[0].className))return null;
|
||||||
|
return c};b.plugin.getSelectedFlash=function(){var c=b.edit.cmd.range,d=c.startContainer,e=c.startOffset;if(!Q&&!c.isControl())return null;c=a(d.childNodes[e]);if(!c||c.name!=="img"||c[0].className!=="ke-flash")return null;return c};b.plugin.getSelectedMedia=function(){var c=b.edit.cmd.range,d=c.startContainer,e=c.startOffset;if(!Q&&!c.isControl())return null;c=a(d.childNodes[e]);if(!c||c.name!=="img"||!/^ke-\w+$/.test(c[0].className))return null;if(c[0].className=="ke-flash")return null;return c};
|
||||||
|
k("link,image,flash,media".split(","),function(a,c){var d=c.charAt(0).toUpperCase()+c.substr(1);k("edit,delete".split(","),function(a,e){b.addContextmenu({title:b.lang(e+d),click:function(){b.loadPlugin(c,function(){b.plugin[c][e]();b.hideMenu()})},cond:b.plugin["getSelected"+d],width:150,iconClass:e=="edit"?"ke-icon-"+c:m})});b.addContextmenu({title:"-"})});b.beforeGetHtml(function(a){return a.replace(/<img[^>]*class="?ke-\w+"?[^>]*>/ig,function(a){a=N(a);a=gb(a["data-ke-tag"]);return Da(a)})});
|
||||||
|
b.beforeSetHtml(function(a){return a.replace(/<embed[^>]*type="([^"]+)"[^>]*>(?:<\/embed>)?/ig,function(a){a=N(a);a.src=o(a.src,"");a.width=o(a.width,0);a.height=o(a.height,0);return hb(b.themesPath+"common/blank.gif",a)})});b.plugin.getSelectedTable=function(){return b.cmd.commonAncestor("table")};b.plugin.getSelectedRow=function(){return b.cmd.commonAncestor("tr")};b.plugin.getSelectedCell=function(){return b.cmd.commonAncestor("td")};k("prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,insert,delete".split(","),
|
||||||
|
function(a,c){var d=I(c,["prop","delete"])<0?b.plugin.getSelectedCell:b.plugin.getSelectedTable;b.addContextmenu({title:b.lang("table"+c),click:function(){b.loadPlugin("table",function(){b.plugin.table[c]();b.hideMenu()})},cond:d,width:170,iconClass:"ke-icon-table"+c})});b.addContextmenu({title:"-"});k("selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript,hr,print,bold,italic,underline,strikethrough,removeformat,unlink".split(","),
|
||||||
|
function(a,d){c[d]&&b.afterCreate(function(){Ba(this.edit.doc,c[d],function(){b.cmd.selection();b.clickToolbar(d)})});b.clickToolbar(d,function(){b.focus().exec(d,null)})});b.afterCreate(function(){var c=b.edit.doc;a(c.body).bind("paste",function(a){b.pasteType===0&&a.stop()});a(c.body).bind(n?"beforepaste":"paste",function(){if(!(b.pasteType===0||a("div.__kindeditor_paste__",c).length>0)){var d=b.cmd.selection(),e=d.range.createBookmark(),f=a('<div class="__kindeditor_paste__"></div>',c).css({position:"absolute",
|
||||||
|
width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:a(e.start).pos().y+"px","white-space":"nowrap"});a(c.body).append(f);d.range.selectNodeContents(f[0]);d.select();setTimeout(function(){d.range.moveToBookmark(e);d.select();Q&&(a("div.__kindeditor_paste__",f).each(function(){a(this).after("<br />").remove(!0)}),a("span.Apple-style-span",f).remove(!0),a("meta",f).remove());var c=f.html();f.remove();c!==""&&(b.pasteType===2&&(c=b.beforeSetHtml(c),c=Y(c,b.filterMode?b.htmlTags:null)),b.pasteType===
|
||||||
|
1&&(c=c.replace(/<br[^>]*>/ig,"\n"),c=c.replace(/<\/p><p[^>]*>/ig,"\n"),c=c.replace(/<[^>]+/g,""),c=c.replace(/ /ig," "),c=c.replace(/\n\s*\n/g,"\n"),c=b.newlineTag=="p"?c.replace(/^/,"<p>").replace(/$/,"</p>").replace(/\n/g,"</p><p>"):c.replace(/\n/g,"<br />$&")),b.insertHtml(c))},0)}})});b.beforeGetHtml(function(a){return a.replace(/<div\s+[^>]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(a,b,c){return"<script"+unescape(b)+">"+c+"<\/script>"}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig,
|
||||||
|
function(a,b,c){a=a.replace(/(\s+(?:href|src)=")[^"]*(")/i,"$1"+c+"$2");return a=a.replace(/\s+data-ke-src="[^"]*"/i,"")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/ig,function(a,b,c){return b+c})});b.beforeSetHtml(function(a){return a.replace(/<script([^>]*)>([\s\S]*?)<\/script>/ig,function(a,b,c){return'<div class="ke-script" data-ke-script-attr="'+escape(b)+'">'+c+"</div>"}).replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/ig,function(a,b,c,d,e){if(a.match(/\sdata-ke-src="[^"]*"/i))return a;
|
||||||
|
return b+c+'="'+d+'" data-ke-src="'+d+'"'+e}).replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig,function(a,b,c){return b+"data-ke-"+c}).replace(/<table([^>]*)>/ig,function(a){if(a.indexOf("ke-zeroborder")>=0)return a;var b=N(a);if(b.border===m||b.border===""||b.border==="0")return Ib(a,"ke-zeroborder");return a})})});f.create=function(a,b){function c(a){k(ka,function(b,c){c.call(a,KindEditor)});return a.create()}var b=b||{},d=f(a);if(d){b.srcElement=d[0];if(!b.width)b.width=d.width();if(!b.height)b.height=
|
||||||
|
d.height();var e=new Sa(b);if(L[e.langType])return c(e);Qa(e.langPath+e.langType+".js?ver="+encodeURIComponent(f.DEBUG?ya:"4.0 beta (2011-08-17)"),function(){return c(e)});return e}};f.plugin=xb;f.lang=zb}})(window);
|
|
@ -0,0 +1,208 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* KindEditor - WYSIWYG HTML Editor for Internet
|
||||||
|
* Copyright (C) 2006-2011 kindsoft.net
|
||||||
|
*
|
||||||
|
* @author Roddy <luolonghao@gmail.com>
|
||||||
|
* @site http://www.kindsoft.net/
|
||||||
|
* @licence http://www.kindsoft.net/license.php
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
KindEditor.lang({
|
||||||
|
source : 'Source',
|
||||||
|
preview : 'Preview',
|
||||||
|
undo : 'Undo(Ctrl+Z)',
|
||||||
|
redo : 'Redo(Ctrl+Y)',
|
||||||
|
cut : 'Cut(Ctrl+X)',
|
||||||
|
copy : 'Copy(Ctrl+C)',
|
||||||
|
paste : 'Paste(Ctrl+V)',
|
||||||
|
plainpaste : 'Paste as plain text',
|
||||||
|
wordpaste : 'Paste from Word',
|
||||||
|
selectall : 'Select all',
|
||||||
|
justifyleft : 'Align left',
|
||||||
|
justifycenter : 'Align center',
|
||||||
|
justifyright : 'Align right',
|
||||||
|
justifyfull : 'Align full',
|
||||||
|
insertorderedlist : 'Ordered list',
|
||||||
|
insertunorderedlist : 'Unordered list',
|
||||||
|
indent : 'Increase indent',
|
||||||
|
outdent : 'Decrease indent',
|
||||||
|
subscript : 'Subscript',
|
||||||
|
superscript : 'Superscript',
|
||||||
|
formatblock : 'Paragraph format',
|
||||||
|
fontname : 'Font family',
|
||||||
|
fontsize : 'Font size',
|
||||||
|
forecolor : 'Text color',
|
||||||
|
hilitecolor : 'Highlight color',
|
||||||
|
bold : 'Bold(Ctrl+B)',
|
||||||
|
italic : 'Italic(Ctrl+I)',
|
||||||
|
underline : 'Underline(Ctrl+U)',
|
||||||
|
strikethrough : 'Strikethrough',
|
||||||
|
removeformat : 'Remove format',
|
||||||
|
image : 'Image',
|
||||||
|
flash : 'Flash',
|
||||||
|
media : 'Embeded media',
|
||||||
|
table : 'Table',
|
||||||
|
tablecell : 'Cell',
|
||||||
|
hr : 'Insert horizontal line',
|
||||||
|
emoticons : 'Insert emoticon',
|
||||||
|
link : 'Link',
|
||||||
|
unlink : 'Unlink',
|
||||||
|
fullscreen : 'Toggle fullscreen mode(Esc)',
|
||||||
|
about : 'About',
|
||||||
|
print : 'Print',
|
||||||
|
filemanager : 'File Manager',
|
||||||
|
code : 'Insert code',
|
||||||
|
map : 'Google Maps',
|
||||||
|
lineheight : 'Line height',
|
||||||
|
clearhtml : 'Clear HTML code',
|
||||||
|
pagebreak : 'Insert Page Break',
|
||||||
|
quickformat : 'Quick Format',
|
||||||
|
insertfile : 'Insert file',
|
||||||
|
template : 'Insert Template',
|
||||||
|
yes : 'OK',
|
||||||
|
no : 'Cancel',
|
||||||
|
close : 'Close',
|
||||||
|
editImage : 'Image properties',
|
||||||
|
deleteImage : 'Delete image',
|
||||||
|
editFlash : 'Flash properties',
|
||||||
|
deleteFlash : 'Delete flash',
|
||||||
|
editMedia : 'Media properties',
|
||||||
|
deleteMedia : 'Delete media',
|
||||||
|
editLink : 'Link properties',
|
||||||
|
deleteLink : 'Unlink',
|
||||||
|
tableprop : 'Table properties',
|
||||||
|
tablecellprop : 'Cell properties',
|
||||||
|
tableinsert : 'Insert table',
|
||||||
|
tabledelete : 'Delete table',
|
||||||
|
tablecolinsertleft : 'Insert column left',
|
||||||
|
tablecolinsertright : 'Insert column right',
|
||||||
|
tablerowinsertabove : 'Insert row above',
|
||||||
|
tablerowinsertbelow : 'Insert row below',
|
||||||
|
tablerowmerge : 'Merge down',
|
||||||
|
tablecolmerge : 'Merge right',
|
||||||
|
tablerowsplit : 'Split row',
|
||||||
|
tablecolsplit : 'Split column',
|
||||||
|
tablecoldelete : 'Delete column',
|
||||||
|
tablerowdelete : 'Delete row',
|
||||||
|
noColor : 'Default',
|
||||||
|
invalidImg : "Please type valid URL.\nAllowed file extension: jpg,gif,bmp,png",
|
||||||
|
invalidMedia : "Please type valid URL.\nAllowed file extension: swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb",
|
||||||
|
invalidWidth : "The width must be number.",
|
||||||
|
invalidHeight : "The height must be number.",
|
||||||
|
invalidBorder : "The border must be number.",
|
||||||
|
invalidUrl : "Please type valid URL.",
|
||||||
|
invalidRows : 'Invalid rows.',
|
||||||
|
invalidCols : 'Invalid columns.',
|
||||||
|
invalidPadding : 'The padding must be number.',
|
||||||
|
invalidSpacing : 'The spacing must be number.',
|
||||||
|
invalidJson : 'Invalid JSON string.',
|
||||||
|
uploadSuccess : 'Upload success.',
|
||||||
|
cutError : 'Currently not supported by your browser, use keyboard shortcut(Ctrl+X) instead.',
|
||||||
|
copyError : 'Currently not supported by your browser, use keyboard shortcut(Ctrl+C) instead.',
|
||||||
|
pasteError : 'Currently not supported by your browser, use keyboard shortcut(Ctrl+V) instead.',
|
||||||
|
'plainpaste.comment' : 'Use keyboard shortcut(Ctrl+V) to paste the text into the window.',
|
||||||
|
'wordpaste.comment' : 'Use keyboard shortcut(Ctrl+V) to paste the text into the window.',
|
||||||
|
'link.url' : 'URL',
|
||||||
|
'link.linkType' : 'Target',
|
||||||
|
'link.newWindow' : 'New window',
|
||||||
|
'link.selfWindow' : 'Same window',
|
||||||
|
'flash.url' : 'URL',
|
||||||
|
'flash.width' : 'Width',
|
||||||
|
'flash.height' : 'Height',
|
||||||
|
'flash.upload' : 'Upload',
|
||||||
|
'flash.viewServer' : 'Browse',
|
||||||
|
'media.url' : 'URL',
|
||||||
|
'media.width' : 'Width',
|
||||||
|
'media.height' : 'Height',
|
||||||
|
'media.autostart' : 'Auto start',
|
||||||
|
'media.upload' : 'Upload',
|
||||||
|
'media.viewServer' : 'Browse',
|
||||||
|
'image.remoteImage' : 'Insert URL',
|
||||||
|
'image.localImage' : 'Upload',
|
||||||
|
'image.remoteUrl' : 'URL',
|
||||||
|
'image.localUrl' : 'File',
|
||||||
|
'image.size' : 'Size',
|
||||||
|
'image.width' : 'Width',
|
||||||
|
'image.height' : 'Height',
|
||||||
|
'image.resetSize' : 'Reset dimensions',
|
||||||
|
'image.align' : 'Align',
|
||||||
|
'image.defaultAlign' : 'Default',
|
||||||
|
'image.leftAlign' : 'Left',
|
||||||
|
'image.rightAlign' : 'Right',
|
||||||
|
'image.imgTitle' : 'Title',
|
||||||
|
'image.viewServer' : 'Browse',
|
||||||
|
'filemanager.emptyFolder' : 'Blank',
|
||||||
|
'filemanager.moveup' : 'Parent folder',
|
||||||
|
'filemanager.viewType' : 'Display: ',
|
||||||
|
'filemanager.viewImage' : 'Thumbnails',
|
||||||
|
'filemanager.listImage' : 'List',
|
||||||
|
'filemanager.orderType' : 'Sorting: ',
|
||||||
|
'filemanager.fileName' : 'By name',
|
||||||
|
'filemanager.fileSize' : 'By size',
|
||||||
|
'filemanager.fileType' : 'By type',
|
||||||
|
'insertfile.url' : 'URL',
|
||||||
|
'insertfile.title' : 'Title',
|
||||||
|
'insertfile.upload' : 'Upload',
|
||||||
|
'insertfile.viewServer' : 'Browse',
|
||||||
|
'table.cells' : 'Cells',
|
||||||
|
'table.rows' : 'Rows',
|
||||||
|
'table.cols' : 'Columns',
|
||||||
|
'table.size' : 'Dimensions',
|
||||||
|
'table.width' : 'Width',
|
||||||
|
'table.height' : 'Height',
|
||||||
|
'table.percent' : '%',
|
||||||
|
'table.px' : 'px',
|
||||||
|
'table.space' : 'Space',
|
||||||
|
'table.padding' : 'Padding',
|
||||||
|
'table.spacing' : 'Spacing',
|
||||||
|
'table.align' : 'Align',
|
||||||
|
'table.textAlign' : 'Horizontal',
|
||||||
|
'table.verticalAlign' : 'Vertical',
|
||||||
|
'table.alignDefault' : 'Default',
|
||||||
|
'table.alignLeft' : 'Left',
|
||||||
|
'table.alignCenter' : 'Center',
|
||||||
|
'table.alignRight' : 'Right',
|
||||||
|
'table.alignTop' : 'Top',
|
||||||
|
'table.alignMiddle' : 'Middle',
|
||||||
|
'table.alignBottom' : 'Bottom',
|
||||||
|
'table.alignBaseline' : 'Baseline',
|
||||||
|
'table.border' : 'Border',
|
||||||
|
'table.borderWidth' : 'Width',
|
||||||
|
'table.borderColor' : 'Color',
|
||||||
|
'table.backgroundColor' : 'Background',
|
||||||
|
'map.address' : 'Address: ',
|
||||||
|
'map.search' : 'Search',
|
||||||
|
'formatblock.formatBlock' : {
|
||||||
|
h1 : 'Heading 1',
|
||||||
|
h2 : 'Heading 2',
|
||||||
|
h3 : 'Heading 3',
|
||||||
|
h4 : 'Heading 4',
|
||||||
|
p : 'Normal'
|
||||||
|
},
|
||||||
|
'fontname.fontName' : {
|
||||||
|
'Arial' : 'Arial',
|
||||||
|
'Arial Black' : 'Arial Black',
|
||||||
|
'Comic Sans MS' : 'Comic Sans MS',
|
||||||
|
'Courier New' : 'Courier New',
|
||||||
|
'Garamond' : 'Garamond',
|
||||||
|
'Georgia' : 'Georgia',
|
||||||
|
'Tahoma' : 'Tahoma',
|
||||||
|
'Times New Roman' : 'Times New Roman',
|
||||||
|
'Trebuchet MS' : 'Trebuchet MS',
|
||||||
|
'Verdana' : 'Verdana'
|
||||||
|
},
|
||||||
|
'lineheight.lineHeight' : [
|
||||||
|
{'1' : 'Line height 1'},
|
||||||
|
{'1.5' : 'Line height 1.5'},
|
||||||
|
{'2' : 'Line height 2'},
|
||||||
|
{'2.5' : 'Line height 2.5'},
|
||||||
|
{'3' : 'Line height 3'}
|
||||||
|
],
|
||||||
|
'template.selectTemplate' : 'Template',
|
||||||
|
'template.replaceContent' : 'Replace current content',
|
||||||
|
'template.fileList' : {
|
||||||
|
'1.html' : 'Image and Text',
|
||||||
|
'2.html' : 'Table',
|
||||||
|
'3.html' : 'List'
|
||||||
|
}
|
||||||
|
}, 'en');
|
|
@ -0,0 +1,210 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* KindEditor - WYSIWYG HTML Editor for Internet
|
||||||
|
* Copyright (C) 2006-2011 kindsoft.net
|
||||||
|
*
|
||||||
|
* @author Roddy <luolonghao@gmail.com>
|
||||||
|
* @site http://www.kindsoft.net/
|
||||||
|
* @licence http://www.kindsoft.net/license.php
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
KindEditor.lang({
|
||||||
|
source : 'HTML代码',
|
||||||
|
preview : '预览',
|
||||||
|
undo : '后退(Ctrl+Z)',
|
||||||
|
redo : '前进(Ctrl+Y)',
|
||||||
|
cut : '剪切(Ctrl+X)',
|
||||||
|
copy : '复制(Ctrl+C)',
|
||||||
|
paste : '粘贴(Ctrl+V)',
|
||||||
|
plainpaste : '粘贴为无格式文本',
|
||||||
|
wordpaste : '从Word粘贴',
|
||||||
|
selectall : '全选(Ctrl+A)',
|
||||||
|
justifyleft : '左对齐',
|
||||||
|
justifycenter : '居中',
|
||||||
|
justifyright : '右对齐',
|
||||||
|
justifyfull : '两端对齐',
|
||||||
|
insertorderedlist : '编号',
|
||||||
|
insertunorderedlist : '项目符号',
|
||||||
|
indent : '增加缩进',
|
||||||
|
outdent : '减少缩进',
|
||||||
|
subscript : '下标',
|
||||||
|
superscript : '上标',
|
||||||
|
formatblock : '段落',
|
||||||
|
fontname : '字体',
|
||||||
|
fontsize : '文字大小',
|
||||||
|
forecolor : '文字颜色',
|
||||||
|
hilitecolor : '文字背景',
|
||||||
|
bold : '粗体(Ctrl+B)',
|
||||||
|
italic : '斜体(Ctrl+I)',
|
||||||
|
underline : '下划线(Ctrl+U)',
|
||||||
|
strikethrough : '删除线',
|
||||||
|
removeformat : '删除格式',
|
||||||
|
image : '图片',
|
||||||
|
flash : 'Flash',
|
||||||
|
media : '视音频',
|
||||||
|
table : '表格',
|
||||||
|
tablecell : '单元格',
|
||||||
|
hr : '插入横线',
|
||||||
|
emoticons : '插入表情',
|
||||||
|
link : '超级链接',
|
||||||
|
unlink : '取消超级链接',
|
||||||
|
fullscreen : '全屏显示(Esc)',
|
||||||
|
about : '关于',
|
||||||
|
print : '打印(Ctrl+P)',
|
||||||
|
filemanager : '浏览服务器',
|
||||||
|
code : '插入程序代码',
|
||||||
|
map : 'Google地图',
|
||||||
|
lineheight : '行距',
|
||||||
|
clearhtml : '清理HTML代码',
|
||||||
|
pagebreak : '插入分页符',
|
||||||
|
quickformat : '一键排版',
|
||||||
|
insertfile : '插入文件',
|
||||||
|
template : '插入模板',
|
||||||
|
yes : '确定',
|
||||||
|
no : '取消',
|
||||||
|
close : '关闭',
|
||||||
|
editImage : '图片属性',
|
||||||
|
deleteImage : '删除图片',
|
||||||
|
editFlash : 'Flash属性',
|
||||||
|
deleteFlash : '删除Flash',
|
||||||
|
editMedia : '视音频属性',
|
||||||
|
deleteMedia : '删除视音频',
|
||||||
|
editLink : '超级链接属性',
|
||||||
|
deleteLink : '取消超级链接',
|
||||||
|
tableprop : '表格属性',
|
||||||
|
tablecellprop : '单元格属性',
|
||||||
|
tableinsert : '插入表格',
|
||||||
|
tabledelete : '删除表格',
|
||||||
|
tablecolinsertleft : '左侧插入列',
|
||||||
|
tablecolinsertright : '右侧插入列',
|
||||||
|
tablerowinsertabove : '上方插入行',
|
||||||
|
tablerowinsertbelow : '下方插入行',
|
||||||
|
tablerowmerge : '向下合并单元格',
|
||||||
|
tablecolmerge : '向右合并单元格',
|
||||||
|
tablerowsplit : '拆分行',
|
||||||
|
tablecolsplit : '拆分列',
|
||||||
|
tablecoldelete : '删除列',
|
||||||
|
tablerowdelete : '删除行',
|
||||||
|
noColor : '无颜色',
|
||||||
|
invalidImg : "请输入有效的URL地址。\n只允许jpg,gif,bmp,png格式。",
|
||||||
|
invalidMedia : "请输入有效的URL地址。\n只允许swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。",
|
||||||
|
invalidWidth : "宽度必须为数字。",
|
||||||
|
invalidHeight : "高度必须为数字。",
|
||||||
|
invalidBorder : "边框必须为数字。",
|
||||||
|
invalidUrl : "请输入有效的URL地址。",
|
||||||
|
invalidRows : '行数为必选项,只允许输入大于0的数字。',
|
||||||
|
invalidCols : '列数为必选项,只允许输入大于0的数字。',
|
||||||
|
invalidPadding : '边距必须为数字。',
|
||||||
|
invalidSpacing : '间距必须为数字。',
|
||||||
|
invalidJson : '服务器发生故障。',
|
||||||
|
uploadSuccess : '上传成功。',
|
||||||
|
cutError : '您的浏览器安全设置不允许使用剪切操作,请使用快捷键(Ctrl+X)来完成。',
|
||||||
|
copyError : '您的浏览器安全设置不允许使用复制操作,请使用快捷键(Ctrl+C)来完成。',
|
||||||
|
pasteError : '您的浏览器安全设置不允许使用粘贴操作,请使用快捷键(Ctrl+V)来完成。',
|
||||||
|
'plainpaste.comment' : '请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。',
|
||||||
|
'wordpaste.comment' : '请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。',
|
||||||
|
'link.url' : 'URL',
|
||||||
|
'link.linkType' : '打开类型',
|
||||||
|
'link.newWindow' : '新窗口',
|
||||||
|
'link.selfWindow' : '当前窗口',
|
||||||
|
'flash.url' : 'URL',
|
||||||
|
'flash.width' : '宽度',
|
||||||
|
'flash.height' : '高度',
|
||||||
|
'flash.upload' : '上传',
|
||||||
|
'flash.viewServer' : '浏览',
|
||||||
|
'media.url' : 'URL',
|
||||||
|
'media.width' : '宽度',
|
||||||
|
'media.height' : '高度',
|
||||||
|
'media.autostart' : '自动播放',
|
||||||
|
'media.upload' : '上传',
|
||||||
|
'media.viewServer' : '浏览',
|
||||||
|
'image.remoteImage' : '远程图片',
|
||||||
|
'image.localImage' : '本地上传',
|
||||||
|
'image.remoteUrl' : '图片地址',
|
||||||
|
'image.localUrl' : '图片地址',
|
||||||
|
'image.size' : '图片大小',
|
||||||
|
'image.width' : '宽',
|
||||||
|
'image.height' : '高',
|
||||||
|
'image.resetSize' : '重置大小',
|
||||||
|
'image.align' : '对齐方式',
|
||||||
|
'image.defaultAlign' : '默认方式',
|
||||||
|
'image.leftAlign' : '左对齐',
|
||||||
|
'image.rightAlign' : '右对齐',
|
||||||
|
'image.imgTitle' : '图片说明',
|
||||||
|
'image.viewServer' : '浏览...',
|
||||||
|
'filemanager.emptyFolder' : '空文件夹',
|
||||||
|
'filemanager.moveup' : '移到上一级文件夹',
|
||||||
|
'filemanager.viewType' : '显示方式:',
|
||||||
|
'filemanager.viewImage' : '缩略图',
|
||||||
|
'filemanager.listImage' : '详细信息',
|
||||||
|
'filemanager.orderType' : '排序方式:',
|
||||||
|
'filemanager.fileName' : '名称',
|
||||||
|
'filemanager.fileSize' : '大小',
|
||||||
|
'filemanager.fileType' : '类型',
|
||||||
|
'insertfile.url' : 'URL',
|
||||||
|
'insertfile.title' : '文件说明',
|
||||||
|
'insertfile.upload' : '上传',
|
||||||
|
'insertfile.viewServer' : '浏览',
|
||||||
|
'table.cells' : '单元格数',
|
||||||
|
'table.rows' : '行数',
|
||||||
|
'table.cols' : '列数',
|
||||||
|
'table.size' : '大小',
|
||||||
|
'table.width' : '宽度',
|
||||||
|
'table.height' : '高度',
|
||||||
|
'table.percent' : '%',
|
||||||
|
'table.px' : 'px',
|
||||||
|
'table.space' : '边距间距',
|
||||||
|
'table.padding' : '边距',
|
||||||
|
'table.spacing' : '间距',
|
||||||
|
'table.align' : '对齐方式',
|
||||||
|
'table.textAlign' : '水平对齐',
|
||||||
|
'table.verticalAlign' : '垂直对齐',
|
||||||
|
'table.alignDefault' : '默认',
|
||||||
|
'table.alignLeft' : '左对齐',
|
||||||
|
'table.alignCenter' : '居中',
|
||||||
|
'table.alignRight' : '右对齐',
|
||||||
|
'table.alignTop' : '顶部',
|
||||||
|
'table.alignMiddle' : '中部',
|
||||||
|
'table.alignBottom' : '底部',
|
||||||
|
'table.alignBaseline' : '基线',
|
||||||
|
'table.border' : '边框',
|
||||||
|
'table.borderWidth' : '边框',
|
||||||
|
'table.borderColor' : '颜色',
|
||||||
|
'table.backgroundColor' : '背景颜色',
|
||||||
|
'map.address' : '地址: ',
|
||||||
|
'map.search' : '搜索',
|
||||||
|
'formatblock.formatBlock' : {
|
||||||
|
h1 : '标题 1',
|
||||||
|
h2 : '标题 2',
|
||||||
|
h3 : '标题 3',
|
||||||
|
h4 : '标题 4',
|
||||||
|
p : '正 文'
|
||||||
|
},
|
||||||
|
'fontname.fontName' : {
|
||||||
|
'SimSun' : '宋体',
|
||||||
|
'NSimSun' : '新宋体',
|
||||||
|
'FangSong_GB2312' : '仿宋_GB2312',
|
||||||
|
'KaiTi_GB2312' : '楷体_GB2312',
|
||||||
|
'SimHei' : '黑体',
|
||||||
|
'Microsoft YaHei' : '微软雅黑',
|
||||||
|
'Arial' : 'Arial',
|
||||||
|
'Arial Black' : 'Arial Black',
|
||||||
|
'Times New Roman' : 'Times New Roman',
|
||||||
|
'Courier New' : 'Courier New',
|
||||||
|
'Tahoma' : 'Tahoma',
|
||||||
|
'Verdana' : 'Verdana'
|
||||||
|
},
|
||||||
|
'lineheight.lineHeight' : [
|
||||||
|
{'1' : '单倍行距'},
|
||||||
|
{'1.5' : '1.5倍行距'},
|
||||||
|
{'2' : '2倍行距'},
|
||||||
|
{'2.5' : '2.5倍行距'},
|
||||||
|
{'3' : '3倍行距'}
|
||||||
|
],
|
||||||
|
'template.selectTemplate' : '可选模板',
|
||||||
|
'template.replaceContent' : '替换当前内容',
|
||||||
|
'template.fileList' : {
|
||||||
|
'1.html' : '图片和文字',
|
||||||
|
'2.html' : '表格',
|
||||||
|
'3.html' : '项目编号'
|
||||||
|
}
|
||||||
|
}, 'zh_CN');
|
|
@ -0,0 +1,210 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* KindEditor - WYSIWYG HTML Editor for Internet
|
||||||
|
* Copyright (C) 2006-2011 kindsoft.net
|
||||||
|
*
|
||||||
|
* @author Roddy <luolonghao@gmail.com>
|
||||||
|
* @site http://www.kindsoft.net/
|
||||||
|
* @licence http://www.kindsoft.net/license.php
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
KindEditor.lang({
|
||||||
|
source : '原始碼',
|
||||||
|
preview : '預覽',
|
||||||
|
undo : '復原(Ctrl+Z)',
|
||||||
|
redo : '重複(Ctrl+Y)',
|
||||||
|
cut : '剪下(Ctrl+X)',
|
||||||
|
copy : '複製(Ctrl+C)',
|
||||||
|
paste : '貼上(Ctrl+V)',
|
||||||
|
plainpaste : '貼為純文字格式',
|
||||||
|
wordpaste : '自Word貼上',
|
||||||
|
selectall : '全選(Ctrl+A)',
|
||||||
|
justifyleft : '靠左對齊',
|
||||||
|
justifycenter : '置中',
|
||||||
|
justifyright : '靠右對齊',
|
||||||
|
justifyfull : '左右對齊',
|
||||||
|
insertorderedlist : '編號清單',
|
||||||
|
insertunorderedlist : '項目清單',
|
||||||
|
indent : '增加縮排',
|
||||||
|
outdent : '減少縮排',
|
||||||
|
subscript : '下標',
|
||||||
|
superscript : '上標',
|
||||||
|
formatblock : '標題',
|
||||||
|
fontname : '字體',
|
||||||
|
fontsize : '文字大小',
|
||||||
|
forecolor : '文字顏色',
|
||||||
|
hilitecolor : '背景顏色',
|
||||||
|
bold : '粗體(Ctrl+B)',
|
||||||
|
italic : '斜體(Ctrl+I)',
|
||||||
|
underline : '底線(Ctrl+U)',
|
||||||
|
strikethrough : '刪除線',
|
||||||
|
removeformat : '清除格式',
|
||||||
|
image : '影像',
|
||||||
|
flash : 'Flash',
|
||||||
|
media : '多媒體',
|
||||||
|
table : '表格',
|
||||||
|
hr : '插入水平線',
|
||||||
|
emoticons : '插入表情',
|
||||||
|
link : '超連結',
|
||||||
|
unlink : '移除超連結',
|
||||||
|
fullscreen : '最大化',
|
||||||
|
about : '關於',
|
||||||
|
print : '列印(Ctrl+P)',
|
||||||
|
fileManager : '瀏覽伺服器',
|
||||||
|
code : '插入程式代碼',
|
||||||
|
map : 'Google地圖',
|
||||||
|
lineheight : '行距',
|
||||||
|
clearhtml : '清理HTML代碼',
|
||||||
|
pagebreak : '插入分頁符號',
|
||||||
|
quickformat : '快速排版',
|
||||||
|
insertfile : '插入文件',
|
||||||
|
template : '插入樣板',
|
||||||
|
yes : '確定',
|
||||||
|
no : '取消',
|
||||||
|
close : '關閉',
|
||||||
|
editImage : '影像屬性',
|
||||||
|
deleteImage : '刪除影像',
|
||||||
|
editFlash : 'Flash屬性',
|
||||||
|
deleteFlash : '删除Flash',
|
||||||
|
editMedia : '多媒體屬性',
|
||||||
|
deleteMedia : '删除多媒體',
|
||||||
|
editLink : '超連結屬性',
|
||||||
|
deleteLink : '移除超連結',
|
||||||
|
tableprop : '表格屬性',
|
||||||
|
tablecellprop : '儲存格屬性',
|
||||||
|
tableinsert : '插入表格',
|
||||||
|
tabledelete : '刪除表格',
|
||||||
|
tablecolinsertleft : '向左插入列',
|
||||||
|
tablecolinsertright : '向右插入列',
|
||||||
|
tablerowinsertabove : '向上插入欄',
|
||||||
|
tablerowinsertbelow : '下方插入欄',
|
||||||
|
tablerowmerge : '向下合併單元格',
|
||||||
|
tablecolmerge : '向右合併單元格',
|
||||||
|
tablerowsplit : '分割欄',
|
||||||
|
tablecolsplit : '分割列',
|
||||||
|
tablecoldelete : '删除列',
|
||||||
|
tablerowdelete : '删除欄',
|
||||||
|
noColor : '自動',
|
||||||
|
invalidImg : "請輸入有效的URL。\n只允許jpg,gif,bmp,png格式。",
|
||||||
|
invalidMedia : "請輸入有效的URL。\n只允許swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。",
|
||||||
|
invalidWidth : "寬度必須是數字。",
|
||||||
|
invalidHeight : "高度必須是數字。",
|
||||||
|
invalidBorder : "邊框必須是數字。",
|
||||||
|
invalidUrl : "請輸入有效的URL。",
|
||||||
|
invalidRows : '欄數是必須輸入項目,只允許輸入大於0的數字。',
|
||||||
|
invalidCols : '列數是必須輸入項目,只允許輸入大於0的數字。',
|
||||||
|
invalidPadding : '內距必須是數字。',
|
||||||
|
invalidSpacing : '間距必須是數字。',
|
||||||
|
invalidBorder : '边框必须为数字。',
|
||||||
|
pleaseInput : "請輸入內容。",
|
||||||
|
invalidJson : '伺服器發生故障。',
|
||||||
|
cutError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+X)完成。',
|
||||||
|
copyError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+C)完成。',
|
||||||
|
pasteError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+V)完成。',
|
||||||
|
'plainpaste.comment' : '請使用快捷鍵(Ctrl+V)把內容貼到下方區域裡。',
|
||||||
|
'wordpaste.comment' : '請使用快捷鍵(Ctrl+V)把內容貼到下方區域裡。',
|
||||||
|
'link.url' : 'URL',
|
||||||
|
'link.linkType' : '打開類型',
|
||||||
|
'link.newWindow' : '新窗口',
|
||||||
|
'link.selfWindow' : '本頁窗口',
|
||||||
|
'flash.url' : 'URL',
|
||||||
|
'flash.width' : '寬度',
|
||||||
|
'flash.height' : '高度',
|
||||||
|
'flash.upload' : '上傳',
|
||||||
|
'flash.viewServer' : '瀏覽',
|
||||||
|
'media.url' : 'URL',
|
||||||
|
'media.width' : '寬度',
|
||||||
|
'media.height' : '高度',
|
||||||
|
'media.autostart' : '自動播放',
|
||||||
|
'media.upload' : '上傳',
|
||||||
|
'media.viewServer' : '瀏覽',
|
||||||
|
'image.remoteImage' : '影像URL',
|
||||||
|
'image.localImage' : '上傳影像',
|
||||||
|
'image.remoteUrl' : '影像URL',
|
||||||
|
'image.localUrl' : '影像URL',
|
||||||
|
'image.size' : '影像大小',
|
||||||
|
'image.width' : '寬度',
|
||||||
|
'image.height' : '高度',
|
||||||
|
'image.resetSize' : '原始大小',
|
||||||
|
'image.align' : '對齊方式',
|
||||||
|
'image.defaultAlign' : '未設定',
|
||||||
|
'image.leftAlign' : '向左對齊',
|
||||||
|
'image.rightAlign' : '向右對齊',
|
||||||
|
'image.imgTitle' : '影像說明',
|
||||||
|
'image.viewServer' : '瀏覽...',
|
||||||
|
'filemanager.emptyFolder' : '空文件夾',
|
||||||
|
'filemanager.moveup' : '至上一級文件夾',
|
||||||
|
'filemanager.viewType' : '顯示方式:',
|
||||||
|
'filemanager.viewImage' : '縮略圖',
|
||||||
|
'filemanager.listImage' : '詳細信息',
|
||||||
|
'filemanager.orderType' : '排序方式:',
|
||||||
|
'filemanager.fileName' : '名稱',
|
||||||
|
'filemanager.fileSize' : '大小',
|
||||||
|
'filemanager.fileType' : '類型',
|
||||||
|
'insertfile.url' : 'URL',
|
||||||
|
'insertfile.title' : '文件說明',
|
||||||
|
'insertfile.upload' : '上傳',
|
||||||
|
'insertfile.viewServer' : '瀏覽',
|
||||||
|
'table.cells' : '儲存格數',
|
||||||
|
'table.rows' : '欄數',
|
||||||
|
'table.cols' : '列數',
|
||||||
|
'table.size' : '表格大小',
|
||||||
|
'table.width' : '寬度',
|
||||||
|
'table.height' : '高度',
|
||||||
|
'table.percent' : '%',
|
||||||
|
'table.px' : 'px',
|
||||||
|
'table.space' : '內距間距',
|
||||||
|
'table.padding' : '內距',
|
||||||
|
'table.spacing' : '間距',
|
||||||
|
'table.align' : '對齊方式',
|
||||||
|
'table.textAlign' : '水平對齊',
|
||||||
|
'table.verticalAlign' : '垂直對齊',
|
||||||
|
'table.alignDefault' : '未設定',
|
||||||
|
'table.alignLeft' : '向左對齊',
|
||||||
|
'table.alignCenter' : '置中',
|
||||||
|
'table.alignRight' : '向右對齊',
|
||||||
|
'table.alignTop' : '靠上',
|
||||||
|
'table.alignMiddle' : '置中',
|
||||||
|
'table.alignBottom' : '靠下',
|
||||||
|
'table.alignBaseline' : '基線',
|
||||||
|
'table.border' : '表格邊框',
|
||||||
|
'table.borderWidth' : '邊框',
|
||||||
|
'table.borderColor' : '顏色',
|
||||||
|
'table.backgroundColor' : '背景顏色',
|
||||||
|
'map.address' : '住所: ',
|
||||||
|
'map.search' : '尋找',
|
||||||
|
'formatblock.formatBlock' : {
|
||||||
|
h1 : '標題 1',
|
||||||
|
h2 : '標題 2',
|
||||||
|
h3 : '標題 3',
|
||||||
|
h4 : '標題 4',
|
||||||
|
p : '一般'
|
||||||
|
},
|
||||||
|
'fontname.fontName' : {
|
||||||
|
'MingLiU' : '細明體',
|
||||||
|
'PMingLiU' : '新細明體',
|
||||||
|
'DFKai-SB' : '標楷體',
|
||||||
|
'SimSun' : '宋體',
|
||||||
|
'NSimSun' : '新宋體',
|
||||||
|
'FangSong' : '仿宋體',
|
||||||
|
'Arial' : 'Arial',
|
||||||
|
'Arial Black' : 'Arial Black',
|
||||||
|
'Times New Roman' : 'Times New Roman',
|
||||||
|
'Courier New' : 'Courier New',
|
||||||
|
'Tahoma' : 'Tahoma',
|
||||||
|
'Verdana' : 'Verdana'
|
||||||
|
},
|
||||||
|
'lineheight.lineHeight' : [
|
||||||
|
{'1' : '单倍行距'},
|
||||||
|
{'1.5' : '1.5倍行距'},
|
||||||
|
{'2' : '2倍行距'},
|
||||||
|
{'2.5' : '2.5倍行距'},
|
||||||
|
{'3' : '3倍行距'}
|
||||||
|
],
|
||||||
|
'template.selectTemplate' : '可選樣板',
|
||||||
|
'template.replaceContent' : '取代當前內容',
|
||||||
|
'template.fileList' : {
|
||||||
|
'1.html' : '影像和文字',
|
||||||
|
'2.html' : '表格',
|
||||||
|
'3.html' : '项目清單'
|
||||||
|
}
|
||||||
|
}, 'zh_TW');
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* KindEditor - WYSIWYG HTML Editor for Internet
|
||||||
|
* Copyright (C) 2006-2011 kindsoft.net
|
||||||
|
*
|
||||||
|
* @author Roddy <luolonghao@gmail.com>
|
||||||
|
* @site http://www.kindsoft.net/
|
||||||
|
* @licence http://www.kindsoft.net/license.php
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
KindEditor.plugin('clearhtml', function(K) {
|
||||||
|
var self = this, name = 'clearhtml';
|
||||||
|
self.clickToolbar(name, function() {
|
||||||
|
self.focus();
|
||||||
|
var html = self.html();
|
||||||
|
html = html.replace(/(<script[^>]*>)([\s\S]*?)(<\/script>)/ig, '');
|
||||||
|
html = html.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/ig, '');
|
||||||
|
html = K.formatHtml(html, {
|
||||||
|
a : ['href', 'target'],
|
||||||
|
embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
|
||||||
|
img : ['src', 'width', 'height', 'border', 'alt', 'title', '.width', '.height'],
|
||||||
|
table : ['border'],
|
||||||
|
'div,td,th,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : []
|
||||||
|
});
|
||||||
|
self.html(html);
|
||||||
|
self.cmd.selection(true);
|
||||||
|
self.addBookmark();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* KindEditor - WYSIWYG HTML Editor for Internet
|
||||||
|
* Copyright (C) 2006-2011 kindsoft.net
|
||||||
|
*
|
||||||
|
* @author Roddy <luolonghao@gmail.com>
|
||||||
|
* @site http://www.kindsoft.net/
|
||||||
|
* @licence http://www.kindsoft.net/license.php
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
// google code prettify: http://google-code-prettify.googlecode.com/
|
||||||
|
// http://google-code-prettify.googlecode.com/
|
||||||
|
|
||||||
|
KindEditor.plugin('code', function(K) {
|
||||||
|
var self = this, name = 'code';
|
||||||
|
self.clickToolbar(name, function() {
|
||||||
|
var lang = self.lang(name + '.'),
|
||||||
|
html = ['<div style="padding:10px 20px;">',
|
||||||
|
'<div class="ke-dialog-row">',
|
||||||
|
'<select class="ke-code-type">',
|
||||||
|
'<option value="js">JavaScript</option>',
|
||||||
|
'<option value="html">HTML</option>',
|
||||||
|
'<option value="css">CSS</option>',
|
||||||
|
'<option value="php">PHP</option>',
|
||||||
|
'<option value="pl">Perl</option>',
|
||||||
|
'<option value="py">Python</option>',
|
||||||
|
'<option value="rb">Ruby</option>',
|
||||||
|
'<option value="java">Java</option>',
|
||||||
|
'<option value="vb">ASP/VB</option>',
|
||||||
|
'<option value="cpp">C/C++</option>',
|
||||||
|
'<option value="cs">C#</option>',
|
||||||
|
'<option value="xml">XML</option>',
|
||||||
|
'<option value="bsh">Shell</option>',
|
||||||
|
'<option value="">Other</option>',
|
||||||
|
'</select>',
|
||||||
|
'</div>',
|
||||||
|
'<textarea class="ke-textarea" style="width:408px;height:260px;"></textarea>',
|
||||||
|
'</div>'].join(''),
|
||||||
|
dialog = self.createDialog({
|
||||||
|
name : name,
|
||||||
|
width : 450,
|
||||||
|
title : self.lang(name),
|
||||||
|
body : html,
|
||||||
|
yesBtn : {
|
||||||
|
name : self.lang('yes'),
|
||||||
|
click : function(e) {
|
||||||
|
var type = K('.ke-code-type', dialog.div).val(),
|
||||||
|
code = textarea.val(),
|
||||||
|
cls = type === '' ? '' : ' lang-' + type,
|
||||||
|
html = '<pre class="prettyprint' + cls + '">\n' + K.escape(code) + '</pre> ';
|
||||||
|
self.insertHtml(html).hideDialog().focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
textarea = K('textarea', dialog.div);
|
||||||
|
textarea[0].focus();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
|
||||||
|
|
||||||
|
pre.prettyprint {
|
||||||
|
border: 0;
|
||||||
|
border-left: 3px solid rgb(204, 204, 204);
|
||||||
|
margin-left: 2em;
|
||||||
|
padding: 0.5em;
|
||||||
|
font-size: 110%;
|
||||||
|
display: block;
|
||||||
|
font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
|
||||||
|
margin: 1em 0px;
|
||||||
|
white-space: pre;
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
|
||||||
|
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
|
||||||
|
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
|
||||||
|
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
|
||||||
|
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
|
||||||
|
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
|
||||||
|
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
|
||||||
|
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
|
||||||
|
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
|
||||||
|
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
|
||||||
|
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
|
||||||
|
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
|
||||||
|
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
|
||||||
|
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
|
||||||
|
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
|
||||||
|
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
|
||||||
|
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
|
||||||
|
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
|
||||||
|
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
|
||||||
|
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
|
||||||
|
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
|
||||||
|
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
|
||||||
|
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
|
||||||
|
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
|
||||||
|
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
|
||||||
|
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
|
||||||
|
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
|
||||||
|
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
|
|
@ -0,0 +1,129 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* KindEditor - WYSIWYG HTML Editor for Internet
|
||||||
|
* Copyright (C) 2006-2011 kindsoft.net
|
||||||
|
*
|
||||||
|
* @author Roddy <luolonghao@gmail.com>
|
||||||
|
* @site http://www.kindsoft.net/
|
||||||
|
* @licence http://www.kindsoft.net/license.php
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
KindEditor.plugin('emoticons', function(K) {
|
||||||
|
var self = this, name = 'emoticons',
|
||||||
|
path = (self.emoticonsPath || self.basePath + 'plugins/emoticons/images/'),
|
||||||
|
allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons,
|
||||||
|
currentPageNum = 1;
|
||||||
|
self.clickToolbar(name, function() {
|
||||||
|
var rows = 5, cols = 9, total = 135, startNum = 0,
|
||||||
|
cells = rows * cols, pages = Math.ceil(total / cells),
|
||||||
|
colsHalf = Math.floor(cols / 2),
|
||||||
|
wrapperDiv = K('<div class="ke-plugin-emoticons"></div>'),
|
||||||
|
elements = [],
|
||||||
|
menu = self.createMenu({
|
||||||
|
name : name,
|
||||||
|
beforeRemove : function() {
|
||||||
|
removeEvent();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
menu.div.append(wrapperDiv);
|
||||||
|
var previewDiv, previewImg;
|
||||||
|
if (allowPreview) {
|
||||||
|
previewDiv = K('<div class="ke-preview"></div>').css('right', 0);
|
||||||
|
previewImg = K('<img class="ke-preview-img" src="' + path + startNum + '.gif" />');
|
||||||
|
wrapperDiv.append(previewDiv);
|
||||||
|
previewDiv.append(previewImg);
|
||||||
|
}
|
||||||
|
function bindCellEvent(cell, j, num) {
|
||||||
|
if (previewDiv) {
|
||||||
|
cell.mouseover(function() {
|
||||||
|
if (j > colsHalf) {
|
||||||
|
previewDiv.css('left', 0);
|
||||||
|
previewDiv.css('right', '');
|
||||||
|
} else {
|
||||||
|
previewDiv.css('left', '');
|
||||||
|
previewDiv.css('right', 0);
|
||||||
|
}
|
||||||
|
previewImg.attr('src', path + num + '.gif');
|
||||||
|
K(this).addClass('ke-on');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
cell.mouseover(function() {
|
||||||
|
K(this).addClass('ke-on');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
cell.mouseout(function() {
|
||||||
|
K(this).removeClass('ke-on');
|
||||||
|
});
|
||||||
|
cell.click(function(e) {
|
||||||
|
self.insertHtml('<img src="' + path + num + '.gif" border="0" alt="" />').hideMenu().focus();
|
||||||
|
e.stop();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function createEmoticonsTable(pageNum, parentDiv) {
|
||||||
|
var table = document.createElement('table');
|
||||||
|
parentDiv.append(table);
|
||||||
|
if (previewDiv) {
|
||||||
|
K(table).mouseover(function() {
|
||||||
|
previewDiv.show();
|
||||||
|
});
|
||||||
|
K(table).mouseout(function() {
|
||||||
|
previewDiv.hide();
|
||||||
|
});
|
||||||
|
elements.push(K(table));
|
||||||
|
}
|
||||||
|
table.className = 'ke-table';
|
||||||
|
table.cellPadding = 0;
|
||||||
|
table.cellSpacing = 0;
|
||||||
|
table.border = 0;
|
||||||
|
var num = (pageNum - 1) * cells + startNum;
|
||||||
|
for (var i = 0; i < rows; i++) {
|
||||||
|
var row = table.insertRow(i);
|
||||||
|
for (var j = 0; j < cols; j++) {
|
||||||
|
var cell = K(row.insertCell(j));
|
||||||
|
cell.addClass('ke-cell');
|
||||||
|
bindCellEvent(cell, j, num);
|
||||||
|
var span = K('<span class="ke-img"></span>')
|
||||||
|
.css('background-position', '-' + (24 * num) + 'px 0px')
|
||||||
|
.css('background-image', 'url(' + path + 'static.gif)');
|
||||||
|
cell.append(span);
|
||||||
|
elements.push(cell);
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return table;
|
||||||
|
}
|
||||||
|
var table = createEmoticonsTable(currentPageNum, wrapperDiv);
|
||||||
|
function removeEvent() {
|
||||||
|
K.each(elements, function() {
|
||||||
|
this.unbind();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var pageDiv;
|
||||||
|
function bindPageEvent(el, pageNum) {
|
||||||
|
el.click(function(e) {
|
||||||
|
removeEvent();
|
||||||
|
table.parentNode.removeChild(table);
|
||||||
|
pageDiv.remove();
|
||||||
|
table = createEmoticonsTable(pageNum, wrapperDiv);
|
||||||
|
createPageTable(pageNum);
|
||||||
|
currentPageNum = pageNum;
|
||||||
|
e.stop();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function createPageTable(currentPageNum) {
|
||||||
|
pageDiv = K('<div class="ke-page"></div>');
|
||||||
|
wrapperDiv.append(pageDiv);
|
||||||
|
for (var pageNum = 1; pageNum <= pages; pageNum++) {
|
||||||
|
if (currentPageNum !== pageNum) {
|
||||||
|
var a = K('<a href="javascript:;">[' + pageNum + ']</a>');
|
||||||
|
bindPageEvent(a, pageNum);
|
||||||
|
pageDiv.append(a);
|
||||||
|
elements.push(a);
|
||||||
|
} else {
|
||||||
|
pageDiv.append(K('@[' + pageNum + ']'));
|
||||||
|
}
|
||||||
|
pageDiv.append(K('@ '));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createPageTable(currentPageNum);
|
||||||
|
});
|
||||||
|
});
|
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.1 KiB |