lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steff...@apache.org
Subject svn commit: r1331705 - in /lucene/dev/trunk/solr/webapp/web: css/styles/analysis.css img/ico/question.png js/scripts/analysis.js tpl/analysis.html
Date Sat, 28 Apr 2012 08:29:58 GMT
Author: steffkes
Date: Sat Apr 28 08:29:58 2012
New Revision: 1331705

URL: http://svn.apache.org/viewvc?rev=1331705&view=rev
Log:
SOLR-3238: Link Analysis to Schema-Browser

Added:
    lucene/dev/trunk/solr/webapp/web/img/ico/question.png   (with props)
Modified:
    lucene/dev/trunk/solr/webapp/web/css/styles/analysis.css
    lucene/dev/trunk/solr/webapp/web/js/scripts/analysis.js
    lucene/dev/trunk/solr/webapp/web/tpl/analysis.html

Modified: lucene/dev/trunk/solr/webapp/web/css/styles/analysis.css
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/css/styles/analysis.css?rev=1331705&r1=1331704&r2=1331705&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/css/styles/analysis.css (original)
+++ lucene/dev/trunk/solr/webapp/web/css/styles/analysis.css Sat Apr 28 08:29:58 2012
@@ -47,6 +47,30 @@
   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;

Added: lucene/dev/trunk/solr/webapp/web/img/ico/question.png
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/img/ico/question.png?rev=1331705&view=auto
==============================================================================
Binary file - no diff available.

Modified: lucene/dev/trunk/solr/webapp/web/js/scripts/analysis.js
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/scripts/analysis.js?rev=1331705&r1=1331704&r2=1331705&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/js/scripts/analysis.js (original)
+++ lucene/dev/trunk/solr/webapp/web/js/scripts/analysis.js Sat Apr 28 08:29:58 2012
@@ -21,7 +21,8 @@ sammy.get
   /^#\/([\w\d-]+)\/(analysis)$/,
   function( context )
   {
-    var core_basepath = this.active_core.attr( 'data-basepath' );
+    var active_core = this.active_core;
+    var core_basepath = active_core.attr( 'data-basepath' );
     var content_element = $( '#content' );
         
     $.get
@@ -36,13 +37,32 @@ sammy.get
         var analysis_form = $( 'form', analysis_element );
         var analysis_result = $( '#analysis-result', analysis_element );
         analysis_result.hide();
-                
+
+        var type_or_name = $( '#type_or_name', analysis_form );
+        var schema_browser_element = $( '#tor_schema' );
+        var schema_browser_path = $( 'p > a', active_core ).attr( 'href' ) + '/schema-browser'
+        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', analysis_form ),
+            context : type_or_name,
             beforeSend : function( xhr, settings )
             {
               this

Modified: lucene/dev/trunk/solr/webapp/web/tpl/analysis.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/tpl/analysis.html?rev=1331705&r1=1331704&r2=1331705&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/tpl/analysis.html (original)
+++ lucene/dev/trunk/solr/webapp/web/tpl/analysis.html Sat Apr 28 08:29:58 2012
@@ -55,6 +55,7 @@ limitations under the License.
 
               <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">
 



Mime
View raw message