Skip to content

Commit

Permalink
show validation response
Browse files Browse the repository at this point in the history
  • Loading branch information
kba committed May 18, 2016
1 parent b14f028 commit cb7532d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
/*.alto
vendor/*
!vendor/Makefile
xsd/
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</button>
</div>
<div class="result hidden" id="validate-result">
<pre></pre>
<pre><code></code></pre>
</div>

</div>
Expand Down
9 changes: 7 additions & 2 deletions web/ocr-schema.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
function escapeHTML(str) {
return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
return str.
replace(/&/g, '&amp;').
replace(/</g, '&lt;').
replace(/"/g, '&quot;').
replace(/'/g, '&#39;').
replace(/\//g, '&#x2F').
replace(/>/g, '&gt;');
}
function updateOptions() {
$.ajax({
Expand Down Expand Up @@ -34,7 +40,6 @@ function handleClick(tabName, params) {
type: 'GET',
url: 'ocr-schema.php?do=' + tabName + '&' + params + "&url=" + url,
success: function(data) {
console.log(data);
$("#" + tabName + "-result pre code").html(escapeHTML(data));
$("#" + tabName + "-submit .spinning").addClass('hidden');
$("#" + tabName + "-result").removeClass('hidden');
Expand Down

0 comments on commit cb7532d

Please sign in to comment.