Commit b75bab23 authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

“whether” get parameter

parent 3ce30baf
var cmEditor = undefined; // CodeMirror component
var current_request_id = ""
var result_nb = 0; // number of given results
......@@ -750,16 +748,6 @@ function copy_conll() {
// ==================================================================================
function save_pattern() {
var clustering = "";
if (app.clust1 == 'key') {
clustering = "&clustering=" + app.clust1_key;
}
var eud = "";
if (get_info(current_corpus, "enhanced") && $('#eud-box').prop('checked')) {
eud = "&eud=yes"
}
if (current_request_id.length > 0) {
var data = {
request: "SHORTEN",
......@@ -772,11 +760,22 @@ function save_pattern() {
data: data,
type: 'post',
success: function(output) {
let get = "?corpus=" + current_corpus + "&custom=" + output;
if (app.clust1 == 'key') {
get += "&clustering=" + app.clust1_key;
}
if (app.clust1 == 'whether') {
get += "&whether=" + clust1_cm.getValue();
}
if (get_info(current_corpus, "enhanced") && $('#eud-box').prop('checked')) {
get += "&eud=yes"
}
history.pushState({
id: output
},
"Grew - Custom saved pattern",
"?corpus=" + current_corpus + "&custom=" + output + clustering + eud
get
);
$('#custom-url').text(window.location.href);
$('#custom-display').show();
......
......@@ -2,20 +2,20 @@ var app = new Vue({
el: '#app',
data: {
clust1: "no", // 3 possible values: no, key or whether
clust2: "no", // 3 possible values: no, key or whether
clust1_key: "",
clust1_whether: "",
clust2: "no", // 3 possible values: no, key or whether
},
});
$(document).ready(function() {
var get_cluster = getParameterByName("clustering");
const get_cluster = getParameterByName("clustering");
if (get_cluster.length > 0) {
app.clust1 = "key";
app.clust1_key = get_cluster;
}
var whether = getParameterByName("whether");
console.log(">>>"+whether+"<<<");
const whether = getParameterByName("whether");
if (whether.length > 0) {
app.clust1 = "whether";
app.clust1_whether = whether;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment