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

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <HTML>
  6. <HEAD>
  7.     <TITLE></TITLE>
  8.  
  9.     <SCRIPT LANGUAGE="JavaScript">
  10.         function chgStatus(indexnum){
  11.             parent.head.document.hiddenform.index.value=indexnum
  12.             <% if Session("Browser") = "IE3" then %>        
  13.                 self.location.href="iimimels.asp#here";
  14.             <% else %>
  15.                 self.location.href="iimimels.asp";            
  16.             <% end if %>            
  17.         }
  18.         
  19.  
  20.     function SetUpdated(){
  21.         //check to see if our event was triggered by a delete. if so, we don't
  22.         //want to set the cached object values, or we'll be overwriting 
  23.         //the wrong item.
  24.  
  25.         if (parent.head.listFunc.noupdate){
  26.             parent.head.listFunc.noupdate = false;
  27.         }
  28.         else{
  29.             i = parent.head.document.hiddenform.index.value
  30.             if (i > -1){
  31.                 parent.head.cachedList[i].app = document.listform.app.value;
  32.                 parent.head.cachedList[i].ext = document.listform.editMe.value;
  33.                 parent.head.cachedList[i].updated = true;
  34.                 top.title.Global.updated="true";
  35.             }
  36.         }
  37.     }
  38.     
  39.     function crop(thestring,size)
  40.         {
  41.         <% if Session("FONTSIZE") = "LARGE" then %>
  42.             size = size-10;
  43.         <% end if %>
  44.         sLen = thestring.length
  45.         if (sLen > size)
  46.             {
  47.             thestring = thestring.substring(0,size) + "...";
  48.             }
  49.         else{
  50.             for (var i = sLen ; i < size; i++) {
  51.                 thestring = thestring + " "
  52.             }            
  53.         }
  54.         return thestring;
  55.     }
  56.  
  57.     function displayVal(dispstr, altstr){
  58.             if (dispstr == ""){
  59.                 dispstr = altstr;
  60.             }
  61.             return dispstr;
  62.     }
  63.         
  64.     function writeCol(colspan,w,str){
  65.                 var writestr = "<TD";
  66.                 if (colspan != ""){
  67.                     writestr += " COLSPAN = " + colspan
  68.                 }
  69.                 if (w != ""){
  70.                     writestr += " WIDTH = " + w;
  71.                 }
  72.                 <% if Session("IsIE") then %>
  73.                 writestr += " STYLE = 'font-face: Helv; font-size: 8pt;'";
  74.                 <% end if %>                        
  75.                 writestr += "><FONT SIZE = 1 FACE = 'Helv'>" + str + "</FONT></TD>";    
  76.                 return writestr;    
  77.     }            
  78.     
  79.  
  80.     </SCRIPT>
  81. </HEAD>
  82.  
  83. <BODY BGCOLOR="#FFFFFF" LEFTMARGIN=0 TOPMARGIN=0>
  84.  
  85. <FORM NAME="listform">
  86. <SCRIPT LANGUAGE="JavaScript">
  87.     editOK=false;
  88.     sel=eval(parent.head.document.hiddenform.index.value);
  89.     var writestr = "<TABLE BORDER=0 CELLPADDING = 2 CELLSPACING = 0>"    
  90.     for (var i=0;i < parent.head.cachedList.length; i++) {
  91.         if (!parent.head.cachedList[i].deleted){
  92.             if (sel!=i) {
  93.                 writestr += "<TR>";
  94.                 if (i+4 == sel)
  95.                 {            
  96.                     writestr += writeCol(1,85,"<A NAME='here'></A><A HREF='javascript:chgStatus("+i+");'>" + crop(parent.head.cachedList[i].ext,20) + "</A>");                
  97.                 }
  98.                 else
  99.                 {
  100.                     writestr += writeCol(1,85,"<A HREF='javascript:chgStatus("+i+");'>" + crop(parent.head.cachedList[i].ext,20) + "</A>");                
  101.                 }
  102.                 writestr += writeCol(1,167,parent.head.cachedList[i].app);                                                    
  103.                 writestr += "</TR>";
  104.             }
  105.             else{    
  106.                 editOK=true;                
  107.                 writestr += "<TR BGCOLOR=#DDDDDD>";                
  108.                 writestr += writeCol(1,85,"<INPUT NAME='editMe' SIZE = 10 VALUE='" + parent.head.cachedList[i].ext + "' onBlur='SetUpdated();'>");                
  109.                 writestr += writeCol(1,167,"<INPUT NAME='app' SIZE = 20 VALUE='" + parent.head.cachedList[i].app + "' onBlur='SetUpdated();'>");                                                    
  110.                 writestr += "</TR>";
  111.             }
  112.         }
  113.     }
  114.     
  115.     writestr += "</TABLE>";
  116.     document.write(writestr);        
  117.     
  118. </SCRIPT>
  119.  
  120. </FORM>
  121. <SCRIPT LANGUAGE="JavaScript">
  122. <% if Session("isAdmin") then %>
  123.     if (editOK){
  124.     document.listform.editMe.focus();
  125.     }
  126. <% end if %>
  127. </SCRIPT>
  128. </BODY>
  129. </HTML>
  130.