open_YT_window_with_list

by Jim_Kelleher

HTML

<HTML>
<body>

   <button id="open_window" onclick="open_popup_window_outer()"></button>
 
  <style>
  #open_window{
      position: fixed;
      width: 15%;
      height: 15%;
      left: 35%;
      top: 35%;
      }
  </style>
</body>
</HTML>

JavaScript

function open_popup_window(window_uri, modal_dialog, resizable, scrollbars, width_in_pixels, height_in_pixels) {
    //----------------------------------------------------------------------
    var window_desc = ""; // init
    // The following processing has the effect of centering the window
    // to be opened on the screen.  Centering is default behavior in
    // all browsers except Firefox.  Rather than making the process
    // browser-specific, using Configuration Services, I'll just do
    // it for everybody, no harm, no foul:
    // Compute the location's coordinates:
    // NOTE: "Avail" means excluding the Windows task bar.
    var x = (screen.availWidth / 2) - (width_in_pixels / 2);
    var y = (screen.availHeight / 2) - (height_in_pixels / 2);
    // Use the equal sign for equality and the comma as a separator:
    window_desc = "margin-left=auto,margin-right=auto,toolbar=yes,"; // init
    window_desc += "resizable=" + resizable + ",";
    window_desc += "scrollbars=" + scrollbars + ",";
    window_desc += "width=" + width_in_pixels.toString() + "px,";
    window_desc += "height=" + height_in_pixels.toString() + "px,";
    window_desc += "left=" + x.toString() + ",";
    window_desc += "top=" + y.toString();
    return window.open(window_uri, "_blank", window_desc);
}

function open_popup_window_outer() {

        // Open a regular window.  See POPUP NOTE, elsewhere in the code.
        open_popup_window(
            'https://www.youtube.com/embed/?playlist=WO6glz0wpmo,12bM1CqHoBY',
	        false,  // modal dialog
	        "yes",  // resizable
	        "no",   // scrollbars NOTE: This doesn't work in Safari
	        700,    // width
	        500     // height
        );
}