|
|
@ -32,46 +32,18 @@ function setupInterface(data, file) {
|
|
|
|
|
|
|
|
|
|
|
|
$('#table-body').empty();
|
|
|
|
$('#table-body').empty();
|
|
|
|
|
|
|
|
|
|
|
|
$.each(data.data,
|
|
|
|
function gotoLocation(evt) {
|
|
|
|
function(nRow, el) {
|
|
|
|
if (urls != null) {
|
|
|
|
|
|
|
|
|
|
|
|
if (nRow < startIndex) return;
|
|
|
|
|
|
|
|
if (nRow >= endIndex) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var row = $("<tr/>");
|
|
|
|
|
|
|
|
row.append($('<td> <button class="btn btn-link btn-xs py-0 offset">' +
|
|
|
|
|
|
|
|
nRow + '</button> </td>'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.each(el,
|
|
|
|
|
|
|
|
function(column, content) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (column == 'url_id') return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
row.append(
|
|
|
|
let nRow = parseInt($(evt.target).text());
|
|
|
|
$(editable_html).
|
|
|
|
|
|
|
|
text(content).
|
|
|
|
|
|
|
|
data('tableInfo', { 'nRow': nRow, 'column': column })
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#table tbody").append(row);
|
|
|
|
let img_url = urls.data[data.data[nRow]['url_id']]['url']
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#table td:contains('B-PER')").addClass('ner_per');
|
|
|
|
console.log(img_url);
|
|
|
|
$("#table td:contains('I-PER')").addClass('ner_per');
|
|
|
|
|
|
|
|
$("#table td:contains('B-LOC')").addClass('ner_loc');
|
|
|
|
|
|
|
|
$("#table td:contains('I-LOC')").addClass('ner_loc');
|
|
|
|
|
|
|
|
$("#table td:contains('B-ORG')").addClass('ner_org');
|
|
|
|
|
|
|
|
$("#table td:contains('I-ORG')").addClass('ner_org');
|
|
|
|
|
|
|
|
$("#table td:contains('B-OTH')").addClass('ner_oth');
|
|
|
|
|
|
|
|
$("#table td:contains('I-OTH')").addClass('ner_oth');
|
|
|
|
|
|
|
|
$("#table td:contains('B-TODO')").addClass('ner_todo');
|
|
|
|
|
|
|
|
$("#table td:contains('I-TODO')").addClass('ner_todo');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(".offset").on('click',
|
|
|
|
$("#preview").attr("src", img_url);
|
|
|
|
function(evt) {
|
|
|
|
$("#preview-link").attr("href", img_url);
|
|
|
|
|
|
|
|
|
|
|
|
if (urls != null) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -106,7 +78,44 @@ function setupInterface(data, file) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.each(data.data,
|
|
|
|
|
|
|
|
function(nRow, el) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nRow < startIndex) return;
|
|
|
|
|
|
|
|
if (nRow >= endIndex) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var row = $("<tr/>");
|
|
|
|
|
|
|
|
row.append($('<td> <button class="btn btn-link btn-xs py-0 offset">' +
|
|
|
|
|
|
|
|
nRow + '</button> </td>'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.each(el,
|
|
|
|
|
|
|
|
function(column, content) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (column == 'url_id') return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
row.append(
|
|
|
|
|
|
|
|
$(editable_html).
|
|
|
|
|
|
|
|
text(content).
|
|
|
|
|
|
|
|
data('tableInfo', { 'nRow': nRow, 'column': column })
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#table tbody").append(row);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#table td:contains('B-PER')").addClass('ner_per');
|
|
|
|
|
|
|
|
$("#table td:contains('I-PER')").addClass('ner_per');
|
|
|
|
|
|
|
|
$("#table td:contains('B-LOC')").addClass('ner_loc');
|
|
|
|
|
|
|
|
$("#table td:contains('I-LOC')").addClass('ner_loc');
|
|
|
|
|
|
|
|
$("#table td:contains('B-ORG')").addClass('ner_org');
|
|
|
|
|
|
|
|
$("#table td:contains('I-ORG')").addClass('ner_org');
|
|
|
|
|
|
|
|
$("#table td:contains('B-OTH')").addClass('ner_oth');
|
|
|
|
|
|
|
|
$("#table td:contains('I-OTH')").addClass('ner_oth');
|
|
|
|
|
|
|
|
$("#table td:contains('B-TODO')").addClass('ner_todo');
|
|
|
|
|
|
|
|
$("#table td:contains('I-TODO')").addClass('ner_todo');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(".offset").on('click', gotoLocation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let table_html =
|
|
|
|
let table_html =
|
|
|
|