|
|
@ -3,7 +3,7 @@ |
|
|
|
<meta charset="utf-8"> |
|
|
|
<meta charset="utf-8"> |
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
|
|
<title>JSONPath evaluator</title> |
|
|
|
<title>Jayway JsonPath evaluator</title> |
|
|
|
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"> |
|
|
|
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"> |
|
|
|
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> |
|
|
|
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> |
|
|
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css"> |
|
|
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css"> |
|
|
@ -16,7 +16,7 @@ |
|
|
|
</head> |
|
|
|
</head> |
|
|
|
<body role="document"> |
|
|
|
<body role="document"> |
|
|
|
<div class="container"> |
|
|
|
<div class="container"> |
|
|
|
<h3>JSONPath evaluator</h3> |
|
|
|
<h3>Jayway JsonPath evaluator</h3> |
|
|
|
<div class="row"> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-md-6"> |
|
|
|
<div class="col-md-6"> |
|
|
|
<div class="form-group"> |
|
|
|
<div class="form-group"> |
|
|
@ -223,7 +223,6 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#txtPath').keyup(function(e) { |
|
|
|
$('#txtPath').keyup(function(e) { |
|
|
|
clearTimeout($.data(this, 'timer')); |
|
|
|
clearTimeout($.data(this, 'timer')); |
|
|
|
if (e.keyCode === 13) { |
|
|
|
if (e.keyCode === 13) { |
|
|
@ -234,6 +233,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function checkPath() { |
|
|
|
function checkPath() { |
|
|
|
var pathString = $("#txtPath").val(); |
|
|
|
var pathString = $("#txtPath").val(); |
|
|
|
|
|
|
|
|
|
|
@ -261,13 +261,10 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$('#submit').on('click', function() { |
|
|
|
$('#submit').on('click', function() { |
|
|
|
$('.result').empty(); |
|
|
|
$('.result').empty(); |
|
|
|
|
|
|
|
|
|
|
|
var json = $('#txtJson').val(); |
|
|
|
var json = $('#txtJson').val(); |
|
|
|
var path = $('#txtPath').val(); |
|
|
|
var path = $('#txtPath').val(); |
|
|
|
|
|
|
|
|
|
|
|
var data = { |
|
|
|
var data = { |
|
|
|
json: json, |
|
|
|
json: json, |
|
|
|
path: path, |
|
|
|
path: path, |
|
|
@ -276,7 +273,6 @@ |
|
|
|
flagNullLeaf: $('#cbFlagNullLeaf').prop('checked'), |
|
|
|
flagNullLeaf: $('#cbFlagNullLeaf').prop('checked'), |
|
|
|
flagSuppress: $('#cbFlagSuppress').prop('checked') |
|
|
|
flagSuppress: $('#cbFlagSuppress').prop('checked') |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(data); |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: "/api/eval", |
|
|
|
url: "/api/eval", |
|
|
|
type: 'POST', |
|
|
|
type: 'POST', |
|
|
@ -285,14 +281,14 @@ |
|
|
|
success: function(data) { |
|
|
|
success: function(data) { |
|
|
|
|
|
|
|
|
|
|
|
$('#jayway-time').text(data.jayway.time); |
|
|
|
$('#jayway-time').text(data.jayway.time); |
|
|
|
$('#jayway-res').hide().text(data.jayway.result).fadeIn(); |
|
|
|
//$('#jayway-res').hide().text(data.jayway.result).fadeIn(); |
|
|
|
|
|
|
|
$('#jayway-res').hide().empty(); |
|
|
|
if(data.jayway.error){ |
|
|
|
if(data.jayway.error){ |
|
|
|
$('#jayway-error').text(data.jayway.error).show(); |
|
|
|
$('#jayway-error').text(data.jayway.error).show(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$('#jayway-error').css( "display", "none") |
|
|
|
$('#jayway-error').css( "display", "none") |
|
|
|
|
|
|
|
$('#jayway-res').text(data.jayway.result).fadeIn(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#boon-time').text(data.boon.time); |
|
|
|
$('#boon-time').text(data.boon.time); |
|
|
|
$('#boon-res').hide().text(data.boon.result).fadeIn(); |
|
|
|
$('#boon-res').hide().text(data.boon.result).fadeIn(); |
|
|
|
if(data.boon.error){ |
|
|
|
if(data.boon.error){ |
|
|
@ -300,7 +296,6 @@ |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$('#boon-error').css( "display", "none") |
|
|
|
$('#boon-error').css( "display", "none") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$('#nebhale-time').text(data.nebhale.time); |
|
|
|
$('#nebhale-time').text(data.nebhale.time); |
|
|
|
$('#nebhale-res').hide().text(data.nebhale.result).fadeIn(); |
|
|
|
$('#nebhale-res').hide().text(data.nebhale.result).fadeIn(); |
|
|
|
if(data.nebhale.error){ |
|
|
|
if(data.nebhale.error){ |
|
|
@ -308,7 +303,6 @@ |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$('#nebhale-error').css( "display", "none") |
|
|
|
$('#nebhale-error').css( "display", "none") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var start = new Date().getTime(); |
|
|
|
var start = new Date().getTime(); |
|
|
|
var res; |
|
|
|
var res; |
|
|
|
try { |
|
|
|
try { |
|
|
@ -317,7 +311,6 @@ |
|
|
|
} catch(err){ |
|
|
|
} catch(err){ |
|
|
|
res = err.message; |
|
|
|
res = err.message; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var elapsed = new Date().getTime() - start; |
|
|
|
var elapsed = new Date().getTime() - start; |
|
|
|
|
|
|
|
|
|
|
|
$("#goessner-time").text(elapsed); |
|
|
|
$("#goessner-time").text(elapsed); |
|
|
|