add demo url text parameter

pull/2/head
Kai Labusch 5 years ago
parent 311c3fc06e
commit a93385a4f8

@ -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);
}
Loading…
Cancel
Save