<commit_before><%@ page language='java' pageEncoding='iso-8859-1' %>
<%
if (request.getHeader("User-Agent").indexOf("MSIE") == -1) {
  response.setContentType("text/javascript;charset=iso-8859-1");
}
%>
// -*- Mode: c -*-
// $Id: stuff.jsp,v 1.4 2004/05/10 19:24:31 pajp Exp $
function context_in(no, isLetterBox, isText, name) {
  document.ctxNo = no;
  document.ctxIsLetterBox = isLetterBox;
  document.ctxIsText = isText;
  document.ctxName = name;
  document.inContext = true;
  getMenuObj();
}

function context_out() {
  document.inContext = false;
  getMenuObj();
}

function add_recipient_interactive(win, textNo, rtype) {
    var rname;
    switch (rtype) {
      case 0: 
          rname = "mottagare";
          break;
      case 1:
          rname = "extra kopiemottagare";
          break;
      case 2:
          rname = "dold kopiemottagare";
          break;
    }
    var recipientName = win.prompt("Vilket mte vill du addera som " + rname + " till text " + textNo + "?");
    if (recipientName == null) return;
    document.location.href="/lyskom/?addRecipient=" + escape(recipientName) + 
      "&toText=" + escape(textNo) + "&recipientType="+escape(rtype);
}

function endast_interactive(win, confNo, name) {
  name = unescape(name);
  var count = win.prompt("Hur mnga olsta vill du ha i \"" + name + "\"?");
  if (count == null) return;
  document.location.href="/lyskom/?endast=" + escape(count) + "&endastConferenceName=" +
    escape(name);
}

function search_interactive(win) {
  var str = win.prompt("Ange skvillkor (lmna blankt fr att lista alla mten och personer):", "");
  if (str == null) return;
  document.location.href="/lyskom/?lookup=" + escape(str);
}

function review_pres_interactive(win, def) {
  var name = win.prompt("Vilket mte eller vilken person vill du se presentationen fr?");
  if (name == null) return;
  document.location.href="/lyskom/?reviewPresentation=" + escape(name);
}

function change_name_interactive(win, def) {
  var name = win.prompt("Vilket namn vill du byta?", def);
  if (name == null) {
    return;
  }
  var newName = win.prompt("Vilket namn vill du byta till?", name);
  if (newName == null) {
    alert("Avbruten.");
    return;
  }
  document.location.href = "/lyskom/?changeName=" + escape(name) + "&newName=" + 
    escape(newName);
}

function _test_context(confNo, isLetterbox) {
   //alert(confNo + " is a " + (isLetterbox ? "person" : "conference"));
   window.open("context.jsp?confNo=" + confNo, "ctx", "chrome");
}

function getMenuObj() {
  if (ie5||ns6) {
    if (typeof(document.inContext)=="undefined" || document.inContext == false) {
      menuobj = document.getElementById("ie5menu");
    } else if (document.ctxIsLetterBox == true) {
      menuobj = document.getElementById("ctxmenu_letterbox");
    } else if (document.ctxIsText == true) {
      menuobj = document.getElementById("ctxmenu_text");
    } else {
      menuobj = document.getElementById("ctxmenu_conference");
    }
  }
}

function showhidemenu(e) {
    getMenuObj();
    if (menuobj.style.visibility = "hidden") {
	showmenuie5(e);
    } else {
	hidemenuie5(e);
    }
}


function showmenuie5(e){
  getMenuObj();
  //Find out how close the mouse is to the corner of the window
  var rightedge=ie5? document.body.clientWidth-event.clientX : window.innerWidth-e.clientX;
  var bottomedge=ie5? document.body.clientHeight-event.clientY : window.innerHeight-e.clientY;
  
  //if the horizontal distance isn't enough to accomodate the width of the context menu
  if (rightedge<menuobj.offsetWidth) {
    //move the horizontal position of the menu to the left by it's width
    menuobj.style.left=ie5? document.body.scrollLeft+event.clientX-menuobj.offsetWidth : window.pageXOffset+e.clientX-menuobj.offsetWidth;
  } else {
    //position the horizontal position of the menu where the mouse was clicked
    menuobj.style.left=ie5? document.body.scrollLeft+event.clientX : window.pageXOffset+e.clientX;
  }

  //same concept with the vertical position
  if (bottomedge<menuobj.offsetHeight)
    menuobj.style.top=ie5? document.body.scrollTop+event.clientY-menuobj.offsetHeight : window.pageYOffset+e.clientY-menuobj.offsetHeight;
  else
    menuobj.style.top=ie5? document.body.scrollTop+event.clientY : window.pageYOffset+e.clientY;

  menuobj.style.visibility="visible";
  return false
}

function hidemenuie5(e){
  /*
  var menus = [ "ie5menu", "ctxmenu_conference", "ctxmenu_text", "ctxmenu_letterbox" ];
  for (var menu in menus) {
    document.getElementById(menu).style.visibility="hidden";
  }
  */
  menuobj.style.visibility="hidden";
}

function highlightie5(e){
  var firingobj=ie5? event.srcElement : e.target;
  if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
    if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode; //up one node
    firingobj.style.backgroundColor="highlight";
    firingobj.style.color="white";
    if (display_url==1)
      window.status=event.srcElement.url;
  }
}

function lowlightie5(e){
  var firingobj=ie5? event.srcElement : e.target;
  if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
    if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode; //up one node
    firingobj.style.backgroundColor="";
    firingobj.style.color="black";
    window.status='';
  }
}

function ctxVars(str) {
  var s = str;
  s = s.replace("%NO%", document.ctxNo);
  s = s.replace("%NAME%", escape(document.ctxName));
  return s;
}<commit_msg>fixed DHTML menu stickiness! finally.<commit_after><%@ page language='java' pageEncoding='iso-8859-1' %>
<%
if (request.getHeader("User-Agent").indexOf("MSIE") == -1) {
  response.setContentType("text/javascript;charset=iso-8859-1");
}
%>
// -*- Mode: c -*-
// $Id: stuff.jsp,v 1.5 2004/05/13 02:42:27 pajp Exp $
function context_in(no, isLetterBox, isText, name) {
  document.ctxNo = no;
  document.ctxIsLetterBox = isLetterBox;
  document.ctxIsText = isText;
  document.ctxName = name;
  document.inContext = true;
  getMenuObj();
}

function context_out() {
  document.inContext = false;
  getMenuObj();
}

function add_recipient_interactive(win, textNo, rtype) {
    var rname;
    switch (rtype) {
      case 0: 
          rname = "mottagare";
          break;
      case 1:
          rname = "extra kopiemottagare";
          break;
      case 2:
          rname = "dold kopiemottagare";
          break;
    }
    var recipientName = win.prompt("Vilket mte vill du addera som " + rname + " till text " + textNo + "?");
    if (recipientName == null) return;
    document.location.href="/lyskom/?addRecipient=" + escape(recipientName) + 
      "&toText=" + escape(textNo) + "&recipientType="+escape(rtype);
}

function endast_interactive(win, confNo, name) {
  name = unescape(name);
  var count = win.prompt("Hur mnga olsta vill du ha i \"" + name + "\"?");
  if (count == null) return;
  document.location.href="/lyskom/?endast=" + escape(count) + "&endastConferenceName=" +
    escape(name);
}

function search_interactive(win) {
  var str = win.prompt("Ange skvillkor (lmna blankt fr att lista alla mten och personer):", "");
  if (str == null) return;
  document.location.href="/lyskom/?lookup=" + escape(str);
}

function review_pres_interactive(win, def) {
  var name = win.prompt("Vilket mte eller vilken person vill du se presentationen fr?");
  if (name == null) return;
  document.location.href="/lyskom/?reviewPresentation=" + escape(name);
}

function change_name_interactive(win, def) {
  var name = win.prompt("Vilket namn vill du byta?", def);
  if (name == null) {
    return;
  }
  var newName = win.prompt("Vilket namn vill du byta till?", name);
  if (newName == null) {
    alert("Avbruten.");
    return;
  }
  document.location.href = "/lyskom/?changeName=" + escape(name) + "&newName=" + 
    escape(newName);
}

function _test_context(confNo, isLetterbox) {
   //alert(confNo + " is a " + (isLetterbox ? "person" : "conference"));
   window.open("context.jsp?confNo=" + confNo, "ctx", "chrome");
}

function getMenuObj() {
  if (ie5||ns6) {
    if (typeof(document.inContext)=="undefined" || document.inContext == false) {
      menuobj = document.getElementById("ie5menu");
    } else if (document.ctxIsLetterBox == true) {
      menuobj = document.getElementById("ctxmenu_letterbox");
    } else if (document.ctxIsText == true) {
      menuobj = document.getElementById("ctxmenu_text");
    } else {
      menuobj = document.getElementById("ctxmenu_conference");
    }
  }
}

function showhidemenu(e) {
    getMenuObj();
    if (menuobj.style.visibility = "hidden") {
	showmenuie5(e);
    } else {
	hidemenuie5(e);
    }
}


function showmenuie5(e){
  getMenuObj();
  //Find out how close the mouse is to the corner of the window
  var rightedge=ie5? document.body.clientWidth-event.clientX : window.innerWidth-e.clientX;
  var bottomedge=ie5? document.body.clientHeight-event.clientY : window.innerHeight-e.clientY;
  
  //if the horizontal distance isn't enough to accomodate the width of the context menu
  if (rightedge<menuobj.offsetWidth) {
    //move the horizontal position of the menu to the left by it's width
    menuobj.style.left=ie5? document.body.scrollLeft+event.clientX-menuobj.offsetWidth : window.pageXOffset+e.clientX-menuobj.offsetWidth;
  } else {
    //position the horizontal position of the menu where the mouse was clicked
    menuobj.style.left=ie5? document.body.scrollLeft+event.clientX : window.pageXOffset+e.clientX;
  }

  //same concept with the vertical position
  if (bottomedge<menuobj.offsetHeight)
    menuobj.style.top=ie5? document.body.scrollTop+event.clientY-menuobj.offsetHeight : window.pageYOffset+e.clientY-menuobj.offsetHeight;
  else
    menuobj.style.top=ie5? document.body.scrollTop+event.clientY : window.pageYOffset+e.clientY;

  menuobj.style.visibility="visible";
  return false
}

function hidemenuie5(e){
  document.getElementById("ie5menu").style.visibility="hidden";
  document.getElementById("ctxmenu_conference").style.visibility="hidden";
  document.getElementById("ctxmenu_text").style.visibility="hidden";
  document.getElementById("ctxmenu_letterbox").style.visibility="hidden";
}

function highlightie5(e){
  var firingobj=ie5? event.srcElement : e.target;
  if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
    if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode; //up one node
    firingobj.style.backgroundColor="highlight";
    firingobj.style.color="white";
    if (display_url==1)
      window.status=event.srcElement.url;
  }
}

function lowlightie5(e){
  var firingobj=ie5? event.srcElement : e.target;
  if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
    if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode; //up one node
    firingobj.style.backgroundColor="";
    firingobj.style.color="black";
    window.status='';
  }
}

function ctxVars(str) {
  var s = str;
  s = s.replace("%NO%", document.ctxNo);
  s = s.replace("%NAME%", escape(document.ctxName));
  return s;
}
{'fraction_non_alphanumeric': 0.1467430207587688, 'fraction_numerical': 0.009484609878310665, 'mean_word_length': 4.082764893133242, 'pattern_counts': {'":': 0, '<': 11, '<?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': '4522054', 'n_tokens_mistral': 3853, 'n_tokens_neox': 3757, 'n_words': 765}