function currentTaskInfo(currentTaskInf) {
        $('.js-previousTasks').empty();
        var now = new Date().getTime();
        var oldTaskHTML = '';
    
        if(currentTaskInf != undefined) {
        var currentID = currentTaskInf.current.id -1;
            if (currentTaskInf.current.anyCurrent) {
                timer = now - currentTaskInf.current.date;
                if(currentTaskInf.current.totalSpended > 0) {
                    timer += currentTaskInf.current.totalSpended;
                }
                timer = millisToMinutesAndSeconds(timer);
                timer = timer.split(':')
                if(parseInt(timer[0]) > 0) {
                    if(parseInt(timer[0]) < 10 ){
                        timer[0] = timer[0].toString().substring(1);
                    }
                    $('.js-currentTask-time-hour').text(timer[0] +' Hour(s) and');
                }
                $('.js-currentTask-time-min').text(timer[1] + ' minute(s)');
                $('.js-currentTask-name').text(currentTaskInf.current.name);
                $('.js-has-working-task').removeClass('hidden');
                $('.js-no-working-task').addClass('hidden');
            } else{
                $('.js-has-working-task').addClass('hidden');
                $('.js-no-working-task').removeClass('hidden');
            }
            for (var i = 0; i < currentTaskInf.oldTasks.length; i++) {
                if((!(currentTaskInf.current.anyCurrent && currentID == i)) && !currentTaskInf.oldTasks[i].removed){
                    timer = millisToMinutesAndSeconds(currentTaskInf.oldTasks[i].totalSpended);
                    oldTaskHTML += '<div class="inactiveTask" data-id="' + currentTaskInf.oldTasks[i].id + '"> <span class="inactiveTaskName">';
                    oldTaskHTML += currentTaskInf.oldTasks[i].name + ' - </span> <span class="inactiveTaskDate">';
                    oldTaskHTML += timer + '</span> <span class="launchTask js-launchTask"> <img src="../assets/icons/launch.png" title="Start working on this task"> </span>';
                    oldTaskHTML += '<span class="removeOldTask js-removeOldTask" data-id="' + currentTaskInf.oldTasks[i].id + '">  <img src="../assets/icons/remove.png" title="Remove this task">  </span>';
                    oldTaskHTML += '</div>';
                }
            }
            
        $('.js-previousTasks').append(oldTaskHTML);
        }
    }
/**
    * list tasks when extension opened
    * @function listTasks
    * @memberof popupjs
    */
list tasks when extension opened
@function listTasks
@memberof popupjs
list tasks when extension opened @function listTasks @memberof popupjs
function currentTaskInfo(currentTaskInf) {
        $('.js-previousTasks').empty();
        var now = new Date().getTime();
        var oldTaskHTML = '';
        if(currentTaskInf != undefined) {
        var currentID = currentTaskInf.current.id -1;
            if (currentTaskInf.current.anyCurrent) {
                timer = now - currentTaskInf.current.date;
                if(currentTaskInf.current.totalSpended > 0) {
                    timer += currentTaskInf.current.totalSpended;
                }
                timer = millisToMinutesAndSeconds(timer);
                timer = timer.split(':')
                if(parseInt(timer[0]) > 0) {
                    if(parseInt(timer[0]) < 10 ){
                        timer[0] = timer[0].toString().substring(1);
                    }
                    $('.js-currentTask-time-hour').text(timer[0] +' Hour(s) and');
                }
                $('.js-currentTask-time-min').text(timer[1] + ' minute(s)');
                $('.js-currentTask-name').text(currentTaskInf.current.name);
                $('.js-has-working-task').removeClass('hidden');
                $('.js-no-working-task').addClass('hidden');
            } else{
                $('.js-has-working-task').addClass('hidden');
                $('.js-no-working-task').removeClass('hidden');
            }
            for (var i = 0; i < currentTaskInf.oldTasks.length; i++) {
                if((!(currentTaskInf.current.anyCurrent && currentID == i)) && !currentTaskInf.oldTasks[i].removed){
                    timer = millisToMinutesAndSeconds(currentTaskInf.oldTasks[i].totalSpended);
                    oldTaskHTML += '<div class="inactiveTask" data-id="' + currentTaskInf.oldTasks[i].id + '"> <span class="inactiveTaskName">';
                    oldTaskHTML += currentTaskInf.oldTasks[i].name + ' - </span> <span class="inactiveTaskDate">';
                    oldTaskHTML += timer + '</span> <span class="launchTask js-launchTask"> <img src="../assets/icons/launch.png" title="Start working on this task"> </span>';
                    oldTaskHTML += '<span class="removeOldTask js-removeOldTask" data-id="' + currentTaskInf.oldTasks[i].id + '">  <img src="../assets/icons/remove.png" title="Remove this task">  </span>';
                    oldTaskHTML += '</div>';
                }
            }
        $('.js-previousTasks').append(oldTaskHTML);
        }
    }
function currentTaskInfo ( currentTaskInf ) { $ ( '.js-previousTasks' ) . empty ( ) ; var now = new Date ( ) . getTime ( ) ; var oldTaskHTML = '' ; if ( currentTaskInf != undefined ) { var currentID = currentTaskInf . current . id - 1 ; if ( currentTaskInf . current . anyCurrent ) { timer = now - currentTaskInf . current . date ; if ( currentTaskInf . current . totalSpended > 0 ) { timer += currentTaskInf . current . totalSpended ; } timer = millisToMinutesAndSeconds ( timer ) ; timer = timer . split ( ':' ) if ( parseInt ( timer [ 0 ] ) > 0 ) { if ( parseInt ( timer [ 0 ] ) < 10 ) { timer [ 0 ] = timer [ 0 ] . toString ( ) . substring ( 1 ) ; } $ ( '.js-currentTask-time-hour' ) . text ( timer [ 0 ] + ' Hour(s) and' ) ; } $ ( '.js-currentTask-time-min' ) . text ( timer [ 1 ] + ' minute(s)' ) ; $ ( '.js-currentTask-name' ) . text ( currentTaskInf . current . name ) ; $ ( '.js-has-working-task' ) . removeClass ( 'hidden' ) ; $ ( '.js-no-working-task' ) . addClass ( 'hidden' ) ; } else { $ ( '.js-has-working-task' ) . addClass ( 'hidden' ) ; $ ( '.js-no-working-task' ) . removeClass ( 'hidden' ) ; } for ( var i = 0 ; i < currentTaskInf . oldTasks . length ; i ++ ) { if ( ( ! ( currentTaskInf . current . anyCurrent && currentID == i ) ) && ! currentTaskInf . oldTasks [ i ] . removed ) { timer = millisToMinutesAndSeconds ( currentTaskInf . oldTasks [ i ] . totalSpended ) ; oldTaskHTML += '<div class="inactiveTask" data-id="' + currentTaskInf . oldTasks [ i ] . id + '"> <span class="inactiveTaskName">' ; oldTaskHTML += currentTaskInf . oldTasks [ i ] . name + ' - </span> <span class="inactiveTaskDate">' ; oldTaskHTML += timer + '</span> <span class="launchTask js-launchTask"> <img src="../assets/icons/launch.png" title="Start working on this task"> </span>' ; oldTaskHTML += '<span class="removeOldTask js-removeOldTask" data-id="' + currentTaskInf . oldTasks [ i ] . id + '">  <img src="../assets/icons/remove.png" title="Remove this task">  </span>' ; oldTaskHTML += '</div>' ; } } $ ( '.js-previousTasks' ) . append ( oldTaskHTML ) ; } }
list tasks when extension opened
 @function listTasks
 @memberof popupjs
list tasks when extension opened @function listTasks @memberof popupjs