diff --git a/qurator/sbb_ner/webapp/static/js/ner-demo.js b/qurator/sbb_ner/webapp/static/js/ner-demo.js index 3e97dc8..0dff38e 100644 --- a/qurator/sbb_ner/webapp/static/js/ner-demo.js +++ b/qurator/sbb_ner/webapp/static/js/ner-demo.js @@ -30,7 +30,7 @@ $(document).ready(function(){ if (url_params.has('text')) { - var text = url_params.get('text') + var text = decodeURIComponent(url_params.get('text')) $('#inputtext').val(text); @@ -52,5 +52,16 @@ function update() { var model_id = $('#model').val(); var input_text = $('#inputtext').val() + if (input_text.length < 200) { + + var url_params = new URLSearchParams(window.location.search); + + url_params.set('text', encodeURIComponent(input_text)) + + window.history.replaceState({}, '', `${location.pathname}?${url_params}`); + } + + + do_task(task, model_id, input_text); } \ No newline at end of file