Apache Solr open-source search software
SOLR-2399: Adding in progress solr admin interface
Ryan McKinleybf2531a9ba32
diff --git a/solr/src/webapp/web/css/screen.css b/solr/src/webapp/web/css/screen.cssnew file mode 100644index 00000000000..883ef150e3d--- /dev/null+++ b/solr/src/webapp/web/css/screen.css@@ -0,0 +1,2925 @@+*+{+ background-repeat: no-repeat;+ margin: 0;+ padding: 0;+}++body, h1, h2, h3, h4, h5, h6, a, button, input, select, option, textarea, th, td+{+ color: #333;+ font: 12px/1.6em "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", Verdana, Arial, sans-serif;+}++body+{+ padding: 20px;+ text-align: center;+}++a, button+{+ cursor: pointer;+}++button, input, select, textarea+{+ border: 1px solid #c0c0c0;+ padding: 2px;+}++a+{+ text-decoration: none;+}++pre+{+ color: #333;+ text-align: left;+}++ul+{+ list-style: none;+}++.clearfix:after { clear: both; content: "."; display: block; font-size: 0; height: 0; visibility: hidden; }+.clearfix { display: block; }++.loader+{+ background-image: url( ../img/loader.gif ) !important;+}++.loader-light+{+ background-image: url( ../img/loader-light.gif ) !important;+}++#wrapper+{+ margin: 0 auto;+ margin-bottom: 30px;+ text-align: left;+ width: 1002px;+}++#header+{+ padding-bottom: 10px;+ position: relative;+}++#header a+{+ background-image: url( ../img/solr.png );+ display: block;+ height: 78px;+ width: 200px;+}++#header a span+{+ display: none;+}++#main+{+ background-image: url( ../img/div.gif );+ background-position: 200px 0;+ background-repeat: repeat-y;+ border: 1px solid #c0c0c0;+ min-height: 600px;+ position: relative;+}++#meta+{+ position: absolute;+ bottom: -26px;+ right: 0;+}++#meta li+{+ float: left;+}++#meta li a+{+ background-position: 10px 50%;+ display: block;+ height: 25px;+ line-height: 25px;+ padding-left: 31px;+ padding-right: 10px;+}++#meta li a:hover+{+ background-color: #f0f0f0;+}++#meta .documentation a { background-image: url( ../img/ico/document-text.png ); }+#meta .issues a { background-image: url( ../img/ico/bug.png ); }+#meta .irc a { background-image: url( ../img/ico/users.png ); }+#meta .mailinglist a { background-image: url( ../img/ico/mail.png ); }+#meta .wiki-query-syntax a { background-image: url( ../img/ico/script-code.png ); }++#environment+{+ background-image: url( ../img/ico/box.png );+ background-position: 10px 50%;+ border: 1px solid #c0c0c0;+ display: none;+ font-weight: bold;+ padding: 5px 10px;+ padding-left: 31px;+ position: absolute;+ top: 0;+ right: 0;+}++#environment.prod+{+ background-color: #c37f7f;+ border-color: #b15757;+ color: #fff;+}++#environment.test+{+ background-color: #f5f5b2;+ border-color: #e4e433;+}++#environment.dev+{+ background-color: #cce7cc;+ border-color: #66b866;+}++#menu-wrapper+{+ float: left;+ width: 201px;+}++#menu p.loader+{+ background-position: 5px 50%;+ color: #c0c0c0;+ margin-top: 5px;+ padding-left: 26px;+}++#menu a+{+ display: block;+ padding: 4px 2px;+}++#menu .active+{+ background-color: #fafafa;+}++#menu p a+{+ background-position: 97% 50%;+ background-image: url( ../img/ico/status-offline.png );+ padding-left: 5px;+ padding-top: 5px;+ padding-bottom: 5px;+}++#menu p a:hover+{+ background-color: #f0f0f0;+}++#menu .active p a+{+ background-color: #c0c0c0; /* #a5a5a6 */+ font-weight: bold;+}++#menu p a small+{+ color: #b5b5b5;+ font-weight: normal;+}++#menu p a small span.txt+{+ display: none;+}++#menu p a small:hover span.txt+{+ display: inline;+}++#menu .busy+{+ border-right-color: #f6f5d9;+}++#menu .busy p a+{+ background-color: #f6f5d9;+ background-image: url( ../img/ico/status-away.png );+}++#menu .offline+{+ border-right-color: #eccfcf;+}++#menu .offline p a+{+ background-color: #eccfcf;+ background-image: url( ../img/ico/status-busy.png );+}++#menu .online+{+ border-right-color: #cfecd3;+}++#menu .online p a+{+ background-color: #cfecd3;+ background-image: url( ../img/ico/status.png );+}++#menu .ping small+{+ color: #000+}++#menu li+{+ border-bottom: 1px solid #c0c0c0;+ /*border-right: 1px solid #f0f0f0;*/+}++#menu li.optional+{+ display: none;+}++#menu li:last-child+{+ border-bottom: 0;+}++#menu ul ul+{+ display: none;+ padding-top: 5px;+ padding-bottom: 10px;+}++#menu ul .active ul+{+ display: block;+}++#menu ul ul li+{+ border-bottom: 0;+ /*border-right: 0;*/+ border-right: 1px solid #f0f0f0;+}++#menu ul ul li a+{+ background-position: 7px 50%;+ border-bottom: 1px solid #f0f0f0;+ color: #bbb;+ margin-left: 15px;+ padding-left: 26px;+}++#menu ul ul li:last-child a+{+ border-bottom: 0;+}++#menu ul ul li a:hover+{+ background-color: #f0f0f0;+ color: #333;+}++#menu ul ul li.active+{+ background-color: #fff;+ border-right-color: #fff;+}++#menu ul ul li.active a+{+ color: #333;+}++#menu ul ul li.active a:hover+{+ background-color: transparent;+}++#menu .global p a+{+ background-position: 5px 50%;+ padding-left: 26px;+}++#menu #index p a+{+ background-image: url( ../img/ico/dashboard.png );+}++#menu #logging p a+{+ background-image: url( ../img/ico/inbox-document-text.png );+}++#menu #java-properties p a+{+ background-image: url( ../img/ico/jar.png );+}++#menu #threads p a+{+ background-image: url( ../img/ico/ui-accordion.png );+}++#menu #cores p a+{+ background-image: url( ../img/ico/databases.png );+}++#menu #cloud p a+{+ background-image: url( ../img/ico/network-cloud.png );+}++#menu .query a { background-image: url( ../img/ico/magnifier.png ); }+#menu .schema a { background-image: url( ../img/ico/table.png ); }+#menu .config a { background-image: url( ../img/ico/gear.png ); }+#menu .analysis a { background-image: url( ../img/ico/funnel.png ); }+#menu .schema-browser a { background-image: url( ../img/ico/book-open-text.png ); }+#menu .stats a { background-image: url( ../img/ico/chart.png ); }+#menu .replication a { background-image: url( ../img/ico/node.png ); }+#menu .distribution a { background-image: url( ../img/ico/node-select.png ); }+#menu .ping a { background-image: url( ../img/ico/system-monitor.png ); }+#menu .logging a { background-image: url( ../img/ico/inbox-document-text.png ); }+#menu .plugins a { background-image: url( ../img/ico/block.png ); }+#menu .dataimport a { background-image: url( ../img/ico/document-import.png ); }++#content-wrapper+{+ float: right;+ width: 799px;+}++#content+{+ padding: 10px;+}++#content.single+{+ padding: 0;+}++#content iframe+{+ border: 0;+ display: block;+ min-height: 400px;+ width: 100%;+}++#content .block+{+ margin-bottom: 10px;+}++#content .block h2+{+ background-color: #fafafa;+ background-position: 5px 50%;+ border-bottom: 1px solid #f0f0f0;+ font-weight: bold;+ padding: 5px;+ padding-left: 26px;+}++#content .block.disabled,+#content .block.disabled h2+{+ color: #c0c0c0;+}++#content .block .message,+#content .block .content+{+ padding: 5px;+}++#content .block .message+{+ display: none;+}++/* dashboard */++#content #dashboard .block+{+ width: 49%;+}++#content #dashboard #statistics+{+ float: left;+}++#content #dashboard #statistics dt,+#content #dashboard #statistics dd+{+ display: block;+ float: left;+}++#content #dashboard #statistics dt+{+ clear: left;+ margin-right: 2%;+ text-align: right;+ width: 23%;+}++#content #dashboard #statistics dd+{+ width: 74%;+}++#content #dashboard #statistics .index_optimized+{+ margin-top: 10px;+}++#content #dashboard #statistics .ico+{+ background-image: url( ../img/ico/slash.png );+ height: 20px;+}++#content #dashboard #statistics .ico.ico-1+{+ background-image: url( ../img/ico/tick.png );+}++#content #dashboard #statistics .ico span+{+ display: none;+}++#content #dashboard #statistics .index_optimized.value a+{+ display: none;+}++#content #dashboard #statistics .index_optimized.value.ico-0 a+{+ background-color: #f0f0f0;+ background-image: url( ../img/ico/hammer-screwdriver.png );+ background-position: 5px 50%;+ border: 1px solid #c0c0c0;+ display: block;+ float: left;+ margin-left: 50px;+ padding: 1px 5px;+ padding-left: 26px;+}++#content #dashboard #statistics .index_has-deletions+{+ display: none;+}++#content #dashboard #statistics .index_has-deletions.value.ico-0+{+ background-image: url( ../img/ico/tick-red.png );+}++#content #dashboard #replication+{+ float: left;+}++#content #dashboard #replication .is-replicating+{+ background-position: 99% 50%;+ display: block;+}++#content #dashboard #replication.is-master .slave+{+ display: none;+}++#content #dashboard #replication table+{+ border-collapse: collapse;+}++#content #dashboard #replication table th,+#content #dashboard #replication table td+{+ border: 1px solid #f0f0f0;+ padding: 2px 5px;+}++#content #dashboard #replication table thead td+{+ border: 0;+}++#content #dashboard #replication table thead th,+#content #dashboard #replication table tbody td+{+ border-right: 0;+}++#content #dashboard #replication table thead th+{+ border-top: 0;+ font-weight: bold;+}++#content #dashboard #replication table tbody th,+#content #dashboard #replication table tbody td+{+ border-bottom: 0;+ text-align: right;+}++#content #dashboard #replication table tbody th+{+ border-left: 0;+}++#content #dashboard #replication table tbody th,+#content #dashboard #replication dt+{+ width: 100px;+}++#content #dashboard #replication dl+{+ display: none;+ margin-top: 10px;+}++#content #dashboard #replication dt,+#content #dashboard #replication dd+{+ display: block;+ padding-top: 1px;+ padding-bottom: 1px;+}++#content #dashboard #replication dt+{+ border-right: 1px solid #f0f0f0;+ float: left;+ padding-left: 5px;+ padding-right: 5px;+ margin-right: 3px;+ text-align: right;+}++#content #dashboard #dataimport+{+ background-color: #0ff;+ float: right;+}+++#content #dashboard #admin-extra+{+ float: right;+}++#content #dashboard #system h2 { background-image: url( ../img/ico/server.png ); }+#content #dashboard #statistics h2 { background-image: url( ../img/ico/chart.png ); }+#content #dashboard #replication h2 { background-image: url( ../img/ico/node.png ); }+#content #dashboard #replication.is-master h2 { background-image: url( ../img/ico/node-master.png ); }+#content #dashboard #replication.is-slave h2 { background-image: url( ../img/ico/node-slave.png ); }+#content #dashboard #dataimport h2 { background-image: url( ../img/ico/document-import.png ); }+#content #dashboard #admin-extra h2 { background-image: url( ../img/ico/plus-button.png ); }++/* analysis */++#content #analysis .settings+{+ clear: both;+ padding-top: 10px;+}++#content #analysis .settings select.loader+{+ background-position: 3px 50%;+ padding-left: 21px;+}++#content #analysis .settings select optgroup+{+ font-style: normal;+ padding: 5px;+}++#content #analysis .settings select option+{+ padding-left: 10px;+}++#content #analysis .settings div+{+ float: right;+ width: 49%;+}++#content #analysis .settings button+{+ float: right;+}++#content #analysis .index label,+#content #analysis .query label+{+ display: block;+}++#content #analysis .index textarea,+#content #analysis .query textarea+{+ display: block;+ width: 100%;+}++#content #analysis .index+{+ float: left;+ margin-right: 0.5%;+ min-width: 49%;+ max-width: 99%;+}++#content #analysis .query+{+ float: right;+ margin-left: 0.5%;+ min-width: 49%;+ max-width: 99%;+}++#content #analysis .analysis-result h2+{+ position: relative;+}++#content #analysis .analysis-result h2 .verbose_output+{+ position: absolute;+ right: 5px;+ top: 5px;+}++#content #analysis .analysis-result h2 .verbose_output a+{+ background-image: url( ../img/ico/ui-check-box-uncheck.png );+ background-position: 0 50%;+ color: #999;+ display: block;+ padding-left: 21px;+}++#content #analysis .analysis-result.verbose_output h2 .verbose_output a+{+ background-image: url( ../img/ico/ui-check-box.png );+ color: #080;+}++#content #analysis .analysis-result .index,+#content #analysis .analysis-result .query+{+ margin-bottom: 10px;+}++#content #analysis .analysis-result .row+{+ border-top: 1px solid #f0f0f0;+ margin-top: 10px;+ padding-top: 10px;+}++#content #analysis .analysis-result .row:first-child+{+ border-top: 0;+ margin-top: 0;+ padding-top: 0;+}++#content #analysis .analysis-result .row .analyzer+{+ color: #c0c0c0;+}++#content #analysis .analysis-result .row:hover .analyzer+{+ color: #333;+}++#content #analysis .analysis-result .row table tr.verbose_output+{+ display: none;+}++#content #analysis .analysis-result.verbose_output .row table tr.verbose_output+{+ display: table-row;+}++#content #analysis .analysis-result .row table th,+#content #analysis .analysis-result .row table td+{+ border-top: 1px solid #f0f0f0;+ vertical-align: top;+}++#content #analysis .analysis-result .row table th+{+ background-color: #f8f8f8;+ color: #999;+ padding: 2px;+ padding-bottom: 0;+}++#content #analysis .analysis-result .row table th abbr+{+ border: 0;+ cursor: help;+}++#content #analysis .analysis-result .row table td+{+ border-left: 1px solid #dcdcdc;+}++#content #analysis .analysis-result .row table td div+{+ border-top: 1px solid #f0f0f0;+ display: block;+ padding: 1px 2px;+}++#content #analysis .analysis-result .row table td div.match+{+ background-color: #e9eff7;+}++#content #analysis .analysis-result .row table td div:first-child+{+ border-top: 0;+}++#content #analysis #field-analysis h2 { background-image: url( ../img/ico/receipt.png ); }+#content #analysis .analysis-result h2 { background-image: url( ../img/ico/receipt-invoice.png ); }++/* plugins */++#content #plugins .loader+{+ background-position: 0 50%;+ padding-left: 21px;+}++#content #plugins .block h2 { background-image: url( ../img/ico/block-small.png ); }+#content #plugins #core h2 { background-image: url( ../img/ico/terminal.png ); }+#content #plugins #queryhandler h2 { background-image: url( ../img/ico/magnifier.png ); }+#content #plugins #updatehandler h2 { background-image: url( ../img/ico/arrow-circle.png ); }+#content #plugins #cache h2 { background-image: url( ../img/ico/disk-black.png ); }+#content #plugins #highlighting h2 { background-image: url( ../img/ico/highlighter-text.png ); }++#content #plugins .block .entry+{+ padding-top: 10px;+}++#content #plugins .block .entry a+{+ background-image: url( ../img/ico/chevron-small-expand.png );+ background-position: 0 50%;+ display: block;+ font-weight: bold;+ padding-left: 21px;+}++#content #plugins .block .entry.expanded a+{+ background-image: url( ../img/ico/chevron-small.png );+}++#content #plugins .block .entry.expanded ul+{+ display: block;+}++#content #plugins .block .entry ul+{+ display: none;+ padding-top: 5px;+ margin-left: 21px;+}++#content #plugins .block .entry li+{+ padding-top: 2px;+ padding-bottom: 2px;+}++#content #plugins .block .entry li.stats+{+ border-top: 1px solid #c0c0c0;+ margin-top: 5px;+ padding-top: 5px;+}++#content #plugins .block .entry li.odd+{+ background-color: #f8f8f8;+}++#content #plugins .block .entry dt,+#content #plugins .block .entry .stats span+{+ float: left;+ width: 11%;+}++#content #plugins .block .entry dd,+#content #plugins .block .entry .stats ul+{+ float: right;+ width: 88%;+}++#content #plugins .block .entry .stats ul+{+ margin: 0;+ padding: 0;+}++#content #plugins .block .entry .stats dt+{+ width: 27%;+}++#content #plugins .block .entry .stats dd+{+ width: 72%;+}++/* query */++#content #query+{+ background-image: url( ../img/div.gif );+ background-position: 210px 0;+ background-repeat: repeat-y;+}++#content #query #form+{+ float: left;+ width: 200px;+}++#content #query #form label+{+ cursor: pointer;+ display: block;+ margin-top: 5px;+}++#content #query #form input,+#content #query #form textarea+{+ margin-bottom: 2px;+ width: 100%;+}++#content #query #form #start+{+ float: left;+ margin-right: 2%;+ width: 49%;+}++#content #query #form #rows+{+ width: 49%;+}++#content #query #form .checkbox input+{+ margin-bottom: 0;+ width: auto;+}++#content #query #form fieldset,+#content #query #form .optional.expanded+{+ border: 1px solid #fff;+ border-top: 1px solid #c0c0c0;+ margin-bottom: 10px;+}++#content #query #form fieldset legend,+#content #query #form .optional.expanded legend+{+ display: block;+ margin-left: 10px;+ padding: 0px 5px;+}++#content #query #form fieldset legend label+{+ margin-top: 0;+}++#content #query #form fieldset .fieldset+{+ border-bottom: 1px solid #f0f0f0;+ margin-bottom: 5px;+ padding-bottom: 5px;+}++#content #query #form .optional+{+ border: 0;+}++#content #query #form .optional .fieldset+{+ display: none;+}++#content #query #form .optional legend+{+ margin-left: 0;+ padding-left: 0;+}++#content #query #form .optional.expanded .fieldset+{+ display: block;+}++#content #query #result+{+ display: none;+ float: right;+ width: 560px;+}++#content #query #result #url+{+ margin-bottom: 10px;+}++#content #query #result #url input+{+ background-image: url( ../img/ico/ui-address-bar.png );+ background-position: 5px 50%;+ border-color: #f0f0f0;+ box-shadow: 1px 1px 0 #f0f0f0;+ -moz-box-shadow: 1px 1px 0 #f0f0f0;+ -webkit-box-shadow: 1px 1px 0 #f0f0f0;+ color: #c0c0c0;+ display: block;+ padding: 5px;+ padding-left: 26px;+ width: 100%;+}++#content #query #result #url input:focus,+#content #query #result #url input:hover+{+ border-color: #c0c0c0;+ box-shadow: 1px 1px 0 #d8d8d8;+ -moz-box-shadow: 1px 1px 0 #d8d8d8;+ -webkit-box-shadow: 1px 1px 0 #d8d8d8;+ color: #333;+}++#content #query #result #response+{+}++/* zookeeper */++#content #zookeeper .loader+{+ background-position: 0 50%;+ padding-left: 21px;+}++/* tree */++#content .tree li,+#content .tree ins+{+ background-color: transparent;+ background-image: url( ../img/tree.png );+ background-repeat: no-repeat;+}++#content .tree li+{+ background-position: -54px 0;+ background-repeat: repeat-y;+ line-height: 22px;+}++#content .tree li.jstree-last+{+ background:transparent;+}++#content .tree .jstree-open > ins+{+ background-position: -36px 0;+}++#content .tree .jstree-closed > ins+{+ background-position: -18px 0;+}++#content .tree .jstree-leaf > ins+{+ background-position: 0 0;+}++#content .tree .jstree-hovered+{+ background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px;+}++#content .tree .jstree-clicked+{+ background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px;+}++#content .tree a .jstree-icon+{+ background-image: url( ../img/ico/folder.png );+}++#content .tree .jstree-leaf a .jstree-icon+{+ background-image: url( ../img/ico/document-text.png );+}++#content .tree .jstree-search+{+ font-style:italic;+}++#content .tree a.jstree-search+{+ color:aqua;+}++/* index */++#content #index .loader+{+ background-position: 0 50%;+ padding-left: 21px;+}++#content #index #data+{+ float: left;+ width: 74%;+}++#content #index #memory+{+ float: right;+ width: 24%;+}++#content #index #data h2 { background-image: url( ../img/ico/server.png ); }+#content #index #memory h2 { background-image: url( ../img/ico/battery.png ); }++#content #index #data li+{+ display: none;+ padding-top: 3px;+ padding-bottom: 3px;+}++#content #index #data li.odd+{+ background-color: #f8f8f8;+}++#content #index #data li dt+{+ float: left;+ width: 27%;+}++#content #index #data li dd+{+ float: right;+ width: 72%+}++#content #index #data li dd.odd+{+ color: #999;+}++#content #index #data dt span+{+ background-position: 0 50%;+ display: block;+ padding-left: 21px;+}++#content #index #data .start_time dt span+{+ background-image: url( ../img/ico/clock-select.png );+}++#content #index #data .host dt span+{+ background-image: url( ../img/ico/globe.png );+}++#content #index #data .cwd dt span+{+ background-image: url( ../img/ico/folder-export.png );+}++#content #index #data .jvm dt span+{+ background-image: url( ../img/ico/jar.png );+}++#content #index #data .command_line_args dt span+{+ background-image: url( ../img/ico/terminal.png );+}++#content #index #data .lucene dt span+{+ background-image: url( ../img/lucene-ico.png );+}++#content #index #memory #memory-bar+{+ background-color: #00f;+ box-shadow: 5px 5px 10px #c0c0c0;+ -moz-box-shadow: 5px 5px 10px #c0c0c0;+ -webkit-box-shadow: 5px 5px 10px #c0c0c0;+ margin-top: 20px;+ width: 100px;+}++#content #index #memory .bar+{+ bottom: 0;+ position: absolute;+ width: 100%;+}++#content #index #memory div .value+{+ border-top: 1px solid #f00;+ display: block;+ font-size: 10px;+ line-height: 12px;+ padding-left: 10px;+ padding-right: 2px;+ position: absolute;+ margin-left: 100px;+ white-space: nowrap;+}++#content #index #memory div .value.upper+{+ border-top-width: 0;+ border-bottom-width: 1px;+ border-bottom-style: solid;+}++#content #index #memory #memory-bar-max+{+ background-color: #f0f0f0;+ height: 200px;+ position: relative;+}++#content #index #memory #memory-bar-max .value+{+ border-color: #f0f0f0;+ color: #d6d6d6;+}++#content #index #memory #memory-bar-total+{+ background-color: #c0c0c0;+}++#content #index #memory #memory-bar-total .value+{+ border-color: #c0c0c0;+ color: #c0c0c0;+}++#content #index #memory #memory-bar-used+{+ background-color: #969696;+}++#content #index #memory #memory-bar-used .value+{+ border-color: #969696;+ color: #969696;+}++/* schema-browser */++#content #schema-browser .loader+{+ background-position: 0 50%;+ padding-left: 21px;+}++#content #schema-browser.loaded+{+ background-image: url( ../img/div.gif );+ background-position: 21% 0;+ background-repeat: repeat-y;+}++#content #schema-browser #data+{+ float: right;+ width: 78%;+}++#content #schema-browser #related+{+ float: left;+ width: 20%;+}++#content #schema-browser #related select+{+ width: 100%;+}++#content #schema-browser #related select optgroup+{+ font-style: normal;+ padding: 5px;+}++#content #schema-browser #related select option+{+ padding-left: 10px;+}++#content #schema-browser #related dl+{+ margin-top: 15px;+}++#content #schema-browser #related dl dt,+#content #schema-browser #related dl dd a+{+ color: #c0c0c0;+}++#content #schema-browser #related dl dt+{+ font-weight: bold;+ margin-top: 5px;+}++#content #schema-browser #related dl dd a+{+ display: block;+ padding-left: 10px;+}++#content #schema-browser #related dl dd a:hover+{+ background-color: #f8f8f8;+}++#content #schema-browser #related .field .field,+#content #schema-browser #related .field .field a,+#content #schema-browser #related .dynamic-field .dynamic-field,+#content #schema-browser #related .dynamic-field .dynamic-field a,+#content #schema-browser #related .type .type,+#content #schema-browser #related .type .type a+{+ color: #333;+}++#content #schema-browser #related .copyfield,+#content #schema-browser #related .copyfield a+{+ color: #666;+}++#content #schema-browser #data #index dt+{+ display: none;+ float: left;+ margin-right: 5px;+ width: 150px;+}++#content #schema-browser #data #field .field-options+{+ margin-bottom: 20px;+}++#content #schema-browser #data #field .field-options .options dt,+#content #schema-browser #data #field .field-options .options dd+{+ float: left;+}++#content #schema-browser #data #field .field-options .options dt+{+ clear: left;+ display: none;+ margin-right: 5px;+ width: 100px;+}++#content #schema-browser #data #field .field-options .options dd+{+ margin-right: 5px;+}++#content #schema-browser #data #field .field-options .analyzer,+#content #schema-browser #data #field .field-options .analyzer li,+#content #schema-browser #data #field .field-options .analyzer ul,+#content #schema-browser #data #field .field-options .analyzer ul li+{+ display: none;+}++#content #schema-browser #data #field .field-options .analyzer p,+#content #schema-browser #data #field .field-options .analyzer dl+{+ float: left;+}++#content #schema-browser #data #field .field-options .analyzer p+{+ margin-right: 5px;+ text-align: right;+ width: 100px;+}++#content #schema-browser #data #field .field-options .analyzer li+{+ border-top: 1px solid #f0f0f0;+ margin-top: 10px;+ padding-top: 10px;+}++#content #schema-browser #data #field .field-options .analyzer ul+{+ clear: left;+ display: block;+ margin-left: 30px;+ padding-top: 5px;+}++#content #schema-browser #data #field .field-options .analyzer ul li+{+ border-top: 1px solid #f8f8f8;+ margin-top: 5px;+ padding-top: 5px;+}++#content #schema-browser #data #field .field-options .analyzer ul p+{+ color: #999;+ margin-right: 5px;+ text-align: right;+ width: 70px;+}++#content #schema-browser #data #field .field-options .analyzer ul dd+{+ margin-left: 20px;+}++#content #schema-browser #data #field .field-options .analyzer ul dd+{+ background-image: url( ../img/ico/document-list.png );+ background-position: 0 50%;+ color: #c0c0c0;+ padding-left: 21px;+}++#content #schema-browser #data #field .field-options .analyzer ul dd.ico-0+{+ background-image: url( ../img/ico/slash.png );+}++#content #schema-browser #data #field .field-options .analyzer ul dd.ico-1+{+ background-image: url( ../img/ico/tick.png );+}++#content #schema-browser #data #field .head+{+ margin-bottom: 5px;+}++#content #schema-browser #data #field .topterms-holder+{+ float: left;+}++#content #schema-browser #data #field .topterms-holder .head .max-holder+{+ color: #c0c0c0;+}++#content #schema-browser #data #field .topterms-holder table+{+ border-collapse: collapse;+ width: 100%;+}++#content #schema-browser #data #field .topterms-holder th,+#content #schema-browser #data #field .topterms-holder td+{+ border: 1px solid #f0f0f0;+ padding: 1px 4px;+}++#content #schema-browser #data #field .topterms-holder thead tr+{+ background-color: #c0c0c0;+}++#content #schema-browser #data #field .topterms-holder thead th+{+ text-align: left;+}++#content #schema-browser #data #field .topterms-holder tbody+{+ display: none;+}++#content #schema-browser #data #field .topterms-holder tbody .odd+{+ background-color: #f0f0f0;+}++#content #schema-browser #data #field .topterms-holder tbody .position+{+ color: #c0c0c0;+ text-align: right;+}++#content #schema-browser #data #field .topterms-holder .navi+{+ margin-top: 5px;+}++#content #schema-browser #data #field .topterms-holder .navi a+{+ color: #c0c0c0;+ display: block;+ padding-top: 2px;+ padding-bottom: 2px;+ width: 49%;+}++#content #schema-browser #data #field .topterms-holder .navi a:hover+{+ background-color: #f8f8f8;+ color: #333;+}++#content #schema-browser #data #field .topterms-holder .navi .less+{+ float: left;+}++#content #schema-browser #data #field .topterms-holder .navi .less span+{+ background-image: url( ../img/ico/chevron-small.png );+ background-position: 0 50%;+ padding-left: 18px;+}++#content #schema-browser #data #field .topterms-holder .navi .more+{+ float: right;+ text-align: right;+}++#content #schema-browser #data #field .topterms-holder .navi .more span+{+ background-image: url( ../img/ico/chevron-small-expand.png );+ background-position: 100% 50%;+ padding-right: 18px;+}++#content #schema-browser #data #field .histogram-holder+{+ display: none;+ float: left;+ margin-left: 50px;+}++#content #schema-browser #data #field .histogram-holder .histogram+{+ height: 150px;+}++#content #schema-browser #data #field .histogram-holder dt,+#content #schema-browser #data #field .histogram-holder dd+{+ float: left;+ font-size: 10px;+ text-align: center;+}++#content #schema-browser #data #field .histogram-holder span+{+ background-color: #f0f0f0;+ display: block;+ width: 20px;+}++#content #schema-browser #data #field .histogram-holder dt+{+ padding-right: 1px;+}++#content #schema-browser #data #field .histogram-holder dd+{+ padding-right: 3px;+}++#content #schema-browser #data #field .histogram-holder dd span+{+ width: 25px;+}++/* java-properties */++#content #java-properties .loader+{+ background-position: 0 50%;+ padding-left: 21px;+}++#content #java-properties li+{+ padding-top: 3px;+ padding-bottom: 3px;+}++#content #java-properties li.odd+{+ background-color: #f8f8f8;+}++#content #java-properties li dt+{+ float: left;+ width: 24%;+}++#content #java-properties li dd+{+ float: right;+ width: 75%+}++#content #java-properties li dd.odd+{+ color: #999;+}++/* logging */++#content #logging .loader+{+ background-position: 0 50%;+ padding-left: 21px;+}++#content #logging .jstree+{+ position: relative;+}++#content #logging .jstree a+{+ cursor: auto;+}++#content #logging .jstree .trigger span+{+ background-position: 100% 50%;+ cursor: pointer;+ padding-right: 21px;+}++#content #logging .jstree a.trigger:hover span+{+ background-image: url( ../img/ico/pencil-small.png );+}++#content #logging .jstree .inactive,+#content #logging .jstree .inactive .effective_level+{+ color: #c0c0c0;+}++#content #logging .jstree li+{+ position: relative;+}++#content #logging .jstree .odd+{+ background-color: #f8f8f8;+}++#content #logging .jstree .loglevel+{+ position: absolute;+ margin-top: 3px;+ top: 0;+}++#content #logging .jstree li .loglevel { left: 340px; }+#content #logging .jstree li li .loglevel { left: 322px; }+#content #logging .jstree li li li .loglevel { left: 304px; }+#content #logging .jstree li li li li .loglevel { left: 286px; }+#content #logging .jstree li li li li li .loglevel { left: 268px; }+#content #logging .jstree li li li li li li .loglevel { left: 250px; }++#content #logging .jstree .loglevel a+{+ display: block;+}++#content #logging .jstree .loglevel .effective_level+{+ height: 22px;+ line-height: 22px;+ padding-left: 5px;+ width: 150px;+}++#content #logging .jstree .loglevel.open .effective_level+{+ background-color: #f0f0f0;+}++#content #logging .jstree .loglevel.open .effective_level+{+ background-image: url( ../img/ico/arrow-000-small.png );+ background-position: 75px 50%;+}++#content #logging .jstree .loglevel.open .effective_level span+{+ background-image: none;+}++#content #logging .jstree .loglevel ul+{+ background-color: #fff;+ border: 1px solid #f0f0f0;+ display: none;+ position: absolute;+ left: 100px;+ top: 0;+}++#content #logging .jstree .loglevel.open ul+{+ display: block;+}++#content #logging .jstree .loglevel ul li+{+ background-image: none;+ line-height: auto;+ margin-left: 0;+}++#content #logging .jstree .loglevel ul li a+{+ background-image: url( ../img/ico/ui-radio-button-uncheck.png );+ background-position: 2px 50%;+ cursor: pointer;+ display: block;+ height: 22px;+ line-height: 22px;+ padding-left: 21px;+ padding-right: 5px;+}++#content #logging .jstree .loglevel ul li.selected a+{+ background-image: url( ../img/ico/ui-radio-button.png );+}++#content #logging .jstree .loglevel ul li a:hover+{+ background-color: #f8f8f8;+ color: #008;+}++#content #logging .jstree .loglevel ul li.unset+{+ border-top: 1px solid #f0f0f0;+}++#content #logging .jstree .loglevel ul li.unset a+{+ background-image: url( ../img/ico/cross-0.png );+ background-position: 4px 50%;+ padding-top: 3px;+ padding-bottom: 3px;+}++#content #logging .jstree .loglevel ul li.unset a:hover+{+ background-image: url( ../img/ico/cross-1.png );+ color: #800;+}++/* threads */++#content #threads .loader+{+ background-position: 0 50%;+ padding-left: 21px;+}++#content #threads #thread-dump table+{+ border-collapse: collapse;+ width: 100%;+}++#content #threads #thread-dump table .spacer,+#content #threads #thread-dump tbody .state+{+ background-color: #fff;+ border: 0;+}++#content #threads #thread-dump table th,+#content #threads #thread-dump table td+{+ border: 1px solid #c0c0c0;+ padding: 3px;+ vertical-align: top;+}++#content #threads #thread-dump thead th+{+ background-color: #c8c8c8;+ font-weight: bold;+ text-align: left;+}++#content #threads #thread-dump tbody .odd+{+ background-color: #f0f0f0;+}++#content #threads #thread-dump tbody .state+{+ width: 20px;+}++#content #threads #thread-dump tbody .state a+{+ background-position: 50% 50%;+ display: block;+ height: 20px;+}++#content #threads #thread-dump tbody .open .state a+{+ background-image: url( ../img/ico/chevron-small.png );+}++#content #threads #thread-dump tbody .state a span+{+ display: none;+}++#content #threads #thread-dump tbody .id+{+ text-align: right;+}++#content #threads #thread-dump tbody .ico+{+ background-position: 50% 3px;+ cursor: help;+ width: 20px;+}++#content #threads #thread-dump tbody .RUNNABLE .ico+{+ background-image: url( ../img/ico/tick-circle.png );+}++#content #threads #thread-dump tbody .WAITING .ico,+#content #threads #thread-dump tbody .TIMED_WAITING .ico+{+ background-image: url( ../img/ico/hourglass.png );+}++#content #threads #thread-dump tbody .WAITING.lock .ico,+#content #threads #thread-dump tbody .TIMED_WAITING.lock .ico+{+ background-image: url( ../img/ico/hourglass--exclamation.png );+}++#content #threads #thread-dump tbody .ico span+{+ display: none;+}++#content #threads #thread-dump tbody .name a+{+ cursor: auto;+ display: block;+}++#content #threads #thread-dump tbody .stacktrace .name a+{+ cursor: pointer;+}++#content #threads #thread-dump tbody .stacktrace .name a span+{+ background-image: url( ../img/ico/chevron-small-expand.png );+ background-position: 100% 50%;+ padding-right: 21px;+}++#content #threads #thread-dump tbody .stacktrace.open .name a span+{+ background-image: url( ../img/ico/chevron-small.png );+}++#content #threads #thread-dump tbody .name p+{+ background-image: url( ../img/ico/arrow-000-small.png );+ background-position: 0 50%;+ color: #c0c0c0;+ font-size: 11px;+ padding-left: 21px;+}++#content #threads #thread-dump tbody .name div+{+ border-top: 1px solid #c0c0c0;+ display: none;+ margin-top: 5px;+ padding-top: 5px;+}++#content #threads #thread-dump tbody .open .name div+{+ display: block;+}++#content #threads #thread-dump tbody .name ul+{+ list-style-type: disc;+ margin-left: 0.7em;+ padding-left: 0.7em;+}++#content #threads #thread-dump tbody .time+{+ text-align: right;+}++#content #threads #thread-dump tbody .details+{+ display: none;+}++/* dataimport */++#content #dataimport+{+ background-image: url( ../img/div.gif );+ background-position: 21% 0;+ background-repeat: repeat-y;+}++#content #dataimport #frame+{+ float: right;+ width: 78%;+}++#content #dataimport #form+{+ float: left;+ width: 20%;+}++#content #dataimport.error #form form+{+ display: none !important;+}++#content #dataimport #form label+{+ cursor: pointer;+ display: block;+ margin-top: 5px;+}++#content #dataimport #form input,+#content #dataimport #form select,+#content #dataimport #form textarea+{+ margin-bottom: 2px;+ width: 100%;+}++#content #dataimport #form #start+{+ float: left;+ margin-right: 2%;+ width: 49%;+}++#content #dataimport #form #rows+{+ width: 49%;+}++#content #dataimport #form .checkbox input+{+ margin-bottom: 0;+ width: auto;+}++#content #dataimport #form fieldset,+#content #dataimport #form .optional.expanded+{+ border: 1px solid #fff;+ border-top: 1px solid #c0c0c0;+ margin-bottom: 10px;+}++#content #dataimport #form fieldset legend,+#content #dataimport #form .optional.expanded legend+{+ display: block;+ margin-left: 10px;+ padding: 0px 5px;+}++#content #dataimport #form fieldset legend label+{+ margin-top: 0;+}++#content #dataimport #form .handler+{+ display: none;+}++#content #dataimport #form .handler ul+{+ list-style: disc;+ margin-left: 0.7em;+ padding-left: 0.7em;+}++#content #dataimport #form .handler ul li a+{+ color: #c0c0c0;+ display: block;+}++#content #dataimport #form .handler ul li.active a+{+ color: #333;+}++#content #dataimport #current_state+{+ display: none;+ padding: 10px;+ margin-bottom: 20px;+}++#content #dataimport.error #current_state+{+ display: none !important;+}++#content #dataimport #current_state .time,+#content #dataimport #current_state .info+{+ display: block;+ padding-left: 21px;+}++#content #dataimport #current_state .time+{+ color: #c0c0c0;+ font-size: 11px;+}++#content #dataimport #current_state .info+{+ background-position: 0 1px;+}++#content #dataimport #current_state.indexing+{+ background-color: #f9f9f9;+}++#content #dataimport #current_state.success+{+ background-color: #e6f3e6;+}++#content #dataimport #current_state.success .info+{+ background-image: url( ../img/ico/tick-circle.png );+}++#content #dataimport #current_state.success .info strong+{+ color: #080;+}++#content #dataimport #current_state.failure+{+ background-color: #f3e6e6;+}++#content #dataimport #current_state.failure .info+{+ background-image: url( ../img/ico/slash.png );+}++#content #dataimport #current_state.failure .info strong+{+ color: #800;+}++#content #dataimport #config-error+{+ background-color: #f00;+ background-image: url( ../img/ico/construction.png );+ background-position: 10px 50%;+ color: #fff;+ display: none;+ font-weight: bold;+ margin-bottom: 20px;+ padding: 10px;+ padding-left: 35px;+}++#content #dataimport #config h2+{+ border-color: #c0c0c0;+ padding-left: 5px;+ position: relative;+}++#content #dataimport #config.hidden h2+{+ border-color: #fafafa;+}++#content #dataimport #config h2 a.toggle+{+ background-image: url( ../img/ico/toggle-small.png );+ background-position: 0 50%;+ padding-left: 21px;+}++#content #dataimport #config.hidden h2 a.toggle+{+ background-image: url( ../img/ico/toggle-small-expand.png );+}++#content #dataimport #config h2 a.reload_config+{+ background-image: url( ../img/ico/arrow-circle.png );+ padding-left: 21px;+ position: absolute;+ right: 5px;+ top: 5px;+}++#content #dataimport #config h2 a.reload_config.success+{+ background-image: url( ../img/ico/tick.png );+}++#content #dataimport #config h2 a.reload_config.error+{+ background-image: url( ../img/ico/slash.png );+}++#content #dataimport #config.hidden .content+{+ display: none;+}++#content #dataimport #dataimport_config .loader+{+ background-position: 0 50%;+ padding-left: 21px;+}++/* cores */++#content #cores+{+ background-image: url( ../img/div.gif );+ background-position: 150px 0;+ background-repeat: repeat-y;+}++#content #cores #frame+{+ float: right;+ width: 610px;+}++#content #cores #list+{+ float: left;+ padding-top: 15px;+ width: 151px;+}++#content #cores #list a+{+ border-right: 1px solid #f0f0f0;+ display: block;+ margin-left: 1px;+ padding: 3px 0;+}++#content #cores #list a:hover+{+ background-color: #fafafa;+}++#content #cores #list .current a+{+ background-color: #fff;+ border-right-color: #fff;+ border-top: 1px solid #f0f0f0;+ border-bottom: 1px solid #f0f0f0;+ font-weight: bold;+}++#content #cores #frame .actions+{+ margin-bottom: 20px;+}++#content #cores .actions form .buttons+{+ padding-left: 40px;+}++#content #cores .actions form a+{+ display: block;+ float: left;+ height: 20px;+ margin-right: 5px;+ padding-left: 21px;+}++#content #cores .actions form a span+{+ display: none;+}++#content #cores .actions form a.submit+{+ background-image: url( ../img/ico/tick.png );+ background-position: 50% 50%;+}++#content #cores .actions form a.submit:hover+{+ background-color: #e6f3e6;+}++#content #cores .actions form a.reset+{+ background-image: url( ../img/ico/cross.png );+ background-position: 50% 50%;+}++#content #cores .actions form a.reset:hover+{+ background-color: #f3e6e6;+}++#content #cores .actions form p+{+ padding-bottom: 3px;+}++#content #cores .actions form label+{+ float: left;+ width: 40px;+}++#content #cores .actions form input,+#content #cores .actions form select+{+ width: 100px;+}++#content #cores .actions form select option.disabled+{+ color: #c0c0c0;+}++#content #cores .actions .button-holder+{+ float: left;+ margin-right: 10px;+ margin-bottom: 5px;+}++#content #cores .actions .button-holder.active+{+ margin-bottom: 0;+}++#content #cores .actions .button-holder .button+{+ background-color: #f5f5f5;+ border: 1px solid #c0c0c0;+ position: relative;+ z-index: 100;+}++#content #cores .actions .button-holder.active .button+{+ background-color: #fff;+ border-bottom-color: #fff;+ padding-bottom: 5px;+}++#content #cores .actions .button-holder .button a+{+ background-position: 5px 50%;+ display: block;+ padding: 1px 5px;+ padding-left: 24px;+}++#content #cores .actions .button-holder .button a.success+{+ background-image: url( ../img/ico/tick.png );+}++#content #cores .actions .button-holder.active .button a+{+ cursor: auto;+}++#content #cores .actions .button-holder .button-content+{+ background-color: #fff;+ border: 1px solid #c0c0c0;+ box-shadow: 5px 5px 10px #c0c0c0;+ -moz-box-shadow: 5px 5px 10px #c0c0c0;+ -webkit-box-shadow: 5px 5px 10px #c0c0c0;+ display: none;+ margin-top: -1px;+ padding: 5px;+ padding-top: 15px;+ position: absolute;+ z-index: 99;+}++#content #cores .actions .button-holder.active .button-content+{+ display: block;+}++#content #cores .actions .button .reload+{+ background-image: url( ../img/ico/arrow-circle.png );+}++#content #cores .actions .button .rename+{+ background-image: url( ../img/ico/ui-text-field-select.png );+}++#content #cores .actions .button .swap+{+ background-image: url( ../img/ico/arrow-switch.png );+}++#content #cores .actions .button .unload+{+ background-image: url( ../img/ico/cross.png );+}++#content #cores .actions .button .optimize+{+ background-image: url( ../img/ico/hammer-screwdriver.png );+ display: none;+}++#content #cores #navigation .add+{+ background-image: url( ../img/ico/plus-button.png );+}++#content #cores #navigation .add label+{+ width: 85px;+}++#content #cores #navigation .add input+{+ width: 155px;+}++#content #cores #navigation .add .buttons+{+ padding-left: 85px;+}++#content #cores #data #core-data h2 { background-image: url( ../img/ico/database.png ); }+#content #cores #data #index-data h2 { background-image: url( ../img/ico/chart.png ); }++#content #cores #data #index-data+{+ margin-top: 10px;+}++#content #cores #data li+{+ padding-bottom: 3px;+ padding-top: 3px;+}++#content #cores #data li.odd+{+ background-color: #f8f8f8;+}++#content #cores #data li dt+{+ float: left;+ width: 17%;+}++#content #cores #data li dd+{+ float: right;+ width: 82%;+}++#content #cores #data li dd.ico+{+ background-image: url( ../img/ico/slash.png );+ height: 20px;+}++#content #cores #data li dd.ico.ico-1+{+ background-image: url( ../img/ico/tick.png );+}++#content #cores #data li dd.ico span+{+ display: none;+}++/* replication */++#content #replication+{+ background-image: url( ../img/div.gif );+ background-position: 165px 0;+ background-repeat: repeat-y;+}++#content #replication #frame+{+ float: right;+ width: 600px;+}++#content #replication #navigation+{+ float: left;+ width: 161px;+}++#content #replication #error+{+ background-color: #f00;+ background-image: url( ../img/ico/construction.png );+ background-position: 10px 50%;+ color: #fff;+ display: none;+ font-weight: bold;+ margin-bottom: 20px;+ padding: 10px;+ padding-left: 35px;+}++#content #replication .block+{+ border-bottom: 1px solid #c0c0c0;+ margin-bottom: 20px;+ padding-bottom: 20px;+}++#content #replication .block.last+{+ border-bottom: 0;+}++#content #replication .masterOnly,+#content #replication .slaveOnly+{+ display: none;+}++#content #replication.master .masterOnly+{+ display: block;+}++#content #replication.slave .slaveOnly+{+ display: block;+}++#content #replication .replicating+{+ display: none;+}++#content #replication.replicating .replicating+{+ display: block;+}++#content #replication #progress+{+ padding-bottom: 80px;+ position: relative;+}++#content #replication #progress .info+{+ padding: 5px;+}++#content #replication #progress #start+{+ margin-left: 100px;+ border-left: 1px solid #c0c0c0;+}++#content #replication #progress #bar+{+ background-color: #f0f0f0;+ margin-left: 100px;+ margin-right: 100px;+ position: relative;+}++#content #replication #progress #bar #bar-info,+#content #replication #progress #bar #eta+{+ position: absolute;+ right: -100px;+ width: 100px;+}++#content #replication #progress #bar #bar-info+{+ border-left: 1px solid #f0f0f0;+ margin-top: 30px;+}++#content #replication #progress #eta .info+{+ color: #c0c0c0;+ height: 30px;+ line-height: 30px;+ padding-top: 0;+ padding-bottom: 0;+}++#content #replication #progress #speed+{+ color: #c0c0c0;+ position: absolute;+ right: 100px;+ top: 0;+}++#content #replication #progress #bar #done+{+ background-color: #c0c0c0;+ box-shadow: 5px 5px 10px #c0c0c0;+ -moz-box-shadow: 5px 5px 10px #c0c0c0;+ -webkit-box-shadow: 5px 5px 10px #c0c0c0;+ height: 30px;+ position: relative;+}++#content #replication #progress #bar #done .percent+{+ font-weight: bold;+ height: 30px;+ line-height: 30px;+ padding-left: 5px;+ padding-right: 5px;+ position: absolute;+ right: 0;+ text-align: right;+}++#content #replication #progress #bar #done #done-info+{+ border-right: 1px solid #c0c0c0;+ position: absolute;+ right: 0;+ margin-top: 30px;+ text-align: right;+ width: 100px;+}++#content #replication #progress #bar #done #done-info .percent+{+ font-weight: bold;+}++#content #replication .block .label,+#content #replication #current-file .file,+#content #replication #current-file .progress,+#content #replication #iterations .iterations+{+ float: left;+}++#content #replication .block .label+{+ width: 100px;+}++#content #replication .block .label span+{+ display: block;+ padding-left: 21px;+}++#content #replication #current-file+{+ border-top: 1px solid #f0f0f0;+ margin-top: 10px;+ padding-top: 10px;+}++#content #replication #current-file .progress+{+ color: #c0c0c0;+ margin-left: 20px;+}++#content #replication #iterations+{+ display: none;+}++#content #replication #iterations .label span+{+ background-image: url( ../img/ico/node-design.png );+}++#content #replication #iterations .iterations li+{+ background-position: 100% 50%;+ display: none;+ padding-right: 21px;+}++#content #replication #iterations .iterations.expanded li+{+ display: block;+}++#content #replication #iterations .iterations .latest+{+ display: block;+}++#content #replication #iterations .iterations .replicated+{+ color: #80c480;+}++#content #replication #iterations .iterations ul:hover .replicated,+#content #replication #iterations .iterations .replicated.latest+{+ color: #080;+}++#content #replication #iterations .iterations .replicated.latest+{+ background-image: url( ../img/ico/tick.png );+}++#content #replication #iterations .iterations .failed+{+ color: #c48080;+}++#content #replication #iterations .iterations ul:hover .failed,+#content #replication #iterations .iterations .failed.latest+{+ color: #800;+}++#content #replication #iterations .iterations .failed.latest+{+ background-image: url( ../img/ico/cross.png );+}++#content #replication #iterations .iterations a+{+ border-top: 1px solid #f0f0f0;+ display: none;+ margin-top: 2px;+ padding-top: 2px;+}++#content #replication #iterations .iterations a span+{+ background-position: 0 50%;+ color: #c0c0c0;+ display: none;+ padding-left: 21px;+}++#content #replication #iterations .iterations a span.expand+{+ background-image: url( ../img/ico/chevron-small-expand.png );+ display: block;+}++#content #replication #iterations .iterations.expanded a span.expand+{+ display: none;+}++#content #replication #iterations .iterations.expanded a span.collapse+{+ background-image: url( ../img/ico/chevron-small.png );+ display: block;+}++#content #replication #details table+{+ border-collapse: collapse;+}++#content #replication #details table th+{+ text-align: left;+}++#content #replication.slave #details table .slaveOnly+{+ display: table-row;+}++#content #replication #details table thead th+{+ color: #c0c0c0;+}++#content #replication #details table thead th,+#content #replication #details table tbody td+{+ padding-right: 20px;+}++#content #replication #details table thead td,+#content #replication #details table thead th,+#content #replication #details table tbody th,+#content #replication #details table tbody td div+{+ padding-top: 3px;+ padding-bottom: 3px;+}++#content #replication #details table tbody td,+#content #replication #details table tbody th+{+ border-top: 1px solid #f0f0f0;+}++#content #replication #details table thead td+{+ width: 100px;+}++#content #replication #details table thead td span+{+ background-image: url( ../img/ico/clipboard-list.png );+ background-position: 0 50%;+ display: block;+ padding-left: 21px;+}++#content #replication #details table tbody th+{+ padding-right: 10px;+ text-align: right;+}++#content #replication #details table tbody .size+{+ text-align: right;+}++#content #replication #details table tbody .generation div+{+ text-align: center;+}++#content #replication #details table tbody .diff div+{+ background-color: #fcfcc9;+ padding-left: 1px;+ padding-right: 1px;+}++#content #replication .settings .label span+{+ background-image: url( ../img/ico/hammer-screwdriver.png );+}++#content #replication .settings ul,+#content #replication .settings dl dt,+#content #replication .settings dl dd+{+ float: left;+}++#content #replication .settings ul li+{+ border-top: 1px solid #f0f0f0;+ display: none;+ padding-top: 3px;+ padding-top: 3px;+}++#content #replication .settings ul li:first-child+{+ border-top: 0;+ padding-top: 0;+}++#content #replication .settings dl dt+{+ clear: left;+ margin-right: 5px;+ width: 120px;+}++#content #replication .settings dl .ico+{+ background-position: 0 50%;+ padding-left: 21px;+}++#content #replication .settings dl .ico.ico-0+{+ background-image: url( ../img/ico/slash.png );+}++#content #replication .settings dl .ico.ico-1+{+ background-image: url( ../img/ico/tick.png );+}++#content #replication #navigation button+{+ background-position: 2px 50%;+ margin-bottom: 10px;+ padding-left: 21px;+}++#content #replication #navigation button.optional+{+ display: none;+}++#content #replication #navigation .replicate-now+{+ background-image: url( ../img/ico/document-convert.png );+}++#content #replication #navigation .abort-replication+{+ background-color: #800;+ background-image: url( ../img/ico/hand.png );+ border-color: #800;+ color: #fff;+}++#content #replication #navigation .disable-polling+{+ background-image: url( ../img/ico/cross.png );+}++#content #replication #navigation .enable-polling+{+ background-image: url( ../img/ico/tick.png );+}++#content #replication #navigation .disable-replication+{+ background-image: url( ../img/ico/cross.png );+}++#content #replication #navigation .enable-replication+{+ background-image: url( ../img/ico/tick.png );+}++#content #replication #navigation .refresh-status+{+ background-image: url( ../img/ico/arrow-circle.png );+}++/* cloud */++#content #cloud #zookeeper h2 { background-image: url( ../img/ico/sitemap.png ); }\ No newline at end of filediff --git a/solr/src/webapp/web/css/syntax.css b/solr/src/webapp/web/css/syntax.cssnew file mode 100644index 00000000000..ea21cf9afa2--- /dev/null+++ b/solr/src/webapp/web/css/syntax.css@@ -0,0 +1,153 @@++/*++github.com style (c) Vasily Polovnyov <[email protected]>++*/++pre.syntax+{+ overflow: auto;+}++pre.syntax code+{+ display: block;+ color: #000;+}++pre.syntax .comment,+pre.syntax .template_comment,+pre.syntax .diff .header,+pre.syntax .javadoc+{+ color: #998;+ font-style: italic;+}++pre.syntax .keyword,+pre.syntax .css .rule .keyword,+pre.syntax .winutils,+pre.syntax .javascript .title,+pre.syntax .lisp .title,+pre.syntax .subst+{+ color: #000;+ font-weight: bold;+}++pre.syntax .number,+pre.syntax .hexcolor+{+ color: #40a070;+}++pre.syntax .string,+pre.syntax .tag .value,+pre.syntax .phpdoc,+pre.syntax .tex .formula+{+ color: #d14;+}++pre.syntax .title,+pre.syntax .id+{+ color: #900;+ font-weight: bold;+}++pre.syntax .javascript .title,+pre.syntax .lisp .title,+pre.syntax .subst+{+ font-weight: normal;+}++pre.syntax .class .title,+pre.syntax .tex .command+{+ color: #458;+ font-weight: bold;+}++pre.syntax .tag,+pre.syntax .css .keyword,+pre.syntax .html .keyword,+pre.syntax .tag .title,+pre.syntax .django .tag .keyword+{+ color: #000080;+ font-weight: normal;+}++pre.syntax .attribute,+pre.syntax .variable,+pre.syntax .instancevar,+pre.syntax .lisp .body+{+ color: #008080;+}++pre.syntax .regexp+{+ color: #009926;+}++pre.syntax .class+{+ color: #458;+ font-weight: bold;+}++pre.syntax .symbol,+pre.syntax .ruby .symbol .string,+pre.syntax .ruby .symbol .keyword,+pre.syntax .ruby .symbol .keymethods,+pre.syntax .lisp .keyword,+pre.syntax .tex .special+{+ color: #990073;+}++pre.syntax .builtin,+pre.syntax .built_in,+pre.syntax .lisp .title+{+ color: #0086b3;+}++pre.syntax .preprocessor,+pre.syntax .pi,+pre.syntax .doctype,+pre.syntax .shebang,+pre.syntax .cdata+{+ color: #999;+ font-weight: bold;+}++pre.syntax .deletion+{+ background: #fdd;+}++pre.syntax .addition+{+ background: #dfd;+}++pre.syntax .diff .change+{+ background: #0086b3;+}++pre.syntax .chunk+{+ color: #aaa;+}++pre.syntax .tex .formula+{+ opacity: 0.5;+}\ No newline at end of filediff --git a/solr/src/webapp/web/img/div.gif b/solr/src/webapp/web/img/div.gifnew file mode 100644index 00000000000..963c9e97bd7Binary files /dev/null and b/solr/src/webapp/web/img/div.gif differdiff --git a/solr/src/webapp/web/img/favicon.ico b/solr/src/webapp/web/img/favicon.iconew file mode 100644index 00000000000..eded10aac91Binary files /dev/null and b/solr/src/webapp/web/img/favicon.ico differdiff --git a/solr/src/webapp/web/img/ico/arrow-000-small.png b/solr/src/webapp/web/img/ico/arrow-000-small.pngnew file mode 100644index 00000000000..cfc2e2493f4Binary files /dev/null and b/solr/src/webapp/web/img/ico/arrow-000-small.png differdiff --git a/solr/src/webapp/web/img/ico/arrow-circle.png b/solr/src/webapp/web/img/ico/arrow-circle.pngnew file mode 100644index 00000000000..dda71327504Binary files /dev/null and b/solr/src/webapp/web/img/ico/arrow-circle.png differdiff --git a/solr/src/webapp/web/img/ico/arrow-switch.png b/solr/src/webapp/web/img/ico/arrow-switch.pngnew file mode 100644index 00000000000..ab3dd3021d2Binary files /dev/null and b/solr/src/webapp/web/img/ico/arrow-switch.png differdiff --git a/solr/src/webapp/web/img/ico/battery.png b/solr/src/webapp/web/img/ico/battery.pngnew file mode 100644index 00000000000..7a825b0257eBinary files /dev/null and b/solr/src/webapp/web/img/ico/battery.png differdiff --git a/solr/src/webapp/web/img/ico/block-small.png b/solr/src/webapp/web/img/ico/block-small.pngnew file mode 100644index 00000000000..7cc52813cd5Binary files /dev/null and b/solr/src/webapp/web/img/ico/block-small.png differdiff --git a/solr/src/webapp/web/img/ico/block.png b/solr/src/webapp/web/img/ico/block.pngnew file mode 100644index 00000000000..ed7ec0e972eBinary files /dev/null and b/solr/src/webapp/web/img/ico/block.png differdiff --git a/solr/src/webapp/web/img/ico/book-open-text.png b/solr/src/webapp/web/img/ico/book-open-text.pngnew file mode 100644index 00000000000..069fae7c951Binary files /dev/null and b/solr/src/webapp/web/img/ico/book-open-text.png differdiff --git a/solr/src/webapp/web/img/ico/box.png b/solr/src/webapp/web/img/ico/box.pngnew file mode 100644index 00000000000..3ec0ceb131cBinary files /dev/null and b/solr/src/webapp/web/img/ico/box.png differdiff --git a/solr/src/webapp/web/img/ico/bug.png b/solr/src/webapp/web/img/ico/bug.pngnew file mode 100644index 00000000000..242d5391c1eBinary files /dev/null and b/solr/src/webapp/web/img/ico/bug.png differdiff --git a/solr/src/webapp/web/img/ico/chart.png b/solr/src/webapp/web/img/ico/chart.pngnew file mode 100644index 00000000000..d3cb71d5c5dBinary files /dev/null and b/solr/src/webapp/web/img/ico/chart.png differdiff --git a/solr/src/webapp/web/img/ico/chevron-small-expand.png b/solr/src/webapp/web/img/ico/chevron-small-expand.pngnew file mode 100644index 00000000000..06a8eaca138Binary files /dev/null and b/solr/src/webapp/web/img/ico/chevron-small-expand.png differdiff --git a/solr/src/webapp/web/img/ico/chevron-small.png b/solr/src/webapp/web/img/ico/chevron-small.pngnew file mode 100644index 00000000000..b54fd1c7c23Binary files /dev/null and b/solr/src/webapp/web/img/ico/chevron-small.png differdiff --git a/solr/src/webapp/web/img/ico/clipboard-list.png b/solr/src/webapp/web/img/ico/clipboard-list.pngnew file mode 100644index 00000000000..e98c567563fBinary files /dev/null and b/solr/src/webapp/web/img/ico/clipboard-list.png differdiff --git a/solr/src/webapp/web/img/ico/clock-select.png b/solr/src/webapp/web/img/ico/clock-select.pngnew file mode 100644index 00000000000..8c567916c8eBinary files /dev/null and b/solr/src/webapp/web/img/ico/clock-select.png differdiff --git a/solr/src/webapp/web/img/ico/construction.png b/solr/src/webapp/web/img/ico/construction.pngnew file mode 100644index 00000000000..8347aa896f4Binary files /dev/null and b/solr/src/webapp/web/img/ico/construction.png differdiff --git a/solr/src/webapp/web/img/ico/cross-0.png b/solr/src/webapp/web/img/ico/cross-0.pngnew file mode 100644index 00000000000..04fef989e7fBinary files /dev/null and b/solr/src/webapp/web/img/ico/cross-0.png differdiff --git a/solr/src/webapp/web/img/ico/cross-1.png b/solr/src/webapp/web/img/ico/cross-1.pngnew file mode 100644index 00000000000..830879b618aBinary files /dev/null and b/solr/src/webapp/web/img/ico/cross-1.png differdiff --git a/solr/src/webapp/web/img/ico/cross.png b/solr/src/webapp/web/img/ico/cross.pngnew file mode 100644index 00000000000..6b9fa6dd36eBinary files /dev/null and b/solr/src/webapp/web/img/ico/cross.png differdiff --git a/solr/src/webapp/web/img/ico/dashboard.png b/solr/src/webapp/web/img/ico/dashboard.pngnew file mode 100644index 00000000000..ba03262f0c8Binary files /dev/null and b/solr/src/webapp/web/img/ico/dashboard.png differdiff --git a/solr/src/webapp/web/img/ico/database.png b/solr/src/webapp/web/img/ico/database.pngnew file mode 100644index 00000000000..d588f422f76Binary files /dev/null and b/solr/src/webapp/web/img/ico/database.png differdiff --git a/solr/src/webapp/web/img/ico/databases.png b/solr/src/webapp/web/img/ico/databases.pngnew file mode 100644index 00000000000..11dcab4b1b3Binary files /dev/null and b/solr/src/webapp/web/img/ico/databases.png differdiff --git a/solr/src/webapp/web/img/ico/disk-black.png b/solr/src/webapp/web/img/ico/disk-black.pngnew file mode 100644index 00000000000..61784784f00Binary files /dev/null and b/solr/src/webapp/web/img/ico/disk-black.png differdiff --git a/solr/src/webapp/web/img/ico/document-convert.png b/solr/src/webapp/web/img/ico/document-convert.pngnew file mode 100644index 00000000000..1ecdafb99a3Binary files /dev/null and b/solr/src/webapp/web/img/ico/document-convert.png differdiff --git a/solr/src/webapp/web/img/ico/document-import.png b/solr/src/webapp/web/img/ico/document-import.pngnew file mode 100644index 00000000000..5fae085f85fBinary files /dev/null and b/solr/src/webapp/web/img/ico/document-import.png differdiff --git a/solr/src/webapp/web/img/ico/document-list.png b/solr/src/webapp/web/img/ico/document-list.pngnew file mode 100644index 00000000000..2b4dde893eeBinary files /dev/null and b/solr/src/webapp/web/img/ico/document-list.png differdiff --git a/solr/src/webapp/web/img/ico/document-text.png b/solr/src/webapp/web/img/ico/document-text.pngnew file mode 100644index 00000000000..ed841a02a7dBinary files /dev/null and b/solr/src/webapp/web/img/ico/document-text.png differdiff --git a/solr/src/webapp/web/img/ico/folder-export.png b/solr/src/webapp/web/img/ico/folder-export.pngnew file mode 100644index 00000000000..86e0cd294ceBinary files /dev/null and b/solr/src/webapp/web/img/ico/folder-export.png differdiff --git a/solr/src/webapp/web/img/ico/folder.png b/solr/src/webapp/web/img/ico/folder.pngnew file mode 100644index 00000000000..ada85c48b88Binary files /dev/null and b/solr/src/webapp/web/img/ico/folder.png differdiff --git a/solr/src/webapp/web/img/ico/funnel-small.png b/solr/src/webapp/web/img/ico/funnel-small.pngnew file mode 100644index 00000000000..96e9e28f251Binary files /dev/null and b/solr/src/webapp/web/img/ico/funnel-small.png differdiff --git a/solr/src/webapp/web/img/ico/funnel.png b/solr/src/webapp/web/img/ico/funnel.pngnew file mode 100644index 00000000000..1f69604528fBinary files /dev/null and b/solr/src/webapp/web/img/ico/funnel.png differdiff --git a/solr/src/webapp/web/img/ico/gear.png b/solr/src/webapp/web/img/ico/gear.pngnew file mode 100644index 00000000000..efc599dccd8Binary files /dev/null and b/solr/src/webapp/web/img/ico/gear.png differdiff --git a/solr/src/webapp/web/img/ico/globe.png b/solr/src/webapp/web/img/ico/globe.pngnew file mode 100644index 00000000000..48e5b6b30cfBinary files /dev/null and b/solr/src/webapp/web/img/ico/globe.png differdiff --git a/solr/src/webapp/web/img/ico/hammer-screwdriver.png b/solr/src/webapp/web/img/ico/hammer-screwdriver.pngnew file mode 100644index 00000000000..985d44c5e7fBinary files /dev/null and b/solr/src/webapp/web/img/ico/hammer-screwdriver.png differdiff --git a/solr/src/webapp/web/img/ico/hand.png b/solr/src/webapp/web/img/ico/hand.pngnew file mode 100644index 00000000000..7b47be2dc92Binary files /dev/null and b/solr/src/webapp/web/img/ico/hand.png differdiff --git a/solr/src/webapp/web/img/ico/highlighter-text.png b/solr/src/webapp/web/img/ico/highlighter-text.pngnew file mode 100644index 00000000000..719c537dbb1Binary files /dev/null and b/solr/src/webapp/web/img/ico/highlighter-text.png differdiff --git a/solr/src/webapp/web/img/ico/hourglass--exclamation.png b/solr/src/webapp/web/img/ico/hourglass--exclamation.pngnew file mode 100644index 00000000000..67436681a1cBinary files /dev/null and b/solr/src/webapp/web/img/ico/hourglass--exclamation.png differdiff --git a/solr/src/webapp/web/img/ico/hourglass.png b/solr/src/webapp/web/img/ico/hourglass.pngnew file mode 100644index 00000000000..127c5d6156bBinary files /dev/null and b/solr/src/webapp/web/img/ico/hourglass.png differdiff --git a/solr/src/webapp/web/img/ico/inbox-document-text.png b/solr/src/webapp/web/img/ico/inbox-document-text.pngnew file mode 100644index 00000000000..4b479cfef6cBinary files /dev/null and b/solr/src/webapp/web/img/ico/inbox-document-text.png differdiff --git a/solr/src/webapp/web/img/ico/information-small.png b/solr/src/webapp/web/img/ico/information-small.pngnew file mode 100644index 00000000000..6db2d56e970Binary files /dev/null and b/solr/src/webapp/web/img/ico/information-small.png differdiff --git a/solr/src/webapp/web/img/ico/information.png b/solr/src/webapp/web/img/ico/information.pngnew file mode 100644index 00000000000..fa9a60b5ad2Binary files /dev/null and b/solr/src/webapp/web/img/ico/information.png differdiff --git a/solr/src/webapp/web/img/ico/jar.png b/solr/src/webapp/web/img/ico/jar.pngnew file mode 100644index 00000000000..8711832acccBinary files /dev/null and b/solr/src/webapp/web/img/ico/jar.png differdiff --git a/solr/src/webapp/web/img/ico/magnifier.png b/solr/src/webapp/web/img/ico/magnifier.pngnew file mode 100644index 00000000000..7a5ae62e327Binary files /dev/null and b/solr/src/webapp/web/img/ico/magnifier.png differdiff --git a/solr/src/webapp/web/img/ico/mail.png b/solr/src/webapp/web/img/ico/mail.pngnew file mode 100644index 00000000000..e708416dac9Binary files /dev/null and b/solr/src/webapp/web/img/ico/mail.png differdiff --git a/solr/src/webapp/web/img/ico/network-cloud.png b/solr/src/webapp/web/img/ico/network-cloud.pngnew file mode 100644index 00000000000..0527a92ba13Binary files /dev/null and b/solr/src/webapp/web/img/ico/network-cloud.png differdiff --git a/solr/src/webapp/web/img/ico/network-status-away.png b/solr/src/webapp/web/img/ico/network-status-away.pngnew file mode 100644index 00000000000..0defbb40d9bBinary files /dev/null and b/solr/src/webapp/web/img/ico/network-status-away.png differdiff --git a/solr/src/webapp/web/img/ico/network-status-busy.png b/solr/src/webapp/web/img/ico/network-status-busy.pngnew file mode 100644index 00000000000..ba2c65473c1Binary files /dev/null and b/solr/src/webapp/web/img/ico/network-status-busy.png differdiff --git a/solr/src/webapp/web/img/ico/network-status-offline.png b/solr/src/webapp/web/img/ico/network-status-offline.pngnew file mode 100644index 00000000000..507ff05959eBinary files /dev/null and b/solr/src/webapp/web/img/ico/network-status-offline.png differdiff --git a/solr/src/webapp/web/img/ico/network-status.png b/solr/src/webapp/web/img/ico/network-status.pngnew file mode 100644index 00000000000..12ccc6baffcBinary files /dev/null and b/solr/src/webapp/web/img/ico/network-status.png differdiff --git a/solr/src/webapp/web/img/ico/node-design.png b/solr/src/webapp/web/img/ico/node-design.pngnew file mode 100644index 00000000000..fb2d4066c71Binary files /dev/null and b/solr/src/webapp/web/img/ico/node-design.png differdiff --git a/solr/src/webapp/web/img/ico/node-master.png b/solr/src/webapp/web/img/ico/node-master.pngnew file mode 100644index 00000000000..c40fcc3ee49Binary files /dev/null and b/solr/src/webapp/web/img/ico/node-master.png differdiff --git a/solr/src/webapp/web/img/ico/node-select.png b/solr/src/webapp/web/img/ico/node-select.pngnew file mode 100644index 00000000000..d2aba04ccb1Binary files /dev/null and b/solr/src/webapp/web/img/ico/node-select.png differdiff --git a/solr/src/webapp/web/img/ico/node-slave.png b/solr/src/webapp/web/img/ico/node-slave.pngnew file mode 100644index 00000000000..78a41cd1277Binary files /dev/null and b/solr/src/webapp/web/img/ico/node-slave.png differdiff --git a/solr/src/webapp/web/img/ico/node.png b/solr/src/webapp/web/img/ico/node.pngnew file mode 100644index 00000000000..88f1a2bbf1bBinary files /dev/null and b/solr/src/webapp/web/img/ico/node.png differdiff --git a/solr/src/webapp/web/img/ico/pencil-small.png b/solr/src/webapp/web/img/ico/pencil-small.pngnew file mode 100644index 00000000000..3d81c2fb136Binary files /dev/null and b/solr/src/webapp/web/img/ico/pencil-small.png differdiff --git a/solr/src/webapp/web/img/ico/plus-button.png b/solr/src/webapp/web/img/ico/plus-button.pngnew file mode 100644index 00000000000..10d1f600317Binary files /dev/null and b/solr/src/webapp/web/img/ico/plus-button.png differdiff --git a/solr/src/webapp/web/img/ico/question-small-white.png b/solr/src/webapp/web/img/ico/question-small-white.pngnew file mode 100644index 00000000000..132d3f5badaBinary files /dev/null and b/solr/src/webapp/web/img/ico/question-small-white.png differdiff --git a/solr/src/webapp/web/img/ico/receipt-invoice.png b/solr/src/webapp/web/img/ico/receipt-invoice.pngnew file mode 100644index 00000000000..fed614079feBinary files /dev/null and b/solr/src/webapp/web/img/ico/receipt-invoice.png differdiff --git a/solr/src/webapp/web/img/ico/receipt.png b/solr/src/webapp/web/img/ico/receipt.pngnew file mode 100644index 00000000000..1548b0ac60cBinary files /dev/null and b/solr/src/webapp/web/img/ico/receipt.png differdiff --git a/solr/src/webapp/web/img/ico/script-code.png b/solr/src/webapp/web/img/ico/script-code.pngnew file mode 100644index 00000000000..d398622dfdfBinary files /dev/null and b/solr/src/webapp/web/img/ico/script-code.png differdiff --git a/solr/src/webapp/web/img/ico/server-cast.png b/solr/src/webapp/web/img/ico/server-cast.pngnew file mode 100644index 00000000000..9213866525bBinary files /dev/null and b/solr/src/webapp/web/img/ico/server-cast.png differdiff --git a/solr/src/webapp/web/img/ico/server.png b/solr/src/webapp/web/img/ico/server.pngnew file mode 100644index 00000000000..ee0c771797eBinary files /dev/null and b/solr/src/webapp/web/img/ico/server.png differdiff --git a/solr/src/webapp/web/img/ico/sitemap.png b/solr/src/webapp/web/img/ico/sitemap.pngnew file mode 100644index 00000000000..298343eeabaBinary files /dev/null and b/solr/src/webapp/web/img/ico/sitemap.png differdiff --git a/solr/src/webapp/web/img/ico/slash.png b/solr/src/webapp/web/img/ico/slash.pngnew file mode 100644index 00000000000..7af3a5189d2Binary files /dev/null and b/solr/src/webapp/web/img/ico/slash.png differdiff --git a/solr/src/webapp/web/img/ico/status-away.png b/solr/src/webapp/web/img/ico/status-away.pngnew file mode 100644index 00000000000..c7be0abbe4dBinary files /dev/null and b/solr/src/webapp/web/img/ico/status-away.png differdiff --git a/solr/src/webapp/web/img/ico/status-busy.png b/solr/src/webapp/web/img/ico/status-busy.pngnew file mode 100644index 00000000000..a9d5f4db20dBinary files /dev/null and b/solr/src/webapp/web/img/ico/status-busy.png differdiff --git a/solr/src/webapp/web/img/ico/status-offline.png b/solr/src/webapp/web/img/ico/status-offline.pngnew file mode 100644index 00000000000..f148af49853Binary files /dev/null and b/solr/src/webapp/web/img/ico/status-offline.png differdiff --git a/solr/src/webapp/web/img/ico/status.png b/solr/src/webapp/web/img/ico/status.pngnew file mode 100644index 00000000000..680bb8a6a62Binary files /dev/null and b/solr/src/webapp/web/img/ico/status.png differdiff --git a/solr/src/webapp/web/img/ico/system-monitor.png b/solr/src/webapp/web/img/ico/system-monitor.pngnew file mode 100644index 00000000000..a139103e11dBinary files /dev/null and b/solr/src/webapp/web/img/ico/system-monitor.png differdiff --git a/solr/src/webapp/web/img/ico/table.png b/solr/src/webapp/web/img/ico/table.pngnew file mode 100644index 00000000000..b0cd69fc5daBinary files /dev/null and b/solr/src/webapp/web/img/ico/table.png differdiff --git a/solr/src/webapp/web/img/ico/terminal.png b/solr/src/webapp/web/img/ico/terminal.pngnew file mode 100644index 00000000000..c18df24f94cBinary files /dev/null and b/solr/src/webapp/web/img/ico/terminal.png differdiff --git a/solr/src/webapp/web/img/ico/tick-circle.png b/solr/src/webapp/web/img/ico/tick-circle.pngnew file mode 100644index 00000000000..210b1a6c3ccBinary files /dev/null and b/solr/src/webapp/web/img/ico/tick-circle.png differdiff --git a/solr/src/webapp/web/img/ico/tick-red.png b/solr/src/webapp/web/img/ico/tick-red.pngnew file mode 100644index 00000000000..8ec99b4a697Binary files /dev/null and b/solr/src/webapp/web/img/ico/tick-red.png differdiff --git a/solr/src/webapp/web/img/ico/tick.png b/solr/src/webapp/web/img/ico/tick.pngnew file mode 100644index 00000000000..2414885b857Binary files /dev/null and b/solr/src/webapp/web/img/ico/tick.png differdiff --git a/solr/src/webapp/web/img/ico/toggle-small-expand.png b/solr/src/webapp/web/img/ico/toggle-small-expand.pngnew file mode 100644index 00000000000..79c5ff7e809Binary files /dev/null and b/solr/src/webapp/web/img/ico/toggle-small-expand.png differdiff --git a/solr/src/webapp/web/img/ico/toggle-small.png b/solr/src/webapp/web/img/ico/toggle-small.pngnew file mode 100644index 00000000000..f783a6f2cb0Binary files /dev/null and b/solr/src/webapp/web/img/ico/toggle-small.png differdiff --git a/solr/src/webapp/web/img/ico/ui-accordion.png b/solr/src/webapp/web/img/ico/ui-accordion.pngnew file mode 100644index 00000000000..a9f1448e29aBinary files /dev/null and b/solr/src/webapp/web/img/ico/ui-accordion.png differdiff --git a/solr/src/webapp/web/img/ico/ui-address-bar.png b/solr/src/webapp/web/img/ico/ui-address-bar.pngnew file mode 100644index 00000000000..1a96ac435efBinary files /dev/null and b/solr/src/webapp/web/img/ico/ui-address-bar.png differdiff --git a/solr/src/webapp/web/img/ico/ui-check-box-uncheck.png b/solr/src/webapp/web/img/ico/ui-check-box-uncheck.pngnew file mode 100644index 00000000000..ba447358cc1Binary files /dev/null and b/solr/src/webapp/web/img/ico/ui-check-box-uncheck.png differdiff --git a/solr/src/webapp/web/img/ico/ui-check-box.png b/solr/src/webapp/web/img/ico/ui-check-box.pngnew file mode 100644index 00000000000..07f3522a9cbBinary files /dev/null and b/solr/src/webapp/web/img/ico/ui-check-box.png differdiff --git a/solr/src/webapp/web/img/ico/ui-radio-button-uncheck.png b/solr/src/webapp/web/img/ico/ui-radio-button-uncheck.pngnew file mode 100644index 00000000000..ec7102b6efdBinary files /dev/null and b/solr/src/webapp/web/img/ico/ui-radio-button-uncheck.png differdiff --git a/solr/src/webapp/web/img/ico/ui-radio-button.png b/solr/src/webapp/web/img/ico/ui-radio-button.pngnew file mode 100644index 00000000000..f83a25496e5Binary files /dev/null and b/solr/src/webapp/web/img/ico/ui-radio-button.png differdiff --git a/solr/src/webapp/web/img/ico/ui-text-field-select.png b/solr/src/webapp/web/img/ico/ui-text-field-select.pngnew file mode 100644index 00000000000..3cfe301ac79Binary files /dev/null and b/solr/src/webapp/web/img/ico/ui-text-field-select.png differdiff --git a/solr/src/webapp/web/img/ico/users.png b/solr/src/webapp/web/img/ico/users.pngnew file mode 100644index 00000000000..a6aae0404b7Binary files /dev/null and b/solr/src/webapp/web/img/ico/users.png differdiff --git a/solr/src/webapp/web/img/loader-light.gif b/solr/src/webapp/web/img/loader-light.gifnew file mode 100644index 00000000000..f578ca586feBinary files /dev/null and b/solr/src/webapp/web/img/loader-light.gif differdiff --git a/solr/src/webapp/web/img/loader.gif b/solr/src/webapp/web/img/loader.gifnew file mode 100644index 00000000000..085ccaecaf5Binary files /dev/null and b/solr/src/webapp/web/img/loader.gif differdiff --git a/solr/src/webapp/web/img/lucene-ico.png b/solr/src/webapp/web/img/lucene-ico.pngnew file mode 100644index 00000000000..43327dd5acbBinary files /dev/null and b/solr/src/webapp/web/img/lucene-ico.png differdiff --git a/solr/src/webapp/web/img/solr.png b/solr/src/webapp/web/img/solr.pngnew file mode 100644index 00000000000..326e3cd5771Binary files /dev/null and b/solr/src/webapp/web/img/solr.png differdiff --git a/solr/src/webapp/web/img/tree.png b/solr/src/webapp/web/img/tree.pngnew file mode 100644index 00000000000..61b6b3ee1a1Binary files /dev/null and b/solr/src/webapp/web/img/tree.png differdiff --git a/solr/src/webapp/web/index.jsp b/solr/src/webapp/web/index.jspindex ef10d002c61..0310573a1da 100644--- a/solr/src/webapp/web/index.jsp+++ b/solr/src/webapp/web/index.jsp@@ -1,49 +1,119 @@-<%@ page import="org.apache.solr.core.SolrCore" %>+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>+<% request.setCharacterEncoding("UTF-8"); %>++<%@ page import="java.util.List" %><%@ page import="java.util.Collection" %>-<%--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.---%>++<% org.apache.solr.core.CoreContainer cores = (org.apache.solr.core.CoreContainer)request.getAttribute("org.apache.solr.CoreContainer"); %><html><head>-<link rel="stylesheet" type="text/css" href="solr-admin.css">-<link rel="icon" href="favicon.ico" type="image/ico"></link>-<link rel="shortcut icon" href="favicon.ico" type="image/ico"></link>-<title>Welcome to Solr</title>++ <title>solr-admin</title>++ <link rel="stylesheet" type="text/css" href="css/screen.css">+ <link rel="icon" type="image/ico" href="img/favicon.ico">++ <script type="text/javascript">++ var app_config = {};++ app_config.solr_path = '<%= request.getContextPath() %>';+ app_config.core_admin_path = '<%= cores.getAdminPath() %>';+ app_config.zookeeper_path = 'zookeeper.jsp';++ </script>+</head>-<body>-<h1>Welcome to Solr!</h1>-<a href="."><img border="0" align="right" height="78" width="142" src="admin/solr_small.png" alt="Solr"/></a>--<%- org.apache.solr.core.CoreContainer cores = (org.apache.solr.core.CoreContainer)request.getAttribute("org.apache.solr.CoreContainer");- Collection<SolrCore> solrCores = cores.getCores();- if( cores != null- && solrCores.size() > 0 // HACK! check that we have valid names...- && solrCores.iterator().next().getName().length() != 0 ) {- for( org.apache.solr.core.SolrCore core : cores.getCores() ) {- String coreName = core.getName();- if("".equals(coreName) ) coreName =".";-%>-<a href="<%= coreName %>/admin/">Admin <%= core.getName() %></a>-<br/>-<% }} else { %>-<a href="admin/">Solr Admin</a>-<% } %>++ <div id="wrapper">++ <div id="header">++ <a href="./"><span>Apache SOLR</span></a>++ <p id="environment"> </p>++ </div>++<div>+ NOTE: This interface is work in progress. It works best in Chrome.+ Use <a href="admin" style="color:blue;">the old admin interface</a> if there are problems with this one.+ <a style="color:blue;" href="https://issues.apache.org/jira/browse/SOLR-2399">SOLR-2399</a>+</div>++ <div id="main" class="clearfix">++ <div id="content-wrapper">+ <div id="content">++ ++ </div>+ </div>++ <div id="menu-wrapper">+ <div id="menu">++ <ul>++ <li id="index" class="global">+ <p><a href="#/">Dashboard</a></p>+ </li>++ <li id="logging" class="global">+ <p><a href="#/logging">Logging</a></p>+ </li>++ <li id="cloud" class="global optional">+ <p><a href="#/cloud">Cloud</a></p>+ </li>++ <li id="cores" class="global optional">+ <p><a href="#/cores">Core Admin</a></p>+ </li>++ <li id="java-properties" class="global">+ <p><a href="#/java-properties">Java Properties</a>+ </li>+ <li id="threads" class="global">+ <p><a href="#/threads">Thread Dump</a></p>+ </li>++ </ul>++ </div>+ </div>++ <div id="meta">++ <ul>++ <li class="documentation"><a href="http://lucene.apache.org/solr/"><span>Documentation</span></a></li>+ <li class="issues"><a href="http://issues.apache.org/jira/browse/SOLR"><span>Issue Tracker</span></a></li>+ <li class="irc"><a href="http://webchat.freenode.net/?channels=#solr"><span>IRC Channel</span></a></li>+ <li class="mailinglist"><a href="http://wiki.apache.org/solr/UsingMailingLists"><span>Community forum</span></a></li>+ <li class="wiki-query-syntax"><a href="http://wiki.apache.org/solr/SolrQuerySyntax"><span>Solr Query Syntax</span></a></li>++ </ul>++ </div>++ </div>++ </div>++ <script type="text/javascript" src="js/0_console.js"></script>+ <script type="text/javascript" src="js/1_jquery.js"></script>+ <script type="text/javascript" src="js/jquery.timeago.js"></script>+ <script type="text/javascript" src="js/jquery.form.js"></script>+ <script type="text/javascript" src="js/jquery.sammy.js"></script>+ <script type="text/javascript" src="js/jquery.sparkline.js"></script>+ <script type="text/javascript" src="js/jquery.jstree.js"></script>+ <script type="text/javascript" src="js/highlight.js"></script>+ <script type="text/javascript" src="js/script.js"></script>+</body>-</html>+</html>\ No newline at end of filediff --git a/solr/src/webapp/web/js/0_console.js b/solr/src/webapp/web/js/0_console.jsnew file mode 100644index 00000000000..8b2dd7382eb--- /dev/null+++ b/solr/src/webapp/web/js/0_console.js@@ -0,0 +1,10 @@+if( 'undefined' === typeof( console ) )+{+ var console = {+ log : function() {},+ debug : function() {},+ dump : function() {},+ error : function() {},+ warn : function(){}+ };+}\ No newline at end of filediff --git a/solr/src/webapp/web/js/1_jquery.js b/solr/src/webapp/web/js/1_jquery.jsnew file mode 100644index 00000000000..5d5a1d58ee5--- /dev/null+++ b/solr/src/webapp/web/js/1_jquery.js@@ -0,0 +1,8936 @@+/*!+ * 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( window, undefined ) {++// Use the correct document accordingly with window argument (sandbox)+var document = window.document,+ navigator = window.navigator,+ location = window.location;+var jQuery = (function() {++// Define a local copy of jQuery+var jQuery = function( selector, context ) {+ // The jQuery object is actually just the init constructor 'enhanced'+ return new jQuery.fn.init( selector, context, rootjQuery );+ },++ // Map over jQuery in case of overwrite+ _jQuery = window.jQuery,++ // Map over the $ in case of overwrite+ _$ = window.$,++ // A central reference to the root jQuery(document)+ rootjQuery,++ // A simple way to check for HTML strings or ID strings+ // (both of which we optimize for)+ quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,++ // Check if a string has a non-whitespace character in it+ rnotwhite = /\S/,++ // Used for trimming whitespace+ trimLeft = /^\s+/,+ trimRight = /\s+$/,++ // Check for digits+ rdigit = /\d/,++ // Match a standalone tag+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,++ // JSON RegExp+ rvalidchars = /^[\],:{}\s]*$/,+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,++ // Useragent RegExp+ rwebkit = /(webkit)[ \/]([\w.]+)/,+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,+ rmsie = /(msie) ([\w.]+)/,+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,++ // Keep a UserAgent string for use with jQuery.browser+ userAgent = navigator.userAgent,++ // For matching the engine and version of the browser+ browserMatch,++ // The deferred used on DOM ready+ readyList,++ // The ready event handler+ DOMContentLoaded,++ // Save a reference to some core methods+ toString = Object.prototype.toString,+ hasOwn = Object.prototype.hasOwnProperty,+ push = Array.prototype.push,+ slice = Array.prototype.slice,+ trim = String.prototype.trim,+ indexOf = Array.prototype.indexOf,++ // [[Class]] -> type pairs+ class2type = {};++jQuery.fn = jQuery.prototype = {+ constructor: jQuery,+ init: function( selector, context, rootjQuery ) {+ var match, elem, ret, doc;++ // Handle $(""), $(null), or $(undefined)+ if ( !selector ) {+ return this;+ }++ // Handle $(DOMElement)+ if ( selector.nodeType ) {+ this.context = this[0] = selector;+ this.length = 1;+ return this;+ }++ // The body element only exists once, optimize finding it+ if ( selector === "body" && !context && document.body ) {+ this.context = document;+ this[0] = document.body;+ this.selector = selector;+ this.length = 1;+ return this;+ }++ // Handle HTML strings+ if ( typeof selector === "string" ) {+ // Are we dealing with HTML string or an ID?+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {+ // Assume that strings that start and end with <> are HTML and skip the regex check+ match = [ null, selector, null ];++ } else {+ match = quickExpr.exec( selector );+ }++ // Verify a match, and that no context was specified for #id+ if ( match && (match[1] || !context) ) {++ // HANDLE: $(html) -> $(array)+ if ( match[1] ) {+ context = context instanceof jQuery ? context[0] : context;+ doc = (context ? context.ownerDocument || context : document);++ // If a single string is passed in and it's a single tag+ // just do a createElement and skip the rest+ ret = rsingleTag.exec( selector );++ if ( ret ) {+ if ( jQuery.isPlainObject( context ) ) {+ selector = [ document.createElement( ret[1] ) ];+ jQuery.fn.attr.call( selector, context, true );++ } else {+ selector = [ doc.createElement( ret[1] ) ];+ }++ } else {+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );+ selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;+ }++ return jQuery.merge( this, selector );++ // HANDLE: $("#id")+ } else {+ elem = document.getElementById( match[2] );++ // Check parentNode to catch when Blackberry 4.6 returns+ // nodes that are no longer in the document #6963+ if ( elem && elem.parentNode ) {+ // Handle the case where IE and Opera return items+ // by name instead of ID+ if ( elem.id !== match[2] ) {+ return rootjQuery.find( selector );+ }++ // Otherwise, we inject the element directly into the jQuery object+ this.length = 1;+ this[0] = elem;+ }++ this.context = document;+ this.selector = selector;+ return this;+ }++ // HANDLE: $(expr, $(...))+ } else if ( !context || context.jquery ) {+ return (context || rootjQuery).find( selector );++ // HANDLE: $(expr, context)+ // (which is just equivalent to: $(context).find(expr)+ } else {+ return this.constructor( context ).find( selector );+ }++ // HANDLE: $(function)+ // Shortcut for document ready+ } else if ( jQuery.isFunction( selector ) ) {+ return rootjQuery.ready( selector );+ }++ if (selector.selector !== undefined) {+ this.selector = selector.selector;+ this.context = selector.context;+ }++ return jQuery.makeArray( selector, this );+ },++ // Start with an empty selector+ selector: "",++ // The current version of jQuery being used+ jquery: "1.6.1",++ // The default length of a jQuery object is 0+ length: 0,++ // The number of elements contained in the matched element set+ size: function() {+ return this.length;+ },++ toArray: function() {+ return slice.call( this, 0 );+ },++ // Get the Nth element in the matched element set OR+ // Get the whole matched element set as a clean array+ get: function( num ) {+ return num == null ?++ // Return a 'clean' array+ this.toArray() :++ // Return just the object+ ( num < 0 ? this[ this.length + num ] : this[ num ] );+ },++ // Take an array of elements and push it onto the stack+ // (returning the new matched element set)+ pushStack: function( elems, name, selector ) {+ // Build a new jQuery matched element set+ var ret = this.constructor();++ if ( jQuery.isArray( elems ) ) {+ push.apply( ret, elems );++ } else {+ jQuery.merge( ret, elems );+ }++ // Add the old object onto the stack (as a reference)+ ret.prevObject = this;++ ret.context = this.context;++ if ( name === "find" ) {+ ret.selector = this.selector + (this.selector ? " " : "") + selector;+ } else if ( name ) {+ ret.selector = this.selector + "." + name + "(" + selector + ")";+ }++ // Return the newly-formed element set+ return ret;+ },++ // Execute a callback for every element in the matched set.+ // (You can seed the arguments with an array of args, but this is+ // only used internally.)+ each: function( callback, args ) {+ return jQuery.each( this, callback, args );+ },++ ready: function( fn ) {+ // Attach the listeners+ jQuery.bindReady();++ // Add the callback+ readyList.done( fn );++ return this;+ },++ eq: function( i ) {+ return i === -1 ?+ this.slice( i ) :+ this.slice( i, +i + 1 );+ },++ first: function() {+ return this.eq( 0 );+ },++ last: function() {+ return this.eq( -1 );+ },++ slice: function() {+ return this.pushStack( slice.apply( this, arguments ),+ "slice", slice.call(arguments).join(",") );+ },++ map: function( callback ) {+ return this.pushStack( jQuery.map(this, function( elem, i ) {+ return callback.call( elem, i, elem );+ }));+ },++ end: function() {+ return this.prevObject || this.constructor(null);+ },++ // For internal use only.+ // Behaves like an Array's method, not like a jQuery method.+ push: push,+ sort: [].sort,+ splice: [].splice+};++// Give the init function the jQuery prototype for later instantiation+jQuery.fn.init.prototype = jQuery.fn;++jQuery.extend = jQuery.fn.extend = function() {+ var options, name, src, copy, copyIsArray, clone,+ target = arguments[0] || {},+ i = 1,+ length = arguments.length,+ deep = false;++ // Handle a deep copy situation+ if ( typeof target === "boolean" ) {+ deep = target;+ target = arguments[1] || {};+ // skip the boolean and the target+ i = 2;+ }++ // Handle case when target is a string or something (possible in deep copy)+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {+ target = {};+ }++ // extend jQuery itself if only one argument is passed+ if ( length === i ) {+ target = this;+ --i;+ }++ for ( ; i < length; i++ ) {+ // Only deal with non-null/undefined values+ if ( (options = arguments[ i ]) != null ) {+ // Extend the base object+ for ( name in options ) {+ src = target[ name ];+ copy = options[ name ];++ // Prevent never-ending loop+ if ( target === copy ) {+ continue;+ }++ // Recurse if we're merging plain objects or arrays+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {+ if ( copyIsArray ) {+ copyIsArray = false;+ clone = src && jQuery.isArray(src) ? src : [];++ } else {+ clone = src && jQuery.isPlainObject(src) ? src : {};+ }++ // Never move original objects, clone them+ target[ name ] = jQuery.extend( deep, clone, copy );++ // Don't bring in undefined values+ } else if ( copy !== undefined ) {+ target[ name ] = copy;+ }+ }+ }+ }++ // Return the modified object+ return target;+};++jQuery.extend({+ noConflict: function( deep ) {+ if ( window.$ === jQuery ) {+ window.$ = _$;+ }++ if ( deep && window.jQuery === jQuery ) {+ window.jQuery = _jQuery;+ }++ return jQuery;+ },++ // Is the DOM ready to be used? Set to true once it occurs.+ isReady: false,++ // A counter to track how many items to wait for before+ // the ready event fires. See #6781+ readyWait: 1,++ // Hold (or release) the ready event+ holdReady: function( hold ) {+ if ( hold ) {+ jQuery.readyWait++;+ } else {+ jQuery.ready( true );+ }+ },++ // Handle when the DOM is ready+ ready: function( wait ) {+ // Either a released hold or an DOMready/load event and not yet ready+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).+ if ( !document.body ) {+ return setTimeout( jQuery.ready, 1 );+ }++ // Remember that the DOM is ready+ jQuery.isReady = true;++ // If a normal DOM Ready event fired, decrement, and wait if need be+ if ( wait !== true && --jQuery.readyWait > 0 ) {+ return;+ }++ // If there are functions bound, to execute+ readyList.resolveWith( document, [ jQuery ] );++ // Trigger any bound ready events+ if ( jQuery.fn.trigger ) {+ jQuery( document ).trigger( "ready" ).unbind( "ready" );+ }+ }+ },++ bindReady: function() {+ if ( readyList ) {+ return;+ }++ readyList = jQuery._Deferred();++ // Catch cases where $(document).ready() is called after the+ // browser event has already occurred.+ if ( document.readyState === "complete" ) {+ // Handle it asynchronously to allow scripts the opportunity to delay ready+ return setTimeout( jQuery.ready, 1 );+ }++ // Mozilla, Opera and webkit nightlies currently support this event+ if ( document.addEventListener ) {+ // Use the handy event callback+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );++ // A fallback to window.onload, that will always work+ window.addEventListener( "load", jQuery.ready, false );++ // If IE event model is used+ } else if ( document.attachEvent ) {+ // ensure firing before onload,+ // maybe late but safe also for iframes+ document.attachEvent( "onreadystatechange", DOMContentLoaded );++ // A fallback to window.onload, that will always work+ window.attachEvent( "onload", jQuery.ready );++ // If IE and not a frame+ // continually check to see if the document is ready+ var toplevel = false;++ try {+ toplevel = window.frameElement == null;+ } catch(e) {}++ if ( document.documentElement.doScroll && toplevel ) {+ doScrollCheck();+ }+ }+ },++ // See test/unit/core.js for details concerning isFunction.+ // Since version 1.3, DOM methods and functions like alert+ // aren't supported. They return false on IE (#2968).+ isFunction: function( obj ) {+ return jQuery.type(obj) === "function";+ },++ isArray: Array.isArray || function( obj ) {+ return jQuery.type(obj) === "array";+ },++ // A crude way of determining if an object is a window+ isWindow: function( obj ) {+ return obj && typeof obj === "object" && "setInterval" in obj;+ },++ isNaN: function( obj ) {+ return obj == null || !rdigit.test( obj ) || isNaN( obj );+ },++ type: function( obj ) {+ return obj == null ?+ String( obj ) :+ class2type[ toString.call(obj) ] || "object";+ },++ isPlainObject: function( obj ) {+ // Must be an Object.+ // Because of IE, we also have to check the presence of the constructor property.+ // Make sure that DOM nodes and window objects don't pass through, as well+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {+ return false;+ }++ // Not own constructor property must be Object+ if ( obj.constructor &&+ !hasOwn.call(obj, "constructor") &&+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {+ return false;+ }++ // Own properties are enumerated firstly, so to speed up,+ // if last one is own, then all properties are own.++ var key;+ for ( key in obj ) {}++ return key === undefined || hasOwn.call( obj, key );+ },++ isEmptyObject: function( obj ) {+ for ( var name in obj ) {+ return false;+ }+ return true;+ },++ error: function( msg ) {+ throw msg;+ },++ parseJSON: function( data ) {+ if ( typeof data !== "string" || !data ) {+ return null;+ }++ // Make sure leading/trailing whitespace is removed (IE can't handle it)+ data = jQuery.trim( data );++ // Attempt to parse using the native JSON parser first+ if ( window.JSON && window.JSON.parse ) {+ return window.JSON.parse( data );+ }++ // Make sure the incoming data is actual JSON+ // Logic borrowed from http://json.org/json2.js+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )+ .replace( rvalidtokens, "]" )+ .replace( rvalidbraces, "")) ) {++ return (new Function( "return " + data ))();++ }+ jQuery.error( "Invalid JSON: " + data );+ },++ // Cross-browser xml parsing+ // (xml & tmp used internally)+ parseXML: function( data , xml , tmp ) {++ if ( window.DOMParser ) { // Standard+ tmp = new DOMParser();+ xml = tmp.parseFromString( data , "text/xml" );+ } else { // IE+ xml = new ActiveXObject( "Microsoft.XMLDOM" );+ xml.async = "false";+ xml.loadXML( data );+ }++ tmp = xml.documentElement;++ if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {+ jQuery.error( "Invalid XML: " + data );+ }++ return xml;+ },++ noop: function() {},++ // Evaluates a script in a global context+ // Workarounds based on findings by Jim Driscoll+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context+ globalEval: function( data ) {+ if ( data && rnotwhite.test( data ) ) {+ // We use execScript on Internet Explorer+ // We use an anonymous function so that context is window+ // rather than jQuery in Firefox+ ( window.execScript || function( data ) {+ window[ "eval" ].call( window, data );+ } )( data );+ }+ },++ nodeName: function( elem, name ) {+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();+ },++ // args is for internal usage only+ each: function( object, callback, args ) {+ var name, i = 0,+ length = object.length,+ isObj = length === undefined || jQuery.isFunction( object );++ if ( args ) {+ if ( isObj ) {+ for ( name in object ) {+ if ( callback.apply( object[ name ], args ) === false ) {+ break;+ }+ }+ } else {+ for ( ; i < length; ) {+ if ( callback.apply( object[ i++ ], args ) === false ) {+ break;+ }+ }+ }++ // A special, fast, case for the most common use of each+ } else {+ if ( isObj ) {+ for ( name in object ) {+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {+ break;+ }+ }+ } else {+ for ( ; i < length; ) {+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {+ break;+ }+ }+ }+ }++ return object;+ },++ // Use native String.trim function wherever possible+ trim: trim ?+ function( text ) {+ return text == null ?+ "" :+ trim.call( text );+ } :++ // Otherwise use our own trimming functionality+ function( text ) {+ return text == null ?+ "" :+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );+ },++ // results is for internal usage only+ makeArray: function( array, results ) {+ var ret = results || [];++ if ( array != null ) {+ // The window, strings (and functions) also have 'length'+ // The extra typeof function check is to prevent crashes+ // in Safari 2 (See: #3039)+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930+ var type = jQuery.type( array );++ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {+ push.call( ret, array );+ } else {+ jQuery.merge( ret, array );+ }+ }++ return ret;+ },++ inArray: function( elem, array ) {++ if ( indexOf ) {+ return indexOf.call( array, elem );+ }++ for ( var i = 0, length = array.length; i < length; i++ ) {+ if ( array[ i ] === elem ) {+ return i;+ }+ }++ return -1;+ },++ merge: function( first, second ) {+ var i = first.length,+ j = 0;++ if ( typeof second.length === "number" ) {+ for ( var l = second.length; j < l; j++ ) {+ first[ i++ ] = second[ j ];+ }++ } else {+ while ( second[j] !== undefined ) {+ first[ i++ ] = second[ j++ ];+ }+ }++ first.length = i;++ return first;+ },++ grep: function( elems, callback, inv ) {+ var ret = [], retVal;+ inv = !!inv;++ // Go through the array, only saving the items+ // that pass the validator function+ for ( var i = 0, length = elems.length; i < length; i++ ) {+ retVal = !!callback( elems[ i ], i );+ if ( inv !== retVal ) {+ ret.push( elems[ i ] );+ }+ }++ return ret;+ },++ // arg is for internal usage only+ map: function( elems, callback, arg ) {+ var value, key, ret = [],+ i = 0,+ length = elems.length,+ // jquery objects are treated as arrays+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;++ // Go through the array, translating each of the items to their+ if ( isArray ) {+ for ( ; i < length; i++ ) {+ value = callback( elems[ i ], i, arg );++ if ( value != null ) {+ ret[ ret.length ] = value;+ }+ }++ // Go through every key on the object,+ } else {+ for ( key in elems ) {+ value = callback( elems[ key ], key, arg );++ if ( value != null ) {+ ret[ ret.length ] = value;+ }+ }+ }++ // Flatten any nested arrays+ return ret.concat.apply( [], ret );+ },++ // A global GUID counter for objects+ guid: 1,++ // Bind a function to a context, optionally partially applying any+ // arguments.+ proxy: function( fn, context ) {+ if ( typeof context === "string" ) {+ var tmp = fn[ context ];+ context = fn;+ fn = tmp;+ }++ // Quick check to determine if target is callable, in the spec+ // this throws a TypeError, but we will just return undefined.+ if ( !jQuery.isFunction( fn ) ) {+ return undefined;+ }++ // Simulated bind+ var args = slice.call( arguments, 2 ),+ proxy = function() {+ return fn.apply( context, args.concat( slice.call( arguments ) ) );+ };++ // Set the guid of unique handler to the same of original handler, so it can be removed+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;++ return proxy;+ },++ // Mutifunctional method to get and set values to a collection+ // The value/s can be optionally by executed if its a function+ access: function( elems, key, value, exec, fn, pass ) {+ var length = elems.length;++ // Setting many attributes+ if ( typeof key === "object" ) {+ for ( var k in key ) {+ jQuery.access( elems, k, key[k], exec, fn, value );+ }+ return elems;+ }++ // Setting one attribute+ if ( value !== undefined ) {+ // Optionally, function values get executed if exec is true+ exec = !pass && exec && jQuery.isFunction(value);++ for ( var i = 0; i < length; i++ ) {+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );+ }++ return elems;+ }++ // Getting an attribute+ return length ? fn( elems[0], key ) : undefined;+ },++ now: function() {+ return (new Date()).getTime();+ },++ // Use of jQuery.browser is frowned upon.+ // More details: http://docs.jquery.com/Utilities/jQuery.browser+ uaMatch: function( ua ) {+ ua = ua.toLowerCase();++ var match = rwebkit.exec( ua ) ||+ ropera.exec( ua ) ||+ rmsie.exec( ua ) ||+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||+ [];++ return { browser: match[1] || "", version: match[2] || "0" };+ },++ sub: function() {+ function jQuerySub( selector, context ) {+ return new jQuerySub.fn.init( selector, context );+ }+ jQuery.extend( true, jQuerySub, this );+ jQuerySub.superclass = this;+ jQuerySub.fn = jQuerySub.prototype = this();+ jQuerySub.fn.constructor = jQuerySub;+ jQuerySub.sub = this.sub;+ jQuerySub.fn.init = function init( selector, context ) {+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {+ context = jQuerySub( context );+ }++ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );+ };+ jQuerySub.fn.init.prototype = jQuerySub.fn;+ var rootjQuerySub = jQuerySub(document);+ return jQuerySub;+ },++ browser: {}+});++// Populate the class2type map+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {+ class2type[ "[object " + name + "]" ] = name.toLowerCase();+});++browserMatch = jQuery.uaMatch( userAgent );+if ( browserMatch.browser ) {+ jQuery.browser[ browserMatch.browser ] = true;+ jQuery.browser.version = browserMatch.version;+}++// Deprecated, use jQuery.browser.webkit instead+if ( jQuery.browser.webkit ) {+ jQuery.browser.safari = true;+}++// IE doesn't match non-breaking spaces with \s+if ( rnotwhite.test( "\xA0" ) ) {+ trimLeft = /^[\s\xA0]+/;+ trimRight = /[\s\xA0]+$/;+}++// All jQuery objects should point back to these+rootjQuery = jQuery(document);++// Cleanup functions for the document ready method+if ( document.addEventListener ) {+ DOMContentLoaded = function() {+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );+ jQuery.ready();+ };++} else if ( document.attachEvent ) {+ DOMContentLoaded = function() {+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).+ if ( document.readyState === "complete" ) {+ document.detachEvent( "onreadystatechange", DOMContentLoaded );+ jQuery.ready();+ }+ };+}++// The DOM ready check for Internet Explorer+function doScrollCheck() {+ if ( jQuery.isReady ) {+ return;+ }++ try {+ // If IE is used, use the trick by Diego Perini+ // http://javascript.nwbox.com/IEContentLoaded/+ document.documentElement.doScroll("left");+ } catch(e) {+ setTimeout( doScrollCheck, 1 );+ return;+ }++ // and execute any waiting functions+ jQuery.ready();+}++// Expose jQuery to the global object+return jQuery;++})();+++var // Promise methods+ promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),+ // Static reference to slice+ sliceDeferred = [].slice;++jQuery.extend({+ // Create a simple deferred (one callbacks list)+ _Deferred: function() {+ var // callbacks list+ callbacks = [],+ // stored [ context , args ]+ fired,+ // to avoid firing when already doing so+ firing,+ // flag to know if the deferred has been cancelled+ cancelled,+ // the deferred itself+ deferred = {++ // done( f1, f2, ...)+ done: function() {+ if ( !cancelled ) {+ var args = arguments,+ i,+ length,+ elem,+ type,+ _fired;+ if ( fired ) {+ _fired = fired;+ fired = 0;+ }+ for ( i = 0, length = args.length; i < length; i++ ) {+ elem = args[ i ];+ type = jQuery.type( elem );+ if ( type === "array" ) {+ deferred.done.apply( deferred, elem );+ } else if ( type === "function" ) {+ callbacks.push( elem );+ }+ }+ if ( _fired ) {+ deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );+ }+ }+ return this;+ },++ // resolve with given context and args+ resolveWith: function( context, args ) {+ if ( !cancelled && !fired && !firing ) {+ // make sure args are available (#8421)+ args = args || [];+ firing = 1;+ try {+ while( callbacks[ 0 ] ) {+ callbacks.shift().apply( context, args );+ }+ }+ finally {+ fired = [ context, args ];+ firing = 0;+ }+ }+ return this;+ },++ // resolve with this as context and given arguments+ resolve: function() {+ deferred.resolveWith( this, arguments );+ return this;+ },++ // Has this deferred been resolved?+ isResolved: function() {+ return !!( firing || fired );+ },++ // Cancel+ cancel: function() {+ cancelled = 1;+ callbacks = [];+ return this;+ }+ };++ return deferred;+ },++ // Full fledged deferred (two callbacks list)+ Deferred: function( func ) {+ var deferred = jQuery._Deferred(),+ failDeferred = jQuery._Deferred(),+ promise;+ // Add errorDeferred methods, then and promise+ jQuery.extend( deferred, {+ then: function( doneCallbacks, failCallbacks ) {+ deferred.done( doneCallbacks ).fail( failCallbacks );+ return this;+ },+ always: function() {+ return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );+ },+ fail: failDeferred.done,+ rejectWith: failDeferred.resolveWith,+ reject: failDeferred.resolve,+ isRejected: failDeferred.isResolved,+ pipe: function( fnDone, fnFail ) {+ return jQuery.Deferred(function( newDefer ) {+ jQuery.each( {+ done: [ fnDone, "resolve" ],+ fail: [ fnFail, "reject" ]+ }, function( handler, data ) {+ var fn = data[ 0 ],+ action = data[ 1 ],+ returned;+ if ( jQuery.isFunction( fn ) ) {+ deferred[ handler ](function() {+ returned = fn.apply( this, arguments );+ if ( returned && jQuery.isFunction( returned.promise ) ) {+ returned.promise().then( newDefer.resolve, newDefer.reject );+ } else {+ newDefer[ action ]( returned );+ }+ });+ } else {+ deferred[ handler ]( newDefer[ action ] );+ }+ });+ }).promise();+ },+ // Get a promise for this deferred+ // If obj is provided, the promise aspect is added to the object+ promise: function( obj ) {+ if ( obj == null ) {+ if ( promise ) {+ return promise;+ }+ promise = obj = {};+ }+ var i = promiseMethods.length;+ while( i-- ) {+ obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];+ }+ return obj;+ }+ });+ // Make sure only one callback list will be used+ deferred.done( failDeferred.cancel ).fail( deferred.cancel );+ // Unexpose cancel+ delete deferred.cancel;+ // Call given func if any+ if ( func ) {+ func.call( deferred, deferred );+ }+ return deferred;+ },++ // Deferred helper+ when: function( firstParam ) {+ var args = arguments,+ i = 0,+ length = args.length,+ count = length,+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?+ firstParam :+ jQuery.Deferred();+ function resolveFunc( i ) {+ return function( value ) {+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;+ if ( !( --count ) ) {+ // Strange bug in FF4:+ // Values changed onto the arguments object sometimes end up as undefined values+ // outside the $.when method. Cloning the object into a fresh array solves the issue+ deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );+ }+ };+ }+ if ( length > 1 ) {+ for( ; i < length; i++ ) {+ if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {+ args[ i ].promise().then( resolveFunc(i), deferred.reject );+ } else {+ --count;+ }+ }+ if ( !count ) {+ deferred.resolveWith( deferred, args );+ }+ } else if ( deferred !== firstParam ) {+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );+ }+ return deferred.promise();+ }+});++++jQuery.support = (function() {++ var div = document.createElement( "div" ),+ documentElement = document.documentElement,+ all,+ a,+ select,+ opt,+ input,+ marginDiv,+ support,+ fragment,+ body,+ bodyStyle,+ tds,+ events,+ eventName,+ i,+ isSupported;++ // Preliminary tests+ div.setAttribute("className", "t");+ div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";++ all = div.getElementsByTagName( "*" );+ a = div.getElementsByTagName( "a" )[ 0 ];++ // Can't get basic test support+ if ( !all || !all.length || !a ) {+ return {};+ }++ // First batch of supports tests+ select = document.createElement( "select" );+ opt = select.appendChild( document.createElement("option") );+ input = div.getElementsByTagName( "input" )[ 0 ];++ support = {+ // IE strips leading whitespace when .innerHTML is used+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),++ // Make sure that tbody elements aren't automatically inserted+ // IE will insert them into empty tables+ tbody: !div.getElementsByTagName( "tbody" ).length,++ // Make sure that link elements get serialized correctly by innerHTML+ // This requires a wrapper element in IE+ htmlSerialize: !!div.getElementsByTagName( "link" ).length,++ // Get the style information from getAttribute+ // (IE uses .cssText instead)+ style: /top/.test( a.getAttribute("style") ),++ // Make sure that URLs aren't manipulated+ // (IE normalizes it by default)+ hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),++ // Make sure that element opacity exists+ // (IE uses filter instead)+ // Use a regex to work around a WebKit issue. See #5145+ opacity: /^0.55$/.test( a.style.opacity ),++ // Verify style float existence+ // (IE uses styleFloat instead of cssFloat)+ cssFloat: !!a.style.cssFloat,++ // Make sure that if no value is specified for a checkbox+ // that it defaults to "on".+ // (WebKit defaults to "" instead)+ checkOn: ( input.value === "on" ),++ // Make sure that a selected-by-default option has a working selected property.+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)+ optSelected: opt.selected,++ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)+ getSetAttribute: div.className !== "t",++ // Will be defined later+ submitBubbles: true,+ changeBubbles: true,+ focusinBubbles: false,+ deleteExpando: true,+ noCloneEvent: true,+ inlineBlockNeedsLayout: false,+ shrinkWrapBlocks: false,+ reliableMarginRight: true+ };++ // Make sure checked status is properly cloned+ input.checked = true;+ support.noCloneChecked = input.cloneNode( true ).checked;++ // Make sure that the options inside disabled selects aren't marked as disabled+ // (WebKit marks them as disabled)+ select.disabled = true;+ support.optDisabled = !opt.disabled;++ // Test to see if it's possible to delete an expando from an element+ // Fails in Internet Explorer+ try {+ delete div.test;+ } catch( e ) {+ support.deleteExpando = false;+ }++ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {+ div.attachEvent( "onclick", function click() {+ // Cloning a node shouldn't copy over any+ // bound event handlers (IE does this)+ support.noCloneEvent = false;+ div.detachEvent( "onclick", click );+ });+ div.cloneNode( true ).fireEvent( "onclick" );+ }++ // Check if a radio maintains it's value+ // after being appended to the DOM+ input = document.createElement("input");+ input.value = "t";+ input.setAttribute("type", "radio");+ support.radioValue = input.value === "t";++ input.setAttribute("checked", "checked");+ div.appendChild( input );+ fragment = document.createDocumentFragment();+ fragment.appendChild( div.firstChild );++ // WebKit doesn't clone checked state correctly in fragments+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;++ div.innerHTML = "";++ // Figure out if the W3C box model works as expected+ div.style.width = div.style.paddingLeft = "1px";++ // We use our own, invisible, body+ body = document.createElement( "body" );+ bodyStyle = {+ visibility: "hidden",+ width: 0,+ height: 0,+ border: 0,+ margin: 0,+ // Set background to avoid IE crashes when removing (#9028)+ background: "none"+ };+ for ( i in bodyStyle ) {+ body.style[ i ] = bodyStyle[ i ];+ }+ body.appendChild( div );+ documentElement.insertBefore( body, documentElement.firstChild );++ // Check if a disconnected checkbox will retain its checked+ // value of true after appended to the DOM (IE6/7)+ support.appendChecked = input.checked;++ support.boxModel = div.offsetWidth === 2;++ if ( "zoom" in div.style ) {+ // Check if natively block-level elements act like inline-block+ // elements when setting their display to 'inline' and giving+ // them layout+ // (IE < 8 does this)+ div.style.display = "inline";+ div.style.zoom = 1;+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );++ // Check if elements with layout shrink-wrap their children+ // (IE 6 does this)+ div.style.display = "";+ div.innerHTML = "<div style='width:4px;'></div>";+ support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );+ }++ div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";+ tds = div.getElementsByTagName( "td" );++ // Check if table cells still have offsetWidth/Height when they are set+ // to display:none and there are still other visible table cells in a+ // table row; if so, offsetWidth/Height are not reliable for use when+ // determining if an element has been hidden directly using+ // display:none (it is still safe to use offsets if a parent element is+ // hidden; don safety goggles and see bug #4512 for more information).+ // (only IE 8 fails this test)+ isSupported = ( tds[ 0 ].offsetHeight === 0 );++ tds[ 0 ].style.display = "";+ tds[ 1 ].style.display = "none";++ // Check if empty table cells still have offsetWidth/Height+ // (IE < 8 fail this test)+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );+ div.innerHTML = "";++ // Check if div with explicit width and no margin-right incorrectly+ // gets computed margin-right based on width of container. For more+ // info see bug #3333+ // Fails in WebKit before Feb 2011 nightlies+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right+ if ( document.defaultView && document.defaultView.getComputedStyle ) {+ marginDiv = document.createElement( "div" );+ marginDiv.style.width = "0";+ marginDiv.style.marginRight = "0";+ div.appendChild( marginDiv );+ support.reliableMarginRight =+ ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;+ }++ // Remove the body element we added+ body.innerHTML = "";+ documentElement.removeChild( body );++ // Technique from Juriy Zaytsev+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/+ // We only care about the case where non-standard event systems+ // are used, namely in IE. Short-circuiting here helps us to+ // avoid an eval call (in setAttribute) which can cause CSP+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP+ if ( div.attachEvent ) {+ for( i in {+ submit: 1,+ change: 1,+ focusin: 1+ } ) {+ eventName = "on" + i;+ isSupported = ( eventName in div );+ if ( !isSupported ) {+ div.setAttribute( eventName, "return;" );+ isSupported = ( typeof div[ eventName ] === "function" );+ }+ support[ i + "Bubbles" ] = isSupported;+ }+ }++ return support;+})();++// Keep track of boxModel+jQuery.boxModel = jQuery.support.boxModel;+++++var rbrace = /^(?:\{.*\}|\[.*\])$/,+ rmultiDash = /([a-z])([A-Z])/g;++jQuery.extend({+ cache: {},++ // Please use with caution+ uuid: 0,++ // Unique for each copy of jQuery on the page+ // Non-digits removed to match rinlinejQuery+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),++ // The following elements throw uncatchable exceptions if you+ // attempt to add expando properties to them.+ noData: {+ "embed": true,+ // Ban all objects except for Flash (which handle expandos)+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",+ "applet": true+ },++ hasData: function( elem ) {+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];++ return !!elem && !isEmptyDataObject( elem );+ },++ data: function( elem, name, data, pvt /* Internal Use Only */ ) {+ if ( !jQuery.acceptData( elem ) ) {+ return;+ }++ var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,++ // We have to handle DOM nodes and JS objects differently because IE6-7+ // can't GC object references properly across the DOM-JS boundary+ isNode = elem.nodeType,++ // Only DOM nodes need the global jQuery cache; JS object data is+ // attached directly to the object so GC can occur automatically+ cache = isNode ? jQuery.cache : elem,++ // Only defining an ID for JS objects if its cache already exists allows+ // the code to shortcut on the same path as a DOM node with no cache+ id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;++ // Avoid doing any more work than we need to when trying to get data on an+ // object that has no data at all+ if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {+ return;+ }++ if ( !id ) {+ // Only DOM nodes need a new unique ID for each element since their data+ // ends up in the global cache+ if ( isNode ) {+ elem[ jQuery.expando ] = id = ++jQuery.uuid;+ } else {+ id = jQuery.expando;+ }+ }++ if ( !cache[ id ] ) {+ cache[ id ] = {};++ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery+ // metadata on plain JS objects when the object is serialized using+ // JSON.stringify+ if ( !isNode ) {+ cache[ id ].toJSON = jQuery.noop;+ }+ }++ // An object can be passed to jQuery.data instead of a key/value pair; this gets+ // shallow copied over onto the existing cache+ if ( typeof name === "object" || typeof name === "function" ) {+ if ( pvt ) {+ cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);+ } else {+ cache[ id ] = jQuery.extend(cache[ id ], name);+ }+ }++ thisCache = cache[ id ];++ // Internal jQuery data is stored in a separate object inside the object's data+ // cache in order to avoid key collisions between internal data and user-defined+ // data+ if ( pvt ) {+ if ( !thisCache[ internalKey ] ) {+ thisCache[ internalKey ] = {};+ }++ thisCache = thisCache[ internalKey ];+ }++ if ( data !== undefined ) {+ thisCache[ jQuery.camelCase( name ) ] = data;+ }++ // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should+ // not attempt to inspect the internal events object using jQuery.data, as this+ // internal data object is undocumented and subject to change.+ if ( name === "events" && !thisCache[name] ) {+ return thisCache[ internalKey ] && thisCache[ internalKey ].events;+ }++ return getByName ? thisCache[ jQuery.camelCase( name ) ] : thisCache;+ },++ removeData: function( elem, name, pvt /* Internal Use Only */ ) {+ if ( !jQuery.acceptData( elem ) ) {+ return;+ }++ var internalKey = jQuery.expando, isNode = elem.nodeType,++ // See jQuery.data for more information+ cache = isNode ? jQuery.cache : elem,++ // See jQuery.data for more information+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;++ // If there is already no cache entry for this object, there is no+ // purpose in continuing+ if ( !cache[ id ] ) {+ return;+ }++ if ( name ) {+ var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];++ if ( thisCache ) {+ delete thisCache[ name ];++ // If there is no data left in the cache, we want to continue+ // and let the cache object itself get destroyed+ if ( !isEmptyDataObject(thisCache) ) {+ return;+ }+ }+ }++ // See jQuery.data for more information+ if ( pvt ) {+ delete cache[ id ][ internalKey ];++ // Don't destroy the parent cache unless the internal data object+ // had been the only thing left in it+ if ( !isEmptyDataObject(cache[ id ]) ) {+ return;+ }+ }++ var internalCache = cache[ id ][ internalKey ];++ // Browsers that fail expando deletion also refuse to delete expandos on+ // the window, but it will allow it on all other JS objects; other browsers+ // don't care+ if ( jQuery.support.deleteExpando || cache != window ) {+ delete cache[ id ];+ } else {+ cache[ id ] = null;+ }++ // We destroyed the entire user cache at once because it's faster than+ // iterating through each key, but we need to continue to persist internal+ // data if it existed+ if ( internalCache ) {+ cache[ id ] = {};+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery+ // metadata on plain JS objects when the object is serialized using+ // JSON.stringify+ if ( !isNode ) {+ cache[ id ].toJSON = jQuery.noop;+ }++ cache[ id ][ internalKey ] = internalCache;++ // Otherwise, we need to eliminate the expando on the node to avoid+ // false lookups in the cache for entries that no longer exist+ } else if ( isNode ) {+ // IE does not allow us to delete expando properties from nodes,+ // nor does it have a removeAttribute function on Document nodes;+ // we must handle all of these cases+ if ( jQuery.support.deleteExpando ) {+ delete elem[ jQuery.expando ];+ } else if ( elem.removeAttribute ) {+ elem.removeAttribute( jQuery.expando );+ } else {+ elem[ jQuery.expando ] = null;+ }+ }+ },++ // For internal use only.+ _data: function( elem, name, data ) {+ return jQuery.data( elem, name, data, true );+ },++ // A method for determining if a DOM node can handle the data expando+ acceptData: function( elem ) {+ if ( elem.nodeName ) {+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];++ if ( match ) {+ return !(match === true || elem.getAttribute("classid") !== match);+ }+ }++ return true;+ }+});++jQuery.fn.extend({+ data: function( key, value ) {+ var data = null;++ if ( typeof key === "undefined" ) {+ if ( this.length ) {+ data = jQuery.data( this[0] );++ if ( this[0].nodeType === 1 ) {+ var attr = this[0].attributes, name;+ for ( var i = 0, l = attr.length; i < l; i++ ) {+ name = attr[i].name;++ if ( name.indexOf( "data-" ) === 0 ) {+ name = jQuery.camelCase( name.substring(5) );++ dataAttr( this[0], name, data[ name ] );+ }+ }+ }+ }++ return data;++ } else if ( typeof key === "object" ) {+ return this.each(function() {+ jQuery.data( this, key );+ });+ }++ var parts = key.split(".");+ parts[1] = parts[1] ? "." + parts[1] : "";++ if ( value === undefined ) {+ data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);++ // Try to fetch any internally stored data first+ if ( data === undefined && this.length ) {+ data = jQuery.data( this[0], key );+ data = dataAttr( this[0], key, data );+ }++ return data === undefined && parts[1] ?+ this.data( parts[0] ) :+ data;++ } else {+ return this.each(function() {+ var $this = jQuery( this ),+ args = [ parts[0], value ];++ $this.triggerHandler( "setData" + parts[1] + "!", args );+ jQuery.data( this, key, value );+ $this.triggerHandler( "changeData" + parts[1] + "!", args );+ });+ }+ },++ removeData: function( key ) {+ return this.each(function() {+ jQuery.removeData( this, key );+ });+ }+});++function dataAttr( elem, key, data ) {+ // If nothing was found internally, try to fetch any+ // data from the HTML5 data-* attribute+ if ( data === undefined && elem.nodeType === 1 ) {+ var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();++ data = elem.getAttribute( name );++ if ( typeof data === "string" ) {+ try {+ data = data === "true" ? true :+ data === "false" ? false :+ data === "null" ? null :+ !jQuery.isNaN( data ) ? parseFloat( data ) :+ rbrace.test( data ) ? jQuery.parseJSON( data ) :+ data;+ } catch( e ) {}++ // Make sure we set the data so it isn't changed later+ jQuery.data( elem, key, data );++ } else {+ data = undefined;+ }+ }++ return data;+}++// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON+// property to be considered empty objects; this property always exists in+// order to make sure JSON.stringify does not expose internal metadata+function isEmptyDataObject( obj ) {+ for ( var name in obj ) {+ if ( name !== "toJSON" ) {+ return false;+ }+ }++ return true;+}+++++function handleQueueMarkDefer( elem, type, src ) {+ var deferDataKey = type + "defer",+ queueDataKey = type + "queue",+ markDataKey = type + "mark",+ defer = jQuery.data( elem, deferDataKey, undefined, true );+ if ( defer &&+ ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&+ ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {+ // Give room for hard-coded callbacks to fire first+ // and eventually mark/queue something else on the element+ setTimeout( function() {+ if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&+ !jQuery.data( elem, markDataKey, undefined, true ) ) {+ jQuery.removeData( elem, deferDataKey, true );+ defer.resolve();+ }+ }, 0 );+ }+}++jQuery.extend({++ _mark: function( elem, type ) {+ if ( elem ) {+ type = (type || "fx") + "mark";+ jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );+ }+ },++ _unmark: function( force, elem, type ) {+ if ( force !== true ) {+ type = elem;+ elem = force;+ force = false;+ }+ if ( elem ) {+ type = type || "fx";+ var key = type + "mark",+ count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );+ if ( count ) {+ jQuery.data( elem, key, count, true );+ } else {+ jQuery.removeData( elem, key, true );+ handleQueueMarkDefer( elem, type, "mark" );+ }+ }+ },++ queue: function( elem, type, data ) {+ if ( elem ) {+ type = (type || "fx") + "queue";+ var q = jQuery.data( elem, type, undefined, true );+ // Speed up dequeue by getting out quickly if this is just a lookup+ if ( data ) {+ if ( !q || jQuery.isArray(data) ) {+ q = jQuery.data( elem, type, jQuery.makeArray(data), true );+ } else {+ q.push( data );+ }+ }+ return q || [];+ }+ },++ dequeue: function( elem, type ) {+ type = type || "fx";++ var queue = jQuery.queue( elem, type ),+ fn = queue.shift(),+ defer;++ // If the fx queue is dequeued, always remove the progress sentinel+ if ( fn === "inprogress" ) {+ fn = queue.shift();+ }++ if ( fn ) {+ // Add a progress sentinel to prevent the fx queue from being+ // automatically dequeued+ if ( type === "fx" ) {+ queue.unshift("inprogress");+ }++ fn.call(elem, function() {+ jQuery.dequeue(elem, type);+ });+ }++ if ( !queue.length ) {+ jQuery.removeData( elem, type + "queue", true );+ handleQueueMarkDefer( elem, type, "queue" );+ }+ }+});++jQuery.fn.extend({+ queue: function( type, data ) {+ if ( typeof type !== "string" ) {+ data = type;+ type = "fx";+ }++ if ( data === undefined ) {+ return jQuery.queue( this[0], type );+ }+ return this.each(function() {+ var queue = jQuery.queue( this, type, data );++ if ( type === "fx" && queue[0] !== "inprogress" ) {+ jQuery.dequeue( this, type );+ }+ });+ },+ dequeue: function( type ) {+ return this.each(function() {+ jQuery.dequeue( this, type );+ });+ },+ // Based off of the plugin by Clint Helfers, with permission.+ // http://blindsignals.com/index.php/2009/07/jquery-delay/+ delay: function( time, type ) {+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;+ type = type || "fx";++ return this.queue( type, function() {+ var elem = this;+ setTimeout(function() {+ jQuery.dequeue( elem, type );+ }, time );+ });+ },+ clearQueue: function( type ) {+ return this.queue( type || "fx", [] );+ },+ // Get a promise resolved when queues of a certain type+ // are emptied (fx is the type by default)+ promise: function( type, object ) {+ if ( typeof type !== "string" ) {+ object = type;+ type = undefined;+ }+ type = type || "fx";+ var defer = jQuery.Deferred(),+ elements = this,+ i = elements.length,+ count = 1,+ deferDataKey = type + "defer",+ queueDataKey = type + "queue",+ markDataKey = type + "mark",+ tmp;+ function resolve() {+ if ( !( --count ) ) {+ defer.resolveWith( elements, [ elements ] );+ }+ }+ while( i-- ) {+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&+ jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {+ count++;+ tmp.done( resolve );+ }+ }+ resolve();+ return defer.promise();+ }+});+++++var rclass = /[\n\t\r]/g,+ rspace = /\s+/,+ rreturn = /\r/g,+ rtype = /^(?:button|input)$/i,+ rfocusable = /^(?:button|input|object|select|textarea)$/i,+ rclickable = /^a(?:rea)?$/i,+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,+ rinvalidChar = /\:/,+ formHook, boolHook;++jQuery.fn.extend({+ attr: function( name, value ) {+ return jQuery.access( this, name, value, true, jQuery.attr );+ },++ removeAttr: function( name ) {+ return this.each(function() {+ jQuery.removeAttr( this, name );+ });+ },++ prop: function( name, value ) {+ return jQuery.access( this, name, value, true, jQuery.prop );+ },++ removeProp: function( name ) {+ name = jQuery.propFix[ name ] || name;+ return this.each(function() {+ // try/catch handles cases where IE balks (such as removing a property on window)+ try {+ this[ name ] = undefined;+ delete this[ name ];+ } catch( e ) {}+ });+ },++ addClass: function( value ) {+ if ( jQuery.isFunction( value ) ) {+ return this.each(function(i) {+ var self = jQuery(this);+ self.addClass( value.call(this, i, self.attr("class") || "") );+ });+ }++ if ( value && typeof value === "string" ) {+ var classNames = (value || "").split( rspace );++ for ( var i = 0, l = this.length; i < l; i++ ) {+ var elem = this[i];++ if ( elem.nodeType === 1 ) {+ if ( !elem.className ) {+ elem.className = value;++ } else {+ var className = " " + elem.className + " ",+ setClass = elem.className;++ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {+ if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {+ setClass += " " + classNames[c];+ }+ }+ elem.className = jQuery.trim( setClass );+ }+ }+ }+ }++ return this;+ },++ removeClass: function( value ) {+ if ( jQuery.isFunction(value) ) {+ return this.each(function(i) {+ var self = jQuery(this);+ self.removeClass( value.call(this, i, self.attr("class")) );+ });+ }++ if ( (value && typeof value === "string") || value === undefined ) {+ var classNames = (value || "").split( rspace );++ for ( var i = 0, l = this.length; i < l; i++ ) {+ var elem = this[i];++ if ( elem.nodeType === 1 && elem.className ) {+ if ( value ) {+ var className = (" " + elem.className + " ").replace(rclass, " ");+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {+ className = className.replace(" " + classNames[c] + " ", " ");+ }+ elem.className = jQuery.trim( className );++ } else {+ elem.className = "";+ }+ }+ }+ }++ return this;+ },++ toggleClass: function( value, stateVal ) {+ var type = typeof value,+ isBool = typeof stateVal === "boolean";++ if ( jQuery.isFunction( value ) ) {+ return this.each(function(i) {+ var self = jQuery(this);+ self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );+ });+ }++ return this.each(function() {+ if ( type === "string" ) {+ // toggle individual class names+ var className,+ i = 0,+ self = jQuery( this ),+ state = stateVal,+ classNames = value.split( rspace );++ while ( (className = classNames[ i++ ]) ) {+ // check each className given, space seperated list+ state = isBool ? state : !self.hasClass( className );+ self[ state ? "addClass" : "removeClass" ]( className );+ }++ } else if ( type === "undefined" || type === "boolean" ) {+ if ( this.className ) {+ // store className if set+ jQuery._data( this, "__className__", this.className );+ }++ // toggle whole className+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";+ }+ });+ },++ hasClass: function( selector ) {+ var className = " " + selector + " ";+ for ( var i = 0, l = this.length; i < l; i++ ) {+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {+ return true;+ }+ }++ return false;+ },++ val: function( value ) {+ var hooks, ret,+ elem = this[0];++ if ( !arguments.length ) {+ if ( elem ) {+ hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];++ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {+ return ret;+ }++ return (elem.value || "").replace(rreturn, "");+ }++ return undefined;+ }++ var isFunction = jQuery.isFunction( value );++ return this.each(function( i ) {+ var self = jQuery(this), val;++ if ( this.nodeType !== 1 ) {+ return;+ }++ if ( isFunction ) {+ val = value.call( this, i, self.val() );+ } else {+ val = value;+ }++ // Treat null/undefined as ""; convert numbers to string+ if ( val == null ) {+ val = "";+ } else if ( typeof val === "number" ) {+ val += "";+ } else if ( jQuery.isArray( val ) ) {+ val = jQuery.map(val, function ( value ) {+ return value == null ? "" : value + "";+ });+ }++ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];++ // If set returns undefined, fall back to normal setting+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {+ this.value = val;+ }+ });+ }+});++jQuery.extend({+ valHooks: {+ option: {+ get: function( elem ) {+ // attributes.value is undefined in Blackberry 4.7 but+ // uses .value. See #6932+ var val = elem.attributes.value;+ return !val || val.specified ? elem.value : elem.text;+ }+ },+ select: {+ get: function( elem ) {+ var value,+ index = elem.selectedIndex,+ values = [],+ options = elem.options,+ one = elem.type === "select-one";++ // Nothing was selected+ if ( index < 0 ) {+ return null;+ }++ // Loop through all the selected options+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {+ var option = options[ i ];++ // Don't return options that are disabled or in a disabled optgroup+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {++ // Get the specific value for the option+ value = jQuery( option ).val();++ // We don't need an array for one selects+ if ( one ) {+ return value;+ }++ // Multi-Selects return an array+ values.push( value );+ }+ }++ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()+ if ( one && !values.length && options.length ) {+ return jQuery( options[ index ] ).val();+ }++ return values;+ },++ set: function( elem, value ) {+ var values = jQuery.makeArray( value );++ jQuery(elem).find("option").each(function() {+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;+ });++ if ( !values.length ) {+ elem.selectedIndex = -1;+ }+ return values;+ }+ }+ },++ attrFn: {+ val: true,+ css: true,+ html: true,+ text: true,+ data: true,+ width: true,+ height: true,+ offset: true+ },++ attrFix: {+ // Always normalize to ensure hook usage+ tabindex: "tabIndex"+ },++ attr: function( elem, name, value, pass ) {+ var nType = elem.nodeType;++ // don't get/set attributes on text, comment and attribute nodes+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {+ return undefined;+ }++ if ( pass && name in jQuery.attrFn ) {+ return jQuery( elem )[ name ]( value );+ }++ // Fallback to prop when attributes are not supported+ if ( !("getAttribute" in elem) ) {+ return jQuery.prop( elem, name, value );+ }++ var ret, hooks,+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );++ // Normalize the name if needed+ name = notxml && jQuery.attrFix[ name ] || name;++ hooks = jQuery.attrHooks[ name ];++ if ( !hooks ) {+ // Use boolHook for boolean attributes+ if ( rboolean.test( name ) &&+ (typeof value === "boolean" || value === undefined || value.toLowerCase() === name.toLowerCase()) ) {++ hooks = boolHook;++ // Use formHook for forms and if the name contains certain characters+ } else if ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {+ hooks = formHook;+ }+ }++ if ( value !== undefined ) {++ if ( value === null ) {+ jQuery.removeAttr( elem, name );+ return undefined;++ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {+ return ret;++ } else {+ elem.setAttribute( name, "" + value );+ return value;+ }++ } else if ( hooks && "get" in hooks && notxml ) {+ return hooks.get( elem, name );++ } else {++ ret = elem.getAttribute( name );++ // Non-existent attributes return null, we normalize to undefined+ return ret === null ?+ undefined :+ ret;+ }+ },++ removeAttr: function( elem, name ) {+ var propName;+ if ( elem.nodeType === 1 ) {+ name = jQuery.attrFix[ name ] || name;++ if ( jQuery.support.getSetAttribute ) {+ // Use removeAttribute in browsers that support it+ elem.removeAttribute( name );+ } else {+ jQuery.attr( elem, name, "" );+ elem.removeAttributeNode( elem.getAttributeNode( name ) );+ }++ // Set corresponding property to false for boolean attributes+ if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {+ elem[ propName ] = false;+ }+ }+ },++ attrHooks: {+ type: {+ set: function( elem, value ) {+ // We can't allow the type property to be changed (since it causes problems in IE)+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {+ jQuery.error( "type property can't be changed" );+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {+ // Setting the type on a radio button after the value resets the value in IE6-9+ // Reset value to it's default in case type is set after value+ // This is for element creation+ var val = elem.value;+ elem.setAttribute( "type", value );+ if ( val ) {+ elem.value = val;+ }+ return value;+ }+ }+ },+ tabIndex: {+ get: function( elem ) {+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/+ var attributeNode = elem.getAttributeNode("tabIndex");++ return attributeNode && attributeNode.specified ?+ parseInt( attributeNode.value, 10 ) :+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?+ 0 :+ undefined;+ }+ }+ },++ 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( elem, name, value ) {+ var nType = elem.nodeType;++ // don't get/set properties on text, comment and attribute nodes+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {+ return undefined;+ }++ var ret, hooks,+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );++ // Try to normalize/fix the name+ name = notxml && jQuery.propFix[ name ] || name;++ hooks = jQuery.propHooks[ name ];++ if ( value !== undefined ) {+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {+ return ret;++ } else {+ return (elem[ name ] = value);+ }++ } else {+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {+ return ret;++ } else {+ return elem[ name ];+ }+ }+ },++ propHooks: {}+});++// Hook for boolean attributes+boolHook = {+ get: function( elem, name ) {+ // Align boolean attributes with corresponding properties+ return elem[ jQuery.propFix[ name ] || name ] ?+ name.toLowerCase() :+ undefined;+ },+ set: function( elem, value, name ) {+ var propName;+ if ( value === false ) {+ // Remove boolean attributes when set to false+ jQuery.removeAttr( elem, name );+ } else {+ // value is true since we know at this point it's type boolean and not false+ // Set boolean attributes to the same name and set the DOM property+ propName = jQuery.propFix[ name ] || name;+ if ( propName in elem ) {+ // Only set the IDL specifically if it already exists on the element+ elem[ propName ] = value;+ }++ elem.setAttribute( name, name.toLowerCase() );+ }+ return name;+ }+};++// Use the value property for back compat+// Use the formHook for button elements in IE6/7 (#1954)+jQuery.attrHooks.value = {+ get: function( elem, name ) {+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {+ return formHook.get( elem, name );+ }+ return elem.value;+ },+ set: function( elem, value, name ) {+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {+ return formHook.set( elem, value, name );+ }+ // Does not return so that setAttribute is also used+ elem.value = value;+ }+};++// IE6/7 do not support getting/setting some attributes with get/setAttribute+if ( !jQuery.support.getSetAttribute ) {++ // propFix is more comprehensive and contains all fixes+ jQuery.attrFix = jQuery.propFix;++ // Use this for any attribute on a form in IE6/7+ formHook = jQuery.attrHooks.name = jQuery.valHooks.button = {+ get: function( elem, name ) {+ var ret;+ ret = elem.getAttributeNode( name );+ // Return undefined if nodeValue is empty string+ return ret && ret.nodeValue !== "" ?+ ret.nodeValue :+ undefined;+ },+ set: function( elem, value, name ) {+ // Check form objects in IE (multiple bugs related)+ // Only use nodeValue if the attribute node exists on the form+ var ret = elem.getAttributeNode( name );+ if ( ret ) {+ ret.nodeValue = value;+ return value;+ }+ }+ };++ // Set width and height to auto instead of 0 on empty string( Bug #8150 )+ // This is for removals+ jQuery.each([ "width", "height" ], function( i, name ) {+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {+ set: function( elem, value ) {+ if ( value === "" ) {+ elem.setAttribute( name, "auto" );+ return value;+ }+ }+ });+ });+}+++// Some attributes require a special call on IE+if ( !jQuery.support.hrefNormalized ) {+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {+ get: function( elem ) {+ var ret = elem.getAttribute( name, 2 );+ return ret === null ? undefined : ret;+ }+ });+ });+}++if ( !jQuery.support.style ) {+ jQuery.attrHooks.style = {+ get: function( elem ) {+ // Return undefined in the case of empty string+ // Normalize to lowercase since IE uppercases css property names+ return elem.style.cssText.toLowerCase() || undefined;+ },+ set: function( elem, value ) {+ return (elem.style.cssText = "" + value);+ }+ };+}++// Safari mis-reports the default selected property of an option+// Accessing the parent's selectedIndex property fixes it+if ( !jQuery.support.optSelected ) {+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {+ get: function( elem ) {+ var parent = elem.parentNode;++ if ( parent ) {+ parent.selectedIndex;++ // Make sure that it also works with optgroups, see #5701+ if ( parent.parentNode ) {+ parent.parentNode.selectedIndex;+ }+ }+ }+ });+}++// Radios and checkboxes getter/setter+if ( !jQuery.support.checkOn ) {+ jQuery.each([ "radio", "checkbox" ], function() {+ jQuery.valHooks[ this ] = {+ get: function( elem ) {+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified+ return elem.getAttribute("value") === null ? "on" : elem.value;+ }+ };+ });+}+jQuery.each([ "radio", "checkbox" ], function() {+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {+ set: function( elem, value ) {+ if ( jQuery.isArray( value ) ) {+ return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);+ }+ }+ });+});+++++var hasOwn = Object.prototype.hasOwnProperty,+ rnamespaces = /\.(.*)$/,+ rformElems = /^(?:textarea|input|select)$/i,+ rperiod = /\./g,+ rspaces = / /g,+ rescape = /[^\w\s.|`]/g,+ fcleanup = function( nm ) {+ return nm.replace(rescape, "\\$&");+ };++/*+ * A number of helper functions used for managing events.+ * Many of the ideas behind this code originated from+ * Dean Edwards' addEvent library.+ */+jQuery.event = {++ // Bind an event to an element+ // Original by Dean Edwards+ add: function( elem, types, handler, data ) {+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {+ return;+ }++ if ( handler === false ) {+ handler = returnFalse;+ } else if ( !handler ) {+ // Fixes bug #7229. Fix recommended by jdalton+ return;+ }++ var handleObjIn, handleObj;++ if ( handler.handler ) {+ handleObjIn = handler;+ handler = handleObjIn.handler;+ }++ // Make sure that the function being executed has a unique ID+ if ( !handler.guid ) {+ handler.guid = jQuery.guid++;+ }++ // Init the element's event structure+ var elemData = jQuery._data( elem );++ // If no elemData is found then we must be trying to bind to one of the+ // banned noData elements+ if ( !elemData ) {+ return;+ }++ var events = elemData.events,+ eventHandle = elemData.handle;++ if ( !events ) {+ elemData.events = events = {};+ }++ if ( !eventHandle ) {+ elemData.handle = eventHandle = function( e ) {+ // Discard the second event of a jQuery.event.trigger() and+ // when an event is called after a page has unloaded+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :+ undefined;+ };+ }++ // Add elem as a property of the handle function+ // This is to prevent a memory leak with non-native events in IE.+ eventHandle.elem = elem;++ // Handle multiple events separated by a space+ // jQuery(...).bind("mouseover mouseout", fn);+ types = types.split(" ");++ var type, i = 0, namespaces;++ while ( (type = types[ i++ ]) ) {+ handleObj = handleObjIn ?+ jQuery.extend({}, handleObjIn) :+ { handler: handler, data: data };++ // Namespaced event handlers+ if ( type.indexOf(".") > -1 ) {+ namespaces = type.split(".");+ type = namespaces.shift();+ handleObj.namespace = namespaces.slice(0).sort().join(".");++ } else {+ namespaces = [];+ handleObj.namespace = "";+ }++ handleObj.type = type;+ if ( !handleObj.guid ) {+ handleObj.guid = handler.guid;+ }++ // Get the current list of functions bound to this event+ var handlers = events[ type ],+ special = jQuery.event.special[ type ] || {};++ // Init the event handler queue+ if ( !handlers ) {+ handlers = events[ type ] = [];++ // Check for a special event handler+ // Only use addEventListener/attachEvent if the special+ // events handler returns false+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {+ // Bind the global event handler to the element+ if ( elem.addEventListener ) {+ elem.addEventListener( type, eventHandle, false );++ } else if ( elem.attachEvent ) {+ elem.attachEvent( "on" + type, eventHandle );+ }+ }+ }++ if ( special.add ) {+ special.add.call( elem, handleObj );++ if ( !handleObj.handler.guid ) {+ handleObj.handler.guid = handler.guid;+ }+ }++ // Add the function to the element's handler list+ handlers.push( handleObj );++ // Keep track of which events have been used, for event optimization+ jQuery.event.global[ type ] = true;+ }++ // Nullify elem to prevent memory leaks in IE+ elem = null;+ },++ global: {},++ // Detach an event or set of events from an element+ remove: function( elem, types, handler, pos ) {+ // don't do events on text and comment nodes+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {+ return;+ }++ if ( handler === false ) {+ handler = returnFalse;+ }++ var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,+ elemData = jQuery.hasData( elem ) && jQuery._data( elem ),+ events = elemData && elemData.events;++ if ( !elemData || !events ) {+ return;+ }++ // types is actually an event object here+ if ( types && types.type ) {+ handler = types.handler;+ types = types.type;+ }++ // Unbind all events for the element+ if ( !types || typeof types === "string" && types.charAt(0) === "." ) {+ types = types || "";++ for ( type in events ) {+ jQuery.event.remove( elem, type + types );+ }++ return;+ }++ // Handle multiple events separated by a space+ // jQuery(...).unbind("mouseover mouseout", fn);+ types = types.split(" ");++ while ( (type = types[ i++ ]) ) {+ origType = type;+ handleObj = null;+ all = type.indexOf(".") < 0;+ namespaces = [];++ if ( !all ) {+ // Namespaced event handlers+ namespaces = type.split(".");+ type = namespaces.shift();++ namespace = new RegExp("(^|\\.)" ++ jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");+ }++ eventType = events[ type ];++ if ( !eventType ) {+ continue;+ }++ if ( !handler ) {+ for ( j = 0; j < eventType.length; j++ ) {+ handleObj = eventType[ j ];++ if ( all || namespace.test( handleObj.namespace ) ) {+ jQuery.event.remove( elem, origType, handleObj.handler, j );+ eventType.splice( j--, 1 );+ }+ }++ continue;+ }++ special = jQuery.event.special[ type ] || {};++ for ( j = pos || 0; j < eventType.length; j++ ) {+ handleObj = eventType[ j ];++ if ( handler.guid === handleObj.guid ) {+ // remove the given handler for the given type+ if ( all || namespace.test( handleObj.namespace ) ) {+ if ( pos == null ) {+ eventType.splice( j--, 1 );+ }++ if ( special.remove ) {+ special.remove.call( elem, handleObj );+ }+ }++ if ( pos != null ) {+ break;+ }+ }+ }++ // remove generic event handler if no more handlers exist+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {+ jQuery.removeEvent( elem, type, elemData.handle );+ }++ ret = null;+ delete events[ type ];+ }+ }++ // Remove the expando if it's no longer used+ if ( jQuery.isEmptyObject( events ) ) {+ var handle = elemData.handle;+ if ( handle ) {+ handle.elem = null;+ }++ delete elemData.events;+ delete elemData.handle;++ if ( jQuery.isEmptyObject( elemData ) ) {+ jQuery.removeData( elem, undefined, true );+ }+ }+ },++ // Events that are safe to short-circuit if no handlers are attached.+ // Native DOM events should not be added, they may have inline handlers.+ customEvent: {+ "getData": true,+ "setData": true,+ "changeData": true+ },++ trigger: function( event, data, elem, onlyHandlers ) {+ // Event object or event type+ var type = event.type || event,+ namespaces = [],+ exclusive;++ if ( type.indexOf("!") >= 0 ) {+ // Exclusive events trigger only for the exact event (no namespaces)+ type = type.slice(0, -1);+ exclusive = true;+ }++ if ( type.indexOf(".") >= 0 ) {+ // Namespaced trigger; create a regexp to match event type in handle()+ namespaces = type.split(".");+ type = namespaces.shift();+ namespaces.sort();+ }++ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {+ // No jQuery handlers for this event type, and it can't have inline handlers+ return;+ }++ // Caller can pass in an Event, Object, or just an event type string+ event = typeof event === "object" ?+ // jQuery.Event object+ event[ jQuery.expando ] ? event :+ // Object literal+ new jQuery.Event( type, event ) :+ // Just the event type (string)+ new jQuery.Event( type );++ event.type = type;+ event.exclusive = exclusive;+ event.namespace = namespaces.join(".");+ event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");++ // triggerHandler() and global events don't bubble or run the default action+ if ( onlyHandlers || !elem ) {+ event.preventDefault();+ event.stopPropagation();+ }++ // Handle a global trigger+ if ( !elem ) {+ // TODO: Stop taunting the data cache; remove global events and always attach to document+ jQuery.each( jQuery.cache, function() {+ // internalKey variable is just used to make it easier to find+ // and potentially change this stuff later; currently it just+ // points to jQuery.expando+ var internalKey = jQuery.expando,+ internalCache = this[ internalKey ];+ if ( internalCache && internalCache.events && internalCache.events[ type ] ) {+ jQuery.event.trigger( event, data, internalCache.handle.elem );+ }+ });+ return;+ }++ // Don't do events on text and comment nodes+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {+ return;+ }++ // Clean up the event in case it is being reused+ event.result = undefined;+ event.target = elem;++ // Clone any incoming data and prepend the event, creating the handler arg list+ data = data ? jQuery.makeArray( data ) : [];+ data.unshift( event );++ var cur = elem,+ // IE doesn't like method names with a colon (#3533, #8272)+ ontype = type.indexOf(":") < 0 ? "on" + type : "";++ // Fire event on the current element, then bubble up the DOM tree+ do {+ var handle = jQuery._data( cur, "handle" );++ event.currentTarget = cur;+ if ( handle ) {+ handle.apply( cur, data );+ }++ // Trigger an inline bound script+ if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {+ event.result = false;+ event.preventDefault();+ }++ // Bubble up to document, then to window+ cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;+ } while ( cur && !event.isPropagationStopped() );++ // If nobody prevented the default action, do it now+ if ( !event.isDefaultPrevented() ) {+ var old,+ special = jQuery.event.special[ type ] || {};++ if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {++ // Call a native DOM method on the target with the same name name as the event.+ // Can't use an .isFunction)() check here because IE6/7 fails that test.+ // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.+ try {+ if ( ontype && elem[ type ] ) {+ // Don't re-trigger an onFOO event when we call its FOO() method+ old = elem[ ontype ];++ if ( old ) {+ elem[ ontype ] = null;+ }++ jQuery.event.triggered = type;+ elem[ type ]();+ }+ } catch ( ieError ) {}++ if ( old ) {+ elem[ ontype ] = old;+ }++ jQuery.event.triggered = undefined;+ }+ }++ return event.result;+ },++ handle: function( event ) {+ event = jQuery.event.fix( event || window.event );+ // Snapshot the handlers list since a called handler may add/remove events.+ var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),+ run_all = !event.exclusive && !event.namespace,+ args = Array.prototype.slice.call( arguments, 0 );++ // Use the fix-ed Event rather than the (read-only) native event+ args[0] = event;+ event.currentTarget = this;++ for ( var j = 0, l = handlers.length; j < l; j++ ) {+ var handleObj = handlers[ j ];++ // Triggered event must 1) be non-exclusive and have no namespace, or+ // 2) have namespace(s) a subset or equal to those in the bound event.+ if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {+ // Pass in a reference to the handler function itself+ // So that we can later remove it+ event.handler = handleObj.handler;+ event.data = handleObj.data;+ event.handleObj = handleObj;++ var ret = handleObj.handler.apply( this, args );++ if ( ret !== undefined ) {+ event.result = ret;+ if ( ret === false ) {+ event.preventDefault();+ event.stopPropagation();+ }+ }++ if ( event.isImmediatePropagationStopped() ) {+ break;+ }+ }+ }+ return event.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( event ) {+ if ( event[ jQuery.expando ] ) {+ return event;+ }++ // store a copy of the original event object+ // and "clone" to set read-only properties+ var originalEvent = event;+ event = jQuery.Event( originalEvent );++ for ( var i = this.props.length, prop; i; ) {+ prop = this.props[ --i ];+ event[ prop ] = originalEvent[ prop ];+ }++ // Fix target property, if necessary+ if ( !event.target ) {+ // Fixes #1925 where srcElement might not be defined either+ event.target = event.srcElement || document;+ }++ // check if target is a textnode (safari)+ if ( event.target.nodeType === 3 ) {+ event.target = event.target.parentNode;+ }++ // Add relatedTarget, if necessary+ if ( !event.relatedTarget && event.fromElement ) {+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;+ }++ // Calculate pageX/Y if missing and clientX/Y available+ if ( event.pageX == null && event.clientX != null ) {+ var eventDocument = event.target.ownerDocument || document,+ doc = eventDocument.documentElement,+ body = eventDocument.body;++ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);+ }++ // Add which for key events+ if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {+ event.which = event.charCode != null ? event.charCode : event.keyCode;+ }++ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)+ if ( !event.metaKey && event.ctrlKey ) {+ event.metaKey = event.ctrlKey;+ }++ // Add which for click: 1 === left; 2 === middle; 3 === right+ // Note: button is not normalized, so don't use it+ if ( !event.which && event.button !== undefined ) {+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));+ }++ return event;+ },++ // Deprecated, use jQuery.guid instead+ guid: 1E8,++ // Deprecated, use jQuery.proxy instead+ proxy: jQuery.proxy,++ special: {+ ready: {+ // Make sure the ready event is setup+ setup: jQuery.bindReady,+ teardown: jQuery.noop+ },++ live: {+ add: function( handleObj ) {+ jQuery.event.add( this,+ liveConvert( handleObj.origType, handleObj.selector ),+ jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );+ },++ remove: function( handleObj ) {+ jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );+ }+ },++ beforeunload: {+ setup: function( data, namespaces, eventHandle ) {+ // We only want to do this special case on windows+ if ( jQuery.isWindow( this ) ) {+ this.onbeforeunload = eventHandle;+ }+ },++ teardown: function( namespaces, eventHandle ) {+ if ( this.onbeforeunload === eventHandle ) {+ this.onbeforeunload = null;+ }+ }+ }+ }+};++jQuery.removeEvent = document.removeEventListener ?+ function( elem, type, handle ) {+ if ( elem.removeEventListener ) {+ elem.removeEventListener( type, handle, false );+ }+ } :+ function( elem, type, handle ) {+ if ( elem.detachEvent ) {+ elem.detachEvent( "on" + type, handle );+ }+ };++jQuery.Event = function( src, props ) {+ // Allow instantiation without the 'new' keyword+ if ( !this.preventDefault ) {+ return new jQuery.Event( src, props );+ }++ // Event object+ if ( src && src.type ) {+ this.originalEvent = src;+ this.type = src.type;++ // Events bubbling up the document may have been marked as prevented+ // by a handler lower down the tree; reflect the correct value.+ this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||+ src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;++ // Event type+ } else {+ this.type = src;+ }++ // Put explicitly provided properties onto the event object+ if ( props ) {+ jQuery.extend( this, props );+ }++ // timeStamp is buggy for some events on Firefox(#3843)+ // So we won't rely on the native value+ this.timeStamp = jQuery.now();++ // Mark it as fixed+ this[ jQuery.expando ] = true;+};++function returnFalse() {+ return false;+}+function returnTrue() {+ return true;+}++// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html+jQuery.Event.prototype = {+ preventDefault: function() {+ this.isDefaultPrevented = returnTrue;++ var e = this.originalEvent;+ if ( !e ) {+ return;+ }++ // if preventDefault exists run it on the original event+ if ( e.preventDefault ) {+ e.preventDefault();++ // otherwise set the returnValue property of the original event to false (IE)+ } else {+ e.returnValue = false;+ }+ },+ stopPropagation: function() {+ this.isPropagationStopped = returnTrue;++ var e = this.originalEvent;+ if ( !e ) {+ return;+ }+ // if stopPropagation exists run it on the original event+ if ( e.stopPropagation ) {+ e.stopPropagation();+ }+ // otherwise set the cancelBubble property of the original event to true (IE)+ e.cancelBubble = true;+ },+ stopImmediatePropagation: function() {+ this.isImmediatePropagationStopped = returnTrue;+ this.stopPropagation();+ },+ isDefaultPrevented: returnFalse,+ isPropagationStopped: returnFalse,+ isImmediatePropagationStopped: returnFalse+};++// Checks if an event happened on an element within another element+// Used in jQuery.event.special.mouseenter and mouseleave handlers+var withinElement = function( event ) {+ // Check if mouse(over|out) are still within the same parent element+ var parent = event.relatedTarget;++ // set the correct event type+ event.type = event.data;++ // Firefox sometimes assigns relatedTarget a XUL element+ // which we cannot access the parentNode property of+ try {++ // Chrome does something similar, the parentNode property+ // can be accessed but is null.+ if ( parent && parent !== document && !parent.parentNode ) {+ return;+ }++ // Traverse up the tree+ while ( parent && parent !== this ) {+ parent = parent.parentNode;+ }++ if ( parent !== this ) {+ // handle event if we actually just moused on to a non sub-element+ jQuery.event.handle.apply( this, arguments );+ }++ // assuming we've left the element since we most likely mousedover a xul element+ } catch(e) { }+},++// In case of event delegation, we only need to rename the event.type,+// liveHandler will take care of the rest.+delegate = function( event ) {+ event.type = event.data;+ jQuery.event.handle.apply( this, arguments );+};++// Create mouseenter and mouseleave events+jQuery.each({+ mouseenter: "mouseover",+ mouseleave: "mouseout"+}, function( orig, fix ) {+ jQuery.event.special[ orig ] = {+ setup: function( data ) {+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );+ },+ teardown: function( data ) {+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );+ }+ };+});++// submit delegation+if ( !jQuery.support.submitBubbles ) {++ jQuery.event.special.submit = {+ setup: function( data, namespaces ) {+ if ( !jQuery.nodeName( this, "form" ) ) {+ jQuery.event.add(this, "click.specialSubmit", function( e ) {+ var elem = e.target,+ type = elem.type;++ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {+ trigger( "submit", this, arguments );+ }+ });++ jQuery.event.add(this, "keypress.specialSubmit", function( e ) {+ var elem = e.target,+ type = elem.type;++ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {+ trigger( "submit", this, arguments );+ }+ });++ } else {+ return false;+ }+ },++ teardown: function( namespaces ) {+ jQuery.event.remove( this, ".specialSubmit" );+ }+ };++}++// change delegation, happens here so we have bind.+if ( !jQuery.support.changeBubbles ) {++ var changeFilters,++ getVal = function( elem ) {+ var type = elem.type, val = elem.value;++ if ( type === "radio" || type === "checkbox" ) {+ val = elem.checked;++ } else if ( type === "select-multiple" ) {+ val = elem.selectedIndex > -1 ?+ jQuery.map( elem.options, function( elem ) {+ return elem.selected;+ }).join("-") :+ "";++ } else if ( jQuery.nodeName( elem, "select" ) ) {+ val = elem.selectedIndex;+ }++ return val;+ },++ testChange = function testChange( e ) {+ var elem = e.target, data, val;++ if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {+ return;+ }++ data = jQuery._data( elem, "_change_data" );+ val = getVal(elem);++ // the current data will be also retrieved by beforeactivate+ if ( e.type !== "focusout" || elem.type !== "radio" ) {+ jQuery._data( elem, "_change_data", val );+ }++ if ( data === undefined || val === data ) {+ return;+ }++ if ( data != null || val ) {+ e.type = "change";+ e.liveFired = undefined;+ jQuery.event.trigger( e, arguments[1], elem );+ }+ };++ jQuery.event.special.change = {+ filters: {+ focusout: testChange,++ beforedeactivate: testChange,++ click: function( e ) {+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";++ if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {+ testChange.call( this, e );+ }+ },++ // Change has to be called before submit+ // Keydown will be called before keypress, which is used in submit-event delegation+ keydown: function( e ) {+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";++ if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||+ type === "select-multiple" ) {+ testChange.call( this, e );+ }+ },++ // Beforeactivate happens also before the previous element is blurred+ // with this event you can't trigger a change event, but you can store+ // information+ beforeactivate: function( e ) {+ var elem = e.target;+ jQuery._data( elem, "_change_data", getVal(elem) );+ }+ },++ setup: function( data, namespaces ) {+ if ( this.type === "file" ) {+ return false;+ }++ for ( var type in changeFilters ) {+ jQuery.event.add( this, type + ".specialChange", changeFilters[type] );+ }++ return rformElems.test( this.nodeName );+ },++ teardown: function( namespaces ) {+ jQuery.event.remove( this, ".specialChange" );++ return rformElems.test( this.nodeName );+ }+ };++ changeFilters = jQuery.event.special.change.filters;++ // Handle when the input is .focus()'d+ changeFilters.focus = changeFilters.beforeactivate;+}++function trigger( type, elem, args ) {+ // Piggyback on a donor event to simulate a different one.+ // Fake originalEvent to avoid donor's stopPropagation, but if the+ // simulated event prevents default then we do the same on the donor.+ // Don't pass args or remember liveFired; they apply to the donor event.+ var event = jQuery.extend( {}, args[ 0 ] );+ event.type = type;+ event.originalEvent = {};+ event.liveFired = undefined;+ jQuery.event.handle.call( elem, event );+ if ( event.isDefaultPrevented() ) {+ args[ 0 ].preventDefault();+ }+}++// Create "bubbling" focus and blur events+if ( !jQuery.support.focusinBubbles ) {+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {++ // Attach a single capturing handler while someone wants focusin/focusout+ var attaches = 0;++ jQuery.event.special[ fix ] = {+ setup: function() {+ if ( attaches++ === 0 ) {+ document.addEventListener( orig, handler, true );+ }+ },+ teardown: function() {+ if ( --attaches === 0 ) {+ document.removeEventListener( orig, handler, true );+ }+ }+ };++ function handler( donor ) {+ // Donor event is always a native one; fix it and switch its type.+ // Let focusin/out handler cancel the donor focus/blur event.+ var e = jQuery.event.fix( donor );+ e.type = fix;+ e.originalEvent = {};+ jQuery.event.trigger( e, null, e.target );+ if ( e.isDefaultPrevented() ) {+ donor.preventDefault();+ }+ }+ });+}++jQuery.each(["bind", "one"], function( i, name ) {+ jQuery.fn[ name ] = function( type, data, fn ) {+ var handler;++ // Handle object literals+ if ( typeof type === "object" ) {+ for ( var key in type ) {+ this[ name ](key, data, type[key], fn);+ }+ return this;+ }++ if ( arguments.length === 2 || data === false ) {+ fn = data;+ data = undefined;+ }++ if ( name === "one" ) {+ handler = function( event ) {+ jQuery( this ).unbind( event, handler );+ return fn.apply( this, arguments );+ };+ handler.guid = fn.guid || jQuery.guid++;+ } else {+ handler = fn;+ }++ if ( type === "unload" && name !== "one" ) {+ this.one( type, data, fn );++ } else {+ for ( var i = 0, l = this.length; i < l; i++ ) {+ jQuery.event.add( this[i], type, handler, data );+ }+ }++ return this;+ };+});++jQuery.fn.extend({+ unbind: function( type, fn ) {+ // Handle object literals+ if ( typeof type === "object" && !type.preventDefault ) {+ for ( var key in type ) {+ this.unbind(key, type[key]);+ }++ } else {+ for ( var i = 0, l = this.length; i < l; i++ ) {+ jQuery.event.remove( this[i], type, fn );+ }+ }++ return this;+ },++ delegate: function( selector, types, data, fn ) {+ return this.live( types, data, fn, selector );+ },++ undelegate: function( selector, types, fn ) {+ if ( arguments.length === 0 ) {+ return this.unbind( "live" );++ } else {+ return this.die( types, null, fn, selector );+ }+ },++ trigger: function( type, data ) {+ return this.each(function() {+ jQuery.event.trigger( type, data, this );+ });+ },++ triggerHandler: function( type, data ) {+ if ( this[0] ) {+ return jQuery.event.trigger( type, data, this[0], true );+ }+ },++ toggle: function( fn ) {+ // Save reference to arguments for access in closure+ var args = arguments,+ guid = fn.guid || jQuery.guid++,+ i = 0,+ toggler = function( event ) {+ // Figure out which function to execute+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );++ // Make sure that clicks stop+ event.preventDefault();++ // and execute the function+ return args[ lastToggle ].apply( this, arguments ) || false;+ };++ // link all the functions, so any of them can unbind this click handler+ toggler.guid = guid;+ while ( i < args.length ) {+ args[ i++ ].guid = guid;+ }++ return this.click( toggler );+ },++ hover: function( fnOver, fnOut ) {+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );+ }+});++var liveMap = {+ focus: "focusin",+ blur: "focusout",+ mouseenter: "mouseover",+ mouseleave: "mouseout"+};++jQuery.each(["live", "die"], function( i, name ) {+ jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {+ var type, i = 0, match, namespaces, preType,+ selector = origSelector || this.selector,+ context = origSelector ? this : jQuery( this.context );++ if ( typeof types === "object" && !types.preventDefault ) {+ for ( var key in types ) {+ context[ name ]( key, data, types[key], selector );+ }++ return this;+ }++ if ( name === "die" && !types &&+ origSelector && origSelector.charAt(0) === "." ) {++ context.unbind( origSelector );++ return this;+ }++ if ( data === false || jQuery.isFunction( data ) ) {+ fn = data || returnFalse;+ data = undefined;+ }++ types = (types || "").split(" ");++ while ( (type = types[ i++ ]) != null ) {+ match = rnamespaces.exec( type );+ namespaces = "";++ if ( match ) {+ namespaces = match[0];+ type = type.replace( rnamespaces, "" );+ }++ if ( type === "hover" ) {+ types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );+ continue;+ }++ preType = type;++ if ( liveMap[ type ] ) {+ types.push( liveMap[ type ] + namespaces );+ type = type + namespaces;++ } else {+ type = (liveMap[ type ] || type) + namespaces;+ }++ if ( name === "live" ) {+ // bind live handler+ for ( var j = 0, l = context.length; j < l; j++ ) {+ jQuery.event.add( context[j], "live." + liveConvert( type, selector ),+ { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );+ }++ } else {+ // unbind live handler+ context.unbind( "live." + liveConvert( type, selector ), fn );+ }+ }++ return this;+ };+});++function liveHandler( event ) {+ var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,+ elems = [],+ selectors = [],+ events = jQuery._data( this, "events" );++ // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)+ if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {+ return;+ }++ if ( event.namespace ) {+ namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");+ }++ event.liveFired = this;++ var live = events.live.slice(0);++ for ( j = 0; j < live.length; j++ ) {+ handleObj = live[j];++ if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {+ selectors.push( handleObj.selector );++ } else {+ live.splice( j--, 1 );+ }+ }++ match = jQuery( event.target ).closest( selectors, event.currentTarget );++ for ( i = 0, l = match.length; i < l; i++ ) {+ close = match[i];++ for ( j = 0; j < live.length; j++ ) {+ handleObj = live[j];++ if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {+ elem = close.elem;+ related = null;++ // Those two events require additional checking+ if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {+ event.type = handleObj.preType;+ related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];++ // Make sure not to accidentally match a child element with the same selector+ if ( related && jQuery.contains( elem, related ) ) {+ related = elem;+ }+ }++ if ( !related || related !== elem ) {+ elems.push({ elem: elem, handleObj: handleObj, level: close.level });+ }+ }+ }+ }++ for ( i = 0, l = elems.length; i < l; i++ ) {+ match = elems[i];++ if ( maxLevel && match.level > maxLevel ) {+ break;+ }++ event.currentTarget = match.elem;+ event.data = match.handleObj.data;+ event.handleObj = match.handleObj;++ ret = match.handleObj.origHandler.apply( match.elem, arguments );++ if ( ret === false || event.isPropagationStopped() ) {+ maxLevel = match.level;++ if ( ret === false ) {+ stop = false;+ }+ if ( event.isImmediatePropagationStopped() ) {+ break;+ }+ }+ }++ return stop;+}++function liveConvert( type, selector ) {+ return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");+}++jQuery.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( i, name ) {++ // Handle event binding+ jQuery.fn[ name ] = function( data, fn ) {+ if ( fn == null ) {+ fn = data;+ data = null;+ }++ return arguments.length > 0 ?+ this.bind( name, data, fn ) :+ this.trigger( name );+ };++ if ( jQuery.attrFn ) {+ jQuery.attrFn[ name ] = true;+ }+});++++/*!+ * Sizzle CSS Selector Engine+ * Copyright 2011, The Dojo Foundation+ * Released under the MIT, BSD, and GPL Licenses.+ * More information: http://sizzlejs.com/+ */+(function(){++var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,+ done = 0,+ toString = Object.prototype.toString,+ hasDuplicate = false,+ baseHasDuplicate = true,+ rBackslash = /\\/g,+ rNonWord = /\W/;++// Here we check if the JavaScript engine is using some sort of+// optimization where it does not always call our comparision+// function. If that is the case, discard the hasDuplicate value.+// Thus far that includes Google Chrome.+[0, 0].sort(function() {+ baseHasDuplicate = false;+ return 0;+});++var Sizzle = function( selector, context, results, seed ) {+ results = results || [];+ context = context || document;++ var origContext = context;++ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {+ return [];+ }++ if ( !selector || typeof selector !== "string" ) {+ return results;+ }++ var m, set, checkSet, extra, ret, cur, pop, i,+ prune = true,+ contextXML = Sizzle.isXML( context ),+ parts = [],+ soFar = selector;++ // Reset the position of the chunker regexp (start from head)+ do {+ chunker.exec( "" );+ m = chunker.exec( soFar );++ if ( m ) {+ soFar = m[3];++ parts.push( m[1] );++ if ( m[2] ) {+ extra = m[3];+ break;+ }+ }+ } while ( m );++ if ( parts.length > 1 && origPOS.exec( selector ) ) {++ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {+ set = posProcess( parts[0] + parts[1], context );++ } else {+ set = Expr.relative[ parts[0] ] ?+ [ context ] :+ Sizzle( parts.shift(), context );++ while ( parts.length ) {+ selector = parts.shift();++ if ( Expr.relative[ selector ] ) {+ selector += parts.shift();+ }++ set = posProcess( selector, set );+ }+ }++ } else {+ // Take a shortcut and set the context if the root selector is an ID+ // (but not if it'll be faster if the inner selector is an ID)+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {++ ret = Sizzle.find( parts.shift(), context, contextXML );+ context = ret.expr ?+ Sizzle.filter( ret.expr, ret.set )[0] :+ ret.set[0];+ }++ if ( context ) {+ ret = seed ?+ { expr: parts.pop(), set: makeArray(seed) } :+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );++ set = ret.expr ?+ Sizzle.filter( ret.expr, ret.set ) :+ ret.set;++ if ( parts.length > 0 ) {+ checkSet = makeArray( set );++ } else {+ prune = false;+ }++ while ( parts.length ) {+ cur = parts.pop();+ pop = cur;++ if ( !Expr.relative[ cur ] ) {+ cur = "";+ } else {+ pop = parts.pop();+ }++ if ( pop == null ) {+ pop = context;+ }++ Expr.relative[ cur ]( checkSet, pop, contextXML );+ }++ } else {+ checkSet = parts = [];+ }+ }++ if ( !checkSet ) {+ checkSet = set;+ }++ if ( !checkSet ) {+ Sizzle.error( cur || selector );+ }++ if ( toString.call(checkSet) === "[object Array]" ) {+ if ( !prune ) {+ results.push.apply( results, checkSet );++ } else if ( context && context.nodeType === 1 ) {+ for ( i = 0; checkSet[i] != null; i++ ) {+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {+ results.push( set[i] );+ }+ }++ } else {+ for ( i = 0; checkSet[i] != null; i++ ) {+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {+ results.push( set[i] );+ }+ }+ }++ } else {+ makeArray( checkSet, results );+ }++ if ( extra ) {+ Sizzle( extra, origContext, results, seed );+ Sizzle.uniqueSort( results );+ }++ return results;+};++Sizzle.uniqueSort = function( results ) {+ if ( sortOrder ) {+ hasDuplicate = baseHasDuplicate;+ results.sort( sortOrder );++ if ( hasDuplicate ) {+ for ( var i = 1; i < results.length; i++ ) {+ if ( results[i] === results[ i - 1 ] ) {+ results.splice( i--, 1 );+ }+ }+ }+ }++ return results;+};++Sizzle.matches = function( expr, set ) {+ return Sizzle( expr, null, null, set );+};++Sizzle.matchesSelector = function( node, expr ) {+ return Sizzle( expr, null, null, [node] ).length > 0;+};++Sizzle.find = function( expr, context, isXML ) {+ var set;++ if ( !expr ) {+ return [];+ }++ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {+ var match,+ type = Expr.order[i];++ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {+ var left = match[1];+ match.splice( 1, 1 );++ if ( left.substr( left.length - 1 ) !== "\\" ) {+ match[1] = (match[1] || "").replace( rBackslash, "" );+ set = Expr.find[ type ]( match, context, isXML );++ if ( set != null ) {+ expr = expr.replace( Expr.match[ type ], "" );+ break;+ }+ }+ }+ }++ if ( !set ) {+ set = typeof context.getElementsByTagName !== "undefined" ?+ context.getElementsByTagName( "*" ) :+ [];+ }++ return { set: set, expr: expr };+};++Sizzle.filter = function( expr, set, inplace, not ) {+ var match, anyFound,+ old = expr,+ result = [],+ curLoop = set,+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );++ while ( expr && set.length ) {+ for ( var type in Expr.filter ) {+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {+ var found, item,+ filter = Expr.filter[ type ],+ left = match[1];++ anyFound = false;++ match.splice(1,1);++ if ( left.substr( left.length - 1 ) === "\\" ) {+ continue;+ }++ if ( curLoop === result ) {+ result = [];+ }++ if ( Expr.preFilter[ type ] ) {+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );++ if ( !match ) {+ anyFound = found = true;++ } else if ( match === true ) {+ continue;+ }+ }++ if ( match ) {+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {+ if ( item ) {+ found = filter( item, match, i, curLoop );+ var pass = not ^ !!found;++ if ( inplace && found != null ) {+ if ( pass ) {+ anyFound = true;++ } else {+ curLoop[i] = false;+ }++ } else if ( pass ) {+ result.push( item );+ anyFound = true;+ }+ }+ }+ }++ if ( found !== undefined ) {+ if ( !inplace ) {+ curLoop = result;+ }++ expr = expr.replace( Expr.match[ type ], "" );++ if ( !anyFound ) {+ return [];+ }++ break;+ }+ }+ }++ // Improper expression+ if ( expr === old ) {+ if ( anyFound == null ) {+ Sizzle.error( expr );++ } else {+ break;+ }+ }++ old = expr;+ }++ return curLoop;+};++Sizzle.error = function( msg ) {+ throw "Syntax error, unrecognized expression: " + msg;+};++var Expr = Sizzle.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( elem ) {+ return elem.getAttribute( "href" );+ },+ type: function( elem ) {+ return elem.getAttribute( "type" );+ }+ },++ relative: {+ "+": function(checkSet, part){+ var isPartStr = typeof part === "string",+ isTag = isPartStr && !rNonWord.test( part ),+ isPartStrNotTag = isPartStr && !isTag;++ if ( isTag ) {+ part = part.toLowerCase();+ }++ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {+ if ( (elem = checkSet[i]) ) {+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}++ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?+ elem || false :+ elem === part;+ }+ }++ if ( isPartStrNotTag ) {+ Sizzle.filter( part, checkSet, true );+ }+ },++ ">": function( checkSet, part ) {+ var elem,+ isPartStr = typeof part === "string",+ i = 0,+ l = checkSet.length;++ if ( isPartStr && !rNonWord.test( part ) ) {+ part = part.toLowerCase();++ for ( ; i < l; i++ ) {+ elem = checkSet[i];++ if ( elem ) {+ var parent = elem.parentNode;+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;+ }+ }++ } else {+ for ( ; i < l; i++ ) {+ elem = checkSet[i];++ if ( elem ) {+ checkSet[i] = isPartStr ?+ elem.parentNode :+ elem.parentNode === part;+ }+ }++ if ( isPartStr ) {+ Sizzle.filter( part, checkSet, true );+ }+ }+ },++ "": function(checkSet, part, isXML){+ var nodeCheck,+ doneName = done++,+ checkFn = dirCheck;++ if ( typeof part === "string" && !rNonWord.test( part ) ) {+ part = part.toLowerCase();+ nodeCheck = part;+ checkFn = dirNodeCheck;+ }++ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );+ },++ "~": function( checkSet, part, isXML ) {+ var nodeCheck,+ doneName = done++,+ checkFn = dirCheck;++ if ( typeof part === "string" && !rNonWord.test( part ) ) {+ part = part.toLowerCase();+ nodeCheck = part;+ checkFn = dirNodeCheck;+ }++ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );+ }+ },++ find: {+ ID: function( match, context, isXML ) {+ if ( typeof context.getElementById !== "undefined" && !isXML ) {+ var m = context.getElementById(match[1]);+ // Check parentNode to catch when Blackberry 4.6 returns+ // nodes that are no longer in the document #6963+ return m && m.parentNode ? [m] : [];+ }+ },++ NAME: function( match, context ) {+ if ( typeof context.getElementsByName !== "undefined" ) {+ var ret = [],+ results = context.getElementsByName( match[1] );++ for ( var i = 0, l = results.length; i < l; i++ ) {+ if ( results[i].getAttribute("name") === match[1] ) {+ ret.push( results[i] );+ }+ }++ return ret.length === 0 ? null : ret;+ }+ },++ TAG: function( match, context ) {+ if ( typeof context.getElementsByTagName !== "undefined" ) {+ return context.getElementsByTagName( match[1] );+ }+ }+ },+ preFilter: {+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {+ match = " " + match[1].replace( rBackslash, "" ) + " ";++ if ( isXML ) {+ return match;+ }++ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {+ if ( elem ) {+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {+ if ( !inplace ) {+ result.push( elem );+ }++ } else if ( inplace ) {+ curLoop[i] = false;+ }+ }+ }++ return false;+ },++ ID: function( match ) {+ return match[1].replace( rBackslash, "" );+ },++ TAG: function( match, curLoop ) {+ return match[1].replace( rBackslash, "" ).toLowerCase();+ },++ CHILD: function( match ) {+ if ( match[1] === "nth" ) {+ if ( !match[2] ) {+ Sizzle.error( match[0] );+ }++ match[2] = match[2].replace(/^\+|\s*/g, '');++ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);++ // calculate the numbers (first)n+(last) including if they are negative+ match[2] = (test[1] + (test[2] || 1)) - 0;+ match[3] = test[3] - 0;+ }+ else if ( match[2] ) {+ Sizzle.error( match[0] );+ }++ // TODO: Move to normal caching system+ match[0] = done++;++ return match;+ },++ ATTR: function( match, curLoop, inplace, result, not, isXML ) {+ var name = match[1] = match[1].replace( rBackslash, "" );++ if ( !isXML && Expr.attrMap[name] ) {+ match[1] = Expr.attrMap[name];+ }++ // Handle if an un-quoted value was used+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );++ if ( match[2] === "~=" ) {+ match[4] = " " + match[4] + " ";+ }++ return match;+ },++ PSEUDO: function( match, curLoop, inplace, result, not ) {+ if ( match[1] === "not" ) {+ // If we're dealing with a complex expression, or a simple one+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {+ match[3] = Sizzle(match[3], null, null, curLoop);++ } else {+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);++ if ( !inplace ) {+ result.push.apply( result, ret );+ }++ return false;+ }++ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {+ return true;+ }++ return match;+ },++ POS: function( match ) {+ match.unshift( true );++ return match;+ }+ },++ filters: {+ enabled: function( elem ) {+ return elem.disabled === false && elem.type !== "hidden";+ },++ disabled: function( elem ) {+ return elem.disabled === true;+ },++ checked: function( elem ) {+ return elem.checked === true;+ },++ selected: function( elem ) {+ // Accessing this property makes selected-by-default+ // options in Safari work properly+ if ( elem.parentNode ) {+ elem.parentNode.selectedIndex;+ }++ return elem.selected === true;+ },++ parent: function( elem ) {+ return !!elem.firstChild;+ },++ empty: function( elem ) {+ return !elem.firstChild;+ },++ has: function( elem, i, match ) {+ return !!Sizzle( match[3], elem ).length;+ },++ header: function( elem ) {+ return (/h\d/i).test( elem.nodeName );+ },++ text: function( elem ) {+ var attr = elem.getAttribute( "type" ), type = elem.type;+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)+ // use getAttribute instead to test this case+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );+ },++ radio: function( elem ) {+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;+ },++ checkbox: function( elem ) {+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;+ },++ file: function( elem ) {+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;+ },++ password: function( elem ) {+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;+ },++ submit: function( elem ) {+ var name = elem.nodeName.toLowerCase();+ return (name === "input" || name === "button") && "submit" === elem.type;+ },++ image: function( elem ) {+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;+ },++ reset: function( elem ) {+ var name = elem.nodeName.toLowerCase();+ return (name === "input" || name === "button") && "reset" === elem.type;+ },++ button: function( elem ) {+ var name = elem.nodeName.toLowerCase();+ return name === "input" && "button" === elem.type || name === "button";+ },++ input: function( elem ) {+ return (/input|select|textarea|button/i).test( elem.nodeName );+ },++ focus: function( elem ) {+ return elem === elem.ownerDocument.activeElement;+ }+ },+ setFilters: {+ first: function( elem, i ) {+ return i === 0;+ },++ last: function( elem, i, match, array ) {+ return i === array.length - 1;+ },++ even: function( elem, i ) {+ return i % 2 === 0;+ },++ odd: function( elem, i ) {+ return i % 2 === 1;+ },++ lt: function( elem, i, match ) {+ return i < match[3] - 0;+ },++ gt: function( elem, i, match ) {+ return i > match[3] - 0;+ },++ nth: function( elem, i, match ) {+ return match[3] - 0 === i;+ },++ eq: function( elem, i, match ) {+ return match[3] - 0 === i;+ }+ },+ filter: {+ PSEUDO: function( elem, match, i, array ) {+ var name = match[1],+ filter = Expr.filters[ name ];++ if ( filter ) {+ return filter( elem, i, match, array );++ } else if ( name === "contains" ) {+ return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;++ } else if ( name === "not" ) {+ var not = match[3];++ for ( var j = 0, l = not.length; j < l; j++ ) {+ if ( not[j] === elem ) {+ return false;+ }+ }++ return true;++ } else {+ Sizzle.error( name );+ }+ },++ CHILD: function( elem, match ) {+ var type = match[1],+ node = elem;++ switch ( type ) {+ case "only":+ case "first":+ while ( (node = node.previousSibling) ) {+ if ( node.nodeType === 1 ) {+ return false;+ }+ }++ if ( type === "first" ) {+ return true;+ }++ node = elem;++ case "last":+ while ( (node = node.nextSibling) ) {+ if ( node.nodeType === 1 ) {+ return false;+ }+ }++ return true;++ case "nth":+ var first = match[2],+ last = match[3];++ if ( first === 1 && last === 0 ) {+ return true;+ }++ var doneName = match[0],+ parent = elem.parentNode;++ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {+ var count = 0;++ for ( node = parent.firstChild; node; node = node.nextSibling ) {+ if ( node.nodeType === 1 ) {+ node.nodeIndex = ++count;+ }+ }++ parent.sizcache = doneName;+ }++ var diff = elem.nodeIndex - last;++ if ( first === 0 ) {+ return diff === 0;++ } else {+ return ( diff % first === 0 && diff / first >= 0 );+ }+ }+ },++ ID: function( elem, match ) {+ return elem.nodeType === 1 && elem.getAttribute("id") === match;+ },++ TAG: function( elem, match ) {+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;+ },++ CLASS: function( elem, match ) {+ return (" " + (elem.className || elem.getAttribute("class")) + " ")+ .indexOf( match ) > -1;+ },++ ATTR: function( elem, match ) {+ var name = match[1],+ result = Expr.attrHandle[ name ] ?+ Expr.attrHandle[ name ]( elem ) :+ elem[ name ] != null ?+ elem[ name ] :+ elem.getAttribute( name ),+ value = result + "",+ type = match[2],+ check = match[4];++ return result == null ?+ type === "!=" :+ type === "=" ?+ value === check :+ type === "*=" ?+ value.indexOf(check) >= 0 :+ type === "~=" ?+ (" " + value + " ").indexOf(check) >= 0 :+ !check ?+ value && result !== false :+ type === "!=" ?+ value !== check :+ type === "^=" ?+ value.indexOf(check) === 0 :+ type === "$=" ?+ value.substr(value.length - check.length) === check :+ type === "|=" ?+ value === check || value.substr(0, check.length + 1) === check + "-" :+ false;+ },++ POS: function( elem, match, i, array ) {+ var name = match[2],+ filter = Expr.setFilters[ name ];++ if ( filter ) {+ return filter( elem, i, match, array );+ }+ }+ }+};++var origPOS = Expr.match.POS,+ fescape = function(all, num){+ return "\\" + (num - 0 + 1);+ };++for ( var type in Expr.match ) {+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );+}++var makeArray = function( array, results ) {+ array = Array.prototype.slice.call( array, 0 );++ if ( results ) {+ results.push.apply( results, array );+ return results;+ }++ return array;+};++// Perform a simple check to determine if the browser is capable of+// converting a NodeList to an array using builtin methods.+// Also verifies that the returned array holds DOM nodes+// (which is not the case in the Blackberry browser)+try {+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;++// Provide a fallback method if it does not work+} catch( e ) {+ makeArray = function( array, results ) {+ var i = 0,+ ret = results || [];++ if ( toString.call(array) === "[object Array]" ) {+ Array.prototype.push.apply( ret, array );++ } else {+ if ( typeof array.length === "number" ) {+ for ( var l = array.length; i < l; i++ ) {+ ret.push( array[i] );+ }++ } else {+ for ( ; array[i]; i++ ) {+ ret.push( array[i] );+ }+ }+ }++ return ret;+ };+}++var sortOrder, siblingCheck;++if ( document.documentElement.compareDocumentPosition ) {+ sortOrder = function( a, b ) {+ if ( a === b ) {+ hasDuplicate = true;+ return 0;+ }++ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {+ return a.compareDocumentPosition ? -1 : 1;+ }++ return a.compareDocumentPosition(b) & 4 ? -1 : 1;+ };++} else {+ sortOrder = function( a, b ) {+ // The nodes are identical, we can exit early+ if ( a === b ) {+ hasDuplicate = true;+ return 0;++ // Fallback to using sourceIndex (in IE) if it's available on both nodes+ } else if ( a.sourceIndex && b.sourceIndex ) {+ return a.sourceIndex - b.sourceIndex;+ }++ var al, bl,+ ap = [],+ bp = [],+ aup = a.parentNode,+ bup = b.parentNode,+ cur = aup;++ // If the nodes are siblings (or identical) we can do a quick check+ if ( aup === bup ) {+ return siblingCheck( a, b );++ // If no parents were found then the nodes are disconnected+ } else if ( !aup ) {+ return -1;++ } else if ( !bup ) {+ return 1;+ }++ // Otherwise they're somewhere else in the tree so we need+ // to build up a full list of the parentNodes for comparison+ while ( cur ) {+ ap.unshift( cur );+ cur = cur.parentNode;+ }++ cur = bup;++ while ( cur ) {+ bp.unshift( cur );+ cur = cur.parentNode;+ }++ al = ap.length;+ bl = bp.length;++ // Start walking down the tree looking for a discrepancy+ for ( var i = 0; i < al && i < bl; i++ ) {+ if ( ap[i] !== bp[i] ) {+ return siblingCheck( ap[i], bp[i] );+ }+ }++ // We ended someplace up the tree so do a sibling check+ return i === al ?+ siblingCheck( a, bp[i], -1 ) :+ siblingCheck( ap[i], b, 1 );+ };++ siblingCheck = function( a, b, ret ) {+ if ( a === b ) {+ return ret;+ }++ var cur = a.nextSibling;++ while ( cur ) {+ if ( cur === b ) {+ return -1;+ }++ cur = cur.nextSibling;+ }++ return 1;+ };+}++// Utility function for retreiving the text value of an array of DOM nodes+Sizzle.getText = function( elems ) {+ var ret = "", elem;++ for ( var i = 0; elems[i]; i++ ) {+ elem = elems[i];++ // Get the text from text nodes and CDATA nodes+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {+ ret += elem.nodeValue;++ // Traverse everything else, except comment nodes+ } else if ( elem.nodeType !== 8 ) {+ ret += Sizzle.getText( elem.childNodes );+ }+ }++ return ret;+};++// Check to see if the browser returns elements by name when+// querying by getElementById (and provide a workaround)+(function(){+ // We're going to inject a fake input element with a specified name+ var form = document.createElement("div"),+ id = "script" + (new Date()).getTime(),+ root = document.documentElement;++ form.innerHTML = "<a name='" + id + "'/>";++ // Inject it into the root element, check its status, and remove it quickly+ root.insertBefore( form, root.firstChild );++ // The workaround has to do additional checks after a getElementById+ // Which slows things down for other browsers (hence the branching)+ if ( document.getElementById( id ) ) {+ Expr.find.ID = function( match, context, isXML ) {+ if ( typeof context.getElementById !== "undefined" && !isXML ) {+ var m = context.getElementById(match[1]);++ return m ?+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?+ [m] :+ undefined :+ [];+ }+ };++ Expr.filter.ID = function( elem, match ) {+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");++ return elem.nodeType === 1 && node && node.nodeValue === match;+ };+ }++ root.removeChild( form );++ // release memory in IE+ root = form = null;+})();++(function(){+ // Check to see if the browser returns only elements+ // when doing getElementsByTagName("*")++ // Create a fake element+ var div = document.createElement("div");+ div.appendChild( document.createComment("") );++ // Make sure no comments are found+ if ( div.getElementsByTagName("*").length > 0 ) {+ Expr.find.TAG = function( match, context ) {+ var results = context.getElementsByTagName( match[1] );++ // Filter out possible comments+ if ( match[1] === "*" ) {+ var tmp = [];++ for ( var i = 0; results[i]; i++ ) {+ if ( results[i].nodeType === 1 ) {+ tmp.push( results[i] );+ }+ }++ results = tmp;+ }++ return results;+ };+ }++ // Check to see if an attribute returns normalized href attributes+ div.innerHTML = "<a href='#'></a>";++ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&+ div.firstChild.getAttribute("href") !== "#" ) {++ Expr.attrHandle.href = function( elem ) {+ return elem.getAttribute( "href", 2 );+ };+ }++ // release memory in IE+ div = null;+})();++if ( document.querySelectorAll ) {+ (function(){+ var oldSizzle = Sizzle,+ div = document.createElement("div"),+ id = "__sizzle__";++ div.innerHTML = "<p class='TEST'></p>";++ // Safari can't handle uppercase or unicode characters when+ // in quirks mode.+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {+ return;+ }++ Sizzle = function( query, context, extra, seed ) {+ context = context || document;++ // Only use querySelectorAll on non-XML documents+ // (ID selectors don't work in non-HTML documents)+ if ( !seed && !Sizzle.isXML(context) ) {+ // See if we find a selector to speed up+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );++ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {+ // Speed-up: Sizzle("TAG")+ if ( match[1] ) {+ return makeArray( context.getElementsByTagName( query ), extra );++ // Speed-up: Sizzle(".CLASS")+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {+ return makeArray( context.getElementsByClassName( match[2] ), extra );+ }+ }++ if ( context.nodeType === 9 ) {+ // Speed-up: Sizzle("body")+ // The body element only exists once, optimize finding it+ if ( query === "body" && context.body ) {+ return makeArray( [ context.body ], extra );++ // Speed-up: Sizzle("#ID")+ } else if ( match && match[3] ) {+ var elem = context.getElementById( match[3] );++ // Check parentNode to catch when Blackberry 4.6 returns+ // nodes that are no longer in the document #6963+ if ( elem && elem.parentNode ) {+ // Handle the case where IE and Opera return items+ // by name instead of ID+ if ( elem.id === match[3] ) {+ return makeArray( [ elem ], extra );+ }++ } else {+ return makeArray( [], extra );+ }+ }++ try {+ return makeArray( context.querySelectorAll(query), extra );+ } catch(qsaError) {}++ // qSA works strangely on Element-rooted queries+ // We can work around this by specifying an extra ID on the root+ // and working up from there (Thanks to Andrew Dupont for the technique)+ // IE 8 doesn't work on object elements+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {+ var oldContext = context,+ old = context.getAttribute( "id" ),+ nid = old || id,+ hasParent = context.parentNode,+ relativeHierarchySelector = /^\s*[+~]/.test( query );++ if ( !old ) {+ context.setAttribute( "id", nid );+ } else {+ nid = nid.replace( /'/g, "\\$&" );+ }+ if ( relativeHierarchySelector && hasParent ) {+ context = context.parentNode;+ }++ try {+ if ( !relativeHierarchySelector || hasParent ) {+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );+ }++ } catch(pseudoError) {+ } finally {+ if ( !old ) {+ oldContext.removeAttribute( "id" );+ }+ }+ }+ }++ return oldSizzle(query, context, extra, seed);+ };++ for ( var prop in oldSizzle ) {+ Sizzle[ prop ] = oldSizzle[ prop ];+ }++ // release memory in IE+ div = null;+ })();+}++(function(){+ var html = document.documentElement,+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;++ if ( matches ) {+ // Check to see if it's possible to do matchesSelector+ // on a disconnected node (IE 9 fails this)+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),+ pseudoWorks = false;++ try {+ // This should fail with an exception+ // Gecko does not error, returns false instead+ matches.call( document.documentElement, "[test!='']:sizzle" );++ } catch( pseudoError ) {+ pseudoWorks = true;+ }++ Sizzle.matchesSelector = function( node, expr ) {+ // Make sure that attribute selectors are quoted+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");++ if ( !Sizzle.isXML( node ) ) {+ try {+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {+ var ret = matches.call( node, expr );++ // IE 9's matchesSelector returns false on disconnected nodes+ if ( ret || !disconnectedMatch ||+ // As well, disconnected nodes are said to be in a document+ // fragment in IE 9, so check for that+ node.document && node.document.nodeType !== 11 ) {+ return ret;+ }+ }+ } catch(e) {}+ }++ return Sizzle(expr, null, null, [node]).length > 0;+ };+ }+})();++(function(){+ var div = document.createElement("div");++ div.innerHTML = "<div class='test e'></div><div class='test'></div>";++ // Opera can't find a second classname (in 9.6)+ // Also, make sure that getElementsByClassName actually exists+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {+ return;+ }++ // Safari caches class attributes, doesn't catch changes (in 3.2)+ div.lastChild.className = "e";++ if ( div.getElementsByClassName("e").length === 1 ) {+ return;+ }++ Expr.order.splice(1, 0, "CLASS");+ Expr.find.CLASS = function( match, context, isXML ) {+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {+ return context.getElementsByClassName(match[1]);+ }+ };++ // release memory in IE+ div = null;+})();++function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {+ var elem = checkSet[i];++ if ( elem ) {+ var match = false;++ elem = elem[dir];++ while ( elem ) {+ if ( elem.sizcache === doneName ) {+ match = checkSet[elem.sizset];+ break;+ }++ if ( elem.nodeType === 1 && !isXML ){+ elem.sizcache = doneName;+ elem.sizset = i;+ }++ if ( elem.nodeName.toLowerCase() === cur ) {+ match = elem;+ break;+ }++ elem = elem[dir];+ }++ checkSet[i] = match;+ }+ }+}++function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {+ var elem = checkSet[i];++ if ( elem ) {+ var match = false;++ elem = elem[dir];++ while ( elem ) {+ if ( elem.sizcache === doneName ) {+ match = checkSet[elem.sizset];+ break;+ }++ if ( elem.nodeType === 1 ) {+ if ( !isXML ) {+ elem.sizcache = doneName;+ elem.sizset = i;+ }++ if ( typeof cur !== "string" ) {+ if ( elem === cur ) {+ match = true;+ break;+ }++ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {+ match = elem;+ break;+ }+ }++ elem = elem[dir];+ }++ checkSet[i] = match;+ }+ }+}++if ( document.documentElement.contains ) {+ Sizzle.contains = function( a, b ) {+ return a !== b && (a.contains ? a.contains(b) : true);+ };++} else if ( document.documentElement.compareDocumentPosition ) {+ Sizzle.contains = function( a, b ) {+ return !!(a.compareDocumentPosition(b) & 16);+ };++} else {+ Sizzle.contains = function() {+ return false;+ };+}++Sizzle.isXML = function( elem ) {+ // documentElement is verified for cases where it doesn't yet exist+ // (such as loading iframes in IE - #4833)+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;++ return documentElement ? documentElement.nodeName !== "HTML" : false;+};++var posProcess = function( selector, context ) {+ var match,+ tmpSet = [],+ later = "",+ root = context.nodeType ? [context] : context;++ // Position selectors must be done after the filter+ // And so must :not(positional) so we move all PSEUDOs to the end+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {+ later += match[0];+ selector = selector.replace( Expr.match.PSEUDO, "" );+ }++ selector = Expr.relative[selector] ? selector + "*" : selector;++ for ( var i = 0, l = root.length; i < l; i++ ) {+ Sizzle( selector, root[i], tmpSet );+ }++ return Sizzle.filter( later, tmpSet );+};++// EXPOSE+jQuery.find = Sizzle;+jQuery.expr = Sizzle.selectors;+jQuery.expr[":"] = jQuery.expr.filters;+jQuery.unique = Sizzle.uniqueSort;+jQuery.text = Sizzle.getText;+jQuery.isXMLDoc = Sizzle.isXML;+jQuery.contains = Sizzle.contains;+++})();+++var runtil = /Until$/,+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,+ // Note: This RegExp should be improved, or likely pulled from Sizzle+ rmultiselector = /,/,+ isSimple = /^.[^:#\[\.,]*$/,+ slice = Array.prototype.slice,+ POS = jQuery.expr.match.POS,+ // methods guaranteed to produce a unique set when starting from a unique set+ guaranteedUnique = {+ children: true,+ contents: true,+ next: true,+ prev: true+ };++jQuery.fn.extend({+ find: function( selector ) {+ var self = this,+ i, l;++ if ( typeof selector !== "string" ) {+ return jQuery( selector ).filter(function() {+ for ( i = 0, l = self.length; i < l; i++ ) {+ if ( jQuery.contains( self[ i ], this ) ) {+ return true;+ }+ }+ });+ }++ var ret = this.pushStack( "", "find", selector ),+ length, n, r;++ for ( i = 0, l = this.length; i < l; i++ ) {+ length = ret.length;+ jQuery.find( selector, this[i], ret );++ if ( i > 0 ) {+ // Make sure that the results are unique+ for ( n = length; n < ret.length; n++ ) {+ for ( r = 0; r < length; r++ ) {+ if ( ret[r] === ret[n] ) {+ ret.splice(n--, 1);+ break;+ }+ }+ }+ }+ }++ return ret;+ },++ has: function( target ) {+ var targets = jQuery( target );+ return this.filter(function() {+ for ( var i = 0, l = targets.length; i < l; i++ ) {+ if ( jQuery.contains( this, targets[i] ) ) {+ return true;+ }+ }+ });+ },++ not: function( selector ) {+ return this.pushStack( winnow(this, selector, false), "not", selector);+ },++ filter: function( selector ) {+ return this.pushStack( winnow(this, selector, true), "filter", selector );+ },++ is: function( selector ) {+ return !!selector && ( typeof selector === "string" ?+ jQuery.filter( selector, this ).length > 0 :+ this.filter( selector ).length > 0 );+ },++ closest: function( selectors, context ) {+ var ret = [], i, l, cur = this[0];++ // Array+ if ( jQuery.isArray( selectors ) ) {+ var match, selector,+ matches = {},+ level = 1;++ if ( cur && selectors.length ) {+ for ( i = 0, l = selectors.length; i < l; i++ ) {+ selector = selectors[i];++ if ( !matches[ selector ] ) {+ matches[ selector ] = POS.test( selector ) ?+ jQuery( selector, context || this.context ) :+ selector;+ }+ }++ while ( cur && cur.ownerDocument && cur !== context ) {+ for ( selector in matches ) {+ match = matches[ selector ];++ if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {+ ret.push({ selector: selector, elem: cur, level: level });+ }+ }++ cur = cur.parentNode;+ level++;+ }+ }++ return ret;+ }++ // String+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?+ jQuery( selectors, context || this.context ) :+ 0;++ for ( i = 0, l = this.length; i < l; i++ ) {+ cur = this[i];++ while ( cur ) {+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {+ ret.push( cur );+ break;++ } else {+ cur = cur.parentNode;+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {+ break;+ }+ }+ }+ }++ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;++ return this.pushStack( ret, "closest", selectors );+ },++ // Determine the position of an element within+ // the matched set of elements+ index: function( elem ) {+ if ( !elem || typeof elem === "string" ) {+ return jQuery.inArray( this[0],+ // If it receives a string, the selector is used+ // If it receives nothing, the siblings are used+ elem ? jQuery( elem ) : this.parent().children() );+ }+ // Locate the position of the desired element+ return jQuery.inArray(+ // If it receives a jQuery object, the first element is used+ elem.jquery ? elem[0] : elem, this );+ },++ add: function( selector, context ) {+ var set = typeof selector === "string" ?+ jQuery( selector, context ) :+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),+ all = jQuery.merge( this.get(), set );++ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?+ all :+ jQuery.unique( all ) );+ },++ andSelf: function() {+ return this.add( this.prevObject );+ }+});++// A painfully simple check to see if an element is disconnected+// from a document (should be improved, where feasible).+function isDisconnected( node ) {+ return !node || !node.parentNode || node.parentNode.nodeType === 11;+}++jQuery.each({+ parent: function( elem ) {+ var parent = elem.parentNode;+ return parent && parent.nodeType !== 11 ? parent : null;+ },+ parents: function( elem ) {+ return jQuery.dir( elem, "parentNode" );+ },+ parentsUntil: function( elem, i, until ) {+ return jQuery.dir( elem, "parentNode", until );+ },+ next: function( elem ) {+ return jQuery.nth( elem, 2, "nextSibling" );+ },+ prev: function( elem ) {+ return jQuery.nth( elem, 2, "previousSibling" );+ },+ nextAll: function( elem ) {+ return jQuery.dir( elem, "nextSibling" );+ },+ prevAll: function( elem ) {+ return jQuery.dir( elem, "previousSibling" );+ },+ nextUntil: function( elem, i, until ) {+ return jQuery.dir( elem, "nextSibling", until );+ },+ prevUntil: function( elem, i, until ) {+ return jQuery.dir( elem, "previousSibling", until );+ },+ siblings: function( elem ) {+ return jQuery.sibling( elem.parentNode.firstChild, elem );+ },+ children: function( elem ) {+ return jQuery.sibling( elem.firstChild );+ },+ contents: function( elem ) {+ return jQuery.nodeName( elem, "iframe" ) ?+ elem.contentDocument || elem.contentWindow.document :+ jQuery.makeArray( elem.childNodes );+ }+}, function( name, fn ) {+ jQuery.fn[ name ] = function( until, selector ) {+ var ret = jQuery.map( this, fn, until ),+ // The variable 'args' was introduced in+ // https://github.com/jquery/jquery/commit/52a0238+ // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.+ // http://code.google.com/p/v8/issues/detail?id=1050+ args = slice.call(arguments);++ if ( !runtil.test( name ) ) {+ selector = until;+ }++ if ( selector && typeof selector === "string" ) {+ ret = jQuery.filter( selector, ret );+ }++ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;++ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {+ ret = ret.reverse();+ }++ return this.pushStack( ret, name, args.join(",") );+ };+});++jQuery.extend({+ filter: function( expr, elems, not ) {+ if ( not ) {+ expr = ":not(" + expr + ")";+ }++ return elems.length === 1 ?+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :+ jQuery.find.matches(expr, elems);+ },++ dir: function( elem, dir, until ) {+ var matched = [],+ cur = elem[ dir ];++ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {+ if ( cur.nodeType === 1 ) {+ matched.push( cur );+ }+ cur = cur[dir];+ }+ return matched;+ },++ nth: function( cur, result, dir, elem ) {+ result = result || 1;+ var num = 0;++ for ( ; cur; cur = cur[dir] ) {+ if ( cur.nodeType === 1 && ++num === result ) {+ break;+ }+ }++ return cur;+ },++ sibling: function( n, elem ) {+ var r = [];++ for ( ; n; n = n.nextSibling ) {+ if ( n.nodeType === 1 && n !== elem ) {+ r.push( n );+ }+ }++ return r;+ }+});++// Implement the identical functionality for filter and not+function winnow( elements, qualifier, keep ) {++ // Can't pass null or undefined to indexOf in Firefox 4+ // Set to 0 to skip string check+ qualifier = qualifier || 0;++ if ( jQuery.isFunction( qualifier ) ) {+ return jQuery.grep(elements, function( elem, i ) {+ var retVal = !!qualifier.call( elem, i, elem );+ return retVal === keep;+ });++ } else if ( qualifier.nodeType ) {+ return jQuery.grep(elements, function( elem, i ) {+ return (elem === qualifier) === keep;+ });++ } else if ( typeof qualifier === "string" ) {+ var filtered = jQuery.grep(elements, function( elem ) {+ return elem.nodeType === 1;+ });++ if ( isSimple.test( qualifier ) ) {+ return jQuery.filter(qualifier, filtered, !keep);+ } else {+ qualifier = jQuery.filter( qualifier, filtered );+ }+ }++ return jQuery.grep(elements, function( elem, i ) {+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;+ });+}+++++var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,+ rleadingWhitespace = /^\s+/,+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,+ rtagName = /<([\w:]+)/,+ rtbody = /<tbody/i,+ rhtml = /<|&#?\w+;/,+ rnocache = /<(?:script|object|embed|option|style)/i,+ // checked="checked" or checked+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,+ rscriptType = /\/(java|ecma)script/i,+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,+ wrapMap = {+ 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, "", "" ]+ };++wrapMap.optgroup = wrapMap.option;+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;+wrapMap.th = wrapMap.td;++// IE can't serialize <link> and <script> tags normally+if ( !jQuery.support.htmlSerialize ) {+ wrapMap._default = [ 1, "div<div>", "</div>" ];+}++jQuery.fn.extend({+ text: function( text ) {+ if ( jQuery.isFunction(text) ) {+ return this.each(function(i) {+ var self = jQuery( this );++ self.text( text.call(this, i, self.text()) );+ });+ }++ if ( typeof text !== "object" && text !== undefined ) {+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );+ }++ return jQuery.text( this );+ },++ wrapAll: function( html ) {+ if ( jQuery.isFunction( html ) ) {+ return this.each(function(i) {+ jQuery(this).wrapAll( html.call(this, i) );+ });+ }++ if ( this[0] ) {+ // The elements to wrap the target around+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);++ if ( this[0].parentNode ) {+ wrap.insertBefore( this[0] );+ }++ wrap.map(function() {+ var elem = this;++ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {+ elem = elem.firstChild;+ }++ return elem;+ }).append( this );+ }++ return this;+ },++ wrapInner: function( html ) {+ if ( jQuery.isFunction( html ) ) {+ return this.each(function(i) {+ jQuery(this).wrapInner( html.call(this, i) );+ });+ }++ return this.each(function() {+ var self = jQuery( this ),+ contents = self.contents();++ if ( contents.length ) {+ contents.wrapAll( html );++ } else {+ self.append( html );+ }+ });+ },++ wrap: function( html ) {+ return this.each(function() {+ jQuery( this ).wrapAll( html );+ });+ },++ unwrap: function() {+ return this.parent().each(function() {+ if ( !jQuery.nodeName( this, "body" ) ) {+ jQuery( this ).replaceWith( this.childNodes );+ }+ }).end();+ },++ append: function() {+ return this.domManip(arguments, true, function( elem ) {+ if ( this.nodeType === 1 ) {+ this.appendChild( elem );+ }+ });+ },++ prepend: function() {+ return this.domManip(arguments, true, function( elem ) {+ if ( this.nodeType === 1 ) {+ this.insertBefore( elem, this.firstChild );+ }+ });+ },++ before: function() {+ if ( this[0] && this[0].parentNode ) {+ return this.domManip(arguments, false, function( elem ) {+ this.parentNode.insertBefore( elem, this );+ });+ } else if ( arguments.length ) {+ var set = jQuery(arguments[0]);+ set.push.apply( set, this.toArray() );+ return this.pushStack( set, "before", arguments );+ }+ },++ after: function() {+ if ( this[0] && this[0].parentNode ) {+ return this.domManip(arguments, false, function( elem ) {+ this.parentNode.insertBefore( elem, this.nextSibling );+ });+ } else if ( arguments.length ) {+ var set = this.pushStack( this, "after", arguments );+ set.push.apply( set, jQuery(arguments[0]).toArray() );+ return set;+ }+ },++ // keepData is for internal use only--do not document+ remove: function( selector, keepData ) {+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {+ if ( !keepData && elem.nodeType === 1 ) {+ jQuery.cleanData( elem.getElementsByTagName("*") );+ jQuery.cleanData( [ elem ] );+ }++ if ( elem.parentNode ) {+ elem.parentNode.removeChild( elem );+ }+ }+ }++ return this;+ },++ empty: function() {+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {+ // Remove element nodes and prevent memory leaks+ if ( elem.nodeType === 1 ) {+ jQuery.cleanData( elem.getElementsByTagName("*") );+ }++ // Remove any remaining nodes+ while ( elem.firstChild ) {+ elem.removeChild( elem.firstChild );+ }+ }++ return this;+ },++ clone: function( dataAndEvents, deepDataAndEvents ) {+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;++ return this.map( function () {+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );+ });+ },++ html: function( value ) {+ if ( value === undefined ) {+ return this[0] && this[0].nodeType === 1 ?+ this[0].innerHTML.replace(rinlinejQuery, "") :+ null;++ // See if we can take a shortcut and just use innerHTML+ } else if ( typeof value === "string" && !rnocache.test( value ) &&+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {++ value = value.replace(rxhtmlTag, "<$1></$2>");++ try {+ for ( var i = 0, l = this.length; i < l; i++ ) {+ // Remove element nodes and prevent memory leaks+ if ( this[i].nodeType === 1 ) {+ jQuery.cleanData( this[i].getElementsByTagName("*") );+ this[i].innerHTML = value;+ }+ }++ // If using innerHTML throws an exception, use the fallback method+ } catch(e) {+ this.empty().append( value );+ }++ } else if ( jQuery.isFunction( value ) ) {+ this.each(function(i){+ var self = jQuery( this );++ self.html( value.call(this, i, self.html()) );+ });++ } else {+ this.empty().append( value );+ }++ return this;+ },++ replaceWith: function( value ) {+ if ( this[0] && this[0].parentNode ) {+ // Make sure that the elements are removed from the DOM before they are inserted+ // this can help fix replacing a parent with child elements+ if ( jQuery.isFunction( value ) ) {+ return this.each(function(i) {+ var self = jQuery(this), old = self.html();+ self.replaceWith( value.call( this, i, old ) );+ });+ }++ if ( typeof value !== "string" ) {+ value = jQuery( value ).detach();+ }++ return this.each(function() {+ var next = this.nextSibling,+ parent = this.parentNode;++ jQuery( this ).remove();++ if ( next ) {+ jQuery(next).before( value );+ } else {+ jQuery(parent).append( value );+ }+ });+ } else {+ return this.length ?+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :+ this;+ }+ },++ detach: function( selector ) {+ return this.remove( selector, true );+ },++ domManip: function( args, table, callback ) {+ var results, first, fragment, parent,+ value = args[0],+ scripts = [];++ // We can't cloneNode fragments that contain checked, in WebKit+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {+ return this.each(function() {+ jQuery(this).domManip( args, table, callback, true );+ });+ }++ if ( jQuery.isFunction(value) ) {+ return this.each(function(i) {+ var self = jQuery(this);+ args[0] = value.call(this, i, table ? self.html() : undefined);+ self.domManip( args, table, callback );+ });+ }++ if ( this[0] ) {+ parent = value && value.parentNode;++ // If we're in a fragment, just use that instead of building a new one+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {+ results = { fragment: parent };++ } else {+ results = jQuery.buildFragment( args, this, scripts );+ }++ fragment = results.fragment;++ if ( fragment.childNodes.length === 1 ) {+ first = fragment = fragment.firstChild;+ } else {+ first = fragment.firstChild;+ }++ if ( first ) {+ table = table && jQuery.nodeName( first, "tr" );++ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {+ callback.call(+ table ?+ root(this[i], first) :+ this[i],+ // Make sure that we do not leak memory by inadvertently discarding+ // the original fragment (which might have attached data) instead of+ // using it; in addition, use the original fragment object for the last+ // item instead of first because it can end up being emptied incorrectly+ // in certain situations (Bug #8070).+ // Fragments from the fragment cache must always be cloned and never used+ // in place.+ results.cacheable || (l > 1 && i < lastIndex) ?+ jQuery.clone( fragment, true, true ) :+ fragment+ );+ }+ }++ if ( scripts.length ) {+ jQuery.each( scripts, evalScript );+ }+ }++ return this;+ }+});++function root( elem, cur ) {+ return jQuery.nodeName(elem, "table") ?+ (elem.getElementsByTagName("tbody")[0] ||+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :+ elem;+}++function cloneCopyEvent( src, dest ) {++ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {+ return;+ }++ var internalKey = jQuery.expando,+ oldData = jQuery.data( src ),+ curData = jQuery.data( dest, oldData );++ // Switch to use the internal data object, if it exists, for the next+ // stage of data copying+ if ( (oldData = oldData[ internalKey ]) ) {+ var events = oldData.events;+ curData = curData[ internalKey ] = jQuery.extend({}, oldData);++ if ( events ) {+ delete curData.handle;+ curData.events = {};++ for ( var type in events ) {+ for ( var i = 0, l = events[ type ].length; i < l; i++ ) {+ jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );+ }+ }+ }+ }+}++function cloneFixAttributes( src, dest ) {+ var nodeName;++ // We do not need to do anything for non-Elements+ if ( dest.nodeType !== 1 ) {+ return;+ }++ // clearAttributes removes the attributes, which we don't want,+ // but also removes the attachEvent events, which we *do* want+ if ( dest.clearAttributes ) {+ dest.clearAttributes();+ }++ // mergeAttributes, in contrast, only merges back on the+ // original attributes, not the events+ if ( dest.mergeAttributes ) {+ dest.mergeAttributes( src );+ }++ nodeName = dest.nodeName.toLowerCase();++ // IE6-8 fail to clone children inside object elements that use+ // the proprietary classid attribute value (rather than the type+ // attribute) to identify the type of content to display+ if ( nodeName === "object" ) {+ dest.outerHTML = src.outerHTML;++ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {+ // IE6-8 fails to persist the checked state of a cloned checkbox+ // or radio button. Worse, IE6-7 fail to give the cloned element+ // a checked appearance if the defaultChecked value isn't also set+ if ( src.checked ) {+ dest.defaultChecked = dest.checked = src.checked;+ }++ // IE6-7 get confused and end up setting the value of a cloned+ // checkbox/radio button to an empty string instead of "on"+ if ( dest.value !== src.value ) {+ dest.value = src.value;+ }++ // IE6-8 fails to return the selected option to the default selected+ // state when cloning options+ } else if ( nodeName === "option" ) {+ dest.selected = src.defaultSelected;++ // IE6-8 fails to set the defaultValue to the correct value when+ // cloning other types of input fields+ } else if ( nodeName === "input" || nodeName === "textarea" ) {+ dest.defaultValue = src.defaultValue;+ }++ // Event data gets referenced instead of copied if the expando+ // gets copied too+ dest.removeAttribute( jQuery.expando );+}++jQuery.buildFragment = function( args, nodes, scripts ) {+ var fragment, cacheable, cacheresults,+ doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);++ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document+ // Cloning options loses the selected state, so don't cache them+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&+ args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {++ cacheable = true;++ cacheresults = jQuery.fragments[ args[0] ];+ if ( cacheresults && cacheresults !== 1 ) {+ fragment = cacheresults;+ }+ }++ if ( !fragment ) {+ fragment = doc.createDocumentFragment();+ jQuery.clean( args, doc, fragment, scripts );+ }++ if ( cacheable ) {+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;+ }++ return { fragment: fragment, cacheable: cacheable };+};++jQuery.fragments = {};++jQuery.each({+ appendTo: "append",+ prependTo: "prepend",+ insertBefore: "before",+ insertAfter: "after",+ replaceAll: "replaceWith"+}, function( name, original ) {+ jQuery.fn[ name ] = function( selector ) {+ var ret = [],+ insert = jQuery( selector ),+ parent = this.length === 1 && this[0].parentNode;++ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {+ insert[ original ]( this[0] );+ return this;++ } else {+ for ( var i = 0, l = insert.length; i < l; i++ ) {+ var elems = (i > 0 ? this.clone(true) : this).get();+ jQuery( insert[i] )[ original ]( elems );+ ret = ret.concat( elems );+ }++ return this.pushStack( ret, name, insert.selector );+ }+ };+});++function getAll( elem ) {+ if ( "getElementsByTagName" in elem ) {+ return elem.getElementsByTagName( "*" );++ } else if ( "querySelectorAll" in elem ) {+ return elem.querySelectorAll( "*" );++ } else {+ return [];+ }+}++// Used in clean, fixes the defaultChecked property+function fixDefaultChecked( elem ) {+ if ( elem.type === "checkbox" || elem.type === "radio" ) {+ elem.defaultChecked = elem.checked;+ }+}+// Finds all inputs and passes them to fixDefaultChecked+function findInputs( elem ) {+ if ( jQuery.nodeName( elem, "input" ) ) {+ fixDefaultChecked( elem );+ } else if ( elem.getElementsByTagName ) {+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );+ }+}++jQuery.extend({+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {+ var clone = elem.cloneNode(true),+ srcElements,+ destElements,+ i;++ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {+ // IE copies events bound via attachEvent when using cloneNode.+ // Calling detachEvent on the clone will also remove the events+ // from the original. In order to get around this, we use some+ // proprietary methods to clear the events. Thanks to MooTools+ // guys for this hotness.++ cloneFixAttributes( elem, clone );++ // Using Sizzle here is crazy slow, so we use getElementsByTagName+ // instead+ srcElements = getAll( elem );+ destElements = getAll( clone );++ // Weird iteration because IE will replace the length property+ // with an element if you are cloning the body and one of the+ // elements on the page has a name or id of "length"+ for ( i = 0; srcElements[i]; ++i ) {+ cloneFixAttributes( srcElements[i], destElements[i] );+ }+ }++ // Copy the events from the original to the clone+ if ( dataAndEvents ) {+ cloneCopyEvent( elem, clone );++ if ( deepDataAndEvents ) {+ srcElements = getAll( elem );+ destElements = getAll( clone );++ for ( i = 0; srcElements[i]; ++i ) {+ cloneCopyEvent( srcElements[i], destElements[i] );+ }+ }+ }++ // Return the cloned set+ return clone;+ },++ clean: function( elems, context, fragment, scripts ) {+ var checkScriptType;++ context = context || document;++ // !context.createElement fails in IE with an error but returns typeof 'object'+ if ( typeof context.createElement === "undefined" ) {+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;+ }++ var ret = [], j;++ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {+ if ( typeof elem === "number" ) {+ elem += "";+ }++ if ( !elem ) {+ continue;+ }++ // Convert html string into DOM nodes+ if ( typeof elem === "string" ) {+ if ( !rhtml.test( elem ) ) {+ elem = context.createTextNode( elem );+ } else {+ // Fix "XHTML"-style tags in all browsers+ elem = elem.replace(rxhtmlTag, "<$1></$2>");++ // Trim whitespace, otherwise indexOf won't work as expected+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),+ wrap = wrapMap[ tag ] || wrapMap._default,+ depth = wrap[0],+ div = context.createElement("div");++ // Go to html and back, then peel off extra wrappers+ div.innerHTML = wrap[1] + elem + wrap[2];++ // Move to the right depth+ while ( depth-- ) {+ div = div.lastChild;+ }++ // Remove IE's autoinserted <tbody> from table fragments+ if ( !jQuery.support.tbody ) {++ // String was a <table>, *may* have spurious <tbody>+ var hasBody = rtbody.test(elem),+ tbody = tag === "table" && !hasBody ?+ div.firstChild && div.firstChild.childNodes :++ // String was a bare <thead> or <tfoot>+ wrap[1] === "<table>" && !hasBody ?+ div.childNodes :+ [];++ for ( j = tbody.length - 1; j >= 0 ; --j ) {+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {+ tbody[ j ].parentNode.removeChild( tbody[ j ] );+ }+ }+ }++ // IE completely kills leading whitespace when innerHTML is used+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );+ }++ elem = div.childNodes;+ }+ }++ // Resets defaultChecked for any radios and checkboxes+ // about to be appended to the DOM in IE 6/7 (#8060)+ var len;+ if ( !jQuery.support.appendChecked ) {+ if ( elem[0] && typeof (len = elem.length) === "number" ) {+ for ( j = 0; j < len; j++ ) {+ findInputs( elem[j] );+ }+ } else {+ findInputs( elem );+ }+ }++ if ( elem.nodeType ) {+ ret.push( elem );+ } else {+ ret = jQuery.merge( ret, elem );+ }+ }++ if ( fragment ) {+ checkScriptType = function( elem ) {+ return !elem.type || rscriptType.test( elem.type );+ };+ for ( i = 0; ret[i]; i++ ) {+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );++ } else {+ if ( ret[i].nodeType === 1 ) {+ var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );++ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );+ }+ fragment.appendChild( ret[i] );+ }+ }+ }++ return ret;+ },++ cleanData: function( elems ) {+ var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,+ deleteExpando = jQuery.support.deleteExpando;++ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {+ continue;+ }++ id = elem[ jQuery.expando ];++ if ( id ) {+ data = cache[ id ] && cache[ id ][ internalKey ];++ if ( data && data.events ) {+ for ( var type in data.events ) {+ if ( special[ type ] ) {+ jQuery.event.remove( elem, type );++ // This is a shortcut to avoid jQuery.event.remove's overhead+ } else {+ jQuery.removeEvent( elem, type, data.handle );+ }+ }++ // Null the DOM reference to avoid IE6/7/8 leak (#7054)+ if ( data.handle ) {+ data.handle.elem = null;+ }+ }++ if ( deleteExpando ) {+ delete elem[ jQuery.expando ];++ } else if ( elem.removeAttribute ) {+ elem.removeAttribute( jQuery.expando );+ }++ delete cache[ id ];+ }+ }+ }+});++function evalScript( i, elem ) {+ if ( elem.src ) {+ jQuery.ajax({+ url: elem.src,+ async: false,+ dataType: "script"+ });+ } else {+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );+ }++ if ( elem.parentNode ) {+ elem.parentNode.removeChild( elem );+ }+}+++++var ralpha = /alpha\([^)]*\)/i,+ ropacity = /opacity=([^)]*)/,+ rdashAlpha = /-([a-z])/ig,+ // fixed for IE9, see #8346+ rupper = /([A-Z]|^ms)/g,+ rnumpx = /^-?\d+(?:px)?$/i,+ rnum = /^-?\d/,+ rrelNum = /^[+\-]=/,+ rrelNumFilter = /[^+\-\.\de]+/g,++ cssShow = { position: "absolute", visibility: "hidden", display: "block" },+ cssWidth = [ "Left", "Right" ],+ cssHeight = [ "Top", "Bottom" ],+ curCSS,++ getComputedStyle,+ currentStyle,++ fcamelCase = function( all, letter ) {+ return letter.toUpperCase();+ };++jQuery.fn.css = function( name, value ) {+ // Setting 'undefined' is a no-op+ if ( arguments.length === 2 && value === undefined ) {+ return this;+ }++ return jQuery.access( this, name, value, true, function( elem, name, value ) {+ return value !== undefined ?+ jQuery.style( elem, name, value ) :+ jQuery.css( elem, name );+ });+};++jQuery.extend({+ // Add in style property hooks for overriding the default+ // behavior of getting and setting a style property+ cssHooks: {+ opacity: {+ get: function( elem, computed ) {+ if ( computed ) {+ // We should always get a number back from opacity+ var ret = curCSS( elem, "opacity", "opacity" );+ return ret === "" ? "1" : ret;++ } else {+ return elem.style.opacity;+ }+ }+ }+ },++ // Exclude the following css properties to add px+ cssNumber: {+ "zIndex": true,+ "fontWeight": true,+ "opacity": true,+ "zoom": true,+ "lineHeight": true,+ "widows": true,+ "orphans": true+ },++ // Add in properties whose names you wish to fix before+ // setting or getting the value+ cssProps: {+ // normalize float css property+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"+ },++ // Get and set the style property on a DOM Node+ style: function( elem, name, value, extra ) {+ // Don't set styles on text and comment nodes+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {+ return;+ }++ // Make sure that we're working with the right name+ var ret, type, origName = jQuery.camelCase( name ),+ style = elem.style, hooks = jQuery.cssHooks[ origName ];++ name = jQuery.cssProps[ origName ] || origName;++ // Check if we're setting a value+ if ( value !== undefined ) {+ type = typeof value;++ // Make sure that NaN and null values aren't set. See: #7116+ if ( type === "number" && isNaN( value ) || value == null ) {+ return;+ }++ // convert relative number strings (+= or -=) to relative numbers. #7345+ if ( type === "string" && rrelNum.test( value ) ) {+ value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );+ }++ // If a number was passed in, add 'px' to the (except for certain CSS properties)+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {+ value += "px";+ }++ // If a hook was provided, use that value, otherwise just set the specified value+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided+ // Fixes bug #5509+ try {+ style[ name ] = value;+ } catch(e) {}+ }++ } else {+ // If a hook was provided get the non-computed value from there+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {+ return ret;+ }++ // Otherwise just get the value from the style object+ return style[ name ];+ }+ },++ css: function( elem, name, extra ) {+ var ret, hooks;++ // Make sure that we're working with the right name+ name = jQuery.camelCase( name );+ hooks = jQuery.cssHooks[ name ];+ name = jQuery.cssProps[ name ] || name;++ // cssFloat needs a special treatment+ if ( name === "cssFloat" ) {+ name = "float";+ }++ // If a hook was provided get the computed value from there+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {+ return ret;++ // Otherwise, if a way to get the computed value exists, use that+ } else if ( curCSS ) {+ return curCSS( elem, name );+ }+ },++ // A method for quickly swapping in/out CSS properties to get correct calculations+ swap: function( elem, options, callback ) {+ var old = {};++ // Remember the old values, and insert the new ones+ for ( var name in options ) {+ old[ name ] = elem.style[ name ];+ elem.style[ name ] = options[ name ];+ }++ callback.call( elem );++ // Revert the old values+ for ( name in options ) {+ elem.style[ name ] = old[ name ];+ }+ },++ camelCase: function( string ) {+ return string.replace( rdashAlpha, fcamelCase );+ }+});++// DEPRECATED, Use jQuery.css() instead+jQuery.curCSS = jQuery.css;++jQuery.each(["height", "width"], function( i, name ) {+ jQuery.cssHooks[ name ] = {+ get: function( elem, computed, extra ) {+ var val;++ if ( computed ) {+ if ( elem.offsetWidth !== 0 ) {+ val = getWH( elem, name, extra );++ } else {+ jQuery.swap( elem, cssShow, function() {+ val = getWH( elem, name, extra );+ });+ }++ if ( val <= 0 ) {+ val = curCSS( elem, name, name );++ if ( val === "0px" && currentStyle ) {+ val = currentStyle( elem, name, name );+ }++ if ( val != null ) {+ // Should return "auto" instead of 0, use 0 for+ // temporary backwards-compat+ return val === "" || val === "auto" ? "0px" : val;+ }+ }++ if ( val < 0 || val == null ) {+ val = elem.style[ name ];++ // Should return "auto" instead of 0, use 0 for+ // temporary backwards-compat+ return val === "" || val === "auto" ? "0px" : val;+ }++ return typeof val === "string" ? val : val + "px";+ }+ },++ set: function( elem, value ) {+ if ( rnumpx.test( value ) ) {+ // ignore negative width and height values #1599+ value = parseFloat(value);++ if ( value >= 0 ) {+ return value + "px";+ }++ } else {+ return value;+ }+ }+ };+});++if ( !jQuery.support.opacity ) {+ jQuery.cssHooks.opacity = {+ get: function( elem, computed ) {+ // IE uses filters for opacity+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :+ computed ? "1" : "";+ },++ set: function( elem, value ) {+ var style = elem.style,+ currentStyle = elem.currentStyle;++ // IE has trouble with opacity if it does not have layout+ // Force it by setting the zoom level+ style.zoom = 1;++ // Set the alpha filter to set the opacity+ var opacity = jQuery.isNaN( value ) ?+ "" :+ "alpha(opacity=" + value * 100 + ")",+ filter = currentStyle && currentStyle.filter || style.filter || "";++ style.filter = ralpha.test( filter ) ?+ filter.replace( ralpha, opacity ) :+ filter + " " + opacity;+ }+ };+}++jQuery(function() {+ // This hook cannot be added until DOM ready because the support test+ // for it is not run until after DOM ready+ if ( !jQuery.support.reliableMarginRight ) {+ jQuery.cssHooks.marginRight = {+ get: function( elem, computed ) {+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right+ // Work around by temporarily setting element display to inline-block+ var ret;+ jQuery.swap( elem, { "display": "inline-block" }, function() {+ if ( computed ) {+ ret = curCSS( elem, "margin-right", "marginRight" );+ } else {+ ret = elem.style.marginRight;+ }+ });+ return ret;+ }+ };+ }+});++if ( document.defaultView && document.defaultView.getComputedStyle ) {+ getComputedStyle = function( elem, name ) {+ var ret, defaultView, computedStyle;++ name = name.replace( rupper, "-$1" ).toLowerCase();++ if ( !(defaultView = elem.ownerDocument.defaultView) ) {+ return undefined;+ }++ if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {+ ret = computedStyle.getPropertyValue( name );+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {+ ret = jQuery.style( elem, name );+ }+ }++ return ret;+ };+}++if ( document.documentElement.currentStyle ) {+ currentStyle = function( elem, name ) {+ var left,+ ret = elem.currentStyle && elem.currentStyle[ name ],+ rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],+ style = elem.style;++ // From the awesome hack by Dean Edwards+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291++ // If we're not dealing with a regular pixel number+ // but a number that has a weird ending, we need to convert it to pixels+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {+ // Remember the original values+ left = style.left;++ // Put in the new values to get a computed value out+ if ( rsLeft ) {+ elem.runtimeStyle.left = elem.currentStyle.left;+ }+ style.left = name === "fontSize" ? "1em" : (ret || 0);+ ret = style.pixelLeft + "px";++ // Revert the changed values+ style.left = left;+ if ( rsLeft ) {+ elem.runtimeStyle.left = rsLeft;+ }+ }++ return ret === "" ? "auto" : ret;+ };+}++curCSS = getComputedStyle || currentStyle;++function getWH( elem, name, extra ) {+ var which = name === "width" ? cssWidth : cssHeight,+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight;++ if ( extra === "border" ) {+ return val;+ }++ jQuery.each( which, function() {+ if ( !extra ) {+ val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;+ }++ if ( extra === "margin" ) {+ val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;++ } else {+ val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;+ }+ });++ return val;+}++if ( jQuery.expr && jQuery.expr.filters ) {+ jQuery.expr.filters.hidden = function( elem ) {+ var width = elem.offsetWidth,+ height = elem.offsetHeight;++ return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");+ };++ jQuery.expr.filters.visible = function( elem ) {+ return !jQuery.expr.filters.hidden( elem );+ };+}+++++var r20 = /%20/g,+ rbracket = /\[\]$/,+ rCRLF = /\r?\n/g,+ rhash = /#.*$/,+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL+ rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,+ // #7653, #8125, #8152: local protocol detection+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,+ rnoContent = /^(?:GET|HEAD)$/,+ rprotocol = /^\/\//,+ rquery = /\?/,+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,+ rselectTextarea = /^(?:select|textarea)/i,+ rspacesAjax = /\s+/,+ rts = /([?&])_=[^&]*/,+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,++ // Keep a copy of the old load method+ _load = jQuery.fn.load,++ /* Prefilters+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)+ * 2) These are called:+ * - BEFORE asking for a transport+ * - AFTER param serialization (s.data is a string if s.processData is true)+ * 3) key is the dataType+ * 4) the catchall symbol "*" can be used+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed+ */+ prefilters = {},++ /* Transports bindings+ * 1) key is the dataType+ * 2) the catchall symbol "*" can be used+ * 3) selection will start with transport dataType and THEN go to "*" if needed+ */+ transports = {},++ // Document location+ ajaxLocation,++ // Document location segments+ ajaxLocParts;++// #8138, IE may throw an exception when accessing+// a field from window.location if document.domain has been set+try {+ ajaxLocation = location.href;+} catch( e ) {+ // Use the href attribute of an A element+ // since IE will modify it given document.location+ ajaxLocation = document.createElement( "a" );+ ajaxLocation.href = "";+ ajaxLocation = ajaxLocation.href;+}++// Segment location into parts+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];++// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport+function addToPrefiltersOrTransports( structure ) {++ // dataTypeExpression is optional and defaults to "*"+ return function( dataTypeExpression, func ) {++ if ( typeof dataTypeExpression !== "string" ) {+ func = dataTypeExpression;+ dataTypeExpression = "*";+ }++ if ( jQuery.isFunction( func ) ) {+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),+ i = 0,+ length = dataTypes.length,+ dataType,+ list,+ placeBefore;++ // For each dataType in the dataTypeExpression+ for(; i < length; i++ ) {+ dataType = dataTypes[ i ];+ // We control if we're asked to add before+ // any existing element+ placeBefore = /^\+/.test( dataType );+ if ( placeBefore ) {+ dataType = dataType.substr( 1 ) || "*";+ }+ list = structure[ dataType ] = structure[ dataType ] || [];+ // then we add to the structure accordingly+ list[ placeBefore ? "unshift" : "push" ]( func );+ }+ }+ };+}++// Base inspection function for prefilters and transports+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,+ dataType /* internal */, inspected /* internal */ ) {++ dataType = dataType || options.dataTypes[ 0 ];+ inspected = inspected || {};++ inspected[ dataType ] = true;++ var list = structure[ dataType ],+ i = 0,+ length = list ? list.length : 0,+ executeOnly = ( structure === prefilters ),+ selection;++ for(; i < length && ( executeOnly || !selection ); i++ ) {+ selection = list[ i ]( options, originalOptions, jqXHR );+ // If we got redirected to another dataType+ // we try there if executing only and not done already+ if ( typeof selection === "string" ) {+ if ( !executeOnly || inspected[ selection ] ) {+ selection = undefined;+ } else {+ options.dataTypes.unshift( selection );+ selection = inspectPrefiltersOrTransports(+ structure, options, originalOptions, jqXHR, selection, inspected );+ }+ }+ }+ // If we're only executing or nothing was selected+ // we try the catchall dataType if not done already+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {+ selection = inspectPrefiltersOrTransports(+ structure, options, originalOptions, jqXHR, "*", inspected );+ }+ // unnecessary when only executing (prefilters)+ // but it'll be ignored by the caller in that case+ return selection;+}++jQuery.fn.extend({+ load: function( url, params, callback ) {+ if ( typeof url !== "string" && _load ) {+ return _load.apply( this, arguments );++ // Don't do a request if no elements are being requested+ } else if ( !this.length ) {+ return this;+ }++ var off = url.indexOf( " " );+ if ( off >= 0 ) {+ var selector = url.slice( off, url.length );+ url = url.slice( 0, off );+ }++ // Default to a GET request+ var type = "GET";++ // If the second parameter was provided+ if ( params ) {+ // If it's a function+ if ( jQuery.isFunction( params ) ) {+ // We assume that it's the callback+ callback = params;+ params = undefined;++ // Otherwise, build a param string+ } else if ( typeof params === "object" ) {+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );+ type = "POST";+ }+ }++ var self = this;++ // Request the remote document+ jQuery.ajax({+ url: url,+ type: type,+ dataType: "html",+ data: params,+ // Complete callback (responseText is used internally)+ complete: function( jqXHR, status, responseText ) {+ // Store the response as specified by the jqXHR object+ responseText = jqXHR.responseText;+ // If successful, inject the HTML into all the matched elements+ if ( jqXHR.isResolved() ) {+ // #4825: Get the actual response in case+ // a dataFilter is present in ajaxSettings+ jqXHR.done(function( r ) {+ responseText = r;+ });+ // See if a selector was specified+ self.html( selector ?+ // Create a dummy div to hold the results+ jQuery("<div>")+ // inject the contents of the document in, removing the scripts+ // to avoid any 'Permission Denied' errors in IE+ .append(responseText.replace(rscript, ""))++ // Locate the specified elements+ .find(selector) :++ // If not, just inject the full result+ responseText );+ }++ if ( callback ) {+ self.each( callback, [ responseText, status, jqXHR ] );+ }+ }+ });++ return this;+ },++ serialize: function() {+ return jQuery.param( this.serializeArray() );+ },++ serializeArray: function() {+ return this.map(function(){+ return this.elements ? jQuery.makeArray( this.elements ) : this;+ })+ .filter(function(){+ return this.name && !this.disabled &&+ ( this.checked || rselectTextarea.test( this.nodeName ) ||+ rinput.test( this.type ) );+ })+ .map(function( i, elem ){+ var val = jQuery( this ).val();++ return val == null ?+ null :+ jQuery.isArray( val ) ?+ jQuery.map( val, function( val, i ){+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };+ }) :+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };+ }).get();+ }+});++// Attach a bunch of functions for handling common AJAX events+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){+ jQuery.fn[ o ] = function( f ){+ return this.bind( o, f );+ };+});++jQuery.each( [ "get", "post" ], function( i, method ) {+ jQuery[ method ] = function( url, data, callback, type ) {+ // shift arguments if data argument was omitted+ if ( jQuery.isFunction( data ) ) {+ type = type || callback;+ callback = data;+ data = undefined;+ }++ return jQuery.ajax({+ type: method,+ url: url,+ data: data,+ success: callback,+ dataType: type+ });+ };+});++jQuery.extend({++ getScript: function( url, callback ) {+ return jQuery.get( url, undefined, callback, "script" );+ },++ getJSON: function( url, data, callback ) {+ return jQuery.get( url, data, callback, "json" );+ },++ // Creates a full fledged settings object into target+ // with both ajaxSettings and settings fields.+ // If target is omitted, writes into ajaxSettings.+ ajaxSetup: function ( target, settings ) {+ if ( !settings ) {+ // Only one parameter, we extend ajaxSettings+ settings = target;+ target = jQuery.extend( true, jQuery.ajaxSettings, settings );+ } else {+ // target was provided, we extend into it+ jQuery.extend( true, target, jQuery.ajaxSettings, settings );+ }+ // Flatten fields we don't want deep extended+ for( var field in { context: 1, url: 1 } ) {+ if ( field in settings ) {+ target[ field ] = settings[ field ];+ } else if( field in jQuery.ajaxSettings ) {+ target[ field ] = jQuery.ajaxSettings[ field ];+ }+ }+ return target;+ },++ ajaxSettings: {+ url: ajaxLocation,+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),+ global: true,+ type: "GET",+ contentType: "application/x-www-form-urlencoded",+ processData: true,+ async: true,+ /*+ timeout: 0,+ data: null,+ dataType: null,+ username: null,+ password: null,+ cache: null,+ traditional: false,+ headers: {},+ */++ 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"+ },++ // List of data converters+ // 1) key format is "source_type destination_type" (a single space in-between)+ // 2) the catchall symbol "*" can be used for source_type+ converters: {++ // Convert anything to text+ "* text": window.String,++ // Text to html (true = no transformation)+ "text html": true,++ // Evaluate text as a json expression+ "text json": jQuery.parseJSON,++ // Parse text as xml+ "text xml": jQuery.parseXML+ }+ },++ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),+ ajaxTransport: addToPrefiltersOrTransports( transports ),++ // Main method+ ajax: function( url, options ) {++ // If url is an object, simulate pre-1.5 signature+ if ( typeof url === "object" ) {+ options = url;+ url = undefined;+ }++ // Force options to be an object+ options = options || {};++ var // Create the final options object+ s = jQuery.ajaxSetup( {}, options ),+ // Callbacks context+ callbackContext = s.context || s,+ // Context for global events+ // It's the callbackContext if one was provided in the options+ // and if it's a DOM node or a jQuery collection+ globalEventContext = callbackContext !== s &&+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?+ jQuery( callbackContext ) : jQuery.event,+ // Deferreds+ deferred = jQuery.Deferred(),+ completeDeferred = jQuery._Deferred(),+ // Status-dependent callbacks+ statusCode = s.statusCode || {},+ // ifModified key+ ifModifiedKey,+ // Headers (they are sent all at once)+ requestHeaders = {},+ requestHeadersNames = {},+ // Response headers+ responseHeadersString,+ responseHeaders,+ // transport+ transport,+ // timeout handle+ timeoutTimer,+ // Cross-domain detection vars+ parts,+ // The jqXHR state+ state = 0,+ // To know if global events are to be dispatched+ fireGlobals,+ // Loop variable+ i,+ // Fake xhr+ jqXHR = {++ readyState: 0,++ // Caches the header+ setRequestHeader: function( name, value ) {+ if ( !state ) {+ var lname = name.toLowerCase();+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;+ requestHeaders[ name ] = value;+ }+ return this;+ },++ // Raw string+ getAllResponseHeaders: function() {+ return state === 2 ? responseHeadersString : null;+ },++ // Builds headers hashtable if needed+ getResponseHeader: function( key ) {+ var match;+ if ( state === 2 ) {+ if ( !responseHeaders ) {+ responseHeaders = {};+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];+ }+ }+ match = responseHeaders[ key.toLowerCase() ];+ }+ return match === undefined ? null : match;+ },++ // Overrides response content-type header+ overrideMimeType: function( type ) {+ if ( !state ) {+ s.mimeType = type;+ }+ return this;+ },++ // Cancel the request+ abort: function( statusText ) {+ statusText = statusText || "abort";+ if ( transport ) {+ transport.abort( statusText );+ }+ done( 0, statusText );+ return this;+ }+ };++ // Callback for when everything is done+ // It is defined here because jslint complains if it is declared+ // at the end of the function (which would be more logical and readable)+ function done( status, statusText, responses, headers ) {++ // Called once+ if ( state === 2 ) {+ return;+ }++ // State is "done" now+ state = 2;++ // Clear timeout if it exists+ if ( timeoutTimer ) {+ clearTimeout( timeoutTimer );+ }++ // Dereference transport for early garbage collection+ // (no matter how long the jqXHR object will be used)+ transport = undefined;++ // Cache response headers+ responseHeadersString = headers || "";++ // Set readyState+ jqXHR.readyState = status ? 4 : 0;++ var isSuccess,+ success,+ error,+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,+ lastModified,+ etag;++ // If successful, handle type chaining+ if ( status >= 200 && status < 300 || status === 304 ) {++ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.+ if ( s.ifModified ) {++ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {+ jQuery.lastModified[ ifModifiedKey ] = lastModified;+ }+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {+ jQuery.etag[ ifModifiedKey ] = etag;+ }+ }++ // If not modified+ if ( status === 304 ) {++ statusText = "notmodified";+ isSuccess = true;++ // If we have data+ } else {++ try {+ success = ajaxConvert( s, response );+ statusText = "success";+ isSuccess = true;+ } catch(e) {+ // We have a parsererror+ statusText = "parsererror";+ error = e;+ }+ }+ } else {+ // We extract error from statusText+ // then normalize statusText and status for non-aborts+ error = statusText;+ if( !statusText || status ) {+ statusText = "error";+ if ( status < 0 ) {+ status = 0;+ }+ }+ }++ // Set data for the fake xhr object+ jqXHR.status = status;+ jqXHR.statusText = statusText;++ // Success/Error+ if ( isSuccess ) {+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );+ } else {+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );+ }++ // Status-dependent callbacks+ jqXHR.statusCode( statusCode );+ statusCode = undefined;++ if ( fireGlobals ) {+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),+ [ jqXHR, s, isSuccess ? success : error ] );+ }++ // Complete+ completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );++ if ( fireGlobals ) {+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] );+ // Handle the global AJAX counter+ if ( !( --jQuery.active ) ) {+ jQuery.event.trigger( "ajaxStop" );+ }+ }+ }++ // Attach deferreds+ deferred.promise( jqXHR );+ jqXHR.success = jqXHR.done;+ jqXHR.error = jqXHR.fail;+ jqXHR.complete = completeDeferred.done;++ // Status-dependent callbacks+ jqXHR.statusCode = function( map ) {+ if ( map ) {+ var tmp;+ if ( state < 2 ) {+ for( tmp in map ) {+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];+ }+ } else {+ tmp = map[ jqXHR.status ];+ jqXHR.then( tmp, tmp );+ }+ }+ return this;+ };++ // Remove hash character (#7531: and string promotion)+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)+ // We also use the url parameter if available+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );++ // Extract dataTypes list+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );++ // Determine if a cross-domain request is in order+ if ( s.crossDomain == null ) {+ parts = rurl.exec( s.url.toLowerCase() );+ s.crossDomain = !!( parts &&+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )+ );+ }++ // Convert data if not already a string+ if ( s.data && s.processData && typeof s.data !== "string" ) {+ s.data = jQuery.param( s.data, s.traditional );+ }++ // Apply prefilters+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );++ // If request was aborted inside a prefiler, stop there+ if ( state === 2 ) {+ return false;+ }++ // We can fire global events as of now if asked to+ fireGlobals = s.global;++ // Uppercase the type+ s.type = s.type.toUpperCase();++ // Determine if request has content+ s.hasContent = !rnoContent.test( s.type );++ // Watch for a new set of requests+ if ( fireGlobals && jQuery.active++ === 0 ) {+ jQuery.event.trigger( "ajaxStart" );+ }++ // More options handling for requests with no content+ if ( !s.hasContent ) {++ // If data is available, append data to url+ if ( s.data ) {+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;+ }++ // Get ifModifiedKey before adding the anti-cache parameter+ ifModifiedKey = s.url;++ // Add anti-cache in url if needed+ if ( s.cache === false ) {++ var ts = jQuery.now(),+ // try replacing _= if it is there+ ret = s.url.replace( rts, "$1_=" + ts );++ // if nothing was replaced, add timestamp to the end+ s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );+ }+ }++ // Set the correct header, if data is being sent+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {+ jqXHR.setRequestHeader( "Content-Type", s.contentType );+ }++ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.+ if ( s.ifModified ) {+ ifModifiedKey = ifModifiedKey || s.url;+ if ( jQuery.lastModified[ ifModifiedKey ] ) {+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );+ }+ if ( jQuery.etag[ ifModifiedKey ] ) {+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );+ }+ }++ // Set the Accepts header for the server, depending on the dataType+ jqXHR.setRequestHeader(+ "Accept",+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :+ s.accepts[ "*" ]+ );++ // Check for headers option+ for ( i in s.headers ) {+ jqXHR.setRequestHeader( i, s.headers[ i ] );+ }++ // Allow custom headers/mimetypes and early abort+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {+ // Abort if not done already+ jqXHR.abort();+ return false;++ }++ // Install callbacks on deferreds+ for ( i in { success: 1, error: 1, complete: 1 } ) {+ jqXHR[ i ]( s[ i ] );+ }++ // Get transport+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );++ // If no transport, we auto-abort+ if ( !transport ) {+ done( -1, "No Transport" );+ } else {+ jqXHR.readyState = 1;+ // Send global event+ if ( fireGlobals ) {+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );+ }+ // Timeout+ if ( s.async && s.timeout > 0 ) {+ timeoutTimer = setTimeout( function(){+ jqXHR.abort( "timeout" );+ }, s.timeout );+ }++ try {+ state = 1;+ transport.send( requestHeaders, done );+ } catch (e) {+ // Propagate exception as error if not done+ if ( status < 2 ) {+ done( -1, e );+ // Simply rethrow otherwise+ } else {+ jQuery.error( e );+ }+ }+ }++ return jqXHR;+ },++ // Serialize an array of form elements or a set of+ // key/values into a query string+ param: function( a, traditional ) {+ var s = [],+ add = function( key, value ) {+ // If value is a function, invoke it and return its value+ value = jQuery.isFunction( value ) ? value() : value;+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );+ };++ // Set traditional to true for jQuery <= 1.3.2 behavior.+ if ( traditional === undefined ) {+ traditional = jQuery.ajaxSettings.traditional;+ }++ // If an array was passed in, assume that it is an array of form elements.+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {+ // Serialize the form elements+ jQuery.each( a, function() {+ add( this.name, this.value );+ });++ } else {+ // If traditional, encode the "old" way (the way 1.3.2 or older+ // did it), otherwise encode params recursively.+ for ( var prefix in a ) {+ buildParams( prefix, a[ prefix ], traditional, add );+ }+ }++ // Return the resulting serialization+ return s.join( "&" ).replace( r20, "+" );+ }+});++function buildParams( prefix, obj, traditional, add ) {+ if ( jQuery.isArray( obj ) ) {+ // Serialize array item.+ jQuery.each( obj, function( i, v ) {+ if ( traditional || rbracket.test( prefix ) ) {+ // Treat each array item as a scalar.+ add( prefix, v );++ } else {+ // If array item is non-scalar (array or object), encode its+ // numeric index to resolve deserialization ambiguity issues.+ // Note that rack (as of 1.0.0) can't currently deserialize+ // nested arrays properly, and attempting to do so may cause+ // a server error. Possible fixes are to modify rack's+ // deserialization algorithm or to provide an option or flag+ // to force array serialization to be shallow.+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );+ }+ });++ } else if ( !traditional && obj != null && typeof obj === "object" ) {+ // Serialize object item.+ for ( var name in obj ) {+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );+ }++ } else {+ // Serialize scalar item.+ add( prefix, obj );+ }+}++// This is still on the jQuery object... for now+// Want to move this to jQuery.ajax some day+jQuery.extend({++ // Counter for holding the number of active queries+ active: 0,++ // Last-Modified header cache for next request+ lastModified: {},+ etag: {}++});++/* Handles responses to an ajax request:+ * - sets all responseXXX fields accordingly+ * - finds the right dataType (mediates between content-type and expected dataType)+ * - returns the corresponding response+ */+function ajaxHandleResponses( s, jqXHR, responses ) {++ var contents = s.contents,+ dataTypes = s.dataTypes,+ responseFields = s.responseFields,+ ct,+ type,+ finalDataType,+ firstDataType;++ // Fill responseXXX fields+ for( type in responseFields ) {+ if ( type in responses ) {+ jqXHR[ responseFields[type] ] = responses[ type ];+ }+ }++ // Remove auto dataType and get content-type in the process+ while( dataTypes[ 0 ] === "*" ) {+ dataTypes.shift();+ if ( ct === undefined ) {+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );+ }+ }++ // Check if we're dealing with a known content-type+ if ( ct ) {+ for ( type in contents ) {+ if ( contents[ type ] && contents[ type ].test( ct ) ) {+ dataTypes.unshift( type );+ break;+ }+ }+ }++ // Check to see if we have a response for the expected dataType+ if ( dataTypes[ 0 ] in responses ) {+ finalDataType = dataTypes[ 0 ];+ } else {+ // Try convertible dataTypes+ for ( type in responses ) {+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {+ finalDataType = type;+ break;+ }+ if ( !firstDataType ) {+ firstDataType = type;+ }+ }+ // Or just use first one+ finalDataType = finalDataType || firstDataType;+ }++ // If we found a dataType+ // We add the dataType to the list if needed+ // and return the corresponding response+ if ( finalDataType ) {+ if ( finalDataType !== dataTypes[ 0 ] ) {+ dataTypes.unshift( finalDataType );+ }+ return responses[ finalDataType ];+ }+}++// Chain conversions given the request and the original response+function ajaxConvert( s, response ) {++ // Apply the dataFilter if provided+ if ( s.dataFilter ) {+ response = s.dataFilter( response, s.dataType );+ }++ var dataTypes = s.dataTypes,+ converters = {},+ i,+ key,+ length = dataTypes.length,+ tmp,+ // Current and previous dataTypes+ current = dataTypes[ 0 ],+ prev,+ // Conversion expression+ conversion,+ // Conversion function+ conv,+ // Conversion functions (transitive conversion)+ conv1,+ conv2;++ // For each dataType in the chain+ for( i = 1; i < length; i++ ) {++ // Create converters map+ // with lowercased keys+ if ( i === 1 ) {+ for( key in s.converters ) {+ if( typeof key === "string" ) {+ converters[ key.toLowerCase() ] = s.converters[ key ];+ }+ }+ }++ // Get the dataTypes+ prev = current;+ current = dataTypes[ i ];++ // If current is auto dataType, update it to prev+ if( current === "*" ) {+ current = prev;+ // If no auto and dataTypes are actually different+ } else if ( prev !== "*" && prev !== current ) {++ // Get the converter+ conversion = prev + " " + current;+ conv = converters[ conversion ] || converters[ "* " + current ];++ // If there is no direct converter, search transitively+ if ( !conv ) {+ conv2 = undefined;+ for( conv1 in converters ) {+ tmp = conv1.split( " " );+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {+ conv2 = converters[ tmp[1] + " " + current ];+ if ( conv2 ) {+ conv1 = converters[ conv1 ];+ if ( conv1 === true ) {+ conv = conv2;+ } else if ( conv2 === true ) {+ conv = conv1;+ }+ break;+ }+ }+ }+ }+ // If we found no converter, dispatch an error+ if ( !( conv || conv2 ) ) {+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );+ }+ // If found converter is not an equivalence+ if ( conv !== true ) {+ // Convert with 1 or 2 converters accordingly+ response = conv ? conv( response ) : conv2( conv1(response) );+ }+ }+ }+ return response;+}+++++var jsc = jQuery.now(),+ jsre = /(\=)\?(&|$)|\?\?/i;++// Default jsonp settings+jQuery.ajaxSetup({+ jsonp: "callback",+ jsonpCallback: function() {+ return jQuery.expando + "_" + ( jsc++ );+ }+});++// Detect, normalize options and install callbacks for jsonp requests+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {++ var inspectData = s.contentType === "application/x-www-form-urlencoded" &&+ ( typeof s.data === "string" );++ if ( s.dataTypes[ 0 ] === "jsonp" ||+ s.jsonp !== false && ( jsre.test( s.url ) ||+ inspectData && jsre.test( s.data ) ) ) {++ var responseContainer,+ jsonpCallback = s.jsonpCallback =+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,+ previous = window[ jsonpCallback ],+ url = s.url,+ data = s.data,+ replace = "$1" + jsonpCallback + "$2";++ if ( s.jsonp !== false ) {+ url = url.replace( jsre, replace );+ if ( s.url === url ) {+ if ( inspectData ) {+ data = data.replace( jsre, replace );+ }+ if ( s.data === data ) {+ // Add callback manually+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;+ }+ }+ }++ s.url = url;+ s.data = data;++ // Install callback+ window[ jsonpCallback ] = function( response ) {+ responseContainer = [ response ];+ };++ // Clean-up function+ jqXHR.always(function() {+ // Set callback back to previous value+ window[ jsonpCallback ] = previous;+ // Call if it was a function and we have a response+ if ( responseContainer && jQuery.isFunction( previous ) ) {+ window[ jsonpCallback ]( responseContainer[ 0 ] );+ }+ });++ // Use data converter to retrieve json after script execution+ s.converters["script json"] = function() {+ if ( !responseContainer ) {+ jQuery.error( jsonpCallback + " was not called" );+ }+ return responseContainer[ 0 ];+ };++ // force json dataType+ s.dataTypes[ 0 ] = "json";++ // Delegate to script+ return "script";+ }+});+++++// Install script dataType+jQuery.ajaxSetup({+ accepts: {+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"+ },+ contents: {+ script: /javascript|ecmascript/+ },+ converters: {+ "text script": function( text ) {+ jQuery.globalEval( text );+ return text;+ }+ }+});++// Handle cache's special case and global+jQuery.ajaxPrefilter( "script", function( s ) {+ if ( s.cache === undefined ) {+ s.cache = false;+ }+ if ( s.crossDomain ) {+ s.type = "GET";+ s.global = false;+ }+});++// Bind script tag hack transport+jQuery.ajaxTransport( "script", function(s) {++ // This transport only deals with cross domain requests+ if ( s.crossDomain ) {++ var script,+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;++ return {++ send: function( _, callback ) {++ script = document.createElement( "script" );++ script.async = "async";++ if ( s.scriptCharset ) {+ script.charset = s.scriptCharset;+ }++ script.src = s.url;++ // Attach handlers for all browsers+ script.onload = script.onreadystatechange = function( _, isAbort ) {++ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {++ // Handle memory leak in IE+ script.onload = script.onreadystatechange = null;++ // Remove the script+ if ( head && script.parentNode ) {+ head.removeChild( script );+ }++ // Dereference the script+ script = undefined;++ // Callback if not abort+ if ( !isAbort ) {+ callback( 200, "success" );+ }+ }+ };+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.+ // This arises when a base node is used (#2709 and #4378).+ head.insertBefore( script, head.firstChild );+ },++ abort: function() {+ if ( script ) {+ script.onload( 0, 1 );+ }+ }+ };+ }+});+++++var // #5280: Internet Explorer will keep connections alive if we don't abort on unload+ xhrOnUnloadAbort = window.ActiveXObject ? function() {+ // Abort all pending requests+ for ( var key in xhrCallbacks ) {+ xhrCallbacks[ key ]( 0, 1 );+ }+ } : false,+ xhrId = 0,+ xhrCallbacks;++// Functions to create xhrs+function createStandardXHR() {+ try {+ return new window.XMLHttpRequest();+ } catch( e ) {}+}++function createActiveXHR() {+ try {+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );+ } catch( e ) {}+}++// Create the request object+// (This is still attached to ajaxSettings for backward compatibility)+jQuery.ajaxSettings.xhr = window.ActiveXObject ?+ /* Microsoft failed to properly+ * implement the XMLHttpRequest in IE7 (can't request local files),+ * so we use the ActiveXObject when it is available+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so+ * we need a fallback.+ */+ function() {+ return !this.isLocal && createStandardXHR() || createActiveXHR();+ } :+ // For all other browsers, use the standard XMLHttpRequest object+ createStandardXHR;++// Determine support properties+(function( xhr ) {+ jQuery.extend( jQuery.support, {+ ajax: !!xhr,+ cors: !!xhr && ( "withCredentials" in xhr )+ });+})( jQuery.ajaxSettings.xhr() );++// Create transport if the browser can provide an xhr+if ( jQuery.support.ajax ) {++ jQuery.ajaxTransport(function( s ) {+ // Cross domain only allowed if supported through XMLHttpRequest+ if ( !s.crossDomain || jQuery.support.cors ) {++ var callback;++ return {+ send: function( headers, complete ) {++ // Get a new xhr+ var xhr = s.xhr(),+ handle,+ i;++ // Open the socket+ // Passing null username, generates a login popup on Opera (#2865)+ if ( s.username ) {+ xhr.open( s.type, s.url, s.async, s.username, s.password );+ } else {+ xhr.open( s.type, s.url, s.async );+ }++ // Apply custom fields if provided+ if ( s.xhrFields ) {+ for ( i in s.xhrFields ) {+ xhr[ i ] = s.xhrFields[ i ];+ }+ }++ // Override mime type if needed+ if ( s.mimeType && xhr.overrideMimeType ) {+ xhr.overrideMimeType( s.mimeType );+ }++ // X-Requested-With header+ // For cross-domain requests, seeing as conditions for a preflight are+ // akin to a jigsaw puzzle, we simply never set it to be sure.+ // (it can always be set on a per-request basis or even using ajaxSetup)+ // For same-domain requests, won't change header if already provided.+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {+ headers[ "X-Requested-With" ] = "XMLHttpRequest";+ }++ // Need an extra try/catch for cross domain requests in Firefox 3+ try {+ for ( i in headers ) {+ xhr.setRequestHeader( i, headers[ i ] );+ }+ } catch( _ ) {}++ // Do send the request+ // This may raise an exception which is actually+ // handled in jQuery.ajax (so no try/catch here)+ xhr.send( ( s.hasContent && s.data ) || null );++ // Listener+ callback = function( _, isAbort ) {++ var status,+ statusText,+ responseHeaders,+ responses,+ xml;++ // Firefox throws exceptions when accessing properties+ // of an xhr when a network error occured+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)+ try {++ // Was never called and is aborted or complete+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {++ // Only called once+ callback = undefined;++ // Do not keep as active anymore+ if ( handle ) {+ xhr.onreadystatechange = jQuery.noop;+ if ( xhrOnUnloadAbort ) {+ delete xhrCallbacks[ handle ];+ }+ }++ // If it's an abort+ if ( isAbort ) {+ // Abort it manually if needed+ if ( xhr.readyState !== 4 ) {+ xhr.abort();+ }+ } else {+ status = xhr.status;+ responseHeaders = xhr.getAllResponseHeaders();+ responses = {};+ xml = xhr.responseXML;++ // Construct response list+ if ( xml && xml.documentElement /* #4958 */ ) {+ responses.xml = xml;+ }+ responses.text = xhr.responseText;++ // Firefox throws an exception when accessing+ // statusText for faulty cross-domain requests+ try {+ statusText = xhr.statusText;+ } catch( e ) {+ // We normalize with Webkit giving an empty statusText+ statusText = "";+ }++ // Filter status for non standard behaviors++ // If the request is local and we have data: assume a success+ // (success with no data won't get notified, that's the best we+ // can do given current implementations)+ if ( !status && s.isLocal && !s.crossDomain ) {+ status = responses.text ? 200 : 404;+ // IE - #1450: sometimes returns 1223 when it should be 204+ } else if ( status === 1223 ) {+ status = 204;+ }+ }+ }+ } catch( firefoxAccessException ) {+ if ( !isAbort ) {+ complete( -1, firefoxAccessException );+ }+ }++ // Call complete if needed+ if ( responses ) {+ complete( status, statusText, responses, responseHeaders );+ }+ };++ // if we're in sync mode or it's in cache+ // and has been retrieved directly (IE6 & IE7)+ // we need to manually fire the callback+ if ( !s.async || xhr.readyState === 4 ) {+ callback();+ } else {+ handle = ++xhrId;+ if ( xhrOnUnloadAbort ) {+ // Create the active xhrs callbacks list if needed+ // and attach the unload handler+ if ( !xhrCallbacks ) {+ xhrCallbacks = {};+ jQuery( window ).unload( xhrOnUnloadAbort );+ }+ // Add to list of active xhrs callbacks+ xhrCallbacks[ handle ] = callback;+ }+ xhr.onreadystatechange = callback;+ }+ },++ abort: function() {+ if ( callback ) {+ callback(0,1);+ }+ }+ };+ }+ });+}+++++var elemdisplay = {},+ iframe, iframeDoc,+ rfxtypes = /^(?:toggle|show|hide)$/,+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,+ timerId,+ fxAttrs = [+ // height animations+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],+ // width animations+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],+ // opacity animations+ [ "opacity" ]+ ],+ fxNow,+ requestAnimationFrame = window.webkitRequestAnimationFrame ||+ window.mozRequestAnimationFrame ||+ window.oRequestAnimationFrame;++jQuery.fn.extend({+ show: function( speed, easing, callback ) {+ var elem, display;++ if ( speed || speed === 0 ) {+ return this.animate( genFx("show", 3), speed, easing, callback);++ } else {+ for ( var i = 0, j = this.length; i < j; i++ ) {+ elem = this[i];++ if ( elem.style ) {+ display = elem.style.display;++ // Reset the inline display of this element to learn if it is+ // being hidden by cascaded rules or not+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {+ display = elem.style.display = "";+ }++ // Set elements which have been overridden with display: none+ // in a stylesheet to whatever the default browser style is+ // for such an element+ if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {+ jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));+ }+ }+ }++ // Set the display of most of the elements in a second loop+ // to avoid the constant reflow+ for ( i = 0; i < j; i++ ) {+ elem = this[i];++ if ( elem.style ) {+ display = elem.style.display;++ if ( display === "" || display === "none" ) {+ elem.style.display = jQuery._data(elem, "olddisplay") || "";+ }+ }+ }++ return this;+ }+ },++ hide: function( speed, easing, callback ) {+ if ( speed || speed === 0 ) {+ return this.animate( genFx("hide", 3), speed, easing, callback);++ } else {+ for ( var i = 0, j = this.length; i < j; i++ ) {+ if ( this[i].style ) {+ var display = jQuery.css( this[i], "display" );++ if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {+ jQuery._data( this[i], "olddisplay", display );+ }+ }+ }++ // Set the display of the elements in a second loop+ // to avoid the constant reflow+ for ( i = 0; i < j; i++ ) {+ if ( this[i].style ) {+ this[i].style.display = "none";+ }+ }++ return this;+ }+ },++ // Save the old toggle function+ _toggle: jQuery.fn.toggle,++ toggle: function( fn, fn2, callback ) {+ var bool = typeof fn === "boolean";++ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {+ this._toggle.apply( this, arguments );++ } else if ( fn == null || bool ) {+ this.each(function() {+ var state = bool ? fn : jQuery(this).is(":hidden");+ jQuery(this)[ state ? "show" : "hide" ]();+ });++ } else {+ this.animate(genFx("toggle", 3), fn, fn2, callback);+ }++ return this;+ },++ fadeTo: function( speed, to, easing, callback ) {+ return this.filter(":hidden").css("opacity", 0).show().end()+ .animate({opacity: to}, speed, easing, callback);+ },++ animate: function( prop, speed, easing, callback ) {+ var optall = jQuery.speed(speed, easing, callback);++ if ( jQuery.isEmptyObject( prop ) ) {+ return this.each( optall.complete, [ false ] );+ }++ // Do not change referenced properties as per-property easing will be lost+ prop = jQuery.extend( {}, prop );++ return this[ optall.queue === false ? "each" : "queue" ](function() {+ // XXX 'this' does not always have a nodeName when running the+ // test suite++ if ( optall.queue === false ) {+ jQuery._mark( this );+ }++ var opt = jQuery.extend( {}, optall ),+ isElement = this.nodeType === 1,+ hidden = isElement && jQuery(this).is(":hidden"),+ name, val, p,+ display, e,+ parts, start, end, unit;++ // will store per property easing and be used to determine when an animation is complete+ opt.animatedProperties = {};++ for ( p in prop ) {++ // property name normalization+ name = jQuery.camelCase( p );+ if ( p !== name ) {+ prop[ name ] = prop[ p ];+ delete prop[ p ];+ }++ val = prop[ name ];++ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)+ if ( jQuery.isArray( val ) ) {+ opt.animatedProperties[ name ] = val[ 1 ];+ val = prop[ name ] = val[ 0 ];+ } else {+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';+ }++ if ( val === "hide" && hidden || val === "show" && !hidden ) {+ return opt.complete.call( this );+ }++ if ( isElement && ( name === "height" || name === "width" ) ) {+ // Make sure that nothing sneaks out+ // Record all 3 overflow attributes because IE does not+ // change the overflow attribute when overflowX and+ // overflowY are set to the same value+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];++ // Set display property to inline-block for height/width+ // animations on inline elements that are having width/height+ // animated+ if ( jQuery.css( this, "display" ) === "inline" &&+ jQuery.css( this, "float" ) === "none" ) {+ if ( !jQuery.support.inlineBlockNeedsLayout ) {+ this.style.display = "inline-block";++ } else {+ display = defaultDisplay( this.nodeName );++ // inline-level elements accept inline-block;+ // block-level elements need to be inline with layout+ if ( display === "inline" ) {+ this.style.display = "inline-block";++ } else {+ this.style.display = "inline";+ this.style.zoom = 1;+ }+ }+ }+ }+ }++ if ( opt.overflow != null ) {+ this.style.overflow = "hidden";+ }++ for ( p in prop ) {+ e = new jQuery.fx( this, opt, p );+ val = prop[ p ];++ if ( rfxtypes.test(val) ) {+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();++ } else {+ parts = rfxnum.exec( val );+ start = e.cur();++ if ( parts ) {+ end = parseFloat( parts[2] );+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );++ // We need to compute starting value+ if ( unit !== "px" ) {+ jQuery.style( this, p, (end || 1) + unit);+ start = ((end || 1) / e.cur()) * start;+ jQuery.style( this, p, start + unit);+ }++ // If a +=/-= token was provided, we're doing a relative animation+ if ( parts[1] ) {+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;+ }++ e.custom( start, end, unit );++ } else {+ e.custom( start, val, "" );+ }+ }+ }++ // For JS strict compliance+ return true;+ });+ },++ stop: function( clearQueue, gotoEnd ) {+ if ( clearQueue ) {+ this.queue([]);+ }++ this.each(function() {+ var timers = jQuery.timers,+ i = timers.length;+ // clear marker counters if we know they won't be+ if ( !gotoEnd ) {+ jQuery._unmark( true, this );+ }+ while ( i-- ) {+ if ( timers[i].elem === this ) {+ if (gotoEnd) {+ // force the next step to be the last+ timers[i](true);+ }++ timers.splice(i, 1);+ }+ }+ });++ // start the next in the queue if the last step wasn't forced+ if ( !gotoEnd ) {+ this.dequeue();+ }++ return this;+ }++});++// Animations created synchronously will run synchronously+function createFxNow() {+ setTimeout( clearFxNow, 0 );+ return ( fxNow = jQuery.now() );+}++function clearFxNow() {+ fxNow = undefined;+}++// Generate parameters to create a standard animation+function genFx( type, num ) {+ var obj = {};++ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {+ obj[ this ] = type;+ });++ return obj;+}++// Generate shortcuts for custom animations+jQuery.each({+ slideDown: genFx("show", 1),+ slideUp: genFx("hide", 1),+ slideToggle: genFx("toggle", 1),+ fadeIn: { opacity: "show" },+ fadeOut: { opacity: "hide" },+ fadeToggle: { opacity: "toggle" }+}, function( name, props ) {+ jQuery.fn[ name ] = function( speed, easing, callback ) {+ return this.animate( props, speed, easing, callback );+ };+});++jQuery.extend({+ speed: function( speed, easing, fn ) {+ var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {+ complete: fn || !fn && easing ||+ jQuery.isFunction( speed ) && speed,+ duration: speed,+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing+ };++ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;++ // Queueing+ opt.old = opt.complete;+ opt.complete = function( noUnmark ) {+ if ( opt.queue !== false ) {+ jQuery.dequeue( this );+ } else if ( noUnmark !== false ) {+ jQuery._unmark( this );+ }++ if ( jQuery.isFunction( opt.old ) ) {+ opt.old.call( this );+ }+ };++ return opt;+ },++ easing: {+ linear: function( p, n, firstNum, diff ) {+ return firstNum + diff * p;+ },+ swing: function( p, n, firstNum, diff ) {+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;+ }+ },++ timers: [],++ fx: function( elem, options, prop ) {+ this.options = options;+ this.elem = elem;+ this.prop = prop;++ options.orig = options.orig || {};+ }++});++jQuery.fx.prototype = {+ // Simple function for setting a style value+ update: function() {+ if ( this.options.step ) {+ this.options.step.call( this.elem, this.now, this );+ }++ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );+ },++ // Get the current size+ cur: function() {+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {+ return this.elem[ this.prop ];+ }++ var parsed,+ r = jQuery.css( this.elem, this.prop );+ // Empty strings, null, undefined and "auto" are converted to 0,+ // complex values such as "rotate(1rad)" are returned as is,+ // simple values such as "10px" are parsed to Float.+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;+ },++ // Start an animation from one number to another+ custom: function( from, to, unit ) {+ var self = this,+ fx = jQuery.fx,+ raf;++ this.startTime = fxNow || createFxNow();+ this.start = from;+ this.end = to;+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );+ this.now = this.start;+ this.pos = this.state = 0;++ function t( gotoEnd ) {+ return self.step(gotoEnd);+ }++ t.elem = this.elem;++ if ( t() && jQuery.timers.push(t) && !timerId ) {+ // Use requestAnimationFrame instead of setInterval if available+ if ( requestAnimationFrame ) {+ timerId = 1;+ raf = function() {+ // When timerId gets set to null at any point, this stops+ if ( timerId ) {+ requestAnimationFrame( raf );+ fx.tick();+ }+ };+ requestAnimationFrame( raf );+ } else {+ timerId = setInterval( fx.tick, fx.interval );+ }+ }+ },++ // Simple 'show' function+ show: function() {+ // Remember where we started, so that we can go back to it later+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );+ this.options.show = true;++ // Begin the animation+ // Make sure that we start at a small width/height to avoid any+ // flash of content+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());++ // Start by showing the element+ jQuery( this.elem ).show();+ },++ // Simple 'hide' function+ hide: function() {+ // Remember where we started, so that we can go back to it later+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );+ this.options.hide = true;++ // Begin the animation+ this.custom(this.cur(), 0);+ },++ // Each step of an animation+ step: function( gotoEnd ) {+ var t = fxNow || createFxNow(),+ done = true,+ elem = this.elem,+ options = this.options,+ i, n;++ if ( gotoEnd || t >= options.duration + this.startTime ) {+ this.now = this.end;+ this.pos = this.state = 1;+ this.update();++ options.animatedProperties[ this.prop ] = true;++ for ( i in options.animatedProperties ) {+ if ( options.animatedProperties[i] !== true ) {+ done = false;+ }+ }++ if ( done ) {+ // Reset the overflow+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {++ jQuery.each( [ "", "X", "Y" ], function (index, value) {+ elem.style[ "overflow" + value ] = options.overflow[index];+ });+ }++ // Hide the element if the "hide" operation was done+ if ( options.hide ) {+ jQuery(elem).hide();+ }++ // Reset the properties, if the item has been hidden or shown+ if ( options.hide || options.show ) {+ for ( var p in options.animatedProperties ) {+ jQuery.style( elem, p, options.orig[p] );+ }+ }++ // Execute the complete function+ options.complete.call( elem );+ }++ return false;++ } else {+ // classical easing cannot be used with an Infinity duration+ if ( options.duration == Infinity ) {+ this.now = t;+ } else {+ n = t - this.startTime;+ this.state = n / options.duration;++ // Perform the easing function, defaults to swing+ this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );+ this.now = this.start + ((this.end - this.start) * this.pos);+ }+ // Perform the next step of the animation+ this.update();+ }++ return true;+ }+};++jQuery.extend( jQuery.fx, {+ tick: function() {+ for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {+ if ( !timers[i]() ) {+ timers.splice(i--, 1);+ }+ }++ if ( !timers.length ) {+ jQuery.fx.stop();+ }+ },++ interval: 13,++ stop: function() {+ clearInterval( timerId );+ timerId = null;+ },++ speeds: {+ slow: 600,+ fast: 200,+ // Default speed+ _default: 400+ },++ step: {+ opacity: function( fx ) {+ jQuery.style( fx.elem, "opacity", fx.now );+ },++ _default: function( fx ) {+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;+ } else {+ fx.elem[ fx.prop ] = fx.now;+ }+ }+ }+});++if ( jQuery.expr && jQuery.expr.filters ) {+ jQuery.expr.filters.animated = function( elem ) {+ return jQuery.grep(jQuery.timers, function( fn ) {+ return elem === fn.elem;+ }).length;+ };+}++// Try to restore the default display value of an element+function defaultDisplay( nodeName ) {++ if ( !elemdisplay[ nodeName ] ) {++ var elem = jQuery( "<" + nodeName + ">" ).appendTo( "body" ),+ display = elem.css( "display" );++ elem.remove();++ // If the simple way fails,+ // get element's real default display by attaching it to a temp iframe+ if ( display === "none" || display === "" ) {+ // No iframe to use yet, so create it+ if ( !iframe ) {+ iframe = document.createElement( "iframe" );+ iframe.frameBorder = iframe.width = iframe.height = 0;+ }++ document.body.appendChild( iframe );++ // Create a cacheable copy of the iframe document on first call.+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake html+ // document to it, Webkit & Firefox won't allow reusing the iframe document+ if ( !iframeDoc || !iframe.createElement ) {+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;+ iframeDoc.write( "<!doctype><html><body></body></html>" );+ }++ elem = iframeDoc.createElement( nodeName );++ iframeDoc.body.appendChild( elem );++ display = jQuery.css( elem, "display" );++ document.body.removeChild( iframe );+ }++ // Store the correct default display+ elemdisplay[ nodeName ] = display;+ }++ return elemdisplay[ nodeName ];+}+++++var rtable = /^t(?:able|d|h)$/i,+ rroot = /^(?:body|html)$/i;++if ( "getBoundingClientRect" in document.documentElement ) {+ jQuery.fn.offset = function( options ) {+ var elem = this[0], box;++ if ( options ) {+ return this.each(function( i ) {+ jQuery.offset.setOffset( this, options, i );+ });+ }++ if ( !elem || !elem.ownerDocument ) {+ return null;+ }++ if ( elem === elem.ownerDocument.body ) {+ return jQuery.offset.bodyOffset( elem );+ }++ try {+ box = elem.getBoundingClientRect();+ } catch(e) {}++ var doc = elem.ownerDocument,+ docElem = doc.documentElement;++ // Make sure we're not dealing with a disconnected DOM node+ if ( !box || !jQuery.contains( docElem, elem ) ) {+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };+ }++ var body = doc.body,+ win = getWindow(doc),+ clientTop = docElem.clientTop || body.clientTop || 0,+ clientLeft = docElem.clientLeft || body.clientLeft || 0,+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,+ top = box.top + scrollTop - clientTop,+ left = box.left + scrollLeft - clientLeft;++ return { top: top, left: left };+ };++} else {+ jQuery.fn.offset = function( options ) {+ var elem = this[0];++ if ( options ) {+ return this.each(function( i ) {+ jQuery.offset.setOffset( this, options, i );+ });+ }++ if ( !elem || !elem.ownerDocument ) {+ return null;+ }++ if ( elem === elem.ownerDocument.body ) {+ return jQuery.offset.bodyOffset( elem );+ }++ jQuery.offset.initialize();++ var computedStyle,+ offsetParent = elem.offsetParent,+ prevOffsetParent = elem,+ doc = elem.ownerDocument,+ docElem = doc.documentElement,+ body = doc.body,+ defaultView = doc.defaultView,+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,+ top = elem.offsetTop,+ left = elem.offsetLeft;++ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {+ break;+ }++ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;+ top -= elem.scrollTop;+ left -= elem.scrollLeft;++ if ( elem === offsetParent ) {+ top += elem.offsetTop;+ left += elem.offsetLeft;++ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {+ top += parseFloat( computedStyle.borderTopWidth ) || 0;+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;+ }++ prevOffsetParent = offsetParent;+ offsetParent = elem.offsetParent;+ }++ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {+ top += parseFloat( computedStyle.borderTopWidth ) || 0;+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;+ }++ prevComputedStyle = computedStyle;+ }++ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {+ top += body.offsetTop;+ left += body.offsetLeft;+ }++ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {+ top += Math.max( docElem.scrollTop, body.scrollTop );+ left += Math.max( docElem.scrollLeft, body.scrollLeft );+ }++ return { top: top, left: left };+ };+}++jQuery.offset = {+ initialize: function() {+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,+ html = "<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>";++ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );++ container.innerHTML = html;+ body.insertBefore( container, body.firstChild );+ innerDiv = container.firstChild;+ checkDiv = innerDiv.firstChild;+ td = innerDiv.nextSibling.firstChild.firstChild;++ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);++ checkDiv.style.position = "fixed";+ checkDiv.style.top = "20px";++ // safari subtracts parent border width here which is 5px+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);+ checkDiv.style.position = checkDiv.style.top = "";++ innerDiv.style.overflow = "hidden";+ innerDiv.style.position = "relative";++ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);++ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);++ body.removeChild( container );+ jQuery.offset.initialize = jQuery.noop;+ },++ bodyOffset: function( body ) {+ var top = body.offsetTop,+ left = body.offsetLeft;++ jQuery.offset.initialize();++ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;+ }++ return { top: top, left: left };+ },++ setOffset: function( elem, options, i ) {+ var position = jQuery.css( elem, "position" );++ // set position first, in-case top/left are set even on static elem+ if ( position === "static" ) {+ elem.style.position = "relative";+ }++ var curElem = jQuery( elem ),+ curOffset = curElem.offset(),+ curCSSTop = jQuery.css( elem, "top" ),+ curCSSLeft = jQuery.css( elem, "left" ),+ calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,+ props = {}, curPosition = {}, curTop, curLeft;++ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed+ if ( calculatePosition ) {+ curPosition = curElem.position();+ curTop = curPosition.top;+ curLeft = curPosition.left;+ } else {+ curTop = parseFloat( curCSSTop ) || 0;+ curLeft = parseFloat( curCSSLeft ) || 0;+ }++ if ( jQuery.isFunction( options ) ) {+ options = options.call( elem, i, curOffset );+ }++ if (options.top != null) {+ props.top = (options.top - curOffset.top) + curTop;+ }+ if (options.left != null) {+ props.left = (options.left - curOffset.left) + curLeft;+ }++ if ( "using" in options ) {+ options.using.call( elem, props );+ } else {+ curElem.css( props );+ }+ }+};+++jQuery.fn.extend({+ position: function() {+ if ( !this[0] ) {+ return null;+ }++ var elem = this[0],++ // Get *real* offsetParent+ offsetParent = this.offsetParent(),++ // Get correct offsets+ offset = this.offset(),+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();++ // Subtract element margins+ // note: when an element has margin: auto the offsetLeft and marginLeft+ // are the same in Safari causing offset.left to incorrectly be 0+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;++ // Add offsetParent borders+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;++ // Subtract the two offsets+ return {+ top: offset.top - parentOffset.top,+ left: offset.left - parentOffset.left+ };+ },++ offsetParent: function() {+ return this.map(function() {+ var offsetParent = this.offsetParent || document.body;+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {+ offsetParent = offsetParent.offsetParent;+ }+ return offsetParent;+ });+ }+});+++// Create scrollLeft and scrollTop methods+jQuery.each( ["Left", "Top"], function( i, name ) {+ var method = "scroll" + name;++ jQuery.fn[ method ] = function( val ) {+ var elem, win;++ if ( val === undefined ) {+ elem = this[ 0 ];++ if ( !elem ) {+ return null;+ }++ win = getWindow( elem );++ // Return the scroll offset+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :+ jQuery.support.boxModel && win.document.documentElement[ method ] ||+ win.document.body[ method ] :+ elem[ method ];+ }++ // Set the scroll offset+ return this.each(function() {+ win = getWindow( this );++ if ( win ) {+ win.scrollTo(+ !i ? val : jQuery( win ).scrollLeft(),+ i ? val : jQuery( win ).scrollTop()+ );++ } else {+ this[ method ] = val;+ }+ });+ };+});++function getWindow( elem ) {+ return jQuery.isWindow( elem ) ?+ elem :+ elem.nodeType === 9 ?+ elem.defaultView || elem.parentWindow :+ false;+}+++++// Create innerHeight, innerWidth, outerHeight and outerWidth methods+jQuery.each([ "Height", "Width" ], function( i, name ) {++ var type = name.toLowerCase();++ // innerHeight and innerWidth+ jQuery.fn["inner" + name] = function() {+ return this[0] ?+ parseFloat( jQuery.css( this[0], type, "padding" ) ) :+ null;+ };++ // outerHeight and outerWidth+ jQuery.fn["outer" + name] = function( margin ) {+ return this[0] ?+ parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :+ null;+ };++ jQuery.fn[ type ] = function( size ) {+ // Get window width or height+ var elem = this[0];+ if ( !elem ) {+ return size == null ? null : this;+ }++ if ( jQuery.isFunction( size ) ) {+ return this.each(function( i ) {+ var self = jQuery( this );+ self[ type ]( size.call( this, i, self[ type ]() ) );+ });+ }++ if ( jQuery.isWindow( elem ) ) {+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat+ var docElemProp = elem.document.documentElement[ "client" + name ];+ return elem.document.compatMode === "CSS1Compat" && docElemProp ||+ elem.document.body[ "client" + name ] || docElemProp;++ // Get document width or height+ } else if ( elem.nodeType === 9 ) {+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater+ return Math.max(+ elem.documentElement["client" + name],+ elem.body["scroll" + name], elem.documentElement["scroll" + name],+ elem.body["offset" + name], elem.documentElement["offset" + name]+ );++ // Get or set width or height on the element+ } else if ( size === undefined ) {+ var orig = jQuery.css( elem, type ),+ ret = parseFloat( orig );++ return jQuery.isNaN( ret ) ? orig : ret;++ // Set the width or height on the element (default to pixels if value is unitless)+ } else {+ return this.css( type, typeof size === "string" ? size : size + "px" );+ }+ };++});+++window.jQuery = window.$ = jQuery;+})(window);diff --git a/solr/src/webapp/web/js/highlight.js b/solr/src/webapp/web/js/highlight.jsnew file mode 100644index 00000000000..6ee2b84ddd8--- /dev/null+++ b/solr/src/webapp/web/js/highlight.js@@ -0,0 +1 @@+var hljs=new function(){var p={};var a={};function n(c){return c.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function k(s,r){if(!s){return false}for(var c=0;c<s.length;c++){if(s[c]==r){return true}}return false}function e(s,r,c){var t="m"+(s.cI?"i":"")+(c?"g":"");return new RegExp(r,t)}function j(r){for(var c=0;c<r.childNodes.length;c++){node=r.childNodes[c];if(node.nodeName=="CODE"){return node}if(!(node.nodeType==3&&node.nodeValue.match(/\s+/))){return null}}}function h(u,t){var s="";for(var r=0;r<u.childNodes.length;r++){if(u.childNodes[r].nodeType==3){var c=u.childNodes[r].nodeValue;if(t){c=c.replace(/\n/g,"")}s+=c}else{if(u.childNodes[r].nodeName=="BR"){s+="\n"}else{s+=h(u.childNodes[r])}}}s=s.replace(/\r/g,"\n");return s}function b(t){var r=t.className.split(/\s+/);r=r.concat(t.parentNode.className.split(/\s+/));for(var c=0;c<r.length;c++){var s=r[c].replace(/^language-/,"");if(p[s]||s=="no-highlight"){return s}}}function d(c){var r=[];(function(t,u){for(var s=0;s<t.childNodes.length;s++){if(t.childNodes[s].nodeType==3){u+=t.childNodes[s].nodeValue.length}else{if(t.childNodes[s].nodeName=="BR"){u+=1}else{r.push({event:"start",offset:u,node:t.childNodes[s]});u=arguments.callee(t.childNodes[s],u);r.push({event:"stop",offset:u,node:t.childNodes[s]})}}}return u})(c,0);return r}function m(z,A,y){var s=0;var x="";var u=[];function v(){if(z.length&&A.length){if(z[0].offset!=A[0].offset){return(z[0].offset<A[0].offset)?z:A}else{return(z[0].event=="start"&&A[0].event=="stop")?A:z}}else{return z.length?z:A}}function t(E){var F="<"+E.nodeName.toLowerCase();for(var C=0;C<E.attributes.length;C++){var D=E.attributes[C];F+=" "+D.nodeName.toLowerCase();if(D.nodeValue!=undefined){F+='="'+n(D.nodeValue)+'"'}}return F+">"}function B(C){return"</"+C.nodeName.toLowerCase()+">"}while(z.length||A.length){var w=v().splice(0,1)[0];x+=n(y.substr(s,w.offset-s));s=w.offset;if(w.event=="start"){x+=t(w.node);u.push(w.node)}else{if(w.event=="stop"){var r=u.length;do{r--;var c=u[r];x+=B(c)}while(c!=w.node);u.splice(r,1);while(r<u.length){x+=t(u[r]);r++}}}}x+=y.substr(s);return x}function g(K,E){function A(r,N){for(var M=0;M<N.sm.length;M++){if(N.sm[M].bR.test(r)){return N.sm[M]}}return null}function x(M,r){if(D[M].e&&D[M].eR.test(r)){return 1}if(D[M].eW){var N=x(M-1,r);return N?N+1:0}return 0}function y(r,M){return M.iR&&M.iR.test(r)}function B(P,O){var N=[];for(var M=0;M<P.sm.length;M++){N.push(P.sm[M].b)}var r=D.length-1;do{if(D[r].e){N.push(D[r].e)}r--}while(D[r+1].eW);if(P.i){N.push(P.i)}return e(O,"("+N.join("|")+")",true)}function t(N,M){var O=D[D.length-1];if(!O.t){O.t=B(O,I)}O.t.lastIndex=M;var r=O.t.exec(N);if(r){return[N.substr(M,r.index-M),r[0],false]}else{return[N.substr(M),"",true]}}function c(P,r){var M=I.cI?r[0].toLowerCase():r[0];for(var O in P.keywordGroups){if(!P.keywordGroups.hasOwnProperty(O)){continue}var N=P.keywordGroups[O].hasOwnProperty(M);if(N){return[O,N]}}return false}function G(N,Q){if(!Q.k||!Q.l){return n(N)}if(!Q.lR){var P="("+Q.l.join("|")+")";Q.lR=e(I,P,true)}var O="";var R=0;Q.lR.lastIndex=0;var M=Q.lR.exec(N);while(M){O+=n(N.substr(R,M.index-R));var r=c(Q,M);if(r){u+=r[1];O+='<span class="'+r[0]+'">'+n(M[0])+"</span>"}else{O+=n(M[0])}R=Q.lR.lastIndex;M=Q.lR.exec(N)}O+=n(N.substr(R,N.length-R));return O}function L(r,N){if(N.subLanguage&&a[N.subLanguage]){var M=g(N.subLanguage,r);u+=M.keyword_count;C+=M.r;return M.value}else{return G(r,N)}}function J(N,r){var M=N.nM?"":'<span class="'+N.displayClassName+'">';if(N.rB){s+=M;N.buffer=""}else{if(N.eB){s+=n(r)+M;N.buffer=""}else{s+=M;N.buffer=r}}D[D.length]=N}function F(M,O,R){var P=D[D.length-1];if(R){s+=L(P.buffer+M,P);return false}var S=A(O,P);if(S){s+=L(P.buffer+M,P);J(S,O);C+=S.r;return S.rB}var r=x(D.length-1,O);if(r){var T=P.nM?"":"</span>";if(P.rE){s+=L(P.buffer+M,P)+T}else{if(P.eE){s+=L(P.buffer+M,P)+T+n(O)}else{s+=L(P.buffer+M+O,P)+T}}while(r>1){T=D[D.length-2].nM?"":"</span>";s+=T;r--;D.length--}var Q=D[D.length-1];D.length--;D[D.length-1].buffer="";if(Q.starts){for(var N=0;N<I.m.length;N++){if(I.m[N].cN==Q.starts){J(I.m[N],"");break}}}return P.rE}if(y(O,P)){throw"Illegal"}}var I=p[K];var D=[I.dM];var C=0;var u=0;var s="";try{var w=0;I.dM.buffer="";do{var z=t(E,w);var v=F(z[0],z[1],z[2]);w+=z[0].length;if(!v){w+=z[1].length}}while(!z[2]);if(D.length>1){throw"Illegal"}return{language:K,r:C,keyword_count:u,value:s}}catch(H){if(H=="Illegal"){return{language:null,r:0,keyword_count:0,value:n(E)}}else{throw H}}}function i(){function r(y,x){if(y.compiled){return}if(y.b){y.bR=e(x,"^"+y.b)}if(y.e){y.eR=e(x,"^"+y.e)}if(y.i){y.iR=e(x,"^(?:"+y.i+")")}if(y.r==undefined){y.r=1}if(!y.displayClassName){y.displayClassName=y.cN}if(!y.cN){y.nM=true}for(var w in y.k){if(!y.k.hasOwnProperty(w)){continue}if(y.k[w] instanceof Object){y.keywordGroups=y.k}else{y.keywordGroups={keyword:y.k}}break}y.sm=[];if(y.c){for(var v=0;v<y.c.length;v++){if(y.c[v] instanceof Object){y.sm.push(y.c[v])}else{for(var u=0;u<x.m.length;u++){if(x.m[u].cN==y.c[v]){y.sm.push(x.m[u])}}}}}y.compiled=true;for(var v=0;v<y.sm.length;v++){r(y.sm[v],x)}}for(var t in p){if(!p.hasOwnProperty(t)){continue}var c=[p[t].dM].concat(p[t].m);for(var s=0;s<c.length;s++){r(c[s],p[t])}}}function f(){if(f.called){return}f.called=true;i();a=p}function q(v,A,r){f();var C=h(v,r);var t=b(v);if(t=="no-highlight"){return}if(t){var y=g(t,C)}else{var y={language:"",keyword_count:0,r:0,value:n(C)};var z=y;for(var B in a){if(!a.hasOwnProperty(B)){continue}var w=g(B,C);if(w.keyword_count+w.r>z.keyword_count+z.r){z=w}if(w.keyword_count+w.r>y.keyword_count+y.r){z=y;y=w}}}var u=v.className;if(!u.match(y.language)){u=u?(u+" "+y.language):y.language}var c=d(v);if(c.length){var s=document.createElement("pre");s.innerHTML=y.value;y.value=m(c,d(s),C)}if(A){y.value=y.value.replace(/^((<[^>]+>|\t)+)/gm,function(D,G,F,E){return G.replace(/\t/g,A)})}if(r){y.value=y.value.replace(/\n/g,"<br>")}if(/MSIE [678]/.test(navigator.userAgent)&&v.tagName=="CODE"&&v.parentNode.tagName=="PRE"){var s=v.parentNode;var x=document.createElement("div");x.innerHTML="<pre><code>"+y.value+"</code></pre>";v=x.firstChild.firstChild;x.firstChild.cN=s.cN;s.parentNode.replaceChild(x.firstChild,s)}else{v.innerHTML=y.value}v.className=u;v.dataset={};v.dataset.result={language:y.language,kw:y.keyword_count,re:y.r};if(z&&z.language){v.dataset.second_best={language:z.language,kw:z.keyword_count,re:z.r}}}function l(){if(l.called){return}l.called=true;f();if(arguments.length){for(var c=0;c<arguments.length;c++){if(p[arguments[c]]){a[arguments[c]]=p[arguments[c]]}}}var s=document.getElementsByTagName("pre");for(var c=0;c<s.length;c++){var r=j(s[c]);if(r){q(r,hljs.tabReplace)}}}function o(){var c=arguments;var r=function(){l.apply(null,c)};if(window.addEventListener){window.addEventListener("DOMContentLoaded",r,false);window.addEventListener("load",r,false)}else{if(window.attachEvent){window.attachEvent("onload",r)}else{window.onload=r}}}this.LANGUAGES=p;this.initHighlightingOnLoad=o;this.highlightBlock=q;this.initHighlighting=l;this.IMR="\\b|\\B";this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:["escape"],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:["escape"],r:0};this.BE={cN:"escape",b:"\\\\.",e:this.IMR,nM:true,r:0};this.CLCM={cN:"comment",b:"//",e:"$",r:0};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NUMBER_MODE={cN:"number",b:this.NR,e:this.IMR,r:0};this.CNM={cN:"number",b:this.CNR,e:this.IMR,r:0};this.inherit=function(c,t){var s={};for(var r in c){s[r]=c[r]}if(t){for(var r in t){s[r]=t[r]}}return s}}();var initHighlightingOnLoad=hljs.initHighlightingOnLoad;(function(){var d="[A-Za-z0-9\\._:-]+";var k={cN:"pi",b:"<\\?",e:"\\?>",r:10};var i={cN:"doctype",b:"<!DOCTYPE",e:">",r:10};var j={cN:"comment",b:"<!--",e:"-->"};var g={cN:"tag",b:"</?",e:"/?>",c:["title","tag_internal"]};var e={cN:"title",b:d,e:hljs.IMR};var b={cN:"tag_internal",b:hljs.IMR,eW:true,nM:true,c:["attribute","value_container"],r:0};var f={cN:"attribute",b:d,e:hljs.IMR,r:0};var a={cN:"value_container",b:'="',rB:true,e:'"',nM:true,c:[{cN:"value",b:'"',eW:true}]};var c={cN:"value_container",b:"='",rB:true,e:"'",nM:true,c:[{cN:"value",b:"'",eW:true}]};hljs.LANGUAGES.xml={dM:{c:["pi","doctype","comment","cdata","tag"]},cI:true,m:[{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},k,i,j,g,hljs.inherit(e,{r:1.75}),b,f,a,c]};var h={code:1,kbd:1,font:1,noscript:1,style:1,img:1,title:1,menu:1,tt:1,tr:1,param:1,li:1,tfoot:1,th:1,input:1,td:1,dl:1,blockquote:1,fieldset:1,big:1,dd:1,abbr:1,optgroup:1,dt:1,button:1,isindex:1,p:1,small:1,div:1,dir:1,em:1,frame:1,meta:1,sub:1,bdo:1,label:1,acronym:1,sup:1,body:1,basefont:1,base:1,br:1,address:1,strong:1,legend:1,ol:1,script:1,caption:1,s:1,col:1,h2:1,h3:1,h1:1,h6:1,h4:1,h5:1,table:1,select:1,noframes:1,span:1,area:1,dfn:1,strike:1,cite:1,thead:1,head:1,option:1,form:1,hr:1,"var":1,link:1,b:1,colgroup:1,ul:1,applet:1,del:1,iframe:1,pre:1,frameset:1,ins:1,tbody:1,html:1,samp:1,map:1,object:1,a:1,xmlns:1,center:1,textarea:1,i:1,q:1,u:1,section:1,nav:1,article:1,aside:1,hgroup:1,header:1,footer:1,figure:1,figurecaption:1,time:1,mark:1,wbr:1,embed:1,video:1,audio:1,source:1,canvas:1,datalist:1,keygen:1,output:1,progress:1,meter:1,details:1,summary:1,command:1};hljs.LANGUAGES.html={dM:{c:["comment","pi","doctype","vbscript","tag"]},cI:true,m:[{cN:"tag",b:"<style",e:">",l:[hljs.IR],k:{style:1},c:["tag_internal"],starts:"css"},{cN:"tag",b:"<script",e:">",l:[hljs.IR],k:{script:1},c:["tag_internal"],starts:"javascript"},{cN:"css",e:"</style>",rE:true,subLanguage:"css"},{cN:"javascript",e:"<\/script>",rE:true,subLanguage:"javascript"},{cN:"vbscript",b:"<%",e:"%>",subLanguage:"vbscript"},j,k,i,hljs.inherit(g),hljs.inherit(e,{l:[hljs.IR],k:h}),hljs.inherit(b),f,a,c,{cN:"value_container",b:"=",e:hljs.IMR,c:[{cN:"unquoted_value",displayClassName:"value",b:"[^\\s/>]+",e:hljs.IMR}]}]}})();\ No newline at end of filediff --git a/solr/src/webapp/web/js/jquery.form.js b/solr/src/webapp/web/js/jquery.form.jsnew file mode 100644index 00000000000..2f165464d52--- /dev/null+++ b/solr/src/webapp/web/js/jquery.form.js@@ -0,0 +1,781 @@+/*!+ * jQuery Form Plugin+ * version: 2.47 (04-SEP-2010)+ * @requires jQuery v1.3.2 or later+ *+ * Examples and documentation at: http://malsup.com/jquery/form/+ * Dual licensed under the MIT and GPL licenses:+ * http://www.opensource.org/licenses/mit-license.php+ * http://www.gnu.org/licenses/gpl.html+ */+;(function($) {++/*+ Usage Note:+ -----------+ Do not use both ajaxSubmit and ajaxForm on the same form. These+ functions are intended to be exclusive. Use ajaxSubmit if you want+ to bind your own submit handler to the form. For example,++ $(document).ready(function() {+ $('#myForm').bind('submit', function() {+ $(this).ajaxSubmit({+ target: '#output'+ });+ return false; // <-- important!+ });+ });++ Use ajaxForm when you want the plugin to manage all the event binding+ for you. For example,++ $(document).ready(function() {+ $('#myForm').ajaxForm({+ target: '#output'+ });+ });++ When using ajaxForm, the ajaxSubmit function will be invoked for you+ at the appropriate time.+*/++/**+ * ajaxSubmit() provides a mechanism for immediately submitting+ * an HTML form using AJAX.+ */+$.fn.ajaxSubmit = function(options) {+ // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)+ if (!this.length) {+ log('ajaxSubmit: skipping submit process - no element selected');+ return this;+ }++ if (typeof options == 'function') {+ options = { success: options };+ }++ var url = $.trim(this.attr('action'));+ if (url) {+ // clean url (don't include hash vaue)+ url = (url.match(/^([^#]+)/)||[])[1];+ }+ url = url || window.location.href || '';++ options = $.extend(true, {+ url: url,+ type: this.attr('method') || 'GET',+ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'+ }, options);++ // hook for manipulating the form data before it is extracted;+ // convenient for use with rich editors like tinyMCE or FCKEditor+ var veto = {};+ this.trigger('form-pre-serialize', [this, options, veto]);+ if (veto.veto) {+ log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');+ return this;+ }++ // provide opportunity to alter form data before it is serialized+ if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {+ log('ajaxSubmit: submit aborted via beforeSerialize callback');+ return this;+ }++ var n,v,a = this.formToArray(options.semantic);+ if (options.data) {+ options.extraData = options.data;+ for (n in options.data) {+ if(options.data[n] instanceof Array) {+ for (var k in options.data[n]) {+ a.push( { name: n, value: options.data[n][k] } );+ }+ }+ else {+ v = options.data[n];+ v = $.isFunction(v) ? v() : v; // if value is fn, invoke it+ a.push( { name: n, value: v } );+ }+ }+ }++ // give pre-submit callback an opportunity to abort the submit+ if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {+ log('ajaxSubmit: submit aborted via beforeSubmit callback');+ return this;+ }++ // fire vetoable 'validate' event+ this.trigger('form-submit-validate', [a, this, options, veto]);+ if (veto.veto) {+ log('ajaxSubmit: submit vetoed via form-submit-validate trigger');+ return this;+ }++ var q = $.param(a);++ if (options.type.toUpperCase() == 'GET') {+ options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;+ options.data = null; // data is null for 'get'+ }+ else {+ options.data = q; // data is the query string for 'post'+ }++ var $form = this, callbacks = [];+ if (options.resetForm) {+ callbacks.push(function() { $form.resetForm(); });+ }+ if (options.clearForm) {+ callbacks.push(function() { $form.clearForm(); });+ }++ // perform a load on the target only if dataType is not provided+ if (!options.dataType && options.target) {+ var oldSuccess = options.success || function(){};+ callbacks.push(function(data) {+ var fn = options.replaceTarget ? 'replaceWith' : 'html';+ $(options.target)[fn](data).each(oldSuccess, arguments);+ });+ }+ else if (options.success) {+ callbacks.push(options.success);+ }++ options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg+ var context = options.context || options; // jQuery 1.4+ supports scope context+ for (var i=0, max=callbacks.length; i < max; i++) {+ callbacks[i].apply(context, [data, status, xhr || $form, $form]);+ }+ };++ // are there files to upload?+ var fileInputs = $('input:file', this).length > 0;+ var mp = 'multipart/form-data';+ var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);++ // options.iframe allows user to force iframe mode+ // 06-NOV-09: now defaulting to iframe mode if file input is detected+ if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {+ // hack to fix Safari hang (thanks to Tim Molendijk for this)+ // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d+ if (options.closeKeepAlive) {+ $.get(options.closeKeepAlive, fileUpload);+ }+ else {+ fileUpload();+ }+ }+ else {+ $.ajax(options);+ }++ // fire 'notify' event+ this.trigger('form-submit-notify', [this, options]);+ return this;+++ // private function for handling file uploads (hat tip to YAHOO!)+ function fileUpload() {+ var form = $form[0];++ if ($(':input[name=submit],:input[id=submit]', form).length) {+ // if there is an input with a name or id of 'submit' then we won't be+ // able to invoke the submit fn on the form (at least not x-browser)+ alert('Error: Form elements must not have name or id of "submit".');+ return;+ }++ var s = $.extend(true, {}, $.ajaxSettings, options);+ s.context = s.context || s;+ var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id;+ window[fn] = function() {+ var f = $io.data('form-plugin-onload');+ if (f) {+ f();+ window[fn] = undefined;+ try { delete window[fn]; } catch(e){}+ }+ }+ var $io = $('<iframe id="' + id + '" name="' + id + '" src="'+ s.iframeSrc +'" onload="window[\'_\'+this.id]()" />');+ var io = $io[0];++ $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });++ var xhr = { // mock object+ aborted: 0,+ responseText: null,+ responseXML: null,+ status: 0,+ statusText: 'n/a',+ getAllResponseHeaders: function() {},+ getResponseHeader: function() {},+ setRequestHeader: function() {},+ abort: function() {+ this.aborted = 1;+ $io.attr('src', s.iframeSrc); // abort op in progress+ }+ };++ var g = s.global;+ // trigger ajax global events so that activity/block indicators work like normal+ if (g && ! $.active++) {+ $.event.trigger("ajaxStart");+ }+ if (g) {+ $.event.trigger("ajaxSend", [xhr, s]);+ }++ if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {+ if (s.global) {+ $.active--;+ }+ return;+ }+ if (xhr.aborted) {+ return;+ }++ var cbInvoked = false;+ var timedOut = 0;++ // add submitting element to data if we know it+ var sub = form.clk;+ if (sub) {+ var n = sub.name;+ if (n && !sub.disabled) {+ s.extraData = s.extraData || {};+ s.extraData[n] = sub.value;+ if (sub.type == "image") {+ s.extraData[n+'.x'] = form.clk_x;+ s.extraData[n+'.y'] = form.clk_y;+ }+ }+ }++ // take a breath so that pending repaints get some cpu time before the upload starts+ function doSubmit() {+ // make sure form attrs are set+ var t = $form.attr('target'), a = $form.attr('action');++ // update form attrs in IE friendly way+ form.setAttribute('target',id);+ if (form.getAttribute('method') != 'POST') {+ form.setAttribute('method', 'POST');+ }+ if (form.getAttribute('action') != s.url) {+ form.setAttribute('action', s.url);+ }++ // ie borks in some cases when setting encoding+ if (! s.skipEncodingOverride) {+ $form.attr({+ encoding: 'multipart/form-data',+ enctype: 'multipart/form-data'+ });+ }++ // support timout+ if (s.timeout) {+ setTimeout(function() { timedOut = true; cb(); }, s.timeout);+ }++ // add "extra" data to form if provided in options+ var extraInputs = [];+ try {+ if (s.extraData) {+ for (var n in s.extraData) {+ extraInputs.push(+ $('<input type="hidden" name="'+n+'" value="'+s.extraData[n]+'" />')+ .appendTo(form)[0]);+ }+ }++ // add iframe to doc and submit the form+ $io.appendTo('body');+ $io.data('form-plugin-onload', cb);+ form.submit();+ }+ finally {+ // reset attrs and remove "extra" input elements+ form.setAttribute('action',a);+ if(t) {+ form.setAttribute('target', t);+ } else {+ $form.removeAttr('target');+ }+ $(extraInputs).remove();+ }+ }++ if (s.forceSync) {+ doSubmit();+ }+ else {+ setTimeout(doSubmit, 10); // this lets dom updates render+ }++ var data, doc, domCheckCount = 50;++ function cb() {+ if (cbInvoked) {+ return;+ }++ $io.removeData('form-plugin-onload');++ var ok = true;+ try {+ if (timedOut) {+ throw 'timeout';+ }+ // extract the server response from the iframe+ doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;++ var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);+ log('isXml='+isXml);+ if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {+ if (--domCheckCount) {+ // in some browsers (Opera) the iframe DOM is not always traversable when+ // the onload callback fires, so we loop a bit to accommodate+ log('requeing onLoad callback, DOM not available');+ setTimeout(cb, 250);+ return;+ }+ // let this fall through because server response could be an empty document+ //log('Could not access iframe DOM after mutiple tries.');+ //throw 'DOMException: not available';+ }++ //log('response detected');+ cbInvoked = true;+ xhr.responseText = doc.documentElement ? doc.documentElement.innerHTML : null;+ xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;+ xhr.getResponseHeader = function(header){+ var headers = {'content-type': s.dataType};+ return headers[header];+ };++ var scr = /(json|script)/.test(s.dataType);+ if (scr || s.textarea) {+ // see if user embedded response in textarea+ var ta = doc.getElementsByTagName('textarea')[0];+ if (ta) {+ xhr.responseText = ta.value;+ }+ else if (scr) {+ // account for browsers injecting pre around json response+ var pre = doc.getElementsByTagName('pre')[0];+ if (pre) {+ xhr.responseText = pre.innerHTML;+ }+ }+ }+ else if (s.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {+ xhr.responseXML = toXml(xhr.responseText);+ }+ data = $.httpData(xhr, s.dataType);+ }+ catch(e){+ log('error caught:',e);+ ok = false;+ xhr.error = e;+ $.handleError(s, xhr, 'error', e);+ }++ // ordering of these callbacks/triggers is odd, but that's how $.ajax does it+ if (ok) {+ s.success.call(s.context, data, 'success', xhr);+ if (g) {+ $.event.trigger("ajaxSuccess", [xhr, s]);+ }+ }+ if (g) {+ $.event.trigger("ajaxComplete", [xhr, s]);+ }+ if (g && ! --$.active) {+ $.event.trigger("ajaxStop");+ }+ if (s.complete) {+ s.complete.call(s.context, xhr, ok ? 'success' : 'error');+ }++ // clean up+ setTimeout(function() {+ $io.removeData('form-plugin-onload');+ $io.remove();+ xhr.responseXML = null;+ }, 100);+ }++ function toXml(s, doc) {+ if (window.ActiveXObject) {+ doc = new ActiveXObject('Microsoft.XMLDOM');+ doc.async = 'false';+ doc.loadXML(s);+ }+ else {+ doc = (new DOMParser()).parseFromString(s, 'text/xml');+ }+ return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;+ }+ }+};++/**+ * ajaxForm() provides a mechanism for fully automating form submission.+ *+ * The advantages of using this method instead of ajaxSubmit() are:+ *+ * 1: This method will include coordinates for <input type="image" /> elements (if the element+ * is used to submit the form).+ * 2. This method will include the submit element's name/value data (for the element that was+ * used to submit the form).+ * 3. This method binds the submit() method to the form for you.+ *+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely+ * passes the options argument along after properly binding events for submit elements and+ * the form itself.+ */+$.fn.ajaxForm = function(options) {+ // in jQuery 1.3+ we can fix mistakes with the ready state+ if (this.length === 0) {+ var o = { s: this.selector, c: this.context };+ if (!$.isReady && o.s) {+ log('DOM not ready, queuing ajaxForm');+ $(function() {+ $(o.s,o.c).ajaxForm(options);+ });+ return this;+ }+ // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()+ log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));+ return this;+ }++ return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {+ if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed+ e.preventDefault();+ $(this).ajaxSubmit(options);+ }+ }).bind('click.form-plugin', function(e) {+ var target = e.target;+ var $el = $(target);+ if (!($el.is(":submit,input:image"))) {+ // is this a child element of the submit el? (ex: a span within a button)+ var t = $el.closest(':submit');+ if (t.length == 0) {+ return;+ }+ target = t[0];+ }+ var form = this;+ form.clk = target;+ if (target.type == 'image') {+ if (e.offsetX != undefined) {+ form.clk_x = e.offsetX;+ form.clk_y = e.offsetY;+ } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin+ var offset = $el.offset();+ form.clk_x = e.pageX - offset.left;+ form.clk_y = e.pageY - offset.top;+ } else {+ form.clk_x = e.pageX - target.offsetLeft;+ form.clk_y = e.pageY - target.offsetTop;+ }+ }+ // clear form vars+ setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);+ });+};++// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm+$.fn.ajaxFormUnbind = function() {+ return this.unbind('submit.form-plugin click.form-plugin');+};++/**+ * formToArray() gathers form element data into an array of objects that can+ * be passed to any of the following ajax functions: $.get, $.post, or load.+ * Each object in the array has both a 'name' and 'value' property. An example of+ * an array for a simple login form might be:+ *+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]+ *+ * It is this array that is passed to pre-submit callback functions provided to the+ * ajaxSubmit() and ajaxForm() methods.+ */+$.fn.formToArray = function(semantic) {+ var a = [];+ if (this.length === 0) {+ return a;+ }++ var form = this[0];+ var els = semantic ? form.getElementsByTagName('*') : form.elements;+ if (!els) {+ return a;+ }++ var i,j,n,v,el;+ for(i=0, max=els.length; i < max; i++) {+ el = els[i];+ n = el.name;+ if (!n) {+ continue;+ }++ if (semantic && form.clk && el.type == "image") {+ // handle image inputs on the fly when semantic == true+ if(!el.disabled && form.clk == el) {+ a.push({name: n, value: $(el).val()});+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});+ }+ continue;+ }++ v = $.fieldValue(el, true);+ if (v && v.constructor == Array) {+ for(j=0, jmax=v.length; j < jmax; j++) {+ a.push({name: n, value: v[j]});+ }+ }+ else if (v !== null && typeof v != 'undefined') {+ a.push({name: n, value: v});+ }+ }++ if (!semantic && form.clk) {+ // input type=='image' are not found in elements array! handle it here+ var $input = $(form.clk), input = $input[0];+ n = input.name;+ if (n && !input.disabled && input.type == 'image') {+ a.push({name: n, value: $input.val()});+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});+ }+ }+ return a;+};++/**+ * Serializes form data into a 'submittable' string. This method will return a string+ * in the format: name1=value1&name2=value2+ */+$.fn.formSerialize = function(semantic) {+ //hand off to jQuery.param for proper encoding+ return $.param(this.formToArray(semantic));+};++/**+ * Serializes all field elements in the jQuery object into a query string.+ * This method will return a string in the format: name1=value1&name2=value2+ */+$.fn.fieldSerialize = function(successful) {+ var a = [];+ this.each(function() {+ var n = this.name;+ if (!n) {+ return;+ }+ var v = $.fieldValue(this, successful);+ if (v && v.constructor == Array) {+ for (var i=0,max=v.length; i < max; i++) {+ a.push({name: n, value: v[i]});+ }+ }+ else if (v !== null && typeof v != 'undefined') {+ a.push({name: this.name, value: v});+ }+ });+ //hand off to jQuery.param for proper encoding+ return $.param(a);+};++/**+ * Returns the value(s) of the element in the matched set. For example, consider the following form:+ *+ * <form><fieldset>+ * <input name="A" type="text" />+ * <input name="A" type="text" />+ * <input name="B" type="checkbox" value="B1" />+ * <input name="B" type="checkbox" value="B2"/>+ * <input name="C" type="radio" value="C1" />+ * <input name="C" type="radio" value="C2" />+ * </fieldset></form>+ *+ * var v = $(':text').fieldValue();+ * // if no values are entered into the text inputs+ * v == ['','']+ * // if values entered into the text inputs are 'foo' and 'bar'+ * v == ['foo','bar']+ *+ * var v = $(':checkbox').fieldValue();+ * // if neither checkbox is checked+ * v === undefined+ * // if both checkboxes are checked+ * v == ['B1', 'B2']+ *+ * var v = $(':radio').fieldValue();+ * // if neither radio is checked+ * v === undefined+ * // if first radio is checked+ * v == ['C1']+ *+ * The successful argument controls whether or not the field element must be 'successful'+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).+ * The default value of the successful argument is true. If this value is false the value(s)+ * for each element is returned.+ *+ * Note: This method *always* returns an array. If no valid value can be determined the+ * array will be empty, otherwise it will contain one or more values.+ */+$.fn.fieldValue = function(successful) {+ for (var val=[], i=0, max=this.length; i < max; i++) {+ var el = this[i];+ var v = $.fieldValue(el, successful);+ if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {+ continue;+ }+ v.constructor == Array ? $.merge(val, v) : val.push(v);+ }+ return val;+};++/**+ * Returns the value of the field element.+ */+$.fieldValue = function(el, successful) {+ var n = el.name, t = el.type, tag = el.tagName.toLowerCase();+ if (successful === undefined) {+ successful = true;+ }++ if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||+ (t == 'checkbox' || t == 'radio') && !el.checked ||+ (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||+ tag == 'select' && el.selectedIndex == -1)) {+ return null;+ }++ if (tag == 'select') {+ var index = el.selectedIndex;+ if (index < 0) {+ return null;+ }+ var a = [], ops = el.options;+ var one = (t == 'select-one');+ var max = (one ? index+1 : ops.length);+ for(var i=(one ? index : 0); i < max; i++) {+ var op = ops[i];+ if (op.selected) {+ var v = op.value;+ if (!v) { // extra pain for IE...+ v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;+ }+ if (one) {+ return v;+ }+ a.push(v);+ }+ }+ return a;+ }+ return $(el).val();+};++/**+ * Clears the form data. Takes the following actions on the form's input fields:+ * - input text fields will have their 'value' property set to the empty string+ * - select elements will have their 'selectedIndex' property set to -1+ * - checkbox and radio inputs will have their 'checked' property set to false+ * - inputs of type submit, button, reset, and hidden will *not* be effected+ * - button elements will *not* be effected+ */+$.fn.clearForm = function() {+ return this.each(function() {+ $('input,select,textarea', this).clearFields();+ });+};++/**+ * Clears the selected form elements.+ */+$.fn.clearFields = $.fn.clearInputs = function() {+ return this.each(function() {+ var t = this.type, tag = this.tagName.toLowerCase();+ if (t == 'text' || t == 'password' || tag == 'textarea') {+ this.value = '';+ }+ else if (t == 'checkbox' || t == 'radio') {+ this.checked = false;+ }+ else if (tag == 'select') {+ this.selectedIndex = -1;+ }+ });+};++/**+ * Resets the form data. Causes all form elements to be reset to their original value.+ */+$.fn.resetForm = function() {+ return this.each(function() {+ // guard against an input with the name of 'reset'+ // note that IE reports the reset function as an 'object'+ if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {+ this.reset();+ }+ });+};++/**+ * Enables or disables any matching elements.+ */+$.fn.enable = function(b) {+ if (b === undefined) {+ b = true;+ }+ return this.each(function() {+ this.disabled = !b;+ });+};++/**+ * Checks/unchecks any matching checkboxes or radio buttons and+ * selects/deselects and matching option elements.+ */+$.fn.selected = function(select) {+ if (select === undefined) {+ select = true;+ }+ return this.each(function() {+ var t = this.type;+ if (t == 'checkbox' || t == 'radio') {+ this.checked = select;+ }+ else if (this.tagName.toLowerCase() == 'option') {+ var $sel = $(this).parent('select');+ if (select && $sel[0] && $sel[0].type == 'select-one') {+ // deselect all other options+ $sel.find('option').selected(false);+ }+ this.selected = select;+ }+ });+};++// helper fn for console logging+// set $.fn.ajaxSubmit.debug to true to enable debug logging+function log() {+ if ($.fn.ajaxSubmit.debug) {+ var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');+ if (window.console && window.console.log) {+ window.console.log(msg);+ }+ else if (window.opera && window.opera.postError) {+ window.opera.postError(msg);+ }+ }+};++})(jQuery);diff --git a/solr/src/webapp/web/js/jquery.jstree.js b/solr/src/webapp/web/js/jquery.jstree.jsnew file mode 100644index 00000000000..0eea2f662f0--- /dev/null+++ b/solr/src/webapp/web/js/jquery.jstree.js@@ -0,0 +1,3510 @@+/*+ * jsTree 1.0-rc1+ * http://jstree.com/+ *+ * Copyright (c) 2010 Ivan Bozhanov (vakata.com)+ *+ * Dual licensed under the MIT and GPL licenses (same as jQuery):+ * http://www.opensource.org/licenses/mit-license.php+ * http://www.gnu.org/licenses/gpl.html+ *+ * $Date: 2010-07-01 10:51:11 +0300 (четв, 01 юли 2010) $+ * $Revision: 191 $+ */++/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */+/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/++"use strict";+// Common functions not related to jsTree+// decided to move them to a `vakata` "namespace"+(function ($) {+ $.vakata = {};+ // CSS related functions+ $.vakata.css = {+ get_css : function(rule_name, delete_flag, sheet) {+ rule_name = rule_name.toLowerCase();+ var css_rules = sheet.cssRules || sheet.rules,+ j = 0;+ do {+ if(css_rules.length && j > css_rules.length + 5) { return false; }+ if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {+ if(delete_flag === true) {+ if(sheet.removeRule) { sheet.removeRule(j); }+ if(sheet.deleteRule) { sheet.deleteRule(j); }+ return true;+ }+ else { return css_rules[j]; }+ }+ }+ while (css_rules[++j]);+ return false;+ },+ add_css : function(rule_name, sheet) {+ if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }+ if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }+ return $.vakata.css.get_css(rule_name);+ },+ remove_css : function(rule_name, sheet) {+ return $.vakata.css.get_css(rule_name, true, sheet);+ },+ add_sheet : function(opts) {+ var tmp;+ if(opts.str) {+ tmp = document.createElement("style");+ tmp.setAttribute('type',"text/css");+ if(tmp.styleSheet) {+ document.getElementsByTagName("head")[0].appendChild(tmp);+ tmp.styleSheet.cssText = opts.str;+ }+ else {+ tmp.appendChild(document.createTextNode(opts.str));+ document.getElementsByTagName("head")[0].appendChild(tmp);+ }+ return tmp.sheet || tmp.styleSheet;+ }+ if(opts.url) {+ if(document.createStyleSheet) {+ try { tmp = document.createStyleSheet(opts.url); } catch (e) { }+ }+ else {+ tmp = document.createElement('link');+ tmp.rel = 'stylesheet';+ tmp.type = 'text/css';+ tmp.media = "all";+ tmp.href = opts.url;+ document.getElementsByTagName("head")[0].appendChild(tmp);+ return tmp.styleSheet;+ }+ }+ }+ };+})(jQuery);++/*+ * jsTree core 1.0+ */+(function ($) {+ // private variables+ var instances = [], // instance array (used by $.jstree.reference/create/focused)+ focused_instance = -1, // the index in the instance array of the currently focused instance+ plugins = {}, // list of included plugins+ prepared_move = {}, // for the move plugin+ is_ie6 = false;++ // jQuery plugin wrapper (thanks to jquery UI widget function)+ $.fn.jstree = function (settings) {+ var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")+ args = Array.prototype.slice.call(arguments, 1),+ returnValue = this;++ // extend settings and allow for multiple hashes and metadata+ if(!isMethodCall && $.meta) { args.push($.metadata.get(this).jstree); }+ settings = !isMethodCall && args.length ? $.extend.apply(null, [true, settings].concat(args)) : settings;+ // block calls to "private" methods+ if(isMethodCall && settings.substring(0, 1) == '_') { return returnValue; }++ // if a method call execute the method on all selected instances+ if(isMethodCall) {+ this.each(function() {+ var instance = instances[$.data(this, "jstree-instance-id")],+ 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; }+ });+ }+ else {+ this.each(function() {+ var instance_id = $.data(this, "jstree-instance-id"),+ s = false;+ // if an instance already exists, destroy it first+ if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }+ // push a new empty object to the instances array+ instance_id = parseInt(instances.push({}),10) - 1;+ // store the jstree instance id to the container element+ $.data(this, "jstree-instance-id", instance_id);+ // clean up all plugins+ if(!settings) { settings = {}; }+ settings.plugins = $.isArray(settings.plugins) ? settings.plugins : $.jstree.defaults.plugins;+ if($.inArray("core", settings.plugins) === -1) { settings.plugins.unshift("core"); }++ // only unique plugins (NOT WORKING)+ // settings.plugins = settings.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");++ // extend defaults with passed data+ s = $.extend(true, {}, $.jstree.defaults, settings);+ s.plugins = settings.plugins;+ $.each(plugins, function (i, val) { if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; } });+ // push the new object to the instances array (at the same time set the default classes to the container) and init+ instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);+ // init all activated plugins for this instance+ $.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]); } });+ // initialize the instance+ instances[instance_id].init();+ });+ }+ // return the jquery selection (or if it was a method call that returned a value - the returned value)+ return returnValue;+ };+ // object to store exposed functions and objects+ $.jstree = {+ defaults : {+ plugins : []+ },+ _focused : function () { return instances[focused_instance] || null; },+ _reference : function (needle) {+ // get by instance id+ if(instances[needle]) { return instances[needle]; }+ // get by DOM (if still no luck - return null+ var o = $(needle);+ if(!o.length && typeof needle === "string") { o = $("#" + needle); }+ if(!o.length) { return null; }+ return instances[o.closest(".jstree").data("jstree-instance-id")] || null;+ },+ _instance : function (index, container, settings) {+ // for plugins to store data in+ this.data = { core : {} };+ this.get_settings = function () { return $.extend(true, {}, settings); };+ this._get_settings = function () { return settings; };+ this.get_index = function () { return index; };+ this.get_container = function () { return container; };+ this._set_settings = function (s) {+ settings = $.extend(true, {}, settings, s);+ };+ },+ _fn : { },+ plugin : function (pname, pdata) {+ pdata = $.extend({}, {+ __init : $.noop,+ __destroy : $.noop,+ _fn : {},+ defaults : false+ }, pdata);+ plugins[pname] = pdata;++ $.jstree.defaults[pname] = pdata.defaults;+ $.each(pdata._fn, function (i, val) {+ val.plugin = pname;+ val.old = $.jstree._fn[i];+ $.jstree._fn[i] = function () {+ var rslt,+ func = val,+ args = Array.prototype.slice.call(arguments),+ evnt = new $.Event("before.jstree"),+ rlbk = false;++ // Check if function belongs to the included plugins of this instance+ do {+ if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }+ func = func.old;+ } while(func);+ if(!func) { return; }++ // a chance to stop execution (or change arguments):+ // * just bind to jstree.before+ // * check the additional data object (func property)+ // * call event.stopImmediatePropagation()+ // * return false (or an array of arguments)+ rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args });+ if(rslt === false) { return; }+ if(typeof rslt !== "undefined") { args = rslt; }++ // context and function to trigger events, then finally call the function+ if(i.indexOf("_") === 0) {+ rslt = func.apply(this, args);+ }+ else {+ rslt = func.apply(+ $.extend({}, this, {+ __callback : function (data) {+ this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });+ },+ __rollback : function () {+ rlbk = this.get_rollback();+ return rlbk;+ },+ __call_old : function (replace_arguments) {+ return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );+ }+ }), args);+ }++ // return the result+ return rslt;+ };+ $.jstree._fn[i].old = val.old;+ $.jstree._fn[i].plugin = pname;+ });+ },+ rollback : function (rb) {+ if(rb) {+ if(!$.isArray(rb)) { rb = [ rb ]; }+ $.each(rb, function (i, val) {+ instances[val.i].set_rollback(val.h, val.d);+ });+ }+ }+ };+ // set the prototype for all instances+ $.jstree._fn = $.jstree._instance.prototype = {};++ // css functions - used internally++ // load the css when DOM is ready+ $(function() {+ // code is copied form jQuery ($.browser is deprecated + there is a bug in IE)+ var u = navigator.userAgent.toLowerCase(),+ v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],+ css_string = '' ++ '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' ++ '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; } ' ++ '.jstree-rtl li { margin-left:0; margin-right:18px; } ' ++ '.jstree > ul > li { margin-left:0px; } ' ++ '.jstree-rtl > ul > li { margin-right:0px; } ' ++ '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' ++ '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' ++ '.jstree a:focus { outline: none; } ' ++ '.jstree a > ins { height:16px; width:16px; } ' ++ '.jstree a > .jstree-icon { margin-right:3px; } ' ++ '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' ++ 'li.jstree-open > ul { display:block; } ' ++ 'li.jstree-closed > ul { display:none; } ';+ // Correct IE 6 (does not support the > CSS selector)+ if(/msie/.test(u) && parseInt(v, 10) == 6) {+ is_ie6 = true;+ css_string += '' ++ '.jstree li { height:18px; margin-left:0; margin-right:0; } ' ++ '.jstree li li { margin-left:18px; } ' ++ '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' ++ 'li.jstree-open ul { display:block; } ' ++ 'li.jstree-closed ul { display:none !important; } ' ++ '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' ++ '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' ++ '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';+ }+ // Correct IE 7 (shifts anchor nodes onhover)+ if(/msie/.test(u) && parseInt(v, 10) == 7) {+ css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';+ }+ $.vakata.css.add_sheet({ str : css_string });+ });++ // core functions (open, close, create, update, delete)+ $.jstree.plugin("core", {+ __init : function () {+ this.data.core.to_open = $.map($.makeArray(this.get_settings().core.initially_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/'); });+ },+ defaults : {+ html_titles : false,+ animation : 500,+ initially_open : [],+ rtl : false,+ strings : {+ loading : "Loading ...",+ new_node : "New node"+ }+ },+ _fn : {+ init : function () {+ this.set_focus();+ if(this._get_settings().core.rtl) {+ this.get_container().addClass("jstree-rtl").css("direction", "rtl");+ }+ this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>" + this._get_settings().core.strings.loading + "</a></li></ul>");+ this.data.core.li_height = this.get_container().find("ul li.jstree-closed, ul li.jstree-leaf").eq(0).height() || 18;++ this.get_container()+ .delegate("li > ins", "click.jstree", $.proxy(function (event) {+ var trgt = $(event.target);+ if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }+ }, this))+ .bind("mousedown.jstree", $.proxy(function () {+ this.set_focus(); // This used to be setTimeout(set_focus,0) - why?+ }, this))+ .bind("dblclick.jstree", function (event) {+ var sel;+ if(document.selection && document.selection.empty) { document.selection.empty(); }+ else {+ if(window.getSelection) {+ sel = window.getSelection();+ try {+ sel.removeAllRanges();+ sel.collapse();+ } catch (err) { }+ }+ }+ });+ this.__callback();+ this.load_node(-1, function () { this.loaded(); this.reopen(); });+ },+ destroy : function () {+ var i,+ n = this.get_index(),+ s = this._get_settings(),+ _this = this;++ $.each(s.plugins, function (i, val) {+ try { plugins[val].__destroy.apply(_this); } catch(err) { }+ });+ this.__callback();+ // set focus to another instance if this one is focused+ if(this.is_focused()) {+ for(i in instances) {+ if(instances.hasOwnProperty(i) && i != n) {+ instances[i].set_focus();+ break;+ }+ }+ }+ // if no other instance found+ if(n === focused_instance) { focused_instance = -1; }+ // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events+ this.get_container()+ .unbind(".jstree")+ .undelegate(".jstree")+ .removeData("jstree-instance-id")+ .find("[class^='jstree']")+ .andSelf()+ .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });+ // remove the actual data+ instances[n] = null;+ delete instances[n];+ },+ save_opened : function () {+ var _this = this;+ this.data.core.to_open = [];+ this.get_container().find(".jstree-open").each(function () {+ _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/'));+ });+ this.__callback(_this.data.core.to_open);+ },+ reopen : function (is_callback) {+ var _this = this,+ done = true,+ current = [],+ remaining = [];+ if(!is_callback) { this.data.core.reopen = false; this.data.core.refreshing = true; }+ if(this.data.core.to_open.length) {+ $.each(this.data.core.to_open, function (i, val) {+ if(val == "#") { return true; }+ if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }+ else { remaining.push(val); }+ });+ if(current.length) {+ this.data.core.to_open = remaining;+ $.each(current, function (i, val) {+ _this.open_node(val, function () { _this.reopen(true); }, true);+ });+ done = false;+ }+ }+ if(done) {+ // TODO: find a more elegant approach to syncronizing returning requests+ if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }+ this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);+ this.data.core.refreshing = false;+ }+ },+ refresh : function (obj) {+ var _this = this;+ this.save_opened();+ if(!obj) { obj = -1; }+ obj = this._get_node(obj);+ if(!obj) { obj = -1; }+ if(obj !== -1) { obj.children("UL").remove(); }+ this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reopen(); });+ },+ // Dummy function to fire after the first load (so that there is a jstree.loaded event)+ loaded : function () {+ this.__callback();+ },+ // deal with focus+ set_focus : function () {+ var f = $.jstree._focused();+ if(f && f !== this) {+ f.get_container().removeClass("jstree-focused");+ }+ if(f !== this) {+ this.get_container().addClass("jstree-focused");+ focused_instance = this.get_index();+ }+ this.__callback();+ },+ is_focused : function () {+ return focused_instance == this.get_index();+ },++ // traverse+ _get_node : function (obj) {+ var $obj = $(obj, this.get_container());+ if($obj.is(".jstree") || obj == -1) { return -1; }+ $obj = $obj.closest("li", this.get_container());+ return $obj.length ? $obj : false;+ },+ _get_next : function (obj, strict) {+ obj = this._get_node(obj);+ if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }+ if(!obj.length) { return false; }+ if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }++ if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }+ else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }+ else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }+ },+ _get_prev : function (obj, strict) {+ obj = this._get_node(obj);+ if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }+ if(!obj.length) { return false; }+ if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }++ if(obj.prev("li").length) {+ obj = obj.prev("li").eq(0);+ while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }+ return obj;+ }+ else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }+ },+ _get_parent : function (obj) {+ obj = this._get_node(obj);+ if(obj == -1 || !obj.length) { return false; }+ var o = obj.parentsUntil(".jstree", "li:eq(0)");+ return o.length ? o : -1;+ },+ _get_children : function (obj) {+ obj = this._get_node(obj);+ if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }+ if(!obj.length) { return false; }+ return obj.children("ul:eq(0)").children("li");+ },+ get_path : function (obj, id_mode) {+ var p = [],+ _this = this;+ obj = this._get_node(obj);+ if(obj === -1 || !obj || !obj.length) { return false; }+ obj.parentsUntil(".jstree", "li").each(function () {+ p.push( id_mode ? this.id : _this.get_text(this) );+ });+ p.reverse();+ p.push( id_mode ? obj.attr("id") : this.get_text(obj) );+ return p;+ },++ is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },+ is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },+ is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },+ // open/close+ open_node : function (obj, callback, skip_animation) {+ obj = this._get_node(obj);+ if(!obj.length) { return false; }+ if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }+ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,+ t = this;+ if(!this._is_loaded(obj)) {+ obj.children("a").addClass("jstree-loading");+ this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);+ }+ else {+ if(s) { obj.children("ul").css("display","none"); }+ obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");+ if(s) { obj.children("ul").stop(true).slideDown(s, function () { this.style.display = ""; }); }+ this.__callback({ "obj" : obj });+ if(callback) { callback.call(); }+ }+ },+ close_node : function (obj, skip_animation) {+ obj = this._get_node(obj);+ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation;+ if(!obj.length || !obj.hasClass("jstree-open")) { return false; }+ if(s) { obj.children("ul").attr("style","display:block !important"); }+ obj.removeClass("jstree-open").addClass("jstree-closed");+ if(s) { obj.children("ul").stop(true).slideUp(s, function () { this.style.display = ""; }); }+ this.__callback({ "obj" : obj });+ },+ toggle_node : function (obj) {+ obj = this._get_node(obj);+ if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }+ if(obj.hasClass("jstree-open")) { return this.close_node(obj); }+ },+ open_all : function (obj, original_obj) {+ obj = obj ? this._get_node(obj) : this.get_container();+ if(!obj || obj === -1) { obj = this.get_container(); }+ if(original_obj) {+ obj = obj.find("li.jstree-closed");+ }+ else {+ original_obj = obj;+ if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }+ else { obj = obj.find("li.jstree-closed"); }+ }+ var _this = this;+ obj.each(function () {+ var __this = this;+ if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, original_obj); }, true); }+ else { _this.open_node(this, false, true); }+ });+ // so that callback is fired AFTER all nodes are open+ if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }+ },+ close_all : function (obj) {+ var _this = this;+ obj = obj ? this._get_node(obj) : this.get_container();+ if(!obj || obj === -1) { obj = this.get_container(); }+ obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this); });+ this.__callback({ "obj" : obj });+ },+ clean_node : function (obj) {+ obj = obj && obj != -1 ? $(obj) : this.get_container();+ obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");+ obj.removeClass("jstree-last")+ .filter("li:last-child").addClass("jstree-last").end()+ .filter(":has(li)")+ .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");+ obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();+ this.__callback({ "obj" : obj });+ },+ // rollback+ get_rollback : function () {+ this.__callback();+ return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };+ },+ set_rollback : function (html, data) {+ this.get_container().empty().append(html);+ this.data = data;+ this.__callback();+ },+ // Dummy functions to be overwritten by any datastore plugin included+ load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },+ _is_loaded : function (obj) { return true; },++ // Basic operations: create+ create_node : function (obj, position, js, callback, is_loaded) {+ obj = this._get_node(obj);+ position = typeof position === "undefined" ? "last" : position;+ var d = $("<li>"),+ s = this._get_settings().core,+ tmp;++ if(obj !== -1 && !obj.length) { return false; }+ if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }++ this.__rollback();++ if(typeof js === "string") { js = { "data" : js }; }+ if(!js) { js = {}; }+ if(js.attr) { d.attr(js.attr); }+ if(js.state) { d.addClass("jstree-" + js.state); }+ if(!js.data) { js.data = s.strings.new_node; }+ if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }+ $.each(js.data, function (i, m) {+ tmp = $("<a>");+ if($.isFunction(m)) { m = m.call(this, js); }+ if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }+ else {+ if(!m.attr) { m.attr = {}; }+ if(!m.attr.href) { m.attr.href = '#'; }+ tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);+ if(m.language) { tmp.addClass(m.language); }+ }+ tmp.prepend("<ins class='jstree-icon'> </ins>");+ if(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"); }+ }+ d.append(tmp);+ });+ d.prepend("<ins class='jstree-icon'> </ins>");+ if(obj === -1) {+ obj = this.get_container();+ if(position === "before") { position = "first"; }+ if(position === "after") { position = "last"; }+ }+ switch(position) {+ case "before": obj.before(d); tmp = this._get_parent(obj); break;+ case "after" : obj.after(d); tmp = this._get_parent(obj); break;+ case "inside":+ case "first" :+ if(!obj.children("ul").length) { obj.append("<ul>"); }+ obj.children("ul").prepend(d);+ tmp = obj;+ break;+ case "last":+ if(!obj.children("ul").length) { obj.append("<ul>"); }+ obj.children("ul").append(d);+ tmp = obj;+ break;+ default:+ if(!obj.children("ul").length) { obj.append("<ul>"); }+ if(!position) { position = 0; }+ tmp = obj.children("ul").children("li").eq(position);+ if(tmp.length) { tmp.before(d); }+ else { obj.children("ul").append(d); }+ tmp = obj;+ break;+ }+ if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }+ this.clean_node(tmp);+ this.__callback({ "obj" : d, "parent" : tmp });+ if(callback) { callback.call(this, d); }+ return d;+ },+ // Basic operations: rename (deal with text)+ get_text : function (obj) {+ obj = this._get_node(obj);+ if(!obj.length) { return false; }+ var s = this._get_settings().core.html_titles;+ obj = obj.children("a:eq(0)");+ if(s) {+ obj = obj.clone();+ obj.children("INS").remove();+ return obj.html();+ }+ else {+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];+ return obj.nodeValue;+ }+ },+ set_text : function (obj, val) {+ obj = this._get_node(obj);+ if(!obj.length) { return false; }+ obj = obj.children("a:eq(0)");+ if(this._get_settings().core.html_titles) {+ var tmp = obj.children("INS").clone();+ obj.html(val).prepend(tmp);+ this.__callback({ "obj" : obj, "name" : val });+ return true;+ }+ else {+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];+ this.__callback({ "obj" : obj, "name" : val });+ return (obj.nodeValue = val);+ }+ },+ rename_node : function (obj, val) {+ obj = this._get_node(obj);+ this.__rollback();+ if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }+ },+ // Basic operations: deleting nodes+ delete_node : function (obj) {+ obj = this._get_node(obj);+ if(!obj.length) { return false; }+ this.__rollback();+ var p = this._get_parent(obj), prev = this._get_prev(obj);+ obj = obj.remove();+ if(p !== -1 && p.find("> ul > li").length === 0) {+ p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");+ }+ this.clean_node(p);+ this.__callback({ "obj" : obj, "prev" : prev });+ return obj;+ },+ prepare_move : function (o, r, pos, cb, is_cb) {+ var p = {};++ p.ot = $.jstree._reference(p.o) || this;+ p.o = p.ot._get_node(o);+ p.r = r === - 1 ? -1 : this._get_node(r);+ p.p = (typeof p === "undefined") ? "last" : pos; // TODO: move to a setting+ if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {+ this.__callback(prepared_move);+ if(cb) { cb.call(this, prepared_move); }+ return;+ }+ p.ot = $.jstree._reference(p.o) || this;+ p.rt = r === -1 ? p.ot : $.jstree._reference(p.r) || this;+ if(p.r === -1) {+ p.cr = -1;+ switch(p.p) {+ case "first":+ case "before":+ case "inside":+ p.cp = 0;+ break;+ case "after":+ case "last":+ p.cp = p.rt.get_container().find(" > ul > li").length;+ break;+ default:+ p.cp = p.p;+ break;+ }+ }+ else {+ if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {+ return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });+ }+ switch(p.p) {+ case "before":+ p.cp = p.r.index();+ p.cr = p.rt._get_parent(p.r);+ break;+ case "after":+ p.cp = p.r.index() + 1;+ p.cr = p.rt._get_parent(p.r);+ break;+ case "inside":+ case "first":+ p.cp = 0;+ p.cr = p.r;+ break;+ case "last":+ p.cp = p.r.find(" > ul > li").length;+ p.cr = p.r;+ break;+ default:+ p.cp = p.p;+ p.cr = p.r;+ break;+ }+ }+ p.np = p.cr == -1 ? p.rt.get_container() : p.cr;+ p.op = p.ot._get_parent(p.o);+ p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");++ prepared_move = p;+ this.__callback(prepared_move);+ if(cb) { cb.call(this, prepared_move); }+ },+ check_move : function () {+ var obj = prepared_move, ret = true;+ if(obj.or[0] === obj.o[0]) { return false; }+ obj.o.each(function () {+ if(obj.r.parentsUntil(".jstree").andSelf().filter("li").index(this) !== -1) { ret = false; return false; }+ });+ return ret;+ },+ move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {+ if(!is_prepared) {+ return this.prepare_move(obj, ref, position, function (p) {+ this.move_node(p, false, false, is_copy, true, skip_check);+ });+ }+ if(!skip_check && !this.check_move()) { return false; }++ this.__rollback();+ var o = false;+ if(is_copy) {+ o = obj.o.clone();+ o.find("*[id]").andSelf().each(function () {+ if(this.id) { this.id = "copy_" + this.id; }+ });+ }+ else { o = obj.o; }++ if(obj.or.length) { obj.or.before(o); }+ else {+ if(!obj.np.children("ul").length) { $("<ul>").appendTo(obj.np); }+ obj.np.children("ul:eq(0)").append(o);+ }++ try {+ obj.ot.clean_node(obj.op);+ obj.rt.clean_node(obj.np);+ if(!obj.op.find("> ul > li").length) {+ obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();+ }+ } catch (e) { }++ if(is_copy) {+ prepared_move.cy = true;+ prepared_move.oc = o;+ }+ this.__callback(prepared_move);+ return prepared_move;+ },+ _get_move : function () { return prepared_move; }+ }+ });+})(jQuery);+//*/++/*+ * jsTree ui plugin 1.0+ * This plugins handles selecting/deselecting/hovering/dehovering nodes+ */+(function ($) {+ $.jstree.plugin("ui", {+ __init : function () {+ this.data.ui.selected = $();+ this.data.ui.last_selected = false;+ this.data.ui.hovered = null;+ this.data.ui.to_select = this.get_settings().ui.initially_select;++ this.get_container()+ .delegate("a", "click.jstree", $.proxy(function (event) {+ event.preventDefault();+ this.select_node(event.currentTarget, true, event);+ }, this))+ .delegate("a", "mouseenter.jstree", $.proxy(function (event) {+ this.hover_node(event.target);+ }, this))+ .delegate("a", "mouseleave.jstree", $.proxy(function (event) {+ this.dehover_node(event.target);+ }, this))+ .bind("reopen.jstree", $.proxy(function () {+ this.reselect();+ }, this))+ .bind("get_rollback.jstree", $.proxy(function () {+ this.dehover_node();+ this.save_selected();+ }, this))+ .bind("set_rollback.jstree", $.proxy(function () {+ this.reselect();+ }, this))+ .bind("close_node.jstree", $.proxy(function (event, data) {+ var s = this._get_settings().ui,+ obj = this._get_node(data.rslt.obj),+ clk = (obj && obj.length) ? obj.children("ul").find(".jstree-clicked") : $(),+ _this = this;+ if(s.selected_parent_close === false || !clk.length) { return; }+ clk.each(function () {+ _this.deselect_node(this);+ if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }+ });+ }, this))+ .bind("delete_node.jstree", $.proxy(function (event, data) {+ var s = this._get_settings().ui.select_prev_on_delete,+ obj = this._get_node(data.rslt.obj),+ clk = (obj && obj.length) ? obj.find(".jstree-clicked") : [],+ _this = this;+ clk.each(function () { _this.deselect_node(this); });+ if(s && clk.length) { this.select_node(data.rslt.prev); }+ }, this))+ .bind("move_node.jstree", $.proxy(function (event, data) {+ if(data.rslt.cy) {+ data.rslt.oc.find(".jstree-clicked").removeClass("jstree-clicked");+ }+ }, this));+ },+ defaults : {+ select_limit : -1, // 0, 1, 2 ... or -1 for unlimited+ select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt+ selected_parent_close : "select_parent", // false, "deselect", "select_parent"+ select_prev_on_delete : true,+ disable_selecting_children : false,+ initially_select : []+ },+ _fn : {+ _get_node : function (obj, allow_multiple) {+ if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }+ var $obj = $(obj, this.get_container());+ if($obj.is(".jstree") || obj == -1) { return -1; }+ $obj = $obj.closest("li", this.get_container());+ return $obj.length ? $obj : false;+ },+ save_selected : function () {+ var _this = this;+ this.data.ui.to_select = [];+ this.data.ui.selected.each(function () { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/')); });+ this.__callback(this.data.ui.to_select);+ },+ reselect : function () {+ var _this = this,+ s = this.data.ui.to_select;+ s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/'); });+ this.deselect_all();+ $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });+ this.__callback();+ },+ refresh : function (obj) {+ this.save_selected();+ return this.__call_old();+ },+ hover_node : function (obj) {+ obj = this._get_node(obj);+ if(!obj.length) { return false; }+ //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }+ if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }+ this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();+ this.__callback({ "obj" : obj });+ },+ dehover_node : function () {+ var obj = this.data.ui.hovered, p;+ if(!obj || !obj.length) { return false; }+ p = obj.children("a").removeClass("jstree-hovered").parent();+ if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }+ this.__callback({ "obj" : obj });+ },+ select_node : function (obj, check, e) {+ obj = this._get_node(obj);+ if(obj == -1 || !obj || !obj.length) { return false; }+ var s = this._get_settings().ui,+ is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),+ is_selected = this.is_selected(obj),+ proceed = true;+ if(check) {+ if(s.disable_selecting_children && is_multiple && obj.parents("li", this.get_container()).children(".jstree-clicked").length) {+ return false;+ }+ proceed = false;+ switch(!0) {+ case (is_selected && !is_multiple):+ this.deselect_all();+ is_selected = false;+ proceed = true;+ break;+ case (!is_selected && !is_multiple):+ if(s.select_limit == -1 || s.select_limit > 0) {+ this.deselect_all();+ proceed = true;+ }+ break;+ case (is_selected && is_multiple):+ this.deselect_node(obj);+ break;+ case (!is_selected && is_multiple):+ if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {+ proceed = true;+ }+ break;+ }+ }+ if(proceed && !is_selected) {+ obj.children("a").addClass("jstree-clicked");+ this.data.ui.selected = this.data.ui.selected.add(obj);+ this.data.ui.last_selected = obj;+ this.__callback({ "obj" : obj });+ }+ },+ deselect_node : function (obj) {+ obj = this._get_node(obj);+ if(!obj.length) { return false; }+ if(this.is_selected(obj)) {+ obj.children("a").removeClass("jstree-clicked");+ this.data.ui.selected = this.data.ui.selected.not(obj);+ if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }+ this.__callback({ "obj" : obj });+ }+ },+ toggle_select : function (obj) {+ obj = this._get_node(obj);+ if(!obj.length) { return false; }+ if(this.is_selected(obj)) { this.deselect_node(obj); }+ else { this.select_node(obj); }+ },+ is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },+ get_selected : function (context) {+ return context ? $(context).find(".jstree-clicked").parent() : this.data.ui.selected;+ },+ deselect_all : function (context) {+ if(context) { $(context).find(".jstree-clicked").removeClass("jstree-clicked"); }+ else { this.get_container().find(".jstree-clicked").removeClass("jstree-clicked"); }+ this.data.ui.selected = $([]);+ this.data.ui.last_selected = false;+ this.__callback();+ }+ }+ });+ // include the selection plugin by default+ $.jstree.defaults.plugins.push("ui");+})(jQuery);+//*/++/*+ * jsTree CRRM plugin 1.0+ * Handles creating/renaming/removing/moving nodes by user interaction.+ */+(function ($) {+ $.jstree.plugin("crrm", {+ __init : function () {+ this.get_container()+ .bind("move_node.jstree", $.proxy(function (e, data) {+ if(this._get_settings().crrm.move.open_onmove) {+ var t = this;+ data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {+ t.open_node(this, false, true);+ });+ }+ }, this));+ },+ defaults : {+ input_width_limit : 200,+ move : {+ always_copy : false, // false, true or "multitree"+ open_onmove : true,+ default_position : "last",+ check_move : function (m) { return true; }+ }+ },+ _fn : {+ _show_input : function (obj, callback) {+ obj = this._get_node(obj);+ var rtl = this._get_settings().core.rtl,+ w = this._get_settings().crrm.input_width_limit,+ w1 = obj.children("ins").width(),+ w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,+ t = this.get_text(obj),+ h1 = $("<div>", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),+ h2 = obj.css("position","relative").append(+ $("<input>", {+ "value" : t,+ // "size" : t.length,+ "css" : {+ "padding" : "0",+ "border" : "1px solid silver",+ "position" : "absolute",+ "left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),+ "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),+ "top" : "0px",+ "height" : (this.data.core.li_height - 2) + "px",+ "lineHeight" : (this.data.core.li_height - 2) + "px",+ "width" : "150px" // will be set a bit further down+ },+ "blur" : $.proxy(function () {+ var i = obj.children("input"),+ v = i.val();+ if(v === "") { v = t; }+ i.remove(); // rollback purposes+ this.set_text(obj,t); // rollback purposes+ this.rename_node(obj, v);+ callback.call(this, obj, v, t);+ obj.css("position","");+ }, this),+ "keyup" : function (event) {+ var key = event.keyCode || event.which;+ if(key == 27) { this.value = t; this.blur(); return; }+ else if(key == 13) { this.blur(); return; }+ else {+ h2.width(Math.min(h1.text("pW" + this.value).width(),w));+ }+ }+ })+ ).children("input");+ this.set_text(obj, "");+ h1.css({+ fontFamily : h2.css('fontFamily') || '',+ fontSize : h2.css('fontSize') || '',+ fontWeight : h2.css('fontWeight') || '',+ fontStyle : h2.css('fontStyle') || '',+ fontStretch : h2.css('fontStretch') || '',+ fontVariant : h2.css('fontVariant') || '',+ letterSpacing : h2.css('letterSpacing') || '',+ wordSpacing : h2.css('wordSpacing') || ''+ });+ h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();+ },+ rename : function (obj) {+ obj = this._get_node(obj);+ this.__rollback();+ var f = this.__callback;+ this._show_input(obj, function (obj, new_name, old_name) {+ f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });+ });+ },+ create : function (obj, position, js, callback, skip_rename) {+ var t, _this = this;+ obj = this._get_node(obj);+ if(!obj) { obj = -1; }+ this.__rollback();+ t = this.create_node(obj, position, js, function (t) {+ var p = this._get_parent(t),+ pos = $(t).index();+ if(callback) { callback.call(this, t); }+ if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }+ if(!skip_rename) {+ this._show_input(t, function (obj, new_name, old_name) {+ _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });+ });+ }+ else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }+ });+ return t;+ },+ remove : function (obj) {+ obj = this._get_node(obj, true);+ this.__rollback();+ this.delete_node(obj);+ this.__callback({ "obj" : obj });+ },+ check_move : function () {+ if(!this.__call_old()) { return false; }+ var s = this._get_settings().crrm.move;+ if(!s.check_move.call(this, this._get_move())) { return false; }+ return true;+ },+ move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {+ var s = this._get_settings().crrm.move;+ if(!is_prepared) {+ if(!position) { position = s.default_position; }+ if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }+ return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);+ }+ // if the move is already prepared+ if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {+ is_copy = true;+ }+ this.__call_old(true, obj, ref, position, is_copy, true, skip_check);+ },++ cut : function (obj) {+ obj = this._get_node(obj);+ this.data.crrm.cp_nodes = false;+ this.data.crrm.ct_nodes = false;+ if(!obj || !obj.length) { return false; }+ this.data.crrm.ct_nodes = obj;+ },+ copy : function (obj) {+ obj = this._get_node(obj);+ this.data.crrm.cp_nodes = false;+ this.data.crrm.ct_nodes = false;+ if(!obj || !obj.length) { return false; }+ this.data.crrm.cp_nodes = obj;+ },+ paste : function (obj) {+ obj = this._get_node(obj);+ if(!obj || !obj.length) { return false; }+ if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }+ if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); }+ if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }+ this.data.crrm.cp_nodes = false;+ this.data.crrm.ct_nodes = false;+ }+ }+ });+ // include the crr plugin by default+ $.jstree.defaults.plugins.push("crrm");+})(jQuery);++/*+ * jsTree themes plugin 1.0+ * Handles loading and setting themes, as well as detecting path to themes, etc.+ */+(function ($) {+ var themes_loaded = [];+ // this variable stores the path to the themes folder - if left as false - it will be autodetected+ $.jstree._themes = false;+ $.jstree.plugin("themes", {+ __init : function () {+ this.get_container()+ .bind("init.jstree", $.proxy(function () {+ var s = this._get_settings().themes;+ this.data.themes.dots = s.dots;+ this.data.themes.icons = s.icons;+ //alert(s.dots);+ this.set_theme(s.theme, s.url);+ }, this))+ .bind("loaded.jstree", $.proxy(function () {+ // bound here too, as simple HTML tree's won't honor dots & icons otherwise+ if(!this.data.themes.dots) { this.hide_dots(); }+ else { this.show_dots(); }+ if(!this.data.themes.icons) { this.hide_icons(); }+ else { this.show_icons(); }+ }, this));+ },+ defaults : {+ theme : "default",+ url : false,+ dots : true,+ icons : true+ },+ _fn : {+ set_theme : function (theme_name, theme_url) {+ if(!theme_name) { return false; }+ if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }+ if($.inArray(theme_url, themes_loaded) == -1) {+ $.vakata.css.add_sheet({ "url" : theme_url, "rel" : "jstree" });+ themes_loaded.push(theme_url);+ }+ if(this.data.themes.theme != theme_name) {+ this.get_container().removeClass('jstree-' + this.data.themes.theme);+ this.data.themes.theme = theme_name;+ }+ this.get_container().addClass('jstree-' + theme_name);+ if(!this.data.themes.dots) { this.hide_dots(); }+ else { this.show_dots(); }+ if(!this.data.themes.icons) { this.hide_icons(); }+ else { this.show_icons(); }+ this.__callback();+ },+ get_theme : function () { return this.data.themes.theme; },++ show_dots : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },+ hide_dots : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },+ toggle_dots : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },++ show_icons : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },+ hide_icons : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },+ toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }+ }+ });+ // autodetect themes path+ $(function () {+ if($.jstree._themes === false) {+ $("script").each(function () {+ if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {+ $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';+ return false;+ }+ });+ }+ if($.jstree._themes === false) { $.jstree._themes = "themes/"; }+ });+ // include the themes plugin by default+ $.jstree.defaults.plugins.push("themes");+})(jQuery);+//*/++/*+ * jsTree hotkeys plugin 1.0+ * Enables keyboard navigation for all tree instances+ * Depends on the jstree ui & jquery hotkeys plugins+ */+(function ($) {+ var bound = [];+ function exec(i, event) {+ var f = $.jstree._focused(), tmp;+ if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {+ tmp = f._get_settings().hotkeys[i];+ if(tmp) { return tmp.call(f, event); }+ }+ }+ $.jstree.plugin("hotkeys", {+ __init : function () {+ if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }+ if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }+ $.each(this._get_settings().hotkeys, function (i, val) {+ if($.inArray(i, bound) == -1) {+ $(document).bind("keydown", i, function (event) { return exec(i, event); });+ bound.push(i);+ }+ });+ this.enable_hotkeys();+ },+ defaults : {+ "up" : function () {+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;+ this.hover_node(this._get_prev(o));+ return false;+ },+ "down" : function () {+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;+ this.hover_node(this._get_next(o));+ return false;+ },+ "left" : function () {+ var o = this.data.ui.hovered || this.data.ui.last_selected;+ if(o) {+ if(o.hasClass("jstree-open")) { this.close_node(o); }+ else { this.hover_node(this._get_prev(o)); }+ }+ return false;+ },+ "right" : function () {+ var o = this.data.ui.hovered || this.data.ui.last_selected;+ if(o && o.length) {+ if(o.hasClass("jstree-closed")) { this.open_node(o); }+ else { this.hover_node(this._get_next(o)); }+ }+ return false;+ },+ "space" : function () {+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }+ return false;+ },+ "ctrl+space" : function (event) {+ event.type = "click";+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }+ return false;+ },+ "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },+ "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }+ },+ _fn : {+ enable_hotkeys : function () {+ this.data.hotkeys.enabled = true;+ },+ disable_hotkeys : function () {+ this.data.hotkeys.enabled = false;+ }+ }+ });+})(jQuery);+//*/++/*+ * jsTree JSON 1.0+ * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.+ */+(function ($) {+ $.jstree.plugin("json_data", {+ defaults : {+ data : false,+ ajax : false,+ correct_state : true,+ progressive_render : false+ },+ _fn : {+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : obj }); s_call.call(this); }, e_call); },+ _is_loaded : function (obj) {+ var s = this._get_settings().json_data, d;+ obj = this._get_node(obj);+ if(obj && obj !== -1 && s.progressive_render && !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"));+ if(d) {+ obj.append(d);+ $.removeData(obj, "jstree-children");+ }+ this.clean_node(obj);+ return true;+ }+ return obj == -1 || !obj || !s.ajax || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;+ },+ load_node_json : function (obj, s_call, e_call) {+ var s = this.get_settings().json_data, d,+ error_func = function () {},+ success_func = function () {};+ obj = this._get_node(obj);+ if(obj && obj !== -1) {+ if(obj.data("jstree-is-loading")) { return; }+ else { obj.data("jstree-is-loading",true); }+ }+ switch(!0) {+ case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):+ if(!obj || obj == -1) {+ d = this._parse_json(s.data);+ if(d) {+ this.get_container().children("ul").empty().append(d.children());+ this.clean_node();+ }+ else {+ if(s.correct_state) { this.get_container().children("ul").empty(); }+ }+ }+ if(s_call) { s_call.call(this); }+ break;+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):+ error_func = function (x, t, e) {+ var ef = this.get_settings().json_data.ajax.error;+ if(ef) { ef.call(this, x, t, e); }+ if(obj != -1 && obj.length) {+ obj.children(".jstree-loading").removeClass("jstree-loading");+ obj.data("jstree-is-loading",false);+ if(t === "success" && s.correct_state) { obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); }+ }+ else {+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }+ }+ if(e_call) { e_call.call(this); }+ };+ success_func = function (d, t, x) {+ var sf = this.get_settings().json_data.ajax.success;+ if(sf) { d = sf.call(this,d,t,x) || d; }+ if(d === "" || (!$.isArray(d) && !$.isPlainObject(d))) {+ return error_func.call(this, x, t, "");+ }+ d = this._parse_json(d);+ if(d) {+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }+ else { obj.append(d).children(".jstree-loading").removeClass("jstree-loading"); obj.data("jstree-is-loading",false); }+ this.clean_node(obj);+ if(s_call) { s_call.call(this); }+ }+ else {+ if(obj === -1 || !obj) {+ if(s.correct_state) {+ this.get_container().children("ul").empty();+ if(s_call) { s_call.call(this); }+ }+ }+ else {+ obj.children(".jstree-loading").removeClass("jstree-loading");+ obj.data("jstree-is-loading",false);+ if(s.correct_state) {+ obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");+ if(s_call) { s_call.call(this); }+ }+ }+ }+ };+ s.ajax.context = this;+ s.ajax.error = error_func;+ s.ajax.success = success_func;+ if(!s.ajax.dataType) { s.ajax.dataType = "json"; }+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }+ $.ajax(s.ajax);+ break;+ }+ },+ _parse_json : function (js, is_callback) {+ var d = false,+ p = this._get_settings(),+ s = p.json_data,+ t = p.core.html_titles,+ tmp, i, j, ul1, ul2;++ if(!js) { return d; }+ if($.isFunction(js)) {+ js = js.call(this);+ }+ if($.isArray(js)) {+ d = $();+ if(!js.length) { return false; }+ for(i = 0, j = js.length; i < j; i++) {+ tmp = this._parse_json(js[i], true);+ if(tmp.length) { d = d.add(tmp); }+ }+ }+ else {+ if(typeof js == "string") { js = { data : js }; }+ if(!js.data && js.data !== "") { return d; }+ d = $("<li>");+ if(js.attr) { d.attr(js.attr); }+ if(js.metadata) { d.data("jstree", js.metadata); }+ if(js.state) { d.addClass("jstree-" + js.state); }+ if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }+ $.each(js.data, function (i, m) {+ tmp = $("<a>");+ if($.isFunction(m)) { m = m.call(this, js); }+ if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }+ else {+ if(!m.attr) { m.attr = {}; }+ if(!m.attr.href) { m.attr.href = '#'; }+ tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);+ if(m.language) { tmp.addClass(m.language); }+ }+ tmp.prepend("<ins class='jstree-icon'> </ins>");+ if(!m.icon && js.icon) { m.icon = js.icon; }+ if(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"); }+ }+ d.append(tmp);+ });+ d.prepend("<ins class='jstree-icon'> </ins>");+ if(js.children) {+ if(s.progressive_render && js.state !== "open") {+ d.addClass("jstree-closed").data("jstree-children", js.children);+ }+ else {+ if($.isFunction(js.children)) {+ js.children = js.children.call(this, js);+ }+ if($.isArray(js.children) && js.children.length) {+ tmp = this._parse_json(js.children, true);+ if(tmp.length) {+ ul2 = $("<ul>");+ ul2.append(tmp);+ d.append(ul2);+ }+ }+ }+ }+ }+ if(!is_callback) {+ ul1 = $("<ul>");+ ul1.append(d);+ d = ul1;+ }+ return d;+ },+ get_json : function (obj, li_attr, a_attr, is_callback) {+ var result = [],+ s = this._get_settings(),+ _this = this,+ tmp1, tmp2, li, a, t, lang;+ obj = this._get_node(obj);+ if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }+ li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];+ if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }+ a_attr = $.isArray(a_attr) ? a_attr : [ ];++ obj.each(function () {+ li = $(this);+ tmp1 = { data : [] };+ if(li_attr.length) { tmp1.attr = { }; }+ $.each(li_attr, function (i, v) {+ tmp2 = li.attr(v);+ if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*|$/ig,'').length) {+ tmp1.attr[v] = tmp2.replace(/jstree[^ ]*|$/ig,'');+ }+ });+ if(li.hasClass("jstree-open")) { tmp1.state = "open"; }+ if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }+ a = li.children("a");+ a.each(function () {+ t = $(this);+ if(+ a_attr.length ||+ $.inArray("languages", s.plugins) !== -1 ||+ t.children("ins").get(0).style.backgroundImage.length ||+ (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)+ ) {+ lang = false;+ if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {+ $.each(s.languages, function (l, lv) {+ if(t.hasClass(lv)) {+ lang = lv;+ return false;+ }+ });+ }+ tmp2 = { attr : { }, title : _this.get_text(t, lang) };+ $.each(a_attr, function (k, z) {+ tmp1.attr[z] = (t.attr(z) || "").replace(/jstree[^ ]*|$/ig,'');+ });+ $.each(s.languages, function (k, z) {+ if(t.hasClass(z)) { tmp2.language = z; return true; }+ });+ if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {+ tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"");+ }+ if(t.children("ins").get(0).style.backgroundImage.length) {+ tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");+ }+ }+ else {+ tmp2 = _this.get_text(t);+ }+ if(a.length > 1) { tmp1.data.push(tmp2); }+ else { tmp1.data = tmp2; }+ });+ li = li.find("> ul > li");+ if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }+ result.push(tmp1);+ });+ return result;+ }+ }+ });+})(jQuery);+//*/++/*+ * jsTree languages plugin 1.0+ * Adds support for multiple language versions in one tree+ * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time+ * This is useful for maintaining the same structure in many languages (hence the name of the plugin)+ */+(function ($) {+ $.jstree.plugin("languages", {+ __init : function () { this._load_css(); },+ defaults : [],+ _fn : {+ set_lang : function (i) {+ var langs = this._get_settings().languages,+ st = false,+ selector = ".jstree-" + this.get_index() + ' a';+ if(!$.isArray(langs) || langs.length === 0) { return false; }+ if($.inArray(i,langs) == -1) {+ if(!!langs[i]) { i = langs[i]; }+ else { return false; }+ }+ 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);+ if(st !== false) { st.style.display = "none"; }+ st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);+ if(st !== false) { st.style.display = ""; }+ this.data.languages.current_language = i;+ this.__callback(i);+ return true;+ },+ get_lang : function () {+ return this.data.languages.current_language;+ },+ get_text : function (obj, lang) {+ obj = this._get_node(obj) || this.data.ui.last_selected;+ if(!obj.size()) { return false; }+ var langs = this._get_settings().languages,+ s = this._get_settings().core.html_titles;+ if($.isArray(langs) && langs.length) {+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;+ obj = obj.children("a." + lang);+ }+ else { obj = obj.children("a:eq(0)"); }+ if(s) {+ obj = obj.clone();+ obj.children("INS").remove();+ return obj.html();+ }+ else {+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];+ return obj.nodeValue;+ }+ },+ set_text : function (obj, val, lang) {+ obj = this._get_node(obj) || this.data.ui.last_selected;+ if(!obj.size()) { return false; }+ var langs = this._get_settings().languages,+ s = this._get_settings().core.html_titles,+ tmp;+ if($.isArray(langs) && langs.length) {+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;+ obj = obj.children("a." + lang);+ }+ else { obj = obj.children("a:eq(0)"); }+ if(s) {+ tmp = obj.children("INS").clone();+ obj.html(val).prepend(tmp);+ this.__callback({ "obj" : obj, "name" : val, "lang" : lang });+ return true;+ }+ else {+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];+ this.__callback({ "obj" : obj, "name" : val, "lang" : lang });+ return (obj.nodeValue = val);+ }+ },+ _load_css : function () {+ var langs = this._get_settings().languages,+ str = "/* languages css */",+ selector = ".jstree-" + this.get_index() + ' a',+ ln;+ if($.isArray(langs) && langs.length) {+ this.data.languages.current_language = langs[0];+ for(ln = 0; ln < langs.length; ln++) {+ str += selector + "." + langs[ln] + " {";+ if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }+ str += " } ";+ }+ this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str });+ }+ },+ create_node : function (obj, position, js, callback) {+ var t = this.__call_old(true, obj, position, js, function (t) {+ var langs = this._get_settings().languages,+ a = t.children("a"),+ ln;+ if($.isArray(langs) && langs.length) {+ for(ln = 0; ln < langs.length; ln++) {+ if(!a.is("." + langs[ln])) {+ t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));+ }+ }+ a.not("." + langs.join(", .")).remove();+ }+ if(callback) { callback.call(this, t); }+ });+ return t;+ }+ }+ });+})(jQuery);+//*/++/*+ * jsTree cookies plugin 1.0+ * Stores the currently opened/selected nodes in a cookie and then restores them+ * Depends on the jquery.cookie plugin+ */+(function ($) {+ $.jstree.plugin("cookies", {+ __init : function () {+ if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }++ var s = this._get_settings().cookies,+ tmp;+ if(!!s.save_opened) {+ tmp = $.cookie(s.save_opened);+ if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }+ }+ if(!!s.save_selected) {+ tmp = $.cookie(s.save_selected);+ if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }+ }+ this.get_container()+ .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {+ this.get_container()+ .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {+ if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }+ }, this));+ }, this));+ },+ defaults : {+ save_opened : "jstree_open",+ save_selected : "jstree_select",+ auto_save : true,+ cookie_options : {}+ },+ _fn : {+ save_cookie : function (c) {+ if(this.data.core.refreshing) { return; }+ var s = this._get_settings().cookies;+ if(!c) { // if called manually and not by event+ if(s.save_opened) {+ this.save_opened();+ $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);+ }+ if(s.save_selected && this.data.ui) {+ this.save_selected();+ $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);+ }+ return;+ }+ switch(c) {+ case "open_node":+ case "close_node":+ if(!!s.save_opened) {+ this.save_opened();+ $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);+ }+ break;+ case "select_node":+ case "deselect_node":+ if(!!s.save_selected && this.data.ui) {+ this.save_selected();+ $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);+ }+ break;+ }+ }+ }+ });+ // include cookies by default+ $.jstree.defaults.plugins.push("cookies");+})(jQuery);+//*/++/*+ * jsTree sort plugin 1.0+ * Sorts items alphabetically (or using any other function)+ */+(function ($) {+ $.jstree.plugin("sort", {+ __init : function () {+ this.get_container()+ .bind("load_node.jstree", $.proxy(function (e, data) {+ var obj = this._get_node(data.rslt.obj);+ obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");+ this.sort(obj);+ }, this))+ .bind("rename_node.jstree", $.proxy(function (e, data) {+ this.sort(data.rslt.obj.parent());+ }, this))+ .bind("move_node.jstree", $.proxy(function (e, data) {+ var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;+ this.sort(m.children("ul"));+ }, this));+ },+ defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },+ _fn : {+ sort : function (obj) {+ var s = this._get_settings().sort,+ t = this;+ obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));+ obj.find("> li > ul").each(function() { t.sort($(this)); });+ this.clean_node(obj);+ }+ }+ });+})(jQuery);+//*/++/*+ * jsTree DND plugin 1.0+ * Drag and drop plugin for moving/copying nodes+ */+(function ($) {+ var o = false,+ r = false,+ m = false,+ sli = false,+ sti = false,+ dir1 = false,+ dir2 = false;+ $.vakata.dnd = {+ is_down : false,+ is_drag : false,+ helper : false,+ scroll_spd : 10,+ init_x : 0,+ init_y : 0,+ threshold : 5,+ user_data : {},++ drag_start : function (e, data, html) {+ if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }+ try {+ e.currentTarget.unselectable = "on";+ e.currentTarget.onselectstart = function() { return false; };+ if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }+ } catch(err) { }+ $.vakata.dnd.init_x = e.pageX;+ $.vakata.dnd.init_y = e.pageY;+ $.vakata.dnd.user_data = data;+ $.vakata.dnd.is_down = true;+ $.vakata.dnd.helper = $("<div id='vakata-dragged'>").html(html).css("opacity", "0.75");+ $(document).bind("mousemove", $.vakata.dnd.drag);+ $(document).bind("mouseup", $.vakata.dnd.drag_stop);+ return false;+ },+ drag : function (e) {+ if(!$.vakata.dnd.is_down) { return; }+ if(!$.vakata.dnd.is_drag) {+ if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {+ $.vakata.dnd.helper.appendTo("body");+ $.vakata.dnd.is_drag = true;+ $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });+ }+ else { return; }+ }++ // maybe use a scrolling parent element instead of document?+ if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a+ var d = $(document), t = d.scrollTop(), l = d.scrollLeft();+ if(e.pageY - t < 20) {+ if(sti && dir1 === "down") { clearInterval(sti); sti = false; }+ if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }+ }+ else {+ if(sti && dir1 === "up") { clearInterval(sti); sti = false; }+ }+ if($(window).height() - (e.pageY - t) < 20) {+ if(sti && dir1 === "up") { clearInterval(sti); sti = false; }+ if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }+ }+ else {+ if(sti && dir1 === "down") { clearInterval(sti); sti = false; }+ }++ if(e.pageX - l < 20) {+ if(sli && dir2 === "right") { clearInterval(sli); sli = false; }+ if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }+ }+ else {+ if(sli && dir2 === "left") { clearInterval(sli); sli = false; }+ }+ if($(window).width() - (e.pageX - l) < 20) {+ if(sli && dir2 === "left") { clearInterval(sli); sli = false; }+ if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }+ }+ else {+ if(sli && dir2 === "right") { clearInterval(sli); sli = false; }+ }+ }++ $.vakata.dnd.helper.css({ left : (e.pageX + 5) + "px", top : (e.pageY + 10) + "px" });+ $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });+ },+ drag_stop : function (e) {+ $(document).unbind("mousemove", $.vakata.dnd.drag);+ $(document).unbind("mouseup", $.vakata.dnd.drag_stop);+ $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });+ $.vakata.dnd.helper.remove();+ $.vakata.dnd.init_x = 0;+ $.vakata.dnd.init_y = 0;+ $.vakata.dnd.user_data = {};+ $.vakata.dnd.is_down = false;+ $.vakata.dnd.is_drag = false;+ }+ };+ $(function() {+ var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';+ $.vakata.css.add_sheet({ str : css_string });+ });++ $.jstree.plugin("dnd", {+ __init : function () {+ this.data.dnd = {+ active : false,+ after : false,+ inside : false,+ before : false,+ off : false,+ prepared : false,+ w : 0,+ to1 : false,+ to2 : false,+ cof : false,+ cw : false,+ ch : false,+ i1 : false,+ i2 : false+ };+ this.get_container()+ .bind("mouseenter.jstree", $.proxy(function () {+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && this.data.themes) {+ m.attr("class", "jstree-" + this.data.themes.theme);+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);+ }+ }, this))+ .bind("mouseleave.jstree", $.proxy(function () {+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }+ }+ }, this))+ .bind("mousemove.jstree", $.proxy(function (e) {+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {+ var cnt = this.get_container()[0];++ // Horizontal scroll+ if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }+ this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);+ }+ else if(e.pageX - 24 < this.data.dnd.cof.left) {+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }+ this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);+ }+ else {+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }+ }++ // Vertical scroll+ if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }+ this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);+ }+ else if(e.pageY - 24 < this.data.dnd.cof.top) {+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }+ this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);+ }+ else {+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }+ }++ }+ }, this))+ .delegate("a", "mousedown.jstree", $.proxy(function (e) {+ if(e.which === 1) {+ this.start_drag(e.currentTarget, e);+ return false;+ }+ }, this))+ .delegate("a", "mouseenter.jstree", $.proxy(function (e) {+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {+ this.dnd_enter(e.currentTarget);+ }+ }, this))+ .delegate("a", "mousemove.jstree", $.proxy(function (e) {+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {+ if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }+ this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;+ if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }+ this.dnd_show();+ }+ }, this))+ .delegate("a", "mouseleave.jstree", $.proxy(function (e) {+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {+ this.data.dnd.after = false;+ this.data.dnd.before = false;+ this.data.dnd.inside = false;+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");+ m.hide();+ if(r && r[0] === e.target.parentNode) {+ if(this.data.dnd.to1) {+ clearTimeout(this.data.dnd.to1);+ this.data.dnd.to1 = false;+ }+ if(this.data.dnd.to2) {+ clearTimeout(this.data.dnd.to2);+ this.data.dnd.to2 = false;+ }+ }+ }+ }, this))+ .delegate("a", "mouseup.jstree", $.proxy(function (e) {+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {+ this.dnd_finish(e);+ }+ }, this));++ $(document)+ .bind("drag_stop.vakata", $.proxy(function () {+ this.data.dnd.after = false;+ this.data.dnd.before = false;+ this.data.dnd.inside = false;+ this.data.dnd.off = false;+ this.data.dnd.prepared = false;+ this.data.dnd.w = false;+ this.data.dnd.to1 = false;+ this.data.dnd.to2 = false;+ this.data.dnd.active = false;+ this.data.dnd.foreign = false;+ if(m) { m.css({ "top" : "-2000px" }); }+ }, this))+ .bind("drag_start.vakata", $.proxy(function (e, data) {+ if(data.data.jstree) {+ var et = $(data.event.target);+ if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {+ this.dnd_enter(et);+ }+ }+ }, this));++ var s = this._get_settings().dnd;+ if(s.drag_target) {+ $(document)+ .delegate(s.drag_target, "mousedown.jstree", $.proxy(function (e) {+ o = e.target;+ $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );+ if(this.data.themes) {+ m.attr("class", "jstree-" + this.data.themes.theme);+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);+ }+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");+ var cnt = this.get_container();+ this.data.dnd.cof = cnt.offset();+ this.data.dnd.cw = parseInt(cnt.width(),10);+ this.data.dnd.ch = parseInt(cnt.height(),10);+ this.data.dnd.foreign = true;+ return false;+ }, this));+ }+ if(s.drop_target) {+ $(document)+ .delegate(s.drop_target, "mouseenter.jstree", $.proxy(function (e) {+ if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target) })) {+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");+ }+ }, this))+ .delegate(s.drop_target, "mouseleave.jstree", $.proxy(function (e) {+ if(this.data.dnd.active) {+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");+ }+ }, this))+ .delegate(s.drop_target, "mouseup.jstree", $.proxy(function (e) {+ if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {+ this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target) });+ }+ }, this));+ }+ },+ defaults : {+ copy_modifier : "ctrl",+ check_timeout : 200,+ open_timeout : 500,+ drop_target : ".jstree-drop",+ drop_check : function (data) { return true; },+ drop_finish : $.noop,+ drag_target : ".jstree-draggable",+ drag_finish : $.noop,+ drag_check : function (data) { return { after : false, before : false, inside : true }; }+ },+ _fn : {+ dnd_prepare : function () {+ if(!r || !r.length) { return; }+ this.data.dnd.off = r.offset();+ if(this._get_settings().core.rtl) {+ this.data.dnd.off.right = this.data.dnd.off.left + r.width();+ }+ if(this.data.dnd.foreign) {+ var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });+ this.data.dnd.after = a.after;+ this.data.dnd.before = a.before;+ this.data.dnd.inside = a.inside;+ this.data.dnd.prepared = true;+ return this.dnd_show();+ }+ this.prepare_move(o, r, "before");+ this.data.dnd.before = this.check_move();+ this.prepare_move(o, r, "after");+ this.data.dnd.after = this.check_move();+ if(this._is_loaded(r)) {+ this.prepare_move(o, r, "inside");+ this.data.dnd.inside = this.check_move();+ }+ else {+ this.data.dnd.inside = false;+ }+ this.data.dnd.prepared = true;+ return this.dnd_show();+ },+ dnd_show : function () {+ if(!this.data.dnd.prepared) { return; }+ var o = ["before","inside","after"],+ r = false,+ rtl = this._get_settings().core.rtl,+ pos;+ if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }+ else if(this.data.dnd.w <= this.data.core.li_height*2/3) {+ o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];+ }+ else { o = ["after","inside","before"]; }+ $.each(o, $.proxy(function (i, val) {+ if(this.data.dnd[val]) {+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");+ r = val;+ return false;+ }+ }, this));+ if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }++ pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);+ switch(r) {+ case "before":+ m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();+ break;+ case "after":+ m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 7) + "px" }).show();+ break;+ case "inside":+ m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();+ break;+ default:+ m.hide();+ break;+ }+ return r;+ },+ dnd_open : function () {+ this.data.dnd.to2 = false;+ this.open_node(r, $.proxy(this.dnd_prepare,this), true);+ },+ dnd_finish : function (e) {+ if(this.data.dnd.foreign) {+ if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {+ this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r });+ }+ }+ else {+ this.dnd_prepare();+ this.move_node(o, r, this.dnd_show(), e[this._get_settings().dnd.copy_modifier + "Key"]);+ }+ o = false;+ r = false;+ m.hide();+ },+ dnd_enter : function (obj) {+ var s = this._get_settings().dnd;+ this.data.dnd.prepared = false;+ r = this._get_node(obj);+ if(s.check_timeout) {+ // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }+ this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);+ }+ else {+ this.dnd_prepare();+ }+ if(s.open_timeout) {+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }+ if(r && r.length && r.hasClass("jstree-closed")) {+ // if the node is closed - open it, then recalculate+ this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);+ }+ }+ else {+ if(r && r.length && r.hasClass("jstree-closed")) {+ this.dnd_open();+ }+ }+ },+ start_drag : function (obj, e) {+ o = this._get_node(obj);+ if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }+ $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + (o.length > 1 ? "Multiple selection" : this.get_text(o)) );+ if(this.data.themes) {+ m.attr("class", "jstree-" + this.data.themes.theme);+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);+ }+ var cnt = this.get_container();+ this.data.dnd.cof = cnt.children("ul").offset();+ this.data.dnd.cw = parseInt(cnt.width(),10);+ this.data.dnd.ch = parseInt(cnt.height(),10);+ this.data.dnd.active = true;+ }+ }+ });+ $(function() {+ var css_string = '' ++ '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; } ' ++ '#vakata-dragged .jstree-ok { background:green; } ' ++ '#vakata-dragged .jstree-invalid { background:red; } ' ++ '#jstree-marker { padding:0; margin:0; line-height:12px; font-size:1px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:silver; } ';+ $.vakata.css.add_sheet({ str : css_string });+ m = $("<div>").attr({ id : "jstree-marker" }).hide().appendTo("body");+ $(document).bind("drag_start.vakata", function (e, data) {+ if(data.data.jstree) {+ m.show();+ }+ });+ $(document).bind("drag_stop.vakata", function (e, data) {+ if(data.data.jstree) { m.hide(); }+ });+ });+})(jQuery);+//*/++/*+ * jsTree checkbox plugin 1.0+ * Inserts checkboxes in front of every node+ * Depends on the ui plugin+ * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP+ */+(function ($) {+ $.jstree.plugin("checkbox", {+ __init : function () {+ this.select_node = this.deselect_node = this.deselect_all = $.noop;+ this.get_selected = this.get_checked;++ this.get_container()+ .bind("open_node.jstree create_node.jstree clean_node.jstree", $.proxy(function (e, data) {+ this._prepare_checkboxes(data.rslt.obj);+ }, this))+ .bind("loaded.jstree", $.proxy(function (e) {+ this._prepare_checkboxes();+ }, this))+ .delegate("a", "click.jstree", $.proxy(function (e) {+ if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }+ else { this.check_node(e.target); }+ if(this.data.ui) { this.save_selected(); }+ if(this.data.cookies) { this.save_cookie("select_node"); }+ e.preventDefault();+ }, this));+ },+ __destroy : function () {+ this.get_container().find(".jstree-checkbox").remove();+ },+ _fn : {+ _prepare_checkboxes : function (obj) {+ obj = !obj || obj == -1 ? this.get_container() : this._get_node(obj);+ var c, _this = this, t;+ obj.each(function () {+ t = $(this);+ c = t.is("li") && t.hasClass("jstree-checked") ? "jstree-checked" : "jstree-unchecked";+ t.find("a").not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(c);+ });+ if(obj.is("li")) { this._repair_state(obj); }+ else { obj.find("> ul > li").each(function () { _this._repair_state(this); }); }+ },+ change_state : function (obj, state) {+ obj = this._get_node(obj);+ state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");+ if(state) { obj.find("li").andSelf().removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"); }+ else {+ obj.find("li").andSelf().removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");+ if(this.data.ui) { this.data.ui.last_selected = obj; }+ this.data.checkbox.last_selected = obj;+ }+ obj.parentsUntil(".jstree", "li").each(function () {+ var $this = $(this);+ if(state) {+ if($this.children("ul").children(".jstree-checked, .jstree-undetermined").length) {+ $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");+ return false;+ }+ else {+ $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");+ }+ }+ else {+ if($this.children("ul").children(".jstree-unchecked, .jstree-undetermined").length) {+ $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");+ return false;+ }+ else {+ $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");+ }+ }+ });+ if(this.data.ui) { this.data.ui.selected = this.get_checked(); }+ this.__callback(obj);+ },+ check_node : function (obj) {+ this.change_state(obj, false);+ },+ uncheck_node : function (obj) {+ this.change_state(obj, true);+ },+ check_all : function () {+ var _this = this;+ this.get_container().children("ul").children("li").each(function () {+ _this.check_node(this, false);+ });+ },+ uncheck_all : function () {+ var _this = this;+ this.get_container().children("ul").children("li").each(function () {+ _this.change_state(this, true);+ });+ },++ is_checked : function(obj) {+ obj = this._get_node(obj);+ return obj.length ? obj.is(".jstree-checked") : false;+ },+ get_checked : function (obj) {+ obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);+ return obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");+ },+ get_unchecked : function (obj) {+ obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);+ return obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");+ },++ show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },+ hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },++ _repair_state : function (obj) {+ obj = this._get_node(obj);+ if(!obj.length) { return; }+ var a = obj.find("> ul > .jstree-checked").length,+ b = obj.find("> ul > .jstree-undetermined").length,+ c = obj.find("> ul > li").length;++ if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.check_node(obj); } }+ else if(a === 0 && b === 0) { this.uncheck_node(obj); }+ else if(a === c) { this.check_node(obj); }+ else {+ obj.parentsUntil(".jstree","li").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");+ }+ },+ reselect : function () {+ if(this.data.ui) {+ var _this = this,+ s = this.data.ui.to_select;+ s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/'); });+ this.deselect_all();+ $.each(s, function (i, val) { _this.check_node(val); });+ this.__callback();+ }+ }+ }+ });+})(jQuery);+//*/++/*+ * jsTree XML 1.0+ * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.+ */+(function ($) {+ $.vakata.xslt = function (xml, xsl, callback) {+ var rs = "", xm, xs, processor, support;+ if(document.recalc) {+ xm = document.createElement('xml');+ xs = document.createElement('xml');+ xm.innerHTML = xml;+ xs.innerHTML = xsl;+ $("body").append(xm).append(xs);+ setTimeout( (function (xm, xs, callback) {+ return function () {+ callback.call(null, xm.transformNode(xs.XMLDocument));+ setTimeout( (function (xm, xs) { return function () { jQuery("body").remove(xm).remove(xs); }; })(xm, xs), 200);+ };+ }) (xm, xs, callback), 100);+ return true;+ }+ if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {+ processor = new XSLTProcessor();+ support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;+ if(!support) { return false; }+ xml = new DOMParser().parseFromString(xml, "text/xml");+ xsl = new DOMParser().parseFromString(xsl, "text/xml");+ if($.isFunction(processor.transformDocument)) {+ rs = document.implementation.createDocument("", "", null);+ processor.transformDocument(xml, xsl, rs, null);+ callback.call(null, XMLSerializer().serializeToString(rs));+ return true;+ }+ else {+ processor.importStylesheet(xsl);+ rs = processor.transformToFragment(xml, document);+ callback.call(null, $("<div>").append(rs).html());+ return true;+ }+ }+ return false;+ };+ var xsl = {+ 'nest' : '<?xml version="1.0" encoding="utf-8" ?>' ++ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' ++ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' ++ '<xsl:template match="/">' ++ ' <xsl:call-template name="nodes">' ++ ' <xsl:with-param name="node" select="/root" />' ++ ' </xsl:call-template>' ++ '</xsl:template>' ++ '<xsl:template name="nodes">' ++ ' <xsl:param name="node" />' ++ ' <ul>' ++ ' <xsl:for-each select="$node/item">' ++ ' <xsl:variable name="children" select="count(./item) > 0" />' ++ ' <li>' ++ ' <xsl:attribute name="class">' ++ ' <xsl:if test="position() = last()">jstree-last </xsl:if>' ++ ' <xsl:choose>' ++ ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' ++ ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' ++ ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' ++ ' </xsl:choose>' ++ ' <xsl:value-of select="@class" />' ++ ' </xsl:attribute>' ++ ' <xsl:for-each select="@*">' ++ ' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' ++ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' ++ ' </xsl:if>' ++ ' </xsl:for-each>' ++ ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' ++ ' <xsl:for-each select="content/name">' ++ ' <a>' ++ ' <xsl:attribute name="href">' ++ ' <xsl:choose>' ++ ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' ++ ' <xsl:otherwise>#</xsl:otherwise>' ++ ' </xsl:choose>' ++ ' </xsl:attribute>' ++ ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' ++ ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' ++ ' <xsl:for-each select="@*">' ++ ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' ++ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' ++ ' </xsl:if>' ++ ' </xsl:for-each>' ++ ' <ins>' ++ ' <xsl:attribute name="class">jstree-icon ' ++ ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' ++ ' </xsl:attribute>' ++ ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' ++ ' <xsl:text> </xsl:text>' ++ ' </ins>' ++ ' <xsl:value-of select="current()" />' ++ ' </a>' ++ ' </xsl:for-each>' ++ ' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' ++ ' </li>' ++ ' </xsl:for-each>' ++ ' </ul>' ++ '</xsl:template>' ++ '</xsl:stylesheet>',++ 'flat' : '<?xml version="1.0" encoding="utf-8" ?>' ++ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' ++ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' ++ '<xsl:template match="/">' ++ ' <ul>' ++ ' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */+ ' <xsl:call-template name="nodes">' ++ ' <xsl:with-param name="node" select="." />' ++ ' <xsl:with-param name="is_last" select="number(position() = last())" />' ++ ' </xsl:call-template>' ++ ' </xsl:for-each>' ++ ' </ul>' ++ '</xsl:template>' ++ '<xsl:template name="nodes">' ++ ' <xsl:param name="node" />' ++ ' <xsl:param name="is_last" />' ++ ' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />' ++ ' <li>' ++ ' <xsl:attribute name="class">' ++ ' <xsl:if test="$is_last = true()">jstree-last </xsl:if>' ++ ' <xsl:choose>' ++ ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' ++ ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' ++ ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' ++ ' </xsl:choose>' ++ ' <xsl:value-of select="@class" />' ++ ' </xsl:attribute>' ++ ' <xsl:for-each select="@*">' ++ ' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' ++ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' ++ ' </xsl:if>' ++ ' </xsl:for-each>' ++ ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' ++ ' <xsl:for-each select="content/name">' ++ ' <a>' ++ ' <xsl:attribute name="href">' ++ ' <xsl:choose>' ++ ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' ++ ' <xsl:otherwise>#</xsl:otherwise>' ++ ' </xsl:choose>' ++ ' </xsl:attribute>' ++ ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' ++ ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' ++ ' <xsl:for-each select="@*">' ++ ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' ++ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' ++ ' </xsl:if>' ++ ' </xsl:for-each>' ++ ' <ins>' ++ ' <xsl:attribute name="class">jstree-icon ' ++ ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' ++ ' </xsl:attribute>' ++ ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' ++ ' <xsl:text> </xsl:text>' ++ ' </ins>' ++ ' <xsl:value-of select="current()" />' ++ ' </a>' ++ ' </xsl:for-each>' ++ ' <xsl:if test="$children">' ++ ' <ul>' ++ ' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' ++ ' <xsl:call-template name="nodes">' ++ ' <xsl:with-param name="node" select="." />' ++ ' <xsl:with-param name="is_last" select="number(position() = last())" />' ++ ' </xsl:call-template>' ++ ' </xsl:for-each>' ++ ' </ul>' ++ ' </xsl:if>' ++ ' </li>' ++ '</xsl:template>' ++ '</xsl:stylesheet>'+ };+ $.jstree.plugin("xml_data", {+ defaults : {+ data : false,+ ajax : false,+ xsl : "flat",+ clean_node : false,+ correct_state : true+ },+ _fn : {+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : obj }); s_call.call(this); }, e_call); },+ _is_loaded : function (obj) {+ var s = this._get_settings().xml_data;+ obj = this._get_node(obj);+ return obj == -1 || !obj || !s.ajax || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;+ },+ load_node_xml : function (obj, s_call, e_call) {+ var s = this.get_settings().xml_data,+ error_func = function () {},+ success_func = function () {};++ obj = this._get_node(obj);+ if(obj && obj !== -1) {+ if(obj.data("jstree-is-loading")) { return; }+ else { obj.data("jstree-is-loading",true); }+ }+ switch(!0) {+ case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):+ if(!obj || obj == -1) {+ this.parse_xml(s.data, $.proxy(function (d) {+ if(d) {+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");+ if(d.length > 10) {+ d = $(d);+ this.get_container().children("ul").empty().append(d.children());+ if(s.clean_node) { this.clean_node(obj); }+ if(s_call) { s_call.call(this); }+ }+ }+ else {+ if(s.correct_state) {+ this.get_container().children("ul").empty();+ if(s_call) { s_call.call(this); }+ }+ }+ }, this));+ }+ break;+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):+ error_func = function (x, t, e) {+ var ef = this.get_settings().xml_data.ajax.error;+ if(ef) { ef.call(this, x, t, e); }+ if(obj !== -1 && obj.length) {+ obj.children(".jstree-loading").removeClass("jstree-loading");+ obj.data("jstree-is-loading",false);+ if(t === "success" && s.correct_state) { obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); }+ }+ else {+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }+ }+ if(e_call) { e_call.call(this); }+ };+ success_func = function (d, t, x) {+ d = x.responseText;+ var sf = this.get_settings().xml_data.ajax.success;+ if(sf) { d = sf.call(this,d,t,x) || d; }+ if(d == "") {+ return error_func.call(this, x, t, "");+ }+ this.parse_xml(d, $.proxy(function (d) {+ if(d) {+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");+ if(d.length > 10) {+ d = $(d);+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }+ else { obj.children(".jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.data("jstree-is-loading",false); }+ if(s.clean_node) { this.clean_node(obj); }+ if(s_call) { s_call.call(this); }+ }+ else {+ if(obj && obj !== -1) {+ obj.children(".jstree-loading").removeClass("jstree-loading");+ obj.data("jstree-is-loading",false);+ if(s.correct_state) {+ obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");+ if(s_call) { s_call.call(this); }+ }+ }+ else {+ if(s.correct_state) {+ this.get_container().children("ul").empty();+ if(s_call) { s_call.call(this); }+ }+ }+ }+ }+ }, this));+ };+ s.ajax.context = this;+ s.ajax.error = error_func;+ s.ajax.success = success_func;+ if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }+ $.ajax(s.ajax);+ break;+ }+ },+ parse_xml : function (xml, callback) {+ var s = this._get_settings().xml_data;+ $.vakata.xslt(xml, xsl[s.xsl], callback);+ },+ get_xml : function (tp, obj, li_attr, a_attr, is_callback) {+ var result = "",+ s = this._get_settings(),+ _this = this,+ tmp1, tmp2, li, a, lang;+ if(!tp) { tp = "flat"; }+ if(!is_callback) { is_callback = 0; }+ obj = this._get_node(obj);+ if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }+ li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];+ if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }++ a_attr = $.isArray(a_attr) ? a_attr : [ ];++ if(!is_callback) { result += "<root>"; }+ obj.each(function () {+ result += "<item";+ li = $(this);+ $.each(li_attr, function (i, v) { result += " " + v + "=\"" + (li.attr(v) || "").replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"") + "\""; });+ if(li.hasClass("jstree-open")) { result += " state=\"open\""; }+ if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }+ if(tp === "flat") { result += " parent_id=\"" + is_callback + "\""; }+ result += ">";+ result += "<content>";+ a = li.children("a");+ a.each(function () {+ tmp1 = $(this);+ lang = false;+ result += "<name";+ if($.inArray("languages", s.plugins) !== -1) {+ $.each(s.languages, function (k, z) {+ if(tmp1.hasClass(z)) { result += " lang=\"" + z + "\""; lang = z; return false; }+ });+ }+ if(a_attr.length) {+ $.each(a_attr, function (k, z) {+ result += " " + z + "=\"" + (tmp1.attr(z) || "").replace(/jstree[^ ]*|$/ig,'') + "\"";+ });+ }+ if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {+ result += ' icon="' + tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"") + '"';+ }+ if(tmp1.children("ins").get(0).style.backgroundImage.length) {+ result += ' icon="' + tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","") + '"';+ }+ result += ">";+ result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";+ result += "</name>";+ });+ result += "</content>";+ tmp2 = li[0].id;+ li = li.find("> ul > li");+ if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }+ else { tmp2 = ""; }+ if(tp == "nest") { result += tmp2; }+ result += "</item>";+ if(tp == "flat") { result += tmp2; }+ });+ if(!is_callback) { result += "</root>"; }+ return result;+ }+ }+ });+})(jQuery);+//*/++/*+ * jsTree search plugin 1.0+ * Enables both sync and async search on the tree+ * DOES NOT WORK WITH JSON PROGRESSIVE RENDER+ */+(function ($) {+ $.expr[':'].jstree_contains = function(a,i,m){+ return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;+ };+ $.jstree.plugin("search", {+ __init : function () {+ this.data.search.str = "";+ this.data.search.result = $();+ },+ defaults : {+ ajax : false, // OR ajax object+ case_insensitive : false+ },+ _fn : {+ search : function (str, skip_async) {+ if(str === "") { return; }+ var s = this.get_settings().search,+ t = this,+ error_func = function () { },+ success_func = function () { };+ this.data.search.str = str;++ if(!skip_async && s.ajax !== false && this.get_container().find(".jstree-closed:eq(0)").length > 0) {+ this.search.supress_callback = true;+ error_func = function () { };+ success_func = function (d, t, x) {+ var sf = this.get_settings().search.ajax.success;+ if(sf) { d = sf.call(this,d,t,x) || d; }+ this.data.search.to_open = d;+ this._search_open();+ };+ s.ajax.context = this;+ s.ajax.error = error_func;+ s.ajax.success = success_func;+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }+ if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }+ if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }+ $.ajax(s.ajax);+ return;+ }+ if(this.data.search.result.length) { this.clear_search(); }+ this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.case_insensitive ? "jstree_contains" : "contains") + "(" + this.data.search.str + ")");+ this.data.search.result.addClass("jstree-search").parents(".jstree-closed").each(function () {+ t.open_node(this, false, true);+ });+ this.__callback({ nodes : this.data.search.result, str : str });+ },+ clear_search : function (str) {+ this.data.search.result.removeClass("jstree-search");+ this.__callback(this.data.search.result);+ this.data.search.result = $();+ },+ _search_open : function (is_callback) {+ var _this = this,+ done = true,+ current = [],+ remaining = [];+ if(this.data.search.to_open.length) {+ $.each(this.data.search.to_open, function (i, val) {+ if(val == "#") { return true; }+ if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }+ else { remaining.push(val); }+ });+ if(current.length) {+ this.data.search.to_open = remaining;+ $.each(current, function (i, val) {+ _this.open_node(val, function () { _this._search_open(true); });+ });+ done = false;+ }+ }+ if(done) { this.search(this.data.search.str, true); }+ }+ }+ });+})(jQuery);+//*/++/*+ * jsTree contextmenu plugin 1.0+ */+(function ($) {+ $.vakata.context = {+ cnt : $("<div id='vakata-contextmenu'>"),+ vis : false,+ tgt : false,+ par : false,+ func : false,+ data : false,+ show : function (s, t, x, y, d, p) {+ var html = $.vakata.context.parse(s), h, w;+ if(!html) { return; }+ $.vakata.context.vis = true;+ $.vakata.context.tgt = t;+ $.vakata.context.par = p || t || null;+ $.vakata.context.data = d || null;+ $.vakata.context.cnt+ .html(html)+ .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });+ h = $.vakata.context.cnt.height();+ w = $.vakata.context.cnt.width();+ if(x + w > $(document).width()) {+ x = $(document).width() - (w + 5);+ $.vakata.context.cnt.find("li > ul").addClass("right");+ }+ if(y + h > $(document).height()) {+ y = y - (h + t[0].offsetHeight);+ $.vakata.context.cnt.find("li > ul").addClass("bottom");+ }++ $.vakata.context.cnt+ .css({ "left" : x, "top" : y })+ .find("li:has(ul)")+ .bind("mouseenter", function (e) {+ var w = $(document).width(),+ h = $(document).height(),+ ul = $(this).children("ul").show();+ if(w !== $(document).width()) { ul.toggleClass("right"); }+ if(h !== $(document).height()) { ul.toggleClass("bottom"); }+ })+ .bind("mouseleave", function (e) {+ $(this).children("ul").hide();+ })+ .end()+ .css({ "visibility" : "visible" })+ .show();+ $(document).triggerHandler("context_show.vakata");+ },+ hide : function () {+ $.vakata.context.vis = false;+ $.vakata.context.cnt.attr("class","").hide();+ $(document).triggerHandler("context_hide.vakata");+ },+ parse : function (s, is_callback) {+ if(!s) { return false; }+ var str = "",+ tmp = false,+ was_sep = true;+ if(!is_callback) { $.vakata.context.func = {}; }+ str += "<ul>";+ $.each(s, function (i, val) {+ if(!val) { return true; }+ $.vakata.context.func[i] = val.action;+ if(!was_sep && val.separator_before) {+ str += "<li class='vakata-separator vakata-separator-before'></li>";+ }+ was_sep = false;+ str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";+ if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }+ if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }+ str += "> </ins><a href='#' rel='" + i + "'>";+ if(val.submenu) {+ str += "<span style='float:right;'>»</span>";+ }+ str += val.label + "</a>";+ if(val.submenu) {+ tmp = $.vakata.context.parse(val.submenu, true);+ if(tmp) { str += tmp; }+ }+ str += "</li>";+ if(val.separator_after) {+ str += "<li class='vakata-separator vakata-separator-after'></li>";+ was_sep = true;+ }+ });+ str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");+ str += "</ul>";+ return str.length > 10 ? str : false;+ },+ exec : function (i) {+ if($.isFunction($.vakata.context.func[i])) {+ $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);+ return true;+ }+ else { return false; }+ }+ };+ $(function () {+ var css_string = '' ++ '#vakata-contextmenu { display:none; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' ++ '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' ++ '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' ++ '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' ++ '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' ++ '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' ++ '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' ++ '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' ++ '#vakata-contextmenu .right { right:100%; left:auto; } ' ++ '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' ++ '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';+ $.vakata.css.add_sheet({ str : css_string });+ $.vakata.context.cnt+ .delegate("a","click", function (e) { e.preventDefault(); })+ .delegate("a","mouseup", function (e) {+ if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {+ $.vakata.context.hide();+ }+ else { $(this).blur(); }+ })+ .delegate("a","mouseover", function () {+ $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");+ })+ .appendTo("body");+ $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });+ if(typeof $.hotkeys !== "undefined") {+ $(document)+ .bind("keydown", "up", function (e) {+ if($.vakata.context.vis) {+ var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();+ if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }+ o.addClass("vakata-hover");+ e.stopImmediatePropagation();+ e.preventDefault();+ }+ })+ .bind("keydown", "down", function (e) {+ if($.vakata.context.vis) {+ var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();+ if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }+ o.addClass("vakata-hover");+ e.stopImmediatePropagation();+ e.preventDefault();+ }+ })+ .bind("keydown", "right", function (e) {+ if($.vakata.context.vis) {+ $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");+ e.stopImmediatePropagation();+ e.preventDefault();+ }+ })+ .bind("keydown", "left", function (e) {+ if($.vakata.context.vis) {+ $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");+ e.stopImmediatePropagation();+ e.preventDefault();+ }+ })+ .bind("keydown", "esc", function (e) {+ $.vakata.context.hide();+ e.preventDefault();+ })+ .bind("keydown", "space", function (e) {+ $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();+ e.preventDefault();+ });+ }+ });++ $.jstree.plugin("contextmenu", {+ __init : function () {+ this.get_container()+ .delegate("a", "contextmenu.jstree", $.proxy(function (e) {+ e.preventDefault();+ this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);+ }, this))+ .bind("destroy.jstree", $.proxy(function () {+ if(this.data.contextmenu) {+ $.vakata.context.hide();+ }+ }, this));+ $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));+ },+ defaults : {+ select_node : false, // requires UI plugin+ show_at_node : true,+ items : { // Could be a function that should return an object like this one+ "create" : {+ "separator_before" : false,+ "separator_after" : true,+ "label" : "Create",+ "action" : function (obj) { this.create(obj); }+ },+ "rename" : {+ "separator_before" : false,+ "separator_after" : false,+ "label" : "Rename",+ "action" : function (obj) { this.rename(obj); }+ },+ "remove" : {+ "separator_before" : false,+ "icon" : false,+ "separator_after" : false,+ "label" : "Delete",+ "action" : function (obj) { this.remove(obj); }+ },+ "ccp" : {+ "separator_before" : true,+ "icon" : false,+ "separator_after" : false,+ "label" : "Edit",+ "action" : false,+ "submenu" : {+ "cut" : {+ "separator_before" : false,+ "separator_after" : false,+ "label" : "Cut",+ "action" : function (obj) { this.cut(obj); }+ },+ "copy" : {+ "separator_before" : false,+ "icon" : false,+ "separator_after" : false,+ "label" : "Copy",+ "action" : function (obj) { this.copy(obj); }+ },+ "paste" : {+ "separator_before" : false,+ "icon" : false,+ "separator_after" : false,+ "label" : "Paste",+ "action" : function (obj) { this.paste(obj); }+ }+ }+ }+ }+ },+ _fn : {+ show_contextmenu : function (obj, x, y) {+ obj = this._get_node(obj);+ var s = this.get_settings().contextmenu,+ a = obj.children("a:visible:eq(0)"),+ o = false;+ if(s.select_node && this.data.ui && !this.is_selected(obj)) {+ this.deselect_all();+ this.select_node(obj, true);+ }+ if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {+ o = a.offset();+ x = o.left;+ y = o.top + this.data.core.li_height;+ }+ if($.isFunction(s.items)) { s.items = s.items.call(this, obj); }+ this.data.contextmenu = true;+ $.vakata.context.show(s.items, a, x, y, this, obj);+ if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }+ }+ }+ });+})(jQuery);+//*/++/*+ * jsTree types plugin 1.0+ * Adds support types of nodes+ * You can set an attribute on each li node, that represents its type.+ * According to the type setting the node may get custom icon/validation rules+ */+(function ($) {+ $.jstree.plugin("types", {+ __init : function () {+ var s = this._get_settings().types;+ this.data.types.attach_to = [];+ this.get_container()+ .bind("init.jstree", $.proxy(function () {+ var types = s.types,+ attr = s.type_attr,+ icons_css = "",+ _this = this;++ $.each(types, function (i, tp) {+ $.each(tp, function (k, v) {+ if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }+ });+ if(!tp.icon) { return true; }+ if( tp.icon.image || tp.icon.position) {+ if(i == "default") { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }+ else { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '=' + i + '] > a > .jstree-icon { '; }+ if(tp.icon.image) { icons_css += ' background-image:url(' + tp.icon.image + '); '; }+ if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }+ else { icons_css += ' background-position:0 0; '; }+ icons_css += '} ';+ }+ });+ if(icons_css != "") { $.vakata.css.add_sheet({ 'str' : icons_css }); }+ }, this))+ .bind("before.jstree", $.proxy(function (e, data) {+ if($.inArray(data.func, this.data.types.attach_to) !== -1) {+ var s = this._get_settings().types.types,+ t = this._get_type(data.args[0]);+ if(+ (+ (s[t] && typeof s[t][data.func] !== "undefined") ||+ (s["default"] && typeof s["default"][data.func] !== "undefined")+ ) && !this._check(data.func, data.args[0])+ ) {+ e.stopImmediatePropagation();+ return false;+ }+ }+ }, this));+ },+ defaults : {+ // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)+ max_children : -1,+ // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)+ max_depth : -1,+ // defines valid node types for the root nodes+ valid_children : "all",++ // where is the type stores (the rel attribute of the LI element)+ type_attr : "rel",+ // a list of types+ 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+ }+ }+ },+ _fn : {+ _get_type : function (obj) {+ obj = this._get_node(obj);+ return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";+ },+ set_type : function (str, obj) {+ obj = this._get_node(obj);+ return (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);+ },+ _check : function (rule, obj, opts) {+ var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types;+ if(obj === -1) {+ if(!!s[rule]) { v = s[rule]; }+ else { return; }+ }+ else {+ if(t === false) { return; }+ if(!!s.types[t] && !!s.types[t][rule]) { v = s.types[t][rule]; }+ else if(!!s.types["default"] && !!s.types["default"][rule]) { v = s.types["default"][rule]; }+ }+ if($.isFunction(v)) { v = v.call(this, obj); }+ if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {+ // also include the node itself - otherwise if root node it is not checked+ this._get_node(obj).children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {+ // check if current depth already exceeds global tree depth+ if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }+ d = (i === 0) ? v : _this._check(rule, this, false);+ // check if current node max depth is already matched or exceeded+ if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }+ // otherwise - set the max depth to the current value minus current depth+ if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }+ // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited+ if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }+ });+ }+ return v;+ },+ check_move : function () {+ if(!this.__call_old()) { return false; }+ var m = this._get_move(),+ s = m.rt._get_settings().types,+ mc = m.rt._check("max_children", m.cr),+ md = m.rt._check("max_depth", m.cr),+ vc = m.rt._check("valid_children", m.cr),+ ch = 0, d = 1, t;++ if(vc === "none") { return false; }+ if($.isArray(vc) && m.ot && m.ot._get_type) {+ m.o.each(function () {+ if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }+ });+ if(d === false) { return false; }+ }+ if(s.max_children !== -2 && mc !== -1) {+ ch = m.cr === -1 ? this.get_container().children("> ul > li").not(m.o).length : m.cr.children("> ul > li").not(m.o).length;+ if(ch + m.o.length > mc) { return false; }+ }+ if(s.max_depth !== -2 && md !== -1) {+ d = 0;+ if(md === 0) { return false; }+ if(typeof m.o.d === "undefined") {+ // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)+ t = m.o;+ while(t.length > 0) {+ t = t.find("> ul > li");+ d ++;+ }+ m.o.d = d;+ }+ if(md - m.o.d < 0) { return false; }+ }+ return true;+ },+ create_node : function (obj, position, js, callback, is_loaded, skip_check) {+ if(!skip_check && (is_loaded || this._is_loaded(obj))) {+ var p = (position && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),+ s = this._get_settings().types,+ mc = this._check("max_children", p),+ md = this._check("max_depth", p),+ vc = this._check("valid_children", p),+ ch;+ if(!js) { js = {}; }+ if(vc === "none") { return false; }+ if($.isArray(vc)) {+ if(!js.attr || !js.attr[s.type_attr]) {+ if(!js.attr) { js.attr = {}; }+ js.attr[s.type_attr] = vc[0];+ }+ else {+ if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }+ }+ }+ if(s.max_children !== -2 && mc !== -1) {+ ch = p === -1 ? this.get_container().children("> ul > li").length : p.children("> ul > li").length;+ if(ch + 1 > mc) { return false; }+ }+ if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }+ }+ return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);+ }+ }+ });+})(jQuery);+//*/++/*+ * jsTree HTML data 1.0+ * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.+ */+(function ($) {+ $.jstree.plugin("html_data", {+ __init : function () {+ // this used to use html() and clean the whitespace, but this way any attached data was lost+ this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);+ // remove white space from LI node - otherwise nodes appear a bit to the right+ this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();+ },+ defaults : {+ data : false,+ ajax : false,+ correct_state : true+ },+ _fn : {+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : obj }); s_call.call(this); }, e_call); },+ _is_loaded : function (obj) {+ obj = this._get_node(obj);+ return obj == -1 || !obj || !this._get_settings().html_data.ajax || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;+ },+ load_node_html : function (obj, s_call, e_call) {+ var d,+ s = this.get_settings().html_data,+ error_func = function () {},+ success_func = function () {};+ obj = this._get_node(obj);+ if(obj && obj !== -1) {+ if(obj.data("jstree-is-loading")) { return; }+ else { obj.data("jstree-is-loading",true); }+ }+ switch(!0) {+ case (!s.data && !s.ajax):+ if(!obj || obj == -1) {+ this.get_container()+ .children("ul").empty()+ .append(this.data.html_data.original_container_html)+ .find("li, a").filter(function () { return this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()+ .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");+ this.clean_node();+ }+ if(s_call) { s_call.call(this); }+ break;+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):+ if(!obj || obj == -1) {+ d = $(s.data);+ if(!d.is("ul")) { d = $("<ul>").append(d); }+ this.get_container()+ .children("ul").empty().append(d.children())+ .find("li, a").filter(function () { return this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()+ .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");+ this.clean_node();+ }+ if(s_call) { s_call.call(this); }+ break;+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):+ obj = this._get_node(obj);+ error_func = function (x, t, e) {+ var ef = this.get_settings().html_data.ajax.error;+ if(ef) { ef.call(this, x, t, e); }+ if(obj != -1 && obj.length) {+ obj.children(".jstree-loading").removeClass("jstree-loading");+ obj.data("jstree-is-loading",false);+ if(t === "success" && s.correct_state) { obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); }+ }+ else {+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }+ }+ if(e_call) { e_call.call(this); }+ };+ success_func = function (d, t, x) {+ var sf = this.get_settings().html_data.ajax.success;+ if(sf) { d = sf.call(this,d,t,x) || d; }+ if(d == "") {+ return error_func.call(this, x, t, "");+ }+ if(d) {+ d = $(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.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }+ else { obj.children(".jstree-loading").removeClass("jstree-loading"); obj.append(d).find("li, a").filter(function () { return this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.data("jstree-is-loading",false); }+ this.clean_node(obj);+ if(s_call) { s_call.call(this); }+ }+ else {+ if(obj && obj !== -1) {+ obj.children(".jstree-loading").removeClass("jstree-loading");+ obj.data("jstree-is-loading",false);+ if(s.correct_state) {+ obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");+ if(s_call) { s_call.call(this); }+ }+ }+ else {+ if(s.correct_state) {+ this.get_container().children("ul").empty();+ if(s_call) { s_call.call(this); }+ }+ }+ }+ };+ s.ajax.context = this;+ s.ajax.error = error_func;+ s.ajax.success = success_func;+ if(!s.ajax.dataType) { s.ajax.dataType = "html"; }+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }+ $.ajax(s.ajax);+ break;+ }+ }+ }+ });+ // include the HTML data plugin by default+ $.jstree.defaults.plugins.push("html_data");+})(jQuery);+//*/++/*+ * jsTree themeroller plugin 1.0+ * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.+ */+(function ($) {+ $.jstree.plugin("themeroller", {+ __init : function () {+ var s = this._get_settings().themeroller;+ this.get_container()+ .addClass("ui-widget-content")+ .delegate("a","mouseenter.jstree", function () {+ $(this).addClass(s.item_h);+ })+ .delegate("a","mouseleave.jstree", function () {+ $(this).removeClass(s.item_h);+ })+ .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {+ this._themeroller(data.rslt.obj);+ }, this))+ .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {+ this._themeroller();+ }, this))+ .bind("close_node.jstree", $.proxy(function (e, data) {+ data.rslt.obj.children("ins").removeClass(s.opened).addClass(s.closed);+ }, this))+ .bind("select_node.jstree", $.proxy(function (e, data) {+ data.rslt.obj.children("a").addClass(s.item_a);+ }, this))+ .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {+ this.get_container()+ .find("." + s.item_a).removeClass(s.item_a).end()+ .find(".jstree-clicked").addClass(s.item_a);+ }, this))+ .bind("move_node.jstree", $.proxy(function (e, data) {+ this._themeroller(data.rslt.o);+ }, this));+ },+ __destroy : function () {+ var s = this._get_settings().themeroller,+ c = [ "ui-icon" ];+ $.each(s, function (i, v) {+ v = v.split(" ");+ if(v.length) { c = c.concat(v); }+ });+ this.get_container()+ .removeClass("ui-widget-content")+ .find("." + c.join(", .")).removeClass(c.join(" "));+ },+ _fn : {+ _themeroller : function (obj) {+ var s = this._get_settings().themeroller;+ obj = !obj || obj == -1 ? this.get_container() : this._get_node(obj).parent();+ obj+ .find("li.jstree-closed > ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()+ .find("li.jstree-open > ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()+ .find("a").addClass(s.item)+ .children("ins.jstree-icon").addClass("ui-icon " + s.item_icon);+ }+ },+ defaults : {+ "opened" : "ui-icon-triangle-1-se",+ "closed" : "ui-icon-triangle-1-e",+ "item" : "ui-state-default",+ "item_h" : "ui-state-hover",+ "item_a" : "ui-state-active",+ "item_icon" : "ui-icon-folder-collapsed"+ }+ });+ $(function() {+ var css_string = '.jstree .ui-icon { overflow:visible; } .jstree a { padding:0 2px; }';+ $.vakata.css.add_sheet({ str : css_string });+ });+})(jQuery);+//*/++/*+ * jsTree unique plugin 1.0+ * Forces different names amongst siblings (still a bit experimental)+ * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)+ */+(function ($) {+ $.jstree.plugin("unique", {+ __init : function () {+ this.get_container()+ .bind("before.jstree", $.proxy(function (e, data) {+ var nms = [], res = true, p, t;+ if(data.func == "move_node") {+ // obj, ref, position, is_copy, is_prepared, skip_check+ if(data.args[4] === true) {+ if(data.args[0].o && data.args[0].o.length) {+ data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });+ res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o));+ }+ }+ }+ if(data.func == "create_node") {+ // obj, position, js, callback, is_loaded+ if(data.args[4] || this._is_loaded(data.args[0])) {+ p = this._get_node(data.args[0]);+ if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {+ p = this._get_parent(data.args[0]);+ if(!p || p === -1) { p = this.get_container(); }+ }+ if(typeof data.args[2] === "string") { nms.push(data.args[2]); }+ else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_settings().core.strings.new_node); }+ else { nms.push(data.args[2].data); }+ res = this._check_unique(nms, p.find("> ul > li"));+ }+ }+ if(data.func == "rename_node") {+ // obj, val+ nms.push(data.args[1]);+ t = this._get_node(data.args[0]);+ p = this._get_parent(t);+ if(!p || p === -1) { p = this.get_container(); }+ res = this._check_unique(nms, p.find("> ul > li").not(t));+ }+ if(!res) {+ e.stopPropagation();+ return false;+ }+ }, this));+ },+ _fn : {+ _check_unique : function (nms, p) {+ var cnms = [];+ p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });+ if(!cnms.length || !nms.length) { return true; }+ cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");+ if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {+ return false;+ }+ return true;+ },+ check_move : function () {+ if(!this.__call_old()) { return false; }+ var p = this._get_move(), nms = [];+ if(p.o && p.o.length) {+ p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });+ return this._check_unique(nms, p.np.find("> ul > li").not(p.o));+ }+ return true;+ }+ }+ });+})(jQuery);+//*/\ No newline at end of filediff --git a/solr/src/webapp/web/js/jquery.sammy.js b/solr/src/webapp/web/js/jquery.sammy.jsnew file mode 100644index 00000000000..14fa5658b4d--- /dev/null+++ b/solr/src/webapp/web/js/jquery.sammy.js@@ -0,0 +1,1840 @@+// name: sammy+// version: 0.6.2++(function($, window) {++ var Sammy,+ PATH_REPLACER = "([^\/]+)",+ PATH_NAME_MATCHER = /:([\w\d]+)/g,+ QUERY_STRING_MATCHER = /\?([^#]*)$/,+ // mainly for making `arguments` an Array+ _makeArray = function(nonarray) { return Array.prototype.slice.call(nonarray); },+ // borrowed from jQuery+ _isFunction = function( obj ) { return Object.prototype.toString.call(obj) === "[object Function]"; },+ _isArray = function( obj ) { return Object.prototype.toString.call(obj) === "[object Array]"; },+ _decode = decodeURIComponent,+ _encode = encodeURIComponent,+ _escapeHTML = function(s) {+ return String(s).replace(/&(?!\w+;)/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');+ },+ _routeWrapper = function(verb) {+ return function(path, callback) { return this.route.apply(this, [verb, path, callback]); };+ },+ _template_cache = {},+ loggers = [];+++ // `Sammy` (also aliased as $.sammy) is not only the namespace for a+ // number of prototypes, its also a top level method that allows for easy+ // creation/management of `Sammy.Application` instances. There are a+ // number of different forms for `Sammy()` but each returns an instance+ // of `Sammy.Application`. When a new instance is created using+ // `Sammy` it is added to an Object called `Sammy.apps`. This+ // provides for an easy way to get at existing Sammy applications. Only one+ // instance is allowed per `element_selector` so when calling+ // `Sammy('selector')` multiple times, the first time will create+ // the application and the following times will extend the application+ // already added to that selector.+ //+ // ### Example+ //+ // // returns the app at #main or a new app+ // Sammy('#main')+ //+ // // equivilent to "new Sammy.Application", except appends to apps+ // Sammy();+ // Sammy(function() { ... });+ //+ // // extends the app at '#main' with function.+ // Sammy('#main', function() { ... });+ //+ Sammy = function() {+ var args = _makeArray(arguments),+ app, selector;+ Sammy.apps = Sammy.apps || {};+ if (args.length === 0 || args[0] && _isFunction(args[0])) { // Sammy()+ return Sammy.apply(Sammy, ['body'].concat(args));+ } else if (typeof (selector = args.shift()) == 'string') { // Sammy('#main')+ app = Sammy.apps[selector] || new Sammy.Application();+ app.element_selector = selector;+ if (args.length > 0) {+ $.each(args, function(i, plugin) {+ app.use(plugin);+ });+ }+ // if the selector changes make sure the refrence in Sammy.apps changes+ if (app.element_selector != selector) {+ delete Sammy.apps[selector];+ }+ Sammy.apps[app.element_selector] = app;+ return app;+ }+ };++ Sammy.VERSION = '0.6.2';++ // Add to the global logger pool. Takes a function that accepts an+ // unknown number of arguments and should print them or send them somewhere+ // The first argument is always a timestamp.+ Sammy.addLogger = function(logger) {+ loggers.push(logger);+ };++ // Sends a log message to each logger listed in the global+ // loggers pool. Can take any number of arguments.+ // Also prefixes the arguments with a timestamp.+ Sammy.log = function() {+ var args = _makeArray(arguments);+ args.unshift("[" + Date() + "]");+ $.each(loggers, function(i, logger) {+ logger.apply(Sammy, args);+ });+ };++ if (typeof window.console != 'undefined') {+ if (_isFunction(window.console.log.apply)) {+ Sammy.addLogger(function() {+ window.console.log.apply(window.console, arguments);+ });+ } else {+ Sammy.addLogger(function() {+ window.console.log(arguments);+ });+ }+ } else if (typeof console != 'undefined') {+ Sammy.addLogger(function() {+ console.log.apply(console, arguments);+ });+ }++ $.extend(Sammy, {+ makeArray: _makeArray,+ isFunction: _isFunction,+ isArray: _isArray+ })++ // Sammy.Object is the base for all other Sammy classes. It provides some useful+ // functionality, including cloning, iterating, etc.+ Sammy.Object = function(obj) { // constructor+ return $.extend(this, obj || {});+ };++ $.extend(Sammy.Object.prototype, {++ // Escape HTML in string, use in templates to prevent script injection.+ // Also aliased as `h()`+ escapeHTML: _escapeHTML,+ h: _escapeHTML,++ // Returns a copy of the object with Functions removed.+ toHash: function() {+ var json = {};+ $.each(this, function(k,v) {+ if (!_isFunction(v)) {+ json[k] = v;+ }+ });+ return json;+ },++ // Renders a simple HTML version of this Objects attributes.+ // Does not render functions.+ // For example. Given this Sammy.Object:+ //+ // var s = new Sammy.Object({first_name: 'Sammy', last_name: 'Davis Jr.'});+ // s.toHTML() //=> '<strong>first_name</strong> Sammy<br /><strong>last_name</strong> Davis Jr.<br />'+ //+ toHTML: function() {+ var display = "";+ $.each(this, function(k, v) {+ if (!_isFunction(v)) {+ display += "<strong>" + k + "</strong> " + v + "<br />";+ }+ });+ return display;+ },++ // Returns an array of keys for this object. If `attributes_only`+ // is true will not return keys that map to a `function()`+ keys: function(attributes_only) {+ var keys = [];+ for (var property in this) {+ if (!_isFunction(this[property]) || !attributes_only) {+ keys.push(property);+ }+ }+ return keys;+ },++ // Checks if the object has a value at `key` and that the value is not empty+ has: function(key) {+ return this[key] && $.trim(this[key].toString()) != '';+ },++ // convenience method to join as many arguments as you want+ // by the first argument - useful for making paths+ join: function() {+ var args = _makeArray(arguments);+ var delimiter = args.shift();+ return args.join(delimiter);+ },++ // Shortcut to Sammy.log+ log: function() {+ Sammy.log.apply(Sammy, arguments);+ },++ // Returns a string representation of this object.+ // if `include_functions` is true, it will also toString() the+ // methods of this object. By default only prints the attributes.+ toString: function(include_functions) {+ var s = [];+ $.each(this, function(k, v) {+ if (!_isFunction(v) || include_functions) {+ s.push('"' + k + '": ' + v.toString());+ }+ });+ return "Sammy.Object: {" + s.join(',') + "}";+ }+ });++ // The HashLocationProxy is the default location proxy for all Sammy applications.+ // A location proxy is a prototype that conforms to a simple interface. The purpose+ // of a location proxy is to notify the Sammy.Application its bound to when the location+ // or 'external state' changes. The HashLocationProxy considers the state to be+ // changed when the 'hash' (window.location.hash / '#') changes. It does this in two+ // different ways depending on what browser you are using. The newest browsers+ // (IE, Safari > 4, FF >= 3.6) support a 'onhashchange' DOM event, thats fired whenever+ // the location.hash changes. In this situation the HashLocationProxy just binds+ // to this event and delegates it to the application. In the case of older browsers+ // a poller is set up to track changes to the hash. Unlike Sammy 0.3 or earlier,+ // the HashLocationProxy allows the poller to be a global object, eliminating the+ // need for multiple pollers even when thier are multiple apps on the page.+ Sammy.HashLocationProxy = function(app, run_interval_every) {+ this.app = app;+ // set is native to false and start the poller immediately+ this.is_native = false;+ this._startPolling(run_interval_every);+ };++ Sammy.HashLocationProxy.prototype = {++ // bind the proxy events to the current app.+ bind: function() {+ var proxy = this, app = this.app;+ $(window).bind('hashchange.' + this.app.eventNamespace(), function(e, non_native) {+ // if we receive a native hash change event, set the proxy accordingly+ // and stop polling+ if (proxy.is_native === false && !non_native) {+ Sammy.log('native hash change exists, using');+ proxy.is_native = true;+ window.clearInterval(Sammy.HashLocationProxy._interval);+ }+ app.trigger('location-changed');+ });+ if (!Sammy.HashLocationProxy._bindings) {+ Sammy.HashLocationProxy._bindings = 0;+ }+ Sammy.HashLocationProxy._bindings++;+ },++ // unbind the proxy events from the current app+ unbind: function() {+ $(window).unbind('hashchange.' + this.app.eventNamespace());+ Sammy.HashLocationProxy._bindings--;+ if (Sammy.HashLocationProxy._bindings <= 0) {+ window.clearInterval(Sammy.HashLocationProxy._interval);+ }+ },++ // get the current location from the hash.+ getLocation: function() {+ // Bypass the `window.location.hash` attribute. If a question mark+ // appears in the hash IE6 will strip it and all of the following+ // characters from `window.location.hash`.+ var matches = window.location.toString().match(/^[^#]*(#.+)$/);+ return matches ? matches[1] : '';+ },++ // set the current location to `new_location`+ setLocation: function(new_location) {+ return (window.location = new_location);+ },++ _startPolling: function(every) {+ // set up interval+ var proxy = this;+ if (!Sammy.HashLocationProxy._interval) {+ if (!every) { every = 10; }+ var hashCheck = function() {+ var current_location = proxy.getLocation();+ if (!Sammy.HashLocationProxy._last_location ||+ current_location != Sammy.HashLocationProxy._last_location) {+ window.setTimeout(function() {+ $(window).trigger('hashchange', [true]);+ }, 13);+ }+ Sammy.HashLocationProxy._last_location = current_location;+ };+ hashCheck();+ Sammy.HashLocationProxy._interval = window.setInterval(hashCheck, every);+ }+ }+ };+++ // Sammy.Application is the Base prototype for defining 'applications'.+ // An 'application' is a collection of 'routes' and bound events that is+ // attached to an element when `run()` is called.+ // The only argument an 'app_function' is evaluated within the context of the application.+ Sammy.Application = function(app_function) {+ var app = this;+ this.routes = {};+ this.listeners = new Sammy.Object({});+ this.arounds = [];+ this.befores = [];+ // generate a unique namespace+ this.namespace = (new Date()).getTime() + '-' + parseInt(Math.random() * 1000, 10);+ this.context_prototype = function() { Sammy.EventContext.apply(this, arguments); };+ this.context_prototype.prototype = new Sammy.EventContext();++ if (_isFunction(app_function)) {+ app_function.apply(this, [this]);+ }+ // set the location proxy if not defined to the default (HashLocationProxy)+ if (!this._location_proxy) {+ this.setLocationProxy(new Sammy.HashLocationProxy(this, this.run_interval_every));+ }+ if (this.debug) {+ this.bindToAllEvents(function(e, data) {+ app.log(app.toString(), e.cleaned_type, data || {});+ });+ }+ };++ Sammy.Application.prototype = $.extend({}, Sammy.Object.prototype, {++ // the four route verbs+ ROUTE_VERBS: ['get','post','put','delete'],++ // An array of the default events triggered by the+ // application during its lifecycle+ APP_EVENTS: ['run',+ 'unload',+ 'lookup-route',+ 'run-route',+ 'route-found',+ 'event-context-before',+ 'event-context-after',+ 'changed',+ 'error',+ 'check-form-submission',+ 'redirect',+ 'location-changed'],++ _last_route: null,+ _location_proxy: null,+ _running: false,++ // Defines what element the application is bound to. Provide a selector+ // (parseable by `jQuery()`) and this will be used by `$element()`+ element_selector: 'body',++ // When set to true, logs all of the default events using `log()`+ debug: false,++ // When set to true, and the error() handler is not overriden, will actually+ // raise JS errors in routes (500) and when routes can't be found (404)+ raise_errors: false,++ // The time in milliseconds that the URL is queried for changes+ run_interval_every: 50,++ // The default template engine to use when using `partial()` in an+ // `EventContext`. `template_engine` can either be a string that+ // corresponds to the name of a method/helper on EventContext or it can be a function+ // that takes two arguments, the content of the unrendered partial and an optional+ // JS object that contains interpolation data. Template engine is only called/refered+ // to if the extension of the partial is null or unknown. See `partial()`+ // for more information+ template_engine: null,++ // //=> Sammy.Application: body+ toString: function() {+ return 'Sammy.Application:' + this.element_selector;+ },++ // returns a jQuery object of the Applications bound element.+ $element: function(selector) {+ return selector ? $(this.element_selector).find(selector) : $(this.element_selector);+ },++ // `use()` is the entry point for including Sammy plugins.+ // The first argument to use should be a function() that is evaluated+ // in the context of the current application, just like the `app_function`+ // argument to the `Sammy.Application` constructor.+ //+ // Any additional arguments are passed to the app function sequentially.+ //+ // For much more detail about plugins, check out:+ // http://code.quirkey.com/sammy/doc/plugins.html+ //+ // ### Example+ //+ // var MyPlugin = function(app, prepend) {+ //+ // this.helpers({+ // myhelper: function(text) {+ // alert(prepend + " " + text);+ // }+ // });+ //+ // };+ //+ // var app = $.sammy(function() {+ //+ // this.use(MyPlugin, 'This is my plugin');+ //+ // this.get('#/', function() {+ // this.myhelper('and dont you forget it!');+ // //=> Alerts: This is my plugin and dont you forget it!+ // });+ //+ // });+ //+ // If plugin is passed as a string it assumes your are trying to load+ // Sammy."Plugin". This is the prefered way of loading core Sammy plugins+ // as it allows for better error-messaging.+ //+ // ### Example+ //+ // $.sammy(function() {+ // this.use('Mustache'); //=> Sammy.Mustache+ // this.use('Storage'); //=> Sammy.Storage+ // });+ //+ use: function() {+ // flatten the arguments+ var args = _makeArray(arguments),+ plugin = args.shift(),+ plugin_name = plugin || '';+ try {+ args.unshift(this);+ if (typeof plugin == 'string') {+ plugin_name = 'Sammy.' + plugin;+ plugin = Sammy[plugin];+ }+ plugin.apply(this, args);+ } catch(e) {+ if (typeof plugin === 'undefined') {+ this.error("Plugin Error: called use() but plugin (" + plugin_name.toString() + ") is not defined", e);+ } else if (!_isFunction(plugin)) {+ this.error("Plugin Error: called use() but '" + plugin_name.toString() + "' is not a function", e);+ } else {+ this.error("Plugin Error", e);+ }+ }+ return this;+ },++ // Sets the location proxy for the current app. By default this is set to+ // a new `Sammy.HashLocationProxy` on initialization. However, you can set+ // the location_proxy inside you're app function to give your app a custom+ // location mechanism. See `Sammy.HashLocationProxy` and `Sammy.DataLocationProxy`+ // for examples.+ //+ // `setLocationProxy()` takes an initialized location proxy.+ //+ // ### Example+ //+ // // to bind to data instead of the default hash;+ // var app = $.sammy(function() {+ // this.setLocationProxy(new Sammy.DataLocationProxy(this));+ // });+ //+ setLocationProxy: function(new_proxy) {+ var original_proxy = this._location_proxy;+ this._location_proxy = new_proxy;+ if (this.isRunning()) {+ if (original_proxy) {+ // if there is already a location proxy, unbind it.+ original_proxy.unbind();+ }+ this._location_proxy.bind();+ }+ },++ // `route()` is the main method for defining routes within an application.+ // For great detail on routes, check out: http://code.quirkey.com/sammy/doc/routes.html+ //+ // This method also has aliases for each of the different verbs (eg. `get()`, `post()`, etc.)+ //+ // ### Arguments+ //+ // * `verb` A String in the set of ROUTE_VERBS or 'any'. 'any' will add routes for each+ // of the ROUTE_VERBS. If only two arguments are passed,+ // the first argument is the path, the second is the callback and the verb+ // is assumed to be 'any'.+ // * `path` A Regexp or a String representing the path to match to invoke this verb.+ // * `callback` A Function that is called/evaluated whent the route is run see: `runRoute()`.+ // It is also possible to pass a string as the callback, which is looked up as the name+ // of a method on the application.+ //+ route: function(verb, path, callback) {+ var app = this, param_names = [], add_route, path_match;++ // if the method signature is just (path, callback)+ // assume the verb is 'any'+ if (!callback && _isFunction(path)) {+ path = verb;+ callback = path;+ verb = 'any';+ }++ verb = verb.toLowerCase(); // ensure verb is lower case++ // if path is a string turn it into a regex+ if (path.constructor == String) {++ // Needs to be explicitly set because IE will maintain the index unless NULL is returned,+ // which means that with two consecutive routes that contain params, the second set of params will not be found and end up in splat instead of params+ // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/lastIndex+ PATH_NAME_MATCHER.lastIndex = 0;++ // find the names+ while ((path_match = PATH_NAME_MATCHER.exec(path)) !== null) {+ param_names.push(path_match[1]);+ }+ // replace with the path replacement+ path = new RegExp("^" + path.replace(PATH_NAME_MATCHER, PATH_REPLACER) + "$");+ }+ // lookup callback+ if (typeof callback == 'string') {+ callback = app[callback];+ }++ add_route = function(with_verb) {+ var r = {verb: with_verb, path: path, callback: callback, param_names: param_names};+ // add route to routes array+ app.routes[with_verb] = app.routes[with_verb] || [];+ // place routes in order of definition+ app.routes[with_verb].push(r);+ };++ if (verb === 'any') {+ $.each(this.ROUTE_VERBS, function(i, v) { add_route(v); });+ } else {+ add_route(verb);+ }++ // return the app+ return this;+ },++ // Alias for route('get', ...)+ get: _routeWrapper('get'),++ // Alias for route('post', ...)+ post: _routeWrapper('post'),++ // Alias for route('put', ...)+ put: _routeWrapper('put'),++ // Alias for route('delete', ...)+ del: _routeWrapper('delete'),++ // Alias for route('any', ...)+ any: _routeWrapper('any'),++ // `mapRoutes` takes an array of arrays, each array being passed to route()+ // as arguments, this allows for mass definition of routes. Another benefit is+ // this makes it possible/easier to load routes via remote JSON.+ //+ // ### Example+ //+ // var app = $.sammy(function() {+ //+ // this.mapRoutes([+ // ['get', '#/', function() { this.log('index'); }],+ // // strings in callbacks are looked up as methods on the app+ // ['post', '#/create', 'addUser'],+ // // No verb assumes 'any' as the verb+ // [/dowhatever/, function() { this.log(this.verb, this.path)}];+ // ]);+ // })+ //+ mapRoutes: function(route_array) {+ var app = this;+ $.each(route_array, function(i, route_args) {+ app.route.apply(app, route_args);+ });+ return this;+ },++ // A unique event namespace defined per application.+ // All events bound with `bind()` are automatically bound within this space.+ eventNamespace: function() {+ return ['sammy-app', this.namespace].join('-');+ },++ // Works just like `jQuery.fn.bind()` with a couple noteable differences.+ //+ // * It binds all events to the application element+ // * All events are bound within the `eventNamespace()`+ // * Events are not actually bound until the application is started with `run()`+ // * callbacks are evaluated within the context of a Sammy.EventContext+ //+ // See http://code.quirkey.com/sammy/docs/events.html for more info.+ //+ bind: function(name, data, callback) {+ var app = this;+ // build the callback+ // if the arity is 2, callback is the second argument+ if (typeof callback == 'undefined') { callback = data; }+ var listener_callback = function() {+ // pull off the context from the arguments to the callback+ var e, context, data;+ e = arguments[0];+ data = arguments[1];+ if (data && data.context) {+ context = data.context;+ delete data.context;+ } else {+ context = new app.context_prototype(app, 'bind', e.type, data, e.target);+ }+ e.cleaned_type = e.type.replace(app.eventNamespace(), '');+ callback.apply(context, [e, data]);+ };++ // it could be that the app element doesnt exist yet+ // so attach to the listeners array and then run()+ // will actually bind the event.+ if (!this.listeners[name]) { this.listeners[name] = []; }+ this.listeners[name].push(listener_callback);+ if (this.isRunning()) {+ // if the app is running+ // *actually* bind the event to the app element+ this._listen(name, listener_callback);+ }+ return this;+ },++ // Triggers custom events defined with `bind()`+ //+ // ### Arguments+ //+ // * `name` The name of the event. Automatically prefixed with the `eventNamespace()`+ // * `data` An optional Object that can be passed to the bound callback.+ // * `context` An optional context/Object in which to execute the bound callback.+ // If no context is supplied a the context is a new `Sammy.EventContext`+ //+ trigger: function(name, data) {+ this.$element().trigger([name, this.eventNamespace()].join('.'), [data]);+ return this;+ },++ // Reruns the current route+ refresh: function() {+ this.last_location = null;+ this.trigger('location-changed');+ return this;+ },++ // Takes a single callback that is pushed on to a stack.+ // Before any route is run, the callbacks are evaluated in order within+ // the current `Sammy.EventContext`+ //+ // If any of the callbacks explicitly return false, execution of any+ // further callbacks and the route itself is halted.+ //+ // You can also provide a set of options that will define when to run this+ // before based on the route it proceeds.+ //+ // ### Example+ //+ // var app = $.sammy(function() {+ //+ // // will run at #/route but not at #/+ // this.before('#/route', function() {+ // //...+ // });+ //+ // // will run at #/ but not at #/route+ // this.before({except: {path: '#/route'}}, function() {+ // this.log('not before #/route');+ // });+ //+ // this.get('#/', function() {});+ //+ // this.get('#/route', function() {});+ //+ // });+ //+ // See `contextMatchesOptions()` for a full list of supported options+ //+ before: function(options, callback) {+ if (_isFunction(options)) {+ callback = options;+ options = {};+ }+ this.befores.push([options, callback]);+ return this;+ },++ // A shortcut for binding a callback to be run after a route is executed.+ // After callbacks have no guarunteed order.+ after: function(callback) {+ return this.bind('event-context-after', callback);+ },+++ // Adds an around filter to the application. around filters are functions+ // that take a single argument `callback` which is the entire route+ // execution path wrapped up in a closure. This means you can decide whether+ // or not to proceed with execution by not invoking `callback` or,+ // more usefuly wrapping callback inside the result of an asynchronous execution.+ //+ // ### Example+ //+ // The most common use case for around() is calling a _possibly_ async function+ // and executing the route within the functions callback:+ //+ // var app = $.sammy(function() {+ //+ // var current_user = false;+ //+ // function checkLoggedIn(callback) {+ // // /session returns a JSON representation of the logged in user+ // // or an empty object+ // if (!current_user) {+ // $.getJSON('/session', function(json) {+ // if (json.login) {+ // // show the user as logged in+ // current_user = json;+ // // execute the route path+ // callback();+ // } else {+ // // show the user as not logged in+ // current_user = false;+ // // the context of aroundFilters is an EventContext+ // this.redirect('#/login');+ // }+ // });+ // } else {+ // // execute the route path+ // callback();+ // }+ // };+ //+ // this.around(checkLoggedIn);+ //+ // });+ //+ around: function(callback) {+ this.arounds.push(callback);+ return this;+ },++ // Returns `true` if the current application is running.+ isRunning: function() {+ return this._running;+ },++ // Helpers extends the EventContext prototype specific to this app.+ // This allows you to define app specific helper functions that can be used+ // whenever you're inside of an event context (templates, routes, bind).+ //+ // ### Example+ //+ // var app = $.sammy(function() {+ //+ // helpers({+ // upcase: function(text) {+ // return text.toString().toUpperCase();+ // }+ // });+ //+ // get('#/', function() { with(this) {+ // // inside of this context I can use the helpers+ // $('#main').html(upcase($('#main').text());+ // }});+ //+ // });+ //+ //+ // ### Arguments+ //+ // * `extensions` An object collection of functions to extend the context.+ //+ helpers: function(extensions) {+ $.extend(this.context_prototype.prototype, extensions);+ return this;+ },++ // Helper extends the event context just like `helpers()` but does it+ // a single method at a time. This is especially useful for dynamically named+ // helpers+ //+ // ### Example+ //+ // // Trivial example that adds 3 helper methods to the context dynamically+ // var app = $.sammy(function(app) {+ //+ // $.each([1,2,3], function(i, num) {+ // app.helper('helper' + num, function() {+ // this.log("I'm helper number " + num);+ // });+ // });+ //+ // this.get('#/', function() {+ // this.helper2(); //=> I'm helper number 2+ // });+ // });+ //+ // ### Arguments+ //+ // * `name` The name of the method+ // * `method` The function to be added to the prototype at `name`+ //+ helper: function(name, method) {+ this.context_prototype.prototype[name] = method;+ return this;+ },++ // Actually starts the application's lifecycle. `run()` should be invoked+ // within a document.ready block to ensure the DOM exists before binding events, etc.+ //+ // ### Example+ //+ // var app = $.sammy(function() { ... }); // your application+ // $(function() { // document.ready+ // app.run();+ // });+ //+ // ### Arguments+ //+ // * `start_url` Optionally, a String can be passed which the App will redirect to+ // after the events/routes have been bound.+ run: function(start_url) {+ if (this.isRunning()) { return false; }+ var app = this;++ // actually bind all the listeners+ $.each(this.listeners.toHash(), function(name, callbacks) {+ $.each(callbacks, function(i, listener_callback) {+ app._listen(name, listener_callback);+ });+ });++ this.trigger('run', {start_url: start_url});+ this._running = true;+ // set last location+ this.last_location = null;+ if (this.getLocation() == '' && typeof start_url != 'undefined') {+ this.setLocation(start_url);+ }+ // check url+ this._checkLocation();+ this._location_proxy.bind();+ this.bind('location-changed', function() {+ app._checkLocation();+ });++ // bind to submit to capture post/put/delete routes+ /*+ this.bind('submit', function(e) {+ var returned = app._checkFormSubmission($(e.target).closest('form'));+ return (returned === false) ? e.preventDefault() : false;+ });+ */++ // bind unload to body unload+ $(window).bind('beforeunload', function() {+ app.unload();+ });++ // trigger html changed+ return this.trigger('changed');+ },++ // The opposite of `run()`, un-binds all event listeners and intervals+ // `run()` Automaticaly binds a `onunload` event to run this when+ // the document is closed.+ unload: function() {+ if (!this.isRunning()) { return false; }+ var app = this;+ this.trigger('unload');+ // clear interval+ this._location_proxy.unbind();+ // unbind form submits+ this.$element().unbind('submit').removeClass(app.eventNamespace());+ // unbind all events+ $.each(this.listeners.toHash() , function(name, listeners) {+ $.each(listeners, function(i, listener_callback) {+ app._unlisten(name, listener_callback);+ });+ });+ this._running = false;+ return this;+ },++ // Will bind a single callback function to every event that is already+ // being listened to in the app. This includes all the `APP_EVENTS`+ // as well as any custom events defined with `bind()`.+ //+ // Used internally for debug logging.+ bindToAllEvents: function(callback) {+ var app = this;+ // bind to the APP_EVENTS first+ $.each(this.APP_EVENTS, function(i, e) {+ app.bind(e, callback);+ });+ // next, bind to listener names (only if they dont exist in APP_EVENTS)+ $.each(this.listeners.keys(true), function(i, name) {+ if (app.APP_EVENTS.indexOf(name) == -1) {+ app.bind(name, callback);+ }+ });+ return this;+ },++ // Returns a copy of the given path with any query string after the hash+ // removed.+ routablePath: function(path) {+ return path.replace(QUERY_STRING_MATCHER, '');+ },++ // Given a verb and a String path, will return either a route object or false+ // if a matching route can be found within the current defined set.+ lookupRoute: function(verb, path) {+ var app = this, routed = false;+ this.trigger('lookup-route', {verb: verb, path: path});+ if (typeof this.routes[verb] != 'undefined') {+ $.each(this.routes[verb], function(i, route) {+ if (app.routablePath(path).match(route.path)) {+ routed = route;+ return false;+ }+ });+ }+ return routed;+ },++ // First, invokes `lookupRoute()` and if a route is found, parses the+ // possible URL params and then invokes the route's callback within a new+ // `Sammy.EventContext`. If the route can not be found, it calls+ // `notFound()`. If `raise_errors` is set to `true` and+ // the `error()` has not been overriden, it will throw an actual JS+ // error.+ //+ // You probably will never have to call this directly.+ //+ // ### Arguments+ //+ // * `verb` A String for the verb.+ // * `path` A String path to lookup.+ // * `params` An Object of Params pulled from the URI or passed directly.+ //+ // ### Returns+ //+ // Either returns the value returned by the route callback or raises a 404 Not Found error.+ //+ runRoute: function(verb, path, params, target) {+ var app = this,+ route = this.lookupRoute(verb, path),+ context,+ wrapped_route,+ arounds,+ around,+ befores,+ before,+ callback_args,+ path_params,+ final_returned;++ this.log('runRoute', [verb, path].join(' '));+ this.trigger('run-route', {verb: verb, path: path, params: params});+ if (typeof params == 'undefined') { params = {}; }++ $.extend(params, this._parseQueryString(path));++ if (route) {+ this.trigger('route-found', {route: route});+ // pull out the params from the path+ if ((path_params = route.path.exec(this.routablePath(path))) !== null) {+ // first match is the full path+ path_params.shift();+ // for each of the matches+ $.each(path_params, function(i, param) {+ // if theres a matching param name+ if (route.param_names[i]) {+ // set the name to the match+ params[route.param_names[i]] = _decode(param);+ } else {+ // initialize 'splat'+ if (!params.splat) { params.splat = []; }+ params.splat.push(_decode(param));+ }+ });+ }++ // set event context+ context = new this.context_prototype(this, verb, path, params, target);+ // ensure arrays+ arounds = this.arounds.slice(0);+ befores = this.befores.slice(0);+ // set the callback args to the context + contents of the splat+ callback_args = [context].concat(params.splat);+ // wrap the route up with the before filters+ wrapped_route = function() {+ var returned;+ while (befores.length > 0) {+ before = befores.shift();+ // check the options+ if (app.contextMatchesOptions(context, before[0])) {+ returned = before[1].apply(context, [context]);+ if (returned === false) { return false; }+ }+ }+ app.last_route = route;+ context.trigger('event-context-before', {context: context});+ returned = route.callback.apply(context, callback_args);+ context.trigger('event-context-after', {context: context});+ return returned;+ };+ $.each(arounds.reverse(), function(i, around) {+ var last_wrapped_route = wrapped_route;+ wrapped_route = function() { return around.apply(context, [last_wrapped_route]); };+ });+ try {+ final_returned = wrapped_route();+ } catch(e) {+ this.error(['500 Error', verb, path].join(' '), e);+ }+ return final_returned;+ } else {+ return this.notFound(verb, path);+ }+ },++ // Matches an object of options against an `EventContext` like object that+ // contains `path` and `verb` attributes. Internally Sammy uses this+ // for matching `before()` filters against specific options. You can set the+ // object to _only_ match certain paths or verbs, or match all paths or verbs _except_+ // those that match the options.+ //+ // ### Example+ //+ // var app = $.sammy(),+ // context = {verb: 'get', path: '#/mypath'};+ //+ // // match against a path string+ // app.contextMatchesOptions(context, '#/mypath'); //=> true+ // app.contextMatchesOptions(context, '#/otherpath'); //=> false+ // // equivilent to+ // app.contextMatchesOptions(context, {only: {path:'#/mypath'}}); //=> true+ // app.contextMatchesOptions(context, {only: {path:'#/otherpath'}}); //=> false+ // // match against a path regexp+ // app.contextMatchesOptions(context, /path/); //=> true+ // app.contextMatchesOptions(context, /^path/); //=> false+ // // match only a verb+ // app.contextMatchesOptions(context, {only: {verb:'get'}}); //=> true+ // app.contextMatchesOptions(context, {only: {verb:'post'}}); //=> false+ // // match all except a verb+ // app.contextMatchesOptions(context, {except: {verb:'post'}}); //=> true+ // app.contextMatchesOptions(context, {except: {verb:'get'}}); //=> false+ // // match all except a path+ // app.contextMatchesOptions(context, {except: {path:'#/otherpath'}}); //=> true+ // app.contextMatchesOptions(context, {except: {path:'#/mypath'}}); //=> false+ //+ contextMatchesOptions: function(context, match_options, positive) {+ // empty options always match+ var options = match_options;+ if (typeof options === 'undefined' || options == {}) {+ return true;+ }+ if (typeof positive === 'undefined') {+ positive = true;+ }+ // normalize options+ if (typeof options === 'string' || _isFunction(options.test)) {+ options = {path: options};+ }+ if (options.only) {+ return this.contextMatchesOptions(context, options.only, true);+ } else if (options.except) {+ return this.contextMatchesOptions(context, options.except, false);+ }+ var path_matched = true, verb_matched = true;+ if (options.path) {+ // wierd regexp test+ if (_isFunction(options.path.test)) {+ path_matched = options.path.test(context.path);+ } else {+ path_matched = (options.path.toString() === context.path);+ }+ }+ if (options.verb) {+ verb_matched = options.verb === context.verb;+ }+ return positive ? (verb_matched && path_matched) : !(verb_matched && path_matched);+ },+++ // Delegates to the `location_proxy` to get the current location.+ // See `Sammy.HashLocationProxy` for more info on location proxies.+ getLocation: function() {+ return this._location_proxy.getLocation();+ },++ // Delegates to the `location_proxy` to set the current location.+ // See `Sammy.HashLocationProxy` for more info on location proxies.+ //+ // ### Arguments+ //+ // * `new_location` A new location string (e.g. '#/')+ //+ setLocation: function(new_location) {+ return this._location_proxy.setLocation(new_location);+ },++ // Swaps the content of `$element()` with `content`+ // You can override this method to provide an alternate swap behavior+ // for `EventContext.partial()`.+ //+ // ### Example+ //+ // var app = $.sammy(function() {+ //+ // // implements a 'fade out'/'fade in'+ // this.swap = function(content) {+ // this.$element().hide('slow').html(content).show('slow');+ // }+ //+ // get('#/', function() {+ // this.partial('index.html.erb') // will fade out and in+ // });+ //+ // });+ //+ swap: function(content) {+ return this.$element().html(content);+ },++ // a simple global cache for templates. Uses the same semantics as+ // `Sammy.Cache` and `Sammy.Storage` so can easily be replaced with+ // a persistant storage that lasts beyond the current request.+ templateCache: function(key, value) {+ if (typeof value != 'undefined') {+ return _template_cache[key] = value;+ } else {+ return _template_cache[key];+ }+ },++ // clear the templateCache+ clearTemplateCache: function() {+ return _template_cache = {};+ },++ // This thows a '404 Not Found' error by invoking `error()`.+ // Override this method or `error()` to provide custom+ // 404 behavior (i.e redirecting to / or showing a warning)+ notFound: function(verb, path) {+ var ret = this.error(['404 Not Found', verb, path].join(' '));+ return (verb === 'get') ? ret : true;+ },++ // The base error handler takes a string `message` and an `Error`+ // object. If `raise_errors` is set to `true` on the app level,+ // this will re-throw the error to the browser. Otherwise it will send the error+ // to `log()`. Override this method to provide custom error handling+ // e.g logging to a server side component or displaying some feedback to the+ // user.+ error: function(message, original_error) {+ if (!original_error) { original_error = new Error(); }+ original_error.message = [message, original_error.message].join(' ');+ this.trigger('error', {message: original_error.message, error: original_error});+ if (this.raise_errors) {+ throw(original_error);+ } else {+ this.log(original_error.message, original_error);+ }+ },++ _checkLocation: function() {+ var location, returned;+ // get current location+ location = this.getLocation();+ // compare to see if hash has changed+ if (!this.last_location || this.last_location[0] != 'get' || this.last_location[1] != location) {+ // reset last location+ this.last_location = ['get', location];+ // lookup route for current hash+ returned = this.runRoute('get', location);+ }+ return returned;+ },++ _getFormVerb: function(form) {+ var $form = $(form), verb, $_method;+ $_method = $form.find('input[name="_method"]');+ if ($_method.length > 0) { verb = $_method.val(); }+ if (!verb) { verb = $form[0].getAttribute('method'); }+ return $.trim(verb.toString().toLowerCase());+ },++ _checkFormSubmission: function(form) {+ var $form, path, verb, params, returned;+ this.trigger('check-form-submission', {form: form});+ $form = $(form);+ path = $form.attr('action');+ verb = this._getFormVerb($form);+ if (!verb || verb == '') { verb = 'get'; }+ this.log('_checkFormSubmission', $form, path, verb);+ if (verb === 'get') {+ this.setLocation(path + '?' + this._serializeFormParams($form));+ returned = false;+ } else {+ params = $.extend({}, this._parseFormParams($form));+ returned = this.runRoute(verb, path, params, form.get(0));+ };+ return (typeof returned == 'undefined') ? false : returned;+ },++ _serializeFormParams: function($form) {+ var queryString = "",+ fields = $form.serializeArray(),+ i;+ if (fields.length > 0) {+ queryString = this._encodeFormPair(fields[0].name, fields[0].value);+ for (i = 1; i < fields.length; i++) {+ queryString = queryString + "&" + this._encodeFormPair(fields[i].name, fields[i].value);+ }+ }+ return queryString;+ },++ _encodeFormPair: function(name, value){+ return _encode(name) + "=" + _encode(value);+ },++ _parseFormParams: function($form) {+ var params = {},+ form_fields = $form.serializeArray(),+ i;+ for (i = 0; i < form_fields.length; i++) {+ params = this._parseParamPair(params, form_fields[i].name, form_fields[i].value);+ }+ return params;+ },++ _parseQueryString: function(path) {+ var params = {}, parts, pairs, pair, i;++ parts = path.match(QUERY_STRING_MATCHER);+ if (parts) {+ pairs = parts[1].split('&');+ for (i = 0; i < pairs.length; i++) {+ pair = pairs[i].split('=');+ params = this._parseParamPair(params, _decode(pair[0]), _decode(pair[1]));+ }+ }+ return params;+ },++ _parseParamPair: function(params, key, value) {+ if (params[key]) {+ if (_isArray(params[key])) {+ params[key].push(value);+ } else {+ params[key] = [params[key], value];+ }+ } else {+ params[key] = value;+ }+ return params;+ },++ _listen: function(name, callback) {+ return this.$element().bind([name, this.eventNamespace()].join('.'), callback);+ },++ _unlisten: function(name, callback) {+ return this.$element().unbind([name, this.eventNamespace()].join('.'), callback);+ }++ });++ // `Sammy.RenderContext` is an object that makes sequential template loading,+ // rendering and interpolation seamless even when dealing with asyncronous+ // operations.+ //+ // `RenderContext` objects are not usually created directly, rather they are+ // instatiated from an `Sammy.EventContext` by using `render()`, `load()` or+ // `partial()` which all return `RenderContext` objects.+ //+ // `RenderContext` methods always returns a modified `RenderContext`+ // for chaining (like jQuery itself).+ //+ // The core magic is in the `then()` method which puts the callback passed as+ // an argument into a queue to be executed once the previous callback is complete.+ // All the methods of `RenderContext` are wrapped in `then()` which allows you+ // to queue up methods by chaining, but maintaing a guarunteed execution order+ // even with remote calls to fetch templates.+ //+ Sammy.RenderContext = function(event_context) {+ this.event_context = event_context;+ this.callbacks = [];+ this.previous_content = null;+ this.content = null;+ this.next_engine = false;+ this.waiting = false;+ };++ Sammy.RenderContext.prototype = $.extend({}, Sammy.Object.prototype, {++ // The "core" of the `RenderContext` object, adds the `callback` to the+ // queue. If the context is `waiting` (meaning an async operation is happening)+ // then the callback will be executed in order, once the other operations are+ // complete. If there is no currently executing operation, the `callback`+ // is executed immediately.+ //+ // The value returned from the callback is stored in `content` for the+ // subsiquent operation. If you return `false`, the queue will pause, and+ // the next callback in the queue will not be executed until `next()` is+ // called. This allows for the guarunteed order of execution while working+ // with async operations.+ //+ // If then() is passed a string instead of a function, the string is looked+ // up as a helper method on the event context.+ //+ // ### Example+ //+ // this.get('#/', function() {+ // // initialize the RenderContext+ // // Even though `load()` executes async, the next `then()`+ // // wont execute until the load finishes+ // this.load('myfile.txt')+ // .then(function(content) {+ // // the first argument to then is the content of the+ // // prev operation+ // $('#main').html(content);+ // });+ // });+ //+ then: function(callback) {+ if (!_isFunction(callback)) {+ // if a string is passed to then, assume we want to call+ // a helper on the event context in its context+ if (typeof callback === 'string' && callback in this.event_context) {+ var helper = this.event_context[callback];+ callback = function(content) {+ return helper.apply(this.event_context, [content]);+ };+ } else {+ return this;+ }+ }+ var context = this;+ if (this.waiting) {+ this.callbacks.push(callback);+ } else {+ this.wait();+ window.setTimeout(function() {+ var returned = callback.apply(context, [context.content, context.previous_content]);+ if (returned !== false) {+ context.next(returned);+ }+ }, 13);+ }+ return this;+ },++ // Pause the `RenderContext` queue. Combined with `next()` allows for async+ // operations.+ //+ // ### Example+ //+ // this.get('#/', function() {+ // this.load('mytext.json')+ // .then(function(content) {+ // var context = this,+ // data = JSON.parse(content);+ // // pause execution+ // context.wait();+ // // post to a url+ // $.post(data.url, {}, function(response) {+ // context.next(JSON.parse(response));+ // });+ // })+ // .then(function(data) {+ // // data is json from the previous post+ // $('#message').text(data.status);+ // });+ // });+ wait: function() {+ this.waiting = true;+ },++ // Resume the queue, setting `content` to be used in the next operation.+ // See `wait()` for an example.+ next: function(content) {+ this.waiting = false;+ if (typeof content !== 'undefined') {+ this.previous_content = this.content;+ this.content = content;+ }+ if (this.callbacks.length > 0) {+ this.then(this.callbacks.shift());+ }+ },++ // Load a template into the context.+ // The `location` can either be a string specifiying the remote path to the+ // file, a jQuery object, or a DOM element.+ //+ // No interpolation happens by default, the content is stored in+ // `content`.+ //+ // In the case of a path, unless the option `{cache: false}` is passed the+ // data is stored in the app's `templateCache()`.+ //+ // If a jQuery or DOM object is passed the `innerHTML` of the node is pulled in.+ // This is useful for nesting templates as part of the initial page load wrapped+ // in invisible elements or `<script>` tags. With template paths, the template+ // engine is looked up by the extension. For DOM/jQuery embedded templates,+ // this isnt possible, so there are a couple of options:+ //+ // * pass an `{engine:}` option.+ // * define the engine in the `data-engine` attribute of the passed node.+ // * just store the raw template data and use `interpolate()` manually+ //+ // If a `callback` is passed it is executed after the template load.+ load: function(location, options, callback) {+ var context = this;+ return this.then(function() {+ var should_cache, cached, is_json, location_array;+ if (_isFunction(options)) {+ callback = options;+ options = {};+ } else {+ options = $.extend({}, options);+ }+ if (callback) { this.then(callback); }+ if (typeof location === 'string') {+ // its a path+ is_json = (location.match(/\.json$/) || options.json);+ should_cache = ((is_json && options.cache === true) || options.cache !== false);+ context.next_engine = context.event_context.engineFor(location);+ delete options.cache;+ delete options.json;+ if (options.engine) {+ context.next_engine = options.engine;+ delete options.engine;+ }+ if (should_cache && (cached = this.event_context.app.templateCache(location))) {+ return cached;+ }+ this.wait();+ $.ajax($.extend({+ url: location,+ data: {},+ dataType: is_json ? 'json' : null,+ type: 'get',+ success: function(data) {+ if (should_cache) {+ context.event_context.app.templateCache(location, data);+ }+ context.next(data);+ }+ }, options));+ return false;+ } else {+ // its a dom/jQuery+ if (location.nodeType) {+ return location.innerHTML;+ }+ if (location.selector) {+ // its a jQuery+ context.next_engine = location.attr('data-engine');+ if (options.clone === false) {+ return location.remove()[0].innerHTML.toString();+ } else {+ return location[0].innerHTML.toString();+ }+ }+ }+ });+ },++ // `load()` a template and then `interpolate()` it with data.+ //+ // ### Example+ //+ // this.get('#/', function() {+ // this.render('mytemplate.template', {name: 'test'});+ // });+ //+ render: function(location, data, callback) {+ if (_isFunction(location) && !data) {+ return this.then(location);+ } else {+ if (!data && this.content) { data = this.content; }+ return this.load(location)+ .interpolate(data, location)+ .then(callback);+ }+ },++ // `render()` the the `location` with `data` and then `swap()` the+ // app's `$element` with the rendered content.+ partial: function(location, data) {+ return this.render(location, data).swap();+ },++ // defers the call of function to occur in order of the render queue.+ // The function can accept any number of arguments as long as the last+ // argument is a callback function. This is useful for putting arbitrary+ // asynchronous functions into the queue. The content passed to the+ // callback is passed as `content` to the next item in the queue.+ //+ // === Example+ //+ // this.send($.getJSON, '/app.json')+ // .then(function(json) {+ // $('#message).text(json['message']);+ // });+ //+ //+ send: function() {+ var context = this,+ args = _makeArray(arguments),+ fun = args.shift();++ if (_isArray(args[0])) { args = args[0]; }++ return this.then(function(content) {+ args.push(function(response) { context.next(response); });+ context.wait();+ fun.apply(fun, args);+ return false;+ });+ },++ // itterates over an array, applying the callback for each item item. the+ // callback takes the same style of arguments as `jQuery.each()` (index, item).+ // The return value of each callback is collected as a single string and stored+ // as `content` to be used in the next iteration of the `RenderContext`.+ collect: function(array, callback, now) {+ var context = this;+ var coll = function() {+ if (_isFunction(array)) {+ callback = array;+ array = this.content;+ }+ var contents = [], doms = false;+ $.each(array, function(i, item) {+ var returned = callback.apply(context, [i, item]);+ if (returned.jquery && returned.length == 1) {+ returned = returned[0];+ doms = true;+ }+ contents.push(returned);+ return returned;+ });+ return doms ? contents : contents.join('');+ };+ return now ? coll() : this.then(coll);+ },++ // loads a template, and then interpolates it for each item in the `data`+ // array. If a callback is passed, it will call the callback with each+ // item in the array _after_ interpolation+ renderEach: function(location, name, data, callback) {+ if (_isArray(name)) {+ callback = data;+ data = name;+ name = null;+ }+ return this.load(location).then(function(content) {+ var rctx = this;+ if (!data) {+ data = _isArray(this.previous_content) ? this.previous_content : [];+ }+ if (callback) {+ $.each(data, function(i, value) {+ var idata = {}, engine = this.next_engine || location;+ name ? (idata[name] = value) : (idata = value);+ callback(value, rctx.event_context.interpolate(content, idata, engine));+ });+ } else {+ return this.collect(data, function(i, value) {+ var idata = {}, engine = this.next_engine || location;+ name ? (idata[name] = value) : (idata = value);+ return this.event_context.interpolate(content, idata, engine);+ }, true);+ }+ });+ },++ // uses the previous loaded `content` and the `data` object to interpolate+ // a template. `engine` defines the templating/interpolation method/engine+ // that should be used. If `engine` is not passed, the `next_engine` is+ // used. If `retain` is `true`, the final interpolated data is appended to+ // the `previous_content` instead of just replacing it.+ interpolate: function(data, engine, retain) {+ var context = this;+ return this.then(function(content, prev) {+ if (!data && prev) { data = prev; }+ if (this.next_engine) {+ engine = this.next_engine;+ this.next_engine = false;+ }+ var rendered = context.event_context.interpolate(content, data, engine);+ return retain ? prev + rendered : rendered;+ });+ },++ // executes `EventContext#swap()` with the `content`+ swap: function() {+ return this.then(function(content) {+ this.event_context.swap(content);+ }).trigger('changed', {});+ },++ // Same usage as `jQuery.fn.appendTo()` but uses `then()` to ensure order+ appendTo: function(selector) {+ return this.then(function(content) {+ $(selector).append(content);+ }).trigger('changed', {});+ },++ // Same usage as `jQuery.fn.prependTo()` but uses `then()` to ensure order+ prependTo: function(selector) {+ return this.then(function(content) {+ $(selector).prepend(content);+ }).trigger('changed', {});+ },++ // Replaces the `$(selector)` using `html()` with the previously loaded+ // `content`+ replace: function(selector) {+ return this.then(function(content) {+ $(selector).html(content);+ }).trigger('changed', {});+ },++ // trigger the event in the order of the event context. Same semantics+ // as `Sammy.EventContext#trigger()`. If data is ommitted, `content`+ // is sent as `{content: content}`+ trigger: function(name, data) {+ return this.then(function(content) {+ if (typeof data == 'undefined') { data = {content: content}; }+ this.event_context.trigger(name, data);+ });+ }++ });++ // `Sammy.EventContext` objects are created every time a route is run or a+ // bound event is triggered. The callbacks for these events are evaluated within a `Sammy.EventContext`+ // This within these callbacks the special methods of `EventContext` are available.+ //+ // ### Example+ //+ // $.sammy(function() {+ // // The context here is this Sammy.Application+ // this.get('#/:name', function() {+ // // The context here is a new Sammy.EventContext+ // if (this.params['name'] == 'sammy') {+ // this.partial('name.html.erb', {name: 'Sammy'});+ // } else {+ // this.redirect('#/somewhere-else')+ // }+ // });+ // });+ //+ // Initialize a new EventContext+ //+ // ### Arguments+ //+ // * `app` The `Sammy.Application` this event is called within.+ // * `verb` The verb invoked to run this context/route.+ // * `path` The string path invoked to run this context/route.+ // * `params` An Object of optional params to pass to the context. Is converted+ // to a `Sammy.Object`.+ // * `target` a DOM element that the event that holds this context originates+ // from. For post, put and del routes, this is the form element that triggered+ // the route.+ //+ Sammy.EventContext = function(app, verb, path, params, target) {+ this.app = app;+ this.verb = verb;+ this.path = path;+ this.params = new Sammy.Object(params);+ this.target = target;+ };++ Sammy.EventContext.prototype = $.extend({}, Sammy.Object.prototype, {++ // A shortcut to the app's `$element()`+ $element: function() {+ return this.app.$element(_makeArray(arguments).shift());+ },++ // Look up a templating engine within the current app and context.+ // `engine` can be one of the following:+ //+ // * a function: should conform to `function(content, data) { return interploated; }`+ // * a template path: 'template.ejs', looks up the extension to match to+ // the `ejs()` helper+ // * a string referering to the helper: "mustache" => `mustache()`+ //+ // If no engine is found, use the app's default `template_engine`+ //+ engineFor: function(engine) {+ var context = this, engine_match;+ // if path is actually an engine function just return it+ if (_isFunction(engine)) { return engine; }+ // lookup engine name by path extension+ engine = (engine || context.app.template_engine).toString();+ if ((engine_match = engine.match(/\.([^\.]+)$/))) {+ engine = engine_match[1];+ }+ // set the engine to the default template engine if no match is found+ if (engine && _isFunction(context[engine])) {+ return context[engine];+ }++ if (context.app.template_engine) {+ return this.engineFor(context.app.template_engine);+ }+ return function(content, data) { return content; };+ },++ // using the template `engine` found with `engineFor()`, interpolate the+ // `data` into `content`+ interpolate: function(content, data, engine) {+ return this.engineFor(engine).apply(this, [content, data]);+ },++ // Create and return a `Sammy.RenderContext` calling `render()` on it.+ // Loads the template and interpolate the data, however does not actual+ // place it in the DOM.+ //+ // ### Example+ //+ // // mytemplate.mustache <div class="name">{{name}}</div>+ // render('mytemplate.mustache', {name: 'quirkey'});+ // // sets the `content` to <div class="name">quirkey</div>+ // render('mytemplate.mustache', {name: 'quirkey'})+ // .appendTo('ul');+ // // appends the rendered content to $('ul')+ //+ render: function(location, data, callback) {+ return new Sammy.RenderContext(this).render(location, data, callback);+ },++ // Create and return a `Sammy.RenderContext` calling `renderEach()` on it.+ // Loads the template and interpolates the data for each item,+ // however does not actual place it in the DOM.+ //+ // ### Example+ //+ // // mytemplate.mustache <div class="name">{{name}}</div>+ // renderEach('mytemplate.mustache', [{name: 'quirkey'}, {name: 'endor'}])+ // // sets the `content` to <div class="name">quirkey</div><div class="name">endor</div>+ // renderEach('mytemplate.mustache', [{name: 'quirkey'}, {name: 'endor'}]).appendTo('ul');+ // // appends the rendered content to $('ul')+ //+ renderEach: function(location, name, data, callback) {+ return new Sammy.RenderContext(this).renderEach(location, name, data, callback);+ },++ // create a new `Sammy.RenderContext` calling `load()` with `location` and+ // `options`. Called without interpolation or placement, this allows for+ // preloading/caching the templates.+ load: function(location, options, callback) {+ return new Sammy.RenderContext(this).load(location, options, callback);+ },++ // `render()` the the `location` with `data` and then `swap()` the+ // app's `$element` with the rendered content.+ partial: function(location, data) {+ return new Sammy.RenderContext(this).partial(location, data);+ },++ // create a new `Sammy.RenderContext` calling `send()` with an arbitrary+ // function+ send: function() {+ var rctx = new Sammy.RenderContext(this);+ return rctx.send.apply(rctx, arguments);+ },++ // Changes the location of the current window. If `to` begins with+ // '#' it only changes the document's hash. If passed more than 1 argument+ // redirect will join them together with forward slashes.+ //+ // ### Example+ //+ // redirect('#/other/route');+ // // equivilent to+ // redirect('#', 'other', 'route');+ //+ redirect: function() {+ var to, args = _makeArray(arguments),+ current_location = this.app.getLocation();+ if (args.length > 1) {+ args.unshift('/');+ to = this.join.apply(this, args);+ } else {+ to = args[0];+ }+ this.trigger('redirect', {to: to});+ this.app.last_location = [this.verb, this.path];+ this.app.setLocation(to);+ if (current_location == to) {+ this.app.trigger('location-changed');+ }+ },++ // Triggers events on `app` within the current context.+ trigger: function(name, data) {+ if (typeof data == 'undefined') { data = {}; }+ if (!data.context) { data.context = this; }+ return this.app.trigger(name, data);+ },++ // A shortcut to app's `eventNamespace()`+ eventNamespace: function() {+ return this.app.eventNamespace();+ },++ // A shortcut to app's `swap()`+ swap: function(contents) {+ return this.app.swap(contents);+ },++ // Raises a possible `notFound()` error for the current path.+ notFound: function() {+ return this.app.notFound(this.verb, this.path);+ },++ // Default JSON parsing uses jQuery's `parseJSON()`. Include `Sammy.JSON`+ // plugin for the more conformant "crockford special".+ json: function(string) {+ return $.parseJSON(string);+ },++ // //=> Sammy.EventContext: get #/ {}+ toString: function() {+ return "Sammy.EventContext: " + [this.verb, this.path, this.params].join(' ');+ }++ });++ // An alias to Sammy+ $.sammy = window.Sammy = Sammy;++})(jQuery, window);diff --git a/solr/src/webapp/web/js/jquery.sparkline.js b/solr/src/webapp/web/js/jquery.sparkline.jsnew file mode 100644index 00000000000..1b0fea3d26a--- /dev/null+++ b/solr/src/webapp/web/js/jquery.sparkline.js@@ -0,0 +1,1271 @@+/**+*+* jquery.sparkline.js+*+* v1.6+* (c) Splunk, Inc+* Contact: Gareth Watts ([email protected])+* http://omnipotent.net/jquery.sparkline/+*+* Generates inline sparkline charts from data supplied either to the method+* or inline in HTML+*+* Compatible with Internet Explorer 6.0+ and modern browsers equipped with the canvas tag+* (Firefox 2.0+, Safari, Opera, etc)+*+* License: New BSD License+*+* Copyright (c) 2010, Splunk Inc.+* All rights reserved.+*+* Redistribution and use in source and binary forms, with or without modification,+* are permitted provided that the following conditions are met:+*+* * Redistributions of source code must retain the above copyright notice,+* this list of conditions and the following disclaimer.+* * Redistributions in binary form must reproduce the above copyright notice,+* this list of conditions and the following disclaimer in the documentation+* and/or other materials provided with the distribution.+* * Neither the name of Splunk Inc nor the names of its contributors may+* be used to endorse or promote products derived from this software without+* specific prior written permission.+*+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES+* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT+* SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT+* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)+* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+*+*+* Usage:+* $(selector).sparkline(values, options)+*+* If values is undefined or set to 'html' then the data values are read from the specified tag:+* <p>Sparkline: <span class="sparkline">1,4,6,6,8,5,3,5</span></p>+* $('.sparkline').sparkline();+* There must be no spaces in the enclosed data set+*+* Otherwise values must be an array of numbers or null values+* <p>Sparkline: <span id="sparkline1">This text replaced if the browser is compatible</span></p>+* $('#sparkline1').sparkline([1,4,6,6,8,5,3,5])+* $('#sparkline2').sparkline([1,4,6,null,null,5,3,5])+*+* Values can also be specified in an HTML comment, or as a values attribute:+* <p>Sparkline: <span class="sparkline"><!--1,4,6,6,8,5,3,5 --></span></p>+* <p>Sparkline: <span class="sparkline" values="1,4,6,6,8,5,3,5"></span></p>+* $('.sparkline').sparkline();+*+* For line charts, x values can also be specified:+* <p>Sparkline: <span class="sparkline">1:1,2.7:4,3.4:6,5:6,6:8,8.7:5,9:3,10:5</span></p>+* $('#sparkline1').sparkline([ [1,1], [2.7,4], [3.4,6], [5,6], [6,8], [8.7,5], [9,3], [10,5] ])+*+* By default, options should be passed in as teh second argument to the sparkline function:+* $('.sparkline').sparkline([1,2,3,4], {type: 'bar'})+*+* Options can also be set by passing them on the tag itself. This feature is disabled by default though+* as there's a slight performance overhead:+* $('.sparkline').sparkline([1,2,3,4], {enableTagOptions: true})+* <p>Sparkline: <span class="sparkline" sparkType="bar" sparkBarColor="red">loading</span></p>+* Prefix all options supplied as tag attribute with "spark" (configurable by setting tagOptionPrefix)+*+* Supported options:+* lineColor - Color of the line used for the chart+* fillColor - Color used to fill in the chart - Set to '' or false for a transparent chart+* width - Width of the chart - Defaults to 3 times the number of values in pixels+* height - Height of the chart - Defaults to the height of the containing element+* chartRangeMin - Specify the minimum value to use for the Y range of the chart - Defaults to the minimum value supplied+* chartRangeMax - Specify the maximum value to use for the Y range of the chart - Defaults to the maximum value supplied+* chartRangeClip - Clip out of range values to the max/min specified by chartRangeMin and chartRangeMax+* chartRangeMinX - Specify the minimum value to use for the X range of the chart - Defaults to the minimum value supplied+* chartRangeMaxX - Specify the maximum value to use for the X range of the chart - Defaults to the maximum value supplied+* composite - If true then don't erase any existing chart attached to the tag, but draw+* another chart over the top - Note that width and height are ignored if an+* existing chart is detected.+* tagValuesAttribute - Name of tag attribute to check for data values - Defaults to 'values'+* enableTagOptions - Whether to check tags for sparkline options+* tagOptionPrefix - Prefix used for options supplied as tag attributes - Defaults to 'spark'+*+* There are 7 types of sparkline, selected by supplying a "type" option of 'line' (default),+* 'bar', 'tristate', 'bullet', 'discrete', 'pie' or 'box'+* line - Line chart. Options:+* spotColor - Set to '' to not end each line in a circular spot+* minSpotColor - If set, color of spot at minimum value+* maxSpotColor - If set, color of spot at maximum value+* spotRadius - Radius in pixels+* lineWidth - Width of line in pixels+* normalRangeMin+* normalRangeMax - If set draws a filled horizontal bar between these two values marking the "normal"+* or expected range of values+* normalRangeColor - Color to use for the above bar+* drawNormalOnTop - Draw the normal range above the chart fill color if true+* defaultPixelsPerValue - Defaults to 3 pixels of width for each value in the chart+*+* bar - Bar chart. Options:+* barColor - Color of bars for postive values+* negBarColor - Color of bars for negative values+* zeroColor - Color of bars with zero values+* nullColor - Color of bars with null values - Defaults to omitting the bar entirely+* barWidth - Width of bars in pixels+* colorMap - Optional mappnig of values to colors to override the *BarColor values above+* can be an Array of values to control the color of individual bars+* barSpacing - Gap between bars in pixels+* zeroAxis - Centers the y-axis around zero if true+*+* tristate - Charts values of win (>0), lose (<0) or draw (=0)+* posBarColor - Color of win values+* negBarColor - Color of lose values+* zeroBarColor - Color of draw values+* barWidth - Width of bars in pixels+* barSpacing - Gap between bars in pixels+* colorMap - Optional mappnig of values to colors to override the *BarColor values above+* can be an Array of values to control the color of individual bars+*+* discrete - Options:+* lineHeight - Height of each line in pixels - Defaults to 30% of the graph height+* thesholdValue - Values less than this value will be drawn using thresholdColor instead of lineColor+* thresholdColor+*+* bullet - Values for bullet graphs msut be in the order: target, performance, range1, range2, range3, ...+* options:+* targetColor - The color of the vertical target marker+* targetWidth - The width of the target marker in pixels+* performanceColor - The color of the performance measure horizontal bar+* rangeColors - Colors to use for each qualitative range background color+*+* pie - Pie chart. Options:+* sliceColors - An array of colors to use for pie slices+* offset - Angle in degrees to offset the first slice - Try -90 or +90+*+* box - Box plot. Options:+* raw - Set to true to supply pre-computed plot points as values+* values should be: low_outlier, low_whisker, q1, median, q3, high_whisker, high_outlier+* When set to false you can supply any number of values and the box plot will+* be computed for you. Default is false.+* showOutliers - Set to true (default) to display outliers as circles+* outlierIRQ - Interquartile range used to determine outliers. Default 1.5+* boxLineColor - Outline color of the box+* boxFillColor - Fill color for the box+* whiskerColor - Line color used for whiskers+* outlierLineColor - Outline color of outlier circles+* outlierFillColor - Fill color of the outlier circles+* spotRadius - Radius of outlier circles+* medianColor - Line color of the median line+* target - Draw a target cross hair at the supplied value (default undefined)+*+*+*+* Examples:+* $('#sparkline1').sparkline(myvalues, { lineColor: '#f00', fillColor: false });+* $('.barsparks').sparkline('html', { type:'bar', height:'40px', barWidth:5 });+* $('#tristate').sparkline([1,1,-1,1,0,0,-1], { type:'tristate' }):+* $('#discrete').sparkline([1,3,4,5,5,3,4,5], { type:'discrete' });+* $('#bullet').sparkline([10,12,12,9,7], { type:'bullet' });+* $('#pie').sparkline([1,1,2], { type:'pie' });+*/+++(function($) {++ /*+ * Default configuration settings+ */+ var defaults = {+ // Settings common to most/all chart types+ common: {+ type : 'line',+ lineColor : '#00f',+ fillColor : '#cdf',+ defaultPixelsPerValue : 3,+ width : 'auto',+ height : 'auto',+ composite : false,+ tagValuesAttribute: 'values',+ tagOptionsPrefix: 'spark',+ enableTagOptions: false+ },+ // Defaults for line charts+ line: {+ spotColor : '#f80',+ spotRadius : 1.5,+ minSpotColor : '#f80',+ maxSpotColor : '#f80',+ lineWidth: 1,+ normalRangeMin : undefined,+ normalRangeMax : undefined,+ normalRangeColor : '#ccc',+ drawNormalOnTop: false,+ chartRangeMin : undefined,+ chartRangeMax : undefined,+ chartRangeMinX : undefined,+ chartRangeMaxX : undefined+ },+ // Defaults for bar charts+ bar: {+ barColor : '#00f',+ negBarColor : '#f44',+ zeroColor: undefined,+ nullColor: undefined,+ zeroAxis : undefined,+ barWidth : 4,+ barSpacing : 1,+ chartRangeMax: undefined,+ chartRangeMin: undefined,+ chartRangeClip: false,+ colorMap : undefined+ },+ // Defaults for tristate charts+ tristate: {+ barWidth : 4,+ barSpacing : 1,+ posBarColor: '#6f6',+ negBarColor : '#f44',+ zeroBarColor : '#999',+ colorMap : {}+ },+ // Defaults for discrete charts+ discrete: {+ lineHeight: 'auto',+ thresholdColor: undefined,+ thresholdValue : 0,+ chartRangeMax: undefined,+ chartRangeMin: undefined,+ chartRangeClip: false+ },+ // Defaults for bullet charts+ bullet: {+ targetColor : 'red',+ targetWidth : 3, // width of the target bar in pixels+ performanceColor : 'blue',+ rangeColors : ['#D3DAFE', '#A8B6FF', '#7F94FF' ],+ base : undefined // set this to a number to change the base start number+ },+ // Defaults for pie charts+ pie: {+ sliceColors : ['#f00', '#0f0', '#00f']+ },+ // Defaults for box plots+ box: {+ raw: false,+ boxLineColor: 'black',+ boxFillColor: '#cdf',+ whiskerColor: 'black',+ outlierLineColor: '#333',+ outlierFillColor: 'white',+ medianColor: 'red',+ showOutliers: true,+ outlierIQR: 1.5,+ spotRadius: 1.5,+ target: undefined,+ targetColor: '#4a2',+ chartRangeMax: undefined,+ chartRangeMin: undefined+ }+ };++ // Provide a cross-browser interface to a few simple drawing primitives+ var VCanvas_base, VCanvas_canvas, VCanvas_vml;+ $.fn.simpledraw = function(width, height, use_existing) {+ if (use_existing && this[0].VCanvas) {+ return this[0].VCanvas;+ }+ if (width === undefined) {+ width=$(this).innerWidth();+ }+ if (height === undefined) {+ height=$(this).innerHeight();+ }+ if ($.browser.hasCanvas) {+ return new VCanvas_canvas(width, height, this);+ } else if ($.browser.msie) {+ return new VCanvas_vml(width, height, this);+ } else {+ return false;+ }+ };++ var pending = [];+++ $.fn.sparkline = function(uservalues, userOptions) {+ return this.each(function() {+ var options = new $.fn.sparkline.options(this, userOptions);+ var render = function() {+ var values, width, height;+ if (uservalues==='html' || uservalues===undefined) {+ var vals = this.getAttribute(options.get('tagValuesAttribute'));+ if (vals===undefined || vals===null) {+ vals = $(this).html();+ }+ values = vals.replace(/(^\s*<!--)|(-->\s*$)|\s+/g, '').split(',');+ } else {+ values = uservalues;+ }++ width = options.get('width')=='auto' ? values.length*options.get('defaultPixelsPerValue') : options.get('width');+ if (options.get('height') == 'auto') {+ if (!options.get('composite') || !this.VCanvas) {+ // must be a better way to get the line height+ var tmp = document.createElement('span');+ tmp.innerHTML = 'a';+ $(this).html(tmp);+ height = $(tmp).innerHeight();+ $(tmp).remove();+ }+ } else {+ height = options.get('height');+ }++ $.fn.sparkline[options.get('type')].call(this, values, options, width, height);+ };+ // jQuery 1.3.0 completely changed the meaning of :hidden :-/+ if (($(this).html() && $(this).is(':hidden')) || ($.fn.jquery < "1.3.0" && $(this).parents().is(':hidden')) || !$(this).parents('body').length) {+ pending.push([this, render]);+ } else {+ render.call(this);+ }+ });+ };++ $.fn.sparkline.defaults = defaults;+++ $.sparkline_display_visible = function() {+ for (var i=pending.length-1; i>=0; i--) {+ var el = pending[i][0];+ if ($(el).is(':visible') && !$(el).parents().is(':hidden')) {+ pending[i][1].call(el);+ pending.splice(i, 1);+ }+ }+ };+++ /**+ * User option handler+ */+ var UNSET_OPTION = {};+ var normalizeValue = function(val) {+ switch(val) {+ case 'undefined':+ val = undefined;+ break;+ case 'null':+ val = null;+ break;+ case 'true':+ val = true;+ break;+ case 'false':+ val = false;+ break;+ default:+ var nf = parseFloat(val);+ if (val == nf) {+ val = nf;+ }+ }+ return val;+ };+ $.fn.sparkline.options = function(tag, userOptions) {+ var extendedOptions;+ this.userOptions = userOptions = userOptions || {};+ this.tag = tag;+ this.tagValCache = {};+ var defaults = $.fn.sparkline.defaults;+ var base = defaults.common;+ this.tagOptionsPrefix = userOptions.enableTagOptions && (userOptions.tagOptionsPrefix || base.tagOptionsPrefix);++ var tagOptionType = this.getTagSetting('type');+ if (tagOptionType === UNSET_OPTION) {+ extendedOptions = defaults[userOptions.type || base.type];+ } else {+ extendedOptions = defaults[tagOptionType];+ }+ this.mergedOptions = $.extend({}, base, extendedOptions, userOptions);+ };+++ $.fn.sparkline.options.prototype.getTagSetting = function(key) {+ var val, i, prefix = this.tagOptionsPrefix;+ if (prefix === false || prefix === undefined) {+ return UNSET_OPTION;+ }+ if (this.tagValCache.hasOwnProperty(key)) {+ val = this.tagValCache.key;+ } else {+ val = this.tag.getAttribute(prefix + key);+ if (val === undefined || val === null) {+ val = UNSET_OPTION;+ } else if (val.substr(0, 1) == '[') {+ val = val.substr(1, val.length-2).split(',');+ for(i=val.length; i--;) {+ val[i] = normalizeValue(val[i].replace(/(^\s*)|(\s*$)/g, ''));+ }+ } else if (val.substr(0, 1) == '{') {+ var pairs= val.substr(1, val.length-2).split(',');+ val = {};+ for(i=pairs.length; i--;) {+ var keyval = pairs[i].split(':', 2);+ val[keyval[0].replace(/(^\s*)|(\s*$)/g, '')] = normalizeValue(keyval[1].replace(/(^\s*)|(\s*$)/g, ''));+ }+ } else {+ val = normalizeValue(val);+ }+ this.tagValCache.key = val;+ }+ return val;+ };++ $.fn.sparkline.options.prototype.get = function(key) {+ var tagOption = this.getTagSetting(key);+ if (tagOption !== UNSET_OPTION) {+ return tagOption;+ }+ return this.mergedOptions[key];+ };+++ /**+ * Line charts+ */+ $.fn.sparkline.line = function(values, options, width, height) {+ var xvalues = [], yvalues = [], yminmax = [];+ for (var i=0; i<values.length; i++) {+ var val = values[i];+ var isstr = typeof(values[i])=='string';+ var isarray = typeof(values[i])=='object' && values[i] instanceof Array;+ var sp = isstr && values[i].split(':');+ if (isstr && sp.length == 2) { // x:y+ xvalues.push(Number(sp[0]));+ yvalues.push(Number(sp[1]));+ yminmax.push(Number(sp[1]));+ } else if (isarray) {+ xvalues.push(val[0]);+ yvalues.push(val[1]);+ yminmax.push(val[1]);+ } else {+ xvalues.push(i);+ if (values[i]===null || values[i]=='null') {+ yvalues.push(null);+ } else {+ yvalues.push(Number(val));+ yminmax.push(Number(val));+ }+ }+ }+ if (options.get('xvalues')) {+ xvalues = options.get('xvalues');+ }++ var maxy = Math.max.apply(Math, yminmax);+ var maxyval = maxy;+ var miny = Math.min.apply(Math, yminmax);+ var minyval = miny;++ var maxx = Math.max.apply(Math, xvalues);+ var minx = Math.min.apply(Math, xvalues);++ var normalRangeMin = options.get('normalRangeMin');+ var normalRangeMax = options.get('normalRangeMax');++ if (normalRangeMin!==undefined) {+ if (normalRangeMin<miny) {+ miny = normalRangeMin;+ }+ if (normalRangeMax>maxy) {+ maxy = normalRangeMax;+ }+ }+ if (options.get('chartRangeMin')!==undefined && (options.get('chartRangeClip') || options.get('chartRangeMin')<miny)) {+ miny = options.get('chartRangeMin');+ }+ if (options.get('chartRangeMax')!==undefined && (options.get('chartRangeClip') || options.get('chartRangeMax')>maxy)) {+ maxy = options.get('chartRangeMax');+ }+ if (options.get('chartRangeMinX')!==undefined && (options.get('chartRangeClipX') || options.get('chartRangeMinX')<minx)) {+ minx = options.get('chartRangeMinX');+ }+ if (options.get('chartRangeMaxX')!==undefined && (options.get('chartRangeClipX') || options.get('chartRangeMaxX')>maxx)) {+ maxx = options.get('chartRangeMaxX');+ }+ var rangex = maxx-minx === 0 ? 1 : maxx-minx;+ var rangey = maxy-miny === 0 ? 1 : maxy-miny;+ var vl = yvalues.length-1;++ if (vl<1) {+ this.innerHTML = '';+ return;+ }++ var target = $(this).simpledraw(width, height, options.get('composite'));+ if (target) {+ var canvas_width = target.pixel_width;+ var canvas_height = target.pixel_height;+ var canvas_top = 0;+ var canvas_left = 0;++ var spotRadius = options.get('spotRadius');+ if (spotRadius && (canvas_width < (spotRadius*4) || canvas_height < (spotRadius*4))) {+ spotRadius = 0;+ }+ if (spotRadius) {+ // adjust the canvas size as required so that spots will fit+ if (options.get('minSpotColor') || (options.get('spotColor') && yvalues[vl]==miny)) {+ canvas_height -= Math.ceil(spotRadius);+ }+ if (options.get('maxSpotColor') || (options.get('spotColor') && yvalues[vl]==maxy)) {+ canvas_height -= Math.ceil(spotRadius);+ canvas_top += Math.ceil(spotRadius);+ }+ if (options.get('minSpotColor') || options.get('maxSpotColor') && (yvalues[0]==miny || yvalues[0]==maxy)) {+ canvas_left += Math.ceil(spotRadius);+ canvas_width -= Math.ceil(spotRadius);+ }+ if (options.get('spotColor') || (options.get('minSpotColor') || options.get('maxSpotColor') && (yvalues[vl]==miny||yvalues[vl]==maxy))) {+ canvas_width -= Math.ceil(spotRadius);+ }+ }+++ canvas_height--;++ var drawNormalRange = function() {+ if (normalRangeMin!==undefined) {+ var ytop = canvas_top+Math.round(canvas_height-(canvas_height*((normalRangeMax-miny)/rangey)));+ var height = Math.round((canvas_height*(normalRangeMax-normalRangeMin))/rangey);+ target.drawRect(canvas_left, ytop, canvas_width, height, undefined, options.get('normalRangeColor'));+ }+ };++ if (!options.get('drawNormalOnTop')) {+ drawNormalRange();+ }++ var path = [];+ var paths = [path];+ var x, y, vlen=yvalues.length;+ for(i=0; i<vlen; i++) {+ x=xvalues[i];+ y=yvalues[i];+ if (y===null) {+ if (i) {+ if (yvalues[i-1]!==null) {+ path = [];+ paths.push(path);+ }+ }+ } else {+ if (y < miny) {+ y=miny;+ }+ if (y > maxy) {+ y=maxy;+ }+ if (!path.length) {+ // previous value was null+ path.push([canvas_left+Math.round((x-minx)*(canvas_width/rangex)), canvas_top+canvas_height]);+ }+ path.push([canvas_left+Math.round((x-minx)*(canvas_width/rangex)), canvas_top+Math.round(canvas_height-(canvas_height*((y-miny)/rangey)))]);+ }+ }+ var lineshapes = [];+ var fillshapes = [];+ var plen=paths.length;+ for(i=0; i<plen; i++) {+ path = paths[i];+ if (!path.length) {+ continue; // last value was null+ }+ if (options.get('fillColor')) {+ path.push([path[path.length-1][0], canvas_top+canvas_height-1]);+ fillshapes.push(path.slice(0));+ path.pop();+ }+ // if there's only a single point in this path, then we want to display it as a vertical line+ // which means we keep path[0] as is+ if (path.length>2) {+ // else we want the first value+ path[0] = [ path[0][0], path[1][1] ];+ }+ lineshapes.push(path);+ }++ // draw the fill first, then optionally the normal range, then the line on top of that+ plen = fillshapes.length;+ for(i=0; i<plen; i++) {+ target.drawShape(fillshapes[i], undefined, options.get('fillColor'));+ }++ if (options.get('drawNormalOnTop')) {+ drawNormalRange();+ }++ plen = lineshapes.length;+ for(i=0; i<plen; i++) {+ target.drawShape(lineshapes[i], options.get('lineColor'), undefined, options.get('lineWidth'));+ }++ if (spotRadius && options.get('spotColor')) {+ target.drawCircle(canvas_left+Math.round(xvalues[xvalues.length-1]*(canvas_width/rangex)), canvas_top+Math.round(canvas_height-(canvas_height*((yvalues[vl]-miny)/rangey))), spotRadius, undefined, options.get('spotColor'));+ }+ if (maxy!=minyval) {+ if (spotRadius && options.get('minSpotColor')) {+ x = xvalues[$.inArray(minyval, yvalues)];+ target.drawCircle(canvas_left+Math.round((x-minx)*(canvas_width/rangex)), canvas_top+Math.round(canvas_height-(canvas_height*((minyval-miny)/rangey))), spotRadius, undefined, options.get('minSpotColor'));+ }+ if (spotRadius && options.get('maxSpotColor')) {+ x = xvalues[$.inArray(maxyval, yvalues)];+ target.drawCircle(canvas_left+Math.round((x-minx)*(canvas_width/rangex)), canvas_top+Math.round(canvas_height-(canvas_height*((maxyval-miny)/rangey))), spotRadius, undefined, options.get('maxSpotColor'));+ }+ }++ } else {+ // Remove the tag contents if sparklines aren't supported+ this.innerHTML = '';+ }+ };+++ /**+ * Bar charts+ */+ $.fn.sparkline.bar = function(values, options, width, height) {+ width = (values.length * options.get('barWidth')) + ((values.length-1) * options.get('barSpacing'));+ var num_values = [];+ for(var i=0, vlen=values.length; i<vlen; i++) {+ if (values[i]=='null' || values[i]===null) {+ values[i] = null;+ } else {+ values[i] = Number(values[i]);+ num_values.push(Number(values[i]));+ }+ }+ var max = Math.max.apply(Math, num_values),+ min = Math.min.apply(Math, num_values);+ if (options.get('chartRangeMin')!==undefined && (options.get('chartRangeClip') || options.get('chartRangeMin')<min)) {+ min = options.get('chartRangeMin');+ }+ if (options.get('chartRangeMax')!==undefined && (options.get('chartRangeClip') || options.get('chartRangeMax')>max)) {+ max = options.get('chartRangeMax');+ }+ var zeroAxis = options.get('zeroAxis');+ if (zeroAxis === undefined) {+ zeroAxis = min<0;+ }+ var range = max-min === 0 ? 1 : max-min;++ var colorMapByIndex, colorMapByValue;+ if ($.isArray(options.get('colorMap'))) {+ colorMapByIndex = options.get('colorMap');+ colorMapByValue = null;+ } else {+ colorMapByIndex = null;+ colorMapByValue = options.get('colorMap');+ }++ var target = $(this).simpledraw(width, height, options.get('composite'));+ if (target) {+ var color,+ canvas_height = target.pixel_height,+ yzero = min<0 && zeroAxis ? canvas_height-Math.round(canvas_height * (Math.abs(min)/range))-1 : canvas_height-1;++ for(i=values.length; i--;) {+ var x = i*(options.get('barWidth')+options.get('barSpacing')),+ y,+ val = values[i];+ if (val===null) {+ if (options.get('nullColor')) {+ color = options.get('nullColor');+ val = (zeroAxis && min<0) ? 0 : min;+ height = 1;+ y = (zeroAxis && min<0) ? yzero : canvas_height - height;+ } else {+ continue;+ }+ } else {+ if (val < min) {+ val=min;+ }+ if (val > max) {+ val=max;+ }+ color = (val < 0) ? options.get('negBarColor') : options.get('barColor');+ if (zeroAxis && min<0) {+ height = Math.round(canvas_height*((Math.abs(val)/range)))+1;+ y = (val < 0) ? yzero : yzero-height;+ } else {+ height = Math.round(canvas_height*((val-min)/range))+1;+ y = canvas_height-height;+ }+ if (val===0 && options.get('zeroColor')!==undefined) {+ color = options.get('zeroColor');+ }+ if (colorMapByValue && colorMapByValue[val]) {+ color = colorMapByValue[val];+ } else if (colorMapByIndex && colorMapByIndex.length>i) {+ color = colorMapByIndex[i];+ }+ if (color===null) {+ continue;+ }+ }+ target.drawRect(x, y, options.get('barWidth')-1, height-1, color, color);+ }+ } else {+ // Remove the tag contents if sparklines aren't supported+ this.innerHTML = '';+ }+ };+++ /**+ * Tristate charts+ */+ $.fn.sparkline.tristate = function(values, options, width, height) {+ values = $.map(values, Number);+ width = (values.length * options.get('barWidth')) + ((values.length-1) * options.get('barSpacing'));++ var colorMapByIndex, colorMapByValue;+ if ($.isArray(options.get('colorMap'))) {+ colorMapByIndex = options.get('colorMap');+ colorMapByValue = null;+ } else {+ colorMapByIndex = null;+ colorMapByValue = options.get('colorMap');+ }++ var target = $(this).simpledraw(width, height, options.get('composite'));+ if (target) {+ var canvas_height = target.pixel_height,+ half_height = Math.round(canvas_height/2);++ for(var i=values.length; i--;) {+ var x = i*(options.get('barWidth')+options.get('barSpacing')),+ y, color;+ if (values[i] < 0) {+ y = half_height;+ height = half_height-1;+ color = options.get('negBarColor');+ } else if (values[i] > 0) {+ y = 0;+ height = half_height-1;+ color = options.get('posBarColor');+ } else {+ y = half_height-1;+ height = 2;+ color = options.get('zeroBarColor');+ }+ if (colorMapByValue && colorMapByValue[values[i]]) {+ color = colorMapByValue[values[i]];+ } else if (colorMapByIndex && colorMapByIndex.length>i) {+ color = colorMapByIndex[i];+ }+ if (color===null) {+ continue;+ }+ target.drawRect(x, y, options.get('barWidth')-1, height-1, color, color);+ }+ } else {+ // Remove the tag contents if sparklines aren't supported+ this.innerHTML = '';+ }+ };+++ /**+ * Discrete charts+ */+ $.fn.sparkline.discrete = function(values, options, width, height) {+ values = $.map(values, Number);+ width = options.get('width')=='auto' ? values.length*2 : width;+ var interval = Math.floor(width / values.length);++ var target = $(this).simpledraw(width, height, options.get('composite'));+ if (target) {+ var canvas_height = target.pixel_height,+ line_height = options.get('lineHeight') == 'auto' ? Math.round(canvas_height * 0.3) : options.get('lineHeight'),+ pheight = canvas_height - line_height,+ min = Math.min.apply(Math, values),+ max = Math.max.apply(Math, values);+ if (options.get('chartRangeMin')!==undefined && (options.get('chartRangeClip') || options.get('chartRangeMin')<min)) {+ min = options.get('chartRangeMin');+ }+ if (options.get('chartRangeMax')!==undefined && (options.get('chartRangeClip') || options.get('chartRangeMax')>max)) {+ max = options.get('chartRangeMax');+ }+ var range = max-min;++ for(var i=values.length; i--;) {+ var val = values[i];+ if (val < min) {+ val=min;+ }+ if (val > max) {+ val=max;+ }+ var x = (i*interval),+ ytop = Math.round(pheight-pheight*((val-min)/range));+ target.drawLine(x, ytop, x, ytop+line_height, (options.get('thresholdColor') && val < options.get('thresholdValue')) ? options.get('thresholdColor') : options.get('lineColor'));+ }+ } else {+ // Remove the tag contents if sparklines aren't supported+ this.innerHTML = '';+ }++ };+++ /**+ * Bullet charts+ */+ $.fn.sparkline.bullet = function(values, options, width, height) {+ values = $.map(values, Number);+ // target, performance, range1, range2, range3++ width = options.get('width')=='auto' ? '4.0em' : width;++ var target = $(this).simpledraw(width, height, options.get('composite'));+ if (target && values.length>1) {+ var canvas_width = target.pixel_width-Math.ceil(options.get('targetWidth')/2),+ canvas_height = target.pixel_height,+ min = Math.min.apply(Math, values),+ max = Math.max.apply(Math, values);++ if (options.get('base') === undefined) {+ min = min < 0 ? min : 0;+ } else {+ min = options.get('base');+ }+ var range = max-min;++ // draw range values+ for(var i=2, vlen=values.length; i<vlen; i++) {+ var rangeval = values[i],+ rangewidth = Math.round(canvas_width*((rangeval-min)/range));+ target.drawRect(0, 0, rangewidth-1, canvas_height-1, options.get('rangeColors')[i-2], options.get('rangeColors')[i-2]);+ }++ // draw the performance bar+ var perfval = values[1],+ perfwidth = Math.round(canvas_width*((perfval-min)/range));+ target.drawRect(0, Math.round(canvas_height*0.3), perfwidth-1, Math.round(canvas_height*0.4)-1, options.get('performanceColor'), options.get('performanceColor'));++ // draw the target line+ var targetval = values[0],+ x = Math.round(canvas_width*((targetval-min)/range)-(options.get('targetWidth')/2)),+ targettop = Math.round(canvas_height*0.10),+ targetheight = canvas_height-(targettop*2);+ target.drawRect(x, targettop, options.get('targetWidth')-1, targetheight-1, options.get('targetColor'), options.get('targetColor'));+ } else {+ // Remove the tag contents if sparklines aren't supported+ this.innerHTML = '';+ }+ };+++ /**+ * Pie charts+ */+ $.fn.sparkline.pie = function(values, options, width, height) {+ values = $.map(values, Number);+ width = options.get('width')=='auto' ? height : width;++ var target = $(this).simpledraw(width, height, options.get('composite'));+ if (target && values.length>1) {+ var canvas_width = target.pixel_width,+ canvas_height = target.pixel_height,+ radius = Math.floor(Math.min(canvas_width, canvas_height)/2),+ total = 0,+ next = 0,+ circle = 2*Math.PI;++ for(var i=values.length; i--;) {+ total += values[i];+ }++ if (options.get('offset')) {+ next += (2*Math.PI)*(options.get('offset')/360);+ }+ var vlen = values.length;+ for(i=0; i<vlen; i++) {+ var start = next;+ var end = next;+ if (total > 0) { // avoid divide by zero+ end = next + (circle*(values[i]/total));+ }+ target.drawPieSlice(radius, radius, radius, start, end, undefined, options.get('sliceColors')[i % options.get('sliceColors').length]);+ next = end;+ }+ }+ };+++ /**+ * Box plots+ */+ var quartile = function(values, q) {+ if (q==2) {+ var vl2 = Math.floor(values.length/2);+ return values.length % 2 ? values[vl2] : (values[vl2]+values[vl2+1])/2;+ } else {+ var vl4 = Math.floor(values.length/4);+ return values.length % 2 ? (values[vl4*q]+values[vl4*q+1])/2 : values[vl4*q];+ }+ };++ $.fn.sparkline.box = function(values, options, width, height) {+ values = $.map(values, Number);+ width = options.get('width')=='auto' ? '4.0em' : width;++ var minvalue = options.get('chartRangeMin')===undefined ? Math.min.apply(Math, values) : options.get('chartRangeMin'),+ maxvalue = options.get('chartRangeMax')===undefined ? Math.max.apply(Math, values) : options.get('chartRangeMax'),+ target = $(this).simpledraw(width, height, options.get('composite')),+ vlen = values.length,+ lwhisker, loutlier, q1, q2, q3, rwhisker, routlier;++ if (target && values.length>1) {+ var canvas_width = target.pixel_width,+ canvas_height = target.pixel_height;+ if (options.get('raw')) {+ if (options.get('showOutliers') && values.length>5) {+ loutlier=values[0]; lwhisker=values[1]; q1=values[2]; q2=values[3]; q3=values[4]; rwhisker=values[5]; routlier=values[6];+ } else {+ lwhisker=values[0]; q1=values[1]; q2=values[2]; q3=values[3]; rwhisker=values[4];+ }+ } else {+ values.sort(function(a, b) { return a-b; });+ q1 = quartile(values, 1);+ q2 = quartile(values, 2);+ q3 = quartile(values, 3);+ var iqr = q3-q1;+ if (options.get('showOutliers')) {+ lwhisker=undefined; rwhisker=undefined;+ for(var i=0; i<vlen; i++) {+ if (lwhisker===undefined && values[i] > q1-(iqr*options.get('outlierIQR'))) {+ lwhisker = values[i];+ }+ if (values[i] < q3+(iqr*options.get('outlierIQR'))) {+ rwhisker = values[i];+ }+ }+ loutlier = values[0];+ routlier = values[vlen-1];+ } else {+ lwhisker = values[0];+ rwhisker = values[vlen-1];+ }+ }++ var unitsize = canvas_width / (maxvalue-minvalue+1),+ canvas_left = 0;+ if (options.get('showOutliers')) {+ canvas_left = Math.ceil(options.get('spotRadius'));+ canvas_width -= 2*Math.ceil(options.get('spotRadius'));+ unitsize = canvas_width / (maxvalue-minvalue+1);+ if (loutlier < lwhisker) {+ target.drawCircle((loutlier-minvalue)*unitsize+canvas_left, canvas_height/2, options.get('spotRadius'), options.get('outlierLineColor'), options.get('outlierFillColor'));+ }+ if (routlier > rwhisker) {+ target.drawCircle((routlier-minvalue)*unitsize+canvas_left, canvas_height/2, options.get('spotRadius'), options.get('outlierLineColor'), options.get('outlierFillColor'));+ }+ }++ // box+ target.drawRect(+ Math.round((q1-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height*0.1),+ Math.round((q3-q1)*unitsize),+ Math.round(canvas_height*0.8),+ options.get('boxLineColor'),+ options.get('boxFillColor'));+ // left whisker+ target.drawLine(+ Math.round((lwhisker-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height/2),+ Math.round((q1-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height/2),+ options.get('lineColor'));+ target.drawLine(+ Math.round((lwhisker-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height/4),+ Math.round((lwhisker-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height-canvas_height/4),+ options.get('whiskerColor'));+ // right whisker+ target.drawLine(Math.round((rwhisker-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height/2),+ Math.round((q3-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height/2),+ options.get('lineColor'));+ target.drawLine(+ Math.round((rwhisker-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height/4),+ Math.round((rwhisker-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height-canvas_height/4),+ options.get('whiskerColor'));+ // median line+ target.drawLine(+ Math.round((q2-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height*0.1),+ Math.round((q2-minvalue)*unitsize+canvas_left),+ Math.round(canvas_height*0.9),+ options.get('medianColor'));+ if (options.get('target')) {+ var size = Math.ceil(options.get('spotRadius'));+ target.drawLine(+ Math.round((options.get('target')-minvalue)*unitsize+canvas_left),+ Math.round((canvas_height/2)-size),+ Math.round((options.get('target')-minvalue)*unitsize+canvas_left),+ Math.round((canvas_height/2)+size),+ options.get('targetColor'));+ target.drawLine(+ Math.round((options.get('target')-minvalue)*unitsize+canvas_left-size),+ Math.round(canvas_height/2),+ Math.round((options.get('target')-minvalue)*unitsize+canvas_left+size),+ Math.round(canvas_height/2),+ options.get('targetColor'));+ }+ } else {+ // Remove the tag contents if sparklines aren't supported+ this.innerHTML = '';+ }+ };+++ // Setup a very simple "virtual canvas" to make drawing the few shapes we need easier+ // This is accessible as $(foo).simpledraw()++ if ($.browser.msie && !document.namespaces.v) {+ document.namespaces.add('v', 'urn:schemas-microsoft-com:vml', '#default#VML');+ }++ if ($.browser.hasCanvas === undefined) {+ var t = document.createElement('canvas');+ $.browser.hasCanvas = t.getContext!==undefined;+ }++ VCanvas_base = function(width, height, target) {+ };++ VCanvas_base.prototype = {+ init : function(width, height, target) {+ this.width = width;+ this.height = height;+ this.target = target;+ if (target[0]) {+ target=target[0];+ }+ target.VCanvas = this;+ },++ drawShape : function(path, lineColor, fillColor, lineWidth) {+ alert('drawShape not implemented');+ },++ drawLine : function(x1, y1, x2, y2, lineColor, lineWidth) {+ return this.drawShape([ [x1,y1], [x2,y2] ], lineColor, lineWidth);+ },++ drawCircle : function(x, y, radius, lineColor, fillColor) {+ alert('drawCircle not implemented');+ },++ drawPieSlice : function(x, y, radius, startAngle, endAngle, lineColor, fillColor) {+ alert('drawPieSlice not implemented');+ },++ drawRect : function(x, y, width, height, lineColor, fillColor) {+ alert('drawRect not implemented');+ },++ getElement : function() {+ return this.canvas;+ },++ _insert : function(el, target) {+ $(target).html(el);+ }+ };++ VCanvas_canvas = function(width, height, target) {+ return this.init(width, height, target);+ };++ VCanvas_canvas.prototype = $.extend(new VCanvas_base(), {+ _super : VCanvas_base.prototype,++ init : function(width, height, target) {+ this._super.init(width, height, target);+ this.canvas = document.createElement('canvas');+ if (target[0]) {+ target=target[0];+ }+ target.VCanvas = this;+ $(this.canvas).css({ display:'inline-block', width:width, height:height, verticalAlign:'top' });+ this._insert(this.canvas, target);+ this.pixel_height = $(this.canvas).height();+ this.pixel_width = $(this.canvas).width();+ this.canvas.width = this.pixel_width;+ this.canvas.height = this.pixel_height;+ $(this.canvas).css({width: this.pixel_width, height: this.pixel_height});+ },++ _getContext : function(lineColor, fillColor, lineWidth) {+ var context = this.canvas.getContext('2d');+ if (lineColor !== undefined) {+ context.strokeStyle = lineColor;+ }+ context.lineWidth = lineWidth===undefined ? 1 : lineWidth;+ if (fillColor !== undefined) {+ context.fillStyle = fillColor;+ }+ return context;+ },++ drawShape : function(path, lineColor, fillColor, lineWidth) {+ var context = this._getContext(lineColor, fillColor, lineWidth);+ context.beginPath();+ context.moveTo(path[0][0]+0.5, path[0][1]+0.5);+ for(var i=1, plen=path.length; i<plen; i++) {+ context.lineTo(path[i][0]+0.5, path[i][1]+0.5); // the 0.5 offset gives us crisp pixel-width lines+ }+ if (lineColor !== undefined) {+ context.stroke();+ }+ if (fillColor !== undefined) {+ context.fill();+ }+ },++ drawCircle : function(x, y, radius, lineColor, fillColor) {+ var context = this._getContext(lineColor, fillColor);+ context.beginPath();+ context.arc(x, y, radius, 0, 2*Math.PI, false);+ if (lineColor !== undefined) {+ context.stroke();+ }+ if (fillColor !== undefined) {+ context.fill();+ }+ },++ drawPieSlice : function(x, y, radius, startAngle, endAngle, lineColor, fillColor) {+ var context = this._getContext(lineColor, fillColor);+ context.beginPath();+ context.moveTo(x, y);+ context.arc(x, y, radius, startAngle, endAngle, false);+ context.lineTo(x, y);+ context.closePath();+ if (lineColor !== undefined) {+ context.stroke();+ }+ if (fillColor) {+ context.fill();+ }+ },++ drawRect : function(x, y, width, height, lineColor, fillColor) {+ return this.drawShape([ [x,y], [x+width, y], [x+width, y+height], [x, y+height], [x, y] ], lineColor, fillColor);+ }++ });++ VCanvas_vml = function(width, height, target) {+ return this.init(width, height, target);+ };++ VCanvas_vml.prototype = $.extend(new VCanvas_base(), {+ _super : VCanvas_base.prototype,++ init : function(width, height, target) {+ this._super.init(width, height, target);+ if (target[0]) {+ target=target[0];+ }+ target.VCanvas = this;+ this.canvas = document.createElement('span');+ $(this.canvas).css({ display:'inline-block', position: 'relative', overflow:'hidden', width:width, height:height, margin:'0px', padding:'0px', verticalAlign: 'top'});+ this._insert(this.canvas, target);+ this.pixel_height = $(this.canvas).height();+ this.pixel_width = $(this.canvas).width();+ this.canvas.width = this.pixel_width;+ this.canvas.height = this.pixel_height;+ var groupel = '<v:group coordorigin="0 0" coordsize="'+this.pixel_width+' '+this.pixel_height+'"' ++ ' style="position:absolute;top:0;left:0;width:'+this.pixel_width+'px;height='+this.pixel_height+'px;"></v:group>';+ this.canvas.insertAdjacentHTML('beforeEnd', groupel);+ this.group = $(this.canvas).children()[0];+ },++ drawShape : function(path, lineColor, fillColor, lineWidth) {+ var vpath = [];+ for(var i=0, plen=path.length; i<plen; i++) {+ vpath[i] = ''+(path[i][0])+','+(path[i][1]);+ }+ var initial = vpath.splice(0,1);+ lineWidth = lineWidth === undefined ? 1 : lineWidth;+ var stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="'+lineWidth+'" strokeColor="'+lineColor+'" ';+ var fill = fillColor === undefined ? ' filled="false"' : ' fillColor="'+fillColor+'" filled="true" ';+ var closed = vpath[0] == vpath[vpath.length-1] ? 'x ' : '';+ var vel = '<v:shape coordorigin="0 0" coordsize="'+this.pixel_width+' '+this.pixel_height+'" ' ++ stroke ++ fill ++ ' style="position:absolute;left:0px;top:0px;height:'+this.pixel_height+'px;width:'+this.pixel_width+'px;padding:0px;margin:0px;" ' ++ ' path="m '+initial+' l '+vpath.join(', ')+' '+closed+'e">' ++ ' </v:shape>';+ this.group.insertAdjacentHTML('beforeEnd', vel);+ },++ drawCircle : function(x, y, radius, lineColor, fillColor) {+ x -= radius+1;+ y -= radius+1;+ var stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="1" strokeColor="'+lineColor+'" ';+ var fill = fillColor === undefined ? ' filled="false"' : ' fillColor="'+fillColor+'" filled="true" ';+ var vel = '<v:oval ' ++ stroke ++ fill ++ ' style="position:absolute;top:'+y+'px; left:'+x+'px; width:'+(radius*2)+'px; height:'+(radius*2)+'px"></v:oval>';+ this.group.insertAdjacentHTML('beforeEnd', vel);++ },++ drawPieSlice : function(x, y, radius, startAngle, endAngle, lineColor, fillColor) {+ if (startAngle == endAngle) {+ return; // VML seems to have problem when start angle equals end angle.+ }+ if ((endAngle - startAngle) == (2*Math.PI)) {+ startAngle = 0.0; // VML seems to have a problem when drawing a full circle that doesn't start 0+ endAngle = (2*Math.PI);+ }++ var startx = x + Math.round(Math.cos(startAngle) * radius);+ var starty = y + Math.round(Math.sin(startAngle) * radius);+ var endx = x + Math.round(Math.cos(endAngle) * radius);+ var endy = y + Math.round(Math.sin(endAngle) * radius);++ // Prevent very small slices from being mistaken as a whole pie+ if (startx==endx && starty==endy && (endAngle-startAngle) < Math.PI) {+ return;+ }++ var vpath = [ x-radius, y-radius, x+radius, y+radius, startx, starty, endx, endy ];+ var stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="1" strokeColor="'+lineColor+'" ';+ var fill = fillColor === undefined ? ' filled="false"' : ' fillColor="'+fillColor+'" filled="true" ';+ var vel = '<v:shape coordorigin="0 0" coordsize="'+this.pixel_width+' '+this.pixel_height+'" ' ++ stroke ++ fill ++ ' style="position:absolute;left:0px;top:0px;height:'+this.pixel_height+'px;width:'+this.pixel_width+'px;padding:0px;margin:0px;" ' ++ ' path="m '+x+','+y+' wa '+vpath.join(', ')+' x e">' ++ ' </v:shape>';+ this.group.insertAdjacentHTML('beforeEnd', vel);+ },++ drawRect : function(x, y, width, height, lineColor, fillColor) {+ return this.drawShape( [ [x, y], [x, y+height], [x+width, y+height], [x+width, y], [x, y] ], lineColor, fillColor);+ }+ });++})(jQuery);diff --git a/solr/src/webapp/web/js/jquery.timeago.js b/solr/src/webapp/web/js/jquery.timeago.jsnew file mode 100644index 00000000000..315629b4bdd--- /dev/null+++ b/solr/src/webapp/web/js/jquery.timeago.js@@ -0,0 +1,164 @@+/*+ * timeago: a jQuery plugin, version: 0.9.3 (2011-01-21)+ * @requires jQuery v1.2.3 or later+ *+ * Timeago is a jQuery plugin that makes it easy to support automatically+ * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").+ *+ * For usage and examples, visit:+ * http://timeago.yarp.com/+ *+ * Licensed under the MIT:+ * http://www.opensource.org/licenses/mit-license.php+ *+ * Copyright (c) 2008-2011, Ryan McGeary (ryanonjavascript -[at]- mcgeary [*dot*] org)+ */+(function($) {+ $.timeago = function(timestamp) {+ if (timestamp instanceof Date) {+ return inWords(timestamp);+ } else if (typeof timestamp === "string") {+ return inWords($.timeago.parse(timestamp));+ } else {+ return inWords($.timeago.datetime(timestamp));+ }+ };+ var $t = $.timeago;++ $.extend($.timeago, {+ settings: {+ refreshMillis: 60000,+ allowFuture: false,+ strings: {+ prefixAgo: null,+ prefixFromNow: null,+ suffixAgo: "ago",+ suffixFromNow: "from now",+ seconds: "less than a minute",+ minute: "about a minute",+ minutes: "%d minutes",+ hour: "about an hour",+ hours: "about %d hours",+ day: "a day",+ days: "%d days",+ month: "about a month",+ months: "%d months",+ year: "about a year",+ years: "%d years",+ numbers: []+ }+ },+ inWords: function(distanceMillis) {+ var $l = this.settings.strings;+ var prefix = $l.prefixAgo;+ var suffix = $l.suffixAgo;+ if (this.settings.allowFuture) {+ if (distanceMillis < 0) {+ prefix = $l.prefixFromNow;+ suffix = $l.suffixFromNow;+ }+ distanceMillis = Math.abs(distanceMillis);+ }++ var seconds = distanceMillis / 1000;+ var minutes = seconds / 60;+ var hours = minutes / 60;+ var days = hours / 24;+ var years = days / 365;++ function substitute(stringOrFunction, number) {+ var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;+ var value = ($l.numbers && $l.numbers[number]) || number;+ return string.replace(/%d/i, value);+ }++ var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||+ seconds < 90 && substitute($l.minute, 1) ||+ minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||+ minutes < 90 && substitute($l.hour, 1) ||+ hours < 24 && substitute($l.hours, Math.round(hours)) ||+ hours < 48 && substitute($l.day, 1) ||+ days < 30 && substitute($l.days, Math.floor(days)) ||+ days < 60 && substitute($l.month, 1) ||+ days < 365 && substitute($l.months, Math.floor(days / 30)) ||+ years < 2 && substitute($l.year, 1) ||+ substitute($l.years, Math.floor(years));++ return $.trim([prefix, words, suffix].join(" "));+ },+ parse: function(iso8601) {+ var s = $.trim(iso8601);+ s = s.replace(/\.\d\d\d+/,""); // remove milliseconds+ s = s.replace(/-/g,"/");+ s = s.replace(/(\d)T(\d)/,"$1 $2").replace(/(\d)Z/,"$1 UTC");+ s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400+ return new Date(s);+ },+ datetime: function(elem) {+ // jQuery's `is()` doesn't play well with HTML5 in IE+ var isTime = $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");++ var iso8601 = null;++ if( isTime )+ {+ iso8601 = $(elem).attr("datetime");+ }++ if( !iso8601 )+ {+ iso8601 = $(elem).attr("title");+ }++ if( !iso8601 )+ {+ iso8601 = $(elem).text();+ }++ return $t.parse(iso8601);+ }+ });++ $.fn.timeago = function() {+ var self = this;+ self.each(refresh);++ var $s = $t.settings;+ if ($s.refreshMillis > 0) {+ setInterval(function() { self.each(refresh); }, $s.refreshMillis);+ }+ return self;+ };++ function refresh() {+ var data = prepareData(this);+ if (!isNaN(data.datetime)) {+ $(this).text(inWords(data.datetime));+ }+ return this;+ }++ function prepareData(element) {+ element = $(element);+ if (!element.data("timeago")) {+ element.data("timeago", { datetime: $t.datetime(element) });+ var text = $.trim(element.text());+ if (text.length > 0) {+ element.attr("title", text);+ }+ }+ return element.data("timeago");+ }++ function inWords(date) {+ return $t.inWords(distance(date));+ }++ function distance(date) {+ return (new Date().getTime() - date.getTime());+ }++ // fix for IE6 suckage+ document.createElement("abbr");+ document.createElement("time");+}(jQuery));diff --git a/solr/src/webapp/web/js/script.js b/solr/src/webapp/web/js/script.jsnew file mode 100644index 00000000000..264d88435a7--- /dev/null+++ b/solr/src/webapp/web/js/script.js@@ -0,0 +1,4119 @@+var loader = {++ show : function( element )+ {+ $( element )+ .addClass( 'loader' );+ },++ hide : function( element )+ {+ $( element )+ .removeClass( 'loader' );+ }++};++var sammy = $.sammy+(+ function()+ {+ this.bind+ (+ 'run',+ function( event, config )+ {+ if( 0 === config.start_url.length )+ {+ location.href = '#/';+ return false;+ }+ }+ );++ this.bind+ (+ 'ping',+ function( event )+ {+ var element = $( this.params.element );++ $.ajax+ (+ {+ url : element.attr( 'href' ) + '?wt=json',+ dataType : 'json',+ beforeSend : function( arr, form, options )+ {+ loader.show( element );+ },+ success : function( response )+ {+ var qtime_element = $( '.qtime', element );++ if( 0 === qtime_element.size() )+ {+ qtime_element = $( '<small class="qtime"> (<span></span>)</small>' );++ element+ .append+ (+ qtime_element+ );+ }++ $( 'span', qtime_element )+ .html( response.responseHeader.QTime + 'ms' );+ },+ error : function()+ {+ },+ complete : function()+ {+ loader.hide( element );+ }+ }+ );++ return false;+ }+ );++ // activate_core+ this.before+ (+ {},+ function()+ {+ $( 'li[id].active', app.menu_element )+ .removeClass( 'active' );++ $( 'ul li.active', app.menu_element )+ .removeClass( 'active' );++ if( this.params.splat )+ {+ var active_element = $( '#' + this.params.splat[0], app.menu_element );++ active_element+ .addClass( 'active' );++ if( this.params.splat[1] )+ {+ $( '.' + this.params.splat[1], active_element )+ .addClass( 'active' );+ }++ if( !active_element.hasClass( 'global' ) )+ {+ this.active_core = active_element;+ }+ }+ }+ );++ // #/cloud+ this.get+ (+ /^#\/(cloud)$/,+ function( context )+ {+ var content_element = $( '#content' );++ $.get+ (+ 'tpl/cloud.html',+ function( template )+ {+ content_element+ .html( template );++ var zookeeper_element = $( '#zookeeper', content_element );++ $.ajax+ (+ {+ url : app.config.zookeeper_path,+ dataType : 'json',+ context : $( '.content', zookeeper_element ),+ beforeSend : function( xhr, settings )+ {+ this+ .html( '<div class="loader">Loading ...</div>' );+ },+ success : function( response, text_status, xhr )+ {+ this+ .html( '<div id="zookeeper-tree" class="tree"></div>' );++ $( '#zookeeper-tree', this )+ .jstree+ (+ {+ "plugins" : [ "json_data" ],+ "json_data" : {+ "data" : response.tree,+ "progressive_render" : true+ },+ "core" : {+ "animation" : 0+ }+ }+ );+ },+ error : function( xhr, text_status, error_thrown )+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ );+ }+ );++ this.bind+ (+ 'cores_load_data',+ function( event, params )+ {+ if( app.cores_data )+ {+ params.callback( app.cores_data );+ return true;+ }++ $.ajax+ (+ {+ url : app.config.solr_path + app.config.core_admin_path + '?wt=json',+ dataType : 'json',+ beforeSend : function( xhr, settings )+ {+ },+ success : function( response, text_status, xhr )+ {+ app.cores_data = response.status;+ params.callback( app.cores_data );+ },+ error : function( xhr, text_status, error_thrown)+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ );++ this.bind+ (+ 'cores_build_navigation',+ function( event, params )+ {+ var navigation_content = ['<ul>'];++ for( var core in params.cores )+ {+ navigation_content.push( '<li><a href="' + params.basepath + core + '">' + core + '</a></li>' );+ }++ params.navigation_element+ .html( navigation_content.join( "\n" ) );++ $( 'a[href="' + params.basepath + params.current_core + '"]', params.navigation_element ).parent()+ .addClass( 'current' );+ }+ );++ this.bind+ (+ 'cores_load_template',+ function( event, params )+ {+ if( app.cores_template )+ {+ params.callback();+ return true;+ }++ $.get+ (+ 'tpl/cores.html',+ function( template )+ {+ params.content_element+ .html( template );++ app.cores_template = template;+ params.callback();+ }+ );+ }+ );++ // #/cores+ this.get+ (+ /^#\/cores$/,+ function( context )+ {+ sammy.trigger+ (+ 'cores_load_data',+ {+ callback : function( cores )+ {+ var first_core = null;+ for( var key in cores )+ {+ if( !first_core )+ {+ first_core = key;+ }+ continue;+ }+ context.redirect( context.path + '/' + first_core );+ }+ }+ );+ }+ );++ // #/cores+ this.get+ (+ /^#\/cores\//,+ function( context )+ {+ var content_element = $( '#content' );++ var path_parts = this.path.match( /^(.+\/cores\/)(.*)$/ );+ var current_core = path_parts[2];++ sammy.trigger+ (+ 'cores_load_data',+ {+ callback : function( cores )+ {+ sammy.trigger+ (+ 'cores_load_template',+ {+ content_element : content_element,+ callback : function()+ {+ var cores_element = $( '#cores', content_element );+ var navigation_element = $( '#navigation', cores_element );+ var list_element = $( '#list', navigation_element );+ var data_element = $( '#data', cores_element );+ var core_data_element = $( '#core-data', data_element );+ var index_data_element = $( '#index-data', data_element );++ sammy.trigger+ (+ 'cores_build_navigation',+ {+ cores : cores,+ basepath : path_parts[1],+ current_core : current_core,+ navigation_element : list_element+ }+ );++ var core_data = cores[current_core];+ var core_basepath = $( '#' + current_core, app.menu_element ).attr( 'data-basepath' );++ // core-data++ $( 'h2 span', core_data_element )+ .html( core_data.name );++ $( '.startTime dd', core_data_element )+ .html( core_data.startTime );++ $( '.instanceDir dd', core_data_element )+ .html( core_data.instanceDir );++ $( '.dataDir dd', core_data_element )+ .html( core_data.dataDir );++ // index-data++ $( '.lastModified dd', index_data_element )+ .html( core_data.index.lastModified );++ $( '.version dd', index_data_element )+ .html( core_data.index.version );++ $( '.numDocs dd', index_data_element )+ .html( core_data.index.numDocs );++ $( '.maxDoc dd', index_data_element )+ .html( core_data.index.maxDoc );++ $( '.optimized dd', index_data_element )+ .addClass( core_data.index.optimized ? 'ico-1' : 'ico-0' );++ $( '#actions .optimize', cores_element )+ .show();++ $( '.optimized dd span', index_data_element )+ .html( core_data.index.optimized ? 'yes' : 'no' );++ $( '.current dd', index_data_element )+ .addClass( core_data.index.current ? 'ico-1' : 'ico-0' );++ $( '.current dd span', index_data_element )+ .html( core_data.index.current ? 'yes' : 'no' );++ $( '.hasDeletions dd', index_data_element )+ .addClass( core_data.index.hasDeletions ? 'ico-1' : 'ico-0' );++ $( '.hasDeletions dd span', index_data_element )+ .html( core_data.index.hasDeletions ? 'yes' : 'no' );++ $( '.directory dd', index_data_element )+ .html+ (+ core_data.index.directory+ .replace( /:/g, ':​' )+ .replace( /@/g, '@​' )+ );++ var core_names = [];+ var core_selects = $( '.swap select', cores_element );++ for( var key in cores )+ {+ core_names.push( '<option>' + key + '</option>' )+ }+++ core_selects+ .html( core_names.join( "\n") );++ $( 'option[value=' + current_core + ']', core_selects.filter( '.core' ) )+ .attr( 'selected', 'selected' );++ $( 'option[value=' + current_core + ']', core_selects.filter( '.other' ) )+ .attr( 'disabled', 'disabled' )+ .addClass( 'disabled' );++ $( '.rename input[name=core]', cores_element )+ .val( current_core );++ // layout++ var actions_element = $( '.actions', cores_element );+ var button_holder_element = $( '.button-holder.options', actions_element );++ button_holder_element+ .die( 'toggle' )+ .live+ (+ 'toggle',+ function( event )+ {+ var element = $( this );++ element+ .toggleClass( 'active' );++ if( element.hasClass( 'active' ) )+ {+ button_holder_element+ .not( element )+ .removeClass( 'active' );+ }+ }+ );++ $( '.button a', button_holder_element )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( this ).parents( '.button-holder' )+ .trigger( 'toggle' );+ }+ );++ $( 'form a.reset', button_holder_element )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( this ).parents( '.button-holder' )+ .trigger( 'toggle' );+ }+ );++ $( '#actions .optimize', cores_element )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $.ajax+ (+ {+ url : core_basepath + '/update?optimize=true&waitFlush=true&wt=json',+ dataType : 'json',+ context : $( this ),+ beforeSend : function( xhr, settings )+ {+ this+ .addClass( 'loader' );+ },+ success : function( response, text_status, xhr )+ {+ $( '.optimized dd.ico-0', index_data_element )+ .removeClass( 'ico-0' )+ .addClass( 'ico-1' );+ },+ error : function( xhr, text_status, error_thrown)+ {+ console.warn( 'd0h, optimize broken!' );+ },+ complete : function( xhr, text_status )+ {+ this+ .removeClass( 'loader' );+ }+ }+ );+ }+ );++ $( '.timeago', data_element )+ .timeago();++ $( 'ul', data_element )+ .each+ (+ function( i, element )+ {+ $( 'li:odd', element )+ .addClass( 'odd' );+ }+ )+ }+ }+ );+ }+ }+ );+ }+ );++ // #/logging+ this.get+ (+ /^#\/(logging)$/,+ function( context )+ {+ var content_element = $( '#content' );++ content_element+ .html( '<div id="logging"></div>' );++ $.ajax+ (+ {+ url : 'logging.json',+ dataType : 'json',+ context : $( '#logging', content_element ),+ beforeSend : function( xhr, settings )+ {+ this+ .html( '<div class="loader">Loading ...</div>' );+ },+ success : function( response, text_status, xhr )+ {+ var logger = response.logger;++ var loglevel = '<div class="loglevel %class%">' + "\n";+ loglevel += '<a class="effective_level trigger"><span>%effective_level%</span></a>' + "\n";+ loglevel += '<ul>' + "\n";++ for( var key in response.levels )+ {+ var level = response.levels[key];+ loglevel += '<li class="' + level + '"><a>' + level + '</a></li>' + "\n";+ }++ loglevel += '<li class="UNSET"><a>UNSET</a></li>' + "\n";+ loglevel += '</ul>' + "\n";+ loglevel += '</div>';++ var logger_tree = function( filter )+ {+ var logger_content = '';+ var filter_regex = new RegExp( '^' + filter + '\\.\\w+$' );++ for( var logger_name in logger )+ {+ var continue_matcher = false;++ if( !filter )+ {+ continue_matcher = logger_name.indexOf( '.' ) !== -1;+ }+ else+ {+ continue_matcher = !logger_name.match( filter_regex );+ }++ if( continue_matcher )+ {+ continue;+ }++ var has_logger_instance = !!logger[logger_name];++ var classes = [];++ has_logger_instance+ ? classes.push( 'active' )+ : classes.push( 'inactive' );++ logger_content += '<li class="jstree-leaf">';+ logger_content += '<ins class="jstree-icon"> </ins>';+ logger_content += '<a class="trigger ' + classes.join( ' ' ) + '" ' + "\n" ++ 'title="' + logger_name + '"><span>' + "\n" ++ logger_name.split( '.' ).pop() + "\n" ++ '</span></a>';++ logger_content += loglevel+ .replace+ (+ /%class%/g,+ classes.join( ' ' )+ )+ .replace+ (+ /%effective_level%/g,+ has_logger_instance+ ? logger[logger_name].effective_level+ : 'null'+ );++ var child_logger_content = logger_tree( logger_name );+ if( child_logger_content )+ {+ logger_content += '<ul>';+ logger_content += child_logger_content;+ logger_content += '</ul>';+ }++ logger_content += '</li>';+ }++ return logger_content;+ }++ var logger_content = logger_tree( null );++ this+ .html( '<ul class="tree jstree">' + logger_content + '</ul>' );++ $( 'li:last-child', this )+ .addClass( 'jstree-last' );++ $( '.loglevel', this )+ .each+ (+ function( index, element )+ {+ var element = $( element );+ var effective_level = $( '.effective_level span', element ).html();++ element+ .css( 'z-index', 800 - index );++ $( 'ul .' + effective_level, element )+ .addClass( 'selected' );+ }+ );++ $( '.trigger', this )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( '.loglevel', $( this ).parents( 'li' ).first() ).first()+ .trigger( 'toggle' );+ }+ );++ $( '.loglevel', this )+ .die( 'toggle')+ .live+ (+ 'toggle',+ function( event )+ {+ $( this )+ .toggleClass( 'open' );+ }+ );+ },+ error : function( xhr, text_status, error_thrown)+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ );++ // #/java-properties+ this.get+ (+ /^#\/(java-properties)$/,+ function( context )+ {+ var core_basepath = $( 'li[data-basepath]', app.menu_element ).attr( 'data-basepath' );+ var content_element = $( '#content' );++ content_element+ .html( '<div id="java-properties"></div>' );++ $.ajax+ (+ {+ url : core_basepath + '/admin/properties?wt=json',+ dataType : 'json',+ context : $( '#java-properties', content_element ),+ beforeSend : function( xhr, settings )+ {+ this+ .html( '<div class="loader">Loading ...</div>' );+ },+ success : function( response, text_status, xhr )+ {+ var system_properties = response['system.properties'];+ var properties_data = {};+ var properties_content = [];+ var properties_order = [];++ for( var key in system_properties )+ {+ var displayed_key = key.replace( /\./g, '.​' );+ var displayed_value = [ system_properties[key] ];+ var item_class = 'clearfix';++ if( -1 !== key.indexOf( '.path' ) )+ {+ displayed_value = system_properties[key].split( ':' );+ if( 1 < displayed_value.length )+ {+ item_class += ' multi';+ }+ }++ var item_content = '<li><dl class="' + item_class + '">' + "\n" ++ '<dt>' + displayed_key + '</dt>' + "\n";++ for( var i in displayed_value )+ {+ item_content += '<dd>' + displayed_value[i] + '</dd>' + "\n";+ }++ item_content += '</dl></li>';++ properties_data[key] = item_content;+ properties_order.push( key );+ }++ properties_order.sort();+ for( var i in properties_order )+ {+ properties_content.push( properties_data[properties_order[i]] );+ }++ this+ .html( '<ul>' + properties_content.join( "\n" ) + '</ul>' );++ $( 'li:odd', this )+ .addClass( 'odd' );++ $( '.multi dd:odd', this )+ .addClass( 'odd' );+ },+ error : function( xhr, text_status, error_thrown)+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ );++ // #/threads+ this.get+ (+ /^#\/(threads)$/,+ function( context )+ {+ var core_basepath = $( 'li[data-basepath]', app.menu_element ).attr( 'data-basepath' );+ var content_element = $( '#content' );++ $.get+ (+ 'tpl/threads.html',+ function( template )+ {+ content_element+ .html( template );++ $.ajax+ (+ {+ url : core_basepath + '/admin/threads?wt=json',+ dataType : 'json',+ context : $( '#threads', content_element ),+ beforeSend : function( xhr, settings )+ {+ },+ success : function( response, text_status, xhr )+ {+ var threadDumpData = response.system.threadDump;+ var threadDumpContent = [];+ var c = 0;+ for( var i = 1; i < threadDumpData.length; i += 2 )+ {+ var state = threadDumpData[i].state;+ var name = '<a><span>' + threadDumpData[i].name + '</span></a>';++ var class = [state];+ var details = '';++ if( 0 !== c % 2 )+ {+ class.push( 'odd' );+ }++ if( threadDumpData[i].lock )+ {+ class.push( 'lock' );+ name += "\n" + '<p title="Waiting on">' + threadDumpData[i].lock + '</p>';+ }++ if( threadDumpData[i].stackTrace && 0 !== threadDumpData[i].stackTrace.length )+ {+ class.push( 'stacktrace' );++ var stack_trace = threadDumpData[i].stackTrace+ .join( '</li><li>' )+ .replace( /\(/g, '​(' );++ name += '<div>' + "\n"+ + '<ul>' + "\n"+ + '<li>' + stack_trace + '</li>'+ + '</ul>' + "\n"+ + '</div>';+ }++ var item = '<tr class="' + class.join( ' ' ) +'">' + "\n"++ + '<td class="ico" title="' + state +'"><span>' + state +'</span></td>' + "\n"+ + '<td class="id">' + threadDumpData[i].id + '</td>' + "\n"+ + '<td class="name">' + name + '</td>' + "\n"+ + '<td class="time">' + threadDumpData[i].cpuTime + '</td>' + "\n"+ + '<td class="time">' + threadDumpData[i].userTime + '</td>' + "\n"++ + '</tr>';++ threadDumpContent.push( item );+ c++;+ }++ var threadDumpBody = $( '#thread-dump tbody', this );++ threadDumpBody+ .html( threadDumpContent.join( "\n" ) );++ $( '.name a', threadDumpBody )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( this ).closest( 'tr' )+ .toggleClass( 'open' );+ }+ )+ },+ error : function( xhr, text_status, error_thrown)+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ );+ }+ );++ // #/:core/replication+ this.get+ (+ /^#\/([\w\d]+)\/(replication)$/,+ function( context )+ {+ var core_basepath = this.active_core.attr( 'data-basepath' );+ var content_element = $( '#content' );++ $.get+ (+ 'tpl/replication.html',+ function( template )+ {+ content_element+ .html( template );++ var replication_element = $( '#replication', content_element );+ var navigation_element = $( '#navigation', replication_element );++ function convert_seconds_to_readable_time( value )+ {+ var text = [];+ value = parseInt( value );++ var minutes = Math.floor( value / 60 );+ var hours = Math.floor( minutes / 60 );++ if( 0 !== hours )+ {+ text.push( hours + 'h' );+ value -= hours * 60 * 60;+ minutes -= hours * 60;+ }++ if( 0 !== minutes )+ {+ text.push( minutes + 'm' );+ value -= minutes * 60;+ }++ text.push( value + 's' );++ return text.join( ' ' );+ }++ function replication_fetch_status()+ {+ $.ajax+ (+ {+ url : core_basepath + '/replication?command=details&wt=json',+ dataType : 'json',+ beforeSend : function( xhr, settings )+ {+ $( '.refresh-status', navigation_element )+ .addClass( 'loader' );+ },+ success : function( response, text_status, xhr )+ {+ $( '.refresh-status', navigation_element )+ .removeClass( 'loader' );++ var data = response.details;+ var is_slave = 'true' === data.isSlave;++ replication_element+ .addClass( is_slave ? 'slave' : 'master' );++ if( is_slave )+ {+ var error_element = $( '#error', replication_element );++ if( data.slave.ERROR )+ {+ error_element+ .html( data.slave.ERROR )+ .show();+ }+ else+ {+ error_element+ .hide()+ .empty();+ }++ var progress_element = $( '#progress', replication_element );++ var start_element = $( '#start', progress_element );+ $( 'span', start_element )+ .text( data.slave.replicationStartTime );++ var eta_element = $( '#eta', progress_element );+ $( 'span', eta_element )+ .text( convert_seconds_to_readable_time( data.slave.timeRemaining ) );++ var bar_element = $( '#bar', progress_element );+ $( '.files span', bar_element )+ .text( data.slave.numFilesToDownload );+ $( '.size span', bar_element )+ .text( data.slave.bytesToDownload );++ var speed_element = $( '#speed', progress_element );+ $( 'span', speed_element )+ .text( data.slave.downloadSpeed );++ var done_element = $( '#done', progress_element );+ $( '.files span', done_element )+ .text( data.slave.numFilesDownloaded );+ $( '.size span', done_element )+ .text( data.slave.bytesDownloaded );+ $( '.percent span', done_element )+ .text( parseInt(data.slave.totalPercent ) );++ var percent = parseInt( data.slave.totalPercent );+ if( 0 === percent )+ {+ done_element+ .css( 'width', '1px' );+ }+ else+ {+ done_element+ .css( 'width', percent + '%' );+ }++ var current_file_element = $( '#current-file', replication_element );+ $( '.file', current_file_element )+ .text( data.slave.currentFile );+ $( '.done', current_file_element )+ .text( data.slave.currentFileSizeDownloaded );+ $( '.total', current_file_element )+ .text( data.slave.currentFileSize );+ $( '.percent', current_file_element )+ .text( parseInt( data.slave.currentFileSizePercent ) );++ if( !data.slave.indexReplicatedAtList )+ {+ data.slave.indexReplicatedAtList = [];+ }++ if( !data.slave.replicationFailedAtList )+ {+ data.slave.replicationFailedAtList = [];+ }++ var iterations_element = $( '#iterations', replication_element );+ var iterations_list = $( '.iterations ul', iterations_element );++ var iterations_data = [];+ $.merge( iterations_data, data.slave.indexReplicatedAtList );+ $.merge( iterations_data, data.slave.replicationFailedAtList );++ if( 0 !== iterations_data.length )+ {+ var iterations = [];+ for( var i = 0; i < iterations_data.length; i++ )+ {+ iterations.push+ (+ '<li data-date="' + iterations_data[i] + '">' ++ iterations_data[i] + '</li>'+ );+ }++ iterations_list+ .html( iterations.join( "\n" ) )+ .show();++ $( data.slave.indexReplicatedAtList )+ .each+ (+ function( key, value )+ {+ $( 'li[data-date="' + value + '"]', iterations_list )+ .addClass( 'replicated' );+ }+ );++ if( data.slave.indexReplicatedAt )+ {+ $(+ 'li[data-date="' + data.slave.indexReplicatedAt + '"]',+ iterations_list+ )+ .addClass( 'latest' );+ }++ $( data.slave.replicationFailedAtList )+ .each+ (+ function( key, value )+ {+ $( 'li[data-date="' + value + '"]', iterations_list )+ .addClass( 'failed' );+ }+ );++ if( data.slave.replicationFailedAt )+ {+ $(+ 'li[data-date="' + data.slave.replicationFailedAt + '"]',+ iterations_list+ )+ .addClass( 'latest' );+ }++ if( 0 !== $( 'li:hidden', iterations_list ).size() )+ {+ $( 'a', iterations_element )+ .show();+ }+ else+ {+ $( 'a', iterations_element )+ .hide();+ }+ }+ }++ var details_element = $( '#details', replication_element );+ var current_type_element = $( ( is_slave ? '.slave' : '.master' ), details_element );++ $( '.version div', current_type_element )+ .html( data.indexVersion );+ $( '.generation div', current_type_element )+ .html( data.generation );+ $( '.size div', current_type_element )+ .html( data.indexSize );++ if( is_slave )+ {+ var master_element = $( '.master', details_element );+ $( '.version div', master_element )+ .html( data.slave.masterDetails.indexVersion );+ $( '.generation div', master_element )+ .html( data.slave.masterDetails.generation );+ $( '.size div', master_element )+ .html( data.slave.masterDetails.indexSize );++ if( data.indexVersion !== data.slave.masterDetails.indexVersion )+ {+ $( '.version', details_element )+ .addClass( 'diff' );+ }+ else+ {+ $( '.version', details_element )+ .removeClass( 'diff' );+ }++ if( data.generation !== data.slave.masterDetails.generation )+ {+ $( '.generation', details_element )+ .addClass( 'diff' );+ }+ else+ {+ $( '.generation', details_element )+ .removeClass( 'diff' );+ }+ }++ if( is_slave )+ {+ var settings_element = $( '#settings', replication_element );++ if( data.slave.masterUrl )+ {+ $( '.masterUrl dd', settings_element )+ .html( response.details.slave.masterUrl )+ .parents( 'li' ).show();+ }++ var polling_content = ' ';+ var polling_ico = 'ico-1';++ if( 'true' === data.slave.isPollingDisabled )+ {+ polling_ico = 'ico-0';++ $( '.disable-polling', navigation_element ).hide();+ $( '.enable-polling', navigation_element ).show();+ }+ else+ {+ $( '.disable-polling', navigation_element ).show();+ $( '.enable-polling', navigation_element ).hide();++ if( data.slave.pollInterval )+ {+ polling_content = '(interval: ' + data.slave.pollInterval + ')';+ }+ }++ $( '.isPollingDisabled dd', settings_element )+ .removeClass( 'ico-0' )+ .removeClass( 'ico-1' )+ .addClass( polling_ico )+ .html( polling_content )+ .parents( 'li' ).show();+ }++ var master_settings_element = $( '#master-settings', replication_element );++ var master_data = is_slave+ ? data.slave.masterDetails.master+ : data.master;++ var replication_icon = 'ico-0';+ if( 'true' === master_data.replicationEnabled )+ {+ replication_icon = 'ico-1';++ $( '.disable-replication', navigation_element ).show();+ $( '.enable-replication', navigation_element ).hide();+ }+ else+ {+ $( '.disable-replication', navigation_element ).hide();+ $( '.enable-replication', navigation_element ).show();+ }++ $( '.replicationEnabled dd', master_settings_element )+ .removeClass( 'ico-0' )+ .removeClass( 'ico-1' )+ .addClass( replication_icon )+ .parents( 'li' ).show();++ $( '.replicateAfter dd', master_settings_element )+ .html( master_data.replicateAfter.join( ', ' ) )+ .parents( 'li' ).show();++ if( master_data.confFiles )+ {+ var conf_files = [];+ var conf_data = master_data.confFiles.split( ',' );++ for( var i = 0; i < conf_data.length; i++ )+ {+ var item = conf_data[i];++ if( - 1 !== item.indexOf( ':' ) )+ {+ info = item.split( ':' );+ item = '<abbr title="' + info[0] + ' » ' + info[1] + '">'+ + ( is_slave ? info[1] : info[0] )+ + '</abbr>';+ }++ conf_files.push( item );+ }++ $( '.confFiles dd', master_settings_element )+ .html( conf_files.join( ', ' ) )+ .parents( 'li' ).show();+ }+++ $( '.block', replication_element ).last()+ .addClass( 'last' );+++++ if( 'true' === data.slave.isReplicating )+ {+ replication_element+ .addClass( 'replicating' );++ $( '.replicate-now', navigation_element ).hide();+ $( '.abort-replication', navigation_element ).show();++ window.setTimeout( replication_fetch_status, 1000 );+ }+ else+ {+ replication_element+ .removeClass( 'replicating' );++ $( '.replicate-now', navigation_element ).show();+ $( '.abort-replication', navigation_element ).hide();+ }+ },+ error : function( xhr, text_status, error_thrown )+ {+ console.debug( arguments );+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ replication_fetch_status();++ $( '#iterations a', content_element )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( this ).parents( '.iterations' )+ .toggleClass( 'expanded' );++ return false;+ }+ );++ $( 'button', navigation_element )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ var button = $( this );+ var command = button.data( 'command' );++ if( button.hasClass( 'refresh-status' ) && !button.hasClass( 'loader' ) )+ {+ replication_fetch_status();+ }+ else if( command )+ {+ $.get+ (+ core_basepath + '/replication?command=' + command + '&wt=json',+ function()+ {+ replication_fetch_status();+ }+ );+ }+ return false;+ }+ );+ }+ );+ }+ );++ this.bind+ (+ 'schema_browser_navi',+ function( event, params )+ {+ var related_navigation_element = $( '#related dl', params.schema_browser_element );+ var related_select_element = $( '#related select', params.schema_browser_element )+ var type = 'index';++ if( !params.route_params )+ {+ related_navigation_element+ .hide();++ $( 'option:selected', related_select_element )+ .removeAttr( 'selected' );+ }+ else+ {+ var type = params.route_params.splat[3];+ var value = params.route_params.splat[4];++ var navigation_data = {+ 'fields' : [],+ 'copyfield_source' : [],+ 'copyfield_dest' : [],+ 'dynamic_fields' : [],+ 'types' : []+ }++ $( 'option[value=' + params.route_params.splat[2] + ']', related_select_element )+ .attr( 'selected', 'selected' );++ if( 'field' === type )+ {+ navigation_data.fields.push( value );+ navigation_data.types.push( app.schema_browser_data.relations.f_t[value] );++ if( app.schema_browser_data.relations.f_df[value] )+ {+ navigation_data.dynamic_fields.push( app.schema_browser_data.relations.f_df[value] );+ }++ if( 0 !== app.schema_browser_data.fields[value].copySources.length )+ {+ navigation_data.copyfield_source = app.schema_browser_data.fields[value].copySources;+ }++ if( 0 !== app.schema_browser_data.fields[value].copyDests.length )+ {+ navigation_data.copyfield_dest = app.schema_browser_data.fields[value].copyDests;+ }+ }+ else if( 'dynamic-field' === type )+ {+ navigation_data.dynamic_fields.push( value );+ navigation_data.types.push( app.schema_browser_data.relations.df_t[value] );++ if( app.schema_browser_data.relations.df_f[value] )+ {+ navigation_data.fields = app.schema_browser_data.relations.df_f[value];+ }+ }+ else if( 'type' === type )+ {+ navigation_data.types.push( value );++ if( app.schema_browser_data.relations.t_f[value] )+ {+ navigation_data.fields = app.schema_browser_data.relations.t_f[value];+ }++ if( app.schema_browser_data.relations.t_df[value] )+ {+ navigation_data.dynamic_fields = app.schema_browser_data.relations.t_df[value];+ }+ }++ var sammy_basepath = '#/' + $( 'p a', params.active_core ).html() + '/schema-browser';+ var navigation_content = '';++ if( 0 !== navigation_data.fields.length )+ {+ navigation_data.fields.sort();+ navigation_content += '<dt class="field">Fields</dt>' + "\n";+ for( var i in navigation_data.fields )+ {+ var href = sammy_basepath + '/field/' + navigation_data.fields[i];+ navigation_content += '<dd class="field"><a href="' + href + '">' ++ navigation_data.fields[i] + '</a></dd>' + "\n";+ }+ }++ if( 0 !== navigation_data.copyfield_source.length )+ {+ navigation_data.copyfield_source.sort();+ navigation_content += '<dt class="copyfield">Copied from</dt>' + "\n";+ for( var i in navigation_data.copyfield_source )+ {+ var href = sammy_basepath + '/field/' + navigation_data.copyfield_source[i];+ navigation_content += '<dd class="copyfield"><a href="' + href + '">' ++ navigation_data.copyfield_source[i] + '</a></dd>' + "\n";+ }+ }++ if( 0 !== navigation_data.copyfield_dest.length )+ {+ navigation_data.copyfield_dest.sort();+ navigation_content += '<dt class="copyfield">Copied to</dt>' + "\n";+ for( var i in navigation_data.copyfield_dest )+ {+ var href = sammy_basepath + '/field/' + navigation_data.copyfield_dest[i];+ navigation_content += '<dd class="copyfield"><a href="' + href + '">' ++ navigation_data.copyfield_dest[i] + '</a></dd>' + "\n";+ }+ }++ if( 0 !== navigation_data.dynamic_fields.length )+ {+ navigation_data.dynamic_fields.sort();+ navigation_content += '<dt class="dynamic-field">Dynamic Fields</dt>' + "\n";+ for( var i in navigation_data.dynamic_fields )+ {+ var href = sammy_basepath + '/dynamic-field/' + navigation_data.dynamic_fields[i];+ navigation_content += '<dd class="dynamic-field"><a href="' + href + '">' ++ navigation_data.dynamic_fields[i] + '</a></dd>' + "\n";+ }+ }++ if( 0 !== navigation_data.types.length )+ {+ navigation_data.types.sort();+ navigation_content += '<dt class="type">Types</dt>' + "\n";+ for( var i in navigation_data.types )+ {+ var href = sammy_basepath + '/type/' + navigation_data.types[i];+ navigation_content += '<dd class="type"><a href="' + href + '">' ++ navigation_data.types[i] + '</a></dd>' + "\n";+ }+ }++ related_navigation_element+ .show()+ .attr( 'class', type )+ .html( navigation_content );+ }++ $.get+ (+ 'tpl/schema-browser_'+ type + '.html',+ function( template )+ {+ var data_element = $( '#data', params.schema_browser_element );++ data_element+ .html( template );++ params.callback( app.schema_browser_data, data_element );+ }+ );+ }+ );++ this.bind+ (+ 'schema_browser_load',+ function( event, params )+ {+ var core_basepath = params.active_core.attr( 'data-basepath' );+ var content_element = $( '#content' );++ if( app.schema_browser_data )+ {+ params.schema_browser_element = $( '#schema-browser', content_element );++ sammy.trigger+ (+ 'schema_browser_navi',+ params+ );+ }+ else+ {+ content_element+ .html( '<div id="schema-browser"><div class="loader">Loading ...</div></div>' );++ $.ajax+ (+ {+ url : core_basepath + '/admin/luke?numTerms=50&wt=json',+ dataType : 'json',+ beforeSend : function( xhr, settings )+ {+ },+ success : function( response, text_status, xhr )+ {+ app.schema_browser_data = {+ default_search_field : null,+ unique_key_field : null,+ key : {},+ fields : {},+ dynamic_fields : {},+ types : {},+ relations : {+ f_df : {},+ f_t : {},+ df_f : {},+ df_t : {},+ t_f : {},+ t_df : {}+ }+ };++ app.schema_browser_data.fields = response.fields;+ app.schema_browser_data.key = response.info.key;++ $.ajax+ (+ {+ url : core_basepath + '/admin/luke?show=schema&wt=json',+ dataType : 'json',+ beforeSend : function( xhr, settings )+ {+ },+ success : function( response, text_status, xhr )+ {+ app.schema_browser_data.default_search_field = response.schema.defaultSearchField;+ app.schema_browser_data.unique_key_field = response.schema.uniqueKeyField;++ app.schema_browser_data.dynamic_fields = response.schema.dynamicFields;+ app.schema_browser_data.types = response.schema.types;++ var luke_array_to_struct = function( array )+ {+ var struct = {+ keys : [],+ values : []+ };+ for( var i = 0; i < array.length; i += 2 )+ {+ struct.keys.push( array[i] );+ struct.values.push( array[i+1] );+ }+ return struct;+ }++ var luke_array_to_hash = function( array )+ {+ var hash = {};+ for( var i = 0; i < array.length; i += 2 )+ {+ hash[ array[i] ] = array[i+1];+ }+ return hash;+ }++ for( var field in response.schema.fields )+ {+ app.schema_browser_data.fields[field] = $.extend+ (+ {},+ app.schema_browser_data.fields[field],+ response.schema.fields[field]+ );+ }++ for( var field in app.schema_browser_data.fields )+ {+ app.schema_browser_data.fields[field].copySourcesRaw = null;++ if( app.schema_browser_data.fields[field].copySources &&+ 0 !== app.schema_browser_data.fields[field].copySources.length )+ {+ app.schema_browser_data.fields[field].copySourcesRaw =+ app.schema_browser_data.fields[field].copySources;+ }++ app.schema_browser_data.fields[field].copyDests = [];+ app.schema_browser_data.fields[field].copySources = [];+ }++ for( var field in app.schema_browser_data.fields )+ {+ if( app.schema_browser_data.fields[field].histogram )+ {+ var histogram = app.schema_browser_data.fields[field].histogram;++ app.schema_browser_data.fields[field].histogram =+ luke_array_to_struct( histogram );++ app.schema_browser_data.fields[field].histogram_hash =+ luke_array_to_hash( histogram );+ }++ if( app.schema_browser_data.fields[field].topTerms )+ {+ var top_terms = app.schema_browser_data.fields[field].topTerms;++ app.schema_browser_data.fields[field].topTerms =+ luke_array_to_struct( top_terms );++ app.schema_browser_data.fields[field].topTerms_hash =+ luke_array_to_hash( top_terms );+ }++ if( app.schema_browser_data.fields[field].copySourcesRaw )+ {+ var copy_sources = app.schema_browser_data.fields[field].copySourcesRaw;+ for( var i in copy_sources )+ {+ var target = copy_sources[i].replace( /^.+:(.+)\{.+$/, '$1' );++ app.schema_browser_data.fields[field].copySources.push( target );+ app.schema_browser_data.fields[target].copyDests.push( field );+ }+ }++ app.schema_browser_data.relations.f_t[field] = app.schema_browser_data.fields[field].type;++ if( !app.schema_browser_data.relations.t_f[app.schema_browser_data.fields[field].type] )+ {+ app.schema_browser_data.relations.t_f[app.schema_browser_data.fields[field].type] = [];+ }+ app.schema_browser_data.relations.t_f[app.schema_browser_data.fields[field].type].push( field );++ if( app.schema_browser_data.fields[field].dynamicBase )+ {+ app.schema_browser_data.relations.f_df[field] = app.schema_browser_data.fields[field].dynamicBase;++ if( !app.schema_browser_data.relations.df_f[app.schema_browser_data.fields[field].dynamicBase] )+ {+ app.schema_browser_data.relations.df_f[app.schema_browser_data.fields[field].dynamicBase] = [];+ }+ app.schema_browser_data.relations.df_f[app.schema_browser_data.fields[field].dynamicBase].push( field );+ }+ }++ for( var dynamic_field in app.schema_browser_data.dynamic_fields )+ {+ app.schema_browser_data.relations.df_t[dynamic_field] = app.schema_browser_data.dynamic_fields[dynamic_field].type;++ if( !app.schema_browser_data.relations.t_df[app.schema_browser_data.dynamic_fields[dynamic_field].type] )+ {+ app.schema_browser_data.relations.t_df[app.schema_browser_data.dynamic_fields[dynamic_field].type] = [];+ }+ app.schema_browser_data.relations.t_df[app.schema_browser_data.dynamic_fields[dynamic_field].type].push( dynamic_field );+ }++ $.get+ (+ 'tpl/schema-browser.html',+ function( template )+ {+ content_element+ .html( template );++ var schema_browser_element = $( '#schema-browser', content_element );+ var related_element = $( '#related', schema_browser_element );+ var related_select_element = $( 'select', related_element );+ var data_element = $( '#data', schema_browser_element );++ var related_options = '';++ var fields = [];+ for( var field_name in app.schema_browser_data.fields )+ {+ fields.push+ (+ '<option value="/field/' + field_name + '">' + field_name + '</option>'+ );+ }+ if( 0 !== fields.length )+ {+ fields.sort();+ related_options += '<optgroup label="Fields">' + "\n";+ related_options += fields.join( "\n" ) + "\n";+ related_options += '</optgroup>' + "\n";+ }++ var dynamic_fields = [];+ for( var type_name in app.schema_browser_data.dynamic_fields )+ {+ dynamic_fields.push+ (+ '<option value="/dynamic-field/' + type_name + '">' + type_name + '</option>'+ );+ }+ if( 0 !== dynamic_fields.length )+ {+ dynamic_fields.sort();+ related_options += '<optgroup label="DynamicFields">' + "\n";+ related_options += dynamic_fields.join( "\n" ) + "\n";+ related_options += '</optgroup>' + "\n";+ }++ var types = [];+ for( var type_name in app.schema_browser_data.types )+ {+ types.push+ (+ '<option value="/type/' + type_name + '">' + type_name + '</option>'+ );+ }+ if( 0 !== types.length )+ {+ types.sort();+ related_options += '<optgroup label="Types">' + "\n";+ related_options += types.join( "\n" ) + "\n";+ related_options += '</optgroup>' + "\n";+ }++ related_select_element+ .attr( 'rel', '#/' + $( 'p a', params.active_core ).html() + '/schema-browser' )+ .append( related_options );++ related_select_element+ .die( 'change' )+ .live+ (+ 'change',+ function( event )+ {+ var select_element = $( this );+ var option_element = $( 'option:selected', select_element );++ location.href = select_element.attr( 'rel' ) + option_element.val();+ return false;+ }+ );++ params.schema_browser_element = schema_browser_element;+ sammy.trigger+ (+ 'schema_browser_navi',+ params+ );+ }+ );+ },+ error : function( xhr, text_status, error_thrown)+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );++ },+ error : function( xhr, text_status, error_thrown)+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ }+ );++ // #/:core/schema-browser+ this.get+ (+ /^#\/([\w\d]+)\/(schema-browser)$/,+ function( context )+ {+ var callback = function( schema_browser_data, data_element )+ {+ var sammy_basepath = '#/' + $( 'p a', context.active_core ).html() + '/schema-browser'++ if( schema_browser_data.unique_key_field )+ {+ $( '.unique-key-field', data_element )+ .show()+ .after( '<dd><a href="' + sammy_basepath + '/field/' + schema_browser_data.unique_key_field + '">' + schema_browser_data.unique_key_field + '</a></dd>' );+ }++ if( schema_browser_data.default_search_field )+ {+ $( '.default-search-field', data_element )+ .show()+ .after( '<dd><a href="' + sammy_basepath + '/field/' + schema_browser_data.default_search_field + '">' + schema_browser_data.default_search_field + '</a></dd>' );+ }+ }++ sammy.trigger+ (+ 'schema_browser_load',+ {+ callback : callback,+ active_core : this.active_core+ }+ );+ }+ );++ // #/:core/schema-browser/field/$field+ this.get+ (+ /^#\/([\w\d]+)\/(schema-browser)(\/(field)\/(.+))$/,+ function( context )+ {+ var callback = function( schema_browser_data, data_element )+ {+ var field = context.params.splat[4];++ var options_element = $( '.options', data_element );+ var sammy_basepath = '#/' + $( 'p a', context.active_core ).html() + '/schema-browser'++ var keystring_to_list = function( keystring )+ {+ var key_list = keystring.replace( /-/g, '' ).split( '' );+ var list = [];++ for( var i in key_list )+ {+ var option_key = schema_browser_data.key[key_list[i]];++ if( !option_key )+ {+ option_key = schema_browser_data.key[key_list[i].toLowerCase()];+ }++ if( !option_key )+ {+ option_key = schema_browser_data.key[key_list[i].toUpperCase()];+ }++ if( option_key )+ {+ list.push( '<dd>' + option_key + ',</dd>' );+ }+ }++ list[list.length-1] = list[key_list.length-1].replace( /,/, '' );++ return list;+ }++ // -- properties+ if( schema_browser_data.fields[field].flags )+ {+ var properties_element = $( '.properties', options_element );+ var properties_keys = keystring_to_list( schema_browser_data.fields[field].flags );++ properties_element+ .show()+ .after( properties_keys.join( "\n" ) );+ }++ // -- schema+ if( schema_browser_data.fields[field].schema )+ {+ var schema_element = $( '.schema', options_element );+ var schema_keys = keystring_to_list( schema_browser_data.fields[field].schema );++ schema_element+ .show()+ .after( schema_keys.join( "\n" ) );+ }++ // -- index+ if( schema_browser_data.fields[field].index )+ {+ var index_element = $( '.index', options_element );+ var index_keys = [];++ if( 0 === schema_browser_data.fields[field].index.indexOf( '(' ) )+ {+ index_keys.push( '<dd>' + schema_browser_data.fields[field].index + '</dd>' );+ }+ else+ {+ index_keys = keystring_to_list( schema_browser_data.fields[field].index );+ }++ index_element+ .show()+ .after( index_keys.join( "\n" ) );+ }++ // -- docs+ if( schema_browser_data.fields[field].docs )+ {+ var docs_element = $( '.docs', options_element );++ docs_element+ .show()+ .after( '<dd>' + schema_browser_data.fields[field].docs + '</dd>' );+ }++ // -- distinct+ if( schema_browser_data.fields[field].distinct )+ {+ var distinct_element = $( '.distinct', options_element );++ distinct_element+ .show()+ .after( '<dd>' + schema_browser_data.fields[field].distinct + '</dd>' );+ }++ // -- position-increment-gap+ if( schema_browser_data.fields[field].positionIncrementGap )+ {+ var pig_element = $( '.position-increment-gap', options_element );++ pig_element+ .show()+ .after( '<dd>' + schema_browser_data.fields[field].positionIncrementGap + '</dd>' );+ }++ var analyzer_data = schema_browser_data.types[schema_browser_data.relations.f_t[field]];+ var analyzer_element = $( '.analyzer', data_element );++ var transform_analyzer_data_into_list = function( analyzer_data )+ {+ var args = [];+ for( var key in analyzer_data.args )+ {+ var arg_class = '';+ var arg_content = '';++ if( 'true' === analyzer_data.args[key] || '1' === analyzer_data.args[key] )+ {+ arg_class = 'ico-1';+ arg_content = key;+ }+ else if( 'false' === analyzer_data.args[key] || '0' === analyzer_data.args[key] )+ {+ arg_class = 'ico-0';+ arg_content = key;+ }+ else+ {+ arg_content = key + ': ';++ if( 'synonyms' === key || 'words' === key )+ {+ // @TODO: set link target for file+ arg_content += '<a>' + analyzer_data.args[key] + '</a>';+ }+ else+ {+ arg_content += analyzer_data.args[key];+ }+ }++ args.push( '<dd class="' + arg_class + '">' + arg_content + '</dd>' );+ }++ var list_content = '<dt>' + analyzer_data.className + '</dt>';+ if( 0 !== args.length )+ {+ args.sort();+ list_content += args.join( "\n" );+ }++ return list_content;+ }++ // -- field-type+ var field_type_element = $( '.field-type', options_element );++ field_type_element+ .show()+ .after( '<dd>' + analyzer_data.className + '</dd>' );+++ for( var key in analyzer_data )+ {+ var key_match = key.match( /^(.+)Analyzer$/ );+ if( !key_match )+ {+ continue;+ }++ var analyzer_key_element = $( '.' + key_match[1], analyzer_element );+ var analyzer_key_data = analyzer_data[key];++ analyzer_element.show();+ analyzer_key_element.show();++ if( analyzer_key_data.className )+ {+ $( 'dl:first dt', analyzer_key_element )+ .html( analyzer_key_data.className );+ }++ for( var type in analyzer_key_data )+ {+ if( 'object' !== typeof analyzer_key_data[type] )+ {+ continue;+ }++ var type_element = $( '.' + type, analyzer_key_element );+ var type_content = [];++ type_element.show();++ if( analyzer_key_data[type].className )+ {+ type_content.push( transform_analyzer_data_into_list( analyzer_key_data[type] ) );+ }+ else+ {+ for( var entry in analyzer_key_data[type] )+ {+ type_content.push( transform_analyzer_data_into_list( analyzer_key_data[type][entry] ) );+ }+ }++ $( 'dl', type_element )+ .append( type_content.join( "\n" ) );+ }+ }+++ var topterms_holder_element = $( '.topterms-holder', data_element );+ if( !schema_browser_data.fields[field].topTerms_hash )+ {+ topterms_holder_element+ .hide();+ }+ else+ {+ topterms_holder_element+ .show();++ var topterms_table_element = $( 'table', topterms_holder_element );++ var topterms_navi_less = $( 'p.navi .less', topterms_holder_element );+ var topterms_navi_more = $( 'p.navi .more', topterms_holder_element );++ var topterms_count = schema_browser_data.fields[field].topTerms.keys.length;+ var topterms_hash = schema_browser_data.fields[field].topTerms_hash;+ var topterms_content = '<tbody>';++ var i = 1;+ for( var term in topterms_hash )+ {+ topterms_content += '<tr>' + "\n" ++ '<td class="position">' + i + '</td>' + "\n" ++ '<td class="term">' + term + '</td>' + "\n" ++ '<td class="frequency">' + topterms_hash[term] + '</td>' + "\n" ++ '</tr>' + "\n";++ if( i !== topterms_count && 0 === i % 10 )+ {+ topterms_content += '</tbody><tbody>';+ }++ i++;+ }++ topterms_content += '</tbody>';++ topterms_table_element+ .append( topterms_content );++ $( 'tbody', topterms_table_element )+ .die( 'change' )+ .live+ (+ 'change',+ function()+ {+ var blocks = $( 'tbody', topterms_table_element );+ var visible_blocks = blocks.filter( ':visible' );+ var hidden_blocks = blocks.filter( ':hidden' );++ $( 'p.head .shown', topterms_holder_element )+ .html( $( 'tr', visible_blocks ).size() );++ 0 < hidden_blocks.size()+ ? topterms_navi_more.show()+ : topterms_navi_more.hide();++ 1 < visible_blocks.size()+ ? topterms_navi_less.show()+ : topterms_navi_less.hide();+ }+ );++ $( 'tbody tr:odd', topterms_table_element )+ .addClass( 'odd' );++ $( 'tbody:first', topterms_table_element )+ .show()+ .trigger( 'change' );++ $( 'p.head .max', topterms_holder_element )+ .html( schema_browser_data.fields[field].distinct );++ topterms_navi_less+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( 'tbody:visible', topterms_table_element ).last()+ .hide()+ .trigger( 'change' );+ }+ );++ topterms_navi_more+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( 'tbody:hidden', topterms_table_element ).first()+ .show()+ .trigger( 'change' );+ }+ );+ }++ var histogram_holder_element = $( '.histogram-holder', data_element );+ if( !schema_browser_data.fields[field].histogram_hash )+ {+ histogram_holder_element+ .hide();+ }+ else+ {+ histogram_holder_element+ .show();++ var histogram_element = $( '.histogram', histogram_holder_element );++ var histogram_values = schema_browser_data.fields[field].histogram_hash;+ var histogram_legend = '';++ histogram_holder_element+ .show();++ for( var key in histogram_values )+ {+ histogram_legend += '<dt><span>' + key + '</span></dt>' + "\n" ++ '<dd title="' + key + '">' ++ '<span>' + histogram_values[key] + '</span>' ++ '</dd>' + "\n";+ }++ $( 'dl', histogram_holder_element )+ .html( histogram_legend );++ histogram_element+ .sparkline+ (+ schema_browser_data.fields[field].histogram.values,+ {+ type : 'bar',+ barColor : '#c0c0c0',+ zeroColor : '#ffffff',+ height : histogram_element.height(),+ barWidth : 46,+ barSpacing : 3+ }+ );+ }+ }++ sammy.trigger+ (+ 'schema_browser_load',+ {+ callback : callback,+ active_core : this.active_core,+ route_params : this.params+ }+ );+ }+ );++ // #/:core/schema-browser/dynamic-field/$field+ this.get+ (+ /^#\/([\w\d]+)\/(schema-browser)(\/(dynamic-field)\/(.+))$/,+ function( context )+ {+ var callback = function( schema_browser_data, data_element )+ {+ console.debug( data_element );+ }++ sammy.trigger+ (+ 'schema_browser_load',+ {+ callback : callback,+ active_core : this.active_core,+ route_params : this.params+ }+ );+ }+ );++ // #/:core/schema-browser/type/$type+ this.get+ (+ /^#\/([\w\d]+)\/(schema-browser)(\/(type)\/(.+))$/,+ function( context )+ {+ var callback = function( schema_browser_data, data_element )+ {+ console.debug( data_element );+ }++ sammy.trigger+ (+ 'schema_browser_load',+ {+ callback : callback,+ active_core : this.active_core,+ route_params : this.params+ }+ );+ }+ );++ this.bind+ (+ 'dataimport_queryhandler_load',+ function( event, params )+ {+ var core_basepath = params.active_core.attr( 'data-basepath' );++ $.ajax+ (+ {+ url : core_basepath + '/admin/mbeans?cat=QUERYHANDLER&wt=json',+ dataType : 'json',+ beforeSend : function( xhr, settings )+ {+ },+ success : function( response, text_status, xhr )+ {+ var handlers = response['solr-mbeans'][1];+ var dataimport_handlers = [];+ for( var key in handlers )+ {+ if( handlers[key].class !== key &&+ handlers[key].class === 'org.apache.solr.handler.dataimport.DataImportHandler' )+ {+ dataimport_handlers.push( key );+ }+ }+ params.callback( dataimport_handlers );+ },+ error : function( xhr, text_status, error_thrown)+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ );++ // #/:core/dataimport+ this.get+ (+ /^#\/([\w\d]+)\/dataimport$/,+ function( context )+ {+ sammy.trigger+ (+ 'dataimport_queryhandler_load',+ {+ active_core : this.active_core,+ callback : function( dataimport_handlers )+ {+ context.redirect( context.path + '/' + dataimport_handlers[0] );+ }+ }+ );+ }+ );++ // #/:core/dataimport+ this.get+ (+ /^#\/([\w\d]+)\/dataimport\//,+ function( context )+ {+ var core_basepath = this.active_core.attr( 'data-basepath' );+ var content_element = $( '#content' );++ var path_parts = this.path.match( /^(.+\/dataimport\/)(.*)$/ );+ var current_handler = path_parts[2];++ $( 'li.dataimport', this.active_core )+ .addClass( 'active' );++ $.get+ (+ 'tpl/dataimport.html',+ function( template )+ {+ content_element+ .html( template );++ var dataimport_element = $( '#dataimport', content_element );+ var form_element = $( '#form', dataimport_element );+ var config_element = $( '#config', dataimport_element );+ var config_error_element = $( '#config-error', dataimport_element );++ // handler++ sammy.trigger+ (+ 'dataimport_queryhandler_load',+ {+ active_core : context.active_core,+ callback : function( dataimport_handlers )+ {+ var handlers_element = $( '.handler', form_element );+ var handlers = [];++ for( var i = 0; i < dataimport_handlers.length; i++ )+ {+ handlers.push+ (+ '<li><a href="' + path_parts[1] + dataimport_handlers[i] + '">' ++ dataimport_handlers[i] ++ '</a></li>'+ );+ }++ $( 'ul', handlers_element )+ .html( handlers.join( "\n") ) ;++ $( 'a[href=' + context.path + ']', handlers_element ).parent()+ .addClass( 'active' );++ handlers_element+ .show();+ }+ }+ );++ // config++ function dataimport_fetch_config()+ {+ $.ajax+ (+ {+ url : core_basepath + '/select?qt=' + current_handler + '&command=show-config',+ dataType : 'xml',+ context : $( '#dataimport_config', config_element ),+ beforeSend : function( xhr, settings )+ {+ },+ success : function( config, text_status, xhr )+ {+ dataimport_element+ .removeClass( 'error' );++ config_error_element+ .hide();++ config_element+ .addClass( 'hidden' );+++ var entities = [];++ $( 'document > entity', config )+ .each+ (+ function( i, element )+ {+ entities.push( '<option>' + $( element ).attr( 'name' ) + '</option>' );+ }+ );++ $( '#entity', form_element )+ .append( entities.join( "\n" ) );+ },+ error : function( xhr, text_status, error_thrown )+ {+ if( 'parsererror' === error_thrown )+ {+ dataimport_element+ .addClass( 'error' );++ config_error_element+ .show();++ config_element+ .removeClass( 'hidden' );+ }+ },+ complete : function( xhr, text_status )+ {+ var code = $(+ '<pre class="syntax language-xml"><code>' ++ xhr.responseText.replace( /\</g, '<' ).replace( /\>/g, '>' ) ++ '</code></pre>'+ );+ this.html( code );++ if( 'success' === text_status )+ {+ hljs.highlightBlock( code.get(0) );+ }+ }+ }+ );+ }+ dataimport_fetch_config();++ $( '.toggle', config_element )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( this ).parents( '.block' )+ .toggleClass( 'hidden' );++ return false;+ }+ )++ var reload_config_element = $( '.reload_config', config_element );+ reload_config_element+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $.ajax+ (+ {+ url : core_basepath + '/select?qt=' + current_handler + '&command=reload-config',+ dataType : 'xml',+ context: $( this ),+ beforeSend : function( xhr, settings )+ {+ this+ .addClass( 'loader' );+ },+ success : function( response, text_status, xhr )+ {+ this+ .addClass( 'success' );++ window.setTimeout+ (+ function()+ {+ reload_config_element+ .removeClass( 'success' );+ },+ 5000+ );+ },+ error : function( xhr, text_status, error_thrown )+ {+ this+ .addClass( 'error' );+ },+ complete : function( xhr, text_status )+ {+ this+ .removeClass( 'loader' );++ dataimport_fetch_config();+ }+ }+ );+ return false;+ }+ )++ // state++ function dataimport_fetch_status()+ {+ $.ajax+ (+ {+ url : core_basepath + '/select?qt=' + current_handler + '&command=status',+ dataType : 'xml',+ beforeSend : function( xhr, settings )+ {+ },+ success : function( response, text_status, xhr )+ {+ var state_element = $( '#current_state', content_element );++ var status = $( 'str[name="status"]', response ).text();+ var rollback_element = $( 'str[name="Rolledback"]', response );+ var messages_count = $( 'lst[name="statusMessages"] str', response ).size();++ var started_at = $( 'str[name="Full Dump Started"]', response ).text();+ if( !started_at )+ {+ started_at = (new Date()).toGMTString();+ }+ console.debug( 'started_at @ ', started_at );++ function dataimport_compute_details( response, details_element )+ {+ var details = [];+++ console.debug( 'elapsed @ ', $( 'str[name="Time Elapsed"]', response ).text() );+ console.debug( 'taken @ ', $( 'str[name="Time taken "]', response ).text() );+ console.debug( 'requests @ ', $( 'str[name="Total Requests made to DataSource"]', response ).text() );+ console.debug( 'fetched @ ', $( 'str[name="Total Rows Fetched"]', response ).text() );+ console.debug( 'skipped @ ', $( 'str[name="Total Documents Skipped"]', response ).text() );+ console.debug( 'processed @ ', $( 'str[name="Total Documents Processed"]', response ).text() );++ var requests = parseInt( $( 'str[name="Total Requests made to DataSource"]', response ).text() );+ if( NaN !== requests )+ {+ details.push+ (+ '<abbr title="Total Requests made to DataSource">Requests</abbr>: ' ++ requests+ );+ }++ var fetched = parseInt( $( 'str[name="Total Rows Fetched"]', response ).text() );+ if( NaN !== fetched )+ {+ details.push+ (+ '<abbr title="Total Rows Fetched">Fetched</abbr>: ' ++ fetched+ );+ }++ var skipped = parseInt( $( 'str[name="Total Documents Skipped"]', response ).text() );+ if( NaN !== requests )+ {+ details.push+ (+ '<abbr title="Total Documents Skipped">Skipped</abbr>: ' ++ skipped+ );+ }++ var processed = parseInt( $( 'str[name="Total Documents Processed"]', response ).text() );+ if( NaN !== processed )+ {+ details.push+ (+ '<abbr title="Total Documents Processed">Processed</abbr>: ' ++ processed+ );+ }++ details_element+ .html( details.join( ', ' ) );+ }++ state_element+ .removeClass( 'indexing' )+ .removeClass( 'success' )+ .removeClass( 'failure' );++ $( '.info', state_element )+ .removeClass( 'loader' );++ if( 0 !== rollback_element.size() )+ {+ state_element+ .addClass( 'failure' )+ .show();++ $( '.info strong', state_element )+ .text( $( 'str[name=""]', response ).text() );++ console.debug( 'failure' );+ console.debug( 'rollback @ ', rollback_element.text() );+ }+ else if( 'idle' === status && 0 !== messages_count )+ {+ state_element+ .addClass( 'success' )+ .show();++ $( '.time', state_element )+ .text( started_at )+ .timeago();++ $( '.info strong', state_element )+ .text( $( 'str[name=""]', response ).text() );++ console.debug( 'success' );+ dataimport_compute_details( response, $( '.info .details', state_element ) );+ }+ else if( 'busy' === status )+ {+ state_element+ .addClass( 'indexing' )+ .show();++ $( '.time', state_element )+ .text( started_at )+ .timeago();++ $( '.info', state_element )+ .addClass( 'loader' );++ $( '.info strong', state_element )+ .text( 'Indexing ...' );++ console.debug( 'indexing' );+ dataimport_compute_details( response, $( '.info .details', state_element ) );++ window.setTimeout( dataimport_fetch_status, 2000 );+ }+ else+ {+ state_element.hide();+ }+ },+ error : function( xhr, text_status, error_thrown )+ {+ console.debug( arguments );+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ dataimport_fetch_status();++ // form++ $( 'form', form_element )+ .die( 'submit' )+ .live+ (+ 'submit',+ function( event )+ {+ $.ajax+ (+ {+ url : core_basepath + '/select?qt=' + current_handler + '&command=full-import',+ dataType : 'xml',+ beforeSend : function( xhr, settings )+ {+ },+ success : function( response, text_status, xhr )+ {+ console.debug( response );+ dataimport_fetch_status();+ },+ error : function( xhr, text_status, error_thrown )+ {+ console.debug( arguments );+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ return false;+ }+ );+ }+ );+ }+ );++ // #/:core/info(/stats)+ this.get+ (+ /^#\/([\w\d]+)\/info/,+ function( context )+ {+ var core_basepath = this.active_core.attr( 'data-basepath' );+ var content_element = $( '#content' );+ var show_stats = 0 <= this.path.indexOf( 'stats' );++ if( show_stats )+ {+ $( 'li.stats', this.active_core )+ .addClass( 'active' );+ }+ else+ {+ $( 'li.plugins', this.active_core )+ .addClass( 'active' );+ }++ content_element+ .html( '<div id="plugins"></div>' );++ $.ajax+ (+ {+ url : core_basepath + '/admin/mbeans?stats=true&wt=json',+ dataType : 'json',+ context : $( '#plugins', content_element ),+ beforeSend : function( xhr, settings )+ {+ this+ .html( '<div class="loader">Loading ...</div>' );+ },+ success : function( response, text_status, xhr )+ {+ var sort_table = {};+ var content = '';++ response.plugins = {};+ var plugin_key = null;++ for( var i = 0; i < response['solr-mbeans'].length; i++ )+ {+ if( !( i % 2 ) )+ {+ plugin_key = response['solr-mbeans'][i];+ }+ else+ {+ response.plugins[plugin_key] = response['solr-mbeans'][i];+ }+ }++ for( var key in response.plugins )+ {+ sort_table[key] = {+ url : [],+ component : [],+ handler : []+ };+ for( var part_key in response.plugins[key] )+ {+ if( 0 < part_key.indexOf( '.' ) )+ {+ sort_table[key]['handler'].push( part_key );+ }+ else if( 0 === part_key.indexOf( '/' ) )+ {+ sort_table[key]['url'].push( part_key );+ }+ else+ {+ sort_table[key]['component'].push( part_key );+ }+ }++ content += '<div class="block" id="' + key.toLowerCase() + '">' + "\n";+ content += '<h2><span>' + key + '</span></h2>' + "\n";+ content += '<div class="content">' + "\n";+ content += '<ul>' + "\n";++ for( var sort_key in sort_table[key] )+ {+ sort_table[key][sort_key].sort();+ var sort_key_length = sort_table[key][sort_key].length;++ for( var i = 0; i < sort_key_length; i++ )+ {+ content += '<li class="entry"><a>' + sort_table[key][sort_key][i] + '</a>' + "\n";+ content += '<ul class="detail">' + "\n";++ var details = response.plugins[key][ sort_table[key][sort_key][i] ];+ for( var detail_key in details )+ {+ if( 'stats' !== detail_key )+ {+ var detail_value = details[detail_key];++ if( 'description' === detail_key )+ {+ detail_value = detail_value.replace( /,/g, ',​' );+ }+ else if( 'src' === detail_key )+ {+ detail_value = detail_value.replace( /\//g, '/​' );+ }++ content += '<li><dl class="clearfix">' + "\n";+ content += '<dt>' + detail_key + ':</dt>' + "\n";+ content += '<dd>' + detail_value + '</dd>' + "\n";+ content += '</dl></li>' + "\n";+ }+ else if( 'stats' === detail_key && details[detail_key] && show_stats )+ {+ content += '<li class="stats clearfix">' + "\n";+ content += '<span>' + detail_key + ':</span>' + "\n";+ content += '<ul>' + "\n";++ for( var stats_key in details[detail_key] )+ {+ var stats_value = details[detail_key][stats_key];++ if( 'readerDir' === stats_key )+ {+ stats_value = stats_value.replace( /@/g, '@​' );+ }++ content += '<li><dl class="clearfix">' + "\n";+ content += '<dt>' + stats_key + ':</dt>' + "\n";+ content += '<dd>' + stats_value + '</dd>' + "\n";+ content += '</dl></li>' + "\n";+ }++ content += '</ul></li>' + "\n";+ }+ }++ content += '</ul>' + "\n";+ }+ }++ content += '</ul>' + "\n";+ content += '</div>' + "\n";+ content += '</div>' + "\n";+ }++ this+ .html( content );++ $( '.block a', this )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( this ).parent()+ .toggleClass( 'expanded' );+ }+ );++ $( '.entry', this )+ .each+ (+ function( i, entry )+ {+ $( '.detail > li', entry ).not( '.stats' ).filter( ':even' )+ .addClass( 'odd' );++ $( '.stats li:odd', entry )+ .addClass( 'odd' );+ }+ );+ },+ error : function( xhr, text_status, error_thrown)+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );++ }+ );++ // #/:core/query+ this.get+ (+ /^#\/([\w\d]+)\/query$/,+ function( context )+ {+ var core_basepath = this.active_core.attr( 'data-basepath' );+ var content_element = $( '#content' );++ $( 'li.query', this.active_core )+ .addClass( 'active' );++ $.get+ (+ 'tpl/query.html',+ function( template )+ {+ content_element+ .html( template );++ var query_element = $( '#query', content_element );+ var query_form = $( '#form form', query_element );+ var url_element = $( '#url input', query_element );+ var result_element = $( '#result', query_element );+ var response_element = $( '#response iframe', result_element );++ url_element+ .die( 'change' )+ .live+ (+ 'change',+ function( event )+ {+ var check_iframe_ready_state = function()+ {+ var iframe_element = response_element.get(0).contentWindow.document ||+ response_element.get(0).document;++ if( !iframe_element )+ {+ console.debug( 'no iframe_element found', response_element );+ return false;+ }++ url_element+ .addClass( 'loader' );++ if( 'complete' === iframe_element.readyState )+ {+ url_element+ .removeClass( 'loader' );+ }+ else+ {+ window.setTimeout( check_iframe_ready_state, 100 );+ }+ }+ check_iframe_ready_state();++ response_element+ .attr( 'src', this.value )++ if( !response_element.hasClass( 'resized' ) )+ {+ response_element+ .addClass( 'resized' )+ .css( 'height', $( '#main' ).height() - 60 );+ }+ }+ )++ $( '.optional legend input[type=checkbox]', query_form )+ .die( 'change' )+ .live+ (+ 'change',+ function( event )+ {+ var fieldset = $( this ).parents( 'fieldset' );++ this.checked+ ? fieldset.addClass( 'expanded' )+ : fieldset.removeClass( 'expanded' );+ }+ )++ query_form+ .die( 'submit' )+ .live+ (+ 'submit',+ function( event )+ {+ var query_url = window.location.protocol + '//' ++ window.location.host ++ core_basepath ++ '/select?' ++ query_form.formSerialize();++ url_element+ .val( query_url )+ .trigger( 'change' );++ result_element+ .show();++ return false;+ }+ );+ }+ );+ }+ );++ // #/:core/analysis+ this.get+ (+ /^#\/([\w\d]+)\/analysis$/,+ function( context )+ {+ var core_basepath = this.active_core.attr( 'data-basepath' );+ var content_element = $( '#content' );++ $( 'li.analysis', this.active_core )+ .addClass( 'active' );++ $.get+ (+ 'tpl/analysis.html',+ function( template )+ {+ content_element+ .html( template );++ var analysis_element = $( '#analysis', content_element );+ var analysis_form = $( 'form', analysis_element );++ $.ajax+ (+ {+ url : core_basepath + '/admin/luke?wt=json&show=schema',+ dataType : 'json',+ context : $( '#type_or_name', analysis_form ),+ beforeSend : function( xhr, settings )+ {+ this+ .html( '<option value="">Loading ... </option>' )+ .addClass( 'loader' );+ },+ success : function( response, text_status, xhr )+ {+ var content = '';++ var fields = [];+ for( var field_name in response.schema.fields )+ {+ fields.push+ (+ '<option value="fieldname=' + field_name + '">' + field_name + '</option>'+ );+ }+ if( 0 !== fields.length )+ {+ content += '<optgroup label="Fields">' + "\n";+ content += fields.join( "\n" ) + "\n";+ content += '</optgroup>' + "\n";+ }++ var types = [];+ for( var type_name in response.schema.types )+ {+ types.push+ (+ '<option value="fieldtype=' + type_name + '">' + type_name + '</option>'+ );+ }+ if( 0 !== types.length )+ {+ content += '<optgroup label="Types">' + "\n";+ content += types.join( "\n" ) + "\n";+ content += '</optgroup>' + "\n";+ }++ this+ .html( content );++ $( 'option[value=fieldname\=' + response.schema.defaultSearchField + ']', this )+ .attr( 'selected', 'selected' );+ },+ error : function( xhr, text_status, error_thrown)+ {+ },+ complete : function( xhr, text_status )+ {+ this+ .removeClass( 'loader' );+ }+ }+ );++ var analysis_result = $( '.analysis-result', analysis_element );+ analysis_result_tpl = analysis_result.clone();+ analysis_result.remove();++ analysis_form+ .ajaxForm+ (+ {+ url : core_basepath + '/analysis/field?wt=json',+ dataType : 'json',+ beforeSubmit : function( array, form, options )+ {+ //loader++ $( '.analysis-result', analysis_element )+ .remove();++ array.push( { name: 'analysis.showmatch', value: 'true' } );++ var type_or_name = $( '#type_or_name', form ).val().split( '=' );++ array.push( { name: 'analysis.' + type_or_name[0], value: type_or_name[1] } );+ },+ success : function( response, status_text, xhr, form )+ {+ for( var name in response.analysis.field_names )+ {+ build_analysis_table( 'name', name, response.analysis.field_names[name] );+ }++ for( var name in response.analysis.field_types )+ {+ build_analysis_table( 'type', name, response.analysis.field_types[name] );+ }+ },+ complete : function()+ {+ //loader+ }+ }+ );++ var build_analysis_table = function( field_or_name, name, analysis_data )+ {+ var analysis_result_data = analysis_result_tpl.clone();+ var content = [];++ for( var type in analysis_data )+ {+ var type_length = analysis_data[type].length;+ if( 0 !== type_length )+ {+ var type_content = '<div class="' + type + '">' + "\n";+ for( var i = 0; i < type_length; i += 2 )+ {+ type_content += '<div class="row">' + "\n";++ var analyzer_parts = analysis_data[type][i].split( '.' );+ var analyzer_parts_name = analyzer_parts.pop();+ var analyzer_parts_namespace = analyzer_parts.join( '.' ) + '.';++ type_content += '<div class="analyzer" title="' + analysis_data[type][i] +'">' ++ analyzer_parts_name + '</div>' + "\n";++ var raw_parts = {+ 'position' : [],+ 'text' : [],+ 'type' : [],+ 'start-end' : []+ };++ for( var k in analysis_data[type][i+1] )+ {+ var pos = analysis_data[type][i+1][k]['position'] - 1;+ var is_match = !!analysis_data[type][i+1][k]['match'];++ if( 'undefined' === typeof raw_parts['text'][pos] )+ {+ raw_parts['position'][pos] = [];+ raw_parts['text'][pos] = [];+ raw_parts['type'][pos] = [];+ raw_parts['start-end'][pos] = [];++ raw_parts['position'][pos].push( '<div>' + analysis_data[type][i+1][k]['position'] + '</div>' );+ }++ raw_parts['text'][pos].push( '<div class="' + ( is_match ? 'match' : '' ) + '">' + analysis_data[type][i+1][k]['text'] + '</div>' );+ raw_parts['type'][pos].push( '<div>' + analysis_data[type][i+1][k]['type'] + '</div>' );+ raw_parts['start-end'][pos].push( '<div>' + analysis_data[type][i+1][k]['start'] + '–' + analysis_data[type][i+1][k]['end'] + '</div>' );+ }++ var parts = {+ 'position' : [],+ 'text' : [],+ 'type' : [],+ 'start-end' : []+ };++ for( var key in raw_parts )+ {+ var length = raw_parts[key].length;+ for( var j = 0; j < length; j++ )+ {+ parts[key].push( '<td>' + raw_parts[key][j].join( "\n" ) + '</td>' );+ }+ }++ type_content += '<div class="result">' + "\n";+ type_content += '<table border="0" cellspacing="0" cellpadding="0">' + "\n";++ type_content += '<tr class="verbose_output">' + "\n";+ type_content += '<th><abbr title="Position">P</abbr></th>' + "\n";+ type_content += parts['position'].join( "\n" ) + "\n";+ type_content += '</tr>' + "\n";++ type_content += '<tr>' + "\n";+ type_content += '<th><abbr title="Text">T</abbr></th>' + "\n";+ type_content += parts['text'].join( "\n" ) + "\n";+ type_content += '</tr>' + "\n";++ type_content += '<tr class="verbose_output">' + "\n";+ type_content += '<th><abbr title="Type">T</abbr></th>' + "\n";+ type_content += parts['type'].join( "\n" ) + "\n";+ type_content += '</tr>' + "\n";++ type_content += '<tr class="verbose_output">' + "\n";+ type_content += '<th><abbr title="Range (Start, End)">R</abbr></th>' + "\n";+ type_content += parts['start-end'].join( "\n" ) + "\n";+ type_content += '</tr>' + "\n";++ type_content += '</table>' + "\n";+ type_content += '</div>' + "\n";++ type_content += '</div>' + "\n";+ }+ type_content += '</div>';+ content.push( $.trim( type_content ) );+ }+ }++ $( 'h2 span', analysis_result_data )+ .html( field_or_name + ': ' + name );++ $( 'h2 .verbose_output a', analysis_result_data )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $( this ).parents( '.block' )+ .toggleClass( 'verbose_output' );+ }+ );++ $( '.analysis-result-content', analysis_result_data )+ .html( content.join( "\n" ) );++ analysis_element.append( analysis_result_data );++ }++ }+ );+ }+ );++ // #/:core/schema, #/:core/config+ this.get+ (+ /^#\/([\w\d]+)\/(schema|config)$/,+ function( context )+ {+ var content_element = $( '#content' );++ content_element+ .html( '<iframe src="' + $( '.active a', this.active_core ).attr( 'href' ) + '"></iframe>' );++ $( 'iframe', content_element )+ .css( 'height', $( '#main' ).height() );+ }+ );++ // #/:core+ this.get+ (+ /^#\/([\w\d]+)$/,+ function( context )+ {+ var core_basepath = this.active_core.attr( 'data-basepath' );+ var content_element = $( '#content' );++ content_element+ .removeClass( 'single' );++ var core_menu = $( 'ul', this.active_core );+ if( !core_menu.data( 'admin-extra-loaded' ) )+ {+ core_menu.data( 'admin-extra-loaded', new Date() );++ $.get+ (+ core_basepath + '/admin/file/?file=admin-extra.menu-top.html',+ function( menu_extra )+ {+ core_menu+ .prepend( menu_extra );+ }+ );++ $.get+ (+ core_basepath + '/admin/file/?file=admin-extra.menu-bottom.html',+ function( menu_extra )+ {+ core_menu+ .append( menu_extra );+ }+ );+ }++ $.get+ (+ 'tpl/dashboard.html',+ function( template )+ {+ content_element+ .html( template );++ var dashboard_element = $( '#dashboard' );++ /*+ $.ajax+ (+ {+ url : core_basepath + '/admin/system?wt=json',+ dataType : 'json',+ context : $( '#system', dashboard_element ),+ beforeSend : function( xhr, settings )+ {+ $( 'h2', this )+ .addClass( 'loader' );++ $( '.message', this )+ .show()+ .html( 'Loading' );+ },+ success : function( response, text_status, xhr )+ {+ $( '.message', this )+ .empty()+ .hide();++ $( 'dl', this )+ .show();++ var data = {+ 'core_now' : response['core']['now'],+ 'core_start' : response['core']['start'],+ 'core_host' : response['core']['host'],+ 'core_schema' : response['core']['schema'],+ 'lucene_solr-spec-version' : response['lucene']['solr-spec-version'],+ 'lucene_solr-impl-version' : response['lucene']['solr-impl-version'],+ 'lucene_lucene-spec-version' : response['lucene']['lucene-spec-version'],+ 'lucene_lucene-impl-version' : response['lucene']['lucene-impl-version']+ };++ for( var key in data )+ {+ $( '.' + key, this )+ .show();++ $( '.value.' + key, this )+ .html( data[key] );+ }+ },+ error : function( xhr, text_status, error_thrown)+ {+ this+ .addClass( 'disabled' );++ $( '.message', this )+ .show()+ .html( 'System-Handler is not configured' );+ },+ complete : function( xhr, text_status )+ {+ $( 'h2', this )+ .removeClass( 'loader' );+ }+ }+ );+ //*/++ $.ajax+ (+ {+ url : core_basepath + '/admin/luke?wt=json',+ dataType : 'json',+ context : $( '#statistics', dashboard_element ),+ beforeSend : function( xhr, settings )+ {+ $( 'h2', this )+ .addClass( 'loader' );++ $( '.message', this )+ .show()+ .html( 'Loading ...' );++ $( '.content' )+ .hide();+ },+ success : function( response, text_status, xhr )+ {+ $( '.message', this )+ .empty()+ .hide();++ $( '.content', this )+ .show();++ var data = {+ 'index_num-docs' : response['index']['numDocs'],+ 'index_max-doc' : response['index']['maxDoc'],+ 'index_last-modified' : response['index']['lastModified']+ };++ for( var key in data )+ {+ $( '.' + key, this )+ .show();++ $( '.value.' + key, this )+ .html( data[key] );+ }++ var optimized_element = $( '.value.index_optimized', this );+ if( response['index']['optimized'] )+ {+ optimized_element+ .addClass( 'ico-1' );++ $( 'span', optimized_element )+ .html( 'yes' );+ }+ else+ {+ optimized_element+ .addClass( 'ico-0' );++ $( 'span', optimized_element )+ .html( 'no' );+ }++ var current_element = $( '.value.index_current', this );+ if( response['index']['current'] )+ {+ current_element+ .addClass( 'ico-1' );++ $( 'span', current_element )+ .html( 'yes' );+ }+ else+ {+ current_element+ .addClass( 'ico-0' );++ $( 'span', current_element )+ .html( 'no' );+ }++ var deletions_element = $( '.value.index_has-deletions', this );+ if( response['index']['hasDeletions'] )+ {+ deletions_element.prev()+ .show();++ deletions_element+ .show()+ .addClass( 'ico-0' );++ $( 'span', deletions_element )+ .html( 'yes' );+ }++ $( 'a', optimized_element )+ .die( 'click' )+ .live+ (+ 'click',+ function( event )+ {+ $.ajax+ (+ {+ url : core_basepath + '/update?optimize=true&waitFlush=true&wt=json',+ dataType : 'json',+ context : $( this ),+ beforeSend : function( xhr, settings )+ {+ this+ .addClass( 'loader' );+ },+ success : function( response, text_status, xhr )+ {+ this.parents( 'dd' )+ .removeClass( 'ico-0' )+ .addClass( 'ico-1' );+ },+ error : function( xhr, text_status, error_thrown)+ {+ console.warn( 'd0h, optimize broken!' );+ },+ complete : function( xhr, text_status )+ {+ this+ .removeClass( 'loader' );+ }+ }+ );+ }+ );++ $( '.timeago', this )+ .timeago();+ },+ error : function( xhr, text_status, error_thrown)+ {+ this+ .addClass( 'disabled' );++ $( '.message', this )+ .show()+ .html( 'Luke is not configured' );+ },+ complete : function( xhr, text_status )+ {+ $( 'h2', this )+ .removeClass( 'loader' );+ }+ }+ );++ $.ajax+ (+ {+ url : core_basepath + '/replication?command=details&wt=json',+ dataType : 'json',+ context : $( '#replication', dashboard_element ),+ beforeSend : function( xhr, settings )+ {+ $( 'h2', this )+ .addClass( 'loader' );++ $( '.message', this )+ .show()+ .html( 'Loading' );++ $( '.content', this )+ .hide();+ },+ success : function( response, text_status, xhr )+ {+ $( '.message', this )+ .empty()+ .hide();++ $( '.content', this )+ .show();++ $( '.replication', context.active_core )+ .show();++ var is_master = 'undefined' === typeof( response['details']['slave'] );+ var headline = $( 'h2 span', this );++ if( is_master )+ {+ this+ .addClass( 'is-master' );++ headline+ .html( headline.html() + ' (Master)' );+ }+ else+ {+ this+ .addClass( 'is-slave' );++ headline+ .html( headline.html() + ' (Slave)' );+ }++ var data = {+ 'details_index-version' : response['details']['indexVersion'],+ 'details_generation' : response['details']['generation'],+ 'details_index-size' : response['details']['indexSize']+ };++ if( !is_master )+ {+ $.extend+ (+ data,+ {+ 'details_slave_master-details_index-version' : response['details']['slave']['masterDetails']['indexVersion'],+ 'details_slave_master-details_generation' : response['details']['slave']['masterDetails']['generation'],+ 'details_slave_master-details_index-size' : response['details']['slave']['masterDetails']['indexSize'],+ 'details_slave_master-url' : response['details']['slave']['masterUrl'],+ 'details_slave_poll-interval' : response['details']['slave']['pollInterval'],+ 'details_slave_next-execution-at' : response['details']['slave']['nextExecutionAt'],+ 'details_slave_index-replicated-at' : response['details']['slave']['indexReplicatedAt'],+ 'details_slave_last-cycle-bytes-downloaded' : response['details']['slave']['lastCycleBytesDownloaded'],+ 'details_slave_replication-failed-at' : response['details']['slave']['replicationFailedAt'],+ 'details_slave_previous-cycle-time-in-seconds' : response['details']['slave']['previousCycleTimeInSeconds'],+ 'details_slave_is-polling-disabled' : response['details']['slave']['isPollingDisabled'],+ 'details_slave_is-replicating' : response['details']['slave']['isReplicating']+ }+ );++ $( 'dl', this )+ .show();+ }++ for( var key in data )+ {+ $( '.' + key, this )+ .show();++ $( '.value.' + key, this )+ .html( data[key] );+ }++ // $( '.timeago', this )+ // .timeago();+ },+ error : function( xhr, text_status, error_thrown)+ {+ this+ .addClass( 'disabled' );++ $( '.message', this )+ .show()+ .html( 'Replication is not configured' );+ },+ complete : function( xhr, text_status )+ {+ $( 'h2', this )+ .removeClass( 'loader' );+ }+ }+ );++ /*+ $.ajax+ (+ {+ url : core_basepath + '/dataimport?command=details&wt=json',+ dataType : 'json',+ context : $( '#dataimport', dashboard_element ),+ beforeSend : function( xhr, settings )+ {+ $( 'h2', this )+ .addClass( 'loader' );++ $( '.message', this )+ .show()+ .html( 'Loading' );+ },+ success : function( response, text_status, xhr )+ {+ $( '.message', this )+ .empty()+ .hide();++ $( 'dl', this )+ .show();++ var data = {+ 'status' : response['status'],+ 'info' : response['statusMessages']['']+ };++ for( var key in data )+ {+ $( '.' + key, this )+ .show();++ $( '.value.' + key, this )+ .html( data[key] );+ }+ },+ error : function( xhr, text_status, error_thrown)+ {+ this+ .addClass( 'disabled' );++ $( '.message', this )+ .show()+ .html( 'DataImport is not configured' );+ },+ complete : function( xhr, text_status )+ {+ $( 'h2', this )+ .removeClass( 'loader' );+ }+ }+ );+ //*/++ $.ajax+ (+ {+ url : core_basepath + '/admin/file/?file=admin-extra.html',+ dataType : 'html',+ context : $( '#admin-extra', dashboard_element ),+ beforeSend : function( xhr, settings )+ {+ $( 'h2', this )+ .addClass( 'loader' );++ $( '.message', this )+ .show()+ .html( 'Loading' );++ $( '.content', this )+ .hide();+ },+ success : function( response, text_status, xhr )+ {+ $( '.message', this )+ .hide()+ .empty();++ $( '.content', this )+ .show()+ .html( response );+ },+ error : function( xhr, text_status, error_thrown)+ {+ this+ .addClass( 'disabled' );++ $( '.message', this )+ .show()+ .html( 'We found no "admin-extra.html" file.' );+ },+ complete : function( xhr, text_status )+ {+ $( 'h2', this )+ .removeClass( 'loader' );+ }+ }+ );++ }+ );+ }+ );++ // #/+ this.get+ (+ /^#\/$/,+ function( context )+ {+ var content_element = $( '#content' );++ $( '#index', app.menu_element )+ .addClass( 'active' );++ content_element+ .html( '<div id="index"></div>' );++ $.ajax+ (+ {+ url : 'tpl/index.html',+ context : $( '#index', content_element ),+ beforeSend : function( arr, form, options )+ {+ },+ success : function( template )+ {+ this+ .html( template );++ var memory_data = {};+ if( app.dashboard_values['jvm']['memory']['raw'] )+ {+ var jvm_memory = app.dashboard_values['jvm']['memory']['raw'];+ memory_data['memory-bar-max'] = parseInt( jvm_memory['max'] );+ memory_data['memory-bar-total'] = parseInt( jvm_memory['total'] );+ memory_data['memory-bar-used'] = parseInt( jvm_memory['used'] );+ }+ else+ {+ var jvm_memory = app.dashboard_values['jvm']['memory'];+ memory_data['memory-bar-max'] = parseFloat( jvm_memory['max'] ) * 1024 * 1024;+ memory_data['memory-bar-total'] = parseFloat( jvm_memory['total'] ) * 1024 * 1024;+ memory_data['memory-bar-used'] = parseFloat( jvm_memory['used'] ) * 1024 * 1024;+ }++ for( var key in memory_data )+ {+ $( '.value.' + key, this )+ .html( memory_data[key] );+ }++ var data = {+ 'start_time' : app.dashboard_values['jvm']['jmx']['startTime'],+ 'host' : app.dashboard_values['core']['host'],+ 'jvm' : app.dashboard_values['jvm']['name'] + ' (' + app.dashboard_values['jvm']['version'] + ')',+ 'solr_spec_version' : app.dashboard_values['lucene']['solr-spec-version'],+ 'solr_impl_version' : app.dashboard_values['lucene']['solr-impl-version'],+ 'lucene_spec_version' : app.dashboard_values['lucene']['lucene-spec-version'],+ 'lucene_impl_version' : app.dashboard_values['lucene']['lucene-impl-version']+ };++ if( app.dashboard_values['core']['directory']['cwd'] )+ {+ data['cwd'] = app.dashboard_values['core']['directory']['cwd'];+ }++ for( var key in data )+ {+ var value_element = $( '.' + key + ' dd', this );++ value_element+ .html( data[key] );++ value_element.closest( 'li' )+ .show();+ }++ var cmd_arg_key_element = $( '.command_line_args dt', this );+ var cmd_arg_element = $( '.command_line_args dd', this );++ for( var key in app.dashboard_values['jvm']['jmx']['commandLineArgs'] )+ {+ cmd_arg_element = cmd_arg_element.clone();+ cmd_arg_element.html( app.dashboard_values['jvm']['jmx']['commandLineArgs'][key] );++ cmd_arg_key_element+ .after( cmd_arg_element );+ }++ cmd_arg_key_element.closest( 'li' )+ .show();++ $( '.command_line_args dd:last', this )+ .remove();++ $( '.timeago', this )+ .timeago();++ $( 'li:visible:odd', this )+ .addClass( 'odd' );++ $( '.command_line_args dd:odd', this )+ .addClass( 'odd' );++ // -- memory bar++ var max_height = Math.round( $( '#memory-bar-max', this ).height() );+ var total_height = Math.round( ( memory_data['memory-bar-total'] * max_height ) / memory_data['memory-bar-max'] );+ var used_height = Math.round( ( memory_data['memory-bar-used'] * max_height ) / memory_data['memory-bar-max'] );++ var memory_bar_total_value = $( '#memory-bar-total span', this ).first();++ $( '#memory-bar-total', this )+ .height( total_height );++ $( '#memory-bar-used', this )+ .height( used_height );++ if( used_height < total_height + memory_bar_total_value.height() )+ {+ memory_bar_total_value+ .addClass( 'upper' )+ .css( 'margin-top', memory_bar_total_value.height() * -1 );+ }++ var memory_percentage = ( ( memory_data['memory-bar-used'] / memory_data['memory-bar-max'] ) * 100 ).toFixed(1);+ var headline = $( '#memory h2 span', this );++ headline+ .html( headline.html() + ' (' + memory_percentage + '%)' );++ $( '#memory-bar .value', this )+ .each+ (+ function()+ {+ var self = $( this );++ var byte_value = parseInt( self.html() );++ self+ .attr( 'title', 'raw: ' + byte_value + ' B' );++ byte_value /= 1024;+ byte_value /= 1024;+ byte_value = byte_value.toFixed( 2 ) + ' MB';++ self+ .html( byte_value );+ }+ );+ },+ error : function( xhr, text_status, error_thrown )+ {+ },+ complete : function( xhr, text_status )+ {+ }+ }+ );+ }+ );+ }+);++var solr_admin = function()+{+ menu_element = null,++ is_multicore = null,+ cores_data = null,+ active_core = null,+ environment_basepath = null,++ config = null,+ params = null,+ dashboard_values = null,+ schema_browser_data = null,++ this.init_menu = function()+ {+ $( '.ping a', this.menu_element )+ .live+ (+ 'click',+ function()+ {+ sammy.trigger+ (+ 'ping',+ { element : this }+ );+ return false;+ }+ );++ $( 'a[rel]', this.menu_element )+ .live+ (+ 'click',+ function()+ {+ location.href = this.rel;+ return false;+ }+ );+ }++ this.__construct = function()+ {+ this.menu_element = $( '#menu ul' );++ this.init_menu();+ }+ this.__construct();+}++var app;+$( document ).ready+(+ function()+ {+ jQuery.timeago.settings.allowFuture = true;++ app = new solr_admin();+ app.config = app_config;++ $.ajax+ (+ {+ url : app.config.solr_path + app.config.core_admin_path + '?wt=json',+ dataType : 'json',+ beforeSend : function( arr, form, options )+ {+ $( '#content' )+ .html( '<div id="index"><div class="loader">Loading ...</div></div>' );+ },+ success : function( response )+ {+ app.cores_data = response.status;+ app.is_multicore = 'undefined' === typeof response.status[''];++ if( app.is_multicore )+ {+ $( '#cores', app.menu_element )+ .show();+ }++ for( var core_name in response.status )+ {+ var core_path = app.config.solr_path + '/' + core_name;++ if( !core_name )+ {+ core_name = 'singlecore';+ core_path = app.config.solr_path+ }++ if( !app.environment_basepath )+ {+ app.environment_basepath = core_path;+ }++ var core_tpl = '<li id="' + core_name + '" data-basepath="' + core_path + '">' + "\n"+ + ' <p><a href="#/' + core_name + '">' + core_name + '</a></p>' + "\n"+ + ' <ul>' + "\n"++ + ' <li class="query"><a rel="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n"+ + ' <li class="schema"><a href="' + core_path + '/admin/file/?file=schema.xml" rel="#/' + core_name + '/schema"><span>Schema</span></a></li>' + "\n"+ + ' <li class="config"><a href="' +core_path + '/admin/file/?file=solrconfig.xml" rel="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n"+ + ' <li class="replication optional"><a href="' + core_path + '/admin/replication/index.jsp" rel="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n"+ + ' <li class="analysis"><a href="' + core_path + '/admin/analysis.jsp?highlight=on" rel="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n"+ + ' <li class="schema-browser"><a href="' + core_path + '/admin/schema.jsp" rel="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' + "\n"+ + ' <li class="stats"><a href="' +core_path + '/admin/stats.jsp" rel="#/' + core_name + '/info/stats"><span>Statistics</span></a></li>' + "\n"+ + ' <li class="ping"><a href="' + core_path + '/admin/ping"><span>Ping</span></a></li>' + "\n"+ + ' <li class="plugins"><a href="' + core_path + '/admin/plugins" rel="#/' + core_name + '/info"><span>Plugins</span></a></li>' + "\n"+ + ' <li class="dataimport"><a rel="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n"++ + ' </ul>' + "\n"+ + '</li>';++ app.menu_element+ .append( core_tpl );+ }++ $.ajax+ (+ {+ url : app.environment_basepath + '/admin/system?wt=json',+ dataType : 'json',+ beforeSend : function( arr, form, options )+ {+ },+ success : function( response )+ {+ app.dashboard_values = response;++ var environment_args = null;+ var cloud_args = null;++ if( response.jvm && response.jvm.jmx && response.jvm.jmx.commandLineArgs )+ {+ var command_line_args = response.jvm.jmx.commandLineArgs.join( ' | ' );++ environment_args = command_line_args+ .match( /-Dsolr.environment=((dev|test|prod)?[\w\d]*)/i );++ cloud_args = command_line_args+ .match( /-Dzk/i );+ }++ // environment++ var environment_element = $( '#environment' );+ if( environment_args )+ {+ environment_element+ .show();++ if( environment_args[1] )+ {+ environment_element+ .html( environment_args[1] );+ }++ if( environment_args[2] )+ {+ environment_element+ .addClass( environment_args[2] );+ }+ }+ else+ {+ environment_element+ .remove();+ }++ // cloud++ var cloud_nav_element = $( '#menu #cloud' );+ if( cloud_args )+ {+ cloud_nav_element+ .show();+ }++ // application++ sammy.run( location.hash );+ },+ error : function()+ {+ },+ complete : function()+ {+ loader.hide( this );+ }+ }+ );+ },+ error : function()+ {+ },+ complete : function()+ {+ }+ }+ );+ }+);\ No newline at end of filediff --git a/solr/src/webapp/web/logging.json b/solr/src/webapp/web/logging.jsonnew file mode 100644index 00000000000..eccaf3f8a0c--- /dev/null+++ b/solr/src/webapp/web/logging.json@@ -0,0 +1,113 @@+{+ "levels" : ["FINEST", "FINE", "CONFIG", "INFO", "WARNING", "SEVERE"],+ "logger" : {+ "root" : {+ "level": { "effective_level" : "INFO" },+ "effective_level" : "INFO"+ },+ "global" : { "effective_level" : "INFO" },+ "javax" : null,+ "javax.management" : { "effective_level" : "INFO" },+ "javax.management.mbeanserver" : { "effective_level" : "INFO" },+ "javax.management.misc" : { "effective_level" : "INFO" },+ "javax.management.mlet" : { "effective_level" : "INFO" },+ "javax.management.modelmbean" : { "effective_level" : "INFO" },+ "javax.management.monitor" : { "effective_level" : "INFO" },+ "javax.management.notification" : { "effective_level" : "INFO" },+ "javax.management.relation" : { "effective_level" : "INFO" },+ "javax.management.snmp" : { "effective_level" : "INFO" },+ "javax.management.snmp.daemon" : { "effective_level" : "INFO" },+ "javax.management.timer" : { "effective_level" : "INFO" },+ "org" : null,+ "org.apache" : null,+ "org.apache.solr" : null,+ "org.apache.solr.analysis" : null,+ "org.apache.solr.analysis.BaseTokenFilterFactory" : { "effective_level" : "INFO" },+ "org.apache.solr.analysis.BaseTokenStreamFactory" : { "effective_level" : "INFO" },+ "org.apache.solr.analysis.BaseTokenizerFactory" : { "effective_level" : "INFO" },+ "org.apache.solr.cloud" : null,+ "org.apache.solr.cloud.SolrZkServer" : { "effective_level" : "INFO" },+ "org.apache.solr.cloud.ZkController" : { "effective_level" : "INFO" },+ "org.apache.solr.common" : null,+ "org.apache.solr.common.cloud" : null,+ "org.apache.solr.common.cloud.CloudState" : { "effective_level" : "INFO" },+ "org.apache.solr.common.cloud.ConnectionManager" : { "effective_level" : "INFO" },+ "org.apache.solr.common.cloud.DefaultConnectionStrategy" : { "effective_level" : "INFO" },+ "org.apache.solr.common.cloud.SolrZkClient" : { "effective_level" : "INFO" },+ "org.apache.solr.common.cloud.ZkStateReader" : { "effective_level" : "INFO" },+ "org.apache.solr.common.util" : null,+ "org.apache.solr.common.util.ConcurrentLRUCache" : { "effective_level" : "INFO" },+ "org.apache.solr.common.util.SystemIdResolver" : { "effective_level" : "INFO" },+ "org.apache.solr.core" : null,+ "org.apache.solr.core.Config" : { "effective_level" : "INFO" },+ "org.apache.solr.core.CoreContainer" : { "effective_level" : "INFO" },+ "org.apache.solr.core.JmxMonitoredMap" : { "effective_level" : "INFO" },+ "org.apache.solr.core.RequestHandlers" : { "effective_level" : "INFO" },+ "org.apache.solr.core.SolrConfig" : { "effective_level" : "INFO" },+ "org.apache.solr.core.SolrCore" : { "effective_level" : "INFO" },+ "org.apache.solr.core.SolrResourceLoader" : { "effective_level" : "INFO" },+ "org.apache.solr.handler" : null,+ "org.apache.solr.handler.XmlUpdateRequestHandler" : { "effective_level" : "INFO" },+ "org.apache.solr.handler.admin" : null,+ "org.apache.solr.handler.admin.LukeRequestHandler" : { "effective_level" : "INFO" },+ "org.apache.solr.handler.admin.SystemInfoHandler" : { "effective_level" : "INFO" },+ "org.apache.solr.handler.component" : null,+ "org.apache.solr.handler.component.QueryElevationComponent" : { "effective_level" : "INFO" },+ "org.apache.solr.handler.component.SearchHandler" : { "effective_level" : "INFO" },+ "org.apache.solr.handler.component.SpellCheckComponent" : { "effective_level" : "INFO" },+ "org.apache.solr.highlight" : null,+ "org.apache.solr.highlight.DefaultSolrHighlighter" : { "effective_level" : "INFO" },+ "org.apache.solr.highlight.SolrHighlighter" : { "effective_level" : "INFO" },+ "org.apache.solr.response" : null,+ "org.apache.solr.response.BinaryResponseWriter" : { "effective_level" : "INFO" },+ "org.apache.solr.response.XSLTResponseWriter" : { "effective_level" : "INFO" },+ "org.apache.solr.schema" : null,+ "org.apache.solr.schema.FieldType" : { "effective_level" : "INFO" },+ "org.apache.solr.schema.IndexSchema" : { "effective_level" : "INFO" },+ "org.apache.solr.search" : null,+ "org.apache.solr.search.SolrIndexSearcher" : { "effective_level" : "INFO" },+ "org.apache.solr.servlet" : null,+ "org.apache.solr.servlet.NewLogLevelSelection" : { "effective_level" : "INFO" },+ "org.apache.solr.servlet.SolrDispatchFilter" : { "effective_level" : "INFO" },+ "org.apache.solr.servlet.SolrRequestParsers" : { "effective_level" : "INFO" },+ "org.apache.solr.spelling" : null,+ "org.apache.solr.spelling.AbstractLuceneSpellChecker" : { "effective_level" : "INFO" },+ "org.apache.solr.spelling.IndexBasedSpellChecker" : { "effective_level" : "INFO" },+ "org.apache.solr.update" : null,+ "org.apache.solr.update.SolrIndexConfig" : { "effective_level" : "INFO" },+ "org.apache.solr.update.UpdateHandler" : { "effective_level" : "INFO" },+ "org.apache.solr.util" : null,+ "org.apache.solr.util.plugin" : null,+ "org.apache.solr.util.plugin.AbstractPluginLoader" : { "effective_level" : "INFO" },+ "org.apache.zookeeper" : null,+ "org.apache.zookeeper.ClientCnxn" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.CreateMode" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.ZooKeeper" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.common" : null,+ "org.apache.zookeeper.common.PathTrie" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.jmx" : null,+ "org.apache.zookeeper.jmx.MBeanRegistry" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server" : null,+ "org.apache.zookeeper.server.ConnectionBean" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.DataTree" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.FinalRequestProcessor" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.NIOServerCnxn" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.PrepRequestProcessor" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.Request" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.SessionTrackerImpl" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.SyncRequestProcessor" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.WatchManager" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.ZKDatabase" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.ZooKeeperServer" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.ZooKeeperServerMain" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.persistence" : null,+ "org.apache.zookeeper.server.persistence.FileSnap" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.persistence.FileTxnLog" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.persistence.FileTxnSnapLog" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.persistence.Util" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.quorum" : null,+ "org.apache.zookeeper.server.quorum.QuorumPeerConfig" : { "effective_level" : "INFO" },+ "org.apache.zookeeper.server.util" : null,+ "org.apache.zookeeper.server.util.SerializeUtils" : { "effective_level" : "INFO" }+ }+}\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/analysis.html b/solr/src/webapp/web/tpl/analysis.htmlnew file mode 100644index 00000000000..a1271c9b4c5--- /dev/null+++ b/solr/src/webapp/web/tpl/analysis.html@@ -0,0 +1,69 @@+<div id="analysis">++ <div class="block" id="field-analysis">++ <h2><span>Field Analysis</span></h2>+ <div class="content">++ <div class="message-container">+ <div class="message"></div>+ </div>++ <form method="get">++ <ul class="clearfix">++ <li class="index">++ <label for="analysis_fieldvalue_index">Field Value (Index)</label>+ <textarea name="analysis.fieldvalue" id="analysis_fieldvalue_index"></textarea>++ </li>++ <li class="query">++ <label for="analysis_fieldvalue_query">Field Value (Query)</label>+ <textarea name="analysis.query" id="analysis_fieldvalue_query"></textarea>++ </li>++ <li class="settings clearfix">++ <label for="type_or_name">Analyse Fieldname / FieldType:</label>+ <select id="type_or_name"></select>++ <div>++ <button type="submit">Analyse Values</button>++ </div>++ </li>++ </ul>++ </form>++ </div>+ </div>++ <div class="block analysis-result">++ <h2>+ <span>{headline}</span>+ <div class="verbose_output">+ <a>Verbose Output</label>+ </div>+ </h2>+ <div class="content">++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="analysis-result-content clearfix">{content}</div>++ </div>+ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/cloud.html b/solr/src/webapp/web/tpl/cloud.htmlnew file mode 100644index 00000000000..5a9eda86f4f--- /dev/null+++ b/solr/src/webapp/web/tpl/cloud.html@@ -0,0 +1,19 @@+<div id="cloud">++ <div class="block" id="zookeeper">++ <h2><span>Zookeeper-Data</span></h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++ <a><span>Fetch Zookeeper Data</span></a>++ </div>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/cores.html b/solr/src/webapp/web/tpl/cores.htmlnew file mode 100644index 00000000000..fa5cd16e28d--- /dev/null+++ b/solr/src/webapp/web/tpl/cores.html@@ -0,0 +1,217 @@+<div id="cores" class="clearfix">++ <div id="frame">++ <div id="actions" class="actions clearfix">++ <div class="button-holder">+ <div class="button">+ <a class="reload">Reload</a>+ </div>+ </div>++ <div class="button-holder options rename">+ <div class="button">+ <a class="rename">Rename</a>+ </div>+ <div class="button-content">++ <form>++ <p class="clearfix"><label for="rename_core">from:</label>+ <input type="text" name="core" id="rename_core" disabled="disabled"></p>++ <p class="clearfix"><label for="rename_other">to:</label>+ <input type="text" name="other" id="rename_other"></p>++ <p class="clearfix buttons">+ <a class="submit"><span>Rename</span></a>+ <a class="reset"><span>Cancel</span></a>+ </p>++ </form>++ </div>+ </div>++ <div class="button-holder options swap">+ <div class="button">+ <a class="swap">Swap</a>+ </div>+ <div class="button-content">++ <form>++ <p class="clearfix"><label for="swap_core">this:</label>+ <select name="core" id="swap_core" class="core" disabled="disabled">+ </select></p>++ <p class="clearfix"><label for="swap_other">and:</label>+ <select class="other" id="swap_other" class="other">+ </select></p>++ <p class="clearfix buttons">+ <a class="submit"><span>Swap</span></a>+ <a class="reset"><span>Cancel</span></a>+ </p>++ </form>++ </div>+ </div>++ <div class="button-holder">+ <div class="button">+ <a class="unload">Unload</a>+ </div>+ </div>++ <div class="button-holder">+ <div class="button">+ <a class="optimize">Optimize</a>+ </div>+ </div>++ </div>++ <div id="data">++ <div class="block" id="core-data">++ <h2><span></span></h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++ <ul>++ <li class="startTime"><dl class="clearfix">+ <dt><span>startTime:</span></dt>+ <dd class="timeago"></dd>+ </dl></li>++ <li class="instanceDir"><dl class="clearfix">+ <dt><span>instanceDir:</span></dt>+ <dd></dd>+ </dl></li>++ <li class="dataDir"><dl class="clearfix">+ <dt><span>dataDir:</span></dt>+ <dd></dd>+ </dl></li>++ </ul>++ </div>+ </div>++ <div class="block" id="index-data">++ <h2><span>Index</span></h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++ <ul>++ <li class="lastModified"><dl class="clearfix">+ <dt><span>lastModified:</span></dt>+ <dd class="timeago"></dd>+ </dl></li>++ <li class="version"><dl class="clearfix">+ <dt><span>version:</span></dt>+ <dd></dd>+ </dl></li>++ <li class="numDocs"><dl class="clearfix">+ <dt><span>numDocs:</span></dt>+ <dd></dd>+ </dl></li>++ <li class="maxDoc"><dl class="clearfix">+ <dt><span>maxDoc:</span></dt>+ <dd></dd>+ </dl></li>++ <li class="optimized"><dl class="clearfix">+ <dt><span>optimized:</span></dt>+ <dd class="ico"><span></span></dd>+ </dl></li>++ <li class="current"><dl class="clearfix">+ <dt><span>current:</span></dt>+ <dd class="ico"><span></span></dd>+ </dl></li>++ <li class="hasDeletions"><dl class="clearfix">+ <dt><span>hasDeletions:</span></dt>+ <dd class="ico"><span></span></dd>+ </dl></li>++ <li class="directory"><dl class="clearfix">+ <dt><span>directory:</span></dt>+ <dd></dd>+ </dl></li>++ </ul>++ </div>+ </div>++ </div>++ </div>++ <div id="navigation">++ <div class="actions">++ <div class="button-holder options add">+ <div class="button">+ <a class="add">Add Core</a>+ </div>+ <div class="button-content">++ <form>++ <p class="clearfix"><label for="add_name">name:</label>+ <input type="text" name="name" id="add_name"></p>++ <p class="clearfix"><label for="add_instanceDir">instanceDir:</label>+ <input type="text" name="instanceDir" id="add_instanceDir"></p>++ <p class="clearfix"><label for="add_config">config:</label>+ <input type="text" name="config" id="add_config"></p>++ <p class="clearfix"><label for="add_schema">schema:</label>+ <input type="text" name="schema" id="add_schema"></p>++ <p class="clearfix"><label for="add_dataDir">dataDir:</label>+ <input type="text" name="dataDir" id="dataDir"></p>++ <p class="clearfix buttons">+ <a class="submit"><span>Add Core</span></a>+ <a class="reset"><span>Cancel</span></a>+ </p>++ </form>++ </div>+ </div>++ </div>++ <div id="list">++ </div>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/dashboard.html b/solr/src/webapp/web/tpl/dashboard.htmlnew file mode 100644index 00000000000..0a2556099dd--- /dev/null+++ b/solr/src/webapp/web/tpl/dashboard.html@@ -0,0 +1,174 @@+<div id="dashboard">++ <div class="clearfix">++ <div class="block" id="statistics">++ <h2><span>Statistics</span></h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++ <dl>++ <dt class="index_last-modified">lastModified:</dt>+ <dd class="index_last-modified value timeago"></dd>++ <dt class="index_num-docs">numDocs:</dt>+ <dd class="index_num-docs value"></dd>++ <dt class="index_max-doc">maxDoc:</dt>+ <dd class="index_max-doc value"></dd>++ <dt class="index_optimized">optimized:</dt>+ <dd class="index_optimized value ico"><span></span>+ <a>optimize now</a></dd>++ <dt class="index_current">current:</dt>+ <dd class="index_current value ico"><span></span></dd>++ <dt class="index_has-deletions">deletions:</dt>+ <dd class="index_has-deletions value ico"><span></span></dd>++ </dl>++ </div>+ </div>++ <div class="block" id="admin-extra">++ <h2><span>Admin Extra</span></h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++ </div>++ </div>++ </div>+ <div class="clearfix">++ <div class="block" id="replication">++ <h2><span class="is-replicating">Replication</span></h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++ <table border="0" cellspacing="0" cellpadding="0">+ <thead>+ <tr>+ <td> </td>+ <th class="slave">slave</th>+ <th>master</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <th>indexVersion</th>+ <td class="slave value details_slave_master-details_index-version"></td>+ <td class="value details_index-version"></td>+ </tr>+ <tr>+ <th>generation</th>+ <td class="slave value details_slave_master-details_generation"></td>+ <td class="value details_generation"></td>+ </tr>+ <tr>+ <th>indexSize</th>+ <td class="slave value details_slave_master-details_index-size"></td>+ <td class="value details_index-size"></td>+ </tr>+ </tbody>+ </table>++ <dl class="clearfix slave">++ <dt class="details_slave_master-url">masterUrl</dt>+ <dd class="value details_slave_master-url"></dd>++ <dt class="details_slave_poll-interval">poll every</dt>+ <dd class="value details_slave_poll-interval"></dd>++ <dt class="details_slave_index-replicated-at">last replicated</dt>+ <dd class="value timeago details_slave_index-replicated-at"></dd>++ <dt class="details_slave_next-execution-at">replicate next</dt>+ <dd class="value timeago details_slave_next-execution-at"></dd>++ <dt class="details_slave_replication-failed-at">last failed</dt>+ <dd class="value timeago details_slave_replication-failed-at"></dd>++ </dl>++<!--+indexVersion:+ 1295900553587+generation:+ 2+indexSize:+ 4.25 KB++// slave++indexVersion:+ 1295900553587+generation:+ 2+indexSize:+ 4.25 KB+masterUrl:+ http://localhost:8985/solr/replication+pollInterval:+ 00:00:60+indexReplicatedAt:+ Tue Mar 01 19:37:00 UTC 2011+nextExecutionAt:+ Tue Mar 01 19:38:00 UTC 2011+replicationFailedAt:+ Tue Mar 01 19:37:00 UTC 2011+lastCycleBytesDownloaded:+ 0+previousCycleTimeInSeconds:+ 0+isPollingDisabled:+ false+isReplicating:+ false+-->++ </div>+ </div>++ <div class="block" id="dataimport">++ <h2><span>DataImport-Handler</span></h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++<!--+status:+ idle+info:+-->++ </div>+ </div>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/dataimport.html b/solr/src/webapp/web/tpl/dataimport.htmlnew file mode 100644index 00000000000..4a6f757dfc0--- /dev/null+++ b/solr/src/webapp/web/tpl/dataimport.html@@ -0,0 +1,121 @@+<link rel="stylesheet" type="text/css" href="css/syntax.css">+<div id="dataimport" class="clearfix">++ <div id="frame">++ <div id="current_state">++ <span class="time"></span>+ <div class="info">+ <strong></strong>++ <div class="details"></div>+ </div>++ </div>++ <div id="config-error">++ Dataimport XML-Configuration is not valid++ </div>++ <div class="block hidden" id="config">++ <h2>+ <a class="toggle"><span>Dataimport Configuration</span></a>+ <a class="reload_config" title="Reload Configuration">Reload</a>+ </h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++ <div id="dataimport_config">++ <div class="loader">Loading ...</div>++ </div>++ </div>+ </div>++ </div>++ <div id="form">++ <fieldset class="handler">+ <legend>handler</legend>+ <div class="fieldset">++ <ul>+ </ul>++ </div>+ </fieldset>++ <form action="#" method="get">++ <fieldset>+ <legend>import</legend>+ <div class="fieldset">++ <label for="command">+ <a rel="help">command</a>+ </label>+ <select name="command" id="command">+ <option>full-import</option>+ <option>delta-import</option>+ </select>++ <label for="verbose" class="checkbox">+ <input type="checkbox" name="verbose" id="verbose" value="true">+ <a rel="help">verbose</a>+ </label>++ <label for="clean" class="checkbox">+ <input type="checkbox" name="clean" id="clean" value="true">+ <a rel="help">clean</a>+ </label>++ <label for="commit" class="checkbox">+ <input type="checkbox" name="commit" id="commit" value="true">+ <a rel="help">commit</a>+ </label>++ <label for="optimize" class="checkbox">+ <input type="checkbox" name="optimize" id="optimize" value="true">+ <a rel="help">optimize</a>+ </label>++ <label for="entity">+ <a rel="help">entity</a>+ </label>+ <select name="entity" id="entity">+ <option value=""></option>+ </select>++ <label for="start">+ <a rel="help">start</a>,+ <a rel="help">rows</a>+ </label>+ <input type="text" name="start" id="start" value="0">+ <input type="text" name="rows" id="rows" value="10">++ <label for="custom_parameters">+ <a rel="help">custom parameters</a>+ </label>+ <input type="text" name="custom_parameters" id="custom_parameters" value="">++ </div>+ </fieldset>++ <button type="submit">Execute Import</button>++ </form>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/index.html b/solr/src/webapp/web/tpl/index.htmlnew file mode 100644index 00000000000..6ea34f745c7--- /dev/null+++ b/solr/src/webapp/web/tpl/index.html@@ -0,0 +1,107 @@+<div id="index">++ <div class="clearfix">++ <div class="block" id="data">++ <h2><span>Dashboard</span></h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++ <ul class="data">++ <li class="start_time"><dl class="clearfix">+ <dt><span>startTime</span></dt>+ <dd class="timeago"></dd>+ </dl></li>++ <li class="host"><dl class="clearfix">+ <dt><span>host</span></dt>+ <dd></dd>+ </dl></li>++ <li class="cwd"><dl class="clearfix">+ <dt><span>cwd</span></dt>+ <dd></dd>+ </dl></li>++ <li class="jvm"><dl class="clearfix">+ <dt><span>JVM</span></dt>+ <dd></dd>+ </dl></li>++ <li class="command_line_args"><dl class="clearfix">+ <dt><span>commandLineArgs</span></dt>+ <dd></dd>+ </dl></li>++ </ul>++ <ul class="lucene">++ <li class="solr_spec_version"><dl class="clearfix">+ <dt><span>solr-spec-version</span></dt>+ <dd></dd>+ </dl></li>++ <li class="solr_impl_version"><dl class="clearfix">+ <dt class=""><span>solr-impl-version</span></dt>+ <dd></dd>+ </dl></li>++ <li class="lucene_spec_version"><dl class="clearfix">+ <dt><span>lucene-spec-version</span></dt>+ <dd></dd>+ </dl></li>++ <li class="lucene_impl_version"><dl class="clearfix">+ <dt><span>lucene-impl-version</span></dt>+ <dd></dd>+ </dl></li>++ </ul>++ </div>++ </div>++ <div class="block" id="memory">++ <h2><span>Memory</span></h2>++ <div class="message-container">+ <div class="message"></div>+ </div>++ <div class="content">++ <div id="memory-bar">++ <div id="memory-bar-max">+ <span class="memory-bar-max value"></span>++ <div id="memory-bar-total" class="bar">+ <span class="memory-bar-total value"></span>++ <div id="memory-bar-used" class="bar">+ <span class="memory-bar-used value"></span>++ </div>++ </div>++ </div>++ </div>++ </div>++ </div>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/query.html b/solr/src/webapp/web/tpl/query.htmlnew file mode 100644index 00000000000..828b6da853b--- /dev/null+++ b/solr/src/webapp/web/tpl/query.html@@ -0,0 +1,244 @@+<div id="query" class="clearfix">++ <div id="form">++ <form action="#" method="get">++ <fieldset>+ <legend>common</legend>+ <div class="fieldset">++ <label for="q">+ q+ </label>+ <textarea name="q" id="q">*:*</textarea>++ <label for="fq">+ <a rel="help">fq</a>+ </label>+ <input type="text" id="fq" name="fq" class="multiple">++ <label for="sort">+ <a rel="help">sort</a>+ </label>+ <input type="text" id="sort" name="sort" class="multiple">++ <label for="start">+ <a rel="help">start</a>,+ <a rel="help">rows</a>+ </label>+ <input type="text" name="start" id="start" value="0">+ <input type="text" name="rows" id="rows" value="10">++ <label for="fl">+ <a rel="help">fl</a>+ </label>+ <input type="text" name="fl" id="fl" value="*">++ <label for="qt">+ <a rel="help">qt</a>+ </label>+ <input type="text" name="qt" id="qt" value="">++ <label for="debugQuery" class="checkbox">+ <input type="checkbox" name="debugQuery" id="debugQuery" value="true">+ <a rel="help">debugQuery</a>+ </label>++ </div>+ </fieldset>++ <fieldset class="optional">+ <legend>+ <label for="dismax" class="checkbox">+ <input type="checkbox" name="dismax" id="dismax" value="true">+ dismax+ </label>+ </legend>+ <div class="fieldset">++ <label for="q_alt">q.alt</label>+ <input type="text" name="q.alt" id="q_alt">++ <label for="qf">qf</label>+ <input type="text" name="qf" id="qf">++ <label for="mm">mm</label>+ <input type="text" name="mm" id="mm">++ <label for="pf">pf</label>+ <input type="text" name="pf" id="pf">++ <label for="ps">ps</label>+ <input type="text" name="ps" id="ps">++ <label for="qs">qs</label>+ <input type="text" name="qs" id="qs">++ <label for="tie">tie</label>+ <input type="text" name="tie" id="tie">++ <label for="bq">bq</label>+ <input type="text" name="bq" id="bq">++ <label for="bf">bf</label>+ <input type="text" name="bf" id="bf">++ </fieldset>++ <fieldset class="optional">+ <legend>+ <label for="hl" class="checkbox">+ <input type="checkbox" name="hl" id="hl" value="true">+ hl+ </label>+ </legend>+ <div class="fieldset">++ <label for="hl_fl">hl.fl</label>+ <input type="text" name="hl.fl" id="hl_fl" value="">++ <label for="hl_simple_pre">hl.simple.pre</label>+ <input type="text" name="hl.simple.pre" id="hl_simple_pre" value="<em>">++ <label for="hl_simple_post">hl.simple.post</label>+ <input type="text" name="hl.simple.post" id="hl_simple_post" value="</em>">++ <label for="hl_requireFieldMatch" class="checkbox">+ <input type="checkbox" name="hl.requireFieldMatch" id="hl_requireFieldMatch" value="true">+ hl.requireFieldMatch+ </label>++ <label for="hl_usePhraseHighlighter" class="checkbox">+ <input type="checkbox" name="hl.usePhraseHighlighter" id="hl_usePhraseHighlighter" value="true">+ hl.usePhraseHighlighter+ </label>++ <label for="hl_highlightMultiTerm" class="checkbox">+ <input type="checkbox" name="hl.highlightMultiTerm" id="hl_highlightMultiTerm" value="true">+ hl.highlightMultiTerm+ </label>++ </div>+ </fieldset>++ <fieldset class="optional">+ <legend>+ <label for="facet" class="checkbox">+ <input type="checkbox" name="facet" id="facet" value="true">+ facet+ </label>+ </legend>+ <div class="fieldset">++ <label for="facet_query">facet.query</label>+ <textarea name="facet.query" id="facet_query"></textarea>++ <label for="facet_field">facet.field</label>+ <input type="text" name="facet.field" id="facet_field">++ <label for="facet_prefix">facet.prefix</label>+ <input type="text" name="facet.prefix" id="facet_prefix">++ </div>+ </fieldset>++ <fieldset class="optional">+ <legend>+ <label for="spatial" class="checkbox">+ <input type="checkbox" name="spatial" id="spatial" value="true">+ spatial+ </label>+ </legend>+ <div class="fieldset">++ <label for="pt">pt</label>+ <input type="text" name="pt" id="pt">++ <label for="sfield">sfield</label>+ <input type="text" name="sfield" id="sfield">++ <label for="d">d</label>+ <input type="text" name="d" id="d">++ </div>+ </fieldset>++ <fieldset class="optional">+ <legend>+ <label for="spellcheck" class="checkbox">+ <input type="checkbox" name="spellcheck" id="spellcheck" value="true">+ spellcheck+ </label>+ </legend>+ <div class="fieldset">++ <label for="spellcheck_build" class="checkbox">+ <input type="checkbox" name="spellcheck.build" id="spellcheck_build" value="true">+ spellcheck.build+ </label>++ <label for="spellcheck_reload" class="checkbox">+ <input type="checkbox" name="spellcheck.reload" id="spellcheck_reload" value="true">+ spellcheck.reload+ </label>++ <label for="spellcheck_q">spellcheck.q</label>+ <input type="text" name="spellcheck.q" id="spellcheck_q">++ <label for="spellcheck_dictionary">spellcheck.dictionary</label>+ <input type="text" name="spellcheck.dictionary" id="spellcheck_dictionary">++ <label for="spellcheck_count">spellcheck.count</label>+ <input type="text" name="spellcheck.count" id="spellcheck_count">++ <label for="spellcheck_onlyMorePopular" class="checkbox">+ <input type="checkbox" name="spellcheck.onlyMorePopular" id="spellcheck_onlyMorePopular" value="true">+ spellcheck.onlyMorePopular+ </label>++ <label for="spellcheck_extendedResults" class="checkbox">+ <input type="checkbox" name="spellcheck.extendedResults" id="spellcheck_extendedResults" value="true">+ spellcheck.extendedResults+ </label>++ <label for="spellcheck_collate" class="checkbox">+ <input type="checkbox" name="spellcheck.collate" id="spellcheck_collate" value="true">+ spellcheck.collate+ </label>++ <label for="spellcheck_maxCollations">spellcheck.maxCollations</label>+ <input type="text" name="spellcheck.maxCollations" id="spellcheck_maxCollations">++ <label for="spellcheck_maxCollationTries">spellcheck.maxCollationTries</label>+ <input type="text" name="spellcheck.maxCollationTries" id="spellcheck_maxCollationTries">++ <label for="spellcheck_accuracy">spellcheck.accuracy</label>+ <input type="text" name="spellcheck.accuracy" id="spellcheck_accuracy">++ </fieldset>+++ <button type="submit">Execute Query</button>++ </form>++ </div>++ <div id="result">++ <div id="url">++ <input type="text" readonly="readonly">++ </div>++ <div id="response">++ <iframe src="about:blank"></iframe>++ </div>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/replication.html b/solr/src/webapp/web/tpl/replication.htmlnew file mode 100644index 00000000000..85c2151d3f2--- /dev/null+++ b/solr/src/webapp/web/tpl/replication.html@@ -0,0 +1,184 @@+<div id="replication" class="clearfix">++ <div id="frame">++ <div id="error"></div>++ <div class="replicating block">++ <div id="progress">++ <div id="start"><div class="info">++ <span>Wed May 11 19:41:48 UTC 2011</span>++ </div></div>++ <div id="speed"><div class="info">++ <span>5.1 MB</span>/s++ </div></div>++ <div id="bar">++ <div id="bar-info"><div class="info">++ <div class="files"><span>24</span> Files</div>+ <div class="size"><span>226.85 MB</span></div>++ </div></div>++ <div id="eta"><div class="info">++ ETA: <span>25s</span>++ </div></div>++ <div id="done" style="width: 20.0%;">++ <div class="percent">++ <span>20</span>%++ </div>++ <div id="done-info"><div class="info">++ <div class="files"><span>2</span> Files</div>+ <div class="size"><span>91.76 MB</span></div>++ </div></div>++ </div>++ </div>++ </div>++ <div id="current-file" class="clearfix">++ <div class="label"><span class="loader">Current File:</span></div>+ <div class="file">_a.fdt</div>+ <div class="progress">+ <span class="done">84 MB</span> / <span class="total">102.98 MB</span> [<span class="percent">81</span>%]+ </div>++ </div>++ </div>++ <div id="iterations" class="slaveOnly block clearfix">++ <div class="label"><span class="">Iterations:</span></div>+ <div class="iterations">+ <ul>+ </ul>+ <a>+ <span class="expand">Show all Iterations</span>+ <span class="collapse">Hide past Iterations</span>+ </a>+ </div>++ </div>++ <div id="details" class="block clearfix">++ <table border="0" cellspacing="0" cellpadding="0">++ <thead>++ <tr>++ <td><span>Index</span></td>+ <th>Version</th>+ <th><abbr title="Generation">Gen</abbr></th>+ <th>Size</th>++ </tr>++ </thead>+ <tbody>++ <tr class="master">++ <th>Master:</th>+ <td class="version"><div></div></td>+ <td class="generation"><div></div></td>+ <td class="size"><div></div></td>++ </tr>++ <tr class="slave slaveOnly">++ <th>Slave:</th>+ <td class="version"><div></div></td>+ <td class="generation"><div></div></td>+ <td class="size"><div></div></td>++ </tr>++ </tbody>++ </table>++ </div>++ <div id="settings" class="settings block clearfix slaveOnly">++ <div class="label"><span>Settings:</span></div>+ <ul>+ <li class="masterUrl"><dl class="clearfix">+ <dt>master url:</dt>+ <dd></dd>+ </dl></li>+ <li class="isPollingDisabled"><dl class="clearfix">+ <dt>polling enable:</dt>+ <dd class="ico"> </dd>+ </dl></li>+ </ul>++ </div>++ <div id="master-settings" class="settings block clearfix">++ <div class="label"><span>Settings (Master):</span></div>+ <ul>+ <li class="replicationEnabled"><dl class="clearfix">+ <dt>replication enable:</dt>+ <dd class="ico"> </dd>+ </dl></li>+ <li class="replicateAfter"><dl class="clearfix">+ <dt>replicateAfter:</dt>+ <dd></dd>+ </dl></li>+ <li class="confFiles"><dl class="clearfix">+ <dt>confFiles:</dt>+ <dd></dd>+ </dl></li>+ </ul>++ </div>++ </div>++ <div id="navigation">++ <button class="refresh-status">Refresh Status</button>++ <div class="slaveOnly">+ <button class="optional replicate-now" data-command="fetchindex">Replicate now</button>+ <button class="optional abort-replication" data-command="abortfetch">Abort Replication</button>++ <button class="optional disable-polling" data-command="disablepoll">Disable Polling</button>+ <button class="optional enable-polling" data-command="enablepoll">Enable Polling</button>+ </div>++ <div class="masterOnly">+ <button class="optional disable-replication" data-command="disablereplication">Disable Replication</button>+ <button class="optional enable-replication" data-command="enablereplication">Enable Replication</button>+ </div>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/schema-browser.html b/solr/src/webapp/web/tpl/schema-browser.htmlnew file mode 100644index 00000000000..a5a6154373e--- /dev/null+++ b/solr/src/webapp/web/tpl/schema-browser.html@@ -0,0 +1,24 @@+<div id="schema-browser" class="loaded">++ <div class="clearfix">++ <div id="data">++ #data++ </div>++ <div id="related">++ <select>+ <option value="" selected="selected">Please select ..</option>+ </select>++ <dl>+ </dl>++ </div>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/schema-browser_dynamic-field.html b/solr/src/webapp/web/tpl/schema-browser_dynamic-field.htmlnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/solr/src/webapp/web/tpl/schema-browser_field.html b/solr/src/webapp/web/tpl/schema-browser_field.htmlnew file mode 100644index 00000000000..1cbc3a6e589--- /dev/null+++ b/solr/src/webapp/web/tpl/schema-browser_field.html@@ -0,0 +1,109 @@+<div id="field">++ <div class="field-options">++ <dl class="options clearfix">++ <dt class="field-type">Field-Type:</dt>++ <dt class="properties">Properties:</dt>++ <dt class="schema">Schema:</dt>++ <dt class="index">Index:</dt>++ <dt class="position-increment-gap"><abbr title="Position Increment Gap">PI Gap</abbr>:</dt>++ <dt class="docs">Docs:</dt>++ <dt class="distinct">Distinct:</dt>++ </dl>++ <ul class="analyzer">+ <li class="clearfix index">++ <p>Index Analyzer:</p>+ <dl>+ <dt></dt>+ </dl>++ <ul>+ <li class="clearfix tokenizer">+ <p>Tokenizer:</p>+ <dl>+ </dl>+ </li>+ <li class="clearfix filters">+ <p>Filters:</p>+ <dl>+ </dl>+ </li>+ </ul>++ </li>+ <li class="clearfix query">++ <p>Query Analyzer:</p>+ <dl>+ <dt></dt>+ </dl>++ <ul>+ <li class="clearfix tokenizer">+ <p>Tokenizer:</p>+ <dl>+ </dl>+ </li>+ <li class="clearfix filters">+ <p>Filters:</p>+ <dl>+ </dl>+ </li>+ </ul>++ </li>+ </ul>++ </div>++ <div class="topterms-holder">++ <p class="head">Top <span class="shown"></span><span class="max-holder">/<span class="max"></span></span> Terms:</p>++ <table border="0" cellspacing="0" cellpadding="0">++ <thead>++ <tr>++ <th class="position" title="Position"> </th>+ <th class="term">Term</th>+ <th class="frequency" title="Frequency">Frq</th>++ </tr>++ </thead>++ </table>++ <p class="navi clearfix">+ <a class="less"><span>less</span></a>+ <a class="more"><span>more</span></a>+ </p>++ </div>++ <div class="histogram-holder">++ <p class="head">Histogram:</p>++ <div class="histogram"></div>++ <dl class="clearfix">++ </dl>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/schema-browser_index.html b/solr/src/webapp/web/tpl/schema-browser_index.htmlnew file mode 100644index 00000000000..f872f11f5ec--- /dev/null+++ b/solr/src/webapp/web/tpl/schema-browser_index.html@@ -0,0 +1,11 @@+<div id="index">++ <dl class="clearfix">++ <dt class="unique-key-field">Unique Key Field:</dt>++ <dt class="default-search-field">Default Search Field:</dt>++ </dl>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/tpl/schema-browser_type.html b/solr/src/webapp/web/tpl/schema-browser_type.htmlnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/solr/src/webapp/web/tpl/threads.html b/solr/src/webapp/web/tpl/threads.htmlnew file mode 100644index 00000000000..ab384ea465a--- /dev/null+++ b/solr/src/webapp/web/tpl/threads.html@@ -0,0 +1,29 @@+<div id="threads">++ <div id="thread-dump">++ <table border="0" cellpadding="0" cellspacing="0">++ <thead>++ <tr>++ <td class="ico spacer"> </td>+ <th>id</th>+ <th>name</th>+ <th>cpuTime</th>+ <th>userTime</th>++ </tr>++ </thead>++ <tbody>++ </tbody>++ </table>++ </div>++</div>\ No newline at end of filediff --git a/solr/src/webapp/web/zookeeper.jsp b/solr/src/webapp/web/zookeeper.jspnew file mode 100644index 00000000000..bc549c0579f--- /dev/null+++ b/solr/src/webapp/web/zookeeper.jsp@@ -0,0 +1,506 @@+<%@ page contentType="application/json; charset=utf-8" pageEncoding="UTF-8" %>+<%@ page trimDirectiveWhitespaces="true" %>++<%@ page import="javax.servlet.jsp.JspWriter" %>+<%@ page import="java.io.IOException" %>+<%@ page import="org.apache.zookeeper.*" %>+<%@ page import="org.apache.zookeeper.data.Stat" %>+<%@ page import="org.apache.solr.core.*" %>+<%@ page import="org.apache.solr.cloud.*" %>+<%@ page import="org.apache.solr.common.cloud.*" %>+<%@ page import="org.apache.solr.common.util.*" %>+<%@ page import="java.util.concurrent.TimeoutException" %>+<%@ page import="java.io.*" %>+<%@ page import="java.util.*" %>+<%@ page import="java.net.URLEncoder" %>++<% SolrCore core = (SolrCore)request.getAttribute( "org.apache.solr.SolrCore" ); %>++<%!++static class ZKPrinter+{++ static boolean FULLPATH_DEFAULT = false;++ boolean indent = true;+ boolean fullpath = FULLPATH_DEFAULT;+ boolean detail = false;++ String addr; // the address passed to us+ String keeperAddr; // the address we're connected to++ boolean doClose; // close the client after done if we opened it++ HttpServletResponse response;+ JspWriter out;+ SolrZkClient zkClient;++ private boolean levelchange;+ int level;+ int maxData = 95;++ public ZKPrinter(HttpServletResponse response, JspWriter out, SolrCore core, String addr)+ throws IOException+ {+ this.response = response;+ this.out = out;+ this.addr = addr;++ if (addr == null)+ {+ ZkController controller = core.getCoreDescriptor().getCoreContainer().getZkController();+ if (controller != null)+ {+ // this core is zk enabled+ keeperAddr = controller.getZkServerAddress();+ zkClient = controller.getZkClient();+ if (zkClient != null && zkClient.isConnected())+ {+ return;+ }+ else+ {+ // try a different client with this address+ addr = keeperAddr;+ }+ }+ }++ keeperAddr = addr;+ if (addr == null)+ {+ response.setStatus(404);+ out.println+ (+ "{" ++ "\"status\": 404" ++ ", \"error\" : \"Zookeeper is not configured for this Solr Core. Please try connecting to an alternate zookeeper address.\"" ++ "}"+ );+ return;+ }++ try+ {+ zkClient = new SolrZkClient(addr, 10000);+ doClose = true;+ }+ catch (TimeoutException e)+ {+ response.setStatus(503);+ out.println+ (+ "{" ++ "\"status\": 503" ++ ", \"error\" : \"Could not connect to zookeeper at '" + addr + "'\"" ++ "}"+ );+ zkClient = null;+ return;+ }+ catch (InterruptedException e)+ {+ // Restore the interrupted status+ Thread.currentThread().interrupt();+ response.setStatus(503);+ out.println+ (+ "{" ++ "\"status\": 503" ++ ", \"error\" : \"Could not connect to zookeeper at '" + addr + "'\"" ++ "}"+ );+ zkClient = null;+ return;+ }++ }++ public void close()+ {+ try+ {+ if (doClose)+ {+ zkClient.close();+ }+ } catch (InterruptedException e)+ {+ // ignore exception on close+ }+ }++ // main entry point+ void print(String path) throws IOException+ {+ if (zkClient == null)+ {+ return;+ }++ // normalize path+ if (path == null)+ {+ path = "/";+ }+ else+ {+ path.trim();+ if (path.length() == 0)+ {+ path = "/";+ }+ }++ if (path.endsWith("/") && path.length() > 1)+ {+ path = path.substring(0, path.length() - 1);+ }++ int idx = path.lastIndexOf('/');+ String parent = idx >= 0 ? path.substring(0, idx) : path;+ if (parent.length() == 0)+ {+ parent = "/";+ }++ out.println("{");++ if (detail)+ {+ printZnode(path);+ out.println(", ");+ }++ out.println("\"tree\" : [");+ printTree(path);+ out.println("]");++ out.println("}");+ }++ void exception(Exception e)+ {+ try+ {+ response.setStatus(500);+ out.println+ (+ "{" ++ "\"status\": 500" ++ ", \"error\" : \"" + e.toString() + "\"" ++ "}"+ );+ }+ catch (IOException e1)+ {+ // nothing we can do+ }+ }++ void xmlescape(String s)+ {+ try+ {+ XML.escapeCharData(s, out);+ }+ catch (IOException e)+ {+ throw new RuntimeException(e);+ }+ }++ // collapse all whitespace to a single space or escaped newline+ String compress(String str) {+ StringBuilder sb = new StringBuilder();+ for (int i = 0; i < str.length(); i++) {+ char ch = str.charAt(i);+ boolean whitespace = false;+ boolean newline = false;+ while (Character.isWhitespace(ch)) {+ whitespace = true;+ if (ch == '\n')+ newline = true;+ if (++i >= str.length())+ return sb.toString();+ ch = str.charAt(i);+ }++ if (newline) {+ // sb.append("\\n");+ sb.append(" "); // collapse newline to two spaces+ } else if (whitespace) {+ sb.append(' ');+ }++ // TODO: handle non-printable chars+ sb.append(ch);++ if (sb.length() >= maxData)+ return sb.toString() + " ...";+ }+ return sb.toString();+ }++ void url(String label, String path, boolean detail) throws IOException {+ try {+ out.print("<a href=\"zookeeper.jsp?");+ if (path != null) {+ out.print("path=");+ out.print(URLEncoder.encode(path, "UTF-8"));+ }+ if (detail) {+ out.print("&detail=" + detail);+ }+ if (fullpath != FULLPATH_DEFAULT) {+ out.print("&fullpath=" + fullpath);+ }+ if (addr != null) {+ out.print("&addr=");+ out.print(URLEncoder.encode(addr, "UTF-8"));+ }++ out.print("\">");+ xmlescape(label);+ out.print("</a>");++ } catch (UnsupportedEncodingException e) {+ exception(e);+ }+ }++ void printTree(String path) throws IOException+ {+ String label = path;+ if (!fullpath)+ {+ int idx = path.lastIndexOf('/');+ label = idx > 0 ? path.substring(idx + 1) : path;+ }++ //url(label, path, true);+ out.println("{");+ out.println("\"data\" : \"" + label + "\"");++ Stat stat = new Stat();+ try+ {+ byte[] data = zkClient.getData(path, null, stat);++ if( stat.getEphemeralOwner() != 0 )+ {+ out.println(", \"ephemeral\" : true");+ out.println(", \"version\" : \"" + stat.getVersion() + "\"");+ }++ /*+ if (stat.getNumChildren() != 0)+ {+ out.println(", \"children_count\" : \"" + stat.getNumChildren() + "\"");+ }+ */++ //if (data != null)+ if( stat.getDataLength() != 0 )+ {++ String str;+ try+ {+ str = new String(data, "UTF-8");+ str = str.replaceAll("\\\"", "\\\\\"");++ out.print(", \"content\" : \"");+ //xmlescape(compress(str));+ out.print(compress(str));+ out.println("\"");+ }+ catch (UnsupportedEncodingException e)+ {+ // not UTF8+ StringBuilder sb = new StringBuilder("BIN(");+ sb.append("len=" + data.length);+ sb.append("hex=");+ int limit = Math.min(data.length, maxData / 2);+ for (int i = 0; i < limit; i++)+ {+ byte b = data[i];+ sb.append(StrUtils.HEX_DIGITS[(b >> 4) & 0xf]);+ sb.append(StrUtils.HEX_DIGITS[b & 0xf]);+ }+ if (limit != data.length)+ {+ sb.append("...");+ }+ sb.append(")");+ str = sb.toString();+ //out.print(str);+ }+ }++ }+ catch (IllegalArgumentException e)+ {+ // path doesn't exist (must have been removed)+ out.println("(path gone)");+ }+ catch (KeeperException e)+ {+ e.printStackTrace();+ }+ catch (InterruptedException e)+ {+ e.printStackTrace();+ }++ if( stat.getNumChildren() > 0 )+ {+ out.print(", \"children\" : [");++ List<String> children = null;+ try+ {+ children = zkClient.getChildren(path, null);+ }+ catch (KeeperException e)+ {+ exception(e);+ return;+ }+ catch (InterruptedException e)+ {+ exception(e);+ }+ catch (IllegalArgumentException e)+ {+ // path doesn't exist (must have been removed)+ out.println("(children gone)");+ }++ Integer i = 0;+ for( String child : children )+ {+ if( 0 != i )+ {+ out.print(", ");+ }++ String childPath = path + (path.endsWith("/") ? "" : "/") + child;+ printTree( childPath );++ i++;+ }++ out.println("]");+ }++ out.println("}");+ }++ String time(long ms) {+ return (new Date(ms)).toString() + " (" + ms + ")";+ }++ void printZnode(String path) throws IOException+ {+ try+ {+ Stat stat = new Stat();+ byte[] data = zkClient.getData(path, null, stat);++ out.println("\"znode\" : {");++ out.print("\"path\" : \"");+ xmlescape(path);+ out.println("\"");++ out.println(", \"version\" : \"" + stat.getVersion() + "\"");+ out.println(", \"aversion\" : \"" + stat.getAversion() + "\"");+ out.println(", \"cversion\" : \"" + stat.getCversion() + "\"");+ out.println(", \"ctime\" : \"" + time(stat.getCtime()) + "\"");+ out.println(", \"mtime\" : \"" + time(stat.getMtime()) + "\"");+ out.println(", \"czxid\" : \"" + stat.getCzxid() + "\"");+ out.println(", \"mzxid\" : \"" + stat.getMzxid() + "\"");+ out.println(", \"pzxid\" : \"" + stat.getPzxid() + "\"");+ out.println(", \"children_count\" : \"" + stat.getNumChildren() + "\"");+ out.println(", \"ephemeralOwner\" : \"" + stat.getEphemeralOwner() + "\"");+ out.println(", \"dataLength\" : \"" + stat.getDataLength() + "\"");++ if( stat.getDataLength() != 0 )+ {+ boolean isBinary = false;+ String str;+ try+ {+ str = new String(data, "UTF-8");+ }+ catch (UnsupportedEncodingException e)+ {+ // The results are unspecified+ // when the bytes are not properly encoded.++ // not UTF8+ StringBuilder sb = new StringBuilder(data.length * 2);+ for (int i = 0; i < data.length; i++)+ {+ byte b = data[i];+ sb.append(StrUtils.HEX_DIGITS[(b >> 4) & 0xf]);+ sb.append(StrUtils.HEX_DIGITS[b & 0xf]);+ if ((i & 0x3f) == 0x3f)+ {+ sb.append("\n");+ }+ }+ str = sb.toString();+ }+ str = str.replaceAll("\\\"", "\\\\\"");++ out.print(", \"data\" : \"");+ //xmlescape(str);+ out.print(str);+ out.println("\"");+ }++ out.println("}");++ }+ catch (KeeperException e)+ {+ exception(e);+ return;+ }+ catch (InterruptedException e)+ {+ exception(e);+ }+ }++ }++%>++<%++String path = request.getParameter("path");+String addr = request.getParameter("addr");++if (addr != null && addr.length() == 0)+{+ addr = null;+}++String detailS = request.getParameter("detail");+boolean detail = detailS != null && detailS.equals("true");++ZKPrinter printer = new ZKPrinter(response, out, core, addr);+printer.detail = detail;+String tryAddr = printer.keeperAddr != null ? printer.keeperAddr : "localhost:2181";++try {+ printer.print(path);+} finally {+ printer.close();+}++%>\ No newline at end of file