<commit_before>var dNdVisible 	= false;
var dNdLoaded	= false;
function showHideDragDrop(targetURL1, message1, properties, targetURL2, message2, max_upload, pathJreInstaller, expandLabel, collapseLabel)
{
  var actionDND = document.getElementById("dNdActionLabel");
	
  if (dNdVisible)
  {
    //hide applet
    hideApplet('DragAndDrop');
    hideApplet('DragAndDropDraft');

    //change link's label
    actionDND.innerHTML = expandLabel;
  }
  else
  {
    actionDND.innerHTML = collapseLabel;
		
    if (dNdLoaded)
    {
      showApplet('DragAndDrop');
      showApplet('DragAndDropDraft');
    }
    else
    {
      try {
        loadApplet('DragAndDrop', targetURL1, message1, properties, max_upload, pathJreInstaller);
      } catch (e) {
      }
      try {
        loadApplet('DragAndDropDraft', targetURL2, message2, properties, max_upload, pathJreInstaller);
      } catch (e) {
      }
      dNdLoaded = true;
    }
  }
  dNdVisible = !dNdVisible;
}

function hideApplet(divId)
{
  try
  {
    var appletObj = document.getElementById("applet"+divId);
    appletObj.setAttribute("height", "1");
  } catch (e) {
  }
}

function showApplet(divId)
{
  try
  {
    var appletObj = document.getElementById("applet"+divId);
    appletObj.setAttribute("height", "70");
  } catch (e) {
  }
}

function reloadApplets()
{
  $("#appletDragAndDrop").remove();
  $("#appletDragAndDropDraft").remove();
  dNdLoaded = false;
  dNdVisible = false;
}

function loadApplet(divId, targetURL, message, properties, max_upload, pathJreInstaller)
{
  var divDND = document.getElementById(divId);
	
  var _info = navigator.userAgent;
  var ie = (_info.indexOf("MSIE") > 0);
  var win = (_info.indexOf("Win") > 0);

  var objectDND;
  if (win)
  {
    objectDND = document.createElement("object");

    if (!ie)
    {
      objectDND.setAttribute("id", "applet"+divId);
      objectDND.setAttribute("width", "100%");
      objectDND.setAttribute("height", "70");
      objectDND.setAttribute("type", "application/x-java-applet;version=1.4.1");
    }
   		
    addParam(objectDND, "archive", "wjhk.jupload.jar,jakarta-commons-net.jar");
    addParam(objectDND, "code", "wjhk.jupload2.JUploadApplet");
    addParam(objectDND, "name", "Silverpeas Drag And Drop");
    addParam(objectDND, "codebase","http://localhost:8000/weblib/upload/")
  }
  else
  {
    /* mac and linux */
    objectDND = document.createElement("applet");
   		
    objectDND.setAttribute("id", "applet"+divId);
    objectDND.setAttribute("width", "100%");
    objectDND.setAttribute("height", "70");
    objectDND.setAttribute("codebase", "http://localhost:8000/weblib/upload/");
    objectDND.setAttribute("archive", "wjhk.jupload.jar,jakarta-commons-net.jar");
    objectDND.setAttribute("code", "wjhk.jupload2.JUploadApplet");
    objectDND.setAttribute("name", "Silverpeas Drag And Drop");
    objectDND.setAttribute("hspace", "0");
    objectDND.setAttribute("vspace", "0");
    objectDND.setAttribute("MAYSCRIPT", "yes");
    objectDND.setAttribute("align", "middle");
  }
  
  addParam(objectDND, "postURL", targetURL);
  addParam(objectDND, "message", message);
  addParam(objectDND, "uploadPolicy", "SilverpeasUploadPolicy");
  addParam(objectDND, "showLogWindow", "false");
  addParam(objectDND, "showStatusBar", "true");
  addParam(objectDND, "afterUploadURL", "javascript:uploadCompleted('%message%')");<commit_msg>Incorrect URL to load the applet jars<commit_after>var dNdVisible 	= false;
var dNdLoaded	= false;
function showHideDragDrop(targetURL1, message1, properties, targetURL2, message2, max_upload, pathJreInstaller, expandLabel, collapseLabel)
{
  var actionDND = document.getElementById("dNdActionLabel");
	
  if (dNdVisible)
  {
    //hide applet
    hideApplet('DragAndDrop');
    hideApplet('DragAndDropDraft');

    //change link's label
    actionDND.innerHTML = expandLabel;
  }
  else
  {
    actionDND.innerHTML = collapseLabel;
		
    if (dNdLoaded)
    {
      showApplet('DragAndDrop');
      showApplet('DragAndDropDraft');
    }
    else
    {
      try {
        loadApplet('DragAndDrop', targetURL1, message1, properties, max_upload, pathJreInstaller);
      } catch (e) {
      }
      try {
        loadApplet('DragAndDropDraft', targetURL2, message2, properties, max_upload, pathJreInstaller);
      } catch (e) {
      }
      dNdLoaded = true;
    }
  }
  dNdVisible = !dNdVisible;
}

function hideApplet(divId)
{
  try
  {
    var appletObj = document.getElementById("applet"+divId);
    appletObj.setAttribute("height", "1");
  } catch (e) {
  }
}

function showApplet(divId)
{
  try
  {
    var appletObj = document.getElementById("applet"+divId);
    appletObj.setAttribute("height", "70");
  } catch (e) {
  }
}

function reloadApplets()
{
  $("#appletDragAndDrop").remove();
  $("#appletDragAndDropDraft").remove();
  dNdLoaded = false;
  dNdVisible = false;
}

function loadApplet(divId, targetURL, message, properties, max_upload, pathJreInstaller)
{
  var divDND = document.getElementById(divId);
	
  var _info = navigator.userAgent;
  var ie = (_info.indexOf("MSIE") > 0);
  var win = (_info.indexOf("Win") > 0);

  var objectDND;
  if (win)
  {
    objectDND = document.createElement("object");

    if (!ie)
    {
      objectDND.setAttribute("id", "applet"+divId);
      objectDND.setAttribute("width", "100%");
      objectDND.setAttribute("height", "70");
      objectDND.setAttribute("type", "application/x-java-applet;version=1.4.1");
    }
   		
    addParam(objectDND, "archive", "wjhk.jupload.jar,jakarta-commons-net.jar");
    addParam(objectDND, "code", "wjhk.jupload2.JUploadApplet");
    addParam(objectDND, "name", "Silverpeas Drag And Drop");
    addParam(objectDND, "codebase","/weblib/upload/")
  }
  else
  {
    /* mac and linux */
    objectDND = document.createElement("applet");
   		
    objectDND.setAttribute("id", "applet"+divId);
    objectDND.setAttribute("width", "100%");
    objectDND.setAttribute("height", "70");
    objectDND.setAttribute("codebase", "/weblib/upload/");
    objectDND.setAttribute("archive", "wjhk.jupload.jar,jakarta-commons-net.jar");
    objectDND.setAttribute("code", "wjhk.jupload2.JUploadApplet");
    objectDND.setAttribute("name", "Silverpeas Drag And Drop");
    objectDND.setAttribute("hspace", "0");
    objectDND.setAttribute("vspace", "0");
    objectDND.setAttribute("MAYSCRIPT", "yes");
    objectDND.setAttribute("align", "middle");
  }
  
  addParam(objectDND, "postURL", targetURL);
  addParam(objectDND, "message", message);
  addParam(objectDND, "uploadPolicy", "SilverpeasUploadPolicy");
  addParam(objectDND, "showLogWindow", "false");
  addParam(objectDND, "showStatusBar", "true");
  addParam(objectDND, "afterUploadURL", "javascript:uploadCompleted('%message%')");
{'fraction_non_alphanumeric': 0.15343601895734596, 'fraction_numerical': 0.010071090047393365, 'mean_word_length': 4.1197877179681575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '376594', 'n_tokens_mistral': 2349, 'n_tokens_neox': 2315, 'n_words': 381}