mirror of
https://github.com/qurator-spk/sbb_ner.git
synced 2025-06-08 03:40:31 +02:00
add demo url text parameter
This commit is contained in:
parent
a1aff8e229
commit
311c3fc06e
1 changed files with 29 additions and 7 deletions
|
@ -4,11 +4,7 @@ $(document).ready(function(){
|
||||||
function(e){
|
function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var task = $('#task').val();
|
update();
|
||||||
var model_id = $('#model').val();
|
|
||||||
var input_text = $('#inputtext').val()
|
|
||||||
|
|
||||||
do_task(task, model_id, input_text);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -27,8 +23,34 @@ $(document).ready(function(){
|
||||||
tmp += '<option value="' + item.id + '" ' + selected + ' >' + item.name + '</option>'
|
tmp += '<option value="' + item.id + '" ' + selected + ' >' + item.name + '</option>'
|
||||||
});
|
});
|
||||||
$('#model').html(tmp);
|
$('#model').html(tmp);
|
||||||
|
|
||||||
|
var url_params = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
|
var do_update=false;
|
||||||
|
|
||||||
|
if (url_params.has('text')) {
|
||||||
|
|
||||||
|
var text = url_params.get('text')
|
||||||
|
|
||||||
|
$('#inputtext').val(text);
|
||||||
|
|
||||||
|
do_update = true;
|
||||||
|
|
||||||
|
window.history.replaceState({}, '', `${location.pathname}`);
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
|
||||||
task_select()
|
task_select()
|
||||||
|
|
||||||
|
if (do_update) update();
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
|
||||||
|
var task = $('#task').val();
|
||||||
|
var model_id = $('#model').val();
|
||||||
|
var input_text = $('#inputtext').val()
|
||||||
|
|
||||||
|
do_task(task, model_id, input_text);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue