Browse Source

refactor js status bar

experimental
Paweł Jedwabny 4 years ago
parent
commit
f15d2fa74f
2 changed files with 19 additions and 25 deletions
  1. +17
    -23
      src/StatusBar/main.js
  2. +2
    -2
      src/epesi.js

+ 17
- 23
src/StatusBar/main.js View File

@@ -7,47 +7,41 @@ window.statusbar_fade_count = 0;
window.statusbar_fade=function(fade_count){
NProgress.configure({parent: '#nano-bar'});
NProgress.start();
if (fade_count && statusbar_fade_count!=fade_count) return;
if (fade_count && statusbar_fade_count !== fade_count) return;
let seconds = 0.2;
wait_while_null('jq(\'#Base_StatusBar\').get(0)','jq(\'#Base_StatusBar\').fadeOut();NProgress.done();');
let statbar = document.getElementById('Base_StatusBar');
jQuery(statbar).fadeOut();
NProgress.done();
jq('#Base_StatusBar').get(0).onclick = null;
setTimeout('statusbar_fade_double_check('+statusbar_fade_count+')',seconds*1000+50);
};
window.statusbar_fade_double_check = function(fade_count) {
if (fade_count && statusbar_fade_count!=fade_count) jq('#Base_StatusBar').show();
else jq('#Base_StatusBar').get(0).onclick = Function("if(!Epesi.procOn)statusbar_fade();");
let statbar = document.getElementById('Base_StatusBar');

if (fade_count && statusbar_fade_count !== fade_count) statbar.style.display = '';
else statbar.onclick = Function("if(!Epesi.procOn)statusbar_fade();");
};
window.updateEpesiIndicatorFunction=function(){
Epesi.indicator_text='statusbar_text';
Epesi.indicator='Base_StatusBar';
let statbar = jq('#Base_StatusBar').get(0);
if (!statbar) {
setTimeout('updateEpesiIndicatorFunction();',3000);
return;
}
jq('#epesiStatus').hide();
jq('#main_content').show();
statbar.onclick = Function("if(!Epesi.procOn)statusbar_fade();");
let statbar = document.getElementById('Base_StatusBar');

statbar.onclick = Function("if(!Epesi.procOn)statusbar_fade();");
statbar.style.display='none';

Epesi.updateIndicator=function(){
let statbar = jq('#Base_StatusBar').get(0);
let cache_pause;
let statbar = document.getElementById('Base_StatusBar');
statusbar_fade_count++;
if(Epesi.procOn){
jq('#dismiss').hide();
document.getElementById('dismiss').style.display = 'none';
statbar.style.display='block';
cache_pause=true;
}else{
if(statusbar_message_t!='') {
jq('#dismiss').show();
t=jq('#statusbar_text');
if(t.length>0)t.html(statusbar_message_t);
if(statusbar_message_t !== '') {
document.getElementById('dismiss').style.display = '';
document.getElementById('statusbar_text').innerHTML = statusbar_message_t;
statusbar_message('');
setTimeout('statusbar_fade('+statusbar_fade_count+')',5000);
}else{
statusbar_fade();
};
cache_pause=false;
};
};
};

+ 2
- 2
src/epesi.js View File

@@ -17,8 +17,8 @@ class Epesi {
procOn = 0;
client_id = 0;
process_file = 'process.php';
indicator = null;
indicator_text = null;
indicator = 'Base_StatusBar';
indicator_text = 'statusbar_text';

constructor(client_id, process_file_path, params = '') {
this.client_id=client_id;


Loading…
Cancel
Save