Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Link from Analysis Page to related Page from Schema-Browser

  • Loading branch information...
commit 626673ff179a9974379bb1b645480e7d49a3c7a9 1 parent 88829e1
@steffkes authored
View
19 css/styles/analysis.css
@@ -47,6 +47,25 @@
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 span
+{
+ display: none;
+}
+
+#content #analysis .settings #tor_schema:hover span
+{
+ display: inline;
+}
+
#content #analysis .settings .buttons
{
float: right;
View
BIN  img/ico/question-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
26 js/scripts/analysis.js
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.