📄 htmlgroup.js
字号:
/* * GContact / PAUL Grégory * * In this file are functions relative to groups to update the view (html) */ /* * Show a form to update groups (and, by the way, update the group list zone) * @param Groups list, formated in XML */function showGroupMgtForm(resultXML) { var content = document.getElementById("content"), listeGroupes = document.getElementById("listeGroupes"), tmpListeGroupes = ''; if (resultXML) { content.innerHTML = ""; listeGroupes.innerHTML = ""; var groups = resultXML.getElementsByTagName("groups")[0]; for (var i = 0; i < groups.childNodes.length; i++) { var id = groups.childNodes[i].getAttribute("id"); var canBeDeleted = (groups.childNodes[i].getAttribute("canBeDeleted") == 'true') ? true : false; var nbPerson = groups.childNodes[i].getAttribute("nbPerson"), txtPerson = '', deleteButton = ''; if (nbPerson.length == 0) { nbPerson = '0'; txtPerson = lbl_nobody; deleteButton = "<input type='button' name='delete"+ id +"' value='"+ action_delete +"' onclick='deleteGroup("+ id +");'/>"; } else txtPerson = '('+ nbPerson +' '+ ((nbPerson > 1) ? lbl_persons : lbl_person) +')'; content.innerHTML += '<label for="name'+id+'">'+ lbl_group_name +' : </label><input type="text" name="name'+id+'" id="name'+id+'" value="'+groups.childNodes[i].getAttribute("name")+'" maxlength="16"/> * '+ deleteButton +' '+ txtPerson +'<br/>'; listeGroupes.innerHTML += '<li><a href="#" onclick="showGroup('+ id +');">'+ groups.childNodes[i].getAttribute("name") +'</a> ('+ nbPerson +')</li>'; } content.innerHTML = '<form name="formGroup" id="formGroup" method="post" action="#">' + '<fieldset><legend>'+ lbl_group_title +'</legend>' + content.innerHTML + '<input type="button" class="marginButtons" value="'+ action_update_group +'" onclick="modifyGroupNames()"/><br/>' + '<hr/>' + '<label for="name">'+ lbl_group_name +' : </label><input type="text" name="nameNew" id="nameNew" value="" maxlength="16"/> * ' + '<input type="button" name="new" value="'+ action_create +'" onclick="createGroupName(document.getElementById(\'nameNew\'))"/>' + '</fieldset>' + '</form>' + msgRequired; listeGroupes.innerHTML = '<ul>' + listeGroupes.innerHTML + '</ul>'; } else content.innerHTML = problemXmlResult; return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -