context: function CCKWriteInstallRDF(destdir){  var idline =          "<em:id>%id%</em:id>";  var nameline =        "<em:name>%name%</em:name>";  var versionline =     "<em:version>%version%</em:version>";  var descriptionline = "<em:description>%description%</em:description>";  var creatorline =     "<em:creator>%creator%</em:creator>";  var homepageURLline = "<em:homepageURL>%homepageURL%</em:homepageURL>";  var updateURLline =   "<em:updateURL>%updateURL%</em:updateURL>";    var iconURLline =     "<em:iconURL>chrome://cck/content/%iconURL%</em:iconURL>";  var file = destdir.clone();  file.append("install.rdf");  try {    file.remove(false);                           } catch (ex) {  }  var fos = Components.classes["@mozilla.org/network/file-output-stream;1"]                       .createInstance(Components.interfaces.nsIFileOutputStream);  fos.init(file, -1, -1, false);  var ioService=Components.classes["@mozilla.org/network/io-service;1"]    .getService(Components.interfaces.nsIIOService);  var scriptableStream=Components    .classes["@mozilla.org/scriptableinputstream;1"]    .getService(Components.interfaces.nsIScriptableInputStream);  var channel=ioService.newChannel("chrome://cckwizard/content/srcfiles/install.rdf.in",null,null);  var input=channel.open();  scriptableStream.init(input);  var str=scriptableStream.read(input.available());  scriptableStream.close();  input.close();    var id = document.getElementById("id").value;  if (id && (id.length > 0)) {    str = str.replace(/%idline%/g, idline);    str = str.replace(/%id%/g, document.getElementById("id").value);  }  var name = document.getElementById("name").value;  if (name && (name.length > 0)) {    str = str.replace(/%nameline%/g, nameline);    str = str.replace(/%name%/g, document.getElementById("name").value);  } else {    str = str.replace(/%nameline%/g, "");  }  var version = document.getElementById("version").value;  if (version && (version.length > 0)) {    str = str.replace(/%versionline%/g, versionline);    str = str.replace(/%version%/g, document.getElementById("version").value);  } else {    str = str.replace(/%versionline%/g, "");  }  var description = document.getElementById("description").value;  if (description && (description.length > 0)) {    str = str.replace(/%descriptionline%/g, descriptionline);    str = str.replace(/%description%/g, document.getElementById("description").value);  } else {    str = str.replace(/%descrptionline%/g, "");  }  var creator = document.getElementById("creator").value;  if (creator && (creator.length > 0)) {    str = str.replace(/%creatorline%/g, creatorline);    str = str.replace(/%creator%/g, document.getElementById("creator").value);  } else {    str = str.replace(/%creatorline%/g, "");  }  var homepageURL = document.getElementById("homepageURL").value;  if (homepageURL && (homepageURL.length > 0)) {    str = str.replace(/%homepageURLline%/g, homepageURLline);    str = str.replace(/%homepageURL%/g, document.getElementById("homepageURL").value);  } else {    str = str.replace(/%homepageURLline%/g, "");  }  var updateURL = document.getElementById("updateURL").value;  if (updateURL && (updateURL.length > 0)) {    str = str.replace(/%updateURLline%/g, updateURLline);    str = str.replace(/%updateURL%/g, document.getElementById("updateURL").value);  } else {    str = str.replace(/%updateURLline%/g, "");  }  var iconURL = document.getElementById("iconURL").value;  if (iconURL && (iconURL.length > 0)) {    var sourcefile = Components.classes["@mozilla.org/file/local;1"]                               .createInstance(Components.interfaces.nsILocalFile);    sourcefile.initWithPath(iconURL);    str = str.replace(/%iconURLline%/g, iconURLline);    str = str.replace(/%iconURL%/g, sourcefile.leafName);  } else {    str = str.replace(/%iconURLline%/g, "");  }  fos.write(str, str.length);   fos.close();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/0ae1504f9fb67ee9d8c8239c57056d63efb99b17/cckwizard.js/buggy/extensions/cck/browser/resources/content/cckwizard/cckwizard.js