"use strict"; function setup_resize_bars_y(win_id) { var win = null; var bar_y = null; if (resize_bar_exists_y(win_id) !== true) { bar_y = make_resize_bar_y(win_id); if (bar_y !== null) { win = document.getElementById(win_id); if (win !== null) { place_resize_bar_y(win_id, bar_y); set_resize_bar_y_event_listeners(win_id, bar_y); //2023-09-23: //Set the resize y bar to animate upon changing //width, height, top, left, box-shadow CSS values. //See file 'transformations.js' //2023-09-22: //temporarily comment this out. ////default_config_elem_for_animation(win_id); //2023-09-22: //instead of assigning default CSS animations for all //CSS properties, assign CSS animations to a window depending //on its action. This function removes CSS animations from //the window, and sets animation to the width and height. //See file: 'window_2.js' set_animations_resize_window(win_id); set_size_resize_bar_y(win_id); ////show_resize_bar_y(win_id); } } } else { bar_y = get_resize_bar_y(win_id); //2023-09-22: //Set the resize y bar to animate upon changing //width, height, top, left, box-shadow CSS values. //See file 'transformations.js' //2023-09-22: //temporarily comment this out. ////default_config_elem_for_animation(win_id); //place_resize_bar_y(win_id); set_size_resize_bar_y(win_id); //set_resize_bar_y_event_listeners(win_id); //show_resize_bar_y(win_id); } } function make_resize_bar_y(win_id) { var bar_y = null; var bar_y_exists = null; bar_y_exists = resize_bar_exists_y(win_id); if (bar_y_exists === true) { bar_y = get_resize_bar_y(win_id); } else { bar_y = document.createElement("div"); bar_y.setAttribute("id", win_id + "_resize_bar_y"); bar_y.style.position = "absolute"; //2023-09-23: //If the web app is running in "test mode", display //the resize width bar in blue. Otherwise, set the opacity //of the resize width bar to 0 (transparent). if (global_test_mode === true) { bar_y.style.backgroundColor = "rgba(0,0,255,1.0)"; } else if (global_test_mode !== true) { bar_y.style.backgroundColor = "rgba(0,0,255,0)"; } } return bar_y; } function get_resize_bar_y(win_id) { var win = null; var bar_y = null; win = document.getElementById(win_id); if (win !== null) { bar_y = document.getElementById(win_id + "_resize_bar_y"); if (bar_y !== null) { return bar_y; } } } function set_size_resize_bar_y(win_id) { var win = null; var win_height = null; var win_top = null; var bar_y = null; var bar_y_width = null; var bar_y_height = null; var bar_y_left = null; var bar_y_top = null; var bar_y_right = null; var bar_y_bottom = null; var pixel_ratio = null; var td_status_height = null; var td_status = null; var td_status_width = null; var td_top = null; var td_height = null; pixel_ratio = get_pixel_ratio(); //alert(pixel_ratio); win = document.getElementById(win_id); //win_id + "_resize_bar_y" if (win !== null) { td_status = document.getElementById(win_id + "_window_status"); if (td_status !== null) { bar_y = get_resize_bar_y(win_id); if (bar_y !== null) { bar_y_height = 8.9895 / pixel_ratio; bar_y_top = get_window_contents_td_top(win_id); bar_y_left = get_window_contents_td_left(win_id); td_top = get_window_contents_td_top(win_id); td_height = get_window_contents_td_height(win_id); td_status_width = parseFloat(td_status.offsetWidth); td_status_height = parseFloat(td_status.offsetHeight); bar_y.style.height = (bar_y_height) + "px"; bar_y.style.width = ((td_status_width) + (parseFloat(4) * pixel_ratio)) + "px"; bar_y.style.left = (bar_y_left) + "px"; bar_y.style.top = ((td_height + td_status_height + td_top - 3) + parseFloat(2.2532 * pixel_ratio)) + "px"; } } } } function place_resize_bar_y(win_id, resize_bar_y) { var win = null; var bar_y = null; var bar_y_exists = null; bar_y = resize_bar_y; win = document.getElementById(win_id); if (win !== null) { bar_y_exists = resize_bar_exists_y(win_id); if (bar_y_exists !== true) { bar_y = make_resize_bar_y(win_id); //win.appendChild(bar_y); //document.insertBefore(bar_y, win.childNodes[1]); ////win.children[0].insertAdjacentElement("afterend", bar_y); win.appendChild(bar_y); ////set_size_resize_bar_y(win_id); ////set_resize_bar_y_event_listeners(win_id); ////show_resize_bar_y(win_id); } } } function set_resize_bar_y_event_listeners(win_id, barY) { var win = null; var bar_y = null; win = document.getElementById(win_id); if (win !== null) { bar_y = get_resize_bar_y(win_id); if (bar_y !== null) { //continue } else { bar_y = make_resize_bar_y(win_id); } bar_y.addEventListener("mouseover", function () { bar_y.style.cursor = "ns-resize"; //2023-09-23: //This function sets the HTML attribute which //determines whether to resize the window by X and Y, //or just X, or just Y. See file: 'resize_window.js' set_win_resize_xy_attribute(win_id, "y"); }); bar_y.addEventListener("mouseout", function () { bar_y.style.cursor = "initial"; }); bar_y.addEventListener("mousedown", function () { global_left_mouse_button_down = true; init_before_resize(win_id); event.preventDefault(); event.stopPropagation(); }); bar_y.addEventListener("mouseup", function () { global_left_mouse_button_down = false; deactivate_global_active_window(); event.preventDefault(); event.stopPropagation(); }); } } function move_resize_bar_y(win_id) { } function hide_resize_bar_y(win_id) { } function show_resize_bar_y(win_id) { var bar_y = null; bar_y = get_resize_bar_y(win_id); if (bar_y !== null) { bar_y.style.display = "block"; } } function remove_resize_bar_y(win_id) { } function resize_bar_exists_y(win_id) { var bar_y = null; var exists = null; bar_y = document.getElementById(win_id + "_resize_bar_y"); if (bar_y !== null) { exists = true; } else { exists = false; } return exists; } //2023-09-23: //duplicate functions; commented out. //they are now placed in the file: 'resize_window.js' /* function set_win_resize_xy_attribute(win_id, xy) { var win = null; var resize_xy = null; win = document.getElementById(win_id); if (win !== null) { resize_xy = xy; if (resize_xy === "xy" || resize_xy === "x" || resize_xy === "y") { } else { resize_xy = "xy"; } win.setAttribute("data-resize_xy", resize_xy); } } */ //2023-09-23: //duplicate functions; commented out. //they are now placed in the file: 'resize_window.js' /* function get_win_resize_xy_attribute(win_id) { var win = null; var resize_xy = null; var xy = null; win = document.getElementById(win_id); if (win !== null) { resize_xy = win.getAttribute("data-resize_xy"); if (resize_xy !== null) { if (typeof resize_xy === "string") { if (resize_xy.length > 0) { xy = resize_xy; } else { xy = "xy"; set_win_resize_xy_attribute(win_id, xy); } } else { xy = "xy"; set_win_resize_xy_attribute(win_id, xy); } } else { xy = "xy"; set_win_resize_xy_attribute(win_id, xy); } } return xy; } */