Skip to content

Commit

Permalink
add auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ss committed Jun 4, 2021
1 parent 25c6480 commit 0ce5976
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
30 changes: 29 additions & 1 deletion client/src/visualizer_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,10 @@ var VisualizerUI = (function ($, window, undefined) {
}, 0);
}; // end showFileBrowser()
$("#collection_browser_button").click(function (evt) {
if (user == null) {
alert("you have to log in first");
return;
}
dispatcher.post("clearSearch");
});

Expand Down Expand Up @@ -2218,6 +2222,10 @@ var VisualizerUI = (function ($, window, undefined) {

var showSearchForm = function () {
// this.checked = searchActive; // TODO: dup? unnecessary? remove if yes.
if (user == null) {
alert("You have to log in first!");
return;
}
updateSearchButtons();
$("#search_form_event_type").change();
$("#search_form_relation_type").change();
Expand Down Expand Up @@ -2287,6 +2295,10 @@ var VisualizerUI = (function ($, window, undefined) {
},
});
$("#data_button").click(function () {
if (user == null) {
alert("You have to log in first!");
return;
}
dispatcher.post("showForm", [dataForm]);
});
// make nice-looking buttons for checkboxes and buttons
Expand Down Expand Up @@ -2337,6 +2349,10 @@ var VisualizerUI = (function ($, window, undefined) {
},
});
$("#label_button").click(function () {
if (user == null) {
alert("You have to log in first!");
return;
}
// get labeling function and update dom
let fullPath = window.location.href.split("#")[1];
let document = fullPath.split("/").reverse()[0];
Expand Down Expand Up @@ -2551,6 +2567,10 @@ var VisualizerUI = (function ($, window, undefined) {
},
});
$("#connect_button").click(function () {
if (user == null) {
alert("You have to log in first!");
return;
}
dispatcher.post("showForm", [connectForm]);
});
$("#connect_form-ok").click(function () {
Expand Down Expand Up @@ -2864,6 +2884,10 @@ var VisualizerUI = (function ($, window, undefined) {
},
});
$("#options_button").click(function () {
if (user == null) {
alert("You have to log in first!");
return;
}
dispatcher.post("showForm", [optionsForm]);
});
// make nice-looking buttons for checkboxes and radios
Expand Down Expand Up @@ -2948,6 +2972,10 @@ var VisualizerUI = (function ($, window, undefined) {
}

if (code === $.ui.keyCode.TAB) {
if (user == null) {
alert("you have to login first");
return;
}
showFileBrowser();
return false;
} else if (evt.shiftKey && code === $.ui.keyCode.RIGHT) {
Expand Down Expand Up @@ -3583,7 +3611,7 @@ var VisualizerUI = (function ($, window, undefined) {
},
],
close: function () {
if (fileBrowserWaiting) {
if (user != null && fileBrowserWaiting) {
showFileBrowser();
}
},
Expand Down
1 change: 1 addition & 0 deletions server/src/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
visual_options_get_arc_bundle,
visual_options_get_text_direction)
from stats import get_statistics
from session import get_session


def _fill_type_configuration(
Expand Down

0 comments on commit 0ce5976

Please sign in to comment.