Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

391 lines
9.9 KiB

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4. <!--#include file="iirtels.str"-->
  5. <!--#include file="iisetfnt.inc"-->
  6. <!--#include file="iiset.inc"-->
  7. <%
  8. ' Do not use top.title.Global.update flag if page is loaded into a dialog
  9. bUpdateGlobal = false
  10. %>
  11. <!--#include file="calendar.str"-->
  12. <!--#include file="date.str"-->
  13. <%
  14. Dim level
  15. level = Request.QueryString("level")
  16. if (level = "") then
  17. level = 0
  18. end if
  19. function writeSlider(prop, stops, width, selnum)
  20. dim slidestr, i
  21. slidestr="<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  22. for i=0 to stops-2
  23. slidestr=slidestr & drawStop(i,prop, selnum)
  24. slidestr=slidestr & "<IMG SRC='images/slidersp.gif' WIDTH=" & width & " HEIGHT=26 BORDER=0>"
  25. Next
  26. slidestr=slidestr & drawStop(i, prop, selnum)
  27. slidestr=slidestr & "<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  28. writeSlider=slidestr
  29. end function
  30. function drawStop(curr,prop, selnum)
  31. dim thisname, slidestr,formname
  32. thisname=quote & prop & curr & quote
  33. if Session("IsIE") then
  34. formname = "parent.document.userform."
  35. else
  36. formname = "document.userform."
  37. end if
  38. slidestr="<A HREF='javascript:moveSlider(" & formname & prop & ", " & quote & prop & quote & "," & curr & ")'>"
  39. if cInt(curr)=cInt(selnum) then
  40. drawStop=slidestr & "<IMG NAME=" & thisname & " SRC='images/slideron.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  41. else
  42. drawStop=slidestr & "<IMG NAME=" & thisname & " SRC='images/slideroff.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  43. end if
  44. end function
  45. %>
  46. <!--#include file="date.inc"-->
  47. <HTML>
  48. <HEAD>
  49. <TITLE></TITLE>
  50. <SCRIPT LANGUAGE="JavaScript">
  51. <% if not Session("IsIE") then %>
  52. slideron=new Image(11,26);
  53. slideron.src="images/slideron.gif";
  54. slideroff=new Image(11,26);
  55. slideroff.src="images/slideroff.gif";
  56. lastslide="hdnPics<%= level %>";
  57. <% end if %>
  58. theList = parent.head.cachedList;
  59. uform = document.userform;
  60. headform = parent.head.document.hiddenform;
  61. var dateFormatter = new UIDateFormat( <%= DATEFORMAT_LONG %> );
  62. function moveSlider(control,prop,num){
  63. top.title.Global.updated=true;
  64. <% if Session("IsIE") then %>
  65. slideurl="iislider.asp?selnum="+num+"&stops=5&width=80&prop="+prop;
  66. control.value=num;
  67. document.Slider.location.href=slideurl;
  68. <% else %>
  69. turnSlideOff(lastslide);
  70. lastslide=prop+num;
  71. thisprop=prop+num;
  72. document [thisprop].src=slideron.src;
  73. control.value=num;
  74. <% end if %>
  75. setLevel(num);
  76. }
  77. function turnSlideOff(prop){
  78. document [prop].src=slideroff.src;
  79. }
  80. function setLevel(num){
  81. setRatingString(num);
  82. theList[headform.index.value].sel = num;
  83. setUpdated();
  84. showLevel();
  85. }
  86. function showLevel(){
  87. uform = document.userform;
  88. uform.level.value = theList[headform.index.value].level[uform.hdnPics.value];
  89. }
  90. function setRatingString(num){
  91. ratings = "r (";
  92. for (i=0;i<theList.length;i++){
  93. ratings += theList[i].key + " " + theList[i].sel;
  94. }
  95. ratings += ")";
  96. }
  97. function padGMToffset(iOffset)
  98. {
  99. var strOffset =Math.abs(iOffset).toString();
  100. var iOffsetLen = strOffset.length;
  101. switch(iOffsetLen)
  102. {
  103. case 1:
  104. strOffset = "000" + strOffset;
  105. break;
  106. case 2:
  107. strOffset = "00" + strOffset;
  108. break;
  109. case 3:
  110. strOffset = "0" + strOffset;
  111. break;
  112. default:
  113. strOffset = "0000";
  114. }
  115. return strOffset;
  116. }
  117. function setUpdated()
  118. {
  119. //parent.head.listFunc.seton = ""
  120. parent.head.document.cacheform.chkEnableRatings.checked = true;
  121. uform = document.userform;
  122. dateObj=parseUIDate(uform.hdnExpiresDateNeutral);
  123. setExpiresDateCtrl( dateObj );
  124. var yyyy=fullYear(dateObj.getYear());
  125. var mo=rpad(2,"0",dateObj.getMonth()+1);
  126. var dd=rpad(2,"0",dateObj.getDate());
  127. var hh=rpad(2,"0",dateObj.getHours());
  128. var mm=rpad(2,"0",dateObj.getMinutes());
  129. var tzdiff= 100*dateObj.getTimezoneOffset()/60;
  130. var strTzdiff = padGMToffset(tzdiff);
  131. if( tzdiff < 0) //getTimezoneOffset is backwards ie EST is positive
  132. parent.head.listFunc.expon =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"+"+strTzdiff;
  133. else
  134. parent.head.listFunc.expon =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"-"+strTzdiff;
  135. dateObj=new Date();
  136. yyyy=fullYear(dateObj.getYear());
  137. mo=rpad(2,"0",dateObj.getMonth()+1);
  138. dd=rpad(2,"0",dateObj.getDate());
  139. hh=rpad(2,"0",dateObj.getHours());
  140. mm=rpad(2,"0",dateObj.getMinutes());
  141. if( tzdiff < 0) //getTimezoneOffset is backwards ie EST is positive
  142. parent.head.listFunc.seton =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"+"+strTzdiff;
  143. else
  144. parent.head.listFunc.seton =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"-"+strTzdiff;
  145. parent.head.listFunc.email = uform.email.value;
  146. }
  147. function rpad(len,padchr,str)
  148. {
  149. str = str.toString();
  150. if (str.length < len){
  151. str = padchr + str;
  152. }
  153. return str;
  154. }
  155. function fullYear(yearStr)
  156. {
  157. if (yearStr < 1000){
  158. yearStr += 1900;
  159. }
  160. return parseInt(yearStr);
  161. }
  162. function replaceStr(fullStr,oldStr,newStr)
  163. {
  164. newFullStr = fullStr;
  165. if (fullStr.indexOf(oldStr) != 0)
  166. {
  167. newFullStr = fullStr.substring(0,fullStr.indexOf(oldStr));
  168. newFullStr += newStr;
  169. newFullStr += fullStr.substring(fullStr.indexOf(oldStr)+(oldStr.length),fullStr.length);
  170. }
  171. return newFullStr;
  172. }
  173. function parseUIDate(dateCntrl)
  174. {
  175. newDate = new Date();
  176. if (dateCntrl.value != "")
  177. {
  178. // Use neutral date format
  179. datestr = dateCntrl.value;
  180. dateParts = datestr.split( "/" );
  181. newDate.setYear( parseInt(dateParts[2]) );
  182. newDate.setMonth( parseInt(dateParts[0]) - 1 );
  183. newDate.setDate( parseInt(dateParts[1]) );
  184. }
  185. return newDate;
  186. }
  187. function parseRatingsDate(dateStr, bExpiresOn)
  188. {
  189. dateObj = new Date();
  190. if( dateStr != "")
  191. {
  192. dateStr = replaceStr(dateStr,"T",".");
  193. dateStr = replaceStr(dateStr,"-",".");
  194. dateStr = replaceStr(dateStr,":",".");
  195. dateArray = dateStr.split(".");
  196. if (dateArray[0] != "")
  197. {
  198. dateObj.setYear(dateArray[0]);
  199. dateObj.setMonth(dateArray[1]-1);
  200. dateObj.setDate(dateArray[2]);
  201. }
  202. }
  203. else if( bExpiresOn )
  204. {
  205. // We want expires on to default to a year from now if
  206. // it isn't set.
  207. var nextYear = parseInt(fullYear(dateObj.getYear())) + 1;
  208. dateObj.setYear( nextYear );
  209. }
  210. return dateObj;
  211. }
  212. function setDateCntrl(dateCntrl,dateObj)
  213. {
  214. datestr = dateFormatter.getDate( dateObj );
  215. dateCntrl.value = datestr;
  216. }
  217. function setExpiresDateCtrl( dateObj )
  218. {
  219. document.userform.hdnExpiresDateNeutral.value = getNeutralDateString( dateObj );
  220. setDateCntrl( document.userform.hdnExpiresDate, dateObj );
  221. }
  222. function setCntrl(cntrl,thisval)
  223. {
  224. cntrl.value = thisval;
  225. }
  226. function popCalendar(cntrlname, blurctrlname, someDate)
  227. {
  228. // Called with neutral date string
  229. if (someDate == "")
  230. {
  231. newdate = new Date();
  232. someDate = getNeutralDateString(newdate);
  233. }
  234. var dateParts = someDate.split( "/" );
  235. width = <%= iHScale(L_CALENDAR_W) %>;
  236. height = <%= iVScale(L_CALENDAR_H) %>;
  237. dsize = "width=" + width +",height=" + height;
  238. thefile="calendar.asp?cntrl="+cntrlname + "&Mo=" + dateParts[0] + "&Dy=" + dateParts[1] + "&Yr=" + dateParts[2] + "&blurcntrl=" + blurctrlname;
  239. popbox=window.open(thefile,"Calendar","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no," + dsize);
  240. if(popbox != null)
  241. {
  242. if (popbox.opener==null)
  243. {
  244. popbox.opener=self;
  245. }
  246. }
  247. }
  248. </SCRIPT>
  249. </HEAD>
  250. <BODY BGCOLOR="<%= Session("BGCOLOR") %>" TOPMARGIN=10 TEXT="#000000" LINK="#FFFFFF" OnLoad="showLevel();">
  251. <TABLE>
  252. <TR>
  253. <TD><%= sFont("","","",True) %>
  254. <TABLE>
  255. <TR>
  256. <TD>
  257. <%= sFont("","","",True) %>
  258. <%= L_RATINGS_TEXT %>
  259. </FONT>
  260. </TD>
  261. <TD>
  262. <% if Session("IsIE") then %>
  263. <IFRAME NAME="Slider" HEIGHT=<%= L_SLIDERFRM_H %> FRAMEBORDER=0 WIDTH=<%= L_SLIDERFRM_W %> SRC="iislider.asp?stops=5&width=80&prop=hdnPics&selnum=<%= level %>">
  264. </IFRAME>
  265. <% else %>
  266. <%= writeSlider("hdnPics", 5, L_SLIDERSTEPSIZE_NUM, level) %>
  267. <% end if %>
  268. </TD>
  269. </TR>
  270. </TABLE>
  271. </FONT>
  272. </TD>
  273. </TR>
  274. </TABLE>
  275. <FORM NAME="userform">
  276. <TABLE WIDTH = 100%>
  277. <TR>
  278. <TD><%= sFont("","","",True) %>
  279. <%= L_RATING_TEXT %>:&nbsp;&nbsp;<INPUT READONLY TYPE="text" SIZE = <%= L_RATING_NUM %> NAME="level" VALUE="" <%= Session("DEFINPUTSTYLE") %>>
  280. <INPUT TYPE="hidden" NAME="hdnPics" VALUE="<%= level %>">
  281. <INPUT TYPE="hidden" NAME="HttpPics">
  282. </TD>
  283. </TR>
  284. </TABLE>
  285. <P>
  286. <TABLE WIDTH = 100%>
  287. <TR>
  288. <TD>
  289. <%= sFont("","","",True) %>
  290. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  291. <%= L_OPTIONAL_TEXT %>
  292. <IMG SRC="images/hr.gif" WIDTH=<%= L_OPTIONAL_NUM %> HEIGHT=2 BORDER=0 ALIGN="middle">
  293. <P>
  294. <%= L_EMAIL_TEXT %>
  295. <%= inputbox(0,"text","email","",L_EMAIL_NUM,"","","setUpdated();",False,False,False) %>
  296. </FONT>
  297. <TABLE>
  298. <TR>
  299. <TD>
  300. <%= sFont("","","",True) %>
  301. <%= L_EXPIRES_TEXT %>
  302. </FONT>
  303. </TD>
  304. <TD>
  305. <%= inputbox(0,"text","hdnExpiresDate","",L_EXPIRES_NUM,"","","setUpdated();",false,false,true)%>
  306. <INPUT TYPE="hidden" NAME="hdnExpiresDateNeutral" VALUE="" >
  307. &nbsp;
  308. <INPUT TYPE="button" VALUE="..." OnClick="popCalendar('document.userform.hdnExpiresDateNeutral', 'document.userform.hdnExpiresDate', document.userform.hdnExpiresDateNeutral.value );">
  309. </TD>
  310. </TR>
  311. <TR>
  312. <TD>
  313. <%= sFont("","","",True) %>
  314. <%= L_MODIFIED_TEXT %>
  315. </FONT>
  316. </TD>
  317. <TD>
  318. <%= sFont("","","",True) %>
  319. <%= inputbox(0,"text","hdnModifiedDate","",L_MODIFIED_NUM,"","","",false,false,true)%>
  320. </FONT>
  321. </TD>
  322. </TR>
  323. </TABLE>
  324. </TD>
  325. </TR>
  326. </TABLE>
  327. </FORM>
  328. <SCRIPT language="JavaScript">
  329. setCntrl(document.userform.email,parent.head.listFunc.email);
  330. setExpiresDateCtrl( parseRatingsDate(parent.head.listFunc.expon, true) );
  331. setDateCntrl(document.userform.hdnModifiedDate,parseRatingsDate(parent.head.listFunc.seton, false));
  332. </SCRIPT>
  333. </BODY>
  334. </HTML>