w2v-server: show dialog if word not found
diff --git a/templates/index.html.ep b/templates/index.html.ep
index cdca76b..72066ed 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -38,6 +38,7 @@
$(".selector").tabs({ active: 1 });
+
$('#firsttable').DataTable({
"sScrollY": "780px",
"bScrollCollapse": true,
@@ -736,9 +737,30 @@
</script>
% } else {
<div id="wrapper">
- <p>
- ERROR: "<%= $word %>" not found in vocabluary.
- </p>
+ <div id="not-found-dialog" title="Not found">
+ <p>ERROR: "<%= $word %>" not found in vocabluary.</p>
+ <p>If you are sure you have spelled the word as intended, you can try to increase the cutoff parameter in the options menu.</p>
+ </div>
+ <script>
+ $( function() {
+ $( "#not-found-dialog" ).dialog({
+ autoOpen: true,
+ modal: true,
+ draggable: false,
+ height: "auto",
+ width: "auto",
+ resizable: false,
+ buttons: {
+ "OK": function() {
+ $( this ).dialog( "close" );
+ },
+ "Apply": function() {
+ window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
+ }
+ }
+ });
+ });
+ </script>
</div>
% }
<div id="second">