Apache Lucene open-source search software
SOLR-4955: Admin UI - Show address bar on top for Schema + Config
Stefan Matheis6ae55f1417ba
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 45118f387ca..86e432a822d 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -205,6 +205,8 @@ Optimizations* SOLR-4611: Admin UI - Analysis-Urls with empty parameters create empty result table(steffkes)+* SOLR-4955: Admin UI - Show address bar on top for Schema + Config (steffkes)+Other Changes----------------------diff --git a/solr/webapp/web/css/styles/common.css b/solr/webapp/web/css/styles/common.cssindex 94ef1a4aca9..077e67a32d3 100644--- a/solr/webapp/web/css/styles/common.css+++ b/solr/webapp/web/css/styles/common.css@@ -640,4 +640,31 @@ pre.syntax .tex .formula#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;}\ No newline at end of filediff --git a/solr/webapp/web/css/styles/query.css b/solr/webapp/web/css/styles/query.cssindex 368eca32c17..6f2931774c7 100644--- a/solr/webapp/web/css/styles/query.css+++ b/solr/webapp/web/css/styles/query.css@@ -149,33 +149,6 @@width: 77%;}-#content #query #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 #query #result #url:focus,-#content #query #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 #query #result #response{}\ No newline at end of filediff --git a/solr/webapp/web/js/scripts/file.js b/solr/webapp/web/js/scripts/file.jsindex a1ff87763c8..95d201feba1 100644--- a/solr/webapp/web/js/scripts/file.js+++ b/solr/webapp/web/js/scripts/file.js@@ -22,34 +22,51 @@ sammy.getfunction( context ){var core_basepath = this.active_core.attr( 'data-basepath' );- var filetype = context.params.splat[1]; // either schema or config- var filename = this.active_core.attr( filetype );+ var content_element = $( '#content' );- $.ajax+ var url = window.location.protocol + '//' + window.location.host + core_basepath + '/admin/file'+ + '?file=' + this.active_core.attr( context.params.splat[1] )+ + '&contentType=text/xml;charset=utf-8';++ $.get(+ 'tpl/file.html',+ function( template ){- url : core_basepath + "/admin/file?file=" + filename + "&contentType=text/xml;charset=utf-8",- dataType : 'xml',- context : $( '#content' ),- beforeSend : function( xhr, settings )- {- this- .html( '<div class="loader">Loading ...</div>' );- },- complete : function( xhr, text_status )- {- var code = $(- '<pre class="syntax language-xml"><code>' +- xhr.responseText.esc() +- '</code></pre>'- );- this.html( code );-- if( 'success' === text_status )+ content_element+ .html( template );++ $( '#url', content_element )+ .text( url )+ .attr( 'href', url );++ $.ajax+ ({- hljs.highlightBlock( code.get(0) );+ url : url,+ dataType : 'xml',+ context : $( '#response' ,content_element ),+ beforeSend : function( xhr, settings )+ {+ this+ .html( '<div class="loader">Loading ...</div>' );+ },+ complete : function( xhr, text_status )+ {+ var code = $(+ '<pre class="syntax language-xml"><code>' ++ xhr.responseText.esc() ++ '</code></pre>'+ );+ this.html( code );++ if( 'success' === text_status )+ {+ hljs.highlightBlock( code.get(0) );+ }+ }}- }+ );});}diff --git a/solr/webapp/web/tpl/file.html b/solr/webapp/web/tpl/file.htmlnew file mode 100755index 00000000000..25fa03dcf87--- /dev/null+++ b/solr/webapp/web/tpl/file.html@@ -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.+-->+<div id="file" class="clearfix">++ <a id="url" class="address-bar" href="#"></a>++ <div id="response"></div>++</div>\ No newline at end of filediff --git a/solr/webapp/web/tpl/query.html b/solr/webapp/web/tpl/query.htmlindex 4272e8ec0ab..bd0cdb06981 100644--- a/solr/webapp/web/tpl/query.html+++ b/solr/webapp/web/tpl/query.html@@ -348,7 +348,7 @@ limitations under the License.<div id="result">- <a id="url" href="#"></a>+ <a id="url" class="address-bar" href="#"></a><div id="response">