context: function makePreview(item){  var theBundle = document.getElementById("pageinfobundle");  var unknown = theBundle.getString("unknown");  var notSet = theBundle.getString("notset");  var url = ("src" in item && item.src) || ("code" in item && item.code) || ("data" in item && item.data) || ("href" in item && item.href) || unknown;  // it better have at least one of those...  document.getElementById("imageurltext").value = url;  document.getElementById("imagetitletext").value = item.title || notSet;  document.getElementById("imagealttext").value = ("alt" in item && item.alt) || getValueText(item) || notSet;  document.getElementById("imagelongdesctext").value = ("longDesc" in item && item.longDesc) || notSet;  // find out the mime type  var mimeType = unknown;  if (item.nodeName.toLowerCase() != "input")    mimeType = ("type" in item && item.type) || ("codeType" in item && item.codeType) || ("contentType" in item && item.contentType) || unknown;  document.getElementById("imagetypetext").value = mimeType;  // get cache info  var sourceText = theBundle.getString("generalNotCached");  var expirationText = theBundle.getString("unknown");  var sizeText = theBundle.getString("unknown");  var expirationTime = 0;  var expirationDate = null;  try  {    var cacheEntryDescriptor = httpCacheSession.openCacheEntry(url, Components.interfaces.nsICache.ACCESS_READ, true);   // open for READ, in blocking mode    if (cacheEntryDescriptor)    {      switch(cacheEntryDescriptor.deviceID)      {        case "disk":          sourceText = theBundle.getString("generalDiskCache");          break;        case "memory":          sourceText = theBundle.getString("generalMemoryCache");          break;        default:          sourceText = cacheEntryDescriptor.deviceID;          break;      }      sizeText = cacheEntryDescriptor.dataSize;      expirationText = formatDate(cacheEntryDescriptor.expirationTime*1000, notSet);    }  }  catch(ex)  {    try    {      cacheEntryDescriptor = ftpCacheSession.openCacheEntry(url, Components.interfaces.nsICache.ACCESS_READ, true);   // open for READ, in blocking mode      if (cacheEntryDescriptor)      {        switch(cacheEntryDescriptor.deviceID)        {          case "disk":            sourceText = theBundle.getString("generalDiskCache");            break;          case "memory":            sourceText = theBundle.getString("generalMemoryCache");            break;          default:            sourceText = cacheEntryDescriptor.deviceID;            break;        }        sizeText = cacheEntryDescriptor.dataSize;        expirationText = formatDate(cacheEntryDescriptor.expirationTime*1000, notSet);      }    }    catch(ex2)    {      sourceText = theBundle.getString("generalNotCached");    }  }  document.getElementById("imagesourcetext").value = sourceText;  document.getElementById("imageexpirestext").value = expirationText;  document.getElementById("imagesizetext").value = sizeText;  // perhaps these can be done in the future  //document.getElementById("imageplugintext").value = "--";  //document.getElementById("imagecharsettext").value = "--";  var width = ("width" in item && item.width) || "";  var height = ("height" in item && item.height) || "";  document.getElementById("imagewidth").value = theBundle.getFormattedString("mediaWidth", [width]);  document.getElementById("imageheight").value = theBundle.getFormattedString("mediaHeight", [height]);  // also can't be done at the moment  //document.getElementById("imageencryptiontext").value = "--";  var imageContainer = document.getElementById("theimagecontainer");  var oldImage = document.getElementById("thepreviewimage");  var newImage = null;  var nn = item.nodeName.toLowerCase();  if (nn == "link" || nn == "input")  {    newImage = new Image();    newImage.src = getAbsoluteURL(getSource(item), item);  }  else  {    newImage = item.cloneNode(true);    newImage.src = ("src" in item && item.src) || ("href" in item && item.href);  // weird funky hack, I know :P  }  newImage.setAttribute("id", "thepreviewimage");  if ("width" in item && item.width)    newImage.width = item.width;  if ("height" in item && item.height)    newImage.height = item.height;  newImage.removeAttribute("align"); // just in case.  imageContainer.removeChild(oldImage);  imageContainer.appendChild(newImage);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/02f44b61445ce9590dda571316e928face8c0082/pageInfo.js/clean/suite/browser/pageInfo.js