"use strict"; async function start() { //document.getElementById("iframe1").parentNode.childNodes[0].tagName = "script"; //setting the default page to //display my snowflake JavaScript instead of loading the page. ////window.location.replace("/chromosphere/scripts/content/snow/index_5.htm"); ////return; var i = null; var win_obj = null; var is_remembered = false; //session memory default value var win = null; var client_memory_address = null; var page_contents = null; var javascript_content = null; //2023-09-22: //A global variable is set to true, or false. If //a developer needs to test, debug, analyze, or fix //an issue, it is turned on (true). If the site is //published to the web, testing mode is turned off //so the end user isn't inundated with testing tools. //See file: 'testing.js' to view test mode functionality. //set_test_mode_on(); set_test_mode_off(); //2023-09-22: //This is a test mode that includes all testing features //to be running, not just some. //This function turns full test mode off so the end user isn't //inundated with all of the testing tools. //See file: 'testing.js' to view test mode functionality. //full_test_mode_on(); full_test_mode_off(); //2025-05-13: //initialize and start the stopwatch. //see file: 'stop_watch.js' init_stop_watch(); //2023-09-22: //Set a global variable that stores a boolean value //indicating that "global test mode" is on, or off. //Test mode is a blanket feature that allows the web app //to be tested, debugged, & analyzed, and also allow it to be //in "published" mode (false) where the end-user doesn't see what //is going on under the hood. ////global_test_mode = false; //2023-09-22: //This is the global stopwatch. It currently fires every 1000 ms. //It was previously set to 1000 ms. //This timer is global in scope, and provides //a global variable storing the time that is updated //every time the timer is fired. This way, whenever a timer //is needed, you don't need to create a new one. This saves resources //and lightens the load needed to run time based functions. //See file: 'utilities.js' update_time(); //2023-06-21: If the viewport width of the top-most window is //below 640 pixels in width, redirect to "mobile" device interface ////change_to_mobile_device_version_if_lessthan_640(event); //get_all_js(); //GETS ALL JAVASCRIPT FILES AND APPENDS THEM INTO ONE TEXT FILE. ////start_code_analysis(); ////return; //THIS IS DONE TO CHECK THE NUMBER OF LINES OF JAVASCRIPT ON THE PAGE OUT OF CURIOSITY. //2023-09-22: As of today, the javascript in this page has 25,000 lines of code, the text file I //have it stored in is 728 KB. If you were to print all of the code, it would come out to 507 pages @ 11pt, //single line spacing format. Wow. see file: 'code_analysis.js' //set_global_vars(); //sets the color and overall style of the web windows set_global_vars_theme_0001(); //Another CSS style profile for setting the color and overall style of the interface //load the global blank spacer image global_cached_blank_img = new Image(); //us a global variable to store blank image/spacer img. global_cached_blank_img.src = "/chromosphere/images/blank.gif"; set_host(); //set the hostname globally //create_html_elems(); //initilize the base URL tag, //the link favicon, link canonical, link author, //and make sure to have them at the head of the //document(place holder html objects are hard-coded //within the index.htm document). make_memory_storage_box(); //creates a container that holds all memory objects //alert("and it begins..."); create_desktop(); //make and config desktop reset_css_pixel_ratio(); //this equalizes screen pixels and window pixels log_CSS_ratio(); //Writes the CSS pixel ratio to the log //apply_page_zoom(get_inverse_pixel_ratio( get_pixel_ratio())); get_coords(); //gets the location of the cursor // --- arguments: ID, Left, Top, Width & Height for: // --- make_new_window(win_id, L, T, W, H, title); //a window event listener for the mouse button being pressed down window.addEventListener("mousedown", function (event) { //testing to see if we can somehow store an event object to the DOM. //See file 'record_events.js' ////store_event(event); get_coords(); //get the location on the screen where mousedown event occurs on the web window. global_left_mouse_button_down = true; //a boolean variable in global scope that tells if the mouse button is down //display_event_details(event); //2023-08-24: researching and testing events //2024-07-16: //for each open window that is displaying the 'window details' menu, //update the details in the details menu. //see file: 'show_window_details.js'. //update_all_window_details_menus(); //initializes elements to adjust their //properties and xy positions to adjust for //any window scrolling. //see file: 'window_2.js' window_scroll_event_handler(); adjust_objects_scroll_xy_position(); set_all_minimized_wins_position_fixed(); //organize any minimized windows into //an organized stack. //see file: 'minimize_window_scroll_box_1.js' ////minimize_window_main //make sure any existing maximized windows //are set at the top zIndex layer. ////move_all_maximized_windows_to_front(); }); //mouseup event listener to release the global active window window.addEventListener("mouseup", function () { global_left_mouse_button_down = false; //the mouse is now up. Update variable. if (global_active_window !== null) { deactivate_global_active_window(); //deactivate the global active web window on mouse up of the window } //2024-05-18: //set all windows' zIndex property in order. tabbed windows are set //with the lowest zIndex. cascaded windows are set next. minimized //windows are set next. finally, the maximized window(s) are set. //see file: 'window_2.js' ////setTimeout(function () { ////set_all_window_zIndexes(); ////}, 750); }); //records the cursor x, y, when the cursor moves window.addEventListener("mousemove", function () { get_coords(); //record x, y, coords when the mouse moves //console.log("X: " + global_mouse_coords_x + " Y: " + global_mouse_coords_y); }); //When the window is resized window.addEventListener("resize", function () { //apply_page_zoom(get_pixel_ratio()); //2023-06-21: If the viewport width of the top-most window is //below 640 pixels in width, redirect to "mobile" device interface ////change_to_mobile_device_version_if_lessthan_640(event); resize_maximized_web_windows(); reset_css_pixel_ratio(); //set_initial_zoom(); //configs the initial default page zoom value and CSS pixel ratio //equalize_css_pixel_ratio(); //this equalizes screen pixels and window pixels //set_initial_zoom(); //equalize_css_pixel_ratio(); //function is in zoom.js. On window resize, it resets the pixel ratio to 1:1 ////apply_page_zoom(global_zoom); //alert(document.body.style.zoom); //alert(get_scale()); //global_css_pixel_ratio = parseFloat(get_pixel_ratio()); //alert((1 - global_css_pixel_ratio)); //set_scale(((1 - global_css_pixel_ratio) * 100)); //set_scale(global_css_pixel_ratio); //resize_window_desktop(); //set size of the resized window //event.preventDefault(); //event.stopImmediatePropagation(); //event.stopPropagation(); //return; }); //2023-08-25: //When the user leaves, or exits the window object, //the blur event occurrs. This is put here to clean up the UI //and reconfigure it. window.addEventListener("blur", function () { reset_ui(); ////block_all_window_content_containers(); }); ////self.addEventListener("mousemove", function (event) { ////event.stopImmediatePropagation(); //// event.stopPropagation(); //// event.preventDefault(); //console.log("mouse is out of bounds"); ////block_all_window_content_containers(); ////}); //2023-08-24: Experimenting with invoking events //----------------------------------------------- window.addEventListener("dblclick", function () { //alert("event invoked"); //config_all_windows_for_tabbed_view(); //2024-05-18: //set all windows' zIndex property in order. tabbed windows are set //with the lowest zIndex. cascaded windows are set next. minimized //windows are set next. finally, the maximized window(s) are set. //see file: 'window_2.js' ////reset_all_window_zIndexes(); ////set_all_window_zIndexes(); }); window.addEventListener("click", function (event) { //invoke_event(); //set_duplicate_event(event, document.body); //2024-05-18: //set all windows' zIndex property in order. tabbed windows are set //with the lowest zIndex. cascaded windows are set next. minimized //windows are set next. finally, the maximized window(s) are set. //see file: 'window_2.js' ////reset_all_window_zIndexes(); ////move_all_tabbed_windows_to_front(); ////move_all_cascaded_windows_to_front(); ////move_all_minimized_windows_to_front(); ////move_all_maximized_windows_to_front(); ////move_all_minimized_windows_to_front(); ////set_all_window_zIndexes(); //2024-07-16: //for every open window, check to see if its option menu is showing. //if the options menu is showing, update all options data. //see file: 'show_window_details.js'. ////update_all_window_details_menus(); //organize any minimized windows into //an organized stack. //see file: 'minimize_window_scroll_box_1.js' ////minimize_window_main(); }); window.addEventListener("mouseover", function () { //2024-03-21: //This is used during testing. It displays a small blue box at //the Y position of the page where the Y offset location should be. //this depends on the existence and "block" display of the main menu //spanning the top of the page. This functionality also does the same //with the tabbed window tab boxes that is also place at the top //of the browser window. See the file: 'testing.js'. if (global_test_mode === true) { offset_Y_test_marker_image(get_page_offset_Y()); } }); document.body.addEventListener("click", function () { ////console.log("The Window object has been clicked, and the Body object writes this log entry (it logs this twice). It works."); //2024-05-18: //set all windows' zIndex property in order. tabbed windows are set //with the lowest zIndex. cascaded windows are set next. minimized //windows are set next. finally, the maximized window(s) are set. //see file: 'window_2.js' ////set_all_window_zIndexes(); }); //------------------------------------------------ //window.addEventListener("mouseenter", function () { // set_initial_zoom(); // equalize_css_pixel_ratio(); //function is in zoom.js. On window resize, it resets the pixel ratio to 1:1 // //alert("c00oVV!"); //}); //on window scroll, make the maximized web window stay within the window width, and height, top, left. window.addEventListener("scroll", function (event) { offset_Y_maximized_window(); //adjust the vertical location of maximized window //set the global variables to store the scroll X, Y //coordinates of the browser window. global_window_scroll_x = parseFloat(window.scrollX); global_window_scroll_y = parseFloat(window.scrollY); //see file: 'window_2.js' window_scroll_event_handler(); adjust_objects_scroll_xy_position(); event.stopImmediatePropagation(); event.stopPropagation(); event.preventDefault(); return; }, { passive: false, capture: false, cancelable: true, bubbles: false }); initialize_xmlhttp_array(); //configures an array to store xmlhttp object initialize_global_interval_timer_array(); //array for global clock that ticks at 1 second, currently //initialize_xmlhttp_timer_id_array(); //stores the timer ids for xmlhttp //initialize_timer_id_array(); //an array to hold timers //remove_noscript(); //remove noscript element from page head self.document.body.style.width = parseFloat(self.innerWidth) + "px"; //set the width of the body to the window size make_caption_box(); //makes the box that contains helper captions make_all_windows(); //make all the web windows and display them ////client_memory_address = set_BG_2(); //Set the background for the page (in the 'desktop' element). //2024-1-15: Created a 4th version to set the background wallpaper bitmap. set_BG(); //xmlhttp_get("https://localhost:44361/chromosphere/scripts/js/ui/ss/dayOfYear"); make_main_menu(); //this fetches the main menu html to be placed into the page //get_top_menu_html(); //reset_zoom_to_1(); //2023-09-22: //--------------------------------------------------------------------- //These variables do not need to be set anymore. I developed several //functions that control these global variables which indicate whether //the web app is being run for testing purposes. //See file: 'utilities.js' to view test mode functionality. //I set up a testing mode to work with the UI content blocking layer. //when mode is set to true, the normally transparent blocking layer //images are opaque white. Otherwise, they're invisible. ////global_ui_interaction_window_content_block_test_mode = false; //when resizing, or moving web-windows, a UI blocking layer //fills the window and blocks unintended interaction. This allows //for smooth movement and resizing of web windows. Otherwise, the mouse //interacts with the web-window content, and the otherwise smooth movements //jerk all over. To test it, I have to be able to see it in action. //When test mode is set to true, the behavior of the blocking //layer can be observed. Otherwise, it's entirely transparent ////global_ui_interaction_screen_content_block_test_mode = false; //----------------------------------------------------------------------- //Sets a global variable to true, or false //depending on if we want UI animations to be present. //See: animations.js set_global_animations_on(); //alert(document.getElementById("head_object")); //alert(return_url_querystring(window.location.href)); //alert(return_non_cahced_url(window.location.href)); //2023-09-20: //this function places a div container object inside //the body node as the first child element in the body. //The container serves as a place to store future //Chromosphere DOM objects. See file 'DOM_objects_container.js'. start_chromosphere_objects_container(); //2024-1-15: //When the page itself has finished loading, //then set an attribute inside the body tag //indicating true, that the page has finished //loading. set_page_is_loaded_attribute(); //msg_box("3", "message box", "The page is now loaded."); //change_element_attribute_values(document.getElementById("desktop"), "id", "_new_suffix"); //2024-02-16: //make the container strip for the container which will hold the //tabs for the tabbed windows. Place it below the top menu bar. ////get_tabbed_window_tabs_container(); //init_stow_minimized_windows(); /* setInterval(function () { //2024-05-18: //set all windows' zIndex property in order. tabbed windows are set //with the lowest zIndex. cascaded windows are set next. minimized //windows are set next. finally, the maximized window(s) are set. //see file: 'window_2.js' reset_all_window_zIndexes(); set_all_window_zIndexes(); }, 500); */ ////document.body.style.minWidth = parseFloat(screen.width) + "px"; ////document.body.style.minHeight = "4000px"; ////alert(document.body.style.width); //2024-08-18: //these functions add event listeners to the window //element for the purpose of mapping touchscreen events //to dispatch mousedown and mouseup synthetic events that //the touchscreen events are mapped to. //see file: 'ui_touch_functions.js' add_touch_event_listeners_window(); ////create_grid_layout_table(); start_view_window_grid(); //2024-12-11: //setting up a feature which requires the visitor of to this website //to "knock the door" to get in. A knock on the door is the same thing //as a click event to the web browser window. The user must knock a //specific number of times, within a pattern of time in order to //continue the start of this web app. //see file: '/chromosphere/scripts/js/ui/testing/request_knock_to_enter/listen_for_a_user_knock.js' //let j = 0; //do { // j++; // console.log(j); // console.log("Window mouse click event has been invoked."); //} while (!start_request_entrance_to_page_by_knocking()); ////start_request_entrance_to_page_by_knocking(); //2024-11-24: //creating a central control system within the //page that is responsible for handling actions //that need a document-wide ability to operate. //for example, to allow one window to send and //recieve data from another window. //see file: 'cps_functions.js' start_central_processing_system(); ////set_fullscreen_scrollbars_event_listener(); //2025-01-18: //reloading every 10 seconds to test if //a unique id number already exists. /* setTimeout(function () { window.location.reload(); }, 10000); */ } //this function creates the windows that automatically load when body loads async function make_all_windows() { return; var i = null; var win = null; var music_video_window = null; //var delay_time_after_load = 300; //in ms. //var delay_time_win_open = 100; //in ms. //for loop that sets timeout delay to make each window //for (i = 100; i < 1500;i+=100) { // //alert(i); // global_tId17 = setTimeout("mW('"+ i +"');clearTimeout(global_tId17);", i); //make window, clear the timeout //} for (i = 0; i < 8; i++) { ////break; let w = null; let h = null; let top = null; let left = null; let win = null; w = Math.abs(Math.floor((Math.random() * (parseFloat(window.innerWidth))) - Math.floor(Math.random() * (parseFloat(window.innerWidth) / 2)))) + 320; h = Math.abs(Math.floor((Math.random() * (parseFloat(window.innerHeight))) - Math.floor(Math.random() * (parseFloat(window.innerHeight) / 3)))) + 240; top = Math.abs(Math.floor((Math.random() * (parseFloat(window.innerHeight))) - Math.floor(Math.random() * (parseFloat(window.innerHeight) / 2)))) + 32; left = Math.abs(Math.floor((Math.random() * (parseFloat(window.innerWidth))) - Math.floor(Math.random() * (parseFloat(window.innerWidth) / 2)))) + 3; ////mW("Window " + i); setTimeout(function () { make_new_window(null, left, top, w, h, (Math.floor(Math.random() * 900) + 100) + " Test Window: " + (i + 100), null); }, (i + 10) * 200); ////minimize_window(await win.id); // global_tId17 = setTimeout("mW('TEST 000" + i + "');", ((i + 1) * 700)); //make window, clear the timeout ////setTimeout(await mW(i), ((i + 1) * 300)); // minimize_window(await win.id); } //setTimeout(function () { // minimize_all(); //}, 4000); //var test_win = null; //test_win = mW("Test Window 0001"); //move_up(test_win.id, 31, 1, 30); ////2023-06-21: Making a feature to show thumbnail images of each window that ////is currently minimized. //var w = null; //w = mW("Testing Thumbnails..."); //start_thumbnails(w.id); //w.style.zIndex = top_zIndex() + 1; //make_new_window(null, 250, 250, 300, 400, "Main Menu Editor", 1097655447841219); // // mW("asdfgh"); ////mW("lkjhgf"); // mW("mjhu"); // mW("edfcv"); /* mW(); mW(); mW(); mW(); mW(); mW(); mW(); mW(); mW(); */ //var counter = null; //counter = 0; ////for (i = 0; i < 12; i++) { // counter = counter + 5; //tId8 = setTimeout("mW();clearTimeout(tId8);", (i + 10)); // global_tId16 = setTimeout(function () { // clearTimeout(global_tId16); // }, (counter * 1)); //// make_new_window(null, null, null, null, null, "Title_" + i.toString(), null); //global_tId = setTimeout("make_new_window(null, null, null, null, null, 'Title: 000" + i + "', null);clearTimeout(global_tId);", ((i + 1) * delay_time_win_open) + delay_time_after_load); ////} //tId = setTimeout("make_new_window(null, null, null, null, null, \"Title\", null);clearTimeout(tId)", null); //make_new_window(null, 0, 35, window.innerWidth, window.innerHeight, "Test run: " + (i + 1), 1000000000000001); ////global_tId2 = setTimeout("make_new_window(null, 150, 150, 300, 300, \"Test run: \" + (100), 1000000000000000);clearTimeout(global_tId2);", 100); ////make_new_window(null, 340, 59, 504, 374, "Test run: ", 1000000000000000); //setTimeout(function () { //make_new_window(null, 250, 250, 300, 400, "Test run: " + (200), null); //make_new_window(null, 350, 350, 400, 500, "Test run: " + (300), null); //make_new_window(null, 450, 450, 500, 600, "Test run: " + (400), null); //make_new_window(null, 550, 550, 600, 700, "Test run: " + (500), 1000000000000004); //}, 200); setTimeout(function () { open_testing_window_6(); }, 500); //setTimeout(function () { // music_video_window = make_new_window(null, 250, 120, 1275, 773, "Youtube Music Playlist", 1000000000000003); // move_to_front(music_video_window.id); //}, 1500); //global_tId3 = setTimeout("make_new_window(null, 375, 360, 504, 360, \"TEST 3 - HTML Pulled from the Database: (1x10^16) + (4.0)\", 1000000000000004);clearTimeout(global_tId3);", ((i + 2) * delay_time_win_open) + delay_time_after_load); make_new_window(null, 375, 360, 500, 600, "TEST 3 - HTML Pulled from the Database: (1x10^16) + (4.0)", 1000000000000004); //make_new_window(null, 375, 56, 504, 319, "TEST 3 - HTML Pulled from the Database: (1x10^16) + (4.0)", 1000000000000004); //// setTimeout(function () { //// make_new_window(null, 1, 35, 640, 480, "Load A Web Page", 1000000000000004); //// }, 100); //global_tId4 = setTimeout("make_new_window(null, 340, 340, 380, 340, \"Read-Only Data - Testing Message Box Feature: \", 1000000000000005);clearTimeout(global_tId4);", 2000); make_new_window(null, 340, 340, 380, 340, "Read-Only Data - Testing Message Box Feature: ", 1000000000000005); //make_new_window(window_id, L, T, W, H, title, content_id) ////setTimeout(function () { //// make_new_window(null, 125, 50, 1100, 600, "Menu Navigation Editor", 1000000000000001); ////}, 100); /// /* setTimeout(function () { make_new_window(null, 100, 40, 600, 442, "Embedded Twitter Feed", 1000000000000005); }, 2000); */ //Tweets by TwitterDev ////setTimeout(function () { ////make_new_window(null, 720, 35, 647, 428, "Youtube Music Playlist", 1000000000000004); ////}, 1500); //// setTimeout(function () { //// make_new_window(null, 200, 200, 1146, 572, "Chromosphere Progress Videos", 1000000000000006); //// }, 2500); //2023-08-22: //Testing opening data in new windows. //checking the scrollbar/overflow properties. //Open the following windows. //setTimeout(function () { //open_testing_window(); open_testing_window_2(); //open_testing_window_3(); //open_testing_window_4(); //open_testing_window_5(); //open_testing_window_6(); ////open_testing_window_7(); //top: 250px; left: 250px; width: 746px; height: 506px; open_testing_window_8(); //open_main_menu_editor_window(); //}, 10); } //2023-08-22: //testing a function that opens a window containing the main menu editor. function open_main_menu_editor_window() { var win = null; setTimeout(function () { win = make_new_window(null, 600, 150, 600, 300, "Main Menu Editor", 1097655447841219); if (win !== null && win !== undefined) { //win.style.zIndex = parseInt(get_top_DOM_z_index()) + 1; //remove_scrollbars_CSS(win); } }, 400); } //2023-08-22: //testing window. function open_testing_window() { //2143827258885544 var win = null; win = make_new_window(null, 250, 250, 300, 400, "Testing Window", 2143827258885544); if (win !== null && win !== undefined) { //win.style.zIndex = parseInt(get_top_DOM_z_index()) + 1; //remove_scrollbars_CSS(win); } } //2023-08-23: //testing window 2. async function open_testing_window_2() { return; var win = null; ////alert("testing"); //// if (win !== null && win !== undefined) { win = await make_new_window(null, 1, 35, ((window.innerWidth) - 7), ((window.innerHeight) - 40), "'Old School: The Movie'", 1861938337563427); setTimeout(function () { if (win !== null) { /////win.style.zIndex = parseInt(get_top_DOM_z_index()) + 1; //setTimeout(function () { // maximize_window(win.id); //}, 1000); ///// maximize_window_by_command(win.id); ///// ////alert(win.id); } }, 50); //remove_scrollbars_CSS(win); ////} } async function open_testing_window_3() { var win_id = null; win_id = await open_window(3645009755624565); set_win_title(win_id, "Testing Window 3"); } async function open_testing_window_4() { var win_id = null; win_id = await open_window(7873293043414374); set_win_title(win_id, "Testing Window 4"); } async function open_testing_window_5() { //var win_id = null; //win_id = await open_window(1861938337563427); //set_win_title(win_id, "Testing Window 5"); display_non_duplicate_window(1861938337563427); } async function display_non_duplicate_window(cid) { //"1861938337563427" open_window(cid); } async function open_testing_window_6() { return; //4764064842580281 //open_window(4764064842580281); var win = null; win = make_new_window(null, 381, 350, 385, null, "Testing Window 6", 7604385955081219); if (win !== null && win !== undefined) { set_win_title(win.id, "Testing Window 6"); //win.style.zIndex = parseInt(get_top_DOM_z_index()) + 1; //remove_scrollbars_CSS(win); } //var win_id = null; //win_id = await open_window(4764064842580281); } async function open_testing_window_7() { //top: 250px; left: 250px; width: 746px; height: 506px; //content_id: 6406452665602639 //width: 845.25 //height: 654.5 var win = null; setTimeout(function () { win = make_new_window(null, 50, 100, 1000, 750, "You ever stood and stared at it? Marveled at its beauty... its genius?", 6406452665602639); if (win !== null && win !== undefined) { set_win_title(win.id, "You ever stood and stared at it? Marveled at its beauty... its genius?"); //win.style.zIndex = 10000000; //increment_zIndex(); // parseInt(get_top_DOM_z_index()) + 1; //remove_scrollbars_CSS(win); } }, 300); } async function open_testing_window_8() { return; //top: 250px; left: 250px; width: 746px; height: 506px; //content_id: 6406452665602639 //width: 845.25 //height: 654.5 var win = null; var data = null; data = "

Data Has Been Written to Window " + parseFloat(Math.floor(Math.random() * 900000) + 100000).toString() + "

"; win = await make_new_window(null, 50, 100, 1000, 750, "This Window Should Write to Itself", 7030434295004499); setTimeout(async function () { if (win !== null && win !== undefined) { ////move_to_front(win.id); //set_win_title(win.id, "You ever stood and stared at it? Marveled at its beauty... its genius?"); ////set_win_title(win.id, "Testing a 'write to window' feature"); ////write_to_window(win.id, data, false); } }, 1000); } //2024-1-15: //Sets an attribute inside the body tag indicating if the //page load event has occurred. function set_page_is_loaded_attribute() { document.body.setAttribute("data-page_is_loaded", "true"); //alert("page is loaded"); }