BeoAngel

Code Mở Vô Hạn Tab Chat

Jan 6th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. function removeTogglers(currentDiv)
  2. {
  3. var curDiv = currentDiv;
  4. console.log(curDiv);
  5. function aaa() {
  6. var fl = false;
  7. for(var i = 0; i < curDiv.classList.length; ++i) {
  8. if(curDiv.classList[i] == "openToggler") {
  9. fl = true;
  10. }
  11. }
  12. if(fl) {
  13. curDiv.classList.remove('openToggler');
  14. }
  15. else {
  16. curDiv.classList.add('openToggler');
  17. }
  18. }
  19. return aaa;
  20. }
  21.  
  22. function getitdonenow(tag1)
  23. {
  24. var aa = tag1.getElementsByClassName('titlebar');
  25. if(aa.length>0)
  26. {
  27. console.log('here i am');
  28. //aa[0].addEventListener('click',removeTogglers(aa[0]),false);
  29. var curDiv = aa[0];
  30. console.log(curDiv);
  31. curDiv.onclick = function() {alert('h');};
  32. console.log('onclick over');
  33. /*console.log('a');
  34. /*var fl = false;for(var i = 0; i < curDiv.classList.length; ++i) {if(curDiv.classList[i] == "openToggler") {fl = true;}}if(fl) {curDiv.classList.remove('openToggler');}else {curDiv.classList.add('openToggler');
  35. }*/
  36. //}
  37. //console.log("u");
  38. }
  39. }
  40.  
  41. function dostuff() {
  42. fbchatWindows = document.getElementsByClassName("fbDockChatTab");
  43. for(i = 0; i < fbchatWindows.length; ++i)
  44. {
  45. oneWindow = fbchatWindows[i];
  46. flag = false;
  47. for(j = 0; j < oneWindow.classList.length; ++j)
  48. {
  49. if(oneWindow.classList[j] == "openToggler")
  50. {
  51. flag = true;
  52. }
  53. }
  54. if(flag==false)
  55. {
  56. oneWindow.classList.add("openToggler");
  57. }
  58. }
  59. }
  60.  
  61. document.addEventListener('DOMNodeInserted', dostuff, false);
Add Comment
Please, Sign In to add comment