Add strict mode to history.html script

This commit is contained in:
Ludovic Stephan 2017-03-18 22:15:09 -03:00
parent b8a307b4a6
commit fa64a68378

View file

@ -63,6 +63,7 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
'use strict';
// Lock to avoid multiple requests // Lock to avoid multiple requests
window.lock = 0; window.lock = 0;
@ -138,12 +139,12 @@ $(document).ready(function() {
// Synchronization // Synchronization
// ----- // -----
websocket_msg_default = {'opegroups':[],'opes':[]} var websocket_msg_default = {'opegroups':[],'opes':[]}
var websocket_protocol = window.location.protocol == 'https:' ? 'wss' : 'ws'; var websocket_protocol = window.location.protocol == 'https:' ? 'wss' : 'ws';
var location_host = window.location.host; var location_host = window.location.host;
var location_url = window.location.pathname.startsWith('/gestion/') ? location_host + '/gestion' : location_host; var location_url = window.location.pathname.startsWith('/gestion/') ? location_host + '/gestion' : location_host;
socket = new ReconnectingWebSocket(websocket_protocol+"://" + location_url + "/ws/k-fet/k-psul/"); var socket = new ReconnectingWebSocket(websocket_protocol+"://" + location_url + "/ws/k-fet/k-psul/");
socket.onmessage = function(e) { socket.onmessage = function(e) {
data = $.extend({}, websocket_msg_default, JSON.parse(e.data)); data = $.extend({}, websocket_msg_default, JSON.parse(e.data));
history.update_data(data); history.update_data(data);