[LON-CAPA-users] Documentation on the <window> command?

H. K. Ng lon-capa-users@mail.lon-capa.org
Mon, 21 May 2007 08:30:31 -0400


--=====================_5845421==.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Brew,

This is what I use when I need a link in a problem to open up another 
window. It is a javascript tag that you put as part of your problem. 
The javascript lets you control what shows up in the new window.

<script type="text/javascript">
function openWindow(url, wdwName) {
     var w      = 650;
     var h      = 750;
     var xpos   = (screen.width-w)/2;
     xpos       = (xpos < 0) ? '0' : xpos;
     var ypos   = (screen.height-h)/2-30;
     ypos       = (ypos < 0) ? '0' : ypos;
     var options = 
"width="+w+",height="+h+",screenx="+xpos+",screeny="+ypos+",";
     options += "resizable=yes,scrollbars=yes,status=no,";
     options += "menubar=no,toolbar=no,location=no,directories=no";
     var newWin = window.open(url, wdwName, options);
     newWin.focus();
}
</script>

Then to call the script, see example below.

<a 
href="javascript:openWindow('http://www.rit.edu/~uphysics/uncertainties/Uncertaintiespart2.html#muldiv','openSesame')" 
TARGET="_self"
  ;=";">Read more on calculating uncertainties.</a>)

Hope that helps.

-hk

At 03:22 PM 5/19/2007, you wrote:
>Somewhere I saw a small piece of code to pop up a supporting window. 
>It was used to provide help or additional explanations for a problem.
>
>I assume there are additional options/parameters or something for 
>the <window> tag? In the problem below, I see an asterisk which is 
>the link to pop up the small window. The title of the small window 
>is <sup>*</sup>, not very cool.
>
>I would like to change the asterisk label, and the title of the 
>popup. Any clues how to do this?
>
>I have the following small code:
>
><problem>
>
><startouttext />Enter the text of the question here.<endouttext />
><!-- Here I am randomly trying various attributes. None of these work -->
><window title="Title of Window" name="Name" label="Label" 
>text="text">This is in a window?
><title> Another title</title>
><h1>Heading One</h1>
><startouttext />Text inside window.<endouttext />
></window>
>
><radiobuttonresponse max="10" randomize="yes">
>
>and so on with the usual radiobuttonresponses.
>
>Thanks,
>brew
>_______________________________________________ LON-CAPA-users 
>mailing list LON-CAPA-users@mail.lon-capa.org 
>http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

--=====================_5845421==.ALT
Content-Type: text/html; charset="us-ascii"

<html>
<body>
Brew,<br><br>
This is what I use when I need a link in a problem to open up another
window. It is a javascript tag that you put as part of your problem. The
javascript lets you control what shows up in the new window. <br><br>
&lt;script type=&quot;text/javascript&quot;&gt;<br>
function openWindow(url, wdwName) {<br>
&nbsp;&nbsp;&nbsp; var w&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 650;<br>
&nbsp;&nbsp;&nbsp; var h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 750;<br>
&nbsp;&nbsp;&nbsp; var xpos&nbsp;&nbsp; = (screen.width-w)/2;<br>
&nbsp;&nbsp;&nbsp; xpos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (xpos &lt;
0) ? '0' : xpos;<br>
&nbsp;&nbsp;&nbsp; var ypos&nbsp;&nbsp; = (screen.height-h)/2-30;<br>
&nbsp;&nbsp;&nbsp; ypos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (ypos &lt;
0) ? '0' : ypos;<br>
&nbsp;&nbsp;&nbsp; var options =
&quot;width=&quot;+w+&quot;,height=&quot;+h+&quot;,screenx=&quot;+xpos+&quot;,screeny=&quot;+ypos+&quot;,&quot;;<br>
&nbsp;&nbsp;&nbsp; options +=
&quot;resizable=yes,scrollbars=yes,status=no,&quot;;<br>
&nbsp;&nbsp;&nbsp; options +=
&quot;menubar=no,toolbar=no,location=no,directories=no&quot;;<br>
&nbsp;&nbsp;&nbsp; var newWin = window.open(url, wdwName, options);<br>
&nbsp;&nbsp;&nbsp; newWin.focus();<br>
}<br>
&lt;/script&gt;<br><br>
Then to call the script, see example below.<br><br>
&lt;a
href=&quot;javascript:openWindow('http://www.rit.edu/~uphysics/uncertainties/Uncertaintiespart2.html#muldiv','openSesame')&quot;
TARGET=&quot;_self&quot;<br>
&nbsp;;=&quot;;&quot;&gt;Read more on calculating
uncertainties.&lt;/a&gt;)<br><br>
Hope that helps.<br><br>
-hk<br><br>
At 03:22 PM 5/19/2007, you wrote:<br>
<blockquote type=cite class=cite cite=""><font size=2>Somewhere I saw a
small piece of code to pop up a supporting window. It was used to provide
help or additional explanations for a problem.<br><br>
I assume there are additional options/parameters or something for the
&lt;window&gt; tag? In the problem below, I see an asterisk which is the
link to pop up the small window. The title of the small window is
&lt;sup&gt;*&lt;/sup&gt;, not very cool.<br><br>
I would like to change the asterisk label, and the title of the popup.
Any clues how to do this?<br><br>
I have the following small code:<br><br>
&lt;problem&gt;<br><br>
&lt;startouttext /&gt;Enter the text of the question here.&lt;endouttext
/&gt;<br>
&lt;!-- Here I am randomly trying various attributes. None of these work
--&gt;<br>
&lt;window title=&quot;Title of Window&quot; name=&quot;Name&quot;
label=&quot;Label&quot; text=&quot;text&quot;&gt;This is in a window?
<br>
&lt;title&gt; Another title&lt;/title&gt;<br>
&lt;h1&gt;Heading One&lt;/h1&gt;<br>
&lt;startouttext /&gt;Text inside window.&lt;endouttext /&gt;<br>
&lt;/window&gt;<br><br>
&lt;radiobuttonresponse max=&quot;10&quot;
randomize=&quot;yes&quot;&gt;<br><br>
and so on with the usual radiobuttonresponses.<br><br>
Thanks,<br>
brew<br>
</font>_______________________________________________ LON-CAPA-users
mailing list LON-CAPA-users@mail.lon-capa.org
<a href="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users" eudora="autourl">
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</a>
</blockquote></body>
</html>

--=====================_5845421==.ALT--