Ticket #1629: diff.patch
| File diff.patch, 7.0 kB (added by cuchac, 6 months ago) |
|---|
-
index.php
20 21 <div id="contactList" class="box" style="left:10px;top:150px;display:none;"> 21 22 <div class="bar" onmousedown="init_drag(event, 'contactList')" id="nick">licqweb</div> 22 23 <div id="contacts"></div> 23 <div id="ownerStatus"></div> 24 <div style="display:box;height:18px"> 25 <div id="ownerStatus"></div> 26 <div class="resizer" onmousedown="init_resize(event, 'contacts', 100, 100)"> 27 <img class="resizerImage" src="images/resizer.png" /> 28 </div> 29 </div> 24 30 </div> 25 31 <div id="statusMenu"></div> 26 32 <div id="windows"></div> -
licqweb.js
168 168 } else { 169 169 pp = contact.pp.toLowerCase(); 170 170 } 171 var imgsrc = "images/" + pp + "." + contact.status.toLowerCase() + ".png";171 var imgsrc = "images/" + pp + "." + contact.status.toLowerCase().replace(" ","") + ".png"; 172 172 if (parseInt(contact.nummsgs) > 0) { 173 173 uclass = "newmessage"; 174 174 imgsrc = "images/msg.png"; … … 205 205 206 206 function getWindowHtml(id, pp, nick) { 207 207 var key = id + '-' + pp; 208 return "<div class=\"window\" style=\"left:300px;top:150px\" id=\"" + key + "-w\">" +208 return "<div onClick=\"set_focus(event, '" + key + "')\" class=\"window\" style=\"left:300px;top:150px\" id=\"" + key + "-w\">" + 209 209 "<div onmousedown=\"init_drag(event, '" + key + "-w')\" class=\"bar\">" + 210 210 "<div class=\"wintitle\">" + nick + " (" + pp + ")</div>" + 211 211 "<div onclick=\"showContactWindow('" + id + "', '" + pp + "')\" class=\"close\">[close]</div>" + 212 212 "</div>" + 213 213 "<div class=\"convo\" id=\"" + key + "-txt\"></div>" + 214 "<div class=\"msginput\"><textarea id=\"" + key + "-input\" onKeyPress=\"textarea_keypress(event, '" + id + "', '" + pp + "')\" ></textarea><br>" +214 "<div class=\"msginput\"><textarea id=\"" + key + "-input\" onKeyPress=\"textarea_keypress(event, '" + id + "', '" + pp + "')\" ></textarea><br>" + 215 215 "<input type=\"submit\" class=\"button\" value=\"Send\" onclick=\"sendMessage('" + id + "', '" + pp + "'); return false\" />" + 216 "<div class=\"resizer\" onmousedown=\"init_resize(event, '" + key + "-txt', 150, 50)\"><img class=\"resizerImage\" src=\"images/resizerMsg.png\" /></div>" + 216 217 "</div>" + 217 218 "</div>"; 218 219 } … … 315 316 document.getElementById(key + '-i').src = "images/msg.png"; 316 317 } else { 317 318 document.getElementById(key + '-s').className = contacts[pp][id].status; 318 document.getElementById(key + '-i').src = "images/" + pp.toLowerCase() + "." + contacts[pp][id].status.toLowerCase() + '.png';319 document.getElementById(key + '-i').src = "images/" + pp.toLowerCase() + "." + contacts[pp][id].status.toLowerCase().replace(" ","") + '.png'; 319 320 } 320 321 } else { 321 322 } … … 340 341 function _updateOwners() { 341 342 var statushtml = ""; 342 343 for (var pp in owners) { 343 statushtml += "<img onclick=\"showSelectStatus(event, '" + owners[pp].id + "', '" + pp + "'); return false\" src=\"images/" + pp.toLowerCase() + "." + owners[pp].status.toLowerCase() + ".png\"/> ";344 statushtml += "<img onclick=\"showSelectStatus(event, '" + owners[pp].id + "', '" + pp + "'); return false\" src=\"images/" + pp.toLowerCase() + "." + owners[pp].status.toLowerCase().replace(" ","") + ".png\"/> "; 344 345 } 345 346 document.getElementById('ownerStatus').innerHTML = statushtml; 346 347 } … … 352 353 statuss["MSN"] = new Array('Online', 'Away', 'Occupied'); 353 354 var statushtml = ""; 354 355 for (var i = 0; i < statuss[pp].length; ++i) { 355 statushtml += "<div onclick=\"changeStatus('" + pp + "', '" + statuss[pp][i] + "')\"><img src=\"images/" + pp.toLowerCase() + "." + statuss[pp][i].toLowerCase() + ".png\">" + statuss[pp][i] + "</div>";356 statushtml += "<div onclick=\"changeStatus('" + pp + "', '" + statuss[pp][i] + "')\"><img src=\"images/" + pp.toLowerCase() + "." + statuss[pp][i].toLowerCase().replace(" ","") + ".png\">" + statuss[pp][i] + "</div>"; 356 357 } 357 358 statusMenu.innerHTML = statushtml; 358 359 statusMenu.style.left = e.pageX; … … 460 461 dragwin.zIndex = 0; 461 462 462 463 function init_drag(event, id) { 463 var el;464 var x, y;465 464 466 dragwin.win = document.getElementById(id);465 dragwin.win = document.getElementById(id); 467 466 468 467 dragwin.startX = event.clientX + window.scrollX; 469 468 dragwin.startY = event.clientY + window.scrollY; … … 494 493 document.removeEventListener("mousemove", start_drag, true); 495 494 document.removeEventListener("mouseup", stop_drag, true); 496 495 } 496 497 function set_focus(event, key){ 498 win = document.getElementById(key + "-w"); 499 win.style.zIndex = ++dragwin.zIndex; 500 event.preventDefault(); 501 502 input = document.getElementById(key + "-input"); 503 input.focus(); 504 505 //stop_propagate(event); 506 } 507 508 function stop_propagate(event){ 509 if (!event) var event = window.event; 510 event.cancelBubble = true; 511 if (event.stopPropagation) event.stopPropagation(); 512 } 513 514 /* Window resizing stuff */ 515 var resizewin = new Object(); 516 517 function init_resize(event, id, minW, minH) { 518 resizewin.win = document.getElementById(id); 519 resizewin.minW = minW; 520 resizewin.minH = minH; 521 522 resizewin.startX = event.clientX + window.scrollX; 523 resizewin.startY = event.clientY + window.scrollY; 524 resizewin.startWidth = parseInt(resizewin.win.style.width, 10); 525 resizewin.startHeight = parseInt(resizewin.win.style.height, 10); 526 527 if (isNaN(resizewin.startWidth)) resizewin.startWidth = resizewin.win.offsetWidth; 528 if (isNaN(resizewin.startHeight)) resizewin.startHeight = resizewin.win.offsetHeight; 529 530 //resizewin.win.style.zIndex = ++resizewin.zIndex; 531 532 document.addEventListener("mousemove", do_resize, true); 533 document.addEventListener("mouseup", stop_resize, true); 534 event.preventDefault(); 535 } 536 537 function do_resize(event) { 538 var x, y; 539 x = event.clientX + window.scrollX; 540 y = event.clientY + window.scrollY; 541 542 543 if(resizewin.minW < (resizewin.startWidth + x - resizewin.startX)){ 544 resizewin.win.style.width = (resizewin.startWidth + x - resizewin.startX) + "px"; 545 resizewin.win.parentNode.style.width = (resizewin.startWidth + x - resizewin.startX) + "px"; 546 } 547 if(resizewin.minH < (resizewin.startHeight + y - resizewin.startY)){ 548 resizewin.win.style.height = (resizewin.startHeight + y - resizewin.startY) + "px"; 549 } 550 551 event.preventDefault(); 552 } 553 554 function stop_resize(event) { 555 document.removeEventListener("mousemove", do_resize, true); 556 document.removeEventListener("mouseup", stop_resize, true); 557 } 558 No newline at end of file -
licqweb.css
108 108 left: 300px; 109 109 } 110 110 111 #ownerStatus { 112 left:0px; 113 width:20px; 114 position:absolute; 115 } 116 117 .resizer { 118 right:0px; 119 bottom:0px; 120 width:18px; 121 height:18px; 122 position:absolute; 123 } 124 125 .resizerImage { 126 bottom:0px; 127 position:absolute; 128 right:0px; 129 } 130 111 131 .box { 112 132 background-color: #eee; 113 133 border: 1px solid #000000;
