Guest User

tlk

a guest
Jul 24th, 2013
200
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript: var idcolor = new Array();
  2. var clrList = new Array("#ffeff9","#ffede6","#ffe8ff","#ffffeb","#faf2bc","#fffff9","#cdffff","#fae6f9","#e2f2fe","#fdfdfd","#edf9d7","#d6fada","#f9ebe9","#d9f2f8","#dbf8ef","#fff8ff","#d7ffff","#e3dcf9","#ffebff","#fffeff","#fefee8","#e8e8e8","#edf8dd","#fac8be","#eef3f4","#d6f7ed","#f9efdd","#dfecf9","#fcf9ce","#f5f8d7","#f1ffff","#aae4ff","#eaf9de","#f9e8f3","#e0f6f9","#c0f9d2","#fffaff","#cedcb8");
  3.  
  4. function clrSet() {
  5. for (var i = 0; i < $("#online-participants .participant-list-item").length; i++) {
  6. if (!idcolor[$("#online-participants .participant-list-item")[i].id]) {
  7. idcolor[$("#online-participants .participant-list-item")[i].id] = clrList[i];
  8. }
  9. $('.' + $("#online-participants .participant-list-item")[i].id).css('background-color', idcolor[$("#online-participants .participant-list-item")[i].id]);
  10. }
  11. }
  12.  
  13. function dateTimeSet() {
  14. for (var i = 0; i < $("#live dd").length; i++) {
  15. if (!$("#live dd").eq(i).attr("title")) {
  16. $("#live dd").eq(i).attr("title", Date($("#live dd").eq(i).attr("data-timestamp") * 1000));
  17. }
  18. }
  19. }
  20. clrSet();
  21. dateTimeSet();
  22. socket.on('message', function (message) {
  23. clrSet();
  24. dateTimeSet();
  25. });
  26. socket.onerror('message', function (message) {
  27. clrSet();
  28. dateTimeSet();
  29. });
RAW Paste Data