"use strict"; function start_progress_bar(time_interval = 50, increment = 1.0) { var progress_box = null; var progress_box_container = null; var i = null; var progress_bar_background = null; if (progress_box_container_exists()) { progress_box_container = document.getElementById("progress_box_container"); } else { progress_box_container = make_progress_box_container(); document.body.appendChild(progress_box_container); } if (progress_box_exists()) { return; ////progress_box = document.getElementById("progress_box"); } else { progress_box = make_loading_progress_box(); progress_box_container.appendChild(progress_box); } do_progress(time_interval, increment); } function do_progress(timeout = 10, increment = 1.0) { var progress_bar_background = null; var i = null; //Add CSS animations for the progress bar as //its width changes. see file: 'progress_bar_2.js' ////most_customizable_config_elem_for_animation("progress_bar_image", "width", "0.33", "0.0"); set_progress_box_title("Progress"); progress_bar_background = document.getElementById("progress_bar_background"); for (i = 0; i < parseFloat(progress_bar_background.offsetWidth); i++) { setTimeout(function () { increment_progress_bar_width(increment); }, (timeout * (i + 1))); } } function increment_progress_bar_width(increment = 1.0) { var progress_bar_image = null; var percent = null; var progress_bar_background = null; var end_number = null; progress_bar_background = document.getElementById("progress_bar_background"); if (progress_bar_background !== null) { end_number = parseFloat(progress_bar_background.offsetWidth); } else { end_number = 150; } progress_bar_image = document.getElementById("progress_bar_image"); if (progress_bar_image !== null) { progress_bar_image.style.width = (parseFloat(progress_bar_image.style.width) + increment) + "px"; percent = (parseFloat(progress_bar_image.style.width) * 100) / parseFloat(end_number); set_progress_bar_percent(percent); set_progress_box_content(parseFloat(progress_bar_image.style.width), end_number); on_finish_progress_remove_progress_container(); } } function on_finish_progress_remove_progress_container() { var progress_bar_image = null; var progress_bar_background = null; var progress_box_container = null; progress_bar_image = document.getElementById("progress_bar_image"); if (progress_bar_image !== null) { progress_bar_background = document.getElementById("progress_bar_background"); if (progress_bar_background !== null) { if (parseFloat(progress_bar_image.offsetWidth) >= parseFloat(progress_bar_background.offsetWidth)) { progress_box_container = document.getElementById("progress_box_container"); if (progress_box_container !== null) { progress_box_container.parentNode.removeChild(progress_box_container); } } } } } function set_mouse_cursor_icon_to_progress() { window.document.body.style.cursor = "progress"; } function set_mouse_cursor_icon_to_default() { window.document.body.style.cursor = "default"; } function make_loading_progress_box() { var tbl = null; var tr1 = null; var tr2 = null; var tr3 = null; var td1 = null; var td2 = null; var td3 = null; var progress_box_container = null; var progress_bar_obj = null; var contents_div = null; var box_content = null; var progress_bar = null; var title_div = null; var footer_div = null; tbl = document.getElementById("progress_box"); if (tbl === null) { tbl = document.createElement("table"); tr1 = document.createElement("tr"); tr2 = document.createElement("tr"); tr3 = document.createElement("tr"); td1 = document.createElement("td"); td2 = document.createElement("td"); td3 = document.createElement("td"); tbl.setAttribute("id", "progress_box"); tbl.style.width = "29%"; tbl.style.height = "18%"; tbl.style.maxWidth = "360px"; tbl.style.maxHeight = "300px"; tbl.style.minWidth = "200px"; //80 + 16 + 20 + 4 + 8 //The minimum height total: 128px //80px: minimum pixel height of middle cell part of the table //16px: minimum pixel height of the bottom cell part of the table //20px: minimum pixel height of top cell part of the table //4px: combined pixel height of all horizontal borders in the table //8px: cell padding of 8 pixels for //combined vertical padding for the middle table cell/row. tbl.style.minHeight = "128px"; tbl.style.margin = "auto"; tbl.style.padding = "0"; tbl.style.border = "1px solid #555"; tbl.style.boxShadow = "7px 7px 12px rgba(51,51,51,0.2)"; tbl.setAttribute("cellpadding", "0"); tbl.setAttribute("cellspacing", "0"); tbl.setAttribute("border", "0"); tr1.style.width = "100%"; tr1.style.height = "20px"; tr1.style.padding = "4px"; tr1.style.backgroundColor = "rgb(153,153,153)"; tr1.style.borderBottom = "1px solid #777"; tr1.style.margin = "0"; td1.style.width = "100%"; td1.style.height = "20px"; td1.style.backgroundColor = "rgb(153,153,153)"; td1.style.borderBottom = "1px solid #777"; td1.style.padding = "4px"; td1.style.paddingBottom = "2px"; //bring the title text down a few pixels td1.style.paddingLeft = "32px"; td1.style.margin = "0"; tr2.style.width = "100%"; tr2.style.height = "80px"; tr2.style.maxWidth = "420px"; tr2.style.maxHeight = "200px"; tr2.style.minWidth = "160px"; tr2.style.minHeight = "32px"; tr2.style.backgroundColor = "rgb(208,208,208)"; tr2.style.borderBottom = "1px solid #777"; td2.style.verticalAlign = "bottom"; td2.style.width = "100%"; td2.style.height = "80px"; td2.style.maxWidth = "360px"; td2.style.maxHeight = "200px"; td2.style.minWidth = "160px"; td2.style.minHeight = "32px"; td2.style.backgroundColor = "rgb(208,208,208)"; td2.style.borderBottom = "1px solid #777"; td2.style.padding = "4px"; td2.style.paddingLeft = "32px"; td2.style.margin = "0"; td2.style.paddingBottom = "16px"; tr3.style.width = "100%"; tr3.style.height = "16px"; tr3.style.backgroundColor = "rgb(208,208,208)"; td3.style.width = "100%"; td3.style.height = "16px"; td3.style.backgroundColor = "rgb(220,220,220)"; td3.style.padding = "4px"; td3.style.paddingLeft = "32px"; td3.style.margin = "0"; box_content = make_progress_box_contents(); td2.appendChild(box_content); progress_bar = make_progress_bar(); td2.appendChild(progress_bar); title_div = make_progress_box_title(); td1.appendChild(title_div); footer_div = make_progress_box_footer(); td3.appendChild(footer_div); tbl.appendChild(tr1); tbl.appendChild(tr2); tbl.appendChild(tr3); tr1.appendChild(td1); tr2.appendChild(td2); tr3.appendChild(td3); tbl.style.zoom = "80%"; } else { tbl.style.zIndex = parseFloat(get_top_DOM_z_index()) + 100000; } return tbl; } function make_progress_bar() { var progress_bar_background = null; var progress_bar = null; var progress_bar_image = null; progress_bar = document.getElementById("progress_bar"); if (progress_bar === null) { //make the actual progress bar progress_bar = document.createElement("div"); progress_bar.setAttribute("id", "progress_bar"); progress_bar.style.position = "absolute"; progress_bar.style.height = "25px"; progress_bar.style.maxHeight = "25px"; progress_bar.style.minHeight = "25px"; //the progress bar itself is an image progress_bar_image = document.createElement("img"); progress_bar_image.setAttribute("id", "progress_bar_image"); progress_bar_image.setAttribute("src", "/chromosphere/images/ui/icons/progress_bar_1px.png"); progress_bar_image.style.position = "relative"; progress_bar_image.style.height = "25px"; progress_bar_image.style.maxHeight = "25px"; progress_bar_image.style.minHeight = "25px"; progress_bar_image.style.width = "1px"; //make the progress bar's background div progress_bar_background = document.createElement("div"); progress_bar_background.setAttribute("id", "progress_bar_background"); progress_bar_background.style.height = "25px"; progress_bar_background.style.maxHeight = "25px"; progress_bar_background.style.minHeight = "25px"; progress_bar_background.style.backgroundColor = "rgb(123,123,123)"; progress_bar_background.style.border = "1px solid rgb(90,90,90)"; progress_bar_background.style.marginRight = "29px"; progress_bar_background.style.position = "relative"; progress_bar_background.style.overflow = "hidden"; //append the progress_bar_image to the progress_bar object, and //append the progress_bar object to the progress_bar_background object. progress_bar_background.appendChild(progress_bar); progress_bar.appendChild(progress_bar_image); return progress_bar_background; } else { return document.getElementById("progress_bar_background"); } } function make_progress_box_title() { var title = null; title = document.createElement("div"); title.setAttribute("id", "progress_box_title"); title.style.color = "rgb(255,255,255)"; title.style.fontFamily = "Myriad, Myriad Pro, Microsoft Sans Serif"; title.style.fontSize = "12pt"; title.style.fontWeight = "700"; title.style.minHeight = "20px"; title.style.maxHeight = "20px"; title.style.height = "20px"; title.style.width = "100%"; title.style.verticalAlign = "top"; title.style.textAlign = "left"; title.style.letterSpacing = "1px"; title.style.textShadow = "2px 2px 3px rgba(0,0,0,0.4)"; title.style.whiteSpace = "nowrap"; title.style.paddingRight = "24px"; return title; } function make_progress_box_contents() { var contents = null; contents = document.createElement("div"); contents.setAttribute("id", "progress_box_contents"); contents.style.color = "rgb(51,51,51)"; contents.style.fontFamily = "Myriad, Myriad Pro, Microsoft Sans Serif"; contents.style.fontSize = "12pt"; contents.style.fontWeight = "500"; contents.style.minHeight = "37px"; contents.style.maxHeight = "37px"; contents.style.height = "37px"; contents.style.width = "100%"; contents.style.verticalAlign = "middle"; contents.style.textAlign = "left"; contents.style.margin = "0"; contents.style.letterSpacing = "1px"; contents.style.textShadow = "1px 1px 3px rgba(0,0,0,0.3)"; return contents; } function make_progress_box_footer() { var footer = null; footer = document.createElement("div"); footer.setAttribute("id", "progress_box_footer"); footer.style.color = "rgb(51,51,51)"; footer.style.fontFamily = "Myriad, Myriad Pro, Microsoft Sans Serif"; footer.style.fontSize = "10pt"; footer.style.fontWeight = "500"; footer.style.minHeight = "16px"; footer.style.maxHeight = "16px"; footer.style.height = "16px"; footer.style.width = "100%"; footer.style.verticalAlign = "middle"; footer.style.textAlign = "left"; footer.style.margin = "0"; footer.style.letterSpacing = "1px"; footer.style.textShadow = "1px 1px 2px rgba(0,0,0,0.2)"; return footer; } function set_progress_box_content(current_count, end_count) { var contents = null; contents = document.getElementById("progress_box_contents"); if (contents !== null) { contents.innerHTML = "