Commit 0ac4918f authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

Simplify "onclick"

parent 7a051c6c
......@@ -114,9 +114,8 @@ function search_corpus(requested_corpus) {
// ==================================================================================
// this function is run atfer page loading
// this function is run after page loading
$(document).ready(function() {
// load the "groups.json" file
$.getJSON("corpora/groups.json").done(function(data) {
current_data = data;
init();
......@@ -157,11 +156,6 @@ function init() {
set_default();
current_snippets = get_info(current_corpus, "snippets");
init_sidebar();
init_table_button();
init_validation_button();
init_log_button();
$('#save-button').prop('disabled', true);
$('#export-button').prop('disabled', true);
......@@ -883,11 +877,9 @@ function last_svg() {
}
// ==================================================================================
function init_sidebar() {
$('#sidebarCollapse').on('click', function() {
$('#sidebar').toggleClass('active');
update_but_text();
});
function sidebar_toggle() {
$('#sidebar').toggleClass('active');
update_but_text();
}
// ==================================================================================
......@@ -901,27 +893,20 @@ function update_but_text() {
// ==================================================================================
function init_table_button() {
$('#tables').on('click', function() {
window.open('_meta/' + current_corpus + '_table.html');
});
function relation_tables() {
window.open('_meta/' + current_corpus + '_table.html');
}
// ==================================================================================
function init_validation_button() {
$('#validation').on('click', function() {
window.open('valid?corpus=' + current_corpus);
});
function validation_page() {
window.open('valid?corpus=' + current_corpus);
}
// ==================================================================================
function init_log_button() {
$('#logs').on('click', function() {
window.open('_meta/' + current_corpus + '.log');
});
function logs_page() {
window.open('_meta/' + current_corpus + '.log');
}
// ==================================================================================
function escape(s) {
s1 = s.split('@').join('_AT_');
......@@ -1009,7 +994,7 @@ function select_group(group, corpus) {
function update_group() {
// update labels of checkboxes
if (current_group == "semantics") {
if (current_group == "semantics" || current_group == "PMB" ) {
app.mode = "semantics";
} else {
app.mode = "syntax";
......
......@@ -107,7 +107,7 @@
<span href="" class="glyphicon glyphicon-question-sign tooltip-desc" id="warning-tooltip"></span>
</h4>
<h2 id="corpus">
<button type="button" id="sidebarCollapse" class="btn btn-primary">
<button type="button" id="sidebarCollapse" onclick="javascript:sidebar_toggle()" class="btn btn-primary">
<span id="but-text">Hide corpora list</span>
</button>
<span id="corpus-fixed"></span>
......@@ -115,13 +115,13 @@
<input type="checkbox" id="eud-box" data-size="mini" checked data-toggle="toggle" data-on="EUD" data-off="UD" data-onstyle="primary" data-offstyle="primary">
</span>
<span style="font-size: 66%" id="corpus-desc"></span>
<button type="button" id="logs" class="btn btn-danger" style="float: right; display: none;">
<button type="button" id="logs" onclick="javascript:logs_page()" class="btn btn-danger" style="float: right; display: none;">
Errors
</button>
<button type="button" id="validation" class="btn btn-primary" style="float: right; display: none;">
<button type="button" id="validation" onclick="javascript:validation_page()" class="btn btn-primary" style="float: right; display: none;">
Validation
</button>
<button v-if="mode=='syntax'" type="button" id="tables" class="btn btn-primary" style="float: right;">
<button v-if="mode=='syntax'" type="button" id="tables" onclick="javascript:relation_tables()" class="btn btn-primary" style="float: right;">
Relation tables
</button>
</h2>
......
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