rubyuw 0.99.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/.gitignore +4 -0
  2. data/README.md +81 -0
  3. data/Rakefile +45 -0
  4. data/VERSION +1 -0
  5. data/lib/rubyuw.rb +9 -0
  6. data/lib/rubyuw/base.rb +122 -0
  7. data/lib/rubyuw/connection.rb +145 -0
  8. data/lib/rubyuw/curriculum_enrollment.rb +75 -0
  9. data/lib/rubyuw/errors.rb +16 -0
  10. data/lib/rubyuw/schedule.rb +52 -0
  11. data/lib/rubyuw/sln.rb +108 -0
  12. data/rubyuw.gemspec +97 -0
  13. data/test/live/curriculum_enrollment_test.rb +47 -0
  14. data/test/live/sln_test.rb +54 -0
  15. data/test/live/test_helper.rb +24 -0
  16. data/test/mocked/base_test.rb +171 -0
  17. data/test/mocked/connection_test.rb +178 -0
  18. data/test/mocked/curriculum_enrollment_test.rb +158 -0
  19. data/test/mocked/fixture_pages/bad_request.html +80 -0
  20. data/test/mocked/fixture_pages/curric_courses.html +2659 -0
  21. data/test/mocked/fixture_pages/curric_no_courses.html +88 -0
  22. data/test/mocked/fixture_pages/curric_no_curric_found.html +86 -0
  23. data/test/mocked/fixture_pages/logged_in_relay.html +660 -0
  24. data/test/mocked/fixture_pages/login.html +121 -0
  25. data/test/mocked/fixture_pages/no_form_login.html +122 -0
  26. data/test/mocked/fixture_pages/no_login_button.html +100 -0
  27. data/test/mocked/fixture_pages/not_logged_in_relay.html +15 -0
  28. data/test/mocked/fixture_pages/registration.html +699 -0
  29. data/test/mocked/fixture_pages/registration_error.html +699 -0
  30. data/test/mocked/fixture_pages/registration_error_no_rows.html +627 -0
  31. data/test/mocked/fixture_pages/registration_no_form.html +700 -0
  32. data/test/mocked/fixture_pages/registration_success.html +718 -0
  33. data/test/mocked/fixture_pages/registration_unknown.html +721 -0
  34. data/test/mocked/fixture_pages/schedule.html +166 -0
  35. data/test/mocked/fixture_pages/schedule_diff_credit_row.html +167 -0
  36. data/test/mocked/fixture_pages/schedule_empty.html +130 -0
  37. data/test/mocked/fixture_pages/schedule_no_credit_row.html +169 -0
  38. data/test/mocked/fixture_pages/sln_does_not_exist.html +85 -0
  39. data/test/mocked/fixture_pages/sln_no_course_info.html +94 -0
  40. data/test/mocked/fixture_pages/sln_no_course_notes.html +94 -0
  41. data/test/mocked/fixture_pages/sln_no_enrollment_info.html +94 -0
  42. data/test/mocked/fixture_pages/sln_status.html +92 -0
  43. data/test/mocked/fixture_pages/welcome.html +93 -0
  44. data/test/mocked/schedule_test.rb +89 -0
  45. data/test/mocked/sln_test.rb +146 -0
  46. data/test/mocked/test_helper.rb +67 -0
  47. data/test/password.rb.sample +8 -0
  48. metadata +118 -0
@@ -0,0 +1,627 @@
1
+
2
+ <html>
3
+ <head>
4
+ <meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
5
+ <style type="text/css">
6
+ div.waitClass { position:absolute; font-size:large; text-align: center;}
7
+ div.readyClass { position:absolute; visibility:hidden;}
8
+ </style>
9
+ <title>Registration</title>
10
+ <link REL="stylesheet" TYPE="text/css" HREF="https://www.washington.edu/home/home.css">
11
+
12
+ </head>
13
+ <body onload="self.focus(); initPage(); return true;">
14
+
15
+ <div id='waitDiv' class='waitClass'>
16
+ <p><br>&nbsp;<br>
17
+ <table border='0' cellpadding='0' cellspacing='0' width='100%'>
18
+ <tr><td align='center' valign='middle'>
19
+ <table width='60%' border='3' bordercolor='#e90000' cellpadding='20'><tr><td align='center'><h3><i>Please wait while your request is being processed . . . .</i></h3></td></tr>
20
+ </table>
21
+ </td></tr></table></p>
22
+ </div>
23
+ <div id='doneDiv' class='readyClass'>
24
+ <table border='0' cellpadding='0' cellspacing='0' width='100%' align='center'>
25
+ <tr>
26
+ <td width='100%' class='rpad'>
27
+ <a href='http://www.washington.edu/' target='_top'><img src='/sdb_library/images/uwlogo150p.gif' border='0' width='150' height='28' alt='University of Washington'></a>
28
+ </td>
29
+ <td rowspan='2' valign='bottom'>
30
+
31
+ <table border='0' cellpadding='0' cellspacing='0'>
32
+ <tr><td colspan='2' bgcolor='#666666'><img src='/sdb_library/images/1px_transparent.gif' height='1'></td></tr>
33
+ <tr>
34
+ <td bgcolor='#666666'><img src='/sdb_library/images/1px_transparent.gif' width='7' height='1'></td>
35
+ <td nowrap><span class='l1text'>
36
+ &nbsp;<font color='#9999cc' face='tahoma,sans-serif,arial,helvetica' style='font-size:110%'><b>Student Personal Services</b></font>&nbsp;<span class='noprint'> | <a href='/students/logout.asp'>Logout</a>&nbsp;</span> </span></td>
37
+ </tr>
38
+ </table>
39
+
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <td bgcolor='#666666'><img src='/sdb_library/images/1px_transparent.gif' height='1'></td>
44
+ </tr>
45
+ </table>
46
+ <table border='0' cellpadding='0' cellspacing='0' width='100%'>
47
+ <tr>
48
+ <td bgcolor='#e6e6e6'><img src='/sdb_library/images/1px_transparent.gif' width='1' height='5'></TD>
49
+ </tr>
50
+ </table>
51
+ <span class='noprint'>
52
+ <table border='0' cellpadding='0' cellspacing='0'>
53
+ <tr>
54
+ <td nowrap>&#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/register.asp' CLASS='barnav'><font color='#333399'><b>Registration</b></font></a></td>
55
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/grades.asp' CLASS='barnav'><font color='#333399'>Grade Inquiry</font></a></td>
56
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/dars.asp' CLASS='barnav'><font color='#333399'>DARS - Degree Audit</font></a></td>
57
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/finaidstatus.asp' CLASS='barnav'><font color='#333399'>Financial Aid Status</font></a></td>
58
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/sisStudents/uwnetid/tuition.aspx' CLASS='barnav'><font color='#333399'>Tuition Statement</font></a></td>
59
+ </tr>
60
+ <tr>
61
+ <td nowrap>&#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/schedule.asp' CLASS='barnav'><font color='#333399'>Class Schedule</font></a></td>
62
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/unofficial.asp' CLASS='barnav'><font color='#333399'>Unofficial Transcript</font></a></td>
63
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/address.asp' CLASS='barnav'><font color='#333399'>Change of Address</font></a></td>
64
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/emt.asp' CLASS='barnav'><font color='#333399'>Direct Deposit Transfer</font></a></td>
65
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/ccpay.asp' CLASS='barnav'><font color='#333399'>Credit Card Payment</font></a></td>
66
+ </tr>
67
+ <tr>
68
+ <td nowrap>&#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/vschedule.asp' CLASS='barnav'><font color='#333399'>Visual Schedule</font></a></td>
69
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/official.asp' CLASS='barnav'><font color='#333399'>Official Transcript</font></a></td>
70
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/op_charges.asp' CLASS='barnav'><font color='#333399'>Insurance/Optional Charges</font></a></td>
71
+ <td nowrap> &nbsp; &#183; <a href='https://sdb.admin.washington.edu/students/uwnetid/shorttermloan.asp' CLASS='barnav'><font color='#333399'>Short-Term Loan</font></a></td>
72
+ </table>
73
+ </span>
74
+ <TABLE WIDTH="90%" BORDER=0 CELLPADDING=3>
75
+ <TR>
76
+ <TD WIDTH="70%" VALIGN=TOP><BR><H1>Registration - Autumn 2009</H1>
77
+ <FORM METHOD="post" ACTION="register.asp" id=qtrform name=qtrform>
78
+ <SELECT NAME="QYYYY" >
79
+ <OPTION VALUE="00000">&nbsp;Select a different quarter&nbsp;</OPTION>
80
+ <OPTION VALUE="32009">&nbsp;Summer</OPTION>
81
+ </SELECT>
82
+ <INPUT TYPE=HIDDEN NAME=INPUTFORM VALUE="QTRCHG">
83
+ <INPUT TYPE="submit" VALUE="Change Quarter">
84
+ </FORM>
85
+ <p>
86
+ <TABLE BORDER=0 CELLPADDING=2>
87
+ <TR><TH ALIGN=left>Prepared for:</TH><TD>Somebody </TD></TR>
88
+ <TR><TH ALIGN=left>Prepared on:</TH><TD>June 28, 2009 at 12:59 a.m.</TD></TR>
89
+ <tr><th align='left'>Major:</th><td>Underwater Basketweaving</td>
90
+ </tr>
91
+ </TABLE></p>
92
+ </TD>
93
+ <TD WIDTH="20%">
94
+ <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0>
95
+ <TR BGCOLOR="#DDDDFF"><TD NOWRAP ALIGN=CENTER><FONT CLASS="navlinkbig">&nbsp;Registration&nbsp;Resources&nbsp;</FONT><BR>
96
+ <FONT CLASS="navlink">(will open in new window)</FONT></TD></TR>
97
+ <TR BGCOLOR="#FOFOFO"><TD NOWRAP> <A HREF="http://www.washington.edu/students/timeschd/AUT2009/" TARGET="_TS"> <FONT CLASS="navlink">Time Schedule</A></FONT><BR>
98
+ <A HREF="https://sdb.admin.washington.edu/TimeSchd/UWNetID/findschd.asp?QTRYR=42009" TARGET="FindSchd"> <FONT CLASS="navlink">Schedule Finder</A></FONT><BR>
99
+ <A HREF="http://www.washington.edu/students/crscat/" TARGET="_CRSCAT"> <FONT CLASS="navlink">Course Catalog</A></FONT><BR>
100
+ <A HREF="http://depts.washington.edu/figs/registration" TARGET="_FIG"> <FONT CLASS="navlink">Freshman Interest Groups</A></FONT><BR>
101
+ <A HREF="http://www.washington.edu/students/reg/calendar.html" TARGET="_REGCAL"> <FONT CLASS="navlink">Academic Calendar</A></FONT><BR>
102
+ <A HREF="http://www.washington.edu/students/reg/A2009exam.html" TARGET="_EXAM"> <FONT CLASS="navlink">Final Exam Schedule</A></FONT><BR>
103
+ <A HREF="http://www.washington.edu/students/timeschd/genedinq.html" TARGET="_GENED"> <FONT CLASS="navlink">General Education Search</A></FONT><BR>
104
+ <A HREF="http://www.washington.edu/students/ugrad/advising/secrets.html" TARGET="_TIPS"> <FONT CLASS="navlink">Tips for Closed Classes</A></FONT><BR>
105
+ <A HREF="http://www.washington.edu/admin/pb/home/opb-tuition.htm" TARGET="_TUIT"> <FONT CLASS="navlink">Tuition Rates</A></FONT><BR>
106
+ <A HREF="http://www.washington.edu/students/" TARGET="_SGR"> <FONT CLASS="navlink">Student Guide</A></FONT><BR>
107
+ </TD></TR>
108
+ </TABLE>
109
+ </TD></TR>
110
+ </TABLE>
111
+
112
+ <BR><B><FONT COLOR="#d00000"><IMG BORDER=0 ALIGN=MIDDLE HSPACE=5 SRC="/sdb_library/images/warning.gif" ALT="ERROR">Schedule not updated. Resolve errors listed below and resubmit.</FONT></B><BR><FORM METHOD="post" ACTION="register.asp" id='regform' name='regform'>
113
+ <INPUT TYPE=HIDDEN NAME=INPUTFORM VALUE="UPDATE">
114
+ <INPUT TYPE=HIDDEN NAME=YR VALUE=2009>
115
+ <INPUT TYPE=HIDDEN NAME=QTR VALUE=4>
116
+ <p><b>Your current schedule:</b><br>
117
+ <TABLE BORDER='1' CELLPADDING='3'>
118
+ <TR BGCOLOR="#d0d0d0">
119
+ <TH ROWSPAN='2'>Drop<BR>from<BR>schedule</TH>
120
+ <TH ROWSPAN='2'>SLN</TH>
121
+ <TH ROWSPAN='2'>Course</TH>
122
+ <TH ROWSPAN='2'>Type</TH>
123
+ <TH ROWSPAN='2'>Credits</TH>
124
+ <TH ROWSPAN='2'><A HREF="http://www.washington.edu/students/gencat/front/Grading_Sys.html", TARGET="_GS">Grading<BR>Option</A></TH>
125
+ <TH ROWSPAN='2'>Title</TH>
126
+ <TH COLSPAN='4'>Meetings</TH>
127
+ </TR>
128
+ <TR BGCOLOR="#d0d0d0">
129
+ <TH>Days</TH>
130
+ <TH>Time</TH>
131
+ <TH>Location</TH>
132
+ <TH>Instructor</TH>
133
+ </TR>
134
+ <TR>
135
+ <TD NOWRAP ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=action1 VALUE='D'></TD>
136
+ <INPUT TYPE=HIDDEN NAME=entcode1 VALUE="">
137
+ <INPUT TYPE=HIDDEN NAME=sln1 VALUE=14368>
138
+ <INPUT TYPE=HIDDEN NAME=dup1 VALUE= >
139
+ <INPUT TYPE=HIDDEN NAME=credits1>
140
+ <TD ALIGN='center'><TT>14368 </TD>
141
+ <TD NOWRAP><TT>HIST 111 A </TD>
142
+ <TD ALIGN='center'><TT>LC </TD>
143
+ <TD ALIGN='center'><TT>5.0 </TD>
144
+ <TD ALIGN=left><TT><INPUT TYPE=RADIO NAME=gr_sys1 ID=gr_sys_dec1 VALUE="decnochange" CHECKED>standard<BR>
145
+ <INPUT TYPE=RADIO NAME=gr_sys1 ID=gr_sys_sns1 VALUE='snschange' onClick=snsWarning(1,2)>S/NS
146
+ </TD>
147
+ <TD><TT><A HREF="http://www.washington.edu/students/crscat/hist.html#hist111" TARGET="_HIST111">THE ANCIENT WORLD</A></TD>
148
+ <TD NOWRAP><TT>MTWTh</TD>
149
+ <TD NOWRAP><TT>&nbsp;130-&nbsp;220</TD>
150
+ <TD NOWRAP><TT><A HREF="http://www.washington.edu/students/maps/map.cgi?SMI" TARGET="_SMI">SMI</A> 120</TD>
151
+ <TD NOWRAP><TT><A HREF="http://www.washington.edu/students/icd/S/hist/111jwalker.html" TARGET="_WALKER,JOEL T">WALKER,JOEL T</A>&nbsp;</TD>
152
+ </TR>
153
+ <TR>
154
+ <TD NOWRAP ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=action2 VALUE='D'></TD>
155
+ <INPUT TYPE=HIDDEN NAME=entcode2 VALUE="">
156
+ <INPUT TYPE=HIDDEN NAME=sln2 VALUE=14372>
157
+ <INPUT TYPE=HIDDEN NAME=dup2 VALUE= >
158
+ <INPUT TYPE=HIDDEN NAME=credits2>
159
+ <TD ALIGN='center'><TT>14372 </TD>
160
+ <TD NOWRAP><TT>HIST 111 AD </TD>
161
+ <TD ALIGN='center'><TT>QZ </TD>
162
+ <TD ALIGN='center'><TT>&nbsp;</TD>
163
+ <TD ALIGN=left><TT>&nbsp;</TD>
164
+ <TD><TT><A HREF="http://www.washington.edu/students/crscat/hist.html#hist111" TARGET="_HIST111">THE ANCIENT WORLD</A></TD>
165
+ <TD NOWRAP><TT>F</TD>
166
+ <TD NOWRAP><TT>1130-1220</TD>
167
+ <TD NOWRAP><TT><A HREF="http://www.washington.edu/students/maps/map.cgi?CDH" TARGET="_CDH">CDH</A> 223B</TD>
168
+ <TD NOWRAP><TT>&nbsp;&nbsp;</TD>
169
+ </TR>
170
+ <TR>
171
+ <TD NOWRAP ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=action3 VALUE='D'></TD>
172
+ <INPUT TYPE=HIDDEN NAME=entcode3 VALUE="">
173
+ <INPUT TYPE=HIDDEN NAME=sln3 VALUE=12271>
174
+ <INPUT TYPE=HIDDEN NAME=dup3 VALUE= >
175
+ <INPUT TYPE=HIDDEN NAME=credits3>
176
+ <TD ALIGN='center'><TT>12271 </TD>
177
+ <TD NOWRAP><TT>CSE 322 A </TD>
178
+ <TD ALIGN='center'><TT>LC </TD>
179
+ <TD ALIGN='center'><TT>3.0 </TD>
180
+ <TD ALIGN=left><TT><INPUT TYPE=RADIO NAME=gr_sys3 ID=gr_sys_dec3 VALUE="decnochange" CHECKED>standard<BR>
181
+ <INPUT TYPE=RADIO NAME=gr_sys3 ID=gr_sys_sns3 VALUE='snschange' onClick=snsWarning(3,2)>S/NS
182
+ </TD>
183
+ <TD><TT><A HREF="http://www.washington.edu/students/crscat/cse.html#cse322" TARGET="_CSE322">INTRO FORMAL MODELS</A></TD>
184
+ <TD NOWRAP><TT>MWF</TD>
185
+ <TD NOWRAP><TT>&nbsp;930-1020</TD>
186
+ <TD NOWRAP><TT><A HREF="http://www.washington.edu/students/maps/map.cgi?EEB" TARGET="_EEB">EEB</A> 037</TD>
187
+ <TD NOWRAP><TT>BEAME,PAUL W.&nbsp;</TD>
188
+ </TR>
189
+ <TR></TR>
190
+ <TR>
191
+ <TD ALIGN='right' COLSPAN='5'><TT>Total credits: 8.0&nbsp;</TD>
192
+ <TD ALIGN=right COLSPAN=6> <A HREF="https://sdb.admin.washington.edu/students/UWNetID/vschedule.asp?Q=4" TARGET="_V_SCHED">Display Visual Schedule</A>
193
+ &nbsp; &nbsp; &nbsp;<A HREF="https://sdb.admin.washington.edu/textbooks/query.asp?qtr=Autumn&sln1=14368&sln2=14372&sln3=12271" TARGET="_tb">Display Textbooks</A></TD></TR>
194
+ </TABLE></p>
195
+ <P><B>Add the following sections:</B><BR>
196
+ <TABLE BORDER=1 CELLPADDING=3>
197
+ <TR BGCOLOR="#d0d0d0">
198
+ <TH>SLN</TH>
199
+ <TH><A HREF="http://www.washington.edu/students/reg/regopt.html#Q1", TARGET="_REGOPT">Add Code or<BR>Faculty Number</A></TH>
200
+ <TH>Credits<BR>(for variable-credit courses)</TH>
201
+ <TH>Check to select<BR><A HREF="http://www.washington.edu/students/gencat/front/Grading_Sys.html", TARGET="_GS">S/NS grading</A></TH>
202
+ <TH>Status</TH>
203
+ </TABLE></p><BR><INPUT TYPE=HIDDEN NAME=maxdrops VALUE=3>
204
+ <INPUT TYPE=HIDDEN NAME=maxadds VALUE=8>
205
+ <INPUT TYPE="submit" VALUE=' Update Schedule 'onClick="return editFormInput()">
206
+ </FORM>
207
+ <br><p>Please <A HREF='http://www.washington.edu/students/ps/feedback.html', TARGET='_FEEDBACK'>let us know</A> if you encounter a problem with this service, or have a suggestion for how it might be improved.</p><span class='noprint'><p><center>
208
+ <table border='0' cellpadding='4' bgcolor='yellow' width='80%'><tr><td>
209
+
210
+ <table border='0' cellpadding='5' cellspacing='0' bgcolor='white' width='100%'><tr>
211
+ <td><img src='/sdb_library/images/caution.gif' width='30' height='30' hspace='10'></td>
212
+ <td>
213
+ To protect your privacy and prevent unauthorized use,
214
+ &nbsp;<a href='http://www.washington.edu/computing/weblogin/logout.html' target='_logout'>close
215
+ <b>ALL</b> of your web browser windows</a>
216
+ and web-enabled applications when you finish.
217
+ </td>
218
+ </tr></table>
219
+
220
+ </td></tr></table>
221
+ </center></p></span>
222
+ <P></P>
223
+ <table border='0' cellpadding='0' cellspacing='0' align='center' width='100%'>
224
+ <tr>
225
+ <td rowspan='2'>
226
+ <a href='http://www.washington.edu/'><img src='/sdb_library/images/footersealW.gif' border='0' height='48' width='48' hspace='5' vspace='7' alt='UW Seal'></a>
227
+ </td>
228
+ <td rowspan='3' bgcolor='#666666' width='5'><img src='/sdb_library/images/1px_transparent.gif' width='7' height='1'></td>
229
+ <td colspan='2' bgcolor='#666666' height='1'><img src='/sdb_library/images/1px_transparent.gif' width='1' height='1'></td>
230
+ </tr><tr>
231
+ <td width='100%'>
232
+ <table border='0' width='100%'>
233
+ <tr>
234
+ <td valign='top'><address>
235
+ Office of the Registrar<br>
236
+ regoff@u.washington.edu<br>
237
+ June 28, 2009
238
+ </address>
239
+ </td>
240
+ </tr>
241
+ </table>
242
+ </td>
243
+ </tr><tr height='1'>
244
+ <td bgcolor='#666666'><img src='/sdb_library/images/1px_transparent.gif' width='1' height='1'></td>
245
+ </tr>
246
+ </table>
247
+ </div>
248
+
249
+ </body>
250
+ </html>
251
+
252
+ <script LANGUAGE="JavaScript">
253
+ <!--
254
+ window.name = "Registration";
255
+ /*************************** CLIENT-SIDE SCRIPTS ******************************/
256
+ /******************************************************************************/
257
+ var timer;
258
+ /******************************************************************************
259
+ * displayTimeRemain
260
+ * This function is initiated with a setInterval in the initPage function.
261
+ * It updates the remaining time displayed on the page in the timeRemain form
262
+ * field.
263
+ ******************************************************************************/
264
+ function displayTimeRemain(iMSecsEnd)
265
+ {
266
+ var elem, iDisplaySecs,iMin, iSec, sMin, sSec, oNoTime, oRemain;
267
+
268
+ var oDate = new Date();
269
+ var iMSecsNow = oDate.getTime();
270
+
271
+ if (document.getElementById){
272
+ if (document.getElementById('txtTimeRemain')){
273
+ elem = document.getElementById('txtTimeRemain');
274
+ }
275
+ }else if (document.all){
276
+ if (document.all['txtTimeRemain']){
277
+ elem = document.all['txtTimeRemain'];
278
+ }
279
+ }else if (document.layers){
280
+ if (document.layers['txtTimeRemain']){
281
+ elem = document.layers['txtTimeRemain'];
282
+ }
283
+ }
284
+
285
+ if (elem){
286
+ iDisplaySecs = Number(iMSecsEnd) - iMSecsNow;
287
+ if (iDisplaySecs > 1000){
288
+ oNoTime = new Date(oDate.setHours(00,00,00));
289
+ oRemain = new Date(oNoTime.setTime(oNoTime.getTime() + iDisplaySecs));
290
+ sMin = " " + String(oRemain.getMinutes());
291
+ iSec = oRemain.getSeconds();
292
+ sSec = String(iSec);
293
+ iSec = oRemain.getSeconds();
294
+ if (iSec < 10){
295
+ sSec = "0" + String(iSec);
296
+ }
297
+ elem.value = sMin + ":" + sSec;
298
+ }else{
299
+ elem.value = "It's time!";
300
+ clearInterval(timer);
301
+ return(false);
302
+ }
303
+ }
304
+ return (true);
305
+ }
306
+
307
+ /******************************************************************************
308
+ * initPage
309
+ * This function handles flipping the divs when 'processing please wait'
310
+ * is displayed and also handles starting the timer when the reject feature is
311
+ * employed. This function is triggered by the onload event of the body of the
312
+ * response.
313
+ ******************************************************************************/
314
+ function initPage()
315
+ {
316
+ var oWait, oDone, elem, timer, sMin, iMin, sSec, iSec, oDate, oNoTime, oRemain;
317
+ if (document.getElementById){
318
+ if (document.getElementById('waitDiv')){
319
+ oWait = document.getElementById('waitDiv').style;
320
+ oDone = document.getElementById('doneDiv').style;
321
+ }
322
+ }else if (document.all){
323
+ if (document.all['waitDiv']){
324
+ oWait = document.all['waitDiv'].style;
325
+ oDone = document.all['doneDiv'].style;
326
+ }
327
+ }else if (document.layers){
328
+ if (document.layers['waitDiv']){
329
+ oWait = document.layers['waitDiv'];
330
+ odone = document.layers['doneDiv'];
331
+ }
332
+ }
333
+
334
+ if (oWait && oDone){
335
+ oWait.visibility = 'hidden';
336
+ oDone.visibility = 'visible';
337
+ }
338
+
339
+ if (document.getElementById){
340
+ if (document.getElementById('txtTimeRemain')){
341
+ elem = document.getElementById('txtTimeRemain');
342
+ }
343
+ }else if (document.all){
344
+ if (document.all['txtTimeRemain']){
345
+ elem = document.all['txtTimeRemain'];
346
+ }
347
+ }else if (document.layers){
348
+ if (document.layers['txtTimeRemain']){
349
+ elem = document.layers['txtTimeRemain'];
350
+ }
351
+ }
352
+ if (elem){
353
+ iMSecsDelay = Number(elem.value) * 60 * 1000;
354
+ oDate = new Date();
355
+ oEndTime = new Date(oDate.setTime(oDate.getTime() + iMSecsDelay));
356
+ iMSecsEnd = oEndTime.getTime();
357
+ oNoTime = new Date(oDate.setHours(00,00,00));
358
+ oRemain = new Date(oNoTime.setTime(oNoTime.getTime() + iMSecsDelay));
359
+ sMin = " " + String(oRemain.getMinutes());
360
+ iSec = oRemain.getSeconds();
361
+ sSec = String(iSec);
362
+ iSec = oRemain.getSeconds();
363
+ if (iSec < 10){
364
+ sSec = "0" + String(iSec);
365
+ }
366
+ elem.value = sMin + ":" + sSec;
367
+
368
+ if (iMSecsEnd > 1000){
369
+ timer = setInterval("displayTimeRemain(iMSecsEnd)",1000);
370
+ }else{
371
+ elem.value = "It's time!";
372
+ }
373
+ }
374
+ return;
375
+ }
376
+ /******************************************************************************
377
+ * checkDelayFormInput
378
+ * This function is triggered by the onClick event of the Submit button.
379
+ ******************************************************************************/
380
+ function checkDelayFormInput()
381
+ {
382
+ var oDate,iTimeNow;
383
+
384
+ if (document.getElementById){
385
+ if (document.getElementById('txtTimeRemain')){
386
+ elem = document.getElementById('txtTimeRemain');
387
+ }
388
+ }else if (document.all){
389
+ if (document.all['txtTimeRemain']){
390
+ elem = document.all['txtTimeRemain'];
391
+ }
392
+ }else if (document.layers){
393
+ if (document.layers['txtTimeRemain']){
394
+ elem = document.layers['txtTimeRemain'];
395
+ }
396
+ }
397
+ if (elem){
398
+ if (isNaN(elem.value.substring(0,1))){
399
+ return(true);
400
+ }
401
+ }
402
+ return (false);
403
+ }
404
+
405
+ /******************************************************************************
406
+ * editFormInput
407
+ * This function is triggered by the onClick event of the Submit button.
408
+ * It will edit the form input for basic valid values and display a
409
+ * warning if the student is attempting to drop all of their classes.
410
+ ******************************************************************************/
411
+ function editFormInput()
412
+ {
413
+ var i, sMsg, sInput;
414
+ var f = document.regform;
415
+ var iMaxDrops = parseInt(f.maxdrops.value);
416
+ var iMaxAdds = parseInt(f.maxadds.value);
417
+ var sDropAll = "Y";
418
+ var sDropAny = "N";
419
+
420
+ sMsg = "";
421
+
422
+ for (i=1; i<=iMaxDrops + iMaxAdds; i++) {
423
+ if ( f["action"+i].value == "D" ) {
424
+ // if checked, dropping something
425
+ if (f["action"+i].checked) {
426
+ sDropAny = "Y";
427
+ }
428
+ // if not checked, not dropping all
429
+ else {
430
+ sDropAll = "N";
431
+ }
432
+ // drop edits: entry code
433
+ sInput = f["entcode"+i].value;
434
+ if ( sInput!="" && (isNaN(sInput) || (!isNaN(sInput) && parseInt(sInput)<10000) ) ) {
435
+ sMsg += "\"" + sInput + "\"" + " is not a valid drop code. "
436
+ + "Please enter the correct 5-digit code.";
437
+ alert(sMsg);
438
+ f["entcode"+i].focus();
439
+ return (false);
440
+ }
441
+ // drop edits: checkbox
442
+ if ( sInput!="" && !f["action"+i].checked ) {
443
+ sMsg += "Please check the drop box if you wish to drop SLN "
444
+ + f["sln"+i].value + ".";
445
+ f["action"+i].focus();
446
+ alert(sMsg);
447
+ return (false);
448
+ }
449
+ }
450
+ else {
451
+ // if an sln is being added or changed, not dropping all
452
+ if (!isNaN(parseInt(f["sln"+i].value))) {
453
+ sDropAll = "N";
454
+ }
455
+ sInput = f["sln"+i].value;
456
+ if ( sInput!="" && (isNaN(sInput) || (!isNaN(sInput) && parseInt(sInput)<1000) ) ) {
457
+ sMsg += "\"" + sInput + "\"" + " is not a valid SLN. "
458
+ + "Please enter the correct Schedule Line Number.";
459
+ f["sln"+i].focus();
460
+ alert(sMsg);
461
+ return (false);
462
+ }
463
+ sInput = f["entcode"+i].value;
464
+ if ( sInput!="" && (isNaN(sInput) || (!isNaN(sInput) && parseInt(sInput)<10000) ) ) {
465
+ sMsg += "\"" + sInput + "\"" + " is not a valid add code or faculty number. "
466
+ + "Please enter the correct 5-digit code.";
467
+ f["entcode"+i].focus();
468
+ alert(sMsg);
469
+ return (false);
470
+ }
471
+ }
472
+ }
473
+
474
+ if ( sDropAll == "Y" && sDropAny == "Y" ) {
475
+ if (iMaxAdds > 0) {
476
+ sMsg = "WARNING: You have requested to drop all of your courses. You will "
477
+ + "be considered withdrawn for the quarter unless you subsequently add "
478
+ + "courses.\n\n"
479
+ + "If this is your intention, click \"OK\". Otherwise click \"Cancel\".";
480
+ }
481
+ else {
482
+ sMsg = "WARNING: You have requested to drop all of your courses and withdraw "
483
+ + "for the quarter. It is past the deadline to add courses.\n\nIf you are "
484
+ + "withdrawing, click \"OK\". Otherwise click \"Cancel\".";
485
+ }
486
+ return (confirm(sMsg));
487
+ }
488
+
489
+ return (true);
490
+ }
491
+
492
+ /******************************************************************************
493
+ * editMMNotice
494
+ * This function is triggered by the onClick event of the MMNotice submit button.
495
+ ******************************************************************************/
496
+ function editMMForm() {
497
+
498
+ var f = document.mmform;
499
+ var sMsg = "You must check the box to acknowledge you have\n"
500
+ + "read the meningococcal meningitis notice before\n"
501
+ + "you may continue with registration. ";
502
+ if (!f["chkMMNotice"].checked){
503
+ alert(sMsg);
504
+ return (false);
505
+ }
506
+
507
+ return (true);
508
+ }
509
+ /******************************************************************************
510
+ * editRIAANotice
511
+ * This function is triggered by the onClick event of the RIAANotice submit button.
512
+ ******************************************************************************/
513
+ function editRIAAForm() {
514
+
515
+ var f = document.riaaform;
516
+ var sMsg = "You must check the box to acknowledge you have read\n"
517
+ + "the File-Sharing and Copyright Infringement Notice\n"
518
+ + " before you may continue with registration. ";
519
+ if (!f["chkRIAANotice"].checked){
520
+ alert(sMsg);
521
+ return (false);
522
+ }
523
+
524
+ return (true);
525
+ }
526
+ /******************************************************************************
527
+ * editCleryNotice
528
+ * This function is triggered by the onClick event of the Clery Notice submit button.
529
+ ******************************************************************************/
530
+ function editCleryForm() {
531
+
532
+ var oElem;
533
+ var sMsg = "You must check the box to acknowledge you have\n"
534
+ + " viewed the Your Safety Your Health notice before\n"
535
+ + " you may continue with registration. ";
536
+
537
+ oElem = document.getElementById('chkCleryNotice');
538
+ if (oElem){
539
+ if (!oElem.checked){
540
+ alert(sMsg);
541
+ return (false);
542
+ }
543
+ }
544
+
545
+ return (true);
546
+ }
547
+
548
+ /******************************************************************************
549
+ * snsWarning
550
+ ******************************************************************************/
551
+ function snsWarning(iSub,iType) {
552
+ var f = document.regform;
553
+ var sMsg = "REMINDER: Undergraduates may only use courses graded with the \n"
554
+ + "S/NS (Satisfactory/Not-Satisfactory) option to meet General Electives.\n"
555
+ + "Graduate students should see their adviser before selecting "
556
+ + "S/NS grading. \n\n"
557
+ + "S/NS is not the same as CREDIT/NO CREDIT. Click on the grading option\n"
558
+ + "link for an explanation of the grade system.\n\n"
559
+ + "One $20 change fee is assessed for any number of change transactions made\n"
560
+ + "during a given day including changes to or from S/NS grading option.\n\n"
561
+ + "Are you sure you want to take this course with the S/NS grading option?\n\n"
562
+ + "NOTE: Your request to change to S/NS grading will not be processed until\n"
563
+ + "you click the \"Update Schedule\" button at the bottom of the page and\n"
564
+ + "you receive the \"Schedule updated\" confirmation message.";
565
+
566
+ if (iType == 1) {
567
+ if ( f["gr_sys"+iSub].checked ) {
568
+ if ( !confirm(sMsg) ){
569
+ f["gr_sys"+iSub].checked = false;
570
+ }
571
+ }
572
+ }
573
+
574
+ if (iType == 2) {
575
+ if ( f["gr_sys_sns"+iSub].checked ) {
576
+ if ( !confirm(sMsg) ){
577
+ f["gr_sys_sns"+iSub].checked = false;
578
+ f["gr_sys_dec"+iSub].checked = true;
579
+ }
580
+ }
581
+ }
582
+ }
583
+ function openWin(sWindowURL,sWindowName,iWidth,iHeight)
584
+ {
585
+ if (iWidth > screen.width) {
586
+ iWidth = screen.width * .99;
587
+ }
588
+ if (iHeight > screen.height) {
589
+ iHeight = screen.height * .99;
590
+ }
591
+
592
+ popupWindow = open
593
+ ( sWindowURL,
594
+ sWindowName,
595
+ "resizable=no"
596
+ + ",scrollbars=yes"
597
+ + ",toolbar=no"
598
+ + ",location=no"
599
+ + ",directories=no"
600
+ + ",status=no"
601
+ + ",menubar=no"
602
+ + ",width=" + iWidth
603
+ + ",height=" + iHeight
604
+ //+ ",top="+((screen.height-screen.height))
605
+ //+ ",left="+((screen.width-screen.width))
606
+ );
607
+ }
608
+
609
+
610
+ //-->
611
+ </script>
612
+ <noscript>
613
+ <div id="__Div" class="waitClass">
614
+ <p><br>&nbsp;<br>
615
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
616
+ <tr><td align="center" valign="middle">
617
+ <table width="100%" border="3" bordercolor="#e90000" cellpadding="20">
618
+ <tr>
619
+ <td align="center" bgcolor="#ffffff">
620
+ <h3><br><i>The Registration service requires that you enable JavaScript in your web browser. Please enable JavaScript and try again. For information on how to enable Javascript, see <a href=http://www.washington.edu/computing/web/cookiesjavascript.html>Accepting Cookies and Enabling Javascript.</a></i>
621
+ </h3>
622
+ </td>
623
+ </tr>
624
+ </table>
625
+ </td></tr></table></p>
626
+ </div>
627
+ </noscript>