[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>
<script type="text/javascript"><br>
function openWindow(url, wdwName) {<br>
var w = 650;<br>
var h = 750;<br>
var xpos = (screen.width-w)/2;<br>
xpos = (xpos <
0) ? '0' : xpos;<br>
var ypos = (screen.height-h)/2-30;<br>
ypos = (ypos <
0) ? '0' : ypos;<br>
var options =
"width="+w+",height="+h+",screenx="+xpos+",screeny="+ypos+",";<br>
options +=
"resizable=yes,scrollbars=yes,status=no,";<br>
options +=
"menubar=no,toolbar=no,location=no,directories=no";<br>
var newWin = window.open(url, wdwName, options);<br>
newWin.focus();<br>
}<br>
</script><br><br>
Then to call the script, see example below.<br><br>
<a
href="javascript:openWindow('http://www.rit.edu/~uphysics/uncertainties/Uncertaintiespart2.html#muldiv','openSesame')"
TARGET="_self"<br>
;=";">Read more on calculating
uncertainties.</a>)<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
<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.<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>
<problem><br><br>
<startouttext />Enter the text of the question here.<endouttext
/><br>
<!-- Here I am randomly trying various attributes. None of these work
--><br>
<window title="Title of Window" name="Name"
label="Label" text="text">This is in a window?
<br>
<title> Another title</title><br>
<h1>Heading One</h1><br>
<startouttext />Text inside window.<endouttext /><br>
</window><br><br>
<radiobuttonresponse max="10"
randomize="yes"><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--