home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iifiltls.asp < prev    next >
Text File  |  1997-11-12  |  4KB  |  134 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% 
  6. Const L_ENTERVALUE_ERRORMESSAGE="Please enter a value."
  7. Const L_LOADED_TEXT = "Loaded"
  8. Const L_UNLOADED_TEXT = "Unloaded"
  9. Const L_DISABLED_TEXT = "Disabled"
  10. Const L_LOW_TEXT = "Low"
  11. Const L_MEDIUM_TEXT = "Medium"
  12. Const L_HIGH_TEXT = "High"
  13. Const L_BROWSE_TEXT = "Browse"
  14. %>
  15.  
  16. <HTML>
  17. <HEAD>
  18.     <TITLE></TITLE>
  19.     <SCRIPT LANGUAGE = "JavaScript">
  20.         function SetUpdated(){
  21.             i = parent.head.listFunc.sel;
  22.             if (i > -1)
  23.             {
  24.             parent.head.cachedList[i].filter = document.listform.editMe.value;
  25.             parent.head.cachedList[i].status = "<%= L_LOADED_TEXT  %>";
  26.             parent.head.cachedList[i].filterpath = document.listform.filterpath.value;
  27.             parent.head.cachedList[i].displayexe = parent.head.cachedList[i].crop(document.listform.filterpath.value,35);
  28.             parent.head.cachedList[i].updated = true;
  29.             }
  30.         }
  31.  
  32.  
  33.         function chgStatus(indexnum){
  34.             parent.head.listFunc.sel=indexnum
  35.             self.location.href = "iifiltls.asp";
  36.         }
  37.         
  38.         function chkPath(pathCntrl){
  39.             if (pathCntrl.value != ""){
  40.                 top.connect.location.href = "iichkpath.asp?path=" + escape(pathCntrl.value) + "&ptype=1";            
  41.             }
  42.         }        
  43.         
  44.         function pathBrowser(){
  45.             JSBrowser=new BrowserObj(document.listform.filterpath,POP,TFILE,<%= Session("FONTSIZE") %>);
  46.         }
  47.  
  48.         function displayVal(dispstr, altstr){
  49.             if (dispstr == ""){
  50.                 dispstr = altstr;
  51.             }
  52.             return dispstr;
  53.         }
  54.         
  55.         function writeCol(colspan,w,str){
  56.                 var writestr = "<TD";
  57.                 if (colspan != ""){
  58.                     writestr += " COLSPAN = " + colspan
  59.                 }
  60.                 if (w != ""){
  61.                     writestr += " WIDTH = " + w;
  62.                 }        
  63.                 <% if Session("IsIE") then %>
  64.                 writestr += " STYLE = 'font-face: Helv; font-size: 8pt;'";
  65.                 <% end if %>                
  66.                 writestr += "><FONT SIZE = 1 FACE = 'Helv,ARIAL'>" + str + "</FONT></TD>";
  67.         
  68.                 return writestr;    
  69.         }
  70.  
  71.     </SCRIPT>
  72.     <% if Session("canBrowse") then %>
  73.     <SCRIPT SRC="JSBrowser/JSBrowser.js">
  74.     </SCRIPT>
  75.     <% end if %>
  76. </HEAD>
  77.  
  78. <BODY BGCOLOR="FFFFFF" LEFTMARGIN = 0 TOPMARGIN = 0>
  79.  
  80. <FORM NAME="listform">
  81.  
  82.  
  83.  
  84. <SCRIPT LANGUAGE="JavaScript">
  85.     editOK = false;
  86.     sel = eval(parent.head.listFunc.sel);
  87.     var writestr = "<TABLE BORDER=0 CELLPADDING = 2 CELLSPACING = 0>"        
  88.     for (var i = 0; i < parent.head.cachedList.length; i++) {
  89.         if (!parent.head.cachedList[i].deleted){
  90.             <% if Session("IsAdmin") then %>
  91.                 if (sel != i) {
  92.             <% else %>
  93.                 if (true){        
  94.             <% end if %>
  95.                 writestr += "<TR>"
  96.                 writestr += writeCol(1,40,parent.head.cachedList[i].displaystatus);
  97.                 writestr += writeCol(1,55,displayVal(parent.head.cachedList[i].priority," "));
  98.                 writestr += writeCol(1,100,"<A HREF='javascript:chgStatus("+i+");'>"+parent.head.cachedList[i].filter +"</A>");                    
  99.                 writestr += writeCol(1,225,parent.head.cachedList[i].displayexe);
  100.                 writestr += "</TR>";
  101.             }
  102.             else {
  103.                 editOK = true;                
  104.                 writestr += "<TR BGCOLOR=#DDDDDD>"
  105.                 writestr += writeCol(1,40,parent.head.cachedList[i].displaystatus);
  106.                 writestr += writeCol(1,55,displayVal(parent.head.cachedList[i].priority," "));
  107.                 writestr += writeCol(1,100,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].filter +"' SIZE=10 onBlur='SetUpdated();'>");                    
  108.                 writestr += writeCol(1,225,"<INPUT TYPE='text' NAME='filterpath' VALUE='"+parent.head.cachedList[i].filterpath +"' SIZE = 25 onBlur='chkPath(this);SetUpdated();'>  <% if Session("canBrowse") then %><A HREF='javascript:pathBrowser();'><IMG ALIGN=middle SRC='images/browse.gif' BORDER=0></A><% end if %>");
  109.                 
  110.                 writestr += "</TR>";
  111.  
  112.             }
  113.         }
  114.     }
  115.     writestr += "</TABLE>";
  116.     document.write(writestr);
  117.  
  118. </SCRIPT>
  119. </TABLE>
  120.  
  121. </FORM>
  122. <% if Session("IsAdmin") then %>
  123. <SCRIPT LANGUAGE="JavaScript">
  124.  
  125.     if (editOK){
  126.     document.listform.editMe.focus();
  127.     document.listform.editMe.select();
  128.     }
  129.  
  130. </SCRIPT>
  131. <% end if %>
  132. </BODY>
  133. </HTML>
  134.