MCPcopy Create free account
hub / github.com/unconed/TermKit / popup

Function popup

HTML/external/syntaxhighlighter_3.0.83/src/shCore.js:591–607  ·  view source on GitHub ↗

* Opens up a centered popup window. * @param {String} url URL to open in the window. * @param {String} name Popup name. * @param {int} width Popup width. * @param {int} height Popup height. * @param {String} options window.open() options. * @return {Window} Returns window instance.

(url, name, width, height, options)

Source from the content-addressed store, hash-verified

589 * @return {Window} Returns window instance.
590 */
591function popup(url, name, width, height, options)
592{
593 var x = (screen.width - width) / 2,
594 y = (screen.height - height) / 2
595 ;
596
597 options += ', left=' + x +
598 ', top=' + y +
599 ', width=' + width +
600 ', height=' + height
601 ;
602 options = options.replace(/^,/, '');
603
604 var win = window.open(url, name, options);
605 win.focus();
606 return win;
607};
608
609/**
610 * Adds event handler to the target object.

Callers 1

shCore.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected