You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by tf...@apache.org on 2017/05/19 00:13:22 UTC

[01/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10666: Add rank transformation Stream Evaluator

Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-10233 6e5894e88 -> ef736a15b


SOLR-10666: Add rank transformation Stream Evaluator


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/6e41ac7a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6e41ac7a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6e41ac7a

Branch: refs/heads/jira/solr-10233
Commit: 6e41ac7a3ba7a45a4d42b9f6b047350ff5d769ae
Parents: 680dcc1
Author: Joel Bernstein <jb...@apache.org>
Authored: Sat May 13 16:25:03 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Mon May 15 11:26:05 2017 -0400

----------------------------------------------------------------------
 .../org/apache/solr/handler/StreamHandler.java  |  1 +
 .../client/solrj/io/stream/RankEvaluator.java   | 75 ++++++++++++++++++++
 .../solrj/io/stream/StreamExpressionTest.java   | 58 +++++++++++++++
 3 files changed, 134 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6e41ac7a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index bc17f9b..bd8e5da 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -175,6 +175,7 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
       .withFunctionName("normalize", NormalizeEvaluator.class)
       .withFunctionName("rev", ReverseEvaluator.class)
       .withFunctionName("length", LengthEvaluator.class)
+      .withFunctionName("rank", RankEvaluator.class)
 
       // metrics
          .withFunctionName("min", MinMetric.class)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6e41ac7a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankEvaluator.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankEvaluator.java
new file mode 100644
index 0000000..2084928
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankEvaluator.java
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+package org.apache.solr.client.solrj.io.stream;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.math3.stat.ranking.NaturalRanking;
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.eval.ComplexEvaluator;
+import org.apache.solr.client.solrj.io.eval.StreamEvaluator;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+
+public class RankEvaluator extends ComplexEvaluator implements Expressible {
+
+  private static final long serialVersionUID = 1;
+
+  public RankEvaluator(StreamExpression expression, StreamFactory factory) throws IOException {
+    super(expression, factory);
+  }
+
+  public List<Number> evaluate(Tuple tuple) throws IOException {
+    StreamEvaluator colEval = subEvaluators.get(0);
+
+    List<Number> numbers = (List<Number>)colEval.evaluate(tuple);
+    double[] values = new double[numbers.size()];
+    for(int i=0; i<numbers.size(); i++) {
+      values[i] = numbers.get(i).doubleValue();
+    }
+
+    NaturalRanking rank = new NaturalRanking();
+    double[] ranked = rank.rank(values);
+    List<Number> rankedList = new ArrayList();
+    for(int i=0; i<numbers.size(); i++) {
+      rankedList.add(ranked[i]);
+    }
+
+    return rankedList;
+  }
+
+  @Override
+  public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException {
+    StreamExpression expression = new StreamExpression(factory.getFunctionName(getClass()));
+    return expression;
+  }
+
+  @Override
+  public Explanation toExplanation(StreamFactory factory) throws IOException {
+    return new Explanation(nodeId.toString())
+        .withExpressionType(ExpressionType.EVALUATOR)
+        .withFunctionName(factory.getFunctionName(getClass()))
+        .withImplementingClass(getClass().getName())
+        .withExpression(toExpression(factory).toString());
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6e41ac7a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 4ba7ab4..ad8a6b2 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -5349,6 +5349,64 @@ public class StreamExpressionTest extends SolrCloudTestCase {
     assertTrue(reverse.get(3).doubleValue() == 100D);
   }
 
+  @Test
+  public void testRankTransform() throws Exception {
+    UpdateRequest updateRequest = new UpdateRequest();
+
+    int i=0;
+    while(i<50) {
+      updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2016", "5", "1"), "price_f", "400.00");
+    }
+
+    while(i<100) {
+      updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2015", "5", "1"), "price_f", "300.0");
+    }
+
+    while(i<150) {
+      updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2014", "5", "1"), "price_f", "500.0");
+    }
+
+    while(i<250) {
+      updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2013", "5", "1"), "price_f", "100.00");
+    }
+
+    updateRequest.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+
+    String expr = "timeseries("+COLLECTIONORALIAS+", q=\"*:*\", start=\"2013-01-01T01:00:00.000Z\", " +
+        "end=\"2016-12-01T01:00:00.000Z\", " +
+        "gap=\"+1YEAR\", " +
+        "field=\"test_dt\", " +
+        "count(*), sum(price_f), max(price_f), min(price_f))";
+
+    String cexpr = "let(a="+expr+", c=col(a, max(price_f)), tuple(reverse=rev(c), ranked=rank(c)))";
+
+    ModifiableSolrParams paramsLoc = new ModifiableSolrParams();
+    paramsLoc.set("expr", cexpr);
+    paramsLoc.set("qt", "/stream");
+
+    String url = cluster.getJettySolrRunners().get(0).getBaseUrl().toString()+"/"+COLLECTIONORALIAS;
+    TupleStream solrStream = new SolrStream(url, paramsLoc);
+
+    StreamContext context = new StreamContext();
+    solrStream.setStreamContext(context);
+    List<Tuple> tuples = getTuples(solrStream);
+    assertTrue(tuples.size() == 1);
+    List<Number> reverse = (List<Number>)tuples.get(0).get("reverse");
+    assertTrue(reverse.size() == 4);
+    assertTrue(reverse.get(0).doubleValue() == 400D);
+    assertTrue(reverse.get(1).doubleValue() == 300D);
+    assertTrue(reverse.get(2).doubleValue() == 500D);
+    assertTrue(reverse.get(3).doubleValue() == 100D);
+
+    List<Number> ranked = (List<Number>)tuples.get(0).get("ranked");
+    assertTrue(ranked.size() == 4);
+    assertTrue(ranked.get(0).doubleValue() == 1D);
+    assertTrue(ranked.get(1).doubleValue() == 4D);
+    assertTrue(ranked.get(2).doubleValue() == 2D);
+    assertTrue(ranked.get(3).doubleValue() == 3D);
+  }
+
+
 
 
   @Test


[04/50] [abbrv] lucene-solr:jira/solr-10233: Add missing CHANGES entry.

Posted by tf...@apache.org.
Add missing CHANGES entry.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/85167838
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/85167838
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/85167838

Branch: refs/heads/jira/solr-10233
Commit: 851678388d749e56ac5df590b94db78c5dbec2d0
Parents: 1721036
Author: Adrien Grand <jp...@gmail.com>
Authored: Tue May 16 11:34:23 2017 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Tue May 16 11:34:48 2017 +0200

----------------------------------------------------------------------
 lucene/CHANGES.txt | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85167838/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 8693e24..bbdc7bd 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -134,6 +134,9 @@ Bug Fixes
 * LUCENE-7824: Fix graph query analysis for multi-word synonym rules with common terms (eg. new york, new york city).
   (Jim Ferenczi)
 
+* LUCENE-7817: Pass cached query to onQueryCache instead of null.
+  (Christoph Kaser via Adrien Grand)
+
 Improvements
 
 * LUCENE-7782: OfflineSorter now passes the total number of items it


[38/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7838: Remove unused imports.

Posted by tf...@apache.org.
LUCENE-7838: Remove unused imports.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c9bdce93
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c9bdce93
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c9bdce93

Branch: refs/heads/jira/solr-10233
Commit: c9bdce937a52e80174ce22f4e82a02da736b56c4
Parents: 06a6034
Author: Adrien Grand <jp...@gmail.com>
Authored: Thu May 18 16:36:14 2017 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Thu May 18 16:36:14 2017 +0200

----------------------------------------------------------------------
 .../lucene/classification/KNearestFuzzyClassifierTest.java      | 5 -----
 1 file changed, 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c9bdce93/lucene/classification/src/test/org/apache/lucene/classification/KNearestFuzzyClassifierTest.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/test/org/apache/lucene/classification/KNearestFuzzyClassifierTest.java b/lucene/classification/src/test/org/apache/lucene/classification/KNearestFuzzyClassifierTest.java
index 6e4c404..1f70eb4 100644
--- a/lucene/classification/src/test/org/apache/lucene/classification/KNearestFuzzyClassifierTest.java
+++ b/lucene/classification/src/test/org/apache/lucene/classification/KNearestFuzzyClassifierTest.java
@@ -16,12 +16,7 @@
  */
 package org.apache.lucene.classification;
 
-import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.analysis.Tokenizer;
-import org.apache.lucene.analysis.core.KeywordTokenizer;
-import org.apache.lucene.analysis.ngram.EdgeNGramTokenFilter;
-import org.apache.lucene.analysis.reverse.ReverseStringFilter;
 import org.apache.lucene.classification.utils.ConfusionMatrixGenerator;
 import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.MultiFields;


[26/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/jquery.ajaxfileupload.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/jquery.ajaxfileupload.js b/solr/webapp/web/js/lib/jquery.ajaxfileupload.js
deleted file mode 100644
index 272976a..0000000
--- a/solr/webapp/web/js/lib/jquery.ajaxfileupload.js
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
-* Copyright (c) 2011 Jordan Feldstein
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-// Original code from: https://github.com/jfeldstein/jQuery.AjaxFileUpload.js https://github.com/jfeldstein/jQuery.AjaxFileUpload.js/commit/9dd56b4161cbed138287d3ae29a476bb59eb5fc4
-// All modifications are BSD licensed
-// GSI: Modifications made to support immediate upload
-/*
- //
- //  - Ajaxifies an individual <input type="file">
- //  - Files are sandboxed. Doesn't matter how many, or where they are, on the page.
- //  - Allows for extra parameters to be included with the file
- //  - onStart callback can cancel the upload by returning false
- */
-
-
-(function ($) {
-  $.fn.ajaxfileupload = function (options) {
-    var settings = {
-      params: {},
-      action: '',
-      onStart: function () {
-        console.log('starting upload');
-        console.log(this);
-      },
-      onComplete: function (response) {
-        console.log('got response: ');
-        console.log(response);
-        console.log(this);
-      },
-      onCancel: function () {
-        console.log('cancelling: ');
-        console.log(this);
-      },
-      validate_extensions: true,
-      valid_extensions: ['gif', 'png', 'jpg', 'jpeg'],
-      submit_button: null,
-      upload_now: false
-    };
-
-    var uploading_file = false;
-
-    if (options) {
-      $.extend(settings, options);
-    }
-
-
-    // 'this' is a jQuery collection of one or more (hopefully)
-    //  file elements, but doesn't check for this yet
-    return this.each(function () {
-      var $element = $(this);
-      /*
-       // Internal handler that tries to parse the response
-       //  and clean up after ourselves.
-       */
-      var handleResponse = function (loadedFrame, element) {
-        var response, responseStr = loadedFrame.contentWindow.document.body.innerHTML;
-        try {
-          //response = $.parseJSON($.trim(responseStr));
-          response = JSON.parse(responseStr);
-        } catch (e) {
-          response = responseStr;
-        }
-
-        // Tear-down the wrapper form
-        element.siblings().remove();
-        element.unwrap();
-
-        uploading_file = false;
-
-        // Pass back to the user
-        settings.onComplete.apply(element, [response, settings.params]);
-      };
-      /*
-       // Wraps element in a <form> tag, and inserts hidden inputs for each
-       //  key:value pair in settings.params so they can be sent along with
-       //  the upload. Then, creates an iframe that the whole thing is
-       //  uploaded through.
-       */
-      var wrapElement = function (element) {
-        // Create an iframe to submit through, using a semi-unique ID
-        var frame_id = 'ajaxUploader-iframe-' + Math.round(new Date().getTime() / 1000)
-        $('body').after('<iframe width="0" height="0" style="display:none;" name="' + frame_id + '" id="' + frame_id + '"/>');
-        $('#' + frame_id).load(function () {
-          handleResponse(this, element);
-        });
-        console.log("settings.action: " + settings.action);
-        // Wrap it in a form
-        element.wrap(function () {
-          return '<form action="' + settings.action + '" method="POST" enctype="multipart/form-data" target="' + frame_id + '" />'
-        })
-          // Insert <input type='hidden'>'s for each param
-            .before(function () {
-              var key, html = '';
-              for (key in settings.params) {
-                var paramVal = settings.params[key];
-                if (typeof paramVal === 'function') {
-                  paramVal = paramVal();
-                }
-                html += '<input type="hidden" name="' + key + '" value="' + paramVal + '" />';
-              }
-              return html;
-            });
-      }
-
-      var upload_file = function () {
-        if ($element.val() == '') return settings.onCancel.apply($element, [settings.params]);
-
-        // make sure extension is valid
-        var ext = $element.val().split('.').pop().toLowerCase();
-        if (true === settings.validate_extensions && $.inArray(ext, settings.valid_extensions) == -1) {
-          // Pass back to the user
-          settings.onComplete.apply($element, [
-            {status: false, message: 'The select file type is invalid. File must be ' + settings.valid_extensions.join(', ') + '.'},
-            settings.params
-          ]);
-        } else {
-          uploading_file = true;
-
-          // Creates the form, extra inputs and iframe used to
-          //  submit / upload the file
-          wrapElement($element);
-
-          // Call user-supplied (or default) onStart(), setting
-          //  its this context to the file DOM element
-          var ret = settings.onStart.apply($element, [settings.params]);
-
-          // let onStart have the option to cancel the upload
-          if (ret !== false) {
-            $element.parent('form').submit(function (e) {
-              e.stopPropagation();
-            }).submit();
-          }
-        }
-      };
-      if (settings.upload_now) {
-        if (!uploading_file) {
-          console.log("uploading now");
-          upload_file();
-        }
-      }
-      // Skip elements that are already setup. May replace this
-      //  with uninit() later, to allow updating that settings
-      if ($element.data('ajaxUploader-setup') === true) return;
-
-      /*
-      $element.change(function () {
-        // since a new image was selected, reset the marker
-        uploading_file = false;
-
-        // only update the file from here if we haven't assigned a submit button
-        if (settings.submit_button == null) {
-          console.log("uploading");
-          upload_file();
-        }
-      });
-      //*/
-
-      if (settings.submit_button == null) {
-        // do nothing
-      } else {
-        settings.submit_button.click(function () {
-          console.log("uploading: " + uploading_file);
-          // only attempt to upload file if we're not uploading
-          if (!uploading_file) {
-            upload_file();
-          }
-        });
-      }
-
-
-      // Mark this element as setup
-      $element.data('ajaxUploader-setup', true);
-
-
-    });
-  }
-})(jQuery)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/jquery.blockUI.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/jquery.blockUI.js b/solr/webapp/web/js/lib/jquery.blockUI.js
deleted file mode 100644
index 6759907..0000000
--- a/solr/webapp/web/js/lib/jquery.blockUI.js
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
-
-The MIT License (MIT)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-/*!
- * jQuery blockUI plugin
- * Version 2.39 (23-MAY-2011)
- * @requires jQuery v1.2.3 or later
- *
- * Examples at: http://malsup.com/jquery/block/
- * Copyright (c) 2007-2010 M. Alsup
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * Thanks to Amir-Hossein Sobhi for some excellent contributions!
- */
-
-;(function($) {
-
-if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {
-  alert('blockUI requires jQuery v1.2.3 or later!  You are using v' + $.fn.jquery);
-  return;
-}
-
-$.fn._fadeIn = $.fn.fadeIn;
-
-var noOp = function() {};
-
-// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
-// retarded userAgent strings on Vista)
-var mode = document.documentMode || 0;
-var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8);
-var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode;
-
-// global $ methods for blocking/unblocking the entire page
-$.blockUI   = function(opts) { install(window, opts); };
-$.unblockUI = function(opts) { remove(window, opts); };
-
-// convenience method for quick growl-like notifications  (http://www.google.com/search?q=growl)
-$.growlUI = function(title, message, timeout, onClose) {
-  var $m = $('<div class="growlUI"></div>');
-  if (title) $m.append('<h1>'+title+'</h1>');
-  if (message) $m.append('<h2>'+message+'</h2>');
-  if (timeout == undefined) timeout = 3000;
-  $.blockUI({
-    message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
-    timeout: timeout, showOverlay: false,
-    onUnblock: onClose, 
-    css: $.blockUI.defaults.growlCSS
-  });
-};
-
-// plugin method for blocking element content
-$.fn.block = function(opts) {
-  return this.unblock({ fadeOut: 0 }).each(function() {
-    if ($.css(this,'position') == 'static')
-      this.style.position = 'relative';
-    if ($.browser.msie)
-      this.style.zoom = 1; // force 'hasLayout'
-    install(this, opts);
-  });
-};
-
-// plugin method for unblocking element content
-$.fn.unblock = function(opts) {
-  return this.each(function() {
-    remove(this, opts);
-  });
-};
-
-$.blockUI.version = 2.39; // 2nd generation blocking at no extra cost!
-
-// override these in your code to change the default behavior and style
-$.blockUI.defaults = {
-  // message displayed when blocking (use null for no message)
-  message:  '<h1>Please wait...</h1>',
-
-  title: null,    // title string; only used when theme == true
-  draggable: true,  // only used when theme == true (requires jquery-ui.js to be loaded)
-  
-  theme: false, // set to true to use with jQuery UI themes
-  
-  // styles for the message when blocking; if you wish to disable
-  // these and use an external stylesheet then do this in your code:
-  // $.blockUI.defaults.css = {};
-  css: {
-    padding:  0,
-    margin:    0,
-    width:    '30%',
-    top:    '40%',
-    left:    '35%',
-    textAlign:  'center',
-    color:    '#000',
-    border:    '3px solid #aaa',
-    backgroundColor:'#fff',
-    cursor:    'wait'
-  },
-  
-  // minimal style set used when themes are used
-  themedCSS: {
-    width:  '30%',
-    top:  '40%',
-    left:  '35%'
-  },
-
-  // styles for the overlay
-  overlayCSS:  {
-    backgroundColor: '#000',
-    opacity:       0.6,
-    cursor:         'wait'
-  },
-
-  // styles applied when using $.growlUI
-  growlCSS: {
-    width:    '350px',
-    top:    '10px',
-    left:     '',
-    right:    '10px',
-    border:   'none',
-    padding:  '5px',
-    opacity:  0.6,
-    cursor:   'default',
-    color:    '#fff',
-    backgroundColor: '#000',
-    '-webkit-border-radius': '10px',
-    '-moz-border-radius':   '10px',
-    'border-radius':      '10px'
-  },
-  
-  // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
-  // (hat tip to Jorge H. N. de Vasconcelos)
-  iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
-
-  // force usage of iframe in non-IE browsers (handy for blocking applets)
-  forceIframe: false,
-
-  // z-index for the blocking overlay
-  baseZ: 1000,
-
-  // set these to true to have the message automatically centered
-  centerX: true, // <-- only effects element blocking (page block controlled via css above)
-  centerY: true,
-
-  // allow body element to be stetched in ie6; this makes blocking look better
-  // on "short" pages.  disable if you wish to prevent changes to the body height
-  allowBodyStretch: true,
-
-  // enable if you want key and mouse events to be disabled for content that is blocked
-  bindEvents: true,
-
-  // be default blockUI will supress tab navigation from leaving blocking content
-  // (if bindEvents is true)
-  constrainTabKey: true,
-
-  // fadeIn time in millis; set to 0 to disable fadeIn on block
-  fadeIn:  200,
-
-  // fadeOut time in millis; set to 0 to disable fadeOut on unblock
-  fadeOut:  400,
-
-  // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
-  timeout: 0,
-
-  // disable if you don't want to show the overlay
-  showOverlay: true,
-
-  // if true, focus will be placed in the first available input field when
-  // page blocking
-  focusInput: true,
-
-  // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
-  applyPlatformOpacityRules: true,
-  
-  // callback method invoked when fadeIn has completed and blocking message is visible
-  onBlock: null,
-
-  // callback method invoked when unblocking has completed; the callback is
-  // passed the element that has been unblocked (which is the window object for page
-  // blocks) and the options that were passed to the unblock call:
-  //   onUnblock(element, options)
-  onUnblock: null,
-
-  // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
-  quirksmodeOffsetHack: 4,
-
-  // class name of the message block
-  blockMsgClass: 'blockMsg'
-};
-
-// private data and functions follow...
-
-var pageBlock = null;
-var pageBlockEls = [];
-
-function install(el, opts) {
-  var full = (el == window);
-  var msg = opts && opts.message !== undefined ? opts.message : undefined;
-  opts = $.extend({}, $.blockUI.defaults, opts || {});
-  opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
-  var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
-  var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
-  msg = msg === undefined ? opts.message : msg;
-
-  // remove the current block (if there is one)
-  if (full && pageBlock)
-    remove(window, {fadeOut:0});
-
-  // if an existing element is being used as the blocking content then we capture
-  // its current place in the DOM (and current display style) so we can restore
-  // it when we unblock
-  if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
-    var node = msg.jquery ? msg[0] : msg;
-    var data = {};
-    $(el).data('blockUI.history', data);
-    data.el = node;
-    data.parent = node.parentNode;
-    data.display = node.style.display;
-    data.position = node.style.position;
-    if (data.parent)
-      data.parent.removeChild(node);
-  }
-
-  $(el).data('blockUI.onUnblock', opts.onUnblock);
-  var z = opts.baseZ;
-
-  // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
-  // layer1 is the iframe layer which is used to supress bleed through of underlying content
-  // layer2 is the overlay layer which has opacity and a wait cursor (by default)
-  // layer3 is the message content that is displayed while blocking
-
-  var lyr1 = ($.browser.msie || opts.forceIframe) 
-    ? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>')
-    : $('<div class="blockUI" style="display:none"></div>');
-  
-  var lyr2 = opts.theme 
-     ? $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>')
-     : $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
-
-  var lyr3, s;
-  if (opts.theme && full) {
-    s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">' +
-        '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' +
-        '<div class="ui-widget-content ui-dialog-content"></div>' +
-      '</div>';
-  }
-  else if (opts.theme) {
-    s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">' +
-        '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' +
-        '<div class="ui-widget-content ui-dialog-content"></div>' +
-      '</div>';
-  }
-  else if (full) {
-    s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
-  }       
-  else {
-    s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
-  }
-  lyr3 = $(s);
-
-  // if we have a message, style it
-  if (msg) {
-    if (opts.theme) {
-      lyr3.css(themedCSS);
-      lyr3.addClass('ui-widget-content');
-    }
-    else 
-      lyr3.css(css);
-  }
-
-  // style the overlay
-  if (!opts.theme && (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform))))
-    lyr2.css(opts.overlayCSS);
-  lyr2.css('position', full ? 'fixed' : 'absolute');
-
-  // make iframe layer transparent in IE
-  if ($.browser.msie || opts.forceIframe)
-    lyr1.css('opacity',0.0);
-
-  //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
-  var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
-  $.each(layers, function() {
-    this.appendTo($par);
-  });
-  
-  if (opts.theme && opts.draggable && $.fn.draggable) {
-    lyr3.draggable({
-      handle: '.ui-dialog-titlebar',
-      cancel: 'li'
-    });
-  }
-
-  // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
-  var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0);
-  if (ie6 || expr) {
-    // give body 100% height
-    if (full && opts.allowBodyStretch && $.boxModel)
-      $('html,body').css('height','100%');
-
-    // fix ie6 issue when blocked element has a border width
-    if ((ie6 || !$.boxModel) && !full) {
-      var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
-      var fixT = t ? '(0 - '+t+')' : 0;
-      var fixL = l ? '(0 - '+l+')' : 0;
-    }
-
-    // simulate fixed position
-    $.each([lyr1,lyr2,lyr3], function(i,o) {
-      var s = o[0].style;
-      s.position = 'absolute';
-      if (i < 2) {
-        full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')
-           : s.setExpression('height','this.parentNode.offsetHeight + "px"');
-        full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
-           : s.setExpression('width','this.parentNode.offsetWidth + "px"');
-        if (fixL) s.setExpression('left', fixL);
-        if (fixT) s.setExpression('top', fixT);
-      }
-      else if (opts.centerY) {
-        if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
-        s.marginTop = 0;
-      }
-      else if (!opts.centerY && full) {
-        var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0;
-        var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
-        s.setExpression('top',expression);
-      }
-    });
-  }
-
-  // show the message
-  if (msg) {
-    if (opts.theme)
-      lyr3.find('.ui-widget-content').append(msg);
-    else
-      lyr3.append(msg);
-    if (msg.jquery || msg.nodeType)
-      $(msg).show();
-  }
-
-  if (($.browser.msie || opts.forceIframe) && opts.showOverlay)
-    lyr1.show(); // opacity is zero
-  if (opts.fadeIn) {
-    var cb = opts.onBlock ? opts.onBlock : noOp;
-    var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
-    var cb2 = msg ? cb : noOp;
-    if (opts.showOverlay)
-      lyr2._fadeIn(opts.fadeIn, cb1);
-    if (msg)
-      lyr3._fadeIn(opts.fadeIn, cb2);
-  }
-  else {
-    if (opts.showOverlay)
-      lyr2.show();
-    if (msg)
-      lyr3.show();
-    if (opts.onBlock)
-      opts.onBlock();
-  }
-
-  // bind key and mouse events
-  bind(1, el, opts);
-
-  if (full) {
-    pageBlock = lyr3[0];
-    pageBlockEls = $(':input:enabled:visible',pageBlock);
-    if (opts.focusInput)
-      setTimeout(focus, 20);
-  }
-  else
-    center(lyr3[0], opts.centerX, opts.centerY);
-
-  if (opts.timeout) {
-    // auto-unblock
-    var to = setTimeout(function() {
-      full ? $.unblockUI(opts) : $(el).unblock(opts);
-    }, opts.timeout);
-    $(el).data('blockUI.timeout', to);
-  }
-};
-
-// remove the block
-function remove(el, opts) {
-  var full = (el == window);
-  var $el = $(el);
-  var data = $el.data('blockUI.history');
-  var to = $el.data('blockUI.timeout');
-  if (to) {
-    clearTimeout(to);
-    $el.removeData('blockUI.timeout');
-  }
-  opts = $.extend({}, $.blockUI.defaults, opts || {});
-  bind(0, el, opts); // unbind events
-
-  if (opts.onUnblock === null) {
-    opts.onUnblock = $el.data('blockUI.onUnblock');
-    $el.removeData('blockUI.onUnblock');
-  }
-
-  var els;
-  if (full) // crazy selector to handle odd field errors in ie6/7
-    els = $('body').children().filter('.blockUI').add('body > .blockUI');
-  else
-    els = $('.blockUI', el);
-
-  if (full)
-    pageBlock = pageBlockEls = null;
-
-  if (opts.fadeOut) {
-    els.fadeOut(opts.fadeOut);
-    setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
-  }
-  else
-    reset(els, data, opts, el);
-};
-
-// move blocking element back into the DOM where it started
-function reset(els,data,opts,el) {
-  els.each(function(i,o) {
-    // remove via DOM calls so we don't lose event handlers
-    if (this.parentNode)
-      this.parentNode.removeChild(this);
-  });
-
-  if (data && data.el) {
-    data.el.style.display = data.display;
-    data.el.style.position = data.position;
-    if (data.parent)
-      data.parent.appendChild(data.el);
-    $(el).removeData('blockUI.history');
-  }
-
-  if (typeof opts.onUnblock == 'function')
-    opts.onUnblock(el,opts);
-};
-
-// bind/unbind the handler
-function bind(b, el, opts) {
-  var full = el == window, $el = $(el);
-
-  // don't bother unbinding if there is nothing to unbind
-  if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
-    return;
-  if (!full)
-    $el.data('blockUI.isBlocked', b);
-
-  // don't bind events when overlay is not in use or if bindEvents is false
-  if (!opts.bindEvents || (b && !opts.showOverlay)) 
-    return;
-
-  // bind anchors and inputs for mouse and key events
-  var events = 'mousedown mouseup keydown keypress';
-  b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);
-
-// former impl...
-//     var $e = $('a,:input');
-//     b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
-};
-
-// event handler to suppress keyboard/mouse events when blocking
-function handler(e) {
-  // allow tab navigation (conditionally)
-  if (e.keyCode && e.keyCode == 9) {
-    if (pageBlock && e.data.constrainTabKey) {
-      var els = pageBlockEls;
-      var fwd = !e.shiftKey && e.target === els[els.length-1];
-      var back = e.shiftKey && e.target === els[0];
-      if (fwd || back) {
-        setTimeout(function(){focus(back)},10);
-        return false;
-      }
-    }
-  }
-  var opts = e.data;
-  // allow events within the message content
-  if ($(e.target).parents('div.' + opts.blockMsgClass).length > 0)
-    return true;
-
-  // allow events for content that is not being blocked
-  return $(e.target).parents().children().filter('div.blockUI').length == 0;
-};
-
-function focus(back) {
-  if (!pageBlockEls)
-    return;
-  var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
-  if (e)
-    e.focus();
-};
-
-function center(el, x, y) {
-  var p = el.parentNode, s = el.style;
-  var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
-  var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
-  if (x) s.left = l > 0 ? (l+'px') : '0';
-  if (y) s.top  = t > 0 ? (t+'px') : '0';
-};
-
-function sz(el, p) {
-  return parseInt($.css(el,p))||0;
-};
-
-})(jQuery);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/jquery.cookie.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/jquery.cookie.js b/solr/webapp/web/js/lib/jquery.cookie.js
deleted file mode 100644
index 03079a5..0000000
--- a/solr/webapp/web/js/lib/jquery.cookie.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-
-The MIT License (MIT)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-/*!
- * jQuery Cookie Plugin
- * https://github.com/carhartl/jquery-cookie
- *
- * Copyright 2011, Klaus Hartl
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.opensource.org/licenses/GPL-2.0
- */
-(function($) {
-    $.cookie = function(key, value, options) {
-
-        // key and at least value given, set cookie...
-        if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) {
-            options = $.extend({}, options);
-
-            if (value === null || value === undefined) {
-                options.expires = -1;
-            }
-
-            if (typeof options.expires === 'number') {
-                var days = options.expires, t = options.expires = new Date();
-                t.setDate(t.getDate() + days);
-            }
-
-            value = String(value);
-
-            return (document.cookie = [
-                encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
-                options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
-                options.path    ? '; path=' + options.path : '',
-                options.domain  ? '; domain=' + options.domain : '',
-                options.secure  ? '; secure' : ''
-            ].join(''));
-        }
-
-        // key and possibly options given, get cookie...
-        options = value || {};
-        var decode = options.raw ? function(s) { return s; } : decodeURIComponent;
-
-        var pairs = document.cookie.split('; ');
-        for (var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) {
-            if (decode(pair[0]) === key) return decode(pair[1] || ''); // IE saves cookies with empty string as "c; ", e.g. without "=" as opposed to EOMB, thus pair[1] may be undefined
-        }
-        return null;
-    };
-})(jQuery);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/jquery.form.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/jquery.form.js b/solr/webapp/web/js/lib/jquery.form.js
deleted file mode 100644
index 114affc..0000000
--- a/solr/webapp/web/js/lib/jquery.form.js
+++ /dev/null
@@ -1,806 +0,0 @@
-/*
-
-The MIT License (MIT)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-/*!
- * 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&amp;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&amp;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);


[21/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/analysis.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/analysis.js b/solr/webapp/web/js/scripts/analysis.js
deleted file mode 100644
index 5fcadaf..0000000
--- a/solr/webapp/web/js/scripts/analysis.js
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
- 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.
-*/
-
-// #/:core/analysis
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(analysis)$' ),
-  function( context )
-  {
-    var active_core = this.active_core;
-    var core_basepath = active_core.attr( 'data-basepath' );
-    var content_element = $( '#content' );
- 
-    $.get
-    (
-      'tpl/analysis.html',
-      function( template )
-      {
-        content_element
-          .html( template );
-                
-        var analysis_element = $( '#analysis', content_element );
-        var analysis_form = $( 'form', analysis_element );
-        var analysis_result = $( '#analysis-result', analysis_element );
-        analysis_result.hide();
-
-        var verbose_link = $( '.verbose_output a', analysis_element );
-
-        var type_or_name = $( '#type_or_name', analysis_form );
-        var schema_browser_element = $( '#tor_schema' );
-        var schema_browser_path = app.core_menu.find( '.schema-browser a' ).attr( 'href' );
-        var schema_browser_map = { 'fieldname' : 'field', 'fieldtype' : 'type' };
-
-        type_or_name
-          .die( 'change' )
-          .live
-          (
-            'change',
-            function( event )
-            {
-              var info = $( this ).val().split( '=' );
-
-              schema_browser_element
-                .attr( 'href', schema_browser_path + '?' + schema_browser_map[info[0]] + '=' + info[1] );
-            }
-          );
-
-        $.ajax
-        (
-          {
-            url : core_basepath + '/admin/luke?wt=json&show=schema',
-            dataType : 'json',
-            context : type_or_name,
-            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.esc() + '">' + field_name.esc() + '</option>'
-                );
-              }
-              if( 0 !== fields.length )
-              {
-                content += '<optgroup label="Fields">' + "\n";
-                content += fields.sort().join( "\n" ) + "\n";
-                content += '</optgroup>' + "\n";
-              }
-                            
-              var types = [];
-              for( var type_name in response.schema.types )
-              {
-                types.push
-                (
-                  '<option value="fieldtype=' + type_name.esc() + '">' + type_name.esc() + '</option>'
-                );
-              }
-              if( 0 !== types.length )
-              {
-                content += '<optgroup label="Types">' + "\n";
-                content += types.sort().join( "\n" ) + "\n";
-                content += '</optgroup>' + "\n";
-              }
-                            
-              this
-                .html( content );
-
-              var defaultSearchField = 'fieldname\=' + ( context.params['analysis.fieldname'] || response.schema.defaultSearchField );
-
-              if( context.params['analysis.fieldtype'] )
-              {
-                defaultSearchField = 'fieldtype\=' + context.params['analysis.fieldtype'];
-              }
-
-              $( 'option[value="' + defaultSearchField + '"]', this )
-                .attr( 'selected', 'selected' );
-
-              this
-                .chosen()
-                .trigger( 'change' );
-
-              var fields = 0;
-              for( var key in context.params )
-              {
-                if( 'string' === typeof context.params[key] && 0 !== context.params[key].length )
-                {
-                  fields++;
-                  $( '[name="' + key + '"]', analysis_form )
-                    .val( context.params[key] );
-                }
-              }
-
-              if( 'undefined' !== typeof context.params.verbose_output )
-              {
-                verbose_link.trigger( 'toggle', !!context.params.verbose_output.match( /^(1|true)$/ ) );
-              }
-
-              if( 0 !== fields )
-              {
-                analysis_form
-                  .trigger( 'execute' );
-              }
-            },
-            error : function( xhr, text_status, error_thrown)
-            {
-            },
-            complete : function( xhr, text_status )
-            {
-              this
-                .removeClass( 'loader' );
-            }
-          }
-        );
-                        
-        $( '.analysis-error .head a', analysis_element )
-          .die( 'click' )
-          .live
-          (
-            'click',
-            function( event )
-            {
-              $( this ).parents( '.analysis-error' )
-                .toggleClass( 'expanded' );
-            }
-          );
-                        
-        var check_empty_spacer = function()
-        {
-          var spacer_holder = $( 'td.part.data.spacer .holder', analysis_result );
-
-          if( 0 === spacer_holder.size() )
-          {
-            return false;
-          }
-
-          var verbose_output = analysis_result.hasClass( 'verbose_output' );
-
-          spacer_holder
-            .each
-            (
-              function( index, element )
-              {
-                element = $( element );
-
-                if( verbose_output )
-                {
-                  var cell = element.parent();
-                  element.height( cell.height() );
-                }
-                else
-                {
-                  element.removeAttr( 'style' );
-                }
-              }
-            );
-        }
-                        
-        verbose_link
-          .die( 'toggle' )
-          .live
-          (
-            'toggle',
-            function( event, state )
-            {
-              $( this ).parent()
-                .toggleClass( 'active', state );
-                            
-              analysis_result
-                .toggleClass( 'verbose_output', state );
-                            
-              check_empty_spacer();
-            }
-          )
-          .die( 'click' )
-          .live
-          (
-            'click',
-            function( event )
-            {
-              $( this ).parent()
-                .toggleClass( 'active' );
-
-              analysis_form.trigger( 'submit' );
-            }
-          );
-
-        var button = $( 'button', analysis_form )
-
-        var compute_analysis_params = function()
-        {
-          var params = analysis_form.formToArray();
-                          
-          var type_or_name = $( '#type_or_name', analysis_form ).val().split( '=' );
-          params.push( { name: 'analysis.' + type_or_name[0], value: type_or_name[1] } );
-          params.push( { name: 'verbose_output', value: $( '.verbose_output', analysis_element ).hasClass( 'active' ) ? 1 : 0 } );
-
-          return params;
-        }
-                
-        analysis_form
-          .die( 'submit' )
-          .live
-          (
-            'submit',
-            function( event )
-            {
-              var params = $.param( compute_analysis_params() )
-                            .replace( /[\w\.]+=\+*(&)/g, '$1' ) // remove empty parameters
-                            .replace( /(&)+/, '$1' )            // reduce multiple ampersands
-                            .replace( /^&/, '' )                // remove leading ampersand
-                            .replace( /\+/g, '%20' );           // replace plus-signs with encoded whitespaces
-
-              context.redirect( context.path.split( '?' ).shift() + '?' + params );
-              return false;
-            }
-          )
-          .die( 'execute' )
-          .live
-          (
-            'execute',
-            function( event )
-            {
-              var url = core_basepath + '/analysis/field?wt=json&analysis.showmatch=true&' + context.path.split( '?' ).pop();
-              url = url.replace( /&verbose_output=\d/, '' );
-
-              $.ajax
-              (
-                {
-                  url : url,
-                  dataType : 'json',
-                  beforeSend : function( xhr, settings )
-                  {
-                    loader.show( $( 'span', button ) );
-                    button.attr( 'disabled', true );
-                  },
-                  success : function( response, status_text, xhr, form )
-                  {
-                    $( '.analysis-error', analysis_element )
-                      .hide();
-                                    
-                    analysis_result
-                      .empty()
-                      .show();
-                                    
-                    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] );
-                    }
-
-                    check_empty_spacer();
-                  },
-                  error : function( xhr, text_status, error_thrown )
-                  {
-                    analysis_result
-                      .empty()
-                      .hide();
-
-                    if( 404 === xhr.status )
-                    {
-                      $( '#analysis-handler-missing', analysis_element )
-                        .show();
-                    }
-                    else
-                    {
-                      $( '#analysis-error', analysis_element )
-                        .show();
-
-                      var response = null;
-                      try
-                      {
-                        eval( 'response = ' + xhr.responseText + ';' );
-                      }
-                      catch( e )
-                      {
-                        console.error( e );
-                      }
-
-                      $( '#analysis-error .body', analysis_element )
-                        .text( response ? response.error.msg : xhr.responseText );
-                    }
-                  },
-                  complete : function()
-                  {
-                    loader.hide( $( 'span', button ) );
-                    button.removeAttr( 'disabled' );
-                  }
-                }
-              );
-            }
-          );
-
-          var generate_class_name = function( type )
-          {
-            var classes = [type];
-            if( 'text' !== type )
-            {
-              classes.push( 'verbose_output' );
-            }
-            return classes.join( ' ' );
-          }
-                    
-          var build_analysis_table = function( field_or_name, name, analysis_data )
-          {        
-            for( var type in analysis_data )
-            {
-              var type_length = analysis_data[type].length;
-              if( 0 !== type_length )
-              {
-                var global_elements_count = 0;
-                if( 'string' === typeof analysis_data[type][1] )
-                {
-                  analysis_data[type][1] = [{ 'text': analysis_data[type][1] }]
-                }
-
-                for( var i = 1; i < type_length; i += 2 )
-                {
-                  var tmp_type_length = analysis_data[type][i].length;
-                  for( var j = 0; j < tmp_type_length; j++ )
-                  {
-                    global_elements_count = Math.max
-                    (
-                      ( analysis_data[type][i][j].positionHistory || [] )[0] || 1,
-                      global_elements_count
-                    );
-                  }
-                }
-
-                var content = '<div class="' + type + '">' + "\n";
-                content += '<table border="0" cellspacing="0" cellpadding="0">' + "\n";
-                                
-                for( var i = 0; i < analysis_data[type].length; i += 2 )
-                {
-                  var colspan = 1;
-                  var elements = analysis_data[type][i+1];
-                  var elements_count = global_elements_count;
-                  
-                  if( !elements[0] || !elements[0].positionHistory )
-                  {
-                    colspan = elements_count;
-                    elements_count = 1;
-                  }
-
-                  var legend = [];
-                  for( var key in elements[0] )
-                  {
-                    var key_parts = key.split( '#' );
-                    var used_key = key_parts.pop();
-                    var short_key = used_key;
-
-                    if( 1 === key_parts.length )
-                    {
-                      used_key = '<abbr title="' + key + '">' + used_key + '</abbr>';
-                    }
-
-                    if( 'positionHistory' === short_key || 'match' === short_key )
-                    {
-                      continue;
-                    }
-
-                    legend.push
-                    (
-                      '<tr class="' + generate_class_name( short_key ) + '">' +
-                      '<td>' + used_key + '</td>' +
-                      '</tr>'
-                    );
-                  }
-
-                  content += '<tbody>' + "\n";
-                  content += '<tr class="step">' + "\n";
-
-                    // analyzer
-                    var analyzer_name = analysis_data[type][i].replace( /(\$1)+$/g, '' );
-
-                    var analyzer_short = -1 !== analyzer_name.indexOf( '$' )
-                                       ? analyzer_name.split( '$' )[1]
-                                       : analyzer_name.split( '.' ).pop();
-                    analyzer_short = analyzer_short.match( /[A-Z]/g ).join( '' );
-
-                    content += '<td class="part analyzer"><div>' + "\n";
-                    content += '<abbr title="' + analysis_data[type][i].esc() + '">' + "\n";
-                    content += analyzer_short.esc() + '</abbr></div></td>' + "\n";
-
-                    // legend
-                    content += '<td class="part legend"><div class="holder">' + "\n";
-                    content += '<table border="0" cellspacing="0" cellpadding="0">' + "\n";
-                    content += '<tr><td>' + "\n";
-                    content += '<table border="0" cellspacing="0" cellpadding="0">' + "\n";
-                    content += legend.join( "\n" ) + "\n";
-                    content += '</table></td></tr></table></td>' + "\n";
-
-                    // data
-                    var cell_content = '<td class="part data spacer" colspan="' + colspan + '"><div class="holder">&nbsp;</div></td>';
-                    var cells = new Array( elements_count + 1 ).join( cell_content );
-                    content += cells + "\n";
-
-                  content += '</tr>' + "\n";
-                  content += '</tbody>' + "\n";
-                }
-                content += '</table>' + "\n";
-                content += '</div>' + "\n";
-
-                $( '.' + type, analysis_result )
-                  .remove();
-
-                analysis_result
-                  .append( content );
-                                
-                var analysis_result_type = $( '.' + type, analysis_result );
-
-                for( var i = 0; i < analysis_data[type].length; i += 2 )
-                {
-                  for( var j = 0; j < analysis_data[type][i+1].length; j += 1 )
-                  {
-                    var pos = analysis_data[type][i+1][j].positionHistory
-                        ? analysis_data[type][i+1][j].positionHistory[0]
-                        : 1;
-                    var selector = 'tr.step:eq(' + ( i / 2 ) +') '
-                                 + 'td.data:eq(' + ( pos - 1 ) + ') '
-                                 + '.holder';
-                    var cell = $( selector, analysis_result_type );
-
-                    cell.parent()
-                      .removeClass( 'spacer' );
-
-                    var table = $( 'table tr.details', cell );
-                    if( 0 === table.size() )
-                    {
-                      cell
-                        .html
-                        (
-                          '<table border="0" cellspacing="0" cellpadding="0">' + 
-                          '<tr class="details"></tr></table>'
-                        );
-                      var table = $( 'table tr.details', cell );
-                    }
-
-                    var tokens = [];
-                    for( var key in analysis_data[type][i+1][j] )
-                    {
-                      var short_key = key.split( '#' ).pop();
-                                            
-                      if( 'positionHistory' === short_key || 'match' === short_key )
-                      {
-                        continue;
-                      }
-
-                      var classes = [];
-                      classes.push( generate_class_name( short_key ) );
-
-                      var data = analysis_data[type][i+1][j][key];
-                      if( 'object' === typeof data && data instanceof Array )
-                      {
-                        data = data.join( ' ' );
-                      }
-                      if( 'string' === typeof data )
-                      {
-                        data = data.esc();
-                      }
-
-                      if( null === data || 0 === data.length )
-                      {
-                        classes.push( 'empty' );
-                        data = '&empty;';
-                      }
-
-                      if( analysis_data[type][i+1][j].match && 
-                        ( 'text' === short_key || 'raw_bytes' === short_key ) )
-                      {
-                        classes.push( 'match' );
-                      }
-
-                      tokens.push
-                      (
-                        '<tr class="' + classes.join( ' ' ) + '">' +
-                        '<td>' + data + '</td>' +
-                        '</tr>'
-                      );
-                    }
-                    table
-                      .append
-                      (
-                        '<td class="details">' +
-                        '<table border="0" cellspacing="0" cellpadding="0">' +
-                        tokens.join( "\n" ) +
-                        '</table></td>'
-                      );
-                  }
-                }
-                
-              }
-            }
-          }
-                    
-      }
-    );
-  }
-);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/app.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/app.js b/solr/webapp/web/js/scripts/app.js
deleted file mode 100644
index a967cfe..0000000
--- a/solr/webapp/web/js/scripts/app.js
+++ /dev/null
@@ -1,669 +0,0 @@
-/*
- 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.
-*/
-
-var loader = {
-    
-  show : function( element )
-  {
-    $( element )
-      .addClass( 'loader' );
-  },
-    
-  hide : function( element )
-  {
-    $( element )
-      .removeClass( 'loader' );
-  }
-    
-};
-
-Number.prototype.esc = function()
-{
-  return new String( this ).esc();
-}
-
-String.prototype.esc = function()
-{
-  return this.replace( /</g, '&lt;' ).replace( />/g, '&gt;' );
-}
-
-SolrDate = function( date )
-{
-  // ["Sat Mar 03 11:00:00 CET 2012", "Sat", "Mar", "03", "11:00:00", "CET", "2012"]
-  var parts = date.match( /^(\w+)\s+(\w+)\s+(\d+)\s+(\d+\:\d+\:\d+)\s+(\w+)\s+(\d+)$/ );
-    
-  // "Sat Mar 03 2012 10:37:33"
-  return new Date( parts[1] + ' ' + parts[2] + ' ' + parts[3] + ' ' + parts[6] + ' ' + parts[4] );
-}
-
-var sammy = $.sammy
-(
-  function()
-  {
-    this.bind
-    (
-      'run',
-      function( event, config )
-      {
-        if( 0 === config.start_url.length )
-        {
-          location.href = '#/';
-          return false;
-        }
-      }
-    );
-
-    this.bind
-    (
-      'error',
-      function( message, original_error )
-      {
-        alert( original_error.message );
-      }
-    );
-        
-    // activate_core
-    this.before
-    (
-      {},
-      function( context )
-      {
-        app.clear_timeout();
-
-        var menu_wrapper = $( '#menu-wrapper' );
-
-        $( 'li[id].active', menu_wrapper )
-          .removeClass( 'active' );
-                
-        $( 'li.active', menu_wrapper )
-          .removeClass( 'active' );
-
-        // global dashboard doesn't have params.splat
-        if( !this.params.splat )
-        {
-          this.params.splat = [ '~index' ];
-        }
-
-        var selector = '~' === this.params.splat[0][0]
-                     ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
-                     : '#core-selector #' + this.params.splat[0].replace( /\./g, '__' );
-
-        var active_element = $( selector, menu_wrapper );
-                  
-        if( 0 === active_element.size() )
-        {
-          this.app.error( 'There exists no core with name "' + this.params.splat[0] + '"' );
-          return false;
-        }
-
-        if( active_element.hasClass( 'global' ) )
-        {
-          active_element
-            .addClass( 'active' );
-
-          if( this.params.splat[1] )
-          {
-            $( '.' + this.params.splat[1], active_element )
-              .addClass( 'active' );
-          }
-
-          $( '#core-selector option[selected]' )
-            .removeAttr( 'selected' )
-            .trigger( 'liszt:updated' );
-
-          $( '#core-selector .chzn-container > a' )
-            .addClass( 'chzn-default' );
-        }
-        else
-        {
-          active_element
-            .attr( 'selected', 'selected' )
-            .trigger( 'liszt:updated' );
-
-          if( !this.params.splat[1] )
-          {
-            this.params.splat[1] = 'overview';
-          }
-
-          $( '#core-menu .' + this.params.splat[1] )
-            .addClass( 'active' );
-
-          this.active_core = active_element;
-        }
-
-        check_fixed_menu();
-      }
-    );
-  }
-);
-
-var solr_admin = function( app_config )
-{
-  that = this,
-
-  menu_element = null,
-
-  is_multicore = null,
-  cores_data = null,
-  active_core = null,
-    
-  config = app_config,
-  params = null,
-  dashboard_values = null,
-  schema_browser_data = null,
-
-  plugin_data = null,
-    
-  this.menu_element = $( '#core-selector select' );
-  this.core_menu = $( '#core-menu ul' );
-
-  this.config = config;
-  this.timeout = null;
-
-  this.core_regex_base = '^#\\/([\\w\\d-\\.]+)';
-
-  browser = {
-    locale : null,
-    language : null,
-    country : null
-  };
-
-  show_global_error = function( error )
-  {
-    var main = $( '#main' );
-
-    $( 'div[id$="-wrapper"]', main )
-      .remove();
-
-    main
-      .addClass( 'error' )
-      .append( error );
-
-    var pre_tags = $( 'pre', main );
-    if( 0 !== pre_tags.size() )
-    {
-      hljs.highlightBlock( pre_tags.get(0) ); 
-    }
-  };
-
-  sort_cores_data = function sort_cores_data( cores_status )
-  {
-    // build array of core-names for sorting
-    var core_names = [];
-    for( var core_name in cores_status )
-    {
-      core_names.push( core_name );
-    }
-    core_names.sort();
-
-    var core_count = core_names.length;
-    var cores = {};
-
-    for( var i = 0; i < core_count; i++ )
-    {
-      var core_name = core_names[i];
-      cores[core_name] = cores_status[core_name];
-    }
-
-    return cores;
-  };
-
-  this.set_cores_data = function set_cores_data( cores )
-  {
-    that.cores_data = sort_cores_data( cores.status );
-    
-    that.menu_element
-      .empty();
-
-    var core_list = [];
-    core_list.push( '<option></option>' );
-
-    var core_count = 0;
-    for( var core_name in that.cores_data )
-    {
-      core_count++;
-      var core_path = config.solr_path + '/' + core_name;
-      var classes = [];
-
-      if( cores.status[core_name]['isDefaultCore'] )
-      {
-        classes.push( 'default' );
-      }
-
-      var core_tpl = '<option '
-                   + '    id="' + core_name.replace( /\./g, '__' ) + '" '
-                   + '    class="' + classes.join( ' ' ) + '"'
-                   + '    data-basepath="' + core_path + '"'
-                   + '    schema="' + cores.status[core_name]['schema'] + '"'
-                   + '    config="' + cores.status[core_name]['config'] + '"'
-                   + '    value="#/' + core_name + '"'
-                   + '    title="' + core_name + '"'
-                   + '>' 
-                   + core_name 
-                   + '</option>';
-
-      core_list.push( core_tpl );
-    }
-
-    var has_cores = 0 !== core_count;
-    if( has_cores )
-    {
-      that.menu_element
-        .append( core_list.join( "\n" ) )
-        .trigger( 'liszt:updated' );
-    }
-
-    var core_selector = $( '#core-selector' );
-    core_selector.find( '#has-cores' ).toggle( has_cores );
-    core_selector.find( '#has-no-cores' ).toggle( !has_cores );
-
-    if( has_cores )
-    {
-      var cores_element = core_selector.find( '#has-cores' );
-      var selector_width = cores_element.width();
-
-      cores_element.find( '.chzn-container' )
-        .css( 'width', selector_width + 'px' );
-      
-      cores_element.find( '.chzn-drop' )
-        .css( 'width', ( selector_width - 2 ) + 'px' );
-    }
-
-    this.check_for_init_failures( cores );
-  };
-
-  this.remove_init_failures = function remove_init_failures()
-  {
-    $( '#init-failures' )
-      .hide()
-      .find( 'ul' )
-        .empty();
-  }
-
-  this.check_for_init_failures = function check_for_init_failures( cores )
-  {
-    if( !cores.initFailures )
-    {
-      this.remove_init_failures();
-      return false;
-    }
-
-    var failures = [];
-    for( var core_name in cores.initFailures )
-    {
-      failures.push
-      (
-        '<li>' +
-          '<strong>' + core_name.esc() + ':</strong>' + "\n" +
-          cores.initFailures[core_name].esc() + "\n" +
-        '</li>'
-      );
-    }
-
-    if( 0 === failures.length )
-    {
-      this.remove_init_failures();
-      return false;
-    }
-
-    $( '#init-failures' )
-      .show()
-      .find( 'ul' )
-        .html( failures.join( "\n" ) );
-  }
-
-  this.run = function()
-  {
-    var navigator_language = navigator.userLanguage || navigator.language;
-    var language_match = navigator_language.match( /^(\w{2})([-_](\w{2}))?$/ );
-    if( language_match )
-    {
-      if( language_match[1] )
-      {
-        browser.language = language_match[1].toLowerCase();
-      }
-      if( language_match[3] )
-      {
-        browser.country = language_match[3].toUpperCase();
-      }
-      if( language_match[1] && language_match[3] )
-      {
-        browser.locale = browser.language + '_' + browser.country
-      }
-    }
-
-    $.ajax
-    (
-      {
-        url : config.solr_path + config.core_admin_path + '?wt=json&indexInfo=false',
-        dataType : 'json',
-        beforeSend : function( arr, form, options )
-        {               
-          $( '#content' )
-            .html( '<div id="index"><div class="loader">Loading ...</div></div>' );
-        },
-        success : function( response )
-        {
-          that.set_cores_data( response );
-
-          that.menu_element
-            .chosen()
-            .off( 'change' )
-            .on
-            (
-              'change',
-              function( event )
-              {
-                location.href = $( 'option:selected', this ).val();
-                return false;
-              }
-            )
-            .on
-            (
-              'liszt:updated',
-              function( event )
-              {
-                var core_name = $( 'option:selected', this ).text();
-
-                that.core_menu
-                  .html
-                  (
-                    //Keep this in alphabetical order after the overview
-                    '<li class="overview"><a href="#/' + core_name + '"><span>Overview</span></a></li>' + "\n" +
-                    '<li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n" +
-                    '<li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n" +
-                    '<li class="documents"><a href="#/' + core_name + '/documents"><span>Documents</span></a></li>' + "\n" +
-                    '<li class="files"><a href="#/' + core_name + '/files"><span>Files</span></a></li>' + "\n" +
-                    '<li class="ping"><a rel="' + that.config.solr_path + '/' + core_name + '/admin/ping"><span>Ping</span></a></li>' + "\n" +
-                    '<li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n" +
-                    '<li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n" +
-                    '<li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n" +
-                    '<li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' +
-                    '<li class="segments"><a href="#/' + core_name + '/segments"><span>Segments info</span></a></li>'
-                  )
-                  .show();
-
-                if( !core_name )
-                {
-                  that.core_menu
-                    .hide()
-                    .empty();
-                }
-              }
-            );
-
-          check_fixed_menu();
-          $( window ).resize( check_fixed_menu );
-
-          var system_url = config.solr_path + '/admin/info/system?wt=json';
-          $.ajax
-          (
-            {
-              url : system_url,
-              dataType : 'json',
-              beforeSend : function( arr, form, options )
-              {
-              },
-              success : function( response )
-              {
-                that.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 );
-                }
-
-                if( response.mode )
-                {
-                  cloud_args = response.mode.match( /solrcloud/i );
-                }
-
-                // environment
-
-                var wrapper = $( '#wrapper' );
-                var environment_element = $( '#environment' );
-                if( environment_args )
-                {
-                  wrapper
-                    .addClass( 'has-environment' );
-
-                  if( environment_args[1] )
-                  {
-                    environment_element
-                      .html( environment_args[1] );
-                  }
-
-                  if( environment_args[2] )
-                  {
-                    environment_element
-                      .addClass( environment_args[2] );
-                  }
-                }
-                else
-                {
-                  wrapper
-                    .removeClass( 'has-environment' );
-                }
-
-                // cloud
-
-                var cloud_nav_element = $( '#menu #cloud' );
-                if( cloud_args )
-                {
-                  cloud_nav_element
-                    .show();
-                }
-
-                // sammy
-
-                sammy.run( location.hash );
-              },
-              error : function()
-              {
-              },
-              complete : function()
-              {
-                loader.hide( this );
-              }
-            }
-          );
-        },
-        error : function()
-        {
-        },
-        complete : function()
-        {
-        }
-      }
-    );
-  };
-
-  this.convert_duration_to_seconds = function convert_duration_to_seconds( str )
-  {
-    var seconds = 0;
-    var arr = new String( str || '' ).split( '.' );
-    var parts = arr[0].split( ':' ).reverse();
-    var parts_count = parts.length;
-
-    for( var i = 0; i < parts_count; i++ )
-    {
-      seconds += ( parseInt( parts[i], 10 ) || 0 ) * Math.pow( 60, i );
-    }
-
-    // treat more or equal than .5 as additional second
-    if( arr[1] && 5 <= parseInt( arr[1][0], 10 ) )
-    {
-      seconds++;
-    }
-
-    return seconds;
-  };
-
-  this.convert_seconds_to_readable_time = function convert_seconds_to_readable_time( seconds )
-  {
-    seconds = parseInt( seconds || 0, 10 );
-    var minutes = Math.floor( seconds / 60 );
-    var hours = Math.floor( minutes / 60 );
-
-    var text = [];
-    if( 0 !== hours )
-    {
-      text.push( hours + 'h' );
-      seconds -= hours * 60 * 60;
-      minutes -= hours * 60;
-    }
-
-    if( 0 !== minutes )
-    {
-      text.push( minutes + 'm' );
-      seconds -= minutes * 60;
-    }
-
-    if( 0 !== seconds )
-    {
-      text.push( ( '0' + seconds ).substr( -2 ) + 's' );
-    }
-
-    return text.join( ' ' );
-  };
-
-  this.clear_timeout = function clear_timeout()
-  {
-    if( !app.timeout )
-    {
-      return false;
-    }
-
-    console.debug( 'Clearing Timeout #' + this.timeout );
-    clearTimeout( this.timeout );
-    this.timeout = null;
-  };
-
-  this.format_json = function format_json( json_str )
-  {
-    if( JSON.stringify && JSON.parse )
-    {
-      json_str = JSON.stringify( JSON.parse( json_str ), undefined, 2 );
-    }
-
-    return json_str.esc();
-  };
-
-  this.format_number = function format_number( number )
-  {
-    var sep = {
-      'de_CH' : '\'',
-      'de' : '.',
-      'en' : ',',
-      'es' : '.',
-      'it' : '.',
-      'ja' : ',',
-      'sv' : ' ',
-      'tr' : '.',
-      '_' : '' // fallback
-    };
-
-    return ( number || 0 ).toString().replace
-    (
-      /\B(?=(\d{3})+(?!\d))/g,
-      sep[ browser.locale ] || sep[ browser.language ] || sep['_']
-    );
-  };
-
-  check_fixed_menu = function check_fixed_menu()
-  {
-    $( '#wrapper' ).toggleClass( 'scroll', $( window ).height() < $( '#menu-wrapper' ).height() + $( '#header' ).height() + 40 );
-  }
-
-};
-
-var connection_check_delay = 1000;
-var connection_working = true;
-
-var connection_check = function connection_check()
-{
-  $.ajax
-  (
-    {
-      url : config.solr_path + config.core_admin_path + '?wt=json&indexInfo=false',
-      dataType : 'json',
-      context : $( '.blockUI #connection_status span' ),
-      beforeSend : function( arr, form, options )
-      {               
-        this
-          .addClass( 'loader' );
-      },
-      success : function( response )
-      {
-        connection_working = true;
-
-        this
-          .html( 'Instance is available - <a href="javascript:location.reload();">Reload the page</a>' );
-
-        this.parents( '#connection_status' )
-          .addClass( 'online' );
-
-        this.parents( '.blockUI' )
-          .css( 'borderColor', '#080' );
-      },
-      error : function()
-      {
-        connection_check_delay += connection_check_delay;
-        window.setTimeout( connection_check, connection_check_delay );
-      },
-      complete : function()
-      {
-        this
-          .removeClass( 'loader' );
-      }
-    }
-  );
-};
-
-var connection_error = function connection_error()
-{
-  connection_working = false;
-
-  $.blockUI
-  (
-    {
-      message: $( '#connection_status' ),
-      css: { width: '450px', borderColor: '#f00' }
-    }
-  );
-
-  window.setTimeout( connection_check, connection_check_delay );
-}
-
-$( document ).ajaxError
-(
-  function( event, xhr, settings, thrownError )
-  {
-    if( connection_working && 0 === xhr.status )
-    {
-      connection_error();
-    }
-  }
-);
-
-$.ajaxSetup( { cache: false } );
-var app = new solr_admin( app_config );

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/cloud.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/cloud.js b/solr/webapp/web/js/scripts/cloud.js
deleted file mode 100644
index 7890af8..0000000
--- a/solr/webapp/web/js/scripts/cloud.js
+++ /dev/null
@@ -1,877 +0,0 @@
-/*
- 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.
-*/
-
-var zk_error = function zk_error( xhr, text_status, error_thrown )
-{
-  var zk = null;
-  try
-  {
-    eval( 'zk = ' + xhr.responseText + ';' );
-  }
-  catch( e ) {}
-
-  var message = '<p class="txt">Loading of "<code>' + xhr.url + '</code>" '
-              + 'failed (HTTP-Status <code>' + xhr.status + '</code>)</p>' + "\n";
-
-  if( zk.error )
-  {
-    message += '<p class="msg">"' + zk.error.esc() + '"</p>' + "\n";
-  }
-  
-  this.closest( '#cloud' )
-    .html( '<div class="block" id="error">' + message + '</div>' );
-};
-
-var init_debug = function( cloud_element )
-{
-  var debug_element = $( '#debug', cloud_element );
-  var debug_button = $( '#menu #cloud .dump a' );
-
-  var clipboard_element = $( '.clipboard', debug_element );
-  var clipboard_button = $( 'a', clipboard_element );
-
-  debug_button
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function( event )
-      {
-        debug_element.trigger( 'show' );
-        return false;
-      }
-    );
-
-  $( '.close', debug_element )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function( event )
-      {
-        debug_element.trigger( 'hide' );
-        return false;
-      }
-    );
-
-  $( '.clipboard', debug_element )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function( event )
-      {
-        return false;
-      }
-    );
-
-  debug_element
-    .die( 'show' )
-    .live
-    (
-      'show',
-      function( event )
-      {
-        debug_element.show();
-
-        $.ajax
-        (
-          {
-            url : app.config.solr_path + '/admin/zookeeper?wt=json&dump=true',
-            dataType : 'text',
-            context : debug_element,
-            beforeSend : function( xhr, settings )
-            {
-              $( '.debug', debug_element )
-                .html( '<span class="loader">Loading Dump ...</span>' );
-
-              ZeroClipboard.setMoviePath( 'img/ZeroClipboard.swf' );
-
-              clipboard_client = new ZeroClipboard.Client();
-                              
-              clipboard_client.addEventListener
-              (
-                'load',
-                function( client )
-                {
-                }
-              );
-
-              clipboard_client.addEventListener
-              (
-                'complete',
-                function( client, text )
-                {
-                  clipboard_element
-                    .addClass( 'copied' );
-
-                  clipboard_button
-                    .data( 'text', clipboard_button.text() )
-                    .text( clipboard_button.data( 'copied' ) );
-                }
-              );
-            },
-            success : function( response, text_status, xhr )
-            {
-              clipboard_client.glue
-              (
-                clipboard_element.get(0),
-                clipboard_button.get(0)
-              );
-
-              clipboard_client.setText( response.replace( /\\/g, '\\\\' ) );
-
-              $( '.debug', debug_element )
-                .removeClass( 'loader' )
-                .text( response );
-            },
-            error : function( xhr, text_status, error_thrown )
-            {
-            },
-            complete : function( xhr, text_status )
-            {
-            }
-          }
-        );
-      }
-    )
-    .die( 'hide' )
-    .live
-    (
-      'hide',
-      function( event )
-      {
-        $( '.debug', debug_element )
-          .empty();
-
-        clipboard_element
-          .removeClass( 'copied' );
-
-        clipboard_button
-          .data( 'copied', clipboard_button.text() )
-          .text( clipboard_button.data( 'text' ) );
-
-        clipboard_client.destroy();
-
-        debug_element.hide();
-      }
-    );
-};
-
-var helper_path_class = function( p )
-{
-  var classes = [ 'link' ];
-  classes.push( 'lvl-' + p.target.depth );
-
-  if( p.target.data && p.target.data.leader )
-  {
-    classes.push( 'leader' );
-  }
-
-  if( p.target.data && p.target.data.state )
-  {
-    classes.push( p.target.data.state );
-  }
-
-  return classes.join( ' ' );
-};
-
-var helper_node_class = function( d )
-{
-  var classes = [ 'node' ];
-  classes.push( 'lvl-' + d.depth );
-
-  if( d.data && d.data.leader )
-  {
-    classes.push( 'leader' );
-  }
-
-  if( d.data && d.data.state )
-  {
-    classes.push( d.data.state );
-  }
-
-  return classes.join( ' ' );
-};
-
-var helper_data = {
-  protocol: [],
-  host: [],
-  hostname: [],
-  port: [],
-  pathname: []
-};
-
-var helper_node_text = function( d )
-{
-  if( !d.data || !d.data.uri )
-  {
-    return d.name;
-  }
-
-  var name = d.data.uri.hostname;
-
-  if( 1 !== helper_data.protocol.length )
-  {
-    name = d.data.uri.protocol + '//' + name;
-  }
-
-  if( 1 !== helper_data.port.length )
-  {
-    name += ':' + d.data.uri.port;
-  }
-
-  if( 1 !== helper_data.pathname.length )
-  {
-    name += d.data.uri.pathname;
-  }
-
-  return name;
-};
-
-var generate_graph = function( graph_element, graph_data, leaf_count )
-{
-  var w = graph_element.width(),
-      h = leaf_count * 20;
-
-  var tree = d3.layout.tree()
-    .size([h, w - 400]);
-
-  var diagonal = d3.svg.diagonal()
-    .projection(function(d) { return [d.y, d.x]; });
-
-  var vis = d3.select( '#canvas' ).append( 'svg' )
-    .attr( 'width', w )
-    .attr( 'height', h)
-    .append( 'g' )
-      .attr( 'transform', 'translate(100, 0)' );
-
-  var nodes = tree.nodes( graph_data );
-
-  var link = vis.selectAll( 'path.link' )
-    .data( tree.links( nodes ) )
-    .enter().append( 'path' )
-      .attr( 'class', helper_path_class )
-      .attr( 'd', diagonal );
-
-  var node = vis.selectAll( 'g.node' )
-    .data( nodes )
-    .enter().append( 'g' )
-      .attr( 'class', helper_node_class )
-      .attr( 'transform', function(d) { return 'translate(' + d.y + ',' + d.x + ')'; } )
-
-  node.append( 'circle' )
-    .attr( 'r', 4.5 );
-
-  node.append( 'text' )
-    .attr( 'dx', function( d ) { return 0 === d.depth ? -8 : 8; } )
-    .attr( 'dy', function( d ) { return 5; } )
-    .attr( 'text-anchor', function( d ) { return 0 === d.depth ? 'end' : 'start'; } )
-    .attr( 'data-href', function( d ) { return d.name; } )
-    .text( helper_node_text );
-
-  $( 'text[data-href*="//"]', graph_element )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function()
-      {
-        location.href = $( this ).data( 'href' );
-      }
-    );
-};
-
-var generate_rgraph = function( graph_element, graph_data, leaf_count )
-{
-  var max_val = Math.min( graph_element.width(), $( 'body' ).height() )
-  var r = max_val / 2;
-
-  var cluster = d3.layout.cluster()
-    .size([360, r - 160]);
-
-  var diagonal = d3.svg.diagonal.radial()
-    .projection(function(d) { return [d.y, d.x / 180 * Math.PI]; });
-
-  var vis = d3.select( '#canvas' ).append( 'svg' )
-    .attr( 'width', r * 2 )
-    .attr( 'height', r * 2 )
-    .append( 'g' )
-      .attr( 'transform', 'translate(' + r + ',' + r + ')' );
-
-  var nodes = cluster.nodes( graph_data );
-
-  var link = vis.selectAll( 'path.link' )
-    .data( cluster.links( nodes ) )
-    .enter().append( 'path' )
-      .attr( 'class', helper_path_class )
-      .attr( 'd', diagonal );
-
-  var node = vis.selectAll( 'g.node' )
-    .data( nodes )
-    .enter().append( 'g' )
-      .attr( 'class', helper_node_class )
-      .attr( 'transform', function(d) { return 'rotate(' + (d.x - 90) + ')translate(' + d.y + ')'; } )
-
-  node.append( 'circle' )
-    .attr( 'r', 4.5 );
-
-  node.append( 'text' )
-    .attr( 'dx', function(d) { return d.x < 180 ? 8 : -8; } )
-    .attr( 'dy', '.31em' )
-    .attr( 'text-anchor', function(d) { return d.x < 180 ? 'start' : 'end'; } )
-    .attr( 'transform', function(d) { return d.x < 180 ? null : 'rotate(180)'; } )
-    .attr( 'data-href', function( d ) { return d.name; } )
-    .text( helper_node_text );
-
-  $( 'text[data-href*="//"]', graph_element )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function()
-      {
-        location.href = $( this ).data( 'href' );
-      }
-    );
-};
-
-var prepare_graph_data = function( response, graph_element, live_nodes, callback )
-{  
-    var state = null;
-    eval( 'state = ' + response.znode.data + ';' );
-    
-    var leaf_count = 0;
-    var graph_data = {
-      name: null,
-      children : []
-    };
-
-    for( var c in state )
-    {
-      var shards = [];
-      for( var s in state[c].shards )
-      {
-        var nodes = [];
-        for( var n in state[c].shards[s].replicas )
-        {
-          leaf_count++;
-          var replica = state[c].shards[s].replicas[n]
-
-          var uri = replica.base_url;
-          var parts = uri.match( /^(\w+:)\/\/(([\w\d\.-]+)(:(\d+))?)(.+)$/ );
-          var uri_parts = {
-            protocol: parts[1],
-            host: parts[2],
-            hostname: parts[3],
-            port: parseInt( parts[5] || 80, 10 ),
-            pathname: parts[6]
-          };
-          
-          helper_data.protocol.push( uri_parts.protocol );
-          helper_data.host.push( uri_parts.host );
-          helper_data.hostname.push( uri_parts.hostname );
-          helper_data.port.push( uri_parts.port );
-          helper_data.pathname.push( uri_parts.pathname );
-
-          var status = replica.state;
-
-          if( !live_nodes[replica.node_name] )
-          {
-            status = 'gone';
-          }
-
-          var node = {
-            name: uri,
-            data: {
-              type : 'node',
-              state : status,
-              leader : 'true' === replica.leader,
-              uri : uri_parts
-            }
-          };
-          nodes.push( node );
-        }
-
-        var shard = {
-          name: s,
-          data: {
-            type : 'shard'
-          },
-          children: nodes
-        };
-        shards.push( shard );
-      }
-
-      var collection = {
-        name: c,
-        data: {
-          type : 'collection'
-        },
-        children: shards
-      };
-      graph_data.children.push( collection );
-    }
-    
-    helper_data.protocol = $.unique( helper_data.protocol );
-    helper_data.host = $.unique( helper_data.host );
-    helper_data.hostname = $.unique( helper_data.hostname );
-    helper_data.port = $.unique( helper_data.port );
-    helper_data.pathname = $.unique( helper_data.pathname );
-
-    callback( graph_element, graph_data, leaf_count );  
-}
-
-var update_status_filter = function(filterType, filterVal) {
-  if (filterType == 'status') {
-    $( '#cloudGraphPagingStatusFilter' ).val(filterVal);
-    $( '#cloudGraphPagingStatusFilter' ).show();
-    $( '#cloudGraphPagingFilter' ).hide();
-    $( '#cloudGraphPagingFilter' ).val('');
-  } else {
-    $( '#cloudGraphPagingStatusFilter' ).hide();
-    $( '#cloudGraphPagingStatusFilter' ).val('');
-    $( '#cloudGraphPagingFilter' ).val(filterVal);
-    $( '#cloudGraphPagingFilter' ).show();                  
-  }  
-};
-
-var prepare_graph = function( graph_element, callback )
-{
-  $.ajax
-  (
-    {
-      url : app.config.solr_path + '/admin/zookeeper?wt=json&path=%2Flive_nodes',
-      dataType : 'json',
-      success : function( response, text_status, xhr )
-      {
-        var live_nodes = {};
-        for( var c in response.tree[0].children )
-        {
-          live_nodes[response.tree[0].children[c].data.title] = true;
-        }
-
-        var start = $( '#cloudGraphPagingStart' ).val();
-        var rows = $( '#cloudGraphPagingRows' ).val();
-        var clusterStateUrl = app.config.solr_path + '/admin/zookeeper?wt=json&detail=true&path=%2Fclusterstate.json&view=graph';
-        if (start && rows)
-          clusterStateUrl += ('&start='+start+'&rows='+rows);
-        
-        var filterType = $( '#cloudGraphPagingFilterType' ).val();
-        if (filterType) {
-          var filter = (filterType == 'status')
-                         ? $( '#cloudGraphPagingStatusFilter' ).val() 
-                         : $( '#cloudGraphPagingFilter' ).val();  
-          if (filter)
-            clusterStateUrl += ('&filterType='+filterType+'&filter='+filter);
-        }
-                
-        $.ajax
-        (
-          {
-            url : clusterStateUrl,
-            dataType : 'json',
-            context : graph_element,
-            beforeSend : function( xhr, settings )
-            {
-              this.show();
-            },
-            success : function( response, text_status, xhr )
-            {              
-              prepare_graph_data(response, graph_element, live_nodes, callback)
-
-              if (response.znode && response.znode.paging) {
-                var parr = response.znode.paging.split('|');
-                if (parr.length < 3) {
-                  $( '#cloudGraphPaging' ).hide();
-                  return;
-                }
-                
-                var start = Math.max(parseInt(parr[0]),0);                  
-                var prevEnabled = (start > 0);
-                $('#cloudGraphPagingPrev').prop('disabled', !prevEnabled);
-                if (prevEnabled)
-                  $('#cloudGraphPagingPrev').show();                    
-                else
-                  $('#cloudGraphPagingPrev').hide();
-                
-                var rows = parseInt(parr[1])
-                var total = parseInt(parr[2])
-                $( '#cloudGraphPagingStart' ).val(start);
-                $( '#cloudGraphPagingRows' ).val(rows);
-                if (rows == -1)
-                  $( '#cloudGraphPaging' ).hide();
-                                  
-                var filterType = parr.length > 3 ? parr[3] : '';
-                if (filterType == '' || filterType == 'none') filterType = 'status';
-                
-                $( '#cloudGraphPagingFilterType' ).val(filterType);                  
-                var filter = parr.length > 4 ? parr[4] : '';
-
-                update_status_filter(filterType, filter);
-                
-                var page = Math.floor(start/rows)+1;
-                var pages = Math.ceil(total/rows);
-                var last = Math.min(start+rows,total);
-                var nextEnabled = (last < total);                  
-                $('#cloudGraphPagingNext').prop('disabled', !nextEnabled);
-                if (nextEnabled)
-                  $('#cloudGraphPagingNext').show();
-                else
-                  $('#cloudGraphPagingNext').hide();                    
-                
-                var status = (total > 0) 
-                               ? 'Collections '+(start+1)+' - '+last+' of '+total+'. ' 
-                               : 'No collections found.';
-                $( '#cloudGraphPagingStatus' ).html(status);
-              } else {
-                $( '#cloudGraphPaging' ).hide();
-              }            
-            },
-            error : function( xhr, text_status, error_thrown)
-            {
-            },
-            complete : function( xhr, text_status )
-            {
-            }
-          }
-        );
-      },
-      error : function( xhr, text_status, error_thrown)
-      {
-      },
-      complete : function( xhr, text_status )
-      {
-      }
-    }
-  );
-
-};
-
-var init_graph = function( graph_element )
-{
-  prepare_graph
-  (
-    graph_element,
-    function( graph_element, graph_data, leaf_count )
-    {
-      generate_graph( graph_element, graph_data, leaf_count );
-    }
-  );
-}
-
-var init_rgraph = function( graph_element )
-{
-  prepare_graph
-  (
-    graph_element,
-    function( graph_element, graph_data, leaf_count )
-    {
-      generate_rgraph( graph_element, graph_data, leaf_count );
-    }
-  );
-}
-
-var init_tree = function( tree_element )
-{
-  $.ajax
-  (
-    {
-      url : app.config.solr_path + '/admin/zookeeper?wt=json',
-      dataType : 'json',
-      context : tree_element,
-      beforeSend : function( xhr, settings )
-      {
-        this
-          .show();
-      },
-      success : function( response, text_status, xhr )
-      {
-        var self = this;
-                      
-        $( '#tree', this )
-          .jstree
-          (
-            {
-              "plugins" : [ "json_data" ],
-              "json_data" : {
-                "data" : response.tree,
-                "progressive_render" : true
-              },
-              "core" : {
-                "animation" : 0
-              }
-            }
-          )
-          .jstree
-          (
-            'open_node',
-            'li:first'
-          );
-
-        var tree_links = $( '#tree a', this );
-
-        tree_links
-          .die( 'click' )
-          .live
-          (
-            'click',
-            function( event )
-            {
-              $( 'a.active', $( this ).parents( '#tree' ) )
-                .removeClass( 'active' );
-                                  
-              $( this )
-                .addClass( 'active' );
-
-              tree_element
-                .addClass( 'show' );
-
-              var file_content = $( '#file-content' );
-
-              $( 'a.close', file_content )
-                .die( 'click' )
-                .live
-                (
-                  'click',
-                  function( event )
-                  {
-                    $( '#tree a.active' )
-                      .removeClass( 'active' );
-                                      
-                    tree_element
-                      .removeClass( 'show' );
-
-                    return false;
-                  }
-                );
-
-              $.ajax
-              (
-                {
-                  url : this.href,
-                  dataType : 'json',
-                  context : file_content,
-                  beforeSend : function( xhr, settings )
-                  {
-                  },
-                  success : function( response, text_status, xhr )
-                  {
-                    var props = [];
-                    for( var key in response.znode.prop )
-                    {
-                      props.push
-                      (
-                        '<li><dl class="clearfix">' + "\n" +
-                          '<dt>' + key.esc() + '</dt>' + "\n" +
-                          '<dd>' + response.znode.prop[key].esc() + '</dd>' + "\n" +
-                        '</dl></li>'
-                      );
-                    }
-
-                    $( '#prop ul', this )
-                      .empty()
-                      .html( props.join( "\n" ) );
-
-                    $( '#prop ul li:odd', this )
-                      .addClass( 'odd' );
-
-                    var data_element = $( '#data', this );
-
-                    var highlight = false;
-                    var data = '<em>Node "' + response.znode.path + '" has no utf8 Content</em>';
-
-                    if( response.znode.data )
-                    {
-                      var classes = '';
-                      var path = response.znode.path.split( '.' );
-                      
-                      if( 1 < path.length )
-                      {
-                        highlight = true;
-                        classes = 'syntax language-' + path.pop().esc();
-                      }
-
-                      data = '<pre class="' + classes + '">'
-                           + response.znode.data.esc()
-                           + '</pre>';
-                    }
-                               
-
-                    data_element
-                        .show()
-                        .html( data );
-
-                    if( highlight )
-                    {
-                      hljs.highlightBlock( data_element.get(0) );
-                    }
-                    
-                  },
-                  error : function( xhr, text_status, error_thrown)
-                  {
-                  },
-                  complete : function( xhr, text_status )
-                  {
-                  }
-                }
-              );
-
-              return false;
-            }
-          );
-      },
-      error : zk_error,
-      complete : function( xhr, text_status )
-      {
-      }
-    }
-  );
-};
-
-// updates the starting position for paged navigation
-// and then rebuilds the graph based on the selected page
-var update_start = function(direction, cloud_element) {
-  var start = $( '#cloudGraphPagingStart' ).val();
-  var rows = $( '#cloudGraphPagingRows' ).val();
-  var startAt = start ? parseInt(start) : 0;
-  var numRows = rows ? parseInt(rows) : 20;
-  var newStart = Math.max(startAt + (rows * direction),0); 
-  $( '#cloudGraphPagingStart' ).val(newStart);
-  
-  var graph_element = $( '#graph-content', cloud_element );
-  $( '#canvas', graph_element).empty();
-  init_graph( graph_element );  
-};
-
-// #/~cloud
-sammy.get
-(
-  /^#\/(~cloud)$/,
-  function( context )
-  {
-    var content_element = $( '#content' );
-
-    $.get
-    (
-      'tpl/cloud.html',
-      function( template )
-      {
-        content_element
-          .html( template );
-
-        var cloud_element = $( '#cloud', content_element );
-        var navigation_element = $( '#menu #cloud' );
-
-        init_debug( cloud_element );
-
-        $( '.tree', navigation_element )
-          .die( 'activate' )
-          .live
-          (
-            'activate',
-            function( event )
-            {
-              $( this ).addClass( 'active' );
-              init_tree( $( '#tree-content', cloud_element ) );
-            }
-          );
-
-        $( '.graph', navigation_element )
-          .die( 'activate' )
-          .live
-          (
-            'activate',
-            function( event )
-            {
-              $( this ).addClass( 'active' );
-              init_graph( $( '#graph-content', cloud_element ) );
-              
-              $('#cloudGraphPagingNext').click(function() {
-                update_start(1, cloud_element);                  
-              });
-              
-              $('#cloudGraphPagingPrev').click(function() {
-                update_start(-1, cloud_element);                                    
-              });              
-
-              $('#cloudGraphPagingRows').change(function() {
-                var rows = $( this ).val();
-                if (!rows || rows == '')
-                  $( this ).val("20");
-                
-                // ? restart the start position when rows changes?
-                $( '#cloudGraphPagingStart' ).val(0);                  
-                update_start(-1, cloud_element);                
-              });              
-              
-              $('#cloudGraphPagingFilter').change(function() {
-                var filter = $( this ).val();
-                // reset the start position when the filter changes
-                $( '#cloudGraphPagingStart' ).val(0);
-                update_start(-1, cloud_element);
-              });
-
-              $( '#cloudGraphPagingStatusFilter' ).show();
-              $( '#cloudGraphPagingFilter' ).hide();
-              
-              $('#cloudGraphPagingFilterType').change(function() {
-                update_status_filter($( this ).val(), '');
-              });
-              
-              $('#cloudGraphPagingStatusFilter').change(function() {
-                // just reset the paged navigation controls based on this update
-                $( '#cloudGraphPagingStart' ).val(0);                  
-                update_start(-1, cloud_element);                                    
-              });
-              
-            }
-          );
-
-        $( '.rgraph', navigation_element )
-          .die( 'activate' )
-          .live
-          (
-            'activate',
-            function( event )
-            {
-              $( "#cloudGraphPaging" ).hide(); // TODO: paging for rgraph too
-              
-              $( this ).addClass( 'active' );
-              init_rgraph( $( '#graph-content', cloud_element ) );
-            }
-          );
-
-        $.ajax
-        (
-          {
-            url : app.config.solr_path + '/admin/zookeeper?wt=json',
-            dataType : 'json',
-            context : cloud_element,
-            success : function( response, text_status, xhr )
-            {
-              $( 'a[href="' + context.path + '"]', navigation_element )
-                .trigger( 'activate' );
-            },
-            error : zk_error
-          }
-        );
-        
-      }
-    );
-  }
-);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/cores.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/cores.js b/solr/webapp/web/js/scripts/cores.js
deleted file mode 100644
index 54f6cfa..0000000
--- a/solr/webapp/web/js/scripts/cores.js
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
- 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.
-*/
-
-sammy.bind
-(
-  'cores_load_data',
-  function( event, params )
-  {
-    $.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 )
-        {
-          if( params.only_failures )
-          {
-            app.check_for_init_failures( response );
-            return true;
-          }
-
-          var has_cores = false;
-          for( core in response.status )
-          {
-            has_cores = true; break;
-          }
-
-          app.set_cores_data( response );
-          
-          if( has_cores )
-          {
-            params.success( app.cores_data );
-          }
-          else
-          {
-            params.error();
-          }
-        },
-        error : function( xhr, text_status, error_thrown)
-        {
-        },
-        complete : function( xhr, text_status )
-        {
-        }
-      }
-    );
-  }
-);
-
-sammy.bind
-(
-  'cores_build_navigation',
-  function( event, params )
-  {
-    var navigation_content = ['<ul>'];
-
-    for( var core in params.cores )
-    {
-      var core_name = core;
-      if( !core_name )
-      {
-        core_name = '<em>(empty)</em>';
-      }
-      navigation_content.push( '<li><a href="' + params.basepath + core + '">' + core_name + '</a></li>' );
-    }
-
-    params.navigation_element
-      .html( navigation_content.join( "\n" ) );
-        
-    $( 'a[href="' + params.basepath + params.current_core + '"]', params.navigation_element ).parent()
-      .addClass( 'current' );
-  }
-);
-
-sammy.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
-sammy.get
-(
-  /^#\/(~cores)$/,
-  function( context )
-  {
-    delete app.cores_template;
-    var content_element = $( '#content' );
-
-    sammy.trigger
-    (
-      'cores_load_data',
-      {
-        success : function( cores )
-        {
-          var first_core = null;
-          for( var key in cores )
-          {
-            if( !first_core )
-            {
-              first_core = key;
-            }
-            continue;
-          }
-          context.redirect( context.path + '/' + first_core );
-        },
-        error : function()
-        {
-          sammy.trigger
-          (
-            'cores_load_template',
-            {
-              content_element : content_element,
-              callback : function()
-              {
-                var cores_element = $( '#cores', content_element );
-                var navigation_element = $( '#navigation', cores_element );
-                var data_element = $( '#data', cores_element );
-                var core_data_element = $( '#core-data', data_element );
-                var index_data_element = $( '#index-data', data_element );
-
-                // layout
-
-                var ui_block = $( '#ui-block' );
-                var actions_element = $( '.actions', cores_element );
-                var div_action = $( 'div.action', actions_element );
-
-                ui_block
-                  .css( 'opacity', 0.7 )
-                  .width( cores_element.width() + 10 )
-                  .height( cores_element.height() );
-
-                if( $( '#cloud.global' ).is( ':visible' ) )
-                {
-                  $( '.cloud', div_action )
-                    .show();
-                }
-
-                $( 'button.action', actions_element )
-                  .die( 'click' )
-                  .live
-                  (
-                    'click',
-                    function( event )
-                    {
-                      var self = $( this );
-
-                      self
-                        .toggleClass( 'open' );
-
-                      $( '.action.' + self.attr( 'id' ), actions_element )
-                        .trigger( 'open' );
-
-                      return false;
-                    }
-                  );
-
-                div_action
-                  .die( 'close' )
-                  .live
-                  (
-                    'close',
-                    function( event )
-                    {
-                      div_action.hide();
-                      ui_block.hide();
-                    }
-                  )
-                  .die( 'open' )
-                  .live
-                  (
-                    'open',
-                    function( event )
-                    {
-                      var self = $( this );
-                      var rel = $( '#' + self.data( 'rel' ) );
-
-                      self
-                        .trigger( 'close' )
-                        .show()
-                        .css( 'left', rel.position().left );
-                      
-                      ui_block
-                        .show();
-                    }
-                  );
-
-                $( 'form button.reset', actions_element )
-                  .die( 'click' )
-                  .live
-                  (
-                    'click',
-                    function( event )
-                    {
-                      $( this ).closest( 'div.action' )
-                        .trigger( 'close' );
-                    }
-                  );
-
-                $( 'form', div_action )
-                  .ajaxForm
-                  (
-                    {
-                      url : app.config.solr_path + app.config.core_admin_path + '?wt=json&indexInfo=false',
-                      dataType : 'json',
-                      beforeSubmit : function( array, form, options )
-                      {
-                        $( 'button[type="submit"] span', form )
-                          .addClass( 'loader' );
-                      },
-                      success : function( response, status_text, xhr, form )
-                      {
-                        delete app.cores_data;
-                        sammy.refresh();
-
-                        $( 'button.reset', form )
-                          .trigger( 'click' );
-                      },
-                      error : function( xhr, text_status, error_thrown )
-                      {
-                        var response = null;
-                        eval( 'response = ' + xhr.responseText + ';' );
-
-                        var error_elem = $( '.error', div_action.filter( ':visible' ) );
-                        error_elem.show();
-                        $( 'span', error_elem ).text( response.error.msg );
-                      },
-                      complete : function()
-                      {
-                        $( 'button span.loader', actions_element )
-                          .removeClass( 'loader' );
-                      }
-                    }
-                  );
-
-                // --
-
-                $( '#add', content_element )
-                  .trigger( 'click' );
-
-                $( '[data-rel="add"] input[type="text"]:first', content_element )
-                  .focus();
-              }
-            }
-          );
-        }
-      }
-    );
-  }
-);
-
-// #/~cores
-sammy.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',
-      {
-        error : function()
-        {
-          context.redirect( '#/' + context.params.splat[0] );
-        },
-        success : 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 data_element = $( '#data', cores_element );
-                var core_data_element = $( '#core-data', data_element );
-                var index_data_element = $( '#index-data', data_element );
-
-                cores_element
-                  .removeClass( 'empty' );
-
-                sammy.trigger
-                (
-                  'cores_build_navigation',
-                  {
-                    cores : cores,
-                    basepath : path_parts[1],
-                    current_core : current_core,
-                    navigation_element : navigation_element
-                  }
-                );
-
-                var core_data = cores[current_core];
-                var core_basepath = $( '#' + current_core, app.menu_element ).attr( 'data-basepath' );
-
-                // core-data
-
-                $( '.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 );
-                
-                $( '.deletedDocs dd', index_data_element )
-                  .html( core_data.index.deletedDocs || '-' );
-
-                $( '.optimized dd', index_data_element )
-                  .addClass( !core_data.index.hasDeletions ? 'ico-1' : 'ico-0' );
-
-                $( '#actions #optimize', cores_element )
-                  .show();
-
-                $( '.optimized dd span', index_data_element )
-                  .html( !core_data.index.hasDeletions ? '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' );
-
-                $( '.directory dd', index_data_element )
-                  .html
-                  (
-                    core_data.index.directory
-                      .replace( /:/g, ':&#8203;' )
-                      .replace( /@/g, '@&#8203;' )
-                  );
-
-                var core_names = [];
-                var core_selects = $( '#actions select', cores_element );
-
-                for( var key in cores )
-                {
-                  core_names.push( '<option value="' + key + '">' + key + '</option>' )
-                }
-
-                core_selects
-                  .html( core_names.join( "\n") );
-
-                $( 'option[value="' + current_core + '"]', core_selects.filter( '.other' ) )
-                  .remove();
-                
-                $( 'input[data-core="current"]', cores_element )
-                  .val( current_core );
-
-                // layout
-
-                var ui_block = $( '#ui-block' );
-                var actions_element = $( '.actions', cores_element );
-                var div_action = $( 'div.action', actions_element );
-
-                ui_block
-                  .css( 'opacity', 0.7 )
-                  .width( cores_element.width() + 10 )
-                  .height( cores_element.height() );
-
-                if( $( '#cloud.global' ).is( ':visible' ) )
-                {
-                  $( '.cloud', div_action )
-                    .show();
-                }
-
-                $( 'button.action', actions_element )
-                  .die( 'click' )
-                  .live
-                  (
-                    'click',
-                    function( event )
-                    {
-                      var self = $( this );
-
-                      self
-                        .toggleClass( 'open' );
-
-                      $( '.action.' + self.attr( 'id' ), actions_element )
-                        .trigger( 'open' );
-
-                      return false;
-                    }
-                  );
-
-                div_action
-                  .die( 'close' )
-                  .live
-                  (
-                    'close',
-                    function( event )
-                    {
-                      div_action.hide();
-                      ui_block.hide();
-                    }
-                  )
-                  .die( 'open' )
-                  .live
-                  (
-                    'open',
-                    function( event )
-                    {
-                      var self = $( this );
-                      var rel = $( '#' + self.data( 'rel' ) );
-
-                      self
-                        .trigger( 'close' )
-                        .show()
-                        .css( 'left', rel.position().left );
-                      
-                      ui_block
-                        .show();
-                    }
-                  );
-
-                $( 'form button.reset', actions_element )
-                  .die( 'click' )
-                  .live
-                  (
-                    'click',
-                    function( event )
-                    {
-                      $( this ).closest( 'div.action' )
-                        .trigger( 'close' );
-                    }
-                  );
-
-                var form_callback = {
-
-                  rename : function( form, response )
-                  {
-                    var url = path_parts[1] + $( 'input[name="other"]', form ).val();
-                    context.redirect( url );
-                  }
-
-                };
-
-                $( 'form', div_action )
-                  .ajaxForm
-                  (
-                    {
-                      url : app.config.solr_path + app.config.core_admin_path + '?wt=json&indexInfo=false',
-                      dataType : 'json',
-                      beforeSubmit : function( array, form, options )
-                      {
-                        $( 'button[type="submit"] span', form )
-                          .addClass( 'loader' );
-                      },
-                      success : function( response, status_text, xhr, form )
-                      {
-                        var action = $( 'input[name="action"]', form ).val().toLowerCase();
-
-                        delete app.cores_data;
-
-                        if( form_callback[action] )
-                        {
-                         form_callback[action]( form, response ); 
-                        }
-                        else
-                        {
-                          sammy.refresh();
-                        }
-
-                        $( 'button.reset', form )
-                          .trigger( 'click' );
-                      },
-                      error : function( xhr, text_status, error_thrown )
-                      {
-                        var response = null;
-                        eval( 'response = ' + xhr.responseText + ';' );
-
-                        var error_elem = $( '.error', div_action.filter( ':visible' ) );
-                        error_elem.show();
-                        $( 'span', error_elem ).text( response.error.msg );
-                      },
-                      complete : function()
-                      {
-                        $( 'button span.loader', actions_element )
-                          .removeClass( 'loader' );
-                      }
-                    }
-                  );
-
-                var reload_button = $( '#actions #reload', cores_element );
-                reload_button
-                  .die( 'click' )
-                  .live
-                  (
-                    'click',
-                    function( event )
-                    {
-                      $.ajax
-                      (
-                        {
-                          url : app.config.solr_path + app.config.core_admin_path + '?wt=json&action=RELOAD&core=' + current_core,
-                          dataType : 'json',
-                          context : $( this ),
-                          beforeSend : function( xhr, settings )
-                          {
-                            $( 'span', this )
-                              .addClass( 'loader' );
-                          },
-                          success : function( response, text_status, xhr )
-                          {
-                            this
-                              .addClass( 'success' );
-
-                            delete app.cores_data;
-                            sammy.refresh();
-
-                            window.setTimeout
-                            (
-                              function()
-                              {
-                                reload_button
-                                  .removeClass( 'success' );
-                              },
-                              1000
-                            );
-                          },
-                          error : function( xhr, text_status, error_thrown )
-                          {
-                            this
-                              .addClass( 'warn' );
-
-                            sammy.trigger( 'cores_load_data', { only_failures : true } );
-
-                            window.setTimeout
-                            (
-                              function()
-                              {
-                                reload_button
-                                  .removeClass( 'warn' );
-                              },
-                              1000
-                            );
-                          },
-                          complete : function( xhr, text_status )
-                          {
-                            $( 'span', this )
-                              .removeClass( 'loader' );
-                          }
-                        }
-                      );
-                    }
-                  );
-                                
-                $( '#actions #unload', cores_element )
-                  .die( 'click' )
-                  .live
-                  (
-                    'click',
-                    function( event )
-                    {
-                      var ret = confirm( 'Do you really want to unload Core "' + current_core + '"?' );
-                      if( !ret )
-                      {
-                        return false;
-                      }
-
-                      $.ajax
-                      (
-                        {
-                          url : app.config.solr_path + app.config.core_admin_path + '?wt=json&action=UNLOAD&core=' + current_core,
-                          dataType : 'json',
-                          context : $( this ),
-                          beforeSend : function( xhr, settings )
-                          {
-                            $( 'span', this )
-                              .addClass( 'loader' );
-                          },
-                          success : function( response, text_status, xhr )
-                          {
-                            delete app.cores_data;
-                            context.redirect( path_parts[1].substr( 0, path_parts[1].length - 1 ) );
-                          },
-                          error : function( xhr, text_status, error_thrown )
-                          {
-                          },
-                          complete : function( xhr, text_status )
-                          {
-                            $( 'span', this )
-                              .removeClass( 'loader' );
-                          }
-                        }
-                      );
-                    }
-                  );
-
-                var optimize_button = $( '#actions #optimize', cores_element );
-                optimize_button
-                  .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 )
-                          {
-                            $( 'span', this )
-                              .addClass( 'loader' );
-                          },
-                          success : function( response, text_status, xhr )
-                          {
-                            this
-                              .addClass( 'success' );
-
-                            window.setTimeout
-                            (
-                              function()
-                              {
-                                optimize_button
-                                  .removeClass( 'success' );
-                              },
-                              1000
-                            );
-                                                        
-                            $( '.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 )
-                          {
-                            $( 'span', this )
-                              .removeClass( 'loader' );
-                          }
-                        }
-                      );
-                    }
-                  );
-
-                $( '.timeago', data_element )
-                  .timeago();
-
-                $( 'ul', data_element )
-                  .each
-                  (
-                    function( i, element )
-                    {
-                      $( 'li:odd', element )
-                        .addClass( 'odd' );
-                    }
-                  )
-              }
-            }
-          );
-        }
-      }
-    );
-  }
-);
\ No newline at end of file


[42/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10623: Remove dead code

Posted by tf...@apache.org.
SOLR-10623: Remove dead code


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/bdecee26
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/bdecee26
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/bdecee26

Branch: refs/heads/jira/solr-10233
Commit: bdecee26be098176a8e2959e7df046a0fd8ce31c
Parents: c373b71
Author: Joel Bernstein <jb...@apache.org>
Authored: Thu May 18 13:03:26 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Thu May 18 13:03:26 2017 -0400

----------------------------------------------------------------------
 .../solr/client/solrj/io/stream/SqlStream.java  | 57 +-------------------
 1 file changed, 1 insertion(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/bdecee26/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
index c91ba5c..d7c10e4 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
@@ -17,12 +17,9 @@
 package org.apache.solr.client.solrj.io.stream;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Random;
 import java.util.stream.Collectors;
@@ -38,15 +35,9 @@ import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
 import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionNamedParameter;
 import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionValue;
 import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
-import org.apache.solr.common.cloud.Aliases;
-import org.apache.solr.common.cloud.ClusterState;
-import org.apache.solr.common.cloud.DocCollection;
-import org.apache.solr.common.cloud.Slice;
-import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.common.util.StrUtils;
 
 public class SqlStream extends TupleStream implements Expressible {
 
@@ -185,12 +176,8 @@ public class SqlStream extends TupleStream implements Expressible {
     this.collection = collectionName;
     this.params = new ModifiableSolrParams(params);
 
-    // If the comparator is null then it was not explicitly set so we will create one using the sort parameter
-    // of the query. While doing this we will also take into account any aliases such that if we are sorting on
-    // fieldA but fieldA is aliased to alias.fieldA then the comparater will be against alias.fieldA.
-
     if (params.get("stmt") == null) {
-      throw new IOException("stmt param expected for search function");
+      throw new IOException("stmt param expected for sql function");
     }
   }
 
@@ -198,10 +185,6 @@ public class SqlStream extends TupleStream implements Expressible {
     this.streamContext = context;
   }
 
-  /**
-   * Opens the CloudSolrStream
-   *
-   ***/
   public void open() throws IOException {
     constructStream();
     tupleStream.open();
@@ -211,44 +194,6 @@ public class SqlStream extends TupleStream implements Expressible {
     return null;
   }
 
-
-  public static Collection<Slice> getSlices(String collectionName, ZkStateReader zkStateReader, boolean checkAlias) throws IOException {
-    ClusterState clusterState = zkStateReader.getClusterState();
-
-    Map<String, DocCollection> collectionsMap = clusterState.getCollectionsMap();
-
-    // Check collection case sensitive
-    if(collectionsMap.containsKey(collectionName)) {
-      return collectionsMap.get(collectionName).getActiveSlices();
-    }
-
-    // Check collection case insensitive
-    for(String collectionMapKey : collectionsMap.keySet()) {
-      if(collectionMapKey.equalsIgnoreCase(collectionName)) {
-        return collectionsMap.get(collectionMapKey).getActiveSlices();
-      }
-    }
-
-    if(checkAlias) {
-      // check for collection alias
-      Aliases aliases = zkStateReader.getAliases();
-      String alias = aliases.getCollectionAlias(collectionName);
-      if (alias != null) {
-        Collection<Slice> slices = new ArrayList<>();
-
-        List<String> aliasList = StrUtils.splitSmart(alias, ",", true);
-        for (String aliasCollectionName : aliasList) {
-          // Add all active slices for this alias collection
-          slices.addAll(collectionsMap.get(aliasCollectionName).getActiveSlices());
-        }
-
-        return slices;
-      }
-    }
-
-    throw new IOException("Slices not found for " + collectionName);
-  }
-
   protected void constructStream() throws IOException {
     try {
 


[49/50] [abbrv] lucene-solr:jira/solr-10233: Merge branch 'master' into jira/solr-10233

Posted by tf...@apache.org.
Merge branch 'master' into jira/solr-10233


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f67b309e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f67b309e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f67b309e

Branch: refs/heads/jira/solr-10233
Commit: f67b309ea553294f709a5587c89215950510adda
Parents: 6e5894e 606b3bf
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Thu May 18 14:23:14 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Thu May 18 14:23:14 2017 -0700

----------------------------------------------------------------------
 .../lucene/classification/classification.iml    |     3 +-
 lucene/CHANGES.txt                              |    22 +-
 .../org/tartarus/snowball/SnowballProgram.java  |    20 +-
 .../lucene/benchmark/quality/trecQRels.txt      |  1090 +-
 lucene/classification/build.xml                 |     8 +-
 .../classification/KNearestFuzzyClassifier.java |   224 +
 .../classification/utils/DatasetSplitter.java   |     2 +-
 .../KNearestFuzzyClassifierTest.java            |   119 +
 .../utils/ConfusionMatrixGeneratorTest.java     |   123 +-
 .../org/apache/lucene/codecs/CodecUtil.java     |     6 +
 .../lucene/index/DefaultIndexingChain.java      |     8 +-
 .../lucene/index/DocumentsWriterPerThread.java  |     4 +
 .../apache/lucene/index/FieldInvertState.java   |    17 +-
 .../search/similarities/BM25Similarity.java     |    79 +-
 .../search/similarities/ClassicSimilarity.java  |   101 +-
 .../search/similarities/SimilarityBase.java     |    65 +-
 .../search/similarities/TFIDFSimilarity.java    |   128 +-
 .../apache/lucene/util/AttributeFactory.java    |    39 +-
 .../java/org/apache/lucene/util/SmallFloat.java |    83 +-
 .../graph/GraphTokenStreamFiniteStrings.java    |    34 +-
 .../org/apache/lucene/codecs/TestCodecUtil.java |    13 +
 .../apache/lucene/index/TestIndexSorting.java   |     2 +-
 .../lucene/index/TestMaxTermFrequency.java      |    47 +-
 .../test/org/apache/lucene/index/TestNorms.java |    65 +-
 .../org/apache/lucene/index/TestOmitTf.java     |     4 +-
 .../lucene/search/TestDisjunctionMaxQuery.java  |     3 +-
 .../lucene/search/TestElevationComparator.java  |     9 +-
 .../apache/lucene/search/TestPhraseQuery.java   |     7 +-
 .../apache/lucene/search/TestQueryRescorer.java |    18 +-
 .../apache/lucene/search/TestSimilarity.java    |    14 +-
 .../lucene/search/TestSimilarityProvider.java   |   117 +-
 .../apache/lucene/search/TestSortRescorer.java  |     2 +-
 .../similarities/TestAxiomaticSimilarity.java   |    13 -
 .../search/similarities/TestBM25Similarity.java |    70 +-
 .../similarities/TestBooleanSimilarity.java     |     5 +-
 .../similarities/TestClassicSimilarity.java     |    91 +-
 .../search/similarities/TestSimilarityBase.java |    99 +-
 .../org/apache/lucene/util/TestSmallFloat.java  |    54 +-
 .../TestGraphTokenStreamFiniteStrings.java      |    53 +
 .../expressions/js/JavascriptCompiler.java      |   131 +-
 .../expressions/TestExpressionRescorer.java     |     2 +-
 .../search/highlight/HighlighterTest.java       |     8 +-
 .../apache/lucene/index/memory/MemoryIndex.java |     2 +-
 .../lucene/index/memory/TestMemoryIndex.java    |    34 +-
 .../apache/lucene/misc/SweetSpotSimilarity.java |    25 +-
 .../lucene/misc/SweetSpotSimilarityTest.java    |   116 +-
 .../function/valuesource/NormValueSource.java   |    36 +-
 .../function/TestLongNormValueSource.java       |   117 +-
 .../queries/function/TestValueSources.java      |     2 +-
 .../queries/payloads/TestPayloadScoreQuery.java |     9 +-
 .../queries/payloads/TestPayloadTermQuery.java  |     3 +-
 .../lucene/queryparser/classic/QueryParser.java |    47 +-
 .../lucene/queryparser/classic/QueryParser.jj   |     6 +-
 .../standard/parser/StandardSyntaxParser.java   |    43 +-
 .../standard/parser/StandardSyntaxParser.jj     |     6 +-
 .../queryparser/util/QueryParserTestBase.java   |    51 +
 .../search/similarities/RandomSimilarity.java   |     2 +-
 solr/CHANGES.txt                                |    45 +-
 solr/NOTICE.txt                                 |    14 +-
 solr/bin/install_solr_service.sh                |     8 +-
 solr/bin/solr                                   |   199 +-
 solr/bin/solr.cmd                               |   106 +-
 solr/bin/solr.in.cmd                            |     3 +
 solr/bin/solr.in.sh                             |     3 +
 .../solr/response/VelocityResponseWriter.java   |     1 +
 .../velocity/src/resources/velocity/head.vm     |     2 +-
 .../src/java/org/apache/solr/api/ApiBag.java    |     2 -
 .../java/org/apache/solr/api/V2HttpCall.java    |     2 +
 .../org/apache/solr/handler/SchemaHandler.java  |    10 -
 .../org/apache/solr/handler/StreamHandler.java  |     8 +
 .../solr/handler/component/ExpandComponent.java |    34 +-
 .../org/apache/solr/parser/QueryParser.java     |    47 +-
 .../java/org/apache/solr/parser/QueryParser.jj  |     6 +-
 .../apache/solr/response/SchemaXmlWriter.java   |     4 -
 .../org/apache/solr/schema/IndexSchema.java     |    26 +-
 .../apache/solr/schema/ManagedIndexSchema.java  |     2 -
 .../solr/search/CollapsingQParserPlugin.java    |    80 +-
 .../solr/search/ComplexPhraseQParserPlugin.java |     2 +-
 .../org/apache/solr/search/DisMaxQParser.java   |     5 +-
 .../solr/search/ExtendedDismaxQParser.java      |     3 +-
 .../org/apache/solr/search/LuceneQParser.java   |     4 +-
 .../org/apache/solr/search/QueryParsing.java    |    27 +-
 .../apache/solr/search/SimpleQParserPlugin.java |     2 +-
 .../apache/solr/servlet/SolrDispatchFilter.java |     2 +
 .../DocumentExpressionDictionaryFactory.java    |    35 +-
 .../solr/update/DefaultSolrCoreState.java       |     4 +-
 .../apache/solr/util/JsonSchemaValidator.java   |   479 +-
 .../src/java/org/apache/solr/util/SolrCLI.java  |   339 +-
 .../util/configuration/SSLConfigurations.java   |    78 +
 .../configuration/SSLConfigurationsFactory.java |    49 +
 .../solr/util/configuration/package-info.java   |    23 +
 .../src/resources/apispec/cluster.Commands.json |     2 +-
 .../resources/apispec/collections.Commands.json |     4 +-
 .../collections.collection.Commands.json        |     4 +-
 .../apispec/core.SchemaEdit.addFieldType.json   |     2 +-
 .../src/resources/apispec/core.SchemaRead.json  |     3 +-
 .../src/resources/apispec/cores.Commands.json   |     2 +-
 .../conf/bad-schema-default-operator.xml        |    26 +
 .../apache/solr/DisMaxRequestHandlerTest.java   |     4 +-
 .../solr/handler/V2ApiIntegrationTest.java      |    19 +
 .../DistributedExpandComponentTest.java         |    50 +-
 .../component/QueryElevationComponentTest.java  |     4 +-
 .../handler/component/TestExpandComponent.java  |    62 +-
 ...tSolrQueryParserDefaultOperatorResource.java |    29 -
 .../schema/TestSolrQueryParserResource.java     |    30 -
 .../apache/solr/schema/BadIndexSchemaTest.java  |     6 +-
 .../solr/schema/TestUseDocValuesAsStored.java   |     2 +-
 .../solr/search/TestCollapseQParserPlugin.java  |    18 +
 .../search/TestPayloadScoreQParserPlugin.java   |     2 +-
 .../org/apache/solr/search/TestRangeQuery.java  |    42 +
 .../search/function/SortByFunctionTest.java     |     6 +-
 .../solr/search/function/TestFunctionQuery.java |     7 +-
 .../TestSweetSpotSimilarityFactory.java         |    91 +-
 .../org/apache/solr/util/JsonValidatorTest.java |    27 +-
 .../configuration/SSLConfigurationsTest.java    |   121 +
 solr/example/files/conf/velocity/head.vm        |     2 +-
 .../javacscript-natural-sort-NOTICE.txt         |     5 -
 .../javascript-natural-sort-LICENSE-MIT.txt     |    21 -
 solr/server/etc/jetty-ssl.xml                   |     4 +-
 .../conf/velocity/head.vm                       |     2 +-
 solr/solr-ref-guide/src/404.md                  |     6 -
 solr/solr-ref-guide/src/_config.yml.template    |    12 -
 solr/solr-ref-guide/src/_includes/archive.html  |    15 -
 solr/solr-ref-guide/src/_includes/feedback.html |    16 -
 solr/solr-ref-guide/src/_includes/footer.html   |     2 +-
 solr/solr-ref-guide/src/_includes/head.html     |     4 +-
 solr/solr-ref-guide/src/_includes/image.html    |     1 -
 .../src/_includes/inline_image.html             |     1 -
 solr/solr-ref-guide/src/_includes/links.html    |    44 -
 solr/solr-ref-guide/src/_includes/sidebar.html  |     4 +-
 solr/solr-ref-guide/src/_includes/topnav.html   |     9 +-
 solr/solr-ref-guide/src/_layouts/post.html      |    41 -
 solr/solr-ref-guide/src/collections-api.adoc    |    13 +
 .../src/command-line-utilities.adoc             |    84 +-
 solr/solr-ref-guide/src/css/customstyles.css    |     4 +-
 solr/solr-ref-guide/src/css/ref-guide.css       |     2 +-
 solr/solr-ref-guide/src/draft-background.png    |   Bin 5391 -> 0 bytes
 .../src/images/draft-background.png             |   Bin 0 -> 5391 bytes
 .../solr-ref-guide/src/images/icons/favicon.ico |   Bin 0 -> 3262 bytes
 .../src/images/solr-sunOnly-small.png           |   Bin 0 -> 7528 bytes
 .../src/other-schema-elements.adoc              |     8 +-
 .../src/pdf/themes/refguide-theme.yml           |     2 +-
 .../src/rule-based-authorization-plugin.adoc    |     2 +-
 solr/solr-ref-guide/src/schema-api.adoc         |    58 -
 .../src/solr-control-script-reference.adoc      |    91 +-
 solr/solr-ref-guide/src/solr-sunOnly-small.png  |   Bin 7528 -> 0 bytes
 .../src/the-dismax-query-parser.adoc            |     2 +-
 .../solr-ref-guide/src/the-terms-component.adoc |     6 +-
 solr/solr-ref-guide/src/upgrading-solr.adoc     |     6 +-
 .../client/solrj/io/stream/CopyOfEvaluator.java |    84 +
 .../solrj/io/stream/DistanceEvaluator.java      |    77 +
 .../stream/EmpiricalDistributionEvaluator.java  |   129 +
 .../client/solrj/io/stream/LengthEvaluator.java |    60 +
 .../solrj/io/stream/PercentileEvaluator.java    |    68 +
 .../client/solrj/io/stream/RankEvaluator.java   |    75 +
 .../client/solrj/io/stream/ScaleEvaluator.java  |    78 +
 .../solr/client/solrj/io/stream/SqlStream.java  |   226 +
 .../solrj/request/schema/SchemaRequest.java     |    19 -
 .../response/schema/SchemaRepresentation.java   |    10 -
 .../solrj/response/schema/SchemaResponse.java   |    28 -
 .../solrj/io/stream/StreamExpressionTest.java   |   370 +
 .../solr/client/solrj/request/SchemaTest.java   |    10 -
 solr/webapp/web/WEB-INF/web.xml                 |     5 -
 solr/webapp/web/WEB-INF/weblogic.xml            |    28 -
 solr/webapp/web/css/angular/java-properties.css |    52 +
 solr/webapp/web/css/chosen.css                  |   421 -
 solr/webapp/web/css/styles/analysis.css         |   311 -
 solr/webapp/web/css/styles/cloud.css            |   410 -
 solr/webapp/web/css/styles/common.css           |   731 --
 solr/webapp/web/css/styles/cores.css            |   244 -
 solr/webapp/web/css/styles/dashboard.css        |   155 -
 solr/webapp/web/css/styles/dataimport.css       |   403 -
 solr/webapp/web/css/styles/documents.css        |   197 -
 solr/webapp/web/css/styles/files.css            |    54 -
 solr/webapp/web/css/styles/index.css            |   207 -
 solr/webapp/web/css/styles/java-properties.css  |    52 -
 solr/webapp/web/css/styles/logging.css          |   391 -
 solr/webapp/web/css/styles/menu.css             |   329 -
 solr/webapp/web/css/styles/plugins.css          |   195 -
 solr/webapp/web/css/styles/query.css            |   173 -
 solr/webapp/web/css/styles/replication.css      |   515 -
 solr/webapp/web/css/styles/schema-browser.css   |   578 -
 solr/webapp/web/css/styles/segments.css         |   145 -
 solr/webapp/web/css/styles/threads.css          |   172 -
 solr/webapp/web/index.html                      |    10 +-
 solr/webapp/web/js/angular/app.js               |    82 -
 solr/webapp/web/js/angular/controllers/cloud.js |    98 -
 solr/webapp/web/js/lib/ZeroClipboard.js         |   342 -
 solr/webapp/web/js/lib/chosen.js                |   982 --
 solr/webapp/web/js/lib/console.js               |    29 -
 solr/webapp/web/js/lib/d3.js                    |  9373 --------------
 solr/webapp/web/js/lib/highlight.js             |    31 -
 solr/webapp/web/js/lib/jquery-1.7.2.min.js      |    30 -
 solr/webapp/web/js/lib/jquery.ajaxfileupload.js |   184 -
 solr/webapp/web/js/lib/jquery.blockUI.js        |   523 -
 solr/webapp/web/js/lib/jquery.cookie.js         |    71 -
 solr/webapp/web/js/lib/jquery.form.js           |   806 --
 solr/webapp/web/js/lib/jquery.jstree.js         |  3534 -----
 solr/webapp/web/js/lib/jquery.sammy.js          |  1863 ---
 solr/webapp/web/js/lib/jquery.timeago.js        |   189 -
 solr/webapp/web/js/lib/linker.js                |    48 -
 solr/webapp/web/js/lib/naturalSort.js           |    82 -
 solr/webapp/web/js/lib/order.js                 |   216 -
 solr/webapp/web/js/main.js                      |    60 -
 solr/webapp/web/js/require.js                   | 11349 -----------------
 solr/webapp/web/js/scripts/analysis.js          |   545 -
 solr/webapp/web/js/scripts/app.js               |   669 -
 solr/webapp/web/js/scripts/cloud.js             |   877 --
 solr/webapp/web/js/scripts/cores.js             |   719 --
 solr/webapp/web/js/scripts/dashboard.js         |   562 -
 solr/webapp/web/js/scripts/dataimport.js        |   812 --
 solr/webapp/web/js/scripts/documents.js         |   362 -
 solr/webapp/web/js/scripts/files.js             |   270 -
 solr/webapp/web/js/scripts/index.js             |   340 -
 solr/webapp/web/js/scripts/java-properties.js   |   106 -
 solr/webapp/web/js/scripts/logging.js           |   578 -
 solr/webapp/web/js/scripts/ping.js              |    72 -
 solr/webapp/web/js/scripts/plugins.js           |   462 -
 solr/webapp/web/js/scripts/query.js             |   229 -
 solr/webapp/web/js/scripts/replication.js       |   527 -
 solr/webapp/web/js/scripts/schema-browser.js    |  1229 --
 solr/webapp/web/js/scripts/segments.js          |   206 -
 solr/webapp/web/js/scripts/threads.js           |   158 -
 solr/webapp/web/libs/jquery-1.7.2.min.js        |    30 +
 solr/webapp/web/old.html                        |   169 -
 solr/webapp/web/tpl/analysis.html               |    83 -
 solr/webapp/web/tpl/cloud.html                  |    87 -
 solr/webapp/web/tpl/cores.html                  |   226 -
 solr/webapp/web/tpl/dashboard.html              |   201 -
 solr/webapp/web/tpl/dataimport.html             |   183 -
 solr/webapp/web/tpl/documents.html              |   100 -
 solr/webapp/web/tpl/files.html                  |    44 -
 solr/webapp/web/tpl/index.html                  |   250 -
 solr/webapp/web/tpl/logging.html                |    23 -
 solr/webapp/web/tpl/plugins.html                |    39 -
 solr/webapp/web/tpl/query.html                  |   361 -
 solr/webapp/web/tpl/replication.html            |   216 -
 solr/webapp/web/tpl/schema-browser.html         |   192 -
 solr/webapp/web/tpl/segments.html               |    49 -
 solr/webapp/web/tpl/threads.html                |    56 -
 240 files changed, 4767 insertions(+), 49354 deletions(-)
----------------------------------------------------------------------



[28/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/highlight.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/highlight.js b/solr/webapp/web/js/lib/highlight.js
deleted file mode 100644
index 527c340..0000000
--- a/solr/webapp/web/js/lib/highlight.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-
-Copyright (c) 2006, Ivan Sagalaev
-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 highlight.js 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 REGENTS 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 REGENTS AND 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.
-
-*/
-
-var hljs=new function(){function l(o){return o.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+q.parentNode.className).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o<p.length;o++){if(e[p[o]]||p[o]=="no-highlight"){return p[o]}}}function c(q){var o=[];(function p(r,s){for(var t=r.firstChild;t;t=t.nextSibling){if(t.nodeType==3){s+=t.nodeValue.length}else{if(t.nodeName=="BR"){s+=1}else{if(t.nodeType==1){o.push({event:"start",offset:s,node:t});s=p(t,s);o.push({event:"stop",offset:s,node:t})}}}}return s})(q,0);return o}function j(x,v,w){var p=0;var y="";var r=[]
 ;function t(){if(x.length&&v.length){if(x[0].offset!=v[0].offset){return(x[0].offset<v[0].offset)?x:v}else{return v[0].event=="start"?x:v}}else{return x.length?x:v}}function s(A){function z(B){return" "+B.nodeName+'="'+l(B.value)+'"'}return"<"+A.nodeName+Array.prototype.map.call(A.attributes,z).join("")+">"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("</"+o.nodeName.toLowerCase()+">")}while(o!=u.node);r.splice(q,1);while(q<r.length){y+=s(r[q]);q++}}}}return y+l(w.substr(p))}function f(q){function o(s,r){return RegExp(s,"m"+(q.cI?"i":"")+(r?"g":""))}function p(y,w){if(y.compiled){return}y.compiled=true;var s=[];if(y.k){var r={};function z(A,t){t.split(" ").forEach(function(B){var C=B.split("|");r[C[0]]=[A,C[1]?Number(C[1]):1];s.push(C[0])})}y.lR=o(y.l||hljs.IR,true);if(typeof y.k=="string"){z("keyword",y.k)}else{for(var x in y.k){
 if(!y.k.hasOwnProperty(x)){continue}z(x,y.k[x])}}y.k=r}if(w){if(y.bWK){y.b="\\b("+s.join("|")+")\\s"}y.bR=o(y.b?y.b:"\\B|\\b");if(!y.e&&!y.eW){y.e="\\B|\\b"}if(y.e){y.eR=o(y.e)}y.tE=y.e||"";if(y.eW&&w.tE){y.tE+=(y.e?"|":"")+w.tE}}if(y.i){y.iR=o(y.i)}if(y.r===undefined){y.r=1}if(!y.c){y.c=[]}for(var v=0;v<y.c.length;v++){if(y.c[v]=="self"){y.c[v]=y}p(y.c[v],y)}if(y.starts){p(y.starts,w)}var u=[];for(var v=0;v<y.c.length;v++){u.push(y.c[v].b)}if(y.tE){u.push(y.tE)}if(y.i){u.push(y.i)}y.t=u.length?o(u.join("|"),true):{exec:function(t){return null}}}p(q)}function d(D,E){function o(r,M){for(var L=0;L<M.c.length;L++){var K=M.c[L].bR.exec(r);if(K&&K.index==0){return M.c[L]}}}function s(K,r){if(K.e&&K.eR.test(r)){return K}if(K.eW){return s(K.parent,r)}}function t(r,K){return K.i&&K.iR.test(r)}function y(L,r){var K=F.cI?r[0].toLowerCase():r[0];return L.k.hasOwnProperty(K)&&L.k[K]}function G(){var K=l(w);if(!A.k){return K}var r="";var N=0;A.lR.lastIndex=0;var L=A.lR.exec(K);while(L){r+=K.subs
 tr(N,L.index-N);var M=y(A,L);if(M){v+=M[1];r+='<span class="'+M[0]+'">'+L[0]+"</span>"}else{r+=L[0]}N=A.lR.lastIndex;L=A.lR.exec(K)}return r+K.substr(N)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return'<span class="'+r.language+'">'+r.value+"</span>"}function J(){return A.sL!==undefined?z():G()}function I(L,r){var K=L.cN?'<span class="'+L.cN+'">':"";if(L.rB){x+=K;w=""}else{if(L.eB){x+=l(r)+K;w=""}else{x+=K;w=r}}A=Object.create(L,{parent:{value:A}});B+=L.r}function C(K,r){w+=K;if(r===undefined){x+=J();return 0}var L=o(r,A);if(L){x+=J();I(L,r);return L.rB?0:r.length}var M=s(A,r);if(M){if(!(M.rE||M.eE)){w+=r}x+=J();do{if(A.cN){x+="</span>"}A=A.parent}while(A!=M.parent);if(M.eE){x+=l(r)}w="";if(M.starts){I(M.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw"Illegal"}w+=r;return r.length||1}var F=e[D];f(F);var A=F;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(E);if(!u){break}q=C(E.
 substr(p,u.index-p),u[0]);p=u.index+q}C(E.substr(p));return{r:B,keyword_count:v,value:x,language:D}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:l(E)}}else{throw H}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"<br>")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w
 .second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;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="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM=
 {cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.ruby=function(e){var a="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var j="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var g={keyword:"and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include"};var c={cN:"yardoctag",b:"@[A-Za-z]+"};var k=[{cN:"comment",b:"#",e:"$",c:[c]},{cN:"comment",b:"^\\=begin",e:"^\\=end",c:[c],r:10},{cN:"comment",b:"^__END__",e:"\\n$"}];var d={cN:"subst",b:"#\\{",e:"}",l:a,k:g};var
  i=[e.BE,d];var b=[{cN:"string",b:"'",e:"'",c:i,r:0},{cN:"string",b:'"',e:'"',c:i,r:0},{cN:"string",b:"%[qw]?\\(",e:"\\)",c:i},{cN:"string",b:"%[qw]?\\[",e:"\\]",c:i},{cN:"string",b:"%[qw]?{",e:"}",c:i},{cN:"string",b:"%[qw]?<",e:">",c:i,r:10},{cN:"string",b:"%[qw]?/",e:"/",c:i,r:10},{cN:"string",b:"%[qw]?%",e:"%",c:i,r:10},{cN:"string",b:"%[qw]?-",e:"-",c:i,r:10},{cN:"string",b:"%[qw]?\\|",e:"\\|",c:i,r:10}];var h={cN:"function",bWK:true,e:" |$|;",k:"def",c:[{cN:"title",b:j,l:a,k:g},{cN:"params",b:"\\(",e:"\\)",l:a,k:g}].concat(k)};var f=k.concat(b.concat([{cN:"class",bWK:true,e:"$|;",k:"class module",c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]}].concat(k)},h,{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:b.concat([{b:j}]),r:0},{cN:"symbol",b:a+":",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"
 variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:k.concat([{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[e.BE,d]}]),r:0}]));d.c=f;h.c[1].c=f;return{l:a,k:g,c:f}}(hljs);hljs.LANGUAGES.diff=function(a){return{c:[{cN:"chunk",b:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",r:10},{cN:"chunk",b:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",r:10},{cN:"chunk",b:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",r:10},{cN:"header",b:"Index: ",e:"$"},{cN:"header",b:"=====",e:"=====$"},{cN:"header",b:"^\\-\\-\\-",e:"$"},{cN:"header",b:"^\\*{3} ",e:"$"},{cN:"header",b:"^\\+\\+\\+",e:"$"},{cN:"header",b:"\\*{5}",e:"\\*{5}$"},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}}(hljs);hljs.LANGUAGES.javascript=function(a){return{k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const",literal:"true false null undefined NaN Infinity"},c:[a.ASM
 ,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",i:"\\n",c:[{b:"\\\\/"}]},{b:"<",e:">;",sL:"xml"}],r:0},{cN:"function",bWK:true,e:"{",k:"function",c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[a.CLCM,a.CBLCLM],i:"[\"'\\(]"}],i:"\\[|%"}]}}(hljs);hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts
 :{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},b]}]}}(hljs);hljs.LANGUAGES.php=function(a){var e={cN:"variable",b:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var b=[a.inherit(a.ASM,{i:null}),a.inherit(a.QSM,{i:null}),{cN:"string",b:'b"',e:'"',c:[a.BE]},{cN:"string",b:"b'",e:"'",c:[a.BE]}];var c=[a.BNM,a.CNM];var d={cN:"title",b:a.UIR};return{cI:true,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return implements parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception php_user_filter default die require __FUNCTION__ enddeclare final try this switch continue endfor endif declare unset true false namespace trait goto instanceof insteadof __DIR__ __NAMESPACE__ __halt_compiler",c
 :[a.CLCM,a.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"}]},{cN:"comment",eB:true,b:"__halt_compiler.+?;",eW:true},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[a.BE]},{cN:"preprocessor",b:"<\\?php",r:10},{cN:"preprocessor",b:"\\?>"},e,{cN:"function",bWK:true,e:"{",k:"function",i:"\\$|\\[|%",c:[d,{cN:"params",b:"\\(",e:"\\)",c:["self",e,a.CBLCLM].concat(b).concat(c)}]},{cN:"class",bWK:true,e:"{",k:"class",i:"[:\\(\\$]",c:[{bWK:true,eW:true,k:"extends",c:[d]},d]},{b:"=>"}].concat(b).concat(c)}}(hljs);hljs.LANGUAGES.python=function(a){var f={cN:"prompt",b:"^(>>>|\\.\\.\\.) "};var c=[{cN:"string",b:"(u|b)?r?'''",e:"'''",c:[f],r:10},{cN:"string",b:'(u|b)?r?"""',e:'"""',c:[f],r:10},{cN:"string",b:"(u|r|ur)'",e:"'",c:[a.BE],r:10},{cN:"string",b:'(u|r|ur)"',e:'"',c:[a.BE],r:10},{cN:"string",b:"(b|br)'",e:"'",c:[a.BE]},{cN:"string",b:'(b|br)"',e:'"',c:[a.BE]}].concat([a.ASM,a.QSM]);var e={cN:"title",b:a.UIR};var d={cN:"params",b:"\\(",e:"\\)",c:["self",a.CNM,f]
 .concat(c)};var b={bWK:true,e:":",i:"[${=;\\n]",c:[e,d],r:10};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10",built_in:"None True False Ellipsis NotImplemented"},i:"(</|->|\\?)",c:c.concat([f,a.HCM,a.inherit(b,{cN:"function",k:"def"}),a.inherit(b,{cN:"class",k:"class"}),a.CNM,{cN:"decorator",b:"@",e:"$"},{b:"\\b(print|exec)\\("}])}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs);


[31/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/index.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/index.css b/solr/webapp/web/css/styles/index.css
deleted file mode 100644
index 288e040..0000000
--- a/solr/webapp/web/css/styles/index.css
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #index .bar-desc
-{
-  color: #c0c0c0;
-  font-weight: normal;
-  margin-left: 10px;
-  white-space: pre;
-}
-
-#content #index .bar-holder
-{
-  box-shadow: 5px 5px 10px #c0c0c0;
-  -moz-box-shadow: 5px 5px 10px #c0c0c0;
-  -webkit-box-shadow: 5px 5px 10px #c0c0c0;
-  height: 35px;
-}
-
-#content #index .bar-holder .bar
-{
-  height: 100%;
-  position: relative;
-}
-
-#content #index .bar-holder div .val
-{
-  border-right: 1px solid #f00;
-  display: block;
-  padding-right: 5px;
-  position: absolute;
-  right: 0;
-  top: 35px;
-  white-space: nowrap;
-}
-
-#content #index .bar-holder .bar-max.bar
-{
-  background-color: #f0f0f0;
-}
-
-#content #index .bar-holder .bar-max.val
-{
-  border-color: #f0f0f0;
-  color: #d6d6d6;
-}
-
-#content #index .bar-holder .bar-total.bar
-{
-  background-color: #c0c0c0;
-}
-
-#content #index .bar-holder .bar-total.val
-{
-  border-color: #c0c0c0;
-  color: #c0c0c0;
-}
-
-#content #index .bar-holder .bar-used.bar
-{
-  background-color: #969696;
-}
-
-#content #index .bar-holder .bar-used.val
-{
-  border-color: #969696;
-  color: #969696;
-}
-
-#content #index .bar-holder.bar-lvl-2 .bar-max.val { padding-top: 25px; }
-#content #index .bar-holder.bar-lvl-2 .bar-total.val { padding-top: 5px; }
-#content #index .bar-holder.bar-lvl-2 { margin-bottom: 45px; }
-
-#content #index .bar-holder.bar-lvl-3 .bar-max.val { padding-top: 45px; }
-#content #index .bar-holder.bar-lvl-3 .bar-total.val { padding-top: 25px; }
-#content #index .bar-holder.bar-lvl-3 .bar-used.val { padding-top: 5px; }
-#content #index .bar-holder.bar-lvl-3 { margin-bottom: 65px; }
-
-#content #index .loader
-{
-  background-position: 0 50%;
-  padding-left: 21px;
-}
-
-#content #index .index-left
-{
-  float: left;
-  width: 55%;
-}
-
-#content #index .index-right
-{
-  float: right;
-  width: 40%;
-}
-
-#content #index .data li
-{
-  display: none;
-  padding-top: 3px;
-  padding-bottom: 3px;
-}
-
-#content #index .data li dt
-{
-  float: left;
-  white-space: nowrap;
-  width: 20%;
-}
-
-#content #index .data li dd
-{
-  float: right;
-  text-overflow: ellipsis;
-  overflow: hidden;
-  white-space: nowrap;
-  width: 80%
-}
-
-#content #index .data li dd.odd
-{
-  color: #999;
-}
-
-#content #index .data dt span
-{
-  background-position: 1px 50%;
-  display: block;
-  padding-left: 22px;
-}
-
-#content #index #instance h2 { background-image: url( ../../img/ico/server.png ); }
-#content #index #instance .start_time dt span { background-image: url( ../../img/ico/clock-select.png ); }
-
-#content #index #versions h2 { background-image: url( ../../img/ico/property.png ); }
-#content #index #versions .solr span { background-image: url( ../../img/solr-ico.png ); }
-#content #index #versions .lucene span { background-image: url( ../../img/lucene-ico.png ); }
-
-#content #index #jvm h2 { background-image: url( ../../img/ico/jar.png ); }
-#content #index #jvm .jvm_version dt span { background-image: url( ../../img/ico/jar.png ); }
-#content #index #jvm .processors dt span { background-image: url( ../../img/ico/processor.png ); }
-#content #index #jvm .command_line_args dt span { background-image: url( ../../img/ico/terminal.png ); }
-
-#content #index #system h2 { background-image: url( ../../img/ico/system-monitor.png ); }
-
-#content #index #system
-{
-  position: relative;
-}
-
-#content #index #system .reload
-{
-  background-image: url( ../../img/ico/arrow-circle.png );
-  background-position: 50% 50%;
-  display: block;
-  height: 30px;
-  position: absolute;
-  right: 0;
-  top: 0;
-  width: 30px;
-}
-
-#content #index #system .reload.loader
-{
-  padding-left: 0;
-}
-
-#content #index #system .reload span
-{
-  display: none;
-}
-
-#content #index #system .content p
-{
-  margin-top: 10px;
-  margin-bottom: 5px;
-}
-
-#content #index #system .content .no-info
-{
-  color: #c0c0c0;
-  display: none;
-  font-style: italic;
-}
-
-#content #index #jvm-memory h2 { background-image: url( ../../img/ico/memory.png ); }
-
-#content #index #jvm-memory-bar
-{
-  margin-top: 20px;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/java-properties.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/java-properties.css b/solr/webapp/web/css/styles/java-properties.css
deleted file mode 100644
index ab5b67b..0000000
--- a/solr/webapp/web/css/styles/java-properties.css
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-
-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.
-
-*/
-
-#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: 29%;
-}
-
-#content #java-properties li dd
-{
-  float: right;
-  width: 70%
-}
-
-#content #java-properties li dd.odd
-{
-  color: #999;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/logging.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/logging.css b/solr/webapp/web/css/styles/logging.css
deleted file mode 100644
index 6d30957..0000000
--- a/solr/webapp/web/css/styles/logging.css
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #logging .loader
-{
-  background-position: 0 50%;
-  padding-left: 21px;
-}
-
-#content #logging .block h2
-{
-  background-image: url( ../../img/ico/document-text.png );
-  margin-bottom: 10px;
-}
-
-#content #logging .block h2 span span
-{
-  color: #c0c0c0;
-  font-weight: normal;
-  margin-left: 10px;
-}
-
-#content #logging #viewer
-{
-  position: relative;
-}
-
-#content #logging #viewer time
-{
-  white-space: pre;
-}
-
-#content #logging #viewer #footer
-{
-  margin-top: 20px;
-}
-
-#content #logging #viewer #state
-{
-  background-position: 0 50%;
-  float: left;
-  color: #c0c0c0;
-  padding-left: 21px;
-  width: 45%;
-}
-
-#content #logging #viewer #date-format
-{
-  float: right;
-}
-
-#content #logging #viewer #date-format a
-{
-  background-image: url( ../../img/ico/ui-check-box-uncheck.png );
-  background-position: 0 50%;
-  color: #c0c0c0;
-  display: block;
-  padding-left: 21px;
-}
-
-#content #logging #viewer #date-format a:hover
-{
-  color: #008;
-}
-
-#content #logging #viewer #date-format a.on
-{
-  background-image: url( ../../img/ico/ui-check-box.png );
-  color: #333;
-}
-
-#content #logging #viewer table
-{
-  border-collapse: collapse;
-  width: 100%;
-}
-
-#content #logging #viewer th,
-#content #logging #viewer td a,
-#content #logging #viewer tbody .trace td
-{
-  padding: 3px 10px;
-}
-
-#content #logging #viewer td
-{
-  vertical-align: top;
-}
-
-#content #logging #viewer td a
-{
-  display: block;
-}
-
-#content #logging #viewer thead th
-{
-  font-weight: bold;
-  text-align: left;
-}
-
-#content #logging #viewer tbody td,
-#content #logging #viewer tfoot td
-{
-  border-top: 1px solid #f0f0f0;
-}
-
-#content #logging #viewer thead th.message
-{
-  width:100%;
-}
-
-#content #logging #viewer tbody td.span a
-{
-  padding-left: 0;
-  padding-right: 0;
-}
-
-#content #logging #viewer tbody span
-{
-  display: block;
-  padding-left: 10px;
-  padding-right: 10px;
-}
-
-#content #logging #viewer tbody .level-info .level span { background-color: #ebf5eb; }
-#content #logging #viewer tbody .level-warning     span { background-color: #FFD930; }
-#content #logging #viewer tbody .level-severe     span  { background-color: #c43c35; color: #fff; }
-
-#content #logging #viewer tbody .level-debug  span  { background-color: #ebf5eb; }
-#content #logging #viewer tbody .level-warn   span  { background-color: #FFD930; }
-#content #logging #viewer tbody .level-error  span  { background-color: #FF6130; }
-#content #logging #viewer tbody .level-fatal  span  { background-color: #c43c35; }
-
-#content #logging #viewer tbody .has-trace a
-{
-  cursor: pointer;
-}
-
-#content #logging #viewer tbody .has-trace a:hover
-{
-  color: #008;
-}
-
-#content #logging #viewer tbody .has-trace .message a
-{
-  background-image: url( ../../img/ico/information.png );
-  background-position: 100% 50%;
-  display: block;
-  padding-right: 21px;
-}
-
-#content #logging #viewer tbody .has-trace.open .message a
-{
-  background-image: url( ../../img/ico/information-white.png );
-}
-
-#content #logging #viewer tbody .trace
-{
-  display: none;
-}
-
-#content #logging #viewer tbody .trace td
-{
-  border-top: 0;
-  color: #c0c0c0;
-}
-
-#content #logging #viewer .has-data tfoot
-{
-  display: none;
-}
-
-#content #logging #viewer tfoot td
-{
-  color: #c0c0c0;
-}
-
-#content #logging .jstree > li
-{
-  margin-left: 0;
-}
-
-#content #logging .jstree li
-{
-  position: relative;
-}
-
-#content #logging .jstree .level-finest  { background-color: #d5e5fc; }
-#content #logging .jstree .level-fine    { background-color: #d5fafc; }
-#content #logging .jstree .level-config  { background-color: #e6fded; }
-#content #logging .jstree .level-info    { background-color: #fafcd7; }
-#content #logging .jstree .level-warning { background-color: #fcecd5; }
-#content #logging .jstree .level-severe  { background-color: #fcdcda; }
-#content #logging .jstree .level-off     { background-color: #ffffff; }
-
-/* Log4j */
-#content #logging .jstree .level-all     { background-color: #9EDAFF; }
-#content #logging .jstree .level-trace   { background-color: #d5e5fc; }
-#content #logging .jstree .level-debug   { background-color: #d5fafc; }
-#content #logging .jstree .level-warn    { background-color: #e6fded; }
-#content #logging .jstree .level-error   { background-color: #fcecd5; }
-#content #logging .jstree .level-fatal   { background-color: #fcdcda; }
-
-
-#content #logging .jstree a
-{
-  height: 17px;
-  line-height: 17px;
-  padding: 0;
-  width: 90%;
-}
-
-#content #logging .jstree a:hover
-{
-  color: #008;
-}
-
-#content #logging .jstree a span.ns
-{
-  display: none;
-}
-
-#content #logging.ns .jstree a span.ns
-{
-  display: inline;
-}
-
-#content #logging .jstree a span.name
-{
-  background-position: 100% 50%;
-  cursor: pointer;
-  padding-right: 21px;
-}
-
-#content #logging .jstree a span.name em
-{
-  color: #f00;
-  font-style: normal;
-  text-transform: uppercase;
-}
-
-#content #logging .jstree a.trigger.set
-{
-  font-weight: bold;
-}
-
-#content #logging .jstree a:hover span.name
-{
-  background-image: url( ../../img/ico/pencil-small.png );
-}
-
-#content #logging .jstree .selector-holder
-{
-  position: absolute;
-  top: -2px;
-  z-index: 700;
-}
-
-#content #logging .jstree .selector-holder.open
-{
-  background-color: #fff;
-  margin-left: -19px;
-  z-index: 800;
-}
-
-#content #logging .jstree li .selector-holder { left: 440px; }
-#content #logging .jstree li li .selector-holder { left: 422px; }
-#content #logging .jstree li li li .selector-holder { left: 404px; }
-#content #logging .jstree li li li li .selector-holder { left: 386px; }
-#content #logging .jstree li li li li li .selector-holder { left: 368px; }
-#content #logging .jstree li li li li li li .selector-holder { left: 350px; }
-#content #logging .jstree li li li li li li li .selector-holder { left: 332px; }
-#content #logging .jstree li li li li li li li li .selector-holder { left: 314px; }
-
-#content #logging .jstree .selector
-{
-  border: 1px solid transparent;
-  position: relative;
-}
-
-#content #logging .jstree .open .selector
-{
-  border-color: #f0f0f0;
-  box-shadow: 5px 5px 10px #c0c0c0;
-  -moz-box-shadow: 5px 5px 10px #c0c0c0;
-  -webkit-box-shadow: 5px 5px 10px #c0c0c0;
-}
-
-#content #logging .jstree .selector a
-{
-  display: block;
-  padding: 2px;
-  width: auto;
-}
-
-#content #logging .jstree .selector .close
-{
-  display: none;
-}
-
-#content #logging .jstree .open .selector .close
-{
-  background-image: url( ../../img/ico/cross-0.png );
-  background-position: 50% 50%;
-  display: block;
-  position: absolute;
-  right: -25px;
-  top: 0;
-  width: 20px;
-}
-
-#content #logging .jstree .open .selector .close:hover
-{
-  background-image: url( ../../img/ico/cross-1.png );
-}
-
-#content #logging .jstree .open .selector .close span
-{
-  display: none;
-}
-
-#content #logging .jstree .open .selector a.trigger
-{
-  display: none;
-}
-
-#content #logging .jstree .selector ul
-{
-  display: none;
-}
-
-#content #logging .jstree .open .selector ul
-{
-  display: block;
-}
-
-#content #logging .jstree .selector ul li
-{
-  background: none;
-  margin-left: 0;
-}
-
-#content #logging .jstree .selector ul li a
-{
-  background-image: url( ../../img/ico/ui-radio-button-uncheck.png );
-  background-position: 2px 50%;
-  padding-left: 21px;
-}
-
-#content #logging .jstree .selector ul li a.level
-{
-  background-color: #f0f0f0;
-}
-
-#content #logging .jstree .selector ul li a:hover
-{
-  background-image: url( ../../img/ico/ui-radio-button.png );
-}
-
-#content #logging .jstree .selector li.unset
-{
-  border-top: 1px solid #f0f0f0;
-}
-
-#content #logging .jstree .selector li.unset a
-{
-  background-image: url( ../../img/ico/cross-0.png );
-  background-position: 4px 50%;
-}
-
-#content #logging .jstree .selector li.unset a:hover
-{
-  background-image: url( ../../img/ico/cross-1.png );
-  color: #800;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/menu.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/menu.css b/solr/webapp/web/css/styles/menu.css
deleted file mode 100644
index f4fa68f..0000000
--- a/solr/webapp/web/css/styles/menu.css
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
-
-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.
-
-*/
-
-#menu-wrapper
-{
-  position: fixed;
-  top: 120px;
-  width: 150px;
-}
-
-.scroll #menu-wrapper
-{
-  position: absolute;
-  top: 90px;
-}
-
-.has-environment #menu-wrapper
-{
-  top: 160px;
-}
-
-#menu-wrapper a
-{
-  display: block;
-  padding: 4px 2px;
-  overflow: hidden;
-  text-overflow: ellipsis;
-}
-
-#core-selector
-{
-  margin-top: 20px;
-  padding-right: 10px;
-}
-
-#core-selector a
-{
-  padding: 0;
-  padding-left: 8px;
-}
-
-#core-selector select
-{
-  width: 100%;
-}
-
-#core-selector #has-no-cores
-{
-  display: none;
-}
-
-#core-selector #has-no-cores a
-{
-  background-image: url( ../../img/ico/database--plus.png );
-}
-
-#core-selector #has-no-cores span
-{
-  color: #c0c0c0;
-  display: block;
-}
-
-#menu-wrapper .active p
-{
-  background-color: #fafafa;
-  border-color: #c0c0c0;
-}
-
-#menu-wrapper p a,
-#menu a
-{
-  background-position: 5px 50%;
-  padding-left: 26px;
-  padding-top: 5px;
-  padding-bottom: 5px;
-}
-
-#menu-wrapper p a:hover
-{
-  background-color: #f0f0f0;
-}
-
-#menu-wrapper .active p a
-{
-  background-color: #c0c0c0;
-  font-weight: bold;
-}
-
-#menu p.loader
-{
-  background-position: 5px 50%;
-  color: #c0c0c0;
-  margin-top: 5px;
-  padding-left: 26px;
-}
-
-#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 #f0f0f0;
-}
-
-#menu li:last-child
-{
-  border-bottom: 0;
-}
-
-#menu li.optional
-{
-  display: none;
-}
-
-#core-menu p
-{
-  border-top: 1px solid #f0f0f0;
-}
-
-#core-menu li:first-child p
-{
-  border-top: 0;
-}
-
-#core-menu p a
-{
-  background-image: url( ../../img/ico/status-offline.png );
-}
-
-#core-menu .active p a
-{
-  background-image: url( ../../img/ico/box.png );
-}
-
-#core-menu ul,
-#menu ul
-{
-  display: none;
-  padding-top: 5px;
-  padding-bottom: 10px;
-}
-
-#core-menu .active ul,
-#menu .active ul
-{
-  display: block;
-}
-
-#menu ul li
-{
-  border-bottom: 0;
-}
-
-#core-menu ul li a,
-#menu ul li a
-{
-  background-position: 7px 50%;
-  border-bottom: 1px solid #f0f0f0;
-  color: #bbb;
-  margin-left: 15px;
-  padding-left: 26px;
-}
-
-#core-menu ul li:last-child a,
-#menu ul li:last-child a
-{
-  border-bottom: 0;
-}
-
-#core-menu ul li a:hover,
-#menu ul li a:hover
-{
-  background-color: #f0f0f0;
-  color: #333;
-}
-
-#core-menu ul li.active a,
-#menu ul li.active a
-{
-  background-color: #d0d0d0;
-  border-color: #d0d0d0;
-  color: #333;
-}
-
-#menu #index.global p a { background-image: url( ../../img/ico/dashboard.png ); }
-
-#menu #logging.global p a { background-image: url( ../../img/ico/inbox-document-text.png ); }
-#menu #logging.global .level a { background-image: url( ../../img/ico/gear.png ); }
-
-#menu #java-properties.global p a { background-image: url( ../../img/ico/jar.png ); }
-
-#menu #threads.global p a { background-image: url( ../../img/ico/ui-accordion.png ); }
-
-#menu #cores.global p a { background-image: url( ../../img/ico/databases.png ); }
-
-#menu #cloud.global p a { background-image: url( ../../img/ico/network-cloud.png ); }
-#menu #cloud.global .tree a { background-image: url( ../../img/ico/folder-tree.png ); }
-#menu #cloud.global .graph a { background-image: url( ../../img/ico/molecule.png ); }
-#menu #cloud.global .rgraph a { background-image: url( ../../img/ico/asterisk.png ); }
-#menu #cloud.global .dump a { background-image: url( ../../img/ico/download-cloud.png ); }
-
-#core-menu .ping.error a
-{
-  
-  background-color: #ffcccc;
-  background-image: url( ../../img/ico/system-monitor--exclamation.png );
-  border-color: #ffcccc;
-  cursor: help;
-}
-
-#core-menu .overview a { background-image: url( ../../img/ico/home.png ); }
-#core-menu .query a { background-image: url( ../../img/ico/magnifier.png ); }
-#core-menu .analysis a { background-image: url( ../../img/ico/funnel.png ); }
-#core-menu .documents a { background-image: url( ../../img/ico/documents-stack.png ); }
-#core-menu .files a { background-image: url( ../../img/ico/folder.png ); }
-#core-menu .schema-browser a { background-image: url( ../../img/ico/book-open-text.png ); }
-#core-menu .replication a { background-image: url( ../../img/ico/node.png ); }
-#core-menu .distribution a { background-image: url( ../../img/ico/node-select.png ); }
-#core-menu .ping a { background-image: url( ../../img/ico/system-monitor.png ); }
-#core-menu .logging a { background-image: url( ../../img/ico/inbox-document-text.png ); }
-#core-menu .plugins a { background-image: url( ../../img/ico/block.png ); }
-#core-menu .dataimport a { background-image: url( ../../img/ico/document-import.png ); }
-#core-menu .segments a { background-image: url( ../../img/ico/construction.png ); }
-
-
-#content #navigation
-{
-  border-right: 1px solid #e0e0e0;
-}
-
-#content #navigation a
-{
-  display: block;
-  padding: 4px 2px;
-}
-
-#content #navigation .current
-{
-  border-color: #e0e0e0;
-}
-
-#content #navigation a
-{
-  background-position: 5px 50%;
-  padding-left: 26px;
-  padding-top: 5px;
-  padding-bottom: 5px;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-}
-
-#content #navigation a:hover
-{
-  background-color: #f0f0f0;
-}
-
-#content #navigation .current a
-{
-  background-color: #e0e0e0;
-  font-weight: bold;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/plugins.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/plugins.css b/solr/webapp/web/css/styles/plugins.css
deleted file mode 100644
index f8ea769..0000000
--- a/solr/webapp/web/css/styles/plugins.css
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #plugins #navigation
-{
-  width: 20%;
-}
-
-#content #plugins #navigation .cache a { background-image: url( ../../img/ico/disk-black.png ); }
-#content #plugins #navigation .core a { background-image: url( ../../img/ico/wooden-box.png ); }
-#content #plugins #navigation .other a { background-image: url( ../../img/ico/zone.png ); }
-#content #plugins #navigation .highlighting a { background-image: url( ../../img/ico/highlighter-text.png ); }
-#content #plugins #navigation .updatehandler a{ background-image: url( ../../img/ico/arrow-circle.png ); }
-#content #plugins #navigation .queryhandler a { background-image: url( ../../img/ico/magnifier.png ); }
-#content #plugins #navigation .queryparser a { background-image: url( ../../img/ico/asterisk.png ); }
-
-#content #plugins #navigation .PLUGINCHANGES { margin-top: 20px; }
-#content #plugins #navigation .PLUGINCHANGES a { background-image: url( ../../img/ico/eye.png ); }
-#content #plugins #navigation .RELOAD a { background-image: url( ../../img/ico/arrow-circle.png ); }
-
-
-#content #plugins #navigation a
-{
-  position: relative;
-}
-
-#content #plugins #navigation a span
-{
-  background-color: #bba500;
-  border-radius: 5px;
-  color: #fff;
-  font-size: 10px;
-  font-weight: normal;
-  line-height: 1.4em;
-  padding-left: 4px;
-  padding-right: 4px;
-  position: absolute;
-  right: 5px;
-  top: 7px;
-}
-
-#content #plugins #frame
-{
-  float: right;
-  width: 78%;
-}
-
-#content #plugins #frame .entry
-{
-  margin-bottom: 10px;
-}
-
-#content #plugins #frame .entry:last-child
-{
-  margin-bottom: 0;
-}
-
-#content #plugins #frame .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 #frame .entry.changed a span
-{
-  color: #bba500;
-}
-
-#content #plugins #frame .entry.expanded a
-{
-  background-image: url( ../../img/ico/chevron-small.png );
-}
-
-#content #plugins #frame .entry.expanded ul
-{
-  display: block;
-}
-
-#content #plugins #frame .entry ul
-{
-  border-left: 9px solid #f0f3ff;
-  display: none;
-  margin-left: 3px;
-  padding-top: 5px;
-  padding-left: 10px;
-}
-
-#content #plugins #frame .entry li
-{
-  padding-top: 2px;
-  padding-bottom: 2px;
-}
-
-#content #plugins #frame .entry li.stats
-{
-  border-top: 1px solid #c0c0c0;
-  margin-top: 5px;
-  padding-top: 5px;
-}
-
-#content #plugins #frame .entry li.odd
-{
-  background-color: #f8f8f8;
-}
-
-#content #plugins #frame .entry dt,
-#content #plugins #frame .entry .stats span
-{
-  float: left;
-  width: 11%;
-}
-
-#content #plugins #frame .entry dd,
-#content #plugins #frame .entry .stats ul
-{
-  float: right;
-  width: 88%;
-}
-
-#content #plugins #frame .entry .stats ul
-{
-  border-left: 0;
-  margin: 0;
-  padding: 0;
-}
-
-#content #plugins #frame .entry .stats dt
-{
-  width: 27%;
-}
-
-#content #plugins #frame .entry .stats dd
-{
-  width: 72%;
-}
-
-#content #plugins #frame .entry.expanded a.linker {
-  background-image: none;
-  background-position: 0 0;
-  display: inline;
-  font-weight: normal;
-  padding:0px;
-}
-
-#content #plugins #frame .entry.expanded a.linker:hover {
-  background-color:#F0F3FF;
-}
-
-#recording
-{
-  display: none;
-}
-
-#recording .wrapper
-{
-  padding: 30px;
-}
-
-#recording p
-{
-  background-position: 0 50%;
-  float: left;
-  padding-left: 21px;
-  padding-top: 7px;
-  padding-bottom: 7px;
-}
-
-#recording button
-{
-  float: right;
-}
-
-#recording button span
-{
-  background-image: url( ../../img/ico/new-text.png );
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/query.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/query.css b/solr/webapp/web/css/styles/query.css
deleted file mode 100644
index 9fd7913..0000000
--- a/solr/webapp/web/css/styles/query.css
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #query
-{
-  background-image: url( ../../img/div.gif );
-  background-position: 22% 0;
-  background-repeat: repeat-y;
-}
-
-#content #query #form
-{
-  float: left;
-  width: 21%;
-}
-
-#content #query #form label
-{
-  cursor: pointer;
-  display: block;
-  margin-top: 5px;
-}
-
-#content #query #form input,
-#content #query #form select,
-#content #query #form textarea
-{
-  margin-bottom: 2px;
-  width: 100%;
-}
-
-#content #query #form input,
-#content #query #form textarea
-{
-  width: 98%;
-}
-
-#content #query #form .multiple input
-{
-  float: left;
-  width: 80%
-}
-
-#content #query #form .multiple .buttons
-{
-  float: right;
-  width: 16%;
-}
-
-
-#content #query #form .multiple a
-{
-  background-position: 50% 50%;
-  display: block;
-  height: 25px;
-  width: 49%;
-}
-
-#content #query #form .multiple a span
-{
-  display: none;
-}
-
-#content #query #form .multiple a.add
-{
-  background-image: url( ../../img/ico/plus-button.png );
-  float: right;
-}
-
-#content #query #form .multiple a.rem
-{
-  background-image: url( ../../img/ico/minus-button.png );
-  float: left;
-}
-
-#content #query #form #start
-{
-  float: left;
-  width: 45%;
-}
-
-#content #query #form #rows
-{
-  float: right;
-  width: 45%;
-}
-
-#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: 5px;
-}
-
-#content #query #form fieldset.common
-{
-  margin-top: 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: 10px;
-}
-
-#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: 77%;
-}
-
-#content #query #result #response
-{
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/replication.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/replication.css b/solr/webapp/web/css/styles/replication.css
deleted file mode 100644
index 7379504..0000000
--- a/solr/webapp/web/css/styles/replication.css
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #replication
-{
-  background-image: url( ../../img/div.gif );
-  background-position: 21% 0;
-  background-repeat: repeat-y;
-}
-
-#content #replication #frame
-{
-  float: right;
-  width: 78%;
-}
-
-#content #replication #navigation
-{
-  border-right: 0;
-  float: left;
-  width: 20%;
-}
-
-#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 .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
-{
-  margin-left: 20px;
-  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;
-  white-space: nowrap;
-}
-
-#content #replication #details table tbody .size
-{
-  text-align: right;
-  white-space: nowrap;
-}
-
-#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 .timer
-{
-  box-shadow: 5px 5px 10px #c0c0c0;
-  -moz-box-shadow: 5px 5px 10px #c0c0c0;
-  -webkit-box-shadow: 5px 5px 10px #c0c0c0;
-  display: none;
-  margin-bottom: 20px;
-  padding: 10px;
-}
-
-#content #replication .timer p,
-#content #replication .timer small
-{
-  padding-left: 21px;
-}
-
-#content #replication .timer p
-{
-  background-image: url( ../../img/ico/clock-select-remain.png );
-  background-position: 0 50%;
-}
-
-#content #replication .timer p .approx
-{
-  color: #c0c0c0;
-  margin-right: 1px;
-}
-
-#content #replication .timer p .tick
-{
-  font-weight: bold;
-}
-
-#content #replication .timer small
-{
-  color: #c0c0c0;
-  display: none;
-}
-
-#content #replication #navigation button
-{
-  display: block;
-  margin-bottom: 10px;
-}
-
-#content #replication #navigation button.optional
-{
-  display: none;
-}
-
-#content #replication #navigation .replicate-now span
-{
-  background-image: url( ../../img/ico/document-convert.png );
-}
-
-#content #replication #navigation .abort-replication span
-{
-  background-image: url( ../../img/ico/hand.png );
-}
-
-#content #replication #navigation .disable-polling span
-{
-  background-image: url( ../../img/ico/cross.png );
-}
-
-#content #replication #navigation .enable-polling span
-{
-  background-image: url( ../../img/ico/tick.png );
-}
-
-#content #replication #navigation .disable-replication span
-{
-  background-image: url( ../../img/ico/cross.png );
-}
-
-#content #replication #navigation .enable-replication span
-{
-  background-image: url( ../../img/ico/tick.png );
-}
-
-#content #replication #navigation .refresh-status span
-{
-  background-image: url( ../../img/ico/arrow-circle.png );
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/schema-browser.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/schema-browser.css b/solr/webapp/web/css/styles/schema-browser.css
deleted file mode 100644
index e43de40..0000000
--- a/solr/webapp/web/css/styles/schema-browser.css
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
-
-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.
-
-*/
-
-#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 #f-df-t
-{
-  border-bottom: 1px solid #f0f0f0;
-  padding-bottom: 15px;
-}
-
-#content #schema-browser #related .ukf-dsf dt
-{
-  display: none;
-}
-
-#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,
-#content #schema-browser #related .active,
-#content #schema-browser #related .active a
-{
-  color: #333;
-}
-
-#content #schema-browser #related .copyfield,
-#content #schema-browser #related .copyfield a
-{
-  color: #666;
-}
-
-#content #schema-browser #data
-{
-  display: none;
-}
-
-#content #schema-browser #data #index dt
-{
-  display: none;
-  float: left;
-  margin-right: 5px;
-  width: 150px;
-}
-
-#content #schema-browser #data #field .field-options
-{
-  margin-bottom: 10px;
-}
-
-#content #schema-browser #data #field .field-options .head h2
-{
-  padding-left: 5px;
-}
-
-#content #schema-browser #data #field .partial
-{
-  display: none;
-}
-
-#content #schema-browser #data #field .partial p
-{
-  background-image: url( ../../img/ico/exclamation-button.png );
-  background-position: 0 50%;
-  padding-left: 21px;
-}
-
-#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 .flags
-{
-  margin-top: 10px;
-  margin-bottom: 20px;
-}
-
-#content #schema-browser #data #field .field-options .flags thead td
-{
-  color: #c0c0c0;
-  padding-right: 5px;
-  width: 100px;
-}
-
-#content #schema-browser #data #field .field-options .flags tbody td,
-#content #schema-browser #data #field .field-options .flags th
-{
-  padding: 2px 5px;
-}
-
-#content #schema-browser #data #field .field-options .flags thead td,
-#content #schema-browser #data #field .field-options .flags tbody th
-{
-  padding-left: 0;
-}
-
-#content #schema-browser #data #field .field-options .flags thead th,
-#content #schema-browser #data #field .field-options .flags tbody td
-{
-  border-left: 1px solid #f0f0f0;
-}
-
-#content #schema-browser #data #field .field-options .flags tbody th,
-#content #schema-browser #data #field .field-options .flags tbody td
-{
-  border-top: 1px solid #f0f0f0;
-}
-
-#content #schema-browser #data #field .field-options .flags tbody .check
-{
-  background-color: #fafdfa;
-  background-image: url( ../../img/ico/tick.png );
-  background-position: 50% 50%;
-  text-align: center;
-}
-
-#content #schema-browser #data #field .field-options .flags tbody .check span
-{
-  display: none;
-}
-
-#content #schema-browser #data #field .field-options .flags tbody .text
-{
-  color: #c0c0c0;
-}
-
-#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: 125px;
-  white-space: pre;
-}
-
-#content #schema-browser #data #field .field-options .analyzer p a
-{
-  cursor: auto;
-}
-
-#content #schema-browser #data #field .field-options .analyzer p a.analysis
-{
-  cursor: pointer;
-  display: block;
-}
-
-#content #schema-browser #data #field .field-options .analyzer p a.analysis span
-{
-  background-image: url( ../../img/ico/question-white.png );
-  background-position: 0 50%;
-  padding-left: 21px;
-}
-
-#content #schema-browser #data #field .field-options .analyzer p a.analysis:hover span
-{
-  background-image: url( ../../img/ico/question.png );
-  color: #008;
-}
-
-#content #schema-browser #data #field .field-options .analyzer a
-{
-  cursor: auto;
-}
-
-#content #schema-browser #data #field .field-options .analyzer .toggle
-{
-  background-image: url( ../../img/ico/chevron-small-expand.png );
-  background-position: 100% 50%;
-  cursor: pointer;
-  display: block;
-  padding-right: 21px;
-}
-
-#content #schema-browser #data #field .field-options .analyzer .open .toggle
-{
-  background-image: url( ../../img/ico/chevron-small.png );
-}
-
-#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: none;
-  margin-left: 55px;
-  padding-top: 5px;
-}
-
-#content #schema-browser #data #field .field-options .analyzer .open ul
-{
-  display: block;
-}
-
-#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 .terminfo-holder
-{
-  border-top: 1px solid #c0c0c0;
-  padding-top: 10px;
-}
-
-#content #schema-browser #data #field .terminfo-holder .trigger
-{
-  float: left;
-  width: 140px;
-}
-
-#content #schema-browser #data #field .terminfo-holder .trigger button span
-{
-  background-image: url( ../../img/ico/information.png );
-}
-
-#content #schema-browser #data #field .terminfo-holder .status
-{
-  border-left: 1px solid #f0f0f0;
-  display: none;
-  float: left;
-  padding-left: 20px;
-  padding-right: 20px;
-}
-
-#content #schema-browser #data #field .terminfo-holder.disabled .trigger button span
-{
-  background-image: url( ../../img/ico/prohibition.png );
-}
-
-#content #schema-browser #data #field .terminfo-holder.disabled .status
-{
-  display: block;
-}
-
-#content #schema-browser #data #field .terminfo-holder .trigger .autoload
-{
-  display: none;
-}
-
-#content #schema-browser #data #field .terminfo-holder.loaded .trigger .autoload
-{
-  background-image: url( ../../img/ico/ui-check-box-uncheck.png );
-  background-position: 0 50%;
-  color: #c0c0c0;
-  display: block;
-  margin-top: 10px;
-  padding-left: 21px;
-}
-
-#content #schema-browser #data #field .terminfo-holder .trigger .autoload:hover
-{
-  color: #008;
-}
-
-#content #schema-browser #data #field .terminfo-holder .trigger .autoload.on
-{
-  background-image: url( ../../img/ico/ui-check-box.png );
-  color: #333;
-}
-
-#content #schema-browser #data #field .topterms-holder,
-#content #schema-browser #data #field .histogram-holder
-{
-  border-left: 1px solid #f0f0f0;
-  display: none;
-  float: left;
-  padding-left: 20px;
-  padding-right: 20px;
-}
-
-#content #schema-browser #data #field .topterms-holder .head input
-{
-  height: 18px;
-  line-height: 16px;
-  text-align: right;
-  width: 30px;
-}
-
-#content #schema-browser #data #field .topterms-holder .head .max-holder
-{
-  color: #c0c0c0;
-}
-
-#content #schema-browser #data #field .topterms-holder .head .max-holder:hover .max
-{
-  color: #008;
-}
-
-#content #schema-browser #data #field .topterms-holder .head #query_link
-{
-  background-image: url( ../../img/ico/question-white.png );
-  background-position: 0 50%;
-  color: #c0c0c0;
-  padding-left: 21px;
-  margin-left: 5px;
-}
-
-#content #schema-browser #data #field .topterms-holder .head #query_link:hover
-{
-  background-image: url( ../../img/ico/question.png );
-}
-
-
-#content #schema-browser #data #field .topterms-holder .head #query_link span
-{
-  visibility: hidden;
-}
-
-#content #schema-browser #data #field .topterms-holder .head #query_link:hover span
-{
-  visibility: visible;
-}
-
-#content #schema-browser .topterms-holder li
-{
-  border-top: 1px solid  #999;
-  margin-bottom: 5px;
-}
-
-/* possible overwrite with inline style */
-#content #schema-browser .topterms-holder li p
-{
-  background-color:  #999;
-  color: #fff;
-  float: left;
-}
-
-#content #schema-browser .topterms-holder li p span
-{
-  display: block;
-  padding-right: 2px;
-  text-align: right;
-}
-
-/* possible overwrite with inline style */
-#content #schema-browser .topterms-holder li ul
-{
-  margin-left: 30px;
-}
-
-#content #schema-browser .topterms-holder li li
-{
-  border-top: 0;
-  margin-bottom: 0;
-  white-space: nowrap;
-}
-
-#content #schema-browser .topterms-holder li li.odd
-{
-  background-color: #f0f0f0;
-}
-
-#content #schema-browser .topterms-holder li li a
-{
-  display: block;
-  padding-left: 2px;
-  padding-right: 2px;
-}
-
-#content #schema-browser .topterms-holder li li a:hover
-{
-  background-color: #c0c0c0;
-}
-
-#content #schema-browser #data #field .histogram-holder ul
-{
-  margin-left: 25px;
-}
-
-#content #schema-browser #data #field .histogram-holder li
-{
-  margin-bottom: 2px;
-  position: relative;
-  width: 150px;
-}
-
-#content #schema-browser #data #field .histogram-holder li.odd
-{
-  background-color: #f0f0f0;
-}
-
-#content #schema-browser #data #field .histogram-holder li dl,
-#content #schema-browser #data #field .histogram-holder li dt
-{
-  padding-top: 1px;
-  padding-bottom: 1px;
-}
-
-#content #schema-browser #data #field .histogram-holder li dl
-{
-  background-color: #c0c0c0;
-  min-width: 1px;
-}
-
-#content #schema-browser #data #field .histogram-holder li dt
-{
-  color: #a0a0a0;
-  position: absolute;
-  overflow: hidden;
-  left: -25px;
-  top: 0px;
-}
-
-#content #schema-browser #data #field .histogram-holder li dt span
-{
-  display: block;
-  padding-right: 4px;
-  text-align: right;
-}
-
-#content #schema-browser #data #field .histogram-holder li dd
-{
-  clear: left;
-  float: left;
-  margin-left: 2px;
-  white-space: nowrap;
-}
-
-#content #schema-browser #data #field .histogram-holder li:hover dl
-{
-  background-color: #b0b0b0;
-}
-
-#content #schema-browser #data #field .histogram-holder li:hover dt
-{
-  color: #333;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/segments.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/segments.css b/solr/webapp/web/css/styles/segments.css
deleted file mode 100644
index 820f882..0000000
--- a/solr/webapp/web/css/styles/segments.css
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #segments .loader
-{
-  background-position: 0 50%;
-  padding-left: 21px;
-}
-
-#content #segments .reload
-{
-  background-image: url( ../../img/ico/arrow-circle.png );
-  background-position: 50% 50%;
-  display: block;
-  height: 30px;
-  position: absolute;
-  right: 10px;
-  top: 10px;
-  width: 30px; 
-}
-
-#content #segments .reload.loader
-{
-  padding-left: 0;
-}
-
-#content #segments .reload span
-{
-  display: none;
-}
-
-#content #segments #result
-{   
-  width: 77%;
-}
-
-#content #segments #result #response
-{
-  margin-left: 25px;
-}
-
-#content #segments .segments-holder ul {
-    margin-left: 25px;
-}
-#content #segments .segments-holder li {
-    margin-bottom: 2px;
-    position: relative;
-    width: 100%;
-}
-
-#content #segments .segments-holder li .toolitp {
-  display: none;
-    background: #C8C8C8;
-    position: absolute;
-    z-index: 1000;
-    width:220px;
-    height:120px;
-    margin-left: 100%;
-    opacity: .8;
-    padding: 5px;
-    border: 1px solid;
-    border-radius: 5px;
-}
-
-#content #segments .segments-holder li .toolitp .label {
-  float: left;
-  width: 20%;  
-  opacity: 1;
-}
-
-#content #segments .segments-holder li:hover .toolitp {
-  display:block;  
-}
-
-#content #segments .segments-holder li dl, 
-#content #segments .segments-holder li dt {
-    padding-bottom: 1px;
-    padding-top: 1px;
-}
-#content #segments .segments-holder li dl {
-    min-width: 1px;
-}
-#content #segments .segments-holder li dt {
-    color: #a0a0a0;
-    left: -45px;
-    overflow: hidden;
-    position: absolute;
-    top: 0;
-}
-#content #segments .segments-holder li dt div {
-    display: block;
-    padding-right: 4px;
-    text-align: right;
-}
-#content #segments .segments-holder li dd {
-    clear: left;
-    float: left;
-    margin-left: 2px;
-    white-space: nowrap;
-    width: 100%;
-}
-
-#content #segments .segments-holder li dd div.deleted {
-    background-color: #808080;    
-    padding-left: 5px;    
-}
-
-#content #segments .segments-holder li dd div.live {
-  background-color: #DDDDDD;
-  float: left;  
-}
-
-#content #segments .segments-holder li dd div.start {
-  float: left;
-  width: 20%;
-}
-
-#content #segments .segments-holder li dd div.end {
-  text-align: right;
-}
-
-.merge-candidate {
-  background-color: #FFC9F9 !important;
-}
-
-#content #segments .segments-holder li dd div.w5 {
-  width: 20%;
-  float: left;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/threads.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/threads.css b/solr/webapp/web/css/styles/threads.css
deleted file mode 100644
index c3cb698..0000000
--- a/solr/webapp/web/css/styles/threads.css
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
-
-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.
-
-*/
-
-#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;
-}
-
-#content #threads #thread-dump table th,
-#content #threads #thread-dump table td
-{
-  padding: 5px 3px;
-  vertical-align: top;
-}
-
-#content #threads #thread-dump thead th
-{
-  background-color: #c8c8c8;
-  font-weight: bold;
-  text-align: left;
-}
-
-#content #threads #thread-dump thead th.name
-{
-  width: 85%;
-}
-
-#content #threads #thread-dump thead th.time
-{
-  text-align: right;
-  width: 15%;
-}
-
-#content #threads #thread-dump tbody .odd
-{
-  background-color: #f0f0f0;
-}
-
-#content #threads #thread-dump tbody .RUNNABLE a
-{
-  background-image: url( ../../img/ico/tick-circle.png );
-}
-
-#content #threads #thread-dump tbody .WAITING a,
-#content #threads #thread-dump tbody .TIMED_WAITING a
-{
-  background-image: url( ../../img/ico/hourglass.png );
-}
-
-#content #threads #thread-dump tbody .WAITING.lock a,
-#content #threads #thread-dump tbody .TIMED_WAITING.lock a
-{
-  background-image: url( ../../img/ico/hourglass--exclamation.png );
-}
-
-#content #threads #thread-dump tbody .name a
-{
-  background-position: 0 50%;
-  cursor: auto;
-  display: block;
-  padding-left: 21px;
-}
-
-#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;
-  margin-left: 21px;
-  padding-left: 21px;
-}
-
-#content #threads #thread-dump tbody .name div
-{
-  border-top: 1px solid #c0c0c0;
-  display: none;
-  margin-left: 21px;
-  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;
-}
-
-#content #threads .controls
-{
-  padding-top: 5px;
-  padding-bottom: 5px;
-}
-
-#content #threads .controls a
-{
-  background-image: url( ../../img/ico/chevron-small-expand.png );
-  padding-left: 21px;
-}
-
-#content #threads.expanded .controls a
-{
-  background-image: url( ../../img/ico/chevron-small.png );
-}
-
-#content #threads.expanded .controls .expand,
-#content #threads.collapsed .controls .collapse
-{
-  display: none;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/index.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/index.html b/solr/webapp/web/index.html
index 2e01906..923d1f1 100644
--- a/solr/webapp/web/index.html
+++ b/solr/webapp/web/index.html
@@ -32,7 +32,7 @@ limitations under the License.
   <link rel="stylesheet" type="text/css" href="css/angular/dataimport.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/angular/files.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/angular/index.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/java-properties.css?_=${version}">
+  <link rel="stylesheet" type="text/css" href="css/angular/java-properties.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/angular/logging.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/angular/menu.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/angular/plugins.css?_=${version}">
@@ -123,10 +123,6 @@ limitations under the License.
         <div class="exception">{{exception.msg}}</div>
       </div>
 
-      <div class="other-ui-link">
-        Use <a class="ul" href="/solr/old.html">original UI</a><a target="_blank" href="http://wiki.apache.org/solr/AngularUI">&nbsp;<span class="help"></span></a>
-      </div>
-
       <div id="content-wrapper">
         <div ng-view id="content">
 
@@ -151,7 +147,7 @@ limitations under the License.
                 <li class="tree" ng-class="{active:page=='cloud-tree'}"><a href="#/~cloud?view=tree">Tree</a></li>
                 <li class="graph" ng-class="{active:page=='cloud-graph'}"><a href="#/~cloud">Graph</a></li>
                 <li class="rgraph" ng-class="{active:page=='cloud-rgraph'}"><a href="#/~cloud?view=rgraph">Graph (Radial)</a></li>
-                <li class="dump" ng-class="{active:page=='cloud-dump'}"><a ng-click="dumpCloud()">Dump</a></li>
+                <!--<li class="dump" ng-class="{active:page=='cloud-dump'}"><a ng-click="dumpCloud()">Dump</a></li>-->
               </ul>
             </li>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/angular/app.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/app.js b/solr/webapp/web/js/angular/app.js
index e86b55f..c4ebef5 100644
--- a/solr/webapp/web/js/angular/app.js
+++ b/solr/webapp/web/js/angular/app.js
@@ -465,88 +465,6 @@ solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $
 });
 
 
-(function(window, angular, undefined) {
-  'use strict';
-
-  angular.module('ngClipboard', []).
-    provider('ngClip', function() {
-      var self = this;
-      this.path = '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.1.6/ZeroClipboard.swf';
-      return {
-        setPath: function(newPath) {
-         self.path = newPath;
-        },
-        setConfig: function(config) {
-          self.config = config;
-        },
-        $get: function() {
-          return {
-            path: self.path,
-            config: self.config
-          };
-        }
-      };
-    }).
-    run(['ngClip', function(ngClip) {
-      var config = {
-        swfPath: ngClip.path,
-        trustedDomains: ["*"],
-        allowScriptAccess: "always",
-        forceHandCursor: true,
-      };
-      ZeroClipboard.config(angular.extend(config,ngClip.config || {}));
-    }]).
-    directive('clipCopy', ['ngClip', function (ngClip) {
-      return {
-        scope: {
-          clipCopy: '&',
-          clipClick: '&',
-          clipClickFallback: '&'
-        },
-        restrict: 'A',
-        link: function (scope, element, attrs) {
-          // Bind a fallback function if flash is unavailable
-          if (ZeroClipboard.isFlashUnusable()) {
-            element.bind('click', function($event) {
-              // Execute the expression with local variables `$event` and `copy`
-              scope.$apply(scope.clipClickFallback({
-                $event: $event,
-                copy: scope.$eval(scope.clipCopy)
-              }));
-            });
-
-            return;
-          }
-
-          // Create the client object
-          var client = new ZeroClipboard(element);
-          if (attrs.clipCopy === "") {
-            scope.clipCopy = function(scope) {
-              return element[0].previousElementSibling.innerText;
-            };
-          }
-          client.on( 'ready', function(readyEvent) {
-
-            client.on('copy', function (event) {
-              var clipboard = event.clipboardData;
-              clipboard.setData(attrs.clipCopyMimeType || 'text/plain', scope.$eval(scope.clipCopy));
-            });
-
-            client.on( 'aftercopy', function(event) {
-              if (angular.isDefined(attrs.clipClick)) {
-                scope.$apply(scope.clipClick);
-              }
-            });
-
-            scope.$on('$destroy', function() {
-              client.destroy();
-            });
-          });
-        }
-      };
-    }]);
-})(window, window.angular);
-
 
 /* THE BELOW CODE IS TAKEN FROM js/scripts/app.js, AND STILL REQUIRES INTEGRATING
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/angular/controllers/cloud.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/controllers/cloud.js b/solr/webapp/web/js/angular/controllers/cloud.js
index aeaf5d3..3636d80 100644
--- a/solr/webapp/web/js/angular/controllers/cloud.js
+++ b/solr/webapp/web/js/angular/controllers/cloud.js
@@ -458,101 +458,3 @@ solrAdminApp.directive('graph', function(Constants) {
         }
     };
 })
-
-/*
-
-========================
-var init_debug = function( cloud_element )
-{
-  var debug_element = $( '#debug', cloud_element );
-  var debug_button = $( '#menu #cloud .dump a' );
-
-  var clipboard_element = $( '.clipboard', debug_element );
-  var clipboard_button = $( 'a', clipboard_element );
-
-  $( '.clipboard', debug_element )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function( event )
-      {
-        return false;
-      }
-    );
-
-            url : app.config.solr_path + '/zookeeper?wt=json&dump=true',
-              ZeroClipboard.setMoviePath( 'img/ZeroClipboard.swf' );
-
-              clipboard_client = new ZeroClipboard.Client();
-
-              clipboard_client.addEventListener
-              (
-                'load',
-                function( client )
-                {
-                }
-              );
-
-              clipboard_client.addEventListener
-              (
-                'complete',
-                function( client, text )
-                {
-                  clipboard_element
-                    .addClass( 'copied' );
-
-                  clipboard_button
-                    .data( 'text', clipboard_button.text() )
-                    .text( clipboard_button.data( 'copied' ) );
-                }
-              );
-            },
-            success : function( response, text_status, xhr )
-            {
-              clipboard_client.glue
-              (
-                clipboard_element.get(0),
-                clipboard_button.get(0)
-              );
-
-              clipboard_client.setText( response.replace( /\\/g, '\\\\' ) );
-
-              $( '.debug', debug_element )
-                .removeClass( 'loader' )
-                .text( response );
-            },
-            error : function( xhr, text_status, error_thrown )
-            {
-            },
-            complete : function( xhr, text_status )
-            {
-            }
-          }
-        );
-      }
-    )
-    .die( 'hide' )
-    .live
-    (
-      'hide',
-      function( event )
-      {
-        $( '.debug', debug_element )
-          .empty();
-
-        clipboard_element
-          .removeClass( 'copied' );
-
-        clipboard_button
-          .data( 'copied', clipboard_button.text() )
-          .text( clipboard_button.data( 'text' ) );
-
-        clipboard_client.destroy();
-
-        debug_element.hide();
-      }
-    );
-};
-
-*/

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/ZeroClipboard.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/ZeroClipboard.js b/solr/webapp/web/js/lib/ZeroClipboard.js
deleted file mode 100644
index a521be8..0000000
--- a/solr/webapp/web/js/lib/ZeroClipboard.js
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
-
-The MIT License (MIT)
-Copyright (c) 2012 Jon Rohan, James M. Greene, 
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-// Simple Set Clipboard System
-// Author: Joseph Huckaby
-
-var ZeroClipboard = {
-  
-  version: "1.0.7",
-  clients: {}, // registered upload clients on page, indexed by id
-  moviePath: 'ZeroClipboard.swf', // URL to movie
-  nextId: 1, // ID of next movie
-  
-  $: function(thingy) {
-    // simple DOM lookup utility function
-    if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
-    if (!thingy.addClass) {
-      // extend element with a few useful methods
-      thingy.hide = function() { this.style.display = 'none'; };
-      thingy.show = function() { this.style.display = ''; };
-      thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
-      thingy.removeClass = function(name) {
-        var classes = this.className.split(/\s+/);
-        var idx = -1;
-        for (var k = 0; k < classes.length; k++) {
-          if (classes[k] == name) { idx = k; k = classes.length; }
-        }
-        if (idx > -1) {
-          classes.splice( idx, 1 );
-          this.className = classes.join(' ');
-        }
-        return this;
-      };
-      thingy.hasClass = function(name) {
-        return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
-      };
-    }
-    return thingy;
-  },
-  
-  setMoviePath: function(path) {
-    // set path to ZeroClipboard.swf
-    this.moviePath = path;
-  },
-  
-  dispatch: function(id, eventName, args) {
-    // receive event from flash movie, send to client    
-    var client = this.clients[id];
-    if (client) {
-      client.receiveEvent(eventName, args);
-    }
-  },
-  
-  register: function(id, client) {
-    // register new client to receive events
-    this.clients[id] = client;
-  },
-  
-  getDOMObjectPosition: function(obj, stopObj) {
-    // get absolute coordinates for dom element
-    var info = {
-      left: 0, 
-      top: 0, 
-      width: obj.width ? obj.width : obj.offsetWidth, 
-      height: obj.height ? obj.height : obj.offsetHeight
-    };
-
-    while (obj && (obj != stopObj)) {
-      info.left += obj.offsetLeft;
-      info.top += obj.offsetTop;
-      obj = obj.offsetParent;
-    }
-
-    return info;
-  },
-  
-  Client: function(elem) {
-    // constructor for new simple upload client
-    this.handlers = {};
-    
-    // unique ID
-    this.id = ZeroClipboard.nextId++;
-    this.movieId = 'ZeroClipboardMovie_' + this.id;
-    
-    // register client with singleton to receive flash events
-    ZeroClipboard.register(this.id, this);
-    
-    // create movie
-    if (elem) this.glue(elem);
-  }
-};
-
-ZeroClipboard.Client.prototype = {
-  
-  id: 0, // unique ID for us
-  ready: false, // whether movie is ready to receive events or not
-  movie: null, // reference to movie object
-  clipText: '', // text to copy to clipboard
-  handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
-  cssEffects: true, // enable CSS mouse effects on dom container
-  handlers: null, // user event handlers
-  
-  glue: function(elem, appendElem, stylesToAdd) {
-    // glue to DOM element
-    // elem can be ID or actual DOM element object
-    this.domElement = ZeroClipboard.$(elem);
-    
-    // float just above object, or zIndex 99 if dom element isn't set
-    var zIndex = 99;
-    if (this.domElement.style.zIndex) {
-      zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
-    }
-    
-    if (typeof(appendElem) == 'string') {
-      appendElem = ZeroClipboard.$(appendElem);
-    }
-    else if (typeof(appendElem) == 'undefined') {
-      appendElem = document.getElementsByTagName('body')[0];
-    }
-    
-    // find X/Y position of domElement
-    var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
-    
-    // create floating DIV above element
-    this.div = document.createElement('div');
-    var style = this.div.style;
-    style.position = 'absolute';
-    style.left = '' + box.left + 'px';
-    style.top = '' + box.top + 'px';
-    style.width = '' + box.width + 'px';
-    style.height = '' + box.height + 'px';
-    style.zIndex = zIndex;
-
-    style.left = '0px';
-    style.top = '0px';
-    
-    if (typeof(stylesToAdd) == 'object') {
-      for (addedStyle in stylesToAdd) {
-        style[addedStyle] = stylesToAdd[addedStyle];
-      }
-    }
-    
-    // style.backgroundColor = '#f00'; // debug
-    
-    appendElem.appendChild(this.div);
-    
-    this.div.innerHTML = this.getHTML( box.width, box.height );
-  },
-  
-  getHTML: function(width, height) {
-    // return HTML for movie
-    var html = '';
-    var flashvars = 'id=' + this.id + 
-      '&width=' + width + 
-      '&height=' + height;
-      
-    if (navigator.userAgent.match(/MSIE/)) {
-      // IE gets an OBJECT tag
-      var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
-      html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
-    }
-    else {
-      // all other browsers get an EMBED tag
-      html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
-    }
-    return html;
-  },
-  
-  hide: function() {
-    // temporarily hide floater offscreen
-    if (this.div) {
-      this.div.style.left = '-2000px';
-    }
-  },
-  
-  show: function() {
-    // show ourselves after a call to hide()
-    this.reposition();
-  },
-  
-  destroy: function() {
-    // destroy control and floater
-    if (this.domElement && this.div) {
-      this.hide();
-      this.div.innerHTML = '';
-      
-      var body = document.getElementsByTagName('body')[0];
-      try { body.removeChild( this.div ); } catch(e) {;}
-      
-      this.domElement = null;
-      this.div = null;
-    }
-  },
-  
-  reposition: function(elem) {
-    // reposition our floating div, optionally to new container
-    // warning: container CANNOT change size, only position
-    if (elem) {
-      this.domElement = ZeroClipboard.$(elem);
-      if (!this.domElement) this.hide();
-    }
-
-    console.debug( this.domElement, this.div );
-    
-    if (this.domElement && this.div) {
-      var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
-      console.debug( box );
-      var style = this.div.style;
-      style.left = '' + box.left + 'px';
-      style.top = '' + box.top + 'px';
-    }
-  },
-  
-  setText: function(newText) {
-    // set text to be copied to clipboard
-    this.clipText = newText;
-    if (this.ready) this.movie.setText(newText);
-  },
-  
-  addEventListener: function(eventName, func) {
-    // add user event listener for event
-    // event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
-    eventName = eventName.toString().toLowerCase().replace(/^on/, '');
-    if (!this.handlers[eventName]) this.handlers[eventName] = [];
-    this.handlers[eventName].push(func);
-  },
-  
-  setHandCursor: function(enabled) {
-    // enable hand cursor (true), or default arrow cursor (false)
-    this.handCursorEnabled = enabled;
-    if (this.ready) this.movie.setHandCursor(enabled);
-  },
-  
-  setCSSEffects: function(enabled) {
-    // enable or disable CSS effects on DOM container
-    this.cssEffects = !!enabled;
-  },
-  
-  receiveEvent: function(eventName, args) {
-    // receive event from flash
-    eventName = eventName.toString().toLowerCase().replace(/^on/, '');
-        
-    // special behavior for certain events
-    switch (eventName) {
-      case 'load':
-        // movie claims it is ready, but in IE this isn't always the case...
-        // bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
-        this.movie = document.getElementById(this.movieId);
-        if (!this.movie) {
-          var self = this;
-          setTimeout( function() { self.receiveEvent('load', null); }, 1 );
-          return;
-        }
-        
-        // firefox on pc needs a "kick" in order to set these in certain cases
-        if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
-          var self = this;
-          setTimeout( function() { self.receiveEvent('load', null); }, 100 );
-          this.ready = true;
-          return;
-        }
-        
-        this.ready = true;
-        this.movie.setText( this.clipText );
-        this.movie.setHandCursor( this.handCursorEnabled );
-        break;
-      
-      case 'mouseover':
-        if (this.domElement && this.cssEffects) {
-          this.domElement.addClass('hover');
-          if (this.recoverActive) this.domElement.addClass('active');
-        }
-        break;
-      
-      case 'mouseout':
-        if (this.domElement && this.cssEffects) {
-          this.recoverActive = false;
-          if (this.domElement.hasClass('active')) {
-            this.domElement.removeClass('active');
-            this.recoverActive = true;
-          }
-          this.domElement.removeClass('hover');
-        }
-        break;
-      
-      case 'mousedown':
-        if (this.domElement && this.cssEffects) {
-          this.domElement.addClass('active');
-        }
-        break;
-      
-      case 'mouseup':
-        if (this.domElement && this.cssEffects) {
-          this.domElement.removeClass('active');
-          this.recoverActive = false;
-        }
-        break;
-    } // switch eventName
-    
-    if (this.handlers[eventName]) {
-      for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
-        var func = this.handlers[eventName][idx];
-      
-        if (typeof(func) == 'function') {
-          // actual function reference
-          func(this, args);
-        }
-        else if ((typeof(func) == 'object') && (func.length == 2)) {
-          // PHP style object + method, i.e. [myObject, 'myMethod']
-          func[0][ func[1] ](this, args);
-        }
-        else if (typeof(func) == 'string') {
-          // name of function
-          window[func](this, args);
-        }
-      } // foreach event handler defined
-    } // user defined handler for event
-  }
-  
-};


[47/50] [abbrv] lucene-solr:jira/solr-10233: Ref Guide: remove leftover TODO note

Posted by tf...@apache.org.
Ref Guide: remove leftover TODO note


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/33e1c71b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/33e1c71b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/33e1c71b

Branch: refs/heads/jira/solr-10233
Commit: 33e1c71bff60f05dc3bdfd65949da8aa65e5c3de
Parents: 5f77aa0
Author: Cassandra Targett <ca...@lucidworks.com>
Authored: Thu May 18 14:01:26 2017 -0500
Committer: Cassandra Targett <ca...@lucidworks.com>
Committed: Thu May 18 14:02:45 2017 -0500

----------------------------------------------------------------------
 solr/solr-ref-guide/src/command-line-utilities.adoc | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/33e1c71b/solr/solr-ref-guide/src/command-line-utilities.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/command-line-utilities.adoc b/solr/solr-ref-guide/src/command-line-utilities.adoc
index 511aaa0..94d3a49 100644
--- a/solr/solr-ref-guide/src/command-line-utilities.adoc
+++ b/solr/solr-ref-guide/src/command-line-utilities.adoc
@@ -27,8 +27,6 @@ Use the `help` option to get a list of available commands from the script itself
 
 Both `zkcli.sh` (for Unix environments) and `zkcli.bat` (for Windows environments) support the following command line options:
 
-// TODO: Change column width to %autowidth.spread when https://github.com/asciidoctor/asciidoctor-pdf/issues/599 is fixed
-
 `-cmd <arg>`::
 The CLI Command to be executed. This parameter is *mandatory*. The following commands are supported:
 


[30/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/chosen.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/chosen.js b/solr/webapp/web/js/lib/chosen.js
deleted file mode 100644
index bf250a2..0000000
--- a/solr/webapp/web/js/lib/chosen.js
+++ /dev/null
@@ -1,982 +0,0 @@
-/*
-
-Chosen
-
-- by Patrick Filler for Harvest http://getharvest.com
-- Copyright (c) 2011-2013 by Harvest
-
-Available for use under the MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-// Chosen, a Select Box Enhancer for jQuery and Protoype
-// by Patrick Filler for Harvest, http://getharvest.com
-// 
-// Version 0.9.8
-// Full source at https://github.com/harvesthq/chosen
-// Copyright (c) 2011 Harvest http://getharvest.com
-
-// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
-// This file is generated by `cake build`, do not edit it by hand.
-(function() {
-  var SelectParser;
-
-  SelectParser = (function() {
-
-    function SelectParser() {
-      this.options_index = 0;
-      this.parsed = [];
-    }
-
-    SelectParser.prototype.add_node = function(child) {
-      if (child.nodeName === "OPTGROUP") {
-        return this.add_group(child);
-      } else {
-        return this.add_option(child);
-      }
-    };
-
-    SelectParser.prototype.add_group = function(group) {
-      var group_position, option, _i, _len, _ref, _results;
-      group_position = this.parsed.length;
-      this.parsed.push({
-        array_index: group_position,
-        group: true,
-        label: group.label,
-        children: 0,
-        disabled: group.disabled
-      });
-      _ref = group.childNodes;
-      _results = [];
-      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
-        option = _ref[_i];
-        _results.push(this.add_option(option, group_position, group.disabled));
-      }
-      return _results;
-    };
-
-    SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
-      if (option.nodeName === "OPTION") {
-        if (option.text !== "") {
-          if (group_position != null) this.parsed[group_position].children += 1;
-          this.parsed.push({
-            array_index: this.parsed.length,
-            options_index: this.options_index,
-            value: option.value,
-            text: option.text,
-            html: option.innerHTML,
-            selected: option.selected,
-            disabled: group_disabled === true ? group_disabled : option.disabled,
-            group_array_index: group_position,
-            classes: option.className,
-            style: option.style.cssText
-          });
-        } else {
-          this.parsed.push({
-            array_index: this.parsed.length,
-            options_index: this.options_index,
-            empty: true
-          });
-        }
-        return this.options_index += 1;
-      }
-    };
-
-    return SelectParser;
-
-  })();
-
-  SelectParser.select_to_array = function(select) {
-    var child, parser, _i, _len, _ref;
-    parser = new SelectParser();
-    _ref = select.childNodes;
-    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
-      child = _ref[_i];
-      parser.add_node(child);
-    }
-    return parser.parsed;
-  };
-
-  this.SelectParser = SelectParser;
-
-}).call(this);
-
-/*
-Chosen source: generate output using 'cake build'
-Copyright (c) 2011 by Harvest
-*/
-
-(function() {
-  var AbstractChosen, root;
-
-  root = this;
-
-  AbstractChosen = (function() {
-
-    function AbstractChosen(form_field, options) {
-      this.form_field = form_field;
-      this.options = options != null ? options : {};
-      this.set_default_values();
-      this.is_multiple = this.form_field.multiple;
-      this.default_text_default = this.is_multiple ? "Select Some Options" : "Select an Option";
-      this.setup();
-      this.set_up_html();
-      this.register_observers();
-      this.finish_setup();
-    }
-
-    AbstractChosen.prototype.set_default_values = function() {
-      var _this = this;
-      this.click_test_action = function(evt) {
-        return _this.test_active_click(evt);
-      };
-      this.activate_action = function(evt) {
-        return _this.activate_field(evt);
-      };
-      this.active_field = false;
-      this.mouse_on_container = false;
-      this.results_showing = false;
-      this.result_highlighted = null;
-      this.result_single_selected = null;
-      this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
-      this.disable_search_threshold = this.options.disable_search_threshold || 0;
-      this.search_contains = this.options.search_contains || false;
-      this.choices = 0;
-      return this.results_none_found = this.options.no_results_text || "No results match";
-    };
-
-    AbstractChosen.prototype.mouse_enter = function() {
-      return this.mouse_on_container = true;
-    };
-
-    AbstractChosen.prototype.mouse_leave = function() {
-      return this.mouse_on_container = false;
-    };
-
-    AbstractChosen.prototype.input_focus = function(evt) {
-      var _this = this;
-      if (!this.active_field) {
-        return setTimeout((function() {
-          return _this.container_mousedown();
-        }), 50);
-      }
-    };
-
-    AbstractChosen.prototype.input_blur = function(evt) {
-      var _this = this;
-      if (!this.mouse_on_container) {
-        this.active_field = false;
-        return setTimeout((function() {
-          return _this.blur_test();
-        }), 100);
-      }
-    };
-
-    AbstractChosen.prototype.result_add_option = function(option) {
-      var classes, style;
-      if (!option.disabled) {
-        option.dom_id = this.container_id + "_o_" + option.array_index;
-        classes = option.selected && this.is_multiple ? [] : ["active-result"];
-        if (option.selected) classes.push("result-selected");
-        if (option.group_array_index != null) classes.push("group-option");
-        if (option.classes !== "") classes.push(option.classes);
-        style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
-        return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
-      } else {
-        return "";
-      }
-    };
-
-    AbstractChosen.prototype.results_update_field = function() {
-      this.result_clear_highlight();
-      this.result_single_selected = null;
-      return this.results_build();
-    };
-
-    AbstractChosen.prototype.results_toggle = function() {
-      if (this.results_showing) {
-        return this.results_hide();
-      } else {
-        return this.results_show();
-      }
-    };
-
-    AbstractChosen.prototype.results_search = function(evt) {
-      if (this.results_showing) {
-        return this.winnow_results();
-      } else {
-        return this.results_show();
-      }
-    };
-
-    AbstractChosen.prototype.keyup_checker = function(evt) {
-      var stroke, _ref;
-      stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
-      this.search_field_scale();
-      switch (stroke) {
-        case 8:
-          if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
-            return this.keydown_backstroke();
-          } else if (!this.pending_backstroke) {
-            this.result_clear_highlight();
-            return this.results_search();
-          }
-          break;
-        case 13:
-          evt.preventDefault();
-          if (this.results_showing) return this.result_select(evt);
-          break;
-        case 27:
-          if (this.results_showing) this.results_hide();
-          return true;
-        case 9:
-        case 38:
-        case 40:
-        case 16:
-        case 91:
-        case 17:
-          break;
-        default:
-          return this.results_search();
-      }
-    };
-
-    AbstractChosen.prototype.generate_field_id = function() {
-      var new_id;
-      new_id = this.generate_random_id();
-      this.form_field.id = new_id;
-      return new_id;
-    };
-
-    AbstractChosen.prototype.generate_random_char = function() {
-      var chars, newchar, rand;
-      chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ";
-      rand = Math.floor(Math.random() * chars.length);
-      return newchar = chars.substring(rand, rand + 1);
-    };
-
-    return AbstractChosen;
-
-  })();
-
-  root.AbstractChosen = AbstractChosen;
-
-}).call(this);
-
-/*
-Chosen source: generate output using 'cake build'
-Copyright (c) 2011 by Harvest
-*/
-
-(function() {
-  var $, Chosen, get_side_border_padding, root,
-    __hasProp = Object.prototype.hasOwnProperty,
-    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
-
-  root = this;
-
-  $ = jQuery;
-
-  $.fn.extend({
-    chosen: function(options) {
-      if ($.browser.msie && ($.browser.version === "6.0" || $.browser.version === "7.0")) {
-        return this;
-      }
-      return $(this).each(function(input_field) {
-        if (!($(this)).hasClass("chzn-done")) return new Chosen(this, options);
-      });
-    }
-  });
-
-  Chosen = (function(_super) {
-
-    __extends(Chosen, _super);
-
-    function Chosen() {
-      Chosen.__super__.constructor.apply(this, arguments);
-    }
-
-    Chosen.prototype.setup = function() {
-      this.form_field_jq = $(this.form_field);
-      return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
-    };
-
-    Chosen.prototype.finish_setup = function() {
-      return this.form_field_jq.addClass("chzn-done");
-    };
-
-    Chosen.prototype.set_up_html = function() {
-      var container_div, dd_top, dd_width, sf_width;
-      this.container_id = this.form_field.id.length ? this.form_field.id.replace(/(:|\.)/g, '_') : this.generate_field_id();
-      this.container_id += "_chzn";
-      this.f_width = this.form_field_jq.outerWidth();
-      this.default_text = this.form_field_jq.data('placeholder') ? this.form_field_jq.data('placeholder') : this.default_text_default;
-      container_div = $("<div />", {
-        id: this.container_id,
-        "class": "chzn-container" + (this.is_rtl ? ' chzn-rtl' : ''),
-        style: 'width: ' + this.f_width + 'px;'
-      });
-      if (this.is_multiple) {
-        container_div.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
-      } else {
-        container_div.html('<a href="javascript:void(0)" class="chzn-single chzn-default"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="search" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
-      }
-      this.form_field_jq.hide().after(container_div);
-      this.container = $('#' + this.container_id);
-      this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
-      this.dropdown = this.container.find('div.chzn-drop').first();
-      dd_top = this.container.height();
-      dd_width = this.f_width - get_side_border_padding(this.dropdown);
-      this.dropdown.css({
-        "width": dd_width + "px",
-        "top": dd_top + "px"
-      });
-      this.search_field = this.container.find('input').first();
-      this.search_results = this.container.find('ul.chzn-results').first();
-      this.search_field_scale();
-      this.search_no_results = this.container.find('li.no-results').first();
-      if (this.is_multiple) {
-        this.search_choices = this.container.find('ul.chzn-choices').first();
-        this.search_container = this.container.find('li.search-field').first();
-      } else {
-        this.search_container = this.container.find('div.chzn-search').first();
-        this.selected_item = this.container.find('.chzn-single').first();
-        sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
-        sf_width = dd_width - get_side_border_padding(this.search_container);
-        this.search_field.css({
-          "width": sf_width + "px"
-        });
-      }
-      this.results_build();
-      this.set_tab_index();
-      return this.form_field_jq.trigger("liszt:ready", {
-        chosen: this
-      });
-    };
-
-    Chosen.prototype.register_observers = function() {
-      var _this = this;
-      this.container.mousedown(function(evt) {
-        return _this.container_mousedown(evt);
-      });
-      this.container.mouseup(function(evt) {
-        return _this.container_mouseup(evt);
-      });
-      this.container.mouseenter(function(evt) {
-        return _this.mouse_enter(evt);
-      });
-      this.container.mouseleave(function(evt) {
-        return _this.mouse_leave(evt);
-      });
-      this.search_results.mouseup(function(evt) {
-        return _this.search_results_mouseup(evt);
-      });
-      this.search_results.mouseover(function(evt) {
-        return _this.search_results_mouseover(evt);
-      });
-      this.search_results.mouseout(function(evt) {
-        return _this.search_results_mouseout(evt);
-      });
-      this.form_field_jq.bind("liszt:updated", function(evt) {
-        return _this.results_update_field(evt);
-      });
-      this.search_field.blur(function(evt) {
-        return _this.input_blur(evt);
-      });
-      this.search_field.keyup(function(evt) {
-        return _this.keyup_checker(evt);
-      });
-      this.search_field.keydown(function(evt) {
-        return _this.keydown_checker(evt);
-      });
-      if (this.is_multiple) {
-        this.search_choices.click(function(evt) {
-          return _this.choices_click(evt);
-        });
-        return this.search_field.focus(function(evt) {
-          return _this.input_focus(evt);
-        });
-      } else {
-        return this.container.click(function(evt) {
-          return evt.preventDefault();
-        });
-      }
-    };
-
-    Chosen.prototype.search_field_disabled = function() {
-      this.is_disabled = this.form_field_jq[0].disabled;
-      if (this.is_disabled) {
-        this.container.addClass('chzn-disabled');
-        this.search_field[0].disabled = true;
-        if (!this.is_multiple) {
-          this.selected_item.unbind("focus", this.activate_action);
-        }
-        return this.close_field();
-      } else {
-        this.container.removeClass('chzn-disabled');
-        this.search_field[0].disabled = false;
-        if (!this.is_multiple) {
-          return this.selected_item.bind("focus", this.activate_action);
-        }
-      }
-    };
-
-    Chosen.prototype.container_mousedown = function(evt) {
-      var target_closelink;
-      if (!this.is_disabled) {
-        target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
-        if (evt && evt.type === "mousedown" && !this.results_showing) {
-          evt.stopPropagation();
-        }
-        if (!this.pending_destroy_click && !target_closelink) {
-          if (!this.active_field) {
-            if (this.is_multiple) this.search_field.val("");
-            $(document).click(this.click_test_action);
-            this.results_show();
-          } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
-            evt.preventDefault();
-            this.results_toggle();
-          }
-          return this.activate_field();
-        } else {
-          return this.pending_destroy_click = false;
-        }
-      }
-    };
-
-    Chosen.prototype.container_mouseup = function(evt) {
-      if (evt.target.nodeName === "ABBR") return this.results_reset(evt);
-    };
-
-    Chosen.prototype.blur_test = function(evt) {
-      if (!this.active_field && this.container.hasClass("chzn-container-active")) {
-        return this.close_field();
-      }
-    };
-
-    Chosen.prototype.close_field = function() {
-      $(document).unbind("click", this.click_test_action);
-      if (!this.is_multiple) {
-        this.selected_item.attr("tabindex", this.search_field.attr("tabindex"));
-        this.search_field.attr("tabindex", -1);
-      }
-      this.active_field = false;
-      this.results_hide();
-      this.container.removeClass("chzn-container-active");
-      this.winnow_results_clear();
-      this.clear_backstroke();
-      this.show_search_field_default();
-      return this.search_field_scale();
-    };
-
-    Chosen.prototype.activate_field = function() {
-      if (!this.is_multiple && !this.active_field) {
-        this.search_field.attr("tabindex", this.selected_item.attr("tabindex"));
-        this.selected_item.attr("tabindex", -1);
-      }
-      this.container.addClass("chzn-container-active");
-      this.active_field = true;
-      this.search_field.val(this.search_field.val());
-      return this.search_field.focus();
-    };
-
-    Chosen.prototype.test_active_click = function(evt) {
-      if ($(evt.target).parents('#' + this.container_id).length) {
-        return this.active_field = true;
-      } else {
-        return this.close_field();
-      }
-    };
-
-    Chosen.prototype.results_build = function() {
-      var content, data, _i, _len, _ref;
-      this.parsing = true;
-      this.results_data = root.SelectParser.select_to_array(this.form_field);
-      if (this.is_multiple && this.choices > 0) {
-        this.search_choices.find("li.search-choice").remove();
-        this.choices = 0;
-      } else if (!this.is_multiple) {
-        this.selected_item.find("span").text(this.default_text);
-        if (this.form_field.options.length <= this.disable_search_threshold) {
-          this.container.addClass("chzn-container-single-nosearch");
-        } else {
-          this.container.removeClass("chzn-container-single-nosearch");
-        }
-      }
-      content = '';
-      _ref = this.results_data;
-      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
-        data = _ref[_i];
-        if (data.group) {
-          content += this.result_add_group(data);
-        } else if (!data.empty) {
-          content += this.result_add_option(data);
-          if (data.selected && this.is_multiple) {
-            this.choice_build(data);
-          } else if (data.selected && !this.is_multiple) {
-            this.selected_item.removeClass("chzn-default").find("span").text(data.text);
-            if (this.allow_single_deselect) this.single_deselect_control_build();
-          }
-        }
-      }
-      this.search_field_disabled();
-      this.show_search_field_default();
-      this.search_field_scale();
-      this.search_results.html(content);
-      return this.parsing = false;
-    };
-
-    Chosen.prototype.result_add_group = function(group) {
-      if (!group.disabled) {
-        group.dom_id = this.container_id + "_g_" + group.array_index;
-        return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
-      } else {
-        return "";
-      }
-    };
-
-    Chosen.prototype.result_do_highlight = function(el) {
-      var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
-      if (el.length) {
-        this.result_clear_highlight();
-        this.result_highlight = el;
-        this.result_highlight.addClass("highlighted");
-        maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
-        visible_top = this.search_results.scrollTop();
-        visible_bottom = maxHeight + visible_top;
-        high_top = this.result_highlight.position().top + this.search_results.scrollTop();
-        high_bottom = high_top + this.result_highlight.outerHeight();
-        if (high_bottom >= visible_bottom) {
-          return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
-        } else if (high_top < visible_top) {
-          return this.search_results.scrollTop(high_top);
-        }
-      }
-    };
-
-    Chosen.prototype.result_clear_highlight = function() {
-      if (this.result_highlight) this.result_highlight.removeClass("highlighted");
-      return this.result_highlight = null;
-    };
-
-    Chosen.prototype.results_show = function() {
-      var dd_top;
-      if (!this.is_multiple) {
-        this.selected_item.addClass("chzn-single-with-drop");
-        if (this.result_single_selected) {
-          this.result_do_highlight(this.result_single_selected);
-        }
-      }
-      dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
-      this.dropdown.css({
-        "top": dd_top + "px",
-        "left": 0
-      });
-      this.results_showing = true;
-      this.search_field.focus();
-      this.search_field.val(this.search_field.val());
-      return this.winnow_results();
-    };
-
-    Chosen.prototype.results_hide = function() {
-      if (!this.is_multiple) {
-        this.selected_item.removeClass("chzn-single-with-drop");
-      }
-      this.result_clear_highlight();
-      this.dropdown.css({
-        "left": "-9000px"
-      });
-      return this.results_showing = false;
-    };
-
-    Chosen.prototype.set_tab_index = function(el) {
-      var ti;
-      if (this.form_field_jq.attr("tabindex")) {
-        ti = this.form_field_jq.attr("tabindex");
-        this.form_field_jq.attr("tabindex", -1);
-        if (this.is_multiple) {
-          return this.search_field.attr("tabindex", ti);
-        } else {
-          this.selected_item.attr("tabindex", ti);
-          return this.search_field.attr("tabindex", -1);
-        }
-      }
-    };
-
-    Chosen.prototype.show_search_field_default = function() {
-      if (this.is_multiple && this.choices < 1 && !this.active_field) {
-        this.search_field.val(this.default_text);
-        return this.search_field.addClass("default");
-      } else {
-        this.search_field.val("");
-        return this.search_field.removeClass("default");
-      }
-    };
-
-    Chosen.prototype.search_results_mouseup = function(evt) {
-      var target;
-      target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
-      if (target.length) {
-        this.result_highlight = target;
-        return this.result_select(evt);
-      }
-    };
-
-    Chosen.prototype.search_results_mouseover = function(evt) {
-      var target;
-      target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
-      if (target) return this.result_do_highlight(target);
-    };
-
-    Chosen.prototype.search_results_mouseout = function(evt) {
-      if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
-        return this.result_clear_highlight();
-      }
-    };
-
-    Chosen.prototype.choices_click = function(evt) {
-      evt.preventDefault();
-      if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
-        return this.results_show();
-      }
-    };
-
-    Chosen.prototype.choice_build = function(item) {
-      var choice_id, link,
-        _this = this;
-      choice_id = this.container_id + "_c_" + item.array_index;
-      this.choices += 1;
-      this.search_container.before('<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>');
-      link = $('#' + choice_id).find("a").first();
-      return link.click(function(evt) {
-        return _this.choice_destroy_link_click(evt);
-      });
-    };
-
-    Chosen.prototype.choice_destroy_link_click = function(evt) {
-      evt.preventDefault();
-      if (!this.is_disabled) {
-        this.pending_destroy_click = true;
-        return this.choice_destroy($(evt.target));
-      } else {
-        return evt.stopPropagation;
-      }
-    };
-
-    Chosen.prototype.choice_destroy = function(link) {
-      this.choices -= 1;
-      this.show_search_field_default();
-      if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
-        this.results_hide();
-      }
-      this.result_deselect(link.attr("rel"));
-      return link.parents('li').first().remove();
-    };
-
-    Chosen.prototype.results_reset = function(evt) {
-      this.form_field.options[0].selected = true;
-      this.selected_item.find("span").text(this.default_text);
-      if (!this.is_multiple) this.selected_item.addClass("chzn-default");
-      this.show_search_field_default();
-      $(evt.target).remove();
-      this.form_field_jq.trigger("change");
-      if (this.active_field) return this.results_hide();
-    };
-
-    Chosen.prototype.result_select = function(evt) {
-      var high, high_id, item, position;
-      if (this.result_highlight) {
-        high = this.result_highlight;
-        high_id = high.attr("id");
-        this.result_clear_highlight();
-        if (this.is_multiple) {
-          this.result_deactivate(high);
-        } else {
-          this.search_results.find(".result-selected").removeClass("result-selected");
-          this.result_single_selected = high;
-          this.selected_item.removeClass("chzn-default");
-        }
-        high.addClass("result-selected");
-        position = high_id.substr(high_id.lastIndexOf("_") + 1);
-        item = this.results_data[position];
-        item.selected = true;
-        this.form_field.options[item.options_index].selected = true;
-        if (this.is_multiple) {
-          this.choice_build(item);
-        } else {
-          this.selected_item.find("span").first().text(item.text);
-          if (this.allow_single_deselect) this.single_deselect_control_build();
-        }
-        if (!(evt.metaKey && this.is_multiple)) this.results_hide();
-        this.search_field.val("");
-        this.form_field_jq.trigger("change");
-        return this.search_field_scale();
-      }
-    };
-
-    Chosen.prototype.result_activate = function(el) {
-      return el.addClass("active-result");
-    };
-
-    Chosen.prototype.result_deactivate = function(el) {
-      return el.removeClass("active-result");
-    };
-
-    Chosen.prototype.result_deselect = function(pos) {
-      var result, result_data;
-      result_data = this.results_data[pos];
-      result_data.selected = false;
-      this.form_field.options[result_data.options_index].selected = false;
-      result = $("#" + this.container_id + "_o_" + pos);
-      result.removeClass("result-selected").addClass("active-result").show();
-      this.result_clear_highlight();
-      this.winnow_results();
-      this.form_field_jq.trigger("change");
-      return this.search_field_scale();
-    };
-
-    Chosen.prototype.single_deselect_control_build = function() {
-      if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
-        return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
-      }
-    };
-
-    Chosen.prototype.winnow_results = function() {
-      var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref;
-      this.no_results_clear();
-      results = 0;
-      searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
-      regexAnchor = this.search_contains ? "" : "^";
-      regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
-      zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
-      _ref = this.results_data;
-      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
-        option = _ref[_i];
-        if (!option.disabled && !option.empty) {
-          if (option.group) {
-            $('#' + option.dom_id).css('display', 'none');
-          } else if (!(this.is_multiple && option.selected)) {
-            found = false;
-            result_id = option.dom_id;
-            result = $("#" + result_id);
-            if (regex.test(option.html)) {
-              found = true;
-              results += 1;
-            } else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) {
-              parts = option.html.replace(/\[|\]/g, "").split(" ");
-              if (parts.length) {
-                for (_j = 0, _len2 = parts.length; _j < _len2; _j++) {
-                  part = parts[_j];
-                  if (regex.test(part)) {
-                    found = true;
-                    results += 1;
-                  }
-                }
-              }
-            }
-            if (found) {
-              if (searchText.length) {
-                startpos = option.html.search(zregex);
-                text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
-                text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
-              } else {
-                text = option.html;
-              }
-              result.html(text);
-              this.result_activate(result);
-              if (option.group_array_index != null) {
-                $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
-              }
-            } else {
-              if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
-                this.result_clear_highlight();
-              }
-              this.result_deactivate(result);
-            }
-          }
-        }
-      }
-      if (results < 1 && searchText.length) {
-        return this.no_results(searchText);
-      } else {
-        return this.winnow_results_set_highlight();
-      }
-    };
-
-    Chosen.prototype.winnow_results_clear = function() {
-      var li, lis, _i, _len, _results;
-      this.search_field.val("");
-      lis = this.search_results.find("li");
-      _results = [];
-      for (_i = 0, _len = lis.length; _i < _len; _i++) {
-        li = lis[_i];
-        li = $(li);
-        if (li.hasClass("group-result")) {
-          _results.push(li.css('display', 'auto'));
-        } else if (!this.is_multiple || !li.hasClass("result-selected")) {
-          _results.push(this.result_activate(li));
-        } else {
-          _results.push(void 0);
-        }
-      }
-      return _results;
-    };
-
-    Chosen.prototype.winnow_results_set_highlight = function() {
-      var do_high, selected_results;
-      if (!this.result_highlight) {
-        selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
-        do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
-        if (do_high != null) return this.result_do_highlight(do_high);
-      }
-    };
-
-    Chosen.prototype.no_results = function(terms) {
-      var no_results_html;
-      no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
-      no_results_html.find("span").first().html(terms);
-      return this.search_results.append(no_results_html);
-    };
-
-    Chosen.prototype.no_results_clear = function() {
-      return this.search_results.find(".no-results").remove();
-    };
-
-    Chosen.prototype.keydown_arrow = function() {
-      var first_active, next_sib;
-      if (!this.result_highlight) {
-        first_active = this.search_results.find("li.active-result").first();
-        if (first_active) this.result_do_highlight($(first_active));
-      } else if (this.results_showing) {
-        next_sib = this.result_highlight.nextAll("li.active-result").first();
-        if (next_sib) this.result_do_highlight(next_sib);
-      }
-      if (!this.results_showing) return this.results_show();
-    };
-
-    Chosen.prototype.keyup_arrow = function() {
-      var prev_sibs;
-      if (!this.results_showing && !this.is_multiple) {
-        return this.results_show();
-      } else if (this.result_highlight) {
-        prev_sibs = this.result_highlight.prevAll("li.active-result");
-        if (prev_sibs.length) {
-          return this.result_do_highlight(prev_sibs.first());
-        } else {
-          if (this.choices > 0) this.results_hide();
-          return this.result_clear_highlight();
-        }
-      }
-    };
-
-    Chosen.prototype.keydown_backstroke = function() {
-      if (this.pending_backstroke) {
-        this.choice_destroy(this.pending_backstroke.find("a").first());
-        return this.clear_backstroke();
-      } else {
-        this.pending_backstroke = this.search_container.siblings("li.search-choice").last();
-        return this.pending_backstroke.addClass("search-choice-focus");
-      }
-    };
-
-    Chosen.prototype.clear_backstroke = function() {
-      if (this.pending_backstroke) {
-        this.pending_backstroke.removeClass("search-choice-focus");
-      }
-      return this.pending_backstroke = null;
-    };
-
-    Chosen.prototype.keydown_checker = function(evt) {
-      var stroke, _ref;
-      stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
-      this.search_field_scale();
-      if (stroke !== 8 && this.pending_backstroke) this.clear_backstroke();
-      switch (stroke) {
-        case 8:
-          this.backstroke_length = this.search_field.val().length;
-          break;
-        case 9:
-          if (this.results_showing && !this.is_multiple) this.result_select(evt);
-          this.mouse_on_container = false;
-          break;
-        case 13:
-          evt.preventDefault();
-          break;
-        case 38:
-          evt.preventDefault();
-          this.keyup_arrow();
-          break;
-        case 40:
-          this.keydown_arrow();
-          break;
-      }
-    };
-
-    Chosen.prototype.search_field_scale = function() {
-      var dd_top, div, h, style, style_block, styles, w, _i, _len;
-      if (this.is_multiple) {
-        h = 0;
-        w = 0;
-        style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
-        styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
-        for (_i = 0, _len = styles.length; _i < _len; _i++) {
-          style = styles[_i];
-          style_block += style + ":" + this.search_field.css(style) + ";";
-        }
-        div = $('<div />', {
-          'style': style_block
-        });
-        div.text(this.search_field.val());
-        $('body').append(div);
-        w = div.width() + 25;
-        div.remove();
-        if (w > this.f_width - 10) w = this.f_width - 10;
-        this.search_field.css({
-          'width': w + 'px'
-        });
-        dd_top = this.container.height();
-        return this.dropdown.css({
-          "top": dd_top + "px"
-        });
-      }
-    };
-
-    Chosen.prototype.generate_random_id = function() {
-      var string;
-      string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
-      while ($("#" + string).length > 0) {
-        string += this.generate_random_char();
-      }
-      return string;
-    };
-
-    return Chosen;
-
-  })(AbstractChosen);
-
-  get_side_border_padding = function(elmt) {
-    var side_border_padding;
-    return side_border_padding = elmt.outerWidth() - elmt.width();
-  };
-
-  root.get_side_border_padding = get_side_border_padding;
-
-}).call(this);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/console.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/console.js b/solr/webapp/web/js/lib/console.js
deleted file mode 100644
index ef91c08..0000000
--- a/solr/webapp/web/js/lib/console.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- 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.
-*/
-
-window.console = window.console || {};
-
-var names = ["log", "debug", "info", "warn", "error",
-    "assert", "dir", "dirxml", "group", "groupEnd", "time",
-    "timeEnd", "count", "trace", "profile", "profileEnd"];
-
-var i = 0;
-var l = names.length;
-for( i = 0; i < l; i++ )
-{
-  window.console[names[i]] = window.console[names[i]] || function() {};
-}


[44/50] [abbrv] lucene-solr:jira/solr-10233: Ref Guide: Placeholders for docs for SOLR-10239 & SOLR-10447

Posted by tf...@apache.org.
Ref Guide: Placeholders for docs for SOLR-10239 & SOLR-10447


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a786f2eb
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a786f2eb
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a786f2eb

Branch: refs/heads/jira/solr-10233
Commit: a786f2eb4e6157334c516a2fba98f93cef800dc2
Parents: 48aa31d
Author: Cassandra Targett <ca...@lucidworks.com>
Authored: Thu May 18 13:14:48 2017 -0500
Committer: Cassandra Targett <ca...@lucidworks.com>
Committed: Thu May 18 13:14:48 2017 -0500

----------------------------------------------------------------------
 solr/solr-ref-guide/src/collections-api.adoc | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a786f2eb/solr/solr-ref-guide/src/collections-api.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/collections-api.adoc b/solr/solr-ref-guide/src/collections-api.adoc
index 9086660..63c7107 100644
--- a/solr/solr-ref-guide/src/collections-api.adoc
+++ b/solr/solr-ref-guide/src/collections-api.adoc
@@ -463,6 +463,15 @@ http://localhost:8983/solr/admin/collections?action=CREATEALIAS&name=testalias&c
 </response>
 ----
 
+== LISTALIASES: List Collection Aliases
+
+Lists all aliases for each collection.
+
+`/admin/collections?action=LISTALIASES`
+
+// TODO 6.6 examples
+
+
 [[CollectionsAPI-deletealias]]
 == DELETEALIAS: Delete a Collection Alias
 
@@ -1858,6 +1867,10 @@ This command recreates replicas in the source node to the target node. After eac
 This operation does not hold necessary locks on the replicas that belong to on the source node. So don't perform other collection operations in this period.
 ====
 
+== MOVEREPLICA: Move a Replica to a New node
+
+// TODO 6.6
+
 [[CollectionsAPI-async]]
 == Asynchronous Calls
 


[33/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10378: Clicking Solr logo on AdminUI shows blank page

Posted by tf...@apache.org.
SOLR-10378: Clicking Solr logo on AdminUI shows blank page


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/afd70a48
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/afd70a48
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/afd70a48

Branch: refs/heads/jira/solr-10233
Commit: afd70a48ccb81c44e81c182c50108e6981dfb6bf
Parents: 21384b5
Author: Jan Høydahl <ja...@apache.org>
Authored: Thu May 18 14:26:59 2017 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Thu May 18 14:26:59 2017 +0200

----------------------------------------------------------------------
 solr/CHANGES.txt           | 2 ++
 solr/webapp/web/index.html | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/afd70a48/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 3237fde..ccc8f4f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -163,6 +163,8 @@ Other Changes
 
 * SOLR-10042: Delete old deprecated Admin UI, leaving the AngularJS UI the only one supported (janhoy)
 
+* SOLR-10378: Clicking Solr logo on AdminUI shows blank page (Takumi Yoshida via janhoy)
+
 ==================  6.7.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/afd70a48/solr/webapp/web/index.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/index.html b/solr/webapp/web/index.html
index 923d1f1..ba86097 100644
--- a/solr/webapp/web/index.html
+++ b/solr/webapp/web/index.html
@@ -86,7 +86,7 @@ limitations under the License.
 
     <div id="header">
 
-      <a href="./" id="solr"><span>Apache SOLR</span></a>
+      <a href="#/" id="solr"><span>Apache SOLR</span></a>
 
       <p id="environment">&nbsp;</p>
 


[11/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10413: v2 API: parsed JSON type should be coerced to expected type

Posted by tf...@apache.org.
SOLR-10413: v2 API: parsed JSON type should be coerced to expected type


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c9340939
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c9340939
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c9340939

Branch: refs/heads/jira/solr-10233
Commit: c93409392d780892542ba736739099970a26632f
Parents: 9dc952a
Author: Cao Manh Dat <da...@apache.org>
Authored: Thu May 18 11:24:50 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Thu May 18 11:24:50 2017 +0700

----------------------------------------------------------------------
 .../apache/solr/util/JsonSchemaValidator.java   | 479 ++++++++-----------
 .../src/resources/apispec/cluster.Commands.json |   2 +-
 .../solr/handler/V2ApiIntegrationTest.java      |  11 +
 .../org/apache/solr/util/JsonValidatorTest.java |  27 +-
 4 files changed, 222 insertions(+), 297 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c9340939/solr/core/src/java/org/apache/solr/util/JsonSchemaValidator.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/JsonSchemaValidator.java b/solr/core/src/java/org/apache/solr/util/JsonSchemaValidator.java
index 1074ed8..8a0a09f 100644
--- a/solr/core/src/java/org/apache/solr/util/JsonSchemaValidator.java
+++ b/solr/core/src/java/org/apache/solr/util/JsonSchemaValidator.java
@@ -17,354 +17,261 @@
 
 package org.apache.solr.util;
 
-import java.util.Collections;
+import java.util.Arrays;
+import java.util.HashMap;
 import java.util.HashSet;
-import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
 
-import org.apache.solr.common.util.StrUtils;
+import org.apache.solr.common.util.Pair;
 import org.apache.solr.common.util.Utils;
 
-import static java.util.Arrays.asList;
-import static java.util.Collections.unmodifiableMap;
-import static java.util.function.Function.identity;
-import static java.util.stream.Collectors.toMap;
-
-/**A very basic and lightweight json schema parsing and data validation tool. This custom tool is created
+/**
+ * A very basic and lightweight json schema parsing and data validation tool. This custom tool is created
  * because a) we need to support non json inputs b) to avoiding double parsing (this accepts an already parsed json as a map)
  * It validates most aspects of json schema but it is NOT A FULLY COMPLIANT JSON schema parser or validator.
- * What is supported ?
- * a) all types and their validation (string, boolean, array, enum,object, integer, number)
- * b) 'required' properties, 'additionalProperties'
- *
- *
+ * This validator borrow some design's idea from https://github.com/networknt/json-schema-validator
  */
-
 public class JsonSchemaValidator {
-  private final SchemaNode root;
+
+  private List<Validator> validators;
+  private static Set<String> KNOWN_FNAMES = new HashSet<>(Arrays.asList(
+      "description","documentation","default","additionalProperties"));
+
 
   public JsonSchemaValidator(String jsonString) {
     this((Map) Utils.fromJSONString(jsonString));
   }
-  public JsonSchemaValidator(Map jsonSchema) {
-    root = new SchemaNode(null);
-    root.isRequired = true;
-    List<String> errs = new LinkedList<>();
-    root.validateSchema(jsonSchema, errs);
-    if(!errs.isEmpty()){
-      throw new RuntimeException("Invalid schema. "+ StrUtils.join(errs,'|'));
-    }
-  }
 
-  private static class SchemaNode {
-    final SchemaNode parent;
-    Type type;
-    Type elementType;
-    boolean isRequired = false;
-    Object validationInfo;
-    Boolean additionalProperties;
-    Map<String, SchemaNode> children;
-
-    private SchemaNode(SchemaNode parent) {
-      this.parent = parent;
-    }
-
-    private void validateSchema(Map jsonSchema, List<String> errs) {
-      Object typeStr = jsonSchema.get("type");
-      if (typeStr == null) {
-        errs.add("'type' is missing ");
-      }
-      Type type = Type.get(typeStr);
-      if (type == null) {
-        errs.add ("Unknown type " + typeStr + " in object "+ Utils.toJSONString(jsonSchema));
-        return;
-      }
-      this.type = type;
+  public JsonSchemaValidator(Map jsonSchema) {
+    this.validators = new LinkedList<>();
+    for (Object fname : jsonSchema.keySet()) {
+      if (KNOWN_FNAMES.contains(fname.toString())) continue;
 
-      for (SchemaAttribute schemaAttribute : SchemaAttribute.values()) {
-        schemaAttribute.validateSchema(jsonSchema, this, errs);
-      }
-      jsonSchema.keySet().forEach(o -> {
-        if (!knownAttributes.containsKey(o)) errs.add("Unknown key : " + o);
-      });
-      if (!errs.isEmpty()) return;
-
-      if (type == Type.OBJECT) {
-        Map m = (Map) jsonSchema.get("properties");
-        if (m != null) {
-          for (Object o : m.entrySet()) {
-            Map.Entry e = (Map.Entry) o;
-            if (e.getValue() instanceof Map) {
-              Map od = (Map) e.getValue();
-              if (children == null) children = new LinkedHashMap<>();
-              SchemaNode child = new SchemaNode(this);
-              children.put((String) e.getKey(), child);
-              child.validateSchema(od, errs);
-            } else {
-              errs.add("Invalid Object definition for field " + e.getKey());
-            }
-          }
-        } else {
-          additionalProperties = Boolean.TRUE;
-        }
-      }
-      for (SchemaAttribute attr : SchemaAttribute.values()) {
-        attr.postValidateSchema(jsonSchema, this, errs);
-      }
+      Function<Pair<Map, Object>, Validator> initializeFunction = VALIDATORS.get(fname.toString());
+      if (initializeFunction == null) throw new RuntimeException("Unknown key : " + fname);
 
+      this.validators.add(initializeFunction.apply(new Pair<>(jsonSchema, jsonSchema.get(fname))));
     }
+  }
 
-    private void validate(String key, Object data, List<String> errs) {
-      if (data == null) {
-        if (isRequired) {
-          errs.add("Missing field '" + key+"'");
-          return;
-        }
-      } else {
-        type.validateData(key, data, this, errs);
-        if(!errs.isEmpty()) return;
-        if (children != null && type == Type.OBJECT) {
-          for (Map.Entry<String, SchemaNode> e : children.entrySet()) {
-            e.getValue().validate(e.getKey(), ((Map) data).get(e.getKey()), errs);
-          }
-          if (Boolean.TRUE != additionalProperties) {
-            for (Object o : ((Map) data).keySet()) {
-              if (!children.containsKey(o)) {
-                errs.add("Unknown field '" + o + "' in object : " + Utils.toJSONString(data));
-              }
-            }
-          }
-        }
-      }
-    }
+  static final Map<String, Function<Pair<Map,Object>, Validator>> VALIDATORS = new HashMap<>();
 
+  static {
+    VALIDATORS.put("items", pair -> new ItemsValidator(pair.first(), (Map) pair.second()));
+    VALIDATORS.put("enum", pair -> new EnumValidator(pair.first(), (List) pair.second()));
+    VALIDATORS.put("properties", pair -> new PropertiesValidator(pair.first(), (Map) pair.second()));
+    VALIDATORS.put("type", pair -> new TypeValidator(pair.first(), pair.second()));
+    VALIDATORS.put("required", pair -> new RequiredValidator(pair.first(), (List)pair.second()));
+    VALIDATORS.put("oneOf", pair -> new OneOfValidator(pair.first(), (List)pair.second()));
   }
 
   public List<String> validateJson(Object data) {
     List<String> errs = new LinkedList<>();
-    root.validate(null, data, errs);
+    validate(data, errs);
     return errs.isEmpty() ? null : errs;
   }
 
-  /**represents an attribute in the schema definition
-   *
-   */
-  enum SchemaAttribute {
-    type(true, Type.STRING),
-    properties(false, Type.OBJECT) {
-      @Override
-      public void validateSchema(Map attrSchema, SchemaNode schemaNode, List<String> errors) {
-        super.validateSchema(attrSchema, schemaNode, errors);
-        if (schemaNode.type != Type.OBJECT) return;
-        Object val = attrSchema.get(key);
-        if (val == null) {
-          Object additional = attrSchema.get(additionalProperties.key);
-          if (Boolean.TRUE.equals(additional)) schemaNode.additionalProperties =  Boolean.TRUE;
-        }
-      }
-    },
-    additionalProperties(false, Type.BOOLEAN),
-    items(false, Type.OBJECT) {
-      @Override
-      public void validateSchema(Map attrSchema, SchemaNode schemaNode, List<String> errors) {
-        super.validateSchema(attrSchema, schemaNode, errors);
-        Object itemsVal = attrSchema.get(key);
-        if (itemsVal != null) {
-          if (schemaNode.type != Type.ARRAY) {
-            errors.add("Only 'array' can have 'items'");
-            return;
-          } else {
-            if (itemsVal instanceof Map) {
-              Map val = (Map) itemsVal;
-              Object value = val.get(type.key);
-              Type t = Type.get(String.valueOf(value));
-              if (t == null) {
-                errors.add("Unknown array type " + Utils.toJSONString(attrSchema));
-              } else {
-                schemaNode.elementType = t;
-              }
-            }
-          }
-        }
-      }
-    },
-    __default(false,Type.UNKNOWN),
-    description(false, Type.STRING),
-    documentation(false, Type.STRING),
-    oneOf(false, Type.ARRAY),
-    __enum(false, Type.ARRAY) {
-      @Override
-      void validateSchema(Map attrSchema, SchemaNode schemaNode, List<String> errors) {
-        if (attrSchema.get(Type.ENUM._name) != null) {
-          schemaNode.elementType = schemaNode.type;
-          schemaNode.type = Type.ENUM;
-        }
+  boolean validate(Object data, List<String> errs){
+    for (Validator validator : validators) {
+      if(!validator.validate(data, errs)) {
+        return false;
       }
+    }
+    return true;
+  }
 
-      @Override
-      void postValidateSchema(Map attrSchema, SchemaNode schemaNode, List<String> errs) {
-        Object val = attrSchema.get(key);
-        if (val == null) return;
-        if (val instanceof List) {
-          List list = (List) val;
-          for (Object o : list) {
-            if (!schemaNode.elementType.validate(o)) {
-              errs.add("Invalid value : " + o + " Expected type : " + schemaNode.elementType._name);
-            }
-          }
-          if (!errs.isEmpty()) return;
-          schemaNode.validationInfo = new HashSet(list);
-        } else {
-          errs.add("'enum' should have a an array as value in Object " + Utils.toJSONString(attrSchema));
-        }
-      }
-    },
-    id(false, Type.STRING),
-    _ref(false, Type.STRING),
-    _schema(false, Type.STRING),
-    required(false, Type.ARRAY) {
-      @Override
-      public void postValidateSchema(Map attrSchema, SchemaNode attr, List<String> errors) {
-        Object val = attrSchema.get(key);
-        if (val instanceof List) {
-          List list = (List) val;
-          if (attr.children != null) {
-            for (Map.Entry<String, SchemaNode> e : attr.children.entrySet()) {
-              if (list.contains(e.getKey())) e.getValue().isRequired = true;
-            }
-          }
-        }
-      }
-    };
+}
 
-    final String key;
-    final boolean _required;
-    final Type typ;
+abstract class Validator<T> {
+  @SuppressWarnings("unused")
+  Validator(Map schema, T properties) {};
+  abstract boolean validate(Object o, List<String> errs);
+}
 
-    public String getKey() {
-      return key;
-    }
+enum Type {
+  STRING(String.class),
+  ARRAY(List.class),
+  NUMBER(Number.class),
+  INTEGER(Long.class),
+  BOOLEAN(Boolean.class),
+  ENUM(List.class),
+  OBJECT(Map.class),
+  NULL(null),
+  UNKNOWN(Object.class);
+
+  Class type;
+
+  Type(Class type) {
+    this.type = type;
+  }
 
-    void validateSchema(Map attrSchema, SchemaNode schemaNode, List<String> errors) {
-      Object val = attrSchema.get(key);
-      if (val == null) {
-        if (_required)
-          errors.add("Missing required attribute '" + key + "' in object " + Utils.toJSONString(attrSchema));
-      } else {
-        if (!typ.validate(val)) errors.add(key + " should be of type " + typ._name);
+  boolean isValid(Object o) {
+    if (type == null) return o == null;
+    return type.isInstance(o);
+  }
+}
+
+class TypeValidator extends Validator<Object> {
+  private Set<Type> types;
+
+  TypeValidator(Map schema, Object type) {
+    super(schema, type);
+    types = new HashSet<>(1);
+    if (type instanceof List) {
+      for (Object t : (List)type) {
+        types.add(getType(t.toString()));
       }
+    } else {
+      types.add(getType(type.toString()));
     }
+  }
 
-    void postValidateSchema(Map attrSchema, SchemaNode schemaNode, List<String> errs) {
+  private Type getType(String typeStr) {
+    try {
+      return Type.valueOf(typeStr.toUpperCase(Locale.ROOT));
+    } catch (IllegalArgumentException e) {
+      throw new IllegalArgumentException("Unknown type " + typeStr);
     }
+  }
 
-    SchemaAttribute(boolean required, Type type) {
-      this.key = name().replaceAll("__","").replace('_', '$');
-      this._required = required;
-      this.typ = type;
+  @Override
+  boolean validate(Object o, List<String> errs) {
+    for (Type type: types) {
+      if (type.isValid(o)) return true;
     }
+    errs.add("Value is not valid, expected one of: " + types + ", found: " + o.getClass().getSimpleName());
+    return false;
   }
+}
 
-  interface TypeValidator {
-    void validateData(String key, Object o, SchemaNode schemaNode, List<String> errs);
+class ItemsValidator extends Validator<Map> {
+  private JsonSchemaValidator validator;
+  ItemsValidator(Map schema, Map properties) {
+    super(schema, properties);
+    validator = new JsonSchemaValidator(properties);
   }
 
-  /**represents a type in json
-   *
-   */
-  enum Type {
-    STRING(o -> o instanceof String),
-    ARRAY(o -> o instanceof List, (key, o, schemaNode, errs) -> {
-      List l = o instanceof List ? (List) o : Collections.singletonList(o);
-      if (schemaNode.elementType != null) {
-        for (Object elem : l) {
-          if (!schemaNode.elementType.validate(elem)) {
-            errs.add("Expected elements of type : " + key + " but found : " + Utils.toJSONString(o));
-            break;
-          }
+  @Override
+  boolean validate(Object o, List<String> errs) {
+    if (o instanceof List) {
+      for (Object o2 : (List) o) {
+        if (!validator.validate(o2, errs)) {
+          errs.add("Items not valid");
+          return false;
         }
       }
-    }),
-    NUMBER(o -> o instanceof Number, (key, o, schemaNode, errs) -> {
-      if (o instanceof String) {
-        try {
-          Double.parseDouble((String) o);
-        } catch (NumberFormatException e) {
-          errs.add(e.getClass().getName() + " " + e.getMessage());
-        }
+      return true;
+    }
+    return false;
+  }
+}
 
-      }
+class EnumValidator extends Validator<List<String>> {
 
-    }),
-    INTEGER(o -> o instanceof Integer, (key, o, schemaNode, errs) -> {
-      if (o instanceof String) {
-        try {
-          Integer.parseInt((String) o);
-        } catch (NumberFormatException e) {
-          errs.add(e.getClass().getName() + " " + e.getMessage());
-        }
-      }
-    }),
-    BOOLEAN(o -> o instanceof Boolean, (key, o, schemaNode, errs) -> {
-      if (o instanceof String) {
-        try {
-          Boolean.parseBoolean((String) o);
-        } catch (Exception e) {
-          errs.add(e.getClass().getName() + " " + e.getMessage());
-        }
-      }
-    }),
-    ENUM(o -> o instanceof List, (key, o, schemaNode, errs) -> {
-      if (schemaNode.validationInfo instanceof HashSet) {
-        HashSet enumVals = (HashSet) schemaNode.validationInfo;
-        if (!enumVals.contains(o)) {
-          errs.add("value of enum " + key + " must be one of" + enumVals);
-        }
-      }
-    }),
-    OBJECT(o -> o instanceof Map),
-    UNKNOWN((o -> true));
-    final String _name;
+  private Set<String> enumVals;
 
-    final java.util.function.Predicate typeValidator;
-    private final TypeValidator validator;
+  EnumValidator(Map schema, List<String> properties) {
+    super(schema, properties);
+    enumVals = new HashSet<>(properties);
 
-    Type(java.util.function.Predicate validator) {
-      this(validator, null);
+  }
 
+  @Override
+  boolean validate(Object o, List<String> errs) {
+    if (o instanceof String) {
+      if(!enumVals.contains(o)) {
+        errs.add("Value of enum must be one of " + enumVals);
+        return false;
+      }
+      return true;
     }
+    return false;
+  }
+}
 
-    Type(java.util.function.Predicate validator, TypeValidator v) {
-      _name = this.name().toLowerCase(Locale.ROOT);
-      this.typeValidator = validator;
-      this.validator = v;
-    }
+class RequiredValidator extends Validator<List<String>> {
 
-    boolean validate(Object o) {
-      return typeValidator.test(o);
-    }
+  private Set<String> requiredProps;
 
-    void validateData(String key, Object o, SchemaNode attr, List<String> errs) {
-      if (validator != null) {
-        validator.validateData(key, o, attr, errs);
-        return;
+  RequiredValidator(Map schema, List<String> requiredProps) {
+    super(schema, requiredProps);
+    this.requiredProps = new HashSet<>(requiredProps);
+  }
+
+  @Override
+  boolean validate(Object o, List<String> errs) {
+    if (o instanceof Map) {
+      Set fnames = ((Map) o).keySet();
+      for (String requiredProp : requiredProps) {
+        if (!fnames.contains(requiredProp)) {
+          errs.add("Missing required attribute '" + requiredProp + "' in object " + Utils.toJSONString(o));
+          return false;
+        }
       }
-      if (!typeValidator.test(o))
-        errs.add("Expected type : " + _name + " but found : " + o + "in object : " + Utils.toJSONString(o));
+      return true;
+    }
+    return false;
+  }
+}
+
+class PropertiesValidator extends Validator<Map<String, Map>> {
+  private Map<String, JsonSchemaValidator> jsonSchemas;
+  private boolean additionalProperties;
+
+  PropertiesValidator(Map schema, Map<String, Map> properties) {
+    super(schema, properties);
+    jsonSchemas = new HashMap<>();
+    this.additionalProperties = (boolean) schema.getOrDefault("additionalProperties", false);
+    for (Map.Entry<String, Map> entry : properties.entrySet()) {
+      jsonSchemas.put(entry.getKey(), new JsonSchemaValidator(entry.getValue()));
     }
+  }
 
-    static Type get(Object type) {
-      for (Type t : Type.values()) {
-        if (t._name.equals(type)) return t;
+  @Override
+  boolean validate(Object o, List<String> errs) {
+    if (o instanceof Map) {
+      Map map = (Map) o;
+      for (Object key : map.keySet()) {
+        JsonSchemaValidator jsonSchema = jsonSchemas.get(key.toString());
+        if (jsonSchema == null && !additionalProperties) {
+          errs.add("Unknown field '" + key + "' in object : " + Utils.toJSONString(o));
+          return false;
+        }
+        if (jsonSchema != null && !jsonSchema.validate(map.get(key), errs)) {
+          return false;
+        }
       }
-      return null;
+      return true;
     }
+    return false;
   }
+}
+
+class OneOfValidator extends Validator<List<String>> {
 
+  private Set<String> oneOfProps;
 
-  static final Map<String, SchemaAttribute> knownAttributes = unmodifiableMap(asList(SchemaAttribute.values()).stream().collect(toMap(SchemaAttribute::getKey, identity())));
+  OneOfValidator(Map schema, List<String> oneOfProps) {
+    super(schema, oneOfProps);
+    this.oneOfProps = new HashSet<>(oneOfProps);
+  }
 
+  @Override
+  boolean validate(Object o, List<String> errs) {
+    if (o instanceof Map) {
+      Map map = (Map) o;
+      for (Object key : map.keySet()) {
+        if (oneOfProps.contains(key.toString())) return true;
+      }
+      errs.add("One of fields :"  + oneOfProps + " is not presented in object : " + Utils.toJSONString(o));
+      return false;
+    }
+
+    return false;
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c9340939/solr/core/src/resources/apispec/cluster.Commands.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/cluster.Commands.json b/solr/core/src/resources/apispec/cluster.Commands.json
index 8983964..88f8c06 100644
--- a/solr/core/src/resources/apispec/cluster.Commands.json
+++ b/solr/core/src/resources/apispec/cluster.Commands.json
@@ -61,7 +61,7 @@
           "description": "The name of the property"
         },
         "val": {
-          "type": "string",
+          "type": ["string","boolean","null"],
           "description": "The value of the property. If the value is empty or null, the property is unset."
         }
       },

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c9340939/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
index 57ab9fc..70b7f8a 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -70,6 +71,16 @@ public class V2ApiIntegrationTest extends SolrCloudTestCase {
   }
 
   @Test
+  public void testSetPropertyValidationOfCluster() throws IOException, SolrServerException {
+    NamedList resp = cluster.getSolrClient().request(
+      new V2Request.Builder("/cluster").withMethod(SolrRequest.METHOD.POST).withPayload("{set-property: {name: autoAddReplicas, val:false}}").build());
+    assertTrue(resp.toString().contains("status=0"));
+    resp = cluster.getSolrClient().request(
+        new V2Request.Builder("/cluster").withMethod(SolrRequest.METHOD.POST).withPayload("{set-property: {name: autoAddReplicas, val:null}}").build());
+    assertTrue(resp.toString().contains("status=0"));
+  }
+
+  @Test
   public void testCollectionsApi() throws Exception {
     CloudSolrClient client = cluster.getSolrClient();
     Map result = resAsMap(client, new V2Request.Builder("/c/"+COLL_NAME+"/get/_introspect").build());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c9340939/solr/core/src/test/org/apache/solr/util/JsonValidatorTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/JsonValidatorTest.java b/solr/core/src/test/org/apache/solr/util/JsonValidatorTest.java
index 4492586..02e95f7 100644
--- a/solr/core/src/test/org/apache/solr/util/JsonValidatorTest.java
+++ b/solr/core/src/test/org/apache/solr/util/JsonValidatorTest.java
@@ -53,21 +53,19 @@ public class JsonValidatorTest extends SolrTestCaseJ4 {
     JsonSchemaValidator validator = new JsonSchemaValidator(createSchema);
     List<String> errs = validator.validateJson(Utils.fromJSONString("{name : x, collections: [ c1 , c2]}"));
     assertNull(toJSONString(errs), errs);
-    errs = validator.validateJson(Utils.fromJSONString("{name : x, collections: c1 }"));
+    errs = validator.validateJson(Utils.fromJSONString("{name : x, collections: [c1] }"));
     assertNull(toJSONString(errs), errs);
     errs = validator.validateJson(Utils.fromJSONString("{name : x, x:y, collections: [ c1 , c2]}"));
     assertNotNull(toJSONString(errs), errs);
     assertTrue(toJSONString(errs), errs.get(0).contains("Unknown"));
     errs = validator.validateJson(Utils.fromJSONString("{name : 123, collections: c1 }"));
     assertNotNull(toJSONString(errs), errs);
-    assertTrue(toJSONString(errs), errs.get(0).contains("Expected type"));
+    assertTrue(toJSONString(errs), errs.get(0).contains("expected"));
     errs = validator.validateJson(Utils.fromJSONString("{x:y, collections: [ c1 , c2]}"));
-    assertEquals(toJSONString(errs), 2, errs.size());
-    assertTrue(toJSONString(errs), StrUtils.join(errs, '|').contains("Missing field"));
     assertTrue(toJSONString(errs), StrUtils.join(errs, '|').contains("Unknown"));
     errs = validator.validateJson(Utils.fromJSONString("{name : x, collections: [ 1 , 2]}"));
     assertFalse(toJSONString(errs), errs.isEmpty());
-    assertTrue(toJSONString(errs), errs.get(0).contains("Expected elements of type"));
+    assertTrue(toJSONString(errs), errs.get(0).contains("expected"));
     validator = new JsonSchemaValidator("{" +
         "  type:object," +
         "  properties: {" +
@@ -77,7 +75,7 @@ public class JsonValidatorTest extends SolrTestCaseJ4 {
     errs = validator.validateJson(Utils.fromJSONString("{name:x, age:21, adult:true}"));
     assertNull(errs);
     errs = validator.validateJson(Utils.fromJSONString("{name:x, age:'21', adult:'true'}"));
-    assertNull(errs);
+    assertNotNull(errs);
 
     errs = validator.validateJson(Utils.fromJSONString("{name:x, age:'x21', adult:'true'}"));
     assertEquals(1, errs.size());
@@ -128,8 +126,8 @@ public class JsonValidatorTest extends SolrTestCaseJ4 {
     assertNull("errs are " + errs, errs);
     errs = validator.validateJson(Utils.fromJSONString("{name: 'Joe Average' , sex:m}"));
     assertEquals(1, errs.size());
-    assertTrue(errs.get(0).contains("value of enum"));
-    
+    assertTrue(errs.get(0).contains("Value of enum"));
+
     String schema = "{\n" +
         "  'type': 'object',\n" +
         "  'properties': {\n" +
@@ -167,9 +165,18 @@ public class JsonValidatorTest extends SolrTestCaseJ4 {
         "    }\n" +
         "  ]\n" +
         "}"));
-    
-
 
+    schema = "{\n" +
+        "'type' : 'object',\n" +
+        "'oneOf' : ['a', 'b']\n" +
+        "}";
+    validator = new JsonSchemaValidator(schema);
+    errs = validator.validateJson(Utils.fromJSONString("" +
+        "{'c':'val'}"));
+    assertNotNull(errs);
+    errs = validator.validateJson(Utils.fromJSONString("" +
+        "{'a':'val'}"));
+    assertNull(errs);
 
   }
 


[13/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10413: Update CHANGES.txt

Posted by tf...@apache.org.
SOLR-10413: Update CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/38205d7a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/38205d7a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/38205d7a

Branch: refs/heads/jira/solr-10233
Commit: 38205d7adab7fc184d510f1fa5af631699f75836
Parents: 896270d
Author: Cao Manh Dat <da...@apache.org>
Authored: Thu May 18 13:59:56 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Thu May 18 13:59:56 2017 +0700

----------------------------------------------------------------------
 solr/CHANGES.txt | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/38205d7a/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index acc29f4..b1584ee 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -113,6 +113,8 @@ Bug Fixes
 * SOLR-10412: v2 API: many API command specification properties are typed "number" but should instead be typed "integer"
   (Steve Rowe, Cao Manh Dat)
 
+* SOLR-10413: v2 API: parsed JSON type should be coerced to expected type (Cao Manh Dat, Noble Paul)
+
 Optimizations
 ----------------------
 


[22/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/require.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/require.js b/solr/webapp/web/js/require.js
deleted file mode 100644
index a47f8b4..0000000
--- a/solr/webapp/web/js/require.js
+++ /dev/null
@@ -1,11349 +0,0 @@
-/*
-
-MIT License
------------
-
-Copyright (c) 2010-2011, The Dojo Foundation
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-/** vim: et:ts=4:sw=4:sts=4
- * @license RequireJS 1.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
- * Available via the MIT or new BSD license.
- * see: http://github.com/jrburke/requirejs for details
- */
-/*jslint strict: false, plusplus: false, sub: true */
-/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */
-
-var requirejs, require, define;
-(function () {
-    //Change this version number for each release.
-    var version = "1.0.6",
-        commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
-        cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g,
-        currDirRegExp = /^\.\//,
-        jsSuffixRegExp = /\.js$/,
-        ostring = Object.prototype.toString,
-        ap = Array.prototype,
-        aps = ap.slice,
-        apsp = ap.splice,
-        isBrowser = !!(typeof window !== "undefined" && navigator && document),
-        isWebWorker = !isBrowser && typeof importScripts !== "undefined",
-        //PS3 indicates loaded and complete, but need to wait for complete
-        //specifically. Sequence is "loading", "loaded", execution,
-        // then "complete". The UA check is unfortunate, but not sure how
-        //to feature test w/o causing perf issues.
-        readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
-                      /^complete$/ : /^(complete|loaded)$/,
-        defContextName = "_",
-        //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
-        isOpera = typeof opera !== "undefined" && opera.toString() === "[object Opera]",
-        empty = {},
-        contexts = {},
-        globalDefQueue = [],
-        interactiveScript = null,
-        checkLoadedDepth = 0,
-        useInteractive = false,
-        reservedDependencies = {
-            require: true,
-            module: true,
-            exports: true
-        },
-        req, cfg = {}, currentlyAddingScript, s, head, baseElement, scripts, script,
-        src, subPath, mainScript, dataMain, globalI, ctx, jQueryCheck, checkLoadedTimeoutId;
-
-    function isFunction(it) {
-        return ostring.call(it) === "[object Function]";
-    }
-
-    function isArray(it) {
-        return ostring.call(it) === "[object Array]";
-    }
-
-    /**
-     * Simple function to mix in properties from source into target,
-     * but only if target does not already have a property of the same name.
-     * This is not robust in IE for transferring methods that match
-     * Object.prototype names, but the uses of mixin here seem unlikely to
-     * trigger a problem related to that.
-     */
-    function mixin(target, source, force) {
-        for (var prop in source) {
-            if (!(prop in empty) && (!(prop in target) || force)) {
-                target[prop] = source[prop];
-            }
-        }
-        return req;
-    }
-
-    /**
-     * Constructs an error with a pointer to an URL with more information.
-     * @param {String} id the error ID that maps to an ID on a web page.
-     * @param {String} message human readable error.
-     * @param {Error} [err] the original error, if there is one.
-     *
-     * @returns {Error}
-     */
-    function makeError(id, msg, err) {
-        var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
-        if (err) {
-            e.originalError = err;
-        }
-        return e;
-    }
-
-    /**
-     * Used to set up package paths from a packagePaths or packages config object.
-     * @param {Object} pkgs the object to store the new package config
-     * @param {Array} currentPackages an array of packages to configure
-     * @param {String} [dir] a prefix dir to use.
-     */
-    function configurePackageDir(pkgs, currentPackages, dir) {
-        var i, location, pkgObj;
-
-        for (i = 0; (pkgObj = currentPackages[i]); i++) {
-            pkgObj = typeof pkgObj === "string" ? { name: pkgObj } : pkgObj;
-            location = pkgObj.location;
-
-            //Add dir to the path, but avoid paths that start with a slash
-            //or have a colon (indicates a protocol)
-            if (dir && (!location || (location.indexOf("/") !== 0 && location.indexOf(":") === -1))) {
-                location = dir + "/" + (location || pkgObj.name);
-            }
-
-            //Create a brand new object on pkgs, since currentPackages can
-            //be passed in again, and config.pkgs is the internal transformed
-            //state for all package configs.
-            pkgs[pkgObj.name] = {
-                name: pkgObj.name,
-                location: location || pkgObj.name,
-                //Remove leading dot in main, so main paths are normalized,
-                //and remove any trailing .js, since different package
-                //envs have different conventions: some use a module name,
-                //some use a file name.
-                main: (pkgObj.main || "main")
-                      .replace(currDirRegExp, '')
-                      .replace(jsSuffixRegExp, '')
-            };
-        }
-    }
-
-    /**
-     * jQuery 1.4.3-1.5.x use a readyWait/ready() pairing to hold DOM
-     * ready callbacks, but jQuery 1.6 supports a holdReady() API instead.
-     * At some point remove the readyWait/ready() support and just stick
-     * with using holdReady.
-     */
-    function jQueryHoldReady($, shouldHold) {
-        if ($.holdReady) {
-            $.holdReady(shouldHold);
-        } else if (shouldHold) {
-            $.readyWait += 1;
-        } else {
-            $.ready(true);
-        }
-    }
-
-    if (typeof define !== "undefined") {
-        //If a define is already in play via another AMD loader,
-        //do not overwrite.
-        return;
-    }
-
-    if (typeof requirejs !== "undefined") {
-        if (isFunction(requirejs)) {
-            //Do not overwrite and existing requirejs instance.
-            return;
-        } else {
-            cfg = requirejs;
-            requirejs = undefined;
-        }
-    }
-
-    //Allow for a require config object
-    if (typeof require !== "undefined" && !isFunction(require)) {
-        //assume it is a config object.
-        cfg = require;
-        require = undefined;
-    }
-
-    /**
-     * Creates a new context for use in require and define calls.
-     * Handle most of the heavy lifting. Do not want to use an object
-     * with prototype here to avoid using "this" in require, in case it
-     * needs to be used in more super secure envs that do not want this.
-     * Also there should not be that many contexts in the page. Usually just
-     * one for the default context, but could be extra for multiversion cases
-     * or if a package needs a special context for a dependency that conflicts
-     * with the standard context.
-     */
-    function newContext(contextName) {
-        var context, resume,
-            config = {
-                waitSeconds: 7,
-                baseUrl: "./",
-                paths: {},
-                pkgs: {},
-                catchError: {}
-            },
-            defQueue = [],
-            specified = {
-                "require": true,
-                "exports": true,
-                "module": true
-            },
-            urlMap = {},
-            defined = {},
-            loaded = {},
-            waiting = {},
-            waitAry = [],
-            urlFetched = {},
-            managerCounter = 0,
-            managerCallbacks = {},
-            plugins = {},
-            //Used to indicate which modules in a build scenario
-            //need to be full executed.
-            needFullExec = {},
-            fullExec = {},
-            resumeDepth = 0;
-
-        /**
-         * Trims the . and .. from an array of path segments.
-         * It will keep a leading path segment if a .. will become
-         * the first path segment, to help with module name lookups,
-         * which act like paths, but can be remapped. But the end result,
-         * all paths that use this function should look normalized.
-         * NOTE: this method MODIFIES the input array.
-         * @param {Array} ary the array of path segments.
-         */
-        function trimDots(ary) {
-            var i, part;
-            for (i = 0; (part = ary[i]); i++) {
-                if (part === ".") {
-                    ary.splice(i, 1);
-                    i -= 1;
-                } else if (part === "..") {
-                    if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
-                        //End of the line. Keep at least one non-dot
-                        //path segment at the front so it can be mapped
-                        //correctly to disk. Otherwise, there is likely
-                        //no path mapping for a path starting with '..'.
-                        //This can still fail, but catches the most reasonable
-                        //uses of ..
-                        break;
-                    } else if (i > 0) {
-                        ary.splice(i - 1, 2);
-                        i -= 2;
-                    }
-                }
-            }
-        }
-
-        /**
-         * Given a relative module name, like ./something, normalize it to
-         * a real name that can be mapped to a path.
-         * @param {String} name the relative name
-         * @param {String} baseName a real name that the name arg is relative
-         * to.
-         * @returns {String} normalized name
-         */
-        function normalize(name, baseName) {
-            var pkgName, pkgConfig;
-
-            //Adjust any relative paths.
-            if (name && name.charAt(0) === ".") {
-                //If have a base name, try to normalize against it,
-                //otherwise, assume it is a top-level require that will
-                //be relative to baseUrl in the end.
-                if (baseName) {
-                    if (config.pkgs[baseName]) {
-                        //If the baseName is a package name, then just treat it as one
-                        //name to concat the name with.
-                        baseName = [baseName];
-                    } else {
-                        //Convert baseName to array, and lop off the last part,
-                        //so that . matches that "directory" and not name of the baseName's
-                        //module. For instance, baseName of "one/two/three", maps to
-                        //"one/two/three.js", but we want the directory, "one/two" for
-                        //this normalization.
-                        baseName = baseName.split("/");
-                        baseName = baseName.slice(0, baseName.length - 1);
-                    }
-
-                    name = baseName.concat(name.split("/"));
-                    trimDots(name);
-
-                    //Some use of packages may use a . path to reference the
-                    //"main" module name, so normalize for that.
-                    pkgConfig = config.pkgs[(pkgName = name[0])];
-                    name = name.join("/");
-                    if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
-                        name = pkgName;
-                    }
-                } else if (name.indexOf("./") === 0) {
-                    // No baseName, so this is ID is resolved relative
-                    // to baseUrl, pull off the leading dot.
-                    name = name.substring(2);
-                }
-            }
-            return name;
-        }
-
-        /**
-         * Creates a module mapping that includes plugin prefix, module
-         * name, and path. If parentModuleMap is provided it will
-         * also normalize the name via require.normalize()
-         *
-         * @param {String} name the module name
-         * @param {String} [parentModuleMap] parent module map
-         * for the module name, used to resolve relative names.
-         *
-         * @returns {Object}
-         */
-        function makeModuleMap(name, parentModuleMap) {
-            var index = name ? name.indexOf("!") : -1,
-                prefix = null,
-                parentName = parentModuleMap ? parentModuleMap.name : null,
-                originalName = name,
-                normalizedName, url, pluginModule;
-
-            if (index !== -1) {
-                prefix = name.substring(0, index);
-                name = name.substring(index + 1, name.length);
-            }
-
-            if (prefix) {
-                prefix = normalize(prefix, parentName);
-            }
-
-            //Account for relative paths if there is a base name.
-            if (name) {
-                if (prefix) {
-                    pluginModule = defined[prefix];
-                    if (pluginModule && pluginModule.normalize) {
-                        //Plugin is loaded, use its normalize method.
-                        normalizedName = pluginModule.normalize(name, function (name) {
-                            return normalize(name, parentName);
-                        });
-                    } else {
-                        normalizedName = normalize(name, parentName);
-                    }
-                } else {
-                    //A regular module.
-                    normalizedName = normalize(name, parentName);
-
-                    url = urlMap[normalizedName];
-                    if (!url) {
-                        //Calculate url for the module, if it has a name.
-                        //Use name here since nameToUrl also calls normalize,
-                        //and for relative names that are outside the baseUrl
-                        //this causes havoc. Was thinking of just removing
-                        //parentModuleMap to avoid extra normalization, but
-                        //normalize() still does a dot removal because of
-                        //issue #142, so just pass in name here and redo
-                        //the normalization. Paths outside baseUrl are just
-                        //messy to support.
-                        url = context.nameToUrl(name, null, parentModuleMap);
-
-                        //Store the URL mapping for later.
-                        urlMap[normalizedName] = url;
-                    }
-                }
-            }
-
-            return {
-                prefix: prefix,
-                name: normalizedName,
-                parentMap: parentModuleMap,
-                url: url,
-                originalName: originalName,
-                fullName: prefix ? prefix + "!" + (normalizedName || '') : normalizedName
-            };
-        }
-
-        /**
-         * Determine if priority loading is done. If so clear the priorityWait
-         */
-        function isPriorityDone() {
-            var priorityDone = true,
-                priorityWait = config.priorityWait,
-                priorityName, i;
-            if (priorityWait) {
-                for (i = 0; (priorityName = priorityWait[i]); i++) {
-                    if (!loaded[priorityName]) {
-                        priorityDone = false;
-                        break;
-                    }
-                }
-                if (priorityDone) {
-                    delete config.priorityWait;
-                }
-            }
-            return priorityDone;
-        }
-
-        function makeContextModuleFunc(func, relModuleMap, enableBuildCallback) {
-            return function () {
-                //A version of a require function that passes a moduleName
-                //value for items that may need to
-                //look up paths relative to the moduleName
-                var args = aps.call(arguments, 0), lastArg;
-                if (enableBuildCallback &&
-                    isFunction((lastArg = args[args.length - 1]))) {
-                    lastArg.__requireJsBuild = true;
-                }
-                args.push(relModuleMap);
-                return func.apply(null, args);
-            };
-        }
-
-        /**
-         * Helper function that creates a require function object to give to
-         * modules that ask for it as a dependency. It needs to be specific
-         * per module because of the implication of path mappings that may
-         * need to be relative to the module name.
-         */
-        function makeRequire(relModuleMap, enableBuildCallback, altRequire) {
-            var modRequire = makeContextModuleFunc(altRequire || context.require, relModuleMap, enableBuildCallback);
-
-            mixin(modRequire, {
-                nameToUrl: makeContextModuleFunc(context.nameToUrl, relModuleMap),
-                toUrl: makeContextModuleFunc(context.toUrl, relModuleMap),
-                defined: makeContextModuleFunc(context.requireDefined, relModuleMap),
-                specified: makeContextModuleFunc(context.requireSpecified, relModuleMap),
-                isBrowser: req.isBrowser
-            });
-            return modRequire;
-        }
-
-        /*
-         * Queues a dependency for checking after the loader is out of a
-         * "paused" state, for example while a script file is being loaded
-         * in the browser, where it may have many modules defined in it.
-         */
-        function queueDependency(manager) {
-            context.paused.push(manager);
-        }
-
-        function execManager(manager) {
-            var i, ret, err, errFile, errModuleTree,
-                cb = manager.callback,
-                map = manager.map,
-                fullName = map.fullName,
-                args = manager.deps,
-                listeners = manager.listeners,
-                cjsModule;
-
-            //Call the callback to define the module, if necessary.
-            if (cb && isFunction(cb)) {
-                if (config.catchError.define) {
-                    try {
-                        ret = req.execCb(fullName, manager.callback, args, defined[fullName]);
-                    } catch (e) {
-                        err = e;
-                    }
-                } else {
-                    ret = req.execCb(fullName, manager.callback, args, defined[fullName]);
-                }
-
-                if (fullName) {
-                    //If setting exports via "module" is in play,
-                    //favor that over return value and exports. After that,
-                    //favor a non-undefined return value over exports use.
-                    cjsModule = manager.cjsModule;
-                    if (cjsModule &&
-                        cjsModule.exports !== undefined &&
-                        //Make sure it is not already the exports value
-                        cjsModule.exports !== defined[fullName]) {
-                        ret = defined[fullName] = manager.cjsModule.exports;
-                    } else if (ret === undefined && manager.usingExports) {
-                        //exports already set the defined value.
-                        ret = defined[fullName];
-                    } else {
-                        //Use the return value from the function.
-                        defined[fullName] = ret;
-                        //If this module needed full execution in a build
-                        //environment, mark that now.
-                        if (needFullExec[fullName]) {
-                            fullExec[fullName] = true;
-                        }
-                    }
-                }
-            } else if (fullName) {
-                //May just be an object definition for the module. Only
-                //worry about defining if have a module name.
-                ret = defined[fullName] = cb;
-
-                //If this module needed full execution in a build
-                //environment, mark that now.
-                if (needFullExec[fullName]) {
-                    fullExec[fullName] = true;
-                }
-            }
-
-            //Clean up waiting. Do this before error calls, and before
-            //calling back listeners, so that bookkeeping is correct
-            //in the event of an error and error is reported in correct order,
-            //since the listeners will likely have errors if the
-            //onError function does not throw.
-            if (waiting[manager.id]) {
-                delete waiting[manager.id];
-                manager.isDone = true;
-                context.waitCount -= 1;
-                if (context.waitCount === 0) {
-                    //Clear the wait array used for cycles.
-                    waitAry = [];
-                }
-            }
-
-            //Do not need to track manager callback now that it is defined.
-            delete managerCallbacks[fullName];
-
-            //Allow instrumentation like the optimizer to know the order
-            //of modules executed and their dependencies.
-            if (req.onResourceLoad && !manager.placeholder) {
-                req.onResourceLoad(context, map, manager.depArray);
-            }
-
-            if (err) {
-                errFile = (fullName ? makeModuleMap(fullName).url : '') ||
-                           err.fileName || err.sourceURL;
-                errModuleTree = err.moduleTree;
-                err = makeError('defineerror', 'Error evaluating ' +
-                                'module "' + fullName + '" at location "' +
-                                errFile + '":\n' +
-                                err + '\nfileName:' + errFile +
-                                '\nlineNumber: ' + (err.lineNumber || err.line), err);
-                err.moduleName = fullName;
-                err.moduleTree = errModuleTree;
-                return req.onError(err);
-            }
-
-            //Let listeners know of this manager's value.
-            for (i = 0; (cb = listeners[i]); i++) {
-                cb(ret);
-            }
-
-            return undefined;
-        }
-
-        /**
-         * Helper that creates a callack function that is called when a dependency
-         * is ready, and sets the i-th dependency for the manager as the
-         * value passed to the callback generated by this function.
-         */
-        function makeArgCallback(manager, i) {
-            return function (value) {
-                //Only do the work if it has not been done
-                //already for a dependency. Cycle breaking
-                //logic in forceExec could mean this function
-                //is called more than once for a given dependency.
-                if (!manager.depDone[i]) {
-                    manager.depDone[i] = true;
-                    manager.deps[i] = value;
-                    manager.depCount -= 1;
-                    if (!manager.depCount) {
-                        //All done, execute!
-                        execManager(manager);
-                    }
-                }
-            };
-        }
-
-        function callPlugin(pluginName, depManager) {
-            var map = depManager.map,
-                fullName = map.fullName,
-                name = map.name,
-                plugin = plugins[pluginName] ||
-                        (plugins[pluginName] = defined[pluginName]),
-                load;
-
-            //No need to continue if the manager is already
-            //in the process of loading.
-            if (depManager.loading) {
-                return;
-            }
-            depManager.loading = true;
-
-            load = function (ret) {
-                depManager.callback = function () {
-                    return ret;
-                };
-                execManager(depManager);
-
-                loaded[depManager.id] = true;
-
-                //The loading of this plugin
-                //might have placed other things
-                //in the paused queue. In particular,
-                //a loader plugin that depends on
-                //a different plugin loaded resource.
-                resume();
-            };
-
-            //Allow plugins to load other code without having to know the
-            //context or how to "complete" the load.
-            load.fromText = function (moduleName, text) {
-                /*jslint evil: true */
-                var hasInteractive = useInteractive;
-
-                //Indicate a the module is in process of loading.
-                loaded[moduleName] = false;
-                context.scriptCount += 1;
-
-                //Indicate this is not a "real" module, so do not track it
-                //for builds, it does not map to a real file.
-                context.fake[moduleName] = true;
-
-                //Turn off interactive script matching for IE for any define
-                //calls in the text, then turn it back on at the end.
-                if (hasInteractive) {
-                    useInteractive = false;
-                }
-
-                req.exec(text);
-
-                if (hasInteractive) {
-                    useInteractive = true;
-                }
-
-                //Support anonymous modules.
-                context.completeLoad(moduleName);
-            };
-
-            //No need to continue if the plugin value has already been
-            //defined by a build.
-            if (fullName in defined) {
-                load(defined[fullName]);
-            } else {
-                //Use parentName here since the plugin's name is not reliable,
-                //could be some weird string with no path that actually wants to
-                //reference the parentName's path.
-                plugin.load(name, makeRequire(map.parentMap, true, function (deps, cb) {
-                    var moduleDeps = [],
-                        i, dep, depMap;
-                    //Convert deps to full names and hold on to them
-                    //for reference later, when figuring out if they
-                    //are blocked by a circular dependency.
-                    for (i = 0; (dep = deps[i]); i++) {
-                        depMap = makeModuleMap(dep, map.parentMap);
-                        deps[i] = depMap.fullName;
-                        if (!depMap.prefix) {
-                            moduleDeps.push(deps[i]);
-                        }
-                    }
-                    depManager.moduleDeps = (depManager.moduleDeps || []).concat(moduleDeps);
-                    return context.require(deps, cb);
-                }), load, config);
-            }
-        }
-
-        /**
-         * Adds the manager to the waiting queue. Only fully
-         * resolved items should be in the waiting queue.
-         */
-        function addWait(manager) {
-            if (!waiting[manager.id]) {
-                waiting[manager.id] = manager;
-                waitAry.push(manager);
-                context.waitCount += 1;
-            }
-        }
-
-        /**
-         * Function added to every manager object. Created out here
-         * to avoid new function creation for each manager instance.
-         */
-        function managerAdd(cb) {
-            this.listeners.push(cb);
-        }
-
-        function getManager(map, shouldQueue) {
-            var fullName = map.fullName,
-                prefix = map.prefix,
-                plugin = prefix ? plugins[prefix] ||
-                                (plugins[prefix] = defined[prefix]) : null,
-                manager, created, pluginManager, prefixMap;
-
-            if (fullName) {
-                manager = managerCallbacks[fullName];
-            }
-
-            if (!manager) {
-                created = true;
-                manager = {
-                    //ID is just the full name, but if it is a plugin resource
-                    //for a plugin that has not been loaded,
-                    //then add an ID counter to it.
-                    id: (prefix && !plugin ?
-                        (managerCounter++) + '__p@:' : '') +
-                        (fullName || '__r@' + (managerCounter++)),
-                    map: map,
-                    depCount: 0,
-                    depDone: [],
-                    depCallbacks: [],
-                    deps: [],
-                    listeners: [],
-                    add: managerAdd
-                };
-
-                specified[manager.id] = true;
-
-                //Only track the manager/reuse it if this is a non-plugin
-                //resource. Also only track plugin resources once
-                //the plugin has been loaded, and so the fullName is the
-                //true normalized value.
-                if (fullName && (!prefix || plugins[prefix])) {
-                    managerCallbacks[fullName] = manager;
-                }
-            }
-
-            //If there is a plugin needed, but it is not loaded,
-            //first load the plugin, then continue on.
-            if (prefix && !plugin) {
-                prefixMap = makeModuleMap(prefix);
-
-                //Clear out defined and urlFetched if the plugin was previously
-                //loaded/defined, but not as full module (as in a build
-                //situation). However, only do this work if the plugin is in
-                //defined but does not have a module export value.
-                if (prefix in defined && !defined[prefix]) {
-                    delete defined[prefix];
-                    delete urlFetched[prefixMap.url];
-                }
-
-                pluginManager = getManager(prefixMap, true);
-                pluginManager.add(function (plugin) {
-                    //Create a new manager for the normalized
-                    //resource ID and have it call this manager when
-                    //done.
-                    var newMap = makeModuleMap(map.originalName, map.parentMap),
-                        normalizedManager = getManager(newMap, true);
-
-                    //Indicate this manager is a placeholder for the real,
-                    //normalized thing. Important for when trying to map
-                    //modules and dependencies, for instance, in a build.
-                    manager.placeholder = true;
-
-                    normalizedManager.add(function (resource) {
-                        manager.callback = function () {
-                            return resource;
-                        };
-                        execManager(manager);
-                    });
-                });
-            } else if (created && shouldQueue) {
-                //Indicate the resource is not loaded yet if it is to be
-                //queued.
-                loaded[manager.id] = false;
-                queueDependency(manager);
-                addWait(manager);
-            }
-
-            return manager;
-        }
-
-        function main(inName, depArray, callback, relModuleMap) {
-            var moduleMap = makeModuleMap(inName, relModuleMap),
-                name = moduleMap.name,
-                fullName = moduleMap.fullName,
-                manager = getManager(moduleMap),
-                id = manager.id,
-                deps = manager.deps,
-                i, depArg, depName, depPrefix, cjsMod;
-
-            if (fullName) {
-                //If module already defined for context, or already loaded,
-                //then leave. Also leave if jQuery is registering but it does
-                //not match the desired version number in the config.
-                if (fullName in defined || loaded[id] === true ||
-                    (fullName === "jquery" && config.jQuery &&
-                     config.jQuery !== callback().fn.jquery)) {
-                    return;
-                }
-
-                //Set specified/loaded here for modules that are also loaded
-                //as part of a layer, where onScriptLoad is not fired
-                //for those cases. Do this after the inline define and
-                //dependency tracing is done.
-                specified[id] = true;
-                loaded[id] = true;
-
-                //If module is jQuery set up delaying its dom ready listeners.
-                if (fullName === "jquery" && callback) {
-                    jQueryCheck(callback());
-                }
-            }
-
-            //Attach real depArray and callback to the manager. Do this
-            //only if the module has not been defined already, so do this after
-            //the fullName checks above. IE can call main() more than once
-            //for a module.
-            manager.depArray = depArray;
-            manager.callback = callback;
-
-            //Add the dependencies to the deps field, and register for callbacks
-            //on the dependencies.
-            for (i = 0; i < depArray.length; i++) {
-                depArg = depArray[i];
-                //There could be cases like in IE, where a trailing comma will
-                //introduce a null dependency, so only treat a real dependency
-                //value as a dependency.
-                if (depArg) {
-                    //Split the dependency name into plugin and name parts
-                    depArg = makeModuleMap(depArg, (name ? moduleMap : relModuleMap));
-                    depName = depArg.fullName;
-                    depPrefix = depArg.prefix;
-
-                    //Fix the name in depArray to be just the name, since
-                    //that is how it will be called back later.
-                    depArray[i] = depName;
-
-                    //Fast path CommonJS standard dependencies.
-                    if (depName === "require") {
-                        deps[i] = makeRequire(moduleMap);
-                    } else if (depName === "exports") {
-                        //CommonJS module spec 1.1
-                        deps[i] = defined[fullName] = {};
-                        manager.usingExports = true;
-                    } else if (depName === "module") {
-                        //CommonJS module spec 1.1
-                        manager.cjsModule = cjsMod = deps[i] = {
-                            id: name,
-                            uri: name ? context.nameToUrl(name, null, relModuleMap) : undefined,
-                            exports: defined[fullName]
-                        };
-                    } else if (depName in defined && !(depName in waiting) &&
-                               (!(fullName in needFullExec) ||
-                                (fullName in needFullExec && fullExec[depName]))) {
-                        //Module already defined, and not in a build situation
-                        //where the module is a something that needs full
-                        //execution and this dependency has not been fully
-                        //executed. See r.js's requirePatch.js for more info
-                        //on fullExec.
-                        deps[i] = defined[depName];
-                    } else {
-                        //Mark this dependency as needing full exec if
-                        //the current module needs full exec.
-                        if (fullName in needFullExec) {
-                            needFullExec[depName] = true;
-                            //Reset state so fully executed code will get
-                            //picked up correctly.
-                            delete defined[depName];
-                            urlFetched[depArg.url] = false;
-                        }
-
-                        //Either a resource that is not loaded yet, or a plugin
-                        //resource for either a plugin that has not
-                        //loaded yet.
-                        manager.depCount += 1;
-                        manager.depCallbacks[i] = makeArgCallback(manager, i);
-                        getManager(depArg, true).add(manager.depCallbacks[i]);
-                    }
-                }
-            }
-
-            //Do not bother tracking the manager if it is all done.
-            if (!manager.depCount) {
-                //All done, execute!
-                execManager(manager);
-            } else {
-                addWait(manager);
-            }
-        }
-
-        /**
-         * Convenience method to call main for a define call that was put on
-         * hold in the defQueue.
-         */
-        function callDefMain(args) {
-            main.apply(null, args);
-        }
-
-        /**
-         * jQuery 1.4.3+ supports ways to hold off calling
-         * calling jQuery ready callbacks until all scripts are loaded. Be sure
-         * to track it if the capability exists.. Also, since jQuery 1.4.3 does
-         * not register as a module, need to do some global inference checking.
-         * Even if it does register as a module, not guaranteed to be the precise
-         * name of the global. If a jQuery is tracked for this context, then go
-         * ahead and register it as a module too, if not already in process.
-         */
-        jQueryCheck = function (jqCandidate) {
-            if (!context.jQuery) {
-                var $ = jqCandidate || (typeof jQuery !== "undefined" ? jQuery : null);
-
-                if ($) {
-                    //If a specific version of jQuery is wanted, make sure to only
-                    //use this jQuery if it matches.
-                    if (config.jQuery && $.fn.jquery !== config.jQuery) {
-                        return;
-                    }
-
-                    if ("holdReady" in $ || "readyWait" in $) {
-                        context.jQuery = $;
-
-                        //Manually create a "jquery" module entry if not one already
-                        //or in process. Note this could trigger an attempt at
-                        //a second jQuery registration, but does no harm since
-                        //the first one wins, and it is the same value anyway.
-                        callDefMain(["jquery", [], function () {
-                            return jQuery;
-                        }]);
-
-                        //Ask jQuery to hold DOM ready callbacks.
-                        if (context.scriptCount) {
-                            jQueryHoldReady($, true);
-                            context.jQueryIncremented = true;
-                        }
-                    }
-                }
-            }
-        };
-
-        function findCycle(manager, traced) {
-            var fullName = manager.map.fullName,
-                depArray = manager.depArray,
-                fullyLoaded = true,
-                i, depName, depManager, result;
-
-            if (manager.isDone || !fullName || !loaded[fullName]) {
-                return result;
-            }
-
-            //Found the cycle.
-            if (traced[fullName]) {
-                return manager;
-            }
-
-            traced[fullName] = true;
-
-            //Trace through the dependencies.
-            if (depArray) {
-                for (i = 0; i < depArray.length; i++) {
-                    //Some array members may be null, like if a trailing comma
-                    //IE, so do the explicit [i] access and check if it has a value.
-                    depName = depArray[i];
-                    if (!loaded[depName] && !reservedDependencies[depName]) {
-                        fullyLoaded = false;
-                        break;
-                    }
-                    depManager = waiting[depName];
-                    if (depManager && !depManager.isDone && loaded[depName]) {
-                        result = findCycle(depManager, traced);
-                        if (result) {
-                            break;
-                        }
-                    }
-                }
-                if (!fullyLoaded) {
-                    //Discard the cycle that was found, since it cannot
-                    //be forced yet. Also clear this module from traced.
-                    result = undefined;
-                    delete traced[fullName];
-                }
-            }
-
-            return result;
-        }
-
-        function forceExec(manager, traced) {
-            var fullName = manager.map.fullName,
-                depArray = manager.depArray,
-                i, depName, depManager, prefix, prefixManager, value;
-
-
-            if (manager.isDone || !fullName || !loaded[fullName]) {
-                return undefined;
-            }
-
-            if (fullName) {
-                if (traced[fullName]) {
-                    return defined[fullName];
-                }
-
-                traced[fullName] = true;
-            }
-
-            //Trace through the dependencies.
-            if (depArray) {
-                for (i = 0; i < depArray.length; i++) {
-                    //Some array members may be null, like if a trailing comma
-                    //IE, so do the explicit [i] access and check if it has a value.
-                    depName = depArray[i];
-                    if (depName) {
-                        //First, make sure if it is a plugin resource that the
-                        //plugin is not blocked.
-                        prefix = makeModuleMap(depName).prefix;
-                        if (prefix && (prefixManager = waiting[prefix])) {
-                            forceExec(prefixManager, traced);
-                        }
-                        depManager = waiting[depName];
-                        if (depManager && !depManager.isDone && loaded[depName]) {
-                            value = forceExec(depManager, traced);
-                            manager.depCallbacks[i](value);
-                        }
-                    }
-                }
-            }
-
-            return defined[fullName];
-        }
-
-        /**
-         * Checks if all modules for a context are loaded, and if so, evaluates the
-         * new ones in right dependency order.
-         *
-         * @private
-         */
-        function checkLoaded() {
-            var waitInterval = config.waitSeconds * 1000,
-                //It is possible to disable the wait interval by using waitSeconds of 0.
-                expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
-                noLoads = "", hasLoadedProp = false, stillLoading = false,
-                cycleDeps = [],
-                i, prop, err, manager, cycleManager, moduleDeps;
-
-            //If there are items still in the paused queue processing wait.
-            //This is particularly important in the sync case where each paused
-            //item is processed right away but there may be more waiting.
-            if (context.pausedCount > 0) {
-                return undefined;
-            }
-
-            //Determine if priority loading is done. If so clear the priority. If
-            //not, then do not check
-            if (config.priorityWait) {
-                if (isPriorityDone()) {
-                    //Call resume, since it could have
-                    //some waiting dependencies to trace.
-                    resume();
-                } else {
-                    return undefined;
-                }
-            }
-
-            //See if anything is still in flight.
-            for (prop in loaded) {
-                if (!(prop in empty)) {
-                    hasLoadedProp = true;
-                    if (!loaded[prop]) {
-                        if (expired) {
-                            noLoads += prop + " ";
-                        } else {
-                            stillLoading = true;
-                            if (prop.indexOf('!') === -1) {
-                                //No reason to keep looking for unfinished
-                                //loading. If the only stillLoading is a
-                                //plugin resource though, keep going,
-                                //because it may be that a plugin resource
-                                //is waiting on a non-plugin cycle.
-                                cycleDeps = [];
-                                break;
-                            } else {
-                                moduleDeps = managerCallbacks[prop] && managerCallbacks[prop].moduleDeps;
-                                if (moduleDeps) {
-                                    cycleDeps.push.apply(cycleDeps, moduleDeps);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-            //Check for exit conditions.
-            if (!hasLoadedProp && !context.waitCount) {
-                //If the loaded object had no items, then the rest of
-                //the work below does not need to be done.
-                return undefined;
-            }
-            if (expired && noLoads) {
-                //If wait time expired, throw error of unloaded modules.
-                err = makeError("timeout", "Load timeout for modules: " + noLoads);
-                err.requireType = "timeout";
-                err.requireModules = noLoads;
-                err.contextName = context.contextName;
-                return req.onError(err);
-            }
-
-            //If still loading but a plugin is waiting on a regular module cycle
-            //break the cycle.
-            if (stillLoading && cycleDeps.length) {
-                for (i = 0; (manager = waiting[cycleDeps[i]]); i++) {
-                    if ((cycleManager = findCycle(manager, {}))) {
-                        forceExec(cycleManager, {});
-                        break;
-                    }
-                }
-
-            }
-
-            //If still waiting on loads, and the waiting load is something
-            //other than a plugin resource, or there are still outstanding
-            //scripts, then just try back later.
-            if (!expired && (stillLoading || context.scriptCount)) {
-                //Something is still waiting to load. Wait for it, but only
-                //if a timeout is not already in effect.
-                if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
-                    checkLoadedTimeoutId = setTimeout(function () {
-                        checkLoadedTimeoutId = 0;
-                        checkLoaded();
-                    }, 50);
-                }
-                return undefined;
-            }
-
-            //If still have items in the waiting cue, but all modules have
-            //been loaded, then it means there are some circular dependencies
-            //that need to be broken.
-            //However, as a waiting thing is fired, then it can add items to
-            //the waiting cue, and those items should not be fired yet, so
-            //make sure to redo the checkLoaded call after breaking a single
-            //cycle, if nothing else loaded then this logic will pick it up
-            //again.
-            if (context.waitCount) {
-                //Cycle through the waitAry, and call items in sequence.
-                for (i = 0; (manager = waitAry[i]); i++) {
-                    forceExec(manager, {});
-                }
-
-                //If anything got placed in the paused queue, run it down.
-                if (context.paused.length) {
-                    resume();
-                }
-
-                //Only allow this recursion to a certain depth. Only
-                //triggered by errors in calling a module in which its
-                //modules waiting on it cannot finish loading, or some circular
-                //dependencies that then may add more dependencies.
-                //The value of 5 is a bit arbitrary. Hopefully just one extra
-                //pass, or two for the case of circular dependencies generating
-                //more work that gets resolved in the sync node case.
-                if (checkLoadedDepth < 5) {
-                    checkLoadedDepth += 1;
-                    checkLoaded();
-                }
-            }
-
-            checkLoadedDepth = 0;
-
-            //Check for DOM ready, and nothing is waiting across contexts.
-            req.checkReadyState();
-
-            return undefined;
-        }
-
-        /**
-         * Resumes tracing of dependencies and then checks if everything is loaded.
-         */
-        resume = function () {
-            var manager, map, url, i, p, args, fullName;
-
-            //Any defined modules in the global queue, intake them now.
-            context.takeGlobalQueue();
-
-            resumeDepth += 1;
-
-            if (context.scriptCount <= 0) {
-                //Synchronous envs will push the number below zero with the
-                //decrement above, be sure to set it back to zero for good measure.
-                //require() calls that also do not end up loading scripts could
-                //push the number negative too.
-                context.scriptCount = 0;
-            }
-
-            //Make sure any remaining defQueue items get properly processed.
-            while (defQueue.length) {
-                args = defQueue.shift();
-                if (args[0] === null) {
-                    return req.onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
-                } else {
-                    callDefMain(args);
-                }
-            }
-
-            //Skip the resume of paused dependencies
-            //if current context is in priority wait.
-            if (!config.priorityWait || isPriorityDone()) {
-                while (context.paused.length) {
-                    p = context.paused;
-                    context.pausedCount += p.length;
-                    //Reset paused list
-                    context.paused = [];
-
-                    for (i = 0; (manager = p[i]); i++) {
-                        map = manager.map;
-                        url = map.url;
-                        fullName = map.fullName;
-
-                        //If the manager is for a plugin managed resource,
-                        //ask the plugin to load it now.
-                        if (map.prefix) {
-                            callPlugin(map.prefix, manager);
-                        } else {
-                            //Regular dependency.
-                            if (!urlFetched[url] && !loaded[fullName]) {
-                                req.load(context, fullName, url);
-
-                                //Mark the URL as fetched, but only if it is
-                                //not an empty: URL, used by the optimizer.
-                                //In that case we need to be sure to call
-                                //load() for each module that is mapped to
-                                //empty: so that dependencies are satisfied
-                                //correctly.
-                                if (url.indexOf('empty:') !== 0) {
-                                    urlFetched[url] = true;
-                                }
-                            }
-                        }
-                    }
-
-                    //Move the start time for timeout forward.
-                    context.startTime = (new Date()).getTime();
-                    context.pausedCount -= p.length;
-                }
-            }
-
-            //Only check if loaded when resume depth is 1. It is likely that
-            //it is only greater than 1 in sync environments where a factory
-            //function also then calls the callback-style require. In those
-            //cases, the checkLoaded should not occur until the resume
-            //depth is back at the top level.
-            if (resumeDepth === 1) {
-                checkLoaded();
-            }
-
-            resumeDepth -= 1;
-
-            return undefined;
-        };
-
-        //Define the context object. Many of these fields are on here
-        //just to make debugging easier.
-        context = {
-            contextName: contextName,
-            config: config,
-            defQueue: defQueue,
-            waiting: waiting,
-            waitCount: 0,
-            specified: specified,
-            loaded: loaded,
-            urlMap: urlMap,
-            urlFetched: urlFetched,
-            scriptCount: 0,
-            defined: defined,
-            paused: [],
-            pausedCount: 0,
-            plugins: plugins,
-            needFullExec: needFullExec,
-            fake: {},
-            fullExec: fullExec,
-            managerCallbacks: managerCallbacks,
-            makeModuleMap: makeModuleMap,
-            normalize: normalize,
-            /**
-             * Set a configuration for the context.
-             * @param {Object} cfg config object to integrate.
-             */
-            configure: function (cfg) {
-                var paths, prop, packages, pkgs, packagePaths, requireWait;
-
-                //Make sure the baseUrl ends in a slash.
-                if (cfg.baseUrl) {
-                    if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== "/") {
-                        cfg.baseUrl += "/";
-                    }
-                }
-
-                //Save off the paths and packages since they require special processing,
-                //they are additive.
-                paths = config.paths;
-                packages = config.packages;
-                pkgs = config.pkgs;
-
-                //Mix in the config values, favoring the new values over
-                //existing ones in context.config.
-                mixin(config, cfg, true);
-
-                //Adjust paths if necessary.
-                if (cfg.paths) {
-                    for (prop in cfg.paths) {
-                        if (!(prop in empty)) {
-                            paths[prop] = cfg.paths[prop];
-                        }
-                    }
-                    config.paths = paths;
-                }
-
-                packagePaths = cfg.packagePaths;
-                if (packagePaths || cfg.packages) {
-                    //Convert packagePaths into a packages config.
-                    if (packagePaths) {
-                        for (prop in packagePaths) {
-                            if (!(prop in empty)) {
-                                configurePackageDir(pkgs, packagePaths[prop], prop);
-                            }
-                        }
-                    }
-
-                    //Adjust packages if necessary.
-                    if (cfg.packages) {
-                        configurePackageDir(pkgs, cfg.packages);
-                    }
-
-                    //Done with modifications, assing packages back to context config
-                    config.pkgs = pkgs;
-                }
-
-                //If priority loading is in effect, trigger the loads now
-                if (cfg.priority) {
-                    //Hold on to requireWait value, and reset it after done
-                    requireWait = context.requireWait;
-
-                    //Allow tracing some require calls to allow the fetching
-                    //of the priority config.
-                    context.requireWait = false;
-                    //But first, call resume to register any defined modules that may
-                    //be in a data-main built file before the priority config
-                    //call.
-                    resume();
-
-                    context.require(cfg.priority);
-
-                    //Trigger a resume right away, for the case when
-                    //the script with the priority load is done as part
-                    //of a data-main call. In that case the normal resume
-                    //call will not happen because the scriptCount will be
-                    //at 1, since the script for data-main is being processed.
-                    resume();
-
-                    //Restore previous state.
-                    context.requireWait = requireWait;
-                    config.priorityWait = cfg.priority;
-                }
-
-                //If a deps array or a config callback is specified, then call
-                //require with those args. This is useful when require is defined as a
-                //config object before require.js is loaded.
-                if (cfg.deps || cfg.callback) {
-                    context.require(cfg.deps || [], cfg.callback);
-                }
-            },
-
-            requireDefined: function (moduleName, relModuleMap) {
-                return makeModuleMap(moduleName, relModuleMap).fullName in defined;
-            },
-
-            requireSpecified: function (moduleName, relModuleMap) {
-                return makeModuleMap(moduleName, relModuleMap).fullName in specified;
-            },
-
-            require: function (deps, callback, relModuleMap) {
-                var moduleName, fullName, moduleMap;
-                if (typeof deps === "string") {
-                    if (isFunction(callback)) {
-                        //Invalid call
-                        return req.onError(makeError("requireargs", "Invalid require call"));
-                    }
-
-                    //Synchronous access to one module. If require.get is
-                    //available (as in the Node adapter), prefer that.
-                    //In this case deps is the moduleName and callback is
-                    //the relModuleMap
-                    if (req.get) {
-                        return req.get(context, deps, callback);
-                    }
-
-                    //Just return the module wanted. In this scenario, the
-                    //second arg (if passed) is just the relModuleMap.
-                    moduleName = deps;
-                    relModuleMap = callback;
-
-                    //Normalize module name, if it contains . or ..
-                    moduleMap = makeModuleMap(moduleName, relModuleMap);
-                    fullName = moduleMap.fullName;
-
-                    if (!(fullName in defined)) {
-                        return req.onError(makeError("notloaded", "Module name '" +
-                                    moduleMap.fullName +
-                                    "' has not been loaded yet for context: " +
-                                    contextName));
-                    }
-                    return defined[fullName];
-                }
-
-                //Call main but only if there are dependencies or
-                //a callback to call.
-                if (deps && deps.length || callback) {
-                    main(null, deps, callback, relModuleMap);
-                }
-
-                //If the require call does not trigger anything new to load,
-                //then resume the dependency processing.
-                if (!context.requireWait) {
-                    while (!context.scriptCount && context.paused.length) {
-                        resume();
-                    }
-                }
-                return context.require;
-            },
-
-            /**
-             * Internal method to transfer globalQueue items to this context's
-             * defQueue.
-             */
-            takeGlobalQueue: function () {
-                //Push all the globalDefQueue items into the context's defQueue
-                if (globalDefQueue.length) {
-                    //Array splice in the values since the context code has a
-                    //local var ref to defQueue, so cannot just reassign the one
-                    //on context.
-                    apsp.apply(context.defQueue,
-                               [context.defQueue.length - 1, 0].concat(globalDefQueue));
-                    globalDefQueue = [];
-                }
-            },
-
-            /**
-             * Internal method used by environment adapters to complete a load event.
-             * A load event could be a script load or just a load pass from a synchronous
-             * load call.
-             * @param {String} moduleName the name of the module to potentially complete.
-             */
-            completeLoad: function (moduleName) {
-                var args;
-
-                context.takeGlobalQueue();
-
-                while (defQueue.length) {
-                    args = defQueue.shift();
-
-                    if (args[0] === null) {
-                        args[0] = moduleName;
-                        break;
-                    } else if (args[0] === moduleName) {
-                        //Found matching define call for this script!
-                        break;
-                    } else {
-                        //Some other named define call, most likely the result
-                        //of a build layer that included many define calls.
-                        callDefMain(args);
-                        args = null;
-                    }
-                }
-                if (args) {
-                    callDefMain(args);
-                } else {
-                    //A script that does not call define(), so just simulate
-                    //the call for it. Special exception for jQuery dynamic load.
-                    callDefMain([moduleName, [],
-                                moduleName === "jquery" && typeof jQuery !== "undefined" ?
-                                function () {
-                                    return jQuery;
-                                } : null]);
-                }
-
-                //Doing this scriptCount decrement branching because sync envs
-                //need to decrement after resume, otherwise it looks like
-                //loading is complete after the first dependency is fetched.
-                //For browsers, it works fine to decrement after, but it means
-                //the checkLoaded setTimeout 50 ms cost is taken. To avoid
-                //that cost, decrement beforehand.
-                if (req.isAsync) {
-                    context.scriptCount -= 1;
-                }
-                resume();
-                if (!req.isAsync) {
-                    context.scriptCount -= 1;
-                }
-            },
-
-            /**
-             * Converts a module name + .extension into an URL path.
-             * *Requires* the use of a module name. It does not support using
-             * plain URLs like nameToUrl.
-             */
-            toUrl: function (moduleNamePlusExt, relModuleMap) {
-                var index = moduleNamePlusExt.lastIndexOf("."),
-                    ext = null;
-
-                if (index !== -1) {
-                    ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
-                    moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
-                }
-
-                return context.nameToUrl(moduleNamePlusExt, ext, relModuleMap);
-            },
-
-            /**
-             * Converts a module name to a file path. Supports cases where
-             * moduleName may actually be just an URL.
-             */
-            nameToUrl: function (moduleName, ext, relModuleMap) {
-                var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
-                    config = context.config;
-
-                //Normalize module name if have a base relative module name to work from.
-                moduleName = normalize(moduleName, relModuleMap && relModuleMap.fullName);
-
-                //If a colon is in the URL, it indicates a protocol is used and it is just
-                //an URL to a file, or if it starts with a slash or ends with .js, it is just a plain file.
-                //The slash is important for protocol-less URLs as well as full paths.
-                if (req.jsExtRegExp.test(moduleName)) {
-                    //Just a plain path, not module name lookup, so just return it.
-                    //Add extension if it is included. This is a bit wonky, only non-.js things pass
-                    //an extension, this method probably needs to be reworked.
-                    url = moduleName + (ext ? ext : "");
-                } else {
-                    //A module that needs to be converted to a path.
-                    paths = config.paths;
-                    pkgs = config.pkgs;
-
-                    syms = moduleName.split("/");
-                    //For each module name segment, see if there is a path
-                    //registered for it. Start with most specific name
-                    //and work up from it.
-                    for (i = syms.length; i > 0; i--) {
-                        parentModule = syms.slice(0, i).join("/");
-                        if (paths[parentModule]) {
-                            syms.splice(0, i, paths[parentModule]);
-                            break;
-                        } else if ((pkg = pkgs[parentModule])) {
-                            //If module name is just the package name, then looking
-                            //for the main module.
-                            if (moduleName === pkg.name) {
-                                pkgPath = pkg.location + '/' + pkg.main;
-                            } else {
-                                pkgPath = pkg.location;
-                            }
-                            syms.splice(0, i, pkgPath);
-                            break;
-                        }
-                    }
-
-                    //Join the path parts together, then figure out if baseUrl is needed.
-                    url = syms.join("/") + (ext || ".js");
-                    url = (url.charAt(0) === '/' || url.match(/^\w+:/) ? "" : config.baseUrl) + url;
-                }
-
-                return config.urlArgs ? url +
-                                        ((url.indexOf('?') === -1 ? '?' : '&') +
-                                         config.urlArgs) : url;
-            }
-        };
-
-        //Make these visible on the context so can be called at the very
-        //end of the file to bootstrap
-        context.jQueryCheck = jQueryCheck;
-        context.resume = resume;
-
-        return context;
-    }
-
-    /**
-     * Main entry point.
-     *
-     * If the only argument to require is a string, then the module that
-     * is represented by that string is fetched for the appropriate context.
-     *
-     * If the first argument is an array, then it will be treated as an array
-     * of dependency string names to fetch. An optional function callback can
-     * be specified to execute when all of those dependencies are available.
-     *
-     * Make a local req variable to help Caja compliance (it assumes things
-     * on a require that are not standardized), and to give a short
-     * name for minification/local scope use.
-     */
-    req = requirejs = function (deps, callback) {
-
-        //Find the right context, use default
-        var contextName = defContextName,
-            context, config;
-
-        // Determine if have config object in the call.
-        if (!isArray(deps) && typeof deps !== "string") {
-            // deps is a config object
-            config = deps;
-            if (isArray(callback)) {
-                // Adjust args if there are dependencies
-                deps = callback;
-                callback = arguments[2];
-            } else {
-                deps = [];
-            }
-        }
-
-        if (config && config.context) {
-            contextName = config.context;
-        }
-
-        context = contexts[contextName] ||
-                  (contexts[contextName] = newContext(contextName));
-
-        if (config) {
-            context.configure(config);
-        }
-
-        return context.require(deps, callback);
-    };
-
-    /**
-     * Support require.config() to make it easier to cooperate with other
-     * AMD loaders on globally agreed names.
-     */
-    req.config = function (config) {
-        return req(config);
-    };
-
-    /**
-     * Export require as a global, but only if it does not already exist.
-     */
-    if (!require) {
-        require = req;
-    }
-
-    /**
-     * Global require.toUrl(), to match global require, mostly useful
-     * for debugging/work in the global space.
-     */
-    req.toUrl = function (moduleNamePlusExt) {
-        return contexts[defContextName].toUrl(moduleNamePlusExt);
-    };
-
-    req.version = version;
-
-    //Used to filter out dependencies that are already paths.
-    req.jsExtRegExp = /^\/|:|\?|\.js$/;
-    s = req.s = {
-        contexts: contexts,
-        //Stores a list of URLs that should not get async script tag treatment.
-        skipAsync: {}
-    };
-
-    req.isAsync = req.isBrowser = isBrowser;
-    if (isBrowser) {
-        head = s.head = document.getElementsByTagName("head")[0];
-        //If BASE tag is in play, using appendChild is a problem for IE6.
-        //When that browser dies, this can be removed. Details in this jQuery bug:
-        //http://dev.jquery.com/ticket/2709
-        baseElement = document.getElementsByTagName("base")[0];
-        if (baseElement) {
-            head = s.head = baseElement.parentNode;
-        }
-    }
-
-    /**
-     * Any errors that require explicitly generates will be passed to this
-     * function. Intercept/override it if you want custom error handling.
-     * @param {Error} err the error object.
-     */
-    req.onError = function (err) {
-        throw err;
-    };
-
-    /**
-     * Does the request to load a module for the browser case.
-     * Make this a separate function to allow other environments
-     * to override it.
-     *
-     * @param {Object} context the require context to find state.
-     * @param {String} moduleName the name of the module.
-     * @param {Object} url the URL to the module.
-     */
-    req.load = function (context, moduleName, url) {
-        req.resourcesReady(false);
-
-        context.scriptCount += 1;
-        req.attach(url, context, moduleName);
-
-        //If tracking a jQuery, then make sure its ready callbacks
-        //are put on hold to prevent its ready callbacks from
-        //triggering too soon.
-        if (context.jQuery && !context.jQueryIncremented) {
-            jQueryHoldReady(context.jQuery, true);
-            context.jQueryIncremented = true;
-        }
-    };
-
-    function getInteractiveScript() {
-        var scripts, i, script;
-        if (interactiveScript && interactiveScript.readyState === 'interactive') {
-            return interactiveScript;
-        }
-
-        scripts = document.getElementsByTagName('script');
-        for (i = scripts.length - 1; i > -1 && (script = scripts[i]); i--) {
-            if (script.readyState === 'interactive') {
-                return (interactiveScript = script);
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * The function that handles definitions of modules. Differs from
-     * require() in that a string for the module should be the first argument,
-     * and the function to execute after dependencies are loaded should
-     * return a value to define the module corresponding to the first argument's
-     * name.
-     */
-    define = function (name, deps, callback) {
-        var node, context;
-
-        //Allow for anonymous functions
-        if (typeof name !== 'string') {
-            //Adjust args appropriately
-            callback = deps;
-            deps = name;
-            name = null;
-        }
-
-        //This module may not have dependencies
-        if (!isArray(deps)) {
-            callback = deps;
-            deps = [];
-        }
-
-        //If no name, and callback is a function, then figure out if it a
-        //CommonJS thing with dependencies.
-        if (!deps.length && isFunction(callback)) {
-            //Remove comments from the callback string,
-            //look for require calls, and pull them into the dependencies,
-            //but only if there are function args.
-            if (callback.length) {
-                callback
-                    .toString()
-                    .replace(commentRegExp, "")
-                    .replace(cjsRequireRegExp, function (match, dep) {
-                        deps.push(dep);
-                    });
-
-                //May be a CommonJS thing even without require calls, but still
-                //could use exports, and module. Avoid doing exports and module
-                //work though if it just needs require.
-                //REQUIRES the function to expect the CommonJS variables in the
-                //order listed below.
-                deps = (callback.length === 1 ? ["require"] : ["require", "exports", "module"]).concat(deps);
-            }
-        }
-
-        //If in IE 6-8 and hit an anonymous define() call, do the interactive
-        //work.
-        if (useInteractive) {
-            node = currentlyAddingScript || getInteractiveScript();
-            if (node) {
-                if (!name) {
-                    name = node.getAttribute("data-requiremodule");
-                }
-                context = contexts[node.getAttribute("data-requirecontext")];
-            }
-        }
-
-        //Always save off evaluating the def call until the script onload handler.
-        //This allows multiple modules to be in a file without prematurely
-        //tracing dependencies, and allows for anonymous module support,
-        //where the module name is not known until the script onload event
-        //occurs. If no context, use the global queue, and get it processed
-        //in the onscript load callback.
-        (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
-
-        return undefined;
-    };
-
-    define.amd = {
-        multiversion: true,
-        plugins: true,
-        jQuery: true
-    };
-
-    /**
-     * Executes the text. Normally just uses eval, but can be modified
-     * to use a more environment specific call.
-     * @param {String} text the text to execute/evaluate.
-     */
-    req.exec = function (text) {
-        return eval(text);
-    };
-
-    /**
-     * Executes a module callack function. Broken out as a separate function
-     * solely to allow the build system to sequence the files in the built
-     * layer in the right sequence.
-     *
-     * @private
-     */
-    req.execCb = function (name, callback, args, exports) {
-        return callback.apply(exports, args);
-    };
-
-
-    /**
-     * Adds a node to the DOM. Public function since used by the order plugin.
-     * This method should not normally be called by outside code.
-     */
-    req.addScriptToDom = function (node) {
-        //For some cache cases in IE 6-8, the script executes before the end
-        //of the appendChild execution, so to tie an anonymous define
-        //call to the module name (which is stored on the node), hold on
-        //to a reference to this node, but clear after the DOM insertion.
-        currentlyAddingScript = node;
-        if (baseElement) {
-            head.insertBefore(node, baseElement);
-        } else {
-            head.appendChild(node);
-        }
-        currentlyAddingScript = null;
-    };
-
-    /**
-     * callback for script loads, used to check status of loading.
-     *
-     * @param {Event} evt the event from the browser for the script
-     * that was loaded.
-     *
-     * @private
-     */
-    req.onScriptLoad = function (evt) {
-        //Using currentTarget instead of target for Firefox 2.0's sake. Not
-        //all old browsers will be supported, but this one was easy enough
-        //to support and still makes sense.
-        var node = evt.currentTarget || evt.srcElement, contextName, moduleName,
-            context;
-
-        if (evt.type === "load" || (node && readyRegExp.test(node.readyState))) {
-            //Reset interactive script so a script node is not held onto for
-            //to long.
-            interactiveScript = null;
-
-            //Pull out the name of the module and the context.
-            contextName = node.getAttribute("data-requirecontext");
-            moduleName = node.getAttribute("data-requiremodule");
-            context = contexts[contextName];
-
-            contexts[contextName].completeLoad(moduleName);
-
-            //Clean up script binding. Favor detachEvent because of IE9
-            //issue, see attachEvent/addEventListener comment elsewhere
-            //in this file.
-            if (node.detachEvent && !isOpera) {
-                //Probably IE. If not it will throw an error, which will be
-                //useful to know.
-                node.detachEvent("onreadystatechange", req.onScriptLoad);
-            } else {
-                node.removeEventListener("load", req.onScriptLoad, false);
-            }
-        }
-    };
-
-    /**
-     * Attaches the script represented by the URL to the current
-     * environment. Right now only supports browser loading,
-     * but can be redefined in other environments to do the right thing.
-     * @param {String} url the url of the script to attach.
-     * @param {Object} context the context that wants the script.
-     * @param {moduleName} the name of the module that is associated with the script.
-     * @param {Function} [callback] optional callback, defaults to require.onScriptLoad
-     * @param {String} [type] optional type, defaults to text/javascript
-     * @param {Function} [fetchOnlyFunction] optional function to indicate the script node
-     * should be set up to fetch the script but do not attach it to the DOM
-     * so that it can later be attached to execute it. This is a way for the
-     * order plugin to support ordered loading in IE. Once the script is fetched,
-     * but not executed, the fetchOnlyFunction will be called.
-     */
-    req.attach = function (url, context, moduleName, callback, type, fetchOnlyFunction) {
-        var node;
-        if (isBrowser) {
-            //In the browser so use a script tag
-            callback = callback || req.onScriptLoad;
-            node = context && context.config && context.config.xhtml ?
-                    document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") :
-                    document.createElement("script");
-            node.type = type || (context && context.config.scriptType) ||
-                        "text/javascript";
-            node.charset = "utf-8";
-            //Use async so Gecko does not block on executing the script if something
-            //like a long-polling comet tag is being run first. Gecko likes
-            //to evaluate scripts in DOM order, even for dynamic scripts.
-            //It will fetch them async, but only evaluate the contents in DOM
-            //order, so a long-polling script tag can delay execution of scripts
-            //after it. But telling Gecko we expect async gets us the behavior
-            //we want -- execute it whenever it is finished downloading. Only
-            //Helps Firefox 3.6+
-            //Allow some URLs to not be fetched async. Mostly helps the order!
-            //plugin
-            node.async = !s.skipAsync[url];
-
-            if (context) {
-                node.setAttribute("data-requirecontext", context.contextName);
-            }
-            node.setAttribute("data-requiremodule", moduleName);
-
-            //Set up load listener. Test attachEvent first because IE9 has
-            //a subtle issue in its addEventListener and script onload firings
-            //that do not match the behavior of all other browsers with
-            //addEventListener support, which fire the onload event for a
-            //script right after the script execution. See:
-            //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
-            //UNFORTUNATELY Opera implements attachEvent but does not follow the script
-            //script execution mode.
-            if (node.attachEvent && !isOpera) {
-                //Probably IE. IE (at least 6-8) do not fire
-                //script onload right after executing the script, so
-                //we cannot tie the anonymous define call to a name.
-                //However, IE reports the script as being in "interactive"
-                //readyState at the time of the define call.
-                useInteractive = true;
-
-
-                if (fetchOnlyFunction) {
-                    //Need to use old school onreadystate here since
-                    //when the event fires and the node is not attached
-                    //to the DOM, the evt.srcElement is null, so use
-                    //a closure to remember the node.
-                    node.onreadystatechange = function (evt) {
-                        //Script loaded but not executed.
-                        //Clear loaded handler, set the real one that
-                        //waits for script execution.
-                        if (node.readyState === 'loaded') {
-                            node.onreadystatechange = null;
-                            node.attachEvent("onreadystatechange", callback);
-                            fetchOnlyFunction(node);
-                        }
-                    };
-                } else {
-                    node.attachEvent("onreadystatechange", callback);
-                }
-            } else {
-                node.addEventListener("load", callback, false);
-            }
-            node.src = url;
-
-            //Fetch only means waiting to attach to DOM after loaded.
-            if (!fetchOnlyFunction) {
-                req.addScriptToDom(node);
-            }
-
-            return node;
-        } else if (isWebWorker) {
-            //In a web worker, use importScripts. This is not a very
-            //efficient use of importScripts, importScripts will block until
-            //its script is downloaded and evaluated. However, if web workers
-            //are in play, the expectation that a build has been done so that
-            //only one script needs to be loaded anyway. This may need to be
-            //reevaluated if other use cases become common.
-            importScripts(url);
-
-            //Account for anonymous modules
-            context.completeLoad(moduleName);
-        }
-        return null;
-    };
-
-    //Look for a data-main script attribute, which could also adjust the baseUrl.
-    if (isBrowser) {
-        //Figure out baseUrl. Get it from the script tag with require.js in it.
-        scripts = document.getElementsByTagName("script");
-
-        for (globalI = scripts.length - 1; globalI > -1 && (script = scripts[globalI]); globalI--) {
-            //Set the "head" where we can append children by
-            //using the script's parent.
-            if (!head) {
-                head = script.parentNode;
-            }
-
-            //Look for a data-main attribute to set main script for the page
-            //to load. If it is there, the path to data main becomes the
-            //baseUrl, if it is not already set.
-            if ((dataMain = script.getAttribute('data-main'))) {
-                if (!cfg.baseUrl) {
-                    //Pull off the directory of data-main for use as the
-                    //baseUrl.
-                    src = dataMain.split('/');
-                    mainScript = src.pop();
-                    subPath = src.length ? src.join('/')  + '/' : './';
-
-                    //Set final config.
-                    cfg.baseUrl = subPath;
-                    //Strip off any trailing .js since dataMain is now
-                    //like a module name.
-                    dataMain = mainScript.replace(jsSuffixRegExp, '');
-                }
-
-                //Put the data-main script in the files to load.
-                cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain];
-
-                break;
-            }
-        }
-    }
-
-    //See if there is nothing waiting across contexts, and if not, trigger
-    //resourcesReady.
-    req.checkReadyState = function () {
-        var contexts = s.contexts, prop;
-        for (prop in contexts) {
-            if (!(prop in empty)) {
-                if (contexts[prop].waitCount) {
-                    return;
-                }
-            }
-        }
-        req.resourcesReady(true);
-    };
-
-    /**
-     * Internal function that is triggered whenever all scripts/resources
-     * have been loaded by the loader. Can be overridden by other, for
-     * instance the domReady plugin, which wants to know when all resources
-     * are loaded.
-     */
-    req.resourcesReady = function (isReady) {
-        var contexts, context, prop;
-
-        //First, set the public variable indicating that resources are loading.
-        req.resourcesDone = isReady;
-
-        if (req.resourcesDone) {
-            //If jQuery with DOM ready delayed, release it now.
-            contexts = s.contexts;
-            for (prop in contexts) {
-                if (!(prop in empty)) {
-                    context = contexts[prop];
-                    if (context.jQueryIncremented) {
-                        jQueryHoldReady(context.jQuery, false);
-                        context.jQueryIncremented = false;
-                    }
-                }
-            }
-        }
-    };
-
-    //FF < 3.6 readyState fix. Needed so that domReady plugin
-    //works well in that environment, since require.js is normally
-    //loaded via an HTML script tag so it will be there before window load,
-    //where the domReady plugin is more likely to be loaded after window load.
-    req.pageLoaded = function () {
-        if (document.readyState !== "complete") {
-            document.readyState = "complete";
-        }
-    };
-    if (isBrowser) {
-        if (document.addEventListener) {
-            if (!document.readyState) {
-                document.readyState = "loading";
-                window.addEventListener("load", req.pageLoaded, false);
-            }
-        }
-    }
-
-    //Set up default context. If require was a configuration object, use that as base config.
-    req(cfg);
-
-    //If modules are built into require.js, then need to make sure dependencies are
-    //traced. Use a setTimeout in the browser world, to allow all the modules to register
-    //themselves. In a non-browser env, assume that modules are not built into require.js,
-    //which seems odd to do on the server.
-    if (req.isAsync && typeof setTimeout !== "undefined") {
-        ctx = s.contexts[(cfg.context || defContextName)];
-        //Indicate that the script that includes require() is still loading,
-        //so that require()'d dependencies are not traced until the end of the
-        //file is parsed (approximated via the setTimeout call).
-        ctx.requireWait = true;
-        setTimeout(function () {
-            ctx.requireWait = false;
-
-            if (!ctx.scriptCount) {
-                ctx.resume();
-            }
-            req.checkReadyState();
-        }, 0);
-    }
-}());
-/*!
- * jQuery JavaScript Library v1.7.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: Mon Nov 21 21:11:03 2011 -0500
- */
-(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 '

<TRUNCATED>

[17/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/libs/jquery-1.7.2.min.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/libs/jquery-1.7.2.min.js b/solr/webapp/web/libs/jquery-1.7.2.min.js
new file mode 100644
index 0000000..90165e9
--- /dev/null
+++ b/solr/webapp/web/libs/jquery-1.7.2.min.js
@@ -0,0 +1,30 @@
+/*!
+
+Copyright 2014 jQuery Foundation and other contributors
+http://jquery.com/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+
+/*! jQuery v1.7.2 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;
 g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);e
 lse d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d
 =parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaul
 tSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typ
 eof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c
 =a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;r
 eturn this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==nu
 ll?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),t
 ypeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready
 );var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:functio
 n(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[
 ];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f
 .concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date 
 RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],
 e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);re
 turn this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f
 .isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.va
 lue==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecke
 d=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="no
 ne",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position=
 "relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[
 n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(
 j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f
 ._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=th
 is,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof
  a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeCla
 ss"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a
 .attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);r
 eturn}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowsp
 an:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b}
 ,set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["r
 adio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
+a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.gui
 d,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remov
 e.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=
 f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.na
 mespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attr
 Name relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.prop
 s?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.
 type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.
 type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("ch
 ange",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e=
 =null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:funct
 ion(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.tes
 t(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,
 l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[
 t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFi
 lter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]
 |\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode=
 ==b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG
 :function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.
 parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a)
 {var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nod
 eType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p
 =o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,
 e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElemen
 t("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]
 );if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}
 }(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.select
 ors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.c
 ontext).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({p
 arent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P
 .call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^
 \s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChi
 ld;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
+.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;
 if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(functi
 on(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h))
 ,e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.
 createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;
 i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",vi
 sibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f
 .cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f
 ===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.su
 pport.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:f
 unction(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.e
 ach("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},
 ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if
 (!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.
 toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d
 .async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.json
 p!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||
 /loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{i
 f(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.
 css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark
 (this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"
 ),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{
 opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.

<TRUNCATED>

[48/50] [abbrv] lucene-solr:jira/solr-10233: Ref Guide: add auth section for SOLR-8440

Posted by tf...@apache.org.
Ref Guide: add auth section for SOLR-8440


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/606b3bfc
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/606b3bfc
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/606b3bfc

Branch: refs/heads/jira/solr-10233
Commit: 606b3bfc62b5b47903d21dac7e0609b6f0aeb6f1
Parents: 33e1c71
Author: Cassandra Targett <ca...@lucidworks.com>
Authored: Thu May 18 15:10:36 2017 -0500
Committer: Cassandra Targett <ca...@lucidworks.com>
Committed: Thu May 18 15:10:36 2017 -0500

----------------------------------------------------------------------
 .../src/solr-control-script-reference.adoc      | 91 ++++++++++++++++++--
 1 file changed, 86 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/606b3bfc/solr/solr-ref-guide/src/solr-control-script-reference.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/solr-control-script-reference.adoc b/solr/solr-ref-guide/src/solr-control-script-reference.adoc
index 3d5a7f7..1c94a8b 100644
--- a/solr/solr-ref-guide/src/solr-control-script-reference.adoc
+++ b/solr/solr-ref-guide/src/solr-control-script-reference.adoc
@@ -391,20 +391,101 @@ If running in SolrCloud mode, the delete command checks if the configuration dir
 |===
 |Parameter |Description |Example
 |-c <name> |Name of the core / collection to delete (required). |`bin/solr delete -c mycoll`
-|-deleteConfig <true|false> a|
+|-deleteConfig <true\|false> a|
 Delete the configuration directory from ZooKeeper. The default is true.
 
 If the configuration directory is being used by another collection, then it will not be deleted even if you pass `-deleteConfig` as true.
-
- |`bin/solr delete -deleteConfig false`
+|`bin/solr delete -deleteConfig false`
 |-p <port> a|
 The port of a local Solr instance to send the delete command to. By default the script tries to detect the port by looking for running Solr instances.
 
 This option is useful if you are running multiple standalone Solr instances on the same host, thus requiring you to be specific about which instance to delete the core from.
-
- |`bin/solr delete -p 8983`
+|`bin/solr delete -p 8983`
 |===
 
+== Authentication
+
+// TODO 6.6 check this whole section for accuracy
+
+The `bin/solr` script allows enabling or disabling Basic Authentication, allowing you to configure authentication from the command line.
+
+Currently, this script only enables Basic Authentication.
+
+=== Enabling Basic Authentication
+
+The command `bin/solr auth enable` configures Solr to use Basic Authentication when accessing the User Interface, using `bin/solr` and any API requests.
+
+TIP: For more information about Solr's authentication plugins, see the section <<securing-solr.adoc#securing-solr,Securing Solr>>. For more information on Basic Authentication support specifically, see the section  <<basic-authentication-plugin.adoc#basic-authentication-plugin,Basic Authentication Plugin>>.
+
+The `bin/solr auth enable` command makes several changes to enable Basic Authentication:
+
+* Creates a `security.json` file and, if using SolrCloud, uploads it to ZooKeeper. The `security.json` file will look similar to:
++
+[source,json]
+----
+{
+  "authentication":{
+   "blockUnknown": false,
+   "class":"solr.BasicAuthPlugin",
+   "credentials":{"user":"vgGVo69YJeUg/O6AcFiowWsdyOUdqfQvOLsrpIPMCzk= 7iTnaKOWe+Uj5ZfGoKKK2G6hrcF10h6xezMQK+LBvpI="}
+  },
+  "authorization":{
+   "class":"solr.RuleBasedAuthorizationPlugin",
+   "permissions":[
+ {"name":"security-edit", "role":"admin"},
+ {"name":"collection-admin-edit", "role":"admin"},
+ {"name":"core-admin-edit", "role":"admin"}
+   ],
+   "user-role":{"user":"admin"}
+  }
+}
+----
+* Adds two lines to `bin/solr.in.sh` or `bin\solr.in.cmd` to set the authentication type, and the path to `basicAuth.conf`:
++
+[source]
+----
+# The following lines added by ./solr for enabling BasicAuth
+SOLR_AUTH_TYPE="basic"
+SOLR_AUTHENTICATION_OPTS="-Dsolr.httpclient.config=/path/to/solr-6.6.0/server/solr/basicAuth.conf"
+----
+* Creates the file `server/solr/basicAuth.conf` to store the credential information that is used with `bin/solr` commands.
+
+The command takes the following parameters:
+
+`-credentials`::
+The username and password in the format of `username:password` of the initial user.
++
+If you prefer not to pass the username and password as an argument to the script, you can choose the `-prompt` option. Either `-credentials` or `-prompt` *must* be specified.
+
+`-prompt`::
+If prompt is preferred, pass *true* as a parameter to request the script to prompt the user to enter a username and password.
++
+Either `-credentials` or `-prompt` *must* be specified.
+
+`-blockUnknown`::
+When *true*, blocks all unauthenticated users from accessing Solr. This defaults to *false*, which means unauthenticated users will still be able to access Solr.
+
+`-updateIncludeFileOnly`::
+When *true*, only the settings in `bin/solr.in.sh` or `bin\solr.in.cmd` will be updated, and `security.json` will not be created.
+
+// TODO 6.6 clarify when this is required
+`-z`::
+Defines the ZooKeeper connect string.
+
+`-d`::
+Defines the Solr server directory, by default `$SOLR_HOME/server`. It is not common to need to override the default.
+
+`-s`::
+Defines the location of `solr.solr.home`, which by default is `server/solr`. If you have multiple instances of Solr on the same host, you likely need to define this.
+
+=== Disabling Basic Authentication
+
+You can disable Basic Authentication with `bin/solr auth disable`.
+
+If the `-updateIncludeFileOnly` option is set to *true*, then only the settings in `bin/solr.in.sh` or `bin\solr.in.cmd` will be updated, and `security.json` will not be removed.
+
+If the `-updateIncludeFileOnly` option is set to *false*, then the settings in `bin/solr.in.sh` or `bin\solr.in.cmd` will be updated, and `security.json` will be removed. However, the `basicAuth.conf` file is not removed with either option.
+
 [[SolrControlScriptReference-ZooKeeperOperations]]
 == ZooKeeper Operations
 


[45/50] [abbrv] lucene-solr:jira/solr-10233: Ref Guide: typos from conversion

Posted by tf...@apache.org.
Ref Guide: typos from conversion


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b77a0a5a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b77a0a5a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b77a0a5a

Branch: refs/heads/jira/solr-10233
Commit: b77a0a5ad51260e62a67fc2a5c239742863149d0
Parents: a786f2e
Author: Cassandra Targett <ca...@lucidworks.com>
Authored: Thu May 18 13:15:36 2017 -0500
Committer: Cassandra Targett <ca...@lucidworks.com>
Committed: Thu May 18 13:15:36 2017 -0500

----------------------------------------------------------------------
 solr/solr-ref-guide/src/the-terms-component.adoc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b77a0a5a/solr/solr-ref-guide/src/the-terms-component.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/the-terms-component.adoc b/solr/solr-ref-guide/src/the-terms-component.adoc
index 1625be2..f93bd66 100644
--- a/solr/solr-ref-guide/src/the-terms-component.adoc
+++ b/solr/solr-ref-guide/src/the-terms-component.adoc
@@ -53,7 +53,7 @@ Specifies the field from which to retrieve terms.
 Example: `terms.fl=title`
 
 |terms.list |No |null a|
-Fetches the document frequency for a comma delimited list of terms. Terms are always returned in index order. If '`terms.ttf`' is set to true, also returns their total term frequency. If multiple '`terms.fl`' are defined, these statistics will be returned for each term in each requested field.
+Fetches the document frequency for a comma delimited list of terms. Terms are always returned in index order. If `terms.ttf` is set to true, also returns their total term frequency. If multiple `terms.fl` are defined, these statistics will be returned for each term in each requested field.
 
 Example: `terms.list=termA,termB,termC`
 
@@ -113,12 +113,12 @@ Example: `terms.regex.flag=case_insensitive`
 
 |terms.stats |No |null |Include index statistics in the results. Currently returns only the *numDocs* for a collection. When combined with terms.list it provides enough information to compute idf for a list of terms.
 |terms.sort |No |count a|
-Defines how to sort the terms returned. Valid options are **count**, which sorts by the term frequency, with the highest term frequency first, or **index**, which sorts in index order.
+Defines how to sort the terms returned. Valid options are *count*, which sorts by the term frequency, with the highest term frequency first, or *index*, which sorts in index order.
 
 Example: `terms.sort=index`
 
 |terms.ttf |No |false a|
-If set to true, returns both 'df' (docFreq) and 'ttf' (totalTermFreq) statistics for each requested term in '`terms.list`'. In this case, the response format is:
+If set to true, returns both `df` (docFreq) and `ttf` (totalTermFreq) statistics for each requested term in `terms.list`. In this case, the response format is:
 
 [source,xml]
 ----


[05/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7831: CodecUtil should not seek to negative offsets.

Posted by tf...@apache.org.
LUCENE-7831: CodecUtil should not seek to negative offsets.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9e1fcb0e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9e1fcb0e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9e1fcb0e

Branch: refs/heads/jira/solr-10233
Commit: 9e1fcb0eb47637082d15700a92e52f0b1c155bc7
Parents: 8516783
Author: Adrien Grand <jp...@gmail.com>
Authored: Tue May 16 18:31:57 2017 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Tue May 16 18:31:57 2017 +0200

----------------------------------------------------------------------
 lucene/CHANGES.txt                                     |  5 ++++-
 .../src/java/org/apache/lucene/codecs/CodecUtil.java   |  6 ++++++
 .../test/org/apache/lucene/codecs/TestCodecUtil.java   | 13 +++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9e1fcb0e/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index bbdc7bd..ce6ba67 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -93,7 +93,10 @@ Other
   (Daniel Jelinski via Adrien Grand)
 
 ======================= Lucene 6.7.0 =======================
-(No Changes)
+
+Bug Fixes
+
+* LUCENE-7831: CodecUtil should not seek to negative offsets. (Adrien Grand)
 
 ======================= Lucene 6.6.0 =======================
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9e1fcb0e/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java b/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java
index a625b47..c49946b 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java
@@ -331,6 +331,9 @@ public final class CodecUtil {
   /** Retrieves the full footer from the provided {@link IndexInput}.  This throws
    *  {@link CorruptIndexException} if this file does not have a valid footer. */
   public static byte[] readFooter(IndexInput in) throws IOException {
+    if (in.length() < footerLength()) {
+      throw new CorruptIndexException("misplaced codec footer (file truncated?): length=" + in.length() + " but footerLength==" + footerLength(), in);
+    }
     in.seek(in.length() - footerLength());
     validateFooter(in);
     in.seek(in.length() - footerLength());
@@ -516,6 +519,9 @@ public final class CodecUtil {
     clone.seek(0);
     ChecksumIndexInput in = new BufferedChecksumIndexInput(clone);
     assert in.getFilePointer() == 0;
+    if (in.length() < footerLength()) {
+      throw new CorruptIndexException("misplaced codec footer (file truncated?): length=" + in.length() + " but footerLength==" + footerLength(), input);
+    }
     in.seek(in.length() - footerLength());
     return checkFooter(in);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9e1fcb0e/lucene/core/src/test/org/apache/lucene/codecs/TestCodecUtil.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/codecs/TestCodecUtil.java b/lucene/core/src/test/org/apache/lucene/codecs/TestCodecUtil.java
index d403f81..0ff7f7c 100644
--- a/lucene/core/src/test/org/apache/lucene/codecs/TestCodecUtil.java
+++ b/lucene/core/src/test/org/apache/lucene/codecs/TestCodecUtil.java
@@ -303,4 +303,17 @@ public class TestCodecUtil extends LuceneTestCase {
     fakeChecksum.set((1L << 32) - 1); // ok
     CodecUtil.writeCRC(fakeOutput);
   }
+
+  public void testTruncatedFileThrowsCorruptIndexException() throws IOException {
+    RAMFile file = new RAMFile();
+    IndexOutput output = new RAMOutputStream(file, false);
+    output.close();
+    IndexInput input = new RAMInputStream("file", file);
+    CorruptIndexException e = expectThrows(CorruptIndexException.class,
+        () -> CodecUtil.checksumEntireFile(input));
+    assertEquals("misplaced codec footer (file truncated?): length=0 but footerLength==16 (resource=RAMInputStream(name=file))", e.getMessage());
+    e = expectThrows(CorruptIndexException.class,
+        () -> CodecUtil.retrieveChecksum(input));
+    assertEquals("misplaced codec footer (file truncated?): length=0 but footerLength==16 (resource=RAMInputStream(name=file))", e.getMessage());
+  }
 }


[02/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-8440: Support for enabling basic authentication using bin/solr|bin/solr.cmd

Posted by tf...@apache.org.
SOLR-8440: Support for enabling basic authentication using bin/solr|bin/solr.cmd


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9be68cc3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9be68cc3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9be68cc3

Branch: refs/heads/jira/solr-10233
Commit: 9be68cc3079a320d323e46c570de3e9e883052ed
Parents: 9c6279d
Author: Ishan Chattopadhyaya <is...@apache.org>
Authored: Mon May 15 22:06:26 2017 +0530
Committer: Ishan Chattopadhyaya <is...@apache.org>
Committed: Mon May 15 22:06:26 2017 +0530

----------------------------------------------------------------------
 solr/bin/solr                                   | 164 +++++++++-
 solr/bin/solr.cmd                               |  72 ++++-
 .../src/java/org/apache/solr/util/SolrCLI.java  | 323 ++++++++++---------
 3 files changed, 400 insertions(+), 159 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9be68cc3/solr/bin/solr
----------------------------------------------------------------------
diff --git a/solr/bin/solr b/solr/bin/solr
index cae386f..14d3f59 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -294,7 +294,7 @@ function print_usage() {
   if [ -z "$CMD" ]; then
     echo ""
     echo "Usage: solr COMMAND OPTIONS"
-    echo "       where COMMAND is one of: start, stop, restart, status, healthcheck, create, create_core, create_collection, delete, version, zk"
+    echo "       where COMMAND is one of: start, stop, restart, status, healthcheck, create, create_core, create_collection, delete, version, zk, auth"
     echo ""
     echo "  Standalone server example (start Solr running in the background on port 8984):"
     echo ""
@@ -544,6 +544,35 @@ function print_usage() {
     echo "             <path>: The Zookeeper path to create. Leading slash is assumed if not present."
     echo "                     Intermediate nodes are created as needed if not present."
     echo ""
+  elif [ "$CMD" == "auth" ]; then
+    echo ""
+    echo "Usage: solr auth enable [-type basicAuth] -credentials user:pass [-blockUnknown <true|false>] [-updateIncludeFileOnly <true|false>]"
+    echo "       solr auth enable [-type basicAuth] -prompt <true|false> [-blockUnknown <true|false>] [-updateIncludeFileOnly <true|false>]"
+    echo "       solr auth disable [-updateIncludeFileOnly <true|false>]"
+    echo ""
+    echo "  -type <type>                           The authentication mechanism to enable. Defaults to 'basicAuth'."
+    echo ""
+    echo "  -credentials <user:pass>               The username and password of the initial user"
+    echo "                                         Note: only one of -prompt or -credentials must be provided"
+    echo ""
+    echo "  -prompt <true|false>                   Prompts the user to provide the credentials"
+    echo "                                         Note: only one of -prompt or -credentials must be provided"
+    echo ""
+    echo "  -blockUnknown <true|false>             When true, this blocks out access to unauthenticated users. When not provided,"
+    echo "                                         this defaults to false (i.e. unauthenticated users can access all endpoints, except the"
+    echo "                                         operations like collection-edit, security-edit, core-admin-edit etc.). Check the reference"
+    echo "                                         guide for Basic Authentication for more details."
+    echo ""
+    echo "  -updateIncludeFileOnly <true|false>    Only update the solr.in.sh or solr.in.cmd file, and skip actual enabling/disabling"
+    echo "                                         authentication (i.e. don't update security.json)"
+    echo ""
+    echo "  -z zkHost                              Zookeeper connection string"
+    echo ""
+    echo "  -d <dir>                               Specify the Solr server directory"
+    echo ""
+    echo "  -s <dir>                               Specify the Solr home directory. This is where any credentials or authentication"
+    echo "                                         configuration files (e.g. basicAuth.conf) would be placed."
+    echo ""
   fi
 } # end print_usage
 
@@ -1187,19 +1216,130 @@ if [[ "$SCRIPT_CMD" == "zk" ]]; then
 fi
 
 if [[ "$SCRIPT_CMD" == "auth" ]]; then
-    if [ -z "$AUTH_PORT" ]; then
-      for ID in `ps auxww | grep java | grep start\.jar | awk '{print $2}' | sort -r`
-        do
-          port=`jetty_port "$ID"`
-          if [ "$port" != "" ]; then
-            AUTH_PORT=$port
+  declare -a AUTH_PARAMS
+  if [ $# -gt 0 ]; then
+    while true; do
+      case "$1" in
+        enable|disable)
+            AUTH_OP=$1
+            AUTH_PARAMS=("${AUTH_PARAMS[@]}" "$AUTH_OP")
+            shift
+        ;;
+        -z|-zkhost|zkHost)
+            ZK_HOST="$2"
+            AUTH_PARAMS=("${AUTH_PARAMS[@]}" "-zkHost" "$ZK_HOST")
+            shift 2
+        ;;
+        -t|-type)
+            AUTH_TYPE="$2"
+            AUTH_PARAMS=("${AUTH_PARAMS[@]}" "-type" "$AUTH_TYPE")
+            shift 2
+        ;;
+        -credentials)
+            AUTH_CREDENTIALS="$2"
+            AUTH_PARAMS=("${AUTH_PARAMS[@]}" "-credentials" "$AUTH_CREDENTIALS")
+            shift 2
+        ;;
+        -solrIncludeFile)
+            SOLR_INCLUDE="$2"
+            shift 2
+        ;;
+        -prompt)
+            AUTH_PARAMS=("${AUTH_PARAMS[@]}" "-prompt" "$2")
+            shift
+        ;;
+        -blockUnknown)
+            AUTH_PARAMS=("${AUTH_PARAMS[@]}" "-blockUnknown" "$2")
+            shift
             break
-          fi
-        done
+        ;;
+        -updateIncludeFileOnly)
+            AUTH_PARAMS=("${AUTH_PARAMS[@]}" "-updateIncludeFileOnly" "$2")
+            shift
+            break
+        ;;
+        -d|-dir)
+            if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
+              print_usage "$SCRIPT_CMD" "Server directory is required when using the $1 option!"
+              exit 1
+            fi
+
+            if [[ "$2" == "." || "$2" == "./" || "$2" == ".." || "$2" == "../" ]]; then
+              SOLR_SERVER_DIR="$(pwd)/$2"
+            else
+              # see if the arg value is relative to the tip vs full path
+              if [[ "$2" != /* ]] && [[ -d "$SOLR_TIP/$2" ]]; then
+                SOLR_SERVER_DIR="$SOLR_TIP/$2"
+              else
+                SOLR_SERVER_DIR="$2"
+              fi
+            fi
+            # resolve it to an absolute path
+            SOLR_SERVER_DIR="$(cd "$SOLR_SERVER_DIR"; pwd)"
+            shift 2
+        ;;
+        -s|-solr.home)
+            if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
+              print_usage "$SCRIPT_CMD" "Solr home directory is required when using the $1 option!"
+              exit 1
+            fi
+
+            SOLR_HOME="$2"
+            shift 2
+        ;;
+        -help|-usage|-h)
+            print_usage "$SCRIPT_CMD"
+            exit 0
+        ;;
+        --)
+            shift
+            break
+        ;;
+        *)
+            shift
+            break
+        ;;
+      esac
+    done
+  fi
+
+  if [ -z "$SOLR_SERVER_DIR" ]; then
+    SOLR_SERVER_DIR="$DEFAULT_SERVER_DIR"
+  fi
+  if [ ! -e "$SOLR_SERVER_DIR" ]; then
+    echo -e "\nSolr server directory $SOLR_SERVER_DIR not found!\n"
+    exit 1
+  fi
+  if [ -z "$SOLR_HOME" ]; then
+    SOLR_HOME="$SOLR_SERVER_DIR/solr"
+  else
+    if [[ $SOLR_HOME != /* ]] && [[ -d "$SOLR_SERVER_DIR/$SOLR_HOME" ]]; then
+      SOLR_HOME="$SOLR_SERVER_DIR/$SOLR_HOME"
+      SOLR_PID_DIR="$SOLR_HOME"
+    elif [[ $SOLR_HOME != /* ]] && [[ -d "`pwd`/$SOLR_HOME" ]]; then
+      SOLR_HOME="$(pwd)/$SOLR_HOME"
     fi
-    solr_include_file=$SOLR_INCLUDE
-    run_tool auth "$@" -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:$AUTH_PORT/solr" -solrIncludeFile "$solr_include_file"
-    exit $?
+  fi
+
+  if [ -z "$AUTH_OP" ]; then
+    print_usage "$SCRIPT_CMD"
+    exit 0
+  fi
+
+  AUTH_PARAMS=("${AUTH_PARAMS[@]}" "-solrIncludeFile" "$SOLR_INCLUDE")
+
+  if [ -z "$AUTH_PORT" ]; then
+    for ID in `ps auxww | grep java | grep start\.jar | awk '{print $2}' | sort -r`
+      do
+        port=`jetty_port "$ID"`
+        if [ "$port" != "" ]; then
+          AUTH_PORT=$port
+          break
+        fi
+      done
+  fi
+  run_tool auth ${AUTH_PARAMS[@]} -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:$AUTH_PORT/solr" -authConfDir "$SOLR_HOME"
+  exit $?
 fi
 
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9be68cc3/solr/bin/solr.cmd
----------------------------------------------------------------------
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index d181f8d..1d093b9 100644
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -276,7 +276,7 @@ goto done
 :script_usage
 @echo.
 @echo Usage: solr COMMAND OPTIONS
-@echo        where COMMAND is one of: start, stop, restart, healthcheck, create, create_core, create_collection, delete, version, zk
+@echo        where COMMAND is one of: start, stop, restart, healthcheck, create, create_core, create_collection, delete, version, zk, auth
 @echo.
 @echo   Standalone server example (start Solr running in the background on port 8984):
 @echo.
@@ -554,6 +554,35 @@ IF "%ZK_FULL%"=="true" (
 )
 goto done
 
+:auth_usage
+echo Usage: solr auth enable [-type basicAuth] -credentials user:pass [-blockUnknown ^<true|false^>] [-updateIncludeFileOnly ^<true|false^>]
+echo        solr auth enable [-type basicAuth] -prompt ^<true|false^> [-blockUnknown ^<true|false^>] [-updateIncludeFileOnly ^<true|false^>]
+echo        solr auth disable [-updateIncludeFileOnly ^<true|false^>]
+echo
+echo   -type ^<type^>                 The authentication mechanism to enable. Defaults to 'basicAuth'.
+echo
+echo   -credentials ^<user:pass^>     The username and password of the initial user
+echo                                Note: only one of -prompt or -credentials must be provided
+echo
+echo   -prompt ^<true|false^>         Prompts the user to provide the credentials
+echo                                Note: only one of -prompt or -credentials must be provided
+echo
+echo   -blockUnknown ^<true|false^>   When true, this blocks out access to unauthenticated users. When not provided,
+echo                                this defaults to false (i.e. unauthenticated users can access all endpoints, except the
+echo                                operations like collection-edit, security-edit, core-admin-edit etc.). Check the reference
+echo                                guide for Basic Authentication for more details.
+echo
+echo   -updateIncludeFileOnly ^<true|false^>    Only update the solr.in.sh or solr.in.cmd file, and skip actual enabling/disabling"
+echo                                          authentication (i.e. don't update security.json)"
+echo
+echo   -z zkHost                    Zookeeper connection string
+echo
+echo   -d <dir>                     Specify the Solr server directory"
+echo 
+echo   -s <dir>                     Specify the Solr home directory. This is where any credentials or authentication"
+echo                                configuration files (e.g. basicAuth.conf) would be placed."
+echo
+goto done
 
 REM Really basic command-line arg parsing
 :parse_args
@@ -1648,6 +1677,44 @@ goto done
 
  
 :run_auth
+IF "%1"=="-help" goto usage
+IF "%1"=="-usage" goto usage
+
+REM Options parsing.
+REM Note: With the following technique of parsing, it is not possible
+REM       to have an option without a value.
+set "AUTH_PARAMS=%1"
+set "option="
+for %%a in (%*) do (
+   if not defined option (
+      set arg=%%a
+      if "!arg:~0,1!" equ "-" set "option=!arg!"
+   ) else (
+      set "option!option!=%%a"
+      if "!option!" equ "-d" set "SOLR_SERVER_DIR=%%a"
+      if "!option!" equ "-s" set "SOLR_HOME=%%a"
+      if not "!option!" equ "-s" if not "!option!" equ "-d" (
+        set "AUTH_PARAMS=!AUTH_PARAMS! !option! %%a"
+      )
+      set "option="
+   )
+)
+IF "%SOLR_SERVER_DIR%"=="" set "SOLR_SERVER_DIR=%DEFAULT_SERVER_DIR%"
+IF NOT EXIST "%SOLR_SERVER_DIR%" (
+  set "SCRIPT_ERROR=Solr server directory %SOLR_SERVER_DIR% not found!"
+  goto err
+)
+IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOLR_SERVER_DIR%\solr"
+IF EXIST "%cd%\%SOLR_HOME%" set "SOLR_HOME=%cd%\%SOLR_HOME%"
+IF NOT EXIST "%SOLR_HOME%\" (
+  IF EXIST "%SOLR_SERVER_DIR%\%SOLR_HOME%" (
+    set "SOLR_HOME=%SOLR_SERVER_DIR%\%SOLR_HOME%"
+  ) ELSE (
+    set "SCRIPT_ERROR=Solr home directory %SOLR_HOME% not found!"
+    goto err
+  )
+)
+
 if "!AUTH_PORT!"=="" (
   for /f "usebackq" %%i in (`dir /b "%SOLR_TIP%\bin" ^| findstr /i "^solr-.*\.port$"`) do (
     set SOME_SOLR_PORT=
@@ -1659,11 +1726,10 @@ if "!AUTH_PORT!"=="" (
     )
   )
 )
-for /f "tokens=1,* delims= " %%a in ("%*") do set auth_params=%%b
 "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^
     -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
     -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
-    org.apache.solr.util.SolrCLI auth %auth_params% -solrIncludeFile "%SOLR_INCLUDE%" ^
+    org.apache.solr.util.SolrCLI auth %AUTH_PARAMS% -solrIncludeFile "%SOLR_INCLUDE%" -authConfDir "%SOLR_HOME%" ^
     -solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!AUTH_PORT!/solr
 goto done
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9be68cc3/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index 0fef03c..aedb9ed 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -3526,49 +3526,59 @@ public class SolrCLI {
     public Option[] getOptions() {
       return new Option[]{
           OptionBuilder
-              .withArgName("enable")
-              .withDescription("Enable authentication.")
-              .create("enable"),
-          OptionBuilder
-              .withArgName("disable")
-              .withDescription("Disable existing authentication.")
-              .create("disable"),
-          OptionBuilder
-              .withArgName("type")
-              .hasArg()
-              .withDescription("basicAuth")
-              .create("type"),
-          OptionBuilder
-              .withArgName("credentials")
-              .hasArg()
-              .withDescription("Credentials in the format username:password. Example: -credentials solr:SolrRocks")
-              .create("credentials"),
-          OptionBuilder
-              .withArgName("prompt")
-              .withDescription("Prompt for credentials. Use either -credentials or -prompt, not both")
-              .create("prompt"),              
-          OptionBuilder
-              .withArgName("blockUnknown")
-              .withDescription("Blocks all access for unknown users (requires authentication for all endpoints)")
-              .hasOptionalArg()
-              .create("blockUnknown"),
-          OptionBuilder
-              .withArgName("solrIncludeFile")
-              .hasArg()
-              .withDescription("The Solr include file which contains overridable environment variables for configuring Solr configurations")
-              .create("solrIncludeFile"),
-          OptionBuilder
-              .withArgName("solrUrl")
-              .hasArg()
-              .withDescription("Solr URL")
-              .create("solrUrl"),
+          .withArgName("type")
+          .hasArg()
+          .withDescription("The authentication mechanism to enable. Defaults to 'basicAuth'.")
+          .create("type"),
+          OptionBuilder
+          .withArgName("credentials")
+          .hasArg()
+          .withDescription("Credentials in the format username:password. Example: -credentials solr:SolrRocks")
+          .create("credentials"),
+          OptionBuilder
+          .withArgName("prompt")
+          .hasArg()
+          .withDescription("Prompts the user to provide the credentials. Use either -credentials or -prompt, not both")
+          .create("prompt"),
+          OptionBuilder
+          .withArgName("blockUnknown")
+          .withDescription("Blocks all access for unknown users (requires authentication for all endpoints)")
+          .hasArg()
+          .create("blockUnknown"),
+          OptionBuilder
+          .withArgName("solrIncludeFile")
+          .hasArg()
+          .withDescription("The Solr include file which contains overridable environment variables for configuring Solr configurations")
+          .create("solrIncludeFile"),
+          OptionBuilder
+          .withArgName("updateIncludeFileOnly")
+          .withDescription("Only update the solr.in.sh or solr.in.cmd file, and skip actual enabling/disabling"
+              + " authentication (i.e. don't update security.json)")
+          .hasArg()
+          .create("updateIncludeFileOnly"),
+          OptionBuilder
+          .withArgName("authConfDir")
+          .hasArg()
+          .isRequired()
+          .withDescription("This is where any authentication related configuration files, if any, would be placed.")
+          .create("authConfDir"),
+          OptionBuilder
+          .withArgName("solrUrl")
+          .hasArg()
+          .withDescription("Solr URL")
+          .create("solrUrl"),
+          OptionBuilder
+          .withArgName("zkHost")
+          .hasArg()
+          .withDescription("ZooKeeper host")
+          .create("zkHost"),
       };
     }
 
     @Override
     public int runTool(CommandLine cli) throws Exception {
-      if (cli.getOptions().length == 0 || cli.getArgs().length > 0 || cli.hasOption("h")) {
-        new HelpFormatter().printHelp("bin/solr auth [OPTIONS]", getToolOptions(this));
+      if (cli.getOptions().length == 0 || cli.getArgs().length == 0 || cli.getArgs().length > 1 || cli.hasOption("h")) {
+        new HelpFormatter().printHelp("bin/solr auth <enable|disable> [OPTIONS]", getToolOptions(this));
         return 1;
       }
 
@@ -3578,128 +3588,153 @@ public class SolrCLI {
         exit(1);
       }
 
-      if (cli.hasOption("enable") && cli.hasOption("disable")) {
-        System.out.println("You have specified both -enable and -disable. Only one should be provided.");
-        return 1;
-      }
-      if  (cli.hasOption("enable")) {
-        String zkHost = getZkHost(cli);
-        if (zkHost == null) {
-          System.out.println("ZK Host not found. Solr should be running in cloud mode");
-          exit(1);
-        }
+      String cmd = cli.getArgs()[0];
+      boolean prompt = Boolean.parseBoolean(cli.getOptionValue("prompt", "false"));
+      boolean updateIncludeFileOnly = Boolean.parseBoolean(cli.getOptionValue("updateIncludeFileOnly", "false"));
+      switch (cmd) {
+        case "enable":
+          if (!prompt && !cli.hasOption("credentials")) {
+            System.out.println("Option -credentials or -prompt is required with enable.");
+            new HelpFormatter().printHelp("bin/solr auth <enable|disable> [OPTIONS]", getToolOptions(this));
+            exit(1);
+          } else if (!prompt && (cli.getOptionValue("credentials") == null || !cli.getOptionValue("credentials").contains(":"))) {
+            System.out.println("Option -credentials is not in correct format.");
+            new HelpFormatter().printHelp("bin/solr auth <enable|disable> [OPTIONS]", getToolOptions(this));
+            exit(1);
+          }
 
-        
-        if (cli.hasOption("credentials") == false && cli.hasOption("prompt") == false) {
-          System.out.println("Option -credentials or -prompt is required with -enable.");
-          new HelpFormatter().printHelp("bin/solr auth [OPTIONS]", getToolOptions(this));
-          exit(1);
-        } else if (cli.hasOption("prompt") == false &&
-            (cli.getOptionValue("credentials") == null || !cli.getOptionValue("credentials").contains(":"))) {
-          System.out.println("Option -credentials is not in correct format.");
-          new HelpFormatter().printHelp("bin/solr auth [OPTIONS]", getToolOptions(this));
-          exit(1);
-        }
+          String zkHost = null;
 
-        String username, password;
-        if (cli.hasOption("credentials")) {
-          String credentials = cli.getOptionValue("credentials");
-          username = credentials.split(":")[0];
-          password = credentials.split(":")[1];
-        } else {
-          Console console = System.console();
-          username = console.readLine("Enter username: ");
-          password = new String(console.readPassword("Enter password: "));
-        }
-        // check if security is already enabled or not
-        try (SolrZkClient zkClient = new SolrZkClient(zkHost, 10000)) {
-          if (zkClient.exists("/security.json", true)) {
-            byte oldSecurityBytes[] = zkClient.getData("/security.json", null, null, true);
-            if (!"{}".equals(new String(oldSecurityBytes, StandardCharsets.UTF_8).trim())) {
-              System.out.println("Security is already enabled. You can disable it with 'bin/solr auth -disable'. Existing security.json: \n"
-                  + new String(oldSecurityBytes, StandardCharsets.UTF_8));
+          if (!updateIncludeFileOnly) {
+            try {
+              zkHost = getZkHost(cli);
+            } catch (Exception ex) {
+              if (cli.hasOption("zkHost")) {
+                System.out.println("Couldn't get ZooKeeper host. Please make sure that ZooKeeper is running and the correct zkHost has been passed in.");
+              } else {
+                System.out.println("Couldn't get ZooKeeper host. Please make sure Solr is running in cloud mode, or a zkHost has been passed in.");
+              }
+              exit(1);
+            }
+            if (zkHost == null) {
+              if (cli.hasOption("zkHost")) {
+                System.out.println("Couldn't get ZooKeeper host. Please make sure that ZooKeeper is running and the correct zkHost has been passed in.");
+              } else {
+                System.out.println("Couldn't get ZooKeeper host. Please make sure Solr is running in cloud mode, or a zkHost has been passed in.");
+              }
               exit(1);
             }
+
+            // check if security is already enabled or not
+            try (SolrZkClient zkClient = new SolrZkClient(zkHost, 10000)) {
+              if (zkClient.exists("/security.json", true)) {
+                byte oldSecurityBytes[] = zkClient.getData("/security.json", null, null, true);
+                if (!"{}".equals(new String(oldSecurityBytes, StandardCharsets.UTF_8).trim())) {
+                  System.out.println("Security is already enabled. You can disable it with 'bin/solr auth disable'. Existing security.json: \n"
+                      + new String(oldSecurityBytes, StandardCharsets.UTF_8));
+                  exit(1);
+                }
+              }
+            }
           }
-        }
 
-        boolean blockUnknown = cli.getOptionValue("blockUnknown") == null ?
-            cli.hasOption("blockUnknown"): Boolean.valueOf(cli.getOptionValue("blockUnknown"));
-
-            String securityJson = "{" +
-                "\n  \"authentication\":{" +
-                "\n   \"blockUnknown\": " + blockUnknown + "," +
-                "\n   \"class\":\"solr.BasicAuthPlugin\"," +
-                "\n   \"credentials\":{\""+username+"\":\"" + Sha256AuthenticationProvider.getSaltedHashedValue(password) + "\"}" +
-                "\n  }," +
-                "\n  \"authorization\":{" +
-                "\n   \"class\":\"solr.RuleBasedAuthorizationPlugin\"," +
-                "\n   \"permissions\":[" +
-                "\n {\"name\":\"security-edit\", \"role\":\"admin\"}," +
-                "\n {\"name\":\"collection-admin-edit\", \"role\":\"admin\"}," +
-                "\n {\"name\":\"core-admin-edit\", \"role\":\"admin\"}" +
-                "\n   ]," +
-                "\n   \"user-role\":{\""+username+"\":\"admin\"}" +
-                "\n  }" +
-                "\n}";
-            System.out.println("Uploading following security.json: " + securityJson);
+          String username, password;
+          if (cli.hasOption("credentials")) {
+            String credentials = cli.getOptionValue("credentials");
+            username = credentials.split(":")[0];
+            password = credentials.split(":")[1];
+          } else {
+            Console console = System.console();
+            username = console.readLine("Enter username: ");
+            password = new String(console.readPassword("Enter password: "));
+          }
 
+          boolean blockUnknown = Boolean.valueOf(cli.getOptionValue("blockUnknown", "false"));
+
+          String securityJson = "{" +
+              "\n  \"authentication\":{" +
+              "\n   \"blockUnknown\": " + blockUnknown + "," +
+              "\n   \"class\":\"solr.BasicAuthPlugin\"," +
+              "\n   \"credentials\":{\"" + username + "\":\"" + Sha256AuthenticationProvider.getSaltedHashedValue(password) + "\"}" +
+              "\n  }," +
+              "\n  \"authorization\":{" +
+              "\n   \"class\":\"solr.RuleBasedAuthorizationPlugin\"," +
+              "\n   \"permissions\":[" +
+              "\n {\"name\":\"security-edit\", \"role\":\"admin\"}," +
+              "\n {\"name\":\"collection-admin-edit\", \"role\":\"admin\"}," +
+              "\n {\"name\":\"core-admin-edit\", \"role\":\"admin\"}" +
+              "\n   ]," +
+              "\n   \"user-role\":{\"" + username + "\":\"admin\"}" +
+              "\n  }" +
+              "\n}";
+
+          if (!updateIncludeFileOnly) {
+            System.out.println("Uploading following security.json: " + securityJson);
             try (SolrZkClient zkClient = new SolrZkClient(zkHost, 10000)) {
               zkClient.setData("/security.json", securityJson.getBytes(StandardCharsets.UTF_8), true);
             }
+          }
 
-            String solrIncludeFilename = cli.getOptionValue("solrIncludeFile");
-            File includeFile = new File(solrIncludeFilename);
-            if (includeFile.exists() == false || includeFile.canWrite() == false) {
-              System.out.println("Solr include file " + solrIncludeFilename + " doesn't exist or is not writeable.");
-              printAuthEnablingInstructions(username, password);
-              System.exit(0);
-            }
-            File basicAuthConfFile = new File(includeFile.getParent() + File.separator + "basicAuth.conf");
-            
-            if (basicAuthConfFile.getParentFile().canWrite() == false) {
-              System.out.println("Cannot write to file: " + basicAuthConfFile.getAbsolutePath());
-              printAuthEnablingInstructions(username, password);
-              System.exit(0);
+          String solrIncludeFilename = cli.getOptionValue("solrIncludeFile");
+          File includeFile = new File(solrIncludeFilename);
+          if (includeFile.exists() == false || includeFile.canWrite() == false) {
+            System.out.println("Solr include file " + solrIncludeFilename + " doesn't exist or is not writeable.");
+            printAuthEnablingInstructions(username, password);
+            System.exit(0);
+          }
+          String authConfDir = cli.getOptionValue("authConfDir");
+          File basicAuthConfFile = new File(authConfDir + File.separator + "basicAuth.conf");
+
+          if (basicAuthConfFile.getParentFile().canWrite() == false) {
+            System.out.println("Cannot write to file: " + basicAuthConfFile.getAbsolutePath());
+            printAuthEnablingInstructions(username, password);
+            System.exit(0);
+          }
+
+          FileUtils.writeStringToFile(basicAuthConfFile,
+              "httpBasicAuthUser=" + username + "\nhttpBasicAuthPassword=" + password, StandardCharsets.UTF_8);
+
+          // update the solr.in.sh file to contain the necessary authentication lines
+          updateIncludeFileEnableAuth(includeFile, basicAuthConfFile.getAbsolutePath());
+          return 0;
+
+        case "disable":
+          if (!updateIncludeFileOnly) {
+            zkHost = getZkHost(cli);
+            if (zkHost == null) {
+              stdout.print("ZK Host not found. Solr should be running in cloud mode");
+              exit(1);
             }
-            
-            FileUtils.writeStringToFile(basicAuthConfFile, 
-                "httpBasicAuthUser=" + username + "\nhttpBasicAuthPassword=" + password, StandardCharsets.UTF_8);
-
-            // update the solr.in.sh file to contain the necessary authentication lines
-            updateIncludeFileEnableAuth(includeFile, basicAuthConfFile.getAbsolutePath(), username, password);
-            return 0;
-      } else if (cli.hasOption("disable")) {
-        String zkHost = getZkHost(cli);
-        if (zkHost == null) {
-          stdout.print("ZK Host not found. Solr should be running in cloud mode");
-          exit(1);
-        }
 
-        System.out.println("Uploading following security.json: {}");
+            System.out.println("Uploading following security.json: {}");
 
-        try (SolrZkClient zkClient = new SolrZkClient(zkHost, 10000)) {
-          zkClient.setData("/security.json", "{}".getBytes(StandardCharsets.UTF_8), true);
-        }
+            try (SolrZkClient zkClient = new SolrZkClient(zkHost, 10000)) {
+              zkClient.setData("/security.json", "{}".getBytes(StandardCharsets.UTF_8), true);
+            }
+          }
 
-        String solrIncludeFilename = cli.getOptionValue("solrIncludeFile");
-        File includeFile = new File(solrIncludeFilename);
-        if (includeFile.exists() == false || includeFile.canWrite() == false) {
-          System.out.println("Solr include file " + solrIncludeFilename + " doesn't exist or is not writeable.");
-          System.out.println("Security has been disabled. Please remove any SOLR_AUTH_TYPE or SOLR_AUTHENTICATION_OPTS configuration from solr.in.sh/solr.in.cmd.\n");
-          System.exit(0);
-        }
+          solrIncludeFilename = cli.getOptionValue("solrIncludeFile");
+          includeFile = new File(solrIncludeFilename);
+          if (!includeFile.exists() || !includeFile.canWrite()) {
+            System.out.println("Solr include file " + solrIncludeFilename + " doesn't exist or is not writeable.");
+            System.out.println("Security has been disabled. Please remove any SOLR_AUTH_TYPE or SOLR_AUTHENTICATION_OPTS configuration from solr.in.sh/solr.in.cmd.\n");
+            System.exit(0);
+          }
 
-        // update the solr.in.sh file to comment out the necessary authentication lines
-        updateIncludeFileDisableAuth(includeFile);
-        return 0;
+          // update the solr.in.sh file to comment out the necessary authentication lines
+          updateIncludeFileDisableAuth(includeFile);
+          return 0;
+
+        default:
+          System.out.println("Valid auth commands are: enable, disable");
+          exit(1);
       }
 
-      System.out.println("Options not understood (should be -enable or -disable).");
-      new HelpFormatter().printHelp("bin/solr auth [OPTIONS]", getToolOptions(this));
+      System.out.println("Options not understood.");
+      new HelpFormatter().printHelp("bin/solr auth <enable|disable> [OPTIONS]", getToolOptions(this));
       return 1;
     }
-    
+
     private void printAuthEnablingInstructions(String username, String password) {
       if (SystemUtils.IS_OS_WINDOWS) {
         System.out.println("\nAdd the following lines to the solr.in.cmd file so that the solr.cmd script can use subsequently.\n");
@@ -3708,11 +3743,11 @@ public class SolrCLI {
       } else {
         System.out.println("\nAdd the following lines to the solr.in.sh file so that the ./solr script can use subsequently.\n");
         System.out.println("SOLR_AUTH_TYPE=\"basic\"\n"
-            + "SOLR_AUTHENTICATION_OPTS=\"-DbasicAuth=" + username + ":" + password + "\"\n");
+            + "SOLR_AUTHENTICATION_OPTS=\"-Dbasicauth=" + username + ":" + password + "\"\n");
       }
     }
 
-    private void updateIncludeFileEnableAuth(File includeFile, String basicAuthConfFile, String username, String password) throws IOException {
+    private void updateIncludeFileEnableAuth(File includeFile, String basicAuthConfFile) throws IOException {
       List<String> includeFileLines = FileUtils.readLines(includeFile, StandardCharsets.UTF_8);
       for (int i=0; i<includeFileLines.size(); i++) {
         String line = includeFileLines.get(i);
@@ -3738,7 +3773,7 @@ public class SolrCLI {
 
       System.out.println("Written out credentials file: " + basicAuthConfFile + ", updated Solr include file: " + includeFile.getAbsolutePath() + ".");
     }
-    
+
     private void updateIncludeFileDisableAuth(File includeFile) throws IOException {
       List<String> includeFileLines = FileUtils.readLines(includeFile, StandardCharsets.UTF_8);
       boolean hasChanged = false;
@@ -3762,7 +3797,7 @@ public class SolrCLI {
     @Override
     protected void runImpl(CommandLine cli) throws Exception {}
   }
-  
+
   public static class UtilsTool extends ToolBase {
     private Path serverPath;
     private Path logsPath;


[27/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/jquery-1.7.2.min.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/jquery-1.7.2.min.js b/solr/webapp/web/js/lib/jquery-1.7.2.min.js
deleted file mode 100644
index 90165e9..0000000
--- a/solr/webapp/web/js/lib/jquery-1.7.2.min.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*!
-
-Copyright 2014 jQuery Foundation and other contributors
-http://jquery.com/
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-*/
-
-/*! jQuery v1.7.2 jquery.com | jquery.org/license */
-(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;
 g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);e
 lse d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d
 =parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaul
 tSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typ
 eof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c
 =a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;r
 eturn this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==nu
 ll?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),t
 ypeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready
 );var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:functio
 n(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[
 ];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f
 .concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date 
 RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],
 e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);re
 turn this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f
 .isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.va
 lue==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecke
 d=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="no
 ne",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position=
 "relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[
 n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(
 j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f
 ._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=th
 is,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof
  a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeCla
 ss"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a
 .attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);r
 eturn}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowsp
 an:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b}
 ,set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["r
 adio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
-a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.gui
 d,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remov
 e.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=
 f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.na
 mespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attr
 Name relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.prop
 s?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.
 type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.
 type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("ch
 ange",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e=
 =null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:funct
 ion(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.tes
 t(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,
 l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[
 t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFi
 lter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]
 |\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode=
 ==b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG
 :function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.
 parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a)
 {var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nod
 eType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p
 =o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,
 e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElemen
 t("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]
 );if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}
 }(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.select
 ors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.c
 ontext).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({p
 arent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P
 .call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^
 \s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChi
 ld;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
-.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;
 if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(functi
 on(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h))
 ,e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.
 createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;
 i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",vi
 sibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f
 .cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f
 ===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.su
 pport.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:f
 unction(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.e
 ach("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},
 ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if
 (!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.
 toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d
 .async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.json
 p!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||
 /loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{i
 f(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.
 css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark
 (this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"
 ),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{
 opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,th

<TRUNCATED>

[50/50] [abbrv] lucene-solr:jira/solr-10233: Fix precommit. Added some javadocs

Posted by tf...@apache.org.
Fix precommit. Added some javadocs


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ef736a15
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ef736a15
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ef736a15

Branch: refs/heads/jira/solr-10233
Commit: ef736a15b6dd79939e9a437be4b9d0b61432ebae
Parents: f67b309
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Thu May 18 16:51:53 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Thu May 18 16:51:53 2017 -0700

----------------------------------------------------------------------
 solr/core/src/java/org/apache/solr/cloud/Assign.java  |  2 +-
 .../java/org/apache/solr/cloud/RecoveryStrategy.java  |  2 +-
 solr/core/src/test-files/log4j.properties             | 14 +++-----------
 .../src/test/org/apache/solr/cloud/AssignTest.java    |  6 ++++++
 .../solr/client/solrj/impl/CloudSolrClient.java       |  9 ++-------
 .../org/apache/solr/common/cloud/DocCollection.java   |  9 +++++++++
 6 files changed, 22 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ef736a15/solr/core/src/java/org/apache/solr/cloud/Assign.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/Assign.java b/solr/core/src/java/org/apache/solr/cloud/Assign.java
index 924ff17..265e453 100644
--- a/solr/core/src/java/org/apache/solr/cloud/Assign.java
+++ b/solr/core/src/java/org/apache/solr/cloud/Assign.java
@@ -110,7 +110,7 @@ public class Assign {
   
   public static String buildCoreName(String collectionName, String shard, Replica.Type type, int replicaNum) {
     // TODO: Adding the suffix is great for debugging, but may be an issue if at some point we want to support a way to change replica type
-    return collectionName + "_" + shard + "_replica_" + type.name().substring(0,1).toLowerCase() + replicaNum;
+    return String.format(Locale.ROOT, "%s_%s_replica_%s%s", collectionName, shard, type.name().substring(0,1).toLowerCase(Locale.ROOT), replicaNum);
   }
 
   public static String buildCoreName(DocCollection collection, String shard, Replica.Type type) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ef736a15/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
index da75195..83380a1 100644
--- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
+++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
@@ -261,7 +261,7 @@ public class RecoveryStrategy implements Runnable, Closeable {
       UpdateRequest ureq = new UpdateRequest();
       ureq.setParams(new ModifiableSolrParams());
       ureq.getParams().set(DistributedUpdateProcessor.COMMIT_END_POINT, true);
-//      ureq.getParams().set(UpdateParams.OPEN_SEARCHER, onlyLeaderIndexes);// nocommit: Why do we need to open searcher if "onlyLeaderIndexes"?
+//      ureq.getParams().set(UpdateParams.OPEN_SEARCHER, onlyLeaderIndexes);// Why do we need to open searcher if "onlyLeaderIndexes"?
       ureq.getParams().set(UpdateParams.OPEN_SEARCHER, false);
       ureq.setAction(AbstractUpdateRequest.ACTION.COMMIT, false, true).process(
           client);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ef736a15/solr/core/src/test-files/log4j.properties
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/log4j.properties b/solr/core/src/test-files/log4j.properties
index 73f7553..2697203 100644
--- a/solr/core/src/test-files/log4j.properties
+++ b/solr/core/src/test-files/log4j.properties
@@ -1,6 +1,5 @@
 #  Logging level
-# nocommit: revert this file before back to master
-log4j.rootLogger=DEBUG, CONSOLE
+log4j.rootLogger=INFO, CONSOLE
 
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
 log4j.appender.CONSOLE.Target=System.err
@@ -11,13 +10,6 @@ log4j.logger.org.apache.hadoop=WARN
 log4j.logger.org.apache.directory=WARN
 log4j.logger.org.apache.solr.hadoop=INFO
 
-log4j.logger.org.apache.solr.cloud.OverseerTaskProcessor=INFO
-log4j.logger.org.apache.solr.cloud.OverseerTaskQueue=INFO
-log4j.logger.org.apache.solr.cloud.OverseerTaskQueue=INFO
-log4j.logger.org.apache.solr.common.cloud.SolrZkClient=INFO
-log4j.logger.org.apache.solr.util.stats.InstrumentedPoolingHttpClientConnectionManager=INFO
-log4j.logger.com.codehale.metrics=INFO
-log4j.logger.com.codahale.metrics.JmxReporter=INFO
 #log4j.logger.org.apache.solr.update.processor.LogUpdateProcessorFactory=DEBUG
 #log4j.logger.org.apache.solr.update.processor.DistributedUpdateProcessor=DEBUG
 #log4j.logger.org.apache.solr.update.PeerSync=DEBUG
@@ -39,6 +31,6 @@ log4j.logger.com.codahale.metrics.JmxReporter=INFO
 
 #log4j.logger.org.apache.http.impl.conn.PoolingHttpClientConnectionManager=DEBUG
 #log4j.logger.org.apache.http.impl.conn.BasicClientConnectionManager=DEBUG
-log4j.logger.org.apache.http=INFO
+#log4j.logger.org.apache.http=DEBUG
 #log4j.logger.org.apache.solr.client.solrj.impl.SolrHttpRequestRetryHandler=DEBUG
-log4j.logger.org.eclipse.jetty=INFO
+#log4j.logger.org.eclipse.jetty=DEBUG

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ef736a15/solr/core/src/test/org/apache/solr/cloud/AssignTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/AssignTest.java b/solr/core/src/test/org/apache/solr/cloud/AssignTest.java
index 7593f3b..8e32510 100644
--- a/solr/core/src/test/org/apache/solr/cloud/AssignTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/AssignTest.java
@@ -87,4 +87,10 @@ public class AssignTest extends SolrTestCaseJ4 {
     assertEquals("core_node2", nodeName);
   }
   
+  @Test
+  public void testBuildCoreName() {
+    assertEquals("Core name pattern changed", "collection1_shard1_replica_n1", Assign.buildCoreName("collection1", "shard1", Replica.Type.NRT, 1));
+    assertEquals("Core name pattern changed", "collection1_shard2_replica_p2", Assign.buildCoreName("collection1", "shard2", Replica.Type.PULL,2));
+  }
+  
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ef736a15/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
index a9c6d6d..ff7b06a 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
@@ -25,7 +25,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -898,7 +897,7 @@ public class CloudSolrClient extends SolrClient {
       String url = zkProps.getCoreUrl();
       urls.add(url);
       if (!directUpdatesToLeadersOnly) {
-        for (Replica replica : slice.getReplicas(EnumSet.of(Replica.Type.TLOG, Replica.Type.NRT))) {
+        for (Replica replica : slice.getReplicas()) {
           if (!replica.getNodeName().equals(leader.getNodeName()) &&
               !replica.getName().equals(leader.getName())) {
             ZkCoreNodeProps zkProps1 = new ZkCoreNodeProps(replica);
@@ -1325,7 +1324,6 @@ public class CloudSolrClient extends SolrClient {
         ClientUtils.addSlices(slices, collectionName, routeSlices, true);
       }
       Set<String> liveNodes = stateProvider.liveNodes();
-      log.debug("Live Nodes: {}", liveNodes);//nocommit
 
       List<String> leaderUrlList = null;
       List<String> urlList = null;
@@ -1340,10 +1338,7 @@ public class CloudSolrClient extends SolrClient {
           ZkCoreNodeProps coreNodeProps = new ZkCoreNodeProps(nodeProps);
           String node = coreNodeProps.getNodeName();
           if (!liveNodes.contains(coreNodeProps.getNodeName())
-              || Replica.State.getState(coreNodeProps.getState()) != Replica.State.ACTIVE) {
-            log.debug("{} not in liveNodes, skipping", coreNodeProps.getNodeName());//nocommit
-            continue;
-          }
+              || Replica.State.getState(coreNodeProps.getState()) != Replica.State.ACTIVE) continue;
           if (nodes.put(node, nodeProps) == null) {
             if (!sendToLeaders || coreNodeProps.isLeader()) {
               String url;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ef736a15/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
index 47bdce3..5c3f895 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
@@ -342,14 +342,23 @@ public class DocCollection extends ZkNodeProps implements Iterable<Slice> {
     return super.equals(that) && Objects.equals(this.znode, other.znode) && this.znodeVersion == other.znodeVersion;
   }
 
+  /**
+   * @return the number of replicas of type {@link org.apache.solr.common.cloud.Replica.Type#NRT} this collection was created with
+   */
   public Integer getNumNrtReplicas() {
     return numNrtReplicas;
   }
 
+  /**
+   * @return the number of replicas of type {@link org.apache.solr.common.cloud.Replica.Type#TLOG} this collection was created with
+   */
   public Integer getNumTlogReplicas() {
     return numTlogReplicas;
   }
 
+  /**
+   * @return the number of replicas of type {@link org.apache.solr.common.cloud.Replica.Type#PULL} this collection was created with
+   */
   public Integer getNumPullReplicas() {
     return numPullReplicas;
   }


[25/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/jquery.jstree.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/jquery.jstree.js b/solr/webapp/web/js/lib/jquery.jstree.js
deleted file mode 100644
index 50c1767..0000000
--- a/solr/webapp/web/js/lib/jquery.jstree.js
+++ /dev/null
@@ -1,3534 +0,0 @@
-/*
-
-The MIT License (MIT)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-/*
- * 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>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</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'>&#160;</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'>&#160;</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'>&#160;</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'>&#160;</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.

<TRUNCATED>

[43/50] [abbrv] lucene-solr:jira/solr-10233: Ref Guide: update upgrade notes for 6.6

Posted by tf...@apache.org.
Ref Guide: update upgrade notes for 6.6


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/48aa31d0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/48aa31d0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/48aa31d0

Branch: refs/heads/jira/solr-10233
Commit: 48aa31d09c501f29acf656a7c269cd7c374bff43
Parents: bdecee2
Author: Cassandra Targett <ca...@lucidworks.com>
Authored: Thu May 18 13:13:40 2017 -0500
Committer: Cassandra Targett <ca...@lucidworks.com>
Committed: Thu May 18 13:13:40 2017 -0500

----------------------------------------------------------------------
 solr/solr-ref-guide/src/upgrading-solr.adoc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/48aa31d0/solr/solr-ref-guide/src/upgrading-solr.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/upgrading-solr.adoc b/solr/solr-ref-guide/src/upgrading-solr.adoc
index 6ec78f1..e5803d8 100644
--- a/solr/solr-ref-guide/src/upgrading-solr.adoc
+++ b/solr/solr-ref-guide/src/upgrading-solr.adoc
@@ -7,7 +7,11 @@ If you are already using Solr 6.5, Solr 6.6 should not present any major problem
 [[UpgradingSolr-Upgradingfrom6.5.x]]
 == Upgrading from 6.5.x
 
-* <TBD>
+* Solr contribs map-reduce, morphlines-core and morphlines-cell have been removed.
+
+* JSON Facet API now uses hyper-log-log for numBuckets cardinality calculation and calculates cardinality before filtering buckets by any mincount greater than 1.
+
+* ZooKeeper dependency has been upgraded from 3.4.6 to 3.4.10.
 
 [[UpgradingSolr-Upgradingfromearlier6.xversions]]
 == Upgrading from earlier 6.x versions


[35/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7838 - removed unused import

Posted by tf...@apache.org.
LUCENE-7838 - removed unused import


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c53d19e7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c53d19e7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c53d19e7

Branch: refs/heads/jira/solr-10233
Commit: c53d19e7b2b15fe2d9d38be3a1137339336a7f23
Parents: bd9e32d
Author: Tommaso Teofili <to...@apache.org>
Authored: Thu May 18 14:42:56 2017 +0200
Committer: Tommaso Teofili <to...@apache.org>
Committed: Thu May 18 14:42:56 2017 +0200

----------------------------------------------------------------------
 .../org/apache/lucene/classification/KNearestFuzzyClassifier.java   | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c53d19e7/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
index 1cde468..7bbdbab 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
@@ -38,7 +38,6 @@ import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.WildcardQuery;
 import org.apache.lucene.search.similarities.BM25Similarity;
-import org.apache.lucene.search.similarities.ClassicSimilarity;
 import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.util.BytesRef;
 


[15/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10223: Allow running examples as root on Linux with -force option

Posted by tf...@apache.org.
SOLR-10223: Allow running examples as root on Linux with -force option


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b5aa0da6
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b5aa0da6
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b5aa0da6

Branch: refs/heads/jira/solr-10233
Commit: b5aa0da6ff56da40df42853564b1c3404cd29444
Parents: 318e546
Author: Jan Høydahl <ja...@apache.org>
Authored: Thu May 18 11:26:19 2017 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Thu May 18 11:26:19 2017 +0200

----------------------------------------------------------------------
 solr/CHANGES.txt                                     | 2 ++
 solr/bin/solr                                        | 1 +
 solr/core/src/java/org/apache/solr/util/SolrCLI.java | 9 +++++++--
 3 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b5aa0da6/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index b1584ee..92e8d8d 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -115,6 +115,8 @@ Bug Fixes
 
 * SOLR-10413: v2 API: parsed JSON type should be coerced to expected type (Cao Manh Dat, Noble Paul)
 
+* SOLR-10223: Allow running examples as root on Linux with -force option (janhoy)
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b5aa0da6/solr/bin/solr
----------------------------------------------------------------------
diff --git a/solr/bin/solr b/solr/bin/solr
index 621ac96..b7bf142 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1469,6 +1469,7 @@ if [ $# -gt 0 ]; then
         ;;
         -force)
             FORCE=true
+            PASS_TO_RUN_EXAMPLE+=" -force"
             shift
         ;;
         --)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b5aa0da6/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index 833e3b4..97fdf1e 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -2550,6 +2550,10 @@ public class SolrCLI {
             .withLongOpt("serverDir")
             .create('d'),
           OptionBuilder
+            .withArgName("FORCE")
+            .withDescription("Force option in case Solr is run as root")
+            .create("force"),
+          OptionBuilder
             .withArgName("DIR")
             .hasArg()
             .isRequired(false)
@@ -2918,6 +2922,7 @@ public class SolrCLI {
       String zkHostArg = (zkHost != null) ? " -z "+zkHost : "";
       String memArg = (memory != null) ? " -m "+memory : "";
       String cloudModeArg = cloudMode ? "-cloud " : "";
+      String forceArg = cli.hasOption("force") ? " -force" : "";
 
       String addlOpts = cli.getOptionValue('a');
       String addlOptsArg = (addlOpts != null) ? " -a \""+addlOpts+"\"" : "";
@@ -2936,8 +2941,8 @@ public class SolrCLI {
         solrHome = solrHome.substring(cwdPath.length()+1);
 
       String startCmd =
-          String.format(Locale.ROOT, "%s start %s -p %d -s \"%s\" %s %s %s %s %s",
-              callScript, cloudModeArg, port, solrHome, hostArg, zkHostArg, memArg, extraArgs, addlOptsArg);
+          String.format(Locale.ROOT, "%s start %s -p %d -s \"%s\" %s %s %s %s %s %s",
+              callScript, cloudModeArg, port, solrHome, hostArg, zkHostArg, memArg, forceArg, extraArgs, addlOptsArg);
       startCmd = startCmd.replaceAll("\\s+", " ").trim(); // for pretty printing
 
       echo("\nStarting up Solr on port " + port + " using command:");


[32/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
SOLR-10042: Delete old deprecated Admin UI


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/21384b5b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/21384b5b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/21384b5b

Branch: refs/heads/jira/solr-10233
Commit: 21384b5b215a68233cb3ef9edaea14be935570b9
Parents: b5aa0da
Author: Jan Høydahl <ja...@apache.org>
Authored: Thu May 18 14:12:59 2017 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Thu May 18 14:12:59 2017 +0200

----------------------------------------------------------------------
 solr/CHANGES.txt                                |     2 +
 solr/NOTICE.txt                                 |    14 +-
 .../solr/response/VelocityResponseWriter.java   |     1 +
 .../velocity/src/resources/velocity/head.vm     |     2 +-
 solr/example/files/conf/velocity/head.vm        |     2 +-
 .../javacscript-natural-sort-NOTICE.txt         |     5 -
 .../javascript-natural-sort-LICENSE-MIT.txt     |    21 -
 .../conf/velocity/head.vm                       |     2 +-
 solr/webapp/web/WEB-INF/web.xml                 |     5 -
 solr/webapp/web/WEB-INF/weblogic.xml            |    28 -
 solr/webapp/web/css/angular/java-properties.css |    52 +
 solr/webapp/web/css/chosen.css                  |   421 -
 solr/webapp/web/css/styles/analysis.css         |   311 -
 solr/webapp/web/css/styles/cloud.css            |   410 -
 solr/webapp/web/css/styles/common.css           |   731 --
 solr/webapp/web/css/styles/cores.css            |   244 -
 solr/webapp/web/css/styles/dashboard.css        |   155 -
 solr/webapp/web/css/styles/dataimport.css       |   403 -
 solr/webapp/web/css/styles/documents.css        |   197 -
 solr/webapp/web/css/styles/files.css            |    54 -
 solr/webapp/web/css/styles/index.css            |   207 -
 solr/webapp/web/css/styles/java-properties.css  |    52 -
 solr/webapp/web/css/styles/logging.css          |   391 -
 solr/webapp/web/css/styles/menu.css             |   329 -
 solr/webapp/web/css/styles/plugins.css          |   195 -
 solr/webapp/web/css/styles/query.css            |   173 -
 solr/webapp/web/css/styles/replication.css      |   515 -
 solr/webapp/web/css/styles/schema-browser.css   |   578 -
 solr/webapp/web/css/styles/segments.css         |   145 -
 solr/webapp/web/css/styles/threads.css          |   172 -
 solr/webapp/web/index.html                      |     8 +-
 solr/webapp/web/js/angular/app.js               |    82 -
 solr/webapp/web/js/angular/controllers/cloud.js |    98 -
 solr/webapp/web/js/lib/ZeroClipboard.js         |   342 -
 solr/webapp/web/js/lib/chosen.js                |   982 --
 solr/webapp/web/js/lib/console.js               |    29 -
 solr/webapp/web/js/lib/d3.js                    |  9373 --------------
 solr/webapp/web/js/lib/highlight.js             |    31 -
 solr/webapp/web/js/lib/jquery-1.7.2.min.js      |    30 -
 solr/webapp/web/js/lib/jquery.ajaxfileupload.js |   184 -
 solr/webapp/web/js/lib/jquery.blockUI.js        |   523 -
 solr/webapp/web/js/lib/jquery.cookie.js         |    71 -
 solr/webapp/web/js/lib/jquery.form.js           |   806 --
 solr/webapp/web/js/lib/jquery.jstree.js         |  3534 -----
 solr/webapp/web/js/lib/jquery.sammy.js          |  1863 ---
 solr/webapp/web/js/lib/jquery.timeago.js        |   189 -
 solr/webapp/web/js/lib/linker.js                |    48 -
 solr/webapp/web/js/lib/naturalSort.js           |    82 -
 solr/webapp/web/js/lib/order.js                 |   216 -
 solr/webapp/web/js/main.js                      |    60 -
 solr/webapp/web/js/require.js                   | 11349 -----------------
 solr/webapp/web/js/scripts/analysis.js          |   545 -
 solr/webapp/web/js/scripts/app.js               |   669 -
 solr/webapp/web/js/scripts/cloud.js             |   877 --
 solr/webapp/web/js/scripts/cores.js             |   719 --
 solr/webapp/web/js/scripts/dashboard.js         |   562 -
 solr/webapp/web/js/scripts/dataimport.js        |   812 --
 solr/webapp/web/js/scripts/documents.js         |   362 -
 solr/webapp/web/js/scripts/files.js             |   270 -
 solr/webapp/web/js/scripts/index.js             |   340 -
 solr/webapp/web/js/scripts/java-properties.js   |   106 -
 solr/webapp/web/js/scripts/logging.js           |   578 -
 solr/webapp/web/js/scripts/ping.js              |    72 -
 solr/webapp/web/js/scripts/plugins.js           |   462 -
 solr/webapp/web/js/scripts/query.js             |   229 -
 solr/webapp/web/js/scripts/replication.js       |   527 -
 solr/webapp/web/js/scripts/schema-browser.js    |  1229 --
 solr/webapp/web/js/scripts/segments.js          |   206 -
 solr/webapp/web/js/scripts/threads.js           |   158 -
 solr/webapp/web/libs/jquery-1.7.2.min.js        |    30 +
 solr/webapp/web/old.html                        |   169 -
 solr/webapp/web/tpl/analysis.html               |    83 -
 solr/webapp/web/tpl/cloud.html                  |    87 -
 solr/webapp/web/tpl/cores.html                  |   226 -
 solr/webapp/web/tpl/dashboard.html              |   201 -
 solr/webapp/web/tpl/dataimport.html             |   183 -
 solr/webapp/web/tpl/documents.html              |   100 -
 solr/webapp/web/tpl/files.html                  |    44 -
 solr/webapp/web/tpl/index.html                  |   250 -
 solr/webapp/web/tpl/logging.html                |    23 -
 solr/webapp/web/tpl/plugins.html                |    39 -
 solr/webapp/web/tpl/query.html                  |   361 -
 solr/webapp/web/tpl/replication.html            |   216 -
 solr/webapp/web/tpl/schema-browser.html         |   192 -
 solr/webapp/web/tpl/segments.html               |    49 -
 solr/webapp/web/tpl/threads.html                |    56 -
 86 files changed, 91 insertions(+), 46658 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 92e8d8d..3237fde 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -161,6 +161,8 @@ Other Changes
 
 * SOLR-10414: RecoveryStrategy is now a Runnable instead of a Thread. (Tomás Fernández Löbbe)
 
+* SOLR-10042: Delete old deprecated Admin UI, leaving the AngularJS UI the only one supported (janhoy)
+
 ==================  6.7.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/NOTICE.txt b/solr/NOTICE.txt
index 54babbb..d1f4e2f 100644
--- a/solr/NOTICE.txt
+++ b/solr/NOTICE.txt
@@ -25,15 +25,9 @@ Copyright (c) 2012, Michael Bostock, https://github.com/mbostock/d3
 This product includes the highlight.js Javascript library created by Ivan Sagalaev
 Copyright (c) 2006, Ivan Sagalaev, https://github.com/isagalaev/highlight.js
 
-This product includes the ZeroClipboard.js Javascript library created by Jon Rohan, James M. Greene
-Copyright (c) 2012 Jon Rohan, James M. Greene, https://github.com/zeroclipboard/ZeroClipboard
-
 This product includes the Chosen Javascript library created by Patrick Filler
 Copyright (c) 2011-2014 by Harvest, https://github.com/harvesthq/chosen
 
-This product includes jquery.ajaxfileupload.js Javascript library created by Jordan Feldstein
-Copyright (c) 2011 Jordan Feldstein, https://github.com/jfeldstein/jQuery.AjaxFileUpload.js
-
 This product includes jquery.blockUI.js Javascript library created by Mike Alsup
 Copyright (c) 2007-2014 M. Alsup https://github.com/malsup/blockui/
 
@@ -43,18 +37,12 @@ Copyright (c) 2013-2014 Klaus Hartl, https://github.com/carhartl/jquery-cookie
 This product includes jquery.form Javascript library created by Mike Alsup
 Copyright 2006-2014 (c) M. Alsup, https://github.com/malsup/form/
 
-This product includes the jstree Javascript library created by Ivan Bozhanov
+This product includes the jquery.jstree.js Javascript library created by Ivan Bozhanov
 Copyright (c) 2013-2014 Ivan Bozhanov, https://github.com/vakata/jstree
 
-This product includes the Sammy.js Javascript library created by Aaron Quint
-Copyright (c) 2008 Aaron Quint, Quirkey NYC, LLC, https://github.com/quirkey/sammy
-
 This product includes jquery.timeago.js Javascript library by Ryan McGeary
 Copyright (c) 2008-2014, Ryan McGeary, https://github.com/rmm5t/jquery-timeago
 
-This product includes linker.js Javascript library created by Michalis Tzikas & Vasilis Lolos
-Copyright (C) 2011 by Michalis Tzikas & Vasilis Lolos, https://github.com/lolos/jquery-Linker/
-
 This product includes require.js Javascript library created by James Burke
 Copyright (C) 2010-2014 James Burke, https://github.com/jrburke/requirejs
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java
----------------------------------------------------------------------
diff --git a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java
index 133bc63..c17412f 100644
--- a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java
+++ b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java
@@ -42,6 +42,7 @@ import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.util.plugin.SolrCoreAware;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.runtime.RuntimeConstants;
 import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/contrib/velocity/src/resources/velocity/head.vm
----------------------------------------------------------------------
diff --git a/solr/contrib/velocity/src/resources/velocity/head.vm b/solr/contrib/velocity/src/resources/velocity/head.vm
index 38e5f0c..4059294 100644
--- a/solr/contrib/velocity/src/resources/velocity/head.vm
+++ b/solr/contrib/velocity/src/resources/velocity/head.vm
@@ -9,7 +9,7 @@
   <link rel="icon" type="image/x-icon" href="#{url_root}/img/favicon.ico"/>
   <link rel="shortcut icon" type="image/x-icon" href="#{url_root}/img/favicon.ico"/>
 
-  <script type="text/javascript" src="#{url_root}/js/lib/jquery-1.7.2.min.js"></script>
+  <script type="text/javascript" src="#{url_root}/libs/jquery-1.7.2.min.js"></script>
 
   <style>
     #admin{

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/example/files/conf/velocity/head.vm
----------------------------------------------------------------------
diff --git a/solr/example/files/conf/velocity/head.vm b/solr/example/files/conf/velocity/head.vm
index 1b3aec9..3c98747 100644
--- a/solr/example/files/conf/velocity/head.vm
+++ b/solr/example/files/conf/velocity/head.vm
@@ -5,7 +5,7 @@
 <link rel="icon" type="image/x-icon" href="#{url_root}/img/favicon.ico"/>
 <link rel="shortcut icon" type="image/x-icon" href="#{url_root}/img/favicon.ico"/>
 
-<script type="text/javascript" src="#{url_root}/js/lib/jquery-1.7.2.min.js"></script>
+<script type="text/javascript" src="#{url_root}/libs/jquery-1.7.2.min.js"></script>
 <script type="text/javascript" src="#{url_for_solr}/admin/file?file=/velocity/js/jquery.tx3-tag-cloud.js&contentType=text/javascript"></script>
 <script type="text/javascript" src="#{url_for_solr}/admin/file?file=/velocity/js/dropit.js&contentType=text/javascript"></script>
 <script type="text/javascript" src="#{url_for_solr}/admin/file?file=/velocity/js/jquery.autocomplete.js&contentType=text/javascript"></script>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/licenses/javacscript-natural-sort-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/javacscript-natural-sort-NOTICE.txt b/solr/licenses/javacscript-natural-sort-NOTICE.txt
deleted file mode 100644
index 576048b..0000000
--- a/solr/licenses/javacscript-natural-sort-NOTICE.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-javascript-natural-sort is a javascript library for sorting data with embedded
-numbers naturally, the way a human would expect.
-https://github.com/jarinudom/naturalSort.js
-
-javascript-natural-sort is licensed under the MIT license.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/licenses/javascript-natural-sort-LICENSE-MIT.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/javascript-natural-sort-LICENSE-MIT.txt b/solr/licenses/javascript-natural-sort-LICENSE-MIT.txt
deleted file mode 100644
index e7a4eb1..0000000
--- a/solr/licenses/javascript-natural-sort-LICENSE-MIT.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2011 Jim Palmer and other contributors
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/head.vm
----------------------------------------------------------------------
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/head.vm b/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/head.vm
index f1ff5c3..15dc0e8 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/head.vm
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/head.vm
@@ -6,7 +6,7 @@
   <title>#param('title')</title>
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
 
-  <script type="text/javascript" src="#{url_root}/js/lib/jquery-1.7.2.min.js"></script>
+  <script type="text/javascript" src="#{url_root}/libs/jquery-1.7.2.min.js"></script>
   <link rel="stylesheet" type="text/css" href="#{url_for_solr}/admin/file?file=/velocity/main.css&contentType=text/css"/>
   <link rel="stylesheet" href="#{url_for_solr}/admin/file?file=/velocity/jquery.autocomplete.css&contentType=text/css" type="text/css" />
   <link rel="icon" type="image/x-icon" href="#{url_root}/img/favicon.ico"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/solr/webapp/web/WEB-INF/web.xml b/solr/webapp/web/WEB-INF/web.xml
index 5ebce10..a4dc233 100644
--- a/solr/webapp/web/WEB-INF/web.xml
+++ b/solr/webapp/web/WEB-INF/web.xml
@@ -141,11 +141,6 @@
 
   <servlet-mapping>
     <servlet-name>LoadAdminUI</servlet-name>
-    <url-pattern>/old.html</url-pattern>
-  </servlet-mapping>
-
-  <servlet-mapping>
-    <servlet-name>LoadAdminUI</servlet-name>
     <url-pattern>/index.html</url-pattern>
   </servlet-mapping>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/WEB-INF/weblogic.xml
----------------------------------------------------------------------
diff --git a/solr/webapp/web/WEB-INF/weblogic.xml b/solr/webapp/web/WEB-INF/weblogic.xml
deleted file mode 100644
index 43809ee..0000000
--- a/solr/webapp/web/WEB-INF/weblogic.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--
- 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.
--->
-<weblogic-web-app
-    xmlns="http://www.bea.com/ns/weblogic/90"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
-
-    <container-descriptor>
-      <filter-dispatched-requests-enabled>false</filter-dispatched-requests-enabled>
-    </container-descriptor>
-
-</weblogic-web-app>
-

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/angular/java-properties.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/angular/java-properties.css b/solr/webapp/web/css/angular/java-properties.css
new file mode 100644
index 0000000..ab5b67b
--- /dev/null
+++ b/solr/webapp/web/css/angular/java-properties.css
@@ -0,0 +1,52 @@
+/*
+
+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.
+
+*/
+
+#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: 29%;
+}
+
+#content #java-properties li dd
+{
+  float: right;
+  width: 70%
+}
+
+#content #java-properties li dd.odd
+{
+  color: #999;
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/chosen.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/chosen.css b/solr/webapp/web/css/chosen.css
deleted file mode 100644
index 127b3c2..0000000
--- a/solr/webapp/web/css/chosen.css
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
-
-Chosen
-
-- by Patrick Filler for Harvest http://getharvest.com
-- Copyright (c) 2011-2013 by Harvest
-
-Available for use under the MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-/* @group Base */
-.chzn-container {
-  font-size: 13px;
-  position: relative;
-  display: inline-block;
-  zoom: 1;
-  *display: inline;
-}
-.chzn-container .chzn-drop {
-  background: #fff;
-  border: 1px solid #aaa;
-  border-top: 0;
-  position: absolute;
-  top: 29px;
-  left: 0;
-  -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
-  -moz-box-shadow   : 0 4px 5px rgba(0,0,0,.15);
-  -o-box-shadow     : 0 4px 5px rgba(0,0,0,.15);
-  box-shadow        : 0 4px 5px rgba(0,0,0,.15);
-  z-index: 999;
-}
-/* @end */
-
-/* @group Single Chosen */
-.chzn-container-single .chzn-single {
-  background-color: #ffffff;
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );   
-  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
-  background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
-  background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
-  background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
-  background-image: -ms-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
-  background-image: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); 
-  -webkit-border-radius: 5px;
-  -moz-border-radius   : 5px;
-  border-radius        : 5px;
-  -moz-background-clip   : padding;
-  -webkit-background-clip: padding-box;
-  background-clip        : padding-box;
-  border: 1px solid #aaaaaa;
-  -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
-  -moz-box-shadow   : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
-  box-shadow        : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
-  display: block;
-  overflow: hidden;
-  white-space: nowrap;
-  position: relative;
-  height: 23px;
-  line-height: 24px;
-  padding: 0 0 0 8px;
-  color: #444444;
-  text-decoration: none;
-}
-.chzn-container-single .chzn-default {
-  color: #999;
-}
-.chzn-container-single .chzn-single span {
-  margin-right: 26px;
-  display: block;
-  overflow: hidden;
-  white-space: nowrap;
-  -o-text-overflow: ellipsis;
-  -ms-text-overflow: ellipsis;
-  text-overflow: ellipsis;
-}
-.chzn-container-single .chzn-single abbr {
-  display: block;
-  position: absolute;
-  right: 26px;
-  top: 6px;
-  width: 12px;
-  height: 13px;
-  font-size: 1px;
-  background: url(../img/chosen-sprite.png) right top no-repeat;
-}
-.chzn-container-single .chzn-single abbr:hover {
-  background-position: right -11px;
-}
-.chzn-container-single .chzn-single div {
-  position: absolute;
-  right: 0;
-  top: 0;
-  display: block;
-  height: 100%;
-  width: 18px;
-}
-.chzn-container-single .chzn-single div b {
-  background: url('../img/chosen-sprite.png') no-repeat 0 0;
-  display: block;
-  width: 100%;
-  height: 100%;
-}
-.chzn-container-single .chzn-search {
-  padding: 3px 4px;
-  position: relative;
-  margin: 0;
-  white-space: nowrap;
-  z-index: 1010;
-}
-.chzn-container-single .chzn-search input {
-  background: #fff url('../img/chosen-sprite.png') no-repeat 100% -22px;
-  background: url('../img/chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
-  background: url('../img/chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background: url('../img/chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background: url('../img/chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background: url('../img/chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background: url('../img/chosen-sprite.png') no-repeat 100% -22px, linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  margin: 1px 0;
-  padding: 4px 20px 4px 5px;
-  outline: 0;
-  border: 1px solid #aaa;
-  font-family: sans-serif;
-  font-size: 1em;
-}
-.chzn-container-single .chzn-drop {
-  -webkit-border-radius: 0 0 4px 4px;
-  -moz-border-radius   : 0 0 4px 4px;
-  border-radius        : 0 0 4px 4px;
-  -moz-background-clip   : padding;
-  -webkit-background-clip: padding-box;
-  background-clip        : padding-box;
-}
-/* @end */
-
-.chzn-container-single-nosearch .chzn-search input {
-  position: absolute;
-  left: -9000px;
-}
-
-/* @group Multi Chosen */
-.chzn-container-multi .chzn-choices {
-  background-color: #fff;
-  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
-  background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  border: 1px solid #aaa;
-  margin: 0;
-  padding: 0;
-  cursor: text;
-  overflow: hidden;
-  height: auto !important;
-  height: 1%;
-  position: relative;
-}
-.chzn-container-multi .chzn-choices li {
-  float: left;
-  list-style: none;
-}
-.chzn-container-multi .chzn-choices .search-field {
-  white-space: nowrap;
-  margin: 0;
-  padding: 0;
-}
-.chzn-container-multi .chzn-choices .search-field input {
-  color: #666;
-  background: transparent !important;
-  border: 0 !important;
-  font-family: sans-serif;
-  font-size: 100%;
-  height: 15px;
-  padding: 5px;
-  margin: 1px 0;
-  outline: 0;
-  -webkit-box-shadow: none;
-  -moz-box-shadow   : none;
-  -o-box-shadow     : none;
-  box-shadow        : none;
-}
-.chzn-container-multi .chzn-choices .search-field .default {
-  color: #999;
-}
-.chzn-container-multi .chzn-choices .search-choice {
-  -webkit-border-radius: 3px;
-  -moz-border-radius   : 3px;
-  border-radius        : 3px;
-  -moz-background-clip   : padding;
-  -webkit-background-clip: padding-box;
-  background-clip        : padding-box;
-  background-color: #e4e4e4;
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 ); 
-  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
-  background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
-  background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
-  background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
-  background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
-  background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); 
-  -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-  -moz-box-shadow   : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-  box-shadow        : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-  color: #333;
-  border: 1px solid #aaaaaa;
-  line-height: 13px;
-  padding: 3px 20px 3px 5px;
-  margin: 3px 0 3px 5px;
-  position: relative;
-  cursor: default;
-}
-.chzn-container-multi .chzn-choices .search-choice-focus {
-  background: #d4d4d4;
-}
-.chzn-container-multi .chzn-choices .search-choice .search-choice-close {
-  display: block;
-  position: absolute;
-  right: 3px;
-  top: 4px;
-  width: 12px;
-  height: 13px;
-  font-size: 1px;
-  background: url(../img/chosen-sprite.png) right top no-repeat;
-}
-.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
-  background-position: right -11px;
-}
-.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
-  background-position: right -11px;
-}
-/* @end */
-
-/* @group Results */
-.chzn-container .chzn-results {
-  margin: 0 4px 4px 0;
-  max-height: 240px;
-  padding: 0 0 0 4px;
-  position: relative;
-  overflow-x: hidden;
-  overflow-y: auto;
-}
-.chzn-container-multi .chzn-results {
-  margin: -1px 0 0;
-  padding: 0;
-}
-.chzn-container .chzn-results li {
-  display: none;
-  line-height: 15px;
-  padding: 5px 6px;
-  margin: 0;
-  list-style: none;
-}
-.chzn-container .chzn-results .active-result {
-  cursor: pointer;
-  display: list-item;
-}
-.chzn-container .chzn-results .highlighted {
-  background-color: #3875d7;
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );  
-  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
-  background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
-  background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
-  background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
-  background-image: -ms-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
-  background-image: linear-gradient(top, #3875d7 20%, #2a62bc 90%);
-  color: #fff;
-}
-.chzn-container .chzn-results li em {
-  background: #feffde;
-  font-style: normal;
-}
-.chzn-container .chzn-results .highlighted em {
-  background: transparent;
-}
-.chzn-container .chzn-results .no-results {
-  background: #f4f4f4;
-  display: list-item;
-}
-.chzn-container .chzn-results .group-result {
-  cursor: default;
-  color: #999;
-  font-weight: bold;
-}
-.chzn-container .chzn-results .group-option {
-  padding-left: 15px;
-}
-.chzn-container-multi .chzn-drop .result-selected {
-  display: none;
-}
-.chzn-container .chzn-results-scroll {
-  background: white;
-  margin: 0 4px;
-  position: absolute;
-  text-align: center;
-  width: 321px; /* This should by dynamic with js */
-  z-index: 1;
-}
-.chzn-container .chzn-results-scroll span {
-  display: inline-block;
-  height: 17px;
-  text-indent: -5000px;
-  width: 9px;
-}
-.chzn-container .chzn-results-scroll-down {
-  bottom: 0;
-}
-.chzn-container .chzn-results-scroll-down span {
-  background: url('../img/chosen-sprite.png') no-repeat -4px -3px;
-}
-.chzn-container .chzn-results-scroll-up span {
-  background: url('../img/chosen-sprite.png') no-repeat -22px -3px;
-}
-/* @end */
-
-/* @group Active  */
-.chzn-container-active .chzn-single {
-  -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-  -moz-box-shadow   : 0 0 5px rgba(0,0,0,.3);
-  -o-box-shadow     : 0 0 5px rgba(0,0,0,.3);
-  box-shadow        : 0 0 5px rgba(0,0,0,.3);
-  border: 1px solid #5897fb;
-}
-.chzn-container-active .chzn-single-with-drop {
-  border: 1px solid #aaa;
-  -webkit-box-shadow: 0 1px 0 #fff inset;
-  -moz-box-shadow   : 0 1px 0 #fff inset;
-  -o-box-shadow     : 0 1px 0 #fff inset;
-  box-shadow        : 0 1px 0 #fff inset;
-  background-color: #eee;
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
-  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
-  background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
-  background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
-  background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
-  background-image: -ms-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
-  background-image: linear-gradient(top, #eeeeee 20%, #ffffff 80%);
-  -webkit-border-bottom-left-radius : 0;
-  -webkit-border-bottom-right-radius: 0;
-  -moz-border-radius-bottomleft : 0;
-  -moz-border-radius-bottomright: 0;
-  border-bottom-left-radius : 0;
-  border-bottom-right-radius: 0;
-}
-.chzn-container-active .chzn-single-with-drop div {
-  background: transparent;
-  border-left: none;
-}
-.chzn-container-active .chzn-single-with-drop div b {
-  background-position: -18px 1px;
-}
-.chzn-container-active .chzn-choices {
-  -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-  -moz-box-shadow   : 0 0 5px rgba(0,0,0,.3);
-  -o-box-shadow     : 0 0 5px rgba(0,0,0,.3);
-  box-shadow        : 0 0 5px rgba(0,0,0,.3);
-  border: 1px solid #5897fb;
-}
-.chzn-container-active .chzn-choices .search-field input {
-  color: #111 !important;
-}
-/* @end */
-
-/* @group Disabled Support */
-.chzn-disabled {
-  cursor: default;
-  opacity:0.5 !important;
-}
-.chzn-disabled .chzn-single {
-  cursor: default;
-}
-.chzn-disabled .chzn-choices .search-choice .search-choice-close {
-  cursor: default;
-}
-
-/* @group Right to Left */
-.chzn-rtl { text-align: right; }
-.chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
-.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
-
-.chzn-rtl .chzn-single div { left: 3px; right: auto; }
-.chzn-rtl .chzn-single abbr {
-  left: 26px;
-  right: auto;
-}
-.chzn-rtl .chzn-choices .search-field input { direction: rtl; }
-.chzn-rtl .chzn-choices li { float: right; }
-.chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
-.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; background-position: right top;}
-.chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
-.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
-.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
-.chzn-rtl .chzn-search input {
-  background: #fff url('../img/chosen-sprite.png') no-repeat -38px -22px;
-  background: url('../img/chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
-  background: url('../img/chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);  
-  background: url('../img/chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background: url('../img/chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background: url('../img/chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  background: url('../img/chosen-sprite.png') no-repeat -38px -22px, linear-gradient(top, #eeeeee 1%, #ffffff 15%);
-  padding: 4px 5px 4px 20px;
-  direction: rtl;
-}
-/* @end */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/analysis.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/analysis.css b/solr/webapp/web/css/styles/analysis.css
deleted file mode 100644
index 2273f4f..0000000
--- a/solr/webapp/web/css/styles/analysis.css
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #analysis-holder
-{
-  background-image: url( ../../img/div.gif );
-  background-position: 50% 0;
-  background-repeat: repeat-y;
-}
-
-#content #analysis #field-analysis
-{
-  margin-bottom: 0;
-}
-
-#content #analysis #field-analysis .content
-{
-  padding-bottom: 0;
-}
-
-#content #analysis .settings-holder
-{
-  clear: both;
-  padding-top: 15px;
-}
-
-#content #analysis .settings
-{
-  background-color: #fff;
-  border-top: 1px solid #fafafa;
-  border-bottom: 1px solid #fafafa;
-  padding-top: 10px;
-  padding-bottom: 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 #tor_schema
-{
-  background-image: url( ../../img/ico/question-white.png );
-  background-position: 0 50%;
-  color: #c0c0c0;
-  margin-left: 5px;
-  padding-left: 21px;
-}
-
-#content #analysis .settings #tor_schema:hover
-{
-  background-image: url( ../../img/ico/question.png );
-}
-
-#content #analysis .settings #tor_schema span
-{
-  display: none;
-}
-
-#content #analysis .settings #tor_schema:hover span
-{
-  display: inline;
-}
-
-#content #analysis .settings .buttons
-{
-  float: right;
-  width: 47%;
-}
-
-#content #analysis .settings button
-{
-  float: right;
-}
-
-#content #analysis .settings button span
-{
-  background-image: url( ../../img/ico/funnel.png );
-}
-
-#content #analysis .settings .verbose_output
-{
-  float: left;
-  width: auto;
-}
-
-#content #analysis .settings .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 .settings .verbose_output.active a
-{
-  background-image: url( ../../img/ico/ui-check-box.png );
-}
-
-#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: 47%;
-  max-width: 99%;
-}
-
-#content #analysis .query
-{
-  float: right;
-  margin-left: 0.5%;
-  min-width: 47%;
-  max-width: 99%;
-}
-
-#content #analysis .analysis-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 #analysis .analysis-error .head a
-{
-  color: #fff;
-  cursor: auto;
-}
-
-#content #analysis #analysis-result
-{
-  overflow: auto;
-}
-
-#content #analysis #analysis-result .index,
-#content #analysis #analysis-result .query
-{
-  background-color: #fff;
-  padding-top: 20px;
-}
-
-#content #analysis #analysis-result table
-{
-  border-collapse: collapse;
-}
-
-#content #analysis #analysis-result td
-{
-  vertical-align: top;
-  white-space: nowrap;
-}
-
-#content #analysis #analysis-result td.part.analyzer div,
-#content #analysis #analysis-result td.part.spacer .holder,
-#content #analysis #analysis-result td td td
-{
-  padding-top: 1px;
-  padding-bottom: 1px;
-}
-
-#content #analysis #analysis-result td.legend,
-#content #analysis #analysis-result td.data tr.verbose_output
-{
-  display: none;
-}
-
-#content #analysis #analysis-result.verbose_output td.legend
-{
-  display: table-cell;
-}
-
-#content #analysis #analysis-result.verbose_output td.data tr.verbose_output
-{
-  display: table-row;
-}
-
-#content #analysis #analysis-result .match
-{
-  background-color: #e9eff7;
-  background-color: #f2f2ff;
-}
-
-#content #analysis #analysis-result td.part
-{
-  padding-bottom: 10px;
-}
-
-#content #analysis #analysis-result td.part.analyzer div
-{
-  border-right: 1px solid #f0f0f0;
-  padding-right: 10px;
-}
-
-#content #analysis #analysis-result td.part.analyzer abbr
-{
-  color: #c0c0c0;
-}
-
-#content #analysis #analysis-result td.part.legend .holder,
-#content #analysis #analysis-result td.part.data .holder
-{
-  padding-left: 10px;
-  padding-right: 10px;
-  border-right: 1px solid #c0c0c0;
-}
-
-#content #analysis #analysis-result td.part.legend td
-{
-  color: #c0c0c0;
-}
-
-#content #analysis #analysis-result td.part.legend .holder
-{
-  border-right-color: #f0f0f0;
-}
-
-#content #analysis #analysis-result td.part.data:last-child .holder
-{
-  padding-right: 0;
-  border-right: 0;
-}
-
-#content #analysis #analysis-result td.details 
-{
-  padding-left: 10px;
-  padding-right: 10px;
-  border-left: 1px solid #f0f0f0;
-  border-right: 1px solid #f0f0f0;
-}
-
-#content #analysis #analysis-result td.details:first-child
-{
-  padding-left: 0;
-  border-left: 0;
-}
-
-#content #analysis #analysis-result td.details:last-child
-{
-  padding-right: 0;
-  border-right: 0;
-}
-
-#content #analysis #analysis-result td.details tr.empty td
-{
-  color: #f0f0f0;
-}
-
-#content #analysis #analysis-result td.details tr.raw_bytes td
-{
-  letter-spacing: -1px;
-}
-
-#content #analysis #analysis-result .part table table td
-{
-  border-top: 1px solid #f0f0f0;
-}
-
-#content #analysis #analysis-result .part table table tr:first-child td
-{
-  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 ); }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/cloud.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/cloud.css b/solr/webapp/web/css/styles/cloud.css
deleted file mode 100644
index 65b5815..0000000
--- a/solr/webapp/web/css/styles/cloud.css
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #cloud
-{
-  position: relative;
-}
-
-#content #cloud #frame .content
-{
-  display: none;
-}
-
-#content #cloud .loader
-{
-  background-position: 0 50%;
-  padding-left: 21px;
-}
-
-#content #cloud #error
-{
-  background-color: #f00;
-  background-image: url( ../../img/ico/construction.png );
-  background-position: 10px 12px;
-  color: #fff;
-  font-weight: bold;
-  margin-bottom: 20px;
-  padding: 10px;
-  padding-left: 35px;
-}
-
-#content #cloud #error .msg
-{
-  font-style: italic;
-  font-weight: normal;
-  margin-top: 10px;
-}
-
-#content #cloud #debug
-{
-  background-color: #fff;
-  box-shadow: 0px 0px 10px #c0c0c0;
-  -moz-box-shadow: 0px 0px 10px #c0c0c0;
-  -webkit-box-shadow: 0px 0px 10px #c0c0c0;
-  display: none;
-  padding: 20px;
-  position: absolute;
-  left: 50px;
-  top: 10px;
-}
-
-#content #cloud #debug ul
-{
-  margin-bottom: 5px;
-}
-
-#content #cloud #debug ul a
-{
-  background-position: 4px 50%;
-  border-right: 0;
-  display: block;
-  padding: 2px 4px;
-  padding-left: 25px;
-}
-
-#content #cloud #debug ul a:hover,
-#content #cloud #debug ul a.hover
-{
-  background-color: #f0f0f0;
-}
-
-#content #cloud #debug .clipboard
-{
-  float: left;
-  position: relative;
-}
-
-#content #cloud #debug .clipboard a
-{
-  background-image: url( ../../img/ico/clipboard-paste.png );
-  z-index: 98;
-}
-
-#content #cloud #debug .clipboard a:hover,
-#content #cloud #debug .clipboard a.hover,
-#content #cloud #debug .clipboard.copied a
-{
-  background-image: url( ../../img/ico/clipboard-paste-document-text.png );
-}
-
-#content #cloud #debug .close
-{
-  float: right;
-}
-
-#content #cloud #debug .close a
-{
-  background-image: url( ../../img/ico/cross-0.png );
-  padding-left: 21px;
-}
-
-#content #cloud #debug .close a:hover
-{
-  background-image: url( ../../img/ico/cross-1.png );
-}
-
-#content #cloud #debug .debug
-{
-  border: 1px solid #f0f0f0;
-  max-height: 350px;
-  overflow: auto;
-  padding: 5px;
-  width: 500px;
-}
-
-#content #cloud #debug .debug .loader
-{
-  background-position: 5px 50%;
-  display: block;
-  padding: 10px 26px;
-}
-
-#content #cloud .content
-{
-  padding-left: 0;
-  padding-right: 0;
-}
-
-#content #cloud .content.show
-{
-  background-image: url( ../../img/div.gif );
-  background-repeat: repeat-y;
-  background-position: 31% 0;
-}
-
-#content #cloud #tree
-{
-  float: left;
-  width: 30%;
-}
-
-#content #cloud .show #tree
-{
-  overflow: hidden;
-}
-
-#content #cloud #file-content
-{
-  display: none;
-  float: right;
-  position: relative;
-  width: 68%;
-  min-height: 100px
-}
-
-#content #cloud .show #file-content
-{
-  display: block;
-}
-
-#content #cloud #file-content .close
-{
-  background-image: url( ../../img/ico/cross-0.png );
-  background-position: 50% 50%;
-  display: block;
-  height: 20px;
-  position: absolute;
-  right: 0;
-  top: 0;
-  width: 20px;
-}
-
-#content #cloud #file-content .close:hover
-{
-  background-image: url( ../../img/ico/cross-1.png );
-}
-
-#content #cloud #file-content .close span
-{
-  display: none;
-}
-
-#content #cloud #file-content #data
-{
-  border-top: 1px solid #c0c0c0;
-  margin-top: 10px;
-  padding-top: 10px;
-}
-
-#content #cloud #file-content #data pre
-{
-  display: block;
-  max-height: 600px;
-  overflow: auto;
-}
-
-#content #cloud #file-content #data em
-{
-  color: #c0c0c0;
-}
-
-#content #cloud #file-content #prop
-{
-}
-
-#content #cloud #file-content li
-{
-  padding-top: 3px;
-  padding-bottom: 3px;
-}
-
-#content #cloud #file-content li.odd
-{
-  background-color: #F8F8F8;
-}
-
-#content #cloud #file-content li dt
-{
-  float: left;
-  width: 19%;
-}
-
-#content #cloud #file-content li dd
-{
-  float: right;
-  width: 80%;
-}
-
-/* tree */
-
-#content #cloud #legend
-{
-  border: 1px solid #f0f0f0;
-  padding: 10px;
-  position: absolute;
-  right: 0;
-  bottom: 0;
-}
-
-#content #cloud #legend li
-{
-  padding-left: 15px;
-  position: relative;
-}
-
-#content #cloud #legend li svg
-{
-  position: absolute;
-  left: 0;
-  top: 2px;
-}
-
-#content #graph-content
-{
-  min-height: 400px;
-}
-
-#content #graph-content .node
-{
-  fill: #333;
-}
-
-#content #cloud #legend circle,
-#content #graph-content .node circle
-{
-  fill: #fff;
-  stroke: #c0c0c0;
-  stroke-width: 1.5px;
-}
-
-#content #graph-content .node.lvl-3 text
-{
-  cursor: pointer;
-}
-
-#content #graph-content .node.lvl-3:hover circle
-{
-  stroke: #000 !important;
-}
-
-#content #graph-content .node.lvl-3:hover text
-{
-  fill: #000 !important;
-}
-
-#content #graph-content .link
-{
-  fill: none;
-  stroke: #e0e0e0;
-  stroke-width: 1.5px;
-}
-
-#content #cloud #legend .gone circle,
-#content #graph-content .node.gone circle,
-#content #graph-content .link.gone
-{
-  stroke: #f0f0f0;
-}
-
-#content #graph-content .node.gone text
-{
-  fill: #f0f0f0;
-}
-
-#content #cloud #legend ul .gone
-{
-  color: #e0e0e0;
-}
-
-#content #cloud #legend .recovery_failed,
-#content #cloud #legend .recovery_failed circle,
-#content #graph-content .node.recovery_failed circle
-{
-  color: #C43C35;
-  stroke: #C43C35;
-}
-
-#content #graph-content .node.recovery_failed text
-{
-  fill: #C43C35;
-}
-
-#content #cloud #legend .down,
-#content #cloud #legend .down circle,
-#content #graph-content .node.down circle
-{
-  color: #c48f00;
-  stroke: #c48f00;
-}
-
-#content #graph-content .node.down text
-{
-  fill: #c48f00;
-}
-
-#content #cloud #legend .recovering,
-#content #cloud #legend .recovering circle,
-#content #graph-content .node.recovering circle
-{
-  color: #d5dd00;
-  stroke: #d5dd00;
-}
-
-#content #graph-content .node.recovering text
-{
-  fill: #d5dd00;
-}
-
-#content #cloud #legend .active,
-#content #cloud #legend .active circle,
-#content #graph-content .node.active circle
-{
-  color: #57A957;
-  stroke: #57A957;
-}
-
-#content #graph-content .node.active text
-{
-  fill: #57A957;
-}
-
-#content #cloud #legend .leader circle,
-#content #graph-content .node.leader circle
-{
-  fill: #000;
-}
-
-#content #cloud #legend .leader circle
-{
-  stroke: #fff;
-}
-
-#content #graph-content .link.lvl-2,
-#content #graph-content .link.leader
-{
-  stroke: #c0c0c0;
-}
-
-#content #graph-content .node.lvl-0 circle
-{
-  stroke: #fff;
-}
-
-#content #graph-content .link.lvl-1
-{
-  stroke: #fff;
-}
-
-#cloudGraphPaging
-{
-  display: inline-block,
-  padding-top: 15px,
-  padding-bottom: 15px
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/common.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/common.css b/solr/webapp/web/css/styles/common.css
deleted file mode 100644
index 6c0a9fb..0000000
--- a/solr/webapp/web/css/styles/common.css
+++ /dev/null
@@ -1,731 +0,0 @@
-/*
-
-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.
-
-*/
-
-*
-{
-  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: 30px;
-  text-align: center;
-}
-
-a, button
-{
-  cursor: pointer;
-}
-
-input, select, textarea
-{
-  border: 1px solid #c0c0c0;
-  padding: 2px;
-}
-
-input[readonly=readonly]
-{
-  border-color: #f0f0f0;
-}
-
-button
-{
-  background-color: #e6e6e6;
-  background-repeat: no-repeat;
-  background-image: -webkit-gradient( linear, 0 0, 0 100%, from( #ffffff ), color-stop( 25%, #ffffff ), to( #e6e6e6 ) );
-  background-image: -webkit-linear-gradient( #ffffff, #ffffff 25%, #e6e6e6 );
-  background-image: -moz-linear-gradient( top, #ffffff, #ffffff 25%, #e6e6e6 );
-  background-image: -ms-linear-gradient( #ffffff, #ffffff 25%, #e6e6e6 );
-  background-image: -o-linear-gradient( #ffffff, #ffffff 25%, #e6e6e6 );
-  background-image: linear-gradient( #ffffff, #ffffff 25%, #e6e6e6 );
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0 );
-  border: 1px solid #ccc;
-  border-bottom-color: #bbb;
-  -moz-border-radius: 4px;
-  -webkit-border-radius: 4px;
-  -khtml-border-radius: 4px;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.2 ), 0 1px 2px rgba( 0, 0, 0, 0.05 );
-  -moz-box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.2 ), 0 1px 2px rgba( 0, 0, 0, 0.05 );
-  box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.2 ), 0 1px 2px rgba( 0, 0, 0, 0.05 );
-  color: #333;
-  cursor: pointer;
-  display: inline-block;
-  padding: 4px 7px 5px;
-  overflow: visible;
-  text-shadow: 0 1px 1px rgba( 255, 255, 255, 0.75 );
-  -webkit-transition: 0.1s linear background-image;
-  -moz-transition: 0.1s linear background-image;
-  -ms-transition: 0.1s linear background-image;
-  -o-transition: 0.1s linear background-image;
-  transition: 0.1s linear background-image;
-}
-
-button span
-{
-  background-position: 0 50%;
-  display: block;
-  padding-left: 21px;
-}
-
-button[type=submit], button.primary
-{
-  background-color: #0064cd;
-  background-repeat: repeat-x;
-  background-image: -khtml-gradient( linear, left top, left bottom, from( #049cdb ), to( #0064cd ) );
-  background-image: -moz-linear-gradient( top, #049cdb, #0064cd );
-  background-image: -ms-linear-gradient( top, #049cdb, #0064cd );
-  background-image: -webkit-gradient( linear, left top, left bottom, color-stop( 0%, #049cdb ), color-stop( 100%, #0064cd ) );
-  background-image: -webkit-linear-gradient( top, #049cdb, #0064cd );
-  background-image: -o-linear-gradient( top, #049cdb, #0064cd );
-  background-image: linear-gradient( top, #049cdb, #0064cd );
-  border-color: #0064cd #0064cd #003f81;
-  border-color: rgba( 0, 0, 0, 0.1 ) rgba( 0, 0, 0, 0.1 ) rgba( 0, 0, 0, 0.25 );
-  color: #ffffff;
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0 );
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-}
-
-button.success
-{
-  background-color: #57a957;
-  background-repeat: repeat-x;
-  background-image: -khtml-gradient( linear, left top, left bottom, from( #62c462 ), to( #57a957 ) );
-  background-image: -moz-linear-gradient( top, #62c462, #57a957 );
-  background-image: -ms-linear-gradient( top, #62c462, #57a957 );
-  background-image: -webkit-gradient( linear, left top, left bottom, color-stop( 0%, #62c462 ), color-stop( 100%, #57a957 ) );
-  background-image: -webkit-linear-gradient( top, #62c462, #57a957 );
-  background-image: -o-linear-gradient( top, #62c462, #57a957 );
-  background-image: linear-gradient( top, #62c462, #57a957 );
-  border-color: #57a957 #57a957 #3d773d;
-  border-color: rgba( 0, 0, 0, 0.1 ) rgba( 0, 0, 0, 0.1 ) rgba( 0, 0, 0, 0.25 );
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#62c462', endColorstr='#57a957', GradientType=0 );
-  color: #ffffff;
-  text-shadow: 0 -1px 0 rgba( 0, 0, 0, 0.25 );
-}
-
-button.warn
-{
-  background-color: #c43c35;
-  background-repeat: repeat-x;
-  background-image: -khtml-gradient( linear, left top, left bottom, from( #ee5f5b ), to( #c43c35 ) );
-  background-image: -moz-linear-gradient( top, #ee5f5b, #c43c35 );
-  background-image: -ms-linear-gradient( top, #ee5f5b, #c43c35 );
-  background-image: -webkit-gradient( linear, left top, left bottom, color-stop( 0%, #ee5f5b ), color-stop( 100%, #c43c35 ) );
-  background-image: -webkit-linear-gradient( top, #ee5f5b, #c43c35 );
-  background-image: -o-linear-gradient( top, #ee5f5b, #c43c35 );
-  background-image: linear-gradient( top, #ee5f5b, #c43c35 );
-  border-color: #c43c35 #c43c35 #882a25;
-  border-color: rgba( 0, 0, 0, 0.1 ) rgba( 0, 0, 0, 0.1 ) rgba( 0, 0, 0, 0.25 );
-  color: #ffffff;
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0 );
-  text-shadow: 0 -1px 0 rgba( 0, 0, 0, 0.25 );
-}
-
-a
-{
-  text-decoration: none;
-}
-
-pre
-{
-  color: #333;
-  text-align: left;
-}
-
-abbr
-{
-  cursor: help;
-}
-
-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
-{
-  position: relative;
-  margin: 0 auto;
-  margin-bottom: 30px;
-  text-align: left;
-}
-
-#header
-{
-  padding-bottom: 10px;
-  position: fixed;
-  z-index: 42;
-}
-
-.scroll #header
-{
-  position: absolute;
-}
-
-#header #solr
-{
-  background-image: url( ../../img/solr.svg );
-  background-size: 128px;
-  display: block;
-  height: 78px;
-  width: 150px;
-}
-
-#header #solr span
-{
-  display: none;
-}
-
-#main
-{
-  min-width: 750px;
-  position: relative;
-}
-
-#main.error
-{
-  border: 0;
-  min-height: 0;
-  padding-top: 20px;
-}
-
-#main.error .message
-{
-  background-color: #f00;
-  background-image: url( ../../img/ico/construction.png );
-  background-position: 10px 50%;
-  color: #fff;
-  font-weight: bold;
-  margin-left: 150px;
-  margin-bottom: 20px;
-  padding: 10px;
-  padding-left: 35px;
-}
-
-#main.error .code
-{
-  border: 1px solid #c0c0c0;
-  padding: 5px;
-}
-
-#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: 5px 50%;
-  display: none;
-  font-weight: bold;
-  margin-top: 10px;
-  padding: 5px 10px;
-  padding-left: 26px;
-}
-
-.has-environment #environment
-{
-  display: block;
-}
-
-#environment.prod
-{
-  background-color: #c37f7f;
-  color: #fff;
-}
-
-#environment.test
-{
-  background-color: #f5f5b2;
-}
-
-#environment.dev
-{
-  background-color: #cce7cc;
-}
-
-#init-failures
-{
-  border: 1px solid #f00;
-  display: none;
-  margin-left: 150px;
-  margin-bottom: 20px;
-}
-
-#init-failures h2,
-#init-failures ul,
-#init-failures p
-{
-  padding: 10px;
-}
-
-#init-failures h2
-{
-  background-color: #f00;
-  color: #fff;
-  font-weight: bold;
-}
-
-#init-failures p
-{
-  color: #c0c0c0;
-  padding-top: 0;
-}
-
-#content-wrapper
-{
-  margin-left: 150px;
-  border: 1px solid #c0c0c0;
-  min-height: 500px;
-}
-
-#content
-{
-  padding: 10px;
-}
-
-#content > .loader
-{
-  background-position: 0 50%;
-  padding-left: 21px;
-}
-
-#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;
-}
-
-/* syntax */
-
-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.language-json .number
-{
-  color: blue;
-}
-
-pre.syntax.language-json .literal
-{
-  color: firebrick;
-}
-
-pre.syntax .string,
-pre.syntax .tag .value,
-pre.syntax .phpdoc,
-pre.syntax .tex .formula
-{
-  color: #d14;
-}
-
-pre.syntax.language-json .string
-{
-  color: green;
-}
-
-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.language-json .attribute
-{
-  color: black;
-  font-weight: bold;
-}
-
-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;
-}
-
-#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.active
-{
-  background-color: #f0f0f0;
-  color: #00f;
-}
-
-#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;
-}
-
-#connection_status
-{
-  display: none;
-  padding: 30px;
-}
-
-#connection_status span
-{
-  background-image: url( ../../img/ico/network-status-busy.png );
-  background-position: 0 50%;
-  color: #800;
-  padding-left: 26px;
-}
-
-#connection_status.online span,
-#connection_status.online span a
-{
-  color: #080;
-}
-
-#connection_status.online span
-{
-  background-image: url( ../../img/ico/network-status.png );
-}
-
-#connection_status.online span a
-{
-  text-decoration: underline;
-}
-
-#connection_status.online span a:hover
-{
-  text-decoration: none;
-}
-
-#content .address-bar
-{
-  margin-bottom: 10px;
-  background-image: url( ../../img/ico/ui-address-bar.png );
-  background-position: 5px 50%;
-  border: 1px solid #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;
-  overflow: hidden;
-  padding: 5px;
-  padding-left: 26px;
-  white-space: nowrap;
-}
-
-#content .address-bar:focus,
-#content .address-bar: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;
-}
-
-.other-ui-link {
-  margin: 0px;
-  position: absolute;
-  right: 0px;
-  top: -20px;
-}
-
-.other-ui-link span.help {
-  background-image: url( ../../img/ico/information-white.png );
-  right: 0px;
-  padding-left: 16px;
-}
-.other-ui-link a.ul {
-  text-decoration: underline;
-}
-
-.old-ui-warning {
-  position: absolute;
-  right: 0px;
-  top: -20px;
-  align: center;
-  color: red;
-  font-weight: bold;
-}
-.old-ui-warning a.ul {
-  color: red;
-  font-weight: bold;
-  text-decoration: underline;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/cores.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/cores.css b/solr/webapp/web/css/styles/cores.css
deleted file mode 100644
index 6a30588..0000000
--- a/solr/webapp/web/css/styles/cores.css
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #cores
-{
-  position: relative;
-}
-
-#content #cores #ui-block
-{
-  background-color: #fff;
-  height: 200px;
-  display: none;
-  position: absolute;
-  left: -5px;
-  top: 35px;
-  width: 500px;
-}
-
-#content #cores.empty .requires-core
-{
-  display: none;
-}
-
-#content #cores #frame
-{
-  float: right;
-  width: 86%;
-}
-
-#content #cores #navigation
-{
-  padding-top: 50px;
-  width: 12%;
-}
-
-#content #cores #navigation a
-{
-  padding-left: 5px;
-}
-
-#content #cores #frame .actions
-{
-  margin-bottom: 20px;
-  min-height: 30px;
-}
-
-#content #cores .actions div.action
-{
-  width: 300px;
-}
-
-#content #cores .actions div.action .cloud
-{
-  display: none;
-}
-
-#content #cores .actions form .directory-note
-{
-  background-image: url( ../../img/ico/information-white.png );
-  background-position: 22% 1px;
-  color: #c0c0c0;
-}
-
-#content #cores .actions form .error
-{
-  background-image: url( ../../img/ico/cross-button.png );
-  background-position: 22% 1px;
-  color: #c00;
-  font-weight: bold;
-  display: none;
-}
-
-#content #cores .actions form p
-{
-  padding-bottom: 8px;
-}
-
-#content #cores .actions form label
-{
-  float: left;
-  padding-top: 3px;
-  padding-bottom: 3px;
-  text-align: right;
-  width: 25%;
-}
-
-#content #cores .actions form input,
-#content #cores .actions form select,
-#content #cores .actions form .buttons,
-#content #cores .actions form .note span
-{
-  float: right;
-  width: 71%;
-}
-
-#content #cores .actions form .note span
-{
-  padding-left: 3px;
-  padding-right: 3px;
-}
-
-#content #cores .actions form .buttons
-{
-  padding-top: 10px;
-}
-
-#content #cores .actions form button.submit
-{
-  margin-right: 20px;
-}
-
-#content #cores .actions form button.submit span
-{
-  background-image: url( ../../img/ico/tick.png );
-}
-
-#content #cores .actions form button.reset span
-{
-  background-image: url( ../../img/ico/cross.png );
-}
-
-#content #cores .actions #add
-{
-  left: 0;
-  position: absolute;
-}
-
-#content #cores .actions #add span
-{
-  background-image: url( ../../img/ico/plus-button.png );
-}
-
-#content #cores .actions #unload
-{
-  margin-right: 20px;
-}
-
-#content #cores .actions #unload span
-{
-  background-image: url( ../../img/ico/cross.png );
-}
-
-#content #cores .actions #reload span
-{
-  background-image: url( ../../img/ico/arrow-circle.png );
-}
-
-#content #cores .actions #rename span
-{
-  background-image: url( ../../img/ico/ui-text-field-select.png );
-}
-
-#content #cores .actions #swap span
-{
-  background-image: url( ../../img/ico/arrow-switch.png );
-}
-
-#content #cores .actions #optimize
-{
-  display: none;
-}
-
-#content #cores .actions #optimize span
-{
-  background-image: url( ../../img/ico/hammer-screwdriver.png );
-}
-
-#content #cores .actions div.action
-{
-  background-color: #fff;
-  border: 1px solid #f0f0f0;
-  box-shadow: 5px 5px 10px #c0c0c0;
-  -moz-box-shadow: 5px 5px 10px #c0c0c0;
-  -webkit-box-shadow: 5px 5px 10px #c0c0c0;
-  display: none;
-  position: absolute;
-  left: -50px;
-  top: 40px;
-  padding: 10px;
-}
-
-#content #cores #data #core-data h2 { background-image: url( ../../img/ico/box.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;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/dashboard.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/dashboard.css b/solr/webapp/web/css/styles/dashboard.css
deleted file mode 100644
index 8d8fd97..0000000
--- a/solr/webapp/web/css/styles/dashboard.css
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #dashboard .block
-{
-  background-image: none;
-  width: 49%;
-}
-
-#content #dashboard .fieldlist
-{
-  float: left;
-}
-
-#content #dashboard .fieldlist dt,
-#content #dashboard .fieldlist dd
-{
-  display: block;
-  float: left;
-}
-
-#content #dashboard .fieldlist dt
-{
-  clear: left;
-  margin-right: 2%;
-  text-align: right;
-  width: 23%;
-}
-
-#content #dashboard .fieldlist dd
-{
-  width: 74%;
-}
-
-#content #dashboard .fieldlist .index_optimized
-{
-  margin-top: 10px;
-}
-
-#content #dashboard .fieldlist .ico
-{
-  background-image: url( ../../img/ico/slash.png );
-  height: 20px;
-}
-
-#content #dashboard .fieldlist .ico.ico-1
-{
-  background-image: url( ../../img/ico/tick.png );
-}
-
-#content #dashboard .fieldlist .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 #details table thead td span
-{
-  display: none;
-}
-
-#content #dashboard #instance
-{
-  float: right;
-}
-
-#content #dashboard #instance .dir_impl
-{
-  margin-top: 10px;
-}
-
-#content #dashboard #admin-extra
-{
-  float: left;
-}
-
-#content #dashboard #healthcheck
-{
-  float: right;
-}
-
-#content #dashboard #healthcheck .ico
-{
-  background-image: url( ../../img/ico/slash.png );
-  height: 20px;
-  padding-left: 20px;
-  width: 60%;
-}
-
-#content #dashboard #healthcheck .ico.ico-1
-{
-  background-image: url( ../../img/ico/tick.png );
-}
-
-#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.master h2 { background-image: url( ../../img/ico/node-master.png ); }
-#content #dashboard #replication.slave h2 { background-image: url( ../../img/ico/node-slave.png ); }
-#content #dashboard #instance h2 { background-image: url( ../../img/ico/server.png ); }
-#content #dashboard #admin-extra h2 { background-image: url( ../../img/ico/plus-button.png ); }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/dataimport.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/dataimport.css b/solr/webapp/web/css/styles/dataimport.css
deleted file mode 100644
index 0ec196d..0000000
--- a/solr/webapp/web/css/styles/dataimport.css
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
-
-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.
-
-*/
-
-#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 #form #navigation
-{
-  border-right: 0;
-}
-
-#content #dataimport #form #navigation a
-{
-  background-image: url( ../../img/ico/status-offline.png );
-}
-
-#content #dataimport #form #navigation .current a
-{
-  background-image: url( ../../img/ico/status.png );
-}
-
-#content #dataimport #form form
-{
-  display: none;
-  border-top: 1px solid #f0f0f0;
-  margin-top: 10px;
-  padding-top: 5px;
-}
-
-#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 input
-{
-  width: 98%;
-}
-
-#content #dataimport #form button
-{
-  margin-top: 10px;
-}
-
-#content #dataimport #form .execute span
-{
-  background-image: url( ../../img/ico/document-import.png );
-}
-
-#content #dataimport #form .refresh-status span
-{
-  background-image: url( ../../img/ico/arrow-circle.png );
-}
-
-#content #dataimport #form .refresh-status span.success
-{
-  background-image: url( ../../img/ico/tick.png );
-}
-
-#content #dataimport #form #start
-{
-  float: left;
-  width: 47%;
-}
-
-#content #dataimport #form #rows
-{
-  float: right;
-  width: 47%;
-}
-
-#content #dataimport #form .checkbox input
-{
-  margin-bottom: 0;
-  width: auto;
-}
-
-#content #dataimport #form #auto-refresh-status
-{
-  margin-top: 20px;
-}
-
-#content #dataimport #form #auto-refresh-status a
-{
-  background-image: url( ../../img/ico/ui-check-box-uncheck.png );
-  background-position: 0 50%;
-  color: #c0c0c0;
-  display: block;
-  padding-left: 21px;
-}
-
-#content #dataimport #form #auto-refresh-status a.on,
-#content #dataimport #form #auto-refresh-status a:hover
-{
-  color: #333;
-}
-
-#content #dataimport #form #auto-refresh-status a.on
-{
-  background-image: url( ../../img/ico/ui-check-box.png );
-}
-
-#content #dataimport #current_state
-{
-  padding: 10px;
-  margin-bottom: 20px;
-}
-
-#content #dataimport.error #current_state
-{
-  display: none !important;
-}
-
-#content #dataimport #current_state .last_update,
-#content #dataimport #current_state .info
-{
-  display: block;
-  padding-left: 21px;
-}
-
-#content #dataimport #current_state .last_update
-{
-  color: #c0c0c0;
-  font-size: 11px;
-}
-
-#content #dataimport #current_state .info
-{
-  background-position: 0 1px;
-  position: relative;
-}
-
-#content #dataimport #current_state .info .details span
-{
-  color: #c0c0c0;
-}
-
-#content #dataimport #current_state .info .abort-import
-{
-  display: none;
-  position: absolute;
-  right: 0px;
-  top: 0px;
-}
-
-#content #dataimport #current_state .info .abort-import span
-{
-  background-image: url( ../../img/ico/cross.png );
-}
-
-#content #dataimport #current_state .info .abort-import.success span
-{
-  background-image: url( ../../img/ico/tick.png );
-}
-
-#content #dataimport #current_state.indexing
-{
-  background-color: #f9f9f9;
-}
-
-#content #dataimport #current_state.indexing .info
-{
-  background-image: url( ../../img/ico/hourglass.png );
-}
-
-#content #dataimport #current_state.indexing .info .abort-import
-{
-  display: block;
-}
-
-#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.aborted
-{
-  background-color: #f3e6e6;
-}
-
-#content #dataimport #current_state.aborted .info
-{
-  background-image: url( ../../img/ico/slash.png );
-}
-
-#content #dataimport #current_state.aborted .info strong
-{
-  color: #800;
-}
-
-#content #dataimport #current_state.failure
-{
-  background-color: #f3e6e6;
-}
-
-#content #dataimport #current_state.failure .info
-{
-  background-image: url( ../../img/ico/cross-button.png );
-}
-
-#content #dataimport #current_state.failure .info strong
-{
-  color: #800;
-}
-
-#content #dataimport #current_state.idle
-{
-  background-color: #e6e6ff;
-}
-
-#content #dataimport #current_state.idle .info
-{
-  background-image: url( ../../img/ico/information.png );
-}
-
-#content #dataimport #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 .block h2
-{
-  border-color: #c0c0c0;
-  padding-left: 5px;
-  position: relative;
-}
-
-#content #dataimport .block.hidden h2
-{
-  border-color: #fafafa;
-}
-
-#content #dataimport .block h2 a.toggle
-{
-  background-image: url( ../../img/ico/toggle-small.png );
-  background-position: 0 50%;
-  padding-left: 21px;
-}
-
-#content #dataimport .block.hidden h2 a.toggle
-{
-  background-image: url( ../../img/ico/toggle-small-expand.png );
-}
-
-#content #dataimport #config h2 a.r
-{
-  background-position: 3px 50%;
-  display: block;
-  float: right;
-  margin-left: 10px;
-  padding-left: 24px;
-  padding-right: 3px;
-}
-
-#content #dataimport #config h2 a.reload_config
-{
-  background-image: url( ../../img/ico/arrow-circle.png );
-}
-
-#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 h2 a.debug_mode
-{
-  background-image: url( ../../img/ico/hammer.png );
-  color: #c0c0c0;
-}
-
-#content #dataimport #config.debug_mode h2 a.debug_mode
-{
-  background-color: #ff0;
-  background-image: url( ../../img/ico/hammer-screwdriver.png );
-  color: #333;
-}
-
-#content #dataimport .block.hidden .content
-{
-  display: none;
-}
-
-#content #dataimport #config .content
-{
-  padding: 5px 2px;
-}
-
-#content #dataimport #dataimport_config .loader
-{
-  background-position: 0 50%;
-  padding-left: 21px;
-}
-
-#content #dataimport #dataimport_config .formatted
-{
-  border: 1px solid #fff;
-  display: block;
-  padding: 2px;
-}
-
-#content #dataimport .debug_mode #dataimport_config .formatted
-{
-  display: none;
-}
-
-#content #dataimport #dataimport_config .editable
-{
-  display: none;
-}
-
-#content #dataimport .debug_mode #dataimport_config .editable
-{
-  display: block;
-}
-
-#content #dataimport #dataimport_config .editable textarea
-{
-  font-family: monospace;
-  height: 120px;
-  min-height: 60px;
-  width: 100%;
-}
-
-#content #dataimport #debug_response
-{
-  display: none;
-}
-
-#content #dataimport #debug_response em
-{
-  color: #c0c0c0;
-  font-style: normal;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/documents.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/documents.css b/solr/webapp/web/css/styles/documents.css
deleted file mode 100644
index 18c4efc..0000000
--- a/solr/webapp/web/css/styles/documents.css
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #documents
-{
-  background-image: url( ../../img/div.gif );
-  background-position: 45% 0;
-  background-repeat: repeat-y;
-}
-
-#content #documents #form
-{
-  float: left;
-  /*width: 21%;*/
-}
-
-#content #documents #form label
-{
-  cursor: pointer;
-  display: block;
-  margin-top: 5px;
-}
-
-#content #documents #form input,
-#content #documents #form select,
-#content #documents #form textarea
-{
-  margin-bottom: 2px;
-  /*width: 100%;*/
-}
-
-#content #documents #form input,
-#content #documents #form textarea
-{
-  margin-bottom: 2px;
-  /*width: 98%;*/
-}
-
-#content #documents #form #start
-{
-  float: left;
-  /*width: 45%;*/
-}
-
-#content #documents #form #rows
-{
-  float: right;
- /* width: 45%;*/
-}
-
-#content #documents #form .checkbox input
-{
-  margin-bottom: 0;
-  width: auto;
-}
-
-#content #documents #form fieldset,
-#content #documents #form .optional.expanded
-{
-  border: 1px solid #fff;
-  border-top: 1px solid #c0c0c0;
-  margin-bottom: 5px;
-}
-
-#content #documents #form fieldset.common
-{
-  margin-top: 10px;
-}
-
-#content #documents #form fieldset legend,
-#content #documents #form .optional.expanded legend
-{
-  display: block;
-  margin-left: 10px;
-  padding: 0px 5px;
-}
-
-#content #documents #form fieldset legend label
-{
-  margin-top: 0;
-}
-
-#content #documents #form fieldset .fieldset
-{
-  border-bottom: 1px solid #f0f0f0;
-  margin-bottom: 5px;
-  padding-bottom: 10px;
-}
-
-#content #documents #form .optional
-{
-  border: 0;
-}
-
-#content #documents #form .optional .fieldset
-{
-  display: none;
-}
-
-#content #documents #form .optional legend
-{
-  margin-left: 0;
-  padding-left: 0;
-}
-
-#content #documents #form .optional.expanded .fieldset
-{
-  display: block;
-}
-
-#content #documents #file-upload{
-  display: none;
-}
-
-#content #documents #result
-{
-  display: none;
-  float: right;
-  width: 54%;
-}
-
-#content #documents #result #url
-{
-  margin-bottom: 10px;
-  background-image: url( ../../img/ico/ui-address-bar.png );
-  background-position: 5px 50%;
-  border: 1px solid #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;
-  overflow: hidden;
-  padding: 5px;
-  padding-left: 26px;
-  white-space: nowrap;
-}
-
-#content #documents #result #url:focus,
-#content #documents #result #url: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 #documents #result #response
-{
-}
-
-#content #documents #result #response pre
-{
-  padding-left: 20px;
-}
-
-.description{
-  font-weight: bold;
-}
-
-#upload-only{
-  display: none;
-}
-
-#document-type{
-  padding-bottom: 5px;
-}
-
-#wizard{
-  display: none;
-}
-
-#wizard-fields div{
-  padding-top: 5px;
-  padding-bottom: 5px;
-}
-
-#wiz-field-data, #wiz-field-data span{
-  vertical-align: top;
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/css/styles/files.css
----------------------------------------------------------------------
diff --git a/solr/webapp/web/css/styles/files.css b/solr/webapp/web/css/styles/files.css
deleted file mode 100644
index 792cc31..0000000
--- a/solr/webapp/web/css/styles/files.css
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
-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.
-
-*/
-
-#content #files #tree-holder
-{
-  float: left;
-  width: 20%;
-}
-
-#content #files #tree-holder li
-{
-  overflow: hidden;
-}
-
-#content #files form .buttons button
-{
-  float: right;
-}
-
-#content #files #file-content
-{
-  display: none;
-  float: right;
-  position: relative;
-  width: 78%;
-  min-height: 100px
-}
-
-#content #files .show #file-content
-{
-  display: block;
-}
-
-#content #files #file-content .response
-{
-  border: 1px solid transparent;
-  padding: 2px;
-}
\ No newline at end of file


[06/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10307: Allow Passing SSL passwords through environment variables.

Posted by tf...@apache.org.
SOLR-10307: Allow Passing SSL passwords through environment variables.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/0fb89f17
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0fb89f17
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0fb89f17

Branch: refs/heads/jira/solr-10233
Commit: 0fb89f17e1312523a768163db88730b5a0c9191c
Parents: 9e1fcb0
Author: Mark Miller <ma...@apache.org>
Authored: Tue May 16 13:59:29 2017 -0300
Committer: Mark Miller <ma...@apache.org>
Committed: Tue May 16 14:19:16 2017 -0300

----------------------------------------------------------------------
 solr/CHANGES.txt                                |   5 +
 solr/bin/solr                                   |  34 ++----
 solr/bin/solr.cmd                               |  34 ++----
 solr/bin/solr.in.cmd                            |   3 +
 solr/bin/solr.in.sh                             |   3 +
 .../apache/solr/servlet/SolrDispatchFilter.java |   2 +
 .../src/java/org/apache/solr/util/SolrCLI.java  |   7 ++
 .../util/configuration/SSLConfigurations.java   |  78 ++++++++++++
 .../configuration/SSLConfigurationsFactory.java |  49 ++++++++
 .../solr/util/configuration/package-info.java   |  23 ++++
 .../configuration/SSLConfigurationsTest.java    | 121 +++++++++++++++++++
 solr/server/etc/jetty-ssl.xml                   |   4 +-
 12 files changed, 318 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 16c91af..85810ab4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -171,6 +171,11 @@ Jetty 9.3.14.v20161028
 Detailed Change List
 ----------------------
 
+New Features
+----------------------
+
+* SOLR-10307: Allow Passing SSL passwords through environment variables. (Mano Kovacs via Mark Miller)
+
 Other Changes
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/bin/solr
----------------------------------------------------------------------
diff --git a/solr/bin/solr b/solr/bin/solr
index 14d3f59..621ac96 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -163,13 +163,20 @@ fi
 SOLR_URL_SCHEME=http
 SOLR_JETTY_CONFIG=()
 SOLR_SSL_OPTS=""
-if [ -n "$SOLR_SSL_KEY_STORE" ]; then
+if [ -z "$SOLR_SSL_ENABLED" ]; then
+  if [ -n "$SOLR_SSL_KEY_STORE" ]; then
+    SOLR_SSL_ENABLED="true" # implicitly from earlier behaviour
+  else
+    SOLR_SSL_ENABLED="false"
+  fi
+fi
+if [ "$SOLR_SSL_ENABLED" == "true" ]; then
   SOLR_JETTY_CONFIG+=("--module=https")
   SOLR_URL_SCHEME=https
-  SOLR_SSL_OPTS+=" -Dsolr.jetty.keystore=$SOLR_SSL_KEY_STORE"
-  if [ -n "$SOLR_SSL_KEY_STORE_PASSWORD" ]; then
-    SOLR_SSL_OPTS+=" -Dsolr.jetty.keystore.password=$SOLR_SSL_KEY_STORE_PASSWORD"
+  if [ -n "$SOLR_SSL_KEY_STORE" ]; then
+    SOLR_SSL_OPTS+=" -Dsolr.jetty.keystore=$SOLR_SSL_KEY_STORE"
   fi
+
   if [ -n "$SOLR_SSL_KEY_STORE_TYPE" ]; then
     SOLR_SSL_OPTS+=" -Dsolr.jetty.keystore.type=$SOLR_SSL_KEY_STORE_TYPE"
   fi
@@ -177,9 +184,6 @@ if [ -n "$SOLR_SSL_KEY_STORE" ]; then
   if [ -n "$SOLR_SSL_TRUST_STORE" ]; then
     SOLR_SSL_OPTS+=" -Dsolr.jetty.truststore=$SOLR_SSL_TRUST_STORE"
   fi
-  if [ -n "$SOLR_SSL_TRUST_STORE_PASSWORD" ]; then
-    SOLR_SSL_OPTS+=" -Dsolr.jetty.truststore.password=$SOLR_SSL_TRUST_STORE_PASSWORD"
-  fi
   if [ -n "$SOLR_SSL_TRUST_STORE_TYPE" ]; then
     SOLR_SSL_OPTS+=" -Dsolr.jetty.truststore.type=$SOLR_SSL_TRUST_STORE_TYPE"
   fi
@@ -194,9 +198,6 @@ if [ -n "$SOLR_SSL_KEY_STORE" ]; then
   if [ -n "$SOLR_SSL_CLIENT_KEY_STORE" ]; then
     SOLR_SSL_OPTS+=" -Djavax.net.ssl.keyStore=$SOLR_SSL_CLIENT_KEY_STORE"
 
-    if [ -n "$SOLR_SSL_CLIENT_KEY_STORE_PASSWORD" ]; then
-      SOLR_SSL_OPTS+=" -Djavax.net.ssl.keyStorePassword=$SOLR_SSL_CLIENT_KEY_STORE_PASSWORD"
-    fi
     if [ -n "$SOLR_SSL_CLIENT_KEY_STORE_TYPE" ]; then
       SOLR_SSL_OPTS+=" -Djavax.net.ssl.keyStoreType=$SOLR_SSL_CLIENT_KEY_STORE_TYPE"
     fi
@@ -204,9 +205,6 @@ if [ -n "$SOLR_SSL_KEY_STORE" ]; then
     if [ -n "$SOLR_SSL_KEY_STORE" ]; then
       SOLR_SSL_OPTS+=" -Djavax.net.ssl.keyStore=$SOLR_SSL_KEY_STORE"
     fi
-    if [ -n "$SOLR_SSL_KEY_STORE_PASSWORD" ]; then
-      SOLR_SSL_OPTS+=" -Djavax.net.ssl.keyStorePassword=$SOLR_SSL_KEY_STORE_PASSWORD"
-    fi
     if [ -n "$SOLR_SSL_KEY_STORE_TYPE" ]; then
       SOLR_SSL_OPTS+=" -Djavax.net.ssl.keyStoreType=$SOLR_SSL_KEYSTORE_TYPE"
     fi
@@ -215,10 +213,6 @@ if [ -n "$SOLR_SSL_KEY_STORE" ]; then
   if [ -n "$SOLR_SSL_CLIENT_TRUST_STORE" ]; then
     SOLR_SSL_OPTS+=" -Djavax.net.ssl.trustStore=$SOLR_SSL_CLIENT_TRUST_STORE"
 
-    if [ -n "$SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD" ]; then
-      SOLR_SSL_OPTS+=" -Djavax.net.ssl.trustStorePassword=$SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD"
-    fi
-
     if [ -n "$SOLR_SSL_CLIENT_TRUST_STORE_TYPE" ]; then
       SOLR_SSL_OPTS+=" -Djavax.net.ssl.trustStoreType=$SOLR_SSL_CLIENT_TRUST_STORE_TYPE"
     fi
@@ -227,10 +221,6 @@ if [ -n "$SOLR_SSL_KEY_STORE" ]; then
       SOLR_SSL_OPTS+=" -Djavax.net.ssl.trustStore=$SOLR_SSL_TRUST_STORE"
     fi
 
-    if [ -n "$SOLR_SSL_TRUST_STORE_PASSWORD" ]; then
-      SOLR_SSL_OPTS+=" -Djavax.net.ssl.trustStorePassword=$SOLR_SSL_TRUST_STORE_PASSWORD"
-    fi
-
     if [ -n "$SOLR_SSL_TRUST_STORE_TYPE" ]; then
       SOLR_SSL_OPTS+=" -Djavax.net.ssl.trustStoreType=$SOLR_SSL_TRUST_STORE_TYPE"
     fi
@@ -1836,7 +1826,7 @@ function launch_solr() {
 
 
   # If SSL-related system props are set, add them to SOLR_OPTS
-  if [ -n "$SOLR_SSL_OPTS" ]; then
+  if [ "$SOLR_SSL_ENABLED" ]; then
     # If using SSL and solr.jetty.https.port not set explicitly, use the jetty.port
     SSL_PORT_PROP="-Dsolr.jetty.https.port=$SOLR_PORT"
     SOLR_OPTS+=($SOLR_SSL_OPTS "$SSL_PORT_PROP")

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/bin/solr.cmd
----------------------------------------------------------------------
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 1d093b9..820b89f 100644
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -42,13 +42,21 @@ REM Select HTTP OR HTTPS related configurations
 set SOLR_URL_SCHEME=http
 set "SOLR_JETTY_CONFIG=--module=http"
 set "SOLR_SSL_OPTS= "
-IF DEFINED SOLR_SSL_KEY_STORE (
+
+IF NOT DEFINED SOLR_SSL_ENABLED (
+  IF DEFINED SOLR_SSL_KEY_STORE (
+    set "SOLR_SSL_ENABLED=true"
+  ) ELSE (
+    set "SOLR_SSL_ENABLED=false"
+  )
+)
+IF "%SOLR_SSL_ENABLED%"=="true" (
   set "SOLR_JETTY_CONFIG=--module=https"
   set SOLR_URL_SCHEME=https
-  set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.keystore=%SOLR_SSL_KEY_STORE%"
-  IF DEFINED SOLR_SSL_KEY_STORE_PASSWORD (
-    set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.keystore.password=%SOLR_SSL_KEY_STORE_PASSWORD%"
+  IF DEFINED SOLR_SSL_KEY_STORE (
+    set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.keystore=%SOLR_SSL_KEY_STORE%"
   )
+
   IF DEFINED SOLR_SSL_KEY_STORE_TYPE (
     set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.keystore.type=%SOLR_SSL_KEY_STORE_TYPE%"
   )
@@ -56,9 +64,6 @@ IF DEFINED SOLR_SSL_KEY_STORE (
   IF DEFINED SOLR_SSL_TRUST_STORE (
     set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.truststore=%SOLR_SSL_TRUST_STORE%"
   )
-  IF DEFINED SOLR_SSL_TRUST_STORE_PASSWORD (
-    set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.truststore.password=%SOLR_SSL_TRUST_STORE_PASSWORD%"
-  )
   IF DEFINED SOLR_SSL_TRUST_STORE_TYPE (
     set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.truststore.type=%SOLR_SSL_TRUST_STORE_TYPE%"
   )
@@ -73,9 +78,6 @@ IF DEFINED SOLR_SSL_KEY_STORE (
   IF DEFINED SOLR_SSL_CLIENT_KEY_STORE (
     set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStore=%SOLR_SSL_CLIENT_KEY_STORE%"
 
-    IF DEFINED SOLR_SSL_CLIENT_KEY_STORE_PASSWORD (
-      set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_CLIENT_KEY_STORE_PASSWORD%"
-    )
     IF DEFINED SOLR_SSL_CLIENT_KEY_STORE_TYPE (
       set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStoreType=%SOLR_SSL_CLIENT_KEY_STORE_TYPE%"
     )
@@ -83,9 +85,6 @@ IF DEFINED SOLR_SSL_KEY_STORE (
     IF DEFINED SOLR_SSL_KEY_STORE (
       set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStore=%SOLR_SSL_KEY_STORE%"
     )
-    IF DEFINED SOLR_SSL_KEY_STORE_PASSWORD (
-      set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_KEY_STORE_PASSWORD%"
-    )
     IF DEFINED SOLR_SSL_KEY_STORE_TYPE (
       set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStoreType=%SOLR_SSL_KEY_STORE_TYPE%"
     )
@@ -94,10 +93,6 @@ IF DEFINED SOLR_SSL_KEY_STORE (
   IF DEFINED SOLR_SSL_CLIENT_TRUST_STORE (
     set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStore=%SOLR_SSL_CLIENT_TRUST_STORE%"
 
-    IF DEFINED SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD (
-      set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD%"
-    )
-
     IF DEFINED SOLR_SSL_CLIENT_TRUST_STORE_TYPE (
       set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStoreType=%SOLR_SSL_CLIENT_TRUST_STORE_TYPE%"
     )
@@ -105,9 +100,6 @@ IF DEFINED SOLR_SSL_KEY_STORE (
     IF DEFINED SOLR_SSL_TRUST_STORE (
      set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStore=%SOLR_SSL_TRUST_STORE%"
     )
-    IF DEFINED SOLR_SSL_TRUST_STORE_PASSWORD (
-     set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_TRUST_STORE_PASSWORD%"
-    )
     IF DEFINED SOLR_SSL_TRUST_STORE_TYPE (
      set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStoreType=%SOLR_SSL_TRUST_STORE_TYPE%"
     )
@@ -1139,7 +1131,7 @@ IF NOT "%REMOTE_JMX_OPTS%"=="" set "START_OPTS=%START_OPTS% %REMOTE_JMX_OPTS%"
 IF NOT "%SOLR_ADDL_ARGS%"=="" set "START_OPTS=%START_OPTS% %SOLR_ADDL_ARGS%"
 IF NOT "%SOLR_HOST_ARG%"=="" set "START_OPTS=%START_OPTS% %SOLR_HOST_ARG%"
 IF NOT "%SOLR_OPTS%"=="" set "START_OPTS=%START_OPTS% %SOLR_OPTS%"
-IF NOT "%SOLR_SSL_OPTS%"=="" (
+IF "%SOLR_SSL_ENABLED%"=="true" (
   set "SSL_PORT_PROP=-Dsolr.jetty.https.port=%SOLR_PORT%"
   set "START_OPTS=%START_OPTS% %SOLR_SSL_OPTS% !SSL_PORT_PROP!"
 )

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/bin/solr.in.cmd
----------------------------------------------------------------------
diff --git a/solr/bin/solr.in.cmd b/solr/bin/solr.in.cmd
index 279e03e..077b68d 100644
--- a/solr/bin/solr.in.cmd
+++ b/solr/bin/solr.in.cmd
@@ -87,6 +87,9 @@ REM set SOLR_JETTY_HOST=0.0.0.0
 REM Sets the port Solr binds to, default is 8983
 REM set SOLR_PORT=8983
 
+REM Enables HTTPS. It is implictly true if you set SOLR_SSL_KEY_STORE. Use this config
+REM to enable https module with custom jetty configuration.
+REM set SOLR_SSL_ENABLED=true
 REM Uncomment to set SSL-related system properties
 REM Be sure to update the paths to the correct keystore for your environment
 REM set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/bin/solr.in.sh
----------------------------------------------------------------------
diff --git a/solr/bin/solr.in.sh b/solr/bin/solr.in.sh
index 67839f9..6c6c229 100644
--- a/solr/bin/solr.in.sh
+++ b/solr/bin/solr.in.sh
@@ -106,6 +106,9 @@
 # Sets the port Solr binds to, default is 8983
 #SOLR_PORT=8983
 
+# Enables HTTPS. It is implictly true if you set SOLR_SSL_KEY_STORE. Use this config
+# to enable https module with custom jetty configuration.
+#SOLR_SSL_ENABLED=true
 # Uncomment to set SSL-related system properties
 # Be sure to update the paths to the correct keystore for your environment
 #SOLR_SSL_KEY_STORE=/home/shalin/work/oss/shalin-lusolr/solr/server/etc/solr-ssl.keystore.jks

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
index 79e476c..e58a3d8 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
@@ -73,6 +73,7 @@ import org.apache.solr.request.SolrRequestInfo;
 import org.apache.solr.security.AuthenticationPlugin;
 import org.apache.solr.security.PKIAuthenticationPlugin;
 import org.apache.solr.util.SolrFileCleaningTracker;
+import org.apache.solr.util.configuration.SSLConfigurationsFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -139,6 +140,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
   @Override
   public void init(FilterConfig config) throws ServletException
   {
+    SSLConfigurationsFactory.current().init();
     log.trace("SolrDispatchFilter.init(): {}", this.getClass().getClassLoader());
     CoreContainer coresInit = null;
     try{

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index aedb9ed..833e3b4 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -61,6 +61,8 @@ import java.util.stream.Stream;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
+import javax.net.ssl.SSLPeerUnverifiedException;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.GnuParser;
 import org.apache.commons.cli.HelpFormatter;
@@ -114,6 +116,7 @@ import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.ContentStreamBase;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.security.Sha256AuthenticationProvider;
+import org.apache.solr.util.configuration.SSLConfigurationsFactory;
 import org.noggit.CharArr;
 import org.noggit.JSONParser;
 import org.noggit.JSONWriter;
@@ -253,6 +256,8 @@ public class SolrCLI {
       exit(0);
     }
 
+    SSLConfigurationsFactory.current().init();
+
     Tool tool = findTool(args);
     CommandLine cli = parseCmdLine(args, tool.getOptions());
     System.exit(tool.runTool(cli));
@@ -867,6 +872,8 @@ public class SolrCLI {
       while (System.nanoTime() < timeout) {
         try {
           return getStatus(solrUrl);
+        } catch (SSLPeerUnverifiedException exc) {
+            throw exc;
         } catch (Exception exc) {
           if (exceptionIsAuthRelated(exc)) {
             throw exc;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/core/src/java/org/apache/solr/util/configuration/SSLConfigurations.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/configuration/SSLConfigurations.java b/solr/core/src/java/org/apache/solr/util/configuration/SSLConfigurations.java
new file mode 100644
index 0000000..bfa5186
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/util/configuration/SSLConfigurations.java
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+package org.apache.solr.util.configuration;
+
+import java.lang.invoke.MethodHandles;
+import java.util.Map;
+
+import org.apache.solr.common.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Dedicated object to handle Solr configurations
+ */
+public class SSLConfigurations {
+  private final Map<String, String> envVars;
+
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  public static class SysProps {
+    public static final String SSL_KEY_STORE_PASSWORD = "javax.net.ssl.keyStorePassword";
+    public static final String SSL_TRUST_STORE_PASSWORD = "javax.net.ssl.trustStorePassword";
+  }
+
+  public static class EnvVars {
+    public static final String SOLR_SSL_CLIENT_KEY_STORE_PASSWORD = "SOLR_SSL_CLIENT_KEY_STORE_PASSWORD";
+    public static final String SOLR_SSL_KEY_STORE_PASSWORD = "SOLR_SSL_KEY_STORE_PASSWORD";
+    public static final String SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD = "SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD";
+    public static final String SOLR_SSL_TRUST_STORE_PASSWORD = "SOLR_SSL_TRUST_STORE_PASSWORD";
+  }
+
+  /**
+   * @param envVars Map of environment variables to use
+   */
+  public SSLConfigurations(Map<String, String> envVars) {
+    this.envVars = envVars;
+  }
+
+  /** Initiates javax.net.ssl.* system properties from the proper sources. */
+  public void init() {
+
+    String clientKeystorePassword = envVars.get(EnvVars.SOLR_SSL_CLIENT_KEY_STORE_PASSWORD);
+    String keystorePassword = envVars.get(EnvVars.SOLR_SSL_KEY_STORE_PASSWORD);
+
+    String clientTruststorePassword = envVars.get(EnvVars.SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD);
+    String truststorePassword = envVars.get(EnvVars.SOLR_SSL_TRUST_STORE_PASSWORD);
+
+    if (isEmpty(System.getProperty(SysProps.SSL_KEY_STORE_PASSWORD))
+        && !(isEmpty(clientKeystorePassword) && isEmpty(keystorePassword))) {
+      log.debug("Setting {} based on env var", SysProps.SSL_KEY_STORE_PASSWORD);
+      System.setProperty(SysProps.SSL_KEY_STORE_PASSWORD, clientKeystorePassword != null ? clientKeystorePassword : keystorePassword);
+    }
+    if (isEmpty(System.getProperty(SysProps.SSL_TRUST_STORE_PASSWORD))
+        && !(isEmpty(clientTruststorePassword) && isEmpty(truststorePassword))) {
+      log.debug("Setting {} based on env var", SysProps.SSL_TRUST_STORE_PASSWORD);
+      System.setProperty(SysProps.SSL_TRUST_STORE_PASSWORD, clientTruststorePassword != null ? clientTruststorePassword : truststorePassword);
+    }
+  }
+
+  private boolean isEmpty(String str) {
+    return StringUtils.isEmpty(str);
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/core/src/java/org/apache/solr/util/configuration/SSLConfigurationsFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/configuration/SSLConfigurationsFactory.java b/solr/core/src/java/org/apache/solr/util/configuration/SSLConfigurationsFactory.java
new file mode 100644
index 0000000..1da7c01
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/util/configuration/SSLConfigurationsFactory.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package org.apache.solr.util.configuration;
+
+import com.google.common.annotations.VisibleForTesting;
+
+public class SSLConfigurationsFactory {
+  static private SSLConfigurations currentConfigurations;
+
+  /**
+   * Creates if necessary and returns singleton object of Configurations. Can be used for
+   * static accessor of application-wide instance.
+   * @return Configurations object
+   */
+  static public SSLConfigurations current() {
+    if (currentConfigurations == null) {
+      synchronized (SSLConfigurationsFactory.class) {
+        if (currentConfigurations == null) {
+          currentConfigurations = getInstance();
+        }
+      }
+    }
+    return currentConfigurations;
+  }
+
+  private static SSLConfigurations getInstance() {
+    return new SSLConfigurations(System.getenv());
+  }
+
+  @VisibleForTesting
+  static public synchronized void setCurrent(SSLConfigurations configurations) {
+    currentConfigurations = configurations;
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/core/src/java/org/apache/solr/util/configuration/package-info.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/configuration/package-info.java b/solr/core/src/java/org/apache/solr/util/configuration/package-info.java
new file mode 100644
index 0000000..68b7db3
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/util/configuration/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+ 
+/** 
+ * Common Util APIs related to Solr configuration.
+ */
+package org.apache.solr.util.configuration;
+
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/core/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java b/solr/core/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java
new file mode 100644
index 0000000..a1d4696
--- /dev/null
+++ b/solr/core/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+
+package org.apache.solr.util.configuration;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.lucene.util.TestRuleRestoreSystemProperties;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class SSLConfigurationsTest {
+  private Map<String, String> envs;
+  private SSLConfigurations sut;
+
+  public static final String SAMPLE_PW1 = "pw123";
+  public static final String SAMPLE_PW2 = "pw456";
+  public static final String SAMPLE_PW3 = "pw789";
+  public static final String KEY_STORE_PASSWORD = SSLConfigurations.SysProps.SSL_KEY_STORE_PASSWORD;
+  public static final String TRUST_STORE_PASSWORD = SSLConfigurations.SysProps.SSL_TRUST_STORE_PASSWORD;
+
+  @Rule
+  public TestRule syspropRestore = new TestRuleRestoreSystemProperties(
+      SSLConfigurations.SysProps.SSL_KEY_STORE_PASSWORD,
+      SSLConfigurations.SysProps.SSL_TRUST_STORE_PASSWORD
+  );
+
+  @Before
+  public void setUp() {
+    envs = new HashMap<>();
+  }
+
+  private SSLConfigurations createSut() {
+    sut = new SSLConfigurations(envs);
+    return sut;
+  }
+
+  @Test
+  public void testSslConfigKeystorePwFromKeystoreEnvVar() {
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_KEY_STORE_PASSWORD, SAMPLE_PW1);
+    createSut().init();
+    assertThat(System.getProperty(KEY_STORE_PASSWORD), is(SAMPLE_PW1));
+  }
+
+  @Test
+  public void testSslConfigKeystorePwFromClientKeystoreEnvVar() {
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_CLIENT_KEY_STORE_PASSWORD, SAMPLE_PW2);
+    createSut().init();
+    assertThat(System.getProperty(KEY_STORE_PASSWORD), is(SAMPLE_PW2));
+  }
+
+  @Test
+  public void testSslConfigKeystorePwFromBothEnvVars() {
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_KEY_STORE_PASSWORD, SAMPLE_PW1);
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_CLIENT_KEY_STORE_PASSWORD, SAMPLE_PW2);
+    createSut().init();
+    assertThat(System.getProperty(KEY_STORE_PASSWORD), is(SAMPLE_PW2));
+  }
+
+  @Test
+  public void testSslConfigKeystorePwNotOverwrittenIfExists() {
+    System.setProperty(KEY_STORE_PASSWORD, SAMPLE_PW3);
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_KEY_STORE_PASSWORD, SAMPLE_PW1);
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_CLIENT_KEY_STORE_PASSWORD, SAMPLE_PW2);
+    createSut().init();
+    assertThat(System.getProperty(KEY_STORE_PASSWORD), is(SAMPLE_PW3)); // unchanged
+  }
+
+
+  @Test
+  public void testSslConfigTruststorePwFromKeystoreEnvVar() {
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_TRUST_STORE_PASSWORD, SAMPLE_PW1);
+    createSut().init();
+    assertThat(System.getProperty(TRUST_STORE_PASSWORD), is(SAMPLE_PW1));
+  }
+
+  @Test
+  public void testSslConfigTruststorePwFromClientKeystoreEnvVar() {
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD, SAMPLE_PW2);
+    createSut().init();
+    assertThat(System.getProperty(TRUST_STORE_PASSWORD), is(SAMPLE_PW2));
+  }
+
+  @Test
+  public void testSslConfigTruststorePwFromBothEnvVars() {
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_TRUST_STORE_PASSWORD, SAMPLE_PW1);
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD, SAMPLE_PW2);
+    createSut().init();
+    assertThat(System.getProperty(TRUST_STORE_PASSWORD), is(SAMPLE_PW2));
+  }
+
+  @Test
+  public void testSslConfigTruststorePwNotOverwrittenIfExists() {
+    System.setProperty(TRUST_STORE_PASSWORD, SAMPLE_PW3);
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_TRUST_STORE_PASSWORD, SAMPLE_PW1);
+    envs.put(SSLConfigurations.EnvVars.SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD, SAMPLE_PW2);
+    createSut().init();
+    assertThat(System.getProperty(TRUST_STORE_PASSWORD), is(SAMPLE_PW3)); // unchanged
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0fb89f17/solr/server/etc/jetty-ssl.xml
----------------------------------------------------------------------
diff --git a/solr/server/etc/jetty-ssl.xml b/solr/server/etc/jetty-ssl.xml
index 4d85de6..741ac48 100644
--- a/solr/server/etc/jetty-ssl.xml
+++ b/solr/server/etc/jetty-ssl.xml
@@ -8,9 +8,9 @@
 <!-- ============================================================= -->
 <Configure id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
   <Set name="KeyStorePath"><Property name="solr.jetty.keystore" default="./etc/solr-ssl.keystore.jks"/></Set>
-  <Set name="KeyStorePassword"><Property name="solr.jetty.keystore.password" default="secret"/></Set>
+  <Set name="KeyStorePassword"><Env name="SOLR_SSL_KEY_STORE_PASSWORD" default="secret"/></Set>
   <Set name="TrustStorePath"><Property name="solr.jetty.truststore" default="./etc/solr-ssl.keystore.jks"/></Set>
-  <Set name="TrustStorePassword"><Property name="solr.jetty.truststore.password" default="secret"/></Set>
+  <Set name="TrustStorePassword"><Env name="SOLR_SSL_TRUST_STORE_PASSWORD" default="secret"/></Set>
   <Set name="NeedClientAuth"><Property name="solr.jetty.ssl.needClientAuth" default="false"/></Set>
   <Set name="WantClientAuth"><Property name="solr.jetty.ssl.wantClientAuth" default="false"/></Set>
   <Set name="KeyStoreType"><Property name="solr.jetty.keystore.type" default="JKS"/></Set>


[46/50] [abbrv] lucene-solr:jira/solr-10233: Ref Guide: Update list of available zkcli commands from SOLR-10430; rework page a bit

Posted by tf...@apache.org.
Ref Guide: Update list of available zkcli commands from SOLR-10430; rework page a bit


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5f77aa08
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5f77aa08
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5f77aa08

Branch: refs/heads/jira/solr-10233
Commit: 5f77aa089713ae84d3af010f77d2862c9a2528c0
Parents: b77a0a5
Author: Cassandra Targett <ca...@lucidworks.com>
Authored: Thu May 18 13:47:26 2017 -0500
Committer: Cassandra Targett <ca...@lucidworks.com>
Committed: Thu May 18 13:47:26 2017 -0500

----------------------------------------------------------------------
 .../src/command-line-utilities.adoc             | 82 ++++++++++++++------
 1 file changed, 58 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5f77aa08/solr/solr-ref-guide/src/command-line-utilities.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/command-line-utilities.adoc b/solr/solr-ref-guide/src/command-line-utilities.adoc
index 78118c8..511aaa0 100644
--- a/solr/solr-ref-guide/src/command-line-utilities.adoc
+++ b/solr/solr-ref-guide/src/command-line-utilities.adoc
@@ -2,49 +2,80 @@
 :page-shortname: command-line-utilities
 :page-permalink: command-line-utilities.html
 
-Solr's Administration page (found by default at `\http://hostname:8983/solr/`), provides a section with menu items for monitoring indexing and performance statistics.
+A ZooKeeper Command Line Interface (CLI) script is available to allow you to interact directly with Solr configuration files stored in ZooKeeper.
 
-This pag also includes information about index distribution and replication, and information on all threads running in the JVM at the time.
+While Solr's Administration UI includes pages dedicated to the state of your SolrCloud cluster, it does not allow you to download or modify related configuration files.
 
-There is also a section where you can run queries, and an assistance area.
+TIP: See the section <<cloud-screens.adoc#cloud-screens,Cloud Screens>> for more information about using the Admin UI screens.
 
-In addition, SolrCloud provides its own administration page (found at http://localhost:8983/solr/#/~cloud), as well as a few tools available via a ZooKeeper Command Line Utility (CLI). The CLI scripts found in `server/scripts/cloud-scripts` let you upload configuration information to ZooKeeper, in the same two ways that were shown in the examples in <<parameter-reference.adoc#parameter-reference,Parameter Reference>>. It also provides a few other commands that let you link collection sets to collections, make ZooKeeper paths or clear them, and download configurations from ZooKeeper to the local filesystem.
+The ZooKeeper CLI scripts found in `server/scripts/cloud-scripts` let you upload configuration information to ZooKeeper, in the same ways shown in the examples in <<parameter-reference.adoc#parameter-reference,Parameter Reference>>. It also provides a few other commands that let you link collection sets to collections, make ZooKeeper paths or clear them, and download configurations from ZooKeeper to the local filesystem.
 
-.Solr's zkcli.sh vs ZooKeeper's zkCli.sh vs Solr Start Script
+Many of the functions provided by the zkCli.sh script are also provided by the <<solr-control-script-reference.adoc#solr-control-script-reference,Solr Control Script>>, which may be more familiar as the start script ZooKeeper maintenance commands are very similar to Unix commands.
+
+.Solr's zkcli.sh vs ZooKeeper's zkCli.sh
 [IMPORTANT]
 ====
 The `zkcli.sh` provided by Solr is not the same as the https://zookeeper.apache.org/doc/trunk/zookeeperStarted.html#sc_ConnectingToZooKeeper[`zkCli.sh` included in ZooKeeper distributions].
 
 ZooKeeper's `zkCli.sh` provides a completely general, application-agnostic shell for manipulating data in ZooKeeper. Solr's `zkcli.sh` – discussed in this section – is specific to Solr, and has command line arguments specific to dealing with Solr data in ZooKeeper.
-
-Many of the functions provided by the zkCli.sh script are also provided by the <<solr-control-script-reference.adoc#solr-control-script-reference,Solr Control Script Reference>>, which may be more familiar as the start script ZooKeeper maintenance commands are very similar to Unix commands.
 ====
 
 [[CommandLineUtilities-UsingSolr_sZooKeeperCLI]]
 == Using Solr's ZooKeeper CLI
 
+Use the `help` option to get a list of available commands from the script itself, as in `./server/scripts/cloud-scrips/zkcli.sh help`.
+
 Both `zkcli.sh` (for Unix environments) and `zkcli.bat` (for Windows environments) support the following command line options:
 
 // TODO: Change column width to %autowidth.spread when https://github.com/asciidoctor/asciidoctor-pdf/issues/599 is fixed
 
-[cols="10,30,60",options="header"]
-|===
-|Short |Parameter Usage |Meaning
-| |`-cmd <arg>` |CLI Command to be executed: `bootstrap`, `upconfig`, `downconfig`, `linkconfig`, `makepath`, `get`, `getfile`, `put`, `putfile`, `list`, `clear` or `clusterprop`. This parameter is **mandatory**.
-|`-z` |`-zkhost <locations>` |ZooKeeper host address. This parameter is *mandatory* for all CLI commands.
-|`-c` |`-collection <name>` |For `linkconfig`: name of the collection.
-|`-d` |`-confdir <path>` |For `upconfig`: a directory of configuration files. For downconfig: the destination of files pulled from ZooKeeper
-|`-h` |`-help` |Display help text.
-|`-n` |`-confname <arg>` |For `upconfig`, `linkconfig`, `downconfig`: name of the configuration set.
-|`-r` |`-runzk <port>` |Run ZooKeeper internally by passing the Solr run port; only for clusters on one machine.
-|`-s` |`-solrhome <path>` |For `bootstrap` or when using `-runzk`: the *mandatory* solrhome location.
-| |`-name <name>` |For `clusterprop`: the *mandatory* cluster property name.
-| |`-val <value>` |For `clusterprop`: the cluster property value. If not specified, *null* will be used as value.
-|===
+`-cmd <arg>`::
+The CLI Command to be executed. This parameter is *mandatory*. The following commands are supported:
+
+* `bootstrap`
+* `upconfig`
+* `downconfig`
+* `linkconfig`
+* `makepath`
+* `get` and `getfile`
+* `put` and `putfile`
+* `clear`
+* `list`
+* `ls`
+* `clusterprop`
+
+`-z` or `-zkhost <locations>`::
+ZooKeeper host address. This parameter is *mandatory* for all CLI commands.
+
+`-c` or `-collection <name>`::
+For `linkconfig`: name of the collection.
+
+`-d` or `-confdir <path>`::
+For `upconfig`: a directory of configuration files. For downconfig: the destination of files pulled from ZooKeeper
+
+`-h` or `-help`::
+Display help text.
+
+`-n` or `-confname <arg>`::
+For `upconfig`, `linkconfig`, `downconfig`: name of the configuration set.
+
+`-r` or `-runzk <port>`::
+Run ZooKeeper internally by passing the Solr run port; only for clusters on one machine.
 
+`-s` or `-solrhome <path>`:: For `bootstrap` or when using `-runzk`: the *mandatory* solrhome location.
+
+`-name <name>`::
+For `clusterprop`: the *mandatory* cluster property name.
+
+`-val <value>`::
+For `clusterprop`: the cluster property value. If not specified, *null* will be used as value.
+
+[TIP]
+====
 The short form parameter options may be specified with a single dash (eg: `-c mycollection`).
 
 The long form parameter options may be specified using either a single dash (eg: `-collection mycollection`) or a double dash (eg: `--collection mycollection`)
+====
 
 [[CommandLineUtilities-ZooKeeperCLIExamples]]
 == ZooKeeper CLI Examples
@@ -72,7 +103,7 @@ If you are on Windows machine, simply replace `zkcli.sh` with `zkcli.bat` in the
 .Bootstrap with chroot
 [NOTE]
 ====
-Using the boostrap command with a zookeeper chroot in the -zkhost parameter, e.g. `-zkhost 127.0.0.1:2181/solr`, will automatically create the chroot path before uploading the configs.
+Using the boostrap command with a zookeeper chroot in the `-zkhost` parameter, e.g. `-zkhost 127.0.0.1:2181/solr`, will automatically create the chroot path before uploading the configs.
 ====
 
 [[CommandLineUtilities-PutarbitrarydataintoanewZooKeeperfile]]
@@ -102,17 +133,20 @@ Using the boostrap command with a zookeeper chroot in the -zkhost parameter, e.g
 [[CommandLineUtilities-CreateanewZooKeeperpath]]
 === Create a new ZooKeeper path
 
+This can be useful to create a chroot path in ZooKeeper before first cluster start.
+
 [source,bash]
 ----
 ./server/scripts/cloud-scripts/zkcli.sh -zkhost 127.0.0.1:2181 -cmd makepath /solr
 ----
 
-This can be useful to create a chroot path in ZooKeeper before first cluster start.
 
 [[CommandLineUtilities-Setaclusterproperty]]
 === Set a cluster property
 
-This command will add or modify a single cluster property in `clusterprops.json`. Use this command instead of the usual getfile -> edit -> putfile cycle. Unlike the CLUSTERPROP REST API, this command does *not* require a running Solr cluster.
+This command will add or modify a single cluster property in `clusterprops.json`. Use this command instead of the usual getfile -> edit -> putfile cycle.
+
+Unlike the CLUSTERPROP command on the <<collections-api.adoc#CollectionsAPI-clusterprop,Collections API>>, this command does *not* require a running Solr cluster.
 
 [source,bash]
 ----


[36/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7730: Better accuracy for the length normalization factor.

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java
index be6a87b..2bbd0dd 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java
@@ -37,6 +37,7 @@ import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.search.similarities.BM25Similarity;
 import org.apache.lucene.search.similarities.ClassicSimilarity;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
@@ -309,7 +310,7 @@ public class TestPhraseQuery extends LuceneTestCase {
     RandomIndexWriter writer = new RandomIndexWriter(random(), directory, 
         newIndexWriterConfig(new MockAnalyzer(random()))
           .setMergePolicy(newLogMergePolicy())
-          .setSimilarity(new ClassicSimilarity()));
+          .setSimilarity(new BM25Similarity()));
 
     Document doc = new Document();
     doc.add(newTextField("field", "foo firstname lastname foo", Field.Store.YES));
@@ -335,9 +336,9 @@ public class TestPhraseQuery extends LuceneTestCase {
     // each other get a higher score:
     assertEquals(1.0, hits[0].score, 0.01);
     assertEquals(0, hits[0].doc);
-    assertEquals(0.62, hits[1].score, 0.01);
+    assertEquals(0.63, hits[1].score, 0.01);
     assertEquals(1, hits[1].doc);
-    assertEquals(0.43, hits[2].score, 0.01);
+    assertEquals(0.47, hits[2].score, 0.01);
     assertEquals(2, hits[2].doc);
     QueryUtils.check(random(), query,searcher);
     reader.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java b/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
index 8b616b5..ab44297 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
@@ -26,6 +26,7 @@ import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.NumericDocValuesField;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
@@ -49,9 +50,14 @@ public class TestQueryRescorer extends LuceneTestCase {
     return searcher;
   }
 
+  public static IndexWriterConfig newIndexWriterConfig() {
+    // We rely on more tokens = lower score:
+    return LuceneTestCase.newIndexWriterConfig().setSimilarity(new ClassicSimilarity());
+  }
+
   public void testBasic() throws Exception {
     Directory dir = newDirectory();
-    RandomIndexWriter w = new RandomIndexWriter(random(), dir);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig());
 
     Document doc = new Document();
     doc.add(newStringField("id", "0", Field.Store.YES));
@@ -106,7 +112,7 @@ public class TestQueryRescorer extends LuceneTestCase {
   // Test LUCENE-5682
   public void testNullScorerTermQuery() throws Exception {
     Directory dir = newDirectory();
-    RandomIndexWriter w = new RandomIndexWriter(random(), dir);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig());
 
     Document doc = new Document();
     doc.add(newStringField("id", "0", Field.Store.YES));
@@ -145,7 +151,7 @@ public class TestQueryRescorer extends LuceneTestCase {
 
   public void testCustomCombine() throws Exception {
     Directory dir = newDirectory();
-    RandomIndexWriter w = new RandomIndexWriter(random(), dir);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig());
 
     Document doc = new Document();
     doc.add(newStringField("id", "0", Field.Store.YES));
@@ -196,7 +202,7 @@ public class TestQueryRescorer extends LuceneTestCase {
 
   public void testExplain() throws Exception {
     Directory dir = newDirectory();
-    RandomIndexWriter w = new RandomIndexWriter(random(), dir);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig());
 
     Document doc = new Document();
     doc.add(newStringField("id", "0", Field.Store.YES));
@@ -271,7 +277,7 @@ public class TestQueryRescorer extends LuceneTestCase {
 
   public void testMissingSecondPassScore() throws Exception {
     Directory dir = newDirectory();
-    RandomIndexWriter w = new RandomIndexWriter(random(), dir);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig());
 
     Document doc = new Document();
     doc.add(newStringField("id", "0", Field.Store.YES));
@@ -325,7 +331,7 @@ public class TestQueryRescorer extends LuceneTestCase {
   public void testRandom() throws Exception {
     Directory dir = newDirectory();
     int numDocs = atLeast(1000);
-    RandomIndexWriter w = new RandomIndexWriter(random(), dir);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig());
 
     final int[] idToNum = new int[numDocs];
     int maxValue = TestUtil.nextInt(random(), 10, 1000000);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java
index 3faa5c2..41f8832 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java
@@ -17,20 +17,18 @@
 package org.apache.lucene.search;
 
 
-import org.apache.lucene.document.Field;
-import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.util.LuceneTestCase;
-
 import java.io.IOException;
 
-import org.apache.lucene.index.FieldInvertState;
+import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.similarities.ClassicSimilarity;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.document.Document;
+import org.apache.lucene.util.LuceneTestCase;
 
 /** Similarity unit test.
  *
@@ -39,7 +37,7 @@ import org.apache.lucene.document.Document;
 public class TestSimilarity extends LuceneTestCase {
   
   public static class SimpleSimilarity extends ClassicSimilarity {
-    @Override public float lengthNorm(FieldInvertState state) { return 1; }
+    @Override public float lengthNorm(int length) { return 1; }
     @Override public float tf(float freq) { return freq; }
     @Override public float sloppyFreq(int distance) { return 2.0f; }
     @Override public float idf(long docFreq, long docCount) { return 1.0f; }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java b/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java
index fbc0b35..d0b33f1 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java
@@ -17,19 +17,21 @@
 package org.apache.lucene.search;
 
 
+import java.io.IOException;
+
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.MultiDocValues;
 import org.apache.lucene.index.NumericDocValues;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper;
 import org.apache.lucene.search.similarities.Similarity;
-import org.apache.lucene.search.similarities.TFIDFSimilarity;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
@@ -38,7 +40,7 @@ public class TestSimilarityProvider extends LuceneTestCase {
   private Directory directory;
   private DirectoryReader reader;
   private IndexSearcher searcher;
-  
+
   @Override
   public void setUp() throws Exception {
     super.setUp();
@@ -51,7 +53,7 @@ public class TestSimilarityProvider extends LuceneTestCase {
     doc.add(field);
     Field field2 = newTextField("bar", "", Field.Store.NO);
     doc.add(field2);
-    
+
     field.setStringValue("quick brown fox");
     field2.setStringValue("quick brown fox");
     iw.addDocument(doc);
@@ -63,14 +65,14 @@ public class TestSimilarityProvider extends LuceneTestCase {
     searcher = newSearcher(reader);
     searcher.setSimilarity(sim);
   }
-  
+
   @Override
   public void tearDown() throws Exception {
     reader.close();
     directory.close();
     super.tearDown();
   }
-  
+
   public void testBasics() throws Exception {
     // sanity check of norms writer
     // TODO: generalize
@@ -81,7 +83,7 @@ public class TestSimilarityProvider extends LuceneTestCase {
       assertEquals(i, barNorms.nextDoc());
       assertFalse(fooNorms.longValue() == barNorms.longValue());
     }
-    
+
     // sanity check of searching
     TopDocs foodocs = searcher.search(new TermQuery(new Term("foo", "brown")), 10);
     assertTrue(foodocs.totalHits > 0);
@@ -89,11 +91,11 @@ public class TestSimilarityProvider extends LuceneTestCase {
     assertTrue(bardocs.totalHits > 0);
     assertTrue(foodocs.scoreDocs[0].score < bardocs.scoreDocs[0].score);
   }
-  
+
   private static class ExampleSimilarityProvider extends PerFieldSimilarityWrapper {
     private Similarity sim1 = new Sim1();
     private Similarity sim2 = new Sim2();
-    
+
     @Override
     public Similarity get(String field) {
       if (field.equals("foo")) {
@@ -103,80 +105,73 @@ public class TestSimilarityProvider extends LuceneTestCase {
       }
     }
   }
-  
-  private static class Sim1 extends TFIDFSimilarity {
-    
-    @Override
-    public long encodeNormValue(float f) {
-      return (long) f;
-    }
-    
-    @Override
-    public float decodeNormValue(long norm) {
-      return norm;
-    }
 
-    @Override
-    public float lengthNorm(FieldInvertState state) {
-      return 1f;
-    }
+  private static class Sim1 extends Similarity {
 
     @Override
-    public float sloppyFreq(int distance) {
-      return 1f;
+    public long computeNorm(FieldInvertState state) {
+      return 1;
     }
 
     @Override
-    public float tf(float freq) {
-      return 1f;
+    public SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
+      return new SimWeight() {};
     }
 
     @Override
-    public float idf(long docFreq, long docCount) {
-      return 1f;
-    }
+    public SimScorer simScorer(SimWeight weight, LeafReaderContext context) throws IOException {
+      return new SimScorer() {
 
-    @Override
-    public float scorePayload(int doc, int start, int end, BytesRef payload) {
-      return 1f;
+        @Override
+        public float score(int doc, float freq) throws IOException {
+          return 1;
+        }
+
+        @Override
+        public float computeSlopFactor(int distance) {
+          return 1;
+        }
+
+        @Override
+        public float computePayloadFactor(int doc, int start, int end, BytesRef payload) {
+          return 1;
+        }
+      };
     }
+
   }
-  
-  private static class Sim2 extends TFIDFSimilarity {
-    
-    @Override
-    public long encodeNormValue(float f) {
-      return (long) f;
-    }
-    
-    @Override
-    public float decodeNormValue(long norm) {
-      return norm;
-    }
-    
-    @Override
-    public float lengthNorm(FieldInvertState state) {
-      return 10f;
-    }
 
-    @Override
-    public float sloppyFreq(int distance) {
-      return 10f;
-    }
+  private static class Sim2 extends Similarity {
 
     @Override
-    public float tf(float freq) {
-      return 10f;
+    public long computeNorm(FieldInvertState state) {
+      return 10;
     }
 
     @Override
-    public float idf(long docFreq, long docCount) {
-      return 10f;
+    public SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
+      return new SimWeight() {};
     }
 
     @Override
-    public float scorePayload(int doc, int start, int end, BytesRef payload) {
-      return 1f;
+    public SimScorer simScorer(SimWeight weight, LeafReaderContext context) throws IOException {
+      return new SimScorer() {
+
+        @Override
+        public float score(int doc, float freq) throws IOException {
+          return 10;
+        }
+
+        @Override
+        public float computeSlopFactor(int distance) {
+          return 1;
+        }
+
+        @Override
+        public float computePayloadFactor(int doc, int start, int end, BytesRef payload) {
+          return 1;
+        }
+      };
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java b/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
index b2d435d..6cce5fe 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
@@ -42,7 +42,7 @@ public class TestSortRescorer extends LuceneTestCase {
   public void setUp() throws Exception {
     super.setUp();
     dir = newDirectory();
-    RandomIndexWriter iw = new RandomIndexWriter(random(), dir);
+    RandomIndexWriter iw = new RandomIndexWriter(random(), dir, newIndexWriterConfig().setSimilarity(new ClassicSimilarity()));
     
     Document doc = new Document();
     doc.add(newStringField("id", "1", Field.Store.YES));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/similarities/TestAxiomaticSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestAxiomaticSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestAxiomaticSimilarity.java
index 44c7e1d..eca6edc 100644
--- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestAxiomaticSimilarity.java
+++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestAxiomaticSimilarity.java
@@ -20,19 +20,6 @@ import org.apache.lucene.util.LuceneTestCase;
 
 public class TestAxiomaticSimilarity extends LuceneTestCase {
 
-  public void testSaneNormValues() {
-    Axiomatic sim = new AxiomaticF2EXP();
-    for (int i = 0; i < 256; i++) {
-      float len = sim.decodeNormValue((byte) i);
-      assertFalse("negative len: " + len + ", byte=" + i, len < 0.0f);
-      assertFalse("inf len: " + len + ", byte=" + i, Float.isInfinite(len));
-      assertFalse("nan len for byte=" + i, Float.isNaN(len));
-      if (i > 0) {
-        assertTrue("len is not decreasing: " + len + ",byte=" + i, len < sim.decodeNormValue((byte) (i - 1)));
-      }
-    }
-  }
-
   public void testIllegalS() {
     IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new AxiomaticF2EXP(Float.POSITIVE_INFINITY, 0.1f);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java
index dc43406..e54ce25 100644
--- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java
+++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java
@@ -17,23 +17,27 @@
 package org.apache.lucene.search.similarities;
 
 
+import java.io.IOException;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.SegmentInfos;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.Explanation;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.Version;
 
 public class TestBM25Similarity extends LuceneTestCase {
   
-  public void testSaneNormValues() {
-    BM25Similarity sim = new BM25Similarity();
-    for (int i = 0; i < 256; i++) {
-      float len = sim.decodeNormValue((byte) i);
-      assertFalse("negative len: " + len + ", byte=" + i, len < 0.0f);
-      assertFalse("inf len: " + len + ", byte=" + i, Float.isInfinite(len));
-      assertFalse("nan len for byte=" + i, Float.isNaN(len));
-      if (i > 0) {
-        assertTrue("len is not decreasing: " + len + ",byte=" + i, len < sim.decodeNormValue((byte)(i-1)));
-      }
-    }
-  }
-  
   public void testIllegalK1() {
     IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new BM25Similarity(Float.POSITIVE_INFINITY, 0.75f);
@@ -72,4 +76,44 @@ public class TestBM25Similarity extends LuceneTestCase {
     });
     assertTrue(expected.getMessage().contains("illegal b value"));
   }
+
+  public void testLengthEncodingBackwardCompatibility() throws IOException {
+    Similarity similarity = new BM25Similarity();
+    for (int indexCreatedVersionMajor : new int[] { Version.LUCENE_6_0_0.major, Version.LATEST.major}) {
+      for (int length : new int[] {1, 2, 4}) { // these length values are encoded accurately on both cases
+        Directory dir = newDirectory();
+        // set the version on the directory
+        new SegmentInfos(indexCreatedVersionMajor).commit(dir);
+        IndexWriter w = new IndexWriter(dir, newIndexWriterConfig().setSimilarity(similarity));
+        Document doc = new Document();
+        String value = IntStream.range(0, length).mapToObj(i -> "b").collect(Collectors.joining(" "));
+        doc.add(new TextField("foo", value, Store.NO));
+        w.addDocument(doc);
+        IndexReader reader = DirectoryReader.open(w);
+        IndexSearcher searcher = newSearcher(reader);
+        searcher.setSimilarity(similarity);
+        Explanation expl = searcher.explain(new TermQuery(new Term("foo", "b")), 0);
+        Explanation docLen = findExplanation(expl, "fieldLength");
+        assertNotNull(docLen);
+        assertEquals(docLen.toString(), length, (int) docLen.getValue());
+        w.close();
+        reader.close();
+        dir.close();
+      }
+    }
+  }
+
+  private static Explanation findExplanation(Explanation expl, String text) {
+    if (expl.getDescription().equals(text)) {
+      return expl;
+    } else {
+      for (Explanation sub : expl.getDetails()) {
+        Explanation match = findExplanation(sub, text);
+        if (match != null) {
+          return match;
+        }
+      }
+    }
+    return null;
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java
index 23f65d3..c388514 100644
--- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java
+++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java
@@ -34,6 +34,7 @@ import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
+import org.apache.lucene.util.Version;
 
 public class TestBooleanSimilarity extends LuceneTestCase {
 
@@ -105,8 +106,8 @@ public class TestBooleanSimilarity extends LuceneTestCase {
     for (int iter = 0; iter < 100; ++iter) {
       final int length = TestUtil.nextInt(random(), 1, 100);
       final int position = random().nextInt(length);
-      final int numOverlaps = random().nextInt(50);
-      FieldInvertState state = new FieldInvertState("foo", position, length, numOverlaps, 100);
+      final int numOverlaps = random().nextInt(length);
+      FieldInvertState state = new FieldInvertState(Version.LATEST.major, "foo", position, length, numOverlaps, 100);
       assertEquals(
           sim2.computeNorm(state),
           sim1.computeNorm(state),

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java
index be07564..c7f0453 100644
--- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java
+++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java
@@ -19,24 +19,34 @@ package org.apache.lucene.search.similarities;
 
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.StringField;
+import org.apache.lucene.document.TextField;
 import org.apache.lucene.document.Field.Store;
 import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.MultiReader;
+import org.apache.lucene.index.SegmentInfos;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.DisjunctionMaxQuery;
+import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.search.similarities.TFIDFSimilarity.IDFStats;
 import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
+import org.apache.lucene.util.Version;
 
 public class TestClassicSimilarity extends LuceneTestCase {
   private Directory directory;
@@ -63,14 +73,6 @@ public class TestClassicSimilarity extends LuceneTestCase {
     IOUtils.close(indexReader, directory);
     super.tearDown();
   }
-  
-  // Javadocs give this as an example so we test to make sure it's correct:
-  public void testPrecisionLoss() throws Exception {
-    ClassicSimilarity sim = new ClassicSimilarity();
-    float v = sim.decodeNormValue(sim.encodeNormValue(.89f));
-    assertEquals(0.875f, v, 0.0001f);
-  }
-
 
   public void testHit() throws IOException {
     Query query = new TermQuery(new Term("test", "hit"));
@@ -159,16 +161,83 @@ public class TestClassicSimilarity extends LuceneTestCase {
     assertTrue(topDocs.scoreDocs[0].score != 0);
   }
   
-  public void testSaneNormValues() {
+  public void testSaneNormValues() throws IOException {
     ClassicSimilarity sim = new ClassicSimilarity();
     for (int i = 0; i < 256; i++) {
-      float boost = sim.decodeNormValue((byte) i);
+      float boost = TFIDFSimilarity.OLD_NORM_TABLE[i];
+      assertFalse("negative boost: " + boost + ", byte=" + i, boost < 0.0f);
+      assertFalse("inf bost: " + boost + ", byte=" + i, Float.isInfinite(boost));
+      assertFalse("nan boost for byte=" + i, Float.isNaN(boost));
+      if (i > 0) {
+        assertTrue("boost is not increasing: " + boost + ",byte=" + i, boost > TFIDFSimilarity.OLD_NORM_TABLE[i-1]);
+      }
+    }
+
+    TFIDFSimilarity.IDFStats stats = (IDFStats) sim.computeWeight(1f, new IndexSearcher(new MultiReader()).collectionStatistics("foo"));
+    for (int i = 0; i < 256; i++) {
+      float boost = stats.normTable[i];
       assertFalse("negative boost: " + boost + ", byte=" + i, boost < 0.0f);
       assertFalse("inf bost: " + boost + ", byte=" + i, Float.isInfinite(boost));
       assertFalse("nan boost for byte=" + i, Float.isNaN(boost));
       if (i > 0) {
-        assertTrue("boost is not increasing: " + boost + ",byte=" + i, boost > sim.decodeNormValue((byte)(i-1)));
+        assertTrue("boost is not decreasing: " + boost + ",byte=" + i, boost < stats.normTable[i-1]);
       }
     }
   }
+
+  public void testNormEncodingBackwardCompatibility() throws IOException {
+    Similarity similarity = new ClassicSimilarity();
+    for (int indexCreatedVersionMajor : new int[] { Version.LUCENE_6_0_0.major, Version.LATEST.major}) {
+      for (int length : new int[] {1, 4, 16 }) { // these length values are encoded accurately on both cases
+        Directory dir = newDirectory();
+        // set the version on the directory
+        new SegmentInfos(indexCreatedVersionMajor).commit(dir);
+        IndexWriter w = new IndexWriter(dir, newIndexWriterConfig().setSimilarity(similarity));
+        Document doc = new Document();
+        String value = IntStream.range(0, length).mapToObj(i -> "b").collect(Collectors.joining(" "));
+        doc.add(new TextField("foo", value, Store.NO));
+        w.addDocument(doc);
+        IndexReader reader = DirectoryReader.open(w);
+        IndexSearcher searcher = newSearcher(reader);
+        searcher.setSimilarity(similarity);
+        Explanation expl = searcher.explain(new TermQuery(new Term("foo", "b")), 0);
+        Explanation fieldNorm = findExplanation(expl, "fieldNorm");
+        assertNotNull(fieldNorm);
+        assertEquals(fieldNorm.toString(), 1/Math.sqrt(length), fieldNorm.getValue(), 0f);
+        w.close();
+        reader.close();
+        dir.close();
+      }
+    }
+  }
+
+  private static Explanation findExplanation(Explanation expl, String text) {
+    if (expl.getDescription().startsWith(text)) {
+      return expl;
+    } else {
+      for (Explanation sub : expl.getDetails()) {
+        Explanation match = findExplanation(sub, text);
+        if (match != null) {
+          return match;
+        }
+      }
+    }
+    return null;
+  }
+
+  public void testSameNormsAsBM25() {
+    ClassicSimilarity sim1 = new ClassicSimilarity();
+    BM25Similarity sim2 = new BM25Similarity();
+    sim2.setDiscountOverlaps(true);
+    for (int iter = 0; iter < 100; ++iter) {
+      final int length = TestUtil.nextInt(random(), 1, 1000);
+      final int position = random().nextInt(length);
+      final int numOverlaps = random().nextInt(length);
+      FieldInvertState state = new FieldInvertState(Version.LATEST.major, "foo", position, length, numOverlaps, 100);
+      assertEquals(
+          sim2.computeNorm(state),
+          sim1.computeNorm(state),
+          0f);
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java
index 373b9e6..59be73a 100644
--- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java
+++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java
@@ -20,16 +20,23 @@ package org.apache.lucene.search.similarities;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.RandomIndexWriter;
+import org.apache.lucene.index.SegmentInfos;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermContext;
 import org.apache.lucene.search.CollectionStatistics;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
@@ -37,9 +44,13 @@ import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TermStatistics;
 import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.search.similarities.Similarity.SimWeight;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.Version;
+
+import com.carrotsearch.randomizedtesting.generators.RandomPicks;
 
 /**
  * Tests the {@link SimilarityBase}-based Similarities. Contains unit tests and 
@@ -586,11 +597,11 @@ public class TestSimilarityBase extends LuceneTestCase {
   
   // LUCENE-5221
   public void testDiscountOverlapsBoost() throws IOException {
-    ClassicSimilarity expected = new ClassicSimilarity();
+    BM25Similarity expected = new BM25Similarity();
     SimilarityBase actual = new DFRSimilarity(new BasicModelIne(), new AfterEffectB(), new NormalizationH2());
     expected.setDiscountOverlaps(false);
     actual.setDiscountOverlaps(false);
-    FieldInvertState state = new FieldInvertState("foo");
+    FieldInvertState state = new FieldInvertState(Version.LATEST.major, "foo");
     state.setLength(5);
     state.setNumOverlap(2);
     assertEquals(expected.computeNorm(state), actual.computeNorm(state));
@@ -598,64 +609,32 @@ public class TestSimilarityBase extends LuceneTestCase {
     actual.setDiscountOverlaps(true);
     assertEquals(expected.computeNorm(state), actual.computeNorm(state));
   }
-  
-  public void testSaneNormValues() {
-    for (SimilarityBase sim : sims) {
-      for (int i = 0; i < 256; i++) {
-        float len = sim.decodeNormValue((byte) i);
-        assertFalse("negative len: " + len + ", byte=" + i + ", sim=" + sim, len < 0.0f);
-        assertFalse("inf len: " + len + ", byte=" + i + ", sim=" + sim, Float.isInfinite(len));
-        assertFalse("nan len for byte=" + i + ", sim=" + sim, Float.isNaN(len));
-        if (i > 0) {
-          assertTrue("len is not decreasing: " + len + ",byte=" + i + ",sim=" + sim, len < sim.decodeNormValue((byte)(i-1)));
-        }
-      }
-    }
-  }
-  
-  /**
-   * make sure the similarity does not go crazy when tested against all possible norm values.
-   */
-  public void testCrazyIndexTimeBoosts() throws Exception {
-    long avgLength = 750;
-    long docCount = 500000;
-    long numTokens = docCount * avgLength;
-   
-    CollectionStatistics collectionStats = new CollectionStatistics("body", docCount, docCount, numTokens, numTokens);
-    
-    long docFreq = 2000;
-    long totalTermFreq = 2000 * avgLength;
-    
-    TermStatistics termStats = new TermStatistics(new BytesRef("term"), docFreq, totalTermFreq);
-    
-    for (SimilarityBase sim : sims) {
-      if (sim instanceof IBSimilarity) {
-        if (((IBSimilarity)sim).getDistribution() instanceof DistributionSPL) {
-          // score goes infinite for tiny doc lengths and negative for huge doc lengths
-          // TODO: fix this
-          continue;
-        }
-      } else if (sim instanceof DFRSimilarity) {
-        BasicModel model = ((DFRSimilarity)sim).getBasicModel();
-        if (model instanceof BasicModelD || model instanceof BasicModelP) {
-          // score goes NaN for tiny doc lengths
-          // TODO: fix this
-          continue;
-        } else if (model instanceof BasicModelBE) {
-          // score goes negative infinity for tiny doc lengths
-          // TODO: fix this
-          continue;
-        }
-      }
-      BasicStats stats = (BasicStats) sim.computeWeight(1f, collectionStats, termStats);
-      for (float tf = 1.0f; tf <= 10.0f; tf += 1.0f) {
-        for (int i = 0; i < 256; i++) {
-          float len = sim.decodeNormValue((byte) i);
-          float score = sim.score(stats, tf, len);
-          assertFalse("negative score for " + sim + ", len=" + len + ",score=" + score, score < 0.0f);
-          assertFalse("inf score for " + sim + ", len=" + len, Float.isInfinite(score));
-          assertFalse("nan score for " + sim + ", len=" + len, Float.isNaN(score));
-        }
+
+  public void testLengthEncodingBackwardCompatibility() throws IOException {
+    Similarity similarity = RandomPicks.randomFrom(random(), sims);
+    for (int indexCreatedVersionMajor : new int[] { Version.LUCENE_6_0_0.major, Version.LATEST.major}) {
+      for (int length : new int[] {1, 2, 4}) { // these length values are encoded accurately on both cases
+        Directory dir = newDirectory();
+        // set the version on the directory
+        new SegmentInfos(indexCreatedVersionMajor).commit(dir);
+        IndexWriter w = new IndexWriter(dir, newIndexWriterConfig().setSimilarity(similarity));
+        Document doc = new Document();
+        String value = IntStream.range(0, length).mapToObj(i -> "b").collect(Collectors.joining(" "));
+        doc.add(new TextField("foo", value, Store.NO));
+        w.addDocument(doc);
+        IndexReader reader = DirectoryReader.open(w);
+        IndexSearcher searcher = newSearcher(reader);
+        searcher.setSimilarity(similarity);
+        Term term = new Term("foo", "b");
+        TermContext context = TermContext.build(reader.getContext(), term);
+        SimWeight simWeight = similarity.computeWeight(1f, searcher.collectionStatistics("foo"), searcher.termStatistics(term, context));
+        SimilarityBase.BasicSimScorer simScorer = (SimilarityBase.BasicSimScorer) similarity.simScorer(simWeight, reader.leaves().get(0));
+        float docLength = simScorer.getLengthValue(0);
+        assertEquals(length, (int) docLength);
+        
+        w.close();
+        reader.close();
+        dir.close();
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/util/TestSmallFloat.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestSmallFloat.java b/lucene/core/src/test/org/apache/lucene/util/TestSmallFloat.java
index 86c6bb8..dca5f2d 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestSmallFloat.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestSmallFloat.java
@@ -16,6 +16,8 @@
  */
 package org.apache.lucene.util;
 
+import java.util.Arrays;
+
 public class TestSmallFloat extends LuceneTestCase {
 
   // original lucene byteToFloat
@@ -87,10 +89,6 @@ public class TestSmallFloat extends LuceneTestCase {
       float f3 = SmallFloat.byte315ToFloat((byte)i);
       assertEquals(f1,f2,0.0);
       assertEquals(f2,f3,0.0);
-
-      float f4 = SmallFloat.byteToFloat((byte)i,5,2);
-      float f5 = SmallFloat.byte52ToFloat((byte)i);
-      assertEquals(f4,f5,0.0);
     }
   }
 
@@ -121,10 +119,51 @@ public class TestSmallFloat extends LuceneTestCase {
       byte b3 = SmallFloat.floatToByte315(f);
       assertEquals(b1,b2);
       assertEquals(b2,b3);
+    }
+  }
+
+  public void testInt4() {
+    for (int i = 0; i <= 16; ++i) {
+      // all values in 0-16 are encoded accurately
+      assertEquals(i, SmallFloat.int4ToLong(SmallFloat.longToInt4(i)));
+    }
+    final int maxEncoded = SmallFloat.longToInt4(Long.MAX_VALUE);
+    for (int i = 1; i < maxEncoded; ++i) {
+      assertTrue(SmallFloat.int4ToLong(i) > SmallFloat.int4ToLong(i - 1));
+    }
+    final int iters = atLeast(1000);
+    for (int iter = 0; iter < iters; ++iter) {
+      final long l = TestUtil.nextLong(random(), 0, 1L << TestUtil.nextInt(random(), 5, 61));
+      int numBits = 64 - Long.numberOfLeadingZeros(l);
+      long expected = l;
+      if (numBits > 4) {
+        long mask = ~0L << (numBits - 4);
+        expected &= mask;
+      }
+      long l2 = SmallFloat.int4ToLong(SmallFloat.longToInt4(l));
+      assertEquals(expected, l2);
+    }
+  }
 
-      byte b4 = SmallFloat.floatToByte(f,5,2);
-      byte b5 = SmallFloat.floatToByte52(f);
-      assertEquals(b4,b5);
+  public void testByte4() {
+    int[] decoded = new int[256];
+    for (int b = 0; b < 256; ++b) {
+      decoded[b] = SmallFloat.byte4ToInt((byte) b);
+      assertEquals((byte) b, SmallFloat.intToByte4(decoded[b]));
+    }
+    for (int i = 1; i < 256; ++i) {
+      assertTrue(decoded[i] > decoded[i-1]);
+    }
+    assertEquals((byte) 255, SmallFloat.intToByte4(Integer.MAX_VALUE));
+    final int iters = atLeast(1000);
+    for (int iter = 0; iter < iters; ++iter) {
+      final int i = random().nextInt(1 << TestUtil.nextInt(random(), 5, 30));
+      int idx = Arrays.binarySearch(decoded, i);
+      if (idx < 0) {
+        idx = -2 - idx;
+      }
+      assertTrue(decoded[idx] <= i);
+      assertEquals((byte) idx, SmallFloat.intToByte4(i));
     }
   }
 
@@ -146,5 +185,4 @@ public class TestSmallFloat extends LuceneTestCase {
     }
   }
   ***/
-
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionRescorer.java
----------------------------------------------------------------------
diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionRescorer.java b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionRescorer.java
index 98012a5..20a6eba 100644
--- a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionRescorer.java
+++ b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionRescorer.java
@@ -44,7 +44,7 @@ public class TestExpressionRescorer extends LuceneTestCase {
   public void setUp() throws Exception {
     super.setUp();
     dir = newDirectory();
-    RandomIndexWriter iw = new RandomIndexWriter(random(), dir);
+    RandomIndexWriter iw = new RandomIndexWriter(random(), dir, newIndexWriterConfig().setSimilarity(new ClassicSimilarity()));
     
     Document doc = new Document();
     doc.add(newStringField("id", "1", Field.Store.YES));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
----------------------------------------------------------------------
diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
index c37709b..d03432e 100644
--- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
+++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
@@ -72,6 +72,8 @@ import org.apache.lucene.search.PhraseQuery.Builder;
 import org.apache.lucene.search.PrefixQuery;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.RegexpQuery;
+import org.apache.lucene.search.Sort;
+import org.apache.lucene.search.SortField;
 import org.apache.lucene.search.SynonymQuery;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TermRangeQuery;
@@ -147,7 +149,7 @@ public class HighlighterTest extends BaseTokenStreamTestCase implements Formatte
     CustomScoreQuery query = new CustomScoreQuery(termQuery);
 
     searcher = newSearcher(reader);
-    TopDocs hits = searcher.search(query, 10);
+    TopDocs hits = searcher.search(query, 10, new Sort(SortField.FIELD_DOC, SortField.FIELD_SCORE));
     assertEquals(2, hits.totalHits);
     QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
     Highlighter highlighter = new Highlighter(scorer);
@@ -199,7 +201,7 @@ public class HighlighterTest extends BaseTokenStreamTestCase implements Formatte
     query.add(new Term(FIELD_NAME, "very"));
 
     searcher = newSearcher(reader);
-    TopDocs hits = searcher.search(query, 10);
+    TopDocs hits = searcher.search(query, 10, new Sort(SortField.FIELD_DOC, SortField.FIELD_SCORE));
     assertEquals(2, hits.totalHits);
     QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
     Highlighter highlighter = new Highlighter(scorer);
@@ -271,7 +273,7 @@ public class HighlighterTest extends BaseTokenStreamTestCase implements Formatte
     };
 
     searcher = newSearcher(reader);
-    TopDocs hits = searcher.search(query, 10);
+    TopDocs hits = searcher.search(query, 10, new Sort(SortField.FIELD_DOC, SortField.FIELD_SCORE));
     assertEquals(2, hits.totalHits);
     QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
     Highlighter highlighter = new Highlighter(scorer);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
----------------------------------------------------------------------
diff --git a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
index a1f2b07..a409a17 100644
--- a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
+++ b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
@@ -892,7 +892,7 @@ public class MemoryIndex {
 
     NumericDocValues getNormDocValues() {
       if (norm == null) {
-        FieldInvertState invertState = new FieldInvertState(fieldInfo.name, fieldInfo.number,
+        FieldInvertState invertState = new FieldInvertState(Version.LATEST.major, fieldInfo.name, fieldInfo.number,
             numTokens, numOverlapTokens, 0);
         final long value = normSimilarity.computeNorm(invertState);
         if (DEBUG) System.err.println("MemoryIndexReader.norms: " + fieldInfo.name + ":" + value + ":" + numTokens);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java
----------------------------------------------------------------------
diff --git a/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java b/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java
index 1e20f30..3d3a12c 100644
--- a/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java
+++ b/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java
@@ -50,6 +50,7 @@ import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.NumericDocValues;
 import org.apache.lucene.index.PostingsEnum;
 import org.apache.lucene.index.SortedDocValues;
@@ -57,13 +58,16 @@ import org.apache.lucene.index.SortedNumericDocValues;
 import org.apache.lucene.index.SortedSetDocValues;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermsEnum;
+import org.apache.lucene.search.CollectionStatistics;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.search.TermStatistics;
 import org.apache.lucene.search.similarities.BM25Similarity;
 import org.apache.lucene.search.similarities.ClassicSimilarity;
+import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
@@ -145,32 +149,32 @@ public class TestMemoryIndex extends LuceneTestCase {
 
     assertEquals(reader.getTermVectors(0).size(), 1);
   }
-  
+
   public void testReaderConsistency() throws IOException {
     Analyzer analyzer = new MockPayloadAnalyzer();
-    
+
     // defaults
     MemoryIndex mi = new MemoryIndex();
     mi.addField("field", "some terms be here", analyzer);
     TestUtil.checkReader(mi.createSearcher().getIndexReader());
-    
+
     // all combinations of offsets/payloads options
     mi = new MemoryIndex(true, true);
     mi.addField("field", "some terms be here", analyzer);
     TestUtil.checkReader(mi.createSearcher().getIndexReader());
-    
+
     mi = new MemoryIndex(true, false);
     mi.addField("field", "some terms be here", analyzer);
     TestUtil.checkReader(mi.createSearcher().getIndexReader());
-    
+
     mi = new MemoryIndex(false, true);
     mi.addField("field", "some terms be here", analyzer);
     TestUtil.checkReader(mi.createSearcher().getIndexReader());
-    
+
     mi = new MemoryIndex(false, false);
     mi.addField("field", "some terms be here", analyzer);
     TestUtil.checkReader(mi.createSearcher().getIndexReader());
-    
+
     analyzer.close();
   }
 
@@ -187,11 +191,23 @@ public class TestMemoryIndex extends LuceneTestCase {
     float n1 = norms.longValue();
 
     // Norms are re-computed when we change the Similarity
-    mi.setSimilarity(new ClassicSimilarity() {
+    mi.setSimilarity(new Similarity() {
+
       @Override
-      public float lengthNorm(FieldInvertState state) {
+      public long computeNorm(FieldInvertState state) {
         return 74;
       }
+
+      @Override
+      public SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
+        throw new UnsupportedOperationException();
+      }
+
+      @Override
+      public SimScorer simScorer(SimWeight weight, LeafReaderContext context) throws IOException {
+        throw new UnsupportedOperationException();
+      }
+
     });
     norms = reader.getNormValues("f1");
     assertEquals(0, norms.nextDoc());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java b/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java
index 9307b94..8cc962d 100644
--- a/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java
+++ b/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java
@@ -17,7 +17,6 @@
 package org.apache.lucene.misc;
 
 import org.apache.lucene.search.similarities.ClassicSimilarity;
-import org.apache.lucene.index.FieldInvertState;
 
 /**
  * <p>
@@ -86,7 +85,7 @@ public class SweetSpotSimilarity extends ClassicSimilarity {
    * Sets the default function variables used by lengthNorm when no field
    * specific variables have been set.
    *
-   * @see #computeLengthNorm
+   * @see #lengthNorm
    */
   public void setLengthNormFactors(int min, int max, float steepness, boolean discountOverlaps) {
     this.ln_min = min;
@@ -94,25 +93,6 @@ public class SweetSpotSimilarity extends ClassicSimilarity {
     this.ln_steep = steepness;
     this.discountOverlaps = discountOverlaps;
   }
-    
-  /**
-   * Implemented as <code> state.getBoost() *
-   * computeLengthNorm(numTokens) </code> where
-   * numTokens does not count overlap tokens if
-   * discountOverlaps is true by default or true for this
-   * specific field. 
-   */
-  @Override
-  public float lengthNorm(FieldInvertState state) {
-    final int numTokens;
-
-    if (discountOverlaps)
-      numTokens = state.getLength() - state.getNumOverlap();
-    else
-      numTokens = state.getLength();
-
-    return computeLengthNorm(numTokens);
-  }
 
   /**
    * Implemented as:
@@ -133,7 +113,8 @@ public class SweetSpotSimilarity extends ClassicSimilarity {
    * @see #setLengthNormFactors
    * @see <a href="doc-files/ss.computeLengthNorm.svg">An SVG visualization of this function</a> 
    */
-  public float computeLengthNorm(int numTerms) {
+  @Override
+  public float lengthNorm(int numTerms) {
     final int l = ln_min;
     final int h = ln_max;
     final float s = ln_steep;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java b/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java
index cd6a819..d21a3ea 100644
--- a/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java
+++ b/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java
@@ -16,27 +16,62 @@
  */
 package org.apache.lucene.misc;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.Explanation;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.similarities.ClassicSimilarity;
 import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper;
 import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.search.similarities.TFIDFSimilarity;
+import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.index.FieldInvertState;
 
 /**
  * Test of the SweetSpotSimilarity
  */
 public class SweetSpotSimilarityTest extends LuceneTestCase {
   
-  public static float computeAndDecodeNorm(SweetSpotSimilarity decode, Similarity encode, FieldInvertState state) {
-    return decode.decodeNormValue(computeAndGetNorm(encode, state));
+  private static float computeNorm(Similarity sim, String field, int length) throws IOException {
+    String value = IntStream.range(0, length).mapToObj(i -> "a").collect(Collectors.joining(" "));
+    Directory dir = newDirectory();
+    IndexWriter w = new IndexWriter(dir, newIndexWriterConfig().setSimilarity(sim));
+    w.addDocument(Collections.singleton(newTextField(field, value, Store.NO)));
+    DirectoryReader reader = DirectoryReader.open(w);
+    w.close();
+    IndexSearcher searcher = new IndexSearcher(reader);
+    searcher.setSimilarity(sim);
+    Explanation expl = searcher.explain(new TermQuery(new Term(field, "a")), 0);
+    reader.close();
+    dir.close();
+    Explanation norm = findExplanation(expl, "fieldNorm");
+    assertNotNull(norm);
+    return norm.getValue();
   }
-  
-  public static byte computeAndGetNorm(Similarity s, FieldInvertState state) {
-    return (byte) s.computeNorm(state);
+
+  private static Explanation findExplanation(Explanation expl, String text) {
+    if (expl.getDescription().startsWith(text)) {
+      return expl;
+    } else {
+      for (Explanation sub : expl.getDetails()) {
+        Explanation match = findExplanation(sub, text);
+        if (match != null) {
+          return match;
+        }
+      }
+    }
+    return null;
   }
 
-  public void testSweetSpotComputeNorm() {
+  public void testSweetSpotComputeNorm() throws IOException {
   
     final SweetSpotSimilarity ss = new SweetSpotSimilarity();
     ss.setLengthNormFactors(1,1,0.5f,true);
@@ -46,12 +81,10 @@ public class SweetSpotSimilarityTest extends LuceneTestCase {
 
 
     // base case, should degrade
-    FieldInvertState invertState = new FieldInvertState("bogus");
     for (int i = 1; i < 1000; i++) {
-      invertState.setLength(i);
       assertEquals("base case: i="+i,
-                   computeAndGetNorm(d, invertState),
-                   computeAndGetNorm(s, invertState),
+                   computeNorm(d, "bogus", i),
+                   computeNorm(s, "bogus", i),
                    0.0f);
     }
 
@@ -60,22 +93,19 @@ public class SweetSpotSimilarityTest extends LuceneTestCase {
     ss.setLengthNormFactors(3,10,0.5f,true);
   
     for (int i = 3; i <=10; i++) {
-      invertState.setLength(i);
       assertEquals("3,10: spot i="+i,
                    1.0f,
-                   computeAndDecodeNorm(ss, ss, invertState),
+                   computeNorm(ss, "bogus", i),
                    0.0f);
     }
   
     for (int i = 10; i < 1000; i++) {
-      invertState.setLength(i-9);
-      final byte normD = computeAndGetNorm(d, invertState);
-      invertState.setLength(i);
-      final byte normS = computeAndGetNorm(s, invertState);
+      final float normD = computeNorm(d, "bogus", i - 9);
+      final float normS = computeNorm(s, "bogus", i);
       assertEquals("3,10: 10<x : i="+i,
                    normD,
                    normS,
-                   0.0f);
+                   0.01f);
     }
 
 
@@ -106,78 +136,60 @@ public class SweetSpotSimilarityTest extends LuceneTestCase {
       }
     };
 
-    invertState = new FieldInvertState("foo");
     for (int i = 3; i <=10; i++) {
-      invertState.setLength(i);
       assertEquals("f: 3,10: spot i="+i,
                    1.0f,
-                   computeAndDecodeNorm(ss, sp, invertState),
+                   computeNorm(sp, "foo", i),
                    0.0f);
     }
     
     for (int i = 10; i < 1000; i++) {
-      invertState.setLength(i-9);
-      final byte normD = computeAndGetNorm(d, invertState);
-      invertState.setLength(i);
-      final byte normS = computeAndGetNorm(sp, invertState);
+      final float normD = computeNorm(d, "foo", i-9);
+      final float normS = computeNorm(sp, "foo", i);
       assertEquals("f: 3,10: 10<x : i="+i,
                    normD,
                    normS,
-                   0.0f);
+                   0.01f);
     }
     
-    invertState = new FieldInvertState("bar");
     for (int i = 8; i <=13; i++) {
-      invertState.setLength(i);
       assertEquals("f: 8,13: spot i="+i,
                    1.0f,
-                   computeAndDecodeNorm(ss, sp, invertState),
-                   0.0f);
+                   computeNorm(sp, "bar", i),
+                   0.01f);
     }
     
-    invertState = new FieldInvertState("yak");
     for (int i = 6; i <=9; i++) {
-      invertState.setLength(i);
       assertEquals("f: 6,9: spot i="+i,
                    1.0f,
-                   computeAndDecodeNorm(ss, sp, invertState),
-                   0.0f);
+                   computeNorm(sp, "yak", i),
+                   0.01f);
     }
     
-    invertState = new FieldInvertState("bar");
     for (int i = 13; i < 1000; i++) {
-      invertState.setLength(i-12);
-      final byte normD = computeAndGetNorm(d, invertState);
-      invertState.setLength(i);
-      final byte normS = computeAndGetNorm(sp, invertState);
+      final float normD = computeNorm(d, "bar", i-12);
+      final float normS = computeNorm(sp, "bar", i);
       assertEquals("f: 8,13: 13<x : i="+i,
                    normD,
                    normS,
-                   0.0f);
+                   0.01f);
     }
     
-    invertState = new FieldInvertState("yak");
     for (int i = 9; i < 1000; i++) {
-      invertState.setLength(i-8);
-      final byte normD = computeAndGetNorm(d, invertState);
-      invertState.setLength(i);
-      final byte normS = computeAndGetNorm(sp, invertState);
+      final float normD = computeNorm(d, "yak", i-8);
+      final float normS = computeNorm(sp, "yak", i);
       assertEquals("f: 6,9: 9<x : i="+i,
                    normD,
                    normS,
-                   0.0f);
+                   0.01f);
     }
 
 
     // steepness
 
     for (int i = 9; i < 1000; i++) {
-      invertState = new FieldInvertState("a");
-      invertState.setLength(i);
-      final byte normSS = computeAndGetNorm(sp, invertState);
-      invertState = new FieldInvertState("b");
-      invertState.setLength(i);
-      final byte normS = computeAndGetNorm(sp, invertState);
+      final float normSS = computeNorm(sp, "a", i);
+      final float normS = computeNorm(sp, "b", i);
       assertTrue("s: i="+i+" : a="+normSS+
                  " < b="+normS,
                  normSS < normS);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java
----------------------------------------------------------------------
diff --git a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java
index d556454..ea63de9 100644
--- a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java
+++ b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NormValueSource.java
@@ -20,19 +20,24 @@ import java.io.IOException;
 import java.util.Map;
 
 import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.index.NumericDocValues;
 import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.queries.function.docvalues.FloatDocValues;
+import org.apache.lucene.search.CollectionStatistics;
 import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.TermStatistics;
 import org.apache.lucene.search.similarities.TFIDFSimilarity;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.search.similarities.Similarity.SimScorer;
+import org.apache.lucene.search.similarities.Similarity.SimWeight;
 
 /** 
- * Function that returns {@link TFIDFSimilarity#decodeNormValue(long)}
- * for every document.
+ * Function that returns the decoded norm for every document.
  * <p>
  * Note that the configured Similarity for the field must be
- * a subclass of {@link TFIDFSimilarity}
+ * a subclass of {@link TFIDFSimilarity} and the contribution of
+ * the TF needs to be 1 when the freq is 1 and the contribution
+ * of the IDF needs to be 1 when docFreq == docCount == 1.
  * @lucene.internal */
 public class NormValueSource extends ValueSource {
   protected final String field;
@@ -61,11 +66,12 @@ public class NormValueSource extends ValueSource {
     if (similarity == null) {
       throw new UnsupportedOperationException("requires a TFIDFSimilarity (such as ClassicSimilarity)");
     }
-    final NumericDocValues norms = readerContext.reader().getNormValues(field);
-
-    if (norms == null) {
-      return new ConstDoubleDocValues(0.0, this);
-    }
+    // Only works if the contribution of the tf is 1 when the freq is 1 and contribution of the idf
+    // is 1 when docCount == docFreq == 1
+    final SimWeight simWeight = similarity.computeWeight(1f,
+        new CollectionStatistics(field, 1, 1, 1, 1),
+        new TermStatistics(new BytesRef("bogus"), 1, 1));
+    final SimScorer simScorer = similarity.simScorer(simWeight, readerContext);
     
     return new FloatDocValues(this) {
       int lastDocID = -1;
@@ -74,16 +80,8 @@ public class NormValueSource extends ValueSource {
         if (docID < lastDocID) {
           throw new AssertionError("docs out of order: lastDocID=" + lastDocID + " docID=" + docID);
         }
-        if (docID > norms.docID()) {
-          norms.advance(docID);
-        }
-        long norm;
-        if (docID == norms.docID()) {
-          norm = norms.longValue();
-        } else {
-          norm = 0;
-        }
-        return similarity.decodeNormValue(norm);
+        lastDocID = docID;
+        return simScorer.score(docID, 1f);
       }
     };
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/queries/src/test/org/apache/lucene/queries/function/TestLongNormValueSource.java
----------------------------------------------------------------------
diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestLongNormValueSource.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestLongNormValueSource.java
index 11060e5..842c117 100644
--- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestLongNormValueSource.java
+++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestLongNormValueSource.java
@@ -21,7 +21,6 @@ import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.RandomIndexWriter;
@@ -33,10 +32,9 @@ import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.SortField;
 import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.search.similarities.ClassicSimilarity;
 import org.apache.lucene.search.similarities.Similarity;
-import org.apache.lucene.search.similarities.TFIDFSimilarity;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -48,7 +46,7 @@ public class TestLongNormValueSource extends LuceneTestCase {
   static IndexSearcher searcher;
   static Analyzer analyzer;
   
-  private static Similarity sim = new PreciseClassicSimilarity();
+  private static Similarity sim = new ClassicSimilarity();
 
   @BeforeClass
   public static void beforeClass() throws Exception {
@@ -116,114 +114,3 @@ public class TestLongNormValueSource extends LuceneTestCase {
     CheckHits.checkExplanations(q, "", searcher);
   }
 }
-
-
-/** Encodes norm as 4-byte float. */
-class PreciseClassicSimilarity extends TFIDFSimilarity {
-
-  /** Sole constructor: parameter-free */
-  public PreciseClassicSimilarity() {}
-
-  /**
-   * Encodes a normalization factor for storage in an index.
-   * <p>
-   * The encoding uses a three-bit mantissa, a five-bit exponent, and the
-   * zero-exponent point at 15, thus representing values from around 7x10^9 to
-   * 2x10^-9 with about one significant decimal digit of accuracy. Zero is also
-   * represented. Negative numbers are rounded up to zero. Values too large to
-   * represent are rounded down to the largest representable value. Positive
-   * values too small to represent are rounded up to the smallest positive
-   * representable value.
-   *
-   * @see org.apache.lucene.util.SmallFloat
-   */
-  @Override
-  public final long encodeNormValue(float f) {
-    return Float.floatToIntBits(f);
-  }
-
-  /**
-   * Decodes the norm value, assuming it is a single byte.
-   *
-   * @see #encodeNormValue(float)
-   */
-  @Override
-  public final float decodeNormValue(long norm) {
-    return Float.intBitsToFloat((int)norm);
-  }
-
-  /** Implemented as
-   *  <code>state.getBoost()*lengthNorm(numTerms)</code>, where
-   *  <code>numTerms</code> is {@link org.apache.lucene.index.FieldInvertState#getLength()} if {@link
-   *  #setDiscountOverlaps} is false, else it's {@link
-   *  org.apache.lucene.index.FieldInvertState#getLength()} - {@link
-   *  org.apache.lucene.index.FieldInvertState#getNumOverlap()}.
-   *
-   *  @lucene.experimental */
-  @Override
-  public float lengthNorm(FieldInvertState state) {
-    final int numTerms;
-    if (discountOverlaps) {
-      numTerms = state.getLength() - state.getNumOverlap();
-    } else {
-      numTerms = state.getLength();
-    }
-    return (float) (1.0 / Math.sqrt(numTerms));
-  }
-
-  /** Implemented as <code>sqrt(freq)</code>. */
-  @Override
-  public float tf(float freq) {
-    return (float)Math.sqrt(freq);
-  }
-
-  /** Implemented as <code>1 / (distance + 1)</code>. */
-  @Override
-  public float sloppyFreq(int distance) {
-    return 1.0f / (distance + 1);
-  }
-
-  /** The default implementation returns <code>1</code> */
-  @Override
-  public float scorePayload(int doc, int start, int end, BytesRef payload) {
-    return 1;
-  }
-
-  /** Implemented as <code>log(docCount/(docFreq+1)) + 1</code>. */
-  @Override
-  public float idf(long docFreq, long docCount) {
-    return (float)(Math.log(docCount/(double)(docFreq+1)) + 1.0);
-  }
-
-  /**
-   * True if overlap tokens (tokens with a position of increment of zero) are
-   * discounted from the document's length.
-   */
-  protected boolean discountOverlaps = true;
-
-  /** Determines whether overlap tokens (Tokens with
-   *  0 position increment) are ignored when computing
-   *  norm.  By default this is true, meaning overlap
-   *  tokens do not count when computing norms.
-   *
-   *  @lucene.experimental
-   *
-   *  @see #computeNorm
-   */
-  public void setDiscountOverlaps(boolean v) {
-    discountOverlaps = v;
-  }
-
-  /**
-   * Returns true if overlap tokens are discounted from the document's length.
-   * @see #setDiscountOverlaps
-   */
-  public boolean getDiscountOverlaps() {
-    return discountOverlaps;
-  }
-
-  @Override
-  public String toString() {
-    return "DefaultSimilarity";
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java
----------------------------------------------------------------------
diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java
index 8008590..4822e03 100644
--- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java
+++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java
@@ -367,7 +367,7 @@ public class TestValueSources extends LuceneTestCase {
       // no norm field (so agnostic to indexed similarity)
       searcher.setSimilarity(new ClassicSimilarity());
       ValueSource vs = new NormValueSource("byte");
-      assertHits(new FunctionQuery(vs), new float[] { 0f, 0f });
+      assertHits(new FunctionQuery(vs), new float[] { 1f, 1f });
 
       // regardless of whether norms exist, value source exists == 0
       assertAllExist(vs);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadScoreQuery.java
----------------------------------------------------------------------
diff --git a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadScoreQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadScoreQuery.java
index 810e4c0..f00cc9b 100644
--- a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadScoreQuery.java
+++ b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadScoreQuery.java
@@ -26,7 +26,6 @@ import org.apache.lucene.analysis.Tokenizer;
 import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.NoMergePolicy;
 import org.apache.lucene.index.RandomIndexWriter;
@@ -143,9 +142,9 @@ public class TestPayloadScoreQuery extends LuceneTestCase {
     // check includeSpanScore makes a difference here
     searcher.setSimilarity(new MultiplyingSimilarity());
     try {
-      checkQuery(q, new MaxPayloadFunction(), new int[]{ 122, 222 }, new float[]{ 41.802513122558594f, 34.13160705566406f });
-      checkQuery(q, new MinPayloadFunction(), new int[]{ 222, 122 }, new float[]{ 34.13160705566406f, 20.901256561279297f });
-      checkQuery(q, new AveragePayloadFunction(), new int[] { 122, 222 }, new float[]{ 38.3189697265625f, 34.13160705566406f });
+      checkQuery(q, new MaxPayloadFunction(), new int[]{ 122, 222 }, new float[]{ 20.901256561279297f, 17.06580352783203f });
+      checkQuery(q, new MinPayloadFunction(), new int[]{ 222, 122 }, new float[]{ 17.06580352783203f, 10.450628280639648f });
+      checkQuery(q, new AveragePayloadFunction(), new int[] { 122, 222 }, new float[]{ 19.15948486328125f, 17.06580352783203f });
       checkQuery(q, new MaxPayloadFunction(), false, new int[]{122, 222}, new float[]{4.0f, 4.0f});
       checkQuery(q, new MinPayloadFunction(), false, new int[]{222, 122}, new float[]{4.0f, 2.0f});
       checkQuery(q, new AveragePayloadFunction(), false, new int[]{222, 122}, new float[]{4.0f, 3.666666f});
@@ -298,7 +297,7 @@ public class TestPayloadScoreQuery extends LuceneTestCase {
     //Make everything else 1 so we see the effect of the payload
     //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     @Override
-    public float lengthNorm(FieldInvertState state) {
+    public float lengthNorm(int length) {
       return 1;
     }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadTermQuery.java
----------------------------------------------------------------------
diff --git a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadTermQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadTermQuery.java
index da46a50..faa8dd0 100644
--- a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadTermQuery.java
+++ b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadTermQuery.java
@@ -25,7 +25,6 @@ import org.apache.lucene.analysis.Tokenizer;
 import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
@@ -268,7 +267,7 @@ public class TestPayloadTermQuery extends LuceneTestCase {
     //Make everything else 1 so we see the effect of the payload
     //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     @Override 
-    public float lengthNorm(FieldInvertState state) {
+    public float lengthNorm(int length) {
       return 1;
     }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/test-framework/src/java/org/apache/lucene/search/similarities/RandomSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/RandomSimilarity.java b/lucene/test-framework/src/java/org/apache/lucene/search/similarities/RandomSimilarity.java
index 4bfe4b8..f880935 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/RandomSimilarity.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/search/similarities/RandomSimilarity.java
@@ -31,7 +31,7 @@ import java.util.Random;
  * for the same field.
  */
 public class RandomSimilarity extends PerFieldSimilarityWrapper {
-  final ClassicSimilarity defaultSim = new ClassicSimilarity();
+  final BM25Similarity defaultSim = new BM25Similarity();
   final List<Similarity> knownSims;
   Map<String,Similarity> previousMappings = new HashMap<>();
   final int perFieldSeed;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
index a8070fa..8d1b758 100644
--- a/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
@@ -86,8 +86,8 @@ public class DisMaxRequestHandlerTest extends SolrTestCaseJ4 {
             req("cool stuff")
             ,"//*[@numFound='3']"
             ,"//result/doc[1]/int[@name='id'][.='42']"
-            ,"//result/doc[2]/int[@name='id'][.='8675309']"
-            ,"//result/doc[3]/int[@name='id'][.='666']"
+            ,"//result/doc[2]/int[@name='id'][.='666']"
+            ,"//result/doc[3]/int[@name='id'][.='8675309']"
             );
 
     assertQ("multi qf",

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
index f113004..f439e87 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
@@ -97,8 +97,8 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
           CommonParams.FL, "id, score, [elevated]")
           , "//*[@numFound='3']"
           , "//result/doc[1]/float[@name='id'][.='7.0']"
-          , "//result/doc[2]/float[@name='id'][.='8.0']"
-          , "//result/doc[3]/float[@name='id'][.='9.0']",
+          , "//result/doc[2]/float[@name='id'][.='9.0']"
+          , "//result/doc[3]/float[@name='id'][.='8.0']",
           "//result/doc[1]/bool[@name='[elevated]'][.='true']",
           "//result/doc[2]/bool[@name='[elevated]'][.='false']",
           "//result/doc[3]/bool[@name='[elevated]'][.='false']"

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/solr/core/src/test/org/apache/solr/search/TestPayloadScoreQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestPayloadScoreQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestPayloadScoreQParserPlugin.java
index 34017c1..8ac09bb 100644
--- a/solr/core/src/test/org/apache/solr/search/TestPayloadScoreQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestPayloadScoreQParserPlugin.java
@@ -49,6 +49,6 @@ public class TestPayloadScoreQParserPlugin extends SolrTestCaseJ4 {
 
     // TODO: fix this includeSpanScore test to be less brittle - score result is score of "A" (via BM25) multipled by 1.0 (payload value)
     assertQ(req("fl","*,score", "q", "{!payload_score f=vals_dpf v=A func=min}"), "//float[@name='score']='1.0'");
-    assertQ(req("fl","*,score", "q", "{!payload_score f=vals_dpf v=A func=min includeSpanScore=true}"), "//float[@name='score']='0.25811607'");
+    assertQ(req("fl","*,score", "q", "{!payload_score f=vals_dpf v=A func=min includeSpanScore=true}"), "//float[@name='score']='0.2876821'");
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java b/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
index e28c957..58a1b53 100644
--- a/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
+++ b/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
@@ -65,9 +65,9 @@ public class SortByFunctionTest extends AbstractSolrTestCase {
     assertQ(req("fl", "id,score", "q", "f_t:ipod", "sort", "score desc"),
             "//*[@numFound='4']",
             "//result/doc[1]/int[@name='id'][.='1']",
-            "//result/doc[2]/int[@name='id'][.='4']",
-            "//result/doc[3]/int[@name='id'][.='2']",
-            "//result/doc[4]/int[@name='id'][.='3']"
+            "//result/doc[2]/int[@name='id'][.='2']",
+            "//result/doc[3]/int[@name='id'][.='3']",
+            "//result/doc[4]/int[@name='id'][.='4']"
     );
 
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
index 8aae74c..e77c4ee 100644
--- a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
@@ -25,7 +25,6 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Random;
 
-import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.search.similarities.TFIDFSimilarity;
 import org.apache.solr.SolrTestCaseJ4;
@@ -431,12 +430,8 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
     assertQ(req("fl","*,score","q", "{!func}tf(a_tfidf,cow)", "fq","id:6"),
             "//float[@name='score']='" + similarity.tf(5)  + "'");
     
-    FieldInvertState state = new FieldInvertState("a_tfidf");
-    state.setLength(4);
-    long norm = similarity.computeNorm(state);
-    float nrm = similarity.decodeNormValue((byte) norm);
     assertQ(req("fl","*,score","q", "{!func}norm(a_tfidf)", "fq","id:2"),
-        "//float[@name='score']='" + nrm  + "'");  // sqrt(4)==2 and is exactly representable when quantized to a byte
+        "//float[@name='score']='0.5'");  // 1/sqrt(4)==1/2==0.5
     
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/solr/core/src/test/org/apache/solr/search/similarities/TestSweetSpotSimilarityFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/similarities/TestSweetSpotSimilarityFactory.java b/solr/core/src/test/org/apache/solr/search/similarities/TestSweetSpotSimilarityFactory.java
index 4b5503d..52d6f8d 100644
--- a/solr/core/src/test/org/apache/solr/search/similarities/TestSweetSpotSimilarityFactory.java
+++ b/solr/core/src/test/org/apache/solr/search/similarities/TestSweetSpotSimilarityFactory.java
@@ -16,8 +16,22 @@
  */
 package org.apache.solr.search.similarities;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.misc.SweetSpotSimilarity;
+import org.apache.lucene.search.Explanation;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.similarities.ClassicSimilarity;
+import org.apache.lucene.search.similarities.Similarity;
+import org.apache.lucene.store.Directory;
 import org.junit.BeforeClass;
 
 /**
@@ -28,7 +42,38 @@ public class TestSweetSpotSimilarityFactory extends BaseSimilarityTestCase {
   public static void beforeClass() throws Exception {
     initCore("solrconfig-basic.xml","schema-sweetspot.xml");
   }
-  
+
+  private static float computeNorm(Similarity sim, int length) throws IOException {
+    String value = IntStream.range(0, length).mapToObj(i -> "a").collect(Collectors.joining(" "));
+    Directory dir = newDirectory();
+    IndexWriter w = new IndexWriter(dir, newIndexWriterConfig().setSimilarity(sim));
+    w.addDocument(Collections.singleton(newTextField("foo", value, Store.NO)));
+    DirectoryReader reader = DirectoryReader.open(w);
+    w.close();
+    IndexSearcher searcher = new IndexSearcher(reader);
+    searcher.setSimilarity(sim);
+    Explanation expl = searcher.explain(new TermQuery(new Term("foo", "a")), 0);
+    reader.close();
+    dir.close();
+    Explanation norm = findExplanation(expl, "fieldNorm");
+    assertNotNull(norm);
+    return norm.getValue();
+  }
+
+  private static Explanation findExplanation(Explanation expl, String text) {
+    if (expl.getDescription().startsWith(text)) {
+      return expl;
+    } else {
+      for (Explanation sub : expl.getDetails()) {
+        Explanation match = findExplanation(sub, text);
+        if (match != null) {
+          return match;
+        }
+      }
+    }
+    return null;
+  }
+
   /** default parameters */
   public void testDefaults() throws Exception {
     SweetSpotSimilarity sim = getSimilarity("text", SweetSpotSimilarity.class);
@@ -40,9 +85,9 @@ public class TestSweetSpotSimilarityFactory extends BaseSimilarityTestCase {
     }
 
     // default norm sanity check
-    assertEquals("norm 1",  1.00F, sim.computeLengthNorm(1),  0.0F);
-    assertEquals("norm 4",  0.50F, sim.computeLengthNorm(4),  0.0F);
-    assertEquals("norm 16", 0.25F, sim.computeLengthNorm(16), 0.0F);
+    assertEquals("norm 1",  1.00F, computeNorm(sim, 1),  0.0F);
+    assertEquals("norm 4",  0.50F, computeNorm(sim, 4),  0.0F);
+    assertEquals("norm 16", 0.25F, computeNorm(sim, 16), 0.0F);
   }
   
   /** baseline with parameters */
@@ -65,17 +110,17 @@ public class TestSweetSpotSimilarityFactory extends BaseSimilarityTestCase {
 
     // norms: plateau from 3-5
     assertEquals("norm 1 == 7", 
-                 sim.computeLengthNorm(1), sim.computeLengthNorm(7),  0.0F);
+                 computeNorm(sim, 1), computeNorm(sim, 7),  0.0F);
     assertEquals("norm 2 == 6",  
-                 sim.computeLengthNorm(1), sim.computeLengthNorm(7),  0.0F);
-    assertEquals("norm 3",  1.00F, sim.computeLengthNorm(3),  0.0F);
-    assertEquals("norm 4",  1.00F, sim.computeLengthNorm(4),  0.0F);
-    assertEquals("norm 5",  1.00F, sim.computeLengthNorm(5),  0.0F);
-    assertTrue("norm 6 too high: " + sim.computeLengthNorm(6),
-               sim.computeLengthNorm(6) < 1.0F);
+                 computeNorm(sim, 1), computeNorm(sim, 7),  0.0F);
+    assertEquals("norm 3",  1.00F, computeNorm(sim, 3),  0.0F);
+    assertEquals("norm 4",  1.00F, computeNorm(sim, 4),  0.0F);
+    assertEquals("norm 5",  1.00F, computeNorm(sim, 5),  0.0F);
+    assertTrue("norm 6 too high: " + computeNorm(sim, 6),
+               computeNorm(sim, 6) < 1.0F);
     assertTrue("norm 7 higher then norm 6", 
-               sim.computeLengthNorm(7) < sim.computeLengthNorm(6));
-    assertEquals("norm 20", 0.25F, sim.computeLengthNorm(20), 0.0F);
+               computeNorm(sim, 7) < computeNorm(sim, 6));
+    assertEquals("norm 20", 0.25F, computeNorm(sim, 20), 0.0F);
   }
 
   /** hyperbolic with parameters */
@@ -92,16 +137,16 @@ public class TestSweetSpotSimilarityFactory extends BaseSimilarityTestCase {
     assertEquals("MID tf", 3.3F+(7.7F - 3.3F)/2.0F, sim.tf(5), 0.00001F);
 
     // norms: plateau from 1-5, shallow slope
-    assertEquals("norm 1",  1.00F, sim.computeLengthNorm(1),  0.0F);
-    assertEquals("norm 2",  1.00F, sim.computeLengthNorm(2),  0.0F);
-    assertEquals("norm 3",  1.00F, sim.computeLengthNorm(3),  0.0F);
-    assertEquals("norm 4",  1.00F, sim.computeLengthNorm(4),  0.0F);
-    assertEquals("norm 5",  1.00F, sim.computeLengthNorm(5),  0.0F);
-    assertTrue("norm 6 too high: " + sim.computeLengthNorm(6),
-               sim.computeLengthNorm(6) < 1.0F);
+    assertEquals("norm 1",  1.00F, computeNorm(sim, 1),  0.0F);
+    assertEquals("norm 2",  1.00F, computeNorm(sim, 2),  0.0F);
+    assertEquals("norm 3",  1.00F, computeNorm(sim, 3),  0.0F);
+    assertEquals("norm 4",  1.00F, computeNorm(sim, 4),  0.0F);
+    assertEquals("norm 5",  1.00F, computeNorm(sim, 5),  0.0F);
+    assertTrue("norm 6 too high: " + computeNorm(sim, 6),
+               computeNorm(sim, 6) < 1.0F);
     assertTrue("norm 7 higher then norm 6", 
-               sim.computeLengthNorm(7) < sim.computeLengthNorm(6));
-    assertTrue("norm 20 not high enough: " + sim.computeLengthNorm(20),
-               0.25F < sim.computeLengthNorm(20));
+               computeNorm(sim, 7) < computeNorm(sim, 6));
+    assertTrue("norm 20 not high enough: " + computeNorm(sim, 20),
+               0.25F < computeNorm(sim, 20));
   }
 }


[23/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/order.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/order.js b/solr/webapp/web/js/lib/order.js
deleted file mode 100644
index 169ccfb..0000000
--- a/solr/webapp/web/js/lib/order.js
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
-
-MIT License
------------
-
-Copyright (c) 2010-2011, The Dojo Foundation
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-/**
- * @license RequireJS order 1.0.5 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
- * Available via the MIT or new BSD license.
- * see: http://github.com/jrburke/requirejs for details
- */
-/*jslint nomen: false, plusplus: false, strict: false */
-/*global require: false, define: false, window: false, document: false,
-  setTimeout: false */
-
-//Specify that requirejs optimizer should wrap this code in a closure that
-//maps the namespaced requirejs API to non-namespaced local variables.
-/*requirejs namespace: true */
-
-(function () {
-
-    //Sadly necessary browser inference due to differences in the way
-    //that browsers load and execute dynamically inserted javascript
-    //and whether the script/cache method works when ordered execution is
-    //desired. Currently, Gecko and Opera do not load/fire onload for scripts with
-    //type="script/cache" but they execute injected scripts in order
-    //unless the 'async' flag is present.
-    //However, this is all changing in latest browsers implementing HTML5
-    //spec. With compliant browsers .async true by default, and
-    //if false, then it will execute in order. Favor that test first for forward
-    //compatibility.
-    var testScript = typeof document !== "undefined" &&
-                 typeof window !== "undefined" &&
-                 document.createElement("script"),
-
-        supportsInOrderExecution = testScript && (testScript.async ||
-                               ((window.opera &&
-                                 Object.prototype.toString.call(window.opera) === "[object Opera]") ||
-                               //If Firefox 2 does not have to be supported, then
-                               //a better check may be:
-                               //('mozIsLocallyAvailable' in window.navigator)
-                               ("MozAppearance" in document.documentElement.style))),
-
-        //This test is true for IE browsers, which will load scripts but only
-        //execute them once the script is added to the DOM.
-        supportsLoadSeparateFromExecute = testScript &&
-                                          testScript.readyState === 'uninitialized',
-
-        readyRegExp = /^(complete|loaded)$/,
-        cacheWaiting = [],
-        cached = {},
-        scriptNodes = {},
-        scriptWaiting = [];
-
-    //Done with the test script.
-    testScript = null;
-
-    //Callback used by the type="script/cache" callback that indicates a script
-    //has finished downloading.
-    function scriptCacheCallback(evt) {
-        var node = evt.currentTarget || evt.srcElement, i,
-            moduleName, resource;
-
-        if (evt.type === "load" || readyRegExp.test(node.readyState)) {
-            //Pull out the name of the module and the context.
-            moduleName = node.getAttribute("data-requiremodule");
-
-            //Mark this cache request as loaded
-            cached[moduleName] = true;
-
-            //Find out how many ordered modules have loaded
-            for (i = 0; (resource = cacheWaiting[i]); i++) {
-                if (cached[resource.name]) {
-                    resource.req([resource.name], resource.onLoad);
-                } else {
-                    //Something in the ordered list is not loaded,
-                    //so wait.
-                    break;
-                }
-            }
-
-            //If just loaded some items, remove them from cacheWaiting.
-            if (i > 0) {
-                cacheWaiting.splice(0, i);
-            }
-
-            //Remove this script tag from the DOM
-            //Use a setTimeout for cleanup because some older IE versions vomit
-            //if removing a script node while it is being evaluated.
-            setTimeout(function () {
-                node.parentNode.removeChild(node);
-            }, 15);
-        }
-    }
-
-    /**
-     * Used for the IE case, where fetching is done by creating script element
-     * but not attaching it to the DOM. This function will be called when that
-     * happens so it can be determined when the node can be attached to the
-     * DOM to trigger its execution.
-     */
-    function onFetchOnly(node) {
-        var i, loadedNode, resourceName;
-
-        //Mark this script as loaded.
-        node.setAttribute('data-orderloaded', 'loaded');
-
-        //Cycle through waiting scripts. If the matching node for them
-        //is loaded, and is in the right order, add it to the DOM
-        //to execute the script.
-        for (i = 0; (resourceName = scriptWaiting[i]); i++) {
-            loadedNode = scriptNodes[resourceName];
-            if (loadedNode &&
-                loadedNode.getAttribute('data-orderloaded') === 'loaded') {
-                delete scriptNodes[resourceName];
-                require.addScriptToDom(loadedNode);
-            } else {
-                break;
-            }
-        }
-
-        //If just loaded some items, remove them from waiting.
-        if (i > 0) {
-            scriptWaiting.splice(0, i);
-        }
-    }
-
-    define({
-        version: '1.0.5',
-
-        load: function (name, req, onLoad, config) {
-            var hasToUrl = !!req.nameToUrl,
-                url, node, context;
-
-            //If no nameToUrl, then probably a build with a loader that
-            //does not support it, and all modules are inlined.
-            if (!hasToUrl) {
-                req([name], onLoad);
-                return;
-            }
-
-            url = req.nameToUrl(name, null);
-
-            //Make sure the async attribute is not set for any pathway involving
-            //this script.
-            require.s.skipAsync[url] = true;
-            if (supportsInOrderExecution || config.isBuild) {
-                //Just a normal script tag append, but without async attribute
-                //on the script.
-                req([name], onLoad);
-            } else if (supportsLoadSeparateFromExecute) {
-                //Just fetch the URL, but do not execute it yet. The
-                //non-standards IE case. Really not so nice because it is
-                //assuming and touching requrejs internals. OK though since
-                //ordered execution should go away after a long while.
-                context = require.s.contexts._;
-
-                if (!context.urlFetched[url] && !context.loaded[name]) {
-                    //Indicate the script is being fetched.
-                    context.urlFetched[url] = true;
-
-                    //Stuff from require.load
-                    require.resourcesReady(false);
-                    context.scriptCount += 1;
-
-                    //Fetch the script now, remember it.
-                    node = require.attach(url, context, name, null, null, onFetchOnly);
-                    scriptNodes[name] = node;
-                    scriptWaiting.push(name);
-                }
-
-                //Do a normal require for it, once it loads, use it as return
-                //value.
-                req([name], onLoad);
-            } else {
-                //Credit to LABjs author Kyle Simpson for finding that scripts
-                //with type="script/cache" allow scripts to be downloaded into
-                //browser cache but not executed. Use that
-                //so that subsequent addition of a real type="text/javascript"
-                //tag will cause the scripts to be executed immediately in the
-                //correct order.
-                if (req.specified(name)) {
-                    req([name], onLoad);
-                } else {
-                    cacheWaiting.push({
-                        name: name,
-                        req: req,
-                        onLoad: onLoad
-                    });
-                    require.attach(url, null, name, scriptCacheCallback, "script/cache");
-                }
-            }
-        }
-    });
-}());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/main.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/main.js b/solr/webapp/web/js/main.js
deleted file mode 100644
index 2a7c32a..0000000
--- a/solr/webapp/web/js/main.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- 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.
-*/
-
-require
-(
-  [
-    'lib/order!lib/console',
-    'lib/order!jquery',
-    'lib/order!lib/jquery.cookie',
-    'lib/order!lib/jquery.form',
-    'lib/order!lib/jquery.jstree',
-    'lib/order!lib/jquery.sammy',
-    'lib/order!lib/jquery.timeago',
-    'lib/order!lib/jquery.ajaxfileupload',
-    'lib/order!lib/jquery.blockUI',
-    'lib/order!lib/highlight',
-    'lib/order!lib/linker',
-    'lib/order!lib/ZeroClipboard',
-    'lib/order!lib/d3',
-    'lib/order!lib/chosen',
-    'lib/order!lib/naturalSort',
-    'lib/order!scripts/app',
-
-    'lib/order!scripts/analysis',
-    'lib/order!scripts/cloud',
-    'lib/order!scripts/cores',
-    'lib/order!scripts/documents',
-    'lib/order!scripts/dataimport',
-    'lib/order!scripts/dashboard',
-    'lib/order!scripts/files',
-    'lib/order!scripts/index',
-    'lib/order!scripts/java-properties',
-    'lib/order!scripts/logging',
-    'lib/order!scripts/ping',
-    'lib/order!scripts/plugins',
-    'lib/order!scripts/query',
-    'lib/order!scripts/replication',
-    'lib/order!scripts/schema-browser',
-    'lib/order!scripts/threads',
-    'lib/order!scripts/segments'
-  ],
-  function( $ )
-  {
-    app.run();
-  }
-);


[20/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/dashboard.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/dashboard.js b/solr/webapp/web/js/scripts/dashboard.js
deleted file mode 100644
index 31070d0..0000000
--- a/solr/webapp/web/js/scripts/dashboard.js
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- 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.
-*/
-
-var set_healthcheck_status = function( status )
-{
-  var hc_button = $( '.healthcheck-status' )
-  if ( status == 'enable' )
-  {
-    hc_button.parents( 'dd' )
-      .removeClass( 'ico-0' )
-      .addClass( 'ico-1' );
-    hc_button
-      .addClass( 'enabled' )
-      .html( 'disable ping' );
-  } else {
-    hc_button.parents( 'dd' )
-      .removeClass( 'ico-1')
-      .addClass( 'ico-0' );
-    hc_button
-      .removeClass( 'enabled' )
-      .html( 'enable ping' );
-  }
-};
-
-// #/:core
-sammy.get
-(
-  new RegExp( app.core_regex_base + '$' ),
-  function( context )
-  {
-    var core_basepath = this.active_core.attr( 'data-basepath' );
-    var content_element = $( '#content' );
-        
-    content_element
-      .removeClass( 'single' );
-    
-    if( !app.core_menu.data( 'admin-extra-loaded' ) )
-    {
-      app.core_menu.data( 'admin-extra-loaded', new Date() );
-
-      $.get
-      (
-        core_basepath + '/admin/file/?file=admin-extra.menu-top.html&contentType=text/html;charset=utf-8',
-        function( menu_extra )
-        {
-          app.core_menu
-            .prepend( menu_extra );
-        }
-      );
-      
-      $.get
-      (
-        core_basepath + '/admin/file/?file=admin-extra.menu-bottom.html&contentType=text/html;charset=utf-8',
-        function( menu_extra )
-        {
-          app.core_menu
-            .append( menu_extra );
-        }
-      );
-    }
-        
-    $.get
-    (
-      'tpl/dashboard.html',
-      function( template )
-      {
-        content_element
-          .html( template );
-                    
-        var dashboard_element = $( '#dashboard' );
-                                     
-        $.ajax
-        (
-          {
-            url : core_basepath + '/admin/luke?wt=json&show=index&numTerms=0',
-            dataType : 'json',
-            context : $( '#statistics', 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();
-                                
-              var data = {
-                'index_num-doc' : response['index']['numDocs'],
-                'index_heap-usage-bytes' : response['index']['indexHeapUsageBytes'],
-                'index_max-doc' : response['index']['maxDoc'],
-                'index_deleted-doc' : response['index']['deletedDocs'],
-                'index_version' : response['index']['version'],
-                'index_segmentCount' : response['index']['segmentCount'],
-                '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']['hasDeletions'] )
-              {
-                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' );
-              }
-
-              $( '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 data = response.details;
-              var is_slave = 'undefined' !== typeof( data.slave );
-              var headline = $( 'h2 span', this );
-              var details_element = $( '#details', this );
-              var current_type_element = $( ( is_slave ? '.slave' : '.masterSearch' ), this );
-              var master_data = is_slave ? data.slave.masterDetails : data;
-
-              if( is_slave )
-              {
-                this
-                  .addClass( 'slave' );
-                                
-                headline
-                  .html( headline.html() + ' (Slave)' );
-              }
-              else
-              {
-                this
-                  .addClass( 'master' );
-                                
-                headline
-                  .html( headline.html() + ' (Master)' );
-              }
-
-              // the currently searchable commit regardless of type
-              $( '.version div', current_type_element )
-                .html( data.indexVersion );
-              $( '.generation div', current_type_element )
-                .html( data.generation );
-              $( '.size div', current_type_element )
-                .html( data.indexSize );
-                            
-              // what's replicable on the master
-              var master_element = $( '.master', details_element );
-              $( '.version div', master_element )
-                .html( master_data.master.replicableVersion || '-' );
-              $( '.generation div', master_element )
-                .html( master_data.master.replicableGeneration || '-' );
-              $( '.size div', master_element )
-                .html( "-" );
-
-              if( is_slave )
-              {
-                var master_element = $( '.masterSearch', 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 );
-                                
-                // warnings if slave version|gen doesn't match what's replicable
-                if( data.indexVersion !== master_data.master.replicableVersion )
-                {
-                  $( '.version', details_element )
-                    .addClass( 'diff' );
-                }
-                else
-                {
-                  $( '.version', details_element )
-                    .removeClass( 'diff' );
-                }
-                                
-                if( data.generation !== master_data.master.replicableGeneration )
-                {
-                  $( '.generation', details_element )
-                    .addClass( 'diff' );
-                }
-                else
-                {
-                  $( '.generation', details_element )
-                    .removeClass( 'diff' );
-                }
-              }
-            },
-            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 + '/admin/system?wt=json',
-            dataType : 'json',
-            context : $( '#instance', 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();
-                            
-              $( 'dl', this )
-                .show();
-                            
-              var data = {
-                'dir_cwd' : response.core.directory.cwd,
-                'dir_instance' : response.core.directory.instance,
-                'dir_data' : response.core.directory.data,
-                'dir_index' : response.core.directory.index,
-                'dir_impl' : response.core.directory.dirimpl
-              };
-                            
-              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( '/admin/system Handler 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' );
-            }
-          }
-        );
-
-        $.ajax
-        (
-          {
-            url : core_basepath + '/admin/ping?action=status&wt=json',
-            dataType : 'json',
-            context : $( '#healthcheck', 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();
-
-              var status_element = $( '.value.status', this );
-              var toggle_button = $( '.healthcheck-status', this );
-              var status = response['status'];
-              $( 'span', status_element ).html( status );
-
-              var action = ( response['status'] == 'enabled' ) ? 'enable' : 'disable';  
-              set_healthcheck_status(action);
-
-              if( response['status'] == 'enabled' )
-              {
-                status_element
-                  .addClass( 'ico-1' );
-                toggle_button
-                  .addClass( 'enabled' );
-              }
-              else
-              {
-                status_element
-                  .addClass( 'ico-0' );
-              }
-              
-              $( '.healthcheck-status', status_element )
-                .die( 'click' )
-                .live
-                (
-                  'click',
-                  function( event )
-                  {                      
-                    var action = $(this).hasClass( 'enabled' ) ? 'disable' : 'enable';  
-                    $.ajax
-                    (
-                      {
-                        url : core_basepath + '/admin/ping?action=' + action + '&wt=json',
-                        dataType : 'json',
-                        context : $( this ),
-                        beforeSend : function( xhr, settings )
-                        {
-                          this
-                            .addClass( 'loader' );
-                        },
-                        success : function( response, text_status, xhr )
-                        {
-                          set_healthcheck_status(action);
-                        },
-                        error : function( xhr, text_status, error_thrown)
-                        {
-                          console.warn( 'd0h, enable broken!' );
-                        },
-                        complete : function( xhr, text_status )
-                        {
-                          this
-                            .removeClass( 'loader' );
-                        }
-                      }
-                    );
-                  }
-                );
-            },
-            error : function( xhr, text_status, error_thrown)
-            {
-              this
-                .addClass( 'disabled' );
-                            
-              $( '.message', this )
-                .show()
-                .html( 'Ping request handler is not configured with a healthcheck file.' );
-            },
-            complete : function( xhr, text_status )
-            {
-              $( 'h2', this )
-                .removeClass( 'loader' );
-            }
-          }
-        );
-                
-      }
-    );
-  }
-);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/dataimport.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/dataimport.js b/solr/webapp/web/js/scripts/dataimport.js
deleted file mode 100644
index 20532c6..0000000
--- a/solr/webapp/web/js/scripts/dataimport.js
+++ /dev/null
@@ -1,812 +0,0 @@
-/*
- 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.
-*/
-
-var dataimport_timeout = 2000;
-var cookie_dataimport_autorefresh = 'dataimport_autorefresh';
-
-sammy.bind
-(
-  'dataimport_queryhandler_load',
-  function( event, params )
-  {
-    var core_basepath = params.active_core.attr( 'data-basepath' );
-
-    $.ajax
-    (
-      {
-        url : core_basepath + '/admin/mbeans?cat=QUERY&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.sort(naturalSort) );
-        },
-        error : function( xhr, text_status, error_thrown)
-        {
-        },
-        complete : function( xhr, text_status )
-        {
-        }
-      }
-    );
-  }
-);
-
-// #/:core/dataimport
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(dataimport)$' ),
-  function( context )
-  {
-    sammy.trigger
-    (
-      'dataimport_queryhandler_load',
-      {
-        active_core : this.active_core,
-        callback :  function( dataimport_handlers )
-        {
-          if( 0 === dataimport_handlers.length )
-          {
-            $( '#content' )
-              .html( 'sorry, no dataimport-handler defined!' );
-
-            return false;
-          }
-
-          context.redirect( context.path + '/' + dataimport_handlers[0] );
-        }
-      }
-    );
-  }
-);
-
-// #/:core/dataimport
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(dataimport)\\/' ),
-  function( context )
-  {
-    var core_basepath = this.active_core.attr( 'data-basepath' );
-    var content_element = $( '#content' );
-
-    var path_parts = this.path.match( /^(.+\/dataimport\/)(.*)$/ );
-    var handler_url = core_basepath + 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 error_element = $( '#error', dataimport_element );
-        var debug_response_element = $( '#debug_response', dataimport_element );
-
-        var autorefresh_status = false;
-        var debug_mode = false;
-
-        // handler
-
-        sammy.trigger
-        (
-          'dataimport_queryhandler_load',
-          {
-            active_core : context.active_core,
-            callback :  function( dataimport_handlers )
-            {
-              var handlers_element = $( '#navigation ul', 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>'
-                );
-              }
-
-              $( handlers_element )
-                .html( handlers.join( "\n") ) ;
-                            
-              $( 'a[href="' + context.path + '"]', handlers_element ).closest( 'li' )
-                .addClass( 'current' );
-
-              $( 'form', form_element )
-                .show();
-            }
-          }
-        );
-
-        // config
-
-        function dataimport_fetch_config()
-        {
-          $.ajax
-          (
-            {
-              url : handler_url + '?command=show-config&indent=true',
-              dataType : 'xml',
-              context : $( '#dataimport_config', config_element ),
-              beforeSend : function( xhr, settings )
-              {
-                error_element
-                  .empty()
-                  .hide();
-              },
-              success : function( config, text_status, xhr )
-              {
-                dataimport_element
-                  .removeClass( 'error' );
-
-                config_element
-                  .addClass( 'hidden' );
-
-                var entities = [ '<option value=""></option>' ];
-
-                $( 'document > entity', config )
-                  .each
-                  (
-                    function( i, element )
-                    {
-                      entities.push( '<option>' + $( element ).attr( 'name' ).esc() + '</option>' );
-                    }
-                  );
-                                
-                $( '#entity', form_element )
-                  .html( entities.join( "\n" ) );
-
-                $( '.editable textarea', this )
-                  .val( xhr.responseText.replace( /\n+$/, '' ) );
-              },
-              error : function( xhr, text_status, error_thrown )
-              {
-                if( 'parsererror' === error_thrown )
-                {
-                  dataimport_element
-                    .addClass( 'error' );
-                                    
-                  error_element
-                    .text( 'Dataimport XML-Configuration is not valid' )
-                    .show();
-
-                  config_element
-                    .removeClass( 'hidden' );
-                }
-              },
-              complete : function( xhr, text_status )
-              {
-                var code = $(
-                  '<pre class="syntax language-xml"><code>' +
-                  xhr.responseText.esc() +
-                  '</code></pre>'
-                );
-                $( '.formatted', this ).html( code );
-
-                if( 'success' === text_status )
-                {
-                  hljs.highlightBlock( code.get(0) );
-                }
-              }
-            }
-          );
-        }
-        dataimport_fetch_config();
-
-        $( '.block .toggle', dataimport_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 : handler_url + '?command=reload-config',
-                  dataType : 'xml',
-                  context: $( this ),
-                  beforeSend : function( xhr, settings )
-                  {
-                    this
-                      .removeClass( 'error' )
-                      .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;
-            }
-          );
-
-        var debug_mode_element = $( '.debug_mode', config_element );
-        debug_mode_element
-          .die( 'click' )
-          .live
-          (
-            'click',
-            function( event )
-            {
-              var self = $( this );
-              var block = self.closest( '.block' )
-
-              var debug_checkbox = $( 'input[name="debug"]', form_element );
-              var submit_span = $( 'button[type="submit"] span', form_element );
-
-              debug_mode = !debug_mode;
-
-              block.toggleClass( 'debug_mode', debug_mode );
-
-              if( debug_mode )
-              {
-                block.removeClass( 'hidden' );
-
-                debug_checkbox
-                  .attr( 'checked', 'checked' )
-                  .trigger( 'change' );
-                  
-                submit_span
-                  .data( 'original', submit_span.text() )
-                  .text( submit_span.data( 'debugmode' ) );
-              }
-              else
-              {
-                submit_span
-                  .text( submit_span.data( 'original' ) )
-                  .removeData( 'original' );
-              }
-            }
-          );
-
-        // abort
-
-        var abort_import_element = $( '.abort-import', dataimport_element );
-        abort_import_element
-          .off( 'click' )
-          .on
-          (
-            'click',
-            function( event )
-            {
-              var span_element = $( 'span', this );
-
-              $.ajax
-              (
-                {
-                  url : handler_url + '?command=abort&wt=json',
-                  dataType : 'json',
-                  type: 'GET',
-                  context: $( this ),
-                  beforeSend : function( xhr, settings )
-                  {
-                    span_element
-                      .addClass( 'loader' );
-                  },
-                  success : function( response, text_status, xhr )
-                  {
-                    span_element
-                      .data( 'original', span_element.text() )
-                      .text( span_element.data( 'aborting' ) );
-
-                    this
-                      .removeClass( 'warn' )
-                      .addClass( 'success' );
-
-                    window.setTimeout
-                    (
-                      function()
-                      {
-                        $( 'span', abort_import_element )
-                          .removeClass( 'loader' )
-                          .text( span_element.data( 'original' ) )
-                          .removeData( 'original' );
-
-                        abort_import_element
-                          .removeClass( 'success' )
-                          .addClass( 'warn' );
-                      },
-                      dataimport_timeout * 2
-                    );
-
-                    dataimport_fetch_status();
-                  }
-                }
-              );
-              return false;
-            }
-          );
-
-        // state
-
-        var status_button = $( 'form button.refresh-status', form_element );
-
-        status_button
-          .off( 'click' )
-          .on
-          (
-            'click',
-            function( event )
-            {
-              dataimport_fetch_status();
-              return false;
-            }
-          )
-          .trigger( 'click' );
-                
-        function dataimport_fetch_status( clear_timeout )
-        {
-          if( clear_timeout )
-          {
-            app.clear_timeout();
-          }
-
-          $.ajax
-          (
-            {
-              url : handler_url + '?command=status&indent=true&wt=json',
-              dataType : 'json',
-              beforeSend : function( xhr, settings )
-              {
-                $( 'span', status_button )
-                  .addClass( 'loader' );
-              },
-              success : function( response, text_status, xhr )
-              {
-                var state_element = $( '#current_state', content_element );
-
-                var status = response.status;
-                var rollback_time = response.statusMessages.Rolledback || null;
-                var abort_time = response.statusMessages.Aborted || null;
-                
-                var messages = response.statusMessages;
-                var messages_count = 0;
-                for( var key in messages ) { messages_count++; }
-
-                function dataimport_compute_details( response, details_element, elapsed_seconds )
-                {
-                  details_element
-                    .show();
-
-                  // --
-
-                  var document_config = {
-                    'Requests' : 'Total Requests made to DataSource',
-                    'Fetched' : 'Total Rows Fetched',
-                    'Skipped' : 'Total Documents Skipped',
-                    'Processed' : 'Total Documents Processed'
-                  };
-
-                  var document_details = [];
-                  for( var key in document_config )
-                  {
-                    var value = parseInt( response.statusMessages[document_config[key]], 10 );
-
-                    var detail = '<abbr title="' + document_config[key].esc() + '">' + key.esc() + '</abbr>: ' +  app.format_number( value ).esc();
-                    if( elapsed_seconds && 'skipped' !== key.toLowerCase() )
-                    {
-                      detail += ' <span>(' + app.format_number( Math.round( value / elapsed_seconds ) ).esc() + '/s)</span>'
-                    }
-
-                    document_details.push( detail );
-                  };
-
-                  $( '.docs', details_element )
-                    .html( document_details.join( ', ' ) );
-
-                  // --
-
-                  var dates_config = {
-                      'Started' : 'Full Dump Started',
-                      'Aborted' : 'Aborted',
-                      'Rolledback' : 'Rolledback'
-                  };
-
-                  var dates_details = [];
-                  for( var key in dates_config )
-                  {
-                    var value = response.statusMessages[dates_config[key]];
-
-                    if( value )
-                    {
-                      var detail = '<abbr title="' + dates_config[key].esc() + '">' + key.esc() + '</abbr>: '
-                                 + '<abbr class="time">' +  value.esc() + '</abbr>';
-                      dates_details.push( detail );                      
-                    }
-                  };
-
-                  var dates_element = $( '.dates', details_element );
-
-                  dates_element
-                    .html( dates_details.join( ', ' ) );
-
-                  $( '.time', dates_element )
-                    .removeData( 'timeago' )
-                    .timeago();
-                };
-
-                var get_time_taken = function get_default_time_taken()
-                {
-                  var time_taken_text = response.statusMessages['Time taken'];
-                  return app.convert_duration_to_seconds( time_taken_text );
-                };
-
-                var get_default_info_text = function default_info_text()
-                {
-                  var info_text = response.statusMessages[''] || '';
-
-                  // format numbers included in status nicely
-                  info_text = info_text.replace
-                  (
-                    /\d{4,}/g,
-                    function( match, position, string )
-                    {
-                      return app.format_number( parseInt( match, 10 ) );
-                    }
-                  );
-
-                  var time_taken_text = app.convert_seconds_to_readable_time( get_time_taken() );
-                  if( time_taken_text )
-                  {
-                    info_text += ' (Duration: ' + time_taken_text.esc() + ')';
-                  }
-
-                  return info_text;
-                };
-
-                var show_info = function show_info( info_text, elapsed_seconds )
-                {
-                  $( '.info strong', state_element )
-                    .text( info_text || get_default_info_text() );
-
-                  $( '.info .details', state_element )
-                    .hide();
-                };
-
-                var show_full_info = function show_full_info( info_text, elapsed_seconds )
-                {
-                  show_info( info_text, elapsed_seconds );
-
-                  dataimport_compute_details
-                  (
-                    response,
-                    $( '.info .details', state_element ),
-                    elapsed_seconds || get_time_taken()
-                  );
-                };
-
-                state_element
-                  .removeAttr( 'class' );
-
-                var current_time = new Date();
-                $( '.last_update abbr', state_element )
-                  .text( current_time.toTimeString().split( ' ' ).shift() )
-                  .attr( 'title', current_time.toUTCString() );
-
-                $( '.info', state_element )
-                  .removeClass( 'loader' );
-
-                if( 'busy' === status )
-                {
-                  state_element
-                    .addClass( 'indexing' );
-
-                  if( autorefresh_status )
-                  {
-                    $( '.info', state_element )
-                      .addClass( 'loader' );
-                  }
-
-                  var time_elapsed_text = response.statusMessages['Time Elapsed'];
-                  var elapsed_seconds = app.convert_duration_to_seconds( time_elapsed_text );
-                  time_elapsed_text = app.convert_seconds_to_readable_time( elapsed_seconds );
-
-                  var info_text = time_elapsed_text
-                                ? 'Indexing since ' + time_elapsed_text
-                                : 'Indexing ...';
-
-                  show_full_info( info_text, elapsed_seconds );
-                }
-                else if( rollback_time )
-                {
-                  state_element
-                    .addClass( 'failure' );
-
-                  show_full_info();
-                }
-                else if( abort_time )
-                {
-                  state_element
-                    .addClass( 'aborted' );
-
-                  show_full_info( 'Aborting current Import ...' );
-                }
-                else if( 'idle' === status && 0 !== messages_count )
-                {
-                  state_element
-                    .addClass( 'success' );
-
-                  show_full_info();
-                }
-                else 
-                {
-                  state_element
-                    .addClass( 'idle' );
-
-                  show_info( 'No information available (idle)' );
-                }
-
-                // show raw status
-
-                var code = $(
-                  '<pre class="syntax language-json"><code>' +
-                  app.format_json( xhr.responseText ).esc() +
-                  '</code></pre>'
-                );
-
-                $( '#raw_output_container', content_element ).html( code );
-                hljs.highlightBlock( code.get(0) );
-
-                if( !app.timeout && autorefresh_status )
-                {
-                  app.timeout = window.setTimeout
-                  (
-                    function()
-                    {
-                      dataimport_fetch_status( true )
-                    },
-                    dataimport_timeout
-                  );
-                }
-              },
-              error : function( xhr, text_status, error_thrown )
-              {
-                console.debug( arguments );
-
-                reload_config_element
-                  .addClass( 'error' );
-              },
-              complete : function( xhr, text_status )
-              {
-                $( 'span', status_button )
-                  .removeClass( 'loader' )
-                  .addClass( 'success' );
-
-                window.setTimeout
-                (
-                  function()
-                  {
-                    $( 'span', status_button )
-                      .removeClass( 'success' );
-                  },
-                  dataimport_timeout / 2
-                );
-              }
-            }
-          );
-        }
-
-        // form
-
-        var form = $( 'form', form_element );
-
-        form
-          .ajaxForm
-          (
-            {
-              url : handler_url,
-              data : {
-                wt : 'json',
-                indent : 'true'
-              },
-              dataType : 'json',
-              type: 'POST',
-              beforeSend : function( xhr, settings )
-              {
-                $( 'button[type="submit"] span', form_element )
-                  .addClass( 'loader' );
-
-                error_element
-                  .empty()
-                  .hide();
-              },
-              beforeSubmit : function( array, form, options )
-              {
-                var entity = $( '#entity', form ).val();
-                if( entity.length )
-                {
-                  array.push( { name : 'entity', value: entity } );
-                }
-
-                var start = parseInt( $( '#start', form ).val(), 10 );
-                if( start )
-                {
-                  array.push( { name : 'start', value: start } );
-                }
-
-                var rows = parseInt( $( '#rows', form ).val(), 10 );
-                if( rows )
-                {
-                  array.push( { name : 'rows', value: rows } );
-                }
-
-                $( 'input:checkbox', form ).not( ':checked' )
-                  .each( function( i, input )
-                  {
-                    array.push( { name: input.name, value: 'false' } );
-                  }
-                );
-
-                var custom_parameters = $( '#custom_parameters', form ).val();
-                if( custom_parameters.length )
-                {
-                  var params = custom_parameters.split( '&' );
-                  for( var i in params )
-                  {
-                    var tmp = params[i].split( '=' );
-                    array.push( { name : tmp[0], value: tmp[1] } );
-                  }
-                }
-
-                if( debug_mode )
-                {
-                  array.push( { name: 'dataConfig', value: $( '#dataimport_config .editable textarea' ).val() } );
-                }
-              },
-              success : function( response, text_status, xhr )
-              {
-              },
-              error : function( xhr, text_status, error_thrown )
-              {
-                var response = null;
-                try
-                {
-                  eval( 'response = ' + xhr.responseText + ';' );
-                }
-                catch( e ){}
-
-                error_element
-                  .text( response.error.msg || 'Unknown Error (Exception w/o Message)' )
-                  .show();
-              },
-              complete : function( xhr, text_status )
-              {
-                $( 'button[type="submit"] span', form_element )
-                  .removeClass( 'loader' );
-
-                var debug = $( 'input[name="debug"]:checked', form );
-                if( 0 !== debug.size() )
-                {
-                  var code = $(
-                    '<pre class="syntax language-json"><code>' +
-                    app.format_json( xhr.responseText ).esc() +
-                    '</code></pre>'
-                  );
-
-                  $( '.content', debug_response_element ).html( code );
-                  hljs.highlightBlock( code.get(0) );
-                }
-
-                dataimport_fetch_status();
-              }
-            }
-          );
-
-        $( 'input[name="debug"]', form )
-          .off( 'change' )
-          .on
-          (
-            'change',
-            function( event )
-            {
-              debug_response_element.toggle( this.checked );
-            }
-          );
-
-        $( '#auto-refresh-status a', form_element )
-          .off( 'click' )
-          .on
-          (
-            'click',
-            function( event )
-            {
-              $.cookie( cookie_dataimport_autorefresh, $.cookie( cookie_dataimport_autorefresh ) ? null : true );
-              $( this ).trigger( 'state' );
-
-              dataimport_fetch_status();
-
-              return false;
-            }
-          )
-          .off( 'state' )
-          .on
-          (
-            'state',
-            function( event )
-            {
-              autorefresh_status = !!$.cookie( cookie_dataimport_autorefresh );
-
-              $.cookie( cookie_dataimport_autorefresh )
-                ? $( this ).addClass( 'on' )
-                : $( this ).removeClass( 'on' );
-            }
-          )
-          .trigger( 'state' );
-      }
-    );
-  }
-);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/documents.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/documents.js b/solr/webapp/web/js/scripts/documents.js
deleted file mode 100644
index 45cfbed..0000000
--- a/solr/webapp/web/js/scripts/documents.js
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- 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.
- */
-//helper for formatting JSON and others
-var content_generator = {
-
-  _default: function (toEsc) {
-    return toEsc.esc();
-  },
-
-  json: function (toEsc) {
-    return app.format_json(toEsc);
-  }
-
-};
-
-//Utiltity function for turning on/off various elements
-function toggles(documents_form, show_json, show_file, show_doc, doc_text, show_wizard) {
-  var the_document = $('#document', documents_form);
-  if (show_doc) {
-    //console.log("doc: " + doc_text);
-    the_document.val(doc_text);
-    the_document.show();
-  } else {
-    the_document.hide();
-  }
-  var file_upload = $('#file-upload', documents_form);
-  var upload_only = $('#upload-only', documents_form);
-  if (show_file) {
-    file_upload.show();
-    upload_only.show();
-  } else {
-    file_upload.hide();
-    upload_only.hide();
-  }
-  var wizard = $('#wizard', documents_form);
-  if (show_wizard) {
-    wizard.show();
-  } else {
-    wizard.hide();
-  }
-}
-// #/:core/documents
-
-//Utiltity function for setting up the wizard fields
-function addWizardFields(active_core, wizard) {
-  var core_basepath = active_core.attr('data-basepath');
-  var select_options = "";
-  //Populate the select options based off the Fields REST API
-  $.getJSON(window.location.protocol + '//' + window.location.host
-          + core_basepath + "/schema/fields").done(
-      //TODO: handle dynamic fields
-      //TODO: get the unique key, too
-      function (data) {
-        var field_select = $("#wiz-field-select", wizard);
-        field_select.empty();
-        $.each(data.fields,
-            function (i, item) {
-              //console.log("i[" + i + "]=" + item.name);
-              if (item.name != "_version_"){
-                select_options += '<option name="' + item.name + '">'
-                  + item.name + '</option>';
-              }
-            });
-        //console.log("select_options: " + select_options);
-        //fill in the select options
-        field_select.append(select_options);
-      });
-  var wizard_doc = $("#wizard-doc", wizard);
-  wizard_doc.die('focusin')
-      .live('focusin', function (event) {
-        $("#wizard-doc", wizard).text("");
-      }
-  );
-  //Add the click handler for the "Add Field" target, which
-  //takes the field content and moves it into the document target
-  var add_field = $("#add-field-href", wizard);
-  add_field.die("click")
-      .live("click",
-      function (event) {
-        //take the field and the contents and append it to the document
-        var wiz_select = $("#wiz-field-select", wizard);
-        var selected = $("option:selected", wiz_select);
-        console.log("selected field: " + selected);
-        var wiz_doc = $("#wizard-doc", wizard);
-        var the_document = $("#document");
-        var current_doc = the_document.val();
-        console.log("current_text: " + current_doc + " wiz_doc: " + wiz_doc.val());
-        var index = current_doc.lastIndexOf("}");
-        var new_entry = '"' + selected.val() + '":"' + wiz_doc.val() + '"';
-        if (index >= 0) {
-          current_doc = current_doc.substring(0, index) + ', ' + new_entry + "}";
-        } else {
-          //we don't have a doc at all
-          current_doc = "{" + new_entry + "}";
-        }
-        current_doc = content_generator['json'](current_doc);
-        the_document.val(current_doc);
-        //clear the wiz doc window
-        wiz_doc.val("");
-        return false;
-      }
-  );
-
-  //console.log("adding " + i + " child: " + child);
-
-}
-
-//The main program for adding the docs
-sammy.get
-(
-    new RegExp(app.core_regex_base + '\\/(documents)$'),
-    function (context) {
-      var active_core = this.active_core;
-      var core_basepath = active_core.attr('data-basepath');
-      var content_element = $('#content');
-
-
-      $.post
-      (
-          'tpl/documents.html',
-          function (template) {
-
-            content_element
-                .html(template);
-            var documents_element = $('#documents', content_element);
-            var documents_form = $('#form form', documents_element);
-            var url_element = $('#url', documents_element);
-            var result_element = $('#result', documents_element);
-            var response_element = $('#response', documents_element);
-            var doc_type_select = $('#document-type', documents_form);
-            //Since we are showing "example" docs, when the area receives the focus
-            // remove the example content.
-            $('#document', documents_form).die('focusin')
-                .live('focusin',
-                function (event) {
-                  var document_type = $('#document-type', documents_form).val();
-                  if (document_type != "wizard"){
-                    //Don't clear the document when in wizard mode.
-                    var the_document = $('#document', documents_form);
-                    the_document.text("");
-                  }
-                }
-            );
-
-            /*response_element.html("");*/
-            //Setup the handlers for toggling the various display options for the "Document Type" select
-            doc_type_select
-                .die('change')
-                .live
-            (
-                'change',
-                function (event) {
-                  var document_type = $('#document-type', documents_form).val();
-                  var file_upload = $('#file-upload', documents_form);
-
-                  //need to clear out any old file upload by forcing a redraw so that
-                  //we don't try to upload an old file
-                  file_upload.html(file_upload.html());
-                  if (document_type == "json") {
-                    toggles(documents_form, true, false, true, '{"id":"change.me","title":"change.me"}', false);
-                    $("#attribs").show();
-                  } else if (document_type == "upload") {
-                    toggles(documents_form, false, true, false, "", false);
-                    $("#attribs").show();
-                  } else if (document_type == "csv") {
-                    toggles(documents_form, false, false, true, "id,title\nchange.me,change.me", false);
-                    $("#attribs").show();
-                  } else if (document_type == "solr") {
-                    toggles(documents_form, false, false, true, '<add>\n' +
-                        '<doc>\n' +
-                        '<field name="id">change.me</field>\n' +
-                        '<field name="title" >chang.me</field>\n' +
-                        '</doc>\n' +
-                        '</add>\n', false);
-                    $("#attribs").hide();
-                  } else if (document_type == "wizard") {
-                    var wizard = $('#wizard', documents_form);
-                    addWizardFields(active_core, wizard);
-                    //$("#wizard-doc", wizard).text('Enter your field text here and then click "Add Field" to add the field to the document.');
-                    toggles(documents_form, false, false, true, "", true);
-                    $("#attribs").show();
-                  } else if (document_type == "xml") {
-                    toggles(documents_form, false, false, true, '<doc>\n' +
-                        '<field name="id">change.me</field>' +
-                        '<field name="title">change.me</field>' +
-                        '</doc>', false);
-                    $("#attribs").show();
-                  }
-                  return false;
-                }
-            );
-            doc_type_select.chosen().trigger('change');
-            //Setup the submit option handling.
-            documents_form
-                .die('submit')
-                .live
-            (
-                'submit',
-                function (event) {
-                  var form_values = [];
-                  var handler_path = $('#qt', documents_form).val();
-                  if ('/' !== handler_path[0]) {
-                    form_values.push({ name: 'qt', value: handler_path.esc() });
-                    handler_path = '/update';
-                  }
-
-                  var document_url = window.location.protocol + '//' + window.location.host
-                      + core_basepath + handler_path + '?wt=json';
-
-                  url_element
-                      .attr('href', document_url)
-                      .text(document_url)
-                      .trigger('change');
-                  var the_document = $('#document', documents_form).val();
-                  var commit_within = $('#commitWithin', documents_form).val();
-                  var overwrite = $('#overwrite', documents_form).val();
-                  var the_command = "";
-                  var content_type = "";
-                  var document_type = $('#document-type', documents_form).val();
-                  var doingFileUpload = false;
-                  //Both JSON and Wizard use the same pathway for submission
-                  //New entries primarily need to fill the_command and set the content_type
-                  if (document_type == "json" || document_type == "wizard") {
-                    //create a JSON command
-                    the_command = "{"
-                        + '"add":{ "doc":' + the_document + ","
-                        + '"overwrite":' + overwrite + ","
-                        + '"commitWithin":' + commit_within
-                        + "}}";
-                    content_type = "application/json";
-                  } else if (document_type == "csv") {
-                    the_command = the_document;
-                    document_url += "&commitWithin=" + commit_within + "&overwrite=" + overwrite;
-                    content_type = "application/csv";
-                  } else if (document_type == "xml") {
-                    the_command = '<add commitWithin="' + commit_within
-                        + '" overwrite="' + overwrite + '"'
-                        + ">"
-                        + the_document + "</add>";
-                    content_type = "text/xml";
-                  } else if (document_type == "upload") {
-                    doingFileUpload = true;
-                  } else if (document_type == "solr") {
-                    //guess content_type
-                    the_command = the_document;
-                    if (the_document.indexOf("<") >= 0) {
-                      //XML
-                      content_type = "text/xml";
-                    } else if (the_document.indexOf("{") >= 0) {
-                      //JSON
-                      content_type = "application/json";
-                    } //TODO: do we need to handle others?
-                  } else {
-                    //How to handle other?
-                  }
-
-                  //Handle the submission of the form in the case where we are not uploading a file
-                  if (doingFileUpload == false) {
-                    $.ajax(
-                        {
-                          url: document_url,
-                          //dataType : 'json',
-                          processData: false,
-                          type: 'POST',
-                          contentType: content_type,
-                          data: the_command,
-                          context: response_element,
-                          beforeSend: function (xhr, settings) {
-                            console.log("beforeSend: Vals: " + document_url + " content-type: " + document_type + " the cmd: " + the_command);
-
-                          },
-                          success: function (response, text_status, xhr) {
-                            console.log("success:  " + response + " status: " + text_status + " xhr: " + xhr.responseText);
-                            this.html('<div><span class="description">Status</span>: ' + text_status + '</div>'
-                                + '<div><span class="description">Response:</span>' + '<pre class="syntax language-json"><code>' + content_generator['json'](xhr.responseText) + "</code></pre></div>");
-                            result_element.show();
-                          },
-                          error: function (xhr, text_status, error_thrown) {
-                            console.log("error: " + text_status + " thrown: " + error_thrown);
-                            this.html('<div><span class="description">Status</span>: ' + text_status + '</div><div><span class="description">Error:</span> '
-                                + '' + error_thrown
-                                + '</div>'
-                                + '<div><span class="description">Error</span>:' + '<pre class="syntax language-json"><code>'
-                                + content_generator['json'](xhr.responseText) +
-                                '</code></pre></div>');
-                            result_element.show();
-                          },
-                          complete: function (xhr, text_status) {
-                            //console.log("complete: " + text_status + " xhr: " + xhr.responseText + " doc type: " + document_type);
-
-                            //alert(text_status + ": " + xhr.responseText);
-                            /*this
-                             .removeClass( 'loader' );*/
-                          }
-                        }
-                    );
-                  } else {
-                    //upload the file
-                    var the_file = $('#the-file', documents_form);
-                    var erh_params = $('#erh-params', documents_form).val();
-                    if (erh_params != "") {
-                      if (erh_params.substring(0,1) != "&"){
-                        erh_params = "&" + erh_params;
-                      }
-                      document_url = document_url + erh_params;
-                    }
-                    console.log("uploading file to: " + document_url);
-                    the_file.ajaxfileupload({
-                      'action': document_url,
-                      'validate_extensions': false,
-                      'upload_now': true,
-                      'params': {
-                        'extra': 'info'
-                      },
-                      'onComplete': function (response) {
-                        response = response.replace('<pre style="word-wrap: break-word; white-space: pre-wrap;">', "");
-                        response = response.replace("</pre>", "");
-                        console.log('completed upload: ' + response);
-                        response_element.html('<div><span class="description">Response:</span>' + '<pre class="syntax language-json"><code>' + content_generator['json'](response) + "</code></pre></div>");
-                        result_element.show();
-
-                      },
-                      'onStart': function () {
-                        console.log("starting file upload");
-                        //if (weWantedTo) return false; // cancels upload
-                      },
-                      'onCancel': function () {
-                        console.log('no file selected');
-                      }
-                    });
-                  }
-                  return false;
-                }
-            );
-          }
-      )
-    }
-)
-/*
- Sample docs:
- <doc boost="2.5">
- <field name="id">05991</field>
- <field name="title" boost="2.0">Bridgewater</field>
- </doc>
-
- {"id":"foo","title":"blah"}
-
- */
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/files.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/files.js b/solr/webapp/web/js/scripts/files.js
deleted file mode 100644
index c6b1951..0000000
--- a/solr/webapp/web/js/scripts/files.js
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- 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.
-*/
-
-// #/:core/files
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(files)$' ),
-  function( context )
-  {
-    core_basepath = this.active_core.attr( 'data-basepath' );
-    current_core = context.params.splat[0];
-
-    var content_element = $( '#content' );
-
-    var file_endpoint = core_basepath + '/admin/file';
-
-    var path = context.path.split( '?' );
-    var selected_file = null;
-    if( path && path[1] )
-    {
-      selected_file = path[1].split( '=' ).pop();
-    }
-
-    $.get
-    (
-      'tpl/files.html',
-      function( template )
-      {
-        content_element
-          .html( template );
-
-        var frame_element = $( '#frame', content_element );
-
-        var tree_callback = function( event, data )
-        {
-          $( 'li[data-file].jstree-closed', event.currentTarget )
-            .filter
-            (
-              function( index, element )
-              {
-                return selected_file && 0 === selected_file.indexOf( $( element ).data( 'file' ) );
-              }
-            )
-            .each
-            (
-              function( index, element )
-              {
-                data.inst.open_node( element );
-              }
-            );
-
-          if( selected_file )
-          {
-            $( 'li[data-file="' + selected_file.replace( /\/$/, '' ) + '"] > a', event.currentTarget )
-              .addClass( 'active' );
-          }
-        };
-
-        var load_tree = function()
-        {
-          $( '#tree', frame_element )
-            .empty()
-            .jstree
-            (
-              {
-                plugins : [ 'json_data', 'sort' ],
-                json_data : {
-                  ajax: {
-                    url : file_endpoint + '?wt=json',
-                    data : function( n )
-                    {
-                      if( -1 === n )
-                        return null;
-
-                      return {
-                        file : n.attr( 'data-file' )
-                      };
-                    },
-                    success : function( response, status, xhr )
-                    {
-                      var files = [];
-
-                      for( var file in response.files )
-                      {
-                        var is_directory = response.files[file].directory;
-                        var prefix = xhr.data ? xhr.data.file + '/' : ''
-
-                        var item = {
-                          data: {
-                            title : file,
-                            attr : {
-                              title : file,
-                              href : '#/' + current_core + '/files?file=' + prefix + file
-                            }
-                          },
-                          attr : {
-                            'data-file' : prefix + file
-                          }
-                        };
-
-                        if( is_directory )
-                        {
-                          item.state = 'closed';
-                          item.data.attr.href += '/';
-                        }
-
-                        files.push( item );
-                      }
-
-                      return files;
-                    }
-                  },
-                  progressive_render : true
-                },
-                core : {
-                  animation : 0
-                }
-              }
-            )
-            .on
-            (
-              'loaded.jstree',
-              tree_callback
-            )
-            .on
-            (
-              'open_node.jstree',
-              tree_callback
-            );
-        };
-        load_tree();
-
-        if( selected_file )
-        {
-          $( '#new-file-holder input' )
-            .val
-            (
-              '/' !== selected_file.substr( -1 )
-              ? selected_file.replace( /[^\/]+$/, '' )
-              : selected_file
-            );
-        }
-
-        if( selected_file && '/' !== selected_file.substr( -1 ) )
-        {
-          frame_element
-            .addClass( 'show' );
-
-          var endpoint = file_endpoint + '?file=' + selected_file;
-
-          var content_type_map = { xml : 'text/xml', html : 'text/html', js : 'text/javascript', json : 'application/json', 'css' : 'text/css' };
-          if (selected_file == 'managed-schema') {
-            endpoint += '&contentType=' + 'text/xml' + ';charset=utf-8';
-          } else {
-            var file_ext = selected_file.match( /\.(\w+)$/  );
-            endpoint += '&contentType=' + ( content_type_map[ file_ext[1] || '' ] || 'text/plain' ) + ';charset=utf-8';
-          }
-
-
-          var public_url = window.location.protocol + '//' + window.location.host + endpoint;
-
-          $( '#url', frame_element )
-            .text( public_url )
-            .attr( 'href', public_url );
-
-          var load_file = function( load_tree )
-          {
-            if( load_tree )
-            {
-              load_tree();
-            }
-
-            $.ajax
-            (
-              {
-                url : endpoint,
-                context : frame_element,
-                beforeSend : function( xhr, settings )
-                {
-                  var block = $( '.view-file .response', this );
-
-                  if( !block.data( 'placeholder' ) )
-                  {
-                    block.data( 'placeholder', block.text() );
-                  }
-
-                  block
-                    .text( block.data( 'placeholder' ) );
-                },
-                success : function( response, text_status, xhr )
-                {
-                  var content_type = xhr.getResponseHeader( 'Content-Type' ) || '';
-                  var highlight = null;
-
-                  if( 0 === content_type.indexOf( 'text/xml' ) ||  0 === xhr.responseText.indexOf( '<?xml' ) ||
-                      0 === content_type.indexOf( 'text/html' ) ||  0 === xhr.responseText.indexOf( '<!--' ) )
-                  {
-                    highlight = 'xml';
-                  }
-                  else if( 0 === content_type.indexOf( 'text/javascript' ) )
-                  {
-                    highlight = 'javascript';
-                  }
-                  else if( 0 === content_type.indexOf( 'text/css' ) )
-                  {
-                    highlight = 'css';
-                  }
-                  else if( 0 === content_type.indexOf( 'application/json' ) )
-                  {
-                    highlight = 'json';
-                  }
-
-                  var code = $(
-                    '<pre class="syntax' + ( highlight ? ' language-' + highlight : '' )+ '"><code>' +
-                    xhr.responseText.esc() +
-                    '</code></pre>'
-                  );
-                  $( '.view-file .response', this )
-                    .html( code );
-
-                  if( highlight )
-                  {
-                    hljs.highlightBlock( code.get( 0 ) );
-                  }
-
-                  $( 'form textarea', this )
-                    .val( xhr.responseText );
-                },
-                error : function( xhr, text_status, error_thrown)
-                {
-                  $( '.view-file .response', this )
-                    .text( 'No such file exists.' );
-                },
-                complete : function( xhr, text_status )
-                {
-                }
-              }
-            );
-          }
-          load_file();
-        }
-      }
-    );
-  }
-);
-
-// legacy redirect for 'config' & 'schema' pages
-// #/:core/schema, #/:core/config
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(schema|config)$' ),
-  function( context )
-  {
-    context.redirect( '#/' + context.params.splat[0] + '/files?file=' + this.active_core.attr( context.params.splat[1] ) );    
-  }
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/index.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/index.js b/solr/webapp/web/js/scripts/index.js
deleted file mode 100644
index d01c4a9..0000000
--- a/solr/webapp/web/js/scripts/index.js
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- 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.
-*/
-
-var parse_memory_value = function( value )
-{
-  if( value !== Number( value ) )
-  {
-    var units = 'BKMGTPEZY';
-    var match = value.match( /^(\d+([,\.]\d+)?) (\w)\w?$/ );
-    var value = parseFloat( match[1] ) * Math.pow( 1024, units.indexOf( match[3].toUpperCase() ) );
-  }
-    
-  return value;
-};
-
-var generate_bar = function( bar_container, bar_data, convert_label_values )
-{
-  bar_holder = $( '.bar-holder', bar_container );
-
-  var bar_level = 1;
-  var max_width = Math.round( $( '.bar-max', bar_holder ).width() );
-  $( '.bar-max.val', bar_holder ).text( bar_data['max'] );
-    
-  bar_level++;
-  $( '.bar-total.bar', bar_holder ).width( new String( (bar_data['total']/bar_data['max'])*100 ) + '%' );
-  $( '.bar-total.val', bar_holder ).text( bar_data['total'] );
-
-  if( bar_data['used'] )
-  {
-    bar_level++;
-    $( '.bar-used.bar', bar_holder ).width( new String( (bar_data['used']/bar_data['total'])*100 ) + '%' );
-    $( '.bar-used.val', bar_holder ).text( bar_data['used'] );
-  }
-
-  bar_holder
-    .addClass( 'bar-lvl-' + bar_level );
-
-  var percentage = ( ( ( bar_data['used'] || bar_data['total'] ) / bar_data['max'] ) * 100 ).toFixed(1);
-        
-  var hl = $( '[data-desc="' + bar_container.attr( 'id' ) + '"]' );
-
-  $( '.bar-desc', hl )
-    .remove();
-
-  hl
-    .append( ' <small class="bar-desc">' + percentage + '%</small>' );
-
-  if( !!convert_label_values )
-  {
-    $( '.val', bar_holder )
-      .each
-      (
-        function()
-        {
-          var self = $( this );
-
-          var unit = null;
-          var byte_value = parseInt( self.html() );
-
-          self
-            .attr( 'title', 'raw: ' + byte_value + ' B' );
-
-          byte_value /= 1024;
-          byte_value /= 1024;
-          unit = 'MB';
-
-          if( 1024 <= byte_value )
-          {
-            byte_value /= 1024;
-            unit = 'GB';
-          }
-
-          byte_value = byte_value.toFixed( 2 ) + ' ' + unit;
-
-          self
-            .text( byte_value );
-        }
-      );
-  }
-};
-
-var system_info = function( element, system_data )
-{
-  // -- usage
-
-  var load_average = ( system_data['system']['uptime'] || '' ).match( /load averages?: (\d+[.,]\d\d),? (\d+[.,]\d\d),? (\d+[.,]\d\d)/ );
-  if( load_average )
-  {
-    var hl = $( '#system h2', element );
-
-    $( '.bar-desc', hl )
-      .remove();
-
-    hl
-      .append( ' <small class="bar-desc">' + load_average.slice( 1 ).join( '  ' ).replace( /,/g, '.' ).esc() + '</small>' );
-  }
-
-  // -- physical-memory-bar
-    
-  var bar_holder = $( '#physical-memory-bar', element );
-  if( system_data['system']['totalPhysicalMemorySize'] === undefined || system_data['system']['freePhysicalMemorySize'] === undefined )
-  {
-    bar_holder.hide();
-  }
-  else
-  {
-    bar_holder.show();
-
-    var bar_data = {
-      'max' : parse_memory_value( system_data['system']['totalPhysicalMemorySize'] ),
-      'total' : parse_memory_value( system_data['system']['totalPhysicalMemorySize'] - system_data['system']['freePhysicalMemorySize'] )
-    };
-
-    generate_bar( bar_holder, bar_data, true );
-  }
-
-  // -- swap-space-bar
-    
-  var bar_holder = $( '#swap-space-bar', element );
-  if( system_data['system']['totalSwapSpaceSize'] === undefined || system_data['system']['freeSwapSpaceSize'] === undefined )
-  {
-    bar_holder.hide();
-  }
-  else
-  {
-    bar_holder.show();
-
-    var bar_data = {
-      'max' : parse_memory_value( system_data['system']['totalSwapSpaceSize'] ),
-      'total' : parse_memory_value( system_data['system']['totalSwapSpaceSize'] - system_data['system']['freeSwapSpaceSize'] )
-    };
-
-    generate_bar( bar_holder, bar_data, true );
-  }
-
-  // -- file-descriptor-bar
-    
-  var bar_holder = $( '#file-descriptor-bar', element );
-  if( system_data['system']['maxFileDescriptorCount'] === undefined || system_data['system']['openFileDescriptorCount'] === undefined )
-  {
-    bar_holder.hide();
-  }
-  else
-  {
-    bar_holder.show();
-
-    var bar_data = {
-      'max' : parse_memory_value( system_data['system']['maxFileDescriptorCount'] ),
-      'total' : parse_memory_value( system_data['system']['openFileDescriptorCount'] )
-    };
-
-    generate_bar( bar_holder, bar_data );
-  }
-
-  0 === $( '#system div[id$="-bar"]:visible', element ).size()
-    ? $( '#system .no-info', element ).show()
-    : $( '#system .no-info', element ).hide();
-
-  // -- memory-bar
-
-  var bar_holder = $( '#jvm-memory-bar', element );
-  if( system_data['jvm']['memory'] === undefined )
-  {
-    bar_holder.hide();
-  }
-  else
-  {
-    bar_holder.show();
-
-    var jvm_memory = $.extend
-    (
-      {
-        'free' : null,
-        'total' : null,
-        'max' : null,
-        'used' : null,
-        'raw' : {
-          'free' : null,
-          'total' : null,
-          'max' : null,
-          'used' : null,
-          'used%' : null
-        }
-      },
-      system_data['jvm']['memory']
-    );
-
-    var bar_data = {
-      'max' : parse_memory_value( jvm_memory['raw']['max'] || jvm_memory['max'] ),
-      'total' : parse_memory_value( jvm_memory['raw']['total'] || jvm_memory['total'] ),
-      'used' : parse_memory_value( jvm_memory['raw']['used'] || jvm_memory['used'] )
-    };
-
-    generate_bar( bar_holder, bar_data, true );
-  }
-
-}
-
-// #/
-sammy.get
-(
-  /^#\/$/,
-  function( context )
-  {
-    var content_element = $( '#content' );
-
-    content_element
-      .html( '<div id="index"></div>' );
-
-    $.ajax
-    (
-      {
-        url : 'tpl/index.html',
-        context : $( '#index', content_element ),
-        beforeSend : function( arr, form, options )
-        {
-        },
-        success : function( template )
-        {
-          var self = this;
-
-          this
-            .html( template );
-    
-          var data = {
-            'start_time' : app.dashboard_values['jvm']['jmx']['startTime'],
-            'jvm_version' : app.dashboard_values['jvm']['name'] + ' (' + app.dashboard_values['jvm']['version'] + ')',
-            'processors' : app.dashboard_values['jvm']['processors'],
-            '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'] || '-'
-          };
-    
-          for( var key in data )
-          {                                                        
-            var value_element = $( '.' + key + ' dd', this );
-
-            value_element
-              .text( data[key].esc() );
-                        
-            value_element.closest( 'li' )
-              .show();
-          }
-
-          var commandLineArgs = app.dashboard_values['jvm']['jmx']['commandLineArgs'].sort().reverse();
-          if( 0 !== commandLineArgs.length )
-          {
-            var cmd_arg_element = $( '.command_line_args dt', this );
-            var cmd_arg_key_element = $( '.command_line_args dt', this );
-            var cmd_arg_element = $( '.command_line_args dd', this );
-
-            for( var key in commandLineArgs )
-            {
-              cmd_arg_element = cmd_arg_element.clone();
-              cmd_arg_element.text( commandLineArgs[key] );
-
-              cmd_arg_key_element
-                .after( cmd_arg_element );
-            }
-
-            cmd_arg_key_element.closest( 'li' )
-              .show();
-
-            $( '.command_line_args dd:last', this )
-              .remove();
-
-            $( '.command_line_args dd:odd', this )
-              .addClass( 'odd' );
-          }
-
-          $( '.timeago', this )
-            .timeago();
-
-          $( '.index-left .block li:visible:odd', this )
-            .addClass( 'odd' );
-                    
-          // -- system_info
-
-          system_info( this, app.dashboard_values );
-
-          $( '#system a.reload', this )
-            .die( 'click' )
-            .live
-            (
-              'click',
-              function( event )
-              {
-                $.ajax
-                (
-                  {
-                    url : config.solr_path + '/admin/info/system?wt=json',
-                    dataType : 'json',
-                    context : this,
-                    beforeSend : function( arr, form, options )
-                    {
-                      loader.show( this );
-                    },
-                    success : function( response )
-                    {
-                      system_info( self, response );
-                    },
-                    error : function()
-                    {
-                    },
-                    complete : function()
-                    {
-                      loader.hide( this );
-                    }
-                  }
-                );
-
-                return false;
-              }
-            );
-        },
-        error : function( xhr, text_status, error_thrown )
-        {
-        },
-        complete : function( xhr, text_status )
-        {
-        }
-      }
-    );
-  }
-);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/java-properties.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/java-properties.js b/solr/webapp/web/js/scripts/java-properties.js
deleted file mode 100644
index a37ddd9..0000000
--- a/solr/webapp/web/js/scripts/java-properties.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- 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.
-*/
-
-// #/~java-properties
-sammy.get
-(
-  /^#\/(~java-properties)$/,
-  function( context )
-  {
-    var content_element = $( '#content' );
-
-    content_element
-      .html( '<div id="java-properties"></div>' );
-
-    $.ajax
-    (
-      {
-        url : app.config.solr_path + '/admin/info/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 = [];
-
-          var workaround = xhr.responseText.match( /"(line\.separator)"\s*:\s*"(.+?)"/ );
-          if( workaround && workaround[2] )
-          {
-            system_properties[workaround[1]] = workaround[2];
-          }
-
-          for( var key in system_properties )
-          {
-            var displayed_key = key.replace( /\./g, '.&#8203;' );
-            var displayed_value = [ system_properties[key] ];
-            var item_class = 'clearfix';
-
-            if( -1 !== key.indexOf( '.path' ) || -1 !== key.indexOf( '.dirs' ) )
-            {
-              displayed_value = system_properties[key].split( system_properties['path.separator'] );
-              if( 1 < displayed_value.length )
-              {
-                item_class += ' multi';
-              }
-            }
-
-            var item_content = '<li><dl class="' + item_class + '">' + "\n"
-                             + '<dt>' + displayed_key.esc() + '</dt>' + "\n";
-
-            for( var i in displayed_value )
-            {
-              item_content += '<dd>' + displayed_value[i].esc() + '</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 )
-        {
-        }
-      }
-    );
-  }
-);
\ No newline at end of file


[19/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/logging.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/logging.js b/solr/webapp/web/js/scripts/logging.js
deleted file mode 100644
index a632ab6..0000000
--- a/solr/webapp/web/js/scripts/logging.js
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- 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.
-*/
-
-var loglevel_path = app.config.solr_path + '/admin/info/logging';
-var cookie_logging_timezone = 'logging_timezone';
-var frame_element = null;
-
-var logging_handler = function( response, text_status, xhr )
-{
-  var self = this;
-  var loggers = response.loggers;
-
-  var levels = '<div class="selector-holder"><div class="selector">' + "\n"
-             + '<a class="trigger"><span><em>null</em></span></a>' + "\n"
-             + '<ul>' + "\n";
-
-  for( var key in response.levels )
-  {
-    var level = response.levels[key].esc();
-    levels += '<li><a href="#" data-level="' + level + '">' + level + '</a></li>' + "\n";
-  }
-
-  levels += '<li class="unset"><a href="#" data-level="unset">UNSET</a></li>' + "\n"
-         + '</ul>' + "\n"
-         + '<a class="close"><span>[x]</span></a>' + "\n"
-         + '</div></div>';
-
-  var logger_tree = function( filter )
-  {
-    var logger_content = '';
-    var filter_regex = new RegExp( '^' + filter + '\\.\\w+$' );
-
-    for( var i in loggers )
-    {
-      var logger = loggers[i];
-      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 logger_class = '';
-
-      if( logger.set )
-      {
-        logger_class = 'set';
-      }
-            
-      if( !logger.level )
-      {
-        logger_class = 'null';
-      }
-
-      var logger_name = logger.name.split( '.' );
-      var display_name = logger_name.pop();
-
-      var leaf_class = 'jstree-leaf';
-      if( logger.level )
-      {
-        leaf_class += ' level-' + logger.level.esc().toLowerCase();
-      }
-
-      logger_content += '<li class="' + leaf_class + '" data-logger="' + logger.name.esc() + '">';
-      logger_content += '<ins class="trigger jstree-icon">&nbsp;</ins>' + "\n";
-      logger_content += '<a href="#" class="trigger '+ logger_class + '"' ;
-
-      if( logger.level )
-      {
-        logger_content += 'rel="' + logger.level.esc() + '" ';
-      }
-            
-      logger_content += 'title="' + logger.name.esc() + '">' + "\n";
-
-      if( 0 !== logger_name.length )
-      {
-        logger_content += '<span class="ns">' + logger_name.join( '.' ).esc() + '.</span>';
-      }
-
-      logger_content += '<span class="name">' + ( display_name ? display_name.esc() : '<em>empty</em>' ) + '</span>' + "\n";
-      logger_content += '</a>';
-
-      logger_content += levels;
-
-      if( !!logger.name )
-      {
-        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 = '<div class="block">' + "\n"
-                     + '<h2><span>' + response.watcher.esc() + '</span></h2>' + "\n"
-                     + '<ul class="tree jstree">' + logger_tree( null ) + '</ul>' + "\n"
-                     + '</div>';
-
-  self
-    .html( logger_content );
-
-  self
-    .die( 'clear' )
-    .live
-    (
-      'clear',
-      function( event )
-      {
-        $( '.open', this )
-          .removeClass( 'open' );
-      }
-    );
-
-  $( 'li:last-child', this )
-    .addClass( 'jstree-last' );
-
-  $( 'li.jstree-leaf > a', this )
-    .each
-    (
-      function( index, element )
-      {
-        element = $( element );
-        var level = element.attr( 'rel' );
-
-        if( level )
-        {
-          var selector = $( '.selector-holder', element.closest( 'li' ) );
-
-          var trigger = $( 'a.trigger', selector );
-
-          trigger
-            .text( level.esc() );
-
-          if( element.hasClass( 'set' ) )
-          {
-            trigger.first()
-              .addClass( 'set' );
-          }
-
-          $( 'ul a[data-level="' + level + '"]', selector ).first()
-            .addClass( 'level' );
-        }
-      }
-    )
-
-  $( '.trigger', this )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function( event )
-      {
-        self.trigger( 'clear' );
-
-        $( '.selector-holder', $( this ).parents( 'li' ).first() ).first()
-          .trigger( 'toggle' );
-
-        return false;
-      }
-    );
-
-  $( '.selector .close', this )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function( event )
-      {
-        self.trigger( 'clear' );
-        return false;
-      }
-    );
-    
-  $( '.selector-holder', this )
-    .die( 'toggle')
-    .live
-    (
-      'toggle',
-      function( event )
-      {
-        var row = $( this ).closest( 'li' );
-
-        $( 'a:first', row )
-          .toggleClass( 'open' );
-
-        $( '.selector-holder:first', row )
-          .toggleClass( 'open' );
-      }
-    );
-
-  $( '.selector ul a', this )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function( event )
-      {
-        var element = $( this );
-
-        $.ajax
-        (
-          {
-            url : loglevel_path,
-            dataType : 'json',
-            data : {
-              'wt' : 'json',
-              'set' : $( this ).parents( 'li[data-logger]' ).data( 'logger' ) + ':' + element.data( 'level' )
-            },
-            type : 'POST',
-            context : self,
-            beforeSend : function( xhr, settings )
-            {
-              element
-                .addClass( 'loader' );
-            },
-            success : logging_handler
-          }
-        );
-
-        return false;
-      }
-    );
-
-};
-
-var format_time_options = {};
-
-var format_time = function( time )
-{
-  time = time ? new Date( time ) : new Date();
-  return '<time datetime="' + time.toISOString().esc() + '">' + format_time_content( time ) + '</abbr>';
-}
-
-var format_time_content = function( time )
-{
-  return time.toLocaleString( undefined, format_time_options ).esc();
-}
-
-var load_logging_viewer = function()
-{
-  var table = $( 'table', frame_element );
-  var state = $( '#state', frame_element );
-  var since = table.data( 'latest' ) || 0;
-  var sticky_mode = null;
-
-  $.ajax
-  (
-    {
-      url : loglevel_path + '?wt=json&since=' + since,
-      dataType : 'json',
-      beforeSend : function( xhr, settings )
-      {
-        // initial request
-        if( 0 === since )
-        {
-          sticky_mode = true;
-        }
-
-        // state element is in viewport
-        else if( state.position().top <= $( window ).scrollTop() + $( window ).height() - ( $( 'body' ).height() - state.position().top ) )
-        {
-          sticky_mode = true;
-        }
-
-        else
-        {
-          sticky_mode = false;
-        }
-      },
-      success : function( response, text_status, xhr )
-      {
-        var docs = response.history.docs;
-        var docs_count = docs.length;
-
-        var table = $( 'table', frame_element );
-
-        $( 'h2 span', frame_element )
-          .text( response.watcher.esc() );
-
-        state
-          .html( 'Last Check: ' + format_time() );
-
-        app.timeout = setTimeout
-        (
-          load_logging_viewer,
-          10000
-        );
-
-        if( 0 === docs_count )
-        {
-          table.trigger( 'update' );
-          return false;
-        }
-
-        var content = '<tbody>';
-
-        for( var i = 0; i < docs_count; i++ )
-        {
-          var doc = docs[i];
-
-          if( 1 === doc.time.length )
-          {
-            for( var key in doc )
-            {
-              doc[key] = doc[key][0];
-            }
-          }
-
-          if( !doc.trace )
-          {
-            var lines = doc.message.split( "\n" );
-            if( 1 < lines.length )
-            {
-              doc.trace = doc.message;
-              doc.message = lines[0];
-              delete lines;
-            }
-          }
-
-          var has_trace = 'undefined' !== typeof( doc.trace );
-
-          doc.logger = '<abbr title="' + doc.logger.esc() + '">' + doc.logger.split( '.' ).pop().esc() + '</abbr>';
-
-          var classes = [ 'level-' + doc.level.toLowerCase().esc() ];
-          if( has_trace )
-          {
-            classes.push( 'has-trace' );
-          }
-
-          content += '<tr class="' + classes.join( ' ' ) + '">' + "\n";
-            content += '<td class="span"><a><span>' + format_time( doc.time ) + '</span></a></td>' + "\n";
-            content += '<td class="level span"><a><span>' + doc.level.esc() + '</span></span></a></td>' + "\n";
-            content += '<td class="span"><a><span>' + doc.core   + '</span></a></td>' + "\n";
-            content += '<td class="span"><a><span>' + doc.logger + '</span></a></td>' + "\n";
-            content += '<td class="message span"><a><span>' + doc.message.replace( /,/g, ',&#8203;' ).esc() + '</span></a></td>' + "\n";
-          content += '</tr>' + "\n";
-
-          if( has_trace )
-          {
-            content += '<tr class="trace">' + "\n";
-              content += '<td colspan="4"><pre>' + doc.trace.esc() + '</pre></td>' + "\n";
-            content += '</tr>' + "\n";
-          }
-
-        }
-
-        content += '</tbody>';
-
-        $( 'table', frame_element )
-          .append( content );
-
-        table
-          .data( 'latest', response.info.last )
-          .removeClass( 'has-data' )
-          .trigger( 'update' );
-
-        if( sticky_mode )
-        {
-          $( 'body' )
-            .animate
-            (
-                { scrollTop: state.position().top },
-                1000
-            );
-        }
-      },
-      error : function( xhr, text_status, error_thrown)
-      {
-      },
-      complete : function( xhr, text_status )
-      {
-      }
-    }
-  );
-}
-
-// #/~logging
-sammy.get
-(
-  /^#\/(~logging)$/,
-  function( context )
-  {
-    var content_element = $( '#content' );
-
-    $.get
-    (
-      'tpl/logging.html',
-      function( template )
-      {
-        content_element
-          .html( template );
-
-        frame_element = $( '#frame', content_element );
-        frame_element
-          .html
-          (
-            '<div id="viewer">' + "\n" +
-              '<div class="block">' + "\n" +
-                '<h2><span>&nbsp;</span></h2>' + "\n" +
-              '</div>' + "\n" +
-              '<table border="0" cellpadding="0" cellspacing="0">' + "\n" +
-                '<thead>' + "\n" +
-                  '<tr>' + "\n" +
-                    '<th class="time">Time (<span>Local</span>)</th>' + "\n" +
-                    '<th class="level">Level</th>' + "\n" +
-                    '<th class="core">Core</th>' + "\n" +
-                    '<th class="logger">Logger</th>' + "\n" +
-                    '<th class="message">Message</th>' + "\n" +
-                  '</tr>' + "\n" +
-                '</thead>' + "\n" +
-                '<tfoot>' + "\n" +
-                  '<tr>' + "\n" +
-                    '<td colspan="4">No Events available</td>' + "\n" +
-                  '</tr>' + "\n" +
-                '</thead>' + "\n" +
-              '</table>' + "\n" +
-              '<div id="footer" class="clearfix">' + "\n" +
-                '<div id="state" class="loader">&nbsp;</div>' + "\n" +
-                '<div id="date-format"><a>Show dates in UTC</a></div>' + "\n" +
-              '</div>' + "\n" +
-            '</div>'
-          );
-
-        var table = $( 'table', frame_element );
-
-        table
-          .die( 'update' )
-          .live
-          (
-            'update',
-            function( event )
-            {
-              var table = $( this );
-              var tbody = $( 'tbody', table );
-
-              0 !== tbody.size()
-                ? table.addClass( 'has-data' )
-                : table.removeClass( 'has-data' );
-
-              return false;
-            }
-          );
-
-        load_logging_viewer();
-
-        $( '.has-trace a', table )
-          .die( 'click' )
-          .live
-          (
-            'click',
-            function( event )
-            {
-              $( this ).closest( 'tr' )
-                .toggleClass( 'open' )
-                .next().toggle();
-
-              return false;
-            }
-          );
-
-        var date_format = $( '#date-format a', frame_element );
-
-        date_format
-          .off( 'click' )
-          .on
-          (
-            'click',
-            function( event )
-            {
-              var self = $( this );
-
-              if( !self.hasClass( 'on' ) )
-              {
-                self.addClass( 'on' );
-                $( 'table th.time span', frame_element ).text( 'UTC' );
-                format_time_options.timeZone = 'UTC';
-                $.cookie( cookie_logging_timezone, 'UTC' );
-              }
-              else
-              {
-                self.removeClass( 'on' );
-                $( 'table th.time span', frame_element ).text( 'Local' );
-                delete format_time_options.timeZone;
-                $.cookie( cookie_logging_timezone, null );
-              }
-
-              $( 'time', frame_element )
-                .each
-                (
-                  function( index, element )
-                  {
-                    var self = $( element );
-                    self.text( format_time_content( new Date( self.attr( 'datetime' ) ) ) );
-                  }
-                )
-
-              return false;
-            }
-          );
-
-        if( 'UTC' === $.cookie( cookie_logging_timezone ) )
-        {
-          date_format
-            .trigger( 'click' );
-        }
-      }
-    );
-  }
-);
-
-// #/~logging/level
-sammy.get
-(
-  /^#\/(~logging)\/level$/,
-  function( context )
-  {
-    var content_element = $( '#content' );
-
-    $.get
-    (
-      'tpl/logging.html',
-      function( template )
-      {
-        content_element
-          .html( template );
-
-        $( '#menu a[href="' + context.path + '"]' )
-          .parent().addClass( 'active' );
-                      
-        $.ajax
-        (
-          {
-            url : loglevel_path + '?wt=json',
-            dataType : 'json',
-            context : $( '#frame', content_element ),
-            beforeSend : function( xhr, settings )
-            {
-              this
-                .html( '<div class="loader">Loading ...</div>' );
-            },
-            success : logging_handler
-          }
-        );
-      }
-    );
-  }
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/ping.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/ping.js b/solr/webapp/web/js/scripts/ping.js
deleted file mode 100644
index 537724a..0000000
--- a/solr/webapp/web/js/scripts/ping.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- 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.
-*/
-
-$( '.ping a', app.core_menu )
-  .live
-  (
-    'click',
-    function( event )
-    {
-      $.ajax
-      (
-        {
-          url : $( this ).attr( 'rel' ) + '?wt=json&ts=' + (new Date).getTime(),
-          dataType : 'json',
-          context: this,
-          beforeSend : function( arr, form, options )
-          {
-            loader.show( this );
-          },
-          success : function( response, text_status, xhr )
-          {
-            $( this )
-              .removeAttr( 'title' );
-                        
-            $( this ).parents( 'li' )
-              .removeClass( 'error' );
-                            
-            var qtime_element = $( '.qtime', this );
-                        
-            if( 0 === qtime_element.size() )
-            {
-              qtime_element = $( '<small class="qtime"> (<span></span>)</small>' );
-                            
-              $( this )
-                .append( qtime_element );
-            }
-                        
-            $( 'span', qtime_element )
-              .html( response.responseHeader.QTime + 'ms' );
-          },
-          error : function( xhr, text_status, error_thrown )
-          {
-            $( this )
-              .attr( 'title', '/admin/ping is not configured (' + xhr.status + ': ' + error_thrown + ')' );
-                        
-            $( this ).parents( 'li' )
-              .addClass( 'error' );
-          },
-          complete : function( xhr, text_status )
-          {
-            loader.hide( this );
-          }
-        }
-      );
-            
-      return false;
-    }
-  );
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/plugins.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/plugins.js b/solr/webapp/web/js/scripts/plugins.js
deleted file mode 100644
index f68682f..0000000
--- a/solr/webapp/web/js/scripts/plugins.js
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
- 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.
-*/
-
-var core_basepath = null;
-var content_element = null;
-var selected_type = null;
-var context_path = null;
-var active_context = null;
-var changes = null;
-var reference_xml = null;
-
-var compute_plugin_data = function( response, changeset )
-{
-  var types = [];
-  var sort_table = {};
-  var plugin_data = {};
-
-  var types_obj = {};
-  var plugin_key = null;
-
-  changes = { count : {}, list : {} }
-
-  for( var i = 0; i < response['solr-mbeans'].length; i++ )
-  {
-    if( !( i % 2 ) )
-    {
-      plugin_key = response['solr-mbeans'][i];
-    }
-    else
-    {
-      plugin_data[plugin_key] = response['solr-mbeans'][i];
-    }
-  }
-
-  for( var key in plugin_data )
-  {
-    sort_table[key] = {
-      url : [],
-      component : [],
-      handler : []
-    };
-    for( var part_key in plugin_data[key] )
-    {
-      if( plugin_data[key][part_key]['_changed_'] )
-      {
-        delete plugin_data[key][part_key]['_changed_'];
-
-        changes.count[key] = changes.count[key] || 0;
-        changes.count[key]++;
-
-        changes.list[key] = changes.list[key] || {};
-        changes.list[key][part_key] = true;
-      }
-
-      if( 0 < part_key.indexOf( '.' ) )
-      {
-        types_obj[key] = true;
-        sort_table[key]['handler'].push( part_key );
-      }
-      else if( 0 === part_key.indexOf( '/' ) )
-      {
-        types_obj[key] = true;
-        sort_table[key]['url'].push( part_key );
-      }
-      else
-      {
-        types_obj[key] = true;
-        sort_table[key]['component'].push( part_key );
-      }
-    }
-  }
-
-  for( var type in types_obj )
-  {
-    types.push( type );
-  }
-  types.sort();
-
-  return {
-    'plugin_data' : plugin_data,
-    'sort_table' : sort_table,
-    'types' : types
-  };
-};
-
-var render_plugin_data = function( plugin_data, plugin_sort, types )
-{
-  var frame_element = $( '#frame', content_element );
-  var navigation_element = $( '#navigation ul', content_element );
-
-  var navigation_content = [];
-  for( var i = 0; i < types.length; i++ )
-  {
-    var type_url = active_context.params.splat[0] + '/' + active_context.params.splat[1] + '/' + types[i].toLowerCase();
-
-    var navigation_markup = '<li class="' + types[i].toLowerCase().esc() + '">' +
-                            '<a href="#/' + type_url + '" rel="' + types[i].esc() + '">' + types[i].esc();
-
-    if( changes.count[types[i]] )
-    {
-      navigation_markup += ' <span>' + changes.count[types[i]].esc() + '</span>';
-    }
-
-    navigation_markup += '</a>' +
-                         '</li>';
-
-    navigation_content.push( navigation_markup );
-  }
-
-  navigation_content.push( '<li class="PLUGINCHANGES"><a href="#">Watch Changes</a></li>' );
-  navigation_content.push( '<li class="RELOAD"><a href="#" onClick="window.location.reload()">Refresh Values</a></li>' );
-
-  navigation_element
-    .html( navigation_content.join( "\n" ) );
-    
-  $( '.PLUGINCHANGES a', navigation_element )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function( event )
-      { 
-        load_reference_xml();
-        
-        changes = { count : {}, list : {} }
-        $( 'a > span', navigation_element ).remove();
-        $( '.entry.changed', frame_element ).removeClass( 'changed' );
-
-        $.blockUI
-        (
-          {
-            message: $('#recording'),
-            css: { width: '450px' }
-          }
-        );
-
-        return false;
-      }
-    ); 
-
-  $( '#recording button' )
-    .die( 'click' )
-    .live
-    (
-      'click',
-      function( event )
-      { 
-        $.ajax
-        (
-          {
-            type: 'POST',
-            url: core_basepath + '/admin/mbeans',
-            dataType : 'json',
-            data: { 
-              'stats': 'true',
-              'wt': 'json', 
-              'diff': 'true',
-              'all': 'true',
-              'stream.body': reference_xml 
-            },
-            success : function( response, text_status, xhr )
-            {
-              load_reference_xml();
-
-              app.plugin_data = compute_plugin_data( response );
-              render_plugin_data( app.plugin_data.plugin_data, app.plugin_data.sort_table, app.plugin_data.types );
-            }
-          }
-        );
-        $.unblockUI();
-        return false;
-      }
-    ); 
-              
-  $( 'a[href="' + context_path + '"]', navigation_element )
-    .parent().addClass( 'current' );
-            
-  var content = '<ul>';
-  for( var sort_key in plugin_sort[selected_type] )
-  {
-    plugin_sort[selected_type][sort_key].sort();
-    var plugin_type_length = plugin_sort[selected_type][sort_key].length;
-                
-    for( var i = 0; i < plugin_type_length; i++ )
-    {
-      var bean = plugin_sort[selected_type][sort_key][i];
-      var classes = [ 'entry' ];
-
-      if( changes.list[selected_type] && changes.list[selected_type][bean] )
-      {
-        classes.push( 'changed' );
-      }
-
-      content += '<li class="' + classes.join( ' ' ) + '">' + "\n";
-      content += '<a href="' + context_path + '?entry=' + bean.esc() + '" data-bean="' + bean.esc() + '">';
-      content += '<span>' + bean.esc() + '</span>';
-      content += '</a>' + "\n";
-      content += '<ul class="detail">' + "\n";
-                    
-      var details = plugin_data[selected_type][ plugin_sort[selected_type][sort_key][i] ];
-      for( var detail_key in details )
-      {
-        if( 'stats' !== detail_key )
-        {
-          var detail_value = details[detail_key];
-
-          if( 'description' === detail_key )
-          {
-            // Link component list to their MBeans page
-            if(detail_value.match(/^Search using components: /)) {
-              var idx = detail_value.indexOf(':');
-              var url = '#/'+active_context.params.splat[0]+'/plugins/other?entry=';
-              var tmp = 'Search using components:<ul>';
-              $.each(detail_value.substr(idx+1).split(","), function(index, value) { 
-                value = $.trim(value);
-                tmp += '<li><a href="'+url+value+'" class="linker">'+value+"</a></li>";
-              });
-              tmp += "</ul>";
-              detail_value = tmp;
-            }
-          }
-
-          content += '<li><dl class="clearfix">' + "\n";
-          content += '<dt>' + detail_key.esc() + ':</dt>' + "\n";
-          if($.isArray(detail_value)) {
-            $.each(detail_value, function(index, value) { 
-              content += '<dd>' + value.esc() + '</dd>' + "\n";
-            });
-          }
-          else {
-            content += '<dd>' + new String( detail_value ).esc() + '</dd>' + "\n";
-          }
-          content += '</dl></li>' + "\n";
-        }
-        else if( 'stats' === detail_key && details[detail_key] )
-        {
-          content += '<li class="stats clearfix">' + "\n";
-          content += '<span>' + detail_key.esc() + ':</span>' + "\n";
-          content += '<ul>' + "\n";
-
-          for( var stats_key in details[detail_key] )
-          {
-            var stats_value = new String( details[detail_key][stats_key] );
-            stats_value = stats_value.replace( /([\(@])/g, '$1&#8203;' );
-
-            content += '<li><dl class="clearfix">' + "\n";
-            content += '<dt>' + stats_key.esc() + ':</dt>' + "\n";
-            content += '<dd>' + stats_value.esc() + '</dd>' + "\n";
-            content += '</dl></li>' + "\n";
-          }
-
-          content += '</ul></li>' + "\n";
-        }
-      }
-                    
-      content += '</ul>' + "\n";
-    }
-  }
-  content += '</ul>' + "\n";
-
-  frame_element
-    .html( content );
-
-  
-  var path = active_context.path.split( '?entry=' );
-  var entries = ( path[1] || '' ).split( ',' );
-  
-  var entry_count = entries.length;
-  for( var i = 0; i < entry_count; i++ )
-  {
-    $( 'a[data-bean="' + entries[i].esc() + '"]', frame_element )
-      .parent().addClass( 'expanded' );
-  }
-
-  $( 'a', frame_element )
-    .off( 'click' )
-    .on
-    (
-      'click',
-      function( event )
-      { 
-        var self = $( this );
-        var bean = self.data( 'bean' );
-
-        var split = '?entry=';
-        var path = active_context.path.split( split );
-        var entry = ( path[1] || '' );
-
-        var regex = new RegExp( bean.replace( /\//g, '\\/' ) + '(,|$)' );
-        var match = regex.test( entry );
-
-        var url = path[0] + split;
-
-        url += match
-             ? entry.replace( regex, '' )
-             : entry + ',' + bean;
-
-        url = url.replace( /=,/, '=' );
-        url = url.replace( /,$/, '' );
-        url = url.replace( /\?entry=$/, '' );
-
-        active_context.redirect( url );
-        return false;
-      }
-    );
-  
-  // Try to make links for anything with http (but leave the rest alone)
-  $( '.detail dd' ).each(function(index) {
-    var txt = $(this).html();
-    if(txt.indexOf("http") >= 0) {
-      $(this).linker({
-         className : 'linker'
-      });
-    }
-  });
-  
-  // Add invisible whitespace after each slash
-  $( '.detail a.linker' ).each(function(index) {
-    $(this).html( $(this).html().replace( /\//g, '/&#8203;' ) );
-  });
-  
-            
-  $( '.entry', frame_element )
-    .each
-    (
-      function( i, entry )
-      {
-        $( '.detail > li', entry ).not( '.stats' ).filter( ':even' )
-          .addClass( 'odd' );
-
-        $( '.stats li:odd', entry )
-          .addClass( 'odd' );
-      }
-    );
-};
-
-var load_reference_xml = function()
-{
-  $.ajax
-  (
-    {
-      type: 'GET',
-      url: core_basepath + '/admin/mbeans?stats=true&wt=xml',
-      dataType : 'text',
-      success: function( data )
-      {
-        reference_xml = data;
-      }
-    }
-  );
-}
-
-sammy.bind
-(
-  'plugins_load',
-  function( event, params )
-  {
-    var callback = function()
-    {
-      params.callback( app.plugin_data.plugin_data, app.plugin_data.sort_table, app.plugin_data.types );
-    }
-        
-    if( app.plugin_data )
-    {
-      callback( app.plugin_data );
-      return true;
-    }
-
-    $.ajax
-    (
-      {
-        url : core_basepath + '/admin/mbeans?stats=true&wt=json',
-        dataType : 'json',
-        beforeSend : function( xhr, settings )
-        {
-        },
-        success : function( response, text_status, xhr )
-        {
-          app.plugin_data = compute_plugin_data( response );
-
-          $.get
-          (
-            'tpl/plugins.html',
-            function( template )
-            {
-              $( '#content' )
-                .html( template );
-                            
-              callback( app.plugin_data );
-            }
-          );
-        },
-        error : function( xhr, text_status, error_thrown)
-        {
-        },
-        complete : function( xhr, text_status )
-        {
-        }
-      }
-    );
-  }
-);
-
-// #/:core/plugins/$type
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(plugins)\\/(\\w+)$' ),
-  function( context )
-  {
-    core_basepath = this.active_core.attr( 'data-basepath' );
-    content_element = $( '#content' );
-    selected_type = context.params.splat[2].toUpperCase();
-    context_path = context.path.split( '?' ).shift();
-    active_context = context;
-    
-    sammy.trigger
-    (
-      'plugins_load',
-      {
-        active_core : this.active_core,
-        callback : render_plugin_data
-      }
-    );                
-  }
-);
-
-// #/:core/plugins
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(plugins)$' ),
-  function( context )
-  {
-    core_basepath = this.active_core.attr( 'data-basepath' );
-    delete app.plugin_data;
-
-    sammy.trigger
-    (
-      'plugins_load',
-      {
-        active_core : this.active_core,
-        callback :  function( plugin_data, plugin_sort, types )
-        {
-          context.redirect( context.path + '/' + types[0].toLowerCase() );
-        }
-      }
-    );
-  }
-);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/query.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/query.js b/solr/webapp/web/js/scripts/query.js
deleted file mode 100644
index 417fef9..0000000
--- a/solr/webapp/web/js/scripts/query.js
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- 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.
-*/
-
-// #/:core/query
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(query)$' ),
-  function( context )
-  {
-    var core_basepath = this.active_core.attr( 'data-basepath' );
-    var content_element = $( '#content' );
-        
-    $.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', query_element );
-        var result_element = $( '#result', query_element );
-        var response_element = $( '#response', result_element );
-
-        url_element
-          .die( 'change' )
-          .live
-          (
-            'change',
-            function( event )
-            {
-              var wt = $( '[name="wt"]', query_form ).val();
-
-              var content_generator = {
-
-                _default : function( xhr )
-                {
-                  return xhr.responseText.esc();
-                },
-
-                json : function( xhr )
-                {
-                  return app.format_json( xhr.responseText );
-                }
-
-              };
-
-              $.ajax
-              (
-                {
-                  url : this.href,
-                  dataType : wt,
-                  context : response_element,
-                  beforeSend : function( xhr, settings )
-                  {
-                    this
-                     .html( '<div class="loader">Loading ...</div>' );
-                  },
-                  complete : function( xhr, text_status )
-                  {
-                    var code = $(
-                      '<pre class="syntax language-' + wt + '"><code>' +
-                      ( content_generator[wt] || content_generator['_default'] )( xhr ) +
-                      '</code></pre>'
-                    );
-                    this.html( code );
-
-                    if( 'success' === text_status )
-                    {
-                      hljs.highlightBlock( code.get(0) );
-                    }
-                  }
-                }
-              );
-            }
-          )
-
-        $( '.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' );
-            }
-          );
-
-        $( '.multiple a', query_form )
-          .die( 'click' )
-          .live
-          (
-            'click',
-            function( event )
-            {
-              var self = $( this );
-              var row = self.closest( '.row' );
-              var container = self.closest( '.multiple' );
-              
-              var add = parseInt( self.data( 'action' ), 10 );
-              if( add )
-              {
-                var new_row = row.clone();
-                new_row.find( 'input' ).val( '' );
-                row.after( new_row );
-                row.next().find( 'input' ).focus();
-              }
-              else if( 1 === $( '.row', container ).size() )
-              {
-                row.find( 'input' ).val( '' ).focus();
-              }
-              else
-              {
-                row.remove();
-                container.find( 'input:last' ).focus();
-              }
-
-              return false;
-            }
-          )
-
-        query_form
-          .die( 'submit' )
-          .live
-          (
-            'submit',
-            function( event )
-            {
-              var form_values = [];
- 
-              var add_to_form_values = function add_to_form_values( fields )
-              {
-                 for( var i in fields )
-                 {
-                  if( !fields[i].value || 0 === fields[i].value.length )
-                  {
-                    continue;
-                  }
- 
-                  form_values.push( fields[i] );
-                 }
-              };
- 
-              var fieldsets = $( '> fieldset', query_form );
- 
-              var fields = fieldsets.first().formToArray( true );
-              add_to_form_values( fields );
-
-              fieldsets.not( '.common' )
-                .each
-                (
-                  function( i, set )
-                  {
-                    if( $( 'legend input', set ).is( ':checked' ) )
-                    {
-                      var fields = $( set ).formToArray( true );
-                      add_to_form_values( fields );
-                    }
-                  }
-                );
-
-              var handler_path = $( '#qt', query_form ).val();
-              if( '/' !== handler_path[0] )
-              {
-                form_values.push( { name : 'qt', value : handler_path.esc() } );
-                handler_path = '/select';
-              }
-
-              var query_url = window.location.protocol + '//' + window.location.host
-                            + core_basepath + handler_path + '?' + $.param( form_values );
-
-              var custom_parameters = $( '#custom_parameters', query_form ).val();
-              if( custom_parameters && 0 !== custom_parameters.length )
-              {
-                query_url += '&' + custom_parameters.replace( /^&/, '' ); 
-              }
-
-              url_element
-                .attr( 'href', query_url )
-                .text( query_url )
-                .trigger( 'change' );
-                            
-              result_element
-                .show();
-                            
-              return false;
-            }
-          );
-
-        var fields = 0;
-        for( var key in context.params )
-        {
-          if( 'string' === typeof context.params[key] )
-          {
-            fields++;
-            $( '[name="' + key + '"]', query_form )
-              .val( context.params[key] );
-          }
-        }
-
-        if( 0 !== fields )
-        {
-          query_form
-            .trigger( 'submit' );
-        }
-      }
-    );
-  }
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/replication.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/replication.js b/solr/webapp/web/js/scripts/replication.js
deleted file mode 100644
index f407f86..0000000
--- a/solr/webapp/web/js/scripts/replication.js
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- 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.
-*/
-
-var timer_element = null;
-var timer_timeout = null;
-
-var core_basepath = null;
-var navigation_element = null;
-var replication_element = null;
-
-var init_timer = function( next_tick )
-{
-  if( timer_timeout )
-  {
-    window.clearTimeout( timer_timeout );
-  }
-  update_timer( next_tick );
-}
-
-var update_timer = function( next_tick )
-{
-  if( 0 === next_tick )
-  {
-    replication_fetch_status();
-    return false;
-  }
-
-  $( 'p .tick', timer_element )
-    .text( app.convert_seconds_to_readable_time( next_tick ) );
-
-  timer_timeout = window.setTimeout
-  (
-    'update_timer( ' + --next_tick + ' )',
-    1000
-  );
-}
-
-var clear_timer = function()
-{
-  if( timer_timeout )
-  {
-    window.clearTimeout( timer_timeout );
-    timer_element.hide();
-  }
-}
-
-var replication_fetch_status = function()
-{
-  $.ajax
-  (
-    {
-      url : core_basepath + '/replication?command=details&wt=json',
-      dataType : 'json',
-      beforeSend : function( xhr, settings )
-      {
-        $( '.refresh-status span', navigation_element )
-          .addClass( 'loader' );
-
-        clear_timer();
-      },
-      success : function( response, text_status, xhr )
-      {
-        $( '.refresh-status span', 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( app.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 = [];
-          var iterations_obj = {};
-
-          for( var i in data.slave.indexReplicatedAtList )
-          {
-            var date = data.slave.indexReplicatedAtList[i];
-            if( !iterations_obj[date] )
-            {
-              iterations_obj[date] = true;
-              iterations_data.push( date );
-            }
-          }
-
-          for( var i in data.slave.replicationFailedAtList )
-          {
-            var date = data.slave.replicationFailedAtList[i];
-            if( !iterations_obj[date] )
-            {
-              iterations_obj[date] = true;
-              iterations_data.push( date );
-            }
-          }
-
-          iterations_data.sort().reverse();
-
-          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' : '.masterSearch' ), details_element );
-        var master_data = is_slave ? data.slave.masterDetails : data;
-
-        // the currently searchable commit regardless of type
-        $( '.version div', current_type_element )
-          .html( data.indexVersion );
-        $( '.generation div', current_type_element )
-          .html( data.generation );
-        $( '.size div', current_type_element )
-          .html( data.indexSize );
-
-        // what's replicable on the master
-        var master_element = $( '.master', details_element );
-        $( '.version div', master_element )
-          .html( master_data.master.replicableVersion || '-' );
-        $( '.generation div', master_element )
-          .html( master_data.master.replicableGeneration || '-' );
-        $( '.size div', master_element )
-          .html( "-" );
-                
-        if( is_slave )
-        {
-          // what's searchable on the master
-          var master_searchable = $( '.masterSearch', details_element );
-          $( '.version div', master_searchable )
-            .html( master_data.indexVersion );
-          $( '.generation div', master_searchable )
-            .html( master_data.generation );
-          $( '.size div', master_searchable )
-            .html( master_data.indexSize );
- 
-          // warnings if slave version|gen doesn't match what's replicable
-          if( data.indexVersion !== master_data.master.replicableVersion )
-          {
-            $( '.version', details_element )
-              .addClass( 'diff' );
-          }
-          else
-          {
-            $( '.version', details_element )
-              .removeClass( 'diff' );
-          }
-                    
-          if( data.generation !== master_data.master.replicableGeneration )
-          {
-            $( '.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 = '&nbsp;';
-          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();
-                
-          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();
-
-
-            if( 'false' === data.slave.isPollingDisabled && data.slave.pollInterval )
-            {
-              timer_element = $( '.timer', navigation_element );
-              approx_element = $( '.approx', timer_element );
-
-              var next_tick = app.convert_duration_to_seconds( data.slave.pollInterval );
-              approx_element.show();
-
-              if( data.slave.nextExecutionAt )
-              {
-                var nextExecutionAt = new SolrDate( data.slave.nextExecutionAt );
-                var currentDate = new SolrDate( data.slave.currentDate );
-
-                if( nextExecutionAt.getTime() > currentDate.getTime() )
-                {
-                  next_tick = ( nextExecutionAt.getTime() - currentDate.getTime() ) / 1000;
-                  approx_element.hide();
-
-                  $( 'small', timer_element )
-                    .text( data.slave.nextExecutionAt )
-                    .show();
-                }
-              }
-
-              init_timer( next_tick );
-
-              timer_element
-                .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' );
-      },
-      error : function( xhr, text_status, error_thrown )
-      {
-        $( '#content' )
-          .html( 'sorry, no replication-handler defined!' );
-      },
-      complete : function( xhr, text_status )
-      {
-      }
-    }
-  );
-}
-
-// #/:core/replication
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(replication)$' ),
-  function( context )
-  {
-    core_basepath = this.active_core.attr( 'data-basepath' );
-    var content_element = $( '#content' );
-        
-    $.get
-    (
-      'tpl/replication.html',
-      function( template )
-      {
-        content_element
-          .html( template );
-                
-        replication_element = $( '#replication', content_element );
-        navigation_element = $( '#navigation', replication_element );
-
-        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;
-            }
-          );
-      }
-    );
-  }
-);


[16/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/old.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/old.html b/solr/webapp/web/old.html
deleted file mode 100644
index d688a0a..0000000
--- a/solr/webapp/web/old.html
+++ /dev/null
@@ -1,169 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-
-<!--
-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.
--->
-
-<head>
-    
-  <title>Solr Admin</title>
-    
-  <link rel="icon" type="image/x-icon" href="img/favicon.ico?_=${version}">
-  <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico?_=${version}">
-
-  <link rel="stylesheet" type="text/css" href="css/styles/common.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/analysis.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/cloud.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/cores.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/dashboard.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/dataimport.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/files.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/index.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/java-properties.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/logging.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/menu.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/plugins.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/documents.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/query.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/replication.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/schema-browser.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/threads.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/segments.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/chosen.css?_=${version}">
-
-  <meta http-equiv="x-ua-compatible" content="IE=9">
-    
-  <script type="text/javascript">
-    
-  var app_config = {};
-    
-  app_config.solr_path = '${contextPath}';
-  app_config.core_admin_path = '${adminPath}';
-    
-  </script>
-    
-</head>
-<body>
-    
-  <div id="wrapper">
-    
-    <div id="header">
-            
-      <a href="./" id="solr"><span>Apache SOLR</span></a>
-
-      <p id="environment">&nbsp;</p>
-
-    </div>
-
-    <div id="main" class="clearfix">
-    
-      <div id="init-failures">
-
-          <h2>SolrCore Initialization Failures</h2>
-          <ul></ul>
-          <p>Please check your logs for more information</p>
-                
-      </div>
-
-      <div class="old-ui-warning">
-        THIS USER INTERFACE IS DEPRECATED. Please use the current UI <a class="ul" href="/solr/">here</a>
-        <a target="_blank" href="http://wiki.apache.org/solr/AngularUI">&nbsp;<span class="help"></span></a>
-      </div>
-
-      <div id="content-wrapper">
-        <div id="content">
-                  
-          &nbsp;
-                  
-        </div>
-      </div>
-            
-      <div id="menu-wrapper">
-        <div>
-                  
-          <ul id="menu">
-
-            <li id="index" class="global"><p><a href="#/">Dashboard</a></p></li>
-
-            <li id="logging" class="global"><p><a href="#/~logging">Logging</a></p>
-              <ul>
-                <li class="level"><a href="#/~logging/level">Level</a></li>
-              </ul>
-            </li>
-
-            <li id="cloud" class="global optional"><p><a href="#/~cloud">Cloud</a></p>
-              <ul>
-                <li class="tree"><a href="#/~cloud?view=tree">Tree</a></li>
-                <li class="graph"><a href="#/~cloud">Graph</a></li>
-                <li class="rgraph"><a href="#/~cloud?view=rgraph">Graph (Radial)</a></li>
-                <li class="dump"><a href="#/~cloud">Dump</a></li>
-              </ul>
-            </li>
-
-            <li id="cores" class="global"><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 id="core-selector">
-            <div id="has-cores">
-              <select data-placeholder="Core Selector"></select>
-            </div>
-            <p id="has-no-cores"><a href="#/~cores">
-              No cores available
-              <span>Go and create one</span>
-            </a></p>
-          </div>
-          <div id="core-menu">
-            <ul></ul>
-          </div>
-                  
-        </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="https://wiki.apache.org/solr/IRCChannels"><span>IRC Channel</span></a></li>
-          <li class="mailinglist"><a href="http://lucene.apache.org/solr/resources.html#community"><span>Community forum</span></a></li>
-          <li class="wiki-query-syntax"><a href="https://cwiki.apache.org/confluence/display/solr/Query+Syntax+and+Parsing"><span>Solr Query Syntax</span></a></li>
-                    
-        </ul>
-                
-      </div>
-            
-    </div>
-    
-  </div>
-
-  <div id="connection_status">
-
-    <span>Connection lost &hellip;</span>
-
-  </div>
-  
-  <script type="text/javascript"> var require = { urlArgs: '_=${version}' }; </script>
-  <script src="js/require.js?_=${version}" data-main="js/main"></script>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/analysis.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/analysis.html b/solr/webapp/web/tpl/analysis.html
deleted file mode 100644
index 76f5699..0000000
--- a/solr/webapp/web/tpl/analysis.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!--
-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.
--->
-<div id="analysis">
-
-  <div class="block analysis-error" id="analysis-handler-missing">
-
-    <div class="head">This Functionality requires the <code>/analysis/field</code> Handler to be registered and active!</div>
-
-  </div>
-
-  <div class="block analysis-error" id="analysis-error">
-
-    <div class="body"></div>
-
-  </div>
-
-  <div id="analysis-holder">
-
-    <div id="field-analysis">
-              
-      <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-holder clearfix">
-            <div class="settings clearfix">
-
-              <label for="type_or_name">Analyse Fieldname / FieldType:</label>
-              <select id="type_or_name"></select>
-              <a id="tor_schema" href="#"><span>Schema Browser</span>&nbsp;</a>
-
-              <div class="buttons clearfix">
-
-                <button type="submit"><span>Analyse Values</span></button>
-
-                <div class="verbose_output active">
-                  <a>Verbose Output</a>
-                </div>
-
-              </div>
-
-            </div>
-          </li>
-                    
-        </ul>
-                
-      </form>
-            
-    </div>
-        
-    <div id="analysis-result" class="clearfix verbose_output"></div>
-
-  </div>
-
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/cloud.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/cloud.html b/solr/webapp/web/tpl/cloud.html
deleted file mode 100644
index 3ce78a3..0000000
--- a/solr/webapp/web/tpl/cloud.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!--
-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.
--->
-<div id="cloud" class="clearfix">
-
-  <div id="frame">
-
-    <div id="tree-content" class="content clearfix">
-
-      <div id="tree" class="tree">#tree</div>
-      <div id="file-content" class="clearfix">
-
-        <div id="prop">
-          <ul></ul>
-        </div>
-
-        <div id="data"></div>
-
-        <a class="close"><span>[x]</span></a>
-
-      </div>
-
-    </div>
-
-    <div id="graph-content" class="content clearfix">
-
-      <div id="canvas"></div>
-
-      <div id="legend">
-        <ul>
-          <li class="leader"><svg width="15" height="15"><g transform="translate(5,2)"><g transform="translate(0,5)"><circle r="4.5"></circle></g></g></svg> Leader</li>
-          <li class="active"><svg width="15" height="15"><g transform="translate(5,2)"><g transform="translate(0,5)"><circle r="4.5"></circle></g></g></svg> Active</li>
-          <li class="recovering"><svg width="15" height="15"><g transform="translate(5,2)"><g transform="translate(0,5)"><circle r="4.5"></circle></g></g></svg> Recovering</li>
-          <li class="down"><svg width="15" height="15"><g transform="translate(5,2)"><g transform="translate(0,5)"><circle r="4.5"></circle></g></g></svg> Down</li>
-          <li class="recovery_failed"><svg width="15" height="15"><g transform="translate(5,2)"><g transform="translate(0,5)"><circle r="4.5"></circle></g></g></svg> Recovery Failed</li>
-          <li class="gone"><svg width="15" height="15"><g transform="translate(5,2)"><g transform="translate(0,5)"><circle r="4.5"></circle></g></g></svg> Gone</li>
-        </ul>
-      </div>
-
-      <div style="width: 100%; text-align: center;">
-        <div id="cloudGraphPaging">
-         <button id="cloudGraphPagingPrev">&lt; Previous</button>
-         <input id="cloudGraphPagingStart" type="hidden" name="start" /> 
-         <span id="cloudGraphPagingStatus"></span>&nbsp;
-         Filter by:&nbsp;<select id="cloudGraphPagingFilterType">
-           <option value="status">Status</option>
-           <option value="name">Name</option>
-         </select>&nbsp;
-         <select id="cloudGraphPagingStatusFilter">
-           <option value=""> - Any - </option>
-           <option value="healthy">Healthy</option>
-           <option value="degraded">Degraded</option>
-           <option value="downed_shard">Downed Shard</option>
-           <option value="recovering">Replica in Recovery</option>
-         </select>         
-         <input id="cloudGraphPagingFilter" type="text" size="10" name="filter" />&nbsp;
-         Show <input id="cloudGraphPagingRows" type="text" size="2" name="rows" /> per page.
-         <button id="cloudGraphPagingNext">Next &gt;</button>
-        </div>
-      </div>
-
-    </div>
-
-  </div>
-
-  <div id="debug">
-    <ul class="clearfix">
-      <li class="clipboard"><a href="#" data-copied="Copied to Clipboard!">Copy to Clipboard (BUGGY!)</a></li>
-      <li class="close"><a href="#">Close</a></li>
-    </ul>
-    <pre class="debug"></pre>
-  </div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/cores.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/cores.html b/solr/webapp/web/tpl/cores.html
deleted file mode 100644
index 98a6a12..0000000
--- a/solr/webapp/web/tpl/cores.html
+++ /dev/null
@@ -1,226 +0,0 @@
-<!--
-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.
--->
-<div id="cores" class="clearfix empty">
-
-  <div id="ui-block">&nbsp;</div>
-
-  <div id="frame">
-
-    <div id="actions" class="actions clearfix">
-      
-      <button id="add" class="action"><span>Add Core</span></button>
-      <button id="unload" class="warn requires-core"><span>Unload</span></button>
-      <button id="rename" class="action requires-core"><span>Rename</span></button>
-      <button id="swap" class="action requires-core"><span>Swap</span></button>
-      <button id="reload" class="requires-core"><span>Reload</span></button>
-      <button id="optimize" class="requires-core"><span>Optimize</span></button>
-
-      <div class="action add" data-rel="add">
-
-        <form>
-
-          <input type="hidden" name="action" value="CREATE">
-
-          <p class="clearfix"><label for="add_name">name:</label>
-          <input type="text" name="name" id="add_name" value="new_core"></p>
-
-          <p class="clearfix"><label for="add_instanceDir">instanceDir:</label>
-          <input type="text" name="instanceDir" id="add_instanceDir" value="new_core"></p>
-
-          <p class="clearfix"><label for="add_dataDir">dataDir:</label>
-          <input type="text" name="dataDir" id="dataDir" value="data"></p>
-
-          <p class="clearfix"><label for="add_config">config:</label>
-          <input type="text" name="config" id="add_config" value="solrconfig.xml"></p>
-
-          <p class="clearfix"><label for="add_schema">schema:</label>
-          <input type="text" name="schema" id="add_schema" value="schema.xml"></p>
-
-          <div class="cloud">
-
-            <p class="clearfix"><label for="add_collection">collection:</label>
-            <input type="text" name="collection" id="add_collection"></p>
-
-            <p class="clearfix"><label for="add_shard">shard:</label>
-            <input type="text" name="shard" id="shard"></p>
-
-          </div>
-
-          <p class="clearfix note directory-note">
-
-            <span><code>instanceDir</code> and <code>dataDir</code> need to exist before you can create the core</span>
-
-          </p>
-
-          <p class="clearfix note error">
-
-            <span></span>
-
-          </p>
-
-          <p class="clearfix buttons">
-            <button type="submit" class="submit"><span>Add Core</span></button>
-            <button type="reset" class="reset"><span>Cancel</span></button>
-          </p>
-
-        </form>
-
-      </div>
-
-      <div class="action rename" data-rel="rename">
-
-        <form>
-
-          <input type="hidden" name="action" value="RENAME">
-          <input type="hidden" name="core" data-core="current">
-
-          <p class="clearfix"><label for="rename_other">New Name:</label>
-          <input type="text" name="other" data-core="current" id="rename_other"></p>
-
-          <p class="clearfix buttons">
-            <button type="submit" class="submit"><span>Rename Core</span></button>
-            <button type="reset" class="reset"><span>Cancel</span></button>
-          </p>
-
-        </form>
-
-      </div>
-
-      <div class="action swap" data-rel="swap">
-
-        <form>
-
-          <input type="hidden" name="action" value="SWAP">
-
-          <p class="clearfix"><label for="swap_core">this:</label>
-          <input type="text" id="swap_core" name="core" data-core="current" readonly="readonly"></p>
-
-          <p class="clearfix"><label for="swap_other">and:</label>
-          <select name="other" id="swap_other" name="other" class="other">
-          </select></p>
-
-          <p class="clearfix buttons">
-            <button type="submit" class="submit"><span>Swap Cores</span></button>
-            <button type="reset" class="reset"><span>Cancel</span></button>
-          </p>
-
-        </form>
-
-      </div>
-
-    </div>
-
-    <div id="data" class="requires-core">
-
-      <div class="block" id="core-data">
-
-          <h2><span>Core</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="deletedDocs"><dl class="clearfix">
-              <dt><span>deletedDocs:</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="directory"><dl class="clearfix">
-              <dt><span>directory:</span></dt>
-                <dd></dd>
-            </dl></li>
-          
-          </ul>
-        
-        </div>
-      </div>
-
-    </div>
-  
-  </div>
-
-  <div id="navigation" class="requires-core clearfix">
-  
-  </div>
-
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/dashboard.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/dashboard.html b/solr/webapp/web/tpl/dashboard.html
deleted file mode 100644
index 814b3c4..0000000
--- a/solr/webapp/web/tpl/dashboard.html
+++ /dev/null
@@ -1,201 +0,0 @@
-<!--
-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.
--->
-<div id="dashboard">
-
-  <div class="clearfix">
-
-    <div class="block fieldlist" 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">Last Modified:</dt>
-            <dd class="index_last-modified value timeago"></dd>
-
-          <dt class="index_num-doc">Num Docs:</dt>
-            <dd class="index_num-doc value"></dd>
-
-          <dt class="index_max-doc">Max Doc:</dt>
-            <dd class="index_max-doc value"></dd>
-
-          <dt class="index_heap-usage-bytes">Heap Memory Usage:</dt>
-            <dd class="index_heap-usage-bytes value"></dd>
-
-          <dt class="index_deleted-doc">Deleted Docs:</dt>
-            <dd class="index_deleted-doc value"></dd>
-
-          <dt class="index_version">Version:</dt>
-            <dd class="index_version value"></dd>
-
-          <dt class="index_segmentCount">Segment Count:</dt>
-            <dd class="index_segmentCount 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>
-                        
-        </dl>
-           
-      </div>
-    </div>
-
-    <div class="block fieldlist" id="instance">
-
-      <h2><span>Instance</span></h2>
-            
-      <div class="message-container">
-        <div class="message"></div>
-      </div>
-
-      <div class="content">
-                
-        <dl>
-                    
-          <dt class="dir_cwd"><abbr title="Current Working Directory">CWD</abbr>:</dt>
-            <dd class="dir_cwd value"></dd>
-
-          <dt class="dir_instance">Instance:</dt>
-            <dd class="dir_instance value"></dd>
-
-          <dt class="dir_data">Data:</dt>
-            <dd class="dir_data value"></dd>
-
-          <dt class="dir_index">Index:</dt>
-            <dd class="dir_index value"></dd>
-
-          <dt class="dir_impl">Impl:</dt>
-            <dd class="dir_impl value"></dd>
-                        
-        </dl>
-
-      </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 clearfix"id="details">
-
-        <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="masterSearch">
-
-              <th>Master (Searching)</th>
-              <td class="version"><div>x</div></td>
-              <td class="generation"><div>y</div></td>
-              <td class="size"><div>z</div></td>
-
-            </tr>
-
-            <tr class="master">
-
-              <th>Master (Replicable)</th>
-              <td class="version"><div>x</div></td>
-              <td class="generation"><div>y</div></td>
-              <td class="size"><div>z</div></td>
-
-            </tr>
-
-            <tr class="slave slaveOnly">
-
-              <th>Slave (Searching)</th>
-              <td class="version"><div>a</div></td>
-              <td class="generation"><div>c</div></td>
-              <td class="size"><div>c</div></td>
-
-            </tr>
-
-          </tbody>
-
-        </table>
-            
-      </div>
-    </div>
-  
-    <div class="block fieldlist" id="healthcheck">
-
-      <h2><span>Healthcheck</span></h2>
-
-      <div class="message-container">
-        <div class="message"></div>
-      </div>
-
-      <div class="content">
-        <dl>
-                    
-          <dt class="status">Status:</dt>
-          <dd class="status value ico">
-            <button class="healthcheck-status">Healthcheck Status</button>
-          </dd>
-        </dl>
-      </div>
-
-    </div>
-
-  </div>
-  <div class="clearfix">
-
-    <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>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/dataimport.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/dataimport.html b/solr/webapp/web/tpl/dataimport.html
deleted file mode 100644
index 3dc32b2..0000000
--- a/solr/webapp/web/tpl/dataimport.html
+++ /dev/null
@@ -1,183 +0,0 @@
-<!--
-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.
--->
-<div id="dataimport" class="clearfix">
-
-  <div id="frame">
-
-    <div id="error"></div>
-
-    <div id="current_state">
-
-      <p class="last_update">Last Update: <abbr>Unknown</abbr></p>
-      <div class="info">
-
-        <strong></strong>
-        <div class="details">
-          <div class="docs"></div>
-          <div class="dates"></div>
-        </div>
-
-        <button class="abort-import warn"><span data-aborting="Aborting Import">Abort Import</span></button>
-
-      </div>
-    
-    </div>
-
-    <div class="block hidden" id="raw_output">
-
-      <h2>
-        <a class="toggle"><span>Raw Status-Output</span></a>
-      </h2>
-        
-      <div class="message-container">
-          <div class="message"></div>
-      </div>
-
-      <div class="content">
-
-        <div id="raw_output_container"></div>
-
-      </div>
-    
-    </div>
-
-    <div class="block hidden" id="config">
-
-      <h2 class="clearfix">
-        <a class="toggle"><span>Configuration</span></a>
-        <a class="r reload_config" title="Reload Configuration">Reload</a>
-        <a class="r debug_mode">Debug-Mode</a>
-      </h2>
-        
-      <div class="message-container">
-          <div class="message"></div>
-      </div>
-
-      <div class="content">
-
-        <div id="dataimport_config">
-
-          <div class="formatted">
-
-            <div class="loader">Loading ...</div>
-          
-          </div>
-
-          <div class="editable">
-
-            <textarea></textarea>
-          
-          </div>
-
-        </div>
-
-      </div>
-    
-    </div>
-
-    <div class="block hidden" id="debug_response">
-
-      <h2>
-        <a class="toggle"><span>Raw Debug-Response</span></a>
-      </h2>
-        
-      <div class="message-container">
-          <div class="message"></div>
-      </div>
-
-      <div class="content">
-
-        <em>No Request executed</em>
-
-      </div>
-    
-    </div>
-  
-  </div>
-
-  <div id="form">
-
-    <div id="navigation">
-
-      <ul></ul>
-
-    </div>
-
-    <form action="#" method="get">
-
-      <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" checked="checked">
-        <a rel="help">Clean</a>
-      </label>
-
-      <label for="commit" class="checkbox">
-        <input type="checkbox" name="commit" id="commit" value="true" checked="checked">
-        <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="debug" class="checkbox">
-        <input type="checkbox" name="debug" id="debug" value="true">
-        <a rel="help">Debug</a>
-      </label>
-
-      <label for="entity">
-        <a rel="help">Entity</a>
-      </label>
-      <select id="entity"></select>
-
-      <label for="start">
-        <a rel="help">Start</a>,
-        <a rel="help">Rows</a>
-      </label>
-      <div class="clearfix">
-        <input type="text" id="start" placeholder="0">
-        <input type="text" id="rows" placeholder="10">
-      </div>
-
-      <label for="custom_parameters">
-        <a rel="help">Custom Parameters</a>
-      </label>
-      <input type="text" id="custom_parameters" value="" placeholder="key1=val1&amp;key2=val2">
-
-      <button class="execute" type="submit"><span data-debugmode="Execute with this Configuration →">Execute</span></button>
-      <button class="refresh-status"><span>Refresh Status</span></button>
-    
-    </form>
-
-    <p id="auto-refresh-status"><a>Auto-Refresh Status</a></p>
-  
-  </div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/documents.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/documents.html b/solr/webapp/web/tpl/documents.html
deleted file mode 100644
index d2a2e0e..0000000
--- a/solr/webapp/web/tpl/documents.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!--
-/*
-* 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.
-*/
--->
-
-<div id="documents" class="clearfix">
-  <div id="form">
-    <form action="#" method="post">
-      <label for="qt">
-        <a rel="help">Request-Handler (qt)</a>
-      </label>
-      <input type="text" id="qt" value="/update" title="Request handler in solrconfig.xml.">
-      <!-- TODO: Add support for uploading docs and a doc wizard -->
-      <label for="document-type">
-        <a rel="help">Document Type</a>
-      </label>
-
-      <div><select name="document-type" id="document-type" title="The type of the document field">
-        <!-- TODO: support the Builder -->
-        <option value="csv">CSV</option>
-        <option value="wizard">Document Builder</option>
-        <option value="upload">File Upload</option>
-        <option selected="true" value="json">JSON</option>
-        <option value="solr">Solr Command (raw XML or JSON)</option>
-        <option value="xml">XML</option>
-        <!-- TODO: If other, then, show a text box -->
-        <!--<option>Other</option>-->
-      </select></div>
-
-      <div id="document-container">
-        <div id="wizard">
-          <div id="wizard-fields">
-            <div><span class="description">Field</span>: <select id="wiz-field-select" name="wiz-field-select"></select>
-            </div>
-            <div><span id="wiz-field-data"><span class="description">Field Data</span>:</span> <textarea id="wizard-doc"
-                                                                                                         name="wizard-doc"
-                                                                                                         rows="10"
-                                                                                                         cols="40">Enter your field text here and then click "Add Field" to add the field to the document.</textarea></div>
-          </div>
-          <div id="wizard-add"><a id="add-field-href" href="#"><img border="0" src="./img/ico/plus-button.png"/>Add
-            Field</a></div>
-        </div>
-        <label for="document">
-          <a rel="help">Document(s)</a>
-        </label>
-        <textarea name="document" id="document" title="The Document" rows="10"
-                  cols="70">{"id":"change.me","title":"change.me"}</textarea>
-
-        <div id="file-upload">
-          <input type="file" id="the-file" name="the-file"/>
-        </div>
-      </div>
-
-      <div id="advanced">
-        <!-- TODO: only show for JSON/XML-->
-        <div id="attribs">
-          <div id="upload-only">
-            <label for="erh-params"><!-- TODO: cleaner way to do this? -->
-              <a rel="help">Extracting Req. Handler Params</a>
-            </label>
-            <input type="text" id="erh-params" value="&literal.id=change.me"
-                   title="Extracting Request Handler Parameters" size="50">
-          </div>
-          <div id="general-attribs">
-            <label for="commitWithin">
-              <a rel="help">Commit Within</a>
-            </label>
-            <input type="text" id="commitWithin" value="1000" title="Commit Within (ms)">
-            <label for="overwrite">
-              <a rel="help">Overwrite</a>
-            </label>
-            <input type="text" id="overwrite" value="true" title="Overwrite">
-          </div>
-        </div>
-      </div>
-
-      <button type="submit" id="submit">Submit Document</button>
-    </form>
-  </div>
-  <div id="result">
-    <div id="response">
-      <!--<iframe src="about:blank"></iframe>-->
-    </div>
-
-  </div>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/files.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/files.html b/solr/webapp/web/tpl/files.html
deleted file mode 100644
index 0a27f24..0000000
--- a/solr/webapp/web/tpl/files.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!--
-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.
--->
-<div id="files" class="clearfix">
-
-  <div id="frame">
-
-    <div id="tree-holder">
-
-      <div id="tree" class="tree">#tree</div>
-
-    </div>
-    <div id="file-content" class="clearfix">
-
-      <div class="top clearfix">
-
-        <a id="url" class="address-bar" href="#"></a>
-
-      </div>
-
-      <div class="view-file">
-
-        <div class="response">Loading …</div>
-
-      </div>
-
-    </div>
-
-  </div>
-
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/index.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/index.html b/solr/webapp/web/tpl/index.html
deleted file mode 100644
index 18fd71a..0000000
--- a/solr/webapp/web/tpl/index.html
+++ /dev/null
@@ -1,250 +0,0 @@
-<!--
-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.
--->
-<div id="index" class="clearfix">
-
-  <div class="clearfix">
-
-    <div class="index-left">
-
-      <div class="block" id="instance">
-
-          <h2><span>Instance</span></h2>
-
-          <div class="content">
-
-            <ul class="data">
-
-              <li class="start_time"><dl class="clearfix">
-                <dt><span>Start</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="dir dir_cwd"><dl class="clearfix">
-                <dt><span>CWD</span></dt>
-                <dd></dd>
-              </dl></li>
-
-              <li class="dir dir_instance"><dl class="clearfix">
-                <dt><span>Instance</span></dt>
-                <dd></dd>
-              </dl></li>
-
-              <li class="dir dir_data"><dl class="clearfix">
-                <dt><span>Data</span></dt>
-                <dd></dd>
-              </dl></li>
-
-              <li class="dir dir_index"><dl class="clearfix">
-                <dt><span>Index</span></dt>
-                <dd></dd>
-              </dl></li>
-            
-            </ul>
-
-          </div>
-
-      </div>
-
-      <div class="block" id="versions">
-
-          <h2><span>Versions</span></h2>
-
-          <div class="content">
-
-            <ul class="data">
-
-              <li class="solr solr_spec_version"><dl class="clearfix">
-                <dt><span>solr-spec</span></dt>
-                  <dd></dd>
-              </dl></li>
-              
-              <li class="solr_impl_version"><dl class="clearfix">
-                <dt class=""><span>solr-impl</span></dt>
-                  <dd></dd>
-              </dl></li>
-              
-              <li class="lucene lucene_spec_version"><dl class="clearfix">
-                <dt><span>lucene-spec</span></dt>
-                  <dd></dd>
-              </dl></li>
-
-              <li class="lucene_impl_version"><dl class="clearfix">            
-                <dt><span>lucene-impl</span></dt>
-                  <dd></dd>
-              </dl></li>
-            
-            </ul>
-
-          </div>
-
-      </div>
-
-    </div>
-      
-    <div class="index-right">
-
-      <div class="block" id="system">
-
-          <h2><span>System</span></h2>
-          <a class="reload"><span>reload</span></a>
-
-          <div class="content">
-
-            <div id="physical-memory-bar">
-
-              <p data-desc="physical-memory-bar">Physical Memory</p>
-              <div class="bar-holder">
-
-                <div class="bar-max bar">
-                  <span class="bar-max val"></span>
-
-                  <div class="bar-total bar">
-                    <span class="bar-total val"></span>
-
-                  </div>
-
-                </div>
-
-              </div>
-
-            </div>
-
-            <div id="swap-space-bar">
-
-              <p data-desc="swap-space-bar">Swap Space</p>
-              <div class="bar-holder">
-
-                <div class="bar-max bar">
-                  <span class="bar-max val"></span>
-
-                  <div class="bar-total bar">
-                    <span class="bar-total val"></span>
-
-                  </div>
-
-                </div>
-
-              </div>
-
-            </div>
-
-          <div id="file-descriptor-bar">
-
-              <p data-desc="file-descriptor-bar">File Descriptor Count</p>
-              <div class="bar-holder">
-
-                <div class="bar-max bar">
-                  <span class="bar-max val"></span>
-
-                  <div class="bar-total bar">
-                    <span class="bar-total val"></span>
-
-                  </div>
-
-                </div>
-
-              </div>
-
-            </div>
-
-            <p class="no-info">Sorry, no information available</p>
-
-          </div>
-
-      </div>
-
-    </div>
-
-  </div>
-
-  <div class="clearfix">
-
-    <div class="index-left">
-
-      <div class="block" id="jvm">
-
-          <h2><span>JVM</span></h2>
-
-          <div class="content clearfix">
-
-            <ul class="data">
-
-              <li class="jvm_version"><dl class="clearfix">            
-                <dt><span>Runtime</span></dt>
-                  <dd></dd>
-              </dl></li>
-
-              <li class="processors"><dl class="clearfix">            
-                <dt><span>Processors</span></dt>
-                  <dd></dd>
-              </dl></li>
-
-              <li class="command_line_args"><dl class="clearfix">
-                <dt><span>Args</span></dt>
-                <dd></dd>
-              </dl></li>
-            
-            </ul>
-
-          </div>
-
-      </div>
-
-    </div>
-    <div class="index-right">
-
-      <div class="block" id="jvm-memory">
-
-          <h2><span data-desc="jvm-memory-bar">JVM-Memory</span></h2>
-
-          <div class="content">
-
-            <div id="jvm-memory-bar">
-              <div class="bar-holder">
-
-                <div class="bar-max bar">
-                  <span class="bar-max val"></span>
-
-                  <div class="bar-total bar">
-                    <span class="bar-total val"></span>
-
-                    <div class="bar-used bar">
-                      <span class="bar-used val"></span>
-
-                    </div>
-
-                  </div>
-
-                </div>
-
-              </div>
-            </div>
-
-          </div>
-
-      </div>
-
-    </div>
-
-  </div>
-
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/logging.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/logging.html b/solr/webapp/web/tpl/logging.html
deleted file mode 100644
index 80671e5..0000000
--- a/solr/webapp/web/tpl/logging.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
-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.
--->
-<div id="logging" class="clearfix">
-
-  <div id="frame">
-
-  </div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/plugins.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/plugins.html b/solr/webapp/web/tpl/plugins.html
deleted file mode 100644
index 2d4a1a8..0000000
--- a/solr/webapp/web/tpl/plugins.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
-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.
--->
-<div id="plugins" class="clearfix">
-
-  <div id="frame">
-
-  </div>
-
-  <div id="navigation" class="clearfix">
-
-    <ul>
-    </ul>
-  
-  </div>
-
-  <div id="recording">
-    <div class="wrapper clearfix">
-
-      <p class="loader">Watching for Changes</p>
-      <button class="primary">Stop &amp; Show Changes</button>
-
-    </div>
-  </div> 
-
-</div>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/query.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/query.html b/solr/webapp/web/tpl/query.html
deleted file mode 100644
index bd0cdb0..0000000
--- a/solr/webapp/web/tpl/query.html
+++ /dev/null
@@ -1,361 +0,0 @@
-<!--
-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.
--->
-<div id="query" class="clearfix">
-
-  <div id="form">
-
-    <form action="#" method="get">
-
-      <label for="qt">
-        <a rel="help">Request-Handler (qt)</a>
-      </label>
-      <input type="text" id="qt" value="/select" title="Request handler in solrconfig.xml.">
-
-      <fieldset class="common">
-        <legend>common</legend>
-        <div class="fieldset">
-
-        <label for="q">
-          q
-        </label>
-        <textarea name="q" id="q" title="The query string.">*:*</textarea>
-
-        <label for="fq">
-          <a rel="help">fq</a>
-        </label>
-        <div class="multiple">
-          <div class="row clearfix">
-            <input type="text" id="fq" name="fq" title="Filter query.">
-            <div class="buttons">
-              <a class="rem" data-action="0"><span>[-]</span></a>
-              <a class="add" data-action="1"><span>[+]</span></a>
-            </div>
-          </div>
-        </div>
-
-        <label for="sort">
-          <a rel="help">sort</a>
-        </label>
-        <input type="text" id="sort" name="sort" title="Sort field or function with asc|desc.">
-
-        <label for="start">
-          <a rel="help">start</a>,
-          <a rel="help">rows</a>
-        </label>
-        <div class="clearfix">
-          <input type="text" name="start" id="start" placeholder="0" pattern="[0-9]+" title="Number of leading documents to skip. (Integer)">
-          <input type="text" name="rows" id="rows" placeholder="10" pattern="[0-9]+" title="Number of documents to return after 'start'. (Integer)">
-        </div>
-
-        <label for="fl">
-          <a rel="help">fl</a>
-        </label>
-        <input type="text" name="fl" id="fl" value="" title="Field list, comma separated.">
-
-        <label for="df">
-          <a rel="help">df</a>
-        </label>
-        <input type="text" name="df" id="df" value="" title="Default search field">
-
-        <label for="custom_parameters">
-          <a rel="help">Raw Query Parameters</a>
-        </label>
-        <input type="text" id="custom_parameters" value="" placeholder="key1=val1&amp;key2=val2">
-
-        <label for="wt">
-          <a rel="help">wt</a>
-        </label>
-        <select name="wt" id="wt" title="The writer type (response format).">
-          <option>json</option>
-          <option>xml</option>
-          <option>python</option>
-          <option>ruby</option>
-          <option>php</option>
-          <option>csv</option>
-        </select>
-
-        <label for="indent" class="checkbox">
-          <input type="checkbox" name="indent" id="indent" value="true" title="Indent results." checked="checked">
-          <a rel="help">indent</a>
-        </label>
-
-        <label for="debugQuery" class="checkbox">
-          <input type="checkbox" name="debugQuery" id="debugQuery" value="true" title="Show timing and diagnostics.">
-          <a rel="help">debugQuery</a>
-        </label>
-
-        </div>
-      </fieldset>
-
-      <fieldset class="dismax optional">
-        <legend>
-          <label for="dismax" class="checkbox">
-            <input type="checkbox" name="defType" id="dismax" value="dismax">
-            dismax
-          </label>
-        </legend>
-        <div class="fieldset">
-
-        <label for="q_alt">q.alt</label>
-        <input type="text" name="q.alt" id="q_alt" title="Alternate query when 'q' is absent.">
-
-        <label for="qf">qf</label>
-        <input type="text" name="qf" id="qf" title="Query fields with optional boosts.">
-
-        <label for="mm">mm</label>
-        <input type="text" name="mm" id="mm" title="Min-should-match expression.">
-
-        <label for="pf">pf</label>
-        <input type="text" name="pf" id="pf" title="Phrase boosted fields.">
-
-        <label for="ps">ps</label>
-        <input type="text" name="ps" id="ps" title="Phrase boost slop.">
-
-        <label for="qs">qs</label>
-        <input type="text" name="qs" id="qs" title="Query string phrase slop.">
-
-        <label for="tie">tie</label>
-        <input type="text" name="tie" id="tie" title="Score tie-breaker. Try 0.1.">
-
-        <label for="bq">bq</label>
-        <input type="text" name="bq" id="bq" title="Boost query.">
-
-        <label for="bf">bf</label>
-        <input type="text" name="bf" id="bf" title="Boost function (added).">
-      
-        </div>
-      </fieldset>
-
-      <fieldset class="edismax optional">
-        <legend>
-          <label for="edismax" class="checkbox">
-            <input type="checkbox" name="defType" id="edismax" value="edismax">
-            <strong>e</strong>dismax
-          </label>
-        </legend>
-        <div class="fieldset">
-
-        <label for="edismax_q_alt">q.alt</label>
-        <input type="text" name="q.alt" id="edismax_q_alt"  title="Alternate query when 'q' is absent.">
-
-        <label for="edismax_qf">qf</label>
-        <input type="text" name="qf" id="edismax_qf" title="Query fields with optional boosts.">
-
-        <label for="edismax_mm">mm</label>
-        <input type="text" name="mm" id="edismax_mm" title="Min-should-match expression.">
-
-        <label for="edismax_pf">pf</label>
-        <input type="text" name="pf" id="edismax_pf" title="Phrase boosted fields.">
-
-        <label for="edismax_ps">ps</label>
-        <input type="text" name="ps" id="edismax_ps" title="Phrase boost slop.">
-
-        <label for="edismax_qs">qs</label>
-        <input type="text" name="qs" id="edismax_qs" title="Query string phrase slop.">
-
-        <label for="edismax_tie">tie</label>
-        <input type="text" name="tie" id="edismax_tie" title="Score tie-breaker. Try 0.1.">
-
-        <label for="edismax_bq">bq</label>
-        <input type="text" name="bq" id="edismax_bq" title="Boost query.">
-
-        <label for="edismax_bf">bf</label>
-        <input type="text" name="bf" id="edismax_bf" title="Boost function (added).">
-
-        <label for="edismax_uf" title="User Fields">uf</label>
-        <input type="text" name="uf" id="edismax_uf">
-
-        <label for="edismax_pf2" title="bigram phrase boost fields">pf2</label>
-        <input type="text" name="pf2" id="edismax_pf2">
-
-        <label for="edismax_pf3" title="trigram phrase boost fields">pf3</label>
-        <input type="text" name="pf3" id="edismax_pf3">
-
-        <label for="edismax_ps2" title="phrase slop for bigram phrases">ps2</label>
-        <input type="text" name="ps2" id="edismax_ps2">
-
-        <label for="edismax_ps3" title="phrase slop for trigram phrases">ps3</label>
-        <input type="text" name="ps3" id="edismax_ps3">
-
-        <label for="edismax_boost" title="multiplicative boost function">boost</label>
-        <input type="text" name="boost" id="edismax_boost">
-
-        <label for="edismax_stopwords" class="checkbox" title="remove stopwords from mandatory 'matching' component">
-          <input type="checkbox" name="stopwords" id="edismax_stopwords" value="true" checked="checked">
-          stopwords
-        </label>
-
-        <label for="edismax_lowercaseOperators" class="checkbox" title="Enable lower-case 'and' and 'or' as operators">
-          <input type="checkbox" name="lowercaseOperators" id="edismax_lowercaseOperators" value="true" checked="checked">
-          lowercaseOperators
-        </label>
-      
-        </div>
-      </fieldset>
-
-      <fieldset class="hl optional">
-        <legend>
-          <label for="hl" class="checkbox">
-            <input type="checkbox" name="hl" id="hl" value="true" title="Enable highlighting.">
-            hl
-          </label>
-        </legend>
-        <div class="fieldset">
-
-        <label for="hl_fl">hl.fl</label>
-        <input type="text" name="hl.fl" id="hl_fl" value="" title="Fields to highlight on.">
-
-        <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="facet 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="spatial 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="spellcheck 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">
-
-    <a id="url" class="address-bar" href="#"></a>
-
-    <div id="response">
-
-      <iframe src="about:blank"></iframe>
-    
-    </div>
-
-  </div>
-
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/replication.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/replication.html b/solr/webapp/web/tpl/replication.html
deleted file mode 100644
index 2bfdfbd..0000000
--- a/solr/webapp/web/tpl/replication.html
+++ /dev/null
@@ -1,216 +0,0 @@
-<!--
-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.
--->
-<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="masterSearch">
-
-            <th>Master (Searching)</th>
-            <td class="version"><div></div></td>
-            <td class="generation"><div></div></td>
-            <td class="size"><div></div></td>
-
-          </tr>
-
-          <tr class="master">
-
-            <th>Master (Replicable)</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 (Searching)</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">&nbsp;</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">&nbsp;</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">
-
-    <div class="timer">
-
-      <p>Next Run: <span class="approx">~</span><span class="tick">15m 8s</span></p>
-      <small>Sat Mar 03 11:00:00 CET 2012</smalL>
-
-    </div>
-
-    <button class="refresh-status"><span>Refresh Status</span></button>
-
-    <div class="slaveOnly">        
-      <button class="optional replicate-now primary" data-command="fetchindex"><span>Replicate now</span></button>
-      <button class="optional abort-replication warn" data-command="abortfetch"><span>Abort Replication</span></button>
-
-      <button class="optional disable-polling" data-command="disablepoll"><span>Disable Polling</span></button>
-      <button class="optional enable-polling" data-command="enablepoll"><span>Enable Polling</span></button>
-    </div>
-
-    <div class="masterOnly">
-      <button class="optional disable-replication warn" data-command="disablereplication"><span>Disable Replication<span></button>
-      <button class="optional enable-replication warn" data-command="enablereplication"><span>Enable Replication<span></button>
-    </div>
-    
-  </div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/schema-browser.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/schema-browser.html b/solr/webapp/web/tpl/schema-browser.html
deleted file mode 100644
index 4338668..0000000
--- a/solr/webapp/web/tpl/schema-browser.html
+++ /dev/null
@@ -1,192 +0,0 @@
-<!--
-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.
--->
-<div id="schema-browser" class="loaded">
-
-  <div class="clearfix">
-
-    <div id="data">
-
-      <div id="field">
-
-        <div class="field-options">
-
-          <div class="block head">
-            <h2>
-              <span class="type"></span>:
-              <span class="name"></span>
-            </h2>
-          </div>
-
-          <div class="partial">
-
-            <p>Because your Index is empty, we have not enough Information about this Field</p>
-
-          </div>
-
-          <dl class="options clearfix">
-
-            <dt class="field-type">Field-Type:</dt>
-
-            <dt class="similarity">Similarity:</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>
-
-          <table class="flags" cellspacing="0" cellpadding="0" border="0">
-
-            <thead>
-
-              <tr>
-
-                <td>Flags:</td>
-
-              </tr>
-
-            </thead>
-
-            <tbody>
-
-            </tbody>
-
-          </table>
-
-          <ul class="analyzer">
-            <li class="clearfix index">
-
-              <p><a><span>Index&nbsp;Analyzer:</span></a></p>
-              <dl>
-                <dt><a class="toggle"></a></dt>
-              </dl>
-
-              <ul>
-                <li class="clearfix charFilters">
-                  <p>Char Filters:</p>
-                  <dl>
-                  </dl>
-                </li>
-                <li class="clearfix tokenizer">
-                  <p>Tokenizer:</p>
-                  <dl>
-                  </dl>
-                </li>
-                <li class="clearfix filters">
-                  <p>Token Filters:</p>
-                  <dl>
-                  </dl>
-                </li>
-              </ul>
-                            
-            </li>
-            <li class="clearfix query">
-
-              <p><a><span>Query&nbsp;Analyzer:</span></a></p>
-              <dl>
-                <dt><a class="toggle"></a></dt>
-              </dl>
-
-              <ul>
-                <li class="clearfix charFilters">
-                  <p>Char Filters:</p>
-                  <dl>
-                  </dl>
-                </li>
-                <li class="clearfix tokenizer">
-                  <p>Tokenizer:</p>
-                  <dl>
-                  </dl>
-                </li>
-                <li class="clearfix filters">
-                  <p>Token Filters:</p>
-                  <dl>
-                  </dl>
-                </li>
-              </ul>
-                            
-            </li>
-          </ul>
-
-        </div>
-
-        <div class="terminfo-holder clearfix">
-
-          <div class="trigger">
-
-            <button class="submit"><span>Load Term Info</span></button>
-
-            <a class="autoload" title="Automatically load Term Info?"><span>Autoload</span></a>
-
-          </div>
-
-          <p class="status">Sorry, no Term Info available :(</p>
-
-          <div class="topterms-holder">
-
-            <form>
-            <p class="head">
-              <input type="text">
-              <a class="max-holder" title="Load all Top-Terms">/<span class="max"></span></a> Top-Terms:
-              <a id="query_link" href="#"><span>Query</span>&nbsp;</a>
-            </p>
-            </form>
-
-            <ul>
-
-            </ul>
-
-          </div>
-
-          <div class="histogram-holder">
-
-            <p class="head">Histogram:</p>
-
-            <ul></ul>
-
-          </div>
-
-        </div>
-
-      </div>
-
-    </div>
-
-    <div id="related">
-
-      <select>
-        <option value="" selected="selected">Please select ...</option>
-      </select>
-
-      <dl id="f-df-t">
-      </dl>
-
-      <dl class="ukf-dsf">
-
-        <dt class="unique-key-field">Unique Key Field</dt>
-
-        <dt class="default-search-field">Default Search Field</dt>
-            
-      </dl>   
-
-    </div>
-
-  </div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/segments.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/segments.html b/solr/webapp/web/tpl/segments.html
deleted file mode 100644
index ffc2177..0000000
--- a/solr/webapp/web/tpl/segments.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
-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.
--->
-<div id="segments">  
-  <div class="clearfix">
-    
-    <div class="block fieldlist" id="statistics">
-      
-      <h2><span>Segments</span></h2>
-      <a class="reload"><span>reload</span></a>
-      
-      <div class="message-container">
-            <div class="message"></div>
-          </div>
-
-          <div class="content">            
-        
-          <div id="result">
-         
-            <div id="response">
-        
-              <div class="segments-holder">
-      
-                 <ul></ul>
-        
-               </div>
-            
-            </div>
-            
-        </div>
-          </div>
-    </div>
-    
-  </div>  
-
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/tpl/threads.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/tpl/threads.html b/solr/webapp/web/tpl/threads.html
deleted file mode 100644
index 87153ba..0000000
--- a/solr/webapp/web/tpl/threads.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!--
-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.
--->
-<div id="threads" class="collapsed">
-
-  <div class="controls">
-    <a>
-      <span class="expand">Show all Stacktraces</span>
-      <span class="collapse">Hide all Stacktraces</span>
-    </a>
-  </div>
-
-  <div id="thread-dump">
-
-    <table border="0" cellpadding="0" cellspacing="0">
-
-      <thead>
-
-        <tr>
-
-          <th class="name">name</th>
-          <th class="time">cpuTime / userTime</th>
-                
-        </tr>
-
-      </thead>
-
-      <tbody>
-
-      </tbody>
-
-    </table>
-    
-  </div>
-
-  <div class="controls">
-    <a>
-      <span class="expand">Show all Stacktraces</span>
-      <span class="collapse">Hide all Stacktraces</span>
-    </a>
-  </div>
-
-</div>
\ No newline at end of file


[07/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7831: Move CHANGES entry to 6.6.

Posted by tf...@apache.org.
LUCENE-7831: Move CHANGES entry to 6.6.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5ba761bc
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5ba761bc
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5ba761bc

Branch: refs/heads/jira/solr-10233
Commit: 5ba761bcf693f3e553489642e2d9f5af09db44cc
Parents: 0fb89f1
Author: Adrien Grand <jp...@gmail.com>
Authored: Tue May 16 23:10:32 2017 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Tue May 16 23:11:18 2017 +0200

----------------------------------------------------------------------
 lucene/CHANGES.txt | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5ba761bc/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index ce6ba67..df8d20d 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -94,10 +94,6 @@ Other
 
 ======================= Lucene 6.7.0 =======================
 
-Bug Fixes
-
-* LUCENE-7831: CodecUtil should not seek to negative offsets. (Adrien Grand)
-
 ======================= Lucene 6.6.0 =======================
 
 New Features
@@ -140,6 +136,8 @@ Bug Fixes
 * LUCENE-7817: Pass cached query to onQueryCache instead of null.
   (Christoph Kaser via Adrien Grand)
 
+* LUCENE-7831: CodecUtil should not seek to negative offsets. (Adrien Grand)
+
 Improvements
 
 * LUCENE-7782: OfflineSorter now passes the total number of items it


[08/50] [abbrv] lucene-solr:jira/solr-10233: Fix commit in TestUseDocValuesAsStored

Posted by tf...@apache.org.
Fix commit in TestUseDocValuesAsStored


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/942a0851
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/942a0851
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/942a0851

Branch: refs/heads/jira/solr-10233
Commit: 942a0851e9d506c168a6a2da825bbc4c3483a54f
Parents: 5ba761b
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Tue May 16 16:17:31 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Tue May 16 16:17:31 2017 -0700

----------------------------------------------------------------------
 .../src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/942a0851/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java b/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
index 136d40e..27b55d0 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestUseDocValuesAsStored.java
@@ -109,7 +109,7 @@ public class TestUseDocValuesAsStored extends AbstractBadConfigTestBase {
   @After
   private void afterTest() throws Exception {
     clearIndex();
-    commit();
+    assertU(commit());
     deleteCore();
     System.clearProperty("managed.schema.mutable");
     System.clearProperty("enable.update.log");


[18/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/schema-browser.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/schema-browser.js b/solr/webapp/web/js/scripts/schema-browser.js
deleted file mode 100644
index c25bafe..0000000
--- a/solr/webapp/web/js/scripts/schema-browser.js
+++ /dev/null
@@ -1,1229 +0,0 @@
-/*
- 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.
-*/
-
-var current_core = null;
-var cookie_schema_browser_autoload = 'schema-browser_autoload';
-
-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;
-}
-
-var load_terminfo = function( trigger_element, core_basepath, field, data_element, terminfo_element )
-{
-  var luke_url = core_basepath + '/admin/luke?wt=json&fl=' + field;
-  var topterms_count_element = $( '.topterms-holder .head input', terminfo_element );
-
-  var term_load_count = parseInt( topterms_count_element.val(), 10 );
-  if( term_load_count )
-  {
-    luke_url += '&numTerms=' + term_load_count;
-  }
-
-  $.ajax
-  (
-    {
-      url : luke_url,
-      dataType : 'json',
-      context : terminfo_element,
-      beforeSend : function( xhr, settings )
-      {
-        $( 'span', trigger_element )
-          .addClass( 'loader' );
-      },
-      success : function( response, text_status, xhr )
-      {
-        var additional_styles = [];
-        var field_data = response.fields[field];
-
-        if( !field_data || !( field_data.topTerms && field_data.histogram ) )
-        {
-          terminfo_element
-            .addClass( 'disabled' );
-
-          return false;
-        }
-
-        var get_width = function get_width()
-        {
-          return $( this ).width();
-        }
-
-        var topterms_holder_element = $( '.topterms-holder', data_element );
-        var histogram_holder_element = $( '.histogram-holder', data_element );
-
-        if( !field_data.topTerms )
-        {
-          topterms_holder_element
-            .hide();
-        }
-        else
-        {
-          topterms_holder_element
-            .show();
-
-          var topterms_table_element = $( 'ul', topterms_holder_element );
-
-          var topterms = field_data.topTerms;
-          var topterms_count = topterms.length;
-                    
-          var topterms_content = '';
-          var topterms_frq_last = null;
-
-          for( var i = 0; i < topterms_count; i += 2 )
-          {
-            if( topterms_frq_last !== topterms[i+1] )
-            {
-              if( topterms_frq_last )
-              {
-                topterms_content += '</ul></li>' + "\n";
-              }
-
-              topterms_frq_last = topterms[i+1];
-              topterms_content += '<li class="clearfix">'
-                               +  '<p><span>' + app.format_number( topterms_frq_last ) + '</span></p>' + "\n"
-                               +  '<ul>' + "\n";
-            }
-
-            var target = '#/' + current_core + '/query?q=' + field.esc() + ':' + encodeURIComponent( '"' + topterms[i] + '"' );
-            topterms_content += '<li><a href="' + target + '">' + topterms[i].esc() + '</a></li>' + "\n";
-          }
-
-          topterms_content += '</li>';
-
-          topterms_count = topterms_count / 2;
-
-          $( 'input', trigger_element )
-            .val( topterms_count );
-
-          topterms_table_element
-            .html( topterms_content );
-
-          var max_width = 10 + Math.max.apply( Math, $( 'p', topterms_table_element ).map( get_width ).get() );
-          additional_styles.push
-          (
-            topterms_table_element.selector + ' p { width: ' + max_width + 'px !important; }' + "\n" +
-            topterms_table_element.selector + ' ul { margin-left: ' + ( max_width + 5 ) + 'px !important; }'
-          );
-
-          topterms_count_element
-            .val( topterms_count );
-
-          $( 'p.head .max', topterms_holder_element )
-            .html( field_data.distinct );
-
-          $( 'p.head #query_link', topterms_holder_element )
-            .attr( 'href', '#/' + current_core + '/query?q=' + field.esc() + ':[* TO *]' );
-
-          $( 'ul li:even', topterms_table_element )
-            .addClass( 'odd' );
-        }
-
-        if( !field_data.histogram )
-        {
-          histogram_holder_element
-            .hide();
-        }
-        else
-        {
-          histogram_holder_element
-            .show();
-
-          var histogram_values = luke_array_to_hash( field_data.histogram );
-          var histogram_entries = [];
-          
-          var histogram_max = null;
-          for( var key in histogram_values )
-          {
-            histogram_max = Math.max( histogram_max, histogram_values[key] );
-          }
-
-          for( var key in histogram_values )
-          {
-            histogram_entries.push
-            (
-              '<li>' + "\n" +
-              '  <dl class="clearfix" style="width: ' +  ( ( histogram_values[key] / histogram_max ) * 100 ) + '%;">' + "\n" +
-              '    <dt><span>' + app.format_number( key ) + '</span></dt>' + "\n" +
-              '    <dd><span>' + app.format_number( histogram_values[key] ) + '</span></dd>' + "\n" +
-              '  </dl>' + "\n" +
-              '</li>'
-            );
-          }
-
-          $( 'ul', histogram_holder_element )
-            .html( histogram_entries.join( "\n" ) );
-
-          $( 'ul li:even', histogram_holder_element )
-            .addClass( 'odd' );
-
-          var max_width = 10 + Math.max.apply( Math, $( 'dt', histogram_holder_element ).map( get_width ).get() );
-          additional_styles.push
-          (
-            histogram_holder_element.selector + ' ul { margin-left: ' + max_width + 'px !important; }' + "\n" +
-            histogram_holder_element.selector + ' li dt { left: ' + ( max_width * -1 ) + 'px !important; width: ' + max_width + 'px !important; }'
-          );
-        }
-
-        if( additional_styles )
-        {
-          terminfo_element
-            .prepend( '<style type="text/css">' + additional_styles.join( "\n" ) + '</style>' );
-        }
-      },
-      error : function( xhr, text_status, error_thrown)
-      {
-        terminfo_element
-          .addClass( 'disabled' );
-      },
-      complete : function( xhr, text_status )
-      {
-        $( 'span', trigger_element )
-          .removeClass( 'loader' );
-      }
-    }
-  );
-}
-
-sammy.bind
-(
-  'schema_browser_navi',
-  function( event, params )
-  {
-    var related_navigation_element = $( '#related dl#f-df-t', params.schema_browser_element );
-    var related_navigation_meta = $( '#related dl.ukf-dsf', params.schema_browser_element );
-    var related_select_element = $( '#related select', params.schema_browser_element )
-    var type = 'index';
-
-    var sammy_basepath = app.core_menu.find( '.active a' ).attr( 'href' );
-        
-    if( !related_navigation_meta.hasClass( 'done' ) )
-    {
-      if( app.schema_browser_data.unique_key_field )
-      {
-        $( '.unique-key-field', related_navigation_meta )
-          .show()
-          .after
-          (
-            '<dd class="unique-key-field"><a href="' + sammy_basepath + '?field=' +
-            app.schema_browser_data.unique_key_field + '">' +
-            app.schema_browser_data.unique_key_field + '</a></dd>'
-          );
-      }
-
-      if( app.schema_browser_data.default_search_field )
-      {
-        $( '.default-search-field', related_navigation_meta )
-          .show()
-          .after
-          (
-            '<dd class="default-search-field"><a href="' + sammy_basepath + '?field=' +
-            app.schema_browser_data.default_search_field + '">' +
-            app.schema_browser_data.default_search_field + '</a></dd>'
-          );
-      }
-
-      related_navigation_meta
-        .addClass( 'done' );
-    }
-
-    if( params.route_params )
-    {
-      var type = params.route_params.type;
-      var value = params.route_params.value;
-
-      var navigation_data = {
-        'fields' : [],
-        'copyfield_source' : [],
-        'copyfield_dest' : [],
-        'dynamic_fields' : [],
-        'types' : []
-      }
-
-      $( 'option[value="' + params.route_params.path.esc() + '"]', related_select_element )
-        .attr( 'selected', 'selected' );
-
-      related_select_element
-        .trigger( 'liszt:updated' );
-
-      if( 'field' === type )
-      {
-        navigation_data.fields.push( value );
-
-        if( app.schema_browser_data.relations.f_t[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( app.schema_browser_data.fields[value].copySources && 0 !== app.schema_browser_data.fields[value].copySources.length )
-        {
-          navigation_data.copyfield_source = app.schema_browser_data.fields[value].copySources;
-        }
-
-        if( app.schema_browser_data.fields[value].copyDests && 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 navigation_content = '';
-
-      if( 0 !== navigation_data.fields.length )
-      {
-        navigation_data.fields.sort();
-        navigation_content += '<dt class="field">Field</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 Field</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">Type</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 );
-    }
-    else
-    {
-      related_navigation_element
-        .hide();
-            
-      $( 'option:selected', related_select_element )
-        .removeAttr( 'selected' );
-    }
-
-    if( 'field' === type && value === app.schema_browser_data.unique_key_field )
-    {
-      $( '.unique-key-field', related_navigation_meta )
-        .addClass( 'active' );
-    }
-    else
-    {
-      $( '.unique-key-field', related_navigation_meta )
-        .removeClass( 'active' );
-    }
-
-    if( 'field' === type && value === app.schema_browser_data.default_search_field )
-    {
-      $( '.default-search-field', related_navigation_meta )
-        .addClass( 'active' );
-    }
-    else
-    {
-      $( '.default-search-field', related_navigation_meta )
-        .removeClass( 'active' );
-    }
-
-    if( params.callback )
-    {
-      params.callback( app.schema_browser_data, $( '#data', params.schema_browser_element ) );
-    }
-  }
-);
-
-sammy.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=0&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;
-
-                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 )
-                {
-                  var copy_dests = app.schema_browser_data.fields[field].copyDests;
-                  for( var i in copy_dests )
-                  {
-                    var copy_dest = copy_dests[i];
-                    if( !app.schema_browser_data.fields[copy_dest] )
-                    {
-                      app.schema_browser_data.fields[copy_dest] = {
-                        partial : true,
-                        copySources : []
-                      };
-                    }
-
-                    if( app.schema_browser_data.fields[copy_dest].partial )
-                    {
-                      app.schema_browser_data.fields[copy_dest].copySources.push( field );
-                    }
-                  }
-
-                  var copy_sources = app.schema_browser_data.fields[field].copySources;
-                  for( var i in copy_sources )
-                  {
-                    var copy_source = copy_sources[i];
-                    if( !app.schema_browser_data.fields[copy_source] )
-                    {
-                      app.schema_browser_data.fields[copy_source] = {
-                        partial : true,
-                        copyDests : []
-                      };
-                    }
-
-                    if( app.schema_browser_data.fields[copy_source].partial )
-                    {
-                      app.schema_browser_data.fields[copy_source].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.esc() + '">' + field_name.esc() + '</option>'
-                      );
-                    }
-                    if( 0 !== fields.length )
-                    {
-                      fields.sort();
-                      related_options += '<optgroup label="Fields">' + "\n";
-                      related_options += fields.sort().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.esc() + '">' + type_name.esc() + '</option>'
-                      );
-                    }
-                    if( 0 !== dynamic_fields.length )
-                    {
-                      dynamic_fields.sort();
-                      related_options += '<optgroup label="DynamicFields">' + "\n";
-                      related_options += dynamic_fields.sort().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.esc() + '">' + type_name.esc() + '</option>'
-                      );
-                    }
-                    if( 0 !== types.length )
-                    {
-                      types.sort();
-                      related_options += '<optgroup label="Types">' + "\n";
-                      related_options += types.sort().join( "\n" ) + "\n";
-                      related_options += '</optgroup>' + "\n";
-                    }
-
-                    related_select_element
-                      .attr( 'rel', app.core_menu.find( '.active a' ).attr( 'href' ) )
-                      .append( related_options )
-                      .chosen();
-                                            
-                    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
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(schema-browser)$' ),
-  function( context )
-  {
-    var core_basepath = this.active_core.attr( 'data-basepath' );
-    current_core = context.params.splat[0];
-
-    var trigger_params = {
-      active_core : this.active_core
-    };
-
-    var path = context.path.split( '?' );
-    if( path && path[1] )
-    {
-      var param = path[1].split( '=' );
-      trigger_params.route_params =  {
-        path : '?' + path[1],
-        type : param[0],
-        value : param[1]
-      }
-
-      trigger_params.callback = function( schema_browser_data, data_element )
-      {
-        var field = trigger_params.route_params.value;
-
-        var type = trigger_params.route_params.type;
-        var is_f = 'field' === type;
-        var is_df = 'dynamic-field' === type;
-        var is_t = 'type' === type;
-                
-        var options_element = $( '.options', data_element );
-        var sammy_basepath = context.path.indexOf( '/', context.path.indexOf( '/', 2 ) + 1 );
-
-        data_element
-          .show();
-
-        // -- head
-
-        var head_element = $( '.head', data_element );
-        if( is_f )
-        {
-          $( '.type', head_element ).html( 'Field' );
-        }
-        else if( is_df )
-        {
-          $( '.type', head_element ).html( 'Dynamic Field' );
-        }
-        else if( is_t )
-        {
-          $( '.type', head_element ).html( 'Type' );
-        }
-        $( '.name', head_element ).html( field.esc() );
-
-
-        var partial_state = false;
-        if( is_f )
-        {
-          partial_state = !!schema_browser_data.fields[field].partial;
-        }
-
-        $( '.partial', data_element )
-          .toggle( partial_state );
-
-        // -- docs
-        var docs_element = $( 'dt.docs', options_element );
-        if( is_f && schema_browser_data.fields[field] && schema_browser_data.fields[field].docs )
-        {
-          $( 'dd.docs', options_element )
-            .remove();
-
-          var target = '#/' + current_core + '/query?q=' + field.esc() + ':[* TO *]';
-          docs_element
-            .show()
-            .after( 
-             '<dd class="docs">'+
-               '<a href="'+target+'">' + schema_browser_data.fields[field].docs + '</a>' +
-             '</dd>' );
-        }
-        else
-        {
-          $( '.docs', options_element )
-            .hide();
-        }
-
-        // -- distinct 
-        var distinct_element = $( 'dt.distinct', options_element );
-        if( is_f && schema_browser_data.fields[field] && schema_browser_data.fields[field].distinct )
-        {
-          $( 'dd.distinct', options_element )
-            .remove();
-
-          distinct_element
-            .show()
-            .after( '<dd class="distinct">' + schema_browser_data.fields[field].distinct + '</dd>' );
-        }
-        else
-        {
-          $( '.distinct', options_element )
-            .hide();
-        }
-
-        // -- position-increment-gap 
-        var pig_element = $( 'dt.position-increment-gap', options_element );
-        if( is_f && schema_browser_data.fields[field] && schema_browser_data.fields[field].positionIncrementGap )
-        {
-          $( 'dd.position-increment-gap', options_element )
-            .remove();
-
-          pig_element
-            .show()
-            .after( '<dd class="position-increment-gap">' + schema_browser_data.fields[field].positionIncrementGap + '</dd>' );
-        }
-        else
-        {
-          $( '.position-increment-gap', options_element )
-            .hide();
-        }
-
-        var similarity_element = $( 'dt.similarity', options_element );
-        if ( is_t && schema_browser_data.types[field] && schema_browser_data.types[field].similarity ) {
-            var similarity = schema_browser_data.types[field].similarity
-            if (similarity.details && similarity.className) {
-                $( 'dd.similarity', options_element ).remove();
-                similarity_element
-                    .show()
-                    .after(['<dd class="similarity">', similarity.details.esc(), ' (', similarity.className.esc(), ') </dd>'].join(""));
-            }
-        } else {
-            $( '.similarity', options_element ).hide();
-        }
-
-
-        // -- flags table
-        var flags_table = $( 'table.flags', data_element );
-
-        var flags_arr = [];
-        for( var key in schema_browser_data.key )
-        {
-          flags_arr.push( '<th data-key="' + key + '">' + schema_browser_data.key[key] + '</th>' );
-        }
-
-        $( 'thead tr', flags_table )
-          .append( flags_arr.join( "\n" ) );
-
-
-        var flags_body = $( 'tbody', flags_table );
-        flags_body.empty();
-
-        var generate_flags_row = function generate_flags_row( flags_str, title )
-        {
-          var flags_arr = [ '<th>' + title.esc() + '</th>' ];
-
-          if( 0 === flags_str.indexOf( '(' ) )
-          {
-            flags_arr.push( '<td colspan="2" class="text">' + flags_str + '</td>' );
-          }
-          else
-          {
-            var i = 0;
-            for( var key in schema_browser_data.key )
-            {
-              var flag_match = key === flags_str[i];
-
-              var flag_cell = '<td '
-                            + ' data-key="' + key + '"'
-                            + ' class="' + ( flag_match ? 'check' : '' ) + '"'
-                            + '>'
-                            + ( flag_match ? '<span>√</span>' : '&nbsp;' )
-                            + '</td>';
-
-              flags_arr.push( flag_cell );
-              i++;
-            }
-          }
-
-          flags_body
-            .append( '<tr>' + flags_arr.join( "\n" ) + '</tr>' );
-        };
-
-        var flags = null;
-        if( is_f && schema_browser_data.fields[field] && schema_browser_data.fields[field].flags )
-        {
-          flags = schema_browser_data.fields[field].flags;
-        }
-        else if( is_df && schema_browser_data.dynamic_fields[field] && schema_browser_data.dynamic_fields[field].flags )
-        {
-          flags = schema_browser_data.dynamic_fields[field].flags;
-        }
-
-        if( flags )
-        {
-          generate_flags_row( flags, 'Properties' );
-        }
-
-        if( is_f && schema_browser_data.fields[field] && schema_browser_data.fields[field].schema )
-        {
-          generate_flags_row( schema_browser_data.fields[field].schema, 'Schema' );
-        }
-
-        if( is_f && schema_browser_data.fields[field] && schema_browser_data.fields[field].index )
-        {
-          generate_flags_row( schema_browser_data.fields[field].index, 'Index' );
-        }
-
-
-        if( 0 !== $( 'tr', flags_body ).size() )
-        {
-          var col_count = 0;
-          for( var key in schema_browser_data.key )
-          {
-            var cols = $( '[data-key="' + key + '"]', flags_table );
-            
-            var col_used = 0 !== cols.filter( '.check' ).size();
-            col_count += col_used;
-
-            cols.toggle( col_used );
-          }
-
-          $( 'td[colspan]', flags_body )
-            .attr( 'colspan', col_count );
-
-          flags_table.show();
-        }
-        else
-        {
-          flags_table.hide();
-        }
-
-        var analyzer_element = $( '.analyzer', data_element );
-        var analyzer_data = null;
-
-        var analysis_link = false;
-        var analysis_link_elements = $( 'p a', analyzer_element );
-        var analysis_target = '#/' + current_core + '/analysis?';
-
-        if( is_f )
-        {
-          analyzer_data = schema_browser_data.types[schema_browser_data.relations.f_t[field]];
-
-          analysis_link = true;
-          analysis_target += 'analysis.fieldname=' + field;
-        }
-        else if( is_df )
-        {
-          analyzer_data = schema_browser_data.types[schema_browser_data.relations.df_t[field]];
-        }
-        else if( is_t )
-        {
-          analyzer_data = schema_browser_data.types[field];
-          
-          analysis_link = true;
-          analysis_target += 'analysis.fieldtype=' + field;
-        }
-
-        if( analysis_link )
-        {
-          analysis_link_elements
-            .addClass( 'analysis' )
-            .attr( 'href', analysis_target );
-        }
-        else
-        {
-          analysis_link_elements
-            .removeClass( 'analysis' )
-            .removeAttr( 'href' );
-        }
-
-
-        if( analyzer_data )
-        {
-          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 = $( 'dt.field-type', options_element );
-
-          $( 'dd.field-type', options_element )
-            .remove();
-
-          field_type_element
-            .show()
-            .after( '<dd class="field-type">' + analyzer_data.className + '</dd>' );
-
-          $( '.toggle', analyzer_element )
-            .die( 'click' )
-            .live
-            (
-              'click',
-              function( event )
-              {
-                $( this ).closest( 'li' )
-                  .toggleClass( 'open' );
-
-                return false;
-              }
-            );
-
-          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();
-
-            $( 'ul li', analyzer_key_element )
-            .removeClass( 'data' )
-            .hide();
-
-            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
-                .addClass( 'data' )
-                .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 )
-                .empty()
-                .append( type_content.join( "\n" ) );
-            }
-
-            var name_element = $( 'dl:first dt a', analyzer_key_element );
-            if( analyzer_key_data.className )
-            {
-              name_element
-                .html( analyzer_key_data.className );
-            }
-
-            0 === $( 'ul li.data', analyzer_key_element ).size()
-            ? name_element.removeClass( 'toggle' )
-            : name_element.addClass( 'toggle' );
-          }
-        }
-
-        var terminfo_element = $( '.terminfo-holder', data_element );
-
-        terminfo_element
-          .removeClass( 'disabled' )
-          .removeClass( 'loaded' );
-
-        var trigger_element = $( '.trigger button', terminfo_element );
-        var form_element = $( 'form', terminfo_element );
-
-        trigger_element
-          .die( 'click' )
-          .live
-          (
-            'click',
-            function( event )
-            {
-              form_element
-                .trigger( 'submit' );
-
-              return false;
-            }
-          );
-
-        form_element
-          .clearForm()
-          .die( 'submit' )
-          .live
-          (
-            'submit',
-            function( event )
-            {
-              load_terminfo( trigger_element, core_basepath, field, data_element, terminfo_element );
-
-              terminfo_element
-                .addClass( 'loaded' );
-
-              return false;
-            }
-          );
-
-        $( '.max-holder', terminfo_element )
-          .die( 'click' )
-          .live
-          (
-            'click',
-            function( event )
-            {
-              var element = $( this );
-
-              $( 'input', element.closest( 'form' ) )
-                .val( $( '.max', element ).text() );
-
-              form_element
-                .trigger( 'submit' );
-
-              return false;
-            }
-          );
-
-        $( '.trigger .autoload', terminfo_element )
-          .die( 'click' )
-          .live
-          (
-            'click',
-            function( event )
-            {
-              $.cookie( cookie_schema_browser_autoload, $.cookie( cookie_schema_browser_autoload ) ? null : true );
-              $( this ).trigger( 'state' );
-
-              return false;
-            }
-          )
-          .die( 'state' )
-          .live
-          (
-            'state',
-            function( event )
-            {
-              $.cookie( cookie_schema_browser_autoload )
-                ? $( this ).addClass( 'on' )
-                : $( this ).removeClass( 'on' );
-            }
-          )
-          .die( 'init' )
-          .live
-          (
-            'init',
-            function( event )
-            {
-              if( !$.cookie( cookie_schema_browser_autoload ) )
-              {
-                return false;
-              }
-
-              $( this ).trigger( 'state' );
-              trigger_element.trigger( 'click' );
-            }
-          )
-          .trigger( 'init' );
-
-        $( 'div[class$="-holder"]', terminfo_element )
-          .hide();
-
-        if( !is_f )
-        {
-          terminfo_element
-            .hide();
-        }
-        else
-        {
-          terminfo_element
-            .show();
-        }
-      }
-    }
-    else
-    {
-      trigger_params.callback = function( schema_browser_data, data_element )
-      {
-        data_element
-          .hide();
-      };
-    }
-
-    delete app.schema_browser_data;
-
-    sammy.trigger
-    (
-      'schema_browser_load',
-      trigger_params
-    );
-  }
-);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/segments.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/segments.js b/solr/webapp/web/js/scripts/segments.js
deleted file mode 100644
index eb5c169..0000000
--- a/solr/webapp/web/js/scripts/segments.js
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- 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.
-*/
-
-
-var get_tooltip = function( segment_response ) {
-    var tooltip =
-        '<div>Segment <b>' + segment_response.name + '</b>:</div>' +
-        '<div class="label">#docs:</div><div>' + number_format(segment_response.size) +'</div>' +
-        '<div class="label">#dels:</div><div>' + number_format(segment_response.delCount) + '</div>' +
-        '<div class="label">size:</div><div>' + number_format(segment_response.sizeInBytes) + ' bytes </div>' +
-        '<div class="label">age:</div><div>' + segment_response.age + '</div>' +
-        '<div class="label">source:</div><div>' + segment_response.source + '</div>';
-    return tooltip;
-};
-
-var get_entry = function( segment_response, segment_bytes_max ) {
-    //calcualte dimensions of graph
-    var dims = calculate_dimensions(segment_response.sizeInBytes, 
-            segment_bytes_max, segment_response.size, segment_response.delCount)
-    //create entry for segment with given dimensions
-    var entry = get_entry_item(segment_response.name, dims, 
-            get_tooltip(segment_response), (segment_response.mergeCandidate)?true:false);
-
-    return entry;
-};
-
-var get_entry_item = function(name, dims, tooltip, isMergeCandidate) {
-    var entry = '<li>' + "\n" +
-    '  <dl class="clearfix" style="width: ' + dims['size'] + '%;">' + "\n" +
-    '    <dt><div>' + name + '</div></dt>' + "\n" +
-    '    <dd>';
-    entry += '<div class="live' + ((isMergeCandidate)?' merge-candidate':'') + 
-         '" style="width: ' + dims['alive_doc_size'] + '%;">&nbsp;</div>';
-    entry += '<div class="toolitp">' + tooltip +'</div>';
-      
-    if (dims['deleted_doc_size'] > 0.001) {
-     entry += '<div class="deleted" style="width:' + dims['deleted_doc_size']  
-         + '%;margin-left:' + dims['alive_doc_size'] + '%;">&nbsp;</div>';
-    }
-    entry += '</dd></dl></li>';
-    return entry;
-};
-
-var get_footer = function(deletions_count, documents_count) {
-    return '<li><dl><dt></dt><dd>Deletions: ' + 
-        (documents_count == 0 ? 0 : round_2(deletions_count/documents_count * 100)) +
-            '% </dd></dl></li>';
-};
-
-var calculate_dimensions = function(segment_size_in_bytes, segment_size_in_bytes_max, doc_count, delete_doc_count) {
-    var segment_size_in_bytes_log = Math.log(segment_size_in_bytes);
-    var segment_size_in_bytes_max_log = Math.log(segment_size_in_bytes_max);
-
-    var dims = {};
-    //Normalize to 100% size of bar
-    dims['size'] = Math.floor((segment_size_in_bytes_log / segment_size_in_bytes_max_log ) * 100);
-    //Deleted doc part size
-    dims['deleted_doc_size'] = Math.floor((delete_doc_count/(delete_doc_count + doc_count)) * dims['size']);
-    //Alive doc part size
-    dims['alive_doc_size'] = dims['size'] - dims['deleted_doc_size'];
-
-    return dims;
-};
-
-var calculate_max_size_on_disk = function(segment_entries) {
-    var max = 0;
-    $.each(segment_entries, function(idx, obj) {
-        if (obj.sizeInBytes > max) {
-            max = obj.sizeInBytes;
-        }
-    });
-    return max;
-};
-
-var round_2 = function(num) {
-    return Math.round(num*100)/100;
-};
-
-var number_format = function(x) {
-    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
-};
-
-var prepare_x_axis = function(segment_bytes_max) {
-    var factor = 1024*1024; //for MB
-    
-    var segment_bytes_max_log = Math.log(segment_bytes_max);
-    
-    var series_entry = '<li>' + "\n" +
-    '  <dl class="clearfix" style="width:100%;">' + "\n" +
-    '    <dt><div>Size</div></dt>' + "\n" +
-    '    <dd>' + 
-    '        <div class="start">0</div>';
-    var step = 0;
-    for (var j = 0; j < 3; j+=1) {
-            step += segment_bytes_max_log/4;
-            var step_value = number_format(Math.floor((Math.pow(Math.E, step))/factor))
-            series_entry += '<div class="w5">' + ((step_value > 0.001)?step_value : '&nbsp;')  + '</div>'
-    }
-    series_entry += '<div class="end">' + number_format(Math.floor(segment_bytes_max/factor)) + ' MB </div>' +
-    '    </dd>' +
-    '  </dl>' +
-    '</li>';
-    return series_entry;
-};
-
-// #/:core/admin/segments
-sammy.get
-(
-  new RegExp( app.core_regex_base + '\\/(segments)$' ),
-  function( context )
-  {
-    var core_basepath = this.active_core.attr( 'data-basepath' );
-    var content_element = $( '#content' );
-        
-    $.get
-    (
-      'tpl/segments.html',
-      function( template )
-      {
-        content_element.html( template );
-            
-        var segments_element = $('#segments', content_element);
-        var segments_reload = $( '#segments a.reload' );
-        var url_element = $('#url', segments_element);
-        var result_element = $('#result', segments_element);
-        var response_element = $('#response', result_element);
-        var segments_holder_element = $('.segments-holder', result_element);
-
-        segments_reload
-            .die( 'click' )
-            .live
-            (
-            'click',
-            function( event )
-            {
-                $.ajax
-                (
-                  {
-                    url : core_basepath +  '/admin/segments?wt=json',
-                    dataType : 'json',
-                    context: this,
-                    beforeSend : function( arr, form, options )
-                    {
-                      loader.show( this );    
-                    },
-                    success : function( response, text_status, xhr )
-                    {
-                        var segments_response = response['segments'],
-                            segments_entries = [],
-                            segment_bytes_max = calculate_max_size_on_disk( segments_response );
-
-                        //scale
-                        segments_entries.push( prepare_x_axis( segment_bytes_max ) );
-                        
-                        var documents_count = 0, deletions_count = 0;
-                        
-                        //elements
-                        $.each( segments_response, function( key, segment_response ) {
-                            segments_entries.push( get_entry( segment_response, segment_bytes_max ) );
-                            
-                            documents_count += segment_response.size;
-                           deletions_count += segment_response.delCount;
-                        });
-     
-                        //footer
-                        segments_entries.push( get_footer( deletions_count, documents_count ) );
-                        
-                        $( 'ul', segments_holder_element ).html( segments_entries.join("\n" ) );
-                    },
-                    error : function( xhr, text_status, error_thrown )
-                    {
-                      $( this )
-                        .attr( 'title', '/admin/segments is not configured (' + xhr.status + ': ' + error_thrown + ')' );
-
-                      $( this ).parents( 'li' )
-                        .addClass( 'error' );
-                    },
-                    complete : function( xhr, text_status )
-                    {
-                      loader.hide( this );
-                    }
-                  }
-                );
-              return false;
-            }
-          );
-        //initially submit
-        segments_reload.click();
-      }
-    );
-  }
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/scripts/threads.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/scripts/threads.js b/solr/webapp/web/js/scripts/threads.js
deleted file mode 100644
index 099dd97..0000000
--- a/solr/webapp/web/js/scripts/threads.js
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- 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.
-*/
-
-// #/~threads
-sammy.get
-(
-  /^#\/(~threads)$/,
-  function( context )
-  {
-    var content_element = $( '#content' );
-
-    $.get
-    (
-      'tpl/threads.html',
-      function( template )
-      {
-        content_element
-          .html( template );
-
-        $.ajax
-        (
-          {
-            url : app.config.solr_path + '/admin/info/threads?wt=json',
-            dataType : 'json',
-            context : $( '#threads', content_element ),
-            beforeSend : function( xhr, settings )
-            {
-            },
-            success : function( response, text_status, xhr )
-            {
-              var self = this;
-
-              var threadDumpData = response.system.threadDump;
-              var threadDumpContent = [];
-              var c = 0;
-              for( var i = 1; i < threadDumpData.length; i += 2 )
-              {
-                var state = threadDumpData[i].state.esc();
-                var name = '<a title="' + state +'"><span>' + threadDumpData[i].name.esc() + ' (' + threadDumpData[i].id.esc() + ')</span></a>';
-
-                var classes = [state];
-                var details = '';
-
-                if( 0 !== c % 2 )
-                {
-                  classes.push( 'odd' );
-                }
-
-                if( threadDumpData[i].lock )
-                {
-                  classes.push( 'lock' );
-                  name += "\n" + '<p title="Waiting on">' + threadDumpData[i].lock.esc() + '</p>';
-                }
-
-                if( threadDumpData[i].stackTrace && 0 !== threadDumpData[i].stackTrace.length )
-                {
-                  classes.push( 'stacktrace' );
-
-                  var stack_trace = threadDumpData[i].stackTrace
-                            .join( '###' )
-                            .esc()
-                            .replace( /\(/g, '&#8203;(' )
-                            .replace( /###/g, '</li><li>' );
-
-                  name += '<div>' + "\n"
-                       + '<ul>' + "\n"
-                       + '<li>' + stack_trace + '</li>'
-                       + '</ul>' + "\n"
-                       + '</div>';
-                }
-
-                var item = '<tr class="' + classes.join( ' ' ) +'">' + "\n"
-                         + '<td class="name">' + name + '</td>' + "\n"
-                         + '<td class="time">' + threadDumpData[i].cpuTime.esc() + '<br>' + threadDumpData[i].userTime.esc() + '</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' );
-                  }
-                );
-                            
-              $( '.controls a', this )
-                .die( 'click' )
-                .live
-                (
-                  'click',
-                  function( event )
-                  {
-                    var threads_element = $( self );
-                    var is_collapsed = threads_element.hasClass( 'collapsed' );
-                    var thread_rows = $( 'tr', threads_element );
-
-                    thread_rows
-                      .each
-                      (
-                        function( index, element )
-                        {
-                          if( is_collapsed )
-                          {
-                            $( element )
-                              .addClass( 'open' );
-                          }
-                          else
-                          {
-                            $( element )
-                              .removeClass( 'open' );
-                          }
-                        }
-                      );
-
-                    threads_element
-                      .toggleClass( 'collapsed' )
-                      .toggleClass( 'expanded' );
-                  }
-                );
-            },
-            error : function( xhr, text_status, error_thrown)
-            {
-            },
-            complete : function( xhr, text_status )
-            {
-            }
-          }
-        );
-      }
-    );
-  }
-);
\ No newline at end of file


[37/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7730: Better accuracy for the length normalization factor.

Posted by tf...@apache.org.
LUCENE-7730: Better accuracy for the length normalization factor.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/06a6034d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/06a6034d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/06a6034d

Branch: refs/heads/jira/solr-10233
Commit: 06a6034d9bc8f06ea567c0110b954b35515c2ea0
Parents: c53d19e
Author: Adrien Grand <jp...@gmail.com>
Authored: Thu May 18 16:27:31 2017 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Thu May 18 16:27:31 2017 +0200

----------------------------------------------------------------------
 lucene/CHANGES.txt                              |    3 +
 .../lucene/benchmark/quality/trecQRels.txt      | 1090 +++++++++---------
 .../lucene/index/DefaultIndexingChain.java      |    8 +-
 .../lucene/index/DocumentsWriterPerThread.java  |    4 +
 .../apache/lucene/index/FieldInvertState.java   |   17 +-
 .../search/similarities/BM25Similarity.java     |   79 +-
 .../search/similarities/ClassicSimilarity.java  |  101 +-
 .../search/similarities/SimilarityBase.java     |   65 +-
 .../search/similarities/TFIDFSimilarity.java    |  128 +-
 .../java/org/apache/lucene/util/SmallFloat.java |   83 +-
 .../apache/lucene/index/TestIndexSorting.java   |    2 +-
 .../lucene/index/TestMaxTermFrequency.java      |   47 +-
 .../test/org/apache/lucene/index/TestNorms.java |   65 +-
 .../org/apache/lucene/index/TestOmitTf.java     |    4 +-
 .../lucene/search/TestDisjunctionMaxQuery.java  |    3 +-
 .../lucene/search/TestElevationComparator.java  |    9 +-
 .../apache/lucene/search/TestPhraseQuery.java   |    7 +-
 .../apache/lucene/search/TestQueryRescorer.java |   18 +-
 .../apache/lucene/search/TestSimilarity.java    |   14 +-
 .../lucene/search/TestSimilarityProvider.java   |  117 +-
 .../apache/lucene/search/TestSortRescorer.java  |    2 +-
 .../similarities/TestAxiomaticSimilarity.java   |   13 -
 .../search/similarities/TestBM25Similarity.java |   70 +-
 .../similarities/TestBooleanSimilarity.java     |    5 +-
 .../similarities/TestClassicSimilarity.java     |   91 +-
 .../search/similarities/TestSimilarityBase.java |   99 +-
 .../org/apache/lucene/util/TestSmallFloat.java  |   54 +-
 .../expressions/TestExpressionRescorer.java     |    2 +-
 .../search/highlight/HighlighterTest.java       |    8 +-
 .../apache/lucene/index/memory/MemoryIndex.java |    2 +-
 .../lucene/index/memory/TestMemoryIndex.java    |   34 +-
 .../apache/lucene/misc/SweetSpotSimilarity.java |   25 +-
 .../lucene/misc/SweetSpotSimilarityTest.java    |  116 +-
 .../function/valuesource/NormValueSource.java   |   36 +-
 .../function/TestLongNormValueSource.java       |  117 +-
 .../queries/function/TestValueSources.java      |    2 +-
 .../queries/payloads/TestPayloadScoreQuery.java |    9 +-
 .../queries/payloads/TestPayloadTermQuery.java  |    3 +-
 .../search/similarities/RandomSimilarity.java   |    2 +-
 .../apache/solr/DisMaxRequestHandlerTest.java   |    4 +-
 .../component/QueryElevationComponentTest.java  |    4 +-
 .../search/TestPayloadScoreQParserPlugin.java   |    2 +-
 .../search/function/SortByFunctionTest.java     |    6 +-
 .../solr/search/function/TestFunctionQuery.java |    7 +-
 .../TestSweetSpotSimilarityFactory.java         |   91 +-
 45 files changed, 1353 insertions(+), 1315 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index df8d20d..404e923 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -63,6 +63,9 @@ Improvements
 * LUCENE-7489: Better storage of sparse doc-values fields with the default
   codec. (Adrien Grand)
 
+* LUCENE-7730: More accurate encoding of the length normalization factor
+  thanks to the removal of index-time boosts. (Adrien Grand)
+
 Optimizations
 
 * LUCENE-7416: BooleanQuery optimizes queries that have queries that occur both

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/trecQRels.txt
----------------------------------------------------------------------
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/trecQRels.txt b/lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/trecQRels.txt
index 183a7f4..16094e3 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/trecQRels.txt
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/trecQRels.txt
@@ -40,64 +40,64 @@
 0 	 0 	 fakedoc3             	 1
 0 	 0 	 fakedoc4             	 1
 
-0 	 0 	 doc18211             	 1
 0 	 0 	 doc20192             	 1
+0        0       doc18211                1
+0        0       doc12431                1
+0 	 0 	 doc5471              	 1
+0 	 0 	 doc3462             	 1
+0 	 0 	 doc3057             	 1
 0 	 0 	 doc7401              	 1
-0 	 0 	 doc11285             	 1
-0 	 0 	 doc20647             	 1
-0 	 0 	 doc3057              	 1
-0 	 0 	 doc12431             	 1
-0 	 0 	 doc4989              	 1
-0 	 0 	 doc17324             	 1
 0 	 0 	 doc4030              	 1
-0 	 0 	 doc4290              	 1
-0 	 0 	 doc3462              	 1
+0 	 0 	 doc4290             	 1
+0 	 0 	 doc17904              	 1
+0 	 0 	 doc11285              	 1
+0 	 0 	 doc20647              	 1
+0 	 0 	 doc17324             	 1
+0 	 0 	 doc7168             	 1
+0 	 0 	 doc9011              	 1
+0 	 0 	 doc4989              	 1
 0 	 0 	 doc15313             	 1
-0 	 0 	 doc10303             	 1
-0 	 0 	 doc1893              	 1
-0 	 0 	 doc5008              	 1
+0 	 0 	 doc10303              	 1
 0 	 0 	 doc14634             	 1
-0 	 0 	 doc5471              	 1
-0 	 0 	 doc17904             	 1
-0 	 0 	 doc7168              	 1
-0 	 0 	 doc21275             	 1
-0 	 0 	 doc9011              	 1
-0 	 0 	 doc17546             	 1
 0 	 0 	 doc9102              	 1
-0 	 0 	 doc13199             	 1
+0 	 0 	 doc5008             	 1
+0 	 0 	 doc1893              	 1
+0 	 0 	 doc17546             	 1
+0 	 0 	 doc13199              	 1
+0 	 0 	 doc21275             	 1
 
 # --- m==1: precision_at_n and avg_precision are hurt, by unmarking relevant docs
 
-1 	 0 	 doc9857              	 0
-1 	 0 	 doc16846             	 1
-1 	 0 	 doc4320              	 1
-1 	 0 	 doc9501              	 0
-1 	 0 	 doc10159             	 1
-1 	 0 	 doc16642             	 1
-1 	 0 	 doc17536             	 0
-1 	 0 	 doc17571             	 1
-1 	 0 	 doc18728             	 1
-1 	 0 	 doc18828             	 1
-1 	 0 	 doc19108             	 0
-1 	 0 	 doc9940              	 1
-1 	 0 	 doc11852             	 1
-1 	 0 	 doc7430              	 0
-1 	 0 	 doc19162             	 1
-1 	 0 	 doc1743              	 1
-1 	 0 	 doc2137              	 1
-1 	 0 	 doc7611              	 1
-1 	 0 	 doc8072              	 1
-1 	 0 	 doc12764             	 1
-1 	 0 	 doc2593              	 1
-1 	 0 	 doc11088             	 1
-1 	 0 	 doc931               	 1
-1 	 0 	 doc7673              	 1
-1 	 0 	 doc12941             	 1
-1 	 0 	 doc11797             	 1
-1 	 0 	 doc11831             	 1
-1 	 0 	 doc13162             	 1
-1 	 0 	 doc4423              	 1
-1 	 0 	 doc5217              	 1
+1 	 0	 doc9857              	 0
+1 	 0	 doc16846             	 1
+1 	 0	 doc9940              	 1
+1 	 0	 doc11852             	 0
+1 	 0	 doc12764             	 1
+1 	 0	 doc11088             	 1
+1 	 0	 doc2137              	 0
+1 	 0	 doc7673              	 1
+1 	 0	 doc7611              	 1
+1 	 0	 doc8072              	 1
+1 	 0	 doc19162             	 0
+1 	 0	 doc12941             	 1
+1 	 0	 doc931               	 1
+1 	 0	 doc2593              	 0
+1 	 0	 doc5037              	 1
+1 	 0	 doc13162             	 1
+1 	 0	 doc5018              	 1
+1 	 0	 doc11797             	 1
+1 	 0	 doc11831             	 1
+1 	 0	 doc5217              	 1
+1 	 0	 doc15426             	 1
+1 	 0	 doc7228              	 1
+1 	 0	 doc15370             	 1
+1 	 0	 doc10159             	 1
+1 	 0	 doc4320              	 1
+1 	 0	 doc9501              	 1
+1 	 0	 doc16642             	 1
+1 	 0	 doc17536             	 1
+1 	 0	 doc17571             	 1
+1 	 0	 doc18728             	 1
 
 # ---- m==2: all precision, precision_at_n and recall are hurt.
 
@@ -106,200 +106,200 @@
 2 	 0 	 fakedoc3             	 1
 2 	 0 	 fakedoc4             	 1
 
-2 	 0 	 doc3137              	 0
-2 	 0 	 doc7142              	 0
-2 	 0 	 doc13667             	 0
-2 	 0 	 doc13171             	 0
-2 	 0 	 doc13372             	 1
-2 	 0 	 doc21415             	 1
-2 	 0 	 doc16298             	 1
-2 	 0 	 doc14957             	 1
-2 	 0 	 doc153               	 1
-2 	 0 	 doc16092             	 1
-2 	 0 	 doc16096             	 1
-2 	 0 	 doc21303             	 1
-2 	 0 	 doc18681             	 1
-2 	 0 	 doc20756             	 1
-2 	 0 	 doc355               	 1
-2 	 0 	 doc13395             	 1
-2 	 0 	 doc5009              	 1
-2 	 0 	 doc17164             	 1
-2 	 0 	 doc13162             	 1
-2 	 0 	 doc11757             	 1
-2 	 0 	 doc9637              	 1
-2 	 0 	 doc18087             	 1
-2 	 0 	 doc4593              	 1
-2 	 0 	 doc4677              	 1
-2 	 0 	 doc20865             	 1
-2 	 0 	 doc8556              	 1
-2 	 0 	 doc2578              	 1
-2 	 0 	 doc1163              	 1
-2 	 0 	 doc3797              	 1
-2 	 0 	 doc11094             	 1
-
-
-3 	 0 	 doc19578             	 1
-3 	 0 	 doc14860             	 1
-3 	 0 	 doc7235              	 1
-3 	 0 	 doc20590             	 1
-3 	 0 	 doc17933             	 1
-3 	 0 	 doc9384              	 1
-3 	 0 	 doc10783             	 1
-3 	 0 	 doc1963              	 1
-3 	 0 	 doc18356             	 1
-3 	 0 	 doc13254             	 1
-3 	 0 	 doc18402             	 1
-3 	 0 	 doc15241             	 1
-3 	 0 	 doc3303              	 1
-3 	 0 	 doc8868              	 1
-3 	 0 	 doc18520             	 1
-3 	 0 	 doc4650              	 1
-3 	 0 	 doc4727              	 1
-3 	 0 	 doc21518             	 1
-3 	 0 	 doc5060              	 1
-3 	 0 	 doc7587              	 1
-3 	 0 	 doc2990              	 1
-3 	 0 	 doc8042              	 1
-3 	 0 	 doc6304              	 1
-3 	 0 	 doc13223             	 1
-3 	 0 	 doc1964              	 1
-3 	 0 	 doc10597             	 1
-3 	 0 	 doc21023             	 1
-3 	 0 	 doc19057             	 1
-3 	 0 	 doc14948             	 1
-3 	 0 	 doc9692              	 1
-
-
-4 	 0 	 doc2534              	 1
-4 	 0 	 doc21388             	 1
-4 	 0 	 doc20923             	 1
-4 	 0 	 doc11547             	 1
-4 	 0 	 doc19755             	 1
-4 	 0 	 doc3793              	 1
-4 	 0 	 doc6714              	 1
-4 	 0 	 doc12722             	 1
-4 	 0 	 doc5552              	 1
-4 	 0 	 doc6810              	 1
-4 	 0 	 doc16953             	 1
-4 	 0 	 doc2527              	 1
-4 	 0 	 doc5361              	 1
-4 	 0 	 doc12353             	 1
-4 	 0 	 doc7308              	 1
-4 	 0 	 doc3836              	 1
-4 	 0 	 doc2293              	 1
-4 	 0 	 doc7348              	 1
-4 	 0 	 doc17119             	 1
-4 	 0 	 doc19331             	 1
-4 	 0 	 doc3411              	 1
-4 	 0 	 doc14643             	 1
-4 	 0 	 doc9058              	 1
-4 	 0 	 doc11099             	 1
-4 	 0 	 doc12485             	 1
-4 	 0 	 doc16432             	 1
-4 	 0 	 doc10047             	 1
-4 	 0 	 doc13788             	 1
-4 	 0 	 doc117               	 1
-4 	 0 	 doc638               	 1
+2 	 0	 doc3137              	 0
+2 	 0	 doc13667             	 0
+2 	 0	 doc7142              	 0
+2 	 0	 doc16298             	 0
+2 	 0	 doc13171             	 1
+2 	 0	 doc14957             	 1
+2 	 0	 doc5009              	 1
+2 	 0	 doc13372             	 1
+2 	 0	 doc17164             	 1
+2 	 0	 doc21303             	 1
+2 	 0	 doc18681             	 1
+2 	 0	 doc13162             	 1
+2 	 0	 doc20756             	 1
+2 	 0	 doc3797              	 1
+2 	 0	 doc20865             	 1
+2 	 0	 doc153               	 1
+2 	 0	 doc16092             	 1
+2 	 0	 doc16096             	 1
+2 	 0	 doc2578              	 1
+2 	 0	 doc21415             	 1
+2 	 0	 doc4593              	 1
+2 	 0	 doc4677              	 1
+2 	 0	 doc21088             	 1
+2 	 0	 doc8556              	 1
+2 	 0	 doc9637              	 1
+2 	 0	 doc344               	 1
+2 	 0	 doc355               	 1
+2 	 0	 doc13395             	 1
+2 	 0	 doc1163              	 1
+2 	 0	 doc11757             	 1
+
+
+3 	 0	 doc7235              	 1
+3 	 0	 doc19578             	 1
+3 	 0	 doc17933             	 1
+3 	 0	 doc20590             	 1
+3 	 0	 doc14860             	 1
+3 	 0	 doc10783             	 1
+3 	 0	 doc15241             	 1
+3 	 0	 doc13223             	 1
+3 	 0	 doc1963              	 1
+3 	 0	 doc10597             	 1
+3 	 0	 doc6304              	 1
+3 	 0	 doc3303              	 1
+3 	 0	 doc13254             	 1
+3 	 0	 doc9384              	 1
+3 	 0	 doc18356             	 1
+3 	 0	 doc18402             	 1
+3 	 0	 doc18520             	 1
+3 	 0	 doc14948             	 1
+3 	 0	 doc5060              	 1
+3 	 0	 doc4650              	 1
+3 	 0	 doc4727              	 1
+3 	 0	 doc19057             	 1
+3 	 0	 doc8868              	 1
+3 	 0	 doc2990              	 1
+3 	 0	 doc21518             	 1
+3 	 0	 doc21023             	 1
+3 	 0	 doc7587              	 1
+3 	 0	 doc8042              	 1
+3 	 0	 doc1964              	 1
+3 	 0	 doc7124              	 1
+
+
+
+4 	 0	 doc2534              	 1
+4 	 0	 doc6714              	 1
+4 	 0	 doc6810              	 1
+4 	 0	 doc21388             	 1
+4 	 0	 doc5361              	 1
+4 	 0	 doc7308              	 1
+4 	 0	 doc20923             	 1
+4 	 0	 doc12722             	 1
+4 	 0	 doc2527              	 1
+4 	 0	 doc7348              	 1
+4 	 0	 doc10047             	 1
+4 	 0	 doc5552              	 1
+4 	 0	 doc19755             	 1
+4 	 0	 doc13788             	 1
+4 	 0	 doc14643             	 1
+4 	 0	 doc11547             	 1
+4 	 0	 doc2293              	 1
+4 	 0	 doc3793              	 1
+4 	 0	 doc19331             	 1
+4 	 0	 doc3836              	 1
+4 	 0	 doc12353             	 1
+4 	 0	 doc11099             	 1
+4 	 0	 doc16432             	 1
+4 	 0	 doc117               	 1
+4 	 0	 doc16953             	 1
+4 	 0	 doc9058              	 1
+4 	 0	 doc3411              	 1
+4 	 0	 doc12485             	 1
+4 	 0	 doc17119             	 1
+4 	 0	 doc638               	 1
 
 
 
 5 	 0	 doc13181 	1
-5 	 0	 doc169 	1
-5 	 0	 doc5389 	1
-5 	 0	 doc955 	1
-5 	 0	 doc8573 	1
+5 	 0	 doc169   	1
+5 	 0	 doc8573  	1
 5 	 0	 doc10242 	1
-5 	 0	 doc4350 	1
-5 	 0	 doc17417 	1
 5 	 0	 doc11758 	1
-5 	 0	 doc9197 	1
+5 	 0	 doc955   	1
+5 	 0	 doc9197  	1
+5 	 0	 doc17417 	1
+5 	 0	 doc5389  	1
+5 	 0	 doc4350  	1
+5 	 0	 doc3857  	1
+5 	 0	 doc3204  	1
 5 	 0	 doc10639 	1
-5 	 0	 doc3857 	1
-5 	 0	 doc10478 	1
 5 	 0	 doc10262 	1
-5 	 0	 doc2981 	1
-5 	 0	 doc3204 	1
+5 	 0	 doc2981  	1
+5 	 0	 doc10478 	1
 5 	 0	 doc17122 	1
+5 	 0	 doc4065  	1
 5 	 0	 doc17864 	1
-5 	 0	 doc9298 	1
-5 	 0	 doc4065 	1
-5 	 0	 doc2492 	1
-5 	 0	 doc18879 	1
-5 	 0	 doc12199 	1
-5 	 0	 doc5180 	1
+5 	 0	 doc9298  	1
+5 	 0	 doc6918  	1
 5 	 0	 doc11528 	1
+5 	 0	 doc12199 	1
+5 	 0	 doc2492  	1
+5 	 0	 doc18879 	1
 5 	 0	 doc20190 	1
-5 	 0	 doc6918 	1
-5 	 0	 doc4665 	1
+5 	 0	 doc4665  	1
+5 	 0	 doc5180  	1
+5 	 0	 doc9124  	1
 5 	 0	 doc10195 	1
-5 	 0	 doc3062 	1
-
-
-
-6 	 0 	 doc9507              	 1
-6 	 0 	 doc15630             	 1
-6 	 0 	 doc8469              	 1
-6 	 0 	 doc11918             	 1
-6 	 0 	 doc20482             	 1
-6 	 0 	 doc20158             	 1
-6 	 0 	 doc19831             	 1
-6 	 0 	 doc8296              	 1
-6 	 0 	 doc8930              	 1
-6 	 0 	 doc16460             	 1
-6 	 0 	 doc2577              	 1
-6 	 0 	 doc15476             	 1
-6 	 0 	 doc1767              	 1
-6 	 0 	 doc689               	 1
-6 	 0 	 doc16606             	 1
-6 	 0 	 doc6149              	 1
-6 	 0 	 doc18691             	 1
-6 	 0 	 doc2208              	 1
-6 	 0 	 doc3592              	 1
-6 	 0 	 doc11199             	 1
-6 	 0 	 doc16329             	 1
-6 	 0 	 doc6007              	 1
-6 	 0 	 doc15231             	 1
-6 	 0 	 doc20622             	 1
-6 	 0 	 doc21468             	 1
-6 	 0 	 doc12230             	 1
-6 	 0 	 doc5723              	 1
-6 	 0 	 doc8120              	 1
-6 	 0 	 doc8668              	 1
-6 	 0 	 doc303               	 1
-
-
-
-
-7 	 0 	 doc7728              	 1
-7 	 0 	 doc7693              	 1
-7 	 0 	 doc21088             	 1
-7 	 0 	 doc5017              	 1
-7 	 0 	 doc10807             	 1
-7 	 0 	 doc16204             	 1
-7 	 0 	 doc2233              	 1
-7 	 0 	 doc3632              	 1
-7 	 0 	 doc4719              	 1
-7 	 0 	 doc6477              	 1
-7 	 0 	 doc6502              	 1
-7 	 0 	 doc6709              	 1
-7 	 0 	 doc7710              	 1
-7 	 0 	 doc9193              	 1
-7 	 0 	 doc9309              	 1
-7 	 0 	 doc9789              	 1
-7 	 0 	 doc10971             	 1
-7 	 0 	 doc18059             	 1
-7 	 0 	 doc19906             	 1
-7 	 0 	 doc20089             	 1
-7 	 0 	 doc20102             	 1
-7 	 0 	 doc21040             	 1
-7 	 0 	 doc21153             	 1
-7 	 0 	 doc9147              	 1
-7 	 0 	 doc9930              	 1
-7 	 0 	 doc19763             	 1
-7 	 0 	 doc1559              	 1
-7 	 0 	 doc21248             	 1
-7 	 0 	 doc17945             	 1
-7 	 0 	 doc526               	 1
+
+
+
+6 	 0	 doc15630             	 1
+6 	 0	 doc9507              	 1
+6 	 0	 doc8469              	 1
+6 	 0	 doc20158             	 1
+6 	 0	 doc20482             	 1
+6 	 0	 doc1767              	 1
+6 	 0	 doc5723              	 1
+6 	 0	 doc12230             	 1
+6 	 0	 doc2577              	 1
+6 	 0	 doc11918             	 1
+6 	 0	 doc6007              	 1
+6 	 0	 doc20622             	 1
+6 	 0	 doc15231             	 1
+6 	 0	 doc21468             	 1
+6 	 0	 doc8296              	 1
+6 	 0	 doc16606             	 1
+6 	 0	 doc18691             	 1
+6 	 0	 doc6149              	 1
+6 	 0	 doc19831             	 1
+6 	 0	 doc8930              	 1
+6 	 0	 doc2208              	 1
+6 	 0	 doc16460             	 1
+6 	 0	 doc689               	 1
+6 	 0	 doc303               	 1
+6 	 0	 doc8120              	 1
+6 	 0	 doc11199             	 1
+6 	 0	 doc3592              	 1
+6 	 0	 doc8668              	 1
+6 	 0	 doc15476             	 1
+6 	 0	 doc7693              	 1
+
+
+
+7 	 0	 doc7693              	 1
+7 	 0	 doc7728              	 1
+7 	 0	 doc21088             	 1
+7 	 0	 doc19763             	 1
+7 	 0	 doc19906             	 1
+7 	 0	 doc16204             	 1
+7 	 0	 doc4719              	 1
+7 	 0	 doc18059             	 1
+7 	 0	 doc9147              	 1
+7 	 0	 doc9930              	 1
+7 	 0	 doc6477              	 1
+7 	 0	 doc21040             	 1
+7 	 0	 doc2233              	 1
+7 	 0	 doc6709              	 1
+7 	 0	 doc7710              	 1
+7 	 0	 doc9789              	 1
+7 	 0	 doc10971             	 1
+7 	 0	 doc20102             	 1
+7 	 0	 doc5017              	 1
+7 	 0	 doc3632              	 1
+7 	 0	 doc6502              	 1
+7 	 0	 doc9193              	 1
+7 	 0	 doc9309              	 1
+7 	 0	 doc21153             	 1
+7 	 0	 doc526               	 1
+7 	 0	 doc20089             	 1
+7 	 0	 doc10807             	 1
+7 	 0	 doc1559              	 1
+7 	 0	 doc21248             	 1
+7 	 0	 doc15559             	 1
 
 
 # --- m==0: avg_precision and recall are hurt, by marking fake docs as relevant
@@ -309,71 +309,71 @@
 8 	 0 	 fakedoc3             	 1
 8 	 0 	 fakedoc4             	 1
 
-8 	 0 	 doc16299             	 1
-8 	 0 	 doc1662              	 1
-8 	 0 	 doc4585              	 1
-8 	 0 	 doc12315             	 1
-8 	 0 	 doc16266             	 1
-8 	 0 	 doc13136             	 1
-8 	 0 	 doc19212             	 1
-8 	 0 	 doc7086              	 1
-8 	 0 	 doc7062              	 1
-8 	 0 	 doc6134              	 1
-8 	 0 	 doc13953             	 1
-8 	 0 	 doc16264             	 1
-8 	 0 	 doc2494              	 1
-8 	 0 	 doc10636             	 1
-8 	 0 	 doc10894             	 1
-8 	 0 	 doc6844              	 1
-8 	 0 	 doc674               	 1
-8 	 0 	 doc13520             	 1
-8 	 0 	 doc344               	 1
-8 	 0 	 doc2896              	 1
-8 	 0 	 doc11871             	 1
-8 	 0 	 doc1862              	 1
-8 	 0 	 doc16728             	 1
-8 	 0 	 doc10308             	 1
-8 	 0 	 doc2227              	 1
-8 	 0 	 doc13167             	 1
-8 	 0 	 doc20607             	 1
-8 	 0 	 doc9670              	 1
-8 	 0 	 doc1566              	 1
-8 	 0 	 doc17885             	 1
+8 	 0	 doc1662              	 1
+8 	 0	 doc12315             	 1
+8 	 0	 doc16299             	 1
+8 	 0	 doc19212             	 1
+8 	 0	 doc2494              	 1
+8 	 0	 doc13520             	 1
+8 	 0	 doc13136             	 1
+8 	 0	 doc7086              	 1
+8 	 0	 doc674               	 1
+8 	 0	 doc16266             	 1
+8 	 0	 doc10894             	 1
+8 	 0	 doc4585              	 1
+8 	 0	 doc6134              	 1
+8 	 0	 doc7062              	 1
+8 	 0	 doc13953             	 1
+8 	 0	 doc2227              	 1
+8 	 0	 doc20607             	 1
+8 	 0	 doc344               	 1
+8 	 0	 doc16264             	 1
+8 	 0	 doc13167             	 1
+8 	 0	 doc2896              	 1
+8 	 0	 doc11871             	 1
+8 	 0	 doc6844              	 1
+8 	 0	 doc10636             	 1
+8 	 0	 doc9670              	 1
+8 	 0	 doc10180             	 1
+8 	 0	 doc1862              	 1
+8 	 0	 doc10308             	 1
+8 	 0	 doc16728             	 1
+8 	 0	 doc15794             	 1
 
 
 # ---- m==1: precision_at_n and avg_precision are hurt, by unmarking relevant docs
 
 
-9 	 0 	 doc1990              	 0
-9 	 0 	 doc9342              	 1
-9 	 0 	 doc19427             	 1
-9 	 0 	 doc12432             	 0
-9 	 0 	 doc13480             	 1
-9 	 0 	 doc3322              	 1
-9 	 0 	 doc16044             	 1
-9 	 0 	 doc266               	 0
-9 	 0 	 doc3437              	 1
-9 	 0 	 doc5370              	 1
-9 	 0 	 doc10314             	 1
-9 	 0 	 doc4892              	 1
-9 	 0 	 doc5763              	 0
-9 	 0 	 doc14045             	 1
-9 	 0 	 doc1090              	 1
-9 	 0 	 doc7437              	 1
-9 	 0 	 doc5822              	 1
-9 	 0 	 doc4285              	 1
-9 	 0 	 doc17119             	 1
-9 	 0 	 doc21001             	 1
-9 	 0 	 doc4337              	 1
-9 	 0 	 doc5967              	 1
-9 	 0 	 doc10214             	 1
-9 	 0 	 doc12001             	 1
-9 	 0 	 doc18553             	 1
-9 	 0 	 doc12116             	 1
-9 	 0 	 doc5064              	 1
-9 	 0 	 doc5018              	 1
-9 	 0 	 doc5037              	 1
-9 	 0 	 doc8025              	 1
+9 	 0	 doc1990              	 0
+9 	 0	 doc4892              	 1
+9 	 0	 doc9342              	 1
+9 	 0	 doc12432             	 0
+9 	 0	 doc13480             	 1
+9 	 0	 doc19427             	 1
+9 	 0	 doc12116             	 1
+9 	 0	 doc5064              	 0
+9 	 0	 doc14045             	 1
+9 	 0	 doc4285              	 1
+9 	 0	 doc5822              	 1
+9 	 0	 doc3322              	 1
+9 	 0	 doc5763              	 1
+9 	 0	 doc3437              	 0
+9 	 0	 doc5370              	 1
+9 	 0	 doc10314             	 1
+9 	 0	 doc16044             	 1
+9 	 0	 doc18553             	 1
+9 	 0	 doc5037              	 1
+9 	 0	 doc7437              	 1
+9 	 0	 doc12001             	 1
+9 	 0	 doc5018              	 1
+9 	 0	 doc1090              	 1
+9 	 0	 doc266               	 1
+9 	 0	 doc17894             	 1
+9 	 0	 doc17119             	 1
+9 	 0	 doc4337              	 1
+9 	 0	 doc5967              	 1
+9 	 0	 doc10214             	 1
+9 	 0	 doc20647             	 1
 
 
 # ---- m==2: all precision, precision_at_n and recall are hurt.
@@ -384,200 +384,200 @@
 10 	 0 	 fakedoc4             	 1
 
 10	 0	 doc16087 	0
-10	 0	 doc19943 	0
-10	 0	 doc5958 	0
-10	 0	 doc6510 	0
-10	 0	 doc4354 	1
-10	 0	 doc17218 	1
-10	 0	 doc6964 	1
-10	 0	 doc10270 	1
+10	 0	 doc17218 	0
+10	 0	 doc10270 	0
+10	 0	 doc16743 	0
+10	 0	 doc19943 	1
+10	 0	 doc16729 	1
+10	 0	 doc16761 	1
+10	 0	 doc4354  	1
 10	 0	 doc18321 	1
+10	 0	 doc5958  	1
+10	 0	 doc6510  	1
+10	 0	 doc7357  	1
+10	 0	 doc2534  	1
+10	 0	 doc6964  	1
 10	 0	 doc14893 	1
-10	 0	 doc16743 	1
-10	 0	 doc7357 	1
-10	 0	 doc2534 	1
 10	 0	 doc18497 	1
-10	 0	 doc16729 	1
-10	 0	 doc16761 	1
-10	 0	 doc8933 	1
-10	 0	 doc15769 	1
 10	 0	 doc14948 	1
+10	 0	 doc8933  	1
+10	 0	 doc14935 	1
 10	 0	 doc10818 	1
+10	 0	 doc7891  	1
 10	 0	 doc11819 	1
-10	 0	 doc7891 	1
-10	 0	 doc14935 	1
+10	 0	 doc7235  	1
+10	 0	 doc15769 	1
 10	 0	 doc14954 	1
-10	 0	 doc9897 	1
-10	 0	 doc6930 	1
-10	 0	 doc7235 	1
+10	 0	 doc9897  	1
 10	 0	 doc15559 	1
-10	 0	 doc6621 	1
 10	 0	 doc11214 	1
+10	 0	 doc5348  	1
+10	 0	 doc6930  	1
 
 
 
+11	 0	 doc8593  	1
 11	 0	 doc11943 	1
-11	 0	 doc9705 	1
-11	 0	 doc286 	1
+11	 0	 doc8800  	1
+11	 0	 doc286   	1
 11	 0	 doc17916 	1
 11	 0	 doc17918 	1
-11	 0	 doc1574 	1
+11	 0	 doc9705  	1
+11	 0	 doc1574  	1
 11	 0	 doc10180 	1
-11	 0	 doc1893 	1
+11	 0	 doc9337  	1
+11	 0	 doc11869 	1
+11	 0	 doc5194  	1
 11	 0	 doc11189 	1
-11	 0	 doc8593 	1
-11	 0	 doc3188 	1
-11	 0	 doc8800 	1
-11	 0	 doc9337 	1
+11	 0	 doc1893  	1
 11	 0	 doc19213 	1
-11	 0	 doc8735 	1
-11	 0	 doc5194 	1
-11	 0	 doc3552 	1
+11	 0	 doc3188  	1
+11	 0	 doc8735  	1
+11	 0	 doc18580 	1
 11	 0	 doc16030 	1
+11	 0	 doc3552  	1
 11	 0	 doc10195 	1
+11	 0	 doc209   	1
+11	 0	 doc5792  	1
+11	 0	 doc8715  	1
 11	 0	 doc17702 	1
-11	 0	 doc209 	1
-11	 0	 doc11869 	1
-11	 0	 doc5008 	1
-11	 0	 doc5792 	1
-11	 0	 doc1990 	1
-11	 0	 doc3393 	1
+11	 0	 doc3166  	1
+11	 0	 doc1990  	1
+11	 0	 doc3393  	1
 11	 0	 doc19027 	1
-11	 0	 doc18580 	1
-11	 0	 doc8715 	1
-11	 0	 doc12753 	1
+11	 0	 doc5008  	1
 
 
 
+12	 0	 doc6544  	1
 12	 0	 doc10640 	1
-12	 0	 doc6544 	1
-12	 0	 doc4305 	1
-12	 0	 doc10760 	1
 12	 0	 doc18198 	1
-12	 0	 doc10881 	1
-12	 0	 doc128 	1
+12	 0	 doc4305  	1
+12	 0	 doc2444  	1
 12	 0	 doc12192 	1
-12	 0	 doc2444 	1
-12	 0	 doc11639 	1
-12	 0	 doc2911 	1
-12	 0	 doc1884 	1
-12	 0	 doc2698 	1
-12	 0	 doc3552 	1
+12	 0	 doc10760 	1
+12	 0	 doc10881 	1
+12	 0	 doc128   	1
+12	 0	 doc1884  	1
 12	 0	 doc18704 	1
-12	 0	 doc7652 	1
-12	 0	 doc9187 	1
-12	 0	 doc3131 	1
-12	 0	 doc2277 	1
-12	 0	 doc2589 	1
-12	 0	 doc3747 	1
-12	 0	 doc3813 	1
-12	 0	 doc5222 	1
-12	 0	 doc6023 	1
-12	 0	 doc6624 	1
-12	 0	 doc7655 	1
-12	 0	 doc9205 	1
-12	 0	 doc12062 	1
+12	 0	 doc11639 	1
+12	 0	 doc3131  	1
+12	 0	 doc2698  	1
+12	 0	 doc3552  	1
+12	 0	 doc2911  	1
+12	 0	 doc7652  	1
+12	 0	 doc20524 	1
+12	 0	 doc9187  	1
+12	 0	 doc2277  	1
 12	 0	 doc15504 	1
-12	 0	 doc16329 	1
+12	 0	 doc2589  	1
+12	 0	 doc5222  	1
+12	 0	 doc3747  	1
+12	 0	 doc6624  	1
+12	 0	 doc9205  	1
+12	 0	 doc12062 	1
+12	 0	 doc3813  	1
+12	 0	 doc6023  	1
+12	 0	 doc7655  	1
 
 
 
 13	 0	 doc16347 	1
-13	 0	 doc1866 	1
+13	 0	 doc8695  	1
+13	 0	 doc4948  	1
+13	 0	 doc8554  	1
 13	 0	 doc13431 	1
-13	 0	 doc4948 	1
+13	 0	 doc1866  	1
 13	 0	 doc13989 	1
+13	 0	 doc2100  	1
 13	 0	 doc21565 	1
-13	 0	 doc8554 	1
-13	 0	 doc8695 	1
-13	 0	 doc6764 	1
-13	 0	 doc2408 	1
-13	 0	 doc5605 	1
-13	 0	 doc42 	1
+13	 0	 doc42    	1
+13	 0	 doc2408  	1
 13	 0	 doc15794 	1
+13	 0	 doc6764  	1
+13	 0	 doc3980  	1
 13	 0	 doc17135 	1
+13	 0	 doc5605  	1
+13	 0	 doc7783  	1
+13	 0	 doc5967  	1
 13	 0	 doc14847 	1
-13	 0	 doc3980 	1
-13	 0	 doc2592 	1
-13	 0	 doc5967 	1
-13	 0	 doc2100 	1
 13	 0	 doc10947 	1
-13	 0	 doc4557 	1
-13	 0	 doc2492 	1
-13	 0	 doc7783 	1
-13	 0	 doc8025 	1
-13	 0	 doc355 	1
-13	 0	 doc17170 	1
-13	 0	 doc14595 	1
 13	 0	 doc16894 	1
-13	 0	 doc5822 	1
+13	 0	 doc355   	1
+13	 0	 doc14595 	1
+13	 0	 doc8977  	1
+13	 0	 doc2592  	1
+13	 0	 doc4557  	1
+13	 0	 doc8025  	1
+13	 0	 doc2492  	1
 13	 0	 doc11088 	1
-
-
-
-14 	 0 	 doc17172             	 1
-14 	 0 	 doc17210             	 1
-14 	 0 	 doc5044              	 1
-14 	 0 	 doc4627              	 1
-14 	 0 	 doc4683              	 1
-14 	 0 	 doc15126             	 1
-14 	 0 	 doc4538              	 1
-14 	 0 	 doc273               	 1
-14 	 0 	 doc19585             	 1
-14 	 0 	 doc16078             	 1
-14 	 0 	 doc4529              	 1
-14 	 0 	 doc4186              	 1
-14 	 0 	 doc12961             	 1
-14 	 0 	 doc19217             	 1
-14 	 0 	 doc5670              	 1
-14 	 0 	 doc1699              	 1
-14 	 0 	 doc4716              	 1
-14 	 0 	 doc12644             	 1
-14 	 0 	 doc18387             	 1
-14 	 0 	 doc336               	 1
-14 	 0 	 doc16130             	 1
-14 	 0 	 doc18718             	 1
-14 	 0 	 doc12527             	 1
-14 	 0 	 doc11797             	 1
-14 	 0 	 doc11831             	 1
-14 	 0 	 doc7538              	 1
-14 	 0 	 doc17259             	 1
-14 	 0 	 doc18724             	 1
-14 	 0 	 doc19330             	 1
-14 	 0 	 doc19206             	 1
-
-
-
-15 	 0 	 doc12198             	 1
-15 	 0 	 doc20371             	 1
-15 	 0 	 doc2947              	 1
-15 	 0 	 doc10750             	 1
-15 	 0 	 doc7239              	 1
-15 	 0 	 doc14189             	 1
-15 	 0 	 doc19474             	 1
-15 	 0 	 doc14776             	 1
-15 	 0 	 doc21270             	 1
-15 	 0 	 doc6387              	 1
-15 	 0 	 doc12908             	 1
-15 	 0 	 doc9573              	 1
-15 	 0 	 doc17102             	 1
-15 	 0 	 doc21482             	 1
-15 	 0 	 doc6524              	 1
-15 	 0 	 doc18034             	 1
-15 	 0 	 doc1358              	 1
-15 	 0 	 doc13147             	 1
-15 	 0 	 doc17731             	 1
-15 	 0 	 doc12890             	 1
-15 	 0 	 doc20887             	 1
-15 	 0 	 doc19508             	 1
-15 	 0 	 doc18498             	 1
-15 	 0 	 doc20642             	 1
-15 	 0 	 doc19878             	 1
-15 	 0 	 doc6556              	 1
-15 	 0 	 doc10272             	 1
-15 	 0 	 doc5720              	 1
-15 	 0 	 doc17578             	 1
-15 	 0 	 doc17164             	 1
+13	 0	 doc1844  	1
+
+
+
+14	 0	 doc17172             	 1
+14	 0	 doc17210             	 1
+14	 0	 doc4627              	 1
+14	 0	 doc4683              	 1
+14	 0	 doc15126             	 1
+14	 0	 doc273               	 1
+14	 0	 doc4716              	 1
+14	 0	 doc4538              	 1
+14	 0	 doc4529              	 1
+14	 0	 doc19206             	 1
+14	 0	 doc5044              	 1
+14	 0	 doc12961             	 1
+14	 0	 doc16078             	 1
+14	 0	 doc19585             	 1
+14	 0	 doc12527             	 1
+14	 0	 doc19217             	 1
+14	 0	 doc19330             	 1
+14	 0	 doc5670              	 1
+14	 0	 doc1699              	 1
+14	 0	 doc11797             	 1
+14	 0	 doc11831             	 1
+14	 0	 doc17259             	 1
+14	 0	 doc18387             	 1
+14	 0	 doc7538              	 1
+14	 0	 doc336               	 1
+14	 0	 doc18718             	 1
+14	 0	 doc4186              	 1
+14	 0	 doc18724             	 1
+14	 0	 doc18356             	 1
+14	 0	 doc12644             	 1
+
+
+
+15	 0	 doc12198             	 1
+15	 0	 doc20371             	 1
+15	 0	 doc1358              	 1
+15	 0	 doc20887             	 1
+15	 0	 doc14189             	 1
+15	 0	 doc14776             	 1
+15	 0	 doc21270             	 1
+15	 0	 doc13147             	 1
+15	 0	 doc2947              	 1
+15	 0	 doc7239              	 1
+15	 0	 doc19474             	 1
+15	 0	 doc12908             	 1
+15	 0	 doc10750             	 1
+15	 0	 doc19878             	 1
+15	 0	 doc20642             	 1
+15	 0	 doc19508             	 1
+15	 0	 doc18034             	 1
+15	 0	 doc6387              	 1
+15	 0	 doc17102             	 1
+15	 0	 doc6524              	 1
+15	 0	 doc6556              	 1
+15	 0	 doc9573              	 1
+15	 0	 doc5720              	 1
+15	 0	 doc10272             	 1
+15	 0	 doc17164             	 1
+15	 0	 doc15126             	 1
+15	 0	 doc21482             	 1
+15	 0	 doc4496              	 1
+15	 0	 doc18498             	 1
+15	 0	 doc10890             	 1
 
 
 # --- m==0: avg_precision and recall are hurt, by marking fake docs as relevant
@@ -587,65 +587,70 @@
 16 	 0 	 fakedoc3             	 1
 16 	 0 	 fakedoc4             	 1
 
-16	 0	 doc4043 	1
-16	 0	 doc15370 	1
+16	 0	 doc4043  	1
 16	 0	 doc15426 	1
-16	 0	 doc1702 	1
+16	 0	 doc15370 	1
+16	 0	 doc1702  	1
+16	 0	 doc3446  	1
+16	 0	 doc3062  	1
 16	 0	 doc14985 	1
-16	 0	 doc3446 	1
+16	 0	 doc8224  	1
 16	 0	 doc16609 	1
+16	 0	 doc19032 	1
+16	 0	 doc7228  	1
 16	 0	 doc16134 	1
-16	 0	 doc3062 	1
-16	 0	 doc8224 	1
+16	 0	 doc5044  	1
 16	 0	 doc16493 	1
-16	 0	 doc15037 	1
+16	 0	 doc8545  	1
 16	 0	 doc12686 	1
-16	 0	 doc1710 	1
-16	 0	 doc19032 	1
-16	 0	 doc8545 	1
-16	 0	 doc5044 	1
-16	 0	 doc17894 	1
-16	 0	 doc7228 	1
-16	 0	 doc7373 	1
-16	 0	 doc9064 	1
-16	 0	 doc13161 	1
-16	 0	 doc3166 	1
+16	 0	 doc1710  	1
+16	 0	 doc15037 	1
+16	 0	 doc9064  	1
 16	 0	 doc19297 	1
+16	 0	 doc3281  	1
+16	 0	 doc3166  	1
 16	 0	 doc15499 	1
+16	 0	 doc17894 	1
+16	 0	 doc13161 	1
+16	 0	 doc13619 	1
+16	 0	 doc7373  	1
+16	 0	 doc15411 	1
+16	 0	 doc10890 	1
+16	 0	 doc8977  	1
 
 
 # --- m==1: precision_at_n and avg_precision are hurt, by unmarking relevant docs
 
-17 	 0 	 doc3117              	 0
-17 	 0 	 doc7477              	 0
-17 	 0 	 doc7569              	 0
-17 	 0 	 doc20667             	 0
-17 	 0 	 doc20260             	 1
-17 	 0 	 doc17355             	 1
-17 	 0 	 doc11021             	 1
-17 	 0 	 doc20934             	 1
-17 	 0 	 doc552               	 1
-17 	 0 	 doc20856             	 1
-17 	 0 	 doc3524              	 1
-17 	 0 	 doc17343             	 1
-17 	 0 	 doc21055             	 1
-17 	 0 	 doc19032             	 1
-17 	 0 	 doc19786             	 1
-17 	 0 	 doc9281              	 1
-17 	 0 	 doc1695              	 1
-17 	 0 	 doc15940             	 1
-17 	 0 	 doc9215              	 1
-17 	 0 	 doc8335              	 1
-17 	 0 	 doc20936             	 1
-17 	 0 	 doc6914              	 1
-17 	 0 	 doc12122             	 1
-17 	 0 	 doc6618              	 1
-17 	 0 	 doc5049              	 1
-17 	 0 	 doc450               	 1
-17 	 0 	 doc19206             	 1
-17 	 0 	 doc18823             	 1
-17 	 0 	 doc5307              	 1
-17 	 0 	 doc17295             	 1
+17	 0	 doc7477              	 0
+17	 0	 doc7569              	 0
+17	 0	 doc3117              	 0
+17	 0	 doc20667             	 0
+17	 0	 doc20260             	 1
+17	 0	 doc20934             	 1
+17	 0	 doc17355             	 1
+17	 0	 doc3524              	 1
+17	 0	 doc11021             	 1
+17	 0	 doc552               	 1
+17	 0	 doc21055             	 1
+17	 0	 doc19032             	 1
+17	 0	 doc1695              	 1
+17	 0	 doc12122             	 1
+17	 0	 doc20856             	 1
+17	 0	 doc9215              	 1
+17	 0	 doc15940             	 1
+17	 0	 doc5049              	 1
+17	 0	 doc19786             	 1
+17	 0	 doc9281              	 1
+17	 0	 doc450               	 1
+17	 0	 doc17343             	 1
+17	 0	 doc20936             	 1
+17	 0	 doc8335              	 1
+17	 0	 doc5307              	 1
+17	 0	 doc6618              	 1
+17	 0	 doc1168              	 1
+17	 0	 doc18823             	 1
+17	 0	 doc19206             	 1
+17	 0	 doc6914              	 1
 
 
 # ---- m==2: all precision, precision_at_n and recall are hurt.
@@ -655,61 +660,66 @@
 18 	 0 	 fakedoc3             	 1
 18 	 0 	 fakedoc4             	 1
 
-18 	 0 	 doc8064              	 0
-18 	 0 	 doc18142             	 0
-18 	 0 	 doc19383             	 0
-18 	 0 	 doc21151             	 0
-18 	 0 	 doc4665              	 1
-18 	 0 	 doc2897              	 1
-18 	 0 	 doc6878              	 1
-18 	 0 	 doc14507             	 1
-18 	 0 	 doc2976              	 1
-18 	 0 	 doc11757             	 1
-18 	 0 	 doc12625             	 1
-18 	 0 	 doc14908             	 1
-18 	 0 	 doc12790             	 1
-18 	 0 	 doc17915             	 1
-18 	 0 	 doc11804             	 1
-18 	 0 	 doc12935             	 1
-18 	 0 	 doc8225              	 1
-18 	 0 	 doc18011             	 1
-18 	 0 	 doc10493             	 1
-18 	 0 	 doc17922             	 1
-18 	 0 	 doc1902              	 1
-18 	 0 	 doc14049             	 1
-18 	 0 	 doc1334              	 1
-18 	 0 	 doc1168              	 1
-18 	 0 	 doc4859              	 1
-18 	 0 	 doc7124              	 1
-18 	 0 	 doc9692              	 1
-18 	 0 	 doc18402             	 1
-18 	 0 	 doc9089              	 1
-18 	 0 	 doc15375             	 1
-
-
-
-19	 0	 doc2310 	1
-19	 0	 doc5267 	1
+18	 0	 doc8064              	 0
+18	 0	 doc18142             	 0
+18	 0	 doc19383             	 0
+18	 0	 doc2897              	 0
+18	 0	 doc21151             	 1
+18	 0	 doc14507             	 1
+18	 0	 doc12935             	 1
+18	 0	 doc12790             	 1
+18	 0	 doc4665              	 1
+18	 0	 doc10493             	 1
+18	 0	 doc2976              	 1
+18	 0	 doc18011             	 1
+18	 0	 doc1334              	 1
+18	 0	 doc14908             	 1
+18	 0	 doc1168              	 1
+18	 0	 doc15375             	 1
+18	 0	 doc18402             	 1
+18	 0	 doc8225              	 1
+18	 0	 doc11757             	 1
+18	 0	 doc11804             	 1
+18	 0	 doc6878              	 1
+18	 0	 doc12625             	 1
+18	 0	 doc4859              	 1
+18	 0	 doc5348              	 1
+18	 0	 doc9089              	 1
+18	 0	 doc14049             	 1
+18	 0	 doc17922             	 1
+18	 0	 doc1902              	 1
+18	 0	 doc17915             	 1
+18	 0	 doc7124              	 1
+
+
+
+19	 0	 doc2310  	1
+19	 0	 doc5267  	1
 19	 0	 doc15666 	1
-19	 0	 doc10803 	1
-19	 0	 doc4900 	1
+19	 0	 doc7925  	1
+19	 0	 doc4900  	1
 19	 0	 doc11435 	1
-19	 0	 doc7925 	1
-19	 0	 doc7652 	1
+19	 0	 doc10803 	1
+19	 0	 doc7652  	1
+19	 0	 doc19546 	1
 19	 0	 doc18561 	1
+19	 0	 doc9163  	1
+19	 0	 doc8869  	1
 19	 0	 doc12733 	1
+19	 0	 doc2444  	1
+19	 0	 doc7194  	1
 19	 0	 doc10634 	1
-19	 0	 doc19546 	1
-19	 0	 doc7194 	1
-19	 0	 doc529 	1
-19	 0	 doc9163 	1
-19	 0	 doc8869 	1
-19	 0	 doc2444 	1
-19	 0	 doc5605 	1
-19	 0	 doc5051 	1
-19	 0	 doc10881 	1
-19	 0	 doc4496 	1
-19	 0	 doc3979 	1
-19	 0	 doc8419 	1
-19	 0	 doc9431 	1
+19	 0	 doc529   	1
+19	 0	 doc8419  	1
 19	 0	 doc16235 	1
+19	 0	 doc4496  	1
+19	 0	 doc5051  	1
+19	 0	 doc5605  	1
+19	 0	 doc3979  	1
+19	 0	 doc9431  	1
+19	 0	 doc10881 	1
+19	 0	 doc12527 	1
+19	 0	 doc4804  	1
+19	 0	 doc4494  	1
+19	 0	 doc8833  	1
+19	 0	 doc732   	1

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
index ba65629..ca384ae 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
@@ -603,7 +603,7 @@ final class DefaultIndexingChain extends DocConsumer {
       // PerField.invert to allow for later downgrading of the index options:
       fi.setIndexOptions(fieldType.indexOptions());
       
-      fp = new PerField(fi, invert);
+      fp = new PerField(docWriter.getIndexCreatedVersionMajor(), fi, invert);
       fp.next = fieldHash[hashPos];
       fieldHash[hashPos] = fp;
       totalFieldCount++;
@@ -633,6 +633,7 @@ final class DefaultIndexingChain extends DocConsumer {
   /** NOTE: not static: accesses at least docState, termsHash. */
   private final class PerField implements Comparable<PerField> {
 
+    final int indexCreatedVersionMajor;
     final FieldInfo fieldInfo;
     final Similarity similarity;
 
@@ -659,7 +660,8 @@ final class DefaultIndexingChain extends DocConsumer {
     // reused
     TokenStream tokenStream;
 
-    public PerField(FieldInfo fieldInfo, boolean invert) {
+    public PerField(int indexCreatedVersionMajor, FieldInfo fieldInfo, boolean invert) {
+      this.indexCreatedVersionMajor = indexCreatedVersionMajor;
       this.fieldInfo = fieldInfo;
       similarity = docState.similarity;
       if (invert) {
@@ -668,7 +670,7 @@ final class DefaultIndexingChain extends DocConsumer {
     }
 
     void setInvertState() {
-      invertState = new FieldInvertState(fieldInfo.name);
+      invertState = new FieldInvertState(indexCreatedVersionMajor, fieldInfo.name);
       termsHashPerField = termsHash.addField(invertState, fieldInfo);
       if (fieldInfo.omitsNorms() == false) {
         assert norms == null;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
index ed50650..c929ba2 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
@@ -193,6 +193,10 @@ class DocumentsWriterPerThread {
     return fieldInfos;
   }
 
+  public int getIndexCreatedVersionMajor() {
+    return indexWriter.segmentInfos.getIndexCreatedVersionMajor();
+  }
+
   final void testPoint(String message) {
     if (enableTestPoints) {
       assert infoStream.isEnabled("TP"); // don't enable unless you need them.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/java/org/apache/lucene/index/FieldInvertState.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/FieldInvertState.java b/lucene/core/src/java/org/apache/lucene/index/FieldInvertState.java
index 1da02b2..f93edde 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FieldInvertState.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FieldInvertState.java
@@ -31,7 +31,8 @@ import org.apache.lucene.util.AttributeSource;
  * @lucene.experimental
  */
 public final class FieldInvertState {
-  String name;
+  final int indexCreatedVersionMajor;
+  final String name;
   int position;
   int length;
   int numOverlap;
@@ -50,14 +51,15 @@ public final class FieldInvertState {
 
   /** Creates {code FieldInvertState} for the specified
    *  field name. */
-  public FieldInvertState(String name) {
+  public FieldInvertState(int indexCreatedVersionMajor, String name) {
+    this.indexCreatedVersionMajor = indexCreatedVersionMajor;
     this.name = name;
   }
   
   /** Creates {code FieldInvertState} for the specified
    *  field name and values for all fields. */
-  public FieldInvertState(String name, int position, int length, int numOverlap, int offset) {
-    this.name = name;
+  public FieldInvertState(int indexCreatedVersionMajor, String name, int position, int length, int numOverlap, int offset) {
+    this(indexCreatedVersionMajor, name);
     this.position = position;
     this.length = length;
     this.numOverlap = numOverlap;
@@ -164,4 +166,11 @@ public final class FieldInvertState {
   public String getName() {
     return name;
   }
+
+  /**
+   * Return the version that was used to create the index, or 6 if it was created before 7.0.
+   */
+  public int getIndexCreatedVersionMajor() {
+    return indexCreatedVersionMajor;
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java
index 74978fd..e693b2b 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java
@@ -96,20 +96,6 @@ public class BM25Similarity extends Similarity {
     }
   }
   
-  /** The default implementation encodes <code>1 / sqrt(length)</code>
-   * with {@link SmallFloat#floatToByte315(float)}.  This is compatible with 
-   * Lucene's historic implementation: {@link ClassicSimilarity}.  If you
-   * change this, then you should change {@link #decodeNormValue(byte)} to match. */
-  protected byte encodeNormValue(int fieldLength) {
-    return SmallFloat.floatToByte315((float) (1 / Math.sqrt(fieldLength)));
-  }
-
-  /** The default implementation returns <code>1 / f<sup>2</sup></code>
-   * where <code>f</code> is {@link SmallFloat#byte315ToFloat(byte)}. */
-  protected float decodeNormValue(byte b) {
-    return NORM_TABLE[b & 0xFF];
-  }
-  
   /** 
    * True if overlap tokens (tokens with a position of increment of zero) are
    * discounted from the document's length.
@@ -132,21 +118,31 @@ public class BM25Similarity extends Similarity {
   }
   
   /** Cache of decoded bytes. */
-  private static final float[] NORM_TABLE = new float[256];
+  private static final float[] OLD_LENGTH_TABLE = new float[256];
+  private static final float[] LENGTH_TABLE = new float[256];
 
   static {
     for (int i = 1; i < 256; i++) {
       float f = SmallFloat.byte315ToFloat((byte)i);
-      NORM_TABLE[i] = 1.0f / (f*f);
+      OLD_LENGTH_TABLE[i] = 1.0f / (f*f);
+    }
+    OLD_LENGTH_TABLE[0] = 1.0f / OLD_LENGTH_TABLE[255]; // otherwise inf
+
+    for (int i = 0; i < 256; i++) {
+      LENGTH_TABLE[i] = SmallFloat.byte4ToInt((byte) i);
     }
-    NORM_TABLE[0] = 1.0f / NORM_TABLE[255]; // otherwise inf
   }
 
 
   @Override
   public final long computeNorm(FieldInvertState state) {
     final int numTerms = discountOverlaps ? state.getLength() - state.getNumOverlap() : state.getLength();
-    return encodeNormValue(numTerms);
+    int indexCreatedVersionMajor = state.getIndexCreatedVersionMajor();
+    if (indexCreatedVersionMajor >= 7) {
+      return SmallFloat.intToByte4(numTerms);
+    } else {
+      return SmallFloat.floatToByte315((float) (1 / Math.sqrt(numTerms)));
+    }
   }
 
   /**
@@ -207,34 +203,43 @@ public class BM25Similarity extends Similarity {
   @Override
   public final SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
     Explanation idf = termStats.length == 1 ? idfExplain(collectionStats, termStats[0]) : idfExplain(collectionStats, termStats);
-
     float avgdl = avgFieldLength(collectionStats);
 
-    // compute freq-independent part of bm25 equation across all norm values
-    float cache[] = new float[256];
+    float[] oldCache = new float[256];
+    float[] cache = new float[256];
     for (int i = 0; i < cache.length; i++) {
-      cache[i] = k1 * ((1 - b) + b * decodeNormValue((byte)i) / avgdl);
+      oldCache[i] = k1 * ((1 - b) + b * OLD_LENGTH_TABLE[i] / avgdl);
+      cache[i] = k1 * ((1 - b) + b * LENGTH_TABLE[i] / avgdl);
     }
-    return new BM25Stats(collectionStats.field(), boost, idf, avgdl, cache);
+    return new BM25Stats(collectionStats.field(), boost, idf, avgdl, oldCache, cache);
   }
 
   @Override
   public final SimScorer simScorer(SimWeight stats, LeafReaderContext context) throws IOException {
     BM25Stats bm25stats = (BM25Stats) stats;
-    return new BM25DocScorer(bm25stats, context.reader().getNormValues(bm25stats.field));
+    return new BM25DocScorer(bm25stats, context.reader().getMetaData().getCreatedVersionMajor(), context.reader().getNormValues(bm25stats.field));
   }
   
   private class BM25DocScorer extends SimScorer {
     private final BM25Stats stats;
     private final float weightValue; // boost * idf * (k1 + 1)
     private final NumericDocValues norms;
+    /** precomputed cache for all length values */
+    private final float[] lengthCache;
+    /** precomputed norm[256] with k1 * ((1 - b) + b * dl / avgdl) */
     private final float[] cache;
     
-    BM25DocScorer(BM25Stats stats, NumericDocValues norms) throws IOException {
+    BM25DocScorer(BM25Stats stats, int indexCreatedVersionMajor, NumericDocValues norms) throws IOException {
       this.stats = stats;
       this.weightValue = stats.weight * (k1 + 1);
-      this.cache = stats.cache;
       this.norms = norms;
+      if (indexCreatedVersionMajor >= 7) {
+        lengthCache = LENGTH_TABLE;
+        cache = stats.cache;
+      } else {
+        lengthCache = OLD_LENGTH_TABLE;
+        cache = stats.oldCache;
+      }
     }
     
     @Override
@@ -245,7 +250,7 @@ public class BM25Similarity extends Similarity {
         norm = k1;
       } else {
         if (norms.advanceExact(doc)) {
-          norm = cache[(byte)norms.longValue() & 0xFF];
+          norm = cache[((byte) norms.longValue()) & 0xFF];
         } else {
           norm = cache[0];
         }
@@ -255,7 +260,7 @@ public class BM25Similarity extends Similarity {
     
     @Override
     public Explanation explain(int doc, Explanation freq) throws IOException {
-      return explainScore(doc, freq, stats, norms);
+      return explainScore(doc, freq, stats, norms, lengthCache);
     }
 
     @Override
@@ -281,21 +286,23 @@ public class BM25Similarity extends Similarity {
     private final float weight;
     /** field name, for pulling norms */
     private final String field;
-    /** precomputed norm[256] with k1 * ((1 - b) + b * dl / avgdl) */
-    private final float cache[];
+    /** precomputed norm[256] with k1 * ((1 - b) + b * dl / avgdl)
+     *  for both OLD_LENGTH_TABLE and LENGTH_TABLE */
+    private final float[] oldCache, cache;
 
-    BM25Stats(String field, float boost, Explanation idf, float avgdl, float cache[]) {
+    BM25Stats(String field, float boost, Explanation idf, float avgdl, float[] oldCache, float[] cache) {
       this.field = field;
       this.boost = boost;
       this.idf = idf;
       this.avgdl = avgdl;
-      this.cache = cache;
       this.weight = idf.getValue() * boost;
+      this.oldCache = oldCache;
+      this.cache = cache;
     }
 
   }
 
-  private Explanation explainTFNorm(int doc, Explanation freq, BM25Stats stats, NumericDocValues norms) throws IOException {
+  private Explanation explainTFNorm(int doc, Explanation freq, BM25Stats stats, NumericDocValues norms, float[] lengthCache) throws IOException {
     List<Explanation> subs = new ArrayList<>();
     subs.add(freq);
     subs.add(Explanation.match(k1, "parameter k1"));
@@ -311,7 +318,7 @@ public class BM25Similarity extends Similarity {
       } else {
         norm = 0;
       }
-      float doclen = decodeNormValue(norm);
+      float doclen = lengthCache[norm & 0xff];
       subs.add(Explanation.match(b, "parameter b"));
       subs.add(Explanation.match(stats.avgdl, "avgFieldLength"));
       subs.add(Explanation.match(doclen, "fieldLength"));
@@ -321,13 +328,13 @@ public class BM25Similarity extends Similarity {
     }
   }
 
-  private Explanation explainScore(int doc, Explanation freq, BM25Stats stats, NumericDocValues norms) throws IOException {
+  private Explanation explainScore(int doc, Explanation freq, BM25Stats stats, NumericDocValues norms, float[] lengthCache) throws IOException {
     Explanation boostExpl = Explanation.match(stats.boost, "boost");
     List<Explanation> subs = new ArrayList<>();
     if (boostExpl.getValue() != 1.0f)
       subs.add(boostExpl);
     subs.add(stats.idf);
-    Explanation tfNormExpl = explainTFNorm(doc, freq, stats, norms);
+    Explanation tfNormExpl = explainTFNorm(doc, freq, stats, norms, lengthCache);
     subs.add(tfNormExpl);
     return Explanation.match(
         boostExpl.getValue() * stats.idf.getValue() * tfNormExpl.getValue(),

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java
index f56575f..c3d36c3 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java
@@ -17,91 +17,27 @@
 package org.apache.lucene.search.similarities;
 
 
-import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.search.CollectionStatistics;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.TermStatistics;
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.SmallFloat;
 
 /**
- * Expert: Default scoring implementation which {@link #encodeNormValue(float)
- * encodes} norm values as a single byte before being stored. At search time,
- * the norm byte value is read from the index
- * {@link org.apache.lucene.store.Directory directory} and
- * {@link #decodeNormValue(long) decoded} back to a float <i>norm</i> value.
- * This encoding/decoding, while reducing index size, comes with the price of
- * precision loss - it is not guaranteed that <i>decode(encode(x)) = x</i>. For
- * instance, <i>decode(encode(0.89)) = 0.875</i>.
- * <p>
- * Compression of norm values to a single byte saves memory at search time,
- * because once a field is referenced at search time, its norms - for all
- * documents - are maintained in memory.
- * <p>
- * The rationale supporting such lossy compression of norm values is that given
- * the difficulty (and inaccuracy) of users to express their true information
- * need by a query, only big differences matter. <br>
- * &nbsp;<br>
- * Last, note that search time is too late to modify this <i>norm</i> part of
- * scoring, e.g. by using a different {@link Similarity} for search.
+ * Expert: Historical scoring implementation. You might want to consider using
+ * {@link BM25Similarity} instead, which is generally considered superior to
+ * TF-IDF.
  */
 public class ClassicSimilarity extends TFIDFSimilarity {
-  
-  /** Cache of decoded bytes. */
-  private static final float[] NORM_TABLE = new float[256];
-
-  static {
-    for (int i = 0; i < 256; i++) {
-      NORM_TABLE[i] = SmallFloat.byte315ToFloat((byte)i);
-    }
-  }
 
   /** Sole constructor: parameter-free */
   public ClassicSimilarity() {}
-  
-  /**
-   * Encodes a normalization factor for storage in an index.
-   * <p>
-   * The encoding uses a three-bit mantissa, a five-bit exponent, and the
-   * zero-exponent point at 15, thus representing values from around 7x10^9 to
-   * 2x10^-9 with about one significant decimal digit of accuracy. Zero is also
-   * represented. Negative numbers are rounded up to zero. Values too large to
-   * represent are rounded down to the largest representable value. Positive
-   * values too small to represent are rounded up to the smallest positive
-   * representable value.
-   *
-   * @see org.apache.lucene.util.SmallFloat
-   */
-  @Override
-  public final long encodeNormValue(float f) {
-    return SmallFloat.floatToByte315(f);
-  }
-
-  /**
-   * Decodes the norm value, assuming it is a single byte.
-   * 
-   * @see #encodeNormValue(float)
-   */
-  @Override
-  public final float decodeNormValue(long norm) {
-    return NORM_TABLE[(int) (norm & 0xFF)];  // & 0xFF maps negative bytes to positive above 127
-  }
 
   /** Implemented as
-   *  <code>state.getBoost()*lengthNorm(numTerms)</code>, where
-   *  <code>numTerms</code> is {@link FieldInvertState#getLength()} if {@link
-   *  #setDiscountOverlaps} is false, else it's {@link
-   *  FieldInvertState#getLength()} - {@link
-   *  FieldInvertState#getNumOverlap()}.
+   *  <code>1/sqrt(length)</code>.
    *
    *  @lucene.experimental */
   @Override
-  public float lengthNorm(FieldInvertState state) {
-    final int numTerms;
-    if (discountOverlaps)
-      numTerms = state.getLength() - state.getNumOverlap();
-    else
-      numTerms = state.getLength();
+  public float lengthNorm(int numTerms) {
     return (float) (1.0 / Math.sqrt(numTerms));
   }
 
@@ -138,33 +74,6 @@ public class ClassicSimilarity extends TFIDFSimilarity {
   public float idf(long docFreq, long docCount) {
     return (float)(Math.log((docCount+1)/(double)(docFreq+1)) + 1.0);
   }
-    
-  /** 
-   * True if overlap tokens (tokens with a position of increment of zero) are
-   * discounted from the document's length.
-   */
-  protected boolean discountOverlaps = true;
-
-  /** Determines whether overlap tokens (Tokens with
-   *  0 position increment) are ignored when computing
-   *  norm.  By default this is true, meaning overlap
-   *  tokens do not count when computing norms.
-   *
-   *  @lucene.experimental
-   *
-   *  @see #computeNorm
-   */
-  public void setDiscountOverlaps(boolean v) {
-    discountOverlaps = v;
-  }
-
-  /**
-   * Returns true if overlap tokens are discounted from the document's length. 
-   * @see #setDiscountOverlaps 
-   */
-  public boolean getDiscountOverlaps() {
-    return discountOverlaps;
-  }
 
   @Override
   public String toString() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java b/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java
index dbf8d45..fb34f07 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java
@@ -190,7 +190,8 @@ public abstract class SimilarityBase extends Similarity {
   }
   
   @Override
-  public SimScorer simScorer(SimWeight stats, LeafReaderContext context) throws IOException {
+  public final SimScorer simScorer(SimWeight stats, LeafReaderContext context) throws IOException {
+    int indexCreatedVersionMajor = context.reader().getMetaData().getCreatedVersionMajor();
     if (stats instanceof MultiSimilarity.MultiStats) {
       // a multi term query (e.g. phrase). return the summation, 
       // scoring almost as if it were boolean query
@@ -198,12 +199,12 @@ public abstract class SimilarityBase extends Similarity {
       SimScorer subScorers[] = new SimScorer[subStats.length];
       for (int i = 0; i < subScorers.length; i++) {
         BasicStats basicstats = (BasicStats) subStats[i];
-        subScorers[i] = new BasicSimScorer(basicstats, context.reader().getNormValues(basicstats.field));
+        subScorers[i] = new BasicSimScorer(basicstats, indexCreatedVersionMajor, context.reader().getNormValues(basicstats.field));
       }
       return new MultiSimilarity.MultiSimScorer(subScorers);
     } else {
       BasicStats basicstats = (BasicStats) stats;
-      return new BasicSimScorer(basicstats, context.reader().getNormValues(basicstats.field));
+      return new BasicSimScorer(basicstats, indexCreatedVersionMajor, context.reader().getNormValues(basicstats.field));
     }
   }
   
@@ -216,40 +217,38 @@ public abstract class SimilarityBase extends Similarity {
 
   // ------------------------------ Norm handling ------------------------------
   
-  /** Norm to document length map. */
-  private static final float[] NORM_TABLE = new float[256];
+  /** Cache of decoded bytes. */
+  private static final float[] OLD_LENGTH_TABLE = new float[256];
+  private static final float[] LENGTH_TABLE = new float[256];
 
   static {
     for (int i = 1; i < 256; i++) {
-      float floatNorm = SmallFloat.byte315ToFloat((byte)i);
-      NORM_TABLE[i] = 1.0f / (floatNorm * floatNorm);
+      float f = SmallFloat.byte315ToFloat((byte)i);
+      OLD_LENGTH_TABLE[i] = 1.0f / (f*f);
+    }
+    OLD_LENGTH_TABLE[0] = 1.0f / OLD_LENGTH_TABLE[255]; // otherwise inf
+
+    for (int i = 0; i < 256; i++) {
+      LENGTH_TABLE[i] = SmallFloat.byte4ToInt((byte) i);
     }
-    NORM_TABLE[0] = 1.0f / NORM_TABLE[255]; // otherwise inf
   }
 
-  /** Encodes the document length in the same way as {@link TFIDFSimilarity}. */
+  /** Encodes the document length in the same way as {@link BM25Similarity}. */
   @Override
-  public long computeNorm(FieldInvertState state) {
-    final float numTerms;
+  public final long computeNorm(FieldInvertState state) {
+    final int numTerms;
     if (discountOverlaps)
       numTerms = state.getLength() - state.getNumOverlap();
     else
       numTerms = state.getLength();
-    return encodeNormValue(numTerms);
-  }
-  
-  /** Decodes a normalization factor (document length) stored in an index.
-   * @see #encodeNormValue(float)
-   */
-  protected float decodeNormValue(byte norm) {
-    return NORM_TABLE[norm & 0xFF];  // & 0xFF maps negative bytes to positive above 127
-  }
-  
-  /** Encodes the length to a byte via SmallFloat. */
-  protected byte encodeNormValue(float length) {
-    return SmallFloat.floatToByte315((float) (1 / Math.sqrt(length)));
+    int indexCreatedVersionMajor = state.getIndexCreatedVersionMajor();
+    if (indexCreatedVersionMajor >= 7) {
+      return SmallFloat.intToByte4(numTerms);
+    } else {
+      return SmallFloat.floatToByte315((float) (1 / Math.sqrt(numTerms)));
+    }
   }
-  
+
   // ----------------------------- Static methods ------------------------------
   
   /** Returns the base two logarithm of {@code x}. */
@@ -266,35 +265,37 @@ public abstract class SimilarityBase extends Similarity {
    * {@link SimilarityBase#explain(BasicStats, int, Explanation, float)},
    * respectively.
    */
-  private class BasicSimScorer extends SimScorer {
+  final class BasicSimScorer extends SimScorer {
     private final BasicStats stats;
     private final NumericDocValues norms;
+    private final float[] normCache;
     
-    BasicSimScorer(BasicStats stats, NumericDocValues norms) throws IOException {
+    BasicSimScorer(BasicStats stats, int indexCreatedVersionMajor, NumericDocValues norms) throws IOException {
       this.stats = stats;
       this.norms = norms;
+      this.normCache = indexCreatedVersionMajor >= 7 ? LENGTH_TABLE : OLD_LENGTH_TABLE;
     }
 
-    private float getNormValue(int doc) throws IOException {
+    float getLengthValue(int doc) throws IOException {
       if (norms == null) {
         return 1F;
       }
       if (norms.advanceExact(doc)) {
-        return decodeNormValue((byte) norms.longValue());
+        return normCache[Byte.toUnsignedInt((byte) norms.longValue())];
       } else {
-        return decodeNormValue((byte) 0);
+        return 0;
       }
     }
     
     @Override
     public float score(int doc, float freq) throws IOException {
       // We have to supply something in case norms are omitted
-      return SimilarityBase.this.score(stats, freq, getNormValue(doc));
+      return SimilarityBase.this.score(stats, freq, getLengthValue(doc));
     }
 
     @Override
     public Explanation explain(int doc, Explanation freq) throws IOException {
-      return SimilarityBase.this.explain(stats, doc, freq, getNormValue(doc));
+      return SimilarityBase.this.explain(stats, doc, freq, getLengthValue(doc));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java
index 2246561..14b3c3f 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java
@@ -30,6 +30,7 @@ import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.TermStatistics;
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.SmallFloat;
 
 
 /**
@@ -233,11 +234,6 @@ import org.apache.lucene.util.BytesRef;
  *   And this is exactly what normalizing the query vector <i>V(q)</i>
  *   provides: comparability (to a certain extent) of two or more queries.
  *   </li>
- *
- *   <li>Applying query normalization on the scores helps to keep the
- *   scores around the unit vector, hence preventing loss of score data
- *   because of floating point precision limitations.
- *   </li>
  *  </ul>
  *  </li>
  *
@@ -379,13 +375,49 @@ import org.apache.lucene.util.BytesRef;
  * @see IndexSearcher#setSimilarity(Similarity)
  */
 public abstract class TFIDFSimilarity extends Similarity {
-  
+
+  /** Cache of decoded bytes. */
+  static final float[] OLD_NORM_TABLE = new float[256];
+
+  static {
+    for (int i = 0; i < 256; i++) {
+      OLD_NORM_TABLE[i] = SmallFloat.byte315ToFloat((byte)i);
+    }
+  }
+
   /**
    * Sole constructor. (For invocation by subclass 
    * constructors, typically implicit.)
    */
   public TFIDFSimilarity() {}
-  
+
+  /** 
+   * True if overlap tokens (tokens with a position of increment of zero) are
+   * discounted from the document's length.
+   */
+  protected boolean discountOverlaps = true;
+
+  /** Determines whether overlap tokens (Tokens with
+   *  0 position increment) are ignored when computing
+   *  norm.  By default this is true, meaning overlap
+   *  tokens do not count when computing norms.
+   *
+   *  @lucene.experimental
+   *
+   *  @see #computeNorm
+   */
+  public void setDiscountOverlaps(boolean v) {
+    discountOverlaps = v;
+  }
+
+  /**
+   * Returns true if overlap tokens are discounted from the document's length. 
+   * @see #setDiscountOverlaps 
+   */
+  public boolean getDiscountOverlaps() {
+    return discountOverlaps;
+  }
+
   /** Computes a score factor based on a term or phrase's frequency in a
    * document.  This value is multiplied by the {@link #idf(long, long)}
    * factor for each term in the query and these products are then summed to
@@ -471,30 +503,25 @@ public abstract class TFIDFSimilarity extends Similarity {
 
   /**
    * Compute an index-time normalization value for this field instance.
-   * <p>
-   * This value will be stored in a single byte lossy representation by 
-   * {@link #encodeNormValue(float)}.
    * 
-   * @param state statistics of the current field (such as length, boost, etc)
-   * @return an index-time normalization value
+   * @param length the number of terms in the field, optionally {@link #setDiscountOverlaps(boolean) discounting overlaps}
+   * @return a length normalization value
    */
-  public abstract float lengthNorm(FieldInvertState state);
+  public abstract float lengthNorm(int length);
   
   @Override
   public final long computeNorm(FieldInvertState state) {
-    float normValue = lengthNorm(state);
-    return encodeNormValue(normValue);
+    final int numTerms;
+    if (discountOverlaps)
+      numTerms = state.getLength() - state.getNumOverlap();
+    else
+      numTerms = state.getLength();
+    if (state.getIndexCreatedVersionMajor() >= 7) {
+      return SmallFloat.intToByte4(numTerms);
+    } else {
+      return SmallFloat.floatToByte315(lengthNorm(numTerms));
+    }
   }
-  
-  /**
-   * Decodes a normalization factor stored in an index.
-   * 
-   * @see #encodeNormValue(float)
-   */
-  public abstract float decodeNormValue(long norm);
-
-  /** Encodes a normalization factor for storage in an index. */
-  public abstract long encodeNormValue(float f);
  
   /** Computes the amount of a sloppy phrase match, based on an edit distance.
    * This value is summed for each sloppy phrase match in a document to form
@@ -529,24 +556,41 @@ public abstract class TFIDFSimilarity extends Similarity {
     final Explanation idf = termStats.length == 1
     ? idfExplain(collectionStats, termStats[0])
     : idfExplain(collectionStats, termStats);
-    return new IDFStats(collectionStats.field(), boost, idf);
+    float[] normTable = new float[256];
+    for (int i = 1; i < 256; ++i) {
+      int length = SmallFloat.byte4ToInt((byte) i);
+      float norm = lengthNorm(length);
+      normTable[i] = norm;
+    }
+    normTable[0] = 1f / normTable[255];
+    return new IDFStats(collectionStats.field(), boost, idf, normTable);
   }
 
   @Override
   public final SimScorer simScorer(SimWeight stats, LeafReaderContext context) throws IOException {
     IDFStats idfstats = (IDFStats) stats;
-    return new TFIDFSimScorer(idfstats, context.reader().getNormValues(idfstats.field));
+    final float[] normTable;
+    if (context.reader().getMetaData().getCreatedVersionMajor() >= 7) {
+      // the norms only encode the length, we need a translation table that depends on how lengthNorm is implemented
+      normTable = idfstats.normTable;
+    } else {
+      // the norm is directly encoded in the index
+      normTable = OLD_NORM_TABLE;
+    }
+    return new TFIDFSimScorer(idfstats, context.reader().getNormValues(idfstats.field), normTable);
   }
   
   private final class TFIDFSimScorer extends SimScorer {
     private final IDFStats stats;
     private final float weightValue;
     private final NumericDocValues norms;
+    private final float[] normTable;
     
-    TFIDFSimScorer(IDFStats stats, NumericDocValues norms) throws IOException {
+    TFIDFSimScorer(IDFStats stats, NumericDocValues norms, float[] normTable) throws IOException {
       this.stats = stats;
       this.weightValue = stats.queryWeight;
       this.norms = norms;
+      this.normTable = normTable;
     }
     
     @Override
@@ -556,13 +600,13 @@ public abstract class TFIDFSimilarity extends Similarity {
       if (norms == null) {
         return raw;
       } else {
-        long normValue;
+        float normValue;
         if (norms.advanceExact(doc)) {
-          normValue = norms.longValue();
+          normValue = normTable[(int) (norms.longValue() & 0xFF)];
         } else {
           normValue = 0;
         }
-        return raw * decodeNormValue(normValue);  // normalize for field
+        return raw * normValue;  // normalize for field
       }
     }
     
@@ -578,35 +622,39 @@ public abstract class TFIDFSimilarity extends Similarity {
 
     @Override
     public Explanation explain(int doc, Explanation freq) throws IOException {
-      return explainScore(doc, freq, stats, norms);
+      return explainScore(doc, freq, stats, norms, normTable);
     }
   }
   
   /** Collection statistics for the TF-IDF model. The only statistic of interest
    * to this model is idf. */
-  private static class IDFStats extends SimWeight {
+  static class IDFStats extends SimWeight {
     private final String field;
     /** The idf and its explanation */
     private final Explanation idf;
     private final float boost;
     private final float queryWeight;
+    final float[] normTable;
     
-    public IDFStats(String field, float boost, Explanation idf) {
+    public IDFStats(String field, float boost, Explanation idf, float[] normTable) {
       // TODO: Validate?
       this.field = field;
       this.idf = idf;
       this.boost = boost;
       this.queryWeight = boost * idf.getValue();
+      this.normTable = normTable;
     }
   }  
 
-  private Explanation explainField(int doc, Explanation freq, IDFStats stats, NumericDocValues norms) throws IOException {
+  private Explanation explainField(int doc, Explanation freq, IDFStats stats, NumericDocValues norms, float[] normTable) throws IOException {
     Explanation tfExplanation = Explanation.match(tf(freq.getValue()), "tf(freq="+freq.getValue()+"), with freq of:", freq);
     float norm;
-    if (norms != null && norms.advanceExact(doc)) {
-      norm = decodeNormValue(norms.longValue());
-    } else {
+    if (norms == null) {
       norm = 1f;
+    } else if (norms.advanceExact(doc) == false) {
+      norm = 0f;
+    } else {
+      norm = normTable[(int) (norms.longValue() & 0xFF)];
     }
     
     Explanation fieldNormExpl = Explanation.match(
@@ -619,9 +667,9 @@ public abstract class TFIDFSimilarity extends Similarity {
         tfExplanation, stats.idf, fieldNormExpl);
   }
 
-  private Explanation explainScore(int doc, Explanation freq, IDFStats stats, NumericDocValues norms) throws IOException {
+  private Explanation explainScore(int doc, Explanation freq, IDFStats stats, NumericDocValues norms, float[] normTable) throws IOException {
     Explanation queryExpl = Explanation.match(stats.boost, "boost");
-    Explanation fieldExpl = explainField(doc, freq, stats, norms);
+    Explanation fieldExpl = explainField(doc, freq, stats, norms, normTable);
     if (stats.boost == 1f) {
       return fieldExpl;
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/java/org/apache/lucene/util/SmallFloat.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/SmallFloat.java b/lucene/core/src/java/org/apache/lucene/util/SmallFloat.java
index 39395ac..317acab 100644
--- a/lucene/core/src/java/org/apache/lucene/util/SmallFloat.java
+++ b/lucene/core/src/java/org/apache/lucene/util/SmallFloat.java
@@ -97,31 +97,74 @@ public class SmallFloat {
     return Float.intBitsToFloat(bits);
   }
 
+  /** Float-like encoding for positive longs that preserves ordering and 4 significant bits. */
+  public static int longToInt4(long i) {
+    if (i < 0) {
+      throw new IllegalArgumentException("Only supports positive values, got " + i);
+    }
+    int numBits = 64 - Long.numberOfLeadingZeros(i);
+    if (numBits < 4) {
+      // subnormal value
+      return Math.toIntExact(i);
+    } else {
+      // normal value
+      int shift = numBits - 4;
+      // only keep the 5 most significant bits
+      int encoded = Math.toIntExact(i >>> shift);
+      // clear the most significant bit, which is implicit
+      encoded &= 0x07;
+      // encode the shift, adding 1 because 0 is reserved for subnormal values
+      encoded |= (shift + 1) << 3;
+      return encoded;
+    }
+  }
 
-  /** floatToByte(b, mantissaBits=5, zeroExponent=2)
-   * <br>smallest nonzero value = 0.033203125
-   * <br>largest value = 1984.0
-   * <br>epsilon = 0.03125
+  /**
+   * Decode values encoded with {@link #longToInt4(long)}.
    */
-  public static byte floatToByte52(float f) {
-    int bits = Float.floatToRawIntBits(f);
-    int smallfloat = bits >> (24-5);
-    if (smallfloat <= (63-2)<<5) {
-      return (bits<=0) ? (byte)0 : (byte)1;
+  public static final long int4ToLong(int i) {
+    long bits = i & 0x07;
+    int shift = (i >>> 3) - 1;
+    long decoded;
+    if (shift == -1) {
+      // subnormal value
+      decoded = bits;
+    } else {
+      // normal value
+      decoded = (bits | 0x08) << shift;
     }
-    if (smallfloat >= ((63-2)<<5) + 0x100) {
-      return -1;
+    return decoded;
+  }
+
+  private static final int MAX_INT4 = longToInt4(Integer.MAX_VALUE);
+  private static final int NUM_FREE_VALUES = 255 - MAX_INT4;
+
+  /**
+   * Encode an integer to a byte. It is built upon {@link #longToInt4(long)}
+   * and leverages the fact that {@code longToInt4(Integer.MAX_VALUE)} is
+   * less than 255 to encode low values more accurately.
+   */
+  public static byte intToByte4(int i) {
+    if (i < 0) {
+      throw new IllegalArgumentException("Only supports positive values, got " + i);
+    }
+    if (i < NUM_FREE_VALUES) {
+      return (byte) i;
+    } else {
+      return (byte) (NUM_FREE_VALUES + longToInt4(i - NUM_FREE_VALUES));
     }
-    return (byte)(smallfloat - ((63-2)<<5));
   }
 
-  /** byteToFloat(b, mantissaBits=5, zeroExponent=2) */
-  public static float byte52ToFloat(byte b) {
-    // on Java1.5 & 1.6 JVMs, prebuilding a decoding array and doing a lookup
-    // is only a little bit faster (anywhere from 0% to 7%)
-    if (b == 0) return 0.0f;
-    int bits = (b&0xff) << (24-5);
-    bits += (63-2) << 24;
-    return Float.intBitsToFloat(bits);
+  /**
+   * Decode values that have been encoded with {@link #intToByte4(int)}.
+   */
+  public static int byte4ToInt(byte b) {
+    int i = Byte.toUnsignedInt(b);
+    if (i < NUM_FREE_VALUES) {
+      return i;
+    } else {
+      long decoded = NUM_FREE_VALUES + int4ToLong(i - NUM_FREE_VALUES);
+      return Math.toIntExact(decoded);
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
index be3a2af..bd483d3 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
@@ -2441,7 +2441,7 @@ public class TestIndexSorting extends LuceneTestCase {
         assertTrue(sparseValues.advanceExact(docID));
         assertTrue(sparseBinaryValues.advanceExact(docID));
         assertTrue(normsValues.advanceExact(docID));
-        assertEquals(124, normsValues.longValue());
+        assertEquals(1, normsValues.longValue());
         assertEquals(127-docID, (int) sparseValues.longValue());
         assertEquals(new BytesRef(Integer.toString(127-docID)), sparseBinaryValues.binaryValue());
       } else {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/index/TestMaxTermFrequency.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMaxTermFrequency.java b/lucene/core/src/test/org/apache/lucene/index/TestMaxTermFrequency.java
index 4f74c30..491660b 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestMaxTermFrequency.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestMaxTermFrequency.java
@@ -17,6 +17,7 @@
 package org.apache.lucene.index;
 
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -26,7 +27,9 @@ import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.search.similarities.TFIDFSimilarity;
+import org.apache.lucene.search.CollectionStatistics;
+import org.apache.lucene.search.TermStatistics;
+import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
@@ -35,12 +38,12 @@ import org.apache.lucene.util.TestUtil;
 /**
  * Tests the maxTermFrequency statistic in FieldInvertState
  */
-public class TestMaxTermFrequency extends LuceneTestCase { 
+public class TestMaxTermFrequency extends LuceneTestCase {
   Directory dir;
   IndexReader reader;
   /* expected maxTermFrequency values for our documents */
   ArrayList<Integer> expected = new ArrayList<>();
-  
+
   @Override
   public void setUp() throws Exception {
     super.setUp();
@@ -59,14 +62,14 @@ public class TestMaxTermFrequency extends LuceneTestCase {
     reader = writer.getReader();
     writer.close();
   }
-  
+
   @Override
   public void tearDown() throws Exception {
     reader.close();
     dir.close();
     super.tearDown();
   }
-  
+
   public void test() throws Exception {
     NumericDocValues fooNorms = MultiDocValues.getNormValues(reader, "foo");
     for (int i = 0; i < reader.maxDoc(); i++) {
@@ -95,30 +98,42 @@ public class TestMaxTermFrequency extends LuceneTestCase {
     Collections.shuffle(terms, random());
     return Arrays.toString(terms.toArray(new String[terms.size()]));
   }
-  
+
   /**
    * Simple similarity that encodes maxTermFrequency directly as a byte
    */
-  static class TestSimilarity extends TFIDFSimilarity {
+  static class TestSimilarity extends Similarity {
 
     @Override
-    public float lengthNorm(FieldInvertState state) {
+    public long computeNorm(FieldInvertState state) {
       return state.getMaxTermFrequency();
     }
 
     @Override
-    public long encodeNormValue(float f) {
-      return (byte) f;
+    public SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
+      return new SimWeight() {};
     }
 
     @Override
-    public float decodeNormValue(long norm) {
-      return norm;
+    public SimScorer simScorer(SimWeight weight, LeafReaderContext context) throws IOException {
+      return new SimScorer() {
+
+        @Override
+        public float score(int doc, float freq) throws IOException {
+          return 0;
+        }
+
+        @Override
+        public float computeSlopFactor(int distance) {
+          return 0;
+        }
+
+        @Override
+        public float computePayloadFactor(int doc, int start, int end, BytesRef payload) {
+          return 0;
+        }
+      };
     }
 
-    @Override public float tf(float freq) { return 0; }
-    @Override public float idf(long docFreq, long docCount) { return 0; }
-    @Override public float sloppyFreq(int distance) { return 0; }
-    @Override public float scorePayload(int doc, int start, int end, BytesRef payload) { return 0; }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/index/TestNorms.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNorms.java b/lucene/core/src/test/org/apache/lucene/index/TestNorms.java
index 64c0649..70c7a32 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestNorms.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestNorms.java
@@ -32,13 +32,11 @@ import org.apache.lucene.search.TermStatistics;
 import org.apache.lucene.search.similarities.ClassicSimilarity;
 import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper;
 import org.apache.lucene.search.similarities.Similarity;
-import org.apache.lucene.search.similarities.TFIDFSimilarity;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LineFileDocs;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
-import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 
 /**
@@ -49,67 +47,6 @@ import org.apache.lucene.util.TestUtil;
 @Slow
 public class TestNorms extends LuceneTestCase {
   static final String BYTE_TEST_FIELD = "normsTestByte";
-
-  static class CustomNormEncodingSimilarity extends TFIDFSimilarity {
-
-    @Override
-    public long encodeNormValue(float f) {
-      return (long) f;
-    }
-    
-    @Override
-    public float decodeNormValue(long norm) {
-      return norm;
-    }
-
-    @Override
-    public float lengthNorm(FieldInvertState state) {
-      return state.getLength();
-    }
-
-    @Override public float tf(float freq) { return 0; }
-    @Override public float idf(long docFreq, long docCount) { return 0; }
-    @Override public float sloppyFreq(int distance) { return 0; }
-    @Override public float scorePayload(int doc, int start, int end, BytesRef payload) { return 0; }
-  }
-  
-  // LUCENE-1260
-  public void testCustomEncoder() throws Exception {
-    Directory dir = newDirectory();
-    MockAnalyzer analyzer = new MockAnalyzer(random());
-
-    IndexWriterConfig config = newIndexWriterConfig(analyzer);
-    config.setSimilarity(new CustomNormEncodingSimilarity());
-    RandomIndexWriter writer = new RandomIndexWriter(random(), dir, config);
-    Document doc = new Document();
-    Field foo = newTextField("foo", "", Field.Store.NO);
-    Field bar = newTextField("bar", "", Field.Store.NO);
-    doc.add(foo);
-    doc.add(bar);
-    
-    for (int i = 0; i < 100; i++) {
-      bar.setStringValue("singleton");
-      writer.addDocument(doc);
-    }
-    
-    IndexReader reader = writer.getReader();
-    writer.close();
-    
-    NumericDocValues fooNorms = MultiDocValues.getNormValues(reader, "foo");
-    for (int i = 0; i < reader.maxDoc(); i++) {
-      assertEquals(i, fooNorms.nextDoc());
-      assertEquals(0, fooNorms.longValue());
-    }
-    
-    NumericDocValues barNorms = MultiDocValues.getNormValues(reader, "bar");
-    for (int i = 0; i < reader.maxDoc(); i++) {
-      assertEquals(i, barNorms.nextDoc());
-      assertEquals(1, barNorms.longValue());
-    }
-    
-    reader.close();
-    dir.close();
-  }
   
   public void testMaxByteNorms() throws IOException {
     Directory dir = newFSDirectory(createTempDir("TestNorms.testMaxByteNorms"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java b/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
index 0deafdd..8af744f 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
@@ -44,9 +44,7 @@ import org.apache.lucene.util.LuceneTestCase;
 public class TestOmitTf extends LuceneTestCase {
   
   public static class SimpleSimilarity extends TFIDFSimilarity {
-    @Override public float decodeNormValue(long norm) { return norm; }
-    @Override public long encodeNormValue(float f) { return (long) f; }
-    @Override public float lengthNorm(FieldInvertState state) { return 1; }
+    @Override public float lengthNorm(int length) { return 1; }
     @Override public float tf(float freq) { return freq; }
     @Override public float sloppyFreq(int distance) { return 2.0f; }
     @Override public float idf(long docFreq, long docCount) { return 1.0f; }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
index e20163a..112d892 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
@@ -30,7 +30,6 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.DirectoryReader;
-import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
@@ -72,7 +71,7 @@ public class TestDisjunctionMaxQuery extends LuceneTestCase {
     }
     
     @Override
-    public float lengthNorm(FieldInvertState state) {
+    public float lengthNorm(int length) {
       // Disable length norm
       return 1;
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06a6034d/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java b/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java
index fb01e1d..bc849e9 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java
@@ -33,6 +33,7 @@ import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.SortedDocValues;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.FieldValueHitQueue.Entry;
+import org.apache.lucene.search.similarities.BM25Similarity;
 import org.apache.lucene.search.similarities.ClassicSimilarity;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
@@ -63,7 +64,7 @@ public class TestElevationComparator extends LuceneTestCase {
     writer.close();
 
     IndexSearcher searcher = newSearcher(r);
-    searcher.setSimilarity(new ClassicSimilarity());
+    searcher.setSimilarity(new BM25Similarity());
 
     runTest(searcher, true);
     runTest(searcher, false);
@@ -98,11 +99,11 @@ public class TestElevationComparator extends LuceneTestCase {
     assertEquals(3, topDocs.scoreDocs[1].doc);
 
     if (reversed) {
-      assertEquals(2, topDocs.scoreDocs[2].doc);
-      assertEquals(1, topDocs.scoreDocs[3].doc);
-    } else {
       assertEquals(1, topDocs.scoreDocs[2].doc);
       assertEquals(2, topDocs.scoreDocs[3].doc);
+    } else {
+      assertEquals(2, topDocs.scoreDocs[2].doc);
+      assertEquals(1, topDocs.scoreDocs[3].doc);
     }
 
     /*


[34/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7838 - added knn classifier based on flt

Posted by tf...@apache.org.
LUCENE-7838 - added knn classifier based on flt


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/bd9e32d3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/bd9e32d3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/bd9e32d3

Branch: refs/heads/jira/solr-10233
Commit: bd9e32d358399af7c31e732314e1ef1dd89bcfa1
Parents: afd70a4
Author: Tommaso Teofili <to...@apache.org>
Authored: Thu May 18 14:35:53 2017 +0200
Committer: Tommaso Teofili <to...@apache.org>
Committed: Thu May 18 14:36:18 2017 +0200

----------------------------------------------------------------------
 .../lucene/classification/classification.iml    |   3 +-
 lucene/classification/build.xml                 |   8 +-
 .../classification/KNearestFuzzyClassifier.java | 225 +++++++++++++++++++
 .../classification/utils/DatasetSplitter.java   |   2 +-
 .../KNearestFuzzyClassifierTest.java            | 124 ++++++++++
 .../utils/ConfusionMatrixGeneratorTest.java     | 123 +++++-----
 6 files changed, 417 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/bd9e32d3/dev-tools/idea/lucene/classification/classification.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/lucene/classification/classification.iml b/dev-tools/idea/lucene/classification/classification.iml
index 0f20274..44af1e4 100644
--- a/dev-tools/idea/lucene/classification/classification.iml
+++ b/dev-tools/idea/lucene/classification/classification.iml
@@ -16,8 +16,9 @@
     <orderEntry type="module" scope="TEST" module-name="lucene-test-framework" />
     <orderEntry type="module" module-name="lucene-core" />
     <orderEntry type="module" module-name="queries" />
-    <orderEntry type="module" scope="TEST" module-name="analysis-common" />
+    <orderEntry type="module" module-name="analysis-common" />
     <orderEntry type="module" module-name="grouping" />
     <orderEntry type="module" module-name="misc" />
+    <orderEntry type="module" module-name="sandbox" />
   </component>
 </module>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/bd9e32d3/lucene/classification/build.xml
----------------------------------------------------------------------
diff --git a/lucene/classification/build.xml b/lucene/classification/build.xml
index 704cae8..b3f1bfd 100644
--- a/lucene/classification/build.xml
+++ b/lucene/classification/build.xml
@@ -28,6 +28,8 @@
     <path refid="base.classpath"/>
     <pathelement path="${queries.jar}"/>
     <pathelement path="${grouping.jar}"/>
+    <pathelement path="${sandbox.jar}"/>
+    <pathelement path="${analyzers-common.jar}"/>
   </path>
 
   <path id="test.classpath">
@@ -36,16 +38,18 @@
     <path refid="test.base.classpath"/>
   </path>
 
-  <target name="compile-core" depends="jar-grouping,jar-queries,jar-analyzers-common,common.compile-core" />
+  <target name="compile-core" depends="jar-sandbox,jar-grouping,jar-queries,jar-analyzers-common,common.compile-core" />
 
   <target name="jar-core" depends="common.jar-core" />
 
-  <target name="javadocs" depends="javadocs-grouping,compile-core,check-javadocs-uptodate"
+  <target name="javadocs" depends="javadocs-sandbox,javadocs-grouping,compile-core,check-javadocs-uptodate"
           unless="javadocs-uptodate-${name}">
     <invoke-module-javadoc>
       <links>
         <link href="../queries"/>
+        <link href="../analyzers/common"/>
         <link href="../grouping"/>
+        <link href="../sandbox"/>
       </links>
     </invoke-module-javadoc>
   </target>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/bd9e32d3/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
new file mode 100644
index 0000000..1cde468
--- /dev/null
+++ b/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
@@ -0,0 +1,225 @@
+/*
+ * 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.
+ */
+package org.apache.lucene.classification;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.sandbox.queries.FuzzyLikeThisQuery;
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.ScoreDoc;
+import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.search.WildcardQuery;
+import org.apache.lucene.search.similarities.BM25Similarity;
+import org.apache.lucene.search.similarities.ClassicSimilarity;
+import org.apache.lucene.search.similarities.Similarity;
+import org.apache.lucene.util.BytesRef;
+
+/**
+ * A k-Nearest Neighbor classifier based on {@link FuzzyLikeThisQuery}.
+ *
+ * @lucene.experimental
+ */
+public class KNearestFuzzyClassifier implements Classifier<BytesRef> {
+
+  /**
+   * the name of the fields used as the input text
+   */
+  protected final String[] textFieldNames;
+
+  /**
+   * the name of the field used as the output text
+   */
+  protected final String classFieldName;
+
+  /**
+   * an {@link IndexSearcher} used to perform queries
+   */
+  protected final IndexSearcher indexSearcher;
+
+  /**
+   * the no. of docs to compare in order to find the nearest neighbor to the input text
+   */
+  protected final int k;
+
+  /**
+   * a {@link Query} used to filter the documents that should be used from this classifier's underlying {@link LeafReader}
+   */
+  protected final Query query;
+  private final Analyzer analyzer;
+
+  /**
+   * Creates a {@link KNearestFuzzyClassifier}.
+   *
+   * @param indexReader    the reader on the index to be used for classification
+   * @param analyzer       an {@link Analyzer} used to analyze unseen text
+   * @param similarity     the {@link Similarity} to be used by the underlying {@link IndexSearcher} or {@code null}
+   *                       (defaults to {@link BM25Similarity})
+   * @param query          a {@link Query} to eventually filter the docs used for training the classifier, or {@code null}
+   *                       if all the indexed docs should be used
+   * @param k              the no. of docs to select in the MLT results to find the nearest neighbor
+   * @param classFieldName the name of the field used as the output for the classifier
+   * @param textFieldNames the name of the fields used as the inputs for the classifier, they can contain boosting indication e.g. title^10
+   */
+  public KNearestFuzzyClassifier(IndexReader indexReader, Similarity similarity, Analyzer analyzer, Query query, int k,
+                                 String classFieldName, String... textFieldNames) {
+    this.textFieldNames = textFieldNames;
+    this.classFieldName = classFieldName;
+    this.analyzer = analyzer;
+    this.indexSearcher = new IndexSearcher(indexReader);
+    if (similarity != null) {
+      this.indexSearcher.setSimilarity(similarity);
+    } else {
+      this.indexSearcher.setSimilarity(new BM25Similarity());
+    }
+    this.query = query;
+    this.k = k;
+  }
+
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public ClassificationResult<BytesRef> assignClass(String text) throws IOException {
+    TopDocs knnResults = knnSearch(text);
+    List<ClassificationResult<BytesRef>> assignedClasses = buildListFromTopDocs(knnResults);
+    ClassificationResult<BytesRef> assignedClass = null;
+    double maxscore = -Double.MAX_VALUE;
+    for (ClassificationResult<BytesRef> cl : assignedClasses) {
+      if (cl.getScore() > maxscore) {
+        assignedClass = cl;
+        maxscore = cl.getScore();
+      }
+    }
+    return assignedClass;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public List<ClassificationResult<BytesRef>> getClasses(String text) throws IOException {
+    TopDocs knnResults = knnSearch(text);
+    List<ClassificationResult<BytesRef>> assignedClasses = buildListFromTopDocs(knnResults);
+    Collections.sort(assignedClasses);
+    return assignedClasses;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public List<ClassificationResult<BytesRef>> getClasses(String text, int max) throws IOException {
+    TopDocs knnResults = knnSearch(text);
+    List<ClassificationResult<BytesRef>> assignedClasses = buildListFromTopDocs(knnResults);
+    Collections.sort(assignedClasses);
+    return assignedClasses.subList(0, max);
+  }
+
+  private TopDocs knnSearch(String text) throws IOException {
+    BooleanQuery.Builder bq = new BooleanQuery.Builder();
+    FuzzyLikeThisQuery fuzzyLikeThisQuery = new FuzzyLikeThisQuery(300, analyzer);
+    for (String fieldName : textFieldNames) {
+      fuzzyLikeThisQuery.addTerms(text, fieldName, 1f, 2); // TODO: make this parameters configurable
+    }
+    bq.add(fuzzyLikeThisQuery, BooleanClause.Occur.MUST);
+    Query classFieldQuery = new WildcardQuery(new Term(classFieldName, "*"));
+    bq.add(new BooleanClause(classFieldQuery, BooleanClause.Occur.MUST));
+    if (query != null) {
+      bq.add(query, BooleanClause.Occur.MUST);
+    }
+    return indexSearcher.search(bq.build(), k);
+  }
+
+  /**
+   * build a list of classification results from search results
+   *
+   * @param topDocs the search results as a {@link TopDocs} object
+   * @return a {@link List} of {@link ClassificationResult}, one for each existing class
+   * @throws IOException if it's not possible to get the stored value of class field
+   */
+  protected List<ClassificationResult<BytesRef>> buildListFromTopDocs(TopDocs topDocs) throws IOException {
+    Map<BytesRef, Integer> classCounts = new HashMap<>();
+    Map<BytesRef, Double> classBoosts = new HashMap<>(); // this is a boost based on class ranking positions in topDocs
+    float maxScore = topDocs.getMaxScore();
+    for (ScoreDoc scoreDoc : topDocs.scoreDocs) {
+      IndexableField storableField = indexSearcher.doc(scoreDoc.doc).getField(classFieldName);
+      if (storableField != null) {
+        BytesRef cl = new BytesRef(storableField.stringValue());
+        //update count
+        Integer count = classCounts.get(cl);
+        if (count != null) {
+          classCounts.put(cl, count + 1);
+        } else {
+          classCounts.put(cl, 1);
+        }
+        //update boost, the boost is based on the best score
+        Double totalBoost = classBoosts.get(cl);
+        double singleBoost = scoreDoc.score / maxScore;
+        if (totalBoost != null) {
+          classBoosts.put(cl, totalBoost + singleBoost);
+        } else {
+          classBoosts.put(cl, singleBoost);
+        }
+      }
+    }
+    List<ClassificationResult<BytesRef>> returnList = new ArrayList<>();
+    List<ClassificationResult<BytesRef>> temporaryList = new ArrayList<>();
+    int sumdoc = 0;
+    for (Map.Entry<BytesRef, Integer> entry : classCounts.entrySet()) {
+      Integer count = entry.getValue();
+      Double normBoost = classBoosts.get(entry.getKey()) / count; //the boost is normalized to be 0<b<1
+      temporaryList.add(new ClassificationResult<>(entry.getKey().clone(), (count * normBoost) / (double) k));
+      sumdoc += count;
+    }
+
+    //correction
+    if (sumdoc < k) {
+      for (ClassificationResult<BytesRef> cr : temporaryList) {
+        returnList.add(new ClassificationResult<>(cr.getAssignedClass(), cr.getScore() * k / (double) sumdoc));
+      }
+    } else {
+      returnList = temporaryList;
+    }
+    return returnList;
+  }
+
+  @Override
+  public String toString() {
+    return "KNearestFuzzyClassifier{" +
+        "textFieldNames=" + Arrays.toString(textFieldNames) +
+        ", classFieldName='" + classFieldName + '\'' +
+        ", k=" + k +
+        ", query=" + query +
+        ", similarity=" + indexSearcher.getSimilarity(true) +
+        '}';
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/bd9e32d3/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java b/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
index 7ab674e..913fb7f 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
@@ -121,7 +121,7 @@ public class DatasetSplitter {
       int b = 0;
 
       // iterate over existing documents
-      for (GroupDocs group : topGroups.groups) {
+      for (GroupDocs<Object> group : topGroups.groups) {
         int totalHits = group.totalHits;
         double testSize = totalHits * testRatio;
         int tc = 0;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/bd9e32d3/lucene/classification/src/test/org/apache/lucene/classification/KNearestFuzzyClassifierTest.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/test/org/apache/lucene/classification/KNearestFuzzyClassifierTest.java b/lucene/classification/src/test/org/apache/lucene/classification/KNearestFuzzyClassifierTest.java
new file mode 100644
index 0000000..6e4c404
--- /dev/null
+++ b/lucene/classification/src/test/org/apache/lucene/classification/KNearestFuzzyClassifierTest.java
@@ -0,0 +1,124 @@
+/*
+ * 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.
+ */
+package org.apache.lucene.classification;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.analysis.Tokenizer;
+import org.apache.lucene.analysis.core.KeywordTokenizer;
+import org.apache.lucene.analysis.ngram.EdgeNGramTokenFilter;
+import org.apache.lucene.analysis.reverse.ReverseStringFilter;
+import org.apache.lucene.classification.utils.ConfusionMatrixGenerator;
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.index.MultiFields;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.Terms;
+import org.apache.lucene.index.TermsEnum;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.util.BytesRef;
+import org.junit.Test;
+
+/**
+ * Testcase for {@link KNearestFuzzyClassifier}
+ */
+public class KNearestFuzzyClassifierTest extends ClassificationTestBase<BytesRef> {
+
+  @Test
+  public void testBasicUsage() throws Exception {
+    LeafReader leafReader = null;
+    try {
+      MockAnalyzer analyzer = new MockAnalyzer(random());
+      leafReader = getSampleIndex(analyzer);
+      Classifier<BytesRef> classifier = new KNearestFuzzyClassifier(leafReader, null, analyzer, null, 3, categoryFieldName, textFieldName);
+      checkCorrectClassification(classifier, TECHNOLOGY_INPUT, TECHNOLOGY_RESULT);
+      checkCorrectClassification(classifier, POLITICS_INPUT, POLITICS_RESULT);
+    } finally {
+      if (leafReader != null) {
+        leafReader.close();
+      }
+    }
+  }
+
+  @Test
+  public void testBasicUsageWithQuery() throws Exception {
+    LeafReader leafReader = null;
+    try {
+      MockAnalyzer analyzer = new MockAnalyzer(random());
+      leafReader = getSampleIndex(analyzer);
+      TermQuery query = new TermQuery(new Term(textFieldName, "not"));
+      Classifier<BytesRef> classifier = new KNearestFuzzyClassifier(leafReader, null, analyzer, query, 3, categoryFieldName, textFieldName);
+      checkCorrectClassification(classifier, TECHNOLOGY_INPUT, TECHNOLOGY_RESULT);
+    } finally {
+      if (leafReader != null) {
+        leafReader.close();
+      }
+    }
+  }
+
+  @Test
+  public void testPerformance() throws Exception {
+    MockAnalyzer analyzer = new MockAnalyzer(random());
+    LeafReader leafReader = getRandomIndex(analyzer, 100);
+    try {
+      long trainStart = System.currentTimeMillis();
+      Classifier<BytesRef> classifier = new KNearestFuzzyClassifier(leafReader, null, analyzer, null, 3, categoryFieldName, textFieldName);
+      long trainEnd = System.currentTimeMillis();
+      long trainTime = trainEnd - trainStart;
+      assertTrue("training took more than 10s: " + trainTime / 1000 + "s", trainTime < 10000);
+
+      long evaluationStart = System.currentTimeMillis();
+      ConfusionMatrixGenerator.ConfusionMatrix confusionMatrix = ConfusionMatrixGenerator.getConfusionMatrix(leafReader,
+          classifier, categoryFieldName, textFieldName, -1);
+      assertNotNull(confusionMatrix);
+      long evaluationEnd = System.currentTimeMillis();
+      long evaluationTime = evaluationEnd - evaluationStart;
+      assertTrue("evaluation took more than 2m: " + evaluationTime / 1000 + "s", evaluationTime < 120000);
+      double avgClassificationTime = confusionMatrix.getAvgClassificationTime();
+      assertTrue(5000 > avgClassificationTime);
+      double accuracy = confusionMatrix.getAccuracy();
+      assertTrue(accuracy >= 0d);
+      assertTrue(accuracy <= 1d);
+
+      double recall = confusionMatrix.getRecall();
+      assertTrue(recall >= 0d);
+      assertTrue(recall <= 1d);
+
+      double precision = confusionMatrix.getPrecision();
+      assertTrue(precision >= 0d);
+      assertTrue(precision <= 1d);
+
+      Terms terms = MultiFields.getTerms(leafReader, categoryFieldName);
+      TermsEnum iterator = terms.iterator();
+      BytesRef term;
+      while ((term = iterator.next()) != null) {
+        String s = term.utf8ToString();
+        recall = confusionMatrix.getRecall(s);
+        assertTrue(recall >= 0d);
+        assertTrue(recall <= 1d);
+        precision = confusionMatrix.getPrecision(s);
+        assertTrue(precision >= 0d);
+        assertTrue(precision <= 1d);
+        double f1Measure = confusionMatrix.getF1Measure(s);
+        assertTrue(f1Measure >= 0d);
+        assertTrue(f1Measure <= 1d);
+      }
+    } finally {
+      leafReader.close();
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/bd9e32d3/lucene/classification/src/test/org/apache/lucene/classification/utils/ConfusionMatrixGeneratorTest.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/test/org/apache/lucene/classification/utils/ConfusionMatrixGeneratorTest.java b/lucene/classification/src/test/org/apache/lucene/classification/utils/ConfusionMatrixGeneratorTest.java
index 63cce2a..edb76b5 100644
--- a/lucene/classification/src/test/org/apache/lucene/classification/utils/ConfusionMatrixGeneratorTest.java
+++ b/lucene/classification/src/test/org/apache/lucene/classification/utils/ConfusionMatrixGeneratorTest.java
@@ -21,11 +21,13 @@ import java.io.IOException;
 import java.util.List;
 
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.classification.BM25NBClassifier;
 import org.apache.lucene.classification.BooleanPerceptronClassifier;
 import org.apache.lucene.classification.CachingNaiveBayesClassifier;
 import org.apache.lucene.classification.ClassificationResult;
 import org.apache.lucene.classification.ClassificationTestBase;
 import org.apache.lucene.classification.Classifier;
+import org.apache.lucene.classification.KNearestFuzzyClassifier;
 import org.apache.lucene.classification.KNearestNeighborClassifier;
 import org.apache.lucene.classification.SimpleNaiveBayesClassifier;
 import org.apache.lucene.index.LeafReader;
@@ -94,22 +96,43 @@ public class ConfusionMatrixGeneratorTest extends ClassificationTestBase<Object>
       Classifier<BytesRef> classifier = new SimpleNaiveBayesClassifier(reader, analyzer, null, categoryFieldName, textFieldName);
       ConfusionMatrixGenerator.ConfusionMatrix confusionMatrix = ConfusionMatrixGenerator.getConfusionMatrix(reader,
           classifier, categoryFieldName, textFieldName, -1);
-      assertNotNull(confusionMatrix);
-      assertNotNull(confusionMatrix.getLinearizedMatrix());
-      assertEquals(7, confusionMatrix.getNumberOfEvaluatedDocs());
-      assertTrue(confusionMatrix.getAvgClassificationTime() >= 0d);
-      double accuracy = confusionMatrix.getAccuracy();
-      assertTrue(accuracy >= 0d);
-      assertTrue(accuracy <= 1d);
-      double precision = confusionMatrix.getPrecision();
-      assertTrue(precision >= 0d);
-      assertTrue(precision <= 1d);
-      double recall = confusionMatrix.getRecall();
-      assertTrue(recall >= 0d);
-      assertTrue(recall <= 1d);
-      double f1Measure = confusionMatrix.getF1Measure();
-      assertTrue(f1Measure >= 0d);
-      assertTrue(f1Measure <= 1d);
+      checkCM(confusionMatrix);
+    } finally {
+      if (reader != null) {
+        reader.close();
+      }
+    }
+  }
+
+  private void checkCM(ConfusionMatrixGenerator.ConfusionMatrix confusionMatrix) {
+    assertNotNull(confusionMatrix);
+    assertNotNull(confusionMatrix.getLinearizedMatrix());
+    assertEquals(7, confusionMatrix.getNumberOfEvaluatedDocs());
+    assertTrue(confusionMatrix.getAvgClassificationTime() >= 0d);
+    double accuracy = confusionMatrix.getAccuracy();
+    assertTrue(accuracy >= 0d);
+    assertTrue(accuracy <= 1d);
+    double precision = confusionMatrix.getPrecision();
+    assertTrue(precision >= 0d);
+    assertTrue(precision <= 1d);
+    double recall = confusionMatrix.getRecall();
+    assertTrue(recall >= 0d);
+    assertTrue(recall <= 1d);
+    double f1Measure = confusionMatrix.getF1Measure();
+    assertTrue(f1Measure >= 0d);
+    assertTrue(f1Measure <= 1d);
+  }
+
+  @Test
+  public void testGetConfusionMatrixWithBM25NB() throws Exception {
+    LeafReader reader = null;
+    try {
+      MockAnalyzer analyzer = new MockAnalyzer(random());
+      reader = getSampleIndex(analyzer);
+      Classifier<BytesRef> classifier = new BM25NBClassifier(reader, analyzer, null, categoryFieldName, textFieldName);
+      ConfusionMatrixGenerator.ConfusionMatrix confusionMatrix = ConfusionMatrixGenerator.getConfusionMatrix(reader,
+          classifier, categoryFieldName, textFieldName, -1);
+      checkCM(confusionMatrix);
     } finally {
       if (reader != null) {
         reader.close();
@@ -126,22 +149,7 @@ public class ConfusionMatrixGeneratorTest extends ClassificationTestBase<Object>
       Classifier<BytesRef> classifier = new CachingNaiveBayesClassifier(reader, analyzer, null, categoryFieldName, textFieldName);
       ConfusionMatrixGenerator.ConfusionMatrix confusionMatrix = ConfusionMatrixGenerator.getConfusionMatrix(reader,
           classifier, categoryFieldName, textFieldName, -1);
-      assertNotNull(confusionMatrix);
-      assertNotNull(confusionMatrix.getLinearizedMatrix());
-      assertEquals(7, confusionMatrix.getNumberOfEvaluatedDocs());
-      assertTrue(confusionMatrix.getAvgClassificationTime() >= 0d);
-      double accuracy = confusionMatrix.getAccuracy();
-      assertTrue(accuracy >= 0d);
-      assertTrue(accuracy <= 1d);
-      double precision = confusionMatrix.getPrecision();
-      assertTrue(precision >= 0d);
-      assertTrue(precision <= 1d);
-      double recall = confusionMatrix.getRecall();
-      assertTrue(recall >= 0d);
-      assertTrue(recall <= 1d);
-      double f1Measure = confusionMatrix.getF1Measure();
-      assertTrue(f1Measure >= 0d);
-      assertTrue(f1Measure <= 1d);
+      checkCM(confusionMatrix);
     } finally {
       if (reader != null) {
         reader.close();
@@ -158,22 +166,24 @@ public class ConfusionMatrixGeneratorTest extends ClassificationTestBase<Object>
       Classifier<BytesRef> classifier = new KNearestNeighborClassifier(reader, null, analyzer, null, 1, 0, 0, categoryFieldName, textFieldName);
       ConfusionMatrixGenerator.ConfusionMatrix confusionMatrix = ConfusionMatrixGenerator.getConfusionMatrix(reader,
           classifier, categoryFieldName, textFieldName, -1);
-      assertNotNull(confusionMatrix);
-      assertNotNull(confusionMatrix.getLinearizedMatrix());
-      assertEquals(7, confusionMatrix.getNumberOfEvaluatedDocs());
-      assertTrue(confusionMatrix.getAvgClassificationTime() >= 0d);
-      double accuracy = confusionMatrix.getAccuracy();
-      assertTrue(accuracy >= 0d);
-      assertTrue(accuracy <= 1d);
-      double precision = confusionMatrix.getPrecision();
-      assertTrue(precision >= 0d);
-      assertTrue(precision <= 1d);
-      double recall = confusionMatrix.getRecall();
-      assertTrue(recall >= 0d);
-      assertTrue(recall <= 1d);
-      double f1Measure = confusionMatrix.getF1Measure();
-      assertTrue(f1Measure >= 0d);
-      assertTrue(f1Measure <= 1d);
+      checkCM(confusionMatrix);
+    } finally {
+      if (reader != null) {
+        reader.close();
+      }
+    }
+  }
+
+  @Test
+  public void testGetConfusionMatrixWithFLTKNN() throws Exception {
+    LeafReader reader = null;
+    try {
+      MockAnalyzer analyzer = new MockAnalyzer(random());
+      reader = getSampleIndex(analyzer);
+      Classifier<BytesRef> classifier = new KNearestFuzzyClassifier(reader, null, analyzer, null, 1, categoryFieldName, textFieldName);
+      ConfusionMatrixGenerator.ConfusionMatrix confusionMatrix = ConfusionMatrixGenerator.getConfusionMatrix(reader,
+          classifier, categoryFieldName, textFieldName, -1);
+      checkCM(confusionMatrix);
     } finally {
       if (reader != null) {
         reader.close();
@@ -190,22 +200,7 @@ public class ConfusionMatrixGeneratorTest extends ClassificationTestBase<Object>
       Classifier<Boolean> classifier = new BooleanPerceptronClassifier(reader, analyzer, null, 1, null, booleanFieldName, textFieldName);
       ConfusionMatrixGenerator.ConfusionMatrix confusionMatrix = ConfusionMatrixGenerator.getConfusionMatrix(reader,
           classifier, booleanFieldName, textFieldName, -1);
-      assertNotNull(confusionMatrix);
-      assertNotNull(confusionMatrix.getLinearizedMatrix());
-      assertEquals(7, confusionMatrix.getNumberOfEvaluatedDocs());
-      assertTrue(confusionMatrix.getAvgClassificationTime() >= 0d);
-      double accuracy = confusionMatrix.getAccuracy();
-      assertTrue(accuracy >= 0d);
-      assertTrue(accuracy <= 1d);
-      double precision = confusionMatrix.getPrecision();
-      assertTrue(precision >= 0d);
-      assertTrue(precision <= 1d);
-      double recall = confusionMatrix.getRecall();
-      assertTrue(recall >= 0d);
-      assertTrue(recall <= 1d);
-      double f1Measure = confusionMatrix.getF1Measure();
-      assertTrue(f1Measure >= 0d);
-      assertTrue(f1Measure <= 1d);
+      checkCM(confusionMatrix);
       assertTrue(confusionMatrix.getPrecision("true") >= 0d);
       assertTrue(confusionMatrix.getPrecision("true") <= 1d);
       assertTrue(confusionMatrix.getPrecision("false") >= 0d);


[39/50] [abbrv] lucene-solr:jira/solr-10233: LUCENE-7800: Remove code that potentially rethrows checked exceptions from methods that don't declare them ("sneaky throw" hack).

Posted by tf...@apache.org.
LUCENE-7800: Remove code that potentially rethrows checked exceptions from methods that don't declare them ("sneaky throw" hack).


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5a50887a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5a50887a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5a50887a

Branch: refs/heads/jira/solr-10233
Commit: 5a50887a4b92f18d8f33e6472cbb9bbdc9631499
Parents: c9bdce9
Author: Dawid Weiss <dw...@apache.org>
Authored: Thu May 18 16:38:53 2017 +0200
Committer: Dawid Weiss <dw...@apache.org>
Committed: Thu May 18 16:39:47 2017 +0200

----------------------------------------------------------------------
 lucene/CHANGES.txt                              |   6 +
 .../org/tartarus/snowball/SnowballProgram.java  |  20 ++-
 .../apache/lucene/util/AttributeFactory.java    |  39 +++---
 .../expressions/js/JavascriptCompiler.java      | 131 +++++++++----------
 4 files changed, 94 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a50887a/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 404e923..f309334 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -97,6 +97,12 @@ Other
 
 ======================= Lucene 6.7.0 =======================
 
+Other
+
+* LUCENE-7800: Remove code that potentially rethrows checked exceptions 
+  from methods that don't declare them ("sneaky throw" hack). (Robert Muir,
+  Uwe Schindler, Dawid Weiss)  
+
 ======================= Lucene 6.6.0 =======================
 
 New Features

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a50887a/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java b/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java
index bfc8ec0..c31065f 100644
--- a/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java
+++ b/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java
@@ -31,6 +31,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 package org.tartarus.snowball;
 
+import java.lang.reflect.UndeclaredThrowableException;
+
 import org.apache.lucene.util.ArrayUtil;
 
 /**
@@ -313,8 +315,10 @@ public abstract class SnowballProgram {
           boolean res = false;
           try {
             res = (boolean) w.method.invokeExact(this);
+          } catch (Error | RuntimeException e) {
+            throw e;
           } catch (Throwable e) {
-            rethrow(e);
+            throw new UndeclaredThrowableException(e);
           }
           cursor = c + w.s_size;
           if (res) return w.result;
@@ -376,8 +380,10 @@ public abstract class SnowballProgram {
           boolean res = false;
           try {
             res = (boolean) w.method.invokeExact(this);
+          } catch (Error | RuntimeException e) {
+            throw e;
           } catch (Throwable e) {
-            rethrow(e);
+            throw new UndeclaredThrowableException(e);
           }
           cursor = c - w.s_size;
           if (res) return w.result;
@@ -485,15 +491,5 @@ extern void debug(struct SN_env * z, int number, int line_count)
     printf("'\n");
 }
 */
-
-    // Hack to rethrow unknown Exceptions from {@link MethodHandle#invoke}:
-    private static void rethrow(Throwable t) {
-      SnowballProgram.<Error>rethrow0(t);
-    }
-    
-    @SuppressWarnings("unchecked")
-    private static <T extends Throwable> void rethrow0(Throwable t) throws T {
-      throw (T) t;
-    }
 };
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a50887a/lucene/core/src/java/org/apache/lucene/util/AttributeFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/AttributeFactory.java b/lucene/core/src/java/org/apache/lucene/util/AttributeFactory.java
index 6c3d6db..70ccadf 100644
--- a/lucene/core/src/java/org/apache/lucene/util/AttributeFactory.java
+++ b/lucene/core/src/java/org/apache/lucene/util/AttributeFactory.java
@@ -20,6 +20,7 @@ package org.apache.lucene.util;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
+import java.lang.reflect.UndeclaredThrowableException;
 
 /**
  * An AttributeFactory creates instances of {@link AttributeImpl}s.
@@ -28,8 +29,14 @@ public abstract class AttributeFactory {
   
   /**
    * Returns an {@link AttributeImpl} for the supplied {@link Attribute} interface class.
+   * 
+   * @throws UndeclaredThrowableException A wrapper runtime exception thrown if the 
+   *         constructor of the attribute class throws a checked exception. 
+   *         Note that attributes should not throw or declare 
+   *         checked exceptions; this may be verified and fail early in the future. 
    */
-  public abstract AttributeImpl createAttributeInstance(Class<? extends Attribute> attClass);
+  public abstract AttributeImpl createAttributeInstance(Class<? extends Attribute> attClass)
+      throws UndeclaredThrowableException;
   
   /**
    * Returns a correctly typed {@link MethodHandle} for the no-arg ctor of the given class.
@@ -61,17 +68,18 @@ public abstract class AttributeFactory {
     };
 
     DefaultAttributeFactory() {}
-  
+
     @Override
     public AttributeImpl createAttributeInstance(Class<? extends Attribute> attClass) {
       try {
         return (AttributeImpl) constructors.get(attClass).invokeExact();
-      } catch (Throwable t) {
-        rethrow(t);
-        throw new AssertionError();
+      } catch (Error | RuntimeException e) {
+        throw e;
+      } catch (Throwable e) {
+        throw new UndeclaredThrowableException(e);
       }
     }
-    
+
     private Class<? extends AttributeImpl> findImplClass(Class<? extends Attribute> attClass) {
       try {
         return Class.forName(attClass.getName() + "Impl", true, attClass.getClassLoader()).asSubclass(AttributeImpl.class);
@@ -138,23 +146,12 @@ public abstract class AttributeFactory {
       protected A createInstance() {
         try {
           return (A) constr.invokeExact();
-        } catch (Throwable t) {
-          rethrow(t);
-          throw new AssertionError();
+        } catch (Error | RuntimeException e) {
+          throw e;
+        } catch (Throwable e) {
+          throw new UndeclaredThrowableException(e);
         }
       }
     };
   }
-  
-  // Hack to rethrow unknown Exceptions from {@link MethodHandle#invoke}:
-  // TODO: remove the impl in test-framework, this one is more elegant :-)
-  static void rethrow(Throwable t) {
-    AttributeFactory.<Error>rethrow0(t);
-  }
-  
-  @SuppressWarnings("unchecked")
-  private static <T extends Throwable> void rethrow0(Throwable t) throws T {
-    throw (T) t;
-  }
-  
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a50887a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java
----------------------------------------------------------------------
diff --git a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java
index 87e41c0..465d43c 100644
--- a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java
+++ b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java
@@ -188,15 +188,20 @@ public final class JavascriptCompiler {
   private Expression compileExpression(ClassLoader parent) throws ParseException {
     final Map<String, Integer> externalsMap = new LinkedHashMap<>();
     final ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
-    
-    generateClass(getAntlrParseTree(), classWriter, externalsMap);
-    
+
     try {
+      generateClass(getAntlrParseTree(), classWriter, externalsMap);
+
       final Class<? extends Expression> evaluatorClass = new Loader(parent)
         .define(COMPILED_EXPRESSION_CLASS, classWriter.toByteArray());
       final Constructor<? extends Expression> constructor = evaluatorClass.getConstructor(String.class, String[].class);
 
       return constructor.newInstance(sourceText, externalsMap.keySet().toArray(new String[externalsMap.size()]));
+    } catch (RuntimeException re) {
+      if (re.getCause() instanceof ParseException) {
+        throw (ParseException)re.getCause();
+      }
+      throw re;
     } catch (ReflectiveOperationException exception) {
       throw new IllegalStateException("An internal error occurred attempting to compile the expression (" + sourceText + ").", exception);
     }
@@ -209,20 +214,13 @@ public final class JavascriptCompiler {
    * @throws ParseException on failure to parse
    */
   private ParseTree getAntlrParseTree() throws ParseException {
-    try {
-      final ANTLRInputStream antlrInputStream = new ANTLRInputStream(sourceText);
-      final JavascriptErrorHandlingLexer javascriptLexer = new JavascriptErrorHandlingLexer(antlrInputStream);
-      javascriptLexer.removeErrorListeners();
-      final JavascriptParser javascriptParser = new JavascriptParser(new CommonTokenStream(javascriptLexer));
-      javascriptParser.removeErrorListeners();
-      javascriptParser.setErrorHandler(new JavascriptParserErrorStrategy());
-      return javascriptParser.compile();
-    } catch (RuntimeException re) {
-      if (re.getCause() instanceof ParseException) {
-        throw (ParseException)re.getCause();
-      }
-      throw re;
-    }
+    final ANTLRInputStream antlrInputStream = new ANTLRInputStream(sourceText);
+    final JavascriptErrorHandlingLexer javascriptLexer = new JavascriptErrorHandlingLexer(antlrInputStream);
+    javascriptLexer.removeErrorListeners();
+    final JavascriptParser javascriptParser = new JavascriptParser(new CommonTokenStream(javascriptLexer));
+    javascriptParser.removeErrorListeners();
+    javascriptParser.setErrorHandler(new JavascriptParserErrorStrategy());
+    return javascriptParser.compile();
   }
 
   /**
@@ -291,51 +289,56 @@ public final class JavascriptCompiler {
         boolean parens = ctx.LP() != null && ctx.RP() != null;
         Method method = parens ? functions.get(text) : null;
 
-        if (method != null) {
-          int arity = method.getParameterTypes().length;
-
-          if (arguments != arity) {
-            throwChecked(new ParseException(
-                "Invalid expression '" + sourceText + "': Expected (" + 
-                arity + ") arguments for function call (" + text + "), but found (" + arguments + ").", 
-                ctx.start.getStartIndex()));
-          }
-
-          typeStack.push(Type.DOUBLE_TYPE);
-
-          for (int argument = 0; argument < arguments; ++argument) {
-            visit(ctx.expression(argument));
-          }
-
-          typeStack.pop();
-
-          gen.invokeStatic(Type.getType(method.getDeclaringClass()),
-              org.objectweb.asm.commons.Method.getMethod(method));
-
-          gen.cast(Type.DOUBLE_TYPE, typeStack.peek());
-        } else if (!parens || arguments == 0 && text.contains(".")) {
-          int index;
-
-          text = normalizeQuotes(ctx.getText());
-
-          if (externalsMap.containsKey(text)) {
-            index = externalsMap.get(text);
+        try {
+          if (method != null) {
+            int arity = method.getParameterTypes().length;
+  
+            if (arguments != arity) {
+              throw new ParseException(
+                  "Invalid expression '" + sourceText + "': Expected (" + 
+                  arity + ") arguments for function call (" + text + "), but found (" + arguments + ").", 
+                  ctx.start.getStartIndex());
+            }
+  
+            typeStack.push(Type.DOUBLE_TYPE);
+  
+            for (int argument = 0; argument < arguments; ++argument) {
+              visit(ctx.expression(argument));
+            }
+  
+            typeStack.pop();
+  
+            gen.invokeStatic(Type.getType(method.getDeclaringClass()),
+                org.objectweb.asm.commons.Method.getMethod(method));
+  
+            gen.cast(Type.DOUBLE_TYPE, typeStack.peek());
+          } else if (!parens || arguments == 0 && text.contains(".")) {
+            int index;
+  
+            text = normalizeQuotes(ctx.getText());
+  
+            if (externalsMap.containsKey(text)) {
+              index = externalsMap.get(text);
+            } else {
+              index = externalsMap.size();
+              externalsMap.put(text, index);
+            }
+  
+            gen.loadArg(0);
+            gen.push(index);
+            gen.arrayLoad(FUNCTION_VALUES_TYPE);
+            gen.invokeVirtual(FUNCTION_VALUES_TYPE, DOUBLE_VAL_METHOD);
+            gen.cast(Type.DOUBLE_TYPE, typeStack.peek());
           } else {
-            index = externalsMap.size();
-            externalsMap.put(text, index);
+            throw new ParseException("Invalid expression '" + sourceText + "': Unrecognized function call (" +
+                text + ").", ctx.start.getStartIndex());
           }
-
-          gen.loadArg(0);
-          gen.push(index);
-          gen.arrayLoad(FUNCTION_VALUES_TYPE);
-          gen.invokeVirtual(FUNCTION_VALUES_TYPE, DOUBLE_VAL_METHOD);
-          gen.cast(Type.DOUBLE_TYPE, typeStack.peek());
-        } else {
-          throwChecked(new ParseException("Invalid expression '" + sourceText + "': Unrecognized function call (" +
-              text + ").", ctx.start.getStartIndex()));
+          return null;
+        } catch (ParseException e) {
+          // The API doesn't allow checked exceptions here, so propagate up the stack. This is unwrapped
+          // in getAntlrParseTree. 
+          throw new RuntimeException(e);
         }
-
-        return null;
       }
 
       @Override
@@ -623,16 +626,6 @@ public final class JavascriptCompiler {
             throw new IllegalStateException("Invalid expected type: " + typeStack.peek());
         }
       }
-      
-      /** Needed to throw checked ParseException in this visitor (that does not allow it). */
-      private void throwChecked(Throwable t) {
-        this.<Error>throwChecked0(t);
-      }
-      
-      @SuppressWarnings("unchecked")
-      private <T extends Throwable> void throwChecked0(Throwable t) throws T {
-        throw (T) t;
-      }
     }.visit(parseTree);
     
     gen.returnValue();


[03/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10661: Add copyOf Stream Evaluator

Posted by tf...@apache.org.
SOLR-10661: Add copyOf Stream Evaluator


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/17210362
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/17210362
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/17210362

Branch: refs/heads/jira/solr-10233
Commit: 17210362736c220ff4c12a448b238eed1212a9a8
Parents: 9be68cc
Author: Joel Bernstein <jb...@apache.org>
Authored: Mon May 15 15:02:42 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Mon May 15 15:03:15 2017 -0400

----------------------------------------------------------------------
 .../org/apache/solr/handler/StreamHandler.java  |  1 +
 .../client/solrj/io/stream/CopyOfEvaluator.java | 84 ++++++++++++++++++++
 .../solrj/io/stream/StreamExpressionTest.java   | 69 ++++++++++++++++
 3 files changed, 154 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/17210362/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index 270542a..ae62965 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -178,6 +178,7 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
       .withFunctionName("rank", RankEvaluator.class)
       .withFunctionName("scale", ScaleEvaluator.class)
       .withFunctionName("distance", DistanceEvaluator.class)
+      .withFunctionName("copyOf", CopyOfEvaluator.class)
 
       // metrics
          .withFunctionName("min", MinMetric.class)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/17210362/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CopyOfEvaluator.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CopyOfEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CopyOfEvaluator.java
new file mode 100644
index 0000000..2380e8f
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CopyOfEvaluator.java
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+package org.apache.solr.client.solrj.io.stream;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.eval.ComplexEvaluator;
+import org.apache.solr.client.solrj.io.eval.StreamEvaluator;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+
+public class CopyOfEvaluator extends ComplexEvaluator implements Expressible {
+
+  private static final long serialVersionUID = 1;
+
+  public CopyOfEvaluator(StreamExpression expression, StreamFactory factory) throws IOException {
+    super(expression, factory);
+  }
+
+  public List<Number> evaluate(Tuple tuple) throws IOException {
+    StreamEvaluator colEval1 = subEvaluators.get(0);
+
+    List<Number> numbers1 = (List<Number>)colEval1.evaluate(tuple);
+    double[] vals = new double[numbers1.size()];
+
+    for(int i=0; i<vals.length; i++) {
+      vals[i] = numbers1.get(i).doubleValue();
+    }
+
+    if(subEvaluators.size() == 2) {
+      StreamEvaluator lengthEval = subEvaluators.get(1);
+      Number lengthNum = (Number)lengthEval.evaluate(tuple);
+      int length = lengthNum.intValue();
+      vals = Arrays.copyOf(vals, length);
+    } else {
+      vals = Arrays.copyOf(vals, vals.length);
+    }
+
+    List<Number> copyOf = new ArrayList(vals.length);
+
+    for(int i=0; i<vals.length; i++) {
+      copyOf.add(vals[i]);
+    }
+
+    return copyOf;
+  }
+
+  @Override
+  public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException {
+    StreamExpression expression = new StreamExpression(factory.getFunctionName(getClass()));
+    return expression;
+  }
+
+  @Override
+  public Explanation toExplanation(StreamFactory factory) throws IOException {
+    return new Explanation(nodeId.toString())
+        .withExpressionType(ExpressionType.EVALUATOR)
+        .withFunctionName(factory.getFunctionName(getClass()))
+        .withImplementingClass(getClass().getName())
+        .withExpression(toExpression(factory).toString());
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/17210362/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 15acf12..58d4d5a 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -5398,6 +5398,75 @@ public class StreamExpressionTest extends SolrCloudTestCase {
     assertTrue(reverse.get(3).doubleValue() == 100D);
   }
 
+
+  @Test
+  public void testCopyOf() throws Exception {
+    UpdateRequest updateRequest = new UpdateRequest();
+
+    int i=0;
+    while(i<50) {
+      updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2016", "5", "1"), "price_f", "400.00");
+    }
+
+    while(i<100) {
+      updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2015", "5", "1"), "price_f", "300.0");
+    }
+
+    while(i<150) {
+      updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2014", "5", "1"), "price_f", "500.0");
+    }
+
+    while(i<250) {
+      updateRequest.add(id, "id_"+(++i),"test_dt", getDateString("2013", "5", "1"), "price_f", "100.00");
+    }
+
+    updateRequest.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+
+    String expr = "timeseries("+COLLECTIONORALIAS+", q=\"*:*\", start=\"2013-01-01T01:00:00.000Z\", " +
+        "end=\"2016-12-01T01:00:00.000Z\", " +
+        "gap=\"+1YEAR\", " +
+        "field=\"test_dt\", " +
+        "count(*), sum(price_f), max(price_f), min(price_f))";
+
+    String cexpr = "let(a="+expr+", c=col(a, max(price_f)), tuple(copy1=copyOf(c, 10), copy2=copyOf(c), copy3=copyOf(c, 2) ))";
+
+    ModifiableSolrParams paramsLoc = new ModifiableSolrParams();
+    paramsLoc.set("expr", cexpr);
+    paramsLoc.set("qt", "/stream");
+
+    String url = cluster.getJettySolrRunners().get(0).getBaseUrl().toString()+"/"+COLLECTIONORALIAS;
+    TupleStream solrStream = new SolrStream(url, paramsLoc);
+
+    StreamContext context = new StreamContext();
+    solrStream.setStreamContext(context);
+    List<Tuple> tuples = getTuples(solrStream);
+    assertTrue(tuples.size() == 1);
+    List<Number> copy1 = (List<Number>)tuples.get(0).get("copy1");
+    assertTrue(copy1.size() == 10);
+    assertTrue(copy1.get(0).doubleValue() == 100D);
+    assertTrue(copy1.get(1).doubleValue() == 500D);
+    assertTrue(copy1.get(2).doubleValue() == 300D);
+    assertTrue(copy1.get(3).doubleValue() == 400D);
+    assertTrue(copy1.get(4).doubleValue() == 0D);
+    assertTrue(copy1.get(5).doubleValue() == 0D);
+    assertTrue(copy1.get(6).doubleValue() == 0D);
+    assertTrue(copy1.get(7).doubleValue() == 0D);
+    assertTrue(copy1.get(8).doubleValue() == 0D);
+    assertTrue(copy1.get(9).doubleValue() == 0D);
+
+    List<Number> copy2 = (List<Number>)tuples.get(0).get("copy2");
+    assertTrue(copy2.size() == 4);
+    assertTrue(copy2.get(0).doubleValue() == 100D);
+    assertTrue(copy2.get(1).doubleValue() == 500D);
+    assertTrue(copy2.get(2).doubleValue() == 300D);
+    assertTrue(copy2.get(3).doubleValue() == 400D);
+
+    List<Number> copy3 = (List<Number>)tuples.get(0).get("copy3");
+    assertTrue(copy3.size() == 2);
+    assertTrue(copy3.get(0).doubleValue() == 100D);
+    assertTrue(copy3.get(1).doubleValue() == 500D);
+  }
+
   @Test
   public void testRankTransform() throws Exception {
     UpdateRequest updateRequest = new UpdateRequest();


[12/50] [abbrv] lucene-solr:jira/solr-10233: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr

Posted by tf...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/896270d1
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/896270d1
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/896270d1

Branch: refs/heads/jira/solr-10233
Commit: 896270d1321296f5851cd39671328619225eb5a6
Parents: c934093 5235903
Author: Cao Manh Dat <da...@apache.org>
Authored: Thu May 18 11:24:58 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Thu May 18 11:24:58 2017 +0700

----------------------------------------------------------------------
 lucene/CHANGES.txt                              |   6 +-
 .../org/apache/lucene/codecs/CodecUtil.java     |   6 +
 .../org/apache/lucene/codecs/TestCodecUtil.java |  13 +
 solr/CHANGES.txt                                |  30 +-
 solr/bin/install_solr_service.sh                |   8 +-
 solr/bin/solr                                   | 198 +++++++++--
 solr/bin/solr.cmd                               | 106 ++++--
 solr/bin/solr.in.cmd                            |   3 +
 solr/bin/solr.in.sh                             |   3 +
 .../org/apache/solr/cloud/RecoveryStrategy.java |   5 +-
 .../org/apache/solr/handler/SchemaHandler.java  |  10 -
 .../org/apache/solr/handler/StreamHandler.java  |   7 +
 .../apache/solr/response/SchemaXmlWriter.java   |   4 -
 .../org/apache/solr/schema/IndexSchema.java     |  26 +-
 .../apache/solr/schema/ManagedIndexSchema.java  |   2 -
 .../solr/search/ComplexPhraseQParserPlugin.java |   2 +-
 .../org/apache/solr/search/DisMaxQParser.java   |   5 +-
 .../solr/search/ExtendedDismaxQParser.java      |   3 +-
 .../org/apache/solr/search/LuceneQParser.java   |   4 +-
 .../org/apache/solr/search/QueryParsing.java    |  27 +-
 .../apache/solr/search/SimpleQParserPlugin.java |   2 +-
 .../apache/solr/servlet/SolrDispatchFilter.java |   2 +
 .../solr/update/DefaultSolrCoreState.java       |   4 +-
 .../src/java/org/apache/solr/util/SolrCLI.java  | 330 +++++++++++--------
 .../util/configuration/SSLConfigurations.java   |  78 +++++
 .../configuration/SSLConfigurationsFactory.java |  49 +++
 .../solr/util/configuration/package-info.java   |  23 ++
 .../src/resources/apispec/core.SchemaRead.json  |   3 +-
 .../conf/bad-schema-default-operator.xml        |  26 ++
 ...tSolrQueryParserDefaultOperatorResource.java |  29 --
 .../schema/TestSolrQueryParserResource.java     |  30 --
 .../apache/solr/schema/BadIndexSchemaTest.java  |   6 +-
 .../solr/schema/TestUseDocValuesAsStored.java   |   2 +-
 .../configuration/SSLConfigurationsTest.java    | 121 +++++++
 solr/server/etc/jetty-ssl.xml                   |   4 +-
 solr/solr-ref-guide/src/404.md                  |   6 -
 solr/solr-ref-guide/src/_config.yml.template    |  12 -
 solr/solr-ref-guide/src/_includes/archive.html  |  15 -
 solr/solr-ref-guide/src/_includes/feedback.html |  16 -
 solr/solr-ref-guide/src/_includes/footer.html   |   2 +-
 solr/solr-ref-guide/src/_includes/image.html    |   1 -
 .../src/_includes/inline_image.html             |   1 -
 solr/solr-ref-guide/src/_includes/links.html    |  44 ---
 solr/solr-ref-guide/src/_includes/topnav.html   |   3 -
 solr/solr-ref-guide/src/_layouts/post.html      |  41 ---
 solr/solr-ref-guide/src/css/ref-guide.css       |   2 +-
 solr/solr-ref-guide/src/draft-background.png    | Bin 5391 -> 0 bytes
 .../src/images/draft-background.png             | Bin 0 -> 5391 bytes
 .../src/images/solr-sunOnly-small.png           | Bin 0 -> 7528 bytes
 .../src/other-schema-elements.adoc              |   8 +-
 .../src/pdf/themes/refguide-theme.yml           |   2 +-
 solr/solr-ref-guide/src/schema-api.adoc         |  58 ----
 solr/solr-ref-guide/src/solr-sunOnly-small.png  | Bin 7528 -> 0 bytes
 .../src/the-dismax-query-parser.adoc            |   2 +-
 .../client/solrj/io/stream/CopyOfEvaluator.java |  84 +++++
 .../solrj/io/stream/DistanceEvaluator.java      |  77 +++++
 .../stream/EmpiricalDistributionEvaluator.java  | 129 ++++++++
 .../client/solrj/io/stream/LengthEvaluator.java |  60 ++++
 .../solrj/io/stream/PercentileEvaluator.java    |  68 ++++
 .../client/solrj/io/stream/RankEvaluator.java   |  75 +++++
 .../client/solrj/io/stream/ScaleEvaluator.java  |  78 +++++
 .../solrj/request/schema/SchemaRequest.java     |  19 --
 .../response/schema/SchemaRepresentation.java   |  10 -
 .../solrj/response/schema/SchemaResponse.java   |  28 --
 .../solrj/io/stream/StreamExpressionTest.java   | 330 +++++++++++++++++++
 .../solr/client/solrj/request/SchemaTest.java   |  10 -
 66 files changed, 1741 insertions(+), 617 deletions(-)
----------------------------------------------------------------------



[40/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10623: Fix pre-commit

Posted by tf...@apache.org.
SOLR-10623: Fix pre-commit


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c373b71b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c373b71b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c373b71b

Branch: refs/heads/jira/solr-10233
Commit: c373b71b254b12191236b6b87e3a8370837b4db6
Parents: f326cfb
Author: Joel Bernstein <jb...@apache.org>
Authored: Thu May 18 12:50:42 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Thu May 18 12:50:59 2017 -0400

----------------------------------------------------------------------
 .../java/org/apache/solr/client/solrj/io/stream/SqlStream.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c373b71b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
index 5a81b74..c91ba5c 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Random;
 import java.util.stream.Collectors;
 
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
@@ -252,7 +253,7 @@ public class SqlStream extends TupleStream implements Expressible {
     try {
 
       List<String> shardUrls = getShards(this.zkHost, this.collection, this.streamContext);
-      Collections.shuffle(shardUrls);
+      Collections.shuffle(shardUrls, new Random());
       String url  = shardUrls.get(0);
       ModifiableSolrParams mParams = new ModifiableSolrParams(params);
       mParams.add(CommonParams.QT, "/sql");


[14/50] [abbrv] lucene-solr:jira/solr-10233: Add missing double quote - from comment in Confluence

Posted by tf...@apache.org.
Add missing double quote - from comment in Confluence


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/318e546d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/318e546d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/318e546d

Branch: refs/heads/jira/solr-10233
Commit: 318e546d1b5526ca7cbfc8b8004d35fd0f715f82
Parents: 38205d7
Author: Jan Høydahl <ja...@apache.org>
Authored: Thu May 18 10:08:17 2017 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Thu May 18 10:08:17 2017 +0200

----------------------------------------------------------------------
 solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/318e546d/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc b/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
index cc85567..3e1cb28 100644
--- a/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
+++ b/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
@@ -164,7 +164,7 @@ curl --user solr:SolrRocks -H 'Content-type:application/json' -d '{
   "set-permission": {"collection": null,
                      "path":"/admin/collections",
                      "params":{"action":[LIST, CREATE]},
-                     "before: 3,
+                     "before": 3,
                      "role": "admin"}
 }' http://localhost:8983/solr/admin/authorization
 ----


[10/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10696: Add empirical distribution and percentile Stream Evaluators

Posted by tf...@apache.org.
SOLR-10696: Add empirical distribution and percentile Stream Evaluators


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/52359031
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/52359031
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/52359031

Branch: refs/heads/jira/solr-10233
Commit: 523590310775ba7c4276e738183ee6b4e9575167
Parents: c9abe7d
Author: Joel Bernstein <jb...@apache.org>
Authored: Tue May 16 20:01:50 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Tue May 16 20:12:25 2017 -0400

----------------------------------------------------------------------
 .../org/apache/solr/handler/StreamHandler.java  |   2 +
 .../stream/EmpiricalDistributionEvaluator.java  | 129 +++++++++++++++++++
 .../solrj/io/stream/PercentileEvaluator.java    |  68 ++++++++++
 .../solrj/io/stream/StreamExpressionTest.java   |  47 +++++++
 4 files changed, 246 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/52359031/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index ae62965..99f5cc3 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -179,6 +179,8 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
       .withFunctionName("scale", ScaleEvaluator.class)
       .withFunctionName("distance", DistanceEvaluator.class)
       .withFunctionName("copyOf", CopyOfEvaluator.class)
+      .withFunctionName("percentile", PercentileEvaluator.class)
+      .withFunctionName("empiricalDistribution", EmpiricalDistributionEvaluator.class)
 
       // metrics
          .withFunctionName("min", MinMetric.class)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/52359031/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EmpiricalDistributionEvaluator.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EmpiricalDistributionEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EmpiricalDistributionEvaluator.java
new file mode 100644
index 0000000..46d08f5
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EmpiricalDistributionEvaluator.java
@@ -0,0 +1,129 @@
+/*
+ * 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.
+ */
+package org.apache.solr.client.solrj.io.stream;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Arrays;
+
+import org.apache.commons.math3.random.EmpiricalDistribution;
+import org.apache.commons.math3.stat.descriptive.StatisticalSummary;
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.eval.ComplexEvaluator;
+import org.apache.solr.client.solrj.io.eval.StreamEvaluator;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+
+public class EmpiricalDistributionEvaluator extends ComplexEvaluator implements Expressible {
+
+  private static final long serialVersionUID = 1;
+
+  public EmpiricalDistributionEvaluator(StreamExpression expression, StreamFactory factory) throws IOException {
+    super(expression, factory);
+  }
+
+  public Tuple evaluate(Tuple tuple) throws IOException {
+
+    if(subEvaluators.size() != 1) {
+      throw new IOException("Empirical dist expects 1 column as a parameters");
+    }
+
+    StreamEvaluator colEval1 = subEvaluators.get(0);
+
+    List<Number> numbers1 = (List<Number>)colEval1.evaluate(tuple);
+    double[] column1 = new double[numbers1.size()];
+
+    for(int i=0; i<numbers1.size(); i++) {
+      column1[i] = numbers1.get(i).doubleValue();
+    }
+
+    Arrays.sort(column1);
+    EmpiricalDistribution empiricalDistribution = new EmpiricalDistribution();
+    empiricalDistribution.load(column1);
+
+    Map map = new HashMap();
+    StatisticalSummary statisticalSummary = empiricalDistribution.getSampleStats();
+
+    map.put("max", statisticalSummary.getMax());
+    map.put("mean", statisticalSummary.getMean());
+    map.put("min", statisticalSummary.getMin());
+    map.put("stdev", statisticalSummary.getStandardDeviation());
+    map.put("sum", statisticalSummary.getSum());
+    map.put("N", statisticalSummary.getN());
+    map.put("var", statisticalSummary.getVariance());
+
+    return new EmpiricalDistributionTuple(empiricalDistribution, column1, map);
+  }
+
+  public static class EmpiricalDistributionTuple extends Tuple {
+
+    private EmpiricalDistribution empiricalDistribution;
+    private double[] backingArray;
+
+    public EmpiricalDistributionTuple(EmpiricalDistribution empiricalDistribution, double[] backingArray, Map map) {
+      super(map);
+      this.empiricalDistribution = empiricalDistribution;
+      this.backingArray = backingArray;
+    }
+
+    public double percentile(double d) {
+      int slot = Arrays.binarySearch(backingArray, d);
+
+      if(slot == 0) {
+        return 0.0;
+      }
+
+      if(slot < 0) {
+        if(slot == -1) {
+          return 0.0D;
+        } else {
+          //Not a direct hit
+          slot = Math.abs(slot);
+          --slot;
+          if(slot == backingArray.length) {
+            return 1.0D;
+          } else {
+            return (this.empiricalDistribution.cumulativeProbability(backingArray[slot]));
+          }
+        }
+      } else {
+        return this.empiricalDistribution.cumulativeProbability(backingArray[slot]);
+      }
+    }
+  }
+
+  @Override
+  public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException {
+    StreamExpression expression = new StreamExpression(factory.getFunctionName(getClass()));
+    return expression;
+  }
+
+  @Override
+  public Explanation toExplanation(StreamFactory factory) throws IOException {
+    return new Explanation(nodeId.toString())
+        .withExpressionType(ExpressionType.EVALUATOR)
+        .withFunctionName(factory.getFunctionName(getClass()))
+        .withImplementingClass(getClass().getName())
+        .withExpression(toExpression(factory).toString());
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/52359031/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PercentileEvaluator.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PercentileEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PercentileEvaluator.java
new file mode 100644
index 0000000..2bf4d60
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PercentileEvaluator.java
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+package org.apache.solr.client.solrj.io.stream;
+
+import java.io.IOException;
+
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.eval.ComplexEvaluator;
+import org.apache.solr.client.solrj.io.eval.StreamEvaluator;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+
+public class PercentileEvaluator extends ComplexEvaluator implements Expressible {
+
+  private static final long serialVersionUID = 1;
+
+  public PercentileEvaluator(StreamExpression expression, StreamFactory factory) throws IOException {
+    super(expression, factory);
+  }
+
+  public Number evaluate(Tuple tuple) throws IOException {
+
+    if(subEvaluators.size() != 2) {
+      throw new IOException("Percentile expects 2 parameters: a regression result and a number");
+    }
+
+    StreamEvaluator r = subEvaluators.get(0);
+    StreamEvaluator d = subEvaluators.get(1);
+
+    EmpiricalDistributionEvaluator.EmpiricalDistributionTuple e = (EmpiricalDistributionEvaluator.EmpiricalDistributionTuple)r.evaluate(tuple);
+    Number n = (Number)d.evaluate(tuple);
+    return e.percentile(n.doubleValue());
+  }
+
+  @Override
+  public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException {
+    StreamExpression expression = new StreamExpression(factory.getFunctionName(getClass()));
+    return expression;
+  }
+
+  @Override
+  public Explanation toExplanation(StreamFactory factory) throws IOException {
+    return new Explanation(nodeId.toString())
+        .withExpressionType(ExpressionType.EVALUATOR)
+        .withFunctionName(factory.getFunctionName(getClass()))
+        .withImplementingClass(getClass().getName())
+        .withExpression(toExpression(factory).toString());
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/52359031/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 58d4d5a..129de1c 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -5467,6 +5467,53 @@ public class StreamExpressionTest extends SolrCloudTestCase {
     assertTrue(copy3.get(1).doubleValue() == 500D);
   }
 
+
+  @Test
+  public void testPercentiles() throws Exception {
+    UpdateRequest updateRequest = new UpdateRequest();
+
+    int i=0;
+    while(i<100) {
+      i=i+2;
+      updateRequest.add(id, "id_"+(i), "price_f", Integer.toString(i));
+    }
+
+    updateRequest.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+
+    String expr = "search("+COLLECTIONORALIAS+", q=\"*:*\", fl=\"price_f\", sort=\"price_f asc\", rows=\"200\")";
+    String cexpr = "let(a="+expr+", c=col(a, price_f), e=empiricalDistribution(c), " +
+        "tuple(p1=percentile(e, 88), " +
+        "p2=percentile(e, 2), " +
+        "p3=percentile(e, 99), " +
+        "p4=percentile(e, 77), " +
+        "p5=percentile(e, 98)))";
+
+    ModifiableSolrParams paramsLoc = new ModifiableSolrParams();
+    paramsLoc.set("expr", cexpr);
+    paramsLoc.set("qt", "/stream");
+
+    String url = cluster.getJettySolrRunners().get(0).getBaseUrl().toString()+"/"+COLLECTIONORALIAS;
+    TupleStream solrStream = new SolrStream(url, paramsLoc);
+
+    StreamContext context = new StreamContext();
+    solrStream.setStreamContext(context);
+    List<Tuple> tuples = getTuples(solrStream);
+    assertTrue(tuples.size() == 1);
+    double percentile1 = tuples.get(0).getDouble("p1");
+    double percentile2 = tuples.get(0).getDouble("p2");
+    double percentile3 = tuples.get(0).getDouble("p3");
+    double percentile4 = tuples.get(0).getDouble("p4");
+    double percentile5 = tuples.get(0).getDouble("p5");
+
+
+    assertEquals(.88D, percentile1, 0.001);
+    assertEquals(.0D, percentile2, 0.001);
+    assertEquals(1.0D, percentile3, 0.001);
+    assertEquals(.78D, percentile4, 0.001);
+    assertEquals(.98D, percentile5, 0.001);
+
+  }
+
   @Test
   public void testRankTransform() throws Exception {
     UpdateRequest updateRequest = new UpdateRequest();


[09/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10414: RecoveryStrategy is now a Runnable instead of a Thread

Posted by tf...@apache.org.
SOLR-10414: RecoveryStrategy is now a Runnable instead of a Thread


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c9abe7db
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c9abe7db
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c9abe7db

Branch: refs/heads/jira/solr-10233
Commit: c9abe7db23578545eaa67414778b501b2b115b8a
Parents: 942a085
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Tue May 16 17:03:10 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Tue May 16 17:03:10 2017 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                                | 2 ++
 solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java  | 5 ++---
 .../src/java/org/apache/solr/update/DefaultSolrCoreState.java   | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c9abe7db/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 85810ab4..acc29f4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -155,6 +155,8 @@ Other Changes
 * SOLR-10584: We'll now always throw an exception if defaultOperator is found in schema. This config has
   been deprecated since 3.6, and enforced for new configs since 6.6 (janhoy)
 
+* SOLR-10414: RecoveryStrategy is now a Runnable instead of a Thread. (Tomás Fernández Löbbe)
+
 ==================  6.7.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c9abe7db/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
index 496d082..7599b05 100644
--- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
+++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
@@ -74,7 +74,7 @@ import org.slf4j.LoggerFactory;
  * between versions in terms of API or back compat behaviour.
  * @lucene.experimental
  */
-public class RecoveryStrategy extends Thread implements Closeable {
+public class RecoveryStrategy implements Runnable, Closeable {
 
   public static class Builder implements NamedListInitializedPlugin {
     private NamedList args;
@@ -124,7 +124,6 @@ public class RecoveryStrategy extends Thread implements Closeable {
     this.cc = cc;
     this.coreName = cd.getName();
     this.recoveryListener = recoveryListener;
-    setName("RecoveryThread-"+this.coreName);
     zkController = cc.getZkController();
     zkStateReader = zkController.getZkStateReader();
     baseUrl = zkController.getBaseUrl();
@@ -370,7 +369,7 @@ public class RecoveryStrategy extends Thread implements Closeable {
     }
 
     Future<RecoveryInfo> replayFuture = null;
-    while (!successfulRecovery && !isInterrupted() && !isClosed()) { // don't use interruption or it will close channels though
+    while (!successfulRecovery && !Thread.currentThread().isInterrupted() && !isClosed()) { // don't use interruption or it will close channels though
       try {
         CloudDescriptor cloudDesc = core.getCoreDescriptor().getCloudDescriptor();
         ZkNodeProps leaderprops = zkStateReader.getLeaderRetry(

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c9abe7db/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
index bc2afa8..e38c28c 100644
--- a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
+++ b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
@@ -278,7 +278,7 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover
   @Override
   public void doRecovery(CoreContainer cc, CoreDescriptor cd) {
     
-    Thread thread = new Thread() {
+    Runnable recoveryTask = new Runnable() {
       @Override
       public void run() {
         MDCLoggingContext.setCoreDescriptor(cc, cd);
@@ -355,7 +355,7 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover
       // The recovery executor is not interrupted on shutdown.
       //
       // avoid deadlock: we can't use the recovery executor here
-      cc.getUpdateShardHandler().getUpdateExecutor().submit(thread);
+      cc.getUpdateShardHandler().getUpdateExecutor().submit(recoveryTask);
     } catch (RejectedExecutionException e) {
       // fine, we are shutting down
     }


[29/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/d3.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/d3.js b/solr/webapp/web/js/lib/d3.js
deleted file mode 100644
index 5015603..0000000
--- a/solr/webapp/web/js/lib/d3.js
+++ /dev/null
@@ -1,9373 +0,0 @@
-/*
-
-Copyright (c) 2013, Michael Bostock
-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.
-
-* The name Michael Bostock may not 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 MICHAEL BOSTOCK 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.
-
-*/
-
-(function(){if (!Date.now) Date.now = function() {
-  return +new Date;
-};
-try {
-  document.createElement("div").style.setProperty("opacity", 0, "");
-} catch (error) {
-  var d3_style_prototype = CSSStyleDeclaration.prototype,
-      d3_style_setProperty = d3_style_prototype.setProperty;
-  d3_style_prototype.setProperty = function(name, value, priority) {
-    d3_style_setProperty.call(this, name, value + "", priority);
-  };
-}
-d3 = {version: "2.8.1"}; // semver
-function d3_class(ctor, properties) {
-  try {
-    for (var key in properties) {
-      Object.defineProperty(ctor.prototype, key, {
-        value: properties[key],
-        enumerable: false
-      });
-    }
-  } catch (e) {
-    ctor.prototype = properties;
-  }
-}
-var d3_array = d3_arraySlice; // conversion for NodeLists
-
-function d3_arrayCopy(pseudoarray) {
-  var i = -1, n = pseudoarray.length, array = [];
-  while (++i < n) array.push(pseudoarray[i]);
-  return array;
-}
-
-function d3_arraySlice(pseudoarray) {
-  return Array.prototype.slice.call(pseudoarray);
-}
-
-try {
-  d3_array(document.documentElement.childNodes)[0].nodeType;
-} catch(e) {
-  d3_array = d3_arrayCopy;
-}
-
-var d3_arraySubclass = [].__proto__?
-
-// Until ECMAScript supports array subclassing, prototype injection works well.
-function(array, prototype) {
-  array.__proto__ = prototype;
-}:
-
-// And if your browser doesn't support __proto__, we'll use direct extension.
-function(array, prototype) {
-  for (var property in prototype) array[property] = prototype[property];
-};
-d3.map = function(object) {
-  var map = new d3_Map;
-  for (var key in object) map.set(key, object[key]);
-  return map;
-};
-
-function d3_Map() {}
-
-d3_class(d3_Map, {
-  has: function(key) {
-    return d3_map_prefix + key in this;
-  },
-  get: function(key) {
-    return this[d3_map_prefix + key];
-  },
-  set: function(key, value) {
-    return this[d3_map_prefix + key] = value;
-  },
-  remove: function(key) {
-    key = d3_map_prefix + key;
-    return key in this && delete this[key];
-  },
-  keys: function() {
-    var keys = [];
-    this.forEach(function(key) { keys.push(key); });
-    return keys;
-  },
-  values: function() {
-    var values = [];
-    this.forEach(function(key, value) { values.push(value); });
-    return values;
-  },
-  entries: function() {
-    var entries = [];
-    this.forEach(function(key, value) { entries.push({key: key, value: value}); });
-    return entries;
-  },
-  forEach: function(f) {
-    for (var key in this) {
-      if (key.charCodeAt(0) === d3_map_prefixCode) {
-        f.call(this, key.substring(1), this[key]);
-      }
-    }
-  }
-});
-
-var d3_map_prefix = "\0", // prevent collision with built-ins
-    d3_map_prefixCode = d3_map_prefix.charCodeAt(0);
-function d3_this() {
-  return this;
-}
-d3.functor = function(v) {
-  return typeof v === "function" ? v : function() { return v; };
-};
-// Copies a variable number of methods from source to target.
-d3.rebind = function(target, source) {
-  var i = 1, n = arguments.length, method;
-  while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
-  return target;
-};
-
-// Method is assumed to be a standard D3 getter-setter:
-// If passed with no arguments, gets the value.
-// If passed with arguments, sets the value and returns the target.
-function d3_rebind(target, source, method) {
-  return function() {
-    var value = method.apply(source, arguments);
-    return arguments.length ? target : value;
-  };
-}
-d3.ascending = function(a, b) {
-  return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
-};
-d3.descending = function(a, b) {
-  return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
-};
-d3.mean = function(array, f) {
-  var n = array.length,
-      a,
-      m = 0,
-      i = -1,
-      j = 0;
-  if (arguments.length === 1) {
-    while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j;
-  } else {
-    while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j;
-  }
-  return j ? m : undefined;
-};
-d3.median = function(array, f) {
-  if (arguments.length > 1) array = array.map(f);
-  array = array.filter(d3_number);
-  return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined;
-};
-d3.min = function(array, f) {
-  var i = -1,
-      n = array.length,
-      a,
-      b;
-  if (arguments.length === 1) {
-    while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
-    while (++i < n) if ((b = array[i]) != null && a > b) a = b;
-  } else {
-    while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined;
-    while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
-  }
-  return a;
-};
-d3.max = function(array, f) {
-  var i = -1,
-      n = array.length,
-      a,
-      b;
-  if (arguments.length === 1) {
-    while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
-    while (++i < n) if ((b = array[i]) != null && b > a) a = b;
-  } else {
-    while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined;
-    while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
-  }
-  return a;
-};
-d3.extent = function(array, f) {
-  var i = -1,
-      n = array.length,
-      a,
-      b,
-      c;
-  if (arguments.length === 1) {
-    while (++i < n && ((a = c = array[i]) == null || a != a)) a = c = undefined;
-    while (++i < n) if ((b = array[i]) != null) {
-      if (a > b) a = b;
-      if (c < b) c = b;
-    }
-  } else {
-    while (++i < n && ((a = c = f.call(array, array[i], i)) == null || a != a)) a = undefined;
-    while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
-      if (a > b) a = b;
-      if (c < b) c = b;
-    }
-  }
-  return [a, c];
-};
-d3.random = {
-  normal: function(mean, deviation) {
-    if (arguments.length < 2) deviation = 1;
-    if (arguments.length < 1) mean = 0;
-    return function() {
-      var x, y, r;
-      do {
-        x = Math.random() * 2 - 1;
-        y = Math.random() * 2 - 1;
-        r = x * x + y * y;
-      } while (!r || r > 1);
-      return mean + deviation * x * Math.sqrt(-2 * Math.log(r) / r);
-    };
-  }
-};
-function d3_number(x) {
-  return x != null && !isNaN(x);
-}
-d3.sum = function(array, f) {
-  var s = 0,
-      n = array.length,
-      a,
-      i = -1;
-
-  if (arguments.length === 1) {
-    while (++i < n) if (!isNaN(a = +array[i])) s += a;
-  } else {
-    while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a;
-  }
-
-  return s;
-};
-// R-7 per <http://en.wikipedia.org/wiki/Quantile>
-d3.quantile = function(values, p) {
-  var H = (values.length - 1) * p + 1,
-      h = Math.floor(H),
-      v = values[h - 1],
-      e = H - h;
-  return e ? v + e * (values[h] - v) : v;
-};
-d3.transpose = function(matrix) {
-  return d3.zip.apply(d3, matrix);
-};
-d3.zip = function() {
-  if (!(n = arguments.length)) return [];
-  for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m;) {
-    for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n;) {
-      zip[j] = arguments[j][i];
-    }
-  }
-  return zips;
-};
-
-function d3_zipLength(d) {
-  return d.length;
-}
-d3.bisector = function(f) {
-  return {
-    left: function(a, x, lo, hi) {
-      if (arguments.length < 3) lo = 0;
-      if (arguments.length < 4) hi = a.length;
-      while (lo < hi) {
-        var mid = lo + hi >> 1;
-        if (f.call(a, a[mid], mid) < x) lo = mid + 1;
-        else hi = mid;
-      }
-      return lo;
-    },
-    right: function(a, x, lo, hi) {
-      if (arguments.length < 3) lo = 0;
-      if (arguments.length < 4) hi = a.length;
-      while (lo < hi) {
-        var mid = lo + hi >> 1;
-        if (x < f.call(a, a[mid], mid)) hi = mid;
-        else lo = mid + 1;
-      }
-      return lo;
-    }
-  };
-};
-
-var d3_bisector = d3.bisector(function(d) { return d; });
-d3.bisectLeft = d3_bisector.left;
-d3.bisect = d3.bisectRight = d3_bisector.right;
-d3.first = function(array, f) {
-  var i = 0,
-      n = array.length,
-      a = array[0],
-      b;
-  if (arguments.length === 1) f = d3.ascending;
-  while (++i < n) {
-    if (f.call(array, a, b = array[i]) > 0) {
-      a = b;
-    }
-  }
-  return a;
-};
-d3.last = function(array, f) {
-  var i = 0,
-      n = array.length,
-      a = array[0],
-      b;
-  if (arguments.length === 1) f = d3.ascending;
-  while (++i < n) {
-    if (f.call(array, a, b = array[i]) <= 0) {
-      a = b;
-    }
-  }
-  return a;
-};
-d3.nest = function() {
-  var nest = {},
-      keys = [],
-      sortKeys = [],
-      sortValues,
-      rollup;
-
-  function map(array, depth) {
-    if (depth >= keys.length) return rollup
-        ? rollup.call(nest, array) : (sortValues
-        ? array.sort(sortValues)
-        : array);
-
-    var i = -1,
-        n = array.length,
-        key = keys[depth++],
-        keyValue,
-        object,
-        valuesByKey = new d3_Map,
-        values,
-        o = {};
-
-    while (++i < n) {
-      if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
-        values.push(object);
-      } else {
-        valuesByKey.set(keyValue, [object]);
-      }
-    }
-
-    valuesByKey.forEach(function(keyValue) {
-      o[keyValue] = map(valuesByKey.get(keyValue), depth);
-    });
-
-    return o;
-  }
-
-  function entries(map, depth) {
-    if (depth >= keys.length) return map;
-
-    var a = [],
-        sortKey = sortKeys[depth++],
-        key;
-
-    for (key in map) {
-      a.push({key: key, values: entries(map[key], depth)});
-    }
-
-    if (sortKey) a.sort(function(a, b) {
-      return sortKey(a.key, b.key);
-    });
-
-    return a;
-  }
-
-  nest.map = function(array) {
-    return map(array, 0);
-  };
-
-  nest.entries = function(array) {
-    return entries(map(array, 0), 0);
-  };
-
-  nest.key = function(d) {
-    keys.push(d);
-    return nest;
-  };
-
-  // Specifies the order for the most-recently specified key.
-  // Note: only applies to entries. Map keys are unordered!
-  nest.sortKeys = function(order) {
-    sortKeys[keys.length - 1] = order;
-    return nest;
-  };
-
-  // Specifies the order for leaf values.
-  // Applies to both maps and entries array.
-  nest.sortValues = function(order) {
-    sortValues = order;
-    return nest;
-  };
-
-  nest.rollup = function(f) {
-    rollup = f;
-    return nest;
-  };
-
-  return nest;
-};
-d3.keys = function(map) {
-  var keys = [];
-  for (var key in map) keys.push(key);
-  return keys;
-};
-d3.values = function(map) {
-  var values = [];
-  for (var key in map) values.push(map[key]);
-  return values;
-};
-d3.entries = function(map) {
-  var entries = [];
-  for (var key in map) entries.push({key: key, value: map[key]});
-  return entries;
-};
-d3.permute = function(array, indexes) {
-  var permutes = [],
-      i = -1,
-      n = indexes.length;
-  while (++i < n) permutes[i] = array[indexes[i]];
-  return permutes;
-};
-d3.merge = function(arrays) {
-  return Array.prototype.concat.apply([], arrays);
-};
-d3.split = function(array, f) {
-  var arrays = [],
-      values = [],
-      value,
-      i = -1,
-      n = array.length;
-  if (arguments.length < 2) f = d3_splitter;
-  while (++i < n) {
-    if (f.call(values, value = array[i], i)) {
-      values = [];
-    } else {
-      if (!values.length) arrays.push(values);
-      values.push(value);
-    }
-  }
-  return arrays;
-};
-
-function d3_splitter(d) {
-  return d == null;
-}
-function d3_collapse(s) {
-  return s.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
-}
-d3.range = function(start, stop, step) {
-  if (arguments.length < 3) {
-    step = 1;
-    if (arguments.length < 2) {
-      stop = start;
-      start = 0;
-    }
-  }
-  if ((stop - start) / step === Infinity) throw new Error("infinite range");
-  var range = [],
-       k = d3_range_integerScale(Math.abs(step)),
-       i = -1,
-       j;
-  start *= k, stop *= k, step *= k;
-  if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k);
-  else while ((j = start + step * ++i) < stop) range.push(j / k);
-  return range;
-};
-
-function d3_range_integerScale(x) {
-  var k = 1;
-  while (x * k % 1) k *= 10;
-  return k;
-}
-d3.requote = function(s) {
-  return s.replace(d3_requote_re, "\\$&");
-};
-
-var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
-d3.round = function(x, n) {
-  return n
-      ? Math.round(x * (n = Math.pow(10, n))) / n
-      : Math.round(x);
-};
-d3.xhr = function(url, mime, callback) {
-  var req = new XMLHttpRequest;
-  if (arguments.length < 3) callback = mime, mime = null;
-  else if (mime && req.overrideMimeType) req.overrideMimeType(mime);
-  req.open("GET", url, true);
-  if (mime) req.setRequestHeader("Accept", mime);
-  req.onreadystatechange = function() {
-    if (req.readyState === 4) callback(req.status < 300 ? req : null);
-  };
-  req.send(null);
-};
-d3.text = function(url, mime, callback) {
-  function ready(req) {
-    callback(req && req.responseText);
-  }
-  if (arguments.length < 3) {
-    callback = mime;
-    mime = null;
-  }
-  d3.xhr(url, mime, ready);
-};
-d3.json = function(url, callback) {
-  d3.text(url, "application/json", function(text) {
-    callback(text ? JSON.parse(text) : null);
-  });
-};
-d3.html = function(url, callback) {
-  d3.text(url, "text/html", function(text) {
-    if (text != null) { // Treat empty string as valid HTML.
-      var range = document.createRange();
-      range.selectNode(document.body);
-      text = range.createContextualFragment(text);
-    }
-    callback(text);
-  });
-};
-d3.xml = function(url, mime, callback) {
-  function ready(req) {
-    callback(req && req.responseXML);
-  }
-  if (arguments.length < 3) {
-    callback = mime;
-    mime = null;
-  }
-  d3.xhr(url, mime, ready);
-};
-var d3_nsPrefix = {
-  svg: "http://www.w3.org/2000/svg",
-  xhtml: "http://www.w3.org/1999/xhtml",
-  xlink: "http://www.w3.org/1999/xlink",
-  xml: "http://www.w3.org/XML/1998/namespace",
-  xmlns: "http://www.w3.org/2000/xmlns/"
-};
-
-d3.ns = {
-  prefix: d3_nsPrefix,
-  qualify: function(name) {
-    var i = name.indexOf(":"),
-        prefix = name;
-    if (i >= 0) {
-      prefix = name.substring(0, i);
-      name = name.substring(i + 1);
-    }
-    return d3_nsPrefix.hasOwnProperty(prefix)
-        ? {space: d3_nsPrefix[prefix], local: name}
-        : name;
-  }
-};
-d3.dispatch = function() {
-  var dispatch = new d3_dispatch,
-      i = -1,
-      n = arguments.length;
-  while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
-  return dispatch;
-};
-
-function d3_dispatch() {}
-
-d3_dispatch.prototype.on = function(type, listener) {
-  var i = type.indexOf("."),
-      name = "";
-
-  // Extract optional namespace, e.g., "click.foo"
-  if (i > 0) {
-    name = type.substring(i + 1);
-    type = type.substring(0, i);
-  }
-
-  return arguments.length < 2
-      ? this[type].on(name)
-      : this[type].on(name, listener);
-};
-
-function d3_dispatch_event(dispatch) {
-  var listeners = [],
-      listenerByName = new d3_Map;
-
-  function event() {
-    var z = listeners, // defensive reference
-        i = -1,
-        n = z.length,
-        l;
-    while (++i < n) if (l = z[i].on) l.apply(this, arguments);
-    return dispatch;
-  }
-
-  event.on = function(name, listener) {
-    var l = listenerByName.get(name),
-        i;
-
-    // return the current listener, if any
-    if (arguments.length < 2) return l && l.on;
-
-    // remove the old listener, if any (with copy-on-write)
-    if (l) {
-      l.on = null;
-      listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));
-      listenerByName.remove(name);
-    }
-
-    // add the new listener, if any
-    if (listener) listeners.push(listenerByName.set(name, {on: listener}));
-
-    return dispatch;
-  };
-
-  return event;
-}
-// TODO align
-d3.format = function(specifier) {
-  var match = d3_format_re.exec(specifier),
-      fill = match[1] || " ",
-      sign = match[3] || "",
-      zfill = match[5],
-      width = +match[6],
-      comma = match[7],
-      precision = match[8],
-      type = match[9],
-      scale = 1,
-      suffix = "",
-      integer = false;
-
-  if (precision) precision = +precision.substring(1);
-
-  if (zfill) {
-    fill = "0"; // TODO align = "=";
-    if (comma) width -= Math.floor((width - 1) / 4);
-  }
-
-  switch (type) {
-    case "n": comma = true; type = "g"; break;
-    case "%": scale = 100; suffix = "%"; type = "f"; break;
-    case "p": scale = 100; suffix = "%"; type = "r"; break;
-    case "d": integer = true; precision = 0; break;
-    case "s": scale = -1; type = "r"; break;
-  }
-
-  // If no precision is specified for r, fallback to general notation.
-  if (type == "r" && !precision) type = "g";
-
-  type = d3_format_types.get(type) || d3_format_typeDefault;
-
-  return function(value) {
-
-    // Return the empty string for floats formatted as ints.
-    if (integer && (value % 1)) return "";
-
-    // Convert negative to positive, and record the sign prefix.
-    var negative = (value < 0) && (value = -value) ? "\u2212" : sign;
-
-    // Apply the scale, computing it from the value's exponent for si format.
-    if (scale < 0) {
-      var prefix = d3.formatPrefix(value, precision);
-      value *= prefix.scale;
-      suffix = prefix.symbol;
-    } else {
-      value *= scale;
-    }
-
-    // Convert to the desired precision.
-    value = type(value, precision);
-
-    // If the fill character is 0, the sign and group is applied after the fill.
-    if (zfill) {
-      var length = value.length + negative.length;
-      if (length < width) value = new Array(width - length + 1).join(fill) + value;
-      if (comma) value = d3_format_group(value);
-      value = negative + value;
-    }
-
-    // Otherwise (e.g., space-filling), the sign and group is applied before.
-    else {
-      if (comma) value = d3_format_group(value);
-      value = negative + value;
-      var length = value.length;
-      if (length < width) value = new Array(width - length + 1).join(fill) + value;
-    }
-
-    return value + suffix;
-  };
-};
-
-// [[fill]align][sign][#][0][width][,][.precision][type]
-var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/;
-
-var d3_format_types = d3.map({
-  g: function(x, p) { return x.toPrecision(p); },
-  e: function(x, p) { return x.toExponential(p); },
-  f: function(x, p) { return x.toFixed(p); },
-  r: function(x, p) { return d3.round(x, p = d3_format_precision(x, p)).toFixed(Math.max(0, Math.min(20, p))); }
-});
-
-function d3_format_precision(x, p) {
-  return p - (x ? 1 + Math.floor(Math.log(x + Math.pow(10, 1 + Math.floor(Math.log(x) / Math.LN10) - p)) / Math.LN10) : 1);
-}
-
-function d3_format_typeDefault(x) {
-  return x + "";
-}
-
-// Apply comma grouping for thousands.
-function d3_format_group(value) {
-  var i = value.lastIndexOf("."),
-      f = i >= 0 ? value.substring(i) : (i = value.length, ""),
-      t = [];
-  while (i > 0) t.push(value.substring(i -= 3, i + 3));
-  return t.reverse().join(",") + f;
-}
-var d3_formatPrefixes = ["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix);
-
-d3.formatPrefix = function(value, precision) {
-  var i = 0;
-  if (value) {
-    if (value < 0) value *= -1;
-    if (precision) value = d3.round(value, d3_format_precision(value, precision));
-    i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
-    i = Math.max(-24, Math.min(24, Math.floor((i <= 0 ? i + 1 : i - 1) / 3) * 3));
-  }
-  return d3_formatPrefixes[8 + i / 3];
-};
-
-function d3_formatPrefix(d, i) {
-  return {
-    scale: Math.pow(10, (8 - i) * 3),
-    symbol: d
-  };
-}
-
-/*
- * TERMS OF USE - EASING EQUATIONS
- *
- * Open source under the BSD License.
- *
- * Copyright 2001 Robert Penner
- * 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 the author nor the names of 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.
- */
-
-var d3_ease_quad = d3_ease_poly(2),
-    d3_ease_cubic = d3_ease_poly(3),
-    d3_ease_default = function() { return d3_ease_identity; };
-
-var d3_ease = d3.map({
-  linear: d3_ease_default,
-  poly: d3_ease_poly,
-  quad: function() { return d3_ease_quad; },
-  cubic: function() { return d3_ease_cubic; },
-  sin: function() { return d3_ease_sin; },
-  exp: function() { return d3_ease_exp; },
-  circle: function() { return d3_ease_circle; },
-  elastic: d3_ease_elastic,
-  back: d3_ease_back,
-  bounce: function() { return d3_ease_bounce; }
-});
-
-var d3_ease_mode = d3.map({
-  "in": d3_ease_identity,
-  "out": d3_ease_reverse,
-  "in-out": d3_ease_reflect,
-  "out-in": function(f) { return d3_ease_reflect(d3_ease_reverse(f)); }
-});
-
-d3.ease = function(name) {
-  var i = name.indexOf("-"),
-      t = i >= 0 ? name.substring(0, i) : name,
-      m = i >= 0 ? name.substring(i + 1) : "in";
-  t = d3_ease.get(t) || d3_ease_default;
-  m = d3_ease_mode.get(m) || d3_ease_identity;
-  return d3_ease_clamp(m(t.apply(null, Array.prototype.slice.call(arguments, 1))));
-};
-
-function d3_ease_clamp(f) {
-  return function(t) {
-    return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
-  };
-}
-
-function d3_ease_reverse(f) {
-  return function(t) {
-    return 1 - f(1 - t);
-  };
-}
-
-function d3_ease_reflect(f) {
-  return function(t) {
-    return .5 * (t < .5 ? f(2 * t) : (2 - f(2 - 2 * t)));
-  };
-}
-
-function d3_ease_identity(t) {
-  return t;
-}
-
-function d3_ease_poly(e) {
-  return function(t) {
-    return Math.pow(t, e);
-  };
-}
-
-function d3_ease_sin(t) {
-  return 1 - Math.cos(t * Math.PI / 2);
-}
-
-function d3_ease_exp(t) {
-  return Math.pow(2, 10 * (t - 1));
-}
-
-function d3_ease_circle(t) {
-  return 1 - Math.sqrt(1 - t * t);
-}
-
-function d3_ease_elastic(a, p) {
-  var s;
-  if (arguments.length < 2) p = 0.45;
-  if (arguments.length < 1) { a = 1; s = p / 4; }
-  else s = p / (2 * Math.PI) * Math.asin(1 / a);
-  return function(t) {
-    return 1 + a * Math.pow(2, 10 * -t) * Math.sin((t - s) * 2 * Math.PI / p);
-  };
-}
-
-function d3_ease_back(s) {
-  if (!s) s = 1.70158;
-  return function(t) {
-    return t * t * ((s + 1) * t - s);
-  };
-}
-
-function d3_ease_bounce(t) {
-  return t < 1 / 2.75 ? 7.5625 * t * t
-      : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75
-      : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375
-      : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
-}
-d3.event = null;
-
-function d3_eventCancel() {
-  d3.event.stopPropagation();
-  d3.event.preventDefault();
-}
-
-function d3_eventSource() {
-  var e = d3.event, s;
-  while (s = e.sourceEvent) e = s;
-  return e;
-}
-
-// Like d3.dispatch, but for custom events abstracting native UI events. These
-// events have a target component (such as a brush), a target element (such as
-// the svg:g element containing the brush) and the standard arguments `d` (the
-// target element's data) and `i` (the selection index of the target element).
-function d3_eventDispatch(target) {
-  var dispatch = new d3_dispatch,
-      i = 0,
-      n = arguments.length;
-
-  while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
-
-  // Creates a dispatch context for the specified `thiz` (typically, the target
-  // DOM element that received the source event) and `argumentz` (typically, the
-  // data `d` and index `i` of the target element). The returned function can be
-  // used to dispatch an event to any registered listeners; the function takes a
-  // single argument as input, being the event to dispatch. The event must have
-  // a "type" attribute which corresponds to a type registered in the
-  // constructor. This context will automatically populate the "sourceEvent" and
-  // "target" attributes of the event, as well as setting the `d3.event` global
-  // for the duration of the notification.
-  dispatch.of = function(thiz, argumentz) {
-    return function(e1) {
-      try {
-        var e0 =
-        e1.sourceEvent = d3.event;
-        e1.target = target;
-        d3.event = e1;
-        dispatch[e1.type].apply(thiz, argumentz);
-      } finally {
-        d3.event = e0;
-      }
-    };
-  };
-
-  return dispatch;
-}
-d3.interpolate = function(a, b) {
-  var i = d3.interpolators.length, f;
-  while (--i >= 0 && !(f = d3.interpolators[i](a, b)));
-  return f;
-};
-
-d3.interpolateNumber = function(a, b) {
-  b -= a;
-  return function(t) { return a + b * t; };
-};
-
-d3.interpolateRound = function(a, b) {
-  b -= a;
-  return function(t) { return Math.round(a + b * t); };
-};
-
-d3.interpolateString = function(a, b) {
-  var m, // current match
-      i, // current index
-      j, // current index (for coallescing)
-      s0 = 0, // start index of current string prefix
-      s1 = 0, // end index of current string prefix
-      s = [], // string constants and placeholders
-      q = [], // number interpolators
-      n, // q.length
-      o;
-
-  // Reset our regular expression!
-  d3_interpolate_number.lastIndex = 0;
-
-  // Find all numbers in b.
-  for (i = 0; m = d3_interpolate_number.exec(b); ++i) {
-    if (m.index) s.push(b.substring(s0, s1 = m.index));
-    q.push({i: s.length, x: m[0]});
-    s.push(null);
-    s0 = d3_interpolate_number.lastIndex;
-  }
-  if (s0 < b.length) s.push(b.substring(s0));
-
-  // Find all numbers in a.
-  for (i = 0, n = q.length; (m = d3_interpolate_number.exec(a)) && i < n; ++i) {
-    o = q[i];
-    if (o.x == m[0]) { // The numbers match, so coallesce.
-      if (o.i) {
-        if (s[o.i + 1] == null) { // This match is followed by another number.
-          s[o.i - 1] += o.x;
-          s.splice(o.i, 1);
-          for (j = i + 1; j < n; ++j) q[j].i--;
-        } else { // This match is followed by a string, so coallesce twice.
-          s[o.i - 1] += o.x + s[o.i + 1];
-          s.splice(o.i, 2);
-          for (j = i + 1; j < n; ++j) q[j].i -= 2;
-        }
-      } else {
-          if (s[o.i + 1] == null) { // This match is followed by another number.
-          s[o.i] = o.x;
-        } else { // This match is followed by a string, so coallesce twice.
-          s[o.i] = o.x + s[o.i + 1];
-          s.splice(o.i + 1, 1);
-          for (j = i + 1; j < n; ++j) q[j].i--;
-        }
-      }
-      q.splice(i, 1);
-      n--;
-      i--;
-    } else {
-      o.x = d3.interpolateNumber(parseFloat(m[0]), parseFloat(o.x));
-    }
-  }
-
-  // Remove any numbers in b not found in a.
-  while (i < n) {
-    o = q.pop();
-    if (s[o.i + 1] == null) { // This match is followed by another number.
-      s[o.i] = o.x;
-    } else { // This match is followed by a string, so coallesce twice.
-      s[o.i] = o.x + s[o.i + 1];
-      s.splice(o.i + 1, 1);
-    }
-    n--;
-  }
-
-  // Special optimization for only a single match.
-  if (s.length === 1) {
-    return s[0] == null ? q[0].x : function() { return b; };
-  }
-
-  // Otherwise, interpolate each of the numbers and rejoin the string.
-  return function(t) {
-    for (i = 0; i < n; ++i) s[(o = q[i]).i] = o.x(t);
-    return s.join("");
-  };
-};
-
-d3.interpolateTransform = function(a, b) {
-  var s = [], // string constants and placeholders
-      q = [], // number interpolators
-      n,
-      A = d3.transform(a),
-      B = d3.transform(b),
-      ta = A.translate,
-      tb = B.translate,
-      ra = A.rotate,
-      rb = B.rotate,
-      wa = A.skew,
-      wb = B.skew,
-      ka = A.scale,
-      kb = B.scale;
-
-  if (ta[0] != tb[0] || ta[1] != tb[1]) {
-    s.push("translate(", null, ",", null, ")");
-    q.push({i: 1, x: d3.interpolateNumber(ta[0], tb[0])}, {i: 3, x: d3.interpolateNumber(ta[1], tb[1])});
-  } else if (tb[0] || tb[1]) {
-    s.push("translate(" + tb + ")");
-  } else {
-    s.push("");
-  }
-
-  if (ra != rb) {
-    q.push({i: s.push(s.pop() + "rotate(", null, ")") - 2, x: d3.interpolateNumber(ra, rb)});
-  } else if (rb) {
-    s.push(s.pop() + "rotate(" + rb + ")");
-  }
-
-  if (wa != wb) {
-    q.push({i: s.push(s.pop() + "skewX(", null, ")") - 2, x: d3.interpolateNumber(wa, wb)});
-  } else if (wb) {
-    s.push(s.pop() + "skewX(" + wb + ")");
-  }
-
-  if (ka[0] != kb[0] || ka[1] != kb[1]) {
-    n = s.push(s.pop() + "scale(", null, ",", null, ")");
-    q.push({i: n - 4, x: d3.interpolateNumber(ka[0], kb[0])}, {i: n - 2, x: d3.interpolateNumber(ka[1], kb[1])});
-  } else if (kb[0] != 1 || kb[1] != 1) {
-    s.push(s.pop() + "scale(" + kb + ")");
-  }
-
-  n = q.length;
-  return function(t) {
-    var i = -1, o;
-    while (++i < n) s[(o = q[i]).i] = o.x(t);
-    return s.join("");
-  };
-};
-
-d3.interpolateRgb = function(a, b) {
-  a = d3.rgb(a);
-  b = d3.rgb(b);
-  var ar = a.r,
-      ag = a.g,
-      ab = a.b,
-      br = b.r - ar,
-      bg = b.g - ag,
-      bb = b.b - ab;
-  return function(t) {
-    return "#"
-        + d3_rgb_hex(Math.round(ar + br * t))
-        + d3_rgb_hex(Math.round(ag + bg * t))
-        + d3_rgb_hex(Math.round(ab + bb * t));
-  };
-};
-
-// interpolates HSL space, but outputs RGB string (for compatibility)
-d3.interpolateHsl = function(a, b) {
-  a = d3.hsl(a);
-  b = d3.hsl(b);
-  var h0 = a.h,
-      s0 = a.s,
-      l0 = a.l,
-      h1 = b.h - h0,
-      s1 = b.s - s0,
-      l1 = b.l - l0;
-  return function(t) {
-    return d3_hsl_rgb(h0 + h1 * t, s0 + s1 * t, l0 + l1 * t).toString();
-  };
-};
-
-d3.interpolateArray = function(a, b) {
-  var x = [],
-      c = [],
-      na = a.length,
-      nb = b.length,
-      n0 = Math.min(a.length, b.length),
-      i;
-  for (i = 0; i < n0; ++i) x.push(d3.interpolate(a[i], b[i]));
-  for (; i < na; ++i) c[i] = a[i];
-  for (; i < nb; ++i) c[i] = b[i];
-  return function(t) {
-    for (i = 0; i < n0; ++i) c[i] = x[i](t);
-    return c;
-  };
-};
-
-d3.interpolateObject = function(a, b) {
-  var i = {},
-      c = {},
-      k;
-  for (k in a) {
-    if (k in b) {
-      i[k] = d3_interpolateByName(k)(a[k], b[k]);
-    } else {
-      c[k] = a[k];
-    }
-  }
-  for (k in b) {
-    if (!(k in a)) {
-      c[k] = b[k];
-    }
-  }
-  return function(t) {
-    for (k in i) c[k] = i[k](t);
-    return c;
-  };
-}
-
-var d3_interpolate_number = /[-+]?(?:\d*\.?\d+)(?:[eE][-+]?\d+)?/g;
-
-function d3_interpolateByName(n) {
-  return n == "transform"
-      ? d3.interpolateTransform
-      : d3.interpolate;
-}
-
-d3.interpolators = [
-  d3.interpolateObject,
-  function(a, b) { return (b instanceof Array) && d3.interpolateArray(a, b); },
-  function(a, b) { return (typeof a === "string" || typeof b === "string") && d3.interpolateString(a + "", b + ""); },
-  function(a, b) { return (typeof b === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) : b instanceof d3_Rgb || b instanceof d3_Hsl) && d3.interpolateRgb(a, b); },
-  function(a, b) { return !isNaN(a = +a) && !isNaN(b = +b) && d3.interpolateNumber(a, b); }
-];
-function d3_uninterpolateNumber(a, b) {
-  b = b - (a = +a) ? 1 / (b - a) : 0;
-  return function(x) { return (x - a) * b; };
-}
-
-function d3_uninterpolateClamp(a, b) {
-  b = b - (a = +a) ? 1 / (b - a) : 0;
-  return function(x) { return Math.max(0, Math.min(1, (x - a) * b)); };
-}
-d3.rgb = function(r, g, b) {
-  return arguments.length === 1
-      ? (r instanceof d3_Rgb ? d3_rgb(r.r, r.g, r.b)
-      : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb))
-      : d3_rgb(~~r, ~~g, ~~b);
-};
-
-function d3_rgb(r, g, b) {
-  return new d3_Rgb(r, g, b);
-}
-
-function d3_Rgb(r, g, b) {
-  this.r = r;
-  this.g = g;
-  this.b = b;
-}
-
-d3_Rgb.prototype.brighter = function(k) {
-  k = Math.pow(0.7, arguments.length ? k : 1);
-  var r = this.r,
-      g = this.g,
-      b = this.b,
-      i = 30;
-  if (!r && !g && !b) return d3_rgb(i, i, i);
-  if (r && r < i) r = i;
-  if (g && g < i) g = i;
-  if (b && b < i) b = i;
-  return d3_rgb(
-      Math.min(255, Math.floor(r / k)),
-      Math.min(255, Math.floor(g / k)),
-      Math.min(255, Math.floor(b / k)));
-};
-
-d3_Rgb.prototype.darker = function(k) {
-  k = Math.pow(0.7, arguments.length ? k : 1);
-  return d3_rgb(
-      Math.floor(k * this.r),
-      Math.floor(k * this.g),
-      Math.floor(k * this.b));
-};
-
-d3_Rgb.prototype.hsl = function() {
-  return d3_rgb_hsl(this.r, this.g, this.b);
-};
-
-d3_Rgb.prototype.toString = function() {
-  return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);
-};
-
-function d3_rgb_hex(v) {
-  return v < 0x10
-      ? "0" + Math.max(0, v).toString(16)
-      : Math.min(255, v).toString(16);
-}
-
-function d3_rgb_parse(format, rgb, hsl) {
-  var r = 0, // red channel; int in [0, 255]
-      g = 0, // green channel; int in [0, 255]
-      b = 0, // blue channel; int in [0, 255]
-      m1, // CSS color specification match
-      m2, // CSS color specification type (e.g., rgb)
-      name;
-
-  /* Handle hsl, rgb. */
-  m1 = /([a-z]+)\((.*)\)/i.exec(format);
-  if (m1) {
-    m2 = m1[2].split(",");
-    switch (m1[1]) {
-      case "hsl": {
-        return hsl(
-          parseFloat(m2[0]), // degrees
-          parseFloat(m2[1]) / 100, // percentage
-          parseFloat(m2[2]) / 100 // percentage
-        );
-      }
-      case "rgb": {
-        return rgb(
-          d3_rgb_parseNumber(m2[0]),
-          d3_rgb_parseNumber(m2[1]),
-          d3_rgb_parseNumber(m2[2])
-        );
-      }
-    }
-  }
-
-  /* Named colors. */
-  if (name = d3_rgb_names.get(format)) return rgb(name.r, name.g, name.b);
-
-  /* Hexadecimal colors: #rgb and #rrggbb. */
-  if (format != null && format.charAt(0) === "#") {
-    if (format.length === 4) {
-      r = format.charAt(1); r += r;
-      g = format.charAt(2); g += g;
-      b = format.charAt(3); b += b;
-    } else if (format.length === 7) {
-      r = format.substring(1, 3);
-      g = format.substring(3, 5);
-      b = format.substring(5, 7);
-    }
-    r = parseInt(r, 16);
-    g = parseInt(g, 16);
-    b = parseInt(b, 16);
-  }
-
-  return rgb(r, g, b);
-}
-
-function d3_rgb_hsl(r, g, b) {
-  var min = Math.min(r /= 255, g /= 255, b /= 255),
-      max = Math.max(r, g, b),
-      d = max - min,
-      h,
-      s,
-      l = (max + min) / 2;
-  if (d) {
-    s = l < .5 ? d / (max + min) : d / (2 - max - min);
-    if (r == max) h = (g - b) / d + (g < b ? 6 : 0);
-    else if (g == max) h = (b - r) / d + 2;
-    else h = (r - g) / d + 4;
-    h *= 60;
-  } else {
-    s = h = 0;
-  }
-  return d3_hsl(h, s, l);
-}
-
-function d3_rgb_parseNumber(c) { // either integer or percentage
-  var f = parseFloat(c);
-  return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f;
-}
-
-var d3_rgb_names = d3.map({
-  aliceblue: "#f0f8ff",
-  antiquewhite: "#faebd7",
-  aqua: "#00ffff",
-  aquamarine: "#7fffd4",
-  azure: "#f0ffff",
-  beige: "#f5f5dc",
-  bisque: "#ffe4c4",
-  black: "#000000",
-  blanchedalmond: "#ffebcd",
-  blue: "#0000ff",
-  blueviolet: "#8a2be2",
-  brown: "#a52a2a",
-  burlywood: "#deb887",
-  cadetblue: "#5f9ea0",
-  chartreuse: "#7fff00",
-  chocolate: "#d2691e",
-  coral: "#ff7f50",
-  cornflowerblue: "#6495ed",
-  cornsilk: "#fff8dc",
-  crimson: "#dc143c",
-  cyan: "#00ffff",
-  darkblue: "#00008b",
-  darkcyan: "#008b8b",
-  darkgoldenrod: "#b8860b",
-  darkgray: "#a9a9a9",
-  darkgreen: "#006400",
-  darkgrey: "#a9a9a9",
-  darkkhaki: "#bdb76b",
-  darkmagenta: "#8b008b",
-  darkolivegreen: "#556b2f",
-  darkorange: "#ff8c00",
-  darkorchid: "#9932cc",
-  darkred: "#8b0000",
-  darksalmon: "#e9967a",
-  darkseagreen: "#8fbc8f",
-  darkslateblue: "#483d8b",
-  darkslategray: "#2f4f4f",
-  darkslategrey: "#2f4f4f",
-  darkturquoise: "#00ced1",
-  darkviolet: "#9400d3",
-  deeppink: "#ff1493",
-  deepskyblue: "#00bfff",
-  dimgray: "#696969",
-  dimgrey: "#696969",
-  dodgerblue: "#1e90ff",
-  firebrick: "#b22222",
-  floralwhite: "#fffaf0",
-  forestgreen: "#228b22",
-  fuchsia: "#ff00ff",
-  gainsboro: "#dcdcdc",
-  ghostwhite: "#f8f8ff",
-  gold: "#ffd700",
-  goldenrod: "#daa520",
-  gray: "#808080",
-  green: "#008000",
-  greenyellow: "#adff2f",
-  grey: "#808080",
-  honeydew: "#f0fff0",
-  hotpink: "#ff69b4",
-  indianred: "#cd5c5c",
-  indigo: "#4b0082",
-  ivory: "#fffff0",
-  khaki: "#f0e68c",
-  lavender: "#e6e6fa",
-  lavenderblush: "#fff0f5",
-  lawngreen: "#7cfc00",
-  lemonchiffon: "#fffacd",
-  lightblue: "#add8e6",
-  lightcoral: "#f08080",
-  lightcyan: "#e0ffff",
-  lightgoldenrodyellow: "#fafad2",
-  lightgray: "#d3d3d3",
-  lightgreen: "#90ee90",
-  lightgrey: "#d3d3d3",
-  lightpink: "#ffb6c1",
-  lightsalmon: "#ffa07a",
-  lightseagreen: "#20b2aa",
-  lightskyblue: "#87cefa",
-  lightslategray: "#778899",
-  lightslategrey: "#778899",
-  lightsteelblue: "#b0c4de",
-  lightyellow: "#ffffe0",
-  lime: "#00ff00",
-  limegreen: "#32cd32",
-  linen: "#faf0e6",
-  magenta: "#ff00ff",
-  maroon: "#800000",
-  mediumaquamarine: "#66cdaa",
-  mediumblue: "#0000cd",
-  mediumorchid: "#ba55d3",
-  mediumpurple: "#9370db",
-  mediumseagreen: "#3cb371",
-  mediumslateblue: "#7b68ee",
-  mediumspringgreen: "#00fa9a",
-  mediumturquoise: "#48d1cc",
-  mediumvioletred: "#c71585",
-  midnightblue: "#191970",
-  mintcream: "#f5fffa",
-  mistyrose: "#ffe4e1",
-  moccasin: "#ffe4b5",
-  navajowhite: "#ffdead",
-  navy: "#000080",
-  oldlace: "#fdf5e6",
-  olive: "#808000",
-  olivedrab: "#6b8e23",
-  orange: "#ffa500",
-  orangered: "#ff4500",
-  orchid: "#da70d6",
-  palegoldenrod: "#eee8aa",
-  palegreen: "#98fb98",
-  paleturquoise: "#afeeee",
-  palevioletred: "#db7093",
-  papayawhip: "#ffefd5",
-  peachpuff: "#ffdab9",
-  peru: "#cd853f",
-  pink: "#ffc0cb",
-  plum: "#dda0dd",
-  powderblue: "#b0e0e6",
-  purple: "#800080",
-  red: "#ff0000",
-  rosybrown: "#bc8f8f",
-  royalblue: "#4169e1",
-  saddlebrown: "#8b4513",
-  salmon: "#fa8072",
-  sandybrown: "#f4a460",
-  seagreen: "#2e8b57",
-  seashell: "#fff5ee",
-  sienna: "#a0522d",
-  silver: "#c0c0c0",
-  skyblue: "#87ceeb",
-  slateblue: "#6a5acd",
-  slategray: "#708090",
-  slategrey: "#708090",
-  snow: "#fffafa",
-  springgreen: "#00ff7f",
-  steelblue: "#4682b4",
-  tan: "#d2b48c",
-  teal: "#008080",
-  thistle: "#d8bfd8",
-  tomato: "#ff6347",
-  turquoise: "#40e0d0",
-  violet: "#ee82ee",
-  wheat: "#f5deb3",
-  white: "#ffffff",
-  whitesmoke: "#f5f5f5",
-  yellow: "#ffff00",
-  yellowgreen: "#9acd32"
-});
-
-d3_rgb_names.forEach(function(key, value) {
-  d3_rgb_names.set(key, d3_rgb_parse(value, d3_rgb, d3_hsl_rgb));
-});
-d3.hsl = function(h, s, l) {
-  return arguments.length === 1
-      ? (h instanceof d3_Hsl ? d3_hsl(h.h, h.s, h.l)
-      : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl))
-      : d3_hsl(+h, +s, +l);
-};
-
-function d3_hsl(h, s, l) {
-  return new d3_Hsl(h, s, l);
-}
-
-function d3_Hsl(h, s, l) {
-  this.h = h;
-  this.s = s;
-  this.l = l;
-}
-
-d3_Hsl.prototype.brighter = function(k) {
-  k = Math.pow(0.7, arguments.length ? k : 1);
-  return d3_hsl(this.h, this.s, this.l / k);
-};
-
-d3_Hsl.prototype.darker = function(k) {
-  k = Math.pow(0.7, arguments.length ? k : 1);
-  return d3_hsl(this.h, this.s, k * this.l);
-};
-
-d3_Hsl.prototype.rgb = function() {
-  return d3_hsl_rgb(this.h, this.s, this.l);
-};
-
-d3_Hsl.prototype.toString = function() {
-  return this.rgb().toString();
-};
-
-function d3_hsl_rgb(h, s, l) {
-  var m1,
-      m2;
-
-  /* Some simple corrections for h, s and l. */
-  h = h % 360; if (h < 0) h += 360;
-  s = s < 0 ? 0 : s > 1 ? 1 : s;
-  l = l < 0 ? 0 : l > 1 ? 1 : l;
-
-  /* From FvD 13.37, CSS Color Module Level 3 */
-  m2 = l <= .5 ? l * (1 + s) : l + s - l * s;
-  m1 = 2 * l - m2;
-
-  function v(h) {
-    if (h > 360) h -= 360;
-    else if (h < 0) h += 360;
-    if (h < 60) return m1 + (m2 - m1) * h / 60;
-    if (h < 180) return m2;
-    if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;
-    return m1;
-  }
-
-  function vv(h) {
-    return Math.round(v(h) * 255);
-  }
-
-  return d3_rgb(vv(h + 120), vv(h), vv(h - 120));
-}
-function d3_selection(groups) {
-  d3_arraySubclass(groups, d3_selectionPrototype);
-  return groups;
-}
-
-var d3_select = function(s, n) { return n.querySelector(s); },
-    d3_selectAll = function(s, n) { return n.querySelectorAll(s); },
-    d3_selectRoot = document.documentElement,
-    d3_selectMatcher = d3_selectRoot.matchesSelector || d3_selectRoot.webkitMatchesSelector || d3_selectRoot.mozMatchesSelector || d3_selectRoot.msMatchesSelector || d3_selectRoot.oMatchesSelector,
-    d3_selectMatches = function(n, s) { return d3_selectMatcher.call(n, s); };
-
-// Prefer Sizzle, if available.
-if (typeof Sizzle === "function") {
-  d3_select = function(s, n) { return Sizzle(s, n)[0]; };
-  d3_selectAll = function(s, n) { return Sizzle.uniqueSort(Sizzle(s, n)); };
-  d3_selectMatches = Sizzle.matchesSelector;
-}
-
-var d3_selectionPrototype = [];
-
-d3.selection = function() {
-  return d3_selectionRoot;
-};
-
-d3.selection.prototype = d3_selectionPrototype;
-d3_selectionPrototype.select = function(selector) {
-  var subgroups = [],
-      subgroup,
-      subnode,
-      group,
-      node;
-
-  if (typeof selector !== "function") selector = d3_selection_selector(selector);
-
-  for (var j = -1, m = this.length; ++j < m;) {
-    subgroups.push(subgroup = []);
-    subgroup.parentNode = (group = this[j]).parentNode;
-    for (var i = -1, n = group.length; ++i < n;) {
-      if (node = group[i]) {
-        subgroup.push(subnode = selector.call(node, node.__data__, i));
-        if (subnode && "__data__" in node) subnode.__data__ = node.__data__;
-      } else {
-        subgroup.push(null);
-      }
-    }
-  }
-
-  return d3_selection(subgroups);
-};
-
-function d3_selection_selector(selector) {
-  return function() {
-    return d3_select(selector, this);
-  };
-}
-d3_selectionPrototype.selectAll = function(selector) {
-  var subgroups = [],
-      subgroup,
-      node;
-
-  if (typeof selector !== "function") selector = d3_selection_selectorAll(selector);
-
-  for (var j = -1, m = this.length; ++j < m;) {
-    for (var group = this[j], i = -1, n = group.length; ++i < n;) {
-      if (node = group[i]) {
-        subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i)));
-        subgroup.parentNode = node;
-      }
-    }
-  }
-
-  return d3_selection(subgroups);
-};
-
-function d3_selection_selectorAll(selector) {
-  return function() {
-    return d3_selectAll(selector, this);
-  };
-}
-d3_selectionPrototype.attr = function(name, value) {
-  name = d3.ns.qualify(name);
-
-  // If no value is specified, return the first value.
-  if (arguments.length < 2) {
-    var node = this.node();
-    return name.local
-        ? node.getAttributeNS(name.space, name.local)
-        : node.getAttribute(name);
-  }
-
-  function attrNull() {
-    this.removeAttribute(name);
-  }
-
-  function attrNullNS() {
-    this.removeAttributeNS(name.space, name.local);
-  }
-
-  function attrConstant() {
-    this.setAttribute(name, value);
-  }
-
-  function attrConstantNS() {
-    this.setAttributeNS(name.space, name.local, value);
-  }
-
-  function attrFunction() {
-    var x = value.apply(this, arguments);
-    if (x == null) this.removeAttribute(name);
-    else this.setAttribute(name, x);
-  }
-
-  function attrFunctionNS() {
-    var x = value.apply(this, arguments);
-    if (x == null) this.removeAttributeNS(name.space, name.local);
-    else this.setAttributeNS(name.space, name.local, x);
-  }
-
-  return this.each(value == null
-      ? (name.local ? attrNullNS : attrNull) : (typeof value === "function"
-      ? (name.local ? attrFunctionNS : attrFunction)
-      : (name.local ? attrConstantNS : attrConstant)));
-};
-d3_selectionPrototype.classed = function(name, value) {
-  var names = name.split(d3_selection_classedWhitespace),
-      n = names.length,
-      i = -1;
-  if (arguments.length > 1) {
-    while (++i < n) d3_selection_classed.call(this, names[i], value);
-    return this;
-  } else {
-    while (++i < n) if (!d3_selection_classed.call(this, names[i])) return false;
-    return true;
-  }
-};
-
-var d3_selection_classedWhitespace = /\s+/g;
-
-function d3_selection_classed(name, value) {
-  var re = new RegExp("(^|\\s+)" + d3.requote(name) + "(\\s+|$)", "g");
-
-  // If no value is specified, return the first value.
-  if (arguments.length < 2) {
-    var node = this.node();
-    if (c = node.classList) return c.contains(name);
-    var c = node.className;
-    re.lastIndex = 0;
-    return re.test(c.baseVal != null ? c.baseVal : c);
-  }
-
-  function classedAdd() {
-    if (c = this.classList) return c.add(name);
-    var c = this.className,
-        cb = c.baseVal != null,
-        cv = cb ? c.baseVal : c;
-    re.lastIndex = 0;
-    if (!re.test(cv)) {
-      cv = d3_collapse(cv + " " + name);
-      if (cb) c.baseVal = cv;
-      else this.className = cv;
-    }
-  }
-
-  function classedRemove() {
-    if (c = this.classList) return c.remove(name);
-    var c = this.className,
-        cb = c.baseVal != null,
-        cv = cb ? c.baseVal : c;
-    cv = d3_collapse(cv.replace(re, " "));
-    if (cb) c.baseVal = cv;
-    else this.className = cv;
-  }
-
-  function classedFunction() {
-    (value.apply(this, arguments)
-        ? classedAdd
-        : classedRemove).call(this);
-  }
-
-  return this.each(typeof value === "function"
-      ? classedFunction : value
-      ? classedAdd
-      : classedRemove);
-}
-d3_selectionPrototype.style = function(name, value, priority) {
-  if (arguments.length < 3) priority = "";
-
-  // If no value is specified, return the first value.
-  if (arguments.length < 2) return window
-      .getComputedStyle(this.node(), null)
-      .getPropertyValue(name);
-
-  function styleNull() {
-    this.style.removeProperty(name);
-  }
-
-  function styleConstant() {
-    this.style.setProperty(name, value, priority);
-  }
-
-  function styleFunction() {
-    var x = value.apply(this, arguments);
-    if (x == null) this.style.removeProperty(name);
-    else this.style.setProperty(name, x, priority);
-  }
-
-  return this.each(value == null
-      ? styleNull : (typeof value === "function"
-      ? styleFunction : styleConstant));
-};
-d3_selectionPrototype.property = function(name, value) {
-
-  // If no value is specified, return the first value.
-  if (arguments.length < 2) return this.node()[name];
-
-  function propertyNull() {
-    delete this[name];
-  }
-
-  function propertyConstant() {
-    this[name] = value;
-  }
-
-  function propertyFunction() {
-    var x = value.apply(this, arguments);
-    if (x == null) delete this[name];
-    else this[name] = x;
-  }
-
-  return this.each(value == null
-      ? propertyNull : (typeof value === "function"
-      ? propertyFunction : propertyConstant));
-};
-d3_selectionPrototype.text = function(value) {
-  return arguments.length < 1
-      ? this.node().textContent : this.each(typeof value === "function"
-      ? function() { var v = value.apply(this, arguments); this.textContent = v == null ? "" : v; } : value == null
-      ? function() { this.textContent = ""; }
-      : function() { this.textContent = value; });
-};
-d3_selectionPrototype.html = function(value) {
-  return arguments.length < 1
-      ? this.node().innerHTML : this.each(typeof value === "function"
-      ? function() { var v = value.apply(this, arguments); this.innerHTML = v == null ? "" : v; } : value == null
-      ? function() { this.innerHTML = ""; }
-      : function() { this.innerHTML = value; });
-};
-// TODO append(node)?
-// TODO append(function)?
-d3_selectionPrototype.append = function(name) {
-  name = d3.ns.qualify(name);
-
-  function append() {
-    return this.appendChild(document.createElementNS(this.namespaceURI, name));
-  }
-
-  function appendNS() {
-    return this.appendChild(document.createElementNS(name.space, name.local));
-  }
-
-  return this.select(name.local ? appendNS : append);
-};
-// TODO insert(node, function)?
-// TODO insert(function, string)?
-// TODO insert(function, function)?
-d3_selectionPrototype.insert = function(name, before) {
-  name = d3.ns.qualify(name);
-
-  function insert() {
-    return this.insertBefore(
-        document.createElementNS(this.namespaceURI, name),
-        d3_select(before, this));
-  }
-
-  function insertNS() {
-    return this.insertBefore(
-        document.createElementNS(name.space, name.local),
-        d3_select(before, this));
-  }
-
-  return this.select(name.local ? insertNS : insert);
-};
-// TODO remove(selector)?
-// TODO remove(node)?
-// TODO remove(function)?
-d3_selectionPrototype.remove = function() {
-  return this.each(function() {
-    var parent = this.parentNode;
-    if (parent) parent.removeChild(this);
-  });
-};
-d3_selectionPrototype.data = function(value, key) {
-  var i = -1,
-      n = this.length,
-      group,
-      node;
-
-  // If no value is specified, return the first value.
-  if (!arguments.length) {
-    value = new Array(n = (group = this[0]).length);
-    while (++i < n) {
-      if (node = group[i]) {
-        value[i] = node.__data__;
-      }
-    }
-    return value;
-  }
-
-  function bind(group, groupData) {
-    var i,
-        n = group.length,
-        m = groupData.length,
-        n0 = Math.min(n, m),
-        n1 = Math.max(n, m),
-        updateNodes = [],
-        enterNodes = [],
-        exitNodes = [],
-        node,
-        nodeData;
-
-    if (key) {
-      var nodeByKeyValue = new d3_Map,
-          keyValues = [],
-          keyValue,
-          j = groupData.length;
-
-      for (i = -1; ++i < n;) {
-        keyValue = key.call(node = group[i], node.__data__, i);
-        if (nodeByKeyValue.has(keyValue)) {
-          exitNodes[j++] = node; // duplicate key
-        } else {
-          nodeByKeyValue.set(keyValue, node);
-        }
-        keyValues.push(keyValue);
-      }
-
-      for (i = -1; ++i < m;) {
-        keyValue = key.call(groupData, nodeData = groupData[i], i)
-        if (nodeByKeyValue.has(keyValue)) {
-          updateNodes[i] = node = nodeByKeyValue.get(keyValue);
-          node.__data__ = nodeData;
-          enterNodes[i] = exitNodes[i] = null;
-        } else {
-          enterNodes[i] = d3_selection_dataNode(nodeData);
-          updateNodes[i] = exitNodes[i] = null;
-        }
-        nodeByKeyValue.remove(keyValue);
-      }
-
-      for (i = -1; ++i < n;) {
-        if (nodeByKeyValue.has(keyValues[i])) {
-          exitNodes[i] = group[i];
-        }
-      }
-    } else {
-      for (i = -1; ++i < n0;) {
-        node = group[i];
-        nodeData = groupData[i];
-        if (node) {
-          node.__data__ = nodeData;
-          updateNodes[i] = node;
-          enterNodes[i] = exitNodes[i] = null;
-        } else {
-          enterNodes[i] = d3_selection_dataNode(nodeData);
-          updateNodes[i] = exitNodes[i] = null;
-        }
-      }
-      for (; i < m; ++i) {
-        enterNodes[i] = d3_selection_dataNode(groupData[i]);
-        updateNodes[i] = exitNodes[i] = null;
-      }
-      for (; i < n1; ++i) {
-        exitNodes[i] = group[i];
-        enterNodes[i] = updateNodes[i] = null;
-      }
-    }
-
-    enterNodes.update
-        = updateNodes;
-
-    enterNodes.parentNode
-        = updateNodes.parentNode
-        = exitNodes.parentNode
-        = group.parentNode;
-
-    enter.push(enterNodes);
-    update.push(updateNodes);
-    exit.push(exitNodes);
-  }
-
-  var enter = d3_selection_enter([]),
-      update = d3_selection([]),
-      exit = d3_selection([]);
-
-  if (typeof value === "function") {
-    while (++i < n) {
-      bind(group = this[i], value.call(group, group.parentNode.__data__, i));
-    }
-  } else {
-    while (++i < n) {
-      bind(group = this[i], value);
-    }
-  }
-
-  update.enter = function() { return enter; };
-  update.exit = function() { return exit; };
-  return update;
-};
-
-function d3_selection_dataNode(data) {
-  return {__data__: data};
-}
-d3_selectionPrototype.datum =
-d3_selectionPrototype.map = function(value) {
-  return arguments.length < 1
-      ? this.property("__data__")
-      : this.property("__data__", value);
-};
-d3_selectionPrototype.filter = function(filter) {
-  var subgroups = [],
-      subgroup,
-      group,
-      node;
-
-  if (typeof filter !== "function") filter = d3_selection_filter(filter);
-
-  for (var j = 0, m = this.length; j < m; j++) {
-    subgroups.push(subgroup = []);
-    subgroup.parentNode = (group = this[j]).parentNode;
-    for (var i = 0, n = group.length; i < n; i++) {
-      if ((node = group[i]) && filter.call(node, node.__data__, i)) {
-        subgroup.push(node);
-      }
-    }
-  }
-
-  return d3_selection(subgroups);
-};
-
-function d3_selection_filter(selector) {
-  return function() {
-    return d3_selectMatches(this, selector);
-  };
-}
-d3_selectionPrototype.order = function() {
-  for (var j = -1, m = this.length; ++j < m;) {
-    for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0;) {
-      if (node = group[i]) {
-        if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
-        next = node;
-      }
-    }
-  }
-  return this;
-};
-d3_selectionPrototype.sort = function(comparator) {
-  comparator = d3_selection_sortComparator.apply(this, arguments);
-  for (var j = -1, m = this.length; ++j < m;) this[j].sort(comparator);
-  return this.order();
-};
-
-function d3_selection_sortComparator(comparator) {
-  if (!arguments.length) comparator = d3.ascending;
-  return function(a, b) {
-    return comparator(a && a.__data__, b && b.__data__);
-  };
-}
-// type can be namespaced, e.g., "click.foo"
-// listener can be null for removal
-d3_selectionPrototype.on = function(type, listener, capture) {
-  if (arguments.length < 3) capture = false;
-
-  // parse the type specifier
-  var name = "__on" + type, i = type.indexOf(".");
-  if (i > 0) type = type.substring(0, i);
-
-  // if called with only one argument, return the current listener
-  if (arguments.length < 2) return (i = this.node()[name]) && i._;
-
-  // remove the old event listener, and add the new event listener
-  return this.each(function(d, i) {
-    var node = this,
-        o = node[name];
-
-    // remove the old listener, if any (using the previously-set capture)
-    if (o) {
-      node.removeEventListener(type, o, o.$);
-      delete node[name];
-    }
-
-    // add the new listener, if any (remembering the capture flag)
-    if (listener) {
-      node.addEventListener(type, node[name] = l, l.$ = capture);
-      l._ = listener; // stash the unwrapped listener for get
-    }
-
-    // wrapped event listener that preserves i
-    function l(e) {
-      var o = d3.event; // Events can be reentrant (e.g., focus).
-      d3.event = e;
-      try {
-        listener.call(node, node.__data__, i);
-      } finally {
-        d3.event = o;
-      }
-    }
-  });
-};
-d3_selectionPrototype.each = function(callback) {
-  for (var j = -1, m = this.length; ++j < m;) {
-    for (var group = this[j], i = -1, n = group.length; ++i < n;) {
-      var node = group[i];
-      if (node) callback.call(node, node.__data__, i, j);
-    }
-  }
-  return this;
-};
-//
-// Note: assigning to the arguments array simultaneously changes the value of
-// the corresponding argument!
-//
-// TODO The `this` argument probably shouldn't be the first argument to the
-// callback, anyway, since it's redundant. However, that will require a major
-// version bump due to backwards compatibility, so I'm not changing it right
-// away.
-//
-d3_selectionPrototype.call = function(callback) {
-  callback.apply(this, (arguments[0] = this, arguments));
-  return this;
-};
-d3_selectionPrototype.empty = function() {
-  return !this.node();
-};
-d3_selectionPrototype.node = function(callback) {
-  for (var j = 0, m = this.length; j < m; j++) {
-    for (var group = this[j], i = 0, n = group.length; i < n; i++) {
-      var node = group[i];
-      if (node) return node;
-    }
-  }
-  return null;
-};
-d3_selectionPrototype.transition = function() {
-  var subgroups = [],
-      subgroup,
-      node;
-
-  for (var j = -1, m = this.length; ++j < m;) {
-    subgroups.push(subgroup = []);
-    for (var group = this[j], i = -1, n = group.length; ++i < n;) {
-      subgroup.push((node = group[i]) ? {node: node, delay: d3_transitionDelay, duration: d3_transitionDuration} : null);
-    }
-  }
-
-  return d3_transition(subgroups, d3_transitionId || ++d3_transitionNextId, Date.now());
-};
-var d3_selectionRoot = d3_selection([[document]]);
-
-d3_selectionRoot[0].parentNode = d3_selectRoot;
-
-// TODO fast singleton implementation!
-// TODO select(function)
-d3.select = function(selector) {
-  return typeof selector === "string"
-      ? d3_selectionRoot.select(selector)
-      : d3_selection([[selector]]); // assume node
-};
-
-// TODO selectAll(function)
-d3.selectAll = function(selector) {
-  return typeof selector === "string"
-      ? d3_selectionRoot.selectAll(selector)
-      : d3_selection([d3_array(selector)]); // assume node[]
-};
-function d3_selection_enter(selection) {
-  d3_arraySubclass(selection, d3_selection_enterPrototype);
-  return selection;
-}
-
-var d3_selection_enterPrototype = [];
-
-d3.selection.enter = d3_selection_enter;
-d3.selection.enter.prototype = d3_selection_enterPrototype;
-
-d3_selection_enterPrototype.append = d3_selectionPrototype.append;
-d3_selection_enterPrototype.insert = d3_selectionPrototype.insert;
-d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;
-d3_selection_enterPrototype.node = d3_selectionPrototype.node;
-d3_selection_enterPrototype.select = function(selector) {
-  var subgroups = [],
-      subgroup,
-      subnode,
-      upgroup,
-      group,
-      node;
-
-  for (var j = -1, m = this.length; ++j < m;) {
-    upgroup = (group = this[j]).update;
-    subgroups.push(subgroup = []);
-    subgroup.parentNode = group.parentNode;
-    for (var i = -1, n = group.length; ++i < n;) {
-      if (node = group[i]) {
-        subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i));
-        subnode.__data__ = node.__data__;
-      } else {
-        subgroup.push(null);
-      }
-    }
-  }
-
-  return d3_selection(subgroups);
-};
-function d3_transition(groups, id, time) {
-  d3_arraySubclass(groups, d3_transitionPrototype);
-
-  var tweens = new d3_Map,
-      event = d3.dispatch("start", "end"),
-      ease = d3_transitionEase;
-
-  groups.id = id;
-
-  groups.time = time;
-
-  groups.tween = function(name, tween) {
-    if (arguments.length < 2) return tweens.get(name);
-    if (tween == null) tweens.remove(name);
-    else tweens.set(name, tween);
-    return groups;
-  };
-
-  groups.ease = function(value) {
-    if (!arguments.length) return ease;
-    ease = typeof value === "function" ? value : d3.ease.apply(d3, arguments);
-    return groups;
-  };
-
-  groups.each = function(type, listener) {
-    if (arguments.length < 2) return d3_transition_each.call(groups, type);
-    event.on(type, listener);
-    return groups;
-  };
-
-  d3.timer(function(elapsed) {
-    groups.each(function(d, i, j) {
-      var tweened = [],
-          node = this,
-          delay = groups[j][i].delay,
-          duration = groups[j][i].duration,
-          lock = node.__transition__ || (node.__transition__ = {active: 0, count: 0});
-
-      ++lock.count;
-
-      delay <= elapsed ? start(elapsed) : d3.timer(start, delay, time);
-
-      function start(elapsed) {
-        if (lock.active > id) return stop();
-        lock.active = id;
-
-        tweens.forEach(function(key, value) {
-          if (tween = value.call(node, d, i)) {
-            tweened.push(tween);
-          }
-        });
-
-        event.start.call(node, d, i);
-        if (!tick(elapsed)) d3.timer(tick, 0, time);
-        return 1;
-      }
-
-      function tick(elapsed) {
-        if (lock.active !== id) return stop();
-
-        var t = (elapsed - delay) / duration,
-            e = ease(t),
-            n = tweened.length;
-
-        while (n > 0) {
-          tweened[--n].call(node, e);
-        }
-
-        if (t >= 1) {
-          stop();
-          d3_transitionId = id;
-          event.end.call(node, d, i);
-          d3_transitionId = 0;
-          return 1;
-        }
-      }
-
-      function stop() {
-        if (!--lock.count) delete node.__transition__;
-        return 1;
-      }
-    });
-    return 1;
-  }, 0, time);
-
-  return groups;
-}
-
-var d3_transitionRemove = {};
-
-function d3_transitionNull(d, i, a) {
-  return a != "" && d3_transitionRemove;
-}
-
-function d3_transitionTween(name, b) {
-  var interpolate = d3_interpolateByName(name);
-
-  function transitionFunction(d, i, a) {
-    var v = b.call(this, d, i);
-    return v == null
-        ? a != "" && d3_transitionRemove
-        : a != v && interpolate(a, v);
-  }
-
-  function transitionString(d, i, a) {
-    return a != b && interpolate(a, b);
-  }
-
-  return typeof b === "function" ? transitionFunction
-      : b == null ? d3_transitionNull
-      : (b += "", transitionString);
-}
-
-var d3_transitionPrototype = [],
-    d3_transitionNextId = 0,
-    d3_transitionId = 0,
-    d3_transitionDefaultDelay = 0,
-    d3_transitionDefaultDuration = 250,
-    d3_transitionDefaultEase = d3.ease("cubic-in-out"),
-    d3_transitionDelay = d3_transitionDefaultDelay,
-    d3_transitionDuration = d3_transitionDefaultDuration,
-    d3_transitionEase = d3_transitionDefaultEase;
-
-d3_transitionPrototype.call = d3_selectionPrototype.call;
-
-d3.transition = function(selection) {
-  return arguments.length
-      ? (d3_transitionId ? selection.transition() : selection)
-      : d3_selectionRoot.transition();
-};
-
-d3.transition.prototype = d3_transitionPrototype;
-d3_transitionPrototype.select = function(selector) {
-  var subgroups = [],
-      subgroup,
-      subnode,
-      node;
-
-  if (typeof selector !== "function") selector = d3_selection_selector(selector);
-
-  for (var j = -1, m = this.length; ++j < m;) {
-    subgroups.push(subgroup = []);
-    for (var group = this[j], i = -1, n = group.length; ++i < n;) {
-      if ((node = group[i]) && (subnode = selector.call(node.node, node.node.__data__, i))) {
-        if ("__data__" in node.node) subnode.__data__ = node.node.__data__;
-        subgroup.push({node: subnode, delay: node.delay, duration: node.duration});
-      } else {
-        subgroup.push(null);
-      }
-    }
-  }
-
-  return d3_transition(subgroups, this.id, this.time).ease(this.ease());
-};
-d3_transitionPrototype.selectAll = function(selector) {
-  var subgroups = [],
-      subgroup,
-      subnodes,
-      node;
-
-  if (typeof selector !== "function") selector = d3_selection_selectorAll(selector);
-
-  for (var j = -1, m = this.length; ++j < m;) {
-    for (var group = this[j], i = -1, n = group.length; ++i < n;) {
-      if (node = group[i]) {
-        subnodes = selector.call(node.node, node.node.__data__, i);
-        subgroups.push(subgroup = []);
-        for (var k = -1, o = subnodes.length; ++k < o;) {
-          subgroup.push({node: subnodes[k], delay: node.delay, duration: node.duration});
-        }
-      }
-    }
-  }
-
-  return d3_transition(subgroups, this.id, this.time).ease(this.ease());
-};
-d3_transitionPrototype.attr = function(name, value) {
-  return this.attrTween(name, d3_transitionTween(name, value));
-};
-
-d3_transitionPrototype.attrTween = function(nameNS, tween) {
-  var name = d3.ns.qualify(nameNS);
-
-  function attrTween(d, i) {
-    var f = tween.call(this, d, i, this.getAttribute(name));
-    return f === d3_transitionRemove
-        ? (this.removeAttribute(name), null)
-        : f && function(t) { this.setAttribute(name, f(t)); };
-  }
-
-  function attrTweenNS(d, i) {
-    var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));
-    return f === d3_transitionRemove
-        ? (this.removeAttributeNS(name.space, name.local), null)
-        : f && function(t) { this.setAttributeNS(name.space, name.local, f(t)); };
-  }
-
-  return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween);
-};
-d3_transitionPrototype.style = function(name, value, priority) {
-  if (arguments.length < 3) priority = "";
-  return this.styleTween(name, d3_transitionTween(name, value), priority);
-};
-
-d3_transitionPrototype.styleTween = function(name, tween, priority) {
-  if (arguments.length < 3) priority = "";
-  return this.tween("style." + name, function(d, i) {
-    var f = tween.call(this, d, i, window.getComputedStyle(this, null).getPropertyValue(name));
-    return f === d3_transitionRemove
-        ? (this.style.removeProperty(name), null)
-        : f && function(t) { this.style.setProperty(name, f(t), priority); };
-  });
-};
-d3_transitionPrototype.text = function(value) {
-  return this.tween("text", function(d, i) {
-    this.textContent = typeof value === "function"
-        ? value.call(this, d, i)
-        : value;
-  });
-};
-d3_transitionPrototype.remove = function() {
-  return this.each("end.transition", function() {
-    var p;
-    if (!this.__transition__ && (p = this.parentNode)) p.removeChild(this);
-  });
-};
-d3_transitionPrototype.delay = function(value) {
-  var groups = this;
-  return groups.each(typeof value === "function"
-      ? function(d, i, j) { groups[j][i].delay = value.apply(this, arguments) | 0; }
-      : (value = value | 0, function(d, i, j) { groups[j][i].delay = value; }));
-};
-d3_transitionPrototype.duration = function(value) {
-  var groups = this;
-  return groups.each(typeof value === "function"
-      ? function(d, i, j) { groups[j][i].duration = Math.max(1, value.apply(this, arguments) | 0); }
-      : (value = Math.max(1, value | 0), function(d, i, j) { groups[j][i].duration = value; }));
-};
-function d3_transition_each(callback) {
-  var id = d3_transitionId,
-      ease = d3_transitionEase,
-      delay = d3_transitionDelay,
-      duration = d3_transitionDuration;
-
-  d3_transitionId = this.id;
-  d3_transitionEase = this.ease();
-  for (var j = 0, m = this.length; j < m; j++) {
-    for (var group = this[j], i = 0, n = group.length; i < n; i++) {
-      var node = group[i];
-      if (node) {
-        d3_transitionDelay = this[j][i].delay;
-        d3_transitionDuration = this[j][i].duration;
-        callback.call(node = node.node, node.__data__, i, j);
-      }
-    }
-  }
-
-  d3_transitionId = id;
-  d3_transitionEase = ease;
-  d3_transitionDelay = delay;
-  d3_transitionDuration = duration;
-  return this;
-}
-d3_transitionPrototype.transition = function() {
-  return this.select(d3_this);
-};
-var d3_timer_queue = null,
-    d3_timer_interval, // is an interval (or frame) active?
-    d3_timer_timeout; // is a timeout active?
-
-// The timer will continue to fire until callback returns true.
-d3.timer = function(callback, delay, then) {
-  var found = false,
-      t0,
-      t1 = d3_timer_queue;
-
-  if (arguments.length < 3) {
-    if (arguments.length < 2) delay = 0;
-    else if (!isFinite(delay)) return;
-    then = Date.now();
-  }
-
-  // See if the callback's already in the queue.
-  while (t1) {
-    if (t1.callback === callback) {
-      t1.then = then;
-      t1.delay = delay;
-      found = true;
-      break;
-    }
-    t0 = t1;
-    t1 = t1.next;
-  }
-
-  // Otherwise, add the callback to the queue.
-  if (!found) d3_timer_queue = {
-    callback: callback,
-    then: then,
-    delay: delay,
-    next: d3_timer_queue
-  };
-
-  // Start animatin'!
-  if (!d3_timer_interval) {
-    d3_timer_timeout = clearTimeout(d3_timer_timeout);
-    d3_timer_interval = 1;
-    d3_timer_frame(d3_timer_step);
-  }
-}
-
-function d3_timer_step() {
-  var elapsed,
-      now = Date.now(),
-      t1 = d3_timer_queue;
-
-  while (t1) {
-    elapsed = now - t1.then;
-    if (elapsed >= t1.delay) t1.flush = t1.callback(elapsed);
-    t1 = t1.next;
-  }
-
-  var delay = d3_timer_flush() - now;
-  if (delay > 24) {
-    if (isFinite(delay)) {
-      clearTimeout(d3_timer_timeout);
-      d3_timer_timeout = setTimeout(d3_timer_step, delay);
-    }
-    d3_timer_interval = 0;
-  } else {
-    d3_timer_interval = 1;
-    d3_timer_frame(d3_timer_step);
-  }
-}
-
-d3.timer.flush = function() {
-  var elapsed,
-      now = Date.now(),
-      t1 = d3_timer_queue;
-
-  while (t1) {
-    elapsed = now - t1.then;
-    if (!t1.delay) t1.flush = t1.callback(elapsed);
-    t1 = t1.next;
-  }
-
-  d3_timer_flush();
-};
-
-// Flush after callbacks, to avoid concurrent queue modification.
-function d3_timer_flush() {
-  var t0 = null,
-      t1 = d3_timer_queue,
-      then = Infinity;
-  while (t1) {
-    if (t1.flush) {
-      t1 = t0 ? t0.next = t1.next : d3_timer_queue = t1.next;
-    } else {
-      then = Math.min(then, t1.then + t1.delay);
-      t1 = (t0 = t1).next;
-    }
-  }
-  return then;
-}
-
-var d3_timer_frame = window.requestAnimationFrame
-    || window.webkitRequestAnimationFrame
-    || window.mozRequestAnimationFrame
-    || window.oRequestAnimationFrame
-    || window.msRequestAnimationFrame
-    || function(callback) { setTimeout(callback, 17); };
-d3.transform = function(string) {
-  var g = document.createElementNS(d3.ns.prefix.svg, "g"),
-      identity = {a: 1, b: 0, c: 0, d: 1, e: 0, f: 0};
-  return (d3.transform = function(string) {
-    g.setAttribute("transform", string);
-    var t = g.transform.baseVal.consolidate();
-    return new d3_transform(t ? t.matrix : identity);
-  })(string);
-};
-
-// Compute x-scale and normalize the first row.
-// Compute shear and make second row orthogonal to first.
-// Compute y-scale and normalize the second row.
-// Finally, compute the rotation.
-function d3_transform(m) {
-  var r0 = [m.a, m.b],
-      r1 = [m.c, m.d],
-      kx = d3_transformNormalize(r0),
-      kz = d3_transformDot(r0, r1),
-      ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;
-  if (r0[0] * r1[1] < r1[0] * r0[1]) {
-    r0[0] *= -1;
-    r0[1] *= -1;
-    kx *= -1;
-    kz *= -1;
-  }
-  this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_transformDegrees;
-  this.translate = [m.e, m.f];
-  this.scale = [kx, ky];
-  this.skew = ky ? Math.atan2(kz, ky) * d3_transformDegrees : 0;
-};
-
-d3_transform.prototype.toString = function() {
-  return "translate(" + this.translate
-      + ")rotate(" + this.rotate
-      + ")skewX(" + this.skew
-      + ")scale(" + this.scale
-      + ")";
-};
-
-function d3_transformDot(a, b) {
-  return a[0] * b[0] + a[1] * b[1];
-}
-
-function d3_transformNormalize(a) {
-  var k = Math.sqrt(d3_transformDot(a, a));
-  if (k) {
-    a[0] /= k;
-    a[1] /= k;
-  }
-  return k;
-}
-
-function d3_transformCombine(a, b, k) {
-  a[0] += k * b[0];
-  a[1] += k * b[1];
-  return a;
-}
-
-var d3_transformDegrees = 180 / Math.PI;
-d3.mouse = function(container) {
-  return d3_mousePoint(container, d3_eventSource());
-};
-
-// https://bugs.webkit.org/show_bug.cgi?id=44083
-var d3_mouse_bug44083 = /WebKit/.test(navigator.userAgent) ? -1 : 0;
-
-function d3_mousePoint(container, e) {
-  var svg = container.ownerSVGElement || container;
-  if (svg.createSVGPoint) {
-    var point = svg.createSVGPoint();
-    if ((d3_mouse_bug44083 < 0) && (window.scrollX || window.scrollY)) {
-      svg = d3.select(document.body)
-        .append("svg")
-          .style("position", "absolute")
-          .style("top", 0)
-          .style("left", 0);
-      var ctm = svg[0][0].getScreenCTM();
-      d3_mouse_bug44083 = !(ctm.f || ctm.e);
-      svg.remove();
-    }
-    if (d3_mouse_bug44083) {
-      point.x = e.pageX;
-      point.y = e.pageY;
-    } else {
-      point.x = e.clientX;
-      point.y = e.clientY;
-    }
-    point = point.matrixTransform(container.getScreenCTM().inverse());
-    return [point.x, point.y];
-  }
-  var rect = container.getBoundingClientRect();
-  return [e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop];
-};
-d3.touches = function(container, touches) {
-  if (arguments.length < 2) touches = d3_eventSource().touches;
-  return touches ? d3_array(touches).map(function(touch) {
-    var point = d3_mousePoint(container, touch);
-    point.identifier = touch.identifier;
-    return point;
-  }) : [];
-};
-function d3_noop() {}
-d3.scale = {};
-
-function d3_scaleExtent(domain) {
-  var start = domain[0], stop = domain[domain.length - 1];
-  return start < stop ? [start, stop] : [stop, start];
-}
-
-function d3_scaleRange(scale) {
-  return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
-}
-function d3_scale_nice(domain, nice) {
-  var i0 = 0,
-      i1 = domain.length - 1,
-      x0 = domain[i0],
-      x1 = domain[i1],
-      dx;
-
-  if (x1 < x0) {
-    dx = i0; i0 = i1; i1 = dx;
-    dx = x0; x0 = x1; x1 = dx;
-  }
-
-  if (dx = x1 - x0) {
-    nice = nice(dx);
-    domain[i0] = nice.floor(x0);
-    domain[i1] = nice.ceil(x1);
-  }
-
-  return domain;
-}
-
-function d3_scale_niceDefault() {
-  return Math;
-}
-d3.scale.linear = function() {
-  return d3_scale_linear([0, 1], [0, 1], d3.interpolate, false);
-};
-
-function d3_scale_linear(domain, range, interpolate, clamp) {
-  var output,
-      input;
-
-  function rescale() {
-    var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear,
-        uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;
-    output = linear(domain, range, uninterpolate, interpolate);
-    input = linear(range, domain, uninterpolate, d3.interpolate);
-    return scale;
-  }
-
-  function scale(x) {
-    return output(x);
-  }
-
-  // Note: requires range is coercible to number!
-  scale.invert = function(y) {
-    return input(y);
-  };
-
-  scale.domain = function(x) {
-    if (!arguments.length) return domain;
-    domain = x.map(Number);
-    return rescale();
-  };
-
-  scale.range = function(x) {
-    if (!arguments.length) return range;
-    range = x;
-    return rescale();
-  };
-
-  scale.rangeRound = function(x) {
-    return scale.range(x).interpolate(d3.interpolateRound);
-  };
-
-  scale.clamp = function(x) {
-    if (!arguments.length) return clamp;
-    clamp = x;
-    return rescale();
-  };
-
-  scale.interpolate = function(x) {
-    if (!arguments.length) return interpolate;
-    interpolate = x;
-    return rescale();
-  };
-
-  scale.ticks = function(m) {
-    return d3_scale_linearTicks(domain, m);
-  };
-
-  scale.tickFormat = function(m) {
-    return d3_scale_linearTickFormat(domain, m);
-  };
-
-  scale.nice = function() {
-    d3_scale_nice(domain, d3_scale_linearNice);
-    return rescale();
-  };
-
-  scale.copy = function() {
-    return d3_scale_linear(domain, range, interpolate, clamp);
-  };
-
-  return rescale();
-}
-
-function d3_scale_linearRebind(scale, linear) {
-  return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp");
-}
-
-function d3_scale_linearNice(dx) {
-  dx = Math.pow(10, Math.round(Math.log(dx) / Math.LN10) - 1);
-  return {
-    floor: function(x) { return Math.floor(x / dx) * dx; },
-    ceil: function(x) { return Math.ceil(x / dx) * dx; }
-  };
-}
-
-function d3_scale_linearTickRange(domain, m) {
-  var extent = d3_scaleExtent(domain),
-      span = extent[1] - extent[0],
-      step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)),
-      err = m / span * step;
-
-  // Filter ticks to get closer to the desired count.
-  if (err <= .15) step *= 10;
-  else if (err <= .35) step *= 5;
-  else if (err <= .75) step *= 2;
-
-  // Round start and stop values to step interval.
-  extent[0] = Math.ceil(extent[0] / step) * step;
-  extent[1] = Math.floor(extent[1] / step) * step + step * .5; // inclusive
-  extent[2] = step;
-  return extent;
-}
-
-function d3_scale_linearTicks(domain, m) {
-  return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));
-}
-
-function d3_scale_linearTickFormat(domain, m) {
-  return d3.format(",." + Math.max(0, -Math.floor(Math.log(d3_scale_linearTickRange(domain, m)[2]) / Math.LN10 + .01)) + "f");
-}
-function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {
-  var u = uninterpolate(domain[0], domain[1]),
-      i = interpolate(range[0], range[1]);
-  return function(x) {
-    return i(u(x));
-  };
-}
-function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
-  var u = [],
-      i = [],
-      j = 0,
-      k = Math.min(domain.length, range.length) - 1;
-
-  // Handle descending domains.
-  if (domain[k] < domain[0]) {
-    domain = domain.slice().reverse();
-    range = range.slice().reverse();
-  }
-
-  while (++j <= k) {
-    u.push(uninterpolate(domain[j - 1], domain[j]));
-    i.push(interpolate(range[j - 1], range[j]));
-  }
-
-  return function(x) {
-    var j = d3.bisect(domain, x, 1, k) - 1;
-    return i[j](u[j](x));
-  };
-}
-d3.scale.log = function() {
-  return d3_scale_log(d3.scale.linear(), d3_scale_logp);
-};
-
-function d3_scale_log(linear, log) {
-  var pow = log.pow;
-
-  function scale(x) {
-    return linear(log(x));
-  }
-
-  scale.invert = function(x) {
-    return pow(linear.invert(x));
-  };
-
-  scale.domain = function(x) {
-    if (!arguments.length) return linear.domain().map(pow);
-    log = x[0] < 0 ? d3_scale_logn : d3_scale_logp;
-    pow = log.pow;
-    linear.domain(x.map(log));
-    return scale;
-  };
-
-  scale.nice = function() {
-    linear.domain(d3_scale_nice(linear.domain(), d3_scale_niceDefault));
-    return scale;
-  };
-
-  scale.ticks = function() {
-    var extent = d3_scaleExtent(linear.domain()),
-        ticks = [];
-    if (extent.every(isFinite)) {
-      var i = Math.floor(extent[0]),
-          j = Math.ceil(extent[1]),
-          u = pow(extent[0]),
-          v = pow(extent[1]);
-      if (log === d3_scale_logn) {
-        ticks.push(pow(i));
-        for (; i++ < j;) for (var k = 9; k > 0; k--) ticks.push(pow(i) * k);
-      } else {
-        for (; i < j; i++) for (var k = 1; k < 10; k++) ticks.push(pow(i) * k);
-        ticks.push(pow(i));
-      }
-      for (i = 0; ticks[i] < u; i++) {} // strip small values
-      for (j = ticks.length; ticks[j - 1] > v; j--) {} // strip big values
-      ticks = ticks.slice(i, j);
-    }
-    return ticks;
-  };
-
-  scale.tickFormat = function(n, format) {
-    if (arguments.length < 2) format = d3_scale_logFormat;
-    if (arguments.length < 1) return format;
-    var k = n / scale.ticks().length,
-        f = log === d3_scale_logn ? (e = -1e-12, Math.floor) : (e = 1e-12, Math.ceil),
-        e;
-    return function(d) {
-      return d / pow(f(log(d) + e)) < k ? format(d) : "";
-    };
-  };
-
-  scale.copy = function() {
-    return d3_scale_log(linear.copy(), log);
-  };
-
-  return d3_scale_linearRebind(scale, linear);
-}
-
-var d3_scale_logFormat = d3.format(".0e");
-
-function d3_scale_logp(x) {
-  return Math.log(x < 0 ? 0 : x) / Math.LN10;
-}
-
-function d3_scale_logn(x) {
-  return -Math.log(x > 0 ? 0 : -x) / Math.LN10;
-}
-
-d3_scale_logp.pow = function(x) {
-  return Math.pow(10, x);
-};
-
-d3_scale_logn.pow = function(x) {
-  return -Math.pow(10, -x);
-};
-d3.scale.pow = function() {
-  return d3_scale_pow(d3.scale.linear(), 1);
-};
-
-function d3_scale_pow(linear, exponent) {
-  var powp = d3_scale_powPow(exponent),
-      powb = d3_scale_powPow(1 / exponent);
-
-  function scale(x) {
-    return linear(powp(x));
-  }
-
-  scale.invert = function(x) {
-    return powb(linear.invert(x));
-  };
-
-  scale.domain = function(x) {
-    if (!arguments.length) return linear.domain().map(powb);
-    linear.domain(x.map(powp));
-    return scale;
-  };
-
-  scale.ticks = function(m) {
-    return d3_scale_linearTicks(scale.domain(), m);
-  };
-
-  scale.tickFormat = function(m) {
-    return d3_scale_linearTickFormat(scale.domain(), m);
-  };
-
-  scale.nice = function() {
-    return scale.domain(d3_scale_nice(scale.domain(), d3_scale_linearNice));
-  };
-
-  scale.exponent = function(x) {
-    if (!arguments.length) return exponent;
-    var domain = scale.domain();
-    powp = d3_scale_powPow(exponent = x);
-    powb = d3_scale_powPow(1 / exponent);
-    return scale.domain(domain);
-  };
-
-  scale.copy = function() {
-    return d3_scale_pow(linear.copy(), exponent);
-  };
-
-  return d3_scale_linearRebind(scale, linear);
-}
-
-function d3_scale_powPow(e) {
-  return function(x) {
-    return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);
-  };
-}
-d3.scale.sqrt = function() {
-  return d3.scale.pow().exponent(.5);
-};
-d3.scale.ordinal = function() {
-  return d3_scale_ordinal([], {t: "range", x: []});
-};
-
-function d3_scale_ordinal(domain, ranger) {
-  var index,
-      range,
-      rangeBand;
-
-  function scale(x) {
-    return range[((index.get(x) || index.set(x, domain.push(x))) - 1) % range.length];
-  }
-
-  function steps(start, step) {
-    return d3.range(domain.length).map(function(i) { return start + step * i; });
-  }
-
-  scale.domain = function(x) {
-    if (!arguments.length) return domain;
-    domain = [];
-    index = new d3_Map;
-    var i = -1, n = x.length, xi;
-    while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi));
-    return scale[ranger.t](ranger.x, ranger.p);
-  };
-
-  scale.range = function(x) {
-    if (!arguments.length) return range;
-    range = x;
-    rangeBand = 0;
-    ranger = {t: "range", x: x};
-    return scale;
-  };
-
-  scale.rangePoints = function(x, padding) {
-    if (arguments.length < 2) padding = 0;
-    var start = x[0],
-        stop = x[1],
-        step = (stop - start) / (domain.length - 1 + padding);
-    range = steps(domain.length < 2 ? (start + stop) / 2 : start + step * padding / 2, step);
-    rangeBand = 0;
-    ranger = {t: "rangePoints", x: x, p: padding};
-    return scale;
-  };
-
-  scale.rangeBands = function(x, padding) {
-    if (arguments.length < 2) padding = 0;
-    var reverse = x[1] < x[0],
-        start = x[reverse - 0],
-        stop = x[1 - reverse],
-        step = (stop - start) / (domain.length + padding);
-    range = steps(start + step * padding, step);
-    if (reverse) range.reverse();
-    rangeBand = step * (1 - padding);
-    ranger = {t: "rangeBands", x: x, p: padding};
-    return scale;
-  };
-
-  scale.rangeRoundBands = function(x, padding) {
-    if (arguments.length < 2) padding = 0;
-    var reverse = x[1] < x[0],
-        start = x[reverse - 0],
-        stop = x[1 - reverse],
-        step = Math.floor((stop - start) / (domain.length + padding)),
-        error = stop - start - (domain.length - padding) * step;
-    range = steps(start + Math.round(error / 2), step);
-    if (reverse) range.reverse();
-    rangeBand = Math.round(step * (1 - padding));
-    ranger = {t: "rangeRoundBands", x: x, p: padding};
-    return scale;
-  };
-
-  scale.rangeBand = function() {
-    return rangeBand;
-  };
-
-  scale.rangeExtent = function() {
-    return d3_scaleExtent(ranger.x);
-  };
-
-  scale.copy = function() {
-    return d3_scale_ordinal(domain, ranger);
-  };
-
-  return scale.domain(domain);
-}
-/*
- * This product includes color specifications and designs developed by Cynthia
- * Brewer (http://colorbrewer.org/). See lib/colorbrewer for more information.
- */
-
-d3.scale.category10 = function() {
-  return d3.scale.ordinal().range(d3_category10);
-};
-
-d3.scale.category20 = function() {
-  return d3.scale.ordinal().range(d3_category20);
-};
-
-d3.scale.category20b = function() {
-  return d3.scale.ordinal().range(d3_category20b);
-};
-
-d3.scale.category20c = function() {
-  return d3.scale.ordinal().range(d3_category20c);
-};
-
-var d3_category10 = [
-  "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
-  "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"
-];
-
-var d3_category20 = [
-  "#1f77b4", "#aec7e8",
-  "#ff7f0e", "#ffbb78",
-  "#2ca02c", "#98df8a",
-  "#d62728", "#ff9896",
-  "#9467bd", "#c5b0d5",
-  "#8c564b", "#c49c94",
-  "#e377c2", "#f7b6d2",
-  "#7f7f7f", "#c7c7c7",
-  "#bcbd22", "#dbdb8d",
-  "#17becf", "#9edae5"
-];
-
-var d3_category20b = [
-  "#393b79", "#5254a3", "#6b6ecf", "#9c9ede",
-  "#637939", "#8ca252", "#b5cf6b", "#cedb9c",
-  "#8c6d31", "#bd9e39", "#e7ba52", "#e7cb94",
-  "#843c39", "#ad494a", "#d6616b", "#e7969c",
-  "#7b4173", "#a55194", "#ce6dbd", "#de9ed6"
-];
-
-var d3_category20c = [
-  "#3182bd", "#6baed6", "#9ecae1", "#c6dbef",
-  "#e6550d", "#fd8d3c", "#fdae6b", "#fdd0a2",
-  "#31a354", "#74c476", "#a1d99b", "#c7e9c0",
-  "#756bb1", "#9e9ac8", "#bcbddc", "#dadaeb",
-  "#636363", "#969696", "#bdbdbd", "#d9d9d9"
-];
-d3.scale.quantile = function() {
-  return d3_scale_quantile([], []);
-};
-
-function d3_scale_quantile(domain, range) {
-  var thresholds;
-
-  function rescale() {
-    var k = 0,
-        n = domain.length,
-        q = range.length;
-    thresholds = [];
-    while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
-    return scale;
-  }
-
-  function scale(x) {
-    if (isNaN(x = +x)) return NaN;
-    return range[d3.bisect(thresholds, x)];
-  }
-
-  scale.domain = function(x) {
-    if (!arguments.length) return domain;
-    domain = x.filter(function(d) { return !isNaN(d); }).sort(d3.ascending);
-    return rescale();
-  };
-
-  scale.range = function(x) {
-    if (!arguments.length) return range;
-    range = x;
-    return rescale();
-  };
-
-  scale.quantiles = function() {
-    return thresholds;
-  };
-
-  scale.copy = function() {
-    return d3_scale_quantile(domain, range); // copy on write!
-  };
-
-  return rescale();
-}
-d3.scale.quantize = function() {
-  return d3_scale_quantize(0, 1, [0, 1]);
-};
-
-function d3_scale_quantize(x0, x1, range) {
-  var kx, i;
-
-  function scale(x) {
-    return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];
-  }
-
-  function rescale() {
-    kx = range.length / (x1 - x0);
-    i = range.length - 1;
-    return scale;
-  }
-
-  scale.domain = function(x) {
-    if (!arguments.length) return [x0, x1];
-    x0 = +x[0];
-    x1 = +x[x.length - 1];
-    return rescale();
-  };
-
-  scale.range = function(x) {
-    if (!arguments.length) return range;
-    range = x;
-    return rescale();
-  };
-
-  scale.copy = function() {
-    return d3_scale_quantize(x0, x1, range); // copy on write
-  };
-
-  return rescale();
-}
-d3.scale.identi

<TRUNCATED>

[24/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10042: Delete old deprecated Admin UI

Posted by tf...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/jquery.sammy.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/jquery.sammy.js b/solr/webapp/web/js/lib/jquery.sammy.js
deleted file mode 100644
index 21b8a80..0000000
--- a/solr/webapp/web/js/lib/jquery.sammy.js
+++ /dev/null
@@ -1,1863 +0,0 @@
-// name: sammy
-// version: 0.6.2
-/*
-
-Copyright (c) 2008 Aaron Quint, Quirkey NYC, LLC
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-(function($, 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, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
-      },
-      _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, it's 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') {
-          // it's 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 {
-          // it's a dom/jQuery
-          if (location.nodeType) {
-            return location.innerHTML;
-          }
-          if (location.selector) {
-            // it's 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);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/jquery.timeago.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/jquery.timeago.js b/solr/webapp/web/js/lib/jquery.timeago.js
deleted file mode 100644
index 32a5ac7..0000000
--- a/solr/webapp/web/js/lib/jquery.timeago.js
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
-
-The MIT License (MIT)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-/*
- * 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));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/linker.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/linker.js b/solr/webapp/web/js/lib/linker.js
deleted file mode 100644
index 565d37f..0000000
--- a/solr/webapp/web/js/lib/linker.js
+++ /dev/null
@@ -1,48 +0,0 @@
-//by Michalis Tzikas & Vasilis Lolos
-//07-03-2012
-//v1.0
-/*
-Copyright (C) 2011 by Michalis Tzikas & Vasilis Lolos
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-(function( $ ){
-  $.fn.linker = function(options) {
-    var defaults = {
-      target   : '', //blank,self,parent,top
-      className : '',
-      rel : ''
-    };
-    var options = $.extend(defaults, options);
-        
-    target_string = (options.target != '') ? 'target="_'+options.target+'"' : '';
-    class_string  = (options.className != '') ? 'class="'+options.className+'"' : '';
-    rel_string    = (options.rel != '') ? 'rel="'+options.rel+'"' : '';
-
-    $(this).each(function(){
-      t = $(this).text();
-      
-      t = t.replace(/(https\:\/\/|http:\/\/)([www\.]?)([^\s|<]+)/gi,'<a href="$1$2$3" '+target_string+' '+class_string+' '+rel_string+'>$1$2$3</a>');
-      t = t.replace(/([^https\:\/\/]|[^http:\/\/]|^)(www)\.([^\s|<]+)/gi,'$1<a href="http://$2.$3" '+target_string+' '+class_string+' '+rel_string+'>$2.$3</a>');
-      t = t.replace(/<([^a]|^\/a])([^<>]+)>/g, "&lt;$1$2&gt;").replace(/&lt;\/a&gt;/g, "</a>").replace(/<(.)>/g, "&lt;$1&gt;").replace(/\n/g, '<br />');
-
-      $(this).html(t);
-    });
-  };
-})( jQuery );
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/21384b5b/solr/webapp/web/js/lib/naturalSort.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/lib/naturalSort.js b/solr/webapp/web/js/lib/naturalSort.js
deleted file mode 100644
index 6f052e9..0000000
--- a/solr/webapp/web/js/lib/naturalSort.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-naturalSort.js
-- by Jim Palmer and other contributors
-
-The MIT License (MIT)
-
-Copyright (c) 2011 Jim Palmer and other contributors
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
-
-//    naturalSort.js 0.7.0
-//    https://github.com/jarinudom/naturalSort.js
-//    (c) 2011 Jim Palmer and other contributors
-//    naturalSort.js may be freely distributed under the MIT license.
-//    Generated by CoffeeScript 1.7.1
-(function() {
-  window.naturalSort = function(a, b) {
-    var cLoc, dre, hre, i, numS, oFxNcL, oFyNcL, ore, re, sre, x, xD, xN, y, yD, yN;
-    re = /(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/g;
-    sre = /(^[ ]*|[ ]*$)/g;
-    dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/;
-    hre = /^0x[0-9a-f]+$/i;
-    ore = /^0/;
-    i = function(s) {
-      return naturalSort.insensitive && ('' + s).toLowerCase() || '' + s;
-    };
-    x = i(a).replace(sre, '') || '';
-    y = i(b).replace(sre, '') || '';
-    xN = x.replace(re, '\u0000$1\u0000').replace(/\0$/, '').replace(/^\0/, '').split('\u0000');
-    yN = y.replace(re, '\u0000$1\u0000').replace(/\0$/, '').replace(/^\0/, '').split('\u0000');
-    xD = parseInt(x.match(hre), 16) || (xN.length !== 1 && x.match(dre) && Date.parse(x));
-    yD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null;
-    oFxNcL = void 0;
-    oFyNcL = void 0;
-    if (yD) {
-      if (xD < yD) {
-        return -1;
-      }
-      if (xD > yD) {
-        return 1;
-      }
-    }
-    cLoc = 0;
-    numS = Math.max(xN.length, yN.length);
-    while (cLoc < numS) {
-      oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
-      oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
-      if (isNaN(oFxNcL) !== isNaN(oFyNcL)) {
-        return (isNaN(oFxNcL) ? 1 : -1);
-      } else if (typeof oFxNcL !== typeof oFyNcL) {
-        oFxNcL += '';
-        oFyNcL += '';
-      }
-      if (oFxNcL < oFyNcL) {
-        return -1;
-      }
-      if (oFxNcL > oFyNcL) {
-        return 1;
-      }
-      cLoc++;
-    }
-    return 0;
-  };
-
-}).call(this);


[41/50] [abbrv] lucene-solr:jira/solr-10233: SOLR-10623: Add sql Streaming Expression

Posted by tf...@apache.org.
SOLR-10623: Add sql Streaming Expression


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f326cfb1
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f326cfb1
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f326cfb1

Branch: refs/heads/jira/solr-10233
Commit: f326cfb17569eb7607084f7fca1ae9aeff31e383
Parents: 5a50887
Author: Joel Bernstein <jb...@apache.org>
Authored: Thu May 18 12:38:22 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Thu May 18 12:50:59 2017 -0400

----------------------------------------------------------------------
 .../org/apache/solr/handler/StreamHandler.java  |   1 +
 .../solr/client/solrj/io/stream/SqlStream.java  | 280 +++++++++++++++++++
 .../solrj/io/stream/StreamExpressionTest.java   |  40 +++
 3 files changed, 321 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f326cfb1/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index 99f5cc3..bf37383 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -167,6 +167,7 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
       .withFunctionName("get", GetStream.class)
       .withFunctionName("timeseries", TimeSeriesStream.class)
       .withFunctionName("tuple", TupStream.class)
+      .withFunctionName("sql", SqlStream.class)
       .withFunctionName("col", ColumnEvaluator.class)
       .withFunctionName("predict", PredictEvaluator.class)
       .withFunctionName("regress", RegressionEvaluator.class)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f326cfb1/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
new file mode 100644
index 0000000..5a81b74
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java
@@ -0,0 +1,280 @@
+/*
+ * 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.
+ */
+package org.apache.solr.client.solrj.io.stream;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
+
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.comp.StreamComparator;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation;
+import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExplanation;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionNamedParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionValue;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+import org.apache.solr.common.cloud.Aliases;
+import org.apache.solr.common.cloud.ClusterState;
+import org.apache.solr.common.cloud.DocCollection;
+import org.apache.solr.common.cloud.Slice;
+import org.apache.solr.common.cloud.ZkStateReader;
+import org.apache.solr.common.params.CommonParams;
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.common.util.StrUtils;
+
+public class SqlStream extends TupleStream implements Expressible {
+
+  private static final long serialVersionUID = 1;
+
+  protected String zkHost;
+  protected String collection;
+  protected SolrParams params;
+  protected transient CloudSolrClient cloudSolrClient;
+  protected transient TupleStream tupleStream;
+  protected transient StreamContext streamContext;
+
+  /**
+   * @param zkHost         Zookeeper ensemble connection string
+   * @param collectionName Name of the collection to operate on
+   * @param params         Map&lt;String, String&gt; of parameter/value pairs
+   * @throws IOException Something went wrong
+   *                     <p>
+   *                     This form does not allow specifying multiple clauses, say "fq" clauses, use the form that
+   *                     takes a SolrParams. Transition code can call the preferred method that takes SolrParams
+   *                     by calling CloudSolrStream(zkHost, collectionName,
+   *                     new ModifiableSolrParams(SolrParams.toMultiMap(new NamedList(Map&lt;String, String&gt;)));
+   * @deprecated         Use the constructor that has a SolrParams obj rather than a Map
+   */
+  
+  public SqlStream(String zkHost, String collectionName, SolrParams params) throws IOException {
+    init(collectionName, zkHost, params);
+  }
+
+  public SqlStream(StreamExpression expression, StreamFactory factory) throws IOException{
+    // grab all parameters out
+    String collectionName = factory.getValueOperand(expression, 0);
+    List<StreamExpressionNamedParameter> namedParams = factory.getNamedOperands(expression);
+    StreamExpressionNamedParameter zkHostExpression = factory.getNamedOperand(expression, "zkHost");
+
+    // Collection Name
+    if(null == collectionName){
+      throw new IOException(String.format(Locale.ROOT,"invalid expression %s - collectionName expected as first operand",expression));
+    }
+
+    // Validate there are no unknown parameters - zkHost and alias are namedParameter so we don't need to count it twice
+    if(expression.getParameters().size() != 1 + namedParams.size()){
+      throw new IOException(String.format(Locale.ROOT,"invalid expression %s - unknown operands found",expression));
+    }
+
+    // Named parameters - passed directly to solr as solrparams
+    if(0 == namedParams.size()){
+      throw new IOException(String.format(Locale.ROOT,"invalid expression %s - at least one named parameter expected. eg. 'q=*:*'",expression));
+    }
+
+    ModifiableSolrParams mParams = new ModifiableSolrParams();
+    for(StreamExpressionNamedParameter namedParam : namedParams){
+      if(!namedParam.getName().equals("zkHost") && !namedParam.getName().equals("aliases")){
+        mParams.add(namedParam.getName(), namedParam.getParameter().toString().trim());
+      }
+    }
+
+    // zkHost, optional - if not provided then will look into factory list to get
+    String zkHost = null;
+    if(null == zkHostExpression){
+      zkHost = factory.getCollectionZkHost(collectionName);
+      if(zkHost == null) {
+        zkHost = factory.getDefaultZkHost();
+      }
+    }
+    else if(zkHostExpression.getParameter() instanceof StreamExpressionValue){
+      zkHost = ((StreamExpressionValue)zkHostExpression.getParameter()).getValue();
+    }
+    /*
+    if(null == zkHost){
+      throw new IOException(String.format(Locale.ROOT,"invalid expression %s - zkHost not found for collection '%s'",expression,collectionName));
+    }
+    */
+
+    // We've got all the required items
+    init(collectionName, zkHost, mParams);
+  }
+
+  @Override
+  public StreamExpression toExpression(StreamFactory factory) throws IOException {
+    // functionName(collectionName, param1, param2, ..., paramN, sort="comp", [aliases="field=alias,..."])
+
+    // function name
+    StreamExpression expression = new StreamExpression(factory.getFunctionName(getClass()));
+
+    // collection
+    expression.addParameter(collection);
+
+    // parameters
+
+    ModifiableSolrParams mParams = new ModifiableSolrParams(SolrParams.toMultiMap(params.toNamedList()));
+    for (Entry<String, String[]> param : mParams.getMap().entrySet()) {
+      String value = String.join(",", param.getValue());
+
+      // SOLR-8409: This is a special case where the params contain a " character
+      // Do note that in any other BASE streams with parameters where a " might come into play
+      // that this same replacement needs to take place.
+      value = value.replace("\"", "\\\"");
+
+      expression.addParameter(new StreamExpressionNamedParameter(param.getKey(), value));
+    }
+
+    // zkHost
+    expression.addParameter(new StreamExpressionNamedParameter("zkHost", zkHost));
+
+    return expression;
+  }
+
+  @Override
+  public Explanation toExplanation(StreamFactory factory) throws IOException {
+
+    StreamExplanation explanation = new StreamExplanation(getStreamNodeId().toString());
+
+    explanation.setFunctionName(factory.getFunctionName(this.getClass()));
+    explanation.setImplementingClass(this.getClass().getName());
+    explanation.setExpressionType(ExpressionType.STREAM_SOURCE);
+    explanation.setExpression(toExpression(factory).toString());
+
+    // child is a datastore so add it at this point
+    StreamExplanation child = new StreamExplanation(getStreamNodeId() + "-datastore");
+    child.setFunctionName(String.format(Locale.ROOT, "solr (%s)", collection));
+    child.setImplementingClass("Solr/Lucene");
+    child.setExpressionType(ExpressionType.DATASTORE);
+
+    if(null != params){
+      ModifiableSolrParams mParams = new ModifiableSolrParams(params);
+      child.setExpression(mParams.getMap().entrySet().stream().map(e -> String.format(Locale.ROOT, "%s=%s", e.getKey(), e.getValue())).collect(Collectors.joining(",")));
+    }
+    explanation.addChild(child);
+
+    return explanation;
+  }
+
+  protected void init(String collectionName, String zkHost, SolrParams params) throws IOException {
+    this.zkHost = zkHost;
+    this.collection = collectionName;
+    this.params = new ModifiableSolrParams(params);
+
+    // If the comparator is null then it was not explicitly set so we will create one using the sort parameter
+    // of the query. While doing this we will also take into account any aliases such that if we are sorting on
+    // fieldA but fieldA is aliased to alias.fieldA then the comparater will be against alias.fieldA.
+
+    if (params.get("stmt") == null) {
+      throw new IOException("stmt param expected for search function");
+    }
+  }
+
+  public void setStreamContext(StreamContext context) {
+    this.streamContext = context;
+  }
+
+  /**
+   * Opens the CloudSolrStream
+   *
+   ***/
+  public void open() throws IOException {
+    constructStream();
+    tupleStream.open();
+  }
+
+  public List<TupleStream> children() {
+    return null;
+  }
+
+
+  public static Collection<Slice> getSlices(String collectionName, ZkStateReader zkStateReader, boolean checkAlias) throws IOException {
+    ClusterState clusterState = zkStateReader.getClusterState();
+
+    Map<String, DocCollection> collectionsMap = clusterState.getCollectionsMap();
+
+    // Check collection case sensitive
+    if(collectionsMap.containsKey(collectionName)) {
+      return collectionsMap.get(collectionName).getActiveSlices();
+    }
+
+    // Check collection case insensitive
+    for(String collectionMapKey : collectionsMap.keySet()) {
+      if(collectionMapKey.equalsIgnoreCase(collectionName)) {
+        return collectionsMap.get(collectionMapKey).getActiveSlices();
+      }
+    }
+
+    if(checkAlias) {
+      // check for collection alias
+      Aliases aliases = zkStateReader.getAliases();
+      String alias = aliases.getCollectionAlias(collectionName);
+      if (alias != null) {
+        Collection<Slice> slices = new ArrayList<>();
+
+        List<String> aliasList = StrUtils.splitSmart(alias, ",", true);
+        for (String aliasCollectionName : aliasList) {
+          // Add all active slices for this alias collection
+          slices.addAll(collectionsMap.get(aliasCollectionName).getActiveSlices());
+        }
+
+        return slices;
+      }
+    }
+
+    throw new IOException("Slices not found for " + collectionName);
+  }
+
+  protected void constructStream() throws IOException {
+    try {
+
+      List<String> shardUrls = getShards(this.zkHost, this.collection, this.streamContext);
+      Collections.shuffle(shardUrls);
+      String url  = shardUrls.get(0);
+      ModifiableSolrParams mParams = new ModifiableSolrParams(params);
+      mParams.add(CommonParams.QT, "/sql");
+      this.tupleStream = new SolrStream(url, mParams);
+      if(streamContext != null) {
+        tupleStream.setStreamContext(streamContext);
+      }
+    } catch (Exception e) {
+      throw new IOException(e);
+    }
+  }
+
+  public void close() throws IOException {
+    tupleStream.close();
+  }
+
+  /** Return the stream sort - ie, the order in which records are returned */
+  public StreamComparator getStreamSort(){
+    return null;
+  }
+
+  public Tuple read() throws IOException {
+    return tupleStream.read();
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f326cfb1/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 129de1c..e651338 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -242,6 +242,46 @@ public class StreamExpressionTest extends SolrCloudTestCase {
     }
   }
 
+  @Test
+  public void testSqlStream() throws Exception {
+
+    new UpdateRequest()
+        .add(id, "0", "a_s", "hello0", "a_i", "0", "a_f", "0")
+        .add(id, "2", "a_s", "hello2", "a_i", "2", "a_f", "0")
+        .add(id, "3", "a_s", "hello3", "a_i", "3", "a_f", "3")
+        .add(id, "4", "a_s", "hello4", "a_i", "4", "a_f", "4")
+        .add(id, "1", "a_s", "hello1", "a_i", "1", "a_f", "1")
+        .commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+
+    List<Tuple> tuples;
+    StreamContext streamContext = new StreamContext();
+    SolrClientCache solrClientCache = new SolrClientCache();
+    streamContext.setSolrClientCache(solrClientCache);
+    List<String> shardUrls = TupleStream.getShards(cluster.getZkServer().getZkAddress(), COLLECTIONORALIAS, streamContext);
+
+    try {
+      StringBuilder buf = new StringBuilder();
+      for (String shardUrl : shardUrls) {
+        if (buf.length() > 0) {
+          buf.append(",");
+        }
+        buf.append(shardUrl);
+      }
+
+      ModifiableSolrParams solrParams = new ModifiableSolrParams();
+      solrParams.add("qt", "/stream");
+      solrParams.add("expr", "sql("+COLLECTIONORALIAS+", stmt=\"select id from collection1 order by a_i asc\")");
+      SolrStream solrStream = new SolrStream(shardUrls.get(0), solrParams);
+      solrStream.setStreamContext(streamContext);
+      tuples = getTuples(solrStream);
+      assert (tuples.size() == 5);
+      assertOrder(tuples, 0, 1, 2, 3, 4);
+
+    } finally {
+      solrClientCache.close();
+    }
+  }
+