"use strict"; //2024-03-21: //This function determines the Y offset of the page by measuring the //top and height parameters of the main menu bar which spans across //the top of the page, in addition to the tabbed window tabs container. function get_page_offset_Y() { var main_menu = null; var main_menu_top = null; var main_menu_height = null; var main_menu_offset_Y = null; var tabbed_windows_container = null; var tabbed_windows_container_top = null; var tabbed_windows_container_height = null; var tabbed_windows_container_offset_Y = null; var total_offset = null; //get the main menu bar spanning the top of the page //if it exists, and is visible main_menu = document.getElementById("div_wrapper_0"); if (main_menu !== null) { //if the main menu is displayed if (main_menu.style.display !== "none") { //get the main menu's top location, and its height main_menu_top = parseFloat(main_menu.scrollTop); main_menu_height = parseFloat(main_menu.offsetHeight); } else { //the main menu exists, but is not displayed. //set the Y offset to 0 main_menu_top = 0; main_menu_height = 0; } } else { //the main menu bar does not exist. //set the Y offset to 0 main_menu_top = 0; main_menu_height = 0; } //add the menu height, and top parameters to get its Y offset main_menu_offset_Y = main_menu_top + main_menu_height; //The tabbed window feature places a bar at the top of the page //that displays the tabs for each tabbed window. It is put in place //at the top of the page, but below the main menu bar. tabbed_windows_container = document.getElementById("tabbed_windows_container"); if (tabbed_windows_container !== null) { //if the tabbed window tabs container exists if (tabbed_windows_container.style.display !== "none") { //if the tabbed window tabs container is displayed, //get its top and height parameters. tabbed_windows_container_top = parseFloat(tabbed_windows_container.scrollTop); tabbed_windows_container_height = parseFloat(tabbed_windows_container.offsetHeight); } else { //if the tabbed window tabs container exists, but is not //displayed, then set the Y offset to 0 tabbed_windows_container_top = 0; tabbed_windows_container_height = 0; } } else { //if the tabbed window tabs container doesn't exist, //set its Y offset to 0. tabbed_windows_container_top = 0; tabbed_windows_container_height = 0; } //add the Y offset values to get the full Y offset tabbed_windows_container_offset_Y = tabbed_windows_container_top + tabbed_windows_container_height; total_offset = main_menu_offset_Y + tabbed_windows_container_offset_Y; //2024-04-13: //adding an additional Y offset for the 'stow minimized windows' feature. //see file: 'stow_minimized_windows.js' ////total_offset = total_offset + get_minimized_windows_offset_Y(); //2024-03-21: //the following function call to test this function //for the correct Y offset at the top of the page is located below. //The function is only called when the global test mode is set to true. //The function indicates the Y offset by placing a small blue square //at the Y offset position that has been determined. //See file 'test.js'. if (global_test_mode === true) { offset_Y_test_marker_image(total_offset); } return total_offset; } function get_top_menu_bar_offset_Y() { var main_menu = null; var main_menu_top = null; var main_menu_height = null; var main_menu_offset_Y = null; //get the main menu bar spanning the top of the page //if it exists, and is visible main_menu = document.getElementById("div_wrapper_0"); if (main_menu !== null) { //if the main menu is displayed if (main_menu.style.display !== "none") { //get the main menu's top location, and its height main_menu_top = parseFloat(main_menu.scrollTop); main_menu_height = parseFloat(main_menu.offsetHeight); } else { //the main menu exists, but is not displayed. //set the Y offset to 0 main_menu_top = 0; main_menu_height = 0; } } else { //the main menu bar does not exist. //set the Y offset to 0 main_menu_top = 0; main_menu_height = 0; } //add the menu height, and top parameters to get its Y offset main_menu_offset_Y = main_menu_top + main_menu_height; return main_menu_offset_Y; } function get_tabbed_window_bar_offset_Y() { var tabbed_windows_container_top = null; var tabbed_windows_container_height = null; var tabbed_windows_container = null; var tabbed_windows_container_offset_Y = null; //The tabbed window feature places a bar at the top of the page //that displays the tabs for each tabbed window. It is put in place //at the top of the page, but below the main menu bar. tabbed_windows_container = document.getElementById("tabbed_windows_container"); if (tabbed_windows_container !== null) { //if the tabbed window tabs container exists if (tabbed_windows_container.style.display !== "none") { //if the tabbed window tabs container is displayed, //get its top and height parameters. tabbed_windows_container_top = parseFloat(tabbed_windows_container.scrollTop); tabbed_windows_container_height = parseFloat(tabbed_windows_container.offsetHeight); } else { //if the tabbed window tabs container exists, but is not //displayed, then set the Y offset to 0 tabbed_windows_container_top = 0; tabbed_windows_container_height = 0; } } else { //if the tabbed window tabs container doesn't exist, //set its Y offset to 0. tabbed_windows_container_top = 0; tabbed_windows_container_height = 0; } //add the Y offset values to get the full Y offset tabbed_windows_container_offset_Y = tabbed_windows_container_top + tabbed_windows_container_height; return tabbed_windows_container_offset_Y; } function get_window_title(win_id) { var title_box = document.getElementById(win_id + "_title_box"); var title_text = null; if (title_box !== null) { title_text = title_box.innerText; return title_text; } return title_text; } function set_win_title(win_id, title) { var title_box = document.getElementById(win_id + "_title_box"); var title_text = title; if (title_box !== null) { title_box.innerText = title_text; return title_text; } return title_text; } function get_window_status(win_id) { var status_box = document.getElementById(win_id + "_window_status"); var status_text = null; if (status_box !== null) { status_text = status_box.innerText; return status_text; } return status_text; } //function set_window_status(win_id, status) { // var status_box = document.getElementById(win_id + "_window_status"); // var status_text = status; // if (status_box !== null) { // status_box.innerText; // return status_text; // } // return status_text; //} //function minimize_all_windows() { /* var window_array = []; var win = null; var i = null; var minimize_button = null; var icon_td = null; var is_loaded = null; var counter = null; window_array = actually_get_EVERY_window_please(); //document.getElementsByName("web_window"); //counter = 0; //window_array.forEach(function (item) { // global_minimize_windows_timer = setTimeout("minimize_single_window('" + item + "');", Math.floor(((counter + 1) * 500))); // counter++; //}); var w_id = null; var w = null; var i = null; var l = null l = window_array.length; for (i = 0; i < l; i++) { w_id = window_array[i]; w = document.getElementById(w_id); if (w !== null) { //global_minimize_windows_timer = setTimeout("minimize_single_window('" + w_id + "');", Math.floor(((i + 1) * 500))); } } //for (i = 0; i < window_array.length; i++) { // win = window_array[i]; //is_loaded = win.getAttribute("data-win-is_loaded"); //alert(is_loaded); //if (is_loaded === "true") { //global_minimize_windows_timer = setTimeout("minimize_single_window('" + win.id + "');", Math.floor(((i + 1) * 500))); //} //} //clearTimeout(global_minimize_delay_timer); //stop the timer ID from the delayed function call */ //} //function minimize_single_window(win_id) { /* var w = document.getElementById(win_id); //var w = null; //var win_id = null; //w = item; //win_id = item.id; //w.style.borderStyle = "solid"; //w.style.borderWidth = "1px"; //w.style.borderColor = "#00ff00"; minimize_window(win_id); clearTimeout(global_minimize_windows_timer); */ //} function get_base_path() { var host = null; var port = null; var protocol = null; var base_url = null; host = window.location.hostname; port = window.location.port; if (port !== "" && port !== null && port !== undefined) { port = ":" + port; } protocol = window.location.protocol + "//"; base_url = protocol + host + port; return base_url; } /* This some basic Javscritpt code used for "Promises" */ //var promise = new Promise(function (resolve, reject) { // // do thing, then… // if (/* everything worked */) { // resolve("See, it worked!"); // } // else { // reject(Error("It broke")); // } //}); //function HTML_to_node(html) { // var div = null; // var new_node = null; // div = document.createElement("div"); // div.innerHTML = html; // new_node = div.firstChild; // return new_node; //} async function get_field_value(table_name, field_name, record_id) { var data = null; var base_path = null; var file_path = null; var query_string = null; var url = null; //alert("test"); //base_path = get_base_path(); ////base_path = "https://chromosphere.com" file_path = "/chromosphere/scripts/js/ui/ss/DB/get_db_field_value/Default"; query_string = "tblname=" + table_name + "&fieldname=" + field_name + "&recordid=" + record_id; ////url = base_path + file_path + "?" + query_string; url = file_path + "?" + query_string; data = await getData3(url); return data; } function null_to_empty_string(v) { if (v === null) { v = ""; } return v; }