You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

preload.js 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. // clog = console.log
  2. // function nop(){}
  3. glob_dev_hooks = window.glob_dev_hooks || {}
  4. glob_dev_fns = window.glob_dev_fns || {}
  5. window.glob_react = window.glob_react || {i:"r0"}
  6. /*
  7. function FS_dec2(fn) {
  8. return function() {
  9. // dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
  10. const ret = fn.apply(this, arguments);
  11. clog("SVD",{ret,that:this,args:[...arguments]})
  12. // console.log('FSD',fn.name,ret, [this,...arguments]);
  13. // const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
  14. // if (ret2){
  15. // return ret2.ret
  16. // }
  17. // const result = fn.apply(this, arguments);
  18. // console.log('Finished');
  19. return ret;
  20. }
  21. }
  22. */
  23. // svop = jc(SmallVideoOrig.prototype)
  24. // svop = jc(SmallVideoOrig)
  25. // svop = Object.assign({},glob_react.Filmstrip)
  26. // svop = Object.assign({},SmallVideoOrig.prototype)
  27. // function save_orig()
  28. orig_classes = window.orig_classes || {}
  29. react_trc_log = window.react_trc_log || {}
  30. react_trc_log = window.react_trc_log || {}
  31. /*
  32. window.react_trc_log.SmallVideoTrc0= ["$avatar",
  33. "_setThumbnailSize",
  34. "bindHoverHandler",
  35. "initBrowserSpecificProperties",
  36. "_renderDisplayName",
  37. "$avatar",
  38. "initializeAvatar",
  39. "_getAudioLevelContainer",
  40. "_getAudioLevelContainer",
  41. "updateAudioLevelIndicator",
  42. "addAudioLevelIndicator",
  43. "updateIndicators",
  44. "isCurrentlyOnLargeVideo",
  45. "_isHovered",]
  46. react_trc_log.SmallVideoTrc = ["_renderDisplayName",
  47. "_setThumbnailSize",
  48. "showDominantSpeakerIndicator",
  49. "setVideoMutedView",
  50. "initBrowserSpecificProperties",
  51. "bindHoverHandler",
  52. "addAudioLevelIndicator",]
  53. */
  54. glob_dev_fns.getTileViewGridDimensions_set_num = function(state,maxColumns,onumberOfParticipants){
  55. // return
  56. clog("SET NUM PRT")
  57. var numberOfParticipants
  58. // if (window.glob_dev_fns && window.glob_dev_fns.ret0){return onumberOfParticipants}
  59. try {
  60. var thumbs = glob_react.Filmstrip._getThumbs()
  61. // numberOfParticipants = thumbs.remoteThumbs.length + thumbs.localThumb thumbs.localThumb.length
  62. numberOfParticipants = thumbs.remoteThumbs.length
  63. if (thumbs.localThumb){
  64. numberOfParticipants += thumbs.localThumb.length
  65. }
  66. } catch(e) {
  67. clog("getTileViewGridDimensions_set_num err:",e)
  68. return onumberOfParticipants
  69. }
  70. // clog("getTileViewGridDimensions_set_num ret:",numberOfParticipants,thumbs,onumberOfParticipants)
  71. // numberOfParticipants < onumberOfParticipants ? numberOfParticipants = onumberOfParticipants : 1
  72. // clog("getTileViewGridDimensions_set_num ret2:",numberOfParticipants,thumbs,onumberOfParticipants)
  73. // clog("NUM",numberOfParticipants)
  74. return numberOfParticipants
  75. }
  76. window.glob_dbg = window.glob_dbg || {
  77. log:{},
  78. logs:{},
  79. }
  80. function log_tb(err,key){
  81. var key
  82. try{
  83. key in window.glob_dbg.logs ? 1 : window.glob_dbg.logs[key]=[]
  84. // key in window.glob_dbg.log ? 1 : window.glob_dbg.log[key]=[]
  85. window.glob_dbg.logs[key].push(err.stack)
  86. // window.glob_dbg.log[key].push(err)
  87. // clog("LOG_TB",key,err)
  88. } catch (e){
  89. clog("LOG TB",key,"ERR:",e)
  90. }
  91. // return new Error()
  92. }
  93. function clone_class() {
  94. var k,v,p
  95. if (orig_classes.SmallVideoOrig){
  96. return
  97. }
  98. orig_classes.SmallVideoOrig = {}
  99. for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
  100. v=p.value
  101. orig_classes.SmallVideoOrig[k]=v
  102. }
  103. }
  104. // clog("R0...",window.SmallVideoOrig)
  105. /*
  106. function loop_proto(){
  107. var k,v,p
  108. for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
  109. // clog("~",k,v)
  110. v=p.value
  111. clog("~",k,typeof(v))
  112. if (typeof(v) == "function"){
  113. SmallVideoOrig.prototype[k] = FS_dec2(v)
  114. }
  115. }
  116. }
  117. */
  118. function loop_vids(vids = $(".small_vid")){
  119. clog("vids",vids)
  120. var k,v
  121. // for (k in [...vids]){
  122. for (k of vids){
  123. clog("..",k)
  124. }
  125. }
  126. function log_info0(key){
  127. var ret = new Map()
  128. var k,v
  129. var arr
  130. for (v of glob_dbg.log[key]){
  131. ret.setD(v.stack,0)
  132. ret.set(v.stack,ret.get(v.stack) + 1)
  133. arr = v.stack.split("\n")
  134. clog(arr[2])
  135. // v.
  136. // clog(k,v)
  137. }
  138. return ret
  139. }
  140. function log_info(key,line_num=2,num_lines=1){
  141. var ret = new Map()
  142. var ret1 = new Map()
  143. var line
  144. var k,v
  145. var arr
  146. for (v of glob_dbg.logs[key]){
  147. ret.setD(v,0)
  148. ret.set(v,ret.get(v) + 1)
  149. arr = v.split("\n")
  150. // clog(arr[3])
  151. // clog(arr[2])
  152. // line = arr[line_num]
  153. line = arr.slice(line_num,line_num+num_lines).join("\n")
  154. // if ("an")
  155. if (line.includes("anony")){
  156. } else {
  157. // continue
  158. }
  159. // clog(line)
  160. ret1.setD(line,0)
  161. ret1.set(line,ret1.get(line) + 1)
  162. // v.
  163. // clog(k,v)
  164. }
  165. return ret1
  166. }
  167. function map_loop(m){
  168. var k,v
  169. for ([k,v] of m){
  170. clog(k,v)
  171. }
  172. }
  173. // XMPPAttachInfo.data = {atr:"modme"}