/** * @licstart The following is the entire license notice for the * JavaScript code in this page. * * Copyright (C) 2015 Alicia ( https://ion.nu/ ) * * The JavaScript code in this page is free software: you can * redistribute it and/or modify it under the terms of the GNU * Affero General Public License (GNU AGPL) as published by the Free Software * Foundation, version 3 of the License. * The code is distributed WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. * * As additional permission under GNU AGPL version 3 section 7, you * may distribute non-source (e.g., minimized or compacted) forms of * that code without the copy of the GNU AGPL normally required by * section 4, provided you include this license notice and a URL * through which recipients can access the Corresponding Source. * * @licend The above is the entire license notice * for the JavaScript code in this page. */ var tabs=new Array(); var currenttab; function tab_focus() { currenttab=this; var i=0; while(i0) { this.chat.style.display='none'; // Hide new tabs this.tab.className='tab'; // And give them close-buttons var close=document.createElement('button'); close.textContent='X'; close.onclick=function(){tab.close();} this.tab.appendChild(close); }else{ this.tab.className='tab tabfocus'; currenttab=this; } this.tab.onclick=function() { tab.focus(); }; document.getElementById('chat').appendChild(this.chat); document.getElementById('tabs').appendChild(this.tab); this.focus=tab_focus; this.setname=tab_setname; this.close=tab_close; this.dead=false; // dead tab = user disconnected } function findtab(name) { var i=1; // Skip the main tab while(i