123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591 |
-
-
- glob_mx.hook_cb.RemoteVideoMenu = glob_mx.hook_cb.RemoteVideoMenu || {}
- glob_mx.qxi_cb.SET_OVERFLOW_MENU_VISIBLE = glob_mx.qxi_cb.SET_OVERFLOW_MENU_VISIBLE || {}
-
- function rvm_to(a){
- clog("rvm_to RemoteVideoMenu...",a, $(".popover"))
- // popup_item
- var n
-
- var svg,icon_template
-
- var jmod_templates_ui_msg = $(mod_templates_ui_msg)
- n = jmod_templates_ui_msg.find(".popup_item_req")
- n.find(".av_io").click(evnt_av_io)
- $(".popupmenu").prepend(n)
-
-
-
-
- }
-
- glob_mx.hook_cb.RemoteVideoMenu.fn = function(o,a2){
- if (!window.iammod){return}
- if ($(".popover").length){
- return
- }
- clog("RemoteVideoMenu...", $(".popover"),o,a2)
- setTimeout(rvm_to,0,"A")
- // setTimeout(rvm_to,100,"B")
- }
- // RemoteVideoMenu
- // glob_mx.qxi_test
-
- // qxi_cb
-
- function somv_to(a){
- var n
- // $(".overflow-menu").prepend("<hr>")
- if ( !amimod() || 0){
- return
- }
- // clog("rvm_to RemoteVideoMenu...",a, $(".popover"))
- var svg,icon_template
- var jmod_templates_ui_msg = $(mod_templates_ui_msg)
- n = jmod_templates_ui_msg.find(".ovmu_av")
- // n.find(".popup_body").prepend(svg)
- // n.find(".popup_body").prepend(svg)
- // ji_mic_off
- // ji_vid_off
-
- // icon_template = $(jmod_templates_ui_msg.find(".settings-button-container")[0].outerHTML)
- // icon_template.find(".jitsi-icon").append(svg)
- svg = $(`<span>${glob_mx.svg["camera-disabled.svg"]}</span>`).find("svg").addClass("icon_svg")
- clog("svg...",svg,svg[0].width)
- // svg[0].width =24
- // svg[0].height =24
- svg[0].setAttribute("width",20)
- svg[0].setAttribute("height",20)
- n.find(".jitsi-icon.ji_vid_off").append(svg)
- // n.find(".ji2_vid_off").append(svg)
- svg = $(`<span>${glob_mx.svg["mic-disabled.svg"]}</span>`).find("svg").addClass("icon_svg")
- svg[0].setAttribute("width",20)
- svg[0].setAttribute("height",20)
- n.find(".jitsi-icon.ji_mic_off").append(svg)
-
-
-
- svg = $(`<span>${glob_mx.svg["microphone.svg"]}</span>`).find("svg").addClass("icon_svg")
- svg[0].setAttribute("width",20)
- svg[0].setAttribute("height",20)
- n.find(".jitsi-icon.ji_mic_on").append(svg)
-
- svg = $(`<span>${glob_mx.svg["camera.svg"]}</span>`).find("svg").addClass("icon_svg")
- clog("svg...",svg,svg[0].width)
- // svg[0].width =24
- // svg[0].height =24
- svg[0].setAttribute("width",20)
- svg[0].setAttribute("height",20)
- n.find(".jitsi-icon.ji_vid_on").append(svg)
- // n.find(".popup_icons").append(icon_template)
-
-
-
- n.find(".av_io").click(evnt_av_io)
-
- $(".toolbox-content .overflow-menu").prepend(n)
- if ( amimod() || 0){
- n = jmod_templates_ui_msg.find(".ovmu_ff")
- set_ovmu_ff3(n)
- set_ovmu_ff(n)
- // set_ovmu_ff2(n)
- $(".toolbox-content .overflow-menu").prepend(n)
- order_menu()
- }
-
- // refresh_overflow_menu()
- // setTimeout(refresh_overflow_menu_only,300)
- // disp(glob_react.toolbox.setToolbarHovered(!!1))
- // refresh_overflow_menu_only()
-
- // $(".overflow-menu").append(n)
-
-
- }
-
-
-
-
- function order_menu(){
- var ovfm = $(".toolbox-content .overflow-menu")
- $(`[aria-label="Toggle settings"]`).before($(".ovmu_av"))
- // $(`[aria-label="Toggle settings"]`).before("<hr>")
- $(".ovmu_av:first").before("<hr>")
- $(".ovmu_ff:last").after("<hr>")
- // $(".ovmu_spot").after("<hr>")
- // $(".ovmu_spot").before("<hr>")
- // $("..overflow-menu").before("<hr>")
- // $(".overflow-menu").prepend("<hr>")
- $(".spot_focus")[0].checked = msto.conference.force_follow
- // ovfm.append($(".ovmu_spot"))
- }
-
-
-
-
-
-
- function ovmu_change(event){
- var local = get_local().id
- if (local != msto.conference.ff.ff_mod){
- // return
- }
- var type,ivar,name,target
- target = event.target
- ivar = target.dataset.ivar
- type = target.type
- name = target.name
- var ff = msto.conference.ff
-
- // clog("")
- clog("ovmu_change",{that:this,data:event.target.dataset,event,args:[...arguments]},{type,ivar,name,target})
- // return
-
- if (type == "number"){
- ff["number"][ivar] = target.value
-
- } else if (type == "checkbox") {
- ff["checkbox"][ivar] = target.checked
- // target.checked = ff["checkbox"][ivar] || 0
- } else if (type == "radio") {
- // ff[""]
- ff["radio"][name] = ivar
- // if (ff["radio"][name] == ivar) { target.checked = 1 }
- // v.checked = ff["radio"][name] || 0
- }
- if (ivar == "ff_timeout"){
- try {
- glob_mx.timeout.ff_ti.o.timeout = ff["number"][ivar]
- } catch (err){}
- }
-
-
- }
-
-
-
-
-
- tomflag=1
-
-
-
-
-
- function set_ovmu_dflts(n){
- var i,k,v,j
- var type,ivar,name
- var ff = msto.conference.ff
- var local = get_local()
-
-
-
-
-
-
-
-
- clog("set_ovmu_dflts...",$(n),n)
- for (v of $(n)){
- ivar = v.dataset.ivar
- type = v.type
- name = v.name
- if (type == "number"){
- v.value = ff["number"][ivar] || 0
- } else if (type == "checkbox") {
- v.checked = ff["checkbox"][ivar] || 0
- } else if (type == "radio") {
- // ff[""]
- if (ff["radio"][name] == ivar) {
- v.checked = 1
- }
- // v.checked = ff["radio"][name] || 0
-
- } else if (v.classList.contains("ff_mod")){
- if (v.tagName == "SPAN"){
- // $(n).find("span.ff_mod").text(msto.conference.ff.ff_mod || "zzz")
- $(v).text(msto.conference.ff.ff_mod == local.id ? "LOCAL " + local.id : msto.conference.ff.ff_mod )
-
- } else if (v.tagName == "BUTTON") {
- $(v).click(ff_mod_button_cb)
- // $(v).clock()
- }
-
- }
- clog("set_ovmu_dflts",{type,ivar,name})
- }
- // $(n).filter("span.ff_mod").text("z")
-
- }
-
-
-
- function ff_ti(){
- // clog("ff_ti")
- var ff_algo = msto.conference.ff.radio.ff_algo
- if (ff_algo=="ff_none"){
- return
- }
- if (ff_algo == "ff_rand"){
-
- test_focus()
-
- } else if (ff_algo == "ff_ordered"){
- ordered_focus()
-
- }
-
-
- }
-
-
-
- function ff_mod_button_cb(event){
- return
- var part,ff_mod_id
- ff_mod_id = $("span.ff_mod").text()
- part = get_local()
- // if (part.id == ff_mod_id){
- if (part.id == msto.conference.ff.ff_mod){
- msto.conference.ff.ff_mod = null
- $("span.ff_mod").text(msto.conference.ff.ff_mod)
- // $(".id_sideToolbarContainer").removeClass("not_local_ff_mod")
- $(".id_sideToolbarContainer").addClass("not_local_ff_mod")
- } else {
- msto.conference.ff.ff_mod = part.id
- $("span.ff_mod").text("LOCAL " + msto.conference.ff.ff_mod)
- $(".id_sideToolbarContainer").removeClass("not_local_ff_mod")
- new Timeout_cls({
- name:"ff_ti",
- timeout:msto.conference.ff.number.ff_timeout,
- fn:ff_ti,
- "zzz":"da"
- })
- // $(".not_local_ff_mod")
- // if (local == msto.conference.ff.ff_mod){
- // } else {
- // }
- // clog()
- glob_mx.timeout.ff_ti.run()
- // glob_mx
- }
- req_ff_send({ff_mod:msto.conference.ff.ff_mod})
- }
-
- function req_ff_send(o){
-
- tmsgx({
- "type":"event",
- // z:
- "payload":o,
- etype:"req_ff"
- },"code")
- }
- // req_av_send({act:"av_off","to":"all"})
- // req_av_send({to:"all",act:"force_vid_on"})
- //
- function ff_evnt(o){
- return
- var ff_mod = o.parsed.payload.ff_mod
- if (ff_mod != get_local().id){
- delete glob_mx.timeout.ff_ti
- // $(".id_sideToolbarContainer").removeClass("not_local_ff_mod")
- $(".id_sideToolbarContainer").addClass("not_local_ff_mod")
- }
-
- // if (msto.conference.ff.ff_mod)
- clog("ff_evnt",msto.conference.ff.ff_mod,get_local().id,{that:this,o,args:[...arguments]})
- }
-
- glob_mx.event_handlers.ff = {
- fn:ff_evnt,
- // fn:nop,
- // m:{etype:"timer_start"},
- m:{etype:"req_ff"},
- }
- function spot_focus_cb(event){
- clog("spot_focus_cb",{that:this,event},event.target,event.target.checked)
- if (event.target.checked){
- $("input#follow_focus").click()
-
- } else {
- $("input#follow_focus_force").click()
- }
-
- }
-
- function ffcb2(){
- clog("ffcb",this.value,this.checked,[this,...arguments])
- disp(glob_react.base_conference.setFollowMe(this.checked))
- msto.conference.follow_focus = this.checked
- var follow_focus_force=$("#follow_focus_force")[0]
- if (follow_focus_force.checked && !this.checked){
- msto.conference.force_follow = this.checked
- follow_focus_force.checked = this.checked
-
- }
- }
- // force follow focus EventListener
- function fffcb2(){
- var follow_focus=$("#follow_focus")[0]
-
- if (!follow_focus.checked && this.checked){
-
- follow_focus.checked = this.checked
- msto.conference.follow_focus = this.checked
- ffcb.bind(follow_focus)()
- }
- msto.conference.force_follow = this.checked
- }
-
-
- function enable_spotlight(){
- msto.conference.follow_focus = true
- msto.conference.force_follow = true
- disp(glob_react.base_conference.setFollowMe(true))
-
- }
-
- function disable_spotlight(){
-
- msto.conference.follow_focus = false
- msto.conference.force_follow = false
- disp(glob_react.base_conference.setFollowMe(false))
-
-
- }
- function toggle_spotlight(event){
- var bool
- if (this.tagName == "INPUT"){
- bool = this.checked
- } else {
- bool = !msto.conference.force_follow
- }
- clog("toggle_spotlight",{that:this,event,bool,checked:this.checked,tagName:this.tagName})
-
- msto.conference.follow_focus = bool
- msto.conference.force_follow = bool
- disp(glob_react.base_conference.setFollowMe(bool))
- bool ? start_ff_ti() :remove_ff_ti()
-
-
- }
-
-
-
-
-
- function start_ff_ti(){
- new Timeout_cls({
- name:"ff_ti",
- timeout:msto.conference.ff.number.ff_timeout,
- fn:ff_ti,
- "zzz":"da"
- })
- // $(".not_local_ff_mod")
- // if (local == msto.conference.ff.ff_mod){
- // } else {
- // }
- // clog()
- glob_mx.timeout.ff_ti.run()
- }
- function remove_ff_ti(){
- delete glob_mx.timeout.ff_ti
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- function set_ovmu_ff3(n){
- msto.conference.ff ? 0 : msto.conference.ff = {
- number:{
- ff_timeout:5,
- },
-
- radio:{
- ff_algo:"ff_none",
- },
- checkbox:{},
- ff_mod:null,
- // ff_ordered:0,
- // ff_rand:0,
- }
- clog("set_ovmu_ff3.",jc(msto.conference.ff),jc(msto.conference))
- set_ovmu_dflts($(n).find(".ff_inp"))
- var local = get_local().id
- if (local == msto.conference.ff.ff_mod){
- // $(".id_sideToolbarContainer").removeClass("not_local_ff_mod")
- } else {
- // $(".id_sideToolbarContainer").addClass("not_local_ff_mod")
-
- }
- $(n).find(".spot_focus").off("change")
- // $(n).find(".spot_focus").change(spot_focus_cb)
- $(n).find(".spot_focus").change(toggle_spotlight)
-
-
-
- // clog("set_ovmu_ff2",n)
- // $("#sideToolbarContainer").change(ovmu_change)
- // $(".id_sideToolbarContainer").change()
- $(".id_sideToolbarContainer").off("change")
- $(".id_sideToolbarContainer").change(ovmu_change)
-
- }
- function set_ovmu_ff2(n){
- clog("set_ovmu_ff2",n)
- n.change(ovmu_change)
-
- }
-
- function set_ovmu_ff(n){
- msto.conference.rotate_index = msto.conference.rotate_index || 0
-
- n = $(n)
- try {
-
-
- n.find("#num_pseudo")[0].onchange = num_pseudo
- n.find("input#ov_timeout")[0].value=window.msto ? msto.conference.scroll_timeout || 15 : 15
- n.find("#num_pseudo")[0].value= window.msto ? msto.conference.repeat || 0 : 0
-
- // n.find("#scroll_now")[0].onclick = scroll_send
- n.find("#scroll_now")[0].onclick = timeout_scroll_start_now
-
- n.find("input#ov_timeout")[0].onchange = scroll_timeout_runner
- n.find("input#ov_timeout_disable")[0].onchange = scroll_timeout_runner
-
- n.find("input#follow_focus")[0].onchange = ffcb
- n.find("input#follow_focus_force")[0].onchange = fffcb
-
-
-
-
- } catch(err){}
- // clog("zz",n.find("input#ov_timeout")[0].value))
- // value=${window.msto ? msto.conference.scroll_timeout || 15 : 15}
- // value=${window.msto ? msto.conference.repeat || 0 : 0} num p
-
- try_set_state(n)
- }
- // function
-
- glob_mx.qxi_cb["SET_OVERFLOW_MENU_VISIBLE"].fn = function (o,a2){
- if (!window.iammod){return}
- // somv_to()
- // setTimeout(somv_to,0,"A")
- // somv_to("A")
- clog("SET_OVERFLOW_MENU_VISIBLE.",o,$(".overflow-menu"))
- /*
- // ovmu_item
- var jmod_templates_ui_msg = $(mod_templates_ui_msg)
- n = jmod_templates_ui_msg.find(".ovmu_item")
- // n.find(".popup_body").prepend(svg)
- // n.find(".popup_body").prepend(svg)
- $(".overflow-menu").append(n)
- */
-
-
- }
-
- // qxi_cb
-
- /*
- av_io_on
- av_io_off
- av_io_mic
- av_io_vid
- av_io_av
- av_io_all
- av_io_single
-
- */
-
- function evnt_av_io(a,a2,a3){
- var o = {
- act:""
- }
- // if
- var n,j,i,k
- var av_io_on,av_type,av_all_single,av_all
- // var av_all,av_single
-
- j = $(this)
-
- av_io_on = j.hasClass("av_io_on")
- av_all = j.hasClass("av_io_all")
- if (j.hasClass("av_io_mic")){
- av_type = "mic"
- // av_type = "av"
- } else if (j.hasClass("av_io_vid")){
- av_type = "vid"
-
- } else if (j.hasClass("av_io_av")){
- av_type = "av"
-
- }
- o.act += av_type + "_"
- if (av_io_on){
- o.act += "on"
- } else {
- o.act += "off"
-
- }
- if (av_all){
- o.to = "all"
- } else {
- // participant_07b5a03f
- j.parents(".small_vid")[0]
- o.to = j.parents(".small_vid")[0].id.split("_").pop()
- }
- req_av_send(o)
-
- clog("evnt_av_io,,,,",o,{av_io_on,av_type,av_all,vid:j.parents(".small_vid")})
- clog("evnt_av_io",a,a2,a3,this)
- }
-
- function refresh_overflow_menu(){
- toggle_overflow_menu()
- setTimeout(toggle_overflow_menu,100)
- dispatch_evnt(1)
- setTimeout(dispatch_evnt(),50)
-
- }
- function refresh_overflow_menu_only(){
- toggle_overflow_menu()
- setTimeout(toggle_overflow_menu,100)
- // dispatch_evnt(1)
- // setTimeout(dispatch_evnt(),50)
-
- }
-
-
-
-
-
- console.log("R1",$("#sharedVideoIFrame")[0].contentWindow)
- // dispatch_evnt()
- // refresh_overflow_menu()
- // toggle_overflow_menu()
-
-
|