Change location where socket is initialized...again

This commit is contained in:
Patrick Jentsch 2020-05-27 13:32:07 +02:00
parent 94d99862bd
commit ba916b70bd
2 changed files with 10 additions and 14 deletions

View File

@ -201,7 +201,7 @@ nopaque.flash = function() {
} }
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", () => {
// Disable all option elements with no value // Disable all option elements with no value
for (let optionElement of document.querySelectorAll('option[value=""]')) { for (let optionElement of document.querySelectorAll('option[value=""]')) {
optionElement.disabled = true; optionElement.disabled = true;

View File

@ -44,17 +44,21 @@
{% endif %} {% endif %}
<script src="{{ url_for('static', filename='js/JSONPatch.js/jsonpatch.min.js') }}"></script> <script src="{{ url_for('static', filename='js/JSONPatch.js/jsonpatch.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/Dark_Reader/darkreader.js') }}"></script> <script src="{{ url_for('static', filename='js/Dark_Reader/darkreader.js') }}"></script>
{% if current_user.is_authenticated and current_user.setting_dark_mode %}
<script>
DarkReader.enable({"brightness": 150, "contrast": 100, "sepia": 0});
</script>
{% endif %}
<script src="{{ url_for('static', filename='js/List.js/list.min.js') }}"></script> <script src="{{ url_for('static', filename='js/List.js/list.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/Socket.IO/socket.io.slim.js') }}"></script> <script src="{{ url_for('static', filename='js/Socket.IO/socket.io.slim.js') }}"></script>
<script src="{{ url_for('static', filename='js/nopaque.js') }}"></script> <script src="{{ url_for('static', filename='js/nopaque.js') }}"></script>
<script src="{{ url_for('static', filename='js/nopaque.lists.js') }}"></script> <script src="{{ url_for('static', filename='js/nopaque.lists.js') }}"></script>
<script> <script>
{% if current_user.is_authenticated %}
{% if current_user.setting_dark_mode %}
DarkReader.enable({"brightness": 150, "contrast": 100, "sepia": 0});
{% endif %}
document.addEventListener("DOMContentLoaded", () => {
nopaque.socket.init();
nopaque.socket.emit("user_data_stream_init");
});
nopaque.flashedMessages = {{ get_flashed_messages(with_categories=True)|tojson }}; nopaque.flashedMessages = {{ get_flashed_messages(with_categories=True)|tojson }};
{% endif %}
</script> </script>
</head> </head>
<body> <body>
@ -235,13 +239,5 @@
--> -->
<script src="{{ url_for('static', filename='js/Materialize/materialize.min.js') }}"></script> <script src="{{ url_for('static', filename='js/Materialize/materialize.min.js') }}"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
{% if current_user.is_authenticated %}
nopaque.socket.init();
nopaque.socket.emit("user_data_stream_init");
{% endif %}
});
</script>
</body> </body>
</html> </html>