public/assets/js/custom_js/HaseImageWordTranslationTimer.js
/**
 * Function is for display count down on image work view.
 * @param integer translateId
 * @param integer reloadTimer
 */
Function is for display count down on image work view.
@param integer translateId
@param integer reloadTimer
Function is for display count down on image work view . @param integer translateId @param integer reloadTimer
function countDown(translateId, reloadTimer) {
    reloadTimer--;
    minRemain = Math.floor(reloadTimer / workTranslateTimer.WORK_TRANSLATE_TIMER);
    secsRemain = new String(reloadTimer - (minRemain * workTranslateTimer.WORK_TRANSLATE_TIMER));
    if (secsRemain.length < workTranslateTimer.INTEGER_TWO) {
        secsRemain = workTranslateTimer.SINGLE_SEPARATORS + secsRemain;
    }
    timerClock = +secsRemain;
    document.getElementById(translateId).innerHTML = timerClock;
    if (reloadTimer > workTranslateTimer.INTEGER_ZERO) {
        setTimeout(workTranslateTimer.COUNT_DOWN + translateId + workTranslateTimer.COMMA_SEPARATORS + reloadTimer + workTranslateTimer.BRACKECT_OVER, workTranslateTimer.COUNT_DOWN_VALUE);
    } else {
        document.getElementById(translateId).style.display = workTranslateTimer.COUNT_DOWN_NONE;
        jQuery.ajax({
            type: "GET",
            url: workTranslateTimer.IMAGE_STATUS_UPDATE,
            async: false,
            success: function (workTranslateData) {
                location.href = "hase_image_word_queue"
            }
        });
    }
    window.onbeforeunload = function (workTranslateElement) {
        jQuery.ajax({
            type: "GET",
            url: workTranslateTimer.IMAGE_STATUS_UPDATE,
            async: false,
            success: function (workTranslateData) {
                location.href = "hase_image_word_queue"
            }
        });
    }
}
function countDown ( translateId , reloadTimer ) { reloadTimer -- ; minRemain = Math . floor ( reloadTimer / workTranslateTimer . WORK_TRANSLATE_TIMER ) ; secsRemain = new String ( reloadTimer - ( minRemain * workTranslateTimer . WORK_TRANSLATE_TIMER ) ) ; if ( secsRemain . length < workTranslateTimer . INTEGER_TWO ) { secsRemain = workTranslateTimer . SINGLE_SEPARATORS + secsRemain ; } timerClock = + secsRemain ; document . getElementById ( translateId ) . innerHTML = timerClock ; if ( reloadTimer > workTranslateTimer . INTEGER_ZERO ) { setTimeout ( workTranslateTimer . COUNT_DOWN + translateId + workTranslateTimer . COMMA_SEPARATORS + reloadTimer + workTranslateTimer . BRACKECT_OVER , workTranslateTimer . COUNT_DOWN_VALUE ) ; } else { document . getElementById ( translateId ) . style . display = workTranslateTimer . COUNT_DOWN_NONE ; jQuery . ajax ( { type : "GET" , url : workTranslateTimer . IMAGE_STATUS_UPDATE , async : false , success : function ( workTranslateData ) { location . href = "hase_image_word_queue" } } ) ; } window . onbeforeunload = function ( workTranslateElement ) { jQuery . ajax ( { type : "GET" , url : workTranslateTimer . IMAGE_STATUS_UPDATE , async : false , success : function ( workTranslateData ) { location . href = "hase_image_word_queue" } } ) ; } }
Function is for display count down on image work view.
Function is for display count down on image work view .