-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade pegjs to 0.10.0, jasmine to 2.8.0, use umd
- Loading branch information
Showing
8 changed files
with
688 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<!-- Load RequireJS --> | ||
<script type="text/javascript" src="../../vendor/require.js"></script> | ||
</head> | ||
<body> | ||
<h3>Query Text</h3> | ||
<textarea | ||
id="query_text" | ||
placeholder="Enter query text here..." | ||
rows="4" | ||
cols="120" | ||
onkeyup="parse_query()" | ||
>title:"The Right Way" AND text:go</textarea> | ||
|
||
<h3>Parser Output</h3> | ||
<hr /> | ||
<p> | ||
<code id="parser_output"> | ||
</code> | ||
</p> | ||
|
||
<script type="text/javascript"> | ||
function parse_query() { | ||
|
||
require(['../../lib/lucene-query-parser.js'], function(lucenequeryparser) { | ||
|
||
// get query text | ||
var query_text = document.getElementById('query_text').value; | ||
|
||
// parse query | ||
var results = lucenequeryparser.parse(query_text); | ||
|
||
// convert to pretty-printed JSON | ||
results = JSON.stringify(results, undefined, 2); | ||
results = results.replace(/\n/g, "<br>").replace(/[ ]/g, " "); | ||
|
||
// display results | ||
document.getElementById('parser_output').innerHTML = results | ||
}); | ||
} | ||
|
||
parse_query(); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.