Advertisement
Guest User

tlk43

a guest
Jul 24th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. javascript: var idcolor = new Array();
  2. var clrList = new Array("#b4eaf7","#f7e2b9","#cb91f8","#b2f2df","#ffffe7","#d9fbff","#bae2e2","#f1f7b4","#f8c6e5","#fecbe2","#c6f3f8","#e4ffec","#ecffc4","#f2ecff","#decbd5","#ffffff","#abfedd","#b8f5e2","#e0f7bd","#ffefff","#c398ba","#ece2fe","#bcdbf7","#c1da9b","#cccccc","#9cf5b7","#faf49c","#ffeefe","#f9c5f7","#efefef","#b3f7bb","#f7eb98","#f8a291","#d7f7be","#f7cec9","#ca8c95","#c9bbf7","#ccd1d2","#e0f7b2","#ffdad3","#98d2fe","#bcdbf7","#fed8f2");
  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. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement