From cfbabcf54f27c3e6faaad081a9e711e3532e2c6d Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Mon, 7 May 2012 19:39:22 +0000 Subject: [PATCH] SOLR-3371: update sammy paths so the core name is not assumed in request git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1335213 13f79535-47bb-0310-9956-ffa450edef68 --- solr/webapp/web/css/styles/menu.css | 15 +++++++++------ solr/webapp/web/js/scripts/app.js | 6 +++++- solr/webapp/web/js/scripts/cloud.js | 2 +- solr/webapp/web/js/scripts/cores.js | 4 ++-- solr/webapp/web/js/scripts/java-properties.js | 2 +- solr/webapp/web/js/scripts/logging.js | 2 +- solr/webapp/web/js/scripts/threads.js | 2 +- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/solr/webapp/web/css/styles/menu.css b/solr/webapp/web/css/styles/menu.css index a1c7e3deb99..b23bbdf4484 100644 --- a/solr/webapp/web/css/styles/menu.css +++ b/solr/webapp/web/css/styles/menu.css @@ -177,12 +177,12 @@ color: #333; } -#menu #index p a { background-image: url( ../../img/ico/dashboard.png ); } -#menu #logging p a { background-image: url( ../../img/ico/inbox-document-text.png ); } -#menu #java-properties p a { background-image: url( ../../img/ico/jar.png ); } -#menu #threads p a { background-image: url( ../../img/ico/ui-accordion.png ); } -#menu #cores p a { background-image: url( ../../img/ico/databases.png ); } -#menu #cloud p a { background-image: url( ../../img/ico/network-cloud.png ); } +#menu #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 #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-selector .ping.error a { @@ -228,6 +228,9 @@ padding-left: 26px; padding-top: 5px; padding-bottom: 5px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } #content #navigation a:hover diff --git a/solr/webapp/web/js/scripts/app.js b/solr/webapp/web/js/scripts/app.js index 00f3b9a97ca..c67e3405263 100644 --- a/solr/webapp/web/js/scripts/app.js +++ b/solr/webapp/web/js/scripts/app.js @@ -98,7 +98,11 @@ var sammy = $.sammy if( this.params.splat ) { - var active_element = $( '#' + this.params.splat[0], menu_wrapper ); + var selector = '~' === this.params.splat[0][0] + ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global' + : '#menu-selector #' + this.params.splat[0]; + + var active_element = $( selector, menu_wrapper ); if( 0 === active_element.size() ) { diff --git a/solr/webapp/web/js/scripts/cloud.js b/solr/webapp/web/js/scripts/cloud.js index cfd19003492..bbb7e9dd86d 100644 --- a/solr/webapp/web/js/scripts/cloud.js +++ b/solr/webapp/web/js/scripts/cloud.js @@ -661,7 +661,7 @@ var init_tree = function( tree_element ) // #/~cloud sammy.get ( - /^#\/~(cloud)$/, + /^#\/(~cloud)$/, function( context ) { var content_element = $( '#content' ); diff --git a/solr/webapp/web/js/scripts/cores.js b/solr/webapp/web/js/scripts/cores.js index 09b5d2ca860..05f21b1f71b 100644 --- a/solr/webapp/web/js/scripts/cores.js +++ b/solr/webapp/web/js/scripts/cores.js @@ -104,7 +104,7 @@ sammy.bind // #/~cores sammy.get ( - /^#\/~(cores)$/, + /^#\/(~cores)$/, function( context ) { delete app.cores_template; @@ -134,7 +134,7 @@ sammy.get // #/~cores sammy.get ( - /^#\/~(cores)\//, + /^#\/(~cores)\//, function( context ) { var content_element = $( '#content' ); diff --git a/solr/webapp/web/js/scripts/java-properties.js b/solr/webapp/web/js/scripts/java-properties.js index f4e35ec44aa..af33195d0c5 100644 --- a/solr/webapp/web/js/scripts/java-properties.js +++ b/solr/webapp/web/js/scripts/java-properties.js @@ -18,7 +18,7 @@ // #/~java-properties sammy.get ( - /^#\/~(java-properties)$/, + /^#\/(~java-properties)$/, function( context ) { var core_basepath = $( 'li[data-basepath]', app.menu_element ).attr( 'data-basepath' ); diff --git a/solr/webapp/web/js/scripts/logging.js b/solr/webapp/web/js/scripts/logging.js index 6fbb93cb350..7b95b21b117 100644 --- a/solr/webapp/web/js/scripts/logging.js +++ b/solr/webapp/web/js/scripts/logging.js @@ -383,7 +383,7 @@ var load_logging_viewer = function() // #/~logging sammy.get ( - /^#\/~(logging)$/, + /^#\/(~logging)$/, function( context ) { var core_basepath = $( 'li[data-basepath]', app.menu_element ).attr( 'data-basepath' ); diff --git a/solr/webapp/web/js/scripts/threads.js b/solr/webapp/web/js/scripts/threads.js index 547139a31c0..f0291b4d8bf 100644 --- a/solr/webapp/web/js/scripts/threads.js +++ b/solr/webapp/web/js/scripts/threads.js @@ -18,7 +18,7 @@ // #/~threads sammy.get ( - /^#\/~(threads)$/, + /^#\/(~threads)$/, function( context ) { var core_basepath = $( 'li[data-basepath]', app.menu_element ).attr( 'data-basepath' );