function validateListEditor () { serializeReferences (); return true; } function makeEditable (element) { element.addClassName ("editing"); element.removeClassName ("referenceListCell"); var tmp = element.innerHTML; element.innerHTML = ""; var textField = new Element ("input", {"type": "text", "width": "90%"}); textField.style.width = "90%"; textField.value = tmp.trim (); textField.value = textField.value.replace (/</, "<"); textField.value = textField.value.replace (/>/, ">"); element.appendChild (textField); textField.addInterface (SOGoAutoCompletionInterface); textField.focus (); textField.select (); textField.excludeLists = 1; textField.menu = $("contactsMenu"); textField.endEditable = endEditable; textField.addAnother = onReferenceAdd; textField.baseUrl = window.location.href + "/../../contactSearch?search="; } function endEditable (event, element) { var card; var name; var mail; if (element) { card = element.readAttribut("card"); mail = element.readAttribute("mail"); name = element.readAttribute("name"); } else { if ($(this).tagName == "INPUT") { element = this.ancestors ().first (); card = this.readAttribute ("card"); name = this.readAttribute ("name"); mail = this.readAttribute ("mail"); } else { element = this; card = element.childElements ().first ().readAttribute ("card"); mail = element.childElements ().first ().readAttribute ("mail"); name = element.childElements ().first ().readAttribute ("name"); } } element.writeAttribute ("card", card); element.writeAttribute ("name", name); element.writeAttribute ("mail", mail); var tmp = ""; if (card) { var tmp = element.childElements ().first ().value; tmp = tmp.replace (//, ">"); element.innerHTML = tmp; element.removeClassName ("editing"); element.addClassName ("referenceListCell"); } else { element.ancestors ().first ().remove (); } } function endAllEditables (e) { var r = $$("TABLE#referenceList tbody tr td"); for (var i=0; i