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.

misc_dev.js 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. // typeof __webpack_dev_server_client__ !== "undefined" ? typeof __webpack_dev_server_client__.default !== "undefined" ? __webpack_dev_server_client__.default : __webpack_dev_server_client__ : "WebSocketClient";
  2. // window.__webpack_dev_server_client__ = __webpack_dev_server_client__
  3. // {
  4. // }
  5. glob_u.fns.check_stropheConn = function(z = "") {
  6. // clog("add_handler_m...")
  7. // var state = window.glob_vhook.fns.getState()
  8. try {
  9. var state = APP.store.getState()
  10. var conference_0 = state["features/base/conference"]
  11. var conference = conference_0.conference
  12. var _stropheConn = conference.xmpp.connection._stropheConn
  13. console.log("ONL_~ _stropheConn",z,_stropheConn)
  14. } catch (err){
  15. console.log("ONL_~ _stropheConn ERR",z,err)
  16. }
  17. }
  18. // /*
  19. // timeout vs frame
  20. // individual vs combinable ... combine opts?
  21. // callback order
  22. {
  23. // async function
  24. function batch_run(ord){
  25. ord.batch.WillRun = false
  26. var batched_events = ord.batch.batched_events
  27. var i,k,v
  28. for ([k,v] of Object.entries(batched_events.combinable)){
  29. ord.run_cbs(v.key,v.arg_obj)
  30. }
  31. for ([k,v] of Object.entries(batched_events.unique)){
  32. ord.run_cbs(v.key,v.arg_obj)
  33. }
  34. ord.batch.batched_events = {
  35. combinable:{},
  36. unique:[],
  37. }
  38. }
  39. // function
  40. glob_u.fns.req_batch_run =function req_batch_run(key,arg_obj,combine){
  41. if (this.batch.WillRun == false) {
  42. this.batch.WillRun = true
  43. this.batch.batched_events = {
  44. combinable:{},
  45. unique:[],
  46. }
  47. }
  48. if (this.batch.WillRun == true){
  49. if (combine){
  50. this.batch.batched_events.combinable[key] = {key,arg_obj,combine}
  51. } else {
  52. this.batch.batched_events.unique.push({key,arg_obj,combine})
  53. }
  54. }
  55. if (!(this.batch.WillRun == true ||this.batch.WillRun == false )){
  56. console.error("::")
  57. throw "req_batch_run err"
  58. }
  59. // cache
  60. }
  61. function dec_cb_ord(){
  62. try {
  63. clog("dec_cb_ord:",glob_u,glob_u.cls.reg_cb_ord)
  64. glob_u.cls.reg_cb_ord.req_batch_run = glob_u.fns.req_batch_run
  65. } catch (err){
  66. clog("dec_cb_ord ERR:",err)
  67. }
  68. }
  69. // glob_u.cls.reg_cb_ord.prototype
  70. // dec_cb_ord()
  71. }
  72. glob_u.fns.gen_ord_decs = function(ord,cb_prefix){
  73. // clog("gen_ord_decs:",cb_prefix)
  74. var reg_cb = function(cb,key_name,cb_name,override_level,push){
  75. return ord.reg_cb(cb,cb_prefix+key_name,cb_name,override_level,push)
  76. }
  77. var run_cbs_lz = function(key,arg_obj,lazy=1){
  78. if (lazy && cb_prefix+key in ord.cb_sto){
  79. return ord.run_cbs(cb_prefix+key,arg_obj)
  80. }
  81. }
  82. var run_cbs = function(key,arg_obj){
  83. return ord.run_cbs(cb_prefix+key,arg_obj)
  84. // split out later maybe?
  85. }
  86. function req_batch_run(key,arg_obj,combine){
  87. return ord.req_batch_run(cb_prefix+key,arg_obj)
  88. // clog("req_batch_run",cb_prefix,ord)
  89. // return ord.req_batch_run(cb_prefix+key,arg_obj)
  90. }
  91. reg_cb.ord = ord
  92. reg_cb.cb_prefix = cb_prefix
  93. run_cbs.ord = ord
  94. run_cbs.cb_prefix = cb_prefix
  95. run_cbs_lz.ord = ord
  96. run_cbs_lz.cb_prefix = cb_prefix
  97. return {reg_cb,run_cbs,run_cbs_lz,req_batch_run}
  98. }
  99. // */
  100. glob_u.fns.inc_map = function inc_map(map,key,dflt=0,inc=1){
  101. if (!map.has(key)){
  102. map.set(key,dflt + inc)
  103. } else {
  104. map.set(key,map.get(key) + inc)
  105. }
  106. }
  107. glob_u.fns.map_to_obj = function map_to_obj(m){
  108. var k,v
  109. var o={}
  110. for ([k,v] of m){
  111. o[k]=v
  112. }
  113. return o
  114. }
  115. glob_u.tvar.pass_qxi = [
  116. // "SET_LAST_N",
  117. "PARTICIPANT_UPDATED",
  118. ]
  119. glob_u.tvar.skip_qxi = [
  120. "SET_TOOLBOX_VISIBLE",
  121. "SET_TOOLBAR_HOVERED",
  122. "SET_TOOLBOX_TIMEOUT",
  123. "CLEAR_TOOLBOX_TIMEOUT",
  124. "SET_TOOLBOX_VISIBLE",
  125. "_ADD_AUDIO_ELEMENT",
  126. "REGISTER_SOUND",
  127. "SET_TOOLBOX_VISIBLE",
  128. ]
  129. glob_u.fns.QXI_log = function QXI_log(o){
  130. // return
  131. // return
  132. if (glob_u.tvar.pass_qxi.includes(o.action.type)){
  133. // clog("=QXI:",o.action.type,o)
  134. clog("=QXI:",o.action.type,o)
  135. }
  136. if (glob_u.tvar.skip_qxi.includes(o.action.type)){
  137. return
  138. clog("SKIP QXI:",o.action.type)
  139. }
  140. // clog("QXI:",o.action.type,o)
  141. if (o.action.type == "PLAY_SOUND"){
  142. // clog("QXI:",o.action.type,o)
  143. }
  144. // clog("QXI_map:",o.action.type,o)
  145. // clog("QXI:",o.action.type,o)
  146. // clog("QXI:",o.action.type,o)
  147. // glob_u.fns.inc_map(m,o.action.type)
  148. }
  149. glob_u.fns.QXI_map = function QXI_map(o){
  150. if (!glob_u.tvar.qxi_data){
  151. glob_u.tvar.qxi_data = {
  152. m:new Map(),
  153. }
  154. }
  155. glob_u.fns.QXI_log(o)
  156. var m = glob_u.tvar.qxi_data.m
  157. glob_u.fns.inc_map(m,o.action.type)
  158. // o.action.type
  159. // clog("QXI_map:",o.action.type,o)
  160. }
  161. glob_u.fns.get_QXI_obj = function get_QXI_obj(){
  162. return glob_u.fns.map_to_obj(glob_u.tvar.qxi_data.m)
  163. }
  164. // glob_u.fns.map_to_obj(glob_u.tvar.qxi_data.m)
  165. // glob_u.fns.get_QXI_obj()
  166. {
  167. // let zz3 = 10
  168. // var zz4 = 14
  169. // clog("zz3",zz3,zz4)
  170. }