Commit 3da05a76 authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'datalognotification-modifications' into 'stable-3.1'

Datalognotification modifications fixes for all but chrome, added stability when losing connection



See merge request !418
parents 198271a3 4adec2ee
......@@ -8,6 +8,7 @@ var ISPConfig = {
indicatorCompleted: false,
registeredHooks: new Array(),
new_tpl_add_id: 0,
dataLogTimer: 0,
options: {
useLoadIndicator: false,
......@@ -175,6 +176,8 @@ var ISPConfig = {
ISPConfig.onAfterContentLoad(target, $('#'+formname).serialize());
ISPConfig.pageFormChanged = false;
}
clearTimeout(dataLogTimer);
ISPConfig.dataLogNotification();
ISPConfig.hideLoadIndicator();
},
error: function(jqXHR, textStatus, errorThrown) {
......@@ -282,6 +285,8 @@ var ISPConfig = {
ISPConfig.onAfterContentLoad(pagename, (params ? params : null));
ISPConfig.pageFormChanged = false;
}
clearTimeout(dataLogTimer); // clear running dataLogTimer
ISPConfig.dataLogNotification();
ISPConfig.hideLoadIndicator();
},
error: function() {
......@@ -346,7 +351,7 @@ var ISPConfig = {
ISPConfig.loadMenus();
ISPConfig.keepalive();
ISPConfig.datalognotification();
ISPConfig.dataLogNotification();
setTimeout(function() {
try {
$('form#pageForm').find('input[name="username"]').focus();
......@@ -494,7 +499,8 @@ var ISPConfig = {
}
});
},
datalognotification: function() {
dataLogNotification: function() {
console.log(ISPConfig.options);
var notificationContent = $.ajax({
type: "GET",
url: "datalogstatus.php",
......@@ -502,17 +508,18 @@ var ISPConfig = {
success: function(data, textStatus, jqXHR) {
var dataLogItems = [];
$.each( data['entries'], function( key, val ) {
dataLogItems.push('<li><strong>' + val['text'] + ':</strong> ' + val['count'] + '</li>');
dataLogItems.push('<li><strong>' + val['text'] + ':</strong> ' + val['count'] + '</li>');
});
if(data['count'] > 0) {
$('.modal-body').html(dataLogItems.join(""));
$('.notification_text').text(data['count']);
$('.notification').css('display','');
setTimeout( function() { ISPConfig.datalognotification(); }, 2000 );
dataLogTimer = setTimeout( function() { ISPConfig.dataLogNotification(); }, 2000 );
} else {
$('.notification').css('display','none');
$('.modal-body').html('');
setTimeout( function() { ISPConfig.datalognotification(); }, 5000 );
$('#datalogModal').modal('hide');
dataLogTimer = setTimeout( function() { ISPConfig.dataLogNotification(); }, 5000 );
}
},
error: function() {
......
......@@ -724,18 +724,26 @@ input[type="password"].form-control[readonly] {
max-width: 100%;
}
.notification {
width: 35px;
height: 35px;
background: #c70f19;
border-radius: 50%;
display: inline-flex;
margin-right: 15px;
margin-top: 15px;
cursor: pointer;
width: 35px;
height: 35px;
background: #c70f19;
border-radius: 50%;
display: flex;
position: absolute;
margin-top: 15px;
cursor: pointer;
margin-right: 15px;
}
.notification {
animation: pulse 2s infinite;
}
@media (max-width: 600px) {
.notification {
margin-top: 0px;
margin-right: 0px;
margin-left: 230px;
}
}
@keyframes pulse {
0% {
background: #ff000e;
......
......@@ -61,31 +61,31 @@
</tmpl_if>
</div>
</div>
<div class="notification" data-toggle="modal" data-target="#myModal" style="display: none;">
<span class="notification_text">{tmpl_var name="datalog_changes_count"}</span>
</div>
<!-- Datalogstatus Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">{tmpl_var name="datalog_changes_txt"}</h4>
</div>
<div class="modal-body">
<ul>
<tmpl_loop name="datalog_changes">
<li><strong>{tmpl_var name="text"}:</strong> {tmpl_var name="count"}</li>
</tmpl_loop>
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- END Datalogstatus Modal -->
<div class="notification" data-toggle="modal" data-target="#datalogModal" style="display: none;">
<span class="notification_text">{tmpl_var name="datalog_changes_count"}</span>
</div>
<!-- Datalogstatus Modal -->
<div id="datalogModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">{tmpl_var name="datalog_changes_txt"}</h4>
</div>
<div class="modal-body">
<ul>
<tmpl_loop name="datalog_changes">
<li><strong>{tmpl_var name="text"}:</strong> {tmpl_var name="count"}</li>
</tmpl_loop>
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- END Datalogstatus Modal -->
<tmpl_if name='logged_in' value='y'><div id='topnav-container'>
</div></tmpl_if>
<div class='clear'>
......
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