mirror of https://github.com/apache/lucene.git
SOLR-3840: XML query response display is unreadable in Solr Admin Query UI
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1429288 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
348f84c32f
commit
7364aab17f
|
@ -225,6 +225,9 @@ Optimizations
|
|||
* SOLR-3851: create a new core/delete an existing core should also update
|
||||
the main/left list of cores on the admin UI (steffkes)
|
||||
|
||||
* SOLR-3840: XML query response display is unreadable in Solr Admin Query UI
|
||||
(steffkes)
|
||||
|
||||
Bug Fixes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -417,6 +417,16 @@ 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,
|
||||
|
@ -425,6 +435,11 @@ pre.syntax .tex .formula
|
|||
color: #d14;
|
||||
}
|
||||
|
||||
pre.syntax.language-json .string
|
||||
{
|
||||
color: green;
|
||||
}
|
||||
|
||||
pre.syntax .title,
|
||||
pre.syntax .id
|
||||
{
|
||||
|
@ -464,6 +479,12 @@ pre.syntax .lisp .body
|
|||
color: #008080;
|
||||
}
|
||||
|
||||
pre.syntax.language-json .attribute
|
||||
{
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
pre.syntax .regexp
|
||||
{
|
||||
color: #009926;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -36,7 +36,7 @@ sammy.get
|
|||
var query_form = $( '#form form', query_element );
|
||||
var url_element = $( '#url', query_element );
|
||||
var result_element = $( '#result', query_element );
|
||||
var response_element = $( '#response iframe', result_element );
|
||||
var response_element = $( '#response', result_element );
|
||||
|
||||
url_element
|
||||
.die( 'change' )
|
||||
|
@ -45,40 +45,49 @@ sammy.get
|
|||
'change',
|
||||
function( event )
|
||||
{
|
||||
var check_iframe_ready_state = function()
|
||||
{
|
||||
var iframe_element = response_element.get(0).contentWindow.document || response_element.get(0).document;
|
||||
var wt = $( '[name="wt"]', query_form ).val();
|
||||
|
||||
if( !iframe_element )
|
||||
var content_generator = {
|
||||
|
||||
_default : function( xhr )
|
||||
{
|
||||
console.debug( 'no iframe_element found', response_element );
|
||||
return false;
|
||||
return xhr.responseText.esc();
|
||||
},
|
||||
|
||||
json : function( xhr )
|
||||
{
|
||||
return JSON.stringify( JSON.parse( xhr.responseText ), undefined, 2 );
|
||||
}
|
||||
|
||||
url_element
|
||||
.addClass( 'loader' );
|
||||
};
|
||||
|
||||
if( 'complete' === iframe_element.readyState )
|
||||
$.ajax
|
||||
(
|
||||
{
|
||||
url_element
|
||||
.removeClass( 'loader' );
|
||||
}
|
||||
else
|
||||
{
|
||||
window.setTimeout( check_iframe_ready_state, 100 );
|
||||
}
|
||||
}
|
||||
check_iframe_ready_state();
|
||||
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 );
|
||||
|
||||
response_element
|
||||
.attr( 'src', this.href );
|
||||
|
||||
if( !response_element.hasClass( 'resized' ) )
|
||||
{
|
||||
response_element
|
||||
.addClass( 'resized' )
|
||||
.css( 'height', $( '#main' ).height() - 60 );
|
||||
}
|
||||
if( 'success' === text_status )
|
||||
{
|
||||
hljs.highlightBlock( code.get(0) );
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ limitations under the License.
|
|||
</select>
|
||||
|
||||
<label for="indent" class="checkbox">
|
||||
<input type="checkbox" name="indent" id="indent" value="true" title="Indent results.">
|
||||
<input type="checkbox" name="indent" id="indent" value="true" title="Indent results." checked="checked">
|
||||
<a rel="help">indent</a>
|
||||
</label>
|
||||
|
||||
|
|
Loading…
Reference in New Issue