[pmwiki-users] newwin question

Hans design5 at softflow.co.uk
Sun Nov 19 07:16:02 CST 2006


Sunday, November 19, 2006, 11:07:22 AM, The wrote:

> Is there any way to open a new window and predefine the size of the window?

%newwin%[[ ..link..]] will open the link in a new window, but does not
size it. Only javascriopt can force a window to open a required size.
Perhaps this %popwin% markup may help:

## %popwin%
$HTMLHeaderFmt[] = "
<script language='javascript' type='text/javascript'><!--
   function popWin(url) {
      newwindow=window.open(url,'name','height=300,width=400');
      if (window.focus) {newwindow.focus()}
      return false;
  } // -->
</script> \n";
$LinkPopupFmt = "<a href='\$LinkUrl' onclick=\"return popWin('\$LinkUrl')\">\$LinkText</a>";
Markup('[[popup:','<[[','/\\[\\[popup:(.*?)\\]\\]/e',
  "Keep(MakeLink(\$pagename,PSS('$1'),NULL,'',\$GLOBALS['LinkPopupFmt']),'L')");
Markup('%popwin%','<[[','/%popwin%\\[\\[(.*?)\\]\\]/e',
  "Keep(MakeLink(\$pagename,PSS('$1'),NULL,'',\$GLOBALS['LinkPopupFmt']),'L')");

you can use either %popwin%[[link]]
or [[popup:link]] syntax.
Size is determined in the function.


Hans





More information about the pmwiki-users mailing list