MINOR Moved jstree piston origin to github (need to reapply patches)

This commit is contained in:
Ingo Schommer 2011-10-04 12:43:47 +02:00
parent 443777e789
commit 4b1b7d4ec7
58 changed files with 8358 additions and 340 deletions

View File

@ -1,8 +1,8 @@
--- ---
format: 1 format: 1
handler: handler:
piston:remote-revision: 236 commit: 53d377b047f45bb4d4042e5928130c66c01a6e8b
piston:uuid: 7ee4f3fb-cb41-0410-822c-dd8830bd4fbc branch: v.pre1.0
lock: false lock: false
repository_class: Piston::Svn::Repository repository_class: Piston::Git::Repository
repository_url: http://jstree.googlecode.com/svn/trunk repository_url: git://github.com/vakata/jstree.git

10
thirdparty/jstree/README.txt vendored Normal file
View File

@ -0,0 +1,10 @@
jsTree pre1.0
http://jstree.com/
Copyright (c) 2011 Ivan Bozhanov (vakata.com)
Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
This is the latest stable version before switching from GoogleCode to GitHub.

20
thirdparty/jstree/_demo/_dump.sql vendored Normal file
View File

@ -0,0 +1,20 @@
CREATE TABLE IF NOT EXISTS `tree` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` bigint(20) unsigned NOT NULL,
`position` bigint(20) unsigned NOT NULL,
`left` bigint(20) unsigned NOT NULL,
`right` bigint(20) unsigned NOT NULL,
`level` bigint(20) unsigned NOT NULL,
`title` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
`type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
INSERT INTO `tree` (`id`, `parent_id`, `position`, `left`, `right`, `level`, `title`, `type`) VALUES
(1, 0, 2, 1, 14, 0, 'ROOT', ''),
(2, 1, 0, 2, 11, 1, 'C:', 'drive'),
(3, 2, 0, 3, 6, 2, '_demo', 'folder'),
(4, 3, 0, 4, 5, 3, 'index.html', 'default'),
(5, 2, 1, 7, 10, 2, '_docs', 'folder'),
(6, 1, 1, 12, 13, 1, 'D:', 'drive'),
(12, 5, 0, 8, 9, 3, 'zmei.html', 'default');

View File

View File

@ -0,0 +1,146 @@
<?php
class _database {
private $link = false;
private $result = false;
private $row = false;
public $settings = array(
"servername"=> "localhost",
"serverport"=> "3306",
"username" => false,
"password" => false,
"database" => false,
"persist" => false,
"dieonerror"=> false,
"showerror" => false,
"error_file"=> true
);
function __construct() {
global $db_config;
$this->settings = array_merge($this->settings, $db_config);
if($this->settings["error_file"] === true) $this->settings["error_file"] = dirname(__FILE__)."/__mysql_errors.log";
}
function connect() {
if (!$this->link) {
$this->link = ($this->settings["persist"]) ?
mysql_pconnect(
$this->settings["servername"].":".$this->settings["serverport"],
$this->settings["username"],
$this->settings["password"]
) :
mysql_connect(
$this->settings["servername"].":".$this->settings["serverport"],
$this->settings["username"],
$this->settings["password"]
) or $this->error();
}
if (!mysql_select_db($this->settings["database"], $this->link)) $this->error();
if($this->link) mysql_query("SET NAMES 'utf8'");
return ($this->link) ? true : false;
}
function query($sql) {
if (!$this->link && !$this->connect()) $this->error();
if (!($this->result = mysql_query($sql, $this->link))) $this->error($sql);
return ($this->result) ? true : false;
}
function nextr() {
if(!$this->result) {
$this->error("No query pending");
return false;
}
unset($this->row);
$this->row = mysql_fetch_array($this->result, MYSQL_BOTH);
return ($this->row) ? true : false ;
}
function get_row($mode = "both") {
if(!$this->row) return false;
$return = array();
switch($mode) {
case "assoc":
foreach($this->row as $k => $v) {
if(!is_int($k)) $return[$k] = $v;
}
break;
case "num":
foreach($this->row as $k => $v) {
if(is_int($k)) $return[$k] = $v;
}
break;
default:
$return = $this->row;
break;
}
return array_map("stripslashes",$return);
}
function get_all($mode = "both", $key = false) {
if(!$this->result) {
$this->error("No query pending");
return false;
}
$return = array();
while($this->nextr()) {
if($key !== false) $return[$this->f($key)] = $this->get_row($mode);
else $return[] = $this->get_row($mode);
}
return $return;
}
function f($index) {
return stripslashes($this->row[$index]);
}
function go_to($row) {
if(!$this->result) {
$this->error("No query pending");
return false;
}
if(!mysql_data_seek($this->result, $row)) $this->error();
}
function nf() {
if ($numb = mysql_num_rows($this->result) === false) $this->error();
return mysql_num_rows($this->result);
}
function af() {
return mysql_affected_rows();
}
function error($string="") {
$error = mysql_error();
if($this->settings["show_error"]) echo $error;
if($this->settings["error_file"] !== false) {
$handle = @fopen($this->settings["error_file"], "a+");
if($handle) {
@fwrite($handle, "[".date("Y-m-d H:i:s")."] ".$string." <".$error.">\n");
@fclose($handle);
}
}
if($this->settings["dieonerror"]) {
if(isset($this->result)) mysql_free_result($this->result);
mysql_close($this->link);
die();
}
}
function insert_id() {
if(!$this->link) return false;
return mysql_insert_id();
}
function escape($string){
if(!$this->link) return addslashes($string);
return mysql_real_escape_string($string);
}
function destroy(){
if (isset($this->result)) mysql_free_result($this->result);
if (isset($this->link)) mysql_close($this->link);
}
}
?>

View File

@ -0,0 +1,152 @@
<?php
class _database {
private $data = false;
private $result = false;
private $row = false;
public $settings = array(
"servername"=> "localhost",
"serverport"=> "3306",
"username" => false,
"password" => false,
"database" => false,
"persist" => false,
"dieonerror"=> false,
"showerror" => false,
"error_file"=> true
);
function __construct() {
global $db_config;
$this->settings = array_merge($this->settings, $db_config);
if($this->settings["error_file"] === true) $this->settings["error_file"] = dirname(__FILE__)."/__mysql_errors.log";
}
function connect() {
$this->data = new mysqli(
$this->settings["servername"],
$this->settings["username"],
$this->settings["password"],
$this->settings["database"],
$this->settings["serverport"]
);
if(mysqli_connect_errno()) {
$this->error("Connection error: ".mysqli_connect_error() );
return false;
}
if(!$this->data->set_charset("utf8")) {
$this->error("Error loading character set utf8");
return false;
}
return true;
}
function query($sql) {
if(!$this->data && !$this->connect()) {
$this->error("Could node connect for query: ".$sql);
return false;
}
//echo $sql."<br />:";
if(!($this->result = $this->data->query($sql))) $this->error($sql);
return ($this->result) ? true : false;
}
function nextr(){
if(!$this->result) {
$this->error("No query pending");
return false;
}
unset($this->row);
$this->row = $this->result->fetch_array(MYSQL_BOTH);
return ($this->row) ? true : false ;
}
function get_row($mode = "both") {
if(!$this->row) return false;
$return = array();
switch($mode) {
case "assoc":
foreach($this->row as $k => $v) {
if(!is_int($k)) $return[$k] = $v;
}
break;
case "num":
foreach($this->row as $k => $v) {
if(is_int($k)) $return[$k] = $v;
}
break;
default:
$return = $this->row;
break;
}
return array_map("stripslashes",$return);
}
function get_all($mode = "both", $key = false) {
if(!$this->result) {
$this->error("No query pending");
return false;
}
$return = array();
while($this->nextr()) {
if($key !== false) $return[$this->f($key)] = $this->get_row($mode);
else $return[] = $this->get_row($mode);
}
return $return;
}
function f($index) {
return stripslashes($this->row[$index]);
}
function go_to($row) {
if(!$this->result) {
$this->error("No query pending");
return false;
}
if(!$this->data->data_seek($row)) $this->error();
}
function nf() {
if (!$this->result) {
$this->error("nf: no result set");
return false;
}
return $this->result->num_rows;
}
function af() {
return $this->data->affected_rows;
}
function error($string = "") {
$error = $this->data->error;
if($this->settings["show_error"]) echo $error;
if($this->settings["error_file"] !== false) {
$handle = @fopen($this->settings["error_file"], "a+");
if($handle) {
@fwrite($handle, "[".date("Y-m-d H:i:s")."] ".$string." <".$error.">\n");
@fclose($handle);
}
}
if($this->settings["dieonerror"]) {
if(isset($this->result)) $this->result->free();
@$this->data->close();
die();
}
}
function insert_id() {
return $this->data->insert_id;
}
function escape($string) {
if(!$this->data) return addslashes($string);
return $this->data->escape_string($string);
}
function destroy() {
if(isset($this->result)) $this->result->free();
if($this->data) $this->data->close();
}
}

View File

@ -0,0 +1,602 @@
<?php
class _tree_struct {
// Structure table and fields
protected $table = "";
protected $fields = array(
"id" => false,
"parent_id" => false,
"position" => false,
"left" => false,
"right" => false,
"level" => false
);
// Constructor
function __construct($table = "tree", $fields = array()) {
$this->table = $table;
if(!count($fields)) {
foreach($this->fields as $k => &$v) { $v = $k; }
}
else {
foreach($fields as $key => $field) {
switch($key) {
case "id":
case "parent_id":
case "position":
case "left":
case "right":
case "level":
$this->fields[$key] = $field;
break;
}
}
}
// Database
$this->db = new _database;
}
function _get_node($id) {
$this->db->query("SELECT `".implode("` , `", $this->fields)."` FROM `".$this->table."` WHERE `".$this->fields["id"]."` = ".(int) $id);
$this->db->nextr();
return $this->db->nf() === 0 ? false : $this->db->get_row("assoc");
}
function _get_children($id, $recursive = false) {
$children = array();
if($recursive) {
$node = $this->_get_node($id);
$this->db->query("SELECT `".implode("` , `", $this->fields)."` FROM `".$this->table."` WHERE `".$this->fields["left"]."` >= ".(int) $node[$this->fields["left"]]." AND `".$this->fields["right"]."` <= ".(int) $node[$this->fields["right"]]." ORDER BY `".$this->fields["left"]."` ASC");
}
else {
$this->db->query("SELECT `".implode("` , `", $this->fields)."` FROM `".$this->table."` WHERE `".$this->fields["parent_id"]."` = ".(int) $id." ORDER BY `".$this->fields["position"]."` ASC");
}
while($this->db->nextr()) $children[$this->db->f($this->fields["id"])] = $this->db->get_row("assoc");
return $children;
}
function _get_path($id) {
$node = $this->_get_node($id);
$path = array();
if(!$node === false) return false;
$this->db->query("SELECT `".implode("` , `", $this->fields)."` FROM `".$this->table."` WHERE `".$this->fields["left"]."` <= ".(int) $node[$this->fields["left"]]." AND `".$this->fields["right"]."` >= ".(int) $node[$this->fields["right"]]);
while($this->db->nextr()) $path[$this->db->f($this->fields["id"])] = $this->db->get_row("assoc");
return $path;
}
function _create($parent, $position) {
return $this->_move(0, $parent, $position);
}
function _remove($id) {
if((int)$id === 1) { return false; }
$data = $this->_get_node($id);
$lft = (int)$data[$this->fields["left"]];
$rgt = (int)$data[$this->fields["right"]];
$dif = $rgt - $lft + 1;
// deleting node and its children
$this->db->query("" .
"DELETE FROM `".$this->table."` " .
"WHERE `".$this->fields["left"]."` >= ".$lft." AND `".$this->fields["right"]."` <= ".$rgt
);
// shift left indexes of nodes right of the node
$this->db->query("".
"UPDATE `".$this->table."` " .
"SET `".$this->fields["left"]."` = `".$this->fields["left"]."` - ".$dif." " .
"WHERE `".$this->fields["left"]."` > ".$rgt
);
// shift right indexes of nodes right of the node and the node's parents
$this->db->query("" .
"UPDATE `".$this->table."` " .
"SET `".$this->fields["right"]."` = `".$this->fields["right"]."` - ".$dif." " .
"WHERE `".$this->fields["right"]."` > ".$lft
);
$pid = (int)$data[$this->fields["parent_id"]];
$pos = (int)$data[$this->fields["position"]];
// Update position of siblings below the deleted node
$this->db->query("" .
"UPDATE `".$this->table."` " .
"SET `".$this->fields["position"]."` = `".$this->fields["position"]."` - 1 " .
"WHERE `".$this->fields["parent_id"]."` = ".$pid." AND `".$this->fields["position"]."` > ".$pos
);
return true;
}
function _move($id, $ref_id, $position = 0, $is_copy = false) {
if((int)$ref_id === 0 || (int)$id === 1) { return false; }
$sql = array(); // Queries executed at the end
$node = $this->_get_node($id); // Node data
$nchildren = $this->_get_children($id); // Node children
$ref_node = $this->_get_node($ref_id); // Ref node data
$rchildren = $this->_get_children($ref_id);// Ref node children
$ndif = 2;
$node_ids = array(-1);
if($node !== false) {
$node_ids = array_keys($this->_get_children($id, true));
// TODO: should be !$is_copy && , but if copied to self - screws some right indexes
if(in_array($ref_id, $node_ids)) return false;
$ndif = $node[$this->fields["right"]] - $node[$this->fields["left"]] + 1;
}
if($position >= count($rchildren)) {
$position = count($rchildren);
}
// Not creating or copying - old parent is cleaned
if($node !== false && $is_copy == false) {
$sql[] = "" .
"UPDATE `".$this->table."` " .
"SET `".$this->fields["position"]."` = `".$this->fields["position"]."` - 1 " .
"WHERE " .
"`".$this->fields["parent_id"]."` = ".$node[$this->fields["parent_id"]]." AND " .
"`".$this->fields["position"]."` > ".$node[$this->fields["position"]];
$sql[] = "" .
"UPDATE `".$this->table."` " .
"SET `".$this->fields["left"]."` = `".$this->fields["left"]."` - ".$ndif." " .
"WHERE `".$this->fields["left"]."` > ".$node[$this->fields["right"]];
$sql[] = "" .
"UPDATE `".$this->table."` " .
"SET `".$this->fields["right"]."` = `".$this->fields["right"]."` - ".$ndif." " .
"WHERE " .
"`".$this->fields["right"]."` > ".$node[$this->fields["left"]]." AND " .
"`".$this->fields["id"]."` NOT IN (".implode(",", $node_ids).") ";
}
// Preparing new parent
$sql[] = "" .
"UPDATE `".$this->table."` " .
"SET `".$this->fields["position"]."` = `".$this->fields["position"]."` + 1 " .
"WHERE " .
"`".$this->fields["parent_id"]."` = ".$ref_id." AND " .
"`".$this->fields["position"]."` >= ".$position." " .
( $is_copy ? "" : " AND `".$this->fields["id"]."` NOT IN (".implode(",", $node_ids).") ");
$ref_ind = $ref_id === 0 ? (int)$rchildren[count($rchildren) - 1][$this->fields["right"]] + 1 : (int)$ref_node[$this->fields["right"]];
$ref_ind = max($ref_ind, 1);
$self = ($node !== false && !$is_copy && (int)$node[$this->fields["parent_id"]] == $ref_id && $position > $node[$this->fields["position"]]) ? 1 : 0;
foreach($rchildren as $k => $v) {
if($v[$this->fields["position"]] - $self == $position) {
$ref_ind = (int)$v[$this->fields["left"]];
break;
}
}
if($node !== false && !$is_copy && $node[$this->fields["left"]] < $ref_ind) {
$ref_ind -= $ndif;
}
$sql[] = "" .
"UPDATE `".$this->table."` " .
"SET `".$this->fields["left"]."` = `".$this->fields["left"]."` + ".$ndif." " .
"WHERE " .
"`".$this->fields["left"]."` >= ".$ref_ind." " .
( $is_copy ? "" : " AND `".$this->fields["id"]."` NOT IN (".implode(",", $node_ids).") ");
$sql[] = "" .
"UPDATE `".$this->table."` " .
"SET `".$this->fields["right"]."` = `".$this->fields["right"]."` + ".$ndif." " .
"WHERE " .
"`".$this->fields["right"]."` >= ".$ref_ind." " .
( $is_copy ? "" : " AND `".$this->fields["id"]."` NOT IN (".implode(",", $node_ids).") ");
$ldif = $ref_id == 0 ? 0 : $ref_node[$this->fields["level"]] + 1;
$idif = $ref_ind;
if($node !== false) {
$ldif = $node[$this->fields["level"]] - ($ref_node[$this->fields["level"]] + 1);
$idif = $node[$this->fields["left"]] - $ref_ind;
if($is_copy) {
$sql[] = "" .
"INSERT INTO `".$this->table."` (" .
"`".$this->fields["parent_id"]."`, " .
"`".$this->fields["position"]."`, " .
"`".$this->fields["left"]."`, " .
"`".$this->fields["right"]."`, " .
"`".$this->fields["level"]."`" .
") " .
"SELECT " .
"".$ref_id.", " .
"`".$this->fields["position"]."`, " .
"`".$this->fields["left"]."` - (".($idif + ($node[$this->fields["left"]] >= $ref_ind ? $ndif : 0))."), " .
"`".$this->fields["right"]."` - (".($idif + ($node[$this->fields["left"]] >= $ref_ind ? $ndif : 0))."), " .
"`".$this->fields["level"]."` - (".$ldif.") " .
"FROM `".$this->table."` " .
"WHERE " .
"`".$this->fields["id"]."` IN (".implode(",", $node_ids).") " .
"ORDER BY `".$this->fields["level"]."` ASC";
}
else {
$sql[] = "" .
"UPDATE `".$this->table."` SET " .
"`".$this->fields["parent_id"]."` = ".$ref_id.", " .
"`".$this->fields["position"]."` = ".$position." " .
"WHERE " .
"`".$this->fields["id"]."` = ".$id;
$sql[] = "" .
"UPDATE `".$this->table."` SET " .
"`".$this->fields["left"]."` = `".$this->fields["left"]."` - (".$idif."), " .
"`".$this->fields["right"]."` = `".$this->fields["right"]."` - (".$idif."), " .
"`".$this->fields["level"]."` = `".$this->fields["level"]."` - (".$ldif.") " .
"WHERE " .
"`".$this->fields["id"]."` IN (".implode(",", $node_ids).") ";
}
}
else {
$sql[] = "" .
"INSERT INTO `".$this->table."` (" .
"`".$this->fields["parent_id"]."`, " .
"`".$this->fields["position"]."`, " .
"`".$this->fields["left"]."`, " .
"`".$this->fields["right"]."`, " .
"`".$this->fields["level"]."` " .
") " .
"VALUES (" .
$ref_id.", " .
$position.", " .
$idif.", " .
($idif + 1).", " .
$ldif.
")";
}
foreach($sql as $q) { $this->db->query($q); }
$ind = $this->db->insert_id();
if($is_copy) $this->_fix_copy($ind, $position);
return $node === false || $is_copy ? $ind : true;
}
function _fix_copy($id, $position) {
$node = $this->_get_node($id);
$children = $this->_get_children($id, true);
$map = array();
for($i = $node[$this->fields["left"]] + 1; $i < $node[$this->fields["right"]]; $i++) {
$map[$i] = $id;
}
foreach($children as $cid => $child) {
if((int)$cid == (int)$id) {
$this->db->query("UPDATE `".$this->table."` SET `".$this->fields["position"]."` = ".$position." WHERE `".$this->fields["id"]."` = ".$cid);
continue;
}
$this->db->query("UPDATE `".$this->table."` SET `".$this->fields["parent_id"]."` = ".$map[(int)$child[$this->fields["left"]]]." WHERE `".$this->fields["id"]."` = ".$cid);
for($i = $child[$this->fields["left"]] + 1; $i < $child[$this->fields["right"]]; $i++) {
$map[$i] = $cid;
}
}
}
function _reconstruct() {
$this->db->query("" .
"CREATE TEMPORARY TABLE `temp_tree` (" .
"`".$this->fields["id"]."` INTEGER NOT NULL, " .
"`".$this->fields["parent_id"]."` INTEGER NOT NULL, " .
"`". $this->fields["position"]."` INTEGER NOT NULL" .
") type=HEAP"
);
$this->db->query("" .
"INSERT INTO `temp_tree` " .
"SELECT " .
"`".$this->fields["id"]."`, " .
"`".$this->fields["parent_id"]."`, " .
"`".$this->fields["position"]."` " .
"FROM `".$this->table."`"
);
$this->db->query("" .
"CREATE TEMPORARY TABLE `temp_stack` (" .
"`".$this->fields["id"]."` INTEGER NOT NULL, " .
"`".$this->fields["left"]."` INTEGER, " .
"`".$this->fields["right"]."` INTEGER, " .
"`".$this->fields["level"]."` INTEGER, " .
"`stack_top` INTEGER NOT NULL, " .
"`".$this->fields["parent_id"]."` INTEGER, " .
"`".$this->fields["position"]."` INTEGER " .
") type=HEAP"
);
$counter = 2;
$this->db->query("SELECT COUNT(*) FROM temp_tree");
$this->db->nextr();
$maxcounter = (int) $this->db->f(0) * 2;
$currenttop = 1;
$this->db->query("" .
"INSERT INTO `temp_stack` " .
"SELECT " .
"`".$this->fields["id"]."`, " .
"1, " .
"NULL, " .
"0, " .
"1, " .
"`".$this->fields["parent_id"]."`, " .
"`".$this->fields["position"]."` " .
"FROM `temp_tree` " .
"WHERE `".$this->fields["parent_id"]."` = 0"
);
$this->db->query("DELETE FROM `temp_tree` WHERE `".$this->fields["parent_id"]."` = 0");
while ($counter <= $maxcounter) {
$this->db->query("" .
"SELECT " .
"`temp_tree`.`".$this->fields["id"]."` AS tempmin, " .
"`temp_tree`.`".$this->fields["parent_id"]."` AS pid, " .
"`temp_tree`.`".$this->fields["position"]."` AS lid " .
"FROM `temp_stack`, `temp_tree` " .
"WHERE " .
"`temp_stack`.`".$this->fields["id"]."` = `temp_tree`.`".$this->fields["parent_id"]."` AND " .
"`temp_stack`.`stack_top` = ".$currenttop." " .
"ORDER BY `temp_tree`.`".$this->fields["position"]."` ASC LIMIT 1"
);
if ($this->db->nextr()) {
$tmp = $this->db->f("tempmin");
$q = "INSERT INTO temp_stack (stack_top, `".$this->fields["id"]."`, `".$this->fields["left"]."`, `".$this->fields["right"]."`, `".$this->fields["level"]."`, `".$this->fields["parent_id"]."`, `".$this->fields["position"]."`) VALUES(".($currenttop + 1).", ".$tmp.", ".$counter.", NULL, ".$currenttop.", ".$this->db->f("pid").", ".$this->db->f("lid").")";
$this->db->query($q);
$this->db->query("DELETE FROM `temp_tree` WHERE `".$this->fields["id"]."` = ".$tmp);
$counter++;
$currenttop++;
}
else {
$this->db->query("" .
"UPDATE temp_stack SET " .
"`".$this->fields["right"]."` = ".$counter.", " .
"`stack_top` = -`stack_top` " .
"WHERE `stack_top` = ".$currenttop
);
$counter++;
$currenttop--;
}
}
$temp_fields = $this->fields;
unset($temp_fields["parent_id"]);
unset($temp_fields["position"]);
unset($temp_fields["left"]);
unset($temp_fields["right"]);
unset($temp_fields["level"]);
if(count($temp_fields) > 1) {
$this->db->query("" .
"CREATE TEMPORARY TABLE `temp_tree2` " .
"SELECT `".implode("`, `", $temp_fields)."` FROM `".$this->table."` "
);
}
$this->db->query("TRUNCATE TABLE `".$this->table."`");
$this->db->query("" .
"INSERT INTO ".$this->table." (" .
"`".$this->fields["id"]."`, " .
"`".$this->fields["parent_id"]."`, " .
"`".$this->fields["position"]."`, " .
"`".$this->fields["left"]."`, " .
"`".$this->fields["right"]."`, " .
"`".$this->fields["level"]."` " .
") " .
"SELECT " .
"`".$this->fields["id"]."`, " .
"`".$this->fields["parent_id"]."`, " .
"`".$this->fields["position"]."`, " .
"`".$this->fields["left"]."`, " .
"`".$this->fields["right"]."`, " .
"`".$this->fields["level"]."` " .
"FROM temp_stack " .
"ORDER BY `".$this->fields["id"]."`"
);
if(count($temp_fields) > 1) {
$sql = "" .
"UPDATE `".$this->table."` v, `temp_tree2` SET v.`".$this->fields["id"]."` = v.`".$this->fields["id"]."` ";
foreach($temp_fields as $k => $v) {
if($k == "id") continue;
$sql .= ", v.`".$v."` = `temp_tree2`.`".$v."` ";
}
$sql .= " WHERE v.`".$this->fields["id"]."` = `temp_tree2`.`".$this->fields["id"]."` ";
$this->db->query($sql);
}
}
function _analyze() {
$report = array();
$this->db->query("" .
"SELECT " .
"`".$this->fields["left"]."` FROM `".$this->table."` s " .
"WHERE " .
"`".$this->fields["parent_id"]."` = 0 "
);
$this->db->nextr();
if($this->db->nf() == 0) {
$report[] = "[FAIL]\tNo root node.";
}
else {
$report[] = ($this->db->nf() > 1) ? "[FAIL]\tMore than one root node." : "[OK]\tJust one root node.";
}
$report[] = ($this->db->f(0) != 1) ? "[FAIL]\tRoot node's left index is not 1." : "[OK]\tRoot node's left index is 1.";
$this->db->query("" .
"SELECT " .
"COUNT(*) FROM `".$this->table."` s " .
"WHERE " .
"`".$this->fields["parent_id"]."` != 0 AND " .
"(SELECT COUNT(*) FROM `".$this->table."` WHERE `".$this->fields["id"]."` = s.`".$this->fields["parent_id"]."`) = 0 ");
$this->db->nextr();
$report[] = ($this->db->f(0) > 0) ? "[FAIL]\tMissing parents." : "[OK]\tNo missing parents.";
$this->db->query("SELECT MAX(`".$this->fields["right"]."`) FROM `".$this->table."`");
$this->db->nextr();
$n = $this->db->f(0);
$this->db->query("SELECT COUNT(*) FROM `".$this->table."`");
$this->db->nextr();
$c = $this->db->f(0);
$report[] = ($n/2 != $c) ? "[FAIL]\tRight index does not match node count." : "[OK]\tRight index matches count.";
$this->db->query("" .
"SELECT COUNT(`".$this->fields["id"]."`) FROM `".$this->table."` s " .
"WHERE " .
"(SELECT COUNT(*) FROM `".$this->table."` WHERE " .
"`".$this->fields["right"]."` < s.`".$this->fields["right"]."` AND " .
"`".$this->fields["left"]."` > s.`".$this->fields["left"]."` AND " .
"`".$this->fields["level"]."` = s.`".$this->fields["level"]."` + 1" .
") != " .
"(SELECT COUNT(*) FROM `".$this->table."` WHERE " .
"`".$this->fields["parent_id"]."` = s.`".$this->fields["id"]."`" .
") "
);
$this->db->nextr();
$report[] = ($this->db->f(0) > 0) ? "[FAIL]\tAdjacency and nested set do not match." : "[OK]\tNS and AJ match";
return implode("<br />",$report);
}
function _dump($output = false) {
$nodes = array();
$this->db->query("SELECT * FROM ".$this->table." ORDER BY `".$this->fields["left"]."`");
while($this->db->nextr()) $nodes[] = $this->db->get_row("assoc");
if($output) {
echo "<pre>";
foreach($nodes as $node) {
echo str_repeat("&#160;",(int)$node[$this->fields["level"]] * 2);
echo $node[$this->fields["id"]]." (".$node[$this->fields["left"]].",".$node[$this->fields["right"]].",".$node[$this->fields["level"]].",".$node[$this->fields["parent_id"]].",".$node[$this->fields["position"]].")<br />";
}
echo str_repeat("-",40);
echo "</pre>";
}
return $nodes;
}
function _drop() {
$this->db->query("TRUNCATE TABLE `".$this->table."`");
$this->db->query("" .
"INSERT INTO `".$this->table."` (" .
"`".$this->fields["id"]."`, " .
"`".$this->fields["parent_id"]."`, " .
"`".$this->fields["position"]."`, " .
"`".$this->fields["left"]."`, " .
"`".$this->fields["right"]."`, " .
"`".$this->fields["level"]."` " .
") " .
"VALUES (" .
"1, " .
"0, " .
"0, " .
"1, " .
"2, " .
"0 ".
")");
}
}
class json_tree extends _tree_struct {
function __construct($table = "tree", $fields = array(), $add_fields = array("title" => "title", "type" => "type")) {
parent::__construct($table, $fields);
$this->fields = array_merge($this->fields, $add_fields);
$this->add_fields = $add_fields;
}
function create_node($data) {
$id = parent::_create((int)$data[$this->fields["id"]], (int)$data[$this->fields["position"]]);
if($id) {
$data["id"] = $id;
$this->set_data($data);
return "{ \"status\" : 1, \"id\" : ".(int)$id." }";
}
return "{ \"status\" : 0 }";
}
function set_data($data) {
if(count($this->add_fields) == 0) { return "{ \"status\" : 1 }"; }
$s = "UPDATE `".$this->table."` SET `".$this->fields["id"]."` = `".$this->fields["id"]."` ";
foreach($this->add_fields as $k => $v) {
if(isset($data[$k])) $s .= ", `".$this->fields[$v]."` = \"".$this->db->escape($data[$k])."\" ";
else $s .= ", `".$this->fields[$v]."` = `".$this->fields[$v]."` ";
}
$s .= "WHERE `".$this->fields["id"]."` = ".(int)$data["id"];
$this->db->query($s);
return "{ \"status\" : 1 }";
}
function rename_node($data) { return $this->set_data($data); }
function move_node($data) {
$id = parent::_move((int)$data["id"], (int)$data["ref"], (int)$data["position"], (int)$data["copy"]);
if(!$id) return "{ \"status\" : 0 }";
if((int)$data["copy"] && count($this->add_fields)) {
$ids = array_keys($this->_get_children($id, true));
$data = $this->_get_children((int)$data["id"], true);
$i = 0;
foreach($data as $dk => $dv) {
$s = "UPDATE `".$this->table."` SET `".$this->fields["id"]."` = `".$this->fields["id"]."` ";
foreach($this->add_fields as $k => $v) {
if(isset($dv[$k])) $s .= ", `".$this->fields[$v]."` = \"".$this->db->escape($dv[$k])."\" ";
else $s .= ", `".$this->fields[$v]."` = `".$this->fields[$v]."` ";
}
$s .= "WHERE `".$this->fields["id"]."` = ".$ids[$i];
$this->db->query($s);
$i++;
}
}
return "{ \"status\" : 1, \"id\" : ".$id." }";
}
function remove_node($data) {
$id = parent::_remove((int)$data["id"]);
return "{ \"status\" : 1 }";
}
function get_children($data) {
$tmp = $this->_get_children((int)$data["id"]);
if((int)$data["id"] === 1 && count($tmp) === 0) {
$this->_create_default();
$tmp = $this->_get_children((int)$data["id"]);
}
$result = array();
if((int)$data["id"] === 0) return json_encode($result);
foreach($tmp as $k => $v) {
$result[] = array(
"attr" => array("id" => "node_".$k, "rel" => $v[$this->fields["type"]]),
"data" => $v[$this->fields["title"]],
"state" => ((int)$v[$this->fields["right"]] - (int)$v[$this->fields["left"]] > 1) ? "closed" : ""
);
}
return json_encode($result);
}
function search($data) {
$this->db->query("SELECT `".$this->fields["left"]."`, `".$this->fields["right"]."` FROM `".$this->table."` WHERE `".$this->fields["title"]."` LIKE '%".$this->db->escape($data["search_str"])."%'");
if($this->db->nf() === 0) return "[]";
$q = "SELECT DISTINCT `".$this->fields["id"]."` FROM `".$this->table."` WHERE 0 ";
while($this->db->nextr()) {
$q .= " OR (`".$this->fields["left"]."` < ".(int)$this->db->f(0)." AND `".$this->fields["right"]."` > ".(int)$this->db->f(1).") ";
}
$result = array();
$this->db->query($q);
while($this->db->nextr()) { $result[] = "#node_".$this->db->f(0); }
return json_encode($result);
}
function _create_default() {
$this->_drop();
$this->create_node(array(
"id" => 1,
"position" => 0,
"title" => "C:",
"type" => "drive"
));
$this->create_node(array(
"id" => 1,
"position" => 1,
"title" => "D:",
"type" => "drive"
));
$this->create_node(array(
"id" => 2,
"position" => 0,
"title" => "_demo",
"type" => "folder"
));
$this->create_node(array(
"id" => 2,
"position" => 1,
"title" => "_docs",
"type" => "folder"
));
$this->create_node(array(
"id" => 4,
"position" => 0,
"title" => "index.html",
"type" => "default"
));
$this->create_node(array(
"id" => 5,
"position" => 1,
"title" => "doc.html",
"type" => "default"
));
}
}
?>

6
thirdparty/jstree/_demo/_install.txt vendored Normal file
View File

@ -0,0 +1,6 @@
1) Create a database and a user with all privileges for this database.
2) Edit the config.php file and update the configuration for the database at the top of the file
3) Import the _dump.sql in your newly created database
4) You are ready to go
*) PLEASE NOTE THAT THE PHP TREE CLASS HAS NOT BEEN THOROUGHLY TESTED

14
thirdparty/jstree/_demo/config.php vendored Normal file
View File

@ -0,0 +1,14 @@
<?php
// Database config & class
$db_config = array(
"servername"=> "localhost",
"username" => "root",
"password" => "",
"database" => ""
);
if(extension_loaded("mysqli")) require_once("_inc/class._database_i.php");
else require_once("_inc/class._database.php");
// Tree class
require_once("_inc/class.tree.php");
?>

BIN
thirdparty/jstree/_demo/file.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

BIN
thirdparty/jstree/_demo/folder.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

461
thirdparty/jstree/_demo/index.html vendored Normal file
View File

@ -0,0 +1,461 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - Demo</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="../_docs/syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="../_docs/!style.css"/>
<script type="text/javascript" src="../_docs/syntax/!script.js"></script>
</head>
<body id="demo_body">
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>DEMO</h1>
<h2>Creating a tree, binding events, using the instance</h2>
<div id="description">
<p>Here is how you create an instance, bind an event and then get the instance.</p>
<div id="demo1" class="demo" style="height:100px;">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source below">
$(function () {
// TO CREATE AN INSTANCE
// select the tree container using jQuery
$("#demo1")
// call `.jstree` with the options object
.jstree({
// the `plugins` array allows you to configure the active plugins on this instance
"plugins" : ["themes","html_data","ui","crrm","hotkeys"],
// each plugin you have included can have its own config object
"core" : { "initially_open" : [ "phtml_1" ] }
// it makes sense to configure a plugin only if overriding the defaults
})
// EVENTS
// each instance triggers its own events - to process those listen on the container
// all events are in the `.jstree` namespace
// so listen for `function_name`.`jstree` - you can function names from the docs
.bind("loaded.jstree", function (event, data) {
// you get two params - event & data - check the core docs for a detailed description
});
// INSTANCES
// 1) you can call most functions just by selecting the container and calling `.jstree("func",`
setTimeout(function () { $("#demo1").jstree("set_focus"); }, 500);
// with the methods below you can call even private functions (prefixed with `_`)
// 2) you can get the focused instance using `$.jstree._focused()`.
setTimeout(function () { $.jstree._focused().select_node("#phtml_1"); }, 1000);
// 3) you can use $.jstree._reference - just pass the container, a node inside it, or a selector
setTimeout(function () { $.jstree._reference("#phtml_1").close_node("#phtml_1"); }, 1500);
// 4) when you are working with an event you can use a shortcut
$("#demo1").bind("open_node.jstree", function (e, data) {
// data.inst is the instance which triggered this event
data.inst.select_node("#phtml_2", true);
});
setTimeout(function () { $.jstree._reference("#phtml_1").open_node("#phtml_1"); }, 2500);
});
</script>
</div>
<h2>Doing something when the tree is loaded</h2>
<div id="description">
<p>You can use a few events to do that.</p>
<div id="demo2" class="demo" style="height:100px;">
<ul>
<li id="rhtml_1" class="jstree-open">
<a href="#">Root node 1</a>
<ul>
<li id="rhtml_2">
<a href="#">Child node 1</a>
</li>
<li id="rhtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="rhtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source below">
// Note method 2) and 3) use `one`, this is because if `refresh` is called those events are triggered
$(function () {
$("#demo2")
.jstree({ "plugins" : ["themes","html_data","ui"] })
// 1) the loaded event fires as soon as data is parsed and inserted
.bind("loaded.jstree", function (event, data) { })
// 2) but if you are using the cookie plugin or the core `initially_open` option:
.one("reopen.jstree", function (event, data) { })
// 3) but if you are using the cookie plugin or the UI `initially_select` option:
.one("reselect.jstree", function (event, data) { });
});
</script>
</div>
<h2>Doing something when a node is clicked</h2>
<div id="description">
<div id="demo3" class="demo" style="height:100px;">
<ul>
<li id="shtml_1" class="jstree-open">
<a href="#">Root node 1</a>
<ul>
<li id="shtml_2">
<a href="#">Child node 1</a>
</li>
<li id="shtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="shtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source below">
$(function () {
$("#demo3")
.jstree({ "plugins" : ["themes","html_data","ui"] })
// 1) if using the UI plugin bind to select_node
.bind("select_node.jstree", function (event, data) {
// `data.rslt.obj` is the jquery extended node that was clicked
alert(data.rslt.obj.attr("id"));
})
// 2) if not using the UI plugin - the Anchor tags work as expected
// so if the anchor has a HREF attirbute - the page will be changed
// you can actually prevent the default, etc (normal jquery usage)
.delegate("a", "click", function (event, data) { event.preventDefault(); })
});
</script>
</div>
<h2>Using CSS to make nodes wrap</h2>
<div id="description">
<div id="demo4" class="demo" style="height:120px;">
<ul>
<li class="jstree-open">
<a href="#">Root node 1</a>
<ul>
<li>
<a href="#">Child node 1 with a long text which would normally just cause a scrollbar, but with this line of CSS it will actually wrap, this is not really throughly tested but it works</a>
</li>
<li>
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li>
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<style type="text/css" class="source below">
#demo4 a { white-space:normal !important; height: auto; padding:1px 2px; }
#demo4 li > ins { vertical-align:top; }
#demo4 .jstree-hovered, #demo4 .jstree-clicked { border:0; }
</style>
<script type="text/javascript">
$(function () {
$("#demo4")
.jstree({ "plugins" : ["themes","html_data","ui"] });
});
</script>
</div>
<h2>Using CSS to make the nodes bigger</h2>
<div id="description">
<div id="demo5" class="demo" style="height:120px;">
<ul>
<li class="jstree-open">
<a href="#">Root node 1</a>
<ul>
<li>
<a href="#">Child node 1 with a long text which would normally just cause a scrollbar, but with this line of CSS it will actually wrap, this is not really throughly tested but it works</a>
</li>
<li>
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li>
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<style type="text/css" class="source below">
#demo5 li { min-height:22px; line-height:22px; }
#demo5 a { line-height:20px; height:20px; font-size:10px; }
#demo5 a ins { height:20px; width:20px; background-position:-56px -17px; }
</style>
<script type="text/javascript">
$(function () {
$("#demo5")
.jstree({ "plugins" : ["themes","html_data","ui"] });
});
</script>
</div>
<h2>PHP &amp; mySQL demo + event order</h2>
<div id="description">
<p>Here is a PHP &amp; mySQL enabled demo. You can use the classes/DB structure included, but those are not thoroughly tested and not officially a part of jstree. In the log window you can also see all function calls as they happen on the instance.</p>
<div id="mmenu" style="height:30px; overflow:auto;">
<input type="button" id="add_folder" value="add folder" style="display:block; float:left;"/>
<input type="button" id="add_default" value="add file" style="display:block; float:left;"/>
<input type="button" id="rename" value="rename" style="display:block; float:left;"/>
<input type="button" id="remove" value="remove" style="display:block; float:left;"/>
<input type="button" id="cut" value="cut" style="display:block; float:left;"/>
<input type="button" id="copy" value="copy" style="display:block; float:left;"/>
<input type="button" id="paste" value="paste" style="display:block; float:left;"/>
<input type="button" id="clear_search" value="clear" style="display:block; float:right;"/>
<input type="button" id="search" value="search" style="display:block; float:right;"/>
<input type="text" id="text" value="" style="display:block; float:right;" />
</div>
<!-- the tree container (notice NOT an UL node) -->
<div id="demo" class="demo" style="height:200px;"></div>
<div style="height:30px; text-align:center;">
<input type="button" style='width:170px; height:24px; margin:5px auto;' value="reconstruct" onclick="$.get('./server.php?reconstruct', function () { $('#demo').jstree('refresh',-1); });" />
<input type="button" style='width:170px; height:24px; margin:5px auto;' id="analyze" value="analyze" onclick="$('#alog').load('./server.php?analyze');" />
<input type="button" style='width:170px; height:24px; margin:5px auto;' value="refresh" onclick="$('#demo').jstree('refresh',-1);" />
</div>
<div id='alog' style="border:1px solid gray; padding:5px; height:100px; margin-top:15px; overflow:auto; font-family:Monospace;"></div>
<!-- JavaScript neccessary for the tree -->
<script type="text/javascript" class="source below">
$(function () {
$("#demo")
.bind("before.jstree", function (e, data) {
$("#alog").append(data.func + "<br />");
})
.jstree({
// List of active plugins
"plugins" : [
"themes","json_data","ui","crrm","cookies","dnd","search","types","hotkeys","contextmenu"
],
// I usually configure the plugin that handles the data first
// This example uses JSON as it is most common
"json_data" : {
// This tree is ajax enabled - as this is most common, and maybe a bit more complex
// All the options are almost the same as jQuery's AJAX (read the docs)
"ajax" : {
// the URL to fetch the data
"url" : "./server.php",
// the `data` function is executed in the instance's scope
// the parameter is the node being loaded
// (may be -1, 0, or undefined when loading the root nodes)
"data" : function (n) {
// the result is fed to the AJAX request `data` option
return {
"operation" : "get_children",
"id" : n.attr ? n.attr("id").replace("node_","") : 1
};
}
}
},
// Configuring the search plugin
"search" : {
// As this has been a common question - async search
// Same as above - the `ajax` config option is actually jQuery's AJAX object
"ajax" : {
"url" : "./server.php",
// You get the search string as a parameter
"data" : function (str) {
return {
"operation" : "search",
"search_str" : str
};
}
}
},
// Using types - most of the time this is an overkill
// read the docs carefully to decide whether you need types
"types" : {
// I set both options to -2, as I do not need depth and children count checking
// Those two checks may slow jstree a lot, so use only when needed
"max_depth" : -2,
"max_children" : -2,
// I want only `drive` nodes to be root nodes
// This will prevent moving or creating any other type as a root node
"valid_children" : [ "drive" ],
"types" : {
// The default type
"default" : {
// I want this type to have no children (so only leaf nodes)
// In my case - those are files
"valid_children" : "none",
// If we specify an icon for the default type it WILL OVERRIDE the theme icons
"icon" : {
"image" : "./file.png"
}
},
// The `folder` type
"folder" : {
// can have files and other folders inside of it, but NOT `drive` nodes
"valid_children" : [ "default", "folder" ],
"icon" : {
"image" : "./folder.png"
}
},
// The `drive` nodes
"drive" : {
// can have files and folders inside, but NOT other `drive` nodes
"valid_children" : [ "default", "folder" ],
"icon" : {
"image" : "./root.png"
},
// those prevent the functions with the same name to be used on `drive` nodes
// internally the `before` event is used
"start_drag" : false,
"move_node" : false,
"delete_node" : false,
"remove" : false
}
}
},
// UI & core - the nodes to initially select and open will be overwritten by the cookie plugin
// the UI plugin - it handles selecting/deselecting/hovering nodes
"ui" : {
// this makes the node with ID node_4 selected onload
"initially_select" : [ "node_4" ]
},
// the core plugin - not many options here
"core" : {
// just open those two nodes up
// as this is an AJAX enabled tree, both will be downloaded from the server
"initially_open" : [ "node_2" , "node_3" ]
}
})
.bind("create.jstree", function (e, data) {
$.post(
"./server.php",
{
"operation" : "create_node",
"id" : data.rslt.parent.attr("id").replace("node_",""),
"position" : data.rslt.position,
"title" : data.rslt.name,
"type" : data.rslt.obj.attr("rel")
},
function (r) {
if(r.status) {
$(data.rslt.obj).attr("id", "node_" + r.id);
}
else {
$.jstree.rollback(data.rlbk);
}
}
);
})
.bind("remove.jstree", function (e, data) {
data.rslt.obj.each(function () {
$.ajax({
async : false,
type: 'POST',
url: "./server.php",
data : {
"operation" : "remove_node",
"id" : this.id.replace("node_","")
},
success : function (r) {
if(!r.status) {
data.inst.refresh();
}
}
});
});
})
.bind("rename.jstree", function (e, data) {
$.post(
"./server.php",
{
"operation" : "rename_node",
"id" : data.rslt.obj.attr("id").replace("node_",""),
"title" : data.rslt.new_name
},
function (r) {
if(!r.status) {
$.jstree.rollback(data.rlbk);
}
}
);
})
.bind("move_node.jstree", function (e, data) {
data.rslt.o.each(function (i) {
$.ajax({
async : false,
type: 'POST',
url: "./server.php",
data : {
"operation" : "move_node",
"id" : $(this).attr("id").replace("node_",""),
"ref" : data.rslt.cr === -1 ? 1 : data.rslt.np.attr("id").replace("node_",""),
"position" : data.rslt.cp + i,
"title" : data.rslt.name,
"copy" : data.rslt.cy ? 1 : 0
},
success : function (r) {
if(!r.status) {
$.jstree.rollback(data.rlbk);
}
else {
$(data.rslt.oc).attr("id", "node_" + r.id);
if(data.rslt.cy && $(data.rslt.oc).children("UL").length) {
data.inst.refresh(data.inst._get_parent(data.rslt.oc));
}
}
$("#analyze").click();
}
});
});
});
});
</script>
<script type="text/javascript" class="source below">
// Code for the menu buttons
$(function () {
$("#mmenu input").click(function () {
switch(this.id) {
case "add_default":
case "add_folder":
$("#demo").jstree("create", null, "last", { "attr" : { "rel" : this.id.toString().replace("add_", "") } });
break;
case "search":
$("#demo").jstree("search", document.getElementById("text").value);
break;
case "text": break;
default:
$("#demo").jstree(this.id);
break;
}
});
});
</script>
</div>
</div>
</body>
</html>

BIN
thirdparty/jstree/_demo/root.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

69
thirdparty/jstree/_demo/server.php vendored Normal file
View File

@ -0,0 +1,69 @@
<?php
require_once("config.php");
$jstree = new json_tree();
//$jstree->_create_default();
//die();
if(isset($_GET["reconstruct"])) {
$jstree->_reconstruct();
die();
}
if(isset($_GET["analyze"])) {
echo $jstree->_analyze();
die();
}
if($_REQUEST["operation"] && strpos($_REQUEST["operation"], "_") !== 0 && method_exists($jstree, $_REQUEST["operation"])) {
header("HTTP/1.0 200 OK");
header('Content-type: application/json; charset=utf-8');
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
echo $jstree->{$_REQUEST["operation"]}($_REQUEST);
die();
}
header("HTTP/1.0 404 Not Found");
?>
<?php
/*
$jstree->_drop();
$jstree->create_node(array("id"=>0,"position"=>0));
$jstree->create_node(array("id"=>1,"position"=>0));
$jstree->create_node(array("id"=>1,"position"=>0));
$jstree->create_node(array("id"=>3,"position"=>0,"name"=>"Pesho"));
$jstree->move(3,2,0,true);
$jstree->_dump(true);
$jstree->_reconstruct();
echo $jstree->_analyze();
die();
$tree = new _tree_struct;
$tree->drop();
$tree->create(0, 0);
$tree->create(0, 0);
$tree->create(1, 0);
$tree->create(0, 3);
$tree->create(2, 3);
$tree->create(2, 0);
$tree->dump(true);
$tree->move(6,4,0);
$tree->move(1,0,0);
$tree->move(3,2,99,true);
$tree->move(7,1,0,true);
$tree->move(1,7,0);
$tree->move(1,0,1,true);
$tree->move(2, 0, 0, true);
$tree->move(13, 12, 2, true);
$tree->dump(true);
$tree->move(15, 16, 2, true);
$tree->dump(true);
$tree->move(4, 0, 0);
$tree->dump(true);
$tree->move(4, 0, 2);
$tree->dump(true);
echo $tree->analyze();
$tree->drop();
*/
?>

48
thirdparty/jstree/_docs/!style.css vendored Normal file
View File

@ -0,0 +1,48 @@
html, body { margin:0; padding:0; background:#D9E3CB; }
body, td, th, pre, code, select, option, input, textarea { font-family:"lucida grande",tahoma,verdana,arial,sans-serif; font-size:10pt; }
#dhead { margin:0 0 0 -10px; padding:0; line-height:80px; font-size:18pt; font-family:Georgia; /*text-shadow:1px 1px 2px gray;*/ border-bottom:10px solid #73796B; margin-bottom:0.5em; text-align:center; width:820px; background:black; color:white; -moz-border-radius:5px 5px 0 0; border-radius:5px 5px 0 0; -webkit-border-radius:5px 5px 0 0; text-indent:-2000px; background:black url("logo.png") center center no-repeat; }
h1 { margin:0 0 0 0px; padding:0; font-size:14pt; font-family:Georgia; /*text-shadow:1px 1px 2px gray;*/ margin-bottom:1em; text-align:center; text-transform:uppercase;}
h2 { margin:0.5em 0 0.5em 0; padding:0.5em 0 0.5em 20px; font-size:12pt; font-family:Georgia; color:white; background:silver; text-shadow:1px 1px 2px gray; clear:both; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; }
h3 { margin:0; padding:0.5em 0 0.5em 0; font-size:11.5pt; font-family:Georgia; color:gray; clear:both; }
p { padding:0em 0 0.5em 0; margin:0; line-height:1.8em; }
p.meta { font-size:9pt; color:gray; margin-top:-5px; }
.arguments .tp, p code { color:green; padding:0 4px; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size:13px; }
#description, .panel { margin:0 20px; }
#container { width:800px; margin:10px auto; overflow:hidden; background:white; padding:0 10px 10px 10px; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; -moz-box-shadow: 0px 0px 10px #000; }
.demo { width:255px; float:left; margin:0; border:1px solid gray; background:white; overflow:auto; }
.code { width:490px; float:right; margin:0 0 10px 0; border:1px solid gray; font-size:12px; }
pre { display:block; }
.code_f { border:1px solid gray; margin-bottom:1em; }
.syntaxhighlighter { margin:0 0 0 0 !important; padding:0 !important; line-height:18px; }
.log { padding:4px; border:1px solid gray; margin-bottom:1em; }
.button { display:block; margin-bottom:0.5em; }
.arguments { margin:0em 1em; padding:0; list-style-type:none; }
.arguments .tp { padding:0 0 0 0; float:left; width:70px; }
.arguments strong { display:block; }
.api h3 { margin-left:-10px; color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:14px; margin-top:2em; border-top:1px solid; width:780px; }
.api .arguments li strong { color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:13px; }
.configuration h3 { margin-left:-10px; color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:14px; margin-top:2em; border-top:1px solid; width:780px; }
.note { background:#ffffee; padding:10px 20px; border:1px solid #333; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; margin-bottom:15px; text-align:center; font-weight:bold; }
.plugins, .demos { margin:0 auto 20px auto; }
ul.columns { list-style-type:none; width:700px; margin:0px auto 15px auto; padding:0; overflow:hidden; }
ul.columns li { float:left; margin:0; padding:0 0 0 0px; line-height:18px; width:345px; }
ul.demos li, ul.plugins li { width:220px; text-align:left; padding:5px 0; }
ul.demos li a, ul.plugins li a { text-decoration:none; color:#3B5998; }
ul.demos li a:hover, ul.plugins li a:hover { text-decoration:underline; }
ul.plugins li p { text-align:left; font-size:9px; color:#333; margin:0 5px 0 0; }
ul.demos li { width:auto; }
.demo, .demo input, .jstree-dnd-helper, #vakata-contextmenu { font-size:10px; font-family:Verdana; }
#demo_body .demo, #demo_body .code { width:auto; float:none; clear:both; margin:10px auto; }
#demo_body .code { margin-bottom:20px; }
ul.jstree { width:700px; margin:0px auto 15px auto; padding:0; }
ul.jstree li { margin:0; padding:2px 0; }
ul.jstree li a { color:#3B5998; text-decoration:underline; }

BIN
thirdparty/jstree/_docs/_drive.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

View File

@ -0,0 +1,2 @@
<li class="jstree-closed"><a href="#">Node 1</a></li>
<li><a href="#">Node 2</a></li>

View File

@ -0,0 +1,4 @@
[
{ "data" : "A node", "children" : [ { "data" : "Only child", "state" : "closed" } ], "state" : "open" },
"Ajax node"
]

View File

@ -0,0 +1,6 @@
[
"Ajax node 1",
"Ajax node 2",
"TARGET",
"Ajax node 4"
]

View File

@ -0,0 +1 @@
[ "#root_node" ]

12
thirdparty/jstree/_docs/_xml_flat.xml vendored Normal file
View File

@ -0,0 +1,12 @@
<root>
<item parent_id="0" id="node_1" state="closed">
<content>
<name><![CDATA[Node 1]]></name>
</content>
</item>
<item parent_id="0" id="node_2">
<content>
<name><![CDATA[Node 2]]></name>
</content>
</item>
</root>

18
thirdparty/jstree/_docs/_xml_nest.xml vendored Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<item id="pxml_1">
<content><name><![CDATA[Root node 1]]></name></content>
<item id="pxml_2">
<content><name><![CDATA[Child node 1]]></name></content>
</item>
<item id="pxml_3">
<content><name><![CDATA[Child node 2]]></name></content>
</item>
<item id="pxml_4">
<content><name><![CDATA[Some other child node]]></name></content>
</item>
</item>
<item id="pxml_5">
<content><name ><![CDATA[Root node 2]]></name></content>
</item>
</root>

171
thirdparty/jstree/_docs/checkbox.html vendored Normal file
View File

@ -0,0 +1,171 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - checkbox documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>checkbox plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>checkbox</code> plugin makes multiselection possible using three-state checkboxes.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>override_ui</h3>
<p class="meta">A boolean. Default is <code>false</code>.</p>
<p>If set to <code>true</code> all selection will be handled by checkboxes. The checkbox plugin will map UI's <a href="ui.html#get_selected">get_selected function</a> to its own <a href="#get_checked">get_checked function</a> and overwrite the <a href="ui.html#reselect">UI reselect function</a>. It will also disable the <code>select_node</code>, <code>deselect_node</code> and <code>deselect_all</code> functions. If left as <code>false</code> nodes can be selected and checked independently. </p>
<h3>checked_parent_open</h3>
<p class="meta">A Boolean. Default is <code>true</code>.</p>
<p>When set to <code>true</code> when programatically checking a node in the tree all of its closed parents are opened automatically.</p>
<h3>two_state</h3>
<p class="meta">A boolean. Default is <code>false</code>.</p>
<p>If set to <code>true</code> checkboxes will be two-state only, meaning that you will be able to select parent and children independently and there will be no undetermined state.</p>
<h3>real_checkboxes</h3>
<p class="meta">A boolean. Default is <code>false</code>.</p>
<p>If set to <code>true</code> real hidden checkboxes will be created for each element, so if the tree is part of a form, checked nodes will be submitted automatically. By default the name of the checkbox is <code>"check_" + <em>the ID of the LI element</em></code> and the value is <code>1</code>, this can be changed using the <code>real_checkboxes_names</code> config option.</p>
<h3>real_checkboxes_names</h3>
<p class="meta">A function. Default is <code>function (n) { return [("check_" + (n[0].id || Math.ceil(Math.random() * 10000))), 1]; }</code>.</p>
<p>If real checkboxes are used this function is invoked in the current tree's scope for each new checkbox that is created. It receives a single argument - the node that will contain the checkbox. The function must return an array consisting of two values - the name for the checkbox and the value for the checkbox.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the checkbox plugin - all you need to do is include it in the list of active plugins.</h3>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2" class="jstree-checked">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">A Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"plugins" : [ "themes", "html_data", "checkbox", "sort", "ui" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="_prepare_checkboxes">._prepare_checkboxes ( node )</h3>
<p>Inserts the checkbox icons on the node. Used internally.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<h3 id="_repair_state">._repair_state ( node )</h3>
<p>Repairs the checkbox state inside the node. Used internally.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<h3 id="change_state">.change_state ( node , uncheck )</h3>
<p>Changes the state of a node. Used mostly internally - you'd be better off using the <code>check_node</code> and <code>uncheck_node</code> functions. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
<li>
<code class="tp">boolean</code> <strong>uncheck</strong>
<p>If set to <code>true</code> the node is unchecked, if set to <code>false</code> the node is checked, otherwise - the state is toggled.</p>
</li>
</ul>
<h3 id="check_node">.check_node ( node )</h3>
<p>Checks a node.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<h3 id="uncheck_node">.uncheck_node ( node )</h3>
<p>Unchecks a node.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<h3 id="check_all">.check_all ( )</h3>
<p>Checks all nodes.</p>
<h3 id="uncheck_all">.uncheck_all ( )</h3>
<p>Unchecks all nodes.</p>
<h3 id="is_checked">.is_checked ( node )</h3>
<p>Checks if a node is checked. Returns boolean.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="get_unchecked">&#160;</span></div>
<h3 id="get_checked">.get_checked ( context, get_all ), .get_unchecked ( context, get_all )</h3>
<p>Both functions return jQuery collections.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>context</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If specified only nodes inside the specified context are returned, otherwise the whole tree is searched.</p>
</li>
<li>
<code class="tp">boolean</code> <strong>get_all</strong>
<p>By default these functions return only top level checked/unchecked nodes (if a node is checked its children are note returned), if this parameter is set to <code>true</code> they will return all checked/unchecked nodes.</p>
</li>
</ul>
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="hide_checkboxes">&#160;</span></div>
<h3 id="show_checkboxes">.show_checkboxes ( ), .hide_checkboxes ( )</h3>
<p>Show or hide the checkbox icons.</p>
</div>
</div>
</body>
</html>

121
thirdparty/jstree/_docs/contextmenu.html vendored Normal file
View File

@ -0,0 +1,121 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - contextmenu documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>contextmenu plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>contextmenu</code> plugin enables a contextual menu to be shown, when the user right-clicks a node (or when triggered programatically by the developer).</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>select_node</h3>
<p class="meta">Boolean. Default is <code>false</code>.</p>
<p>Whether to select the right clicked node when showing the context menu. If this is set to <code>true</code> and the node is not selected all currently selected nodes will be deselected.</p>
<h3>show_at_node</h3>
<p class="meta">Boolean. Default is <code>true</code>.</p>
<p>Whether to show the context menu just below the node, or at the clicked point exactly.</p>
<h3>items</h3>
<p>Expects an object or a function, which should return an object. If a function is used it fired in the tree's context and receives one argument - the node that was right clicked. The object format is:</p>
<div style="border:1px solid gray">
<pre class="brush:js">
{
// Some key
"rename" : {
// The item label
"label" : "Rename",
// The function to execute upon a click
"action" : function (obj) { this.rename(obj); },
// All below are optional
"_disabled" : true, // clicking the item won't do a thing
"_class" : "class", // class is applied to the item LI node
"separator_before" : false, // Insert a separator before the item
"separator_after" : true, // Insert a separator after the item
// false or string - if does not contain `/` - used as classname
"icon" : false,
"submenu" : {
/* Collection of objects (the same structure) */
}
}
/* MORE ENTRIES ... */
}
</pre>
</div>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the contextmenu</h3>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"plugins" : [ "themes", "html_data", "ui", "crrm", "contextmenu" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="show_contextmenu">.show_contextmenu ( node , x, y )</h3>
<p>Shows the contextmenu next to a node. Triggered automatically when right-clicking a node.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
<li>
<code class="tp">number</code> <strong>x</strong>
<p>The X-coordinate to show the menu at - may be overwritten by <code>show_at_node</code>. If you omit this the menu is shown aligned with the left of the node.</p>
</li>
<li>
<code class="tp">number</code> <strong>y</strong>
<p>The Y-coordinate to show the menu at - may be overwritten by <code>show_at_node</code>. If you omit this the menu is shown just below the node.</p>
</li>
</ul>
</div>
</div>
</body>
</html>

97
thirdparty/jstree/_docs/cookies.html vendored Normal file
View File

@ -0,0 +1,97 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - cookies documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>cookies plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>cookies</code> enables jstree to save the state of the tree across sessions. What this does is save the opened and selected nodes in a cookie, and reopen &amp; reselect them the next time the user loads the tree. Depends on the <a href="http://plugins.jquery.com/project/cookie">jQuery.cookie</a> plugin. </p><p class="note">The nodes need to have IDs for this plugin to work.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>save_opened</h3>
<p class="meta">A string (or <code>false</code>). Default is <code>"jstree_open"</code>.</p>
<p>The name of the cookie to save opened nodes in. If set to <code>false</code> - opened nodes won't be saved.</p>
<h3>save_selected</h3>
<p class="meta">A string (or <code>false</code>). Default is <code>"jstree_select"</code>.</p>
<p>The name of the cookie to save selected nodes in. If set to <code>false</code> - selected nodes won't be saved.</p>
<h3>auto_save</h3>
<p class="meta">A Boolean. Default is <code>true</code>.</p>
<p>If set to <code>true</code> jstree will automatically update the cookies every time a change in the state occurs.</p>
<h3>cookie_options</h3>
<p class="meta">An object. Default is <code>{}</code>.</p>
<p>The options accepted by the <a href="http://plugins.jquery.com/project/cookie">jQuery.cookie</a> plugin.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<p>Check your data plugin documentation (<a href="html_data.html">html_data</a>, <a href="xml_data.html">xml_data</a>, <a href="json_data.html">json_data</a>) or take a close look at these examples for information on how to specify multilanguage nodes.</p>
<h3>Using the cookies plugin</h3>
<p>Go ahead and make changes to the tree and then <a href="javascript:document.location.reload();">refresh this page</a>.</p>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"plugins" : [ "themes", "html_data", "ui", "cookies" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="save_cookie">.save_cookie ( event )</h3>
<p>Save the current state.</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>event</strong>
<p>Used internally with the <code>auto_save</code> option. Do not set this manually.</p>
</li>
</ul>
</div>
</div>
</body>
</html>

689
thirdparty/jstree/_docs/core.html vendored Normal file
View File

@ -0,0 +1,689 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 Core documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>CORE</h1>
<h2>Description</h2>
<div id="description">
<h3>Including the files</h3>
<p>First of all, as jsTree is a jQuery component, you need to include jQuery itself. jsTree v.1.0 requires jQuery version 1.4.2</p>
<div class="code_f"><pre class="brush:xml;">
&lt;script type="text/javascript" src="_lib/jquery.js"&gt;&lt;/script&gt;
</pre></div>
<p>Then you need to include jsTree:</p>
<div class="code_f"><pre class="brush:xml;">
&lt;script type="text/javascript" src="jquery.jstree.js"&gt;&lt;/script&gt;
</pre></div>
<p>Or you could use the minified version:</p>
<div class="code_f"><pre class="brush:xml;">
&lt;script type="text/javascript" src="jquery.jstree.min.js"&gt;&lt/script&gt;
</pre></div>
<p>You may change the path to whatever you like, but it is recommended not to rename <code>jquery.tree.js</code> or <code>jquery.tree.min.js</code> as the filenames may be used for path autodetection (for example in the <code>themes</code> plugin, but if you really need to rename the file most plugins will give you the option to set the path manually).</p>
<p>Additionally some plugins have dependencies - plugins that detect a dependency is missing will throw an error.</p>
<h3>Creating and configuring an instance</h3>
<p>You can create a tree in the following manner:</p>
<div class="code_f"><pre class="brush:js;">
jQuery("some-selector-to-container-node-here").jstree([ config_object ]);
</pre></div>
<p>In the optional config object you specify all the options that you want to set. Each plugin will describe its configuration and defaults. In the <a href="#configuration">configuration section</a> below you will find the options defined by the core. Each plugin's options (even the core) are set in their own subobject, which is named after the plugin. For example all of the core's options are set in the <code>core</code> key of the config object:</p>
<div class="code_f"><pre class="brush:js;">
jQuery("some-selector-to-container-node-here")
.jstree({
core : {
/* core options go here */
}
});
</pre></div>
<p class="note">Please note that if your options for a given plugin are the same as the defaults you may omit those options or omit the subobject completely (if you do not need to modify the defaults).</p>
<p>There is only one special config option that is not a part of any plugin - this is the <code>plugins</code> option, which defines a list of active plugins for the instance being created. Although many plugins may be included, only the ones listed in this option will be active. The only autoincluded "plugin" is the jstree core.</p>
<div class="code_f"><pre class="brush:js;">
jQuery("some-selector-to-container-node-here")
.jstree({
core : { /* core options go here */ },
plugins : [ "themes", "html_data", "some-other-plugin" ]
});
</pre></div>
<h3>Interacting with the tree</h3>
<p>To perform an operation programatically on a given instance you can use two methods:</p>
<div class="code_f"><pre class="brush:js;">
/* METHOD ONE */
jQuery("some-selector-to-container-node-here")
.jstree("operation_name" [, argument_1, argument_2, ...]);
/* METHOD TWO */
jQuery.jstree._reference(needle)
/* NEEDLE can be a DOM node or selector for the container or a node within the container */
.operation_name([ argument_1, argument_2, ...]);
</pre></div>
<p class="note">NOTE: Functions prefixed with <code>_</code> can not be called with method one.</p>
<p>jsTree uses events to notify of any changes happening in the tree. All events fire on the tree container in the <code>jstree</code> namespace and are named after the function that triggered them. Please note that for some events it is best to bind before creating the instance. For example:</p>
<div class="code_f"><pre class="brush:js;">
jQuery("some-container")
.bind("loaded.jstree", function (event, data) {
alert("TREE IS LOADED");
})
.jstree({ /* configuration here */ });
</pre></div>
<p>Please note the second parameter <code>data</code>. Its structure is as follows:</p>
<div class="code_f"><pre class="brush:js;">
{
"inst" : /* the actual tree instance */,
"args" : /* arguments passed to the function */,
"rslt" : /* any data the function passed to the event */,
"rlbk" : /* an optional rollback object - it is not always present */
}
</pre></div>
<p>There is also one special event - <code>before.jstree</code>. This events enables you to prevent an operation from executing. Look at the <a href="#demos">demo</a> below.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>html_titles</h3>
<p class="meta">Boolean. Default is <code>false</code>.</p>
<p>Defines whether titles can contain HTML code.</p>
<h3>animation</h3>
<p class="meta">A number. Default is <code>500</code>.</p>
<p>Defines the duration of open/close animations. <code>0</code> means no animation.</p>
<h3>initially_open</h3>
<p class="meta">An array. Default is <code>[]</code>.</p>
<p>Defines which nodes are to be automatically opened (if they are not present they will first be loaded) when the tree finishes loading - a list of IDs is expected.</p>
<h3>initially_load</h3>
<p class="meta">An array. Default is <code>[]</code>.</p>
<p>Defines which nodes are to be automatically loaded (but not opened) when the tree finishes loading - a list of IDs is expected.</p>
<h3>load_open</h3>
<p class="meta">A Boolean. Default is <code>false</code>.</p>
<p>When set to <code>true</code> forces loading of nodes marked as open, which do not have children. Otherwise nodes are only visualized as open without any children and opening/closing such a node won't cause it to load (make a server call).</p>
<h3>open_parents</h3>
<p class="meta">Boolean. Default is <code>true</code>.</p>
<p>If set to true opening a node will also open any closed ancestors it has (will open the whole chain down to this node).</p>
<h3>notify_plugins</h3>
<p class="meta">Boolean. Default is <code>true</code>.</p>
<p>If set to true loading nodes with some metadata will trigger some actions on the corresponding plugin. So you can actually set the selected/checked/etc</p>
<h3>rtl</h3>
<p class="meta">Boolean. Default is <code>false</code>.</p>
<p>Defines whether the tree is in right-to-left mode (also make sure you are using a RTL theme - for example the included <code>default-rtl</code>).</p>
<h3>strings</h3>
<p class="meta">Object. Default is <code>{ loading : "Loading ...", new_node : "New node" }</code>.</p>
<p>Contains strings needed for the operation of the tree so that you can localize.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Binding to an event and executing an action</h3>
<input type="button" class="button" value="toggle_node" id="toggle_node" style="clear:both;" />
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#toggle_node").click(function () {
$("#demo1").jstree("toggle_node","#phtml_1");
});
$("#demo1")
.bind("open_node.jstree close_node.jstree", function (e) {
$("#log1").html("Last operation: " + e.type);
})
.jstree({ "plugins" : [ "themes", "html_data" ] });
});
</script>
<p class="log" id="log1" style="clear:both;">&#160;</p>
<h3>Preventing an action</h3>
<p>This is the same demo as above, but this time the operation will be prevented.</p>
<input type="button" class="button" value="toggle_node" id="toggle_node2" style="clear:both;" />
<div id="demo2" class="demo">
<ul>
<li id="html_1">
<a href="#">Root node 1</a>
<ul>
<li id="html_2">
<a href="#">Child node 1</a>
</li>
<li id="html_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="html_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript">
$(function () {
$("#toggle_node2").click(function () {
$("#demo2").jstree("toggle_node","#html_1");
});
$("#demo2")
.bind("open_node.jstree close_node.jstree", function (e) {
$("#log2").html("Last operation: " + e.type);
})
.jstree({ "plugins" : [ "themes", "html_data" ] });
});
</script>
<script type="text/javascript" class="source">
$(function () {
$("#demo2").bind("before.jstree", function (e, data) {
if(data.func === "open_node") {
$("#log2").html(data.args[0].attr("id"));
e.stopImmediatePropagation();
return false;
}
});
});
</script>
<p class="log" id="log2" style="clear:both;">&#160;</p>
<p>The important part is <code>e.stopImmediatePropagation(); return false</code>.</p>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<p class="note">Use extra caution when working with functions prefixed with an underscore - <code>_</code>!<br />Those functions are probably for internal usage only.</p>
<h3 id="jstree.defaults">jQuery.jstree.defaults</h3>
<p class="meta">An object. Default is a collection of all included plugin's defaults.</p>
<p>This object is exposed so that you can apply standart settings to all future instances</p>
<h3 id="jstree.plugin">jQuery.jstree.plugin ( plugin_name , plugin_data )</h3>
<p>This function is used by developers to extend jstree (add "plugins").</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>plugin_name</strong>
<p>The plugin name - it should be unique.</p>
</li>
<li>
<code class="tp">object</code> <strong>plugin_data</strong>
<p>The plugin itself. It consists of <code>__init</code> &amp; <code>__destroy</code> functions, <code>defaults</code> object (that of course could be an array or a simple value) and a <code>_fn</code> object, whose keys are all the functions you are extending jstree with. You can overwrite functions (but you can in your function call the overriden old function), and you are responsible for triggering events and setting rollback points. You can omit any of the elements in the <code>plugin_data</code> param. Keep in mind jstree will automatically clear classes prepended with <code>jstree-</code> and all events in the <code>jstree</code> namespace when destroying a tree, so you do not need to worry about those.</p>
<p>Read jstree's code for examples on how to develop plugins.</p>
</li>
</ul>
<h3 id="jstree.rollback">jQuery.jstree.rollback ( rollback_object )</h3>
<p>This function will roll the tree back to the state specified by the rollback object</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>rollback_object</strong>
<p>Normally you will get this object from the event you are handling. You can of course use <code>.get_rollback()</code> to get the current state of the tree as a rollback object.</p>
<div class="code_f"><pre class="brush:js;">
$("some-container").bind("some-event.jstree", function (e, data) {
$.jstree.rollback(data.rlbk);
});</pre></div>
<p>Keep in mind that not all events will give you a rollback object - sometimes <code>data.rlbk</code> will be <code>false</code>.</p>
</li>
</ul>
<h3 id="jstree._focused">jQuery.jstree._focused ()</h3>
<p>Returns the currently focused tree instance on the page. If not interaction has been made - it is the last one to be created.</p>
<h3 id="jstree._reference">jQuery.jstree._reference ( needle )</h3>
<p>Returns the tree instance for the specified <code>needle</code>.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>needle</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the tree container, or an element within the tree.</p>
</li>
</ul>
<h3 id="jstree._instance">jQuery.jstree._instance ( index , container , settings )</h3>
<p>This function is used internally when creating new tree instances. Calling this function by itself is not enough to create a new instance. To create a tree use the documented method <code>$("selector").jstree([ options ])</code>.</p>
<h3 id="jstree._fn">jQuery.jstree._fn</h3>
<p>This object stores all functions included by plugins. It is used internally as a prototype for all instances - do not modify manually.</p>
<h3 id="data">.data</h3>
<p>An object where all plugins store instance specific data. Do not modify manually.</p>
<h3 id="get_settings">.get_settings ()</h3>
<p>Returns a copy of the instance's settings object - the defaults, extended by your own config object.</p>
<h3 id="_get_settings">._get_settings ()</h3>
<p>Returns the instance's settings object - the defaults, extended by your own config object.</p>
<h3 id="get_index">.get_index ()</h3>
<p>Returns the internal instance index.</p>
<h3 id="get_container">.get_container ()</h3>
<p>Returns the jQuery extended container node of the tree.</p>
<h3 id="get_container_ul">.get_container_ul ()</h3>
<p>Returns the jQuery extended first UL node in the container of the tree.</p>
<h3 id="_set_settings">._set_settings ( settings )</h3>
<p>Replace the settings object with the <code>settings</code> param. Please note that not all plugins will react to the change. Unless you know exactly what you are doing you'd be better off recreating the tree with the new settings.</p>
<h3 id="init">.init ()</h3>
<p>This function is used internally when creating a new instance. Triggers an event, which fires after the tree is initialized, but not yet loaded.</p>
<h3 id="destroy">.destroy ()</h3>
<p>Destroys the instance - it will automatically remove all bound events in the <code>jstree</code> namespace &amp; remove all classes starting with <code>jstree-</code>. Triggers an event.</p>
<h3 id="save_opened">.save_opened ()</h3>
<p>Stores the currently open nodes before refreshing. Used internally. Triggers an event.</p>
<h3 id="reopen">.reopen ( is_callback )</h3>
<p>Reopens all the nodes stored by <code>save_opened</code> or set in the <code>initially_open</code> config option on first load. It is called multiple times while reopening nodes - the <code>is_callback</code> param determines if this is the first call (<code>false</code>) or not. Used internally. Triggers an event.</p>
<h3 id="refresh">.refresh ( node )</h3>
<p>Refreshes the tree. Saves all open nodes, and reloads and then reopens all saved nodes. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If set this will reload only the given node - otherwise - the whole tree. Passing <code>-1</code> also reloads the whole tree.</p>
</li>
</ul>
<h3 id="loaded">.loaded ()</h3>
<p>A dummy function, whose purpose is only to trigger the loaded event. This event is triggered once after the tree's root nodes are loaded, but before any nodes set in <code>initially_open</code> are opened.</p>
<h3 id="set_focus">.set_focus ()</h3>
<p>Makes the current instance the focused one on the page. Triggers an event.</p>
<h3 id="unset_focus">.unset_focus ()</h3>
<p>If the current instance is focused this removes the focus. Triggers an event.</p>
<h3 id="is_focused">.is_focused ()</h3>
<p>Returns <code>true</code> if the current instance is the focused one, otherwise returns <code>false</code>.</p>
<h3 id="lock">.lock ()</h3>
<p>Sets the tree to a locked state - no methods can be called on that instance except for <code>unlock</code> and <code>is_locked</code>.</p>
<h3 id="unlock">.unlock ()</h3>
<p>Sets the tree to a unlocked state (the default state).</p>
<h3 id="is_locked">.is_locked ()</h3>
<p>Returns <code>true</code> if the tree is locked, otherwise returns <code>false</code>.</p>
<h3 id="_get_node">._get_node ( node )</h3>
<p>Return the jQuery extended <code>LI</code> element of the node, <code>-1</code> if the container node is passed, or <code>false</code> otherwise.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<h3 id="_get_next">._get_next ( node , strict )</h3>
<p>Gets the <code>LI</code> element representing the node next to the passed <code>node</code>. Returns <code>false</code> on failure.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose next sibling we want.</p>
</li>
<li>
<code class="tp">bool</code> <strong>strict</strong>
<p>If set to <code>true</code> only immediate siblings are calculated. Otherwise if the <code>node</code> is the last child of its parent this function will "jump out" and return the parent's next sibling, etc. Default is <code>false</code>.</p>
</li>
</ul>
<h3 id="_get_prev">._get_prev ( node , strict )</h3>
<p>Gets the <code>LI</code> element representing the node previous to the passed <code>node</code>. Returns <code>false</code> on failure.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose previous sibling we want.</p>
</li>
<li>
<code class="tp">bool</code> <strong>strict</strong>
<p>If set to <code>true</code> only immediate siblings are calculated. Otherwise if the <code>node</code> is the first child of its parent this function will "jump out" and return the parent itself. Default is <code>false</code>.</p>
</li>
</ul>
<h3 id="_get_parent">._get_parent ( node )</h3>
<p>Gets the <code>LI</code> element representing the parent of the passed <code>node</code>. Returns <code>false</code> on failure.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose parent we want.</p>
</li>
</ul>
<h3 id="_get_children">._get_children ( node )</h3>
<p>Gets the <code>LI</code> elements representing the children of the passed <code>node</code>. Returns <code>false</code> on failure (or if the node has no children).</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose children we want. Use <code>-1</code> to return all root nodes.</p>
</li>
</ul>
<h3 id="get_path">.get_path ( node , id_mode )</h3>
<p>Return the path to a node, either as an array of IDs or as an array of node names.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree, whose path we want.</p>
</li>
<li>
<code class="tp">bool</code> <strong>id_mode</strong>
<p>If set to <code>true</code> IDs are returned instead of the names of the parents. Default is <code>false</code>.</p>
</li>
</ul>
<h3 id="correct_state">.correct_state ( node )</h3>
<p>Corrects closed items to leaf items, if no children are found. Used internally, triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element we want corrected.</p>
</li>
<h3 id="open_node">.open_node ( node , callback , skip_animation )</h3>
<p>Opens a closed node, so that its children are visible. If the <code>animation</code> config option is greater than <code>0</code> the children are revealed using a slide down animation, whose duration is the value of the <code>animation</code> config option in milliseconds. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element we want opened.</p>
</li>
<li>
<code class="tp">function</code> <strong>callback</strong>
<p>A callback function executed once the node is opened. Used mostly internally, you'd be better of waiting for the event. You can skip this, by not specifying it, or by passing <code>false</code>.</p>
</li>
<li>
<code class="tp">bool</code> <strong>skip_animation</strong>
<p>If set to <code>true</code> the animation set in the <code>animation</code> config option is skipped. Default is <code>false</code>.</p>
</li>
</ul>
<h3 id="after_open">.after_open ( node )</h3>
<p>A dummy function, it triggers an event after the open animation has finished.</p>
<h3 id="close_node">.close_node ( node , skip_animation )</h3>
<p>Closes an open node, so that its children are not visible. If the <code>animation</code> config option is greater than <code>0</code> the children are hidden using a slide up animation, whose duration is the value of the <code>animation</code> config option in milliseconds. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element we want closed.</p>
</li>
<li>
<code class="tp">bool</code> <strong>skip_animation</strong>
<p>If set to <code>true</code> the animation set in the <code>animation</code> config option is skipped. Default is <code>false</code>.</p>
</li>
</ul>
<h3 id="after_close">.after_close ( node )</h3>
<p>A dummy function, it triggers an event after the close animation has finished.</p>
<h3 id="toggle_node">.toggle_node ( node )</h3>
<p>If a node is closed - this function opens it, if it is open - calling this function will close it.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element we want toggled.</p>
</li>
</ul>
<h3 id="open_all">.open_all ( node , do_animation, original_obj )</h3>
<p>Opens all descendants of the <code>node</code> node.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element whose descendants you want opened. If this param is omitted or set to <code>-1</code> all nodes in the tree are opened.</p>
</li>
<li>
<code class="tp">boolean</code> <strong>do_animation</strong>
<p>If set to <code>true</code> all nodes are opened with an animation. This can be slow on large trees.</p>
</li>
<li>
<code class="tp">mixed</code> <strong>original_obj</strong>
<p>Used internally when recursively calling the same function - do not pass this param.</p>
</li>
</ul>
<h3 id="close_all">.close_all ( node, do_animation )</h3>
<p>Closes all descendants of the <code>node</code> node.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element whose descendants you want closed. If this param is omitted or set to <code>-1</code> all nodes in the tree are closed.</p>
</li>
<li>
<code class="tp">boolean</code> <strong>do_animation</strong>
<p>If set to <code>true</code> all nodes are closed with an animation. This can be slow on large trees.</p>
</li>
</ul>
<div style="height:1px; visibility:hidden;"><span id="is_leaf">&nbsp;</span><span id="is_closed">&nbsp;</span></div>
<h3 id="is_open">.is_open ( node ), .is_closed ( node ), .is_leaf ( node )</h3>
<p>Those function check if the <code>node</code> is in a state.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element you want checked.</p>
</li>
</ul>
<h3 id="clean_node">.clean_node ( node )</h3>
<p>Applies all necessary classes to the <code>node</code> and its descendants. Used internally. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element you want cleaned. If this param is omitted or set to <code>-1</code> all nodes in the tree are cleaned.</p>
</li>
</ul>
<h3 id="get_rollback">.get_rollback ()</h3>
<p>Get the current tree's state in the rollback format. Used mainly internally by plugins.</p>
<h3 id="set_rollback">.set_rollback ( html , data )</h3>
<p>Rollback the tree. Used ONLY internally! Both arguments are part of the rollback object. If you need to rollback - take a look at <a href="#jstree.rollback">jQuery.jstree.rollback()</a>. Triggers event.</p>
<h3 id="load_node">.load_node ( node , success_callback , error_callback )</h3>
<p>A dummy function that is overwritten by data plugins. Triggers event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element you want loaded. Use <code>-1</code> for root nodes.</p>
</li>
<li>
<code class="tp">function</code> <strong>success_callback</strong>
<p>A function to be executed once the node is loaded successfully - used internally. You should wait for the event.</p>
</li>
<li>
<code class="tp">function</code> <strong>error_callback</strong>
<p>A function to be executed if the node is not loaded due to an error - used internally. You should wait for the event.</p>
</li>
</ul>
<h3 id="_is_loaded">._is_loaded ( node )</h3>
<p>A dummy function that should return <code>true</code> if the node's children are loaded or <code>false</code> otherwise.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element you want to check.</p>
</li>
</ul>
<h3 id="create_node">.create_node ( node , position , js , callback , is_loaded )</h3>
<p>Creates the DOM structure necessary for a new node. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element you want to create in (or next to).</p>
</li>
<li>
<code class="tp">mixed</code> <strong>position</strong>
<p>The position of the newly created node. This can be a zero based index to position the element at a specific point among the current children. You can also pass in one of those strings: <code>"before"</code>, <code>"after"</code>, <code>"inside"</code>, <code>"first"</code>, <code>"last"</code>.</p>
</li>
<li>
<code class="tp">object</code> <strong>js</strong>
<p>The data for the newly created node. Consists of three keys:</p><p style="margin-left:25px;"><code class="tp">attr</code> - an object of attributes (same used for <code>jQuery.attr()</code>. You can omit this key;<br /><code class="tp">state</code> - a string - either <code>"open"</code> or <code>"closed"</code>, for a leaf node - omit this key;<br /><code class="tp">data</code> - a string or an object - if a string is passed it is used for the title of the node, if an object is passed there are two keys you can specify: <code>attr</code> and <code>title</code>;</p>
</li>
<li>
<code class="tp">function</code> <strong>callback</strong>
<p>A function to be executed once the node is created - used internally. You should wait for the event.</p>
</li>
<li>
<code class="tp">bool</code> <strong>is_loaded</strong>
<p>Specifies if the parent of the node is loaded or not - used ONLY internally.</p>
</li>
</ul>
<h3 id="_get_string">._get_string ( node )</h3>
<p>Returns the needed string from the config object. If the key does not exist the key itself is returned.</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>key</strong>
<p>The name of the string you are looking for.</p>
</li>
</ul>
<h3 id="get_text">.get_text ( node )</h3>
<p>Returns the title of a node.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element whose title you need.</p>
</li>
</ul>
<h3 id="set_text">.set_text ( node , text )</h3>
<p>Sets the title of a node. Triggers an event. This is used mostly internally - wait for a <a href="#rename_node">.rename_node event</a> to avoid confusion.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element whose title you want to change.</p>
</li>
<li>
<code class="tp">string</code> <strong>text</strong>
<p>The new title.</p>
</li>
</ul>
<h3 id="rename_node">.rename_node ( node , text )</h3>
<p>Sets the title of a node. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element whose title you want to change.</p>
</li>
<li>
<code class="tp">string</code> <strong>text</strong>
<p>The new title.</p>
</li>
</ul>
<h3 id="delete_node">.delete_node ( node )</h3>
<p>Removes a node. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element you want to remove.</p>
</li>
</ul>
<h3 id="prepare_move">.prepare_move ( o , r , pos , cb , is_cb )</h3>
<p>This function is used internally to prepare all necessary variables and nodes when moving a node around. It is automatically called as needed - you do not need to call it manually. Triggers an event.</p>
<h3 id="check_move">.check_move ()</h3>
<p>Checks if the prepared move is a valid one.</p>
<h3 id="move_node">.move_node ( node , ref , position , is_copy , is_prepared , skip_check )</h3>
<p>Moves a node to a new place. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element you want to move.</p>
</li>
<li>
<code class="tp">mixed</code> <strong>ref</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element which will be the reference element in the move. <code>-1</code> may be used too (to indicate the container node).</p>
</li>
<li>
<code class="tp">mixed</code> <strong>position</strong>
<p>The new position of the moved node. This can be a zero based index to position the element at a specific point among the reference node's current children. You can also use one of these strings: <code>"before"</code>, <code>"after"</code>, <code>"inside"</code>, <code>"first"</code>, <code>"last"</code>.</p>
</li>
<li>
<code class="tp">bool</code> <strong>is_copy</strong>
<p>Should this be a copy or a move operation.</p>
</li>
<li>
<code class="tp">bool</code> <strong>is_prepared</strong>
<p>Used internally when this function is called recursively.</p>
</li>
<li>
<code class="tp">bool</code> <strong>skip_check</strong>
<p>If this is set to <code>true</code> <a href="#check_move">check_move</a> is not called.</p>
</li>
</ul>
<h3 id="_get_move">._get_move ()</h3>
<p>Returns the lastly prepared move. The returned object contains:<br />
<code>.o</code> - the node being moved<br />
<code>.r</code> - the reference node in the move<br />
<code>.ot</code> - the origin tree instance<br />
<code>.rt</code> - the reference tree instance<br />
<code>.p</code> - the position to move to (may be a string - <code>"last"</code>, <code>"first"</code>, etc)<br />
<code>.cp</code> - the calculated position to move to (always a number)<br />
<code>.np</code> - the new parent<br />
<code>.oc</code> - the original node (if there was a copy)<br />
<code>.cy</code> - boolen indicating if the move was a copy<br />
<code>.cr</code> - same as <code>np</code>, but if a root node is created this is -1<br />
<code>.op</code> - the former parent<br />
<code>.or</code> - the node that was previously in the position of the moved node<br />
</p>
</div>
</div>
</body>
</html>

316
thirdparty/jstree/_docs/crrm.html vendored Normal file
View File

@ -0,0 +1,316 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - CRRM documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>crrm plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>CRRM</code> plugin handles creating, renaming, removing and moving nodes by the user.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>input_width_limit</h3>
<p class="meta">A number. Default is <code>200</code>.</p>
<p>When renaming (or creating) nodes the input for the text will autosize - this number sets the maximum size for the input.</p>
<h3>move</h3>
<p class="meta">An object, containing various settings - see below for more.</p>
<h3>move.always_copy</h3>
<p class="meta"><code>true</code>, <code>false</code> or <code>"multitree"</code>. Default is <code>false</code>.</p>
<p>Defines how moves are handled - if set to <code>true</code> every move will be forced to a copy (leaving the original node in place). If set to <code>"multitree"</code> only moves between trees will be forced to a copy.</p>
<h3>move.open_onmove</h3>
<p class="meta">A Boolean. Default is <code>true</code>.</p>
<p>If set to true, when moving a node to a new, closed parent, the parent node will be opened when the move completes.</p>
<h3>move.default_position</h3>
<p class="meta">A string or a number. Default is <code>"last"</code>.</p>
<p>The default position to move to if no position is specified. This can be a zero based index to position the element at a specific point among the new parent's current children. You can also use one of these strings: <code>"before"</code>, <code>"after"</code>, <code>"inside"</code>, <code>"first"</code>, <code>"last"</code>.</p>
<h3>move.check_move</h3>
<p class="meta">A function. Default is <code>function (m) { return true; }</code>.</p>
<p>The callback function enabling you to prevent some moves - just return <code>false</code>. The <code>m</code> parameter is the move object generated by jstree. The object follows the structure described in <a href="core.html#_get_move">._get_move</a>.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Creating nodes</h3>
<input type="button" class="button" value="create_1" id="create_1" style="float:left;" />
<input type="button" class="button" value="create_2" id="create_2" style="float:left;" />
<input type="button" class="button" value="create_3" id="create_3" style="" />
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#create_1").click(function () {
$("#demo1").jstree("create");
});
$("#create_2").click(function () {
$("#demo1").jstree("create","#phtml_1","first","Enter a new name");
});
$("#create_3").click(function () {
$("#demo1").jstree("create",-1,false,"No rename",false,true);
});
$("#demo1").jstree({
"ui" : {
"initially_select" : [ "phtml_2" ]
},
"core" : { "initially_open" : [ "phtml_1" ] },
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
});
});
</script>
<h3>Removing nodes</h3>
<input type="button" class="button" value="remove_1" id="remove_1" style="float:left;" />
<input type="button" class="button" value="remove_2" id="remove_2" style="" />
<div id="demo2" class="demo">
<ul>
<li id="rhtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="rhtml_2">
<a href="#">Child node 1</a>
</li>
<li id="rhtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="rhtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#remove_1").click(function () {
$("#demo2").jstree("remove");
});
$("#remove_2").click(function () {
$("#demo2").jstree("remove","#rhtml_1");
});
$("#demo2").jstree({
"ui" : {
"initially_select" : [ "rhtml_2" ]
},
"core" : { "initially_open" : [ "rhtml_1" ] },
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
});
});
</script>
<h3>Renaming nodes</h3>
<input type="button" class="button" value="rename_1" id="rename_1" style="float:left;" />
<input type="button" class="button" value="rename_2" id="rename_2" style="" />
<div id="demo3" class="demo">
<ul>
<li id="shtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="shtml_2">
<a href="#">Child node 1</a>
</li>
<li id="shtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="shtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#rename_1").click(function () {
$("#demo3").jstree("rename");
});
$("#rename_2").click(function () {
$("#demo3").jstree("rename","#shtml_1");
});
$("#demo3").jstree({
"ui" : {
"initially_select" : [ "shtml_2" ]
},
"core" : { "initially_open" : [ "shtml_1" ] },
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
});
});
</script>
<h3>Moving nodes</h3>
<p><strong>move_1</strong> uses the default position - <code>"first"</code></p>
<p><strong>move_2</strong> specifies a position - <code>"before"</code> - meaning that the node specified as a first argument will come above the node specified as the second argument</p>
<p><strong>move_3</strong> will never work, because of the specified <code>check_move</code> function which prevents the first root node from being moved</p>
<input type="button" class="button" value="move_1" id="move_1" style="float:left;" />
<input type="button" class="button" value="move_2" id="move_2" style="float:left;" />
<input type="button" class="button" value="move_3" id="move_3" style="" />
<div id="demo4" class="demo">
<ul>
<li id="thtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="thtml_2">
<a href="#">Child node 1</a>
</li>
<li id="thtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="thtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#move_1").click(function () {
$("#demo4").jstree("move_node","#thtml_4","#thtml_1");
});
$("#move_2").click(function () {
$("#demo4").jstree("move_node","#thtml_4","#thtml_1", "before");
});
$("#move_3").click(function () {
$("#demo4").jstree("move_node","#thtml_1","#thtml_4");
});
$("#demo4").jstree({
"crrm" : {
"move" : {
"default_position" : "first",
"check_move" : function (m) { return (m.o[0].id === "thtml_1") ? false : true; }
}
},
"ui" : {
"initially_select" : [ "thtml_2" ]
},
"core" : { "initially_open" : [ "thtml_1" ] },
"plugins" : [ "themes", "html_data", "ui", "crrm" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="_show_input">._show_input ( node , callback )</h3>
<p>Renders an input field in a node. Used only internally.</p>
<h3 id="rename">.rename ( node )</h3>
<p>Sets a node in rename mode and when the user has entered changes, an event is triggered.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
</li>
</ul>
<h3 id="create">.create ( node , position , js , callback , skip_rename )</h3>
<p>Creates a new node. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element you want to create in (or next to). If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
</li>
<li>
<code class="tp">mixed</code> <strong>position</strong>
<p>The position of the newly created node. This can be a zero based index to position the element at a specific point among the current children. You can also pass in one of those strings: <code>"before"</code>, <code>"after"</code>, <code>"inside"</code>, <code>"first"</code>, <code>"last"</code>.</p>
</li>
<li>
<code class="tp">object</code> <strong>js</strong>
<p>The data for the newly created node. Consists of three keys:</p><p style="margin-left:25px;"><code class="tp">attr</code> - an object of attributes (same used for <code>jQuery.attr()</code>. You can omit this key;<br /><code class="tp">state</code> - a string - either <code>"open"</code> or <code>"closed"</code>, for a leaf node - omit this key;<br /><code class="tp">data</code> - a string or an object - if a string is passed it is used for the title of the node, if an object is passed there are two keys you can specify: <code>attr</code> and <code>title</code>;</p>
</li>
<li>
<code class="tp">function</code> <strong>callback</strong>
<p>A function to be executed once the node is created. You'd be better off waiting for the event.</p>
</li>
<li>
<code class="tp">bool</code> <strong>skip_rename</strong>
<p>Skips the user input step. The node is created with the data you have supplied.</p>
</li>
</ul>
<h3 id="remove">.remove ( node )</h3>
<p>Removes a node. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected items.</p>
</li>
</ul>
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="check_move">&#160;</span></div>
<h3 id="move_node">.check_move ( ), .move_node ( )</h3>
<p>Both functions are overwritten from the <a href="core.html#check_move">core</a> in order to implement the new functionality.</p>
<h3 id="cut">.cut ( node )</h3>
<p>Cuts a node (prepares it for pasting).</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
</li>
</ul>
<h3 id="copy">.copy ( node )</h3>
<p>Copies a node (prepares it for pasting).</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
</li>
</ul>
<h3 id="paste">.paste ( node )</h3>
<p>Pastes copied or cut nodes inside a node.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If you use the UI plugin - pass <code>null</code> to use the currently selected item.</p>
</li>
</ul>
</div>
</div>
</body>
</html>

199
thirdparty/jstree/_docs/dnd.html vendored Normal file
View File

@ -0,0 +1,199 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - dnd documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>dnd plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>dnd</code> plugin enables drag'n'drop support for jstree, also using foreign nodes and drop targets.</p>
<p class="note">All foreign node options and callback functions in the config (drop_target, drop_check, drop_finish, drag_target, drag_check, drag_finish) are to be used ONLY when nodes that are not part of any tree are involved.<br />If moving nodes from one tree instance to another - just listen for the "move_node.jstree" event on the receiving tree.<br /><span style="color:red">DO NOT SET drag_target AND drop_target to match tree nodes!</span></p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>copy_modifier</h3>
<p class="meta">A string. Default is <code>"ctrl"</code>.</p>
<p>The special key used to make a drag copy instead of move (<code>"ctrl"</code>, <code>"shift"</code>, <code>"alt"</code>, <code>"meta"</code>).</p>
<h3>check_timeout</h3>
<p class="meta">A number. Default is <code>200</code>.</p>
<p>The number of milliseconds to wait before checking if a move is valid upon hovering a node (while dragging). <code>200</code> is a reasonable value - a higher number means better performance but slow feedback to the user, a lower number means lower performance (possibly) but the user will get feedback faster.</p>
<h3>open_timeout</h3>
<p class="meta">A number. Default is <code>500</code>.</p>
<p>The number of milliseconds to wait before opening a hovered if it has children (while dragging). This means that the user has to stop over the node for half a second in order to trigger the open operation. Keep in mind that a low value in combination with async data could mean a lot of unneeded traffic, so <code>500</code> is quite reasonable.</p>
<h3>drop_target</h3>
<p class="meta">A string (jQuery selector) (or <code>false</code>). Default is <code>".jstree-drop"</code>.</p>
<p>A jquery selector matching all drop targets (you can also use the comma <code>,</code> in the string to specify multiple valid targets). If set to <code>false</code> drop targets are disabled.</p>
<h3>drop_check</h3>
<p class="meta">A function. Default is <code>function (data) { return true; }</code>.</p>
<p>Return <code>false</code> to mark the move as invalid, otherwise return <code>true</code>. The <code>data</code> parameter is as follows:</p>
<p style="margin-left:2em;"><code>data.o</code> - the object being dragged</p>
<p style="margin-left:2em;"><code>data.r</code> - the drop target</p>
<h3>drop_finish</h3>
<p class="meta">A function. Default is <code>$.noop</code>.</p>
<p>Gets executed after a valid drop, you get one parameter, which is as follows:</p>
<p style="margin-left:2em;"><code>data.o</code> - the object being dragged</p>
<p style="margin-left:2em;"><code>data.r</code> - the drop target</p>
<h3>drag_target</h3>
<p class="meta">A string (jQuery selector) (or <code>false</code>). Default is <code>".jstree-draggable"</code>.</p>
<p>A jquery selector matching all foreign nodes that can be dropped on the tree (you can also use the comma <code>,</code> in the string to specify multiple valid foreign nodes). If set to <code>false</code> dragging foreign nodes is disabled.</p>
<h3>drag_check</h3>
<p class="meta">A function. Default is <code>function (data) { return { after : false, before : false, inside : true }; }</code>.</p>
<p>Return a boolean for each position. The <code>data</code> parameter is as follows:</p>
<p style="margin-left:2em;"><code>data.o</code> - the foreign object being dragged</p>
<p style="margin-left:2em;"><code>data.r</code> - the hovered node</p>
<h3>drag_finish</h3>
<p class="meta">A function. Default is <code>$.noop</code>.</p>
<p>Gets executed after a dropping a foreign element on a tree item, you get one parameter, which is as follows:</p>
<p style="margin-left:2em;"><code>data.o</code> - the foreign object being dragged</p>
<p style="margin-left:2em;"><code>data.r</code> - the target node</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the dnd plugin</h3>
<p>Drag stuff around!</p>
<div class="jstree-drop" style="clear:both; border:5px solid green; background:lime; color:green; height:40px; line-height:40px; text-align:center; font-size:20px;">I have the jstree-drop class</div>
<div class="jstree-draggable" style="margin:10px 0; clear:both; border:5px solid navy; background:aqua; color:navy; height:40px; line-height:40px; text-align:center; font-size:20px;">I have the jstree-draggable class</div>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"dnd" : {
"drop_finish" : function () {
alert("DROP");
},
"drag_check" : function (data) {
if(data.r.attr("id") == "phtml_1") {
return false;
}
return {
after : false,
before : false,
inside : true
};
},
"drag_finish" : function (data) {
alert("DRAG OK");
}
},
"plugins" : [ "themes", "html_data", "dnd" ]
});
});
</script>
<h3>Reorder only demo</h3>
<div id="demo2" class="demo">
<ul>
<li id="rhtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="rhtml_2">
<a href="#">Child node 1</a>
</li>
<li id="rhtml_3">
<a href="#">Child node 2</a>
</li>
<li id="rhtml_4">
<a href="#">Child node 3</a>
</li>
<li id="rhtml_5">
<a href="#">Child node 4</a>
</li>
</ul>
</li>
<li id="rhtml_6">
<a href="#">Root node 2</a>
</li>
<li id="rhtml_7">
<a href="#">Root node 3</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo2").jstree({
"crrm" : {
"move" : {
"check_move" : function (m) {
var p = this._get_parent(m.o);
if(!p) return false;
p = p == -1 ? this.get_container() : p;
if(p === m.np) return true;
if(p[0] && m.np[0] && p[0] === m.np[0]) return true;
return false;
}
}
},
"dnd" : {
"drop_target" : false,
"drag_target" : false
},
"plugins" : [ "themes", "html_data", "crrm", "dnd" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<div style="height:1px; visibility:hidden;">
<span id="dnd_show">&nbsp;</span>
<span id="dnd_open">&nbsp;</span>
<span id="dnd_finish">&nbsp;</span>
<span id="dnd_enter">&nbsp;</span>
<span id="start_drag">&nbsp;</span>
</div>
<h3 id="dnd_prepare">.dnd_prepare ( ), .dnd_show ( ), .dnd_open ( ), .dnd_finish ( ), .dnd_enter ( ), .dnd_leave ( ), .start_drag ( )</h3>
<p>All those functions are used internally only. If you want more information - examine the source code.</p>
</div>
</div>
</body>
</html>

82
thirdparty/jstree/_docs/hotkeys.html vendored Normal file
View File

@ -0,0 +1,82 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - hotkeys documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>hotkeys plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>hotkeys</code> plugin enables keyboard navigation and shortcuts. Depends on the <a href="http://github.com/jeresig/jquery.hotkeys/">jquery.hotkeys plugin</a>.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<p>Expects an object:<br />each key is the keyboard shortcut (for possible values check <a href="http://github.com/jeresig/jquery.hotkeys/">the hotkeys plugin</a>)<br />each value is a function executed in the instance's context, the return value is used as a return value for the event.</p>
<p>Simple example:</p>
<p><code>"del" : function () { this.remove(); }</code></p>
<p>By default <code>"up"</code>, <code>"ctrl+up"</code>, <code>"shift+up"</code>, <code>"down"</code>, <code>"ctrl+down"</code>, <code>"shift+down"</code>, <code>"left"</code>, <code>"ctrl+left"</code>, <code>"shift+left"</code>, <code>"right"</code>, <code>"ctrl+right"</code>, <code>"shift+right"</code>, <code>"space"</code>, <code>"ctrl+space"</code>, <code>"shift+space"</code>, <code>"f2"</code>, <code>"del"</code> are bound.<br />To override any of those - just specify your own function, to disable - just set to <code>false</code>.
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the hotkeys plugin</h3>
<p>Try pressing <code>up</code>/<code>down</code>/<code>left</code>/<code>right</code>/<code>space</code>/<code>f2</code>/<code>del</code>.</p>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"core" : { "initially_open" : [ "phtml_1" ] },
"plugins" : ["themes","html_data","ui","crrm","hotkeys"]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="enable_hotkeys">.enable_hotkeys ( )</h3>
<p>Enable shortcuts on the instance (enabled by default).</p>
<h3 id="disable_hotkeys">.disable_hotkeys ( )</h3>
<p>Disable shortcuts on the instance.</p>
</div>
</div>
</body>
</html>

175
thirdparty/jstree/_docs/html_data.html vendored Normal file
View File

@ -0,0 +1,175 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - html_data documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>html_data plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>html_data</code> plugin enables jsTree to convert nested unordered lists to interactive trees. jsTree can also get HTML from the server insert it into the DOM and convert that to a tree.</p>
<p>The basic structure you need to follow when supplying data in the HTML format is:</p>
<div class="code_f">
<pre class="brush:xml;">
&lt;li&gt;
&lt;a href="some_value_here"&gt;Node title&lt;/a&gt;
&lt;!-- UL node only needed for children - omit if there are no children --&gt;
&lt;ul&gt;
&lt;!-- Children LI nodes here --&gt;
&lt;/ul&gt;
&lt;/li&gt;
</pre>
</div>
<p>If you inspect the resulting structure you will find it a bit different - that is because jstree will automatically do some corrections.</p>
<div class="code_f">
<pre class="brush:xml;">
&lt;!-- one of the three classes will be applied depending on node structure --&gt;
&lt;li class="[ jstree-open | jstree-closed | jstree-leaf ]"&gt;
&lt;!-- an INS element is inserted --&gt;
&lt;ins class="jstree-icon"&gt;&amp;#160;&lt;/ins&gt;
&lt;a href="some_value_here"&gt;
&lt;!-- another INS element is inserted --&gt;
&lt;ins class="jstree-icon"&gt;&amp;#160;&lt;/ins&gt;
Node title
&lt;/a&gt;
&lt;/li&gt;
</pre>
</div>
<p>Both <code>ins</code> elements are inserted for visualization purposes. As for the class (<code>jstree-open</code>, <code>jstree-closed</code>) - you can specify that yourself to force the node to appear either closed or opened. Making a node with no children appear closed is often used - if you use ajax, opening a closed node with no children will result in jstree making a server call for the children (see the <a href="#demo3">demo below</a>).</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>data</h3>
<p class="meta">A HTML string (or <code>false</code> if not used). Default is <code>false</code>.</p>
<p>Specifies the content to load into the container and convert to a tree.</p>
<h3>ajax</h3>
<p class="meta">An object (or <code>false</code> if not used). Default is <code>false</code>.</p>
<p>The ajax config object is pretty much the same as the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax settings object</a>.</p>
<p>You can set the <code>data</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the node about to be open as a paramater (or <code>-1</code> for initial load). Whatever you return in the function will be sent to the server as data (so for example you can send the node's ID).</p>
<p>You can set the <code>url</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the node about to be open as a paramater (or <code>-1</code> for initial load). Whatever you return in the <code>url</code> function will be used as the ajax URL (so that you can accomodate pretty paths such as /get_children/node_2).</p>
<p>The <code>error</code> and <code>success</code> functions (if present) also fire in the context of the tree, and if you return a value in the <code>success</code> function it will be used to populate the tree - this can be useful if you want to somehow change what the server returned on the client side before it is displayed in the tree.</p>
<h3>correct_state</h3>
<p class="meta">A Boolean. Default is <code>true</code>.</p>
<p>If this option is set to <code>true</code> if an AJAX request returns an empty result, the node that was about to be opened will be converted to a leaf node (the open icon will no longer be displayed).</p>
<p class="note"><strong>NOTE:</strong><br />If both <code>data</code> and <code>ajax</code> are not set, the current container's HTML is used to build the tree.<br />If both <code>data</code> and <code>ajax</code> are set the initial tree is rendered from the <code>data</code> string. When opening a closed node (that has no loaded children) an AJAX request is made.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using initial content (convert an existing list)</h3>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"plugins" : [ "themes", "html_data" ]
});
});
</script>
<h3>Using the data config option</h3>
<div id="demo2" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo2").jstree({
"core" : { "initially_open" : [ "root" ] },
"html_data" : {
"data" : "<li id='root'><a href='#'>Root node</a><ul><li><a href='#'>Child node</a></li></ul></li>"
},
"plugins" : [ "themes", "html_data" ]
});
});
</script>
<h3>Using the ajax config option</h3>
<div id="demo3" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo3").jstree({
"html_data" : {
"ajax" : {
"url" : "_html_data.html",
"data" : function (n) {
return { id : n.attr ? n.attr("id") : 0 };
}
}
},
"plugins" : [ "themes", "html_data" ]
});
});
</script>
<h3>Using both the data &amp; ajax config options</h3>
<div id="demo4" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo4").jstree({
"core" : { "initially_open" : [ "root2" ] },
"html_data" : {
"data" : "<li class='jstree-closed' id='root2'><a href='#'>Root node</a></li>",
"ajax" : { "url" : "_html_data.html" }
},
"plugins" : [ "themes", "html_data" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<p>Both dummy functions - <code>_is_loaded</code> and <code>load_node</code> are overwritten.</p>
<h3 id="load_node_html">.load_node_html ( node , success_callback , error_callback )</h3>
<p>This function is called instead of <code>load_node</code>.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element you want loaded. Use <code>-1</code> for root nodes.</p>
</li>
<li>
<code class="tp">function</code> <strong>success_callback</strong>
<p>A function to be executed once the node is loaded successfully - used internally. You should wait for the <code>load_node</code> event.</p>
</li>
<li>
<code class="tp">function</code> <strong>error_callback</strong>
<p>A function to be executed if the node is not loaded due to an error - used internally. You should wait for the <code>load_node</code> event.</p>
</li>
</ul>
</div>
</div>
</body>
</html>

86
thirdparty/jstree/_docs/index.html vendored Normal file
View File

@ -0,0 +1,86 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 Documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree - jquery tree plugin</h1>
<h2>Description</h2>
<div id="description">
<h3>jsTree:</h3>
<ul class="jstree">
<li>&#9830;&#160;&#160;is a <strong>javascript based, cross browser tree component</strong>. It is packaged as a <a href="http://jquery.com">jQuery</a> plugin.</li>
<li>&#9830;&#160;&#160;<strong>is absolutely free</strong> (licensed same as jQuery under the terms of either the MIT License or the GPL v2 License).</li>
<li>&#9830;&#160;&#160;is a <a href="http://vakata.com/">one man</a> project and relies on <a href="http://groups.google.com/group/jstree">its great community</a> for <a href="http://code.google.com/p/jstree/issues/list">feature requests &amp; bug reports</a>. Join in!</li>
<li>&#9830;&#160;&#160;passes <a href="http://jslint.com">jslint validation</a>, minifies nicely and does not modify the global scope in any way.</li>
<li>&#9830;&#160;&#160;uses plugins so feel free to remove any plugins you do not use (for an even smaller download) or create your own plugins.</li>
</ul>
<h3>Features at a glance</h3>
<ul class="columns">
<li>Various data sources - HTML, JSON, XML</li>
<li>Supports AJAX loading</li>
<li>Drag &amp; drop support</li>
<li>Highly configurable</li>
<li>Theme support + included themes</li>
<li>Uses jQuery's event system</li>
<li>Optional keyboard navigation</li>
<li>Maintain the same tree in many languages</li>
<li>Inline editing</li>
<li>Open/close optional animation</li>
<li>Define node types and fine tune them</li>
<li>Configurable multitree drag &amp; drop</li>
<li>Optional checkbox tree support</li>
<li>Search function</li>
<li>Supports plugins</li>
<li>Optional state saving using cookies</li>
<li>RTL support</li>
<li>Optional sorting / unique management</li>
</ul>
<p style="color:gray; font-size:0.8em; text-align:center; padding:15px;">if you like the project - consider <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=paypal@vakata.com&amp;currency_code=USD&amp;amount=&amp;return=http://jstree.com/donation&amp;item_name=Buy+me+a+coffee+for+jsTree">supporting jstree</a>.</p>
</div>
<h2 id="plugins">Plugins documentation</h2>
<div class="panel">
<p>As of version 1.0 jsTree is extremely plugin friendly, so all functionality is now wrapped in plugins, which take care of various aspects of the tree and can be removed without affecting the functionality of other plugins. Below you will find a list of plugins - each with its own documentation page. Probably a good place to start is the <a href="core.html">core</a>.</p>
<ul class="columns plugins">
<li style="float:none; width:660px;"><a href="core.html" style="font-weight:bold;">Core functionality</a><p>all core functions for manipulating the tree + basic examples of including, configuring and working with the tree, along with demos of the new event system</p></li>
<li><a href="html_data.html">HTML_DATA plugin</a><p>enables jsTree to convert nested unordered lists to interactive trees, an already existing UL may be used or data could be retrieved from a server</p></li>
<li><a href="json_data.html">JSON_DATA plugin</a><p>enables jsTree to convert JSON objects to interactive trees, data can be set up in the config or retrieved from a server</p></li>
<li><a href="xml_data.html">XML_DATA plugin</a><p>enables jsTree to convert XML objects to interactive trees (using XSL), data can be set up in the config or retrieved from a server</p></li>
<li><a href="themes.html">Themes plugin</a><p>controls the looks of jstree - without this plugin you will get a functional tree, but it will look just like an ordinary UL list</p></li>
<li><a href="ui.html">UI plugin</a><p>handles selecting, deselecting and hovering tree items</p></li>
<li><a href="crrm.html">CRRM plugin</a><p>handles creating, renaming, removing and moving nodes by the user, also includes cut/copy/paste functions</p></li>
<li><a href="hotkeys.html">Hotkeys plugin</a><p>enables support for keyboard navigation &amp; shortcuts, highly configurable</p></li>
<li><a href="languages.html">Languages plugin</a><p>enables multilanguage support - each node can have multiple titles, but only one is visible</p></li>
<li><a href="cookies.html">Cookies plugin</a><p>enables jstree to save the state of the tree across sessions, by saving selected and opened nodes in a cookie</p></li>
<li><a href="sort.html">Sort plugin</a><p>enables jstree to automatically sort all nodes<br />using a specified function</p></li>
<li><a href="dnd.html">DND plugin</a><p>enables drag'n'drop support for jstree, also using foreign nodes and drop targets</p></li>
<li><a href="checkbox.html">Checkbox plugin</a><p>makes multiselection possible using three-state checkboxes</p></li>
<li><a href="search.html">Search plugin</a><p>enables searching for nodes whose title contains a given string, works on async trees too</p></li>
<li><a href="contextmenu.html">Contextmenu plugin</a><p>enables a multilevel context menu on tree items</p></li>
<li><a href="types.html">Types plugin</a><p>each node can have a type, and you can define rules on how that type should behave</p></li>
<li><a href="themeroller.html">Themeroller plugin</a><p>adds support for jQuery UI's themes</p></li>
<li><a href="unique.html">Unique plugin</a><p>adds unique checking to jsTree</p></li>
<li><a href="#" onclick="return false" style="color:black;text-decoration:none;">Wholerow plugin</a><p>enhances UIs select &amp; hover functions</p></li>
</ul>
</div>
</div>
</body>
</html>

249
thirdparty/jstree/_docs/json_data.html vendored Normal file
View File

@ -0,0 +1,249 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - json_data documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>json_data plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>json_data</code> plugin enables jsTree to convert JSON objects to interactive trees. The data (JSON) can be set up in the config or retrieved from a server (also ondemand). Version 1.0 also introduces the experimental progressive render feature, which is suitable for large heavy trees, when the DOM would be too heavy to manipulate.</p>
<p>The basic structure you need to follow when supplying data in the JSON format is:</p>
<div class="code_f">
<pre class="brush:js;">
{
"data" : "node_title",
// omit `attr` if not needed; the `attr` object gets passed to the jQuery `attr` function
"attr" : { "id" : "node_identificator", "some-other-attribute" : "attribute_value" },
// `state` and `children` are only used for NON-leaf nodes
"state" : "closed", // or "open", defaults to "closed"
"children" : [ /* an array of child nodes objects */ ]
}
</pre>
</div>
<p>The attr object will appear as attributes on the resulting <code>li</code> node.</p>
<p>You may need to pass some attributes to the <code>a</code> node, or set some metadata, or use language versions (for the <a href="languages.html">languages plugin</a>):</p>
<div class="code_f">
<pre class="brush:js;">
{
// `data` can also be an object
"data" : {
"title" : "The node title",
// omit when not needed
"attr" : {},
// if `icon` contains a slash / it is treated as a file, used for background
// otherwise - it is added as a class to the &lt;ins&gt; node
"icon" : "folder"
},
// the `metadata` property will be saved using the jQuery `data` function on the `li` node
"metadata" : "a string, array, object, etc",
// if you use the language plugin - just set this property
// also make sure that `data` is an array of objects
"language" : "en" // any code you are using
}
</pre>
</div>
<p>As seen in the first example below - you can also use a simple string to define a node (Child 1 &amp; Child 2).</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>data</h3>
<p class="meta">A JSON object (or <code>false</code> if not used). Default is <code>false</code>.</p>
<p>Specifies the content to load into the container and convert to a tree. You can also set this to a function - it will be executed in the tree's scope for every node that needs to be loaded, the function will receive two arguments - the node being loaded &amp; a function to call with the data once your processing is done.</p>
<h3>ajax</h3>
<p class="meta">An object (or <code>false</code> if not used). Default is <code>false</code>.</p>
<p>The ajax config object is pretty much the same as the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax settings object</a>.</p>
<p>You can set the <code>data</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the node about to be open as a paramater (or <code>-1</code> for initial load). Whatever you return in the <code>data</code> function will be sent to the server as data (so for example you can send the node's ID).</p>
<p>You can set the <code>url</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the node about to be open as a paramater (or <code>-1</code> for initial load). Whatever you return in the <code>url</code> function will be used as the ajax URL (so that you can accomodate pretty paths such as /get_children/node_2).</p>
<p>The <code>error</code> and <code>success</code> functions (if present) also fire in the context of the tree, and if you return a value in the <code>success</code> function it will be used to populate the tree - this can be useful if you want to somehow change what the server returned on the client side before it is displayed in the tree (for example some .NET json implementations require this to work: <code>"success" : function (data) { return data.d; }</code>.</p>
<h3>correct_state</h3>
<p class="meta">A Boolean. Default is <code>true</code>.</p>
<p>If this option is set to <code>true</code> if an AJAX returns an empty result, the node that was about to be opened will be converted to a leaf node (the open icon will no longer be displayed).</p>
<h3>progressive_render</h3>
<p class="meta">A Boolean. Default is <code>false</code>.</p>
<p>If this option is set to <code>true</code> only the visible (open nodes) parts of the returned JSON are converted to DOM nodes, any hidden parts are saved away and parsed ondemand (when a node becomes visible). This is useful when you have a large nested tree which would result in a heavy DOM.</p>
<h3>progressive_unload</h3>
<p class="meta">A Boolean. Default is <code>false</code>.</p>
<p>If this option is set to <code>true</code> when a node is closed its children are removed from the DOM and saved as metadata on the node itself, on reopen that metadata is used (much like <code>progressive_render</code>).</p>
<p class="note"><strong>NOTE:</strong><br />If both <code>data</code> and <code>ajax</code> are set the initial tree is rendered from the <code>data</code> string. When opening a closed node (that has no loaded children) an AJAX request is made.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the data config option</h3>
<div id="demo1" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"json_data" : {
"data" : [
{
"data" : "A node",
"metadata" : { id : 23 },
"children" : [ "Child 1", "A Child 2" ]
},
{
"attr" : { "id" : "li.node.id1" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
]
},
"plugins" : [ "themes", "json_data", "ui" ]
}).bind("select_node.jstree", function (e, data) { alert(jQuery.data(data.rslt.obj[0], "id")); });
});
</script>
<h3>Using the ajax config option</h3>
<div id="demo2" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo2").jstree({
"json_data" : {
"ajax" : {
"url" : "_json_data.json",
"data" : function (n) {
return { id : n.attr ? n.attr("id") : 0 };
}
}
},
"plugins" : [ "themes", "json_data" ]
});
});
</script>
<h3>Using the progressive render config option</h3>
<div id="demo3" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo3").jstree({
"json_data" : {
"data" : [
{
"data" : "A node",
"children" : [ "Child 1", "Child 2" ]
},
{
"attr" : { "id" : "li.node.id2" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
],
"progressive_render" : true
},
"plugins" : [ "themes", "json_data" ]
});
});
</script>
<h3>Using both the data &amp; ajax config options</h3>
<div id="demo4" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo4").jstree({
"json_data" : {
"data" : [
{
"data" : "A node",
"state" : "closed"
},
{
"attr" : { "id" : "li.node.id3" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
],
"ajax" : { "url" : "_json_data.json" }
},
"plugins" : [ "themes", "json_data" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<p>Both dummy functions - <code>_is_loaded</code> and <code>load_node</code> are overwritten.</p>
<h3 id="load_node_json">.load_node_json ( node , success_callback , error_callback )</h3>
<p>This function is called instead of <code>load_node</code>.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element you want loaded. Use <code>-1</code> for root nodes.</p>
</li>
<li>
<code class="tp">function</code> <strong>success_callback</strong>
<p>A function to be executed once the node is loaded successfully - used internally. You should wait for the <code>load_node</code> event.</p>
</li>
<li>
<code class="tp">function</code> <strong>error_callback</strong>
<p>A function to be executed if the node is not loaded due to an error - used internally. You should wait for the <code>load_node</code> event.</p>
</li>
</ul>
<h3 id="_parse_json">._parse_json ( data , node , is_callback )</h3>
<p>This function converts JSON nodes to the DOM structure required by jstree. Returns a jQuery object.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a tree node in the JSON format described above, or an array of such JSON nodes, may also be a string.</p>
</li>
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This is the DOM node, jQuery node or selector pointing to the element for which data is parsed. <code>-1</code> means root nodes.</p>
</li>
<li>
<code class="tp">bool</code> <strong>is_callback</strong>
<p>Specifies if the function is called recursively - used ONLY internally.</p>
</li>
</ul>
<h3 id="get_json">.get_json ( node , li_attr , a_attr )</h3>
<p>This function returns an array of tree nodes converted back to JSON.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element you want returned. Use <code>-1</code> or omit to get the whole tree.</p>
</li>
<li>
<code class="tp">array</code> <strong>li_attr</strong>
<p>The attributes to collect from the <code>LI</code> node. Defaults to <code>[ "id" , "class" ]</p>
</li>
<li>
<code class="tp">array</code> <strong>a_attr</strong>
<p>The attributes to collect from the <code>A</code> node. Defaults to <code>[ ]</p>
</li>
<li>
<code class="tp">boolean</code> <strong>is_callback</strong>
<p>Used internally.</p>
</li>
</ul>
</div>
</div>
</body>
</html>

152
thirdparty/jstree/_docs/languages.html vendored Normal file
View File

@ -0,0 +1,152 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - languages documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>languages plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>languages</code> plugin enables multilanguage trees. This means that each node has a specified number of titles - each in a different "language". Only one language set is visible at any given time. This is useful for maintaining the same structure in many languages (hence the name of the plugin)</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<p>Expects an array of language codes. Each of the items is used as a CSS class name, so make sure you specify only valid CSS class name strings. The first langauge will be visible onload. For example:</p>
<p><code>[ "en", "de", "bg" ]</code></p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<p>Check your data plugin documentation (<a href="html_data.html">html_data</a>, <a href="xml_data.html">xml_data</a>, <a href="json_data.html">json_data</a>) or take a close look at these examples for information on how to specify multilanguage nodes.</p>
<h3>Using the languages plugin with HTML data</h3>
<input type="button" class="button" value="en" id="en_1" style="float:left;" />
<input type="button" class="button" value="bg" id="bg_1" style="float:left;" />
<input type="button" class="button" value="rename_1" id="rename_1" style="float:left;" />
<input type="button" class="button" value="rename_2" id="rename_2" style="" />
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#" class="en">Root node 1</a>
<a href="#" class="bg">Корен 1</a>
<ul>
<li id="phtml_2">
<a href="#" class="en">Child node 1</a>
<a href="#" class="bg">Дете 1</a>
</li>
<li id="phtml_3">
<a href="#" class="en">Child node 2</a>
<a href="#" class="bg">Дете 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#" class="en">Root node 2</a>
<a href="#" class="bg">Корен 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#en_1, #bg_1").click(function () {
$("#demo1").jstree("set_lang", this.value);
});
$("#rename_1").click(function () {
$("#demo1").jstree("rename_node", "#phtml_1", "Rename visible lang");
});
$("#rename_2").click(function () {
$("#demo1").jstree("rename_node", "#phtml_1", "Rename `bg`", "bg");
});
$("#demo1").jstree({
"languages" : [ "en", "bg" ],
"plugins" : [ "themes", "html_data", "languages","checkbox"]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="set_lang">.set_lang ( lang )</h3>
<p>Set the tree's visible language. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">string <br />number</code> <strong>lang</strong>
<p>Either the language code string (as specified in the config) or an index from the config array.</p>
</li>
</ul>
<h3 id="get_lang">.get_lang ( )</h3>
<p>Returns the name of the currently visible language.</p>
<h3 id="_get_string">._get_string ( node , lang )</h3>
<p>Returns the needed string from the core config object. Overwrites the <a href="core.html#_get_string">get_string function</a> from the core. If the key does not exist in that language, but exists in the root of the object - that is returned, if even that does not exist - the key itself is returned.</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>key</strong>
<p>The name of the string you are looking for. If you want to use the localize option just set the strings core config option to an object like this one: <code>strings : { "lang-code-here" : { "string-key" : "string-value" ... }, "other-lang" : { ... } }</code>, otherwise _get_strings won't be affected.</p>
</li>
<li>
<code class="tp">string</code> <strong>lang</strong>
<p>The language code string (as specified in the config) to get the key in. If not specified the currently visible language is used.</p>
</li>
</ul>
<h3 id="get_text">.get_text ( node , lang )</h3>
<p>Returns the title of a node. Overwrites the <a href="core.html#get_text">get_text function</a> from the core.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element whose title you need.</p>
</li>
<li>
<code class="tp">string</code> <strong>lang</strong>
<p>The language code string (as specified in the config) to get the title in. If you omit this - the currently visible language is used.</p>
</li>
</ul>
<h3 id="set_text">.set_text ( node , text , lang )</h3>
<p>Sets the title of a node. Overwrites the <a href="core.html#set_text">set_text function</a> from the core. This is used internally - you should use <a href="core.html#rename_node">rename_node</a>. Since <code>rename_node</code> uses <code>set_text</code> internally you can pass a language string as a third parameter to rename_node.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element whose title you want to change.</p>
</li>
<li>
<code class="tp">string</code> <strong>text</strong>
<p>The new title.</p>
</li>
<li>
<code class="tp">string</code> <strong>lang</strong>
<p>The language code string (as specified in the config) to get the title in. If you omit this - the currently visible language is used.</p>
</li>
</ul>
<h3 id="_load_css">._load_css ( )</h3>
<p>used only internally to include the CSS necessary for the plugin onload.</p>
<h3 id="create_node">.create_node ( obj , position , js , callback )</h3>
<p>Overwrites the <a href="core.html#create_node">create_node</a> function from the core. To create a node with a few titles use an array for the <code>data</code> property of the <code>js</code> parameter:</p>
<p><code>{ "data" : [ { "title" : "EN title", language : "en" }, { "title" : "BG заглавие", language : "bg" } ] }</code></p>
</div>
</div>
</body>
</html>

BIN
thirdparty/jstree/_docs/logo.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

153
thirdparty/jstree/_docs/search.html vendored Normal file
View File

@ -0,0 +1,153 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - Search documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>search plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>search</code> plugin enables searching for nodes whose title contains a given string, works on async trees too. All found nodes get the <code>jstree-search</code> class applied to their contained <code>a</code> nodes - you can use that class to style search results.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>search_method</h3>
<p class="meta">A string. Default is <code>"contains"</code>.</p>
<p>The method to use for searching. The other options bundled with jstree are <code>"jstree_contains"</code> (case insensitive search) and <code>"jstree_title_contains"</code> (case insensitive based on the title tag of the A node). For multiple word search take a look this: <a href="https://github.com/vakata/jstree/issues/10">https://github.com/vakata/jstree/issues/10</a> - you can easily write your own method too.</p>
<h3>show_only_matches</h3>
<p class="meta">A boolean. Default is <code>false</code>.</p>
<p>If set to <code>true</code> all non-matching nodes are hidden and only the matching nodes (and their parents) are left visible, until the search is cleared. Keep in mind <code>show_only_matches</code> is heavy on the browser/DOM and is still experimental.</p>
<h3>ajax</h3>
<p class="meta">An object (or <code>false</code> if not used). Default is <code>false</code>.</p>
<p>This object can be used to make a request to the server on each search - useful if you are using async trees. That way you can return an array of IDs that need to be loaded before the actual DOM search is performed (so that all the nodes that will match the search are loaded). For example if the user searches for "string", you get that on the server side, check the database and find out that there is a node containing that string. But the node is the child of some other node, etc - so in your response you must return the path to the node (without the node itself) as ids: <code>["#root_node","#child_node_3"]</code>. This means that jstree will load those two nodes before doing the client side search, ensuring that your node will be visible.</p>
<p>The ajax config object is pretty much the same as the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax settings object</a>.</p>
<p>You can set the <code>data</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the search string as a paramater. Whatever you return in the function will be sent to the server as data.</p>
<p>You can set the <code>url</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the search string as a paramater. Whatever you return in the function will be used as the URL of the ajax request.</p>
<p>The <code>error</code> and <code>success</code> functions (if present) also fire in the context of the tree, and if you return a value in the <code>success</code> function it will be used as the array of IDs.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Searching nodes</h3>
<p>Do not open the node - instead - just press the button.</p>
<input type="button" class="button" value="Search" id="search" style="" />
<div id="demo1" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#search").click(function () {
$("#demo1").jstree("search","TARGEt");
});
$("#demo1")
.jstree({
"json_data" : {
"data" : [
{
"attr" : { "id" : "root_node" },
"data" : "A closed node",
"state" : "closed"
}
],
"ajax" : {
"url" : "_search_data.json",
"data" : function (n) {
return { id : n.attr ? n.attr("id") : 0 };
}
}
},
"search" : {
"case_insensitive" : true,
"ajax" : {
"url" : "_search_result.json"
}
},
"plugins" : [ "themes", "json_data", "search" ]
})
.bind("search.jstree", function (e, data) {
alert("Found " + data.rslt.nodes.length + " nodes matching '" + data.rslt.str + "'.");
});
});
</script>
<h3>Using adv_search</h3>
<p>Try pressing the buttons. It will also work with AJAX searching.</p>
<input type="button" class="button" value="search for ADV_SEARCH" id="search1" rel="ADV_SEARCH" style="float:left;" />
<input type="button" class="button" value="search for Root" id="search2" rel="Root" style="float:left;" />
<input type="button" class="button" value="search for Child" id="search3" rel="Child" style="float:left;" />
<input type="button" class="button" value="Clear search" id="clear" style="" />
<div id="demo2" class="demo">
<ul>
<li class="jstree-open"><a href="#">Root node 1</a>
<ul>
<li><a href="#">Child node 1</a></li>
<li><a href="#">Child node 2</a></li>
<li><a href="#">ADV_SEARCH</a></li>
<li><a href="#">Child node 4</a></li>
</ul>
</li>
<li><a href="#">Root node 2</a>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#search1, #search2, #search3").click(function () {
$("#demo2").jstree("search", $(this).attr("rel"));
});
$("#clear").click(function () {
$("#demo2").jstree("clear_search");
});
$("#demo2")
.jstree({
"plugins" : [ "themes", "html_data", "search", "adv_search" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="search">.search ( str , skip_async )</h3>
<p>Searches for nodes matching the supplied string. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>str</strong>
<p>The string to search for.</p>
</li>
<li>
<code class="tp">boolean</code> <strong>skip_async</strong>
<p>If set to <code>true</code> - skip the async search (if setup in the config). This is used mostly internally.</p>
</li>
</ul>
<h3 id="clear_search">.clear_search ( )</h3>
<p>Clears the current search. This function is automatically called when doing a new search. Triggers an event.</p>
<h3 id="_search_open">._search_open ( is_callback )</h3>
<p>Used internally if async is setup in the config. This functions loads the nodes returned by the server one by one.</p>
</div>
</div>
</body>
</html>

85
thirdparty/jstree/_docs/sort.html vendored Normal file
View File

@ -0,0 +1,85 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - sort documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>sort plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>sort</code> enables jstree to automatically sort all nodes using a specified function. This means that when the user creates, renames or moves nodes around - they will automatically sort.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<p>Expects a function. The functions receives two arguments - two nodes to be compared. Return <code>-1</code> or <code>1</code> (or any other different from -1). Default is: </p>
<p><code>function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; }</code></p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the sort plugin</h3>
<input type="button" class="button" value="rename" id="rename" style="" />
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#rename").click(function () {
$("#demo1").jstree("rename");
});
$("#demo1").jstree({
"plugins" : [ "themes", "html_data", "ui", "crrm", "sort" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="sort">.sort ( node )</h3>
<p>Sorts the children of the specified node - this function is called automatically.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element.</p>
</li>
</ul>
</div>
</div>
</body>
</html>

2232
thirdparty/jstree/_docs/syntax/!script.js vendored Normal file
View File

@ -0,0 +1,2232 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
//
// Begin anonymous function. This is used to contain local scope variables without polutting global scope.
//
if (!window.SyntaxHighlighter) var SyntaxHighlighter = function() {
// Shortcut object which will be assigned to the SyntaxHighlighter variable.
// This is a shorthand for local reference in order to avoid long namespace
// references to SyntaxHighlighter.whatever...
var sh = {
defaults : {
/** Additional CSS class names to be added to highlighter elements. */
'class-name' : '',
/** First line number. */
'first-line' : 1,
/**
* Pads line numbers. Possible values are:
*
* false - don't pad line numbers.
* true - automaticaly pad numbers with minimum required number of leading zeroes.
* [int] - length up to which pad line numbers.
*/
'pad-line-numbers' : true,
/** Lines to highlight. */
'highlight' : null,
/** Enables or disables smart tabs. */
'smart-tabs' : true,
/** Gets or sets tab size. */
'tab-size' : 4,
/** Enables or disables gutter. */
'gutter' : true,
/** Enables or disables toolbar. */
'toolbar' : true,
/** Forces code view to be collapsed. */
'collapse' : false,
/** Enables or disables automatic links. */
'auto-links' : true,
/** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */
'light' : false,
/** Enables or disables automatic line wrapping. */
'wrap-lines' : true,
'html-script' : false
},
config : {
/** Enables use of <SCRIPT type="syntaxhighlighter" /> tags. */
useScriptTags : true,
/** Path to the copy to clipboard SWF file. */
clipboardSwf : null,
/** Width of an item in the toolbar. */
toolbarItemWidth : 16,
/** Height of an item in the toolbar. */
toolbarItemHeight : 16,
/** Blogger mode flag. */
bloggerMode : false,
stripBrs : false,
/** Name of the tag that SyntaxHighlighter will automatically look for. */
tagName : 'pre',
strings : {
expandSource : 'show source',
viewSource : 'view source',
copyToClipboard : 'copy to clipboard',
copyToClipboardConfirmation : 'The code is in your clipboard now',
print : 'print',
help : '?',
alert: 'SyntaxHighlighter\n\n',
noBrush : 'Can\'t find brush for: ',
brushNotHtmlScript : 'Brush wasn\'t configured for html-script option: ',
// this is populated by the build script
aboutDialog : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>About SyntaxHighlighter</title></head><body style="font-family:Geneva,Arial,Helvetica,sans-serif;background-color:#fff;color:#000;font-size:1em;text-align:center;"><div style="text-align:center;margin-top:3em;"><div style="font-size:xx-large;">SyntaxHighlighter</div><div style="font-size:.75em;margin-bottom:4em;"><div>version 2.1.364 (October 15 2009)</div><div><a href="http://alexgorbatchev.com" target="_blank" style="color:#0099FF;text-decoration:none;">http://alexgorbatchev.com</a></div><div>If you like this script, please <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2930402" style="color:#0099FF;text-decoration:none;">donate</a> to keep development active!</div></div><div>JavaScript code syntax highlighter.</div><div>Copyright 2004-2009 Alex Gorbatchev.</div></div></body></html>'
},
/** If true, output will show HTML produces instead. */
debug : false
},
/** Internal 'global' variables. */
vars : {
discoveredBrushes : null,
spaceWidth : null,
printFrame : null,
highlighters : {}
},
/** This object is populated by user included external brush files. */
brushes : {},
/** Common regular expressions. */
regexLib : {
multiLineCComments : /\/\*[\s\S]*?\*\//gm,
singleLineCComments : /\/\/.*$/gm,
singleLinePerlComments : /#.*$/gm,
doubleQuotedString : /"([^\\"\n]|\\.)*"/g,
singleQuotedString : /'([^\\'\n]|\\.)*'/g,
multiLineDoubleQuotedString : /"([^\\"]|\\.)*"/g,
multiLineSingleQuotedString : /'([^\\']|\\.)*'/g,
xmlComments : /(&lt;|<)!--[\s\S]*?--(&gt;|>)/gm,
url : /&lt;\w+:\/\/[\w-.\/?%&=@:;]*&gt;|\w+:\/\/[\w-.\/?%&=@:;]*/g,
/** <?= ?> tags. */
phpScriptTags : { left: /(&lt;|<)\?=?/g, right: /\?(&gt;|>)/g },
/** <%= %> tags. */
aspScriptTags : { left: /(&lt;|<)%=?/g, right: /%(&gt;|>)/g },
/** <script></script> tags. */
scriptScriptTags : { left: /(&lt;|<)\s*script.*?(&gt;|>)/gi, right: /(&lt;|<)\/\s*script\s*(&gt;|>)/gi }
},
toolbar : {
/**
* Creates new toolbar for a highlighter.
* @param {Highlighter} highlighter Target highlighter.
*/
create : function(highlighter)
{
var div = document.createElement('DIV'),
items = sh.toolbar.items
;
div.className = 'toolbar';
for (var name in items)
{
var constructor = items[name],
command = new constructor(highlighter),
element = command.create()
;
highlighter.toolbarCommands[name] = command;
if (element == null)
continue;
if (typeof(element) == 'string')
element = sh.toolbar.createButton(element, highlighter.id, name);
element.className += 'item ' + name;
div.appendChild(element);
}
return div;
},
/**
* Create a standard anchor button for the toolbar.
* @param {String} label Label text to display.
* @param {String} highlighterId Highlighter ID that this button would belong to.
* @param {String} commandName Command name that would be executed.
* @return {Element} Returns an 'A' element.
*/
createButton : function(label, highlighterId, commandName)
{
var a = document.createElement('a'),
style = a.style,
config = sh.config,
width = config.toolbarItemWidth,
height = config.toolbarItemHeight
;
a.href = '#' + commandName;
a.title = label;
a.highlighterId = highlighterId;
a.commandName = commandName;
a.innerHTML = label;
if (isNaN(width) == false)
style.width = width + 'px';
if (isNaN(height) == false)
style.height = height + 'px';
a.onclick = function(e)
{
try
{
sh.toolbar.executeCommand(
this,
e || window.event,
this.highlighterId,
this.commandName
);
}
catch(e)
{
sh.utils.alert(e.message);
}
return false;
};
return a;
},
/**
* Executes a toolbar command.
* @param {Element} sender Sender element.
* @param {MouseEvent} event Original mouse event object.
* @param {String} highlighterId Highlighter DIV element ID.
* @param {String} commandName Name of the command to execute.
* @return {Object} Passes out return value from command execution.
*/
executeCommand : function(sender, event, highlighterId, commandName, args)
{
var highlighter = sh.vars.highlighters[highlighterId],
command
;
if (highlighter == null || (command = highlighter.toolbarCommands[commandName]) == null)
return null;
return command.execute(sender, event, args);
},
/** Collection of toolbar items. */
items : {
expandSource : function(highlighter)
{
this.create = function()
{
if (highlighter.getParam('collapse') != true)
return;
return sh.config.strings.expandSource;
};
this.execute = function(sender, event, args)
{
var div = highlighter.div;
sender.parentNode.removeChild(sender);
div.className = div.className.replace('collapsed', '');
};
},
/**
* Command to open a new window and display the original unformatted source code inside.
*/
viewSource : function(highlighter)
{
this.create = function()
{
return sh.config.strings.viewSource;
};
this.execute = function(sender, event, args)
{
var code = sh.utils.fixInputString(highlighter.originalCode).replace(/</g, '&lt;'),
wnd = sh.utils.popup('', '_blank', 750, 400, 'location=0, resizable=1, menubar=0, scrollbars=1')
;
code = sh.utils.unindent(code);
wnd.document.write('<pre>' + code + '</pre>');
wnd.document.close();
};
},
/**
* Command to copy the original source code in to the clipboard.
* Uses Flash method if <code>clipboardSwf</code> is configured.
*/
copyToClipboard : function(highlighter)
{
var flashDiv, flashSwf,
highlighterId = highlighter.id
;
this.create = function()
{
var config = sh.config;
// disable functionality if running locally
if (config.clipboardSwf == null)
return null;
function params(list)
{
var result = '';
for (var name in list)
result += "<param name='" + name + "' value='" + list[name] + "'/>";
return result;
};
function attributes(list)
{
var result = '';
for (var name in list)
result += " " + name + "='" + list[name] + "'";
return result;
};
var args1 = {
width : config.toolbarItemWidth,
height : config.toolbarItemHeight,
id : highlighterId + '_clipboard',
type : 'application/x-shockwave-flash',
title : sh.config.strings.copyToClipboard
},
// these arguments are used in IE's <param /> collection
args2 = {
allowScriptAccess : 'always',
wmode : 'transparent',
flashVars : 'highlighterId=' + highlighterId,
menu : 'false'
},
swf = config.clipboardSwf,
html
;
if (/msie/i.test(navigator.userAgent))
{
html = '<object'
+ attributes({
classid : 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
codebase : 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'
})
+ attributes(args1)
+ '>'
+ params(args2)
+ params({ movie : swf })
+ '</object>'
;
}
else
{
html = '<embed'
+ attributes(args1)
+ attributes(args2)
+ attributes({ src : swf })
+ '/>'
;
}
flashDiv = document.createElement('div');
flashDiv.innerHTML = html;
return flashDiv;
};
this.execute = function(sender, event, args)
{
var command = args.command;
switch (command)
{
case 'get':
var code = sh.utils.unindent(
sh.utils.fixInputString(highlighter.originalCode)
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&amp;/g, '&')
);
if(window.clipboardData)
// will fall through to the confirmation because there isn't a break
window.clipboardData.setData('text', code);
else
return sh.utils.unindent(code);
case 'ok':
sh.utils.alert(sh.config.strings.copyToClipboardConfirmation);
break;
case 'error':
sh.utils.alert(args.message);
break;
}
};
},
/** Command to print the colored source code. */
printSource : function(highlighter)
{
this.create = function()
{
return sh.config.strings.print;
};
this.execute = function(sender, event, args)
{
var iframe = document.createElement('IFRAME'),
doc = null
;
// make sure there is never more than one hidden iframe created by SH
if (sh.vars.printFrame != null)
document.body.removeChild(sh.vars.printFrame);
sh.vars.printFrame = iframe;
// this hides the iframe
iframe.style.cssText = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
document.body.appendChild(iframe);
doc = iframe.contentWindow.document;
copyStyles(doc, window.document);
doc.write('<div class="' + highlighter.div.className.replace('collapsed', '') + ' printing">' + highlighter.div.innerHTML + '</div>');
doc.close();
iframe.contentWindow.focus();
iframe.contentWindow.print();
function copyStyles(destDoc, sourceDoc)
{
var links = sourceDoc.getElementsByTagName('link');
for(var i = 0; i < links.length; i++)
if(links[i].rel.toLowerCase() == 'stylesheet' && /shCore\.css$/.test(links[i].href))
destDoc.write('<link type="text/css" rel="stylesheet" href="' + links[i].href + '"></link>');
};
};
},
/** Command to display the about dialog window. */
about : function(highlighter)
{
this.create = function()
{
return sh.config.strings.help;
};
this.execute = function(sender, event)
{
var wnd = sh.utils.popup('', '_blank', 500, 250, 'scrollbars=0'),
doc = wnd.document
;
doc.write(sh.config.strings.aboutDialog);
doc.close();
wnd.focus();
};
}
}
},
utils : {
/**
* Finds an index of element in the array.
* @ignore
* @param {Object} searchElement
* @param {Number} fromIndex
* @return {Number} Returns index of element if found; -1 otherwise.
*/
indexOf : function(array, searchElement, fromIndex)
{
fromIndex = Math.max(fromIndex || 0, 0);
for (var i = fromIndex; i < array.length; i++)
if(array[i] == searchElement)
return i;
return -1;
},
/**
* Generates a unique element ID.
*/
guid : function(prefix)
{
return prefix + Math.round(Math.random() * 1000000).toString();
},
/**
* Merges two objects. Values from obj2 override values in obj1.
* Function is NOT recursive and works only for one dimensional objects.
* @param {Object} obj1 First object.
* @param {Object} obj2 Second object.
* @return {Object} Returns combination of both objects.
*/
merge: function(obj1, obj2)
{
var result = {}, name;
for (name in obj1)
result[name] = obj1[name];
for (name in obj2)
result[name] = obj2[name];
return result;
},
/**
* Attempts to convert string to boolean.
* @param {String} value Input string.
* @return {Boolean} Returns true if input was "true", false if input was "false" and value otherwise.
*/
toBoolean: function(value)
{
switch (value)
{
case "true":
return true;
case "false":
return false;
}
return value;
},
/**
* Opens up a centered popup window.
* @param {String} url URL to open in the window.
* @param {String} name Popup name.
* @param {int} width Popup width.
* @param {int} height Popup height.
* @param {String} options window.open() options.
* @return {Window} Returns window instance.
*/
popup: function(url, name, width, height, options)
{
var x = (screen.width - width) / 2,
y = (screen.height - height) / 2
;
options += ', left=' + x +
', top=' + y +
', width=' + width +
', height=' + height
;
options = options.replace(/^,/, '');
var win = window.open(url, name, options);
win.focus();
return win;
},
/**
* Adds event handler to the target object.
* @param {Object} obj Target object.
* @param {String} type Name of the event.
* @param {Function} func Handling function.
*/
addEvent: function(obj, type, func)
{
if (obj.attachEvent)
{
obj['e' + type + func] = func;
obj[type + func] = function()
{
obj['e' + type + func](window.event);
}
obj.attachEvent('on' + type, obj[type + func]);
}
else
{
obj.addEventListener(type, func, false);
}
},
/**
* Displays an alert.
* @param {String} str String to display.
*/
alert: function(str)
{
alert(sh.config.strings.alert + str)
},
/**
* Finds a brush by its alias.
*
* @param {String} alias Brush alias.
* @param {Boolean} alert Suppresses the alert if false.
* @return {Brush} Returns bursh constructor if found, null otherwise.
*/
findBrush: function(alias, alert)
{
var brushes = sh.vars.discoveredBrushes,
result = null
;
if (brushes == null)
{
brushes = {};
// Find all brushes
for (var brush in sh.brushes)
{
var aliases = sh.brushes[brush].aliases;
if (aliases == null)
continue;
// keep the brush name
sh.brushes[brush].name = brush.toLowerCase();
for (var i = 0; i < aliases.length; i++)
brushes[aliases[i]] = brush;
}
sh.vars.discoveredBrushes = brushes;
}
result = sh.brushes[brushes[alias]];
if (result == null && alert != false)
sh.utils.alert(sh.config.strings.noBrush + alias);
return result;
},
/**
* Executes a callback on each line and replaces each line with result from the callback.
* @param {Object} str Input string.
* @param {Object} callback Callback function taking one string argument and returning a string.
*/
eachLine: function(str, callback)
{
var lines = str.split('\n');
for (var i = 0; i < lines.length; i++)
lines[i] = callback(lines[i]);
return lines.join('\n');
},
/**
* This is a special trim which only removes first and last empty lines
* and doesn't affect valid leading space on the first line.
*
* @param {String} str Input string
* @return {String} Returns string without empty first and last lines.
*/
trimFirstAndLastLines: function(str)
{
return str.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, '');
},
/**
* Parses key/value pairs into hash object.
*
* Understands the following formats:
* - name: word;
* - name: [word, word];
* - name: "string";
* - name: 'string';
*
* For example:
* name1: value; name2: [value, value]; name3: 'value'
*
* @param {String} str Input string.
* @return {Object} Returns deserialized object.
*/
parseParams: function(str)
{
var match,
result = {},
arrayRegex = new XRegExp("^\\[(?<values>(.*?))\\]$"),
regex = new XRegExp(
"(?<name>[\\w-]+)" +
"\\s*:\\s*" +
"(?<value>" +
"[\\w-%#]+|" + // word
"\\[.*?\\]|" + // [] array
'".*?"|' + // "" string
"'.*?'" + // '' string
")\\s*;?",
"g"
)
;
while ((match = regex.exec(str)) != null)
{
var value = match.value
.replace(/^['"]|['"]$/g, '') // strip quotes from end of strings
;
// try to parse array value
if (value != null && arrayRegex.test(value))
{
var m = arrayRegex.exec(value);
value = m.values.length > 0 ? m.values.split(/\s*,\s*/) : [];
}
result[match.name] = value;
}
return result;
},
/**
* Wraps each line of the string into <code/> tag with given style applied to it.
*
* @param {String} str Input string.
* @param {String} css Style name to apply to the string.
* @return {String} Returns input string with each line surrounded by <span/> tag.
*/
decorate: function(str, css)
{
if (str == null || str.length == 0 || str == '\n')
return str;
str = str.replace(/</g, '&lt;');
// Replace two or more sequential spaces with &nbsp; leaving last space untouched.
str = str.replace(/ {2,}/g, function(m)
{
var spaces = '';
for (var i = 0; i < m.length - 1; i++)
spaces += '&nbsp;';
return spaces + ' ';
});
// Split each line and apply <span class="...">...</span> to them so that
// leading spaces aren't included.
if (css != null)
str = sh.utils.eachLine(str, function(line)
{
if (line.length == 0)
return '';
var spaces = '';
line = line.replace(/^(&nbsp;| )+/, function(s)
{
spaces = s;
return '';
});
if (line.length == 0)
return spaces;
return spaces + '<code class="' + css + '">' + line + '</code>';
});
return str;
},
/**
* Pads number with zeros until it's length is the same as given length.
*
* @param {Number} number Number to pad.
* @param {Number} length Max string length with.
* @return {String} Returns a string padded with proper amount of '0'.
*/
padNumber : function(number, length)
{
var result = number.toString();
while (result.length < length)
result = '0' + result;
return result;
},
/**
* Measures width of a single space character.
* @return {Number} Returns width of a single space character.
*/
measureSpace : function()
{
var container = document.createElement('div'),
span,
result = 0,
body = document.body,
id = sh.utils.guid('measureSpace'),
// variable names will be compressed, so it's better than a plain string
divOpen = '<div class="',
closeDiv = '</div>',
closeSpan = '</span>'
;
// we have to duplicate highlighter nested structure in order to get an acurate space measurment
container.innerHTML =
divOpen + 'syntaxhighlighter">'
+ divOpen + 'lines">'
+ divOpen + 'line">'
+ divOpen + 'content'
+ '"><span class="block"><span id="' + id + '">&nbsp;' + closeSpan + closeSpan
+ closeDiv
+ closeDiv
+ closeDiv
+ closeDiv
;
body.appendChild(container);
span = document.getElementById(id);
if (/opera/i.test(navigator.userAgent))
{
var style = window.getComputedStyle(span, null);
result = parseInt(style.getPropertyValue("width"));
}
else
{
result = span.offsetWidth;
}
body.removeChild(container);
return result;
},
/**
* Replaces tabs with spaces.
*
* @param {String} code Source code.
* @param {Number} tabSize Size of the tab.
* @return {String} Returns code with all tabs replaces by spaces.
*/
processTabs : function(code, tabSize)
{
var tab = '';
for (var i = 0; i < tabSize; i++)
tab += ' ';
return code.replace(/\t/g, tab);
},
/**
* Replaces tabs with smart spaces.
*
* @param {String} code Code to fix the tabs in.
* @param {Number} tabSize Number of spaces in a column.
* @return {String} Returns code with all tabs replaces with roper amount of spaces.
*/
processSmartTabs : function(code, tabSize)
{
var lines = code.split('\n'),
tab = '\t',
spaces = ''
;
// Create a string with 1000 spaces to copy spaces from...
// It's assumed that there would be no indentation longer than that.
for (var i = 0; i < 50; i++)
spaces += ' '; // 20 spaces * 50
// This function inserts specified amount of spaces in the string
// where a tab is while removing that given tab.
function insertSpaces(line, pos, count)
{
return line.substr(0, pos)
+ spaces.substr(0, count)
+ line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab
;
};
// Go through all the lines and do the 'smart tabs' magic.
code = sh.utils.eachLine(code, function(line)
{
if (line.indexOf(tab) == -1)
return line;
var pos = 0;
while ((pos = line.indexOf(tab)) != -1)
{
// This is pretty much all there is to the 'smart tabs' logic.
// Based on the position within the line and size of a tab,
// calculate the amount of spaces we need to insert.
var spaces = tabSize - pos % tabSize;
line = insertSpaces(line, pos, spaces);
}
return line;
});
return code;
},
/**
* Performs various string fixes based on configuration.
*/
fixInputString : function(str)
{
var br = /<br\s*\/?>|&lt;br\s*\/?&gt;/gi;
if (sh.config.bloggerMode == true)
str = str.replace(br, '\n');
if (sh.config.stripBrs == true)
str = str.replace(br, '');
return str;
},
/**
* Removes all white space at the begining and end of a string.
*
* @param {String} str String to trim.
* @return {String} Returns string without leading and following white space characters.
*/
trim: function(str)
{
return str.replace(/^\s+|\s+$/g, '');
},
/**
* Unindents a block of text by the lowest common indent amount.
* @param {String} str Text to unindent.
* @return {String} Returns unindented text block.
*/
unindent: function(str)
{
var lines = sh.utils.fixInputString(str).split('\n'),
indents = new Array(),
regex = /^\s*/,
min = 1000
;
// go through every line and check for common number of indents
for (var i = 0; i < lines.length && min > 0; i++)
{
var line = lines[i];
if (sh.utils.trim(line).length == 0)
continue;
var matches = regex.exec(line);
// In the event that just one line doesn't have leading white space
// we can't unindent anything, so bail completely.
if (matches == null)
return str;
min = Math.min(matches[0].length, min);
}
// trim minimum common number of white space from the begining of every line
if (min > 0)
for (var i = 0; i < lines.length; i++)
lines[i] = lines[i].substr(min);
return lines.join('\n');
},
/**
* Callback method for Array.sort() which sorts matches by
* index position and then by length.
*
* @param {Match} m1 Left object.
* @param {Match} m2 Right object.
* @return {Number} Returns -1, 0 or -1 as a comparison result.
*/
matchesSortCallback: function(m1, m2)
{
// sort matches by index first
if(m1.index < m2.index)
return -1;
else if(m1.index > m2.index)
return 1;
else
{
// if index is the same, sort by length
if(m1.length < m2.length)
return -1;
else if(m1.length > m2.length)
return 1;
}
return 0;
},
/**
* Executes given regular expression on provided code and returns all
* matches that are found.
*
* @param {String} code Code to execute regular expression on.
* @param {Object} regex Regular expression item info from <code>regexList</code> collection.
* @return {Array} Returns a list of Match objects.
*/
getMatches: function(code, regexInfo)
{
function defaultAdd(match, regexInfo)
{
return [new sh.Match(match[0], match.index, regexInfo.css)];
};
var index = 0,
match = null,
result = [],
func = regexInfo.func ? regexInfo.func : defaultAdd
;
while((match = regexInfo.regex.exec(code)) != null)
result = result.concat(func(match, regexInfo));
return result;
},
processUrls: function(code)
{
var lt = '&lt;',
gt = '&gt;'
;
return code.replace(sh.regexLib.url, function(m)
{
var suffix = '', prefix = '';
// We include &lt; and &gt; in the URL for the common cases like <http://google.com>
// The problem is that they get transformed into &lt;http://google.com&gt;
// Where as &gt; easily looks like part of the URL string.
if (m.indexOf(lt) == 0)
{
prefix = lt;
m = m.substring(lt.length);
}
if (m.indexOf(gt) == m.length - gt.length)
{
m = m.substring(0, m.length - gt.length);
suffix = gt;
}
return prefix + '<a href="' + m + '">' + m + '</a>' + suffix;
});
},
/**
* Finds all <SCRIPT TYPE="syntaxhighlighter" /> elements.
* @return {Array} Returns array of all found SyntaxHighlighter tags.
*/
getSyntaxHighlighterScriptTags: function()
{
var tags = document.getElementsByTagName('script'),
result = []
;
for (var i = 0; i < tags.length; i++)
if (tags[i].type == 'syntaxhighlighter')
result.push(tags[i]);
return result;
},
/**
* Strips <![CDATA[]]> from <SCRIPT /> content because it should be used
* there in most cases for XHTML compliance.
* @param {String} original Input code.
* @return {String} Returns code without leading <![CDATA[]]> tags.
*/
stripCData: function(original)
{
var left = '<![CDATA[',
right = ']]>',
// for some reason IE inserts some leading blanks here
copy = sh.utils.trim(original),
changed = false
;
if (copy.indexOf(left) == 0)
{
copy = copy.substring(left.length);
changed = true;
}
if (copy.indexOf(right) == copy.length - right.length)
{
copy = copy.substring(0, copy.length - right.length);
changed = true;
}
return changed ? copy : original;
}
}, // end of utils
/**
* Shorthand to highlight all elements on the page that are marked as
* SyntaxHighlighter source code.
*
* @param {Object} globalParams Optional parameters which override element's
* parameters. Only used if element is specified.
*
* @param {Object} element Optional element to highlight. If none is
* provided, all elements in the current document
* are highlighted.
*/
highlight : function(globalParams, element)
{
function toArray(source)
{
var result = [];
for (var i = 0; i < source.length; i++)
result.push(source[i]);
return result;
};
var elements = element ? [element] : toArray(document.getElementsByTagName(sh.config.tagName)),
propertyName = 'innerHTML',
highlighter = null,
conf = sh.config
;
// support for <SCRIPT TYPE="syntaxhighlighter" /> feature
if (conf.useScriptTags)
elements = elements.concat(sh.utils.getSyntaxHighlighterScriptTags());
if (elements.length === 0)
return;
for (var i = 0; i < elements.length; i++)
{
var target = elements[i],
params = sh.utils.parseParams(target.className),
brushName,
code,
result
;
// local params take precedence over globals
params = sh.utils.merge(globalParams, params);
brushName = params['brush'];
if (brushName == null)
continue;
// Instantiate a brush
if (params['html-script'] == 'true' || sh.defaults['html-script'] == true)
{
highlighter = new sh.HtmlScript(brushName);
brushName = 'htmlscript';
}
else
{
var brush = sh.utils.findBrush(brushName);
if (brush)
{
brushName = brush.name;
highlighter = new brush();
}
else
{
continue;
}
}
code = target[propertyName];
// remove CDATA from <SCRIPT/> tags if it's present
if (conf.useScriptTags)
code = sh.utils.stripCData(code);
params['brush-name'] = brushName;
highlighter.highlight(code, params);
result = highlighter.div;
if (sh.config.debug)
{
result = document.createElement('textarea');
result.value = highlighter.div.innerHTML;
result.style.width = '70em';
result.style.height = '30em';
}
target.parentNode.replaceChild(result, target);
}
},
/**
* Main entry point for the SyntaxHighlighter.
* @param {Object} params Optional params to apply to all highlighted elements.
*/
all : function(params)
{
sh.utils.addEvent(
window,
'load',
function() { sh.highlight(params); }
);
}
}; // end of sh
/**
* Match object.
*/
sh.Match = function(value, index, css)
{
this.value = value;
this.index = index;
this.length = value.length;
this.css = css;
this.brushName = null;
};
sh.Match.prototype.toString = function()
{
return this.value;
};
/**
* Simulates HTML code with a scripting language embedded.
*
* @param {String} scriptBrushName Brush name of the scripting language.
*/
sh.HtmlScript = function(scriptBrushName)
{
var brushClass = sh.utils.findBrush(scriptBrushName),
scriptBrush,
xmlBrush = new sh.brushes.Xml(),
bracketsRegex = null
;
if (brushClass == null)
return;
scriptBrush = new brushClass();
this.xmlBrush = xmlBrush;
if (scriptBrush.htmlScript == null)
{
sh.utils.alert(sh.config.strings.brushNotHtmlScript + scriptBrushName);
return;
}
xmlBrush.regexList.push(
{ regex: scriptBrush.htmlScript.code, func: process }
);
function offsetMatches(matches, offset)
{
for (var j = 0; j < matches.length; j++)
matches[j].index += offset;
}
function process(match, info)
{
var code = match.code,
matches = [],
regexList = scriptBrush.regexList,
offset = match.index + match.left.length,
htmlScript = scriptBrush.htmlScript,
result
;
// add all matches from the code
for (var i = 0; i < regexList.length; i++)
{
result = sh.utils.getMatches(code, regexList[i]);
offsetMatches(result, offset);
matches = matches.concat(result);
}
// add left script bracket
if (htmlScript.left != null && match.left != null)
{
result = sh.utils.getMatches(match.left, htmlScript.left);
offsetMatches(result, match.index);
matches = matches.concat(result);
}
// add right script bracket
if (htmlScript.right != null && match.right != null)
{
result = sh.utils.getMatches(match.right, htmlScript.right);
offsetMatches(result, match.index + match[0].lastIndexOf(match.right));
matches = matches.concat(result);
}
for (var j = 0; j < matches.length; j++)
matches[j].brushName = brushClass.name;
return matches;
}
};
sh.HtmlScript.prototype.highlight = function(code, params)
{
this.xmlBrush.highlight(code, params);
this.div = this.xmlBrush.div;
}
/**
* Main Highlither class.
* @constructor
*/
sh.Highlighter = function()
{
};
sh.Highlighter.prototype = {
/**
* Returns value of the parameter passed to the highlighter.
* @param {String} name Name of the parameter.
* @param {Object} defaultValue Default value.
* @return {Object} Returns found value or default value otherwise.
*/
getParam : function(name, defaultValue)
{
var result = this.params[name];
return sh.utils.toBoolean(result == null ? defaultValue : result);
},
/**
* Shortcut to document.createElement().
* @param {String} name Name of the element to create (DIV, A, etc).
* @return {HTMLElement} Returns new HTML element.
*/
create: function(name)
{
return document.createElement(name);
},
/**
* Applies all regular expression to the code and stores all found
* matches in the `this.matches` array.
* @param {Array} regexList List of regular expressions.
* @param {String} code Source code.
* @return {Array} Returns list of matches.
*/
findMatches: function(regexList, code)
{
var result = [];
if (regexList != null)
for (var i = 0; i < regexList.length; i++)
// BUG: length returns len+1 for array if methods added to prototype chain (oising@gmail.com)
if (typeof (regexList[i]) == "object")
result = result.concat(sh.utils.getMatches(code, regexList[i]));
// sort the matches
return result.sort(sh.utils.matchesSortCallback);
},
/**
* Checks to see if any of the matches are inside of other matches.
* This process would get rid of highligted strings inside comments,
* keywords inside strings and so on.
*/
removeNestedMatches: function()
{
var matches = this.matches;
// Optimized by Jose Prado (http://joseprado.com)
for (var i = 0; i < matches.length; i++)
{
if (matches[i] === null)
continue;
var itemI = matches[i],
itemIEndPos = itemI.index + itemI.length
;
for (var j = i + 1; j < matches.length && matches[i] !== null; j++)
{
var itemJ = matches[j];
if (itemJ === null)
continue;
else if (itemJ.index > itemIEndPos)
break;
else if (itemJ.index == itemI.index && itemJ.length > itemI.length)
this.matches[i] = null;
else if (itemJ.index >= itemI.index && itemJ.index < itemIEndPos)
this.matches[j] = null;
}
}
},
/**
* Splits block of text into individual DIV lines.
* @param {String} code Code to highlight.
* @return {String} Returns highlighted code in HTML form.
*/
createDisplayLines : function(code)
{
var lines = code.split(/\n/g),
firstLine = parseInt(this.getParam('first-line')),
padLength = this.getParam('pad-line-numbers'),
highlightedLines = this.getParam('highlight', []),
hasGutter = this.getParam('gutter')
;
code = '';
if (padLength == true)
padLength = (firstLine + lines.length - 1).toString().length;
else if (isNaN(padLength) == true)
padLength = 0;
for (var i = 0; i < lines.length; i++)
{
var line = lines[i],
indent = /^(&nbsp;|\s)+/.exec(line),
lineClass = 'alt' + (i % 2 == 0 ? 1 : 2),
lineNumber = sh.utils.padNumber(firstLine + i, padLength),
highlighted = sh.utils.indexOf(highlightedLines, (firstLine + i).toString()) != -1,
spaces = null
;
if (indent != null)
{
spaces = indent[0].toString();
line = line.substr(spaces.length);
}
line = sh.utils.trim(line);
if (line.length == 0)
line = '&nbsp;';
if (highlighted)
lineClass += ' highlighted';
code +=
'<div class="line ' + lineClass + '">'
+ '<table>'
+ '<tr>'
+ (hasGutter ? '<td class="number"><code>' + lineNumber + '</code></td>' : '')
+ '<td class="content">'
+ (spaces != null ? '<code class="spaces">' + spaces.replace(' ', '&nbsp;') + '</code>' : '')
+ line
+ '</td>'
+ '</tr>'
+ '</table>'
+ '</div>'
;
}
return code;
},
/**
* Finds all matches in the source code.
* @param {String} code Source code to process matches in.
* @param {Array} matches Discovered regex matches.
* @return {String} Returns formatted HTML with processed mathes.
*/
processMatches: function(code, matches)
{
var pos = 0,
result = '',
decorate = sh.utils.decorate, // make an alias to save some bytes
brushName = this.getParam('brush-name', '')
;
function getBrushNameCss(match)
{
var result = match ? (match.brushName || brushName) : brushName;
return result ? result + ' ' : '';
};
// Finally, go through the final list of matches and pull the all
// together adding everything in between that isn't a match.
for (var i = 0; i < matches.length; i++)
{
var match = matches[i],
matchBrushName
;
if (match === null || match.length === 0)
continue;
matchBrushName = getBrushNameCss(match);
result += decorate(code.substr(pos, match.index - pos), matchBrushName + 'plain')
+ decorate(match.value, matchBrushName + match.css)
;
pos = match.index + match.length;
}
// don't forget to add whatever's remaining in the string
result += decorate(code.substr(pos), getBrushNameCss() + 'plain');
return result;
},
/**
* Highlights the code and returns complete HTML.
* @param {String} code Code to highlight.
* @param {Object} params Parameters object.
*/
highlight: function(code, params)
{
// using variables for shortcuts because JS compressor will shorten local variable names
var conf = sh.config,
vars = sh.vars,
div,
divClassName,
tabSize,
important = 'important'
;
this.params = {};
this.div = null;
this.lines = null;
this.code = null;
this.bar = null;
this.toolbarCommands = {};
this.id = sh.utils.guid('highlighter_');
// register this instance in the highlighters list
vars.highlighters[this.id] = this;
if (code === null)
code = '';
// local params take precedence over defaults
this.params = sh.utils.merge(sh.defaults, params || {});
// process light mode
if (this.getParam('light') == true)
this.params.toolbar = this.params.gutter = false;
this.div = div = this.create('DIV');
this.lines = this.create('DIV');
this.lines.className = 'lines';
className = 'syntaxhighlighter';
div.id = this.id;
// make collapsed
if (this.getParam('collapse'))
className += ' collapsed';
// disable gutter
if (this.getParam('gutter') == false)
className += ' nogutter';
// disable line wrapping
if (this.getParam('wrap-lines') == false)
this.lines.className += ' no-wrap';
// add custom user style name
className += ' ' + this.getParam('class-name');
// add brush alias to the class name for custom CSS
className += ' ' + this.getParam('brush-name');
div.className = className;
this.originalCode = code;
this.code = sh.utils.trimFirstAndLastLines(code)
.replace(/\r/g, ' ') // IE lets these buggers through
;
tabSize = this.getParam('tab-size');
// replace tabs with spaces
this.code = this.getParam('smart-tabs') == true
? sh.utils.processSmartTabs(this.code, tabSize)
: sh.utils.processTabs(this.code, tabSize)
;
this.code = sh.utils.unindent(this.code);
// add controls toolbar
if (this.getParam('toolbar'))
{
this.bar = this.create('DIV');
this.bar.className = 'bar';
this.bar.appendChild(sh.toolbar.create(this));
div.appendChild(this.bar);
// set up toolbar rollover
var bar = this.bar;
function hide() { bar.className = bar.className.replace('show', ''); }
div.onmouseover = function() { hide(); bar.className += ' show'; };
div.onmouseout = function() { hide(); }
}
div.appendChild(this.lines);
this.matches = this.findMatches(this.regexList, this.code);
this.removeNestedMatches();
code = this.processMatches(this.code, this.matches);
// finally, split all lines so that they wrap well
code = this.createDisplayLines(sh.utils.trim(code));
// finally, process the links
if (this.getParam('auto-links'))
code = sh.utils.processUrls(code);
this.lines.innerHTML = code;
},
/**
* Converts space separated list of keywords into a regular expression string.
* @param {String} str Space separated keywords.
* @return {String} Returns regular expression string.
*/
getKeywords: function(str)
{
str = str
.replace(/^\s+|\s+$/g, '')
.replace(/\s+/g, '|')
;
return '\\b(?:' + str + ')\\b';
},
/**
* Makes a brush compatible with the `html-script` functionality.
* @param {Object} regexGroup Object containing `left` and `right` regular expressions.
*/
forHtmlScript: function(regexGroup)
{
this.htmlScript = {
left : { regex: regexGroup.left, css: 'script' },
right : { regex: regexGroup.right, css: 'script' },
code : new XRegExp(
"(?<left>" + regexGroup.left.source + ")" +
"(?<code>.*?)" +
"(?<right>" + regexGroup.right.source + ")",
"sgi"
)
};
}
}; // end of Highlighter
return sh;
}(); // end of anonymous function
/**
* XRegExp 0.6.1
* (c) 2007-2008 Steven Levithan
* <http://stevenlevithan.com/regex/xregexp/>
* MIT License
*
* provides an augmented, cross-browser implementation of regular expressions
* including support for additional modifiers and syntax. several convenience
* methods and a recursive-construct parser are also included.
*/
// prevent running twice, which would break references to native globals
if (!window.XRegExp) {
// anonymous function to avoid global variables
(function () {
// copy various native globals for reference. can't use the name ``native``
// because it's a reserved JavaScript keyword.
var real = {
exec: RegExp.prototype.exec,
match: String.prototype.match,
replace: String.prototype.replace,
split: String.prototype.split
},
/* regex syntax parsing with support for all the necessary cross-
browser and context issues (escapings, character classes, etc.) */
lib = {
part: /(?:[^\\([#\s.]+|\\(?!k<[\w$]+>|[pP]{[^}]+})[\S\s]?|\((?=\?(?!#|<[\w$]+>)))+|(\()(?:\?(?:(#)[^)]*\)|<([$\w]+)>))?|\\(?:k<([\w$]+)>|[pP]{([^}]+)})|(\[\^?)|([\S\s])/g,
replaceVar: /(?:[^$]+|\$(?![1-9$&`']|{[$\w]+}))+|\$(?:([1-9]\d*|[$&`'])|{([$\w]+)})/g,
extended: /^(?:\s+|#.*)+/,
quantifier: /^(?:[?*+]|{\d+(?:,\d*)?})/,
classLeft: /&&\[\^?/g,
classRight: /]/g
},
indexOf = function (array, item, from) {
for (var i = from || 0; i < array.length; i++)
if (array[i] === item) return i;
return -1;
},
brokenExecUndef = /()??/.exec("")[1] !== undefined,
plugins = {};
/**
* Accepts a pattern and flags, returns a new, extended RegExp object.
* differs from a native regex in that additional flags and syntax are
* supported and browser inconsistencies are ameliorated.
* @ignore
*/
XRegExp = function (pattern, flags) {
if (pattern instanceof RegExp) {
if (flags !== undefined)
throw TypeError("can't supply flags when constructing one RegExp from another");
return pattern.addFlags(); // new copy
}
var flags = flags || "",
singleline = flags.indexOf("s") > -1,
extended = flags.indexOf("x") > -1,
hasNamedCapture = false,
captureNames = [],
output = [],
part = lib.part,
match, cc, len, index, regex;
part.lastIndex = 0; // in case the last XRegExp compilation threw an error (unbalanced character class)
while (match = real.exec.call(part, pattern)) {
// comment pattern. this check must come before the capturing group check,
// because both match[1] and match[2] will be non-empty.
if (match[2]) {
// keep tokens separated unless the following token is a quantifier
if (!lib.quantifier.test(pattern.slice(part.lastIndex)))
output.push("(?:)");
// capturing group
} else if (match[1]) {
captureNames.push(match[3] || null);
if (match[3])
hasNamedCapture = true;
output.push("(");
// named backreference
} else if (match[4]) {
index = indexOf(captureNames, match[4]);
// keep backreferences separate from subsequent literal numbers
// preserve backreferences to named groups that are undefined at this point as literal strings
output.push(index > -1 ?
"\\" + (index + 1) + (isNaN(pattern.charAt(part.lastIndex)) ? "" : "(?:)") :
match[0]
);
// unicode element (requires plugin)
} else if (match[5]) {
output.push(plugins.unicode ?
plugins.unicode.get(match[5], match[0].charAt(1) === "P") :
match[0]
);
// character class opening delimiter ("[" or "[^")
// (non-native unicode elements are not supported within character classes)
} else if (match[6]) {
if (pattern.charAt(part.lastIndex) === "]") {
// for cross-browser compatibility with ECMA-262 v3 behavior,
// convert [] to (?!) and [^] to [\S\s].
output.push(match[6] === "[" ? "(?!)" : "[\\S\\s]");
part.lastIndex++;
} else {
// parse the character class with support for inner escapes and
// ES4's infinitely nesting intersection syntax ([&&[^&&[]]]).
cc = XRegExp.matchRecursive("&&" + pattern.slice(match.index), lib.classLeft, lib.classRight, "", {escapeChar: "\\"})[0];
output.push(match[6] + cc + "]");
part.lastIndex += cc.length + 1;
}
// dot ("."), pound sign ("#"), or whitespace character
} else if (match[7]) {
if (singleline && match[7] === ".") {
output.push("[\\S\\s]");
} else if (extended && lib.extended.test(match[7])) {
len = real.exec.call(lib.extended, pattern.slice(part.lastIndex - 1))[0].length;
// keep tokens separated unless the following token is a quantifier
if (!lib.quantifier.test(pattern.slice(part.lastIndex - 1 + len)))
output.push("(?:)");
part.lastIndex += len - 1;
} else {
output.push(match[7]);
}
} else {
output.push(match[0]);
}
}
regex = RegExp(output.join(""), real.replace.call(flags, /[sx]+/g, ""));
regex._x = {
source: pattern,
captureNames: hasNamedCapture ? captureNames : null
};
return regex;
};
/**
* Barebones plugin support for now (intentionally undocumented)
* @ignore
* @param {Object} name
* @param {Object} o
*/
XRegExp.addPlugin = function (name, o) {
plugins[name] = o;
};
/**
* Adds named capture support, with values returned as ``result.name``.
*
* Also fixes two cross-browser issues, following the ECMA-262 v3 spec:
* - captured values for non-participating capturing groups should be returned
* as ``undefined``, rather than the empty string.
* - the regex's ``lastIndex`` should not be incremented after zero-length
* matches.
* @ignore
*/
RegExp.prototype.exec = function (str) {
var match = real.exec.call(this, str),
name, i, r2;
if (match) {
// fix browsers whose exec methods don't consistently return
// undefined for non-participating capturing groups
if (brokenExecUndef && match.length > 1) {
// r2 doesn't need /g or /y, but they shouldn't hurt
r2 = new RegExp("^" + this.source + "$(?!\\s)", this.getNativeFlags());
real.replace.call(match[0], r2, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
// attach named capture properties
if (this._x && this._x.captureNames) {
for (i = 1; i < match.length; i++) {
name = this._x.captureNames[i - 1];
if (name) match[name] = match[i];
}
}
// fix browsers that increment lastIndex after zero-length matches
if (this.global && this.lastIndex > (match.index + match[0].length))
this.lastIndex--;
}
return match;
};
})(); // end anonymous function
} // end if(!window.XRegExp)
/**
* intentionally undocumented
* @ignore
*/
RegExp.prototype.getNativeFlags = function () {
return (this.global ? "g" : "") +
(this.ignoreCase ? "i" : "") +
(this.multiline ? "m" : "") +
(this.extended ? "x" : "") +
(this.sticky ? "y" : "");
};
/**
* Accepts flags; returns a new XRegExp object generated by recompiling
* the regex with the additional flags (may include non-native flags).
* The original regex object is not altered.
* @ignore
*/
RegExp.prototype.addFlags = function (flags) {
var regex = new XRegExp(this.source, (flags || "") + this.getNativeFlags());
if (this._x) {
regex._x = {
source: this._x.source,
captureNames: this._x.captureNames ? this._x.captureNames.slice(0) : null
};
}
return regex;
};
/**
* Accepts a context object and string; returns the result of calling
* ``exec`` with the provided string. the context is ignored but is
* accepted for congruity with ``Function.prototype.call``.
* @ignore
*/
RegExp.prototype.call = function (context, str) {
return this.exec(str);
};
/**
* Accepts a context object and arguments array; returns the result of
* calling ``exec`` with the first value in the arguments array. the context
* is ignored but is accepted for congruity with ``Function.prototype.apply``.
* @ignore
*/
RegExp.prototype.apply = function (context, args) {
return this.exec(args[0]);
};
/**
* Accepts a pattern and flags; returns an XRegExp object. if the pattern
* and flag combination has previously been cached, the cached copy is
* returned, otherwise the new object is cached.
* @ignore
*/
XRegExp.cache = function (pattern, flags) {
var key = "/" + pattern + "/" + (flags || "");
return XRegExp.cache[key] || (XRegExp.cache[key] = new XRegExp(pattern, flags));
};
/**
* Accepts a string; returns the string with regex metacharacters escaped.
* the returned string can safely be used within a regex to match a literal
* string. escaped characters are [, ], {, }, (, ), -, *, +, ?, ., \, ^, $,
* |, #, [comma], and whitespace.
* @ignore
*/
XRegExp.escape = function (str) {
return str.replace(/[-[\]{}()*+?.\\^$|,#\s]/g, "\\$&");
};
/**
* Accepts a string to search, left and right delimiters as regex pattern
* strings, optional regex flags (may include non-native s, x, and y flags),
* and an options object which allows setting an escape character and changing
* the return format from an array of matches to a two-dimensional array of
* string parts with extended position data. returns an array of matches
* (optionally with extended data), allowing nested instances of left and right
* delimiters. use the g flag to return all matches, otherwise only the first
* is returned. if delimiters are unbalanced within the subject data, an error
* is thrown.
*
* This function admittedly pushes the boundaries of what can be accomplished
* sensibly without a "real" parser. however, by doing so it provides flexible
* and powerful recursive parsing capabilities with minimal code weight.
*
* Warning: the ``escapeChar`` option is considered experimental and might be
* changed or removed in future versions of XRegExp.
*
* unsupported features:
* - backreferences within delimiter patterns when using ``escapeChar``.
* - although providing delimiters as regex objects adds the minor feature of
* independent delimiter flags, it introduces other limitations and is only
* intended to be done by the ``XRegExp`` constructor (which can't call
* itself while building a regex).
*
* @ignore
*/
XRegExp.matchRecursive = function (str, left, right, flags, options) {
var options = options || {},
escapeChar = options.escapeChar,
vN = options.valueNames,
flags = flags || "",
global = flags.indexOf("g") > -1,
ignoreCase = flags.indexOf("i") > -1,
multiline = flags.indexOf("m") > -1,
sticky = flags.indexOf("y") > -1,
/* sticky mode has its own handling in this function, which means you
can use flag "y" even in browsers which don't support it natively */
flags = flags.replace(/y/g, ""),
left = left instanceof RegExp ? (left.global ? left : left.addFlags("g")) : new XRegExp(left, "g" + flags),
right = right instanceof RegExp ? (right.global ? right : right.addFlags("g")) : new XRegExp(right, "g" + flags),
output = [],
openTokens = 0,
delimStart = 0,
delimEnd = 0,
lastOuterEnd = 0,
outerStart, innerStart, leftMatch, rightMatch, escaped, esc;
if (escapeChar) {
if (escapeChar.length > 1) throw SyntaxError("can't supply more than one escape character");
if (multiline) throw TypeError("can't supply escape character when using the multiline flag");
escaped = XRegExp.escape(escapeChar);
/* Escape pattern modifiers:
/g - not needed here
/i - included
/m - **unsupported**, throws error
/s - handled by XRegExp when delimiters are provided as strings
/x - handled by XRegExp when delimiters are provided as strings
/y - not needed here; supported by other handling in this function
*/
esc = new RegExp(
"^(?:" + escaped + "[\\S\\s]|(?:(?!" + left.source + "|" + right.source + ")[^" + escaped + "])+)+",
ignoreCase ? "i" : ""
);
}
while (true) {
/* advance the starting search position to the end of the last delimiter match.
a couple special cases are also covered:
- if using an escape character, advance to the next delimiter's starting position,
skipping any escaped characters
- first time through, reset lastIndex in case delimiters were provided as regexes
*/
left.lastIndex = right.lastIndex = delimEnd +
(escapeChar ? (esc.exec(str.slice(delimEnd)) || [""])[0].length : 0);
leftMatch = left.exec(str);
rightMatch = right.exec(str);
// only keep the result which matched earlier in the string
if (leftMatch && rightMatch) {
if (leftMatch.index <= rightMatch.index)
rightMatch = null;
else leftMatch = null;
}
/* paths*:
leftMatch | rightMatch | openTokens | result
1 | 0 | 1 | ...
1 | 0 | 0 | ...
0 | 1 | 1 | ...
0 | 1 | 0 | throw
0 | 0 | 1 | throw
0 | 0 | 0 | break
* - does not include the sticky mode special case
- the loop ends after the first completed match if not in global mode
*/
if (leftMatch || rightMatch) {
delimStart = (leftMatch || rightMatch).index;
delimEnd = (leftMatch ? left : right).lastIndex;
} else if (!openTokens) {
break;
}
if (sticky && !openTokens && delimStart > lastOuterEnd)
break;
if (leftMatch) {
if (!openTokens++) {
outerStart = delimStart;
innerStart = delimEnd;
}
} else if (rightMatch && openTokens) {
if (!--openTokens) {
if (vN) {
if (vN[0] && outerStart > lastOuterEnd)
output.push([vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart]);
if (vN[1]) output.push([vN[1], str.slice(outerStart, innerStart), outerStart, innerStart]);
if (vN[2]) output.push([vN[2], str.slice(innerStart, delimStart), innerStart, delimStart]);
if (vN[3]) output.push([vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd]);
} else {
output.push(str.slice(innerStart, delimStart));
}
lastOuterEnd = delimEnd;
if (!global)
break;
}
} else {
// reset lastIndex in case delimiters were provided as regexes
left.lastIndex = right.lastIndex = 0;
throw Error("subject data contains unbalanced delimiters");
}
// if the delimiter matched an empty string, advance delimEnd to avoid an infinite loop
if (delimStart === delimEnd)
delimEnd++;
}
if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd)
output.push([vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length]);
// reset lastIndex in case delimiters were provided as regexes
left.lastIndex = right.lastIndex = 0;
return output;
};
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.0.320 (May 03 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Xml = function()
{
function process(match, regexInfo)
{
var constructor = SyntaxHighlighter.Match,
code = match[0],
tag = new XRegExp('(&lt;|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code),
result = []
;
if (match.attributes != null)
{
var attributes,
regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' +
'\\s*=\\s*' +
'(?<value> ".*?"|\'.*?\'|\\w+)',
'xg');
while ((attributes = regex.exec(code)) != null)
{
result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
}
}
if (tag != null)
result.push(
new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
);
return result;
}
this.regexList = [
{ regex: new XRegExp('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
{ regex: new XRegExp('(\\&lt;|<)!--\\s*.*?\\s*--(\\&gt;|>)', 'gm'), css: 'comments' }, // <!-- ... -->
{ regex: new XRegExp('(&lt;|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)', 'sg'), func: process }
];
};
SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html', 'xhtml'];
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.0.320 (May 03 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.JScript = function()
{
var keywords = 'break case catch continue ' +
'default delete do else false ' +
'for function if in instanceof ' +
'new null return super switch ' +
'this throw true try typeof var while with'
;
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
];
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
};
SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript'];
SyntaxHighlighter.config.clipboardSwf = 'syntax/clipboard.swf';
$(function () {
var divs = $([]);
$("#container .source").each(function () {
var code = $(this).html().replace(/</g,'&lt;').replace(/>/g,'&gt;'),
div = $('<div class="code"><pre class="brush:' + ( $(this).is("script") ? 'js' : 'xml' ) + ';">' + code + '</pre></div>'),
demo = $(this).prevAll(".demo:eq(0)");
$(this).after(div);
if(!$(this).hasClass("below")) divs = divs.add(div);
});
SyntaxHighlighter.all();
setTimeout((function (divs) {
return function () {
divs.each(function () {
var div = $(this),
demo = $(this).prevAll(".demo:eq(0)"),
h = false;
var h = Math.max(demo[0].offsetHeight, div[0].offsetHeight);
if(h) {
if(h < 198) h = 198;
div.height(h);
demo.height(h);
}
});
}
})(divs), 500);
// $(".panel").hide().prev().click(function () { $(this).next().toggle(); }).css("cursor","pointer");
});

View File

@ -0,0 +1,511 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
.syntaxhighlighter,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody
{
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
outline: 0 !important;
background: none !important;
text-align: left !important;
float: none !important;
vertical-align: baseline !important;
position: static !important;
left: auto !important;
top: auto !important;
right: auto !important;
bottom: auto !important;
height: auto !important;
width: auto !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
min-height: inherit !important; /* For IE8, FF & WebKit */
min-height: auto !important; /* For IE7 */
/*
line-height: 1.1em !important;
font-size: 1em !important;
*/
font-size:12px !important;
line-height:18px !important;
}
.syntaxhighlighter
{
width: 99.9% !important; /* 99% fixes IE8 horizontal scrollbar */
margin: 1em 0 1em 0 !important;
padding: 1px !important; /* adds a little border on top and bottom */
position: relative !important;
}
.syntaxhighlighter .bold
{
font-weight: bold !important;
}
.syntaxhighlighter .italic
{
font-style: italic !important;
}
.syntaxhighlighter .line
{
}
.syntaxhighlighter .no-wrap .line .content
{
white-space: pre !important;
}
.syntaxhighlighter .line table
{
border-collapse: collapse !important;
}
.syntaxhighlighter .line td
{
vertical-align: top !important;
}
.syntaxhighlighter .line .number
{
width: 3em !important;
}
.syntaxhighlighter .line .number code
{
width: 2.7em !important;
padding-right: .3em !important;
text-align: right !important;
display: block !important;
}
.syntaxhighlighter .line .content
{
padding-left: .5em !important;
}
.syntaxhighlighter .line .spaces
{
}
/* Disable border and margin on the lines when no gutter option is set */
.syntaxhighlighter.nogutter .line .content
{
border-left: none !important;
}
.syntaxhighlighter .bar
{
display: none !important;
}
.syntaxhighlighter .bar.show
{
display: block !important;
}
.syntaxhighlighter.collapsed .bar
{
display: block !important;
}
/* Adjust some properties when collapsed */
.syntaxhighlighter.collapsed .lines
{
display: none !important;
}
.syntaxhighlighter .lines.no-wrap
{
overflow: auto !important;
overflow-y: hidden !important;
}
/* Styles for the toolbar */
.syntaxhighlighter .toolbar
{
position: absolute !important;
right: 0px !important;
top: 0px !important;
font-size: 1px !important;
padding: 8px 8px 8px 0 !important; /* in px because images don't scale with ems */
}
.syntaxhighlighter.collapsed .toolbar
{
font-size: 80% !important;
padding: .2em 0 .5em .5em !important;
position: static !important;
}
.syntaxhighlighter .toolbar a.item,
.syntaxhighlighter .toolbar .item
{
display: block !important;
float: left !important;
margin-left: 8px !important;
background-repeat: no-repeat !important;
overflow: hidden !important;
text-indent: -5000px !important;
}
.syntaxhighlighter.collapsed .toolbar .item
{
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar .item.expandSource
{
background-image: url(magnifier.png) !important;
display: inline !important;
text-indent: 0 !important;
width: auto !important;
float: none !important;
height: 16px !important;
padding-left: 20px !important;
}
.syntaxhighlighter .toolbar .item.viewSource
{
background-image: url(page_white_code.png) !important;
}
.syntaxhighlighter .toolbar .item.printSource
{
background-image: url(printer.png) !important;
}
.syntaxhighlighter .toolbar .item.copyToClipboard
{
text-indent: 0 !important;
background: none !important;
overflow: visible !important;
}
.syntaxhighlighter .toolbar .item.about
{
background-image: url(help.png) !important;
}
/**
* Print view.
* Colors are based on the default theme without background.
*/
.syntaxhighlighter.printing,
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content,
{
background: none !important;
}
/* Gutter line numbers */
.syntaxhighlighter.printing .line .number
{
color: #bbb !important;
}
/* Add border to the lines */
.syntaxhighlighter.printing .line .content
{
color: #000 !important;
}
/* Toolbar when visible */
.syntaxhighlighter.printing .toolbar
{
display: none !important;
}
.syntaxhighlighter.printing a
{
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain,
.syntaxhighlighter.printing .plain a
{
color: #000 !important;
}
.syntaxhighlighter.printing .comments,
.syntaxhighlighter.printing .comments a
{
color: #008200 !important;
}
.syntaxhighlighter.printing .string,
.syntaxhighlighter.printing .string a
{
color: blue !important;
}
.syntaxhighlighter.printing .keyword
{
color: #069 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor
{
color: gray !important;
}
.syntaxhighlighter.printing .variable
{
color: #a70 !important;
}
.syntaxhighlighter.printing .value
{
color: #090 !important;
}
.syntaxhighlighter.printing .functions
{
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants
{
color: #0066CC !important;
}
.syntaxhighlighter.printing .script
{
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1,
.syntaxhighlighter.printing .color1 a
{
color: #808080 !important;
}
.syntaxhighlighter.printing .color2,
.syntaxhighlighter.printing .color2 a
{
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3,
.syntaxhighlighter.printing .color3 a
{
color: red !important;
}
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
/************************************
* Default Syntax Highlighter theme.
*
* Interface elements.
************************************/
.syntaxhighlighter
{
background-color: #fff !important;
}
/* Highlighed line number */
.syntaxhighlighter .line.highlighted .number
{
color: black !important;
}
/* Highlighed line */
.syntaxhighlighter .line.highlighted.alt1,
.syntaxhighlighter .line.highlighted.alt2
{
background-color: #e0e0e0 !important;
}
/* Gutter line numbers */
.syntaxhighlighter .line .number
{
color: #afafaf !important;
}
/* Add border to the lines */
.syntaxhighlighter .line .content
{
border-left: 1px solid gray !important;
color: #000 !important;
}
.syntaxhighlighter.printing .line .content
{
border: 0 !important;
}
/* First line */
.syntaxhighlighter .line.alt1
{
background-color: #fff !important;
}
/* Second line */
.syntaxhighlighter .line.alt2
{
background-color: #F8F8F8 !important;
}
.syntaxhighlighter .toolbar
{
background-color: #F8F8F8 !important;
border: #E7E5DC solid 1px !important;
}
.syntaxhighlighter .toolbar a
{
color: #a0a0a0 !important;
}
.syntaxhighlighter .toolbar a:hover
{
color: red !important;
}
/************************************
* Actual syntax highlighter colors.
************************************/
.syntaxhighlighter .plain,
.syntaxhighlighter .plain a
{
color: #000 !important;
}
.syntaxhighlighter .comments,
.syntaxhighlighter .comments a
{
color: #008200 !important;
}
.syntaxhighlighter .string,
.syntaxhighlighter .string a
{
color: blue !important;
}
.syntaxhighlighter .keyword
{
color: #069 !important;
font-weight: bold !important;
}
.syntaxhighlighter .preprocessor
{
color: gray !important;
}
.syntaxhighlighter .variable
{
color: #a70 !important;
}
.syntaxhighlighter .value
{
color: #090 !important;
}
.syntaxhighlighter .functions
{
color: #ff1493 !important;
}
.syntaxhighlighter .constants
{
color: #0066CC !important;
}
.syntaxhighlighter .script
{
background-color: yellow !important;
}
.syntaxhighlighter .color1,
.syntaxhighlighter .color1 a
{
color: #808080 !important;
}
.syntaxhighlighter .color2,
.syntaxhighlighter .color2 a
{
color: #ff1493 !important;
}
.syntaxhighlighter .color3,
.syntaxhighlighter .color3 a
{
color: red !important;
}

Binary file not shown.

BIN
thirdparty/jstree/_docs/syntax/help.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

107
thirdparty/jstree/_docs/themeroller.html vendored Normal file
View File

@ -0,0 +1,107 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - themeroller documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" type="text/css" media="all" />
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>themeroller plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>themeroller</code> plugin adds support for jQuery UI's themes. Add the plugin as last in your <code>plugins</code> config option. Also make sure that you have included the jquery theme you'd like to use and you should NOT use the native jstree <code>themes</code> plugin.</p>
<p>If using the search plugin - bind to <code>"search.jstree"</code> to style the found nodes, or apply some styles to the <code>.jstree-search</code> class (which is added by default) but make sure the selector is stronger than your current theme or use <code>!important</code></p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>opened</h3>
<p class="meta">A string. Default is <code>"ui-icon-triangle-1-se"</code>.</p>
<p>The class name to use for open nodes (shows the arrow to close).</p>
<h3>closed</h3>
<p class="meta">A string. Default is <code>"ui-icon-triangle-1-e"</code>.</p>
<p>The class name to use for closed nodes (shows the arrow to open).</p>
<h3>item</h3>
<p class="meta">A string. Default is <code>"ui-state-default"</code>.</p>
<p>The class name to use for the actual items.</p>
<h3>item_h</h3>
<p class="meta">A string. Default is <code>"ui-state-hover"</code>.</p>
<p>The class name to use for the hovered item.</p>
<h3>item_a</h3>
<p class="meta">A string. Default is <code>"ui-state-active"</code>.</p>
<p>The class name to use for selected items (UI plugin).</p>
<h3>item_open</h3>
<p class="meta">A string. Default is <code>"ui-icon-folder-open"</code>.</p>
<p>The class name to use for the opened items. If set to <code>false</code> the icon is not shown.</p>
<h3>item_clsd</h3>
<p class="meta">A string. Default is <code>"ui-icon-folder-collapsed"</code>.</p>
<p>The class name to use for the opened items. If set to <code>false</code> the icon is not shown.</p>
<h3>item_leaf</h3>
<p class="meta">A string. Default is <code>"ui-icon-document"</code>.</p>
<p>The class name to use for the opened items. If set to <code>false</code> the icon is not shown.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the themeroller plugin</h3>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#"><ins class="ui-icon ui-icon-lightbulb">&#160;</ins>Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"plugins" : [ "html_data", "ui", "themeroller" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="_themeroller">._themeroller ( obj )</h3>
<p>Fixes the tree on various events by applying the configured classes - used internally only.</p>
</div>
</div>
</body>
</html>

127
thirdparty/jstree/_docs/themes.html vendored Normal file
View File

@ -0,0 +1,127 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - themes documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>themes plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>themes</code> plugin controls the looks of jstree - without this plugin you will get a functional tree, but it will look just like an ordinary UL list.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>theme</h3>
<p class="meta">A string. Default is <code>"default"</code>.</p>
<p>The name of the theme to use to style the tree.</p>
<h3>url</h3>
<p class="meta">A string (or <code>false</code> if not used). Default is <code>false</code>.</p>
<p>The location of the theme's CSS file, if set to <code>false</code> jstree will look for the file in <code><em>&lt; theme folder &gt;</em>/themes/<em>&lt; theme name &gt;</em>/style.css</code>. You can set the theme folder using <code>$.jstree._themes = "PATH/TO/FOLDER/";</code>, otherwise it is autodetected as <code><em>&lt;jquery.tree.js location&gt;</em>/themes/</code>.</p>
<h3>dots</h3>
<p class="meta">A Boolean. Default is <code>true</code>.</p>
<p>Whether to show the connecting dots or not.</p>
<h3>icons</h3>
<p class="meta">A Boolean. Default is <code>true</code>.</p>
<p>Whether to show the node icons or not.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the themes plugin</h3>
<input type="button" class="button" value="toggle_dots" id="toggle_dots" style="float:left;" />
<input type="button" class="button" value="toggle_icons" id="toggle_icons" style="float:left;" />
<input type="button" class="button" value="set_theme1" id="set_theme1" style="float:left;" />
<input type="button" class="button" value="set_theme2" id="set_theme2" style="" />
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#toggle_dots, #toggle_icons").click(function () {
$("#demo1").jstree(this.value);
});
$("#set_theme1").click(function () {
$("#demo1").jstree("set_theme","apple");
});
$("#set_theme2").click(function () {
$("#demo1").jstree("set_theme","default");
});
$("#demo1").jstree({
"themes" : {
"theme" : "default",
"dots" : false,
"icons" : false
},
"plugins" : [ "themes", "html_data" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="set_theme">.set_theme ( name , url )</h3>
<p>Set the tree's theme. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>name</strong>
<p>The name of the theme to use to style the tree.</p>
</li>
<li>
<code class="tp">string</code> <strong>url</strong>
<p>The location of the theme's CSS file, if omitted jstree will look for the file in:<br /><code><em>&lt; theme folder &gt;</em>/themes/<em>&lt; name &gt;</em>/style.css</code>.<br />You can set the theme folder using:<br /><code>$.jstree._themes = "PATH/TO/FOLDER/";</code>, otherwise it is autodetected as <code><em>&lt;jquery.tree.js location&gt;</em>/themes/</code>.</p>
</li>
</ul>
<h3 id="get_theme">.get_theme ( )</h3>
<p>Returns the name of the currently active theme.</p>
<div style="height:1px; visibility:hidden;"><span id="hide_dots">&nbsp;</span><span id="toggle_dots">&nbsp;</span></div>
<h3 id="show_dots">.show_dots ( ), .hide_dots ( ), .toggle_dots ( )</h3>
<p>Show, hide or toggle the visibility of the dots connecting the tree's nodes.</p>
<div style="height:1px; visibility:hidden;"><span id="hide_icons">&nbsp;</span><span id="toggle_icons">&nbsp;</span></div>
<h3 id="show_icons">.show_icons ( ), .hide_icons ( ), .toggle_icons ( )</h3>
<p>Show, hide or toggle the visibility of the icons next to the title of each the tree node.</p>
</div>
</div>
</body>
</html>

178
thirdparty/jstree/_docs/types.html vendored Normal file
View File

@ -0,0 +1,178 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - types documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>types plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>types</code> enables node types - each node can have a type, and you can define rules on how that type should behave - maximum children count, maximum depth, valid children types, selectable or not, etc.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>max_children</h3>
<p class="meta">A number. Default is <code>-1</code>.</p>
<p>Defines maximum number of root nodes (<code>-1</code> means unlimited, <code>-2</code> means disable max_children checking in the tree).</p>
<h3>max_depth</h3>
<p class="meta">A number. Default is <code>-1</code>.</p>
<p>Defines maximum depth of the tree (<code>-1</code> means unlimited, <code>-2</code> means disable max_depth checking in the tree).</p>
<h3>valid_children</h3>
<p class="meta">A string or array. Default is <code>"all"</code>.</p>
<p>Defines valid root node types (could be <code>"all"</code>, <code>"none"</code>, or an array of type strings).</p>
<h3>use_data</h3>
<p class="meta">A boolean. Default is <code>false</code>.</p>
<p>If set to <code>true</code> jstree will check every node for <code>$.metadata</code> or <code>$.data</code> for rules (valid_children, max_depth &amp; the function rules). Keep in mind jstree will look for this data in <code>$("li-node-here").metadata().jstree.<em>rule_name</em></code> (or <code>$.data</code> respectively).</p>
<h3>type_attr</h3>
<p class="meta">A string. Default is <code>"rel"</code>.</p>
<p>Defines the attribute on each <code>li</code> node, where the type attribute will be stored. <em>For correct usage in IE - do not assign to <code>"type"</code> - it triggers an IE bug.</em></p>
<h3>types</h3>
<p class="meta">An object.</p>
<p>Defines all the active types in the tree. Each key is the type name, and each value represents the rules for this type. A <code>default</code> type is defined - all nodes with no explicit type set are treated as if they were of the <code>default</code> type.</p>
<div style="border:1px solid gray;">
<pre class="brush:js">
types : {
// the default type
"default" : {
"max_children" : -1,
"max_depth" : -1,
"valid_children": "all"
// Bound functions - you can bind any other function here (using boolean or function)
//"select_node" : true,
//"open_node" : true,
//"close_node" : true,
//"create_node" : true,
//"delete_node" : true
}
}
</pre>
</div>
<p>For <code>max_children</code>, <code>max_depth</code> &amp; <code>valid_children</code> use the same values as for the tree, but the value you set will only apply for that node type.</p>
<p>You can set an <code>icon</code> key - it should be an object consisting of two keys - <code>image</code> (string - location of the image to be used as an icon) &amp; <code>position</code> (string - left and top pixels of the image - 10px 40px, only useful when using sprites - omit otherwise).</p>
<p>You can set more keys in that object - each key should be a function name, and each value - either a boolean (in order to allow or disallow that operation, on that node type) or a function. If you supply a function - your function will be called with two arguments - the name of the called function (the key) and the arguments passed to that function - you can then decide whether to return <code>true</code> or <code>false</code>.</p>
<p class="note">For any type - for now you can control only functions that take the node being manipulated as the first argument.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the types plugin</h3>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1" rel="root">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4" rel="root">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"types" : {
"valid_children" : [ "root" ],
"types" : {
"root" : {
"icon" : {
"image" : "http://static.jstree.com/v.1.0rc/_docs/_drive.png"
},
"valid_children" : [ "default" ],
"max_depth" : 2,
"hover_node" : false,
"select_node" : function () {return false;}
},
"default" : {
"valid_children" : [ "default" ]
}
}
},
"plugins" : ["themes","html_data","dnd","ui","types"]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="_get_type">._get_type ( node )</h3>
<p>Get the type of a node.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element.</p>
</li>
</ul>
<h3 id="set_type">.set_type ( type , node )</h3>
<p>Set the type of a node. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>type</strong>
<p>The new type.</p>
</li>
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element.</p>
</li>
</ul>
<h3 id="_check">._check ( rule , node , opts )</h3>
<p>Checks a rule on a give node. Used mostly internally.</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>rule</strong>
<p>The rule to check.</p>
</li>
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to the element.</p>
</li>
<li>
<code class="tp">mixed</code> <strong>opts</strong>
<p>Any additional options regarding the rule. Used internally.</p>
</li>
</ul>
<div style="height:1px; visibility:hidden;"><span id="check_move">&nbsp;</span></div>
<h3 id="create_node">.create_node ( ), .check_move ( )</h3>
<p>Both functions are overwritten to accomodate the new functionality presented by the plugin.</p>
</div>
</div>
</body>
</html>

197
thirdparty/jstree/_docs/ui.html vendored Normal file
View File

@ -0,0 +1,197 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - UI documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>ui plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>UI</code> plugin handles selecting, deselecting and hovering tree items.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>select_limit</h3>
<p class="meta">A number. Default is <code>-1</code>.</p>
<p>Defines how many nodes can be selected at a given time (<code>-1</code> means unlimited).</p>
<h3>select_multiple_modifier</h3>
<p class="meta">A string. Default is <code>"ctrl"</code>.</p>
<p>The special key used to make a click add to the selection and not replace it (<code>"ctrl"</code>, <code>"shift"</code>, <code>"alt"</code>, <code>"meta"</code>).<br />You can also set this to <code>"on"</code> making every click add to the selection.</p>
<h3>select_range_modifier</h3>
<p class="meta">A string. Default is <code>"shift"</code>.</p>
<p>The special key used to make a click expand a range from the last selected item (<code>"ctrl"</code>, <code>"shift"</code>, <code>"alt"</code>, <code>"meta"</code>).<br />Note that the last clicked elemtn should be a sibling of the currently clicked element so that a range will be created (same as common file explorers).</p>
<h3>selected_parent_close</h3>
<p class="meta">A string (or <code>false</code>). Default is <code>"select_parent"</code>.</p>
<p>What action to take when a selected node's parent is closed (making the selected node invisible). Possible values are <code>false</code> - do nothing, <code>"select_parent"</code> - select the closed node's parent and <code>"deselect"</code> - deselect the node.</p>
<h3>selected_parent_open</h3>
<p class="meta">A Boolean. Default is <code>true</code>.</p>
<p>When set to <code>true</code> when programatically selecting a node in the tree all of its closed parents are opened automatically.</p>
<h3>select_prev_on_delete</h3>
<p class="meta">A boolean. Default is <code>true</code>.</p>
<p>If set to <code>true</code> when a selected node is deleted, its previous sibling (or parent) is selected.</p>
<h3>disable_selecting_children</h3>
<p class="meta">A boolean. Default is <code>false</code>.</p>
<p>If set to <code>true</code> you will not be able to select children of already selected nodes.</p>
<h3>initially_select</h3>
<p class="meta">An array. Default is <code>[]</code>.</p>
<p>Defines which nodes are to be automatically selected when the tree finishes loading - a list of IDs is expected.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the UI plugin</h3>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"ui" : {
"select_limit" : 2,
"select_multiple_modifier" : "alt",
"selected_parent_close" : "select_parent",
"initially_select" : [ "phtml_2" ]
},
"core" : { "initially_open" : [ "phtml_1" ] },
"plugins" : [ "themes", "html_data", "ui" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="_get_node">._get_node ( node , allow_multiple )</h3>
<p>Overrides the function from the <a href="core.html#_get_node">core</a> module.<br />if <code>node</code> is <code>undefined</code> or <code>null</code> and <code>allow_multiple</code> is <code>true</code> all the currently selected nodes are returned<br />if <code>node</code> is <code>undefined</code> or <code>null</code> and <code>allow_multiple</code> is NOT <code>true</code> only the last selected node is returned.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
<li>
<code class="tp">boolean</code> <strong>allow_multiple</strong>
<p>Whether to return all selected nodes or only the last selected one if <code>node</code> is <code>null</code>.</p>
</li>
</ul>
<h3 id="save_selected">.save_selected ( )</h3>
<p>Saves away the current selection state of the tree (saves it in a variable, so do not expect a restore after a refresh - for that functionality refer to the <a href="cookies.html">cookies plugin</a>. Used mostly internally. Triggers an event.</p>
<h3 id="reselect">.reselect ( )</h3>
<p>Restores the state of the tree using the variable saved in the above function. Used mostly internally. Triggers an event.</p>
<h3 id="refresh">.refresh ( node )</h3>
<p>Overrides the function form the <a href="core.html#refresh">core</a> module.<br />Enables saving the selection state before the refresh and restoring it afterwards.</p>
<h3 id="hover_node">.hover_node ( node )</h3>
<p>Sets the specified node as hovered. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<h3 id="dehover_node">.dehover_node ( )</h3>
<p>Removes the hover state from the currently hovered node (if there is one). Triggers an event.</p>
<h3 id="select_node">.select_node ( node , check , event )</h3>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
<li>
<code class="tp">bool</code> <strong>check</strong>
<p>Whether to check the specified rules and do appropriate actions (check <code>select_limit</code>, deselect other nodes respectively, etc) or to just force selection of the node regardless of <code>select_limit</code>.</p>
</li>
<li>
<code class="tp">event</code> <strong>event</strong>
<p>Used internally - when a click on a node caused this function to be executed.</p>
</li>
</ul>
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="toggle_select">&#160;</span></div>
<h3 id="deselect_node">.deselect_node ( node ), .toggle_select ( node )</h3>
<p>There functions control the selected state on a node. <code>deselect_node</code> triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<h3 id="deselect_all">.deselect_all ( context )</h3>
<p>Deselects all selected nodes. If context is set - only the selected nodes within that context are deselected. Triggers an event.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>context</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<h3 id="get_selected">.get_selected ( context )</h3>
<p>Returns all selected nodes. If context is set - only the selected nodes within that context are returned.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>context</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
<h3 id="is_selected">.is_selected ( node )</h3>
<p>Returns whether the specified node is selected or not.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
</li>
</ul>
</div>
</div>
</body>
</html>

85
thirdparty/jstree/_docs/unique.html vendored Normal file
View File

@ -0,0 +1,85 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - unique documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>unique plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>unique</code> plugin prevents from nodes with same titles coexisting (create/move/rename) in the same parent.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>error_callback</h3>
<p class="meta">A function. Default is <code>$.noop</code>.</p>
<p>Whenever the plugin stops an action (because it violates the unique policy) this function will bre triggered in current tree's scope, receiving the name, siblings and function name that caused the conflict.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<p>Try moving the child nodes together (drag'n'drop).</p>
<h3>Using the unique plugin</h3>
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
</ul>
</li>
<li id="phtml_4">
<a href="#">Root node 2</a>
<ul>
<li id="phtml_3">
<a href="#">Child node 1</a>
</li>
</ul>
</li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"unique" : {
"error_callback" : function (n, p, f) {
// alert("Duplicate node `" + n + "` with function `" + f + "`!");
}
},
"plugins" : [ "themes", "html_data", "dnd", "unique" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<h3 id="save_cookie">._check_unique ( names, siblings )</h3>
<p>Used internally - checks the names array against the sibling nodes for matches.</p>
</div>
</div>
</body>
</html>

218
thirdparty/jstree/_docs/xml_data.html vendored Normal file
View File

@ -0,0 +1,218 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTree v.1.0 - xml_data documentation</title>
<script type="text/javascript" src="../_lib/jquery.js"></script>
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
<link type="text/css" rel="stylesheet" href="!style.css"/>
<script type="text/javascript" src="syntax/!script.js"></script>
</head>
<body>
<div id="container">
<h1 id="dhead">jsTree v.1.0</h1>
<h1>xml_data plugin</h1>
<h2>Description</h2>
<div id="description">
<p>The <code>xml_data</code> plugin enables jsTree to convert XML objects to interactive trees (using XSL). The data (XML) can be set up in the config (as a string) or retrieved from a server (also ondemand).</p>
<p>Two types of XML structures are supported - flat and nested:</p>
<div class="code_f">
<pre class="brush:xml;">
&lt;!-- FLAT --&gt;
&lt;root&gt;
&lt;item id="root_1" parent_id="0" state="closed"&gt;
&lt;content&gt;
&lt;name&gt;&lt;![CDATA[Node 1]]&gt;&lt;/name&gt;
&lt;/content&gt;
&lt;/item&gt;
&lt;item id="node_2" parent_id="root_1"&gt;
&lt;content&gt;
&lt;name&gt;&lt;![CDATA[Node 2]]&gt;&lt;/name&gt;
&lt;/content&gt;
&lt;/item&gt;
&lt;/root&gt;
&lt;!-- NESTED --&gt;
&lt;root&gt;
&lt;item id="xml_1"&gt;
&lt;content&gt;&lt;name&gt;&lt;![CDATA[Root node 1]]&gt;&lt;/name&gt;&lt;/content&gt;
&lt;item id="xml_2"&gt;
&lt;content&gt;&lt;name&gt;&lt;![CDATA[Child node 1]]&gt;&lt;/name&gt;&lt;/content&gt;
&lt;/item&gt;
&lt;/item&gt;
&lt;/root&gt;
</pre>
</div>
<p>Aside from nesting the only difference is the <code>parent_id</code> attribute used in <code>xml_flat</code>.</p>
<p><code>parent_id</code> defines the parent of the node in XML flat, use <code>0</code> for root nodes. Also when using async - use <code>0</code> for the first level.</p>
<p><code>state</code> defines the state of the node (<code>open</code> or <code>closed</code>). You can omit it too - jstree will handle the data automatically - nodes with no children will be leaf nodes, nodes with children will be closed.</p>
<p>All attributes you set on the <code>item</code> node will be transfered to the resulting <code>li</code> node. All attributes you set on the <code>name</code> node will be transfered to the resulting <code>a</code> node.</p>
<p>If you are using the <a href="languages.html">languages plugin</a> you can have multiple <code>name</code> nodes in a every <code>item</code> node, just set a <code>language</code> attribute on each one (<code>&lt;name language="en" ...</code>).</p>
<p class="note">Remember to always set the XML header on your XML files.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="panel configuration">
<h3>data</h3>
<p class="meta">A XML string (or <code>false</code> if not used). Default is <code>false</code>.</p>
<p>Specifies the content to load into the container and convert to a tree.</p>
<h3>ajax</h3>
<p class="meta">An object (or <code>false</code> if not used). Default is <code>false</code>.</p>
<p>The ajax config object is pretty much the same as the <a href="http://api.jquery.com/jQuery.ajax/">jQuery ajax settings object</a>.</p>
<p>You can set the <code>data</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the node about to be open as a parameter (or <code>-1</code> for initial load). Whatever you return in the function will be sent to the server as data (so for example you can send the node's ID).</p>
<p>You can set the <code>url</code> option to a function, that will be executed in the current tree's scope (<code>this</code> will be the tree instance) and gets the node about to be open as a paramater (or <code>-1</code> for initial load). Whatever you return in the <code>url</code> function will be used as the ajax URL (so that you can accomodate pretty paths such as /get_children/node_2).</p>
<p>The <code>error</code> and <code>success</code> functions (if present) also fire in the context of the tree, and if you return a value in the <code>success</code> function it will be used to populate the tree - this can be useful if you want to somehow change what the server returned on the client side before it is displayed in the tree. Please note that the <code>success</code> function receives a string as the first parameter, and also if you decide to return a value - return a string.</p>
<h3>correct_state</h3>
<p class="meta">A Boolean. Default is <code>true</code>.</p>
<p>If this option is set to <code>true</code> if an AJAX returns an empty result, the node that was about to be opened will be converted to a leaf node (the open icon will no longer be displayed).</p>
<h3>clean_node</h3>
<p class="meta">A Boolean. Default is <code>false</code>.</p>
<p>Set to true if node needs to be cleaned - usually you should leave this to <code>false</code>.</p>
<h3>xsl</h3>
<p class="meta">A string. Default is <code>"flat"</code>.</p>
<p>The type of structure you wiil be using - set either to <code>"flat"</code> or <code>"nest"</code>.</p>
<h3>get_skip_empty</h3>
<p class="meta">A Boolean. Default is <code>false</code>.</p>
<p>If set to <code>true</code> empty attributes won't be returned by the <code>get_xml</code> function.</p>
<p class="note"><strong>NOTE:</strong><br />If both <code>data</code> and <code>ajax</code> are set the initial tree is rendered from the <code>data</code> string. When opening a closed node (that has no loaded children) an AJAX request is made.</p>
</div>
<h2 id="demos">Demos</h2>
<div class="panel">
<h3>Using the data config option (flat)</h3>
<div id="demo1" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"xml_data" : {
"data" : "" +
"<root>" +
"<item id='node_1'>" +
"<content><name>Root node 1</name></content>" +
"</item>" +
"<item>" +
"<content><name>Root node 2</name></content>" +
"</item>" +
"<item parent_id='node_1'>" +
"<content><name>Child node</name></content>" +
"</item>" +
"</root>"
},
"plugins" : [ "themes", "xml_data" ]
});
});
</script>
<h3>Using the ajax config option (nested)</h3>
<div id="demo2" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo2").jstree({
"xml_data" : {
"ajax" : {
"url" : "_xml_nest.xml"
},
"xsl" : "nest"
},
"plugins" : [ "themes", "xml_data" ]
});
});
</script>
<h3>Using both the data &amp; ajax config options (flat)</h3>
<div id="demo4" class="demo"></div>
<script type="text/javascript" class="source">
$(function () {
$("#demo4").jstree({
"xml_data" : {
"data" : "" +
"<root>" +
"<item id='node_1' state='closed'>" +
"<content><name>Root node 1</name></content>" +
"</item>" +
"<item>" +
"<content><name>Root node 2</name></content>" +
"</item>" +
"</root>",
"ajax" : {
"url" : "_xml_flat.xml",
"data" : function (n) {
return {
id : n.attr ? n.attr("id") : 0,
rand : new Date().getTime()
};
}
}
},
"plugins" : [ "themes", "xml_data" ]
});
});
</script>
</div>
<h2 id="api">API</h2>
<div class="panel api">
<p>Both dummy functions - <code>_is_loaded</code> and <code>load_node</code> are overwritten.</p>
<h3 id="load_node_xml">.load_node_xml ( node , success_callback , error_callback )</h3>
<p>This function is called instead of <code>load_node</code>.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element you want loaded. Use <code>-1</code> for root nodes.</p>
</li>
<li>
<code class="tp">function</code> <strong>success_callback</strong>
<p>A function to be executed once the node is loaded successfully - used internally. You should wait for the <code>load_node</code> event.</p>
</li>
<li>
<code class="tp">function</code> <strong>error_callback</strong>
<p>A function to be executed if the node is not loaded due to an error - used internally. You should wait for the <code>load_node</code> event.</p>
</li>
</ul>
<h3 id="parse_xml">.parse_xml ( data )</h3>
<p>This function converts XML strings or objects to the DOM structure required by jstree. Returns a jQuery object.</p>
<ul class="arguments">
<li>
<code class="tp">mixed</code> <strong>data</strong>
<p>The XML string/object.</p>
</li>
</ul>
<h3 id="get_xml">.get_xml ( type , node , li_attr , a_attr , is_callback )</h3>
<p>This function returns an array of tree nodes converted back to XML.</p>
<ul class="arguments">
<li>
<code class="tp">string</code> <strong>type</strong>
<p>Either <code>"flat"</code> or <code>"nest"</code>. Default is <code>"flat"</code>.</p>
</li>
<li>
<code class="tp">mixed</code> <strong>node</strong>
<p>This can be a DOM node, jQuery node or selector pointing to an element you want returned. Use <code>-1</code> or omit to get the whole tree.</p>
</li>
<li>
<code class="tp">array</code> <strong>li_attr</strong>
<p>The attributes to collect from the <code>LI</code> node. Defaults to <code>[ "id" , "class" ]</p>
</li>
<li>
<code class="tp">array</code> <strong>a_attr</strong>
<p>The attributes to collect from the <code>A</code> node. Defaults to <code>[ ]</p>
</li>
<li>
<code class="tp">string</code> <strong>is_callback</strong>
<p>Used internally.</p>
</li>
</ul>
</div>
</div>
</body>
</html>

96
thirdparty/jstree/_lib/jquery.cookie.js vendored Normal file
View File

@ -0,0 +1,96 @@
/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
/**
* Create a cookie with the given name and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
* used when the cookie was set.
*
* @param String name The name of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
* If set to null or omitted, the cookie will be a session cookie and will not be retained
* when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
// CAUTION: Needed to parenthesize options.path and options.domain
// in the following expressions, otherwise they evaluate to undefined
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
};

View File

@ -0,0 +1,99 @@
/*
* jQuery Hotkeys Plugin
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Based upon the plugin by Tzury Bar Yochay:
* http://github.com/tzuryby/hotkeys
*
* Original idea by:
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
*/
(function(jQuery){
jQuery.hotkeys = {
version: "0.8",
specialKeys: {
8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta"
},
shiftNums: {
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
".": ">", "/": "?", "\\": "|"
}
};
function keyHandler( handleObj ) {
// Only care when a possible input has been specified
if ( typeof handleObj.data !== "string" ) {
return;
}
var origHandler = handleObj.handler,
keys = handleObj.data.toLowerCase().split(" ");
handleObj.handler = function( event ) {
// Don't fire in text-accepting inputs that we didn't directly bind to
if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
event.target.type === "text") ) {
return;
}
// Keypress represents characters, not special keys
var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
character = String.fromCharCode( event.which ).toLowerCase(),
key, modif = "", possible = {};
// check combinations (alt|ctrl|shift+anything)
if ( event.altKey && special !== "alt" ) {
modif += "alt+";
}
if ( event.ctrlKey && special !== "ctrl" ) {
modif += "ctrl+";
}
// TODO: Need to make sure this works consistently across platforms
if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
modif += "meta+";
}
if ( event.shiftKey && special !== "shift" ) {
modif += "shift+";
}
if ( special ) {
possible[ modif + special ] = true;
} else {
possible[ modif + character ] = true;
possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
if ( modif === "shift+" ) {
possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
}
}
for ( var i = 0, l = keys.length; i < l; i++ ) {
if ( possible[ keys[i] ] ) {
return origHandler.apply( this, arguments );
}
}
};
}
jQuery.each([ "keydown", "keyup", "keypress" ], function() {
jQuery.event.special[ this ] = { add: keyHandler };
});
})( jQuery );

18
thirdparty/jstree/_lib/jquery.js vendored Normal file
View File

@ -0,0 +1,18 @@
/*!
* jQuery JavaScript Library v1.6.1
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Thu May 12 15:04:36 2011 -0400
*/
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("<!doctype><html><body></body></html>");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bF.test(a)?d(a,e):b_(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bU,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bQ),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bD(a,b,c){var d=b==="width"?bx:by,e=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return e;f.each(d,function(){c||(e-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?e+=parseFloat(f.css(a,"margin"+this))||0:e-=parseFloat(f.css(a,"border"+this+"Width"))||0});return e}function bn(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bm(a){f.nodeName(a,"input")?bl(a):a.getElementsByTagName&&f.grep(a.getElementsByTagName("input"),bl)}function bl(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bk(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bj(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bi(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bh(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function X(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(S.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(y,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?C.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),y.done(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(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:C,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:E?function(a){return a==null?"":E.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?C.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(F)return F.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=D.call(arguments,2),g=function(){return a.apply(c,f.concat(D.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){G["[object "+b+"]"]=b.toLowerCase()}),x=e.uaMatch(w),x.browser&&(e.browser[x.browser]=!0,e.browser.version=x.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?z=function(){c.removeEventListener("DOMContentLoaded",z,!1),e.ready()}:c.attachEvent&&(z=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",z),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.addClass(a.call(this,b,c.attr("class")||""))});if(a&&typeof a=="string"){var b=(a||"").split(o);for(var c=0,d=this.length;c<d;c++){var e=this[c];if(e.nodeType===1)if(!e.className)e.className=a;else{var g=" "+e.className+" ",h=e.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);e.className=f.trim(h)}}}return this},removeClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b){var c=(a||"").split(o);for(var d=0,e=this.length;d<e;d++){var g=this[d];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(n," ");for(var i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){var d=f(this);d.toggleClass(a.call(this,c,d.attr("class"),b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem
)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.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 pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,O(a.origType,a.selector),f.extend({},a,{handler:N,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,O(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?F:E):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=F;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=F;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F,this.stopPropagation()},isDefaultPrevented:E,isPropagationStopped:E,isImmediatePropagationStopped:E};var G=function(a){var b=a.relatedTarget;a.type=a.data;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&f.event.handle.apply(this,arguments)}catch(d){}},H=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?H:G,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?H:G)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&L("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&L("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var I,J=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var M={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||E,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=y.exec(h),k="",j&&(k=j[0],h=h.replace(y,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,M[h]?(a.push(M[h]+k),h=h+k):h=(M[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+O(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+O(h,m),e)}return this}}),f.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){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=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|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var P=/Until$/,Q=/^(?:parents|prevUntil|prevAll)/,R=/,/,S=/^.[^:#\[\.,]*$/,T=Array.prototype.slice,U=f.expr.match.POS,V={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(X(this,a,!1),"not",a)},filter:function(a){return this.pushStack(X(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=U.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(W(c[0])||W(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/<tbody/i,bb=/<|&#?\w+;/,bc=/<(?:script|object|embed|option|style)/i,bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={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,"",""]};bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(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,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bh(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bn)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bc.test(a[0])&&(f.support.checkClone||!bd.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||
b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1></$2>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bm(k[i]);else bm(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bo=/alpha\([^)]*\)/i,bp=/opacity=([^)]*)/,bq=/-([a-z])/ig,br=/([A-Z]|^ms)/g,bs=/^-?\d+(?:px)?$/i,bt=/^-?\d/,bu=/^[+\-]=/,bv=/[^+\-\.\de]+/g,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB,bC=function(a,b){return b.toUpperCase()};f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0,widows:!0,orphans:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bu.test(d)&&(d=+d.replace(bv,"")+parseFloat(f.css(a,c))),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bq,bC)}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){a.offsetWidth!==0?e=bD(a,b,d):f.swap(a,bw,function(){e=bD(a,b,d)});if(e<=0){e=bz(a,b,b),e==="0px"&&bB&&(e=bB(a,b,b));if(e!=null)return e===""||e==="auto"?"0px":e}if(e<0||e==null){e=a.style[b];return e===""||e==="auto"?"0px":e}return typeof e=="string"?e:e+"px"}},set:function(a,b){if(!bs.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bO,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bP.test(this.nodeName)||bJ.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bI.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bV,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bE,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cv(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cm.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=cn.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this),f.isFunction(d.old)&&d.old.call(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cq||cs(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!co&&(cr?(co=1,g=function(){co&&(cr(g),e.tick())},cr(g)):co=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cq||cs(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){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:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<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>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);

View File

@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* $Date: 2011-02-09 12:17:14 +1300 (Wed, 09 Feb 2011) $ * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
* $Revision: 236 $ * $Revision: 236 $
*/ */
@ -57,47 +57,44 @@
return $.vakata.css.get_css(rule_name, true, sheet); return $.vakata.css.get_css(rule_name, true, sheet);
}, },
add_sheet : function(opts) { add_sheet : function(opts) {
// MODIFIED ischommer/SilverStripe: add_sheet significantly slows down rendering, var tmp = false, is_new = true;
// we're loading all required CSS directly rather than adding it inline if(opts.str) {
if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
// var tmp = false, is_new = true; if(tmp) { is_new = false; }
// if(opts.str) { else {
// if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; } tmp = document.createElement("style");
// if(tmp) { is_new = false; } tmp.setAttribute('type',"text/css");
// else { if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
// tmp = document.createElement("style"); }
// tmp.setAttribute('type',"text/css"); if(tmp.styleSheet) {
// if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); } if(is_new) {
// } document.getElementsByTagName("head")[0].appendChild(tmp);
// if(tmp.styleSheet) { tmp.styleSheet.cssText = opts.str;
// if(is_new) { }
// document.getElementsByTagName("head")[0].appendChild(tmp); else {
// tmp.styleSheet.cssText = opts.str; tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
// } }
// else { }
// tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str; else {
// } tmp.appendChild(document.createTextNode(opts.str));
// } document.getElementsByTagName("head")[0].appendChild(tmp);
// else { }
// tmp.appendChild(document.createTextNode(opts.str)); return tmp.sheet || tmp.styleSheet;
// document.getElementsByTagName("head")[0].appendChild(tmp); }
// } if(opts.url) {
// return tmp.sheet || tmp.styleSheet; if(document.createStyleSheet) {
// } try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
// if(opts.url) { }
// if(document.createStyleSheet) { else {
// try { tmp = document.createStyleSheet(opts.url); } catch (e) { } tmp = document.createElement('link');
// } tmp.rel = 'stylesheet';
// else { tmp.type = 'text/css';
// tmp = document.createElement('link'); tmp.media = "all";
// tmp.rel = 'stylesheet'; tmp.href = opts.url;
// tmp.type = 'text/css'; document.getElementsByTagName("head")[0].appendChild(tmp);
// tmp.media = "all"; return tmp.styleSheet;
// tmp.href = opts.url; }
// document.getElementsByTagName("head")[0].appendChild(tmp); }
// return tmp.styleSheet;
// }
// }
} }
}; };
@ -117,7 +114,7 @@
if(isMethodCall) { if(isMethodCall) {
if(settings.substring(0, 1) == '_') { return returnValue; } if(settings.substring(0, 1) == '_') { return returnValue; }
this.each(function() { this.each(function() {
var instance = instances[$.data(this, "jstree-instance-id")], var instance = instances[$.data(this, "jstree_instance_id")],
methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance; methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; } if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
}); });
@ -125,7 +122,7 @@
else { else {
this.each(function() { this.each(function() {
// extend settings and allow for multiple hashes and $.data // extend settings and allow for multiple hashes and $.data
var instance_id = $.data(this, "jstree-instance-id"), var instance_id = $.data(this, "jstree_instance_id"),
a = [], a = [],
b = settings ? $.extend({}, true, settings) : {}, b = settings ? $.extend({}, true, settings) : {},
c = $(this), c = $(this),
@ -140,7 +137,7 @@
// push a new empty object to the instances array // push a new empty object to the instances array
instance_id = parseInt(instances.push({}),10) - 1; instance_id = parseInt(instances.push({}),10) - 1;
// store the jstree instance id to the container element // store the jstree instance id to the container element
$.data(this, "jstree-instance-id", instance_id); $.data(this, "jstree_instance_id", instance_id);
// clean up all plugins // clean up all plugins
b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice(); b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
b.plugins.unshift("core"); b.plugins.unshift("core");
@ -162,7 +159,7 @@
$.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; }); $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
$.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } }); $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
// initialize the instance // initialize the instance
setTimeout(function() { instances[instance_id].init(); }, 0); setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
}); });
} }
// return the jquery selection (or if it was a method call that returned a value - the returned value) // return the jquery selection (or if it was a method call that returned a value - the returned value)
@ -181,7 +178,7 @@
var o = $(needle); var o = $(needle);
if(!o.length && typeof needle === "string") { o = $("#" + needle); } if(!o.length && typeof needle === "string") { o = $("#" + needle); }
if(!o.length) { return null; } if(!o.length) { return null; }
return instances[o.closest(".jstree").data("jstree-instance-id")] || null; return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
}, },
_instance : function (index, container, settings) { _instance : function (index, container, settings) {
// for plugins to store data in // for plugins to store data in
@ -359,7 +356,8 @@
this.get_container() this.get_container()
.delegate("li > ins", "click.jstree", $.proxy(function (event) { .delegate("li > ins", "click.jstree", $.proxy(function (event) {
var trgt = $(event.target); var trgt = $(event.target);
if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); } // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
this.toggle_node(trgt);
}, this)) }, this))
.bind("mousedown.jstree", $.proxy(function () { .bind("mousedown.jstree", $.proxy(function () {
this.set_focus(); // This used to be setTimeout(set_focus,0) - why? this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
@ -436,7 +434,7 @@
this.get_container() this.get_container()
.unbind(".jstree") .unbind(".jstree")
.undelegate(".jstree") .undelegate(".jstree")
.removeData("jstree-instance-id") .removeData("jstree_instance_id")
.find("[class^='jstree']") .find("[class^='jstree']")
.andSelf() .andSelf()
.attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); }); .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
@ -526,7 +524,7 @@
} }
this.__callback({}); this.__callback({});
}, },
refresh : function (obj, s_call, e_call) { refresh : function (obj) {
var _this = this; var _this = this;
this.save_opened(); this.save_opened();
if(!obj) { obj = -1; } if(!obj) { obj = -1; }
@ -534,15 +532,7 @@
if(!obj) { obj = -1; } if(!obj) { obj = -1; }
if(obj !== -1) { obj.children("UL").remove(); } if(obj !== -1) { obj.children("UL").remove(); }
else { this.get_container_ul().empty(); } else { this.get_container_ul().empty(); }
this.load_node( this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
obj,
function () {
_this.__callback({ "obj" : obj});
_this.reload_nodes();
if(s_call) s_call.call(this);
},
e_call
);
}, },
// Dummy function to fire after the first load (so that there is a jstree.loaded event) // Dummy function to fire after the first load (so that there is a jstree.loaded event)
loaded : function () { loaded : function () {
@ -763,6 +753,7 @@
if(m.language) { tmp.addClass(m.language); } if(m.language) { tmp.addClass(m.language); }
} }
tmp.prepend("<ins class='jstree-icon'>&#160;</ins>"); tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
if(!m.icon && js.icon) { m.icon = js.icon; }
if(m.icon) { if(m.icon) {
if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); } if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); } else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
@ -817,7 +808,7 @@
} }
else { else {
obj = obj.contents().filter(function() { return this.nodeType == 3; })[0]; obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
return obj ? obj.nodeValue : ''; return obj.nodeValue;
} }
}, },
set_text : function (obj, val) { set_text : function (obj, val) {
@ -931,10 +922,12 @@
check_move : function () { check_move : function () {
var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r; var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; } if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; } if(!obj.cy) {
obj.o.each(function () { if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; } obj.o.each(function () {
}); if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
});
}
return ret; return ret;
}, },
move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) { move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
@ -1669,7 +1662,7 @@
obj = this._get_node(obj); obj = this._get_node(obj);
var s = this._get_settings().json_data; var s = this._get_settings().json_data;
if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) { if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
obj.removeData("jstree-children"); obj.removeData("jstree_children");
} }
return this.__call_old(); return this.__call_old();
}, },
@ -1679,11 +1672,11 @@
success_func = function () {}; success_func = function () {};
obj = this._get_node(obj); obj = this._get_node(obj);
if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree-children")) { if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
d = this._parse_json(obj.data("jstree-children"), obj); d = this._parse_json(obj.data("jstree_children"), obj);
if(d) { if(d) {
obj.append(d); obj.append(d);
if(!s.progressive_unload) { obj.removeData("jstree-children"); } if(!s.progressive_unload) { obj.removeData("jstree_children"); }
} }
this.clean_node(obj); this.clean_node(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
@ -1691,8 +1684,8 @@
} }
if(obj && obj !== -1) { if(obj && obj !== -1) {
if(obj.data("jstree-is-loading")) { return; } if(obj.data("jstree_is_loading")) { return; }
else { obj.data("jstree-is-loading",true); } else { obj.data("jstree_is_loading",true); }
} }
switch(!0) { switch(!0) {
case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied."; case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
@ -1706,14 +1699,14 @@
} }
else { else {
obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.children("a.jstree-loading").removeClass("jstree-loading");
obj.removeData("jstree-is-loading"); obj.removeData("jstree_is_loading");
if(s.correct_state) { this.correct_state(obj); } if(s.correct_state) { this.correct_state(obj); }
} }
if(e_call) { e_call.call(this); } if(e_call) { e_call.call(this); }
} }
else { else {
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); } if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree-is-loading"); } else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
this.clean_node(obj); this.clean_node(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
} }
@ -1738,7 +1731,7 @@
if(ef) { ef.call(this, x, t, e); } if(ef) { ef.call(this, x, t, e); }
if(obj != -1 && obj.length) { if(obj != -1 && obj.length) {
obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.children("a.jstree-loading").removeClass("jstree-loading");
obj.removeData("jstree-is-loading"); obj.removeData("jstree_is_loading");
if(t === "success" && s.correct_state) { this.correct_state(obj); } if(t === "success" && s.correct_state) { this.correct_state(obj); }
} }
else { else {
@ -1755,7 +1748,7 @@
d = this._parse_json(d, obj); d = this._parse_json(d, obj);
if(d) { if(d) {
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); } if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree-is-loading"); } else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
this.clean_node(obj); this.clean_node(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
} }
@ -1768,7 +1761,7 @@
} }
else { else {
obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.children("a.jstree-loading").removeClass("jstree-loading");
obj.removeData("jstree-is-loading"); obj.removeData("jstree_is_loading");
if(s.correct_state) { if(s.correct_state) {
this.correct_state(obj); this.correct_state(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
@ -1795,7 +1788,7 @@
if(!js) { return d; } if(!js) { return d; }
if(s.progressive_unload && obj && obj !== -1) { if(s.progressive_unload && obj && obj !== -1) {
obj.data("jstree-children", d); obj.data("jstree_children", d);
} }
if($.isArray(js)) { if($.isArray(js)) {
d = $(); d = $();
@ -1834,10 +1827,10 @@
d.prepend("<ins class='jstree-icon'>&#160;</ins>"); d.prepend("<ins class='jstree-icon'>&#160;</ins>");
if(js.children) { if(js.children) {
if(s.progressive_render && js.state !== "open") { if(s.progressive_render && js.state !== "open") {
d.addClass("jstree-closed").data("jstree-children", js.children); d.addClass("jstree-closed").data("jstree_children", js.children);
} }
else { else {
if(s.progressive_unload) { d.data("jstree-children", js.children); } if(s.progressive_unload) { d.data("jstree_children", js.children); }
if($.isArray(js.children) && js.children.length) { if($.isArray(js.children) && js.children.length) {
tmp = this._parse_json(js.children, obj, true); tmp = this._parse_json(js.children, obj, true);
if(tmp.length) { if(tmp.length) {
@ -1938,6 +1931,7 @@
* This is useful for maintaining the same structure in many languages (hence the name of the plugin) * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
*/ */
(function ($) { (function ($) {
var sh = false;
$.jstree.plugin("languages", { $.jstree.plugin("languages", {
__init : function () { this._load_css(); }, __init : function () { this._load_css(); },
defaults : [], defaults : [],
@ -1952,9 +1946,9 @@
else { return false; } else { return false; }
} }
if(i == this.data.languages.current_language) { return true; } if(i == this.data.languages.current_language) { return true; }
st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css); st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, sh);
if(st !== false) { st.style.display = "none"; } if(st !== false) { st.style.display = "none"; }
st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css); st = $.vakata.css.get_css(selector + "." + i, false, sh);
if(st !== false) { st.style.display = ""; } if(st !== false) { st.style.display = ""; }
this.data.languages.current_language = i; this.data.languages.current_language = i;
this.__callback(i); this.__callback(i);
@ -2028,7 +2022,7 @@
if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; } if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
str += " } "; str += " } ";
} }
this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" }); sh = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
} }
}, },
create_node : function (obj, position, js, callback) { create_node : function (obj, position, js, callback) {
@ -2821,19 +2815,20 @@
else { else {
$t.children(":checkbox").addClass("jstree-real-checkbox"); $t.children(":checkbox").addClass("jstree-real-checkbox");
} }
if(c === "jstree-checked") { }
$t.children(":checkbox").attr("checked","checked"); if(!ts) {
if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
$t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true);
} }
} }
if(c === "jstree-checked" && !ts) { else {
$t.find("li").addClass("jstree-checked"); if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
$t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
}
} }
}); });
}); });
if(!ts) { if(!ts) {
if(obj.length === 1 && obj.is("li")) { this._repair_state(obj); }
if(obj.is("li")) { obj.each(function () { _this._repair_state(this); }); }
else { obj.find("> ul > li").each(function () { _this._repair_state(this); }); }
obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); }); obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
} }
}, },
@ -2845,11 +2840,11 @@
if(this._get_settings().checkbox.two_state) { if(this._get_settings().checkbox.two_state) {
if(state) { if(state) {
obj.removeClass("jstree-checked").addClass("jstree-unchecked"); obj.removeClass("jstree-checked").addClass("jstree-unchecked");
if(rc) { obj.children(":checkbox").removeAttr("checked"); } if(rc) { obj.children(":checkbox").prop("checked", false); }
} }
else { else {
obj.removeClass("jstree-unchecked").addClass("jstree-checked"); obj.removeClass("jstree-unchecked").addClass("jstree-checked");
if(rc) { obj.children(":checkbox").attr("checked","checked"); } if(rc) { obj.children(":checkbox").prop("checked", true); }
} }
} }
else { else {
@ -2857,13 +2852,13 @@
coll = obj.find("li").andSelf(); coll = obj.find("li").andSelf();
if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; } if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"); coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
if(rc) { coll.children(":checkbox").removeAttr("checked"); } if(rc) { coll.children(":checkbox").prop("checked", false); }
} }
else { else {
coll = obj.find("li").andSelf(); coll = obj.find("li").andSelf();
if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; } if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"); coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
if(rc) { coll.children(":checkbox").attr("checked","checked"); } if(rc) { coll.children(":checkbox").prop("checked", true); }
if(this.data.ui) { this.data.ui.last_selected = obj; } if(this.data.ui) { this.data.ui.last_selected = obj; }
this.data.checkbox.last_selected = obj; this.data.checkbox.last_selected = obj;
} }
@ -2872,23 +2867,23 @@
if(state) { if(state) {
if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) { if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); } if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
return false; return false;
} }
else { else {
$this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"); $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
if(rc) { $this.children(":checkbox").removeAttr("checked"); } if(rc) { $this.children(":checkbox").prop("checked", false); }
} }
} }
else { else {
if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) { if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); } if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
return false; return false;
} }
else { else {
$this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"); $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
if(rc) { $this.children(":checkbox").attr("checked","checked"); } if(rc) { $this.children(":checkbox").prop("checked", true); }
} }
} }
}); });
@ -2946,6 +2941,10 @@
_repair_state : function (obj) { _repair_state : function (obj) {
obj = this._get_node(obj); obj = this._get_node(obj);
if(!obj.length) { return; } if(!obj.length) { return; }
if(this._get_settings().checkbox.two_state) {
obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
return;
}
var rc = this._get_settings().checkbox.real_checkboxes, var rc = this._get_settings().checkbox.real_checkboxes,
a = obj.find("> ul > .jstree-checked").length, a = obj.find("> ul > .jstree-checked").length,
b = obj.find("> ul > .jstree-undetermined").length, b = obj.find("> ul > .jstree-undetermined").length,
@ -2955,7 +2954,7 @@
else if(a === c) { this.change_state(obj, false); } else if(a === c) { this.change_state(obj, false); }
else { else {
obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); } if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
} }
}, },
reselect : function () { reselect : function () {
@ -3204,8 +3203,8 @@
obj = this._get_node(obj); obj = this._get_node(obj);
if(obj && obj !== -1) { if(obj && obj !== -1) {
if(obj.data("jstree-is-loading")) { return; } if(obj.data("jstree_is_loading")) { return; }
else { obj.data("jstree-is-loading",true); } else { obj.data("jstree_is_loading",true); }
} }
switch(!0) { switch(!0) {
case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied."; case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
@ -3217,14 +3216,14 @@
if(d.length > 10) { if(d.length > 10) {
d = $(d); d = $(d);
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); } if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree-is-loading"); } else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
if(s.clean_node) { this.clean_node(obj); } if(s.clean_node) { this.clean_node(obj); }
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
} }
else { else {
if(obj && obj !== -1) { if(obj && obj !== -1) {
obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.children("a.jstree-loading").removeClass("jstree-loading");
obj.removeData("jstree-is-loading"); obj.removeData("jstree_is_loading");
if(s.correct_state) { if(s.correct_state) {
this.correct_state(obj); this.correct_state(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
@ -3268,7 +3267,7 @@
if(ef) { ef.call(this, x, t, e); } if(ef) { ef.call(this, x, t, e); }
if(obj !== -1 && obj.length) { if(obj !== -1 && obj.length) {
obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.children("a.jstree-loading").removeClass("jstree-loading");
obj.removeData("jstree-is-loading"); obj.removeData("jstree_is_loading");
if(t === "success" && s.correct_state) { this.correct_state(obj); } if(t === "success" && s.correct_state) { this.correct_state(obj); }
} }
else { else {
@ -3289,14 +3288,14 @@
if(d.length > 10) { if(d.length > 10) {
d = $(d); d = $(d);
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); } if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree-is-loading"); } else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
if(s.clean_node) { this.clean_node(obj); } if(s.clean_node) { this.clean_node(obj); }
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
} }
else { else {
if(obj && obj !== -1) { if(obj && obj !== -1) {
obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.children("a.jstree-loading").removeClass("jstree-loading");
obj.removeData("jstree-is-loading"); obj.removeData("jstree_is_loading");
if(s.correct_state) { if(s.correct_state) {
this.correct_state(obj); this.correct_state(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
@ -4031,8 +4030,8 @@
success_func = function () {}; success_func = function () {};
obj = this._get_node(obj); obj = this._get_node(obj);
if(obj && obj !== -1) { if(obj && obj !== -1) {
if(obj.data("jstree-is-loading")) { return; } if(obj.data("jstree_is_loading")) { return; }
else { obj.data("jstree-is-loading",true); } else { obj.data("jstree_is_loading",true); }
} }
switch(!0) { switch(!0) {
case ($.isFunction(s.data)): case ($.isFunction(s.data)):
@ -4041,14 +4040,14 @@
d = $(d); d = $(d);
if(!d.is("ul")) { d = $("<ul />").append(d); } if(!d.is("ul")) { d = $("<ul />").append(d); }
if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); } if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree-is-loading"); } else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
this.clean_node(obj); this.clean_node(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
} }
else { else {
if(obj && obj !== -1) { if(obj && obj !== -1) {
obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.children("a.jstree-loading").removeClass("jstree-loading");
obj.removeData("jstree-is-loading"); obj.removeData("jstree_is_loading");
if(s.correct_state) { if(s.correct_state) {
this.correct_state(obj); this.correct_state(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
@ -4093,7 +4092,7 @@
if(ef) { ef.call(this, x, t, e); } if(ef) { ef.call(this, x, t, e); }
if(obj != -1 && obj.length) { if(obj != -1 && obj.length) {
obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.children("a.jstree-loading").removeClass("jstree-loading");
obj.removeData("jstree-is-loading"); obj.removeData("jstree_is_loading");
if(t === "success" && s.correct_state) { this.correct_state(obj); } if(t === "success" && s.correct_state) { this.correct_state(obj); }
} }
else { else {
@ -4111,14 +4110,14 @@
d = $(d); d = $(d);
if(!d.is("ul")) { d = $("<ul />").append(d); } if(!d.is("ul")) { d = $("<ul />").append(d); }
if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); } if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree-is-loading"); } else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
this.clean_node(obj); this.clean_node(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
} }
else { else {
if(obj && obj !== -1) { if(obj && obj !== -1) {
obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.children("a.jstree-loading").removeClass("jstree-loading");
obj.removeData("jstree-is-loading"); obj.removeData("jstree_is_loading");
if(s.correct_state) { if(s.correct_state) {
this.correct_state(obj); this.correct_state(obj);
if(s_call) { s_call.call(this); } if(s_call) { s_call.call(this); }
@ -4229,7 +4228,8 @@
_fn : { _fn : {
_themeroller : function (obj) { _themeroller : function (obj) {
var s = this._get_settings().themeroller; var s = this._get_settings().themeroller;
obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent(); obj = (!obj || obj == -1) ? this.get_container_ul() : this._get_node(obj);
obj = (!obj || obj == -1) ? this.get_container_ul() : obj.parent();
obj obj
.find("li.jstree-closed") .find("li.jstree-closed")
.children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end() .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
@ -4342,15 +4342,19 @@
}, },
_fn : { _fn : {
_check_unique : function (nms, p, func) { _check_unique : function (nms, p, func) {
var cnms = []; var cnms = [], ok = true;
p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); }); p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
if(!cnms.length || !nms.length) { return true; } if(!cnms.length || !nms.length) { return true; }
cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(","); $.each(nms, function (i, v) {
if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) { if($.inArray(v, cnms) !== -1) {
ok = false;
return false;
}
});
if(!ok) {
this._get_settings().unique.error_callback.call(null, nms, p, func); this._get_settings().unique.error_callback.call(null, nms, p, func);
return false;
} }
return true; return ok;
}, },
check_move : function () { check_move : function () {
if(!this.__call_old()) { return false; } if(!this.__call_old()) { return false; }

View File

@ -1,61 +1,61 @@
/* /*
* jsTree apple theme 1.0 * jsTree apple theme 1.0
* Supported features: dots/no-dots, icons/no-icons, focused, loading * Supported features: dots/no-dots, icons/no-icons, focused, loading
* Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
*/ */
.jstree-apple > ul { background:url("bg.jpg") left top repeat; } .jstree-apple > ul { background:url("bg.jpg") left top repeat; }
.jstree-apple li, .jstree-apple li,
.jstree-apple ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; } .jstree-apple ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
.jstree-apple li { background-position:-90px 0; background-repeat:repeat-y; } .jstree-apple li { background-position:-90px 0; background-repeat:repeat-y; }
.jstree-apple li.jstree-last { background:transparent; } .jstree-apple li.jstree-last { background:transparent; }
.jstree-apple .jstree-open > ins { background-position:-72px 0; } .jstree-apple .jstree-open > ins { background-position:-72px 0; }
.jstree-apple .jstree-closed > ins { background-position:-54px 0; } .jstree-apple .jstree-closed > ins { background-position:-54px 0; }
.jstree-apple .jstree-leaf > ins { background-position:-36px 0; } .jstree-apple .jstree-leaf > ins { background-position:-36px 0; }
.jstree-apple a { border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; text-shadow:1px 1px 1px white; } .jstree-apple a { border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; text-shadow:1px 1px 1px white; }
.jstree-apple .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 3px 0 1px; text-shadow:1px 1px 1px silver; } .jstree-apple .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 3px 0 1px; text-shadow:1px 1px 1px silver; }
.jstree-apple .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 3px 0 1px; } .jstree-apple .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 3px 0 1px; }
.jstree-apple a .jstree-icon { background-position:-56px -20px; } .jstree-apple a .jstree-icon { background-position:-56px -20px; }
.jstree-apple a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; } .jstree-apple a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
.jstree-apple.jstree-focused { background:white; } .jstree-apple.jstree-focused { background:white; }
.jstree-apple .jstree-no-dots li, .jstree-apple .jstree-no-dots li,
.jstree-apple .jstree-no-dots .jstree-leaf > ins { background:transparent; } .jstree-apple .jstree-no-dots .jstree-leaf > ins { background:transparent; }
.jstree-apple .jstree-no-dots .jstree-open > ins { background-position:-18px 0; } .jstree-apple .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
.jstree-apple .jstree-no-dots .jstree-closed > ins { background-position:0 0; } .jstree-apple .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
.jstree-apple .jstree-no-icons a .jstree-icon { display:none; } .jstree-apple .jstree-no-icons a .jstree-icon { display:none; }
.jstree-apple .jstree-search { font-style:italic; } .jstree-apple .jstree-search { font-style:italic; }
.jstree-apple .jstree-no-icons .jstree-checkbox { display:inline-block; } .jstree-apple .jstree-no-icons .jstree-checkbox { display:inline-block; }
.jstree-apple .jstree-no-checkboxes .jstree-checkbox { display:none !important; } .jstree-apple .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
.jstree-apple .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; } .jstree-apple .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
.jstree-apple .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; } .jstree-apple .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
.jstree-apple .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; } .jstree-apple .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
.jstree-apple .jstree-checked > a > .checkbox:hover { background-position:-38px -37px; } .jstree-apple .jstree-checked > a > .checkbox:hover { background-position:-38px -37px; }
.jstree-apple .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; } .jstree-apple .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
.jstree-apple .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; } .jstree-apple .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
#vakata-dragged.jstree-apple ins { background:transparent !important; } #vakata-dragged.jstree-apple ins { background:transparent !important; }
#vakata-dragged.jstree-apple .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; } #vakata-dragged.jstree-apple .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
#vakata-dragged.jstree-apple .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; } #vakata-dragged.jstree-apple .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
#jstree-marker.jstree-apple { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; } #jstree-marker.jstree-apple { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
.jstree-apple a.jstree-search { color:aqua; } .jstree-apple a.jstree-search { color:aqua; }
.jstree-apple .jstree-locked a { color:silver; cursor:default; } .jstree-apple .jstree-locked a { color:silver; cursor:default; }
#vakata-contextmenu.jstree-apple-context, #vakata-contextmenu.jstree-apple-context,
#vakata-contextmenu.jstree-apple-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; } #vakata-contextmenu.jstree-apple-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
#vakata-contextmenu.jstree-apple-context li { } #vakata-contextmenu.jstree-apple-context li { }
#vakata-contextmenu.jstree-apple-context a { color:black; } #vakata-contextmenu.jstree-apple-context a { color:black; }
#vakata-contextmenu.jstree-apple-context a:hover, #vakata-contextmenu.jstree-apple-context a:hover,
#vakata-contextmenu.jstree-apple-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; } #vakata-contextmenu.jstree-apple-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
#vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a, #vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a,
#vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; } #vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
#vakata-contextmenu.jstree-apple-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; } #vakata-contextmenu.jstree-apple-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
#vakata-contextmenu.jstree-apple-context li ul { margin-left:-4px; } #vakata-contextmenu.jstree-apple-context li ul { margin-left:-4px; }
/* TODO: IE6 support - the `>` selectors */ /* TODO: IE6 support - the `>` selectors */

View File

@ -1,77 +1,77 @@
/* /*
* jsTree classic theme 1.0 * jsTree classic theme 1.0
* Supported features: dots/no-dots, icons/no-icons, focused, loading * Supported features: dots/no-dots, icons/no-icons, focused, loading
* Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
*/ */
.jstree-classic li, .jstree-classic li,
.jstree-classic ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; } .jstree-classic ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
.jstree-classic li { background-position:-90px 0; background-repeat:repeat-y; } .jstree-classic li { background-position:-90px 0; background-repeat:repeat-y; }
.jstree-classic li.jstree-last { background:transparent; } .jstree-classic li.jstree-last { background:transparent; }
.jstree-classic .jstree-open > ins { background-position:-72px 0; } .jstree-classic .jstree-open > ins { background-position:-72px 0; }
.jstree-classic .jstree-closed > ins { background-position:-54px 0; } .jstree-classic .jstree-closed > ins { background-position:-54px 0; }
.jstree-classic .jstree-leaf > ins { background-position:-36px 0; } .jstree-classic .jstree-leaf > ins { background-position:-36px 0; }
.jstree-classic .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; } .jstree-classic .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; }
.jstree-classic .jstree-clicked { background:navy; border:1px solid navy; padding:0 2px 0 1px; color:white; } .jstree-classic .jstree-clicked { background:navy; border:1px solid navy; padding:0 2px 0 1px; color:white; }
.jstree-classic a .jstree-icon { background-position:-56px -19px; } .jstree-classic a .jstree-icon { background-position:-56px -19px; }
.jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; } .jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; }
.jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; } .jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
.jstree-classic.jstree-focused { background:white; } .jstree-classic.jstree-focused { background:white; }
.jstree-classic .jstree-no-dots li, .jstree-classic .jstree-no-dots li,
.jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; } .jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; }
.jstree-classic .jstree-no-dots .jstree-open > ins { background-position:-18px 0; } .jstree-classic .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
.jstree-classic .jstree-no-dots .jstree-closed > ins { background-position:0 0; } .jstree-classic .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
.jstree-classic .jstree-no-icons a .jstree-icon { display:none; } .jstree-classic .jstree-no-icons a .jstree-icon { display:none; }
.jstree-classic .jstree-search { font-style:italic; } .jstree-classic .jstree-search { font-style:italic; }
.jstree-classic .jstree-no-icons .jstree-checkbox { display:inline-block; } .jstree-classic .jstree-no-icons .jstree-checkbox { display:inline-block; }
.jstree-classic .jstree-no-checkboxes .jstree-checkbox { display:none !important; } .jstree-classic .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
.jstree-classic .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; } .jstree-classic .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
.jstree-classic .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; } .jstree-classic .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
.jstree-classic .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; } .jstree-classic .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
.jstree-classic .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; } .jstree-classic .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
.jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; } .jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
.jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; } .jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
#vakata-dragged.jstree-classic ins { background:transparent !important; } #vakata-dragged.jstree-classic ins { background:transparent !important; }
#vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; } #vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
#vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; } #vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
#jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; } #jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
.jstree-classic a.jstree-search { color:aqua; } .jstree-classic a.jstree-search { color:aqua; }
.jstree-classic .jstree-locked a { color:silver; cursor:default; } .jstree-classic .jstree-locked a { color:silver; cursor:default; }
#vakata-contextmenu.jstree-classic-context, #vakata-contextmenu.jstree-classic-context,
#vakata-contextmenu.jstree-classic-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; } #vakata-contextmenu.jstree-classic-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
#vakata-contextmenu.jstree-classic-context li { } #vakata-contextmenu.jstree-classic-context li { }
#vakata-contextmenu.jstree-classic-context a { color:black; } #vakata-contextmenu.jstree-classic-context a { color:black; }
#vakata-contextmenu.jstree-classic-context a:hover, #vakata-contextmenu.jstree-classic-context a:hover,
#vakata-contextmenu.jstree-classic-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; } #vakata-contextmenu.jstree-classic-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a, #vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a,
#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; } #vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
#vakata-contextmenu.jstree-classic-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; } #vakata-contextmenu.jstree-classic-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
#vakata-contextmenu.jstree-classic-context li ul { margin-left:-4px; } #vakata-contextmenu.jstree-classic-context li ul { margin-left:-4px; }
/* IE6 BEGIN */ /* IE6 BEGIN */
.jstree-classic li, .jstree-classic li,
.jstree-classic ins, .jstree-classic ins,
#vakata-dragged.jstree-classic .jstree-invalid, #vakata-dragged.jstree-classic .jstree-invalid,
#vakata-dragged.jstree-classic .jstree-ok, #vakata-dragged.jstree-classic .jstree-ok,
#jstree-marker.jstree-classic { _background-image:url("d.gif"); } #jstree-marker.jstree-classic { _background-image:url("d.gif"); }
.jstree-classic .jstree-open ins { _background-position:-72px 0; } .jstree-classic .jstree-open ins { _background-position:-72px 0; }
.jstree-classic .jstree-closed ins { _background-position:-54px 0; } .jstree-classic .jstree-closed ins { _background-position:-54px 0; }
.jstree-classic .jstree-leaf ins { _background-position:-36px 0; } .jstree-classic .jstree-leaf ins { _background-position:-36px 0; }
.jstree-classic .jstree-open a ins.jstree-icon { _background-position:-56px -36px; } .jstree-classic .jstree-open a ins.jstree-icon { _background-position:-56px -36px; }
.jstree-classic .jstree-closed a ins.jstree-icon { _background-position:-56px -19px; } .jstree-classic .jstree-closed a ins.jstree-icon { _background-position:-56px -19px; }
.jstree-classic .jstree-leaf a ins.jstree-icon { _background-position:-56px -19px; } .jstree-classic .jstree-leaf a ins.jstree-icon { _background-position:-56px -19px; }
#vakata-contextmenu.jstree-classic-context ins { _display:none; } #vakata-contextmenu.jstree-classic-context ins { _display:none; }
#vakata-contextmenu.jstree-classic-context li { _zoom:1; } #vakata-contextmenu.jstree-classic-context li { _zoom:1; }
.jstree-classic .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; } .jstree-classic .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
.jstree-classic .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; } .jstree-classic .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
.jstree-classic .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; } .jstree-classic .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
/* IE6 END */ /* IE6 END */

View File

@ -1,84 +1,84 @@
/* /*
* jsTree default-rtl theme 1.0 * jsTree default-rtl theme 1.0
* Supported features: dots/no-dots, icons/no-icons, focused, loading * Supported features: dots/no-dots, icons/no-icons, focused, loading
* Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
*/ */
.jstree-default-rtl li, .jstree-default-rtl li,
.jstree-default-rtl ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; } .jstree-default-rtl ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
.jstree-default-rtl li { background-position:-90px 0; background-repeat:repeat-y; } .jstree-default-rtl li { background-position:-90px 0; background-repeat:repeat-y; }
.jstree-default-rtl li.jstree-last { background:transparent; } .jstree-default-rtl li.jstree-last { background:transparent; }
.jstree-default-rtl .jstree-open > ins { background-position:-72px 0; } .jstree-default-rtl .jstree-open > ins { background-position:-72px 0; }
.jstree-default-rtl .jstree-closed > ins { background-position:-54px 0; } .jstree-default-rtl .jstree-closed > ins { background-position:-54px 0; }
.jstree-default-rtl .jstree-leaf > ins { background-position:-36px 0; } .jstree-default-rtl .jstree-leaf > ins { background-position:-36px 0; }
.jstree-default-rtl .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; } .jstree-default-rtl .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
.jstree-default-rtl .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; } .jstree-default-rtl .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
.jstree-default-rtl a .jstree-icon { background-position:-56px -19px; } .jstree-default-rtl a .jstree-icon { background-position:-56px -19px; }
.jstree-default-rtl a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; } .jstree-default-rtl a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
.jstree-default-rtl.jstree-focused { background:#ffffee; } .jstree-default-rtl.jstree-focused { background:#ffffee; }
.jstree-default-rtl .jstree-no-dots li, .jstree-default-rtl .jstree-no-dots li,
.jstree-default-rtl .jstree-no-dots .jstree-leaf > ins { background:transparent; } .jstree-default-rtl .jstree-no-dots .jstree-leaf > ins { background:transparent; }
.jstree-default-rtl .jstree-no-dots .jstree-open > ins { background-position:-18px 0; } .jstree-default-rtl .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
.jstree-default-rtl .jstree-no-dots .jstree-closed > ins { background-position:0 0; } .jstree-default-rtl .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
.jstree-default-rtl .jstree-no-icons a .jstree-icon { display:none; } .jstree-default-rtl .jstree-no-icons a .jstree-icon { display:none; }
.jstree-default-rtl .jstree-search { font-style:italic; } .jstree-default-rtl .jstree-search { font-style:italic; }
.jstree-default-rtl .jstree-no-icons .jstree-checkbox { display:inline-block; } .jstree-default-rtl .jstree-no-icons .jstree-checkbox { display:inline-block; }
.jstree-default-rtl .jstree-no-checkboxes .jstree-checkbox { display:none !important; } .jstree-default-rtl .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
.jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; } .jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; } .jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; } .jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
.jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; } .jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; } .jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; } .jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
#vakata-dragged.jstree-default-rtl ins { background:transparent !important; } #vakata-dragged.jstree-default-rtl ins { background:transparent !important; }
#vakata-dragged.jstree-default-rtl .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; } #vakata-dragged.jstree-default-rtl .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
#vakata-dragged.jstree-default-rtl .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; } #vakata-dragged.jstree-default-rtl .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
#jstree-marker.jstree-default-rtl { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; } #jstree-marker.jstree-default-rtl { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
.jstree-default-rtl a.jstree-search { color:aqua; } .jstree-default-rtl a.jstree-search { color:aqua; }
.jstree-default-rtl .jstree-locked a { color:silver; cursor:default; } .jstree-default-rtl .jstree-locked a { color:silver; cursor:default; }
#vakata-contextmenu.jstree-default-rtl-context, #vakata-contextmenu.jstree-default-rtl-context,
#vakata-contextmenu.jstree-default-rtl-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; } #vakata-contextmenu.jstree-default-rtl-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
#vakata-contextmenu.jstree-default-rtl-context li { } #vakata-contextmenu.jstree-default-rtl-context li { }
#vakata-contextmenu.jstree-default-rtl-context a { color:black; } #vakata-contextmenu.jstree-default-rtl-context a { color:black; }
#vakata-contextmenu.jstree-default-rtl-context a:hover, #vakata-contextmenu.jstree-default-rtl-context a:hover,
#vakata-contextmenu.jstree-default-rtl-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; } #vakata-contextmenu.jstree-default-rtl-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
#vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a, #vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a,
#vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; } #vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
#vakata-contextmenu.jstree-default-rtl-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; } #vakata-contextmenu.jstree-default-rtl-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
#vakata-contextmenu.jstree-default-rtl-context li ul { margin-left:-4px; } #vakata-contextmenu.jstree-default-rtl-context li ul { margin-left:-4px; }
/* IE6 BEGIN */ /* IE6 BEGIN */
.jstree-default-rtl li, .jstree-default-rtl li,
.jstree-default-rtl ins, .jstree-default-rtl ins,
#vakata-dragged.jstree-default-rtl .jstree-invalid, #vakata-dragged.jstree-default-rtl .jstree-invalid,
#vakata-dragged.jstree-default-rtl .jstree-ok, #vakata-dragged.jstree-default-rtl .jstree-ok,
#jstree-marker.jstree-default-rtl { _background-image:url("d.gif"); } #jstree-marker.jstree-default-rtl { _background-image:url("d.gif"); }
.jstree-default-rtl .jstree-open ins { _background-position:-72px 0; } .jstree-default-rtl .jstree-open ins { _background-position:-72px 0; }
.jstree-default-rtl .jstree-closed ins { _background-position:-54px 0; } .jstree-default-rtl .jstree-closed ins { _background-position:-54px 0; }
.jstree-default-rtl .jstree-leaf ins { _background-position:-36px 0; } .jstree-default-rtl .jstree-leaf ins { _background-position:-36px 0; }
.jstree-default-rtl a ins.jstree-icon { _background-position:-56px -19px; } .jstree-default-rtl a ins.jstree-icon { _background-position:-56px -19px; }
#vakata-contextmenu.jstree-default-rtl-context ins { _display:none; } #vakata-contextmenu.jstree-default-rtl-context ins { _display:none; }
#vakata-contextmenu.jstree-default-rtl-context li { _zoom:1; } #vakata-contextmenu.jstree-default-rtl-context li { _zoom:1; }
.jstree-default-rtl .jstree-undetermined a .jstree-checkbox { _background-position:-18px -19px; } .jstree-default-rtl .jstree-undetermined a .jstree-checkbox { _background-position:-18px -19px; }
.jstree-default-rtl .jstree-checked a .jstree-checkbox { _background-position:-36px -19px; } .jstree-default-rtl .jstree-checked a .jstree-checkbox { _background-position:-36px -19px; }
.jstree-default-rtl .jstree-unchecked a .jstree-checkbox { _background-position:0px -19px; } .jstree-default-rtl .jstree-unchecked a .jstree-checkbox { _background-position:0px -19px; }
/* IE6 END */ /* IE6 END */
/* RTL part */ /* RTL part */
.jstree-default-rtl .jstree-hovered, .jstree-default-rtl .jstree-clicked { padding:0 1px 0 2px; } .jstree-default-rtl .jstree-hovered, .jstree-default-rtl .jstree-clicked { padding:0 1px 0 2px; }
.jstree-default-rtl li { background-image:url("dots.gif"); background-position: 100% 0px; } .jstree-default-rtl li { background-image:url("dots.gif"); background-position: 100% 0px; }
.jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-36px -19px; margin-left:2px; } .jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-36px -19px; margin-left:2px; }
.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:0px -19px; margin-left:2px; } .jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:0px -19px; margin-left:2px; }
.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-18px -19px; margin-left:2px; } .jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-18px -19px; margin-left:2px; }
.jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-36px -37px; } .jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-36px -37px; }
.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:0px -37px; } .jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:0px -37px; }
.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-18px -37px; } .jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-18px -37px; }