SOLR-3238: Persist State of Verbose-Setting on Analysis

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1331706 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Matheis 2012-04-28 08:32:52 +00:00
parent d2a4908ac8
commit 269ff0028d
1 changed files with 39 additions and 17 deletions

View File

@ -15,6 +15,8 @@
limitations under the License. limitations under the License.
*/ */
var cookie_name = 'analysis_verbose';
// #/:core/analysis // #/:core/analysis
sammy.get sammy.get
( (
@ -160,23 +162,6 @@ sammy.get
} }
); );
$( '.verbose_output a', analysis_element )
.die( 'click' )
.live
(
'click',
function( event )
{
$( this ).parent()
.toggleClass( 'active' );
analysis_result
.toggleClass( 'verbose_output' );
check_empty_spacer();
}
);
var check_empty_spacer = function() var check_empty_spacer = function()
{ {
var spacer_holder = $( 'td.part.data.spacer .holder', analysis_result ); var spacer_holder = $( 'td.part.data.spacer .holder', analysis_result );
@ -208,6 +193,43 @@ sammy.get
); );
} }
var verbose_link = $( '.verbose_output a', analysis_element );
verbose_link
.die( 'toggle' )
.live
(
'toggle',
function( event )
{
$( this ).parent()
.toggleClass( 'active' );
analysis_result
.toggleClass( 'verbose_output' );
check_empty_spacer();
}
)
.die( 'click' )
.live
(
'click',
function( event )
{
$.cookie( cookie_name, $.cookie( cookie_name ) ? null : true );
$( this )
.trigger( 'toggle' );
}
);
if( $.cookie( cookie_name ) )
{
verbose_link
.trigger( 'toggle' );
}
var button = $( 'button', analysis_form ) var button = $( 'button', analysis_form )
var compute_analysis_params = function() var compute_analysis_params = function()