"use strict"; //2024-04-18: //this script is responsible for stowing minimized winodws out of sight, as //well as unstowing them to be viewed as a stack of minimized windows set to //the left part of the page. other scripts make use of this script, including //but not limited to files: "maximize_window.js", "minimize_window_16.js", //"window_state_controls.js", "cascade_window.js", "hide_show_stowed.js", //and "minimize_scroll_box_1.js". //2024-04-18: //start here to begin the 'stow minimized windows' feature. //calling this function will call the start function for this //feature. the start function gets a current, or creates a //non-existent stow minimized window box/button and adds //the event listeners needed to stow or display //minimized windows as needed. function init_stow_minimized_windows() { ////console.log("init_stow_minimized_windows() has been called from function: \n" + init_stow_minimized_windows.caller.toString()); start_stow_minimized_windows(); //2024-05-13: //this function will add a browser window event listener: //if there are no minimized windows present, then hide the stow inimized window box/button. //this sets the box/button's visibility to hidden after a short pause in time. //if there are no minimized windows present, it hides the box/button. //otherwise, it does nothing. For some reason, the stow minimized window box/button //displays visibly when an event calls a function to open a new window. This bug //doesn't seem to occur when calling the event to create a new window progrmatically. //see file: 'stow_minimized_windows.js' hide_stow_minimized_window_box_if_no_minimized_windows_exist_event_listener(); } //2024-04-18: //this function gets, or creates a new //stow minimized windows box / button. //after it gets, or creates the box/button, //it adds the appropriate event listeners //that will toggle the minimized windows //between visible and stacked, or hidden //and stowed. function start_stow_minimized_windows() { var stow_minimized_box = null; stow_minimized_box = get_stow_minimized_window_box(); if (stow_minimized_box !== null) { set_stow_transition_active_false(); set_stow_minimized_box_event_listeners(stow_minimized_box); } } //2024-04-18: //this function creates the box/button that you click //on to stow minimized windows out of sight, or //displays all minimized windows in a visible //stack formation. function get_stow_minimized_window_box() { var stow_minimized_box = null; var stow_minimized_box_id = null; var arrow_icon = null; var are_min_wins_stowed = null; var stowed_minimized_windows_objects_container = null; stow_minimized_box_id = "stow_minimized_windows_box"; stow_minimized_box = document.getElementById(stow_minimized_box_id); if (stow_minimized_box !== null) { arrow_icon = document.getElementById("stow_scroll_box_icon"); if (arrow_icon !== null) { are_min_wins_stowed = get_are_minimized_windows_stowed_attribute(); //the stow minimized windows box does exist, and minimized windows //are currently stowed. set the proper src for the arrow icon (down), //set the attribute indicating that the minimized windows are //stowed, and remove any html that may exist within the stow minimized //windows box/button leaving it blank. if (are_min_wins_stowed === true) { arrow_icon.setAttribute("src", "/chromosphere/images/ui/icons/down_icon.png"); set_minimized_windows_stowed_true(); ////remove_stow_minimized_windows_box_innerHTML(); } //the stow minimized windows box does exist, but no minimized windows //are currently stowed. set the proper src for the arrow icon (up), //set the attribute indicating that the minimized windows are not //stowed, and remove any html that may exist within the stow minimized //windows box/button leaving it blank. else if (are_min_wins_stowed === false) { arrow_icon.setAttribute("src", "/chromosphere/images/ui/icons/up_icon.png"); set_minimized_windows_stowed_false(); ////remove_stow_minimized_windows_box_innerHTML(); } //in the case that the stow minimized windows box/button //exists, but does not have an attribute value //(no idea why that would be) then it sets the attribute value //to a default value of false, changes the stow icon to a //blank image, and removes any text that may be present within the //box/button. else { arrow_icon.setAttribute("src", "/chromosphere/images/blank.gif"); set_minimized_windows_stowed_false(); ////remove_stow_minimized_windows_box_innerHTML(); } } return stow_minimized_box; } //if the stow minimized windows box/button does not exist, then create it. //once created, append it to the document's body element. else { stow_minimized_box = document.createElement("div"); stow_minimized_box = stow_minimized_box_add_children(stow_minimized_box); stow_minimized_box.setAttribute("id", "stow_minimized_windows_box"); stow_minimized_box.style.backgroundColor = "rgba(124,124,124,1.0)"; stow_minimized_box.style.border = "0.5px solid rgba(102,102,102,1.0)"; stow_minimized_box.style.position = "fixed"; stow_minimized_box.style.height = "30px"; stow_minimized_box.style.width = "306px"; stow_minimized_box.style.left = "0"; stow_minimized_box.style.borderBottomRightRadius = "4px"; stow_minimized_box.style.userSelect = "none"; stow_minimized_box.overflowX = "hidden"; //for testing purposes, set the opacity of the box to semi-transparant if (global_test_mode === true) { stow_minimized_box.style.backgroundColor = "rgba(255,255,255,0.75)"; stow_minimized_box.style.opacity = 0.75; } //position the top (Y) offset position for the minimize window below the main menu bar at the top of the page. //see file: 'common_functions.js'. For the 'get_tabbed_window_bar_offset_Y()' function, see file: 'stow_minimized_windows.js' stow_minimized_box.style.top = (get_page_offset_Y() - get_tabbed_window_bar_offset_Y()) + "px"; //append the stow minimized window box/button to its container object. //if the container does not exist and cannot be created, then append it to the body element. stowed_minimized_windows_objects_container = get_stowed_minimized_windows_objects_container(); if (stowed_minimized_windows_objects_container !== null) { stowed_minimized_windows_objects_container.appendChild(stow_minimized_box); } else { document.body.appendChild(stow_minimized_box); } //sets an attribute in the stow minimized windows box/button //indicating that by default, the box/button is expand, not retracted. set_stow_minimized_windows_box_expanded_true(); //add CSS default animation properties to the //stow minimized windows box/button. when the box retracts, //and extends to its normal width, cause it to animate. set_animations_default(stow_minimized_box.id); //set the html attribute indicating that the minimized windows are stowed to false set_minimized_windows_stowed_false(); //this function removes the text from inside the hide minimized windows box //leaving it blank. remove_stow_minimized_windows_box_innerHTML(); //the 'stow minimized windows' box/button is created on a mouseover event for //minimizing windows. By default, set its display to hidden. It will appear //once the minimize window icon is pressed on either a //cascaded, or maximized window. To see the 'mouseover' event for //this icon in the file: 'window_state_controls.js' hide_stow_minimized_window_box(); //when the first window (after page load) is minimized, it does not //initialize this 'stow minimized windows' feature. //Adding a 'mouseover/enter/down/move' event handler to the 'stow minimized windows' box/button //will ensure that the feature functions for a single minimized window //that is minimized first, and then stowed before minimizing an additional window. onmouse_event_init_stow_minimized_windows_box(); //2024-04-18: //creating a feature that hides any stowed minimized windows. //see file: 'hide_show_stowed.js' place_tucked_stowed_minimized_windows_icon(); //2024-04-21: //show the tuck stowed minimized windows arrow icon. hide_tuck_stowed_minimized_window_icon(); //set the initial value that determines if a stow minimized windows //transition is active to false. if it is true, then the stow transition //function will exit. if this value is not first set to false, then the //stow transition function could exit before performing any actions. set_stow_transition_active_false(); //2024-04-23: //this function hides the small icon that retracts the stowed minimized windows //and the box/button that stows minimized windows. //see file: 'hide_show_stowed.js' hide_tuck_stowed_minimized_window_icon(); return stow_minimized_box; } } //2024-04-18: //this function hides the stow minimized windows' box/button function hide_stow_minimized_window_box() { var stow_minimized_box = null; var stow_minimized_box_id = null; stow_minimized_box_id = "stow_minimized_windows_box"; stow_minimized_box = document.getElementById(stow_minimized_box_id); if (stow_minimized_box !== null) { stow_minimized_box.style.display = "none"; } } //2024-04-18: //this function displays the stow minimized windows' box/button function show_stow_minimized_window_box() { var stow_minimized_box = null; var stow_minimized_box_id = null; stow_minimized_box_id = "stow_minimized_windows_box"; stow_minimized_box = document.getElementById(stow_minimized_box_id); if (stow_minimized_box !== null) { stow_minimized_box.style.display = "block"; } } //2024-04-13: //when minimizing a window, it automatically docks itself to the left of //the browser window. It's vertical (Y) position is offset by the //main menu bar spanning the top of the screen, in addition to the box/button //that stows minimized windows. this function gets the //offset for the minimized windows stack. function get_minimized_windows_offset_Y() { var stow_minimized_box = null; var stow_minimized_box_id = null; var stow_minimized_box_scrollTop = null; var stow_minimized_box_offsetHeight = null; var minimized_windows_offset_Y = null; minimized_windows_offset_Y = 0; stow_minimized_box_id = "stow_minimized_windows_box"; stow_minimized_box = document.getElementById(stow_minimized_box_id); if (stow_minimized_box !== null) { stow_minimized_box_scrollTop = parseFloat(stow_minimized_box.scrollTop); stow_minimized_box_offsetHeight = parseFloat(stow_minimized_box.offsetHeight); if (typeof stow_minimized_box_scrollTop === "number") { if (typeof stow_minimized_box_offsetHeight === "number") { minimized_windows_offset_Y = parseFloat(stow_minimized_box_scrollTop + stow_minimized_box_offsetHeight); } } } return minimized_windows_offset_Y; } //2024-04-18: //this function adds event listeners to the stow minimized windows box/button. //if the box/button exists, then set a mousedown event listener where the //display of minimized windows toggles between stowed and hidden, or //displayed in a stack on the left of the screen. the setTimeout and its //global id variable are needed to cancel out any stow/display action //that is currently in process. without the setTimeout and its global id, //the page may freeze. function set_stow_minimized_box_event_listeners(stow_minimized_box) { var stow_transition_time = null; if (stow_minimized_box !== null) { stow_minimized_box.addEventListener("mousedown", function (event) { //if there are current stocwing/tucking actions occuring, //then exit the function. if (get_tuck_transition_active_attribute() === true) { return; } //this gets the delay and duration of the 'stow minimized box' CSS animation time in milliseconds. //see file: 'animations.js' stow_transition_time = Math.abs(get_element_animation_duration(stow_minimized_box) * 1000); if (typeof stow_transition_time === "number") { //the value is numeric. continue. } else { //if the stow transition time delay is not numeric, then //set it to a default of 307 millisecond. currently, this //is what the CSS animation duration time is set to on //the stow minimized windows box/button stow_transition_time = 307; } if (get_are_minimized_windows_stowed_attribute() === false) { //set the attribute that //indicates that the transition of //stowing/unstowing to true set_stow_transition_active_true(); //console.log("the attribute indicating that the stow/unstow process is in action is set to true"); if (global_stow_minimized_windows_timer_ID === null) { global_stow_minimized_windows_timer_ID = setTimeout(function () { stow_minimized_windows(); set_minimized_windows_stowed_true(); toggle_up_down_arrow_icon(); set_innerHTML_stow_minimized_windows_box(); //2024-04-21: //show the tuck stowed minimized windows arrow icon. //see file: hide_show_stowed.js' show_tuck_stowed_minimized_window_icon(); //hide the scroll box. //see file: 'minimize_window_scroll_box_1.js' hide_scroll_box(); clearTimeout(global_stow_minimized_windows_timer_ID); global_stow_minimized_windows_timer_ID = null; set_stow_transition_active_false(); }, stow_transition_time); } } else { //set the attribute that //indicates that the transition of //stowing/unstowing to true set_stow_transition_active_true(); //console.log("the attribute indicating that the stow/unstow process is in action is set to true"); if (global_stow_minimized_windows_timer_ID === null) { global_stow_minimized_windows_timer_ID = setTimeout(function () { unstow_minimized_windows(); set_minimized_windows_stowed_false(); toggle_up_down_arrow_icon(); set_innerHTML_stow_minimized_windows_box(); //2024-04-21: //show the tuck stowed minimized windows arrow icon. //see file: hide_show_stowed.js' hide_tuck_stowed_minimized_window_icon(); //show the scroll box. //see file: 'minimize_window_scroll_box_1.js' show_scroll_box(); clearTimeout(global_stow_minimized_windows_timer_ID); global_stow_minimized_windows_timer_ID = null; set_stow_transition_active_false(); }, stow_transition_time); } } event.preventDefault(); //NOTE: be sure not to Stop Immediate Propagation on this event, //or else it won't work. //hide all visible submenus of the main menu that may be showing. //see file: 'view_menu_default_page.js' all_stack_menus_allow_hide(); hide_all_stack_menus(); }); //when the mouse button is released from the down position, it causes //this event listener to be called. in order to prevent freezing up the //page during an action where minimized windows are being displayed, //or stowed, it is set to do nothing at all. stow_minimized_box.addEventListener("mouseup", function (event) { event.preventDefault(); event.stopPropagation(); return; }, false); //in order to prevent freezing up the page during an action where //minimized windows are being displayed, or stowed, this event //listener is set to do nothing at all. stow_minimized_box.addEventListener("click", function (event) { event.preventDefault(); event.stopPropagation(); return; }, false); //in order to prevent freezing up the page during an action where //minimized windows are being displayed, or stowed, this event //listener is set to do nothing at all. stow_minimized_box.addEventListener("dblclick", function (event) { event.preventDefault(); event.stopPropagation(); return; }, false); //in order to prevent freezing up the page during an action where //minimized windows are being displayed, or stowed, this event //listener is set to do nothing at all. in the case where the website's //global test mode is set to false/off, the right-click event //listener does nothing. if test mode is true/on then the context menu will //be displayed upon a right mouse button click. stow_minimized_box.addEventListener("contextmenu", function (event) { ////alert("right click"); /* if (global_test_mode !== true) { event.preventDefault(); event.stopPropagation(); } */ return; }, false); //in order to prevent freezing up the page during an action where //minimized windows are being displayed, or stowed, this event //listener is set to do nothing at all, with the exception of inserting //html/text content into the stow minimized window box / button. stow_minimized_box.addEventListener("mouseover", function (event) { set_innerHTML_stow_minimized_windows_box(); event.preventDefault(); event.stopPropagation(); return; }, false); //in order to prevent freezing up the page during an action where //minimized windows are being displayed, or stowed, this event //listener is set to do nothing at all, with the exception of removing //any html/text present within the stow minimized window box/button. stow_minimized_box.addEventListener("mouseout", function (event) { remove_stow_minimized_windows_box_innerHTML(); event.preventDefault(); event.stopPropagation(); return; }, false); } } //2024-04-18: //this function is responsible for iterating through all minimized //windows and stowing them out of view underneath the stow minimized //window box/button. this function does not set the //"data-minimized_windows_stowed" attribute inside the box/button. //see the function: "set_stowed_minimized_windows_attribute_true();" //that sets the attribute. function stow_minimized_windows() { var minimized_windows = null; var min_win_count = null; var i = null; var min_win = null; var min_win_top = null; minimized_windows = get_all_minimized_windows(); if (minimized_windows !== null) { min_win_count = minimized_windows.length; if (typeof min_win_count === "number" && min_win_count > 0) { for (i = 0; i < min_win_count; i++) { min_win = document.getElementById(minimized_windows[i]); if (min_win !== null) { min_win_top = parseFloat((get_page_offset_Y() - get_tabbed_window_bar_offset_Y())); if (typeof min_win_top === "number") { if (parseFloat(min_win.style.left) <= 300) { min_win.style.top = min_win_top + "px"; min_win.style.left = "0"; min_win.setAttribute("data-minimized_and_stowed", "true"); } } } } } } } //2024-04-18: //this function is responsible for iterating through all minimized //windows and stacking them together on the left side of the page. //this will make the minimized windows visible to the user. //this function does not set the "data-minimized_windows_stowed" //attribute inside the box / button. //see the function: "set_stowed_minimized_windows_attribute_false();" //that sets the attribute. function unstow_minimized_windows() { var minimized_windows = null; var min_win_count = null; var i = null; var min_win = null; minimized_windows = get_all_minimized_windows(); if (minimized_windows !== null) { min_win_count = minimized_windows.length; if (typeof min_win_count === "number" && min_win_count > 0) { for (i = 0; i < min_win_count; i++) { min_win = document.getElementById(minimized_windows[i]); if (min_win !== null) { if (parseFloat(min_win.style.top) <= (get_page_offset_Y() - get_tabbed_window_bar_offset_Y())) { if (parseFloat(min_win.style.left) <= 300) { minimize_window_main(min_win); min_win.setAttribute("data-minimized_and_stowed", "false"); } } } } } } } //2024-04-18: //a function to set the stowed minimized windows box/button //"data-minimized_windows_stowed" attribute to "true". this function is called //when the minimized windows are stowed. function set_stowed_minimized_windows_attribute_true() { var container = null; container = get_stowed_minimized_windows_objects_container(); if (container !== null) { container.setAttribute("data-minimized_windows_stowed", "true"); //console.log("the html attribute indicating that the windows are stowed has been set to true."); } } //2024-04-18: //a function to set the stowed minimized windows box/button //"data-minimized_windows_stowed" attribute to "false". this function is called //when the minimized windows are unstowed, and visible to the user //as a stack of minimized windows on the left of the page. function set_stowed_minimized_windows_attribute_false() { var container = null; container = get_stowed_minimized_windows_objects_container(); if (container !== null) { container.setAttribute("data-minimized_windows_stowed", "false"); //console.log("the html attribute indicating that the windows are not stowed has been set to false."); } } //2024-04-18: //Upon minimizing a single window for the first time, we need to //initialize this 'stow minimized windows' feature. This is because //the first minimized window that is minimized does not initialize //the feature. Hence, adding an inline mouseenter event handler //attribute to the 'stow minimized windows' box/button will ensure //that the feature is set up to function when the first window is //minimized beforehand. function onmouse_event_init_stow_minimized_windows_box() { var stow_minimized_box = null; var event_handler_function = null; var event_attr = null; event_attr = "onmousemove"; stow_minimized_box = get_stow_minimized_window_box(); if (stow_minimized_box !== null) { if (stow_minimized_box.hasAttribute(event_attr) !== true) { stow_minimized_box.setAttribute(event_attr, "init_stow_minimized_windows();"); //console.log("onmousemove over stowed minimized windows box. html attribute has been added"); //console.log("inline HTML attribute is set. function to initialize and start feature has been called: 'init_stow_minimized_windows()'"); } else { event_handler_function = stow_minimized_box.getAttribute(event_attr).toString(); if (event_handler_function !== null && typeof event_handler_function === "string" && event_handler_function.length > 0) { if (event_handler_function.indexOf("init_stow_minimized_windows();") < 0) { stow_minimized_box.setAttribute(event_attr, "init_stow_minimized_windows();" + stow_minimized_box.getAttribute(event_attr).toString()); //console.log("onmousemove inline attribute has been set over stow minimized windows box/button"); } } } } } //2024-04-18: //this function gets the 'stow minimized windows' button/box and //adds the text and icon which will allow for the minimized //windows to be stowed. it also adds the necessary event //listeners to the elements which allow for the minimized windows //to be stowed, or display as stacked. function stow_minimized_box_add_children(stow_minimized_box) { var are_min_wins_stowed = null; var stow_scroll_box_icon = null; var tbl = null; var tr_0000 = null; var td_0000 = null; var td_0001 = null; if (stow_minimized_box !== null) { stow_minimized_box.innerHTML = ""; tbl = document.createElement("table"); tr_0000 = document.createElement("tr"); td_0000 = document.createElement("td"); td_0001 = document.createElement("td"); //if the website is running in test mode, //then display the table's border. otherwise, //make it hidden. See file: 'testing.js' if (global_test_mode === true) { tbl.setAttribute("border", "1"); } else { tbl.setAttribute("border", "0"); } tbl.setAttribute("id", "stow_minimized_windows_box_table"); tbl.setAttribute("cellpadding", "0"); tbl.setAttribute("cellspacing", "0"); tbl.style.width = "inherit"; tbl.style.padding = "4px"; tbl.style.paddingRight = "3px"; tbl.style.paddingTop = "0"; tbl.style.paddingBottom = "0"; tbl.style.paddingLeft = "0"; if (global_test_mode === true) { tbl.style.border = "1px solid rgba(255,255,255,0.75)"; } tbl.style.borderBottomRightRadius = "4px"; tbl.style.backgroundColor = "rgba(127,127,127, 1.0)"; tbl.style.userSelect = "none"; td_0000.setAttribute("id", "stow_minimized_windows_box_text"); td_0000.style.fontFamily = "Microsoft Sans Serif, Arial, Helvetica"; td_0000.style.fontSize = "11pt"; td_0000.style.color = "rgba(255,255,255,1.0)"; td_0000.style.textAlign = "right"; td_0000.style.verticalAlign = "middle"; td_0000.style.paddingRight = "7px"; td_0000.style.borderCollapse = "collapse"; td_0000.style.overflow = "hidden"; td_0000.innerHTML = " "; td_0000.style.textShadow = global_window_status_text_shadow; td_0000.style.whiteSpace = "nowrap"; td_0000.style.userSelect = "none"; if (global_test_mode === true) { //// td_0000.style.backgroundColor = "rgba(255,0,0,0.75)"; } //when the mouse hovers over the table cell containing the " ", //or other html markup, this html will be displayed inside the table //cell. td_0000.addEventListener("mouseover", function () { ////td_0000.innerHTML = set_innerHTML_stow_minimized_windows_box(); td_0001.style.backgroundColor = "rgba(0,0,255,1.0)"; }); //when the mouse cursor exits the bounds of the stow minimized windows box/button, //replace the cell's inner html content to a " " character, thus leaving //it to appear blank. td_0000.addEventListener("mouseout", function () { ////td_0000.innerHTML = " "; td_0001.style.background = "none"; }); //when clicking the mouse button down while hovering over the //table cell to the left of the icon, set the icon's table cell //background color to white. td_0000.addEventListener("mousedown", function () { td_0001.style.backgroundColor = "rgba(255,255,255,1.0)"; }); //when releasing a down mouse button up while the mouse cursor //is hovering over the table cell to the left of the icon's table cell, //set the background of the icon's table cell to blue. td_0000.addEventListener("mouseup", function () { td_0001.style.backgroundColor = "rgba(0,0,255,1.0)"; }); //when the mouse cursor is moved over the table cell containing the //up/down arrow icon, set its background color and insert the //appropriate inner html into the left table cell. td_0001.addEventListener("mouseover", function () { td_0001.style.backgroundColor = "rgba(0,0,255,1.0)"; ////td_0000.innerHTML = set_innerHTML_stow_minimized_windows_box(); }); //when the mouse cursor moves outside the bounds of the table cell containing //the html and arrow icon, remove the background color, and set its corresponding //table cell contents to " ", thus making it appear blank. td_0001.addEventListener("mouseout", function () { td_0001.style.background = "none"; ////td_0000.innerHTML = " "; }); //when the table cell containing the stow/display arrow icon is //clicked down upon by the mouse, set its background to white, and place //the appropriate inner html into the adjacent table cell. td_0001.addEventListener("mousedown", function () { td_0001.style.backgroundColor = "rgba(255,255,255,1.0)"; ////td_0000.innerHTML = set_innerHTML_stow_minimized_windows_box(); }); //when the table cell containing the stow/display arrow icon has //been clicked down upon and released, set its background to blue, and place //the appropriate inner html into the adjacent table cell. td_0001.addEventListener("mouseup", function () { td_0001.style.backgroundColor = "rgba(0,0,255,1.0)"; ////td_0000.innerHTML = set_innerHTML_stow_minimized_windows_box(); }); //set the proper width and height for the table's //row, and both table cells. tr_0000.style.width = "100%"; ////tr_0000.style.maxHeight = "19px"; td_0000.style.height = "28px"; td_0001.style.height = "28px"; td_0000.style.width = "auto"; td_0001.style.width = "19px"; td_0000.style.paddingLeft = "3px"; td_0000.style.paddingRight = "9px"; td_0000.style.paddingBottom = "0"; //adjust the padding inside the icon's table cell //for aesthetic purposes. td_0001.style.paddingLeft = "3px"; td_0001.style.paddingRight = "3px"; td_0001.style.paddingBottom = "0"; td_0001.style.userSelect = "none"; //create the icon image element. give it an id. stow_scroll_box_icon = document.createElement("img"); stow_scroll_box_icon.setAttribute("id", "stow_scroll_box_icon"); stow_scroll_box_icon.style.userSelect = "none"; //when the mouse button is clicked down while over the stow/display //icon (up or down arrow), then toggle the src of the icon image to //show an up arrow, or down arrow depending on if the minimized windows //are stowed or displayed. set the html contents of the left table cell //to the appropriate content. //(i.e. "hide minimized windows", or "show minimized windows") stow_scroll_box_icon.addEventListener("mousedown", function () { are_min_wins_stowed = get_are_minimized_windows_stowed_attribute(); if (are_min_wins_stowed === true) { stow_scroll_box_icon.setAttribute("src", "/chromosphere/images/ui/icons/up_icon.png"); td_0000.innerHTML = set_innerHTML_stow_minimized_windows_box(); } else { stow_scroll_box_icon.setAttribute("src", "/chromosphere/images/ui/icons/down_icon.png"); td_0000.innerHTML = set_innerHTML_stow_minimized_windows_box(); } }); //set the height and width of the icon image to fit inside the table cell. stow_scroll_box_icon.style.height = "19px"; stow_scroll_box_icon.style.width = "19px" //by default, when the elements are added to the stow minimized window box/button //make the icon display an "up" arrow. stow_scroll_box_icon.setAttribute("src", "/chromosphere/images/ui/icons/up_icon.png"); //initialize the helper captions feature. see file: 'helper_captions.js' stow_minimized_box = set_stow_minimized_windows_box_helper_captions(stow_minimized_box); //append all the child objects to the //stow minimized windows box / button stow_minimized_box.appendChild(tbl); tbl.appendChild(tr_0000); tr_0000.appendChild(td_0000); tr_0000.appendChild(td_0001); td_0001.appendChild(stow_scroll_box_icon); //console.log("inner HTML (table, stow icon image) has been inserted into the stow minimized windows box/button."); } return stow_minimized_box; } //2024-04-18: //this function sets the helper caption that displays when the mouse cursor //hovers over the stow minimized window box/button function set_stow_minimized_windows_box_helper_captions(elem) { if (elem !== null) { elem.setAttribute("data-title", "Show/Hide Minimized Windows"); elem.setAttribute("data-desc", "click to display, or hide all minimized windows"); elem.addEventListener("mousemove", function (event) { move_caption_box(this, event); //function is located in the file helper_captions_[X].js }); elem.addEventListener("mousedown", function () { var box = document.getElementById("helper_caption_box"); if (box !== null) { box.style.opacity = 0.0; box.style.display = "none"; box.parentNode.removeChild(box); } }); elem.addEventListener("mouseout", function () { var box = document.getElementById("helper_caption_box"); if (box !== null) { box.style.opacity = 0.0; box.style.display = "none"; box.parentNode.removeChild(box); } }); } return elem; } //2024-04-18: //if the arrow icon is pointed upwards, replace the icon image with //the down arrow. if the icon displays an upwards arrow, replace the //image with the down arrow icon image. function toggle_up_down_arrow_icon() { var arrow_icon = null; var are_min_wins_stowed = null; arrow_icon = document.getElementById("stow_scroll_box_icon"); if (arrow_icon !== null) { are_min_wins_stowed = get_are_minimized_windows_stowed_attribute(); if (are_min_wins_stowed === true) { arrow_icon.setAttribute("src", "/chromosphere/images/ui/icons/down_icon.png"); //console.log("the stow minimized windows icon is now pointed down"); } else { arrow_icon.setAttribute("src", "/chromosphere/images/ui/icons/up_icon.png"); //console.log("the stow minimized windows icon is now pointed up"); } } } //2024-04-18: //place contents into the left table cell within the stow minimized windows box/button. //depending on whether the minimized windows are displayed as a stack, or hidden as stowed, //the html text will read as "show minimized windows", or "hide minimized windows". by default, //the html text is set to a space character leaving the content blank. function set_innerHTML_stow_minimized_windows_box() { var are_min_wins_stowed = null; var show_or_hide = null; var td_0000 = null; show_or_hide = " "; td_0000 = document.getElementById("stow_minimized_windows_box_text"); if (td_0000 !== null) { are_min_wins_stowed = get_are_minimized_windows_stowed_attribute(); if (are_min_wins_stowed === true) { show_or_hide = "show "; } else if (are_min_wins_stowed === false) { show_or_hide = "hide "; } else { show_or_hide = " "; } show_or_hide = show_or_hide + "minimized windows"; td_0000.innerHTML = show_or_hide; } else { show_or_hide = show_or_hide + "minimized windows"; } return show_or_hide; } //2024-04-18: //this removes any inner html inside the table cell that is present //within the table cell which is adjacent to the icon arrow's table cell. //(table cell to the left of the icon arrow image) function remove_stow_minimized_windows_box_innerHTML() { var td_0000 = null; td_0000 = document.getElementById("stow_minimized_windows_box_text"); if (td_0000 !== null) { td_0000.innerHTML = " "; } } //2024-04-18: //when a window is minimized, or cascaded, any stowed minimized windows //automatically display as a stack on the left of the page. when this happens, //we need to configure the stow minimized windows box/button to reflect //the change. because the minimized windows are displayed in a stack, //the stow minimized windows box/button must be set in accordance with //the new configuration of minimized windows. since the minimized windows //are now displayed as a stack, they are not stowed. hence, the "down" //arrow icon image needs to replaced with the "up" arrow icon. the html //attribute which designates whether the minimized windows are displayed, //or stowed needs to set to false, and any html inside the table cell adjacent //to the icon arrow (to the left) is rendered blank w/ a " " character. //the minimized windows are already unstowed, but call the function to unstow //the minimized windows for redundancy purposes; just to make sure. function reset_stow_minimized_window_box() { var stow_minimized_box = null; var stow_minimized_box_id = null; var arrow_icon = null; stow_minimized_box_id = "stow_minimized_windows_box"; stow_minimized_box = document.getElementById(stow_minimized_box_id); if (stow_minimized_box !== null) { arrow_icon = document.getElementById("stow_scroll_box_icon"); if (arrow_icon !== null) { unstow_minimized_windows(); set_minimized_windows_stowed_false(); remove_stow_minimized_windows_box_innerHTML(); arrow_icon.setAttribute("src", "/chromosphere/images/ui/icons/up_icon.png"); ////console.log("the stow minimized windows box/button has been reset to the unstowed configuration."); } } } //this function will stow windows by calling a function, instead of a mousedown //event. see the function above that sets the event listeners to the stow minimized box: //'set_stow_minimized_box_event_listeners(stow_minimized_box)'. the code in this function //is almost the exact same as the code in the mousedown event handler. function toggle_stow_unstow_minimized_windows_by_function() { var stow_minimized_box = null; var animation_time = null; stow_minimized_box = get_stow_minimized_window_box(); animation_time = 50; if (stow_minimized_box !== null) { if (get_are_minimized_windows_stowed_attribute() === false) { set_stow_transition_active_true(); if (global_stow_minimized_windows_function_timer_ID === null) { global_stow_minimized_windows_function_timer_ID = setTimeout(function () { stow_minimized_windows(); set_minimized_windows_stowed_true(); toggle_up_down_arrow_icon(); set_innerHTML_stow_minimized_windows_box(); show_tuck_stowed_minimized_window_icon(); //hide the scrollbox if it is visible. even if its opacity //is set to 0, the vartical scroll bar of the scroll box //stays visible. see file: 'minimize_window_scroll_box_1.js' hide_scroll_box(); ////console.log("the minimized windows are now STOWED by a function, not an event"); clearTimeout(global_stow_minimized_windows_function_timer_ID); global_stow_minimized_windows_function_timer_ID = null; set_stow_transition_active_false(); }, animation_time); } } else { set_stow_transition_active_true(); if (global_stow_minimized_windows_function_timer_ID === null) { global_stow_minimized_windows_function_timer_ID = setTimeout(function () { unstow_minimized_windows(); set_minimized_windows_stowed_false(); toggle_up_down_arrow_icon(); set_innerHTML_stow_minimized_windows_box(); hide_tuck_stowed_minimized_window_icon(); //show the scroll box. //see file: 'minimize_window_scroll_box_1.js' show_scroll_box(); ////console.log("the minimized windows are now UNSTOWED by a function, not an event"); clearTimeout(global_stow_minimized_windows_function_timer_ID); global_stow_minimized_windows_function_timer_ID = null; set_stow_transition_active_false(); }, animation_time); } //hide all visible submenus of the main menu that may be showing. //see file: 'view_menu_default_page.js' all_stack_menus_allow_hide(); hide_all_stack_menus(); } } } //this function creates a div element that is attached to the DOM as //a child object of the body element. the container serves as a place //in the DOM where all stow minimized window objects are placed. function create_stowed_minimized_windows_objects_container() { var container = null; container = document.getElementById("stowed_minimized_windows_objects_container"); if (container !== null) { } else { container = document.createElement("div"); container.setAttribute("id", "stowed_minimized_windows_objects_container"); document.body.appendChild(container); //console.log("the stowed minimized windows object container has been created and appended to the DOM") } return container } //this function gets the div container that contains objects //associated with the stow minimized windows feature. if the //container does not exist, it is created. function get_stowed_minimized_windows_objects_container() { var container = null; container = document.getElementById("stowed_minimized_windows_objects_container"); if (container !== null) { //continue } else { container = create_stowed_minimized_windows_objects_container(); } return container } //this function sets an HTML attribute in the stow minimized //windows DOM container that determines whether the minimized //windows are stowed away, and not displayed as a stack. function set_minimized_windows_stowed_true() { var container = null; container = get_stowed_minimized_windows_objects_container(); if (container !== null) { container.setAttribute("data-minimized_windows_stowed", "true"); //console.log("the html attribute indicating that the minimized windows have been stowed is now set to true"); } } //this function sets an HTML attribute in the stow minimized //windows DOM container that determines whether the minimized //windows displayed as a stack, and not as stowed away. function set_minimized_windows_stowed_false() { var container = null; container = get_stowed_minimized_windows_objects_container(); if (container !== null) { container.setAttribute("data-minimized_windows_stowed", "false"); //console.log("the html attribute indicating that the minimized windows have been stowed is now set to false"); } } //this function gets the value of the HTML attribute in the //container element that determines whether the minimized //windows are in a stowed configuration, or not. function get_are_minimized_windows_stowed_attribute() { var container = null; var are_minimized_windows_stowed = null; container = get_stowed_minimized_windows_objects_container(); if (container !== null) { are_minimized_windows_stowed = container.getAttribute("data-minimized_windows_stowed"); if (are_minimized_windows_stowed === "true" || are_minimized_windows_stowed === true) { are_minimized_windows_stowed = true; } else if (are_minimized_windows_stowed === "false" || are_minimized_windows_stowed === false) { are_minimized_windows_stowed = false; } } //console.log("the html attribute determining if the minimized windows are stowed, or not, has been retrieve with the value of: " + are_minimized_windows_stowed); return are_minimized_windows_stowed; } //when the 'stow minimized windows' action is in progress, //an HTML attribute inside the 'stow minimized window' DOM //objects container is set to "true". when the action has //completed, the attribute is set to "false". this prevents //other actions from being performed //(i.e. 'tuck stowed minimized windows') at the same time. //otherwise, one action can conflict and interrupt another //action that is in progress. function set_stow_transition_active_true() { var container = null; container = get_stowed_minimized_windows_objects_container(); if (container !== null) { container.setAttribute("data-stow_transition_active", "true"); //console.log("the html attribute indicating that the minimized windows ACTIONS are in progress is set to TRUE"); } } //when the 'stow minimized windows' action is not in progress, //an HTML attribute inside the 'stow minimized window' DOM //objects container is set to "false". when the action is in //progress, the attribute is set to "true". this prevents //other actions from being performed //(i.e. 'tuck stowed minimized windows') at the same time. //otherwise, one action can conflict and interrupt another //action that is in progress. function set_stow_transition_active_false() { var container = null; container = get_stowed_minimized_windows_objects_container(); if (container !== null) { container.setAttribute("data-stow_transition_active", "false"); //console.log("the html attribute indicating that the minimized windows ACTIONS are in progress is set to FALSE"); } } //this function gets the value of an HTML attribute in the //'stow minimized windows' DOM objects' container which designates //whether the 'stow minimized windows' feature is in progress, or not. //this attribute prevents other actions from being performed while //the stowing minimized windows action is in progress, thus preventing //conflicts with other actions that may currently be in progress. function get_stow_transition_active_attribute() { var container = null; var is_active = null; container = get_stowed_minimized_windows_objects_container(); if (container !== null) { is_active = container.getAttribute("data-stow_transition_active"); if (is_active === "true" || is_active === true) { is_active = true; } else if (is_active === "false" || is_active === false) { is_active = false; } } //console.log("the html attribute determining if the minimized windows are currently in action to be stowed/unstowed, has been retrieved with the value of: " + is_active); return is_active; } //2024-05-13: //this function will add a browser window event listener: //if there are no minimized windows present, then hide the stow inimized window box/button. //this sets the box/button's visibility to hidden after a short pause in time. //if there are no minimized windows present, it hides the box/button. //otherwise, it does nothing. For some reason, the stow minimized window box/button //displays visibly when an event calls a function to open a new window. This bug //doesn't seem to occur when calling the event to create a new window progrmatically. //see file: 'stow_minimized_windows.js' function hide_stow_minimized_window_box_if_no_minimized_windows_exist_event_listener() { window.addEventListener("mousedown", function (event) { setTimeout(function () { hide_stow_minimized_windows_box_if_no_minimized_exist(); }, 10); //event.preventDefault(); //return; }); } //2024-05-13: //this function counts the minimized windows. if minimized windows //don't exist, then hide the stow minimized windows box/button. //it's currently being called in an event listener for the web //browser window element. see file: 'stow_minimized_windows.js' function hide_stow_minimized_windows_box_if_no_minimized_exist() { var minimized_count = null; minimized_count = minimized_window_count(); if (minimized_count < 1) { hide_stow_minimized_window_box(); hide_tuck_stowed_minimized_window_icon(); } } //2024-05-21: //this function counts the minimized windows. if minimized windows //don't exist, then remove the stow minimized windows box/button. // see file: 'stow_minimized_windows.js' function remove_stow_minimized_windows_box_if_no_minimized_exist() { var minimized_count = null; var tab_box_container = null; minimized_count = parseFloat(minimized_window_count()); if (minimized_count <= 0) { tab_box_container = document.getElementById("stowed_minimized_windows_objects_container"); if (tab_box_container !== null) { tab_box_container.parentNode.removeChild(tab_box_container); } } } //2024-05-21: //this function counts //the minimized windows. if no minimized windows exist (count < 1), //then remove the stow minimized windows box/button. in this case //there is a pause in time before calling the function that counts //the minimized windows, and if none exist, remove the stow minimized //windows components. // see file: 'stow_minimized_windows.js' function pause_remove_stow_minimized_windows_box_if_no_minimized_exist() { setTimeout(function () { remove_stow_minimized_windows_box_if_no_minimized_exist(); }, 1000); }