Browse Source

ign4

master
jfinn 4 years ago
commit
bb056448a2
100 changed files with 21640 additions and 0 deletions
  1. 1
    0
      New_folder/ntd.txt
  2. 249
    0
      baks/fbp_reducer.js
  3. 390
    0
      clone/cui5.js
  4. 41
    0
      clone/fake_resize.js
  5. 313
    0
      clone/fs.css
  6. 87
    0
      clone/fs_hook.js
  7. 10
    0
      clone/inspect_utils.js
  8. 139
    0
      clone/m/_m_utils.js
  9. 302
    0
      clone/m/_m_utils0.js
  10. 286
    0
      clone/m/m_api.js
  11. 239
    0
      clone/m/m_api_html.js
  12. 146
    0
      clone/m/m_const.js
  13. 135
    0
      clone/m/m_req.js
  14. 713
    0
      clone/m/m_utils.js
  15. 418
    0
      clone/m/mdev.js
  16. 60
    0
      clone/m/moveto.js
  17. 0
    0
      clone/m/timer/New Text Document.txt
  18. 145
    0
      clone/m/timer/m.css
  19. 156
    0
      clone/m/timer/m.html
  20. 278
    0
      clone/m/timer/m.js
  21. 755
    0
      clone/m/timer/m0.js
  22. 16
    0
      clone/m/timer/mod_de_utils.js
  23. 0
    0
      clone/m/timer/rhtml.html
  24. 168
    0
      clone/preload.js
  25. 91
    0
      clone/proto_ext.js
  26. 84
    0
      clone/r0.css
  27. 287
    0
      clone/r0.js
  28. 41
    0
      clone/r1.js
  29. 220
    0
      clone/r2.js
  30. 183
    0
      clone/react_fn.js
  31. 354
    0
      clone/resize_hook.js
  32. 156
    0
      clone/toy.js
  33. 16
    0
      clone/universals.js
  34. 390
    0
      cui5.js
  35. 449
    0
      custom_resize.js
  36. 323
    0
      deep_walk.js
  37. 461
    0
      deep_walk2.js
  38. 15
    0
      efile.js
  39. 592
    0
      fs.css
  40. 84
    0
      fs_hook.js
  41. 85
    0
      i4/i11.html
  42. 51
    0
      i4/lobby.js
  43. 38
    0
      inspect_utils.js
  44. 10
    0
      junk_dev
  45. 253
    0
      junk_dev.js
  46. 302
    0
      m/_m_utils.js
  47. 311
    0
      m/m_api.js
  48. 239
    0
      m/m_api_html.js
  49. 146
    0
      m/m_const.js
  50. 172
    0
      m/m_req.js
  51. 715
    0
      m/m_utils.js
  52. 418
    0
      m/mdev.js
  53. 0
    0
      m/timer/New Text Document.txt
  54. 426
    0
      m/timer/m.css
  55. 156
    0
      m/timer/m.html
  56. 475
    0
      m/timer/m.js
  57. 913
    0
      m/timer/m0.js
  58. 0
    0
      m/timer/rhtml.html
  59. 253
    0
      preload.js
  60. 91
    0
      proto_ext.js
  61. 250
    0
      proxy_dev.js
  62. 102
    0
      proxy_dev2.js
  63. 83
    0
      quick_tiling_fix.js
  64. 151
    0
      r0.css
  65. 287
    0
      r0.js
  66. 92
    0
      r0a.css
  67. 327
    0
      r0b.js
  68. 716
    0
      r0c.js
  69. 537
    0
      r0d.js
  70. 427
    0
      r0e.js
  71. 33
    0
      r1.js
  72. 217
    0
      r2.js
  73. 144
    0
      r2t.js
  74. 173
    0
      react_fn.js
  75. 5
    0
      redir.css
  76. 235
    0
      resize_hook.b.js
  77. 344
    0
      resize_hook.js
  78. 401
    0
      resize_proto.js
  79. 225
    0
      rf/class_dec.js
  80. 41
    0
      rf/fake_resize.js
  81. 150
    0
      rf/filmstrip_mod/m.css
  82. 156
    0
      rf/filmstrip_mod/m.html
  83. 417
    0
      rf/filmstrip_mod/m.js
  84. 821
    0
      rf/filmstrip_mod/m0.js
  85. 327
    0
      rf/fs.css
  86. 87
    0
      rf/fs_hook.js
  87. 94
    0
      rf/i4m/m.css
  88. 31
    0
      rf/i4m/m.html
  89. 87
    0
      rf/i4m/m.js
  90. 0
    0
      rf/i4m/m0.js
  91. 3
    0
      rf/idev/i8.js
  92. BIN
      rf/img/image.png
  93. BIN
      rf/img/image_opace.png
  94. BIN
      rf/img/img3.jpg
  95. 20
    0
      rf/inspect_utils.js
  96. 251
    0
      rf/jquery.corner.js
  97. 130
    0
      rf/keyboard_dev_fn.js
  98. 139
    0
      rf/m/_m_utils.js
  99. 290
    0
      rf/m/m_api.js
  100. 0
    0
      rf/m/m_req.js

+ 1
- 0
New_folder/ntd.txt View File

@@ -0,0 +1 @@
1
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

+ 249
- 0
baks/fbp_reducer.js View File

@@ -0,0 +1,249 @@
1
+// @flow
2
+
3
+import { ReducerRegistry, set } from '../redux';
4
+
5
+import {
6
+    DOMINANT_SPEAKER_CHANGED,
7
+    PARTICIPANT_ID_CHANGED,
8
+    PARTICIPANT_JOINED,
9
+    PARTICIPANT_LEFT,
10
+    PARTICIPANT_UPDATED,
11
+    PIN_PARTICIPANT,
12
+    SET_LOADABLE_AVATAR_URL
13
+} from './actionTypes';
14
+import { LOCAL_PARTICIPANT_DEFAULT_ID, PARTICIPANT_ROLE } from './constants';
15
+
16
+/**
17
+ * Participant object.
18
+ * @typedef {Object} Participant
19
+ * @property {string} id - Participant ID.
20
+ * @property {string} name - Participant name.
21
+ * @property {string} avatar - Path to participant avatar if any.
22
+ * @property {string} role - Participant role.
23
+ * @property {boolean} local - If true, participant is local.
24
+ * @property {boolean} pinned - If true, participant is currently a
25
+ * "PINNED_ENDPOINT".
26
+ * @property {boolean} dominantSpeaker - If this participant is the dominant
27
+ * speaker in the (associated) conference, {@code true}; otherwise,
28
+ * {@code false}.
29
+ * @property {string} email - Participant email.
30
+ */
31
+
32
+declare var APP: Object;
33
+
34
+/**
35
+ * The participant properties which cannot be updated through
36
+ * {@link PARTICIPANT_UPDATED}. They either identify the participant or can only
37
+ * be modified through property-dedicated actions.
38
+ *
39
+ * @type {string[]}
40
+ */
41
+const PARTICIPANT_PROPS_TO_OMIT_WHEN_UPDATE = [
42
+
43
+    // The following properties identify the participant:
44
+    'conference',
45
+    'id',
46
+    'local',
47
+
48
+    // The following properties can only be modified through property-dedicated
49
+    // actions:
50
+    'dominantSpeaker',
51
+    'pinned'
52
+];
53
+
54
+/**
55
+ * Listen for actions which add, remove, or update the set of participants in
56
+ * the conference.
57
+ *
58
+ * @param {Participant[]} state - List of participants to be modified.
59
+ * @param {Object} action - Action object.
60
+ * @param {string} action.type - Type of action.
61
+ * @param {Participant} action.participant - Information about participant to be
62
+ * added/removed/modified.
63
+ * @returns {Participant[]}
64
+ */
65
+ReducerRegistry.register('features/base/participants', (state = [], action) => {
66
+    var ret
67
+    switch (action.type) {
68
+    case SET_LOADABLE_AVATAR_URL:
69
+    case DOMINANT_SPEAKER_CHANGED:
70
+    case PARTICIPANT_ID_CHANGED:
71
+    case PARTICIPANT_UPDATED:
72
+    case PIN_PARTICIPANT:
73
+        // var ret2 = _participant(p, action)
74
+        // ret =state.map(p => ret2);
75
+        ret =state.map(p => _participant(p, action));
76
+        ret = new Proxy(ret,gen_proxy())
77
+        // clog("ATYPE",{ret,ret2,p ,action})
78
+        clog("ATYPE",action.type,{ret})
79
+        return ret
80
+        // return state.map(p => _participant(p, action));
81
+
82
+
83
+    case PARTICIPANT_JOINED:
84
+            // dev inspect
85
+        const participant_new = _participantJoined(action)
86
+        clog("PARTICIPANT_JOINED RFN dev inspect",{state,action,participant_new})
87
+        ret = [ ...state, participant_new ]
88
+        clog("PARTICIPANT_JOINED RFN dev inspect2",ret)
89
+        ret = new Proxy(ret,gen_proxy())
90
+        clog("PARTICIPANT_JOINED RFN dev inspect3",ret)
91
+        // const ret = new Proxy([ ...state, participant_new ],rprox)
92
+        return ret;
93
+        // return [ ...state, _participantJoined(action) ];
94
+
95
+    case PARTICIPANT_LEFT: {
96
+        // XXX A remote participant is uniquely identified by their id in a
97
+        // specific JitsiConference instance. The local participant is uniquely
98
+        // identified by the very fact that there is only one local participant
99
+        // (and the fact that the local participant "joins" at the beginning of
100
+        // the app and "leaves" at the end of the app).
101
+        const { conference, id } = action.participant;
102
+
103
+        return state.filter(p =>
104
+            !(
105
+                p.id === id
106
+
107
+                    // XXX Do not allow collisions in the IDs of the local
108
+                    // participant and a remote participant cause the removal of
109
+                    // the local participant when the remote participant's
110
+                    // removal is requested.
111
+                    && p.conference === conference
112
+                    && (conference || p.local)));
113
+    }
114
+    }
115
+
116
+    return state;
117
+});
118
+
119
+/**
120
+ * Reducer function for a single participant.
121
+ *
122
+ * @param {Participant|undefined} state - Participant to be modified.
123
+ * @param {Object} action - Action object.
124
+ * @param {string} action.type - Type of action.
125
+ * @param {Participant} action.participant - Information about participant to be
126
+ * added/modified.
127
+ * @param {JitsiConference} action.conference - Conference instance.
128
+ * @private
129
+ * @returns {Participant}
130
+ */
131
+function _participant(state: Object = {}, action) {
132
+    switch (action.type) {
133
+    case DOMINANT_SPEAKER_CHANGED:
134
+        // Only one dominant speaker is allowed.
135
+        return (
136
+            set(state, 'dominantSpeaker', state.id === action.participant.id));
137
+
138
+    case PARTICIPANT_ID_CHANGED: {
139
+        // A participant is identified by an id-conference pair. Only the local
140
+        // participant is with an undefined conference.
141
+        const { conference } = action;
142
+
143
+        if (state.id === action.oldValue
144
+                && state.conference === conference
145
+                && (conference || state.local)) {
146
+            return {
147
+                ...state,
148
+                id: action.newValue
149
+            };
150
+        }
151
+        break;
152
+    }
153
+
154
+    case SET_LOADABLE_AVATAR_URL:
155
+    case PARTICIPANT_UPDATED: {
156
+        const { participant } = action; // eslint-disable-line no-shadow
157
+        let { id } = participant;
158
+        const { local } = participant;
159
+
160
+        if (!id && local) {
161
+            id = LOCAL_PARTICIPANT_DEFAULT_ID;
162
+        }
163
+
164
+        if (state.id === id) {
165
+            const newState = { ...state };
166
+
167
+            for (const key in participant) {
168
+                if (participant.hasOwnProperty(key)
169
+                        && PARTICIPANT_PROPS_TO_OMIT_WHEN_UPDATE.indexOf(key)
170
+                            === -1) {
171
+                    newState[key] = participant[key];
172
+                }
173
+            }
174
+
175
+            return newState;
176
+        }
177
+        break;
178
+    }
179
+
180
+    case PIN_PARTICIPANT:
181
+        // Currently, only one pinned participant is allowed.
182
+        return set(state, 'pinned', state.id === action.participant.id);
183
+    }
184
+
185
+    return state;
186
+}
187
+
188
+/**
189
+ * Reduces a specific redux action of type {@link PARTICIPANT_JOINED} in the
190
+ * feature base/participants.
191
+ *
192
+ * @param {Action} action - The redux action of type {@code PARTICIPANT_JOINED}
193
+ * to reduce.
194
+ * @private
195
+ * @returns {Object} The new participant derived from the payload of the
196
+ * specified {@code action} to be added into the redux state of the feature
197
+ * base/participants after the reduction of the specified
198
+ * {@code action}.
199
+ */
200
+function _participantJoined({ participant }) {
201
+    const {
202
+        avatarID,
203
+        avatarURL,
204
+        botType,
205
+        connectionStatus,
206
+        dominantSpeaker,
207
+        email,
208
+        isFakeParticipant,
209
+        isJigasi,
210
+        loadableAvatarUrl,
211
+        local,
212
+        name,
213
+        pinned,
214
+        presence,
215
+        role
216
+    } = participant;
217
+    let { conference, id } = participant;
218
+
219
+    if (local) {
220
+        // conference
221
+        //
222
+        // XXX The local participant is not identified in association with a
223
+        // JitsiConference because it is identified by the very fact that it is
224
+        // the local participant.
225
+        conference = undefined;
226
+
227
+        // id
228
+        id || (id = LOCAL_PARTICIPANT_DEFAULT_ID);
229
+    }
230
+
231
+    return {
232
+        avatarID,
233
+        avatarURL,
234
+        botType,
235
+        conference,
236
+        connectionStatus,
237
+        dominantSpeaker: dominantSpeaker || false,
238
+        email,
239
+        id,
240
+        isFakeParticipant,
241
+        isJigasi,
242
+        loadableAvatarUrl,
243
+        local: local || false,
244
+        name,
245
+        pinned: pinned || false,
246
+        presence,
247
+        role: role || PARTICIPANT_ROLE.NONE
248
+    };
249
+}

+ 390
- 0
clone/cui5.js View File

@@ -0,0 +1,390 @@
1
+
2
+
3
+
4
+
5
+twsfn5 = window.twsfn5 || {}
6
+
7
+vc2 = {
8
+    key:"key",
9
+}
10
+
11
+
12
+
13
+
14
+
15
+
16
+if (!window.gws){
17
+    window.gws = {
18
+        sockets:{},
19
+    }
20
+}
21
+gws.twsfn5 = twsfn5
22
+
23
+// gws
24
+
25
+
26
+
27
+
28
+// Object.keys(twsfn5_bak)
29
+// Object.keys(twsfn5)
30
+
31
+// Object.keys(twsfn5_bak) +"" == Object.keys(twsfn5)+""
32
+
33
+
34
+
35
+
36
+function connect_helper5(){
37
+        var o = {  
38
+            // ':8943/ws/vts/'
39
+            // url:'wss://' + window.location.host + '/ws/vts2/' + window.roomName.toLowerCase() + '/?CONN',
40
+            url:'wss://' + window.location.host + ':8943/ws/vts2/' + window.roomName.toLowerCase() + '/?CONN',
41
+            wsfn:twsfn5,
42
+            name:"ws_n15",
43
+        }
44
+        clog("o",o)
45
+        connect_ws_arg(o)
46
+}
47
+
48
+
49
+
50
+
51
+
52
+// connect_ws_arg()
53
+
54
+
55
+        // 'wss://' + window.location.host +
56
+        // '/ws/vts/' + window.roomName + '/?qqAAAAAAAAAAAAAAAAA'
57
+
58
+
59
+
60
+
61
+    twsfn5.ts_t2x = function(data) {
62
+        clog("ts_t2x",data)
63
+        var k,v
64
+        for ([k,v] of Object.entries(data.obj.times)){
65
+            clog(k,v.t - data.obj.t0 )
66
+        }
67
+    }
68
+
69
+
70
+    twsfn5.ts_t0x = function(data) {
71
+        // clog("pub_msg",pub_msg)
72
+        var msg = {}
73
+        msg[vc2.key] = "ts_t1"
74
+        twsfn5.s(msg)
75
+    }
76
+
77
+    twsfn5.ts_test = function(data) {
78
+        // clog("pub_msg",pub_msg)
79
+        // var msg = {}
80
+        // msg[vc2.key] = "ts_t1"
81
+        // twsfn.s(msg)
82
+        clog("jx twsfn5.ts_test TEST")
83
+    }
84
+
85
+    twsfn5.pub_msg = function(data) {
86
+        clog("pub_msg",data)
87
+        // var msg = {}
88
+        // msg[vc2.key] = "pong"
89
+        // twsfn5.s(msg)
90
+    }
91
+
92
+
93
+
94
+
95
+
96
+
97
+    twsfn5.qdb_got = function(data) {
98
+        clog("jx qdb_data",data)
99
+        clog("jx qdb_got",data.obj)
100
+        clog(data.obj)
101
+    }
102
+
103
+    twsfn5.qdb_got3 = function(data) {
104
+        clog("jx qdb_data",data)
105
+        clog("jx qdb_got",data.obj)
106
+        clog("~jx~",data.obj.participants,data.obj.corners)
107
+    }
108
+
109
+    twsfn5.recv_corners = function(data) {
110
+        // clog("jx qdb_data",data)
111
+        // clog("jx qdb_got",data.obj)
112
+        glob_corner.corners=data.obj.corners
113
+        cad_ts5r()
114
+        clog("~jx~",data.obj.participants,data.obj.corners)
115
+    }
116
+
117
+    twsfn5.pingpong = function(data) {
118
+        // clog("VFB5 PONG2!")
119
+
120
+        var msg = {}
121
+        msg[vc2.key] = "pong"
122
+        twsfn5.s(msg)
123
+    }
124
+
125
+
126
+
127
+
128
+    twsfn5.onmessage = function(e) {
129
+        var recv_ts_u0 = window.performance.now()
130
+        var recv_ts = Date.now()
131
+        var recv_ts_u1 = window.performance.now()
132
+        // clog("VFB MSG",e)
133
+
134
+        // clog()
135
+        // return
136
+        var data = JSON.parse(e.data);
137
+        data.recv_ts = recv_ts
138
+        data.recv_ts_u0 = recv_ts_u0
139
+        data.recv_ts_u1 = recv_ts_u1
140
+        if (data.type != "pingpong"){
141
+            // clog("ixq twsfn5.onmessage")
142
+        }
143
+        // clog("VFB data",data)
144
+        // clog("WS ONMSG",data)
145
+        if (data.message != undefined){
146
+            // twsfn5.on_chat_message(data)
147
+        }
148
+        if (data.type != undefined && twsfn5[data.type]){
149
+            twsfn5[data.type](data,e)
150
+
151
+        } else {
152
+            clog("VFB data",data)
153
+        }
154
+    };
155
+
156
+    twsfn5.onopen = function(e) {
157
+        clog("jx ONCON...")
158
+        chatSocket.onopen
159
+        // clog("jx ONCON....")
160
+        // window.qdb ? onconnect : console.err("ERR no qdb")
161
+        // window.qdb ? window.qdb.onconnect() : console.error(" jx ERR no qdb")
162
+        window.qdb ? window.qdb.onconnect_2() : console.error(" jx ERR no qdb")
163
+        // console.error(" jx ERR test")
164
+        // console.error(" jx ERR test2")
165
+        // clog("jx ONCON... fin")
166
+    }
167
+    twsfn5.onclose = function(e) {
168
+        console.error('VFB2 vChat socket closed unexpectedly');
169
+        setTimeout(connect_helper5,1400)
170
+        // setTimeout(vconnect_ws,1400)
171
+    };
172
+
173
+
174
+ twsfn5.s=   function(o){
175
+
176
+        if (o.key != "pong"){
177
+            // clog("ixq twsfn5.send")
178
+        }
179
+
180
+    var vchatSocket = gws.sockets["ws_n15"]
181
+        // .send(JSON.stringify(o));
182
+        // twsfn5.s0 =
183
+         vchatSocket.send(JSON.stringify(o));
184
+    }
185
+
186
+// s =twsfn5.s
187
+// vconnect_ws()
188
+
189
+
190
+
191
+
192
+
193
+
194
+// delete qdb
195
+{
196
+
197
+class QDB {
198
+    constructor(){
199
+        this.db = {}
200
+    }
201
+    onconnect(){
202
+
203
+        qdb.get_corners()
204
+    }
205
+    onconnect_2(){
206
+        clog("JX onconnect_2")
207
+        // qdb.get_corners()
208
+        // setTimeout(this.get_corners.bind(this,1000))
209
+
210
+        setTimeout(this.get_corners.bind(this),100)
211
+        setTimeout(this.get_corners.bind(this),2000)
212
+        get_cui_html(rldi.files["cui3.html"])
213
+
214
+        // setTimeout(this.get_corners.bind(this,1000))
215
+        // setTimeout(this.get_corners.bind(this,))
216
+        // setTimeout(qdb.get_corners.bind(this,100)
217
+
218
+        // qdb.get_corners()
219
+    }
220
+
221
+    send(o){
222
+        twsfn5.s(o)
223
+    }
224
+    q(action){
225
+        this.send({"key":"qdb","action":action})
226
+
227
+    }
228
+    get_db(){
229
+        this.send({"key":"qdb","action":"get_db"})
230
+
231
+    }
232
+    get_db2(){
233
+        this.send({"key":"qdb","action":"get_db2"})
234
+
235
+    }
236
+
237
+    
238
+    set_db(){
239
+        this.send({"key":"qdb","action":"set_db"})
240
+
241
+    }
242
+
243
+    update(){
244
+
245
+    }
246
+    proc_response(data){
247
+        clog("jx proc_response",data)
248
+    }
249
+
250
+    updated(){
251
+
252
+    }
253
+
254
+    set_corners(corner_name){
255
+        this.send({"key":"qdb","action":"set_corners","corner_name":corner_name})
256
+    }
257
+    get_corners(corner_name){
258
+        clog("jx get_corners abc 123",this)
259
+        this.send({"key":"qdb","action":"get_corners"})
260
+    }
261
+    add_corner(corner_name){
262
+        this.send({"key":"qdb","action":"add_corner","corner_name":corner_name})
263
+    }
264
+    remove_corner(corner_name){
265
+        this.send({"key":"qdb","action":"remove_corner","corner_name":corner_name})
266
+    }
267
+    move(corner_name){
268
+        this.send({"key":"qdb","action":"move","corner_name":corner_name})
269
+    }
270
+
271
+
272
+    time_sync(){
273
+        clog("TIME SYNC")
274
+        // Date.now()
275
+
276
+
277
+        this.send({"key":"qdb","action":"time_sync","t0":Date.now(),"t0_u":window.performance.now()})
278
+    }
279
+
280
+    // server_ts
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+}
290
+window.QDB = QDB
291
+}
292
+function replace_proto(){
293
+    window.qdb.__proto__ = QDB.prototype
294
+    var vchatSocket = gws.sockets["ws_n15"]
295
+    var wsfn = twsfn5
296
+
297
+    vchatSocket.onmessage = wsfn.onmessage
298
+    vchatSocket.onclose = wsfn.onclose  
299
+    vchatSocket.onopen = wsfn.onopen  
300
+
301
+}
302
+if (!window.qdb){
303
+    window.qdb = new QDB()
304
+
305
+} 
306
+
307
+
308
+
309
+
310
+window.QDB_def0 = QDB + ""
311
+if (window.QDB_def0 != window.QDB_def){
312
+    if (window.QDB_def){
313
+
314
+window.QDB_def = QDB + ""
315
+replace_proto()
316
+    }
317
+window.QDB_def = QDB + ""
318
+}
319
+if (window.qdb){
320
+    twsfn5.client_qbd = window.qdb.proc_response
321
+}
322
+
323
+twsfn5.get_db = function(){
324
+
325
+}
326
+twsfn5.server_ts = function(data,e){
327
+    var ts_u1 = window.performance.now()
328
+
329
+    var t1 = Date.now()
330
+    var t0 = data.req.t0
331
+    var ts = data.server_time
332
+    var tsx =ts * 1000
333
+    var ta = (t0+t1)/2
334
+    tsd = new Date(ts*1000)
335
+    t0d = new Date(t0)
336
+    t1d = new Date(t1)
337
+    td2 = ta - tsx
338
+    td  =  tsx - ta
339
+    tarr = [[t1,"t1"],[tsx,"tsx"],[t0,"t0"],[ta,"ta"],[td,"td"],[td2,"td2"]]
340
+    tobj = {t1,tsx,t0,ta,td,td2}
341
+
342
+    clog("ts:",t1 - data.recv_ts,ts_u1- data.recv_ts_u1,data)
343
+    // clog("ts:",{t0,ts,t1})
344
+
345
+    // clog("ts3:",(t0+t1)/2 - (ts *1000),t0 - t1)
346
+
347
+    t01 = t0 - t1
348
+    t01_u = data.req.t0_u - ts_u1
349
+
350
+    clog("ts3:",(t0+t1)/2 - tsx,t0-tsx,t1-tsx,t0 - t1)
351
+    if (!qdb.td){
352
+        qdb.td = 0
353
+    }
354
+    clog("ts4:",qdb.td - td,"~",qdb.td,td)
355
+    clog("ts5:",t01,t01_u)
356
+    qdb.td = td
357
+    qdb.td2 = td2
358
+    if (window.clock_info_draw){
359
+        clock_info_draw()
360
+    }
361
+
362
+}
363
+twsfn5.update_db = function(){}
364
+twsfn5.updated_db = function(){}
365
+
366
+
367
+
368
+
369
+
370
+function rld_continues(){
371
+    clog("vfb jx RC")
372
+    if (window.stop_flag){
373
+        return 
374
+    }
375
+    twsfn5.s({"key":"rld"})
376
+    setTimeout(rld_continues,500)
377
+}
378
+
379
+
380
+
381
+
382
+
383
+// connect_helper5()
384
+
385
+
386
+
387
+// setTimeout
388
+
389
+
390
+clog("BX5")

+ 41
- 0
clone/fake_resize.js View File

@@ -0,0 +1,41 @@
1
+
2
+// make the App think you resized the window
3
+function dispatch_resize(store = APP.store) {
4
+        // store.dispatch(clientResized_dev(innerWidth, innerHeight));
5
+        store.dispatch({
6
+        type: "CLIENT_RESIZED",
7
+        clientHeight:innerHeight,
8
+        clientWidth:innerWidth,
9
+    });
10
+        // clog("dispatch_resize")
11
+}
12
+
13
+// unused old fn to add pseudo videos
14
+function add_spans(n=1,xtra=0){
15
+	var s = `
16
+	<span class="pseudo_vid videocontainer"></span>
17
+	`
18
+	$(".pseudo_vid").remove()
19
+	if (!xtra){
20
+	n = n - APP.store.getState()["features/base/participants"].length
21
+	}
22
+	var k,v
23
+	for (var i = 0; i < n; i++) {
24
+		// Things[i]
25
+		clog("..",i)
26
+	$("#filmstripRemoteVideosContainer").append(s)
27
+	}
28
+	dispatch_resize()
29
+}
30
+
31
+
32
+
33
+
34
+
35
+
36
+fs_dec_list = [
37
+"resizeThumbnailsForHorizontalView",
38
+"resizeThumbnailsForVerticalView",
39
+// "resizeThumbnailsForTileView",
40
+]
41
+dec_fns = {}

+ 313
- 0
clone/fs.css View File

@@ -0,0 +1,313 @@
1
+
2
+
3
+.tile-view #filmstripRemoteVideos {
4
+	margin: 135 0 100 0;
5
+}
6
+
7
+
8
+
9
+
10
+
11
+.vid_container > .small_vid {
12
+	display: inline-block;
13
+}
14
+
15
+
16
+
17
+.small_vid{
18
+	/*box-sizing: content-box;*/
19
+	box-sizing: border-box;
20
+	margin: 4px 5px;/
21
+	/*background-clip: border-box;*/
22
+	background-clip: content-box;
23
+	outline: unset;
24
+}
25
+.dev_filmstrip {
26
+	height: 100%;
27
+	width: 100%;
28
+	position: absolute;
29
+	display: inline-flex;
30
+    align-items: center;
31
+    justify-content: center;
32
+}
33
+
34
+
35
+
36
+.vid_container{
37
+	z-index: 6;
38
+}
39
+
40
+
41
+
42
+
43
+
44
+.ic4  {
45
+	/*vertical-align: */
46
+	vertical-align: middle;
47
+	text-align: center;
48
+	/*outline: 2px solid red;*/
49
+
50
+	align-items: center;
51
+	/*margin: auto;*/
52
+	display: flex;
53
+	/*flex-wrap: */
54
+}
55
+
56
+.ic4 .small_vid  {
57
+	display: inline-block !important;
58
+	margin: auto;
59
+}
60
+
61
+
62
+
63
+.fs_container{
64
+	position: relative;
65
+	display: inline-block;
66
+	height: 100%;
67
+	margin: auto;
68
+
69
+}
70
+
71
+#sharedVideoIFrame {
72
+	width: 100% !important;
73
+	height: 100% !important;
74
+}
75
+
76
+#videospace{
77
+	vertical-align: center;
78
+	--lvw: 100% !important;;
79
+}
80
+ 
81
+.youtube_vid {
82
+	outline: 5px dotted red;
83
+}
84
+
85
+
86
+
87
+.ic1 {
88
+
89
+  display: flex;
90
+  justify-content: center;
91
+
92
+	justify-content:center;
93
+
94
+}
95
+
96
+
97
+
98
+#sharedVideoIFrame,#sharedVideo {
99
+	display: unset !important;
100
+	opacity: 1 !important;
101
+}
102
+
103
+#largeVideoWrapper {
104
+	width: 100% !important;
105
+	height: 100% !important;
106
+	top: 0 !important;
107
+	bottom: 0 !important;
108
+	left: 0 !important;
109
+	right: 0 !important;
110
+}
111
+
112
+.large-video-background{
113
+	display: none !important;
114
+}
115
+
116
+
117
+.indicator_hook {
118
+pointer-events: none;
119
+}
120
+
121
+
122
+.vid_toptoolbar_hook {
123
+	position: absolute;
124
+}
125
+
126
+
127
+#toggleFilmstripButton,[aria-label="Toggle tile view"] {
128
+	display: none !important;
129
+}
130
+
131
+.videocontainer__toptoolbar{
132
+	z-index: auto !important;
133
+}
134
+
135
+
136
+/* this is important this covers large video  */
137
+.cont.c4{
138
+	z-index: 0;
139
+}
140
+
141
+
142
+.dev_hook:not(.vspace,.top_toolbox){
143
+	display: none;
144
+}
145
+.xbox {
146
+	display: none ;
147
+
148
+}
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+.vid_toptoolbar_hook{
157
+	width: 100%;
158
+	height: 0%;
159
+	padding-bottom: 56.25%;
160
+}
161
+
162
+
163
+
164
+
165
+
166
+.outline_indicator{
167
+	/*outline: 1px solid #0000;*/
168
+	outline: 2px solid #000;
169
+	outline: 0px solid #fff;
170
+	outline-offset: -15px;
171
+	--voffc: -3px; 
172
+	--voff:  2px;
173
+	--voffw: 2px; 
174
+	width: 100%;
175
+	height: 100%;
176
+	position: absolute;
177
+
178
+}
179
+
180
+.active-speaker .outline_indicator.ind_1{
181
+	outline-offset: 5px;
182
+	outline-offset: calc((var(--voff) * 3 ) + var(--voffc));
183
+	outline-width: var(--voffw);
184
+	outline-color: #0ff;
185
+}
186
+.videoContainerFocused .outline_indicator.ind_2{
187
+	outline-offset: 3px;
188
+	outline-offset: calc((var(--voff) * 2 ) + var(--voffc));
189
+	outline-width: var(--voffw);
190
+	outline-color: #f00;
191
+}
192
+.local_vid .outline_indicator.ind_3{
193
+	outline-offset: 1px;
194
+	outline-offset: calc((var(--voff) * 1 ) + var(--voffc));
195
+	outline-width: var(--voffw);
196
+	outline-color: #fff;
197
+}
198
+
199
+
200
+
201
+
202
+
203
+.remote-video-menu-trigger, .remotevideomenu {
204
+	z-index: 10;
205
+}
206
+
207
+.follow_focus {
208
+	z-index: 20;
209
+	position: absolute;
210
+	left: 250px;
211
+	pointer-events:auto;
212
+
213
+}
214
+
215
+.follow_focus2 {
216
+	z-index: 20;
217
+	position: absolute;
218
+	right: 100px;
219
+	pointer-events:auto;
220
+
221
+}
222
+
223
+.dev_hook.top_toolbox{
224
+	pointer-events: none;
225
+	z-index: -1;
226
+}
227
+
228
+
229
+#react > div {
230
+		/*background-color: rgb(27, 38, 56);*/
231
+		/*background-color: rgb(71, 71, 71);*/
232
+		background-color: #374757;
233
+}
234
+
235
+
236
+.new-toolbox .toolbox-background {
237
+/*
238
+    background-image: linear-gradient(to top,rgba(0,0,0,.6),rgba(0,0,0,.4),rgba(0,0,0,.1),rgba(0,0,0,0));
239
+
240
+
241
+    --vr0: rgba(0,0,0,1);
242
+    --vr1: rgba(0,0,0,.6);
243
+    --vr2: rgba(0,0,0,.4);
244
+    --vr3: rgba(0,0,0,0);
245
+
246
+    background-image: linear-gradient(to top,rgba(0,0,0,1),rgba(0,0,0,.5),rgba(0,0,0,.2),rgba(0,0,0,0));
247
+*/
248
+
249
+    --vr0:  rgba(0,0,0,1)  0%;
250
+    --vr1:  rgba(0,0,0,.6) 25%;
251
+    --vr2:  rgba(0,0,0,.3) 55%;
252
+    --vr3:  rgba(0,0,0,0)  100%;
253
+
254
+    background-image: linear-gradient(to top,var(--vr0),var(--vr1),var(--vr2),var(--vr3));
255
+}
256
+.button-group-center {
257
+	position: relative;
258
+}
259
+
260
+
261
+
262
+/*
263
+.il {
264
+	outline: 4px inset #ff0;
265
+}
266
+
267
+.ir {
268
+	outline: 4px inset #f00;
269
+	
270
+}
271
+
272
+
273
+.ilr {
274
+	outline: 4px inset #0ff;
275
+}
276
+
277
+.ir0 {
278
+	border-radius: 30px;
279
+}
280
+
281
+.il0 {
282
+	border-radius: 30px;
283
+}
284
+.ic3 {
285
+	background: #ff08;
286
+
287
+}
288
+.ic2 {
289
+	background: #00f8;
290
+
291
+}
292
+*/
293
+
294
+
295
+
296
+.follow_focus,.follow_focus2 {
297
+	background-color: #0008;
298
+}
299
+
300
+
301
+.inline_input {
302
+	display: inline;
303
+}
304
+
305
+#ov_timeout,#num_pseudo{
306
+	width: 4em;
307
+}
308
+
309
+/*.presence-label, */
310
+
311
+.subject {
312
+	overflow: visible;
313
+}

+ 87
- 0
clone/fs_hook.js View File

@@ -0,0 +1,87 @@
1
+
2
+
3
+
4
+
5
+function resize_filmstrips(that,fn_name,args=[]){
6
+
7
+}
8
+function resize_filmstrips2(that,fn_name,args=[]){
9
+	
10
+}
11
+
12
+
13
+glob_mx.filmstrip_handlers = glob_mx.filmstrip_handlers || {}
14
+glob_mx.filmstrip_tile_handlers = glob_mx.filmstrip_tile_handlers || {}
15
+
16
+
17
+
18
+// run callbacks for all filmstrips on resize
19
+function resizeThumbnailsForCustomView(that,fn_name,args=[]){
20
+    const thumbs = glob_react.Filmstrip._getThumbs()
21
+    const all_thumbs = $(".small_vid")
22
+    const custom_thumbs = all_thumbs.not(thumbs.remlocThumbs)
23
+    const vid_containers = $(".vid_container")
24
+    const loose_thumbs = custom_thumbs.not(vid_containers.children())
25
+    var k,v 
26
+    let fs_handler_key
27
+    let fs_handler 
28
+    let fs_tile_handler
29
+    let fs_handlers = new Map()
30
+    let i
31
+    // console.trace("rtscv...")
32
+
33
+    let fs_tile_handlers = []
34
+    for (v of vid_containers){
35
+      // clog(":",v,v.dataset.fs_type)
36
+      fs_handler_key = v.dataset.fs_handler
37
+      // clog("~",v,v.dataset,fs_handler)
38
+      fs_tile_handler = glob_mx.filmstrip_tile_handlers[fs_handler_key] || nop
39
+      fs_handler = glob_mx.filmstrip_handlers[fs_handler_key] || nop
40
+      // glob_mx.filmstrip_tile_handlers[fs_handler_key] ? glob_mx.filmstrip_tile_handlers[fs_handler_key](v) : 1
41
+      // fs_tile_handlers.push([glob_mx.filmstrip_tile_handlers[fs_handler_key] || nop,v])
42
+      // fs_handlers.setD(glob_mx.filmstrip_handlers[fs_handler_key] || nop,)
43
+      fs_tile_handlers.push([fs_tile_handler,v])
44
+      fs_handlers.setD(fs_handler,[])
45
+      i = fs_handlers.get(fs_handler)
46
+      i.push(v)
47
+
48
+      // glob_mx.filmstrip_handlers
49
+    }
50
+    clog("fs_tile_handlers",fs_tile_handlers)
51
+    for ([k,v] of fs_handlers){
52
+    	// clog("ft0",k,v)
53
+    	k(v)
54
+    }
55
+    for ([k,v] of fs_tile_handlers){
56
+    	// clog("ft",k,v)
57
+    	k(v)
58
+
59
+    }
60
+
61
+
62
+    // return
63
+    // const custom_thumbs = all_thumbs
64
+
65
+    var aspect = 16/18
66
+    var width = 135
67
+    var height = Math.round(width/aspect)
68
+    loose_thumbs.css({
69
+      'padding-top': '',
70
+      "min-height": `${height}px`,
71
+      "min-width": `${width}px`,
72
+      width: `${width}px`,
73
+      height: `${height}px`,
74
+    })
75
+
76
+    clog("rtscv",fn_name,[that,...args])
77
+
78
+
79
+}
80
+
81
+
82
+
83
+
84
+
85
+function onover(){
86
+	clog(this,[...arguments])
87
+}

+ 10
- 0
clone/inspect_utils.js View File

@@ -0,0 +1,10 @@
1
+
2
+
3
+function jclone(obj){
4
+	return Array.isArray(obj) ?  $.extend(true,[],obj) :  $.extend(true,{},obj)
5
+}
6
+function jx(obj){
7
+	return JSON.parse(JSON.stringify(obj))
8
+}
9
+window.jc = jclone
10
+

+ 139
- 0
clone/m/_m_utils.js View File

@@ -0,0 +1,139 @@
1
+
2
+
3
+
4
+
5
+if (!window.glob_mx){
6
+	// window.glob_mx={}
7
+}
8
+function disp(o){
9
+	APP.store.dispatch(o)
10
+}
11
+
12
+
13
+// default event handler this should match all events
14
+mhndlr_opt_null = {
15
+from: undefined,
16
+handler: "onAll",
17
+id: null,
18
+name: null,
19
+// "http://jitsi.org/jitmeet"
20
+ns: null,
21
+options: {matchBareFromJid: false, ignoreNamespaceFragment: false},
22
+type: null,
23
+user: true,
24
+cstr:"test"
25
+};
26
+
27
+
28
+
29
+mhndlr_opt_x = {
30
+	cstr:"?",
31
+	ns:"corner_mx",
32
+	handler:mhndlr,
33
+
34
+}
35
+
36
+
37
+function add_handler_m(handler) {
38
+	var phx = APP.connection.xmpp.connection._stropheConn.handlers[0].__proto__;
39
+
40
+	var hxa=Object.create(phx)
41
+	Object.assign(hxa,mhndlr_opt_null,handler)
42
+	APP.connection.xmpp.connection._stropheConn.addHandlers.push(hxa)
43
+}
44
+
45
+
46
+function tmsgx(data,tag="div",attrs={}){
47
+	// return
48
+	var ns = {xmlns:"corner_mx"}
49
+	var msg = $build("message",{ to: window.APP.conference._room.room.roomjid,
50
+            type: 'groupchat',
51
+             });
52
+	var payload=JSON.stringify(data)
53
+
54
+	Object.assign({},ns,attrs)
55
+
56
+	msg.c(tag, payload,Object.assign({},ns,attrs)).up();
57
+	// console.log("zzzz")
58
+	APP.conference._room.room.connection.send(msg)
59
+}
60
+
61
+
62
+
63
+function tmsgx2(data,opt_arg={},attrs={}){
64
+	// return
65
+	dflt_opt = {
66
+	tag:"code",
67
+	type:"chat",
68
+	to:window.APP.conference._room.room.roomjid,
69
+	}
70
+	var opt = Object.assign({},dflt_opt,opt_arg)
71
+
72
+	var ns = {xmlns:"corner_mx"}
73
+	var msg = $build("message",{ to: opt.to,
74
+            type: opt.type,
75
+             });
76
+	var payload=JSON.stringify(data)
77
+
78
+	Object.assign({},ns,attrs)
79
+
80
+	msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
81
+	// console.log("zzzz")
82
+	APP.conference._room.room.connection.send(msg)
83
+}
84
+function tmsgx3(data,opt_arg={},attrs={}){
85
+	// return
86
+	dflt_opt = {
87
+	tag:"code",
88
+	// type:"chat",
89
+	to:window.APP.conference._room.room.roomjid,
90
+	}
91
+	var opt = Object.assign({},dflt_opt,opt_arg)
92
+	clog("T:",data,opt,opt.type)
93
+	if (!opt.type){
94
+		clog("NO TYPE")
95
+	opt.to == dflt_opt.to ? opt.type = "groupchat" : opt.type = "chat"
96
+	}
97
+	clog("T:",data,opt,opt.type)
98
+
99
+	var ns = {xmlns:"corner_mx"}
100
+	var msg = $build("message",{ to: opt.to,
101
+            type: opt.type,
102
+            // from: "nnnx@conference.jfidev.com/3db7bf15",
103
+            // xtra: "nnnx@conference.jfidev.com/3db7bf15",
104
+             });
105
+	var payload=JSON.stringify(data)
106
+
107
+	Object.assign({},ns,attrs)
108
+
109
+	msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
110
+	// console.log("zzzz")
111
+	APP.conference._room.room.connection.send(msg)
112
+}
113
+
114
+
115
+
116
+function mhndlr_rld_dflt(a0,a1,a2,a3,a4){
117
+	clog("mhndlr... dflt")
118
+	return true
119
+}
120
+if (!window.mhndlr_rld){
121
+	window.mhndlr_rld = mhndlr_rld_dflt
122
+}
123
+function mhndlr(a0,a1,a2,a3,a4){
124
+	// clog("MH!")
125
+	setTimeout(window.mhndlr_rld,1,this,a0,a1,a2,a3,a4)
126
+	return true
127
+}
128
+
129
+
130
+function init_mx(){
131
+	clog("INITMX")
132
+	add_handler_m(mhndlr_opt_x)
133
+	// add_handler_m(mhndlr_opt_x_all)
134
+}
135
+
136
+// init_mx will be called once we join th confrence
137
+ifn_obj.init_conf_join.push(init_mx)
138
+
139
+

+ 302
- 0
clone/m/_m_utils0.js View File

@@ -0,0 +1,302 @@
1
+
2
+
3
+
4
+
5
+if (!window.glob_mx){
6
+	// window.glob_mx={}
7
+}
8
+
9
+
10
+
11
+
12
+
13
+/*
14
+msto_qx = {
15
+	local:{},
16
+	conference:{},
17
+	participant:{},
18
+}
19
+
20
+
21
+
22
+msto_qx = {
23
+	private_local:{},
24
+	participant_local:{},
25
+	conference:{},
26
+	participant:{
27
+		'<id_0>':{},
28
+		'<id_1>':{},
29
+		'<id_...>':{},
30
+		'<id_n>':{
31
+			rkey:{},
32
+		},
33
+
34
+	},
35
+}
36
+*/
37
+mhndlr_opt_null = {
38
+from: undefined,
39
+handler: "onAll",
40
+id: null,
41
+name: null,
42
+// "http://jitsi.org/jitmeet"
43
+ns: null,
44
+options: {matchBareFromJid: false, ignoreNamespaceFragment: false},
45
+type: null,
46
+user: true,
47
+cstr:"test"
48
+};
49
+// cstr:"onMsgx"
50
+
51
+
52
+
53
+mhndlr_opt_x = {
54
+	cstr:"?",
55
+	ns:"corner_mx",
56
+	handler:mhndlr,
57
+
58
+}
59
+function rtrue(){
60
+	// clog("rtrue...",this,arguments)
61
+	// console.trace("rtrue")
62
+	return true
63
+}
64
+function rtrue2(){
65
+	clog("rtrue2...",this,arguments)
66
+	// console.trace("rtrue2")
67
+	return true
68
+}
69
+function rtrue3(){
70
+	clog("rtrue3...",this,arguments)
71
+	// console.trace("rtrue2")
72
+	allevnt(...arguments)
73
+	return true
74
+}
75
+mhndlr_opt_x_all = {
76
+	cstr:"?",
77
+	ns:"jabber:client",
78
+	// name:"message",
79
+	type:"groupchat",
80
+	handler:allevnt,
81
+	// isMatch:rtrue2,
82
+	// run:rtrue3,
83
+	// namespaceMatch:rtrue,
84
+
85
+
86
+}
87
+
88
+function add_handler_m(argument) {
89
+	// minit()
90
+	// if (!th.phx){
91
+		// th.
92
+	// }
93
+		// var phx = APP.conference._room.room.connection.handlers[0].__proto__;
94
+		var phx = APP.connection.xmpp.connection._stropheConn.handlers[0].__proto__;
95
+
96
+	var hxa=Object.create(phx)
97
+	Object.assign(hxa,mhndlr_opt_null,mhndlr_opt_x)
98
+	// APP.conference._room.room.connection.handlers.push(hxa)
99
+	APP.connection.xmpp.connection._stropheConn.addHandlers.push(hxa)
100
+	// th.hxa=hxa
101
+	// th.hx
102
+	// body...
103
+}
104
+function add_handler_m2(argument) {
105
+	clog("ADD HANDLER M2")
106
+	// minit()
107
+	// if (!th.phx){
108
+		// th.
109
+	// }
110
+		// var phx = APP.conference._room.room.connection.handlers[0].__proto__;
111
+		var phx = APP.connection.xmpp.connection._stropheConn.handlers[0].__proto__;
112
+
113
+	var hxa=Object.create(phx)
114
+	Object.assign(hxa,mhndlr_opt_null,mhndlr_opt_x_all)
115
+	// APP.conference._room.room.connection.handlers.push(hxa)
116
+	APP.connection.xmpp.connection._stropheConn.addHandlers.push(hxa)
117
+	return hxa
118
+	// th.hxa=hxa
119
+	// th.hx
120
+	// body...
121
+}
122
+
123
+function tmsgx(data,tag="div",attrs={}){
124
+	// return
125
+	var ns = {xmlns:"corner_mx"}
126
+	var msg = $build("message",{ to: window.APP.conference._room.room.roomjid,
127
+            type: 'groupchat',
128
+             });
129
+	var payload=JSON.stringify(data)
130
+
131
+	Object.assign({},ns,attrs)
132
+
133
+	msg.c(tag, payload,Object.assign({},ns,attrs)).up();
134
+	console.log("zzzz")
135
+	APP.conference._room.room.connection.send(msg)
136
+}
137
+
138
+
139
+
140
+function tmsgx2(data,opt_arg={},attrs={}){
141
+	// return
142
+	dflt_opt = {
143
+	tag:"code",
144
+	type:"chat",
145
+	to:window.APP.conference._room.room.roomjid,
146
+	}
147
+	var opt = Object.assign({},dflt_opt,opt_arg)
148
+
149
+	var ns = {xmlns:"corner_mx"}
150
+	var msg = $build("message",{ to: opt.to,
151
+            type: opt.type,
152
+             });
153
+	var payload=JSON.stringify(data)
154
+
155
+	Object.assign({},ns,attrs)
156
+
157
+	msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
158
+	console.log("zzzz")
159
+	APP.conference._room.room.connection.send(msg)
160
+}
161
+function tmsgx3(data,opt_arg={},attrs={}){
162
+	// return
163
+	dflt_opt = {
164
+	tag:"code",
165
+	// type:"chat",
166
+	to:window.APP.conference._room.room.roomjid,
167
+	}
168
+	var opt = Object.assign({},dflt_opt,opt_arg)
169
+	clog("T:",data,opt,opt.type)
170
+	if (!opt.type){
171
+		clog("NO TYPE")
172
+	opt.to == dflt_opt.to ? opt.type = "groupchat" : opt.type = "chat"
173
+	}
174
+	clog("T:",data,opt,opt.type)
175
+
176
+	var ns = {xmlns:"corner_mx"}
177
+	var msg = $build("message",{ to: opt.to,
178
+            type: opt.type,
179
+            // from: "nnnx@conference.jfidev.com/3db7bf15",
180
+            // xtra: "nnnx@conference.jfidev.com/3db7bf15",
181
+             });
182
+	var payload=JSON.stringify(data)
183
+
184
+	Object.assign({},ns,attrs)
185
+
186
+	msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
187
+	console.log("zzzz")
188
+	APP.conference._room.room.connection.send(msg)
189
+}
190
+
191
+function mhndlr_rld_dflt(a0,a1,a2,a3,a4){
192
+	// clog("mhndlr....",a0,a1,a2)
193
+	clog("mhndlr... dflt")
194
+	// setTimeout(window.onAll_rld_v2,1,this,a0,a1,a2,a3,a4)
195
+	return true
196
+}
197
+if (!window.mhndlr_rld){
198
+	window.mhndlr_rld = mhndlr_rld_dflt
199
+}
200
+function mhndlr(a0,a1,a2,a3,a4){
201
+	// clog("MH!")
202
+	setTimeout(window.mhndlr_rld,1,this,a0,a1,a2,a3,a4)
203
+	return true
204
+}
205
+function allevnt(a0,a1,a2,a3,a4){
206
+	clog("MH! allevnt")
207
+	setTimeout(window.allevnt_rld,1,this,a0,a1,a2,a3,a4)
208
+	return true
209
+}
210
+function rld_room(room){
211
+	clog("rld_room...",room)
212
+	window.location.assign(room)
213
+}
214
+function allevnt_rld(a0,a1,a2,a3,a4){
215
+	// clog("MH!")
216
+	// clog("allevnt_rld",a0,a1,a2,a3,a4)
217
+
218
+	var msg = a1.querySelector(`body`)
219
+	if (!msg){
220
+		return
221
+	}
222
+	// clog("allevnt_rld...",a1)
223
+
224
+
225
+	// clog("allevnt_rldw",_from.split("/").pop())
226
+	// clog(msg)
227
+	// return
228
+	// @Joseph-Innace
229
+	// clog(msg.innerHTML)
230
+	var msg_txt = msg.innerHTML 
231
+	if (msg_txt.startsWith("moveto=")){
232
+		var room = msg_txt.split("=").pop()
233
+		if (room){
234
+	var _from = a1.getAttribute("from").split("/").pop()
235
+	if (get_local().id == _from){
236
+		rld_room(room)
237
+	} else {
238
+		setTimeout(rld_room,2000,room)
239
+
240
+	}
241
+	// get_local().id
242
+
243
+		}
244
+
245
+		// clog("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",msg_txt.split("~"),msg_txt.split("~").pop())
246
+	} 
247
+	// clog($(a1))
248
+	// clog("z",$(a1)[0].innerHTML)
249
+
250
+	// setTimeout(window.mhndlr_rld,1,this,a0,a1,a2,a3,a4)
251
+	return true
252
+}
253
+/*
254
+
255
+delete Root_io
256
+{
257
+
258
+class Root_io {
259
+	constructor(){}
260
+	_pub_msg(m){
261
+		clog("ixi PUB MSG",m)
262
+	}
263
+	_rec_msg(m){
264
+		clog("ixi REC MSG",m)
265
+	}
266
+}
267
+window.Root_io = Root_io
268
+}
269
+*/
270
+// function allevnt(){
271
+
272
+// }
273
+clog("ZZZZZZZZZ")
274
+function init_mx(){
275
+	clog("INITMX3")
276
+	add_handler_m(mhndlr)
277
+	add_handler_m2(allevnt)
278
+}
279
+
280
+ifn_obj.init_conf_join.push(init_mx)
281
+
282
+
283
+
284
+// sto_event
285
+// sto_update
286
+
287
+
288
+// pub_msg
289
+// rec_msg
290
+
291
+
292
+// set_local
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+

+ 286
- 0
clone/m/m_api.js View File

@@ -0,0 +1,286 @@
1
+
2
+
3
+
4
+// this file enables loading modules after pageload
5
+
6
+
7
+
8
+
9
+
10
+function get_cui_html(file) {
11
+	clog("get_cui_html",this,arguments)
12
+	// console.trace("~IX~ ixr")
13
+	clog("~IX~ ixr")
14
+	// for (var file of this.arr){
15
+		var aii 
16
+		aii= $.ajax({
17
+			// url: "ign/cui.html",
18
+			url: file.url,
19
+			// data: file.qs,
20
+			cache:false,
21
+			// complete:complete_html,
22
+			success: file.success || proc_cui_html,
23
+			// error: err_html,
24
+			// dataType: "text"
25
+			dataType: "html"
26
+		})
27
+		aii.file = file
28
+		// aii.rldh=file
29
+	// }
30
+}
31
+
32
+
33
+
34
+function cui_respH(){
35
+	clog("cui_respH")
36
+}
37
+
38
+function cui_diffH(file){
39
+	clog("cui_diffH",this,arguments)
40
+	// get_cui_html(file)	
41
+}
42
+
43
+
44
+
45
+
46
+
47
+
48
+function proc_cui_html(rsp,status,xhr){
49
+	clog("proc_cui_html",this,arguments)
50
+	/*
51
+	gxh.success = {
52
+		that:this,
53
+		rsp,status,xhr,
54
+		args:arguments,
55
+	}
56
+	*/
57
+	// insert_cui_html(rsp)
58
+	// rsp
59
+}
60
+function insert_cui_html(innerHTML){
61
+	clog("insert_cui_html....")
62
+	window.cui_html = innerHTML
63
+	t5i2.crnr_init()
64
+	// t5i2.crnr_refresh()
65
+
66
+	// var n
67
+	//  n = document.createElement("div")
68
+	// n = document.querySelector("#xh_root")
69
+	// n ? n.innerHTML = innerHTML : 0
70
+	// event_html(n)
71
+}
72
+
73
+
74
+function dflt_api_handler(){
75
+	clog("dflt_api_handler NOT IMPLIMENTED")
76
+}
77
+
78
+function add_rld_html(){
79
+	// js files
80
+	// html
81
+	// css
82
+
83
+
84
+
85
+
86
+rldi.files["ign/m/timer/rhtml.html"]=  {url: "ign/m/timer/rhtml.html",
87
+ qs: {v:1}, respH: cui_respH, diffH: cui_diffH,
88
+ cached:"z z",
89
+ success:proc_cui_html,
90
+}
91
+
92
+
93
+
94
+}
95
+
96
+/*
97
+var reqt = {
98
+	url:"",
99
+	respH:dflt_handler,
100
+	diffH:diff_handler,
101
+}
102
+
103
+*/
104
+
105
+
106
+
107
+
108
+// jsrh
109
+// cssrh
110
+api_dflts = {
111
+	dflt:window.reqt || {url:"", respH:dflt_handler, diffH:diff_handler,},
112
+	js:{
113
+		diffH:jsrh,
114
+		// diffH:jsrh,
115
+		qs:{v:1},
116
+	},
117
+	css:{
118
+		diffH:cssrh,
119
+		qs:{v:1},
120
+
121
+	},
122
+	html:{
123
+
124
+		diffH:html_rld_cb,
125
+		qs:{v:1},
126
+	},
127
+}
128
+
129
+
130
+api_test = {}
131
+
132
+// <script class="rld" src="ign/m/m_api.js?c=023"></script>
133
+function insert_js(file){
134
+	var n = document.createElement("SCRIPT")
135
+	n.classList.add("rld")
136
+	n.src=file.url + "?_="+new Date().getTime()
137
+	// n.rel="stylesheet"
138
+	$(`script.rld[src^="`+file.url+`"]`).remove()
139
+	$(".m0.module").after(n)
140
+}
141
+function insert_css(file){
142
+	var url = file.url
143
+	var n = document.createElement("LINK")
144
+	n.classList.add("rld")
145
+	n.href=file.url + "?_="+new Date().getTime()
146
+	n.rel="stylesheet"
147
+	 $(`link.rld[href^="`+file.url+`"]`).remove()
148
+	$(".m0.module").after(n)
149
+}
150
+function html_rld_cb(){
151
+	clog("html_rld_cb!")
152
+
153
+}
154
+
155
+
156
+function html_rld_cb2(){
157
+	clog("html_rld_cb2!",this,[...arguments])
158
+
159
+}
160
+function html_rld_cb3(){
161
+	clog("html_rld_cb3!",this,[...arguments])
162
+}
163
+function html_rld_cb4(rsp,status,xhr){
164
+	clog("html_rld_cb4!",this,[...arguments])
165
+	// window[this.success_js](rsp,status,xhr)
166
+	window[xhr.file.success_js](rsp,status,xhr)
167
+}
168
+
169
+
170
+function register_rld(file){
171
+	clog("RR",file)
172
+	file.cached = rls[file.url]
173
+	rldi.files[file.url] =  file
174
+
175
+}
176
+
177
+
178
+window.qto_stop = 0
179
+window.qto_cnt = 0
180
+function qto_init(){
181
+	window.qto_stop = 0
182
+window.qto_cnt = 0
183
+	// setTimeout(qto_stop_fn,1000)
184
+	setTimeout(qto_stop_fn,100)
185
+	qto()
186
+
187
+}
188
+function qto_stop_fn(){
189
+	clog("qto_stop_fn")
190
+	window.qto_stop =1
191
+}
192
+function qto(){
193
+	clog("QTO",window.qto_cnt)
194
+	// clog("QTO",window.qto_cnt,$(`script.rld[src^="ign/m/timer/m.js"]`))
195
+	window.qto_cnt += 1
196
+	if (!window.qto_stop){
197
+		setTimeout(qto,1)
198
+	}
199
+
200
+}
201
+
202
+
203
+
204
+	// $(`script.rld[src^="ign/m/timer/m.js"]`).remove()
205
+	// ign/m/timer/m.js
206
+
207
+
208
+
209
+
210
+// mtx ={js:["ign/m/timer/m.js"],css:["ign/m/timer/m.css"],html:["ign/m/timer/m.html"]}
211
+// mtx ={js:["ign/m/timer/m.js"],css:["ign/m/timer/m.css"],html:[{url:"ign/m/timer/m.html",diffH:html_rld_cb2,success:html_rld_cb4,}]}
212
+mtx ={	
213
+	// js:["ign/m/timer/m.js","ign/m/timer/m0.js"],
214
+	js:["ign/clone/m/timer/m0.js","ign/clone/m/timer/m.js",],
215
+	css:["ign/clone/m/timer/m.css"],
216
+	html:[{url:"ign/clone/m/timer/m.html",diffH:get_cui_html,success:html_rld_cb4,success_js:"html_js_handler"}]
217
+	}
218
+
219
+function add_module(o){
220
+	var k,v
221
+	let file 
222
+		// qto_init()
223
+		// file = jclone(api_dflts.css)
224
+	for (k of o.css || []){
225
+		if (typeof(k) == "string"){
226
+			 file = $.extend(true,{},api_dflts.css, {url:k})
227
+		} else {
228
+			 file = $.extend(true,{},api_dflts.css, k)
229
+		}
230
+		// file = jclone(api_dflts.css)
231
+		// file.url = k
232
+
233
+		register_rld(file)
234
+		insert_css(file)
235
+
236
+		api_test[file.url]=file
237
+		clog("~",k)
238
+	}
239
+	for (k of o.js || []){
240
+		if (typeof(k) == "string"){
241
+			 file = $.extend(true,{},api_dflts.js, {url:k})
242
+		} else {
243
+			 file = $.extend(true,{},api_dflts.js, k)
244
+		}
245
+		// file = jclone(api_dflts.js)
246
+		// file.url = k
247
+
248
+		register_rld(file)
249
+		insert_js(file)
250
+
251
+		api_test[file.url]=file
252
+		clog("~",k)
253
+	}
254
+	for (k of o.html || []){
255
+		if (typeof(k) == "string"){
256
+			 file = $.extend(true,{},api_dflts.html, {url:k})
257
+		} else {
258
+			 file = $.extend(true,{},api_dflts.html, k)
259
+		}
260
+		// file = jclone(api_dflts.html)
261
+		// file.url = k
262
+		register_rld(file)
263
+		api_test[file.url]=file
264
+		clog("~",k)
265
+		rfile = file
266
+		get_cui_html(file)
267
+	}
268
+
269
+
270
+}
271
+
272
+
273
+
274
+
275
+
276
+
277
+// jquery helper
278
+function add_node(n,rn,i) {
279
+	$(rn)[i](n)
280
+}
281
+
282
+
283
+setTimeout(add_module,300,mtx)
284
+
285
+
286
+// add_module(mtx )

+ 239
- 0
clone/m/m_api_html.js View File

@@ -0,0 +1,239 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+// insert
12
+
13
+
14
+// insert
15
+
16
+
17
+
18
+// small_video after
19
+// small_video ui
20
+// psudo_small_video
21
+
22
+// location ui
23
+// psudo location ui
24
+
25
+
26
+
27
+// small_video_toolbar
28
+
29
+
30
+// pseudo_small_video
31
+// small_video_ui
32
+// small_video_after
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+function init_api0(){
41
+	$(".plugin_top").remove()
42
+	var n
43
+	n = `<div class="plugin_top"><div class="m">ABC</div></div>`
44
+	// n = `<span class="plugin_top"><div class="m">ABC</div></span>`
45
+	n = `<span class="plugin_top pseudo_vid small_vid"><span class="m">ABC</span></span>`
46
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"></span>`
47
+	n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"><span class="m">ABC</span></span>`
48
+
49
+	// add_node(n,`.small_vid`,"append")
50
+	// add_node(n,`.small_vid`,"after")
51
+	// add_node(n,`.jdiv`,"append")
52
+	// add_node(n,`.cont.c1`,"append")
53
+
54
+}
55
+
56
+// vroot.vproc.sizes
57
+
58
+
59
+// toolbox-content
60
+// button-group-left
61
+// button-group-center
62
+// button-group-right
63
+// toolbox-button
64
+
65
+function init_api(){
66
+	$(".plugin_top").remove()
67
+	var n
68
+	n = `<div class="plugin_top toolbox-button "><div class="cbar">ABC</div></div>`
69
+	n = `<span class="plugin_top pseudo_vid small_vid"><div class="m">ABC</div></span>`
70
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
71
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
72
+	// n = `<span class="plugin_top pseudo_vid"><span class="m">ABC</span></span>`
73
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"></span>`
74
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"><span class="m">ABC</span></span>`
75
+
76
+	// add_node(n,`.small_vid`,"append")
77
+	// add_node(n,`.small_vid`,"after")
78
+
79
+
80
+
81
+
82
+	// add_node(n,`.remote_vid,#localVideoTileViewContainer`,"after")
83
+	n = `<span class="plugin_top pseudo_vid small_vid "><div class="m">ABC</div></span>`
84
+	add_node(n,`.remote_vid,#localVideoTileViewContainer`,"after")
85
+
86
+
87
+
88
+
89
+
90
+
91
+	// add_node(n,`.jdiv`,"append")
92
+
93
+	// add_node(n,`.button-group-center`,"append")
94
+	// add_node(n,`.button-group-right`,"prepend")
95
+	// add_node(n,`.jdiv`,"prepend")
96
+
97
+
98
+	// add_node(n,`.cont`,"prepend")
99
+	// add_node(n,`.cont`,"after")
100
+	try {
101
+		dispatch_resize()
102
+	} catch {
103
+
104
+	}
105
+
106
+}
107
+
108
+
109
+function init_api2(){
110
+	$(".plugin_top").remove()
111
+	// dispatch_resize()
112
+	// return
113
+	var n
114
+	n = `<div class="plugin_top toolbox-button "><div class="cbar">ABC</div></div>`
115
+	n = `<span class="plugin_top pseudo_vid small_vid"><div class="m">ABC</div></span>`
116
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
117
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
118
+	// n = `<span class="plugin_top pseudo_vid"><span class="m">ABC</span></span>`
119
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"></span>`
120
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"><span class="m">ABC</span></span>`
121
+
122
+	// add_node(n,`.small_vid`,"append")
123
+
124
+
125
+
126
+
127
+	// add_node(n,`.remote_vid,#localVideoTileViewContainer`,"after")
128
+	n = `<span class="plugin_top pseudo_vid small_vid "><div class="m">ABC</div></span>`
129
+	// add_node(n,`.small_vid`,"after")
130
+	// add_node(n,`.remote_vid,#localVideoTileViewContainer`,"after")
131
+	// add_node(n,`.remote-videos-container`,"append")
132
+	add_node(n,`#localVideoTileViewContainer`,"before")
133
+
134
+
135
+
136
+	// n = `<span class="plugin_top "><div class="m">ABC</div></span>`
137
+	// n = `<span class="plugin_top overlay"><div class="m">ABC</div></span>`
138
+
139
+
140
+
141
+	// add_node(n,`.jdiv`,"append")
142
+/*
143
+	add_node(n,`.button-group-center`,"append")
144
+	add_node(n,`.button-group-right`,"append")
145
+	add_node(n,`.button-group-left`,"append")
146
+
147
+
148
+	add_node(n,`.button-group-center`,"prepend")
149
+	add_node(n,`.button-group-right`,"prepend")
150
+	add_node(n,`.button-group-left`,"prepend")
151
+*/
152
+	// add_node(n,`.toolbox-content`,"prepend")
153
+	// add_node(n,`.toolbox-content`,"before")
154
+	// add_node(n,`.toolbox-content`,"after")
155
+
156
+	// add_node(n,`.toolbox-background`,"after")
157
+	// add_node(n,`.toolbox-background`,"append")
158
+	// add_node(n,`.toolbox-background`,"append")
159
+
160
+	// add_node(n,`.new-toolbox`,"append")
161
+	// add_node(n,`.new-toolbox`,"prepend")
162
+	// add_node(n,`#react`,"prepend")
163
+	// add_node(n,`body`,"prepend")
164
+	// add_node(n,`body`,"append")
165
+
166
+
167
+
168
+
169
+	// add_node(n,`.jdiv`,"prepend")
170
+	// add_node(n,`.jdiv`,"append")
171
+
172
+
173
+	// add_node(n,`.cont`,"prepend")
174
+	// add_node(n,`.cont`,"after")
175
+	try {
176
+		dispatch_resize()
177
+	} catch {
178
+
179
+	}
180
+
181
+
182
+}
183
+
184
+function init_api3(){
185
+	$(".plugin_top").remove()
186
+	// dispatch_resize()
187
+	// return
188
+	var n
189
+	// ".top_toolbox,.vid_toptoolbar_hook"
190
+	n = `<div class="plugin_top toolbox-button "><div class="cbar">ABC</div></div>`
191
+	n = `<span class="plugin_top pseudo_vid small_vid"><div class="m">ABC</div></span>`
192
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
193
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
194
+
195
+	n = `<span class="plugin_top pseudo_vid small_vid "><div class="m2 xbox">ABC</div></span>`
196
+
197
+
198
+	add_node(n,`#localVideoTileViewContainer`,"before")
199
+	n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
200
+	add_node(n,`.top_toolbox,.vid_toptoolbar_hook`,"append")
201
+	// add_node(n,`.dev_hook`,"append")
202
+	add_node(n,`.button-group-right`,"prepend")
203
+
204
+	try {
205
+		dispatch_resize()
206
+	} catch {
207
+
208
+	}
209
+
210
+}
211
+// Add Psudo vid
212
+// video toolbar hook
213
+// window top margin
214
+// window window bottom toolbar
215
+
216
+
217
+
218
+function add_node(n,rn,i) {
219
+	$(rn)[i](n)
220
+	// after
221
+	// $(".plugin_top")
222
+
223
+
224
+	// body...
225
+
226
+
227
+}
228
+init_api3()
229
+// C:\bspace\repos\jmc\ign_kutd\m\m_api_html.js
230
+
231
+
232
+
233
+
234
+// div.dev_hook.top_toolbox.jdiv
235
+// div.dev_hook.indicator_hook.vid_toptoolbar_hook.jdiv.t0
236
+
237
+
238
+
239
+

+ 146
- 0
clone/m/m_const.js View File

@@ -0,0 +1,146 @@
1
+
2
+
3
+window.m_const = {
4
+
5
+}
6
+
7
+
8
+window.m_const.exclude = Symbol("exclude")
9
+window.m_const.include = Symbol("include")
10
+// window.m_const.exclude = Symbol("include")
11
+
12
+
13
+
14
+// glob_react.Filmstrip._getThumbs = function (onlyVisible = false) {
15
+_getThumbs_mod_junk = function (onlyVisible = false) {
16
+        // let selector = 'span';
17
+
18
+        // console.log("crnr flm getThumbs",!!(window.log_tb))
19
+        // console.log("crnr flm getThumbs",this,this.filmstripRemoteVideos)
20
+        // window.log_tb ? log_tb(new Error(),"getThumbs") : 0
21
+        
22
+
23
+        // console.trace("getThumbs_tb")
24
+        let selector = '.remote_vid,.pseudo_vid';
25
+        selector = window.glob_sel || selector;
26
+        let filter = '';
27
+
28
+        if (onlyVisible) {
29
+            filter += ':visible';
30
+        }
31
+
32
+        // const remoteThumbs = this.filmstripRemoteVideos.children(selector);
33
+        // const remoteThumbs = this.filmstripRemoteVideos.find(selector);
34
+        const filmstripRemoteVideos =  $('#filmstripRemoteVideosContainer')
35
+        // const localThumb = $('#localVideoContainer');
36
+        // const localThumb = filmstripRemoteVideos.children('#localVideoContainer');
37
+        const localThumb = filmstripRemoteVideos.children("#localVideoTileViewContainer").children('#localVideoContainer');
38
+        // const localThumb = filmstripRemoteVideos.children($('#localVideoContainer'));
39
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).filter(filter) : filmstripRemoteVideos.find(selector);
40
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).children(filter) : filmstripRemoteVideos.children(selector);
41
+        const remoteThumbs = filter ? filmstripRemoteVideos.children(selector).filter(filter) : filmstripRemoteVideos.children(selector);
42
+        
43
+
44
+        // clog("$$$",localThumb.hasClass('hidden') ,localThumb.find(".local_vid").length,filmstripRemoteVideos.find("#localVideoContainer").length)
45
+        clog("$$$2",localThumb.length, (localThumb.hasClass('hidden') ,localThumb.find(".local_vid").length || filmstripRemoteVideos.find("#localVideoContainer").length))
46
+
47
+        // Exclude the local video container if it has been hidden.
48
+        // if (localThumb.hasClass('hidden') && ( ! (localThumb.find(".local_vid").length && filmstripRemoteVideos.find(#localVideoContainer)) ) ) {
49
+        // if (localThumb.hasClass('hidden') || ( ! (localThumb.find(".local_vid").length || filmstripRemoteVideos.find("#localVideoContainer")) ) ) {
50
+        // if (localThumb.hasClass('hidden') || ( ! (localThumb.find(".local_vid").length || filmstripRemoteVideos.find("#localVideoContainer").length) ) ) {
51
+        if (localThumb.hasClass('hidden') || ! localThumb.length  ) {
52
+            return { remoteThumbs };
53
+        }
54
+        // return { remoteThumbs };
55
+
56
+        return { remoteThumbs,
57
+            localThumb };
58
+}
59
+
60
+
61
+
62
+glob_react.Filmstrip._getThumbs_works = function (onlyVisible = false) {
63
+    // _getThumbs_works(onlyVisible = false) {
64
+        // let selector = 'span';
65
+
66
+        // console.log("crnr flm getThumbs",!!(window.log_tb))
67
+        // console.log("crnr flm getThumbs",this,this.filmstripRemoteVideos)
68
+        // window.log_tb ? log_tb(new Error(),"getThumbs") : 0
69
+        
70
+
71
+        // console.trace("getThumbs_tb")
72
+        let selector = '.remote_vid,.pseudo_vid';
73
+        selector = window.glob_sel || selector;
74
+        let filter = '';
75
+
76
+        if (onlyVisible) {
77
+            filter += ':visible';
78
+        }
79
+
80
+        const localThumb = $('#localVideoContainer');
81
+        // const remoteThumbs = this.filmstripRemoteVideos.children(selector);
82
+        // const remoteThumbs = this.filmstripRemoteVideos.find(selector);
83
+        const filmstripRemoteVideos =  $('#filmstripRemoteVideosContainer')
84
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).filter(filter) : filmstripRemoteVideos.find(selector);
85
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).children(filter) : filmstripRemoteVideos.children(selector);
86
+        const remoteThumbs = filter ? filmstripRemoteVideos.children(selector).filter(filter) : filmstripRemoteVideos.children(selector);
87
+
88
+        // Exclude the local video container if it has been hidden.
89
+        if (localThumb.hasClass('hidden')) {
90
+            return { remoteThumbs };
91
+        }
92
+
93
+        return { remoteThumbs,
94
+            localThumb };
95
+
96
+    }
97
+
98
+
99
+
100
+ glob_react.Filmstrip._getThumbs_buggy = function(onlyVisible = false) {
101
+    // _getThumbs(onlyVisible = false) {
102
+        // let selector = 'span';
103
+
104
+        // console.log("crnr flm getThumbs",!!(window.log_tb))
105
+        // console.log("crnr flm getThumbs",this,this.filmstripRemoteVideos)
106
+        // window.log_tb ? log_tb(new Error(),"getThumbs") : 0
107
+        
108
+
109
+        // console.trace("getThumbs_tb")
110
+        let selector = '.remote_vid,.pseudo_vid';
111
+        selector = window.glob_sel || selector;
112
+        let filter = '';
113
+
114
+        if (onlyVisible) {
115
+            filter += ':visible';
116
+        }
117
+
118
+        // const remoteThumbs = this.filmstripRemoteVideos.children(selector);
119
+        // const remoteThumbs = this.filmstripRemoteVideos.find(selector);
120
+        const filmstripRemoteVideos =  $('#filmstripRemoteVideosContainer')
121
+        // const localThumb = $('#localVideoContainer');
122
+        // $("#filmstripLocalVideoThumbnail > *")
123
+        // const localThumb = filmstripRemoteVideos.children("#localVideoTileViewContainer").children('#localVideoContainer');
124
+        // const localThumb = filmstripRemoteVideos.children("#localVideoTileViewContainer").children('#localVideoContainer');
125
+        const localThumb = $("#filmstripRemoteVideosContainer > #localVideoTileViewContainer,#filmstripLocalVideoThumbnail").children('#localVideoContainer');
126
+
127
+
128
+        // const localThumb = filmstripRemoteVideos.children($('#localVideoContainer'));
129
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).filter(filter) : filmstripRemoteVideos.find(selector);
130
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).children(filter) : filmstripRemoteVideos.children(selector);
131
+        const remoteThumbs = filter ? filmstripRemoteVideos.children(selector).filter(filter) : filmstripRemoteVideos.children(selector);
132
+
133
+        // Exclude the local video container if it has been hidden.
134
+        // if (localThumb.hasClass('hidden') && ( ! (localThumb.find(".local_vid").length && filmstripRemoteVideos.find(#localVideoContainer)) ) ) {
135
+        if (localThumb.hasClass('hidden')  || ! localThumb.length )  {
136
+            return { remoteThumbs };
137
+        }
138
+
139
+        return { remoteThumbs,
140
+            localThumb };
141
+
142
+    }
143
+
144
+
145
+// glob_react.Filmstrip._getThumbs = glob_react.Filmstrip._getThumbs_works
146
+// glob_react.Filmstrip._getThumbs = glob_react.Filmstrip._getThumbs_buggy

+ 135
- 0
clone/m/m_req.js View File

@@ -0,0 +1,135 @@
1
+
2
+window.ifn_obj =  window.ifn_obj || {	init_conf_join:[], }
3
+
4
+function get_mod(participants){
5
+	if (!participants){
6
+	participants = get_participants()
7
+	}
8
+	var k,v
9
+	for (v of participants){
10
+		if (v.role == "moderator"){
11
+			clog("cui_mod_cd",[v],v.corner_data)
12
+			return v
13
+		}
14
+	}
15
+}
16
+function get_participants(){
17
+	return APP.store.getState()["features/base/participants"]
18
+}
19
+function get_local(participants){
20
+	if (!participants){
21
+	participants = get_participants()
22
+	}
23
+	var k,v
24
+	for (v of participants){
25
+		if (v.local){
26
+			return v
27
+		}
28
+	}
29
+	return APP.store.getState()["features/base/participants"]
30
+}
31
+function amimod() {
32
+	try {
33
+	return get_local().role == "moderator"
34
+	} catch (e) {
35
+		console.error("AM I MOD ERR: is evrything inited?",e)
36
+		// clog("AM I MOD ERR: is evrything inited?",e)
37
+	}
38
+}
39
+
40
+
41
+
42
+function Someone_Left_Handler(o){
43
+	delete msto.participants[o.action.participant.id]
44
+}
45
+
46
+
47
+// reflow all your filmstrips
48
+function Someone_Left_or_Joined_Handler(o){
49
+	try {
50
+		APP.store.dispatch(window.glob_react.video_layout.setTileView(false))
51
+		APP.store.dispatch(window.glob_react.rf_filmstrip.setFilmstripVisible(false))
52
+		if (! $("#vspace_filmstrip_template").length){
53
+		    init_api6()
54
+		}
55
+			refresh_toolbars()
56
+			mod_sort()
57
+			new_move()
58
+			dispatch_resize()
59
+	} catch(err) {
60
+		console.error("Someone_Left_or_Joined_Handler err:", err)
61
+	}
62
+}
63
+
64
+
65
+
66
+
67
+
68
+// dispay moderator toolbar if you become moderator
69
+window.iammod = window.iammod || false
70
+function amimodnow(){
71
+	var iammod = amimod()
72
+	window.iammod = iammod
73
+	if (iammod){
74
+		refresh_toolbars()
75
+	}
76
+}
77
+
78
+
79
+
80
+
81
+// run init callbacks after CONFERENCE_JOINED
82
+function cji(){
83
+	if (window.init_m){
84
+		// setTimeout(window.init_m())
85
+	}
86
+	if (ifn_obj && ifn_obj.init_conf_join){
87
+		var k,v
88
+		for ([k,v] of Object.entries(ifn_obj.init_conf_join)){
89
+			v()
90
+		}
91
+	}
92
+}
93
+
94
+
95
+
96
+// safe to remove
97
+function stv(o,ta){
98
+	clog(o,ta)
99
+}
100
+
101
+
102
+// this is called with setTimeout so we can throw errors without wrecking everything
103
+function dev_middleware_listner(o) {
104
+	if (!o.action.type){
105
+		return
106
+	}
107
+	// if (o.action.type != "ENDPOINT_MESSAGE_RECEIVED"){
108
+		// CONFERENCE_JOINED
109
+	// clog("QXI",o.action.type)
110
+	// }
111
+
112
+
113
+	
114
+	switch(o.action.type){
115
+		case "PARTICIPANT_UPDATED":
116
+			window.iammod ? 0 : amimodnow()
117
+
118
+		break;
119
+		case "PARTICIPANT_LEFT":
120
+			setTimeout(Someone_Left_Handler,1,o)
121
+			// setTimeout(Someone_Left_Handler,1000,o)
122
+		case "PARTICIPANT_JOINED":
123
+			setTimeout(Someone_Left_or_Joined_Handler,1,o)
124
+			// setTimeout(Someone_Left_or_Joined_Handler,300,o)
125
+		break;
126
+		// case "SET_TILE_VIEW":
127
+		// stv(o,[this,arguments])
128
+		break;
129
+		case "CONFERENCE_JOINED":
130
+			setTimeout(cji,1)
131
+		break;
132
+
133
+	}
134
+}
135
+

+ 713
- 0
clone/m/m_utils.js View File

@@ -0,0 +1,713 @@
1
+
2
+// This file creates and syncs msto
3
+// msto is a recursive proxy that synchronizes itself between all meeting participants
4
+// you can get a clone of the object by typing jc(msto) into your dev console 
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+if (!window.glob_mx ){
24
+	window.glob_mx={}
25
+
26
+glob_mx.prom = {}
27
+glob_mx.event_handlers = {}
28
+glob_mx.cb = {
29
+	init_db:{}
30
+}
31
+glob_mx.filmstrip_handlers  = {}
32
+//glob_mx.filmstrip_handlers = glob_mx.filmstrip_handlers || {}
33
+
34
+}
35
+
36
+
37
+
38
+function match(mx,m,o){
39
+	var k,v,k2,v2
40
+	var r = 0
41
+		// clog("@",mx,m,o)
42
+	for ([k,v] of Object.entries(m || {})){
43
+		v2 = o[k]
44
+    // clog("M~",k,typeof(v),typeof(v2),v,v2)
45
+		if (typeof(v) == "string" && typeof(v2) == "string") {
46
+			r += !(v==v2)
47
+		} else if (Array.isArray(v) && Array.isArray(v2)){
48
+			r += !(isSubset_arr(v,v2))
49
+		} else if (Array.isArray(v) && typeof(v2) == "string"){
50
+      // r += !(isSubset_arr(v2,v))
51
+      r += !v.includes(v2)
52
+			// clog("!!!!!!!!!!!!!",v,v2,isSubset_arr(v2,v))
53
+		} else if (Array.isArray(v2) && typeof(v) == "string"){
54
+			r += !(v2.includes(v))
55
+		}
56
+		if (r){
57
+			return !r
58
+		}
59
+	}
60
+	return !r
61
+}
62
+
63
+
64
+function isSubset(subset,superset){
65
+    for (var elem of subset) {
66
+        if (!superset.includes(elem)) {
67
+            return false;
68
+        }
69
+    }
70
+    return true;  
71
+}
72
+
73
+function isSubset_arr(subset,superset){
74
+    for (var elem of subset) {
75
+    	if (Array.isArray(elem)){
76
+
77
+    		if (!new Set(elem).intersection(superset).size){
78
+    			return false
79
+    		}
80
+    	} else if (!superset.includes(elem)) {
81
+            return false;
82
+        }
83
+    }
84
+    return true;  
85
+}
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+function dispatch_events(e,key){
107
+	var k,v
108
+	e.parsed.etype ? 1 : e.parsed.etype = "null"
109
+	var mflag =0
110
+		clog("dispatch_events??",e,key)
111
+
112
+	for ([k,v] of Object.entries(glob_mx.event_handlers || {}) ) {
113
+		clog("dispatch_events:",k)
114
+		if (v.m){
115
+			mflag = match({},v.m,e.parsed)
116
+		mflag ? v.fn(e) : 1
117
+		}
118
+	}
119
+}
120
+
121
+
122
+function run_cbs(key){
123
+	var k,v
124
+		clog("RUN_CB??",key,glob_mx.cb[key])
125
+
126
+	for ([k,v] of Object.entries(glob_mx.cb[key]|| {}) ) {
127
+		clog("RUN_CB:",k)
128
+		v()
129
+	}
130
+}
131
+
132
+
133
+
134
+
135
+
136
+
137
+function wait(ms) {
138
+  return new Promise(r => setTimeout(r, ms));
139
+}
140
+
141
+function attr_info(n){
142
+	var k,v
143
+	var ret ={}
144
+	// clog(".")
145
+	for (k in n.attributes){
146
+		// clog(k)
147
+	}
148
+	// clog("~")
149
+	for (k of n.attributes){
150
+	// for (k of n.attributes){
151
+		// clog(k)
152
+	}
153
+	// clog("--")
154
+	for ([k,v] of Object.entries(n.attributes)){
155
+		// clog(k,v,v+"+")
156
+		// clog("+",[k,v],v)
157
+		ret[v.name]= v.value
158
+		// clog(typeof(k),typeof(v))
159
+	}
160
+	return ret
161
+
162
+
163
+}
164
+
165
+
166
+
167
+
168
+
169
+
170
+// ai.from.split((a0,a1,a2,a3)=>{clog({a0,a1,a2,a3});return "z"})
171
+// tmsgx3({type:"db_sync_request"})
172
+function mhndlr_rld(that,m){
173
+	try {
174
+		window.mx=m
175
+		var n = m.querySelector(`code`)
176
+		if (!n){return}
177
+		var parsed = JSON.parse(n.innerHTML)
178
+		var ai = attr_info(m)
179
+		window.ai=ai
180
+		// clog("FROM",ai.from == glob_mx.all_jids[0])
181
+		// var id = ai.from.split().slice(-1)[0]
182
+		var id = ai.from.split("/").pop()
183
+
184
+		clog("mhndlr_rld2",m,parsed,n,n.dataset)
185
+		var o = parsed.payload
186
+		switch (parsed.type){
187
+			case "set_msg":
188
+				pf._set_recv(o.path,o.key,o.val)
189
+			break;
190
+			case "event":
191
+				clog("~event~",parsed)
192
+				dispatch_events({parsed,ai,m,that})
193
+			break;
194
+			case "msg_test":
195
+				clog("msg_test",parsed)
196
+			break;
197
+			case "db_sync_request":
198
+				// tmsgx3({type:"db_sync_response",payload:pf.root})
199
+				tmsgx3({type:"db_sync_response",payload:pf.root},{to:ai.from})
200
+				
201
+				clog("db_sync_request",parsed)
202
+			break;
203
+			case "db_sync_response":
204
+				if (id == glob_mx.local_id){
205
+					clog( "db_sync_response ...")
206
+					break
207
+
208
+				}
209
+					if (glob_mx.prom.init_db_resolve){
210
+						glob_mx.prom.init_db_resolve({aaa:"dsr",pl:parsed.payload})
211
+
212
+					}
213
+
214
+				clog("db_sync_response",ai.from == glob_mx.local_id,ai.from,parsed)
215
+			break;
216
+
217
+		}
218
+		/*
219
+
220
+
221
+		if (parsed.type == "set_msg"){
222
+			var o = parsed.payload
223
+			pf._set_recv(o.path,o.key,o.val)
224
+		} 
225
+		if (parsed.type == "msg_test"){
226
+			clog("msg_test",parsed)
227
+		} 
228
+		*/
229
+
230
+	} catch (err) {
231
+		clog("mhndlr err:",err)
232
+	}
233
+	return true
234
+}
235
+
236
+isProxy = Symbol("isProxy")
237
+
238
+
239
+tlu = {
240
+	object:"",
241
+	string:true,
242
+	number:true,
243
+	undefined:true,
244
+	boolean:true,
245
+}
246
+
247
+
248
+
249
+function type_info(o){
250
+	var t 
251
+	var flags = {
252
+		leaf:false,
253
+		deep_not_prx:false,
254
+		prx:false,
255
+		isObj:false,
256
+		isArr:false,
257
+		els:false,
258
+	}
259
+	t = typeof(o)
260
+	flags.t=t
261
+	if (!(o === null)){
262
+		flags.isArr = Array.isArray(o)
263
+		flags.isObj = Object.prototype == o.__proto__
264
+	}
265
+
266
+	if (tlu[t] === true || o === null){
267
+		flags.leaf = true
268
+	} else if (t == "object" && o.__prx){
269
+		flags.prx = true
270
+	} else if (t == "object" && (flags.isArr || flags.isObj)){
271
+		flags.prx = false
272
+		flags.deep_not_prx = true
273
+	} else {
274
+		clog("ELSE")
275
+		flags.els = true
276
+	}	
277
+
278
+	return flags
279
+
280
+	clog(t,flags)
281
+}
282
+
283
+
284
+
285
+
286
+
287
+function deep_prop(o,p){
288
+	try {
289
+	var arr = jc(p)
290
+	var ret = o
291
+	while (arr.length){
292
+		// clog("deep_prop",arr,ret)
293
+		ret = ret[arr.shift()]
294
+	}
295
+	// clog("deep_prop ret",ret)
296
+	return ret
297
+	} catch(err){console.error("DEEP_PROP ERR:",err)}
298
+}
299
+
300
+
301
+
302
+
303
+delete Proxy_Factory
304
+{
305
+
306
+class Proxy_Factory {
307
+	constructor(o,n="dflt"){
308
+		this.db = o
309
+		this.n = n
310
+		this.hidden_props = ["add_proxy","_set","walker","walker_start","prxy","_sett","_sett2"]
311
+		this._pub_cb =[]
312
+		this.__prx = true
313
+		this.SymPrx = Symbol("SymPrx")
314
+	}
315
+	init(o){
316
+		// clog("BP",this,this.baseProp,this.__proto__.baseProp,window.baseProp)
317
+		this.root = o
318
+	}
319
+	sync(o){
320
+		this.root = jc(o.root)
321
+		o._pub_cb.push(this._set_recv.bind(this))
322
+	}
323
+	get prxy(){
324
+		return this
325
+	}
326
+
327
+	_set(o,k,v,prx,a0){
328
+		this.obj[k]=prx
329
+	}
330
+
331
+	_sett(o,k,v,prx,a0){
332
+		clog("_SETT",this,arguments)
333
+	}
334
+	_sett2(o,k,v,prx,a0){
335
+		clog("_SETT2",this,arguments)
336
+	}
337
+
338
+	set_pub(obj, prop, val,receiver){
339
+		// clog("qia_pub",obj, prop, val,receiver)
340
+		// clog("qia_pub2",this.n,obj.__path_arr, prop, jx(val))
341
+		this._set_pub(obj.__path_arr, prop, jx(val))
342
+
343
+	}
344
+	_set_pub(path,key,val){
345
+		var k,v
346
+					// /*
347
+
348
+			tmsgx({
349
+				"type":"set_msg",
350
+				"payload":{path,key,val},
351
+			},"code")
352
+			//		*/
353
+		for (v of this._pub_cb){
354
+			v(path,key,val)
355
+
356
+		}
357
+	}
358
+
359
+	_set_recv(path,prop,val){
360
+		// return
361
+		var p = path
362
+		var nprop =deep_prop(this.root,p)
363
+		var dpth = nprop.__dpth
364
+		if (tlu[typeof(val)]){
365
+		nprop._set(nprop,prop,val,val)
366
+		} else {
367
+		nprop._set(nprop,prop,val,new Proxy(val,this))
368
+		nprop[prop].add_proxy(nprop,prop,val,dpth+1)
369
+		}
370
+		// var tf = {}
371
+		// this.walker(nprop[prop],tf,dpth+2)
372
+		this.walker(nprop[prop],{},dpth+2)
373
+	}
374
+
375
+	set(obj, prop, val,receiver){
376
+		// clog("prx_db set ",this,obj, prop, val,receiver,val.__prx)
377
+		if (obj[prop] === val){
378
+			return Reflect.set(...arguments)
379
+		}
380
+
381
+		this.set_pub(obj, prop, val,receiver)
382
+		this.event_proc("set")
383
+		
384
+		if ("__prx" == prop){
385
+			this.__prx=val
386
+			return this.__prx
387
+		}
388
+
389
+		if (typeof(val) === "object" && val != null && !(val.__prx)){
390
+			var ret = Reflect.set(...arguments)
391
+			this.set_obj(obj, prop, val,receiver)
392
+			return ret
393
+		} 
394
+
395
+		return Reflect.set(...arguments)
396
+	}
397
+	get(obj, prop,receiver){
398
+		// clog("prx_db get ...",prop==isProxy,this,obj, prop,receiver)
399
+		if (this.hidden_props.includes(prop)){
400
+			switch (prop){
401
+				case "add_proxy":
402
+				return this.add_proxy.bind(this)
403
+			break;
404
+				case "prxy":
405
+				return this
406
+				case "_set":
407
+				// clog("_SET")
408
+				// return this._set.bind({this})
409
+				return this._set.bind({that:this,obj, prop,receiver})
410
+				case "_sett":
411
+				return this._sett.bind({that:this,obj, prop,receiver})
412
+				case "_sett2":
413
+				return this._sett2.bind({that:this})
414
+				case "walker_start":
415
+				return this.walker_start
416
+				case "walker":
417
+				return this.walker
418
+			break;
419
+			}
420
+		}
421
+
422
+		if (isProxy == prop){ return true }
423
+		if ("__prx" == prop){ return this.__prx }
424
+
425
+		return Reflect.get(...arguments)
426
+	}
427
+	add_proxy(o,k,v,dpth){
428
+		// clog("~add_proxy~",o,k,v,dpth)
429
+		// clog("~add_proxy~",o.__prx,o,k,v,dpth,xpath)
430
+		var xpath = o.__path
431
+		var apath = o.__path_arr
432
+		this.event_proc("add_proxy")
433
+		if (!apath){
434
+			apath=[]
435
+		}
436
+
437
+		if (!xpath){
438
+			xpath="ROOT!"
439
+		}
440
+
441
+		Object.defineProperty(v,"__path_arr",Object.assign({value:apath.concat(k),},this.baseProp))
442
+		Object.defineProperty(v,"__path",Object.assign({value:xpath+":"+k,},this.baseProp))
443
+		Object.defineProperty(v,"__dpth",Object.assign({value:dpth,},this.baseProp))
444
+
445
+	}
446
+	set_obj(obj, prop, val,receiver){
447
+		var dpth = obj.__dpth
448
+		var tf = {}
449
+		this.walker(receiver,tf,dpth)
450
+	}
451
+
452
+	walker(o,tfo,dpth=0){
453
+		clog("qia WALK",this)
454
+		if (dpth > 7){
455
+			console.error("MAX DEPTH")
456
+			return
457
+		}
458
+		var k,v
459
+		var tf 
460
+			for ([k,v] of Object.entries(o)){
461
+				tf = type_info(v)
462
+				if (tf.deep_not_prx){
463
+					o._set(o,k,v,new Proxy(v,this.prxy))
464
+					o[k].add_proxy(o,k,v,dpth)
465
+				this.walker(o[k],tf,dpth+1)
466
+				}
467
+			}
468
+	}
469
+	walker_start(o,dpth){
470
+		var tf = type_info(o)
471
+		o.add_proxy({},[],o,-1)
472
+		this.walker(o,tf,0)
473
+	}
474
+	event_proc(e){}
475
+}
476
+window.Proxy_Factory = Proxy_Factory
477
+
478
+Proxy_Factory.prototype.baseProp={
479
+	writable: true,
480
+	// enumerable: true,
481
+	enumerable: false,
482
+	configurable: true,
483
+	}
484
+}
485
+
486
+
487
+function arr_match(m,o){
488
+	var k,v
489
+	var r = 0
490
+	for ([k,v] of Object.entries(m || {})){
491
+		if (o[k] != v.valueOf()){
492
+			r += 1
493
+			return !r
494
+		}
495
+
496
+	// for ([k,v] in m){
497
+		// case 
498
+		clog(k,v)
499
+	}
500
+	return !r
501
+}
502
+
503
+permissions_def = {
504
+	participants:{
505
+		m:["participants"],
506
+		fn(set_scope,match){
507
+
508
+
509
+			clog("FN....",match.fp,match.fp[1] == window.glob_mx.local_id)
510
+			if (match.fp[1] != window.glob_mx.local_id)
511
+				throw "permission err"
512
+			return 
513
+		},
514
+	}
515
+}
516
+// 
517
+// msto.my_data.prxy.__proto__.__proto__.set.call(msto.my_data.prxy,msto.participants,"abc2",{})
518
+permissions_def__set = {
519
+	participants:{
520
+		m:["participants"],
521
+		fn(set_scope,match){
522
+
523
+
524
+			clog("FN....",match.fp,match.fp[1] == window.glob_mx.local_id)
525
+			if (match.fp[1] != window.glob_mx.local_id)
526
+				// throw "permission err"
527
+			return 
528
+		},
529
+	}
530
+}
531
+
532
+
533
+{
534
+	class Proxy_Permissions extends Proxy_Factory {
535
+		constructor(a,a1){
536
+			super(...arguments)
537
+		}
538
+		set(obj, prop, val,receiver){
539
+			clog("PRX_PERM",obj.__path_arr,prop)
540
+			var k,v
541
+			var r
542
+			var matched 
543
+			var fp = obj.__path_arr.concat(prop)
544
+			for ([k,v] of Object.entries(permissions_def)){
545
+				matched = arr_match(v.m,fp)
546
+				if (matched){
547
+					r = v.fn({that:this,obj, prop, val,receiver},{fp,k,v}) || {}
548
+				}
549
+				// if (r.return)
550
+			}
551
+			// case
552
+			// if (obj.__path_arr && obj.__path_arr.length){}
553
+			super.set(obj, prop, val,receiver)
554
+		}
555
+		_set(){
556
+			clog("Proxy_Permissions _set")
557
+			super._set(...arguments)
558
+		}
559
+	}
560
+	window.Proxy_Permissions = Proxy_Permissions
561
+}
562
+
563
+
564
+msto_z = {
565
+	// private_local:{},
566
+	// participant_local:{},
567
+	conference:{},
568
+	participants:{
569
+	},
570
+}
571
+
572
+
573
+
574
+
575
+
576
+function pfnf(o){
577
+	return  function(resolve, reject){
578
+		o.resolve=resolve
579
+		o.reject=reject
580
+		// clog(arguments)
581
+	}
582
+}
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+function init_db_cb(){
592
+}
593
+function init_sync_participant(){
594
+}
595
+function init_db(objx){
596
+		var obj
597
+	if (objx.participants){
598
+		obj = objx
599
+	} else {
600
+		obj = objx.pl
601
+	}
602
+	// var obj = obj.pl
603
+	clog("INIT DB...",objx,obj)
604
+pf = new Proxy_Permissions({},"pf")
605
+msto_prx = new Proxy(obj,pf)
606
+window.msto_prx0 =msto_prx
607
+// msto_prx = new Proxy(msto_z,pf)
608
+pf.init(msto_prx)
609
+msto_prx.walker_start(msto_prx)
610
+
611
+pf.root.participants[glob_mx.local_id] = {}
612
+
613
+
614
+window.msto= {
615
+	participants:pf.root.participants,
616
+	conference:pf.root.conference,
617
+	my_data:pf.root.participants[glob_mx.local_id],
618
+	private_local:{},
619
+}
620
+// var k,v
621
+clog("RUN_CB...")
622
+run_cbs("init_db")
623
+}
624
+
625
+function init_mu(persistent_mods){
626
+	// .role == "moderator"
627
+		clog(">>>>>>>>>>>>>>>>>>>.. RUN_CB")
628
+var participants = get_participants()
629
+clog(participants)
630
+
631
+
632
+
633
+
634
+var local = get_local(participants)
635
+	if (window.glob_mx.local_id && persistent_mods && local.role=="moderator"){
636
+		// if window.glob_mx.local_id
637
+		clog("no RUN_CB")
638
+
639
+		return
640
+	}
641
+window.glob_mx.local_id = local.id
642
+var k,v
643
+window.glob_mx.all_ids = []
644
+window.glob_mx.all_jids = []
645
+for (v of participants){
646
+	window.glob_mx.all_ids.push(v.id)
647
+	window.glob_mx.all_jids.push(`nnnx@conference.jfidev.com/${v.id}`)
648
+}	
649
+	var rr = {}
650
+	var prom1 = new Promise(pfnf(rr));
651
+	prom1.then(init_db)
652
+	// setTimeout(rr.reject,2000,"RESP DB Timeout")
653
+	// setTimeout(rr.resolve,4000,"RESP DB Timeout")
654
+	// setTimeout(rr.resolve,4000,msto_z)
655
+	// setTimeout(rr.resolve,4000,{aaa:"timedout",pl:msto_z})
656
+	setTimeout(rr.resolve,5000,{aaa:"timedout",pl:msto_z})
657
+
658
+	if (participants.length > 1){
659
+	glob_mx.prom.init_db_resolve = rr.resolve
660
+		tmsgx3({type:"db_sync_request"})
661
+
662
+	} else {
663
+		// glob_mx.prom.init_db_resolve(msto_z)
664
+		rr.resolve(msto_z)
665
+	// init_db()
666
+
667
+	}
668
+}
669
+
670
+
671
+
672
+
673
+function create_db(){
674
+	
675
+}
676
+
677
+
678
+
679
+
680
+
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+function isident(){
690
+	return JSON.stringify(pf.root) == JSON.stringify(pf2.root)
691
+}
692
+
693
+
694
+
695
+function init_mu_runner(){
696
+	if (window.glob_mx.conf_joined){
697
+		init_mu(...arguments)
698
+	}
699
+}
700
+
701
+
702
+function init_mx2(){
703
+	clog("INITMX3")
704
+	window.glob_mx.conf_joined =1
705
+	init_mu_runner()
706
+	// add_handler_m(mhndlr)
707
+}
708
+ifn_obj.init_conf_join.push(init_mx2)
709
+
710
+// init_mu_runner("auto")
711
+init_mu_runner("")
712
+
713
+

+ 418
- 0
clone/m/mdev.js View File

@@ -0,0 +1,418 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+o = {a:2,b:3}
10
+
11
+// Object.defineProperties()
12
+Object.defineProperty(o,"b",{
13
+	enumerable:false,
14
+})
15
+Object.defineProperty(o,"c",{
16
+	enumerable:false,
17
+})
18
+Object.defineProperty(o,"d",{
19
+	// enumerable:false,
20
+})
21
+
22
+zxc2 = Object.getOwnPropertyDescriptors (o)
23
+// zxc2.a.enumerable=false
24
+
25
+
26
+
27
+ 
28
+function okv(obj) {
29
+	var k,v
30
+	for ([k,v] of Object.entries(obj))
31
+	// body...
32
+	clog("!",k,v)
33
+}
34
+
35
+cnt = 0
36
+
37
+
38
+
39
+prxt = {
40
+	set:function(obj, prop, val,receiver){
41
+		clog("prxt set ",obj, prop, val,receiver)
42
+		return
43
+
44
+		return Reflect.set(...arguments)
45
+	},
46
+	get:function(obj, prop,receiver){
47
+
48
+
49
+
50
+
51
+
52
+		
53
+		if (window.cnt){
54
+		window.cnt+=1
55
+		clog("prxt get ret",cnt,prop)
56
+			return
57
+		}
58
+		window.cnt+=1
59
+		clog("prxt get",obj, prop,receiver)
60
+		// clog("prxt get",prop)
61
+		// clog("prxt get")
62
+		return
63
+
64
+		return Reflect.get(...arguments)
65
+	},
66
+	// __prx:true,
67
+	// rec:
68
+
69
+}
70
+
71
+
72
+
73
+
74
+delete obsObj
75
+{
76
+
77
+class obsObj {
78
+	constructor(o){
79
+		this.db = o
80
+	}
81
+	_pub_msg(m){
82
+		clog("ixi PUB MSG",m)
83
+	}
84
+	_rec_msg(that,m){
85
+		clog("ixi REC MSG2",m)
86
+	}
87
+	__noSuchMethod__(){
88
+		clog("__lookupGetter__~",arguments)
89
+	}
90
+}
91
+window.obsObj = obsObj
92
+glob_mx.obsobj =new obsObj({})
93
+glob_mx.obsobj2 =new obsObj({})
94
+}
95
+
96
+
97
+glob_mx.obsobj.__proto__ = new Proxy(glob_mx.obsobj.__proto__,prxt)
98
+
99
+delete Magic
100
+{
101
+
102
+class Magic {
103
+    constructor () {
104
+        return new Proxy(this, this);
105
+    }
106
+    get (target, prop) {
107
+        return this[prop] || 'MAGIC';
108
+    }
109
+}
110
+window.Magic = Magic
111
+glob_mx.magic =new Magic({})
112
+glob_mx.magic2 =new Magic({})
113
+// glob_mx.magic3 =new Magic({})
114
+}
115
+// __lookupGetter__
116
+
117
+// function replacer(a0,a1,a2,a3,a4){
118
+hdn = [
119
+"__path_arr",
120
+"__path",
121
+"__dpth",
122
+]
123
+
124
+function replacer(key,val){
125
+	// clog("REP",key,val,this)
126
+	var v,k
127
+	if (typeof(val) == "object" && val != null){
128
+		// val._add="Z"
129
+		v = Object.assign({},val)
130
+		for (k of hdn){
131
+			v[k] = val[k]
132
+		}
133
+		return v
134
+	}
135
+	return val
136
+	// return a0
137
+}
138
+
139
+
140
+function jh(o){
141
+	return JSON.parse(JSON.stringify(o, replacer))
142
+}
143
+
144
+
145
+s1 ={a:{b:{c:3}}}
146
+// JSON.stringify({a:{b:{c:3}}}, replacer)
147
+// JSON.stringify({}, replacer)
148
+// JSON.stringify({a:{b:{c:3}}}, replacer)
149
+// JSON.stringify({}, replacer[, space]])
150
+// 
151
+m = {}
152
+m.m0 = {
153
+	// k:["z2"]
154
+}
155
+m.m1 = {
156
+	k:["z2","z3"]
157
+}
158
+m.m2 = {
159
+	k:["z3"]
160
+}
161
+// m.
162
+
163
+
164
+function isSubset(subset,superset){
165
+    for (var elem of subset) {
166
+        if (!superset.includes(elem)) {
167
+            return false;
168
+        }
169
+    }
170
+    return true;  
171
+}
172
+
173
+function isSubset_arr(subset,superset){
174
+    for (var elem of subset) {
175
+    	if (Array.isArray(elem)){
176
+
177
+    		if (!new Set(elem).intersection(superset).size){
178
+    			return false
179
+    		}
180
+    	} else if (!superset.includes(elem)) {
181
+            return false;
182
+        }
183
+    }
184
+    return true;  
185
+}
186
+
187
+
188
+function sym_info(o){
189
+	var k,v 
190
+	for ([k,v] of Object.entries(syms)){
191
+		// clog(k,v)
192
+		clog(k,o[v])
193
+	}
194
+}
195
+
196
+function art(m,o){
197
+	var k,v
198
+	var r = 0
199
+	var ret = {}
200
+	var md =Object.getOwnPropertyDescriptors(m)
201
+
202
+	for ([k,v] of Object.entries(md)){
203
+		if (typeof(v.value) == "symbol"){
204
+			r+=1
205
+			ret[k]=v.value
206
+		}
207
+
208
+
209
+	// for ([k,v] in m){
210
+		// case 
211
+		clog(k,typeof(v.value),v.value,[v])
212
+	}
213
+	return {cnt:r,o:ret}
214
+}
215
+syms = art(Symbol).o
216
+
217
+function match(mx,m,o){
218
+	var k,v,k2,v2
219
+	var r = 0
220
+		// clog("@",mx,m,o)
221
+	for ([k,v] of Object.entries(m || {})){
222
+		v2 = o[k]
223
+    // clog("M~",k,typeof(v),typeof(v2),v,v2)
224
+		if (typeof(v) == "string" && typeof(v2) == "string") {
225
+			r += !(v==v2)
226
+		} else if (Array.isArray(v) && Array.isArray(v2)){
227
+			r += !(isSubset_arr(v,v2))
228
+		} else if (Array.isArray(v) && typeof(v2) == "string"){
229
+      // r += !(isSubset_arr(v2,v))
230
+      // r += !(isSubset_arr(v2,v))
231
+      r += !v.includes(v2)
232
+			// clog("!!!!!!!!!!!!!",v,v2,isSubset_arr(v2,v))
233
+		} else if (Array.isArray(v2) && typeof(v) == "string"){
234
+			r += !(v2.includes(v))
235
+		}
236
+		if (r){
237
+			return !r
238
+		}
239
+	}
240
+	return !r
241
+}
242
+
243
+
244
+// clog("m1,m2",match({},m.m1,m.m2))
245
+// clog("m2,m1",match({},m.m2,m.m1))
246
+
247
+// clog("m2,m0",match({},m.m2,m.m0))
248
+// clog("m0,m2",match({},m.m0,m.m2))
249
+
250
+
251
+a = ["A","B","C"]
252
+a1 = ["A","B",,"D"]
253
+a1[-1]="z"
254
+a1["q"]="z2"
255
+s2 = "str2"
256
+
257
+r1 = [/a\d/,/b[a-z]\d/]
258
+
259
+delete Str
260
+{
261
+
262
+class Str extends String {
263
+	// constructor(o){
264
+		// super(o)
265
+	// }
266
+	/*
267
+		this.db = o
268
+	}
269
+	_pub_msg(m){
270
+		clog("ixi PUB MSG",m)
271
+	}
272
+	_rec_msg(that,m){
273
+		clog("ixi REC MSG2",m)
274
+	}
275
+	*/
276
+}
277
+window.Str = Str
278
+}
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+function gpt(){
294
+	try {
295
+	clog("gx gpt",get_participants)
296
+	clog("gx gpt2",get_participants())
297
+
298
+	}	catch (err) {
299
+
300
+	clog("gx gpt err:",err)
301
+	}
302
+}
303
+
304
+gpt()
305
+
306
+
307
+
308
+{
309
+
310
+class QString extends String {
311
+    isEmpty() {
312
+        return this.length === 0;
313
+    }
314
+    concat(){
315
+      return new QString(this + Array.prototype.join.call(arguments, ''));
316
+    }
317
+}
318
+
319
+var testQStr1 = new QString("abc");
320
+var testQStr2 = new QString("as easy as");
321
+var testQStr3 = new QString("123");
322
+var testStr3 = new String("123");
323
+
324
+console.log(testQStr1,testQStr1 == "abc");
325
+test1 = testQStr1.concat(testQStr2,testQStr3);
326
+console.log(test1,test1=="abcas easy as123");
327
+
328
+
329
+
330
+
331
+}
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+function switch_t(m,o){
343
+	// var t 
344
+	// var flags = {
345
+	// 	leaf:"??",
346
+	// 	prx:"??",
347
+	// }
348
+	// t = typeof(o)	
349
+	// t=o
350
+	// var s1 = t
351
+	// var s2 = 2
352
+	// var s0 = [s1,s2]
353
+	// switch (...s0){
354
+	switch (o[0],o[1]){
355
+		case m[0][0],m[0][1]:
356
+		clog("m0")
357
+	break;
358
+		case  m[1][0],m[1][1]:
359
+		clog("m1")
360
+		clog(m[1][0],m[1][1],":",o[0],o[1])
361
+		// clog("~MX~","tlu")
362
+	break;
363
+	default:
364
+		clog("default")
365
+
366
+	}
367
+}
368
+o1 = []
369
+m1 = [[],[]]
370
+function wait(ms) {
371
+  return new Promise(r => setTimeout(r, ms));
372
+}
373
+pfn1= async function(resolve, reject) {
374
+	clog("RESV")
375
+  // resolve('Success!');
376
+	window.pfn1_cb = function(/*resolve, reject*/) {
377
+  resolve('Success!');
378
+	}
379
+	await wait(3000)
380
+	
381
+	reject("TIMED_OUT")
382
+}
383
+pfn2=  function(resolve, reject) {
384
+	clog("RESV")
385
+  resolve({zzz:'Success!'});
386
+
387
+
388
+}
389
+
390
+prm ={}
391
+
392
+// prm.resolve("zzz")
393
+// promise1 = new Promise(pfn1);
394
+
395
+
396
+promise1 = new Promise(pfnf(prm));
397
+
398
+setTimeout(prm.reject,3000,"ST REJ")
399
+
400
+	clog("and then")
401
+promise1.then(function(value) {
402
+  console.log(this,value,arguments);
403
+  // expected output: "Success!"
404
+});
405
+
406
+promise1.then(function(value) {
407
+  console.log("this,value,arguments");
408
+  // expected output: "Success!"
409
+});
410
+
411
+promise1.catch(function(value) {
412
+  console.log("REJECT",this,value,arguments);
413
+  // expected output: "Success!"
414
+});
415
+	clog("and then...")
416
+
417
+
418
+prm.resolve("11111zzz","zzzzzzz")

+ 60
- 0
clone/m/moveto.js View File

@@ -0,0 +1,60 @@
1
+
2
+
3
+
4
+
5
+
6
+mhndlr_opt_x_all = {
7
+	cstr:"?",
8
+	ns:"jabber:client",
9
+	// name:"message",
10
+	type:"groupchat",
11
+	handler:allevnt,
12
+	// isMatch:rtrue2,
13
+	// run:rtrue3,
14
+	// namespaceMatch:rtrue,
15
+
16
+
17
+}
18
+
19
+function allevnt(a0,a1,a2,a3,a4){
20
+	// clog("MH! allevnt")
21
+	setTimeout(window.allevnt_rld,1,this,a0,a1,a2,a3,a4)
22
+	return true
23
+}
24
+function rld_room(room){
25
+	clog("rld_room...",room)
26
+	window.location.assign(room)
27
+}
28
+function allevnt_rld(a0,a1,a2,a3,a4){
29
+	var msg = a1.querySelector(`body`)
30
+	if (!msg){
31
+		return
32
+	}
33
+	var msg_txt = msg.innerHTML 
34
+	if (msg_txt.startsWith("moveto=")){
35
+		var room = msg_txt.split("=").pop()
36
+		if (room){
37
+	var _from = a1.getAttribute("from").split("/").pop()
38
+	if (get_local().id == _from){
39
+		rld_room(room)
40
+	} else {
41
+		setTimeout(rld_room,2000,room)
42
+
43
+	}
44
+
45
+		}
46
+
47
+	} 
48
+	return true
49
+}
50
+
51
+
52
+
53
+function init_mx(){
54
+	clog("INITMX moveto")
55
+	// add_handler_m(mhndlr_opt_x)
56
+	add_handler_m(mhndlr_opt_x_all)
57
+}
58
+
59
+ifn_obj.init_conf_join.push(init_mx)
60
+

+ 0
- 0
clone/m/timer/New Text Document.txt View File


+ 145
- 0
clone/m/timer/m.css View File

@@ -0,0 +1,145 @@
1
+
2
+.abs {
3
+	background: #0080;
4
+	position: absolute;
5
+	z-index: 100;
6
+	top:0;
7
+	left:0;
8
+	right: 0;
9
+	bottom: 0;
10
+	margin: inherit;
11
+}	
12
+
13
+
14
+
15
+
16
+.icont {
17
+	/*background: #0ff8;*/
18
+
19
+	width: 100%;
20
+	height: 100%;
21
+	position: relative;
22
+}
23
+
24
+
25
+
26
+.xbox {
27
+	width: 25px;
28
+	height: 25px;
29
+	/*color: #0000;*/
30
+	color: #000;
31
+	background: #0ff;
32
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
33
+}
34
+
35
+.xbox2 {
36
+	width: 25px;
37
+	height: 25px;
38
+	position: relative;
39
+	position: absolute;
40
+	color: #000;
41
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
42
+}
43
+
44
+
45
+
46
+.small_vid .xbox:after,.small_vid .xbox2:after{
47
+/*.xbox:after,.xbox2:after{*/
48
+	content: "???";
49
+	z-index: 0;
50
+	white-space: pre-wrap;
51
+	content: var(--v_index,":???:") "\A" var(--v_id,":???:");
52
+	background-color: #fff;
53
+	position:absolute;
54
+	top: 0;
55
+	width: 75px;
56
+	height: 45px;
57
+	left: 0;
58
+	/*right: 0;*/
59
+	/*bottom: 0;*/
60
+}
61
+
62
+
63
+.xbox.m2s {
64
+	width: 75px;
65
+	height: 75px;
66
+
67
+	width: 100%;
68
+	height: 100%;
69
+
70
+	background: #ff8;
71
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
72
+
73
+
74
+}
75
+
76
+
77
+
78
+
79
+.pseudo_vid {
80
+	background-color: #f00;
81
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
82
+}
83
+
84
+
85
+.tile-view .pseudo_vid,.vertical-filmstrip .pseudo_vid{
86
+	background-size:contain;
87
+	/*border: 2px solid transparent !important;*/
88
+	margin:4 5px;
89
+	width: 100%;
90
+}
91
+
92
+.small_vid {
93
+	display: block;
94
+}
95
+.pseudo_vid {
96
+	/*display: none;*/
97
+	position: relative;
98
+	/*position: absolute;*/
99
+}
100
+
101
+
102
+
103
+.vspace {
104
+	position: absolute;
105
+	/*height: 500px;*/
106
+	height: 100%;
107
+	width: 100%;
108
+	/*width: calc(100% - 4px);*/
109
+	width: calc(100% );
110
+	width: calc(100% - 4px);
111
+	/*background-color: #555;*/
112
+	height: calc(100% - 4px);
113
+	border-radius: 100px;
114
+
115
+}
116
+
117
+
118
+.m4 {
119
+	width: 50px;
120
+	height: 50px;
121
+	top: 200px;
122
+	left: 10px;
123
+	z-index: 100; 
124
+	position: relative;
125
+	background-color: #00f;
126
+}
127
+
128
+
129
+
130
+
131
+.cont {
132
+	/*position: relative;*/
133
+	position: absolute;
134
+
135
+}
136
+
137
+.toolbox-background{
138
+	z-index: 100 !important;
139
+}
140
+
141
+
142
+
143
+.c6 {
144
+	overflow-x: scroll;
145
+}

+ 156
- 0
clone/m/timer/m.html View File

@@ -0,0 +1,156 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+HI THIS is AN HTML SNIPIT
9
+
10
+
11
+<!-- <div class="mp1">abc</div>
12
+<div class="mp2">def</div> -->
13
+
14
+
15
+
16
+
17
+<span class="plugin_top abs filmstrip_template"><div class="dev_filmstrip">
18
+	<span class="cont c1">
19
+		<div class="icont ic1"></div>
20
+	</span>
21
+	<span class="cont c2">
22
+		<div class="icont ic2"></div>
23
+	</span>
24
+	<span class="cont c3">
25
+		<div class="icont ic3"></div>
26
+	</span>
27
+</div></span>
28
+
29
+
30
+
31
+
32
+<span id="vspace_filmstrip_template0" class="plugin_top abs2"><div class="dev_filmstrip">
33
+	<span class="cont c1">
34
+		<div class="icont ic1 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
35
+	</span>
36
+	<span class="cont c2">
37
+		<div class="icont ic2 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
38
+	</span>
39
+	<span class="cont c3">
40
+		<div class="icont ic3 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
41
+	</span>
42
+	<span class="cont c6">
43
+		<div class="icont ic6 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
44
+	</span>
45
+	<span class="cont c5">
46
+		<div class="icont ic5 vid_container" data-fs_type="single" data-fs_handler="center"></div>
47
+		<div class="at a1"></div>
48
+		<div class="at a2"></div>
49
+		<div class="at a3"></div>
50
+		<div class="at a4"></div>
51
+	</span>
52
+	<span class="cont c4">
53
+		<div class="icont ic4 vid_container" data-fs_type="single"></div>
54
+	</span>
55
+</div></span>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+<!-- 
68
+<input type="checkbox" name="">
69
+ -->
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+<span id="vspace_filmstrip_template" class="plugin_top abs2"><div class="dev_filmstrip">
80
+	<span class="fs_container">
81
+	<span class="cont c2">
82
+		<div class="icont ic2 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
83
+	</span>
84
+	<span class="cont c1">
85
+		<div class="icont ic1 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
86
+	</span>
87
+	<span class="cont c3">
88
+		<div class="icont ic3 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
89
+	</span>
90
+	<span class="cont c6">
91
+		<div class="icont ic6 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
92
+	</span>
93
+	<!-- 
94
+	<span class="cont c5">
95
+		<div class="icont ic5 vid_container" data-fs_type="single" data-fs_handler="center"></div>
96
+		<div class="at a1"></div>
97
+		<div class="at a2"></div>
98
+		<div class="at a3"></div>
99
+		<div class="at a4"></div>
100
+	</span>
101
+	 -->
102
+	<span class="cont c4">
103
+		<div class="icont ic4 vid_container" data-fs_type="single" data-fs_handler="center"></div>
104
+	</span>
105
+	</span>
106
+</div></span>
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+<span id="vspace_filmstrip_proto_template" class="plugin_top abs2"><div class="dev_filmstrip">
117
+	<!-- 
118
+	<span class="cont c1">
119
+		<div class="icont ic1 vid_container" data-fs_type="vertical"></div>
120
+	</span>
121
+	<span class="cont c2">
122
+		<div class="icont ic2 vid_container" data-fs_type="horizontal"></div>
123
+	</span>
124
+	<span class="cont c3">
125
+		<div class="icont ic3 vid_container" data-fs_type="vertical"></div>
126
+	</span>
127
+	 -->
128
+
129
+	<span class="cont c5">
130
+		<!-- <div class="icont ic5 vid_container" data-fs_type="single"></div> -->
131
+		<div class="at a1"></div>
132
+		<div class="at a2"></div>
133
+		<div class="at a3"></div>
134
+		<div class="at a4"></div>
135
+		<div class="at a5"></div>
136
+		<div class="at a6"></div>
137
+		<div class="at a7"></div>
138
+		<div class="at a8"></div>
139
+
140
+
141
+
142
+		<div class="at at2 b1"></div>
143
+		<div class="at at2 b2"></div>
144
+		<div class="at at2 b3"></div>
145
+		<div class="at at2 b4"></div>
146
+		<div class="at at2 b5"></div>
147
+		<div class="at at2 b6"></div>
148
+		<div class="at at2 b7"></div>
149
+		<div class="at at2 b8"></div>
150
+
151
+
152
+	</span>
153
+	<span class="cont c4">
154
+		<!-- <div class="icont ic4 vid_container" data-fs_type="single"></div> -->
155
+	</span>
156
+</div></span>

+ 278
- 0
clone/m/timer/m.js View File

@@ -0,0 +1,278 @@
1
+
2
+// this will be refactored into the api and an a filmstrip module
3
+
4
+mod_templates = window.mod_templates || $("")
5
+
6
+// reload templates
7
+function html_js_handler(rsp) {
8
+	clog("html_js_handler",[...arguments])
9
+	mod_templates = $(`<span>${rsp}</span>`)
10
+	init_api6()
11
+}
12
+
13
+
14
+
15
+html_hooks = {
16
+	create_video_tile(n){
17
+		add_node(n,`#localVideoTileViewContainer`,"before")
18
+	},
19
+	create_vid_toptoolbar_hook(n){
20
+		add_node(n,`.vid_toptoolbar_hook`,"append")
21
+	},
22
+	create_vid_toptoolbar_hook_after(n){
23
+		add_node(n,`.vid_toptoolbar_hook`,"append")
24
+	},
25
+	// Top of window
26
+	create_top_toolbox_hook(n){
27
+		add_node(n,`.top_toolbox`,"append")
28
+	},
29
+	create_bottom_toolbox_hook(n){
30
+		add_node(n,`.button-group-right`,"prepend")
31
+	},
32
+	create_new_filmstrip(n){
33
+		add_node(n,`#filmstripRemoteVideos`,"prepend")
34
+	},
35
+}
36
+
37
+
38
+
39
+function saftly_remove(n,remove_nodes=true){
40
+	const j =$(n)
41
+
42
+	$(`#localVideoTileViewContainer`).append(j.find(".local_vid"))
43
+	$(`#filmstripRemoteVideosContainer`).append(j.find("#localVideoTileViewContainer"))
44
+
45
+	$(`#localVideoTileViewContainer`).before(j.find(".remote_vid"))
46
+	remove_nodes ? j.remove() : clog("DO NOT REMOVE")
47
+
48
+
49
+}
50
+
51
+// follow focus EventListener
52
+function ffcb(){
53
+	clog("ffcb",this.value,this.checked,[this,...arguments])
54
+	disp(glob_react.base_conference.setFollowMe(this.checked))
55
+	var follow_focus_force=$("#follow_focus_force")[0] 
56
+	if (follow_focus_force.checked && !this.checked){
57
+		msto.conference.force_follow = this.checked
58
+		follow_focus_force.checked = this.checked
59
+
60
+	}
61
+}
62
+// force follow focus EventListener
63
+function fffcb(){
64
+	var follow_focus=$("#follow_focus")[0]
65
+
66
+	if (!follow_focus.checked && this.checked){
67
+
68
+	follow_focus.checked = this.checked
69
+	ffcb.bind(follow_focus)()
70
+	}
71
+	msto.conference.force_follow = this.checked
72
+}
73
+// number of pseudo videos EventListener
74
+function num_pseudo(){
75
+	msto.conference.repeat = this.value
76
+	setTimeout(refresh_fs_send,100)
77
+}
78
+// overflow scroll EventListener
79
+function scroll_timeout_runner(){
80
+	$("#follow_focus_force")[0] 
81
+	// scroll_send)
82
+	var ov_timeout=$("#ov_timeout")[0]
83
+	var ov_timeout_disable=$("#ov_timeout_disable")[0]
84
+	// ov_timeout_disable
85
+	if (ov_timeout_disable.checked){
86
+		timeout_scroll_glob.stop = 1
87
+	} else {
88
+		timeout_scroll_glob.stop = 0
89
+
90
+	}
91
+	if (!isNaN(ov_timeout.value) && ov_timeout.value > .2){
92
+		timeout_scroll_glob.timeout = Math.ceil(ov_timeout.value * 1000)
93
+		msto.conference.scroll_timeout = ov_timeout.value
94
+		timeout_scroll_start()
95
+	}
96
+}
97
+
98
+
99
+// to
100
+
101
+function refresh_toolbars(){
102
+    saftly_remove(".plugin_top.tbar")
103
+    // this stuff should go in a template
104
+
105
+    n = `
106
+    <span class="plugin_top tbar"><span class="outline_indicator ind_1"></span><span class="outline_indicator ind_2"></span><span class="outline_indicator ind_3"></span>
107
+    <div class="m xbox">ABC</div>
108
+    </span>`
109
+
110
+    html_hooks.create_vid_toptoolbar_hook_after(n)
111
+    n = `<span class="plugin_top tbar"><span class="m follow_focus">
112
+<input type="checkbox" id="follow_focus" name="follow_focus">
113
+<label for="follow_focus">
114
+follow focus (moderator only)
115
+</label>
116
+
117
+<br>
118
+<input type="checkbox" id="follow_focus_force" name="follow_focus_force">
119
+<label for="follow_focus_force">
120
+force
121
+</label>
122
+</span>
123
+<span class="m follow_focus2">
124
+ <label for="num_pseudo"># of pseudo videos</label>
125
+  <input type="number" id="num_pseudo" name="num_pseudo" value=${window.msto ? msto.conference.repeat || 0 : 0} min=0>
126
+<br>
127
+  <label for="ov_timeout">overflow scroll interval </label>
128
+  <input type="number" id="ov_timeout" name="timeout" min=.4 step=.1 value=${window.msto ? msto.conference.scroll_timeout || 15 : 15}>
129
+
130
+<br>
131
+<input type="checkbox" id="ov_timeout_disable" name="ov_timeout_disable">
132
+<label for="ov_timeout_disable" class="inline_input">
133
+disable
134
+</label>
135
+<span class="inline_input"><button id="scroll_now" class="inline_input">scroll now</button></span>
136
+
137
+</span>
138
+</span>`
139
+
140
+	// add moderator elements
141
+    if (amimod()){
142
+
143
+    n = $(n)
144
+    n.find("input#follow_focus")[0].onchange = ffcb
145
+    n.find("input#follow_focus_force")[0].onchange = fffcb
146
+    n.find("input#ov_timeout")[0].onchange = scroll_timeout_runner
147
+    n.find("input#ov_timeout_disable")[0].onchange = scroll_timeout_runner
148
+    n.find("#scroll_now")[0].onclick = scroll_send
149
+    n.find("#num_pseudo")[0].onchange = num_pseudo
150
+
151
+    add_node(n,`.subject`,"prepend")
152
+    }
153
+}
154
+
155
+
156
+// 
157
+function init_api6(){
158
+    saftly_remove(".plugin_top")
159
+    // return
160
+    var arr = []
161
+    var n 
162
+    n = `<span class="plugin_top pseudo_vid small_vid "><div class="m2 xbox2">ABC</div></span>`
163
+
164
+    const repeat = window.msto ?  msto.conference.repeat || 0 : 0
165
+    if ((!isNaN(repeat) && repeat > 0 )){
166
+    html_hooks.create_video_tile(n.repeat(repeat))
167
+    }
168
+
169
+    refresh_toolbars()
170
+    
171
+    n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
172
+    html_hooks.create_bottom_toolbox_hook(n)
173
+
174
+
175
+    // n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
176
+    // n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
177
+    // n= mod_templates.find(".filmstrip_template")[0].outerHTML
178
+    // html_hooks.create_new_filmstrip(n)
179
+    // n = `<span class="plugin_top pseudo_vid small_vid "><div class="m4 xbox3">ABC</div></span>`
180
+
181
+    let nj = mod_templates.find("#vspace_filmstrip_template")
182
+    if (nj.length){
183
+    n= mod_templates.find("#vspace_filmstrip_template")[0].outerHTML
184
+    add_node(n,`.vspace`,"append")
185
+    }
186
+
187
+    if (window.mod_sort){
188
+    mod_sort()
189
+    }
190
+
191
+    dispatch_resize()
192
+
193
+
194
+}
195
+
196
+
197
+
198
+
199
+
200
+/*
201
+// example event 
202
+function event_test(){
203
+
204
+            tmsgx({
205
+                "type":"event",
206
+                "payload":{path:"z",key:"z",val:"z",etype:"xyz"},
207
+            },"code")
208
+}
209
+
210
+
211
+function all_plugin_events(e){
212
+	clog("all_plugin_events",[this],[...arguments])
213
+}
214
+
215
+
216
+glob_mx.event_handlers.e1 = {
217
+	fn:all_plugin_events,
218
+	m:{},
219
+}
220
+*/
221
+
222
+
223
+function refresh_fs_send(){
224
+
225
+            tmsgx({
226
+                "type":"event",
227
+                "payload":'{path,key,val}',
228
+                etype:"refresh_fs"
229
+            },"code")
230
+}
231
+
232
+function refresh_fs_proc(){
233
+    init_api6()
234
+mod_sort()
235
+new_move()
236
+
237
+dispatch_resize()
238
+	clog("refresh_fs_proc")
239
+}
240
+
241
+function scroll_send(){
242
+
243
+            tmsgx({
244
+                "type":"event",
245
+                "payload":'{path,key,val}',
246
+                etype:"overflow_scroll"
247
+            },"code")
248
+}
249
+
250
+
251
+function scroll_proc(e){
252
+	scroll_to()
253
+    // clog("scroll_proc",[this,...arguments])
254
+}
255
+
256
+
257
+glob_mx.event_handlers.e2 = {
258
+    fn:scroll_proc,
259
+    // fn:nop,
260
+    // m:{etype:"timer_start"},
261
+    m:{etype:"overflow_scroll"},
262
+}
263
+
264
+glob_mx.event_handlers.e3 = {
265
+    fn:refresh_fs_proc,
266
+    // fn:nop,
267
+    // m:{etype:"timer_start"},
268
+    m:{etype:"refresh_fs"},
269
+}
270
+
271
+
272
+
273
+
274
+if (window.refresh_fs_proc){
275
+	refresh_fs_proc()
276
+
277
+}
278
+

+ 755
- 0
clone/m/timer/m0.js View File

@@ -0,0 +1,755 @@
1
+
2
+glob_mx.filmstrip_handlers[undefined] = function function_name(argument) {
3
+    clog("default FN HANDLER")
4
+}
5
+glob_mx.dims = glob_mx.dims || {} 
6
+
7
+dflt_css = {
8
+      'padding-top': '',
9
+      "min-height": ``,
10
+      "min-width": ``,
11
+      width: ``,
12
+      height: ``,
13
+    
14
+}
15
+
16
+
17
+
18
+function fix_avatar(vid){
19
+    var k,v,bcr
20
+    for (v of  $(vid).filter(".remote_vid,.local_vid")){
21
+        bcr = v.getBoundingClientRect()
22
+        $(v).find(".avatar-container").css({
23
+            width:Math.ceil(bcr.height * .75),
24
+            height:Math.ceil(bcr.height * .75),
25
+        })
26
+    }
27
+}
28
+
29
+
30
+
31
+function resize_thumbs_vertical(cont){
32
+  const computed_css = Object.assign({},dflt_css)
33
+
34
+  var aspect = 16/9
35
+  var width = 335
36
+  var thumbs = $(cont).children(".small_vid")
37
+  width = $(cont).width() - 1  
38
+  width = glob_mx.dims.w5
39
+  // computed_css["--v_index"]=`"VERT"`
40
+  var height = Math.round(width/aspect)
41
+  computed_css.height = height
42
+  computed_css["min-height"] = height
43
+  computed_css.width = width
44
+  computed_css["min-width"] = width
45
+  var k,v
46
+  for ([k,v] of Object.entries(computed_css)){
47
+    Number(v) ? computed_css[k] = v + "px" : 0
48
+  }
49
+  // clog("RTHUMBS")
50
+  thumbs.css(computed_css)
51
+  fix_avatar(thumbs)
52
+
53
+}
54
+
55
+function resize_thumbs_horizontal(cont){
56
+  const computed_css = Object.assign({},dflt_css)
57
+
58
+  var aspect = 16/9
59
+  var width = 335
60
+  // computed_css["--v_index"]=`"horizontal"`
61
+  var thumbs = $(cont).children(".small_vid")
62
+  width = ($(cont).height() * aspect) 
63
+  width = ($(cont).height() * aspect) - 1
64
+  width = glob_mx.dims.w5
65
+  var height = Math.round(width/aspect)
66
+  computed_css.height = height
67
+  computed_css.width = width
68
+  clog("RTH",cont)
69
+  computed_css["min-width"] = width
70
+  var k,v
71
+  for ([k,v] of Object.entries(computed_css)){
72
+    Number(v) ? computed_css[k] = v + "px" : 0
73
+  }
74
+  // clog("RTHUMBS")
75
+  fix_avatar(thumbs)
76
+  thumbs.css(computed_css)
77
+
78
+
79
+}
80
+
81
+function resize_thumbs_center(cont){
82
+  const computed_css = Object.assign({},dflt_css)
83
+
84
+  var aspect = 16/9
85
+  var width = 335
86
+  // computed_css["--v_index"]=`"horizontal"`
87
+  var thumbs = $(cont).children(".small_vid")
88
+  width = ($(cont).width() ) - 10
89
+  var height = Math.round(width/aspect)
90
+  computed_css.height = height
91
+  computed_css.width = width
92
+  var k,v
93
+  for ([k,v] of Object.entries(computed_css)){
94
+    Number(v) ? computed_css[k] = v + "px" : 0
95
+  }
96
+  // clog("RTHUMBS")
97
+  thumbs.css(computed_css)
98
+  fix_avatar(thumbs)
99
+
100
+
101
+}
102
+
103
+
104
+dflt_css_proto = {
105
+
106
+      'padding-top': '',
107
+      "max-height": ``,
108
+      "min-height": ``,
109
+      "max-width": ``,
110
+      "min-width": ``,
111
+      width: ``,
112
+      height: ``,
113
+      top: ``,
114
+      left: ``,
115
+      bottom: ``,
116
+      right: ``,
117
+      position:``,
118
+      tramsform:``,
119
+      // right: ``,
120
+      // right: ``,
121
+    
122
+}
123
+
124
+function resize_thumbs_proto(thumbs,css_arg){
125
+  var k,v
126
+  let css
127
+  if (Array.isArray(css_arg)){
128
+    css = Object.assign({},dflt_css_proto,...css_arg)
129
+  } else {
130
+    css = Object.assign({},dflt_css_proto,css_arg)
131
+  }
132
+
133
+  if (typeof(css.data) == "object"){
134
+    try{
135
+    Object.assign($(thumbs)[0].dataset,css.data)
136
+} catch(err) {
137
+    clog("dataset err",err)
138
+}
139
+  }
140
+  css["--vdim"] = `"${css.width} x ${css.height}"`
141
+  $(thumbs).css(css)
142
+
143
+}
144
+
145
+
146
+
147
+
148
+
149
+// this handles the layout of all custom filmstrips an the large video element
150
+// todo refactor half of this into the api
151
+function calc_fs_dims(){
152
+    const hd_w = 16
153
+    const hd_h = 9
154
+
155
+    const aspect_ratio_hd = hd_w / hd_h
156
+
157
+    const aspect_ratio_65 = (hd_w * 6) / (hd_h * 5)
158
+    const aspect_ratio_64 = (hd_w * 6) / (hd_h * 4)
159
+
160
+
161
+    const state = APP.store.getState();
162
+    var { clientHeight, clientWidth } = state['features/base/responsive-ui'];
163
+    var avail_width  =clientWidth
164
+    // var avail_height =clientHeight - 100
165
+    var avail_height =clientHeight - 45
166
+
167
+
168
+
169
+    var dim_hd = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
170
+            columns:1,
171
+    visibleRows:1,
172
+    clientWidth:avail_width,
173
+    clientHeight:avail_height,
174
+    TILE_ASPECT_RATIO:TILE_ASPECT_RATIO ,
175
+    verticalMargin:0,
176
+    // sideMargins=0,
177
+    // topBottomPadding:100,
178
+    })
179
+    let w5,h5,w53,h53,w54,h54
180
+    h5 = dim_hd.height/5
181
+    w5 = dim_hd.width/5
182
+    let m = 10
183
+    let wm = 10
184
+    let hm = 8
185
+    // w5 = w5 - m
186
+    // h5 = h5 - m
187
+
188
+
189
+    w53 = w5 * 3
190
+    h53 = h5 * 3
191
+    w54 = w5 * 4
192
+    h54 = h5 * 4
193
+    w5 = w5 - m 
194
+    h5 = h5 - hm
195
+
196
+    glob_mx.dims.w5 = w5 
197
+    glob_mx.dims.h5 = h5 
198
+    glob_mx.dims.m = m
199
+
200
+    h54 = h54  + (hm * 2)
201
+    let vtop 
202
+    let vleft 
203
+    let s_width,h_height
204
+    s_width = w53 
205
+    h_height = h53  + 1 * hm
206
+    vleft = w5 + ( m ) 
207
+    // = h5 + ((m * 2 ) / aspect_ratio_hd) + 1
208
+    vtop = h5 + ( m * 2 ) - 2 
209
+    vtop = h5 + (hm * 1.5)
210
+    clog("....",clientHeight - dim_hd.height  > 100,clientHeight - dim_hd.height,clientHeight , dim_hd.height)
211
+
212
+    var top_margin_flag 
213
+    if (clientHeight - dim_hd.height  > 150 ) {
214
+
215
+     top_margin_flag = 1
216
+    // $(".fs_container").css({width:dim_hd.width,"min-height":dim_hd.height,"max-height":dim_hd.height + 100})
217
+    resize_thumbs_proto($(".fs_container"),{width:dim_hd.width,"height":dim_hd.height})
218
+    // top_margin_flag = 
219
+    // $(".fs_container").css({width:dim_hd.width,"min-height":dim_hd.height,"max-height":dim_hd.height + 100})
220
+    } else {
221
+     top_margin_flag = 0
222
+    // resize_thumbs_proto($(".fs_container"),{width:dim_hd.width,"height":dim_hd.height})
223
+    resize_thumbs_proto($(".fs_container"),{width:dim_hd.width,"min-height":dim_hd.height,"max-height":dim_hd.height + 100})
224
+
225
+    }
226
+    // $(".fs_container").css({width:dim_hd.width,"height":dim_hd.height})
227
+    // fs_type: "vertical"
228
+    resize_thumbs_proto($(".ic1"),[
229
+        {
230
+                 width:dim_hd.width,
231
+        height:h5,
232
+            "--vtext":`"top_fs"`,
233
+            // data:{fs_type: "vertical"},
234
+            data:{fs_type: "horizontal",},
235
+        },])
236
+
237
+
238
+    resize_thumbs_proto($(".ic2"),[
239
+        {
240
+                 width:w5,
241
+        height:h53,
242
+        top:vtop ,
243
+
244
+            "--vtext":`"left_fs"`,
245
+            data:{fs_type: "vertical"},
246
+        },])
247
+
248
+    resize_thumbs_proto($(".ic3"),[
249
+        {
250
+                 width:w5,
251
+        height:h53,
252
+        top:vtop,
253
+        left:w54,
254
+        // left:0,
255
+        // right:0,
256
+            "--vtext":`"right_fs"`,
257
+            data:{fs_type: "vertical"},
258
+        },])
259
+
260
+    let overflow_vids = $(".ic6").children(".small_vid")
261
+    let overflow_obj = {}
262
+    if (overflow_vids.length > 5){
263
+    }
264
+    overflow_obj.width = w5 * (overflow_vids.length + 1)
265
+    resize_thumbs_proto($(".c6"),[{
266
+        width:dim_hd.width,
267
+        height:h5,
268
+        height:h5 + 20,
269
+        top:h54 - (hm) * .5,
270
+        left:0,}])
271
+
272
+    resize_thumbs_proto($(".ic6"),[
273
+        {
274
+                 width:dim_hd.width,
275
+        height:h5 + 10,
276
+        // top:h54 - (hm) * .5,
277
+        // left:0,
278
+        // left:w54,
279
+        // right:0,
280
+            "--vtext":`"bottom_fs"`,
281
+            data:{fs_type: "horizontal"},
282
+        },overflow_obj])
283
+
284
+
285
+    resize_thumbs_proto($(".ic4"),[
286
+        {
287
+        // height:h53,
288
+        width:s_width,
289
+        // height:h53,
290
+        height:h_height,
291
+        top:vtop - 1,
292
+        left:vleft,
293
+        // left:w54,
294
+        // right:0,
295
+            "--vtext":`"center"`,
296
+            data:{fs_type: "single"},
297
+        },])
298
+
299
+    var center_vid = $(".ic4")[0]
300
+    var bcr = center_vid.getBoundingClientRect()
301
+    var bcr_fs = $(".fs_container")[0].getBoundingClientRect()
302
+    if (top_margin_flag){
303
+    resize_thumbs_proto($("#largeVideoContainer"),[
304
+        {
305
+        // height:h53,
306
+        width:s_width - m,
307
+        // height:h53,
308
+        height:h_height - hm,
309
+        // top:vtop - 2 + (hm * .5),
310
+        transform: "translate(0%, -50%)",
311
+        top:`calc(50% + ${Math.floor(hm * 1)}px)`,
312
+        top:`calc(50% + ${Math.floor(hm * .7)}px)`,
313
+        left:vleft + (.5 * m),
314
+        position:"relative",
315
+        // outline:"1px solid blue",
316
+        outline:"",
317
+        // "z-index":"10",
318
+        // left:w54,
319
+        // right:0,
320
+            "--vtext":`"center"`,
321
+            data:{fs_type: "single"},
322
+        },])
323
+    } else {
324
+resize_thumbs_proto($("#largeVideoContainer"),[
325
+        {
326
+        // height:h53,
327
+        width:s_width - m,
328
+        // height:h53,
329
+        height:h_height - hm,
330
+        top:vtop - 2 + (hm * .5) + bcr_fs.y,
331
+        // top:h5 + (3 * hm),
332
+        transform: "translate(-50%, 0)",
333
+        // top:`calc(50% + ${Math.floor(hm * 1)}px)`,
334
+        // top:`calc(50% + ${Math.floor(hm * .7)}px)`,
335
+        // left:vleft + (.5 * m),
336
+        left:"50%",
337
+        position:"relative",
338
+        // "z-index":"10",
339
+        // left:w54,
340
+        // right:0,
341
+        // outline:"1px solid red",
342
+        outline:"",
343
+            "--vtext":`"center"`,
344
+            data:{fs_type: "single"},
345
+        },])   
346
+    }
347
+
348
+    // #sharedVideo
349
+            // resize_thumbs_proto($(".ic4"),[
350
+            resize_thumbs_proto($("#sharedVideoIFrame.z"),[
351
+        {
352
+        // height:h53,
353
+        width:s_width,
354
+        // height:h53,
355
+        height:h_height,
356
+        top:vtop - 1,
357
+        left:vleft,
358
+        position:"relative",
359
+        // "z-index":"10",
360
+        // left:w54,
361
+        // right:0,
362
+            "--vtext":`"center"`,
363
+            data:{fs_type: "single"},
364
+        },])
365
+resize_thumbs_proto($("#sharedVideoIFrame"),{
366
+        position:"",
367
+
368
+})
369
+clog("top",top_margin_flag)
370
+resize_thumbs_proto($("#largeVideoContainer.z,#sharedVideoIFrame"),{position:"",})
371
+}
372
+
373
+function filmstrip_rs(){
374
+    calc_fs_dims()
375
+    clog("filmstrip_rs")
376
+}
377
+
378
+glob_mx.filmstrip_handlers.vertical = filmstrip_rs
379
+glob_mx.filmstrip_handlers.horizontal = filmstrip_rs
380
+glob_mx.filmstrip_handlers.center = filmstrip_rs
381
+
382
+
383
+
384
+
385
+
386
+glob_mx.filmstrip_tile_handlers.vertical = resize_thumbs_vertical
387
+glob_mx.filmstrip_tile_handlers.horizontal = resize_thumbs_horizontal
388
+glob_mx.filmstrip_tile_handlers.center = resize_thumbs_center
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+// this handles sorting the videos  
432
+
433
+
434
+
435
+
436
+function sort_id3(a, b) {
437
+    if (a.id > b.id){
438
+        return 1
439
+    } else if (a.id < b.id){
440
+        return -1
441
+    }
442
+    return 0
443
+}
444
+
445
+
446
+
447
+
448
+indexed_tiles = []
449
+indexed_map = window.indexed_map || new Map()
450
+reverse_indexed_map = window.reverse_indexed_map || new Map()
451
+
452
+// indexed_map =  new Map()
453
+// reverse_indexed_map =  new Map()
454
+
455
+function array_move(arr, old_index, new_index) {
456
+    if (new_index >= arr.length) {
457
+        var k = new_index - arr.length + 1;
458
+        while (k--) {
459
+            arr.push(undefined);
460
+        }
461
+    }
462
+    arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
463
+    return arr; // for testing
464
+};
465
+
466
+
467
+
468
+function mod_sort(){
469
+    var arr = []
470
+    var parr = []
471
+    var ivid = {}
472
+    var k,v
473
+    var j = $(".small_vid:not(.pseudo_vid)")
474
+window.indexed_map =  new Map()
475
+window.reverse_indexed_map =  new Map()
476
+
477
+    var part = get_participants()
478
+    var parts =jc(part).sort(sort_id3)
479
+    // clog(parts,part)
480
+    var mod_id = get_mod(part)
481
+    if (mod_id){
482
+    remap_set( $(`#participant_${mod_id.id}`)[0],2)
483
+    }
484
+        
485
+
486
+   
487
+
488
+    var n 
489
+    var cnt = 0
490
+    for (k of parts){
491
+        // clog("z",k,k.local)
492
+        if (k.isFakeParticipant){ 
493
+    n = `<span class="plugin_top pseudo_vid small_vid youtube_vid"><div class="m2 xbox2">ABC</div></span>`
494
+    if ($(".youtube_vid").length){
495
+
496
+    } else {
497
+        // html_hooks.create_video_tile(n)
498
+
499
+    }
500
+        // remap_set($(".youtube_vid")[0],0)
501
+        j = $("#sharedVideoContainer")
502
+        remap_set(j[0],2)
503
+        // remap_set( $(`#participant_${mod_id.id}`)[0],1)
504
+        } else {
505
+        j = k.local ? $("#localVideoContainer") : $(`#participant_${k.id}`)
506
+        // get_mod().id
507
+
508
+        }
509
+        j.css({"--v_index":`"I: ${cnt}"`})
510
+        j.css({"--v_id":`"${k.id}"`})
511
+        j[0].dataset.v_index = cnt
512
+        arr.push(j[0])
513
+        cnt += 1
514
+    }
515
+    v = $(".pseudo_vid")
516
+    for (k of v){
517
+        // clog(k)
518
+        $(k).css({"--v_index":`"I: ${cnt}"`})
519
+        $(k).css({"--v_id":`"pseudo_${cnt}"`})
520
+        parr.push(k)
521
+        $(k)[0].dataset.v_index = cnt
522
+        cnt += 1
523
+    }
524
+
525
+
526
+
527
+    arr.push(...parr)
528
+    window.arig_tiles = jc(arr)
529
+    // remap_set($(".local_vid")[0],1)
530
+    remap_set($(".local_vid")[0],3)
531
+    // remap_set( $(`#participant_${mod_id.id}`)[0],2)
532
+
533
+    arr = remap_sort(arr)
534
+    arr = remap_sort(arr)
535
+    arr = remap_sort(arr)
536
+    window.sorted_tiles = arr
537
+
538
+
539
+
540
+
541
+
542
+    // for 
543
+}
544
+sorted_tiles = window.sorted_tiles || []
545
+function remap_sort(arr){
546
+    // return
547
+    var k,v
548
+    for ([k,v] of indexed_map){
549
+        // clog(k,v)
550
+        var old_index = arr.indexOf(k)
551
+        // clog("K,v",k,v,old_index)
552
+        array_move(arr,old_index,v)
553
+
554
+        // clog(cnt,sorted_tiles.includes(k),v,k)
555
+        // cnt += 1
556
+
557
+    }
558
+    return arr
559
+
560
+}
561
+
562
+function remap_set(vid,loc){
563
+    if (typeof(vid)=="number"){
564
+        vid = sorted_tiles[vid]
565
+    }
566
+    var old = reverse_indexed_map.get(loc)
567
+    // reverse_indexed_map
568
+    indexed_map.delete(old,loc)
569
+    indexed_map.set(vid,loc)
570
+    reverse_indexed_map.set(loc,vid)
571
+    var k,v
572
+    var cnt = 0 
573
+    for ([k,v] of indexed_map){
574
+        // clog(k,v)
575
+        // clog(cnt,sorted_tiles.includes(k),v,k)
576
+        cnt += 1
577
+
578
+    }
579
+
580
+}
581
+
582
+
583
+
584
+
585
+
586
+
587
+// move videos onto the filmstrips
588
+function new_move(){
589
+    var j 
590
+    try {
591
+        j = jc(window.sorted_tiles)
592
+    } catch (err) {
593
+        clog("NEW MOVE err:",err)
594
+    }
595
+    $(".ic1").append(j.splice(0,5))
596
+    $(".ic2").append(j.splice(0,3))
597
+    $(".ic3").append(j.splice(0,3))
598
+    const all_extra = j.splice(0)
599
+    if (all_extra.length > 5){
600
+        $(".ic6").addClass("overflow")
601
+    } else {
602
+
603
+        $(".ic6").removeClass("overflow")
604
+    }
605
+    $(".ic6").append(all_extra)
606
+}
607
+
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+// the rest of this slides the bottom row if there is overflow.
624
+
625
+timeout_scroll_glob = window.timeout_scroll_glob || {
626
+    stop:1,
627
+    timeout:3000,
628
+    rid:0,
629
+    mx_raf:200,
630
+    to_left:1,
631
+}
632
+timeout_scroll_glob.stop=1
633
+function timeout_scroll(rid){
634
+    // clog("Tscroll",rid,timeout_scroll_glob)
635
+    if (timeout_scroll_glob.stop || rid != timeout_scroll_glob.rid){
636
+        // clog("tscroll stop")
637
+        return
638
+    }
639
+        // clog("tscroll continue")
640
+        scroll_send()
641
+    var t = setTimeout(timeout_scroll,timeout_scroll_glob.timeout,rid)
642
+
643
+}
644
+
645
+function timeout_scroll_start(){
646
+    timeout_scroll_glob.rid += 1
647
+    setTimeout(timeout_scroll,timeout_scroll_glob.timeout,timeout_scroll_glob.rid)
648
+
649
+}
650
+
651
+function get_bcrs(arr,fs_bcr){
652
+    var ret = {
653
+        arr:[],
654
+        first_left:0,
655
+        first_left_bcr:0,
656
+        first_right:0,
657
+        first_right_bcr:0,
658
+    }
659
+    var s = $(".ic6").children(".small_vid")
660
+    s.removeClass("ir il ilr ir0 il0")
661
+    var k,v,bcr,isleft,isright
662
+    for (v of arr){
663
+        bcr = v.getBoundingClientRect()
664
+        ret.arr.push(bcr)
665
+        isleft = bcr.right < (fs_bcr.right + 10)
666
+        isright = bcr.left > (fs_bcr.left )
667
+        if (isleft && isright){
668
+            $(v).addClass("ilr")
669
+        } else if (isleft){
670
+            $(v).addClass("il")
671
+
672
+        } else if (isright){
673
+            $(v).addClass("ir")
674
+
675
+        }
676
+        
677
+        if (isleft && ! isright){
678
+            ret.first_left = v
679
+            ret.first_left_bcr = bcr
680
+        }  
681
+        if ( (! ret.first_right ) && !isleft  && isright ){
682
+            ret.first_right = v
683
+            ret.first_right_bcr = bcr
684
+
685
+        }
686
+        
687
+
688
+    }
689
+    clog("````",ret)
690
+    $(ret.first_right).addClass("ir0")
691
+    $(ret.first_left).addClass("il0")
692
+    return ret
693
+
694
+}
695
+
696
+function scroll_to(n){
697
+    var fs,fs_bcr,vid_bcr,ifs
698
+    fs =  $(".c6")[0]
699
+    ifs =  $(".ic6")[0]
700
+    var vid
701
+
702
+    var s = $(".ic6").children(".small_vid")
703
+    fs_bcr = fs.getBoundingClientRect() 
704
+    var ov = get_bcrs([...s],fs_bcr)
705
+    var tobj = {
706
+
707
+    }
708
+    var scroll_to_vid = 0
709
+    if (timeout_scroll_glob.to_left){
710
+        if (ov.first_left){
711
+            scroll_to_vid = ov.first_left
712
+            vid_bcr = ov.first_left_bcr
713
+            tobj.inc_mx = vid_bcr.left - fs_bcr.left
714
+            tobj.inc = -8
715
+        } else {
716
+            timeout_scroll_glob.to_left = 0
717
+        }
718
+    } else {
719
+        if (ov.first_right){
720
+            scroll_to_vid = ov.first_right
721
+            vid_bcr = ov.first_right_bcr
722
+            tobj.inc_mx = vid_bcr.right - fs_bcr.right
723
+            tobj.inc = 8
724
+        } else {
725
+            timeout_scroll_glob.to_left = 1
726
+        }
727
+    }
728
+    scroll_to_vid ?  requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,scroll_to_vid,tobj.inc,tobj.inc_mx,0,0),"z-index") : 0
729
+
730
+}
731
+function raf_clog(fs,vid,cnt,ts){
732
+    clog("raf.",cnt,ts)
733
+
734
+
735
+}
736
+
737
+function raf(fs,vid,inc,inc_mx,cnt,ts0,ts){
738
+    fs.scrollBy(inc,0)
739
+    if (Math.abs(inc) < Math.abs(inc_mx) && cnt < timeout_scroll_glob.mx_raf && ts - (ts0 || ts)  < 3000){
740
+    requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,vid,inc,inc_mx - inc ,cnt+1,ts0 || ts))
741
+
742
+    } else {
743
+        // clog("FIN",[fs,vid],cnt,ts0,inc_mx,ts,ts-ts0)
744
+        vid.scrollIntoView({ behavior: 'smooth', block: 'nearest' ,inline:"nearest"})
745
+    }
746
+
747
+}
748
+
749
+
750
+
751
+
752
+if (window.refresh_fs_proc){
753
+    refresh_fs_proc()
754
+
755
+}

+ 16
- 0
clone/m/timer/mod_de_utils.js View File

@@ -0,0 +1,16 @@
1
+
2
+function get_hook_types(){
3
+	var j = $(".dev_hook")
4
+	var ret = {}
5
+	var ret = new Map()
6
+	var k,v
7
+	for (k of j){
8
+		v = "."+[...k.classList].join(".")
9
+		ret.setD(v,0)
10
+		// ret.get(v) + 1
11
+		ret.set(v,ret.get(v) + 1)
12
+		// clog("~",k)
13
+	}
14
+	return ret
15
+
16
+}

+ 0
- 0
clone/m/timer/rhtml.html View File


+ 168
- 0
clone/preload.js View File

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

+ 91
- 0
clone/proto_ext.js View File

@@ -0,0 +1,91 @@
1
+Map.prototype.setD = function(k,v){
2
+	if (!this.has(k)){
3
+		this.set(k,v)
4
+		// clog("SetD")
5
+		return 1
6
+	}
7
+		// clog("SetD0")
8
+}
9
+
10
+Set.prototype.isSuperset = function(subset) {
11
+    for (var elem of subset) {
12
+        if (!this.has(elem)) {
13
+            return false;
14
+        }
15
+    }
16
+    return true;
17
+}
18
+
19
+Set.prototype.union = function(setB) {
20
+    var union = new Set(this);
21
+    for (var elem of setB) {
22
+        union.add(elem);
23
+    }
24
+    return union;
25
+}
26
+
27
+Set.prototype.intersection = function(setB) {
28
+    var intersection = new Set();
29
+    for (var elem of setB) {
30
+        if (this.has(elem)) {
31
+            intersection.add(elem);
32
+        }
33
+    }
34
+    return intersection;
35
+}
36
+
37
+Set.prototype.difference = function(setB) {
38
+    var difference = new Set(this);
39
+    for (var elem of setB) {
40
+        difference.delete(elem);
41
+    }
42
+    return difference;
43
+}
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+Set.prototype.union_update = function(setB) {
55
+    var union = this;
56
+    for (var elem of setB) {
57
+        union.add(elem);
58
+    }
59
+    return union;
60
+}
61
+
62
+Set.prototype.intersection_update = function(setB) {
63
+    var intersection = this
64
+    for (var elem of setB) {
65
+        if (!this.has(elem)) {
66
+            intersection.delete(elem);
67
+        }
68
+    }
69
+    return intersection;
70
+}
71
+
72
+Set.prototype.difference_update = function(setB) {
73
+    var difference = this;
74
+    for (var elem of setB) {
75
+        difference.delete(elem);
76
+    }
77
+    return difference;
78
+}
79
+
80
+/*
81
+Set.prototype.symDifference = function(setB) {
82
+    var difference = new Set(this.union(setB));
83
+     var intersection = new Set(this.intersection(setB));
84
+    for (var elem of intersection) {
85
+        difference.delete(elem);
86
+    }
87
+    return difference;
88
+}
89
+*/
90
+
91
+console.log("test")

+ 84
- 0
clone/r0.css View File

@@ -0,0 +1,84 @@
1
+
2
+
3
+
4
+#filmstripRemoteVideos{
5
+overflow-x: auto !important;
6
+
7
+}
8
+
9
+.hidden_vid {
10
+	position: relative;
11
+	/*position: absolute;*/
12
+	width:     80px !important;
13
+	min-width: 80px !important;
14
+	display: none;
15
+
16
+}
17
+
18
+
19
+.overlay {
20
+	position: absolute;
21
+	width: 100%;
22
+	height: 100%;
23
+	top: 0;
24
+	left: 0;
25
+	outline: 2px solid #0ff;
26
+	background-color: #ff08;
27
+	background-color: #0ff8;
28
+	/*z-index: 351;*/
29
+}
30
+
31
+
32
+
33
+
34
+
35
+.top_toolbox {
36
+	position: relative;
37
+	z-index: 1;
38
+	width: 100%;
39
+	height: 100px;
40
+	background-image:linear-gradient(to bottom,rgba(255,255,255,1),rgba(71,71,71,0));
41
+	background-image:linear-gradient(to bottom,rgba(255,255,255,.3),rgba(71,71,71,0));
42
+
43
+}
44
+
45
+
46
+
47
+
48
+
49
+
50
+.new-toolbox .toolbox-content  .audio-preview .toolbox-button{
51
+	    margin-left:  0px;
52
+
53
+}
54
+.new-toolbox .toolbox-content  .video-preview .toolbox-button{
55
+	    margin-right: 0px;
56
+
57
+}
58
+
59
+.new-toolbox .toolbox-content .toolbox-button{
60
+	    margin-right: 4px;
61
+	    margin-left:  4px;
62
+}
63
+.button-group-right {
64
+	width: 25% !important;
65
+}
66
+.button-group-left{
67
+	width: 25% !important;
68
+}
69
+.button-group-center {
70
+	width: 50% !important;
71
+}
72
+
73
+
74
+.subject {
75
+	background-image:unset;
76
+	text-align: unset;
77
+	padding-left: 75px;
78
+	padding-right: 75px;
79
+
80
+}
81
+.env_info {
82
+	position: absolute;
83
+	/*display: none;*/
84
+}

+ 287
- 0
clone/r0.js View File

@@ -0,0 +1,287 @@
1
+// clog = console.log
2
+// function nop(){}
3
+
4
+glob_dev_hooks = window.glob_dev_hooks || {}
5
+glob_dev_fns = window.glob_dev_fns || {}
6
+window.glob_react = window.glob_react || {i:"r0"}
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+function wt(a1,a2){
32
+	var c = 0
33
+	var cmx = 10
34
+	clog(a1 < a2,a1 > a2)
35
+	while (a1 < a2){
36
+		c += 1
37
+		clog(".",c)
38
+		if (cmx < c){clog("r",c);return}
39
+
40
+	}
41
+
42
+
43
+}
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+function FS_dec2(fn) {
61
+  return function() {
62
+  	// dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
63
+    const ret = fn.apply(this, arguments);
64
+    clog("SVD",{ret,that:this,args:[...arguments]})
65
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
66
+  	// const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
67
+  	// if (ret2){
68
+  		// return ret2.ret
69
+  	// }
70
+    // const result = fn.apply(this, arguments);
71
+    // console.log('Finished');
72
+    return ret;
73
+  }
74
+}
75
+
76
+
77
+// svop = jc(SmallVideoOrig.prototype)
78
+// svop = jc(SmallVideoOrig)
79
+// svop = Object.assign({},glob_react.Filmstrip)
80
+// svop = Object.assign({},SmallVideoOrig.prototype)
81
+// function save_orig()
82
+orig_classes = window.orig_classes || {}
83
+react_trc_log = window.react_trc_log || {}
84
+react_trc_log = window.react_trc_log || {}
85
+window.react_trc_log.SmallVideoTrc0= ["$avatar",
86
+ "_setThumbnailSize",
87
+ "bindHoverHandler",
88
+ "initBrowserSpecificProperties",
89
+ "_renderDisplayName",
90
+ "$avatar",
91
+ "initializeAvatar",
92
+ "_getAudioLevelContainer",
93
+ "_getAudioLevelContainer",
94
+ "updateAudioLevelIndicator",
95
+ "addAudioLevelIndicator",
96
+ "updateIndicators",
97
+ "isCurrentlyOnLargeVideo",
98
+ "_isHovered",]
99
+
100
+
101
+
102
+
103
+
104
+react_trc_log.SmallVideoTrc = ["_renderDisplayName",
105
+"_setThumbnailSize",
106
+"showDominantSpeakerIndicator",
107
+"setVideoMutedView",
108
+"initBrowserSpecificProperties",
109
+"bindHoverHandler",
110
+"addAudioLevelIndicator",]
111
+
112
+
113
+
114
+glob_dev_fns.getTileViewGridDimensions_set_num = function(state,maxColumns,onumberOfParticipants){
115
+	// return
116
+	// clog("SET NUM PRT")
117
+	var numberOfParticipants
118
+	// if (window.glob_dev_fns && window.glob_dev_fns.ret0){return onumberOfParticipants}
119
+		try {
120
+    var thumbs = glob_react.Filmstrip._getThumbs()
121
+			
122
+// numberOfParticipants = thumbs.remoteThumbs.length + thumbs.localThumb  thumbs.localThumb.length
123
+numberOfParticipants = thumbs.remoteThumbs.length 
124
+if (thumbs.localThumb){
125
+numberOfParticipants += thumbs.localThumb.length 
126
+
127
+}
128
+		} catch(e) {
129
+			clog("getTileViewGridDimensions_set_num err:",e)
130
+			return onumberOfParticipants
131
+
132
+		}
133
+	// clog("getTileViewGridDimensions_set_num ret:",numberOfParticipants,thumbs,onumberOfParticipants)
134
+	// numberOfParticipants < onumberOfParticipants ? numberOfParticipants = onumberOfParticipants : 1
135
+	// clog("getTileViewGridDimensions_set_num ret2:",numberOfParticipants,thumbs,onumberOfParticipants)
136
+	// clog("NUM",numberOfParticipants)
137
+return numberOfParticipants
138
+
139
+
140
+}
141
+
142
+
143
+
144
+
145
+window.glob_dbg = window.glob_dbg || {
146
+	log:{},
147
+	logs:{},
148
+}
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+function log_tb(err,key){
157
+	var key
158
+	try{
159
+
160
+	key in window.glob_dbg.logs ? 1 : window.glob_dbg.logs[key]=[]
161
+	// key in window.glob_dbg.log ? 1 : window.glob_dbg.log[key]=[]
162
+	window.glob_dbg.logs[key].push(err.stack)
163
+	// window.glob_dbg.log[key].push(err)
164
+	// clog("LOG_TB",key,err)
165
+	} catch (e){
166
+		clog("LOG TB",key,"ERR:",e)
167
+	}
168
+	// return new Error()
169
+}
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+function clone_class() {
183
+	var k,v,p 
184
+	if (orig_classes.SmallVideoOrig){
185
+		return
186
+	}
187
+	orig_classes.SmallVideoOrig = {}
188
+	for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
189
+		v=p.value
190
+		orig_classes.SmallVideoOrig[k]=v
191
+	}
192
+
193
+}
194
+clog("R0...",window.SmallVideoOrig)
195
+
196
+function loop_proto(){
197
+	var k,v,p 
198
+	for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
199
+		// clog("~",k,v)
200
+		v=p.value
201
+		clog("~",k,typeof(v))
202
+		if (typeof(v) == "function"){
203
+		SmallVideoOrig.prototype[k] = FS_dec2(v)
204
+
205
+		}
206
+
207
+	}
208
+}
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+function loop_vids(vids = $(".small_vid")){
217
+	clog("vids",vids)
218
+	var k,v
219
+	// for (k in [...vids]){
220
+	for (k of vids){
221
+		clog("..",k)
222
+	}
223
+}
224
+
225
+
226
+function log_info0(key){
227
+	var ret = new Map()
228
+	var k,v
229
+	var arr
230
+	for (v of glob_dbg.log[key]){
231
+		ret.setD(v.stack,0)
232
+		ret.set(v.stack,ret.get(v.stack) + 1)
233
+		arr = v.stack.split("\n")
234
+		clog(arr[2])
235
+
236
+		// v.
237
+		// clog(k,v)
238
+	}
239
+	return ret
240
+
241
+}
242
+
243
+
244
+function log_info(key,line_num=2,num_lines=1){
245
+	var ret = new Map()
246
+	var ret1 = new Map()
247
+	var line 
248
+	var k,v
249
+	var arr
250
+	for (v of glob_dbg.logs[key]){
251
+		ret.setD(v,0)
252
+		ret.set(v,ret.get(v) + 1)
253
+		arr = v.split("\n")
254
+		// clog(arr[3])
255
+		// clog(arr[2])
256
+		// line = arr[line_num]
257
+		line = arr.slice(line_num,line_num+num_lines).join("\n")
258
+		// if ("an")
259
+		if (line.includes("anony")){
260
+
261
+		} else {
262
+			// continue
263
+		}
264
+
265
+		// clog(line)
266
+		ret1.setD(line,0)
267
+		ret1.set(line,ret1.get(line) + 1)
268
+
269
+		// v.
270
+		// clog(k,v)
271
+	}
272
+	return ret1
273
+
274
+}
275
+
276
+
277
+function map_loop(m){
278
+	var k,v
279
+	for ([k,v] of m){
280
+		clog(k,v)
281
+	}
282
+}
283
+
284
+
285
+
286
+
287
+// XMPPAttachInfo.data = {atr:"modme"}

+ 41
- 0
clone/r1.js View File

@@ -0,0 +1,41 @@
1
+
2
+// make the App think you resized the window
3
+function dispatch_resize(store = APP.store) {
4
+        // store.dispatch(clientResized_dev(innerWidth, innerHeight));
5
+        store.dispatch({
6
+        type: "CLIENT_RESIZED",
7
+        clientHeight:innerHeight,
8
+        clientWidth:innerWidth,
9
+    });
10
+        // clog("dispatch_resize")
11
+}
12
+
13
+// unused old fn to add pseudo videos
14
+function add_spans(n=1,xtra=0){
15
+	var s = `
16
+	<span class="pseudo_vid videocontainer"></span>
17
+	`
18
+	$(".pseudo_vid").remove()
19
+	if (!xtra){
20
+	n = n - APP.store.getState()["features/base/participants"].length
21
+	}
22
+	var k,v
23
+	for (var i = 0; i < n; i++) {
24
+		// Things[i]
25
+		clog("..",i)
26
+	$("#filmstripRemoteVideosContainer").append(s)
27
+	}
28
+	dispatch_resize()
29
+}
30
+
31
+
32
+
33
+
34
+
35
+
36
+fs_dec_list = [
37
+"resizeThumbnailsForHorizontalView",
38
+"resizeThumbnailsForVerticalView",
39
+// "resizeThumbnailsForTileView",
40
+]
41
+dec_fns = {}

+ 220
- 0
clone/r2.js View File

@@ -0,0 +1,220 @@
1
+
2
+// this file contains decorator functions
3
+
4
+
5
+
6
+
7
+
8
+
9
+function FS_dec(fn) {
10
+  return function() {
11
+  	dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
12
+    const ret = fn.apply(this, arguments);
13
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
14
+    console.log('FSD',fn.name);
15
+    console.trace('FSD_trc  '+fn.name);
16
+    // log_tb()
17
+    window.log_tb(new Error(),fn.name)
18
+  	const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
19
+  	if (ret2){
20
+  		return ret2.ret
21
+  	}
22
+    // const result = fn.apply(this, arguments);
23
+    // console.log('Finished');
24
+    return ret;
25
+  }
26
+}
27
+
28
+
29
+
30
+
31
+
32
+// if ((!window.glob_orig) && ){
33
+
34
+// }
35
+
36
+// glob_react.rf_filmstrip.calculateThumbnailSizeForTileView
37
+
38
+// calculateThumbnailSizeForTileView
39
+
40
+dec_fns = {
41
+	resizeThumbnailsForTileView:{
42
+		pre:function(){
43
+			// console.trace("resizeThumbnailsForTileView")
44
+
45
+		},
46
+		post:function(){
47
+
48
+		},
49
+
50
+	}
51
+}
52
+
53
+
54
+function rt(w,h = 0,force = true){
55
+	h ? 0 : h = w / (16/9)   
56
+	glob_react.Filmstrip.resizeThumbnailsForTileView(w,h,force)
57
+}
58
+
59
+function dec_fs2(){
60
+	var k,v
61
+	glob_react.rf_filmstrip.calculateThumbnailSizeForTileView = FS_dec(glob_react.rf_filmstrip.calculateThumbnailSizeForTileView)
62
+
63
+	// for ([k,v] of Object.entries(glob_orig.Filmstrip)){
64
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
65
+		// clog("~",k,v.name)
66
+		// glob_react.Filmstrip[k] = FS_dec(v)
67
+	// }
68
+
69
+}
70
+
71
+
72
+
73
+function dec_fs(){
74
+	var k,v
75
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
76
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
77
+		clog("~",k,v.name)
78
+		glob_react.Filmstrip[k] = FS_dec(v)
79
+		// glob_react.Filmstrip[k] = v
80
+	}
81
+
82
+}
83
+fs_dec_list = [
84
+"resizeThumbnailsForHorizontalView",
85
+"resizeThumbnailsForVerticalView",
86
+// "resizeThumbnailsForTileView",
87
+]
88
+
89
+function undec_fs(){
90
+	var k,v
91
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
92
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
93
+		// clog("~",k,v.name)
94
+		// glob_react.Filmstrip[k] = FS_dec(v)
95
+		glob_react.Filmstrip[k] = v
96
+	}	
97
+}
98
+
99
+
100
+
101
+modkeys =  ["calculateThumbnailSizeForTileView",
102
+"TILE_VIEW_SIDE_MARGINS",
103
+"SET_TILE_VIEW_DIMENSIONS",]
104
+
105
+// glob_react.rf_filmstrip
106
+function check_mod_keys(){
107
+	var k
108
+	for (k of modkeys){
109
+		clog(k,glob_react.rf_filmstrip[k])
110
+	}
111
+
112
+}
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+function log_info3(o){
132
+	var i,k,v
133
+	for ([k,v] of o.ret3){
134
+		if (v.fn.size >= 3){
135
+			clog(k,v)
136
+		}
137
+	}
138
+}
139
+function log_info2(key,line_num=2,num_lines=1){
140
+	var ret = new Map()
141
+	var ret2 = new Map()
142
+	var ret3 = new Map()
143
+	var ret4 = new Map()
144
+	// var ret = new Map()
145
+	var i,k,v
146
+	var i2,k2,v2
147
+	var i3,k3,v3
148
+	var i4,k4,v4
149
+	var line 
150
+	var arr
151
+	key = 2
152
+	// var 
153
+
154
+	// for ([k,v] of Object.values(glob_dbg.logs)){
155
+	// for (v of [...Object.values(glob_dbg.logs)]){
156
+	for ([k,v] of Object.entries(glob_dbg.logs)){
157
+		// clog([k,v])
158
+		for (v2 of v){
159
+			ret.setD(v2,{c:0,fn:k})
160
+			i = ret.get(v2)
161
+			i.c += 1
162
+			// ret.set(v2,ret.get(v2) + 1)
163
+		}
164
+	}
165
+	for ([k,v] of ret){
166
+		arr = k.split("\n")
167
+		i =  ret.get(k)
168
+		// k2 = i.fn: arr[key]
169
+		k2 = `${i.fn}: ${arr[key]}`
170
+		ret2.setD(k2,{c:0})
171
+		i2 =  ret2.get(k2)
172
+		i2.c += i.c
173
+
174
+
175
+		for ([k3,v3] of Object.entries(arr)){
176
+			// clog(k3,v3)
177
+			v4 = k3 + ": " +v3
178
+			ret4.setD(v4,{fn:new Set()})
179
+
180
+			ret3.setD(v3,{fn:new Set()})
181
+			i3 = ret3.get(v3)
182
+			i3.fn.add(i.fn)
183
+		}
184
+
185
+
186
+	}
187
+	clog(ret2)
188
+
189
+
190
+	return {ret,ret2,ret3,ret4}
191
+	var ret1 = new Map()
192
+	var line 
193
+	var arr
194
+	for (v of glob_dbg.logs[key]){
195
+		ret.setD(v,0)
196
+		ret.set(v,ret.get(v) + 1)
197
+		arr = v.split("\n")
198
+		// clog(arr[3])
199
+		// clog(arr[2])
200
+		// line = arr[line_num]
201
+		line = arr.slice(line_num,line_num+num_lines).join("\n")
202
+		// if ("an")
203
+		if (line.includes("anony")){
204
+
205
+		} else {
206
+			// continue
207
+		}
208
+
209
+		// clog(line)
210
+		ret1.setD(line,0)
211
+		ret1.set(line,ret1.get(line) + 1)
212
+
213
+		// v.
214
+		// clog(k,v)
215
+	}
216
+	return ret1
217
+
218
+}
219
+// clog(log_info3(log_info2()))
220
+// clog(log_info2())

+ 183
- 0
clone/react_fn.js View File

@@ -0,0 +1,183 @@
1
+
2
+
3
+/*
4
+these functions are slighty modified versions of their react counterparts
5
+*/
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+TILE_ASPECT_RATIO = 16 / 9;
14
+function reth(o){
15
+
16
+	return {ret:o}
17
+}
18
+{
19
+
20
+
21
+
22
+var calcTileGrid=glob_react.fns.calcTileGrid
23
+var getMaxColumnCount=glob_react.fns.getMaxColumnCount
24
+let getMaxColumnCount2=glob_react.fns.getMaxColumnCount
25
+
26
+let sideMargins=(135 * 2 )+ 20
27
+// let sideMargins=(135 )+ 20
28
+let topBottomPadding=135 + 100
29
+
30
+// glob_dev_fns.getTileViewGridDimensions_set_num
31
+
32
+// function getTileViewGridDimensions(state: Object, maxColumns: number = getMaxColumnCount()) {
33
+// glob_dev_fns.getTileViewGridDimensions = function(state: Object, maxColumns: number = getMaxColumnCount()) {
34
+glob_dev_fns.getTileViewGridDimensions = function(state, maxColumns = getMaxColumnCount(),maxColumns2 = getMaxColumnCount2()) {
35
+    // When in tile view mode, we must discount ourselves (the local participant) because our
36
+    // tile is not visible.
37
+    const { iAmRecorder } = state['features/base/config'];
38
+    // dev util hook
39
+    // const numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
40
+     //   /*
41
+    var numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
42
+    // clog("r0 num",numberOfParticipants)
43
+
44
+    if (window.glob_dev_fns && window.glob_dev_fns.getTileViewGridDimensions_set_num){
45
+        const numberOfParticipants_dev = window.glob_dev_fns.getTileViewGridDimensions_set_num(state,maxColumns,numberOfParticipants)
46
+        if (typeof(numberOfParticipants_dev)=="number"){numberOfParticipants = numberOfParticipants_dev}
47
+    }
48
+    //        */
49
+    
50
+    const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
51
+
52
+    // calculate available width and height for tile view.
53
+    // copied from calculateThumbnailSizeForTileView (one variable was dropped)
54
+    // const topBottomPadding = 200;
55
+    // const sideMargins = 30 * 2;
56
+
57
+    const viewWidth = clientWidth - sideMargins;
58
+    const viewHeight = clientHeight - topBottomPadding;
59
+
60
+    const viewAspectRatio = viewWidth / viewHeight;
61
+    const ratioOfRatios = TILE_ASPECT_RATIO / viewAspectRatio;
62
+
63
+    const tileGrid = calcTileGrid(ratioOfRatios, numberOfParticipants);
64
+    let { columns } = tileGrid;
65
+    const { rows, availableTiles } = tileGrid;
66
+
67
+    // maybe remove a column, for aesthetics.
68
+        // clog("r0 dec? columns",columns,rows <= availableTiles - numberOfParticipants,columns > 1,rows <= availableTiles - numberOfParticipants && columns > 1)
69
+    // if (rows <= availableTiles - numberOfParticipants && columns > 1) {
70
+    if (rows <= availableTiles - numberOfParticipants) {
71
+        // clog("r0 dec columns",columns)
72
+        columns -= 1;
73
+        // clog("r0 dec columns2",columns)
74
+    }
75
+
76
+    const columnsOverflowed = columns > maxColumns;
77
+    // clog("r0 NaN",columnsOverflowed,Math.ceil(numberOfParticipants / columns),Math.min(columns, maxColumns) )
78
+    // clog("r0 NaN2",Math.min(Math.ceil(numberOfParticipants / columns),maxColumns))
79
+
80
+    columns = Math.min(columns, maxColumns) || 1;
81
+    let visibleRows = Math.ceil(numberOfParticipants / columns) || 1;
82
+
83
+    if (columnsOverflowed) {
84
+        visibleRows = Math.min(visibleRows, maxColumns);
85
+    }
86
+    // clog("r0 gtvd",{columns,visibleRows,numberOfParticipants},tileGrid)
87
+    /*
88
+    return {
89
+        columns,
90
+        visibleRows
91
+    };
92
+    */
93
+    const ret = reth({
94
+        columns,
95
+        visibleRows
96
+    })
97
+    clog("!!!",{numberOfParticipants,clientHeight, clientWidth,tileGrid,iAmRecorder,maxColumns,maxColumns2},arguments,ret)
98
+    return reth({
99
+        columns,
100
+        visibleRows
101
+    });
102
+}
103
+
104
+/*
105
+export function calculateThumbnailSizeForTileView({
106
+    columns,
107
+    visibleRows,
108
+    clientWidth,
109
+    clientHeight
110
+}: Object)
111
+*/
112
+glob_dev_fns.calculateThumbnailSizeForTileView = function ({
113
+    columns,
114
+    visibleRows,
115
+    clientWidth,
116
+    clientHeight
117
+}) {
118
+	// clog("calculateThumbnailSizeForTileView new")
119
+    // The distance from the top and bottom of the screen, as set by CSS, to
120
+    // avoid overlapping UI elements.
121
+    // const topBottomPadding = 200;
122
+
123
+    // Minimum space to keep between the sides of the tiles and the sides
124
+    // of the window.
125
+    // const sideMargins = 30 * 2;
126
+
127
+    const verticalMargins = visibleRows * 10;
128
+    const viewWidth = clientWidth - sideMargins;
129
+    const viewHeight = clientHeight - topBottomPadding - verticalMargins;
130
+    const initialWidth = viewWidth / columns;
131
+    const aspectRatioHeight = initialWidth / TILE_ASPECT_RATIO;
132
+    const height = Math.floor(Math.min(aspectRatioHeight, viewHeight / visibleRows));
133
+    const width = Math.floor(TILE_ASPECT_RATIO * height);
134
+
135
+    return reth({
136
+        height,
137
+        width
138
+    });
139
+}
140
+
141
+glob_dev_fns.calculateThumbnailSizeForTileView_dev = function ({
142
+    columns,
143
+    visibleRows,
144
+    clientWidth,
145
+    clientHeight,
146
+    sideMargins=0,
147
+    topBottomPadding=0,
148
+    verticalMargin = 10,
149
+    TILE_ASPECT_RATIO=glob_react.fns.TILE_ASPECT_RATIO
150
+}) {
151
+    // clog("calculateThumbnailSizeForTileView new")
152
+    // The distance from the top and bottom of the screen, as set by CSS, to
153
+    // avoid overlapping UI elements.
154
+    // const topBottomPadding = 200;
155
+
156
+    // Minimum space to keep between the sides of the tiles and the sides
157
+    // of the window.
158
+    // const sideMargins = 30 * 2;
159
+
160
+    const verticalMargins = visibleRows * verticalMargin;
161
+    const viewWidth = clientWidth - sideMargins;
162
+    const viewHeight = clientHeight - topBottomPadding - verticalMargins;
163
+    const initialWidth = viewWidth / columns;
164
+    const aspectRatioHeight = initialWidth / TILE_ASPECT_RATIO;
165
+    const height = Math.floor(Math.min(aspectRatioHeight, viewHeight / visibleRows));
166
+    const width = Math.floor(TILE_ASPECT_RATIO * height);
167
+
168
+    return ({
169
+        height,
170
+        width,
171
+        consts:{verticalMargins,
172
+viewWidth,
173
+viewHeight,
174
+initialWidth,
175
+aspectRatioHeight,},
176
+    });
177
+}
178
+}
179
+
180
+
181
+
182
+
183
+

+ 354
- 0
clone/resize_hook.js View File

@@ -0,0 +1,354 @@
1
+
2
+
3
+// these functions allow you to decorate react classes
4
+// they should be rewriten so you can handle any class
5
+
6
+
7
+
8
+
9
+
10
+
11
+function FS_dec_resize(fn) {
12
+  return function() {
13
+    clog("rtscv0",glob_react.Filmstrip._getThumbs())
14
+    resize_filmstrips(this,fn.name,arguments)
15
+  	dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
16
+    const ret = fn.apply(this, arguments);
17
+    resize_filmstrips2(this,fn.name,arguments)
18
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
19
+    // console.log('FSD',fn.name);
20
+    
21
+    // console.trace('FSD_trc  '+fn.name);
22
+    // log_tb()
23
+    // window.log_tb(new Error(),fn.name)
24
+    clog("rtscv1",glob_react.Filmstrip._getThumbs())
25
+    resizeThumbnailsForCustomView(this,fn.name,arguments)
26
+  	const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
27
+  	if (ret2){
28
+  		return ret2.ret
29
+  	}
30
+    // const result = fn.apply(this, arguments);
31
+    // console.log('Finished');
32
+    clog("rtscv2",glob_react.Filmstrip._getThumbs())
33
+    return ret;
34
+  }
35
+}
36
+function FS_dec_proto(fn,fn_name) {
37
+  return function() {
38
+    clog("fdp0",fn_name,glob_react.Filmstrip._getThumbs())
39
+    dec_fns[fn_name] && dec_fns[fn_name].pre ? dec_fns[fn_name].pre({that:this, arguments}) : 1
40
+    if (fn_name == "updateDOMLocation") {
41
+      this.updateDOMLocation2()
42
+    }
43
+    const ret = fn.apply(this, arguments);
44
+    // console.log('FSD',fn_name,ret, [this,...arguments]);
45
+    // console.log('FSD',fn_name);
46
+    
47
+    // console.trace('FSD_trc  '+fn_name);
48
+    // log_tb()
49
+    // window.log_tb(new Error(),fn_name)
50
+    // clog("rtscv1",glob_react.Filmstrip._getThumbs())
51
+    // resizeThumbnailsForCustomView(this,fn_name,arguments)
52
+    clog("fdp2",fn_name,glob_react.Filmstrip._getThumbs())
53
+    const ret2 = dec_fns[fn_name] && dec_fns[fn_name].post ? dec_fns[fn_name].post({that:this, arguments}) : 0
54
+    if (ret2){
55
+      return ret2.ret
56
+    }
57
+    // const result = fn.apply(this, arguments);
58
+    // console.log('Finished');
59
+    // clog("rtscv2",glob_react.Filmstrip._getThumbs())
60
+    return ret;
61
+  }
62
+}
63
+
64
+
65
+
66
+function undec_fs(){
67
+  var k,v
68
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
69
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
70
+    // clog("~",k,v.name)
71
+    // glob_react.Filmstrip[k] = FS_dec(v)
72
+    glob_react.Filmstrip[k] = v
73
+  } 
74
+}
75
+
76
+
77
+function undec_class(){
78
+  var k,v
79
+  var proto = glob_orig.vidClass.LocalVideo
80
+  // var proto = glob_react.vidClass.LocalVideo.prototype
81
+  // for ([k,v] of iter_desc(proto)){
82
+  for ([k,v] of Object.entries(proto)){
83
+    // glob_react.Filmstrip[k] = v
84
+    // clog(k,v)
85
+    glob_react.vidClass.LocalVideo.prototype[k] = v.value
86
+    // clog(k,v)
87
+  } 
88
+}
89
+
90
+
91
+
92
+
93
+function dec_fs_proto(){
94
+  var k,v
95
+  save_orig()
96
+  undec_class()
97
+  var proto = glob_orig.vidClass.LocalVideo
98
+  for ([k,v] of Object.entries(proto)){
99
+    // glob_react.Filmstrip[k] = v
100
+    // glob_react.vidClass.LocalVideo.prototype[k] = FS_dec_proto(v)
101
+    glob_react.vidClass.LocalVideo.prototype[k] = FS_dec_proto(v.value,k)
102
+    // clog(k,v)
103
+  } 
104
+  // glob_react.vidClass.LocalVideo.prototype.updateDOMLocation = updateDOMLocation
105
+  glob_react.vidClass.LocalVideo.prototype.updateDOMLocation = updateDOMLocation2
106
+  // updateDOMLocation
107
+  /*
108
+  for (k of fs_dec_list){
109
+    clog("~",k)
110
+    v = glob_orig.Filmstrip[k]
111
+    glob_react.Filmstrip[k] = FS_dec_resize(v)
112
+  }
113
+  */
114
+  return
115
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
116
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
117
+    // clog("~",k,v.name,v)
118
+    clog("~",k,v.name)
119
+    // glob_react.Filmstrip[k] = FS_dec(v)
120
+  }
121
+
122
+}
123
+
124
+
125
+function dec_fs_resize(){
126
+  var k,v
127
+  save_orig()
128
+  undec_fs()
129
+  dec_fs_proto()
130
+
131
+  for (k of fs_dec_list){
132
+    clog("~",k)
133
+    v = glob_orig.Filmstrip[k]
134
+    glob_react.Filmstrip[k] = FS_dec_resize(v)
135
+  }
136
+  return
137
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
138
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
139
+    // clog("~",k,v.name,v)
140
+    clog("~",k,v.name)
141
+    // glob_react.Filmstrip[k] = FS_dec(v)
142
+  }
143
+
144
+}
145
+
146
+
147
+
148
+
149
+
150
+
151
+function test_thumbs(){
152
+  var ret = glob_react.Filmstrip._getThumbs()
153
+  clog(ret)
154
+  return ret
155
+
156
+}
157
+
158
+
159
+
160
+function updateDOMLocation2() {
161
+        clog("updateDOMLocation2",this,arguments)
162
+        // this._updateVideoElement();
163
+        clog("UDL 00")
164
+        // return
165
+        // if (!this.container || !this.container.parentElement) {
166
+        if (!this.container ) {
167
+            return;
168
+        }
169
+        // dev trc 
170
+        // ...
171
+
172
+        clog("UDL 10",this.container.parentElement)
173
+
174
+        var custom_local = 0
175
+        this.container.parentElement ? custom_local = this.container.parentElement.classList.contains("icont") : 0
176
+        if (this.container.parentElement && !custom_local) {
177
+            this.container.parentElement.removeChild(this.container);
178
+        }
179
+        // return
180
+        clog("UDL 20")
181
+        const appendTarget = shouldDisplayTileView(APP.store.getState())
182
+            ? document.getElementById('localVideoTileViewContainer')
183
+            : document.getElementById('filmstripLocalVideoThumbnail');
184
+        // if ()
185
+        !custom_local && appendTarget && appendTarget.appendChild(this.container);
186
+        clog("UDL 30")
187
+        clog("")
188
+        this._updateVideoElement();
189
+        clog("UDL 40")
190
+    }
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+function updateDOMLocation() {
199
+
200
+        if (!this.container) {
201
+            return;
202
+        }
203
+        // dev trc 
204
+        // ...
205
+        if (this.container.parentElement) {
206
+            this.container.parentElement.removeChild(this.container);
207
+        }
208
+
209
+        const appendTarget = shouldDisplayTileView(APP.store.getState())
210
+            ? document.getElementById('localVideoTileViewContainer')
211
+            : document.getElementById('filmstripLocalVideoThumbnail');
212
+
213
+        appendTarget && appendTarget.appendChild(this.container);
214
+        this._updateVideoElement();
215
+    }
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+function save_orig_prototype(classes){
242
+  var i,k,v
243
+  var i2,k2,v2
244
+  var o
245
+  var ret = {}
246
+  // o = glob_react.vidClass.LocalVideo.prototype
247
+  // o  = tobj
248
+  // o = glob_react.vidClass.LocalVideo
249
+  // for ([k,v] of Object.entries(glob_react.vidClass)){
250
+  // for ([k,v] of Object.entries(o)){
251
+  // for ([k2,v2] of Object.entries(glob_react.vidClass)){
252
+  for ([k2,v2] of Object.entries(classes)){
253
+      clog("...",k2)
254
+      ret[k2] = {}
255
+      o = v2.prototype
256
+    for ([k,v] of iter_desc(o)){
257
+
258
+      // clog(k,v)
259
+      ret[k2][k]=v
260
+      clog(k2,k,v)
261
+    }
262
+  }
263
+  clog("><",Object.getOwnPropertyDescriptors(o))
264
+  return ret
265
+
266
+}
267
+
268
+function save_orig(){
269
+// console.trace("SAVE-ORIG")
270
+glob_orig = window.glob_orig || {
271
+  Filmstrip:{},
272
+  fs:{},
273
+  rf_filmstrip:{},
274
+}
275
+
276
+
277
+  glob_orig.Filmstrip = Object.assign({},glob_react.Filmstrip)
278
+  glob_orig.fs = Object.assign({},glob_react.fs)
279
+  glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
280
+  glob_orig.vidClass = save_orig_prototype(glob_react.vidClass)
281
+  // glob_orig.vidClass.LocalVideo_proto = Object.assign({},glob_react.vidClass.LocalVideo.prototype)
282
+  // glob_orig.vidClass2  = jc(glob_react.vidClass)
283
+  // glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
284
+  save_orig = nop
285
+}
286
+
287
+// glob_react.vidClass.LocalVideo.prototype
288
+// 
289
+
290
+
291
+
292
+
293
+
294
+if (window.glob_orig){
295
+
296
+save_orig = nop
297
+// save_orig()
298
+}
299
+if (!window.glob_orig && window.glob_react){
300
+
301
+// save_orig = nop
302
+save_orig()
303
+}
304
+if (window.glob_orig && window.glob_react){
305
+// dec_fs()
306
+// dec_fs_resize()
307
+// save_orig = nop
308
+// save_orig()
309
+}
310
+
311
+
312
+
313
+
314
+
315
+if (window.glob_orig && window.glob_react){
316
+// dec_fs()
317
+dec_fs_resize()
318
+// save_orig = nop
319
+// save_orig()
320
+}
321
+
322
+
323
+
324
+
325
+
326
+function* iter_desc(o){
327
+  var i,k,v
328
+  i = 0
329
+  for ([k,v] of Object.entries(Object.getOwnPropertyDescriptors(o))){
330
+    yield [k,v]
331
+    i += 1
332
+  }
333
+
334
+}
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+function glvcb(elm){
344
+  // clog("GLVCB",this,[...arguments])
345
+  try{
346
+  return  elm.isLocal
347
+
348
+  } catch{}
349
+}
350
+
351
+function get_local_vid(){
352
+  return glob_dev_hooks.smallvids.filter(glvcb)[0]
353
+
354
+}

+ 156
- 0
clone/toy.js View File

@@ -0,0 +1,156 @@
1
+
2
+
3
+
4
+function fn4({c,r}){
5
+	clog(c,r)
6
+}
7
+
8
+
9
+
10
+function fn3({c,r}){
11
+	clog("fn3",c,r)
12
+	fn4(...arguments)
13
+}
14
+
15
+
16
+
17
+function fn2(a,b="ar2"){
18
+	// fn2(...arguments)
19
+	// parameters
20
+	// par
21
+	clog(arguments[0],arguments[1],arguments[2])
22
+	clog(a,b,[arguments])
23
+}
24
+
25
+function fn1(a,b="ar1"){
26
+	fn2(...arguments)
27
+}
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+toy = {
37
+	dflt_obj:{
38
+		k1:"dflt",
39
+		k2:"dflt",
40
+		k3:"dflt",
41
+		k4:"dflt",
42
+		k5:"dflt",
43
+		k6:"dflt",
44
+	},
45
+	o1:{
46
+		k2:"abc",
47
+		k3:"abc2",
48
+		k4:"abc4",
49
+	},
50
+	arr:[
51
+		{
52
+		k2:"abc_arr",
53
+		k4:"arr0",
54
+		},
55
+		{
56
+		k3:"arr1",
57
+		k3:"arr1",
58
+		},
59
+	],
60
+
61
+}
62
+
63
+
64
+function obj_assign_arr(o,arr=[]){
65
+	// var ret = Object.assign({},toy.dflt_obj,o,...arr)
66
+	var ret = Object.assign({},toy.dflt_obj,o,arr)
67
+	clog(ret)
68
+	return ret
69
+}
70
+// calc_fs_dims()
71
+
72
+// obj_assign_arr(toy.o1,toy.arr)
73
+// dispatch_resize()
74
+
75
+
76
+
77
+// $("[style*='--v']")
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+function filter(o,f=""){
88
+	var k,v
89
+	var ret = {} 
90
+	for ([k,v] of Object.entries(o)){
91
+		k.endsWith(f) ? ret[k]=v :1
92
+	}
93
+return ret
94
+}
95
+
96
+
97
+
98
+function dispatch_evnt(){
99
+	var v
100
+	for (v of $(".remote-video-menu-trigger")){
101
+		// onmouseenter
102
+		// var e = new MouseEvent("onmouseenter",{bubbles: true})
103
+		// var e = new MouseEvent("onmouseover",{bubbles: true})
104
+		var e = new MouseEvent("mouseover",{bubbles: true})
105
+		v.dispatchEvent(e)
106
+		// onmouseover
107
+		// clog([v])
108
+	}	
109
+}
110
+
111
+
112
+
113
+function disp(o){
114
+	APP.store.dispatch(o)
115
+}
116
+// glob_react.base_conference.setFollowMe(true)
117
+// disp(glob_react.base_conference.setFollowMe(true))
118
+// 
119
+
120
+clog('TEST')
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+toy_arr = ["a","b","c","d","e","f","g",]
130
+toy_arr2 = []
131
+
132
+function tta(){
133
+	var k,v
134
+	var arr = toy_arr
135
+	delete arr[4]
136
+	var ret = []
137
+	for ([k,v] of Object.entries(arr)){
138
+		clog("~",k,v)
139
+
140
+	}
141
+}
142
+
143
+// tta()
144
+
145
+
146
+
147
+/*function rcom2(){
148
+	var k,v
149
+	var k2,v2
150
+	for ([k,v] of Object.entries(rldi.files) ){
151
+		// clog(k,v.cached == rls[k],v.cached,rls[k])
152
+		clog(k)
153
+	}
154
+	clog(Object.entries(rldi.files).length)
155
+
156
+}*/

+ 16
- 0
clone/universals.js View File

@@ -0,0 +1,16 @@
1
+
2
+
3
+clog = console.log
4
+function nop(){}
5
+// clog = nop
6
+
7
+function rcom2(){
8
+	var k,v
9
+	var k2,v2
10
+	for ([k,v] of Object.entries(rldi.files) ){
11
+		// clog(k,v.cached == rls[k],v.cached,rls[k])
12
+		clog(k)
13
+	}
14
+	clog(Object.entries(rldi.files).length)
15
+
16
+}

+ 390
- 0
cui5.js View File

@@ -0,0 +1,390 @@
1
+
2
+
3
+
4
+
5
+twsfn5 = window.twsfn5 || {}
6
+
7
+vc2 = {
8
+    key:"key",
9
+}
10
+
11
+
12
+
13
+
14
+
15
+
16
+if (!window.gws){
17
+    window.gws = {
18
+        sockets:{},
19
+    }
20
+}
21
+gws.twsfn5 = twsfn5
22
+
23
+// gws
24
+
25
+
26
+
27
+
28
+// Object.keys(twsfn5_bak)
29
+// Object.keys(twsfn5)
30
+
31
+// Object.keys(twsfn5_bak) +"" == Object.keys(twsfn5)+""
32
+
33
+
34
+
35
+
36
+function connect_helper5(){
37
+        var o = {  
38
+            // ':8943/ws/vts/'
39
+            // url:'wss://' + window.location.host + '/ws/vts2/' + window.roomName.toLowerCase() + '/?CONN',
40
+            url:'wss://' + window.location.host + ':8943/ws/vts2/' + window.roomName.toLowerCase() + '/?CONN',
41
+            wsfn:twsfn5,
42
+            name:"ws_n15",
43
+        }
44
+        clog("o",o)
45
+        connect_ws_arg(o)
46
+}
47
+
48
+
49
+
50
+
51
+
52
+// connect_ws_arg()
53
+
54
+
55
+        // 'wss://' + window.location.host +
56
+        // '/ws/vts/' + window.roomName + '/?qqAAAAAAAAAAAAAAAAA'
57
+
58
+
59
+
60
+
61
+    twsfn5.ts_t2x = function(data) {
62
+        clog("ts_t2x",data)
63
+        var k,v
64
+        for ([k,v] of Object.entries(data.obj.times)){
65
+            clog(k,v.t - data.obj.t0 )
66
+        }
67
+    }
68
+
69
+
70
+    twsfn5.ts_t0x = function(data) {
71
+        // clog("pub_msg",pub_msg)
72
+        var msg = {}
73
+        msg[vc2.key] = "ts_t1"
74
+        twsfn5.s(msg)
75
+    }
76
+
77
+    twsfn5.ts_test = function(data) {
78
+        // clog("pub_msg",pub_msg)
79
+        // var msg = {}
80
+        // msg[vc2.key] = "ts_t1"
81
+        // twsfn.s(msg)
82
+        clog("jx twsfn5.ts_test TEST")
83
+    }
84
+
85
+    twsfn5.pub_msg = function(data) {
86
+        clog("pub_msg",data)
87
+        // var msg = {}
88
+        // msg[vc2.key] = "pong"
89
+        // twsfn5.s(msg)
90
+    }
91
+
92
+
93
+
94
+
95
+
96
+
97
+    twsfn5.qdb_got = function(data) {
98
+        clog("jx qdb_data",data)
99
+        clog("jx qdb_got",data.obj)
100
+        clog(data.obj)
101
+    }
102
+
103
+    twsfn5.qdb_got3 = function(data) {
104
+        clog("jx qdb_data",data)
105
+        clog("jx qdb_got",data.obj)
106
+        clog("~jx~",data.obj.participants,data.obj.corners)
107
+    }
108
+
109
+    twsfn5.recv_corners = function(data) {
110
+        // clog("jx qdb_data",data)
111
+        // clog("jx qdb_got",data.obj)
112
+        glob_corner.corners=data.obj.corners
113
+        cad_ts5r()
114
+        clog("~jx~",data.obj.participants,data.obj.corners)
115
+    }
116
+
117
+    twsfn5.pingpong = function(data) {
118
+        // clog("VFB5 PONG2!")
119
+
120
+        var msg = {}
121
+        msg[vc2.key] = "pong"
122
+        twsfn5.s(msg)
123
+    }
124
+
125
+
126
+
127
+
128
+    twsfn5.onmessage = function(e) {
129
+        var recv_ts_u0 = window.performance.now()
130
+        var recv_ts = Date.now()
131
+        var recv_ts_u1 = window.performance.now()
132
+        // clog("VFB MSG",e)
133
+
134
+        // clog()
135
+        // return
136
+        var data = JSON.parse(e.data);
137
+        data.recv_ts = recv_ts
138
+        data.recv_ts_u0 = recv_ts_u0
139
+        data.recv_ts_u1 = recv_ts_u1
140
+        if (data.type != "pingpong"){
141
+            // clog("ixq twsfn5.onmessage")
142
+        }
143
+        // clog("VFB data",data)
144
+        // clog("WS ONMSG",data)
145
+        if (data.message != undefined){
146
+            // twsfn5.on_chat_message(data)
147
+        }
148
+        if (data.type != undefined && twsfn5[data.type]){
149
+            twsfn5[data.type](data,e)
150
+
151
+        } else {
152
+            clog("VFB data",data)
153
+        }
154
+    };
155
+
156
+    twsfn5.onopen = function(e) {
157
+        clog("jx ONCON...")
158
+        chatSocket.onopen
159
+        // clog("jx ONCON....")
160
+        // window.qdb ? onconnect : console.err("ERR no qdb")
161
+        // window.qdb ? window.qdb.onconnect() : console.error(" jx ERR no qdb")
162
+        window.qdb ? window.qdb.onconnect_2() : console.error(" jx ERR no qdb")
163
+        // console.error(" jx ERR test")
164
+        // console.error(" jx ERR test2")
165
+        // clog("jx ONCON... fin")
166
+    }
167
+    twsfn5.onclose = function(e) {
168
+        console.error('VFB2 vChat socket closed unexpectedly');
169
+        setTimeout(connect_helper5,1400)
170
+        // setTimeout(vconnect_ws,1400)
171
+    };
172
+
173
+
174
+ twsfn5.s=   function(o){
175
+
176
+        if (o.key != "pong"){
177
+            // clog("ixq twsfn5.send")
178
+        }
179
+
180
+    var vchatSocket = gws.sockets["ws_n15"]
181
+        // .send(JSON.stringify(o));
182
+        // twsfn5.s0 =
183
+         vchatSocket.send(JSON.stringify(o));
184
+    }
185
+
186
+// s =twsfn5.s
187
+// vconnect_ws()
188
+
189
+
190
+
191
+
192
+
193
+
194
+// delete qdb
195
+{
196
+
197
+class QDB {
198
+    constructor(){
199
+        this.db = {}
200
+    }
201
+    onconnect(){
202
+
203
+        qdb.get_corners()
204
+    }
205
+    onconnect_2(){
206
+        clog("JX onconnect_2")
207
+        // qdb.get_corners()
208
+        // setTimeout(this.get_corners.bind(this,1000))
209
+
210
+        setTimeout(this.get_corners.bind(this),100)
211
+        setTimeout(this.get_corners.bind(this),2000)
212
+        get_cui_html(rldi.files["cui3.html"])
213
+
214
+        // setTimeout(this.get_corners.bind(this,1000))
215
+        // setTimeout(this.get_corners.bind(this,))
216
+        // setTimeout(qdb.get_corners.bind(this,100)
217
+
218
+        // qdb.get_corners()
219
+    }
220
+
221
+    send(o){
222
+        twsfn5.s(o)
223
+    }
224
+    q(action){
225
+        this.send({"key":"qdb","action":action})
226
+
227
+    }
228
+    get_db(){
229
+        this.send({"key":"qdb","action":"get_db"})
230
+
231
+    }
232
+    get_db2(){
233
+        this.send({"key":"qdb","action":"get_db2"})
234
+
235
+    }
236
+
237
+    
238
+    set_db(){
239
+        this.send({"key":"qdb","action":"set_db"})
240
+
241
+    }
242
+
243
+    update(){
244
+
245
+    }
246
+    proc_response(data){
247
+        clog("jx proc_response",data)
248
+    }
249
+
250
+    updated(){
251
+
252
+    }
253
+
254
+    set_corners(corner_name){
255
+        this.send({"key":"qdb","action":"set_corners","corner_name":corner_name})
256
+    }
257
+    get_corners(corner_name){
258
+        clog("jx get_corners abc 123",this)
259
+        this.send({"key":"qdb","action":"get_corners"})
260
+    }
261
+    add_corner(corner_name){
262
+        this.send({"key":"qdb","action":"add_corner","corner_name":corner_name})
263
+    }
264
+    remove_corner(corner_name){
265
+        this.send({"key":"qdb","action":"remove_corner","corner_name":corner_name})
266
+    }
267
+    move(corner_name){
268
+        this.send({"key":"qdb","action":"move","corner_name":corner_name})
269
+    }
270
+
271
+
272
+    time_sync(){
273
+        clog("TIME SYNC")
274
+        // Date.now()
275
+
276
+
277
+        this.send({"key":"qdb","action":"time_sync","t0":Date.now(),"t0_u":window.performance.now()})
278
+    }
279
+
280
+    // server_ts
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+}
290
+window.QDB = QDB
291
+}
292
+function replace_proto(){
293
+    window.qdb.__proto__ = QDB.prototype
294
+    var vchatSocket = gws.sockets["ws_n15"]
295
+    var wsfn = twsfn5
296
+
297
+    vchatSocket.onmessage = wsfn.onmessage
298
+    vchatSocket.onclose = wsfn.onclose  
299
+    vchatSocket.onopen = wsfn.onopen  
300
+
301
+}
302
+if (!window.qdb){
303
+    window.qdb = new QDB()
304
+
305
+} 
306
+
307
+
308
+
309
+
310
+window.QDB_def0 = QDB + ""
311
+if (window.QDB_def0 != window.QDB_def){
312
+    if (window.QDB_def){
313
+
314
+window.QDB_def = QDB + ""
315
+replace_proto()
316
+    }
317
+window.QDB_def = QDB + ""
318
+}
319
+if (window.qdb){
320
+    twsfn5.client_qbd = window.qdb.proc_response
321
+}
322
+
323
+twsfn5.get_db = function(){
324
+
325
+}
326
+twsfn5.server_ts = function(data,e){
327
+    var ts_u1 = window.performance.now()
328
+
329
+    var t1 = Date.now()
330
+    var t0 = data.req.t0
331
+    var ts = data.server_time
332
+    var tsx =ts * 1000
333
+    var ta = (t0+t1)/2
334
+    tsd = new Date(ts*1000)
335
+    t0d = new Date(t0)
336
+    t1d = new Date(t1)
337
+    td2 = ta - tsx
338
+    td  =  tsx - ta
339
+    tarr = [[t1,"t1"],[tsx,"tsx"],[t0,"t0"],[ta,"ta"],[td,"td"],[td2,"td2"]]
340
+    tobj = {t1,tsx,t0,ta,td,td2}
341
+
342
+    clog("ts:",t1 - data.recv_ts,ts_u1- data.recv_ts_u1,data)
343
+    // clog("ts:",{t0,ts,t1})
344
+
345
+    // clog("ts3:",(t0+t1)/2 - (ts *1000),t0 - t1)
346
+
347
+    t01 = t0 - t1
348
+    t01_u = data.req.t0_u - ts_u1
349
+
350
+    clog("ts3:",(t0+t1)/2 - tsx,t0-tsx,t1-tsx,t0 - t1)
351
+    if (!qdb.td){
352
+        qdb.td = 0
353
+    }
354
+    clog("ts4:",qdb.td - td,"~",qdb.td,td)
355
+    clog("ts5:",t01,t01_u)
356
+    qdb.td = td
357
+    qdb.td2 = td2
358
+    if (window.clock_info_draw){
359
+        clock_info_draw()
360
+    }
361
+
362
+}
363
+twsfn5.update_db = function(){}
364
+twsfn5.updated_db = function(){}
365
+
366
+
367
+
368
+
369
+
370
+function rld_continues(){
371
+    clog("vfb jx RC")
372
+    if (window.stop_flag){
373
+        return 
374
+    }
375
+    twsfn5.s({"key":"rld"})
376
+    setTimeout(rld_continues,500)
377
+}
378
+
379
+
380
+
381
+
382
+
383
+// connect_helper5()
384
+
385
+
386
+
387
+// setTimeout
388
+
389
+
390
+clog("BX5")

+ 449
- 0
custom_resize.js View File

@@ -0,0 +1,449 @@
1
+clog("!")
2
+
3
+
4
+
5
+
6
+
7
+
8
+glob_mx.filmstrip_handlers = glob_mx.filmstrip_handlers || {}
9
+
10
+
11
+
12
+
13
+
14
+
15
+dflt_css = {
16
+
17
+      'padding-top': '',
18
+      "min-height": ``,
19
+      "min-width": ``,
20
+      width: ``,
21
+      height: ``,
22
+    
23
+}
24
+function resize_thumbs(thumbs,css){
25
+  const computed_css = Object.assign({},dflt_css,css)
26
+  var k,v
27
+  for ([k,v] of Object.entries(computed_css)){
28
+    Number(v) ? computed_css[k] = v + "px" : 0
29
+  }
30
+  // clog("RTHUMBS")
31
+  thumbs.css(computed_css)
32
+
33
+}
34
+function resize_thumbs_vertical(cont){
35
+  const computed_css = Object.assign({},dflt_css)
36
+
37
+  var aspect = 16/9
38
+  var width = 335
39
+  var thumbs = $(cont).children(".small_vid")
40
+  width = $(cont).width() - 1  
41
+  // computed_css["--v_index"]=`"VERT"`
42
+  var height = Math.round(width/aspect)
43
+  computed_css.height = height
44
+  computed_css["min-height"] = height
45
+  computed_css.width = width
46
+  computed_css["min-width"] = width
47
+  var k,v
48
+  for ([k,v] of Object.entries(computed_css)){
49
+    Number(v) ? computed_css[k] = v + "px" : 0
50
+  }
51
+  // clog("RTHUMBS")
52
+  thumbs.css(computed_css)
53
+
54
+}
55
+
56
+function resize_thumbs_horizontal(cont){
57
+  const computed_css = Object.assign({},dflt_css)
58
+
59
+  var aspect = 16/9
60
+  var width = 335
61
+  // computed_css["--v_index"]=`"horizontal"`
62
+  var thumbs = $(cont).children(".small_vid")
63
+  width = ($(cont).height() * aspect) 
64
+  width = ($(cont).height() * aspect) - 1
65
+  var height = Math.round(width/aspect)
66
+  computed_css.height = height
67
+  computed_css.width = width
68
+  var k,v
69
+  for ([k,v] of Object.entries(computed_css)){
70
+    Number(v) ? computed_css[k] = v + "px" : 0
71
+  }
72
+  // clog("RTHUMBS")
73
+  thumbs.css(computed_css)
74
+
75
+
76
+}
77
+
78
+function resize_thumbs_center(cont){
79
+  const computed_css = Object.assign({},dflt_css)
80
+
81
+  var aspect = 16/9
82
+  var width = 335
83
+  // computed_css["--v_index"]=`"horizontal"`
84
+  var thumbs = $(cont).children(".small_vid")
85
+  width = ($(cont).height() * aspect) 
86
+  width = ($(cont).height() * aspect) - 1
87
+  var height = Math.round(width/aspect)
88
+  computed_css.height = height
89
+  computed_css.width = width
90
+  var k,v
91
+  for ([k,v] of Object.entries(computed_css)){
92
+    Number(v) ? computed_css[k] = v + "px" : 0
93
+  }
94
+  // clog("RTHUMBS")
95
+  thumbs.css(computed_css)
96
+
97
+
98
+}
99
+
100
+
101
+function resize_filmstrips(that,fn_name,args=[]){
102
+
103
+}
104
+function resize_filmstrips2(that,fn_name,args=[]){
105
+	
106
+}
107
+
108
+
109
+function resizeThumbnailsForCustomView(that,fn_name,args=[]){
110
+    const thumbs = glob_react.Filmstrip._getThumbs()
111
+    const all_thumbs = $(".small_vid")
112
+    const custom_thumbs = all_thumbs.not(thumbs.remlocThumbs)
113
+    const vid_containers = $(".vid_container")
114
+    const loose_thumbs = custom_thumbs.not(vid_containers.children())
115
+    var k,v 
116
+    for (v of vid_containers){
117
+      // clog(":",v,v.dataset.fs_type)
118
+      switch (v.dataset.fs_type){
119
+        case "vertical":{
120
+          resize_thumbs_vertical(v)
121
+          /*
122
+          resize_thumbs($(v).children(".small_vid"),{
123
+                  width: `${100}px`,
124
+                height: `${100}px`,
125
+          })
126
+          */
127
+          break;
128
+        }
129
+        case "horizontal":{
130
+          resize_thumbs_horizontal(v)
131
+
132
+          break;
133
+        }
134
+        case "single":{
135
+          resize_thumbs_center(v)
136
+
137
+          break;
138
+        }
139
+
140
+        default:{
141
+
142
+          break;
143
+        }
144
+        clog("HI")
145
+      }
146
+    }
147
+    // return
148
+    // const custom_thumbs = all_thumbs
149
+
150
+    var aspect = 16/18
151
+    var width = 135
152
+    var height = Math.round(width/aspect)
153
+    loose_thumbs.css({
154
+      'padding-top': '',
155
+      "min-height": `${height}px`,
156
+      "min-width": `${width}px`,
157
+      width: `${width}px`,
158
+      height: `${height}px`,
159
+    })
160
+
161
+    clog("rtscv",fn_name,[that,...args])
162
+
163
+
164
+}
165
+
166
+
167
+
168
+
169
+function calc_fs_dims0(){
170
+    const hd_w = 16
171
+    const hd_h = 9
172
+
173
+    const aspect_ratio_hd = hd_w / hd_h
174
+
175
+    const aspect_ratio_65 = (hd_w * 6) / (hd_h * 5)
176
+    const aspect_ratio_64 = (hd_w * 6) / (hd_h * 4)
177
+
178
+
179
+    const state = APP.store.getState();
180
+    var { clientHeight, clientWidth } = state['features/base/responsive-ui'];
181
+    var avail_width  =clientWidth
182
+    var avail_height =clientHeight - 100
183
+
184
+
185
+
186
+    var dim_hd = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
187
+            columns:1,
188
+    visibleRows:1,
189
+    clientWidth:avail_width,
190
+    clientHeight:avail_height,
191
+    TILE_ASPECT_RATIO:TILE_ASPECT_RATIO ,
192
+    verticalMargin:0,
193
+    // sideMargins=0,
194
+    // topBottomPadding:100,
195
+    })
196
+
197
+
198
+    var dim_65 = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
199
+            columns:1,
200
+    visibleRows:1,
201
+    clientWidth:avail_width,
202
+    clientHeight:avail_height,
203
+    TILE_ASPECT_RATIO:aspect_ratio_65 ,
204
+    verticalMargin:0,
205
+    // sideMargins=0,
206
+    // topBottomPadding:100,
207
+    })
208
+
209
+    var dim_64 = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
210
+            columns:1,
211
+    visibleRows:1,
212
+    clientWidth:avail_width,
213
+    clientHeight:avail_height,
214
+    TILE_ASPECT_RATIO:aspect_ratio_64 ,
215
+    verticalMargin:0,
216
+    // sideMargins=0,
217
+    // topBottomPadding:100,
218
+    })
219
+    clog("~~",dim_hd)
220
+
221
+
222
+
223
+
224
+    resize_thumbs_proto($(".a1"),{
225
+        width:clientWidth,
226
+        height:clientHeight,
227
+        "--vtext":`"window"`
228
+    })
229
+    resize_thumbs_proto($(".a2"),{
230
+        width:avail_width,
231
+        height:avail_height,
232
+        "--vtext":`"avail"`
233
+    })
234
+
235
+
236
+    resize_thumbs_proto($(".b2"),[dim_hd,
237
+    	{
238
+    		"--vtext":`"dim_hd"`
239
+    	},])
240
+
241
+    resize_thumbs_proto($(".b3"),[dim_65,
242
+    	{
243
+    		"--vtext":`"dim_65"`
244
+    	},])
245
+
246
+    resize_thumbs_proto($(".b4"),[dim_64,
247
+    	{
248
+    		"--vtext":`"dim_64"`
249
+    	},])
250
+    let w5,h5,w53,h53,w54,h54
251
+    h5 = dim_hd.height/5
252
+    w5 = dim_hd.width/5
253
+
254
+    w53 = w5 * 3
255
+    h53 = h5 * 3
256
+    w54 = w5 * 4
257
+    h54 = h5 * 4
258
+    resize_thumbs_proto($(".a3z"),[
259
+    	{
260
+    		        width:w5,
261
+        height:h5,
262
+    		"--vtext":`"t5"`
263
+    	},])
264
+
265
+
266
+    resize_thumbs_proto($(".a4"),[
267
+    	{
268
+    		     width:dim_hd.width,
269
+        height:h5,
270
+    		"--vtext":`"top_fs"`
271
+    	},])
272
+    resize_thumbs_proto($(".a5"),[
273
+    	{
274
+    		     width:w5,
275
+        height:h53,
276
+        top:h5,
277
+    		"--vtext":`"left_fs"`,
278
+    	},])
279
+
280
+    resize_thumbs_proto($(".a6"),[
281
+    	{
282
+    		     width:w5,
283
+        height:h53,
284
+        top:h5,
285
+        left:w54,
286
+        // right:0,
287
+    		"--vtext":`"right_fs"`,
288
+    	},])
289
+
290
+    resize_thumbs_proto($(".a7"),[
291
+    	{
292
+    		     width:dim_hd.width,
293
+        height:h5,
294
+        top:h54,
295
+        // left:w54,
296
+        // right:0,
297
+    		"--vtext":`"bottom_fs"`,
298
+    	},])
299
+
300
+
301
+
302
+    // resize_thumbs_proto($(".b2"),dim_hd)
303
+
304
+
305
+
306
+}
307
+function calc_fs_dims(){
308
+    const hd_w = 16
309
+    const hd_h = 9
310
+
311
+    const aspect_ratio_hd = hd_w / hd_h
312
+
313
+    const aspect_ratio_65 = (hd_w * 6) / (hd_h * 5)
314
+    const aspect_ratio_64 = (hd_w * 6) / (hd_h * 4)
315
+
316
+
317
+    const state = APP.store.getState();
318
+    var { clientHeight, clientWidth } = state['features/base/responsive-ui'];
319
+    var avail_width  =clientWidth
320
+    var avail_height =clientHeight - 100
321
+
322
+
323
+
324
+    var dim_hd = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
325
+            columns:1,
326
+    visibleRows:1,
327
+    clientWidth:avail_width,
328
+    clientHeight:avail_height,
329
+    TILE_ASPECT_RATIO:TILE_ASPECT_RATIO ,
330
+    verticalMargin:0,
331
+    // sideMargins=0,
332
+    // topBottomPadding:100,
333
+    })
334
+    let w5,h5,w53,h53,w54,h54
335
+    h5 = dim_hd.height/5
336
+    w5 = dim_hd.width/5
337
+
338
+    w53 = w5 * 3
339
+    h53 = h5 * 3
340
+    w54 = w5 * 4
341
+    h54 = h5 * 4
342
+
343
+
344
+
345
+
346
+    // fs_type: "vertical"
347
+    resize_thumbs_proto($(".ic1"),[
348
+    	{
349
+    		     width:dim_hd.width,
350
+        height:h5,
351
+    		"--vtext":`"top_fs"`,
352
+    		// data:{fs_type: "vertical"},
353
+    		data:{fs_type: "horizontal",},
354
+    	},])
355
+
356
+
357
+    resize_thumbs_proto($(".ic2"),[
358
+    	{
359
+    		     width:w5,
360
+        height:h53,
361
+        top:h5,
362
+
363
+    		"--vtext":`"left_fs"`,
364
+    		data:{fs_type: "vertical"},
365
+    	},])
366
+
367
+    resize_thumbs_proto($(".ic3"),[
368
+    	{
369
+    		     width:w5,
370
+        height:h53,
371
+        top:h5,
372
+        left:w54,
373
+        // left:0,
374
+        // right:0,
375
+    		"--vtext":`"right_fs"`,
376
+    		data:{fs_type: "vertical"},
377
+    	},])
378
+
379
+    resize_thumbs_proto($(".ic6"),[
380
+    	{
381
+    		     width:dim_hd.width,
382
+        height:h5,
383
+        top:h54,
384
+        left:0,
385
+        // left:w54,
386
+        // right:0,
387
+    		"--vtext":`"bottom_fs"`,
388
+    		data:{fs_type: "horizontal"},
389
+    	},])
390
+
391
+
392
+    resize_thumbs_proto($(".ic4"),[
393
+    	{
394
+    		     width:w53,
395
+        height:h53,
396
+        height:h53,
397
+        top:h5,
398
+        left:w5,
399
+        // left:w54,
400
+        // right:0,
401
+    		"--vtext":`"center"`,
402
+    		data:{fs_type: "single"},
403
+    	},])
404
+
405
+}
406
+
407
+
408
+
409
+function new_move(){
410
+	var j 
411
+	try {
412
+		j = jc(window.sorted_tiles)
413
+	} catch (err) {
414
+		clog("NEW MOVE err:",err)
415
+	}
416
+	// var j = $(".small_vid")
417
+	$(".ic1").append(j.splice(2,5))
418
+	$(".ic2").append(j.splice(0,3))
419
+	$(".ic3").append(j.splice(0,3))
420
+	$(".ic6").append(j.splice(0,5))
421
+	$(".ic4").append(j.splice(0,1))
422
+}
423
+
424
+function move_info(){
425
+	var j = $(".small_vid")
426
+	var k,v
427
+	for (v of j){
428
+		clog(v)
429
+	}
430
+	// $(".ic1").append(j.splice(2,5))
431
+	// $(".ic2").append(j.splice(0,3))
432
+	// $(".ic3").append(j.splice(0,3))
433
+	// $(".ic6").append(j.splice(0,5))
434
+	// $(".ic4").append(j.splice(0,1))
435
+}
436
+
437
+
438
+if (window.saftly_remove){
439
+    init_api6()
440
+    // calc_fs_dims0()
441
+    calc_fs_dims()
442
+    new_move()
443
+    // get_avail_width()
444
+    // clog("REZIE PROTO READY")
445
+}
446
+
447
+
448
+
449
+

+ 323
- 0
deep_walk.js View File

@@ -0,0 +1,323 @@
1
+
2
+
3
+
4
+
5
+
6
+function* keyVal(obj){
7
+  for (let en in obj){
8
+    yield [en,obj[en]]
9
+  }
10
+}
11
+
12
+function* keyVal2(obj){
13
+  let ctr = 0
14
+  for (let en in obj){
15
+    yield [ctr++,en,obj[en]]
16
+  }
17
+}
18
+
19
+_deep_walk = {}
20
+_deep_walk.mx_ = 15000
21
+_deep_walk.mx_depth = 8
22
+// _deep_walk.mx_depth = 6
23
+_deep_walk.cnt = 0
24
+_deep_walk.depth = 0
25
+_deep_walk.skip_walk = 1
26
+_deep_walk.k = new Set()
27
+_deep_walk.stops = new Set()
28
+
29
+_deep_walk.m = new Map()
30
+
31
+_deep_walk_dflt = {
32
+	path:[],
33
+	paths:[],
34
+	names:[],
35
+}
36
+
37
+// kvt(APP.store.getState())
38
+
39
+
40
+function kvt(o,path=[],d=0) {
41
+		// clog(":",d,path.join("."))
42
+		_deep_walk.st ? clog(d,path.join(".")) :1
43
+
44
+	if (o.skip_walk){
45
+		clog("skip_walk",d ,_deep_walk.cnt)
46
+		_deep_walk.st = 1
47
+		return
48
+	} else if(_deep_walk.cnt > _deep_walk.mx_) {
49
+		clog("_deep_walk.cnt > _deep_walk.mx_")
50
+		return
51
+	} else if (d > _deep_walk.mx_depth){
52
+		clog("d > _deep_walk.mx_depth",_deep_walk.cnt,d)
53
+		return
54
+	}
55
+	// _deep_walk.cnt += 1
56
+
57
+	var k,v
58
+	var new_obj
59
+	var ometa
60
+	var breadth_first = []
61
+	for ([k,v] of keyVal(o)){
62
+		_deep_walk.cnt += 1
63
+		// clog("cntx",_deep_walk.cnt)
64
+ if(_deep_walk.cnt > _deep_walk.mx_) {
65
+		clog("_deep_walk.cnt > _deep_walk.mx_ 1")
66
+		return
67
+	}
68
+		if (k.includes("handler")){
69
+			clog(d,_deep_walk.cnt,[...path,k].join("."))
70
+		}
71
+		// clog(_deep_walk.cnt,k)
72
+
73
+		// if (typeof(v) != "object" && typeof(v) != "function"){
74
+
75
+
76
+
77
+			/*
78
+
79
+		if (typeof(v) != "object" || ( v && v.nodeName)){
80
+		// _deep_walk.k.add(typeof(v) === undefined ? "_undefined" : typeof(v) )
81
+		_deep_walk.stops.add( typeof(v) )
82
+
83
+			// return
84
+			continue
85
+		}
86
+			*/
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+		// _deep_walk.cnt += 1
96
+		// new_obj = _deep_walk.m.has(o)
97
+		new_obj = _deep_walk.m.setD(v,jc(_deep_walk_dflt))
98
+		ometa = _deep_walk.m.get(v)
99
+		ometa.names.push(k)
100
+		ometa.paths.push([...path,k])
101
+
102
+		_deep_walk.k.add(k === undefined ? "_undefined" : k )
103
+
104
+
105
+		if (typeof(v) != "object" || ( v && v.nodeName)){
106
+		// _deep_walk.k.add(typeof(v) === undefined ? "_undefined" : typeof(v) )
107
+		_deep_walk.stops.add( typeof(v) )
108
+
109
+			// return
110
+			continue
111
+		}
112
+
113
+
114
+
115
+		
116
+		if (new_obj && typeof(v) == "object" && v){
117
+			breadth_first.push(k)
118
+
119
+			// kvt(v,[...path,k],d+1)
120
+		}
121
+
122
+	}
123
+	for ([k,v] of keyVal(o)){
124
+		// clog("cntx2",_deep_walk.cnt)
125
+ if(_deep_walk.cnt > _deep_walk.mx_) {
126
+		clog("_deep_walk.cnt > _deep_walk.mx_ 2")
127
+		return
128
+	}
129
+
130
+		if (breadth_first.includes(k)){
131
+			kvt(v,[...path,k],d+1)
132
+
133
+		}
134
+
135
+	}
136
+
137
+
138
+	if (!d){
139
+		clog("FIN!")
140
+	}
141
+
142
+}
143
+
144
+
145
+
146
+
147
+
148
+function kvt00(o,path=[],d=0) {
149
+		// clog(":",d,path.join("."))
150
+		_deep_walk.st ? clog(d,path.join(".")) :1
151
+
152
+	if (o.skip_walk){
153
+		clog("skip_walk",d ,_deep_walk.cnt)
154
+		_deep_walk.st = 1
155
+		return
156
+	} else if(_deep_walk.cnt > _deep_walk.mx_) {
157
+		clog("_deep_walk.cnt > _deep_walk.mx_")
158
+		return
159
+	} else if (d > _deep_walk.mx_depth){
160
+		clog("d > _deep_walk.mx_depth")
161
+		return
162
+	}
163
+	// _deep_walk.cnt += 1
164
+
165
+	var k,v
166
+	var new_obj
167
+	var ometa
168
+	var breadth_first = []
169
+	for ([k,v] of keyVal(o)){
170
+		_deep_walk.cnt += 1
171
+		clog("cntx",_deep_walk.cnt)
172
+ if(_deep_walk.cnt > _deep_walk.mx_) {
173
+		clog("_deep_walk.cnt > _deep_walk.mx_ 1")
174
+		return
175
+	}
176
+		if (k.includes("handler")){
177
+			clog(d,_deep_walk.cnt,[...path,k].join("."))
178
+		}
179
+		// clog(_deep_walk.cnt,k)
180
+
181
+		// if (typeof(v) != "object" && typeof(v) != "function"){
182
+		if (typeof(v) != "object" || ( v && v.nodeName)){
183
+		// _deep_walk.k.add(typeof(v) === undefined ? "_undefined" : typeof(v) )
184
+		_deep_walk.stops.add( typeof(v) )
185
+
186
+			// return
187
+			continue
188
+		}
189
+		// _deep_walk.cnt += 1
190
+		// new_obj = _deep_walk.m.has(o)
191
+		new_obj = _deep_walk.m.setD(v,jc(_deep_walk_dflt))
192
+		ometa = _deep_walk.m.get(v)
193
+		ometa.names.push(k)
194
+		ometa.paths.push([...path,k])
195
+
196
+		_deep_walk.k.add(k === undefined ? "_undefined" : k )
197
+		if (new_obj && typeof(v) == "object" && v){
198
+			breadth_first.push(k)
199
+
200
+			// kvt(v,[...path,k],d+1)
201
+		}
202
+
203
+	}
204
+	for ([k,v] of keyVal(o)){
205
+		clog("cntx2",_deep_walk.cnt)
206
+ if(_deep_walk.cnt > _deep_walk.mx_) {
207
+		clog("_deep_walk.cnt > _deep_walk.mx_ 2")
208
+		return
209
+	}
210
+
211
+		if (breadth_first.includes(k)){
212
+			kvt(v,[...path,k],d+1)
213
+
214
+		}
215
+
216
+	}
217
+
218
+
219
+	if (!d){
220
+		clog("FIN!")
221
+	}
222
+
223
+}
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+function kvt0(o,path=[],d=0) {
239
+		// clog(":",d,path.join("."))
240
+
241
+	if (o.skip_walk){
242
+		clog("skip_walk")
243
+		return
244
+	} else if(_deep_walk.cnt > _deep_walk.mx_) {
245
+		clog("_deep_walk.cnt > _deep_walk.mx_")
246
+		return
247
+	} else if (d > _deep_walk.mx_depth){
248
+		clog("d > _deep_walk.mx_depth")
249
+		return
250
+	}
251
+	// _deep_walk.cnt += 1
252
+
253
+	var k,v
254
+	var new_obj
255
+	var ometa
256
+	// var 
257
+	for ([k,v] of keyVal(o)){
258
+		if (k.includes("handler")){
259
+			clog(d,_deep_walk.cnt,[...path,k].join("."))
260
+		}
261
+		// clog(_deep_walk.cnt,k)
262
+
263
+		// if (typeof(v) != "object" && typeof(v) != "function"){
264
+		if (typeof(v) != "object" || ( v && v.nodeName)){
265
+		// _deep_walk.k.add(typeof(v) === undefined ? "_undefined" : typeof(v) )
266
+		_deep_walk.stops.add( typeof(v) )
267
+
268
+			// return
269
+			continue
270
+		}
271
+		_deep_walk.cnt += 1
272
+		// new_obj = _deep_walk.m.has(o)
273
+		new_obj = _deep_walk.m.setD(v,jc(_deep_walk_dflt))
274
+		ometa = _deep_walk.m.get(v)
275
+		ometa.names.push(k)
276
+		ometa.paths.push([...path,k])
277
+
278
+		_deep_walk.k.add(k === undefined ? "_undefined" : k )
279
+		if (new_obj && typeof(v) == "object" && v){
280
+
281
+			kvt0(v,[...path,k],d+1)
282
+		}
283
+
284
+	}
285
+	if (!d){
286
+		clog("FIN!")
287
+	}
288
+
289
+}
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+function lmap(m){
301
+	var k,v 
302
+	var cnt
303
+	var cnt_mx
304
+	cnt_mx = 6000
305
+	var ret = {
306
+		types:new Set(),
307
+	}
308
+	cnt = 0
309
+	for ([k,v] of m){
310
+		cnt += 1
311
+		// clog(cnt,k,v)
312
+		ret.types.add(typeof(k))
313
+		if (cnt > cnt_mx){
314
+			clog("RET")
315
+
316
+			return
317
+		}
318
+	}
319
+	ret.cnt = cnt
320
+	ret.cnt_mx = cnt_mx
321
+	// clog()
322
+	return ret
323
+}

+ 461
- 0
deep_walk2.js View File

@@ -0,0 +1,461 @@
1
+
2
+
3
+
4
+
5
+_deep_walk2 = {
6
+	mx_cnt:100,
7
+	cnt:0,
8
+	mx_depth:2,
9
+	m:new Map(),
10
+}
11
+
12
+_deep_walk_dflt2 = {
13
+	path:[],
14
+	paths:[],
15
+	names:[],
16
+	kv:[],
17
+	cnt:0,
18
+}
19
+
20
+
21
+function breadth_first(o,p,d){
22
+	var k,v,cnt,ometa
23
+	cnt = 0
24
+	for ([k,v] of o){
25
+	_deep_walk2.cnt +=1
26
+		cnt += 1
27
+		// _deep_walk2.m
28
+		_deep_walk2.m.setD(v,jc(_deep_walk_dflt))
29
+		ometa = _deep_walk.m.get(v)
30
+		ometa.names.push(k)
31
+		ometa.cnt += 1
32
+		// clog()
33
+
34
+	}
35
+
36
+}
37
+
38
+
39
+function get_type_proto_(o){
40
+	const type = typeof(o)
41
+	if (type !== "object"){
42
+		return type
43
+	} else if (o == null){
44
+		return "null"
45
+	}
46
+	try {
47
+		return o.__proto__
48
+	} catch (err){
49
+		console.log("get_type_proto_ err",err)
50
+		return "err"
51
+	}
52
+}
53
+
54
+
55
+vanilla_objs= new Set([get_type_proto_([]),get_type_proto_({})])
56
+function v_obj(type){
57
+	return vanilla_objs.has(type)
58
+	// if (vanilla_objs)
59
+}
60
+
61
+
62
+kvt_types = new Set()
63
+
64
+
65
+
66
+
67
+
68
+// rdeep(_deep_dev,window,{},0)
69
+
70
+
71
+
72
+function should_i_stop(that,o,meta,d){
73
+	if (d > that.mx_depth){
74
+		clog("init stop","depth",that.mx_cnt,d)
75
+		that.stop = 1
76
+	} else {
77
+		// clog("mx~",d > that.mx_depth,d , that.mx_depth)
78
+	}
79
+
80
+	if (that.cnt > that.mx_cnt){
81
+		clog("init stop","mx_cnt",that.mx_cnt,d)
82
+		that.stop = 1
83
+	}
84
+
85
+	if (that.stop){
86
+		return 1
87
+	}
88
+
89
+}
90
+
91
+function* wlk(that,o,meta,d){
92
+	// let i,k,v
93
+  let ctr = 0
94
+  for (let en in o){
95
+    yield [ctr++,en,o[en]]
96
+  }
97
+
98
+}
99
+
100
+
101
+tobj = {
102
+	x:{x2:"abc"},
103
+	"a":{
104
+		"a2":{
105
+			"a3":{a4:"xyz"},
106
+			"b3":{
107
+				b4:"xyz2",
108
+				c4:"xyz3",
109
+				},
110
+
111
+		},
112
+	},
113
+	z:{z2:"abcz"},
114
+}
115
+tobj2 = {
116
+	a:{k1:"v1"},
117
+	b:{k2:"v2"},
118
+}
119
+tobj.c=tobj.a
120
+_deep_dev_dflt =  {
121
+
122
+	mt:new Map(),
123
+	m:new Map(),
124
+	mq:new Map(),
125
+	mx_depth:8,
126
+	// mx_depth:5,
127
+
128
+	mx_cnt:3500,
129
+	cnt2:0,
130
+	cnt_loop:250,
131
+	// mx_cnt:1500,
132
+	cnt:0,
133
+}
134
+_deep_dev = window._deep_dev || _deep_dev_dflt
135
+_deep_walk_dflt3 = {
136
+	path:[],
137
+	paths:[],
138
+	names:[],
139
+	kv:[],
140
+	cnt:0,
141
+	depth:0,
142
+}
143
+
144
+
145
+function rdeep_init(that,o){
146
+	_deep_dev = jc(_deep_dev_dflt)
147
+
148
+	// _deep_dev.mq.setD(window,jc(_deep_walk_dflt3))
149
+
150
+	// _deep_dev.mq.setD(tobj,jc(_deep_walk_dflt3))
151
+	_deep_dev.mq.setD(APP.store.getState(),jc(_deep_walk_dflt3))
152
+	// _deep_dev.mq.setD(o,jc(_deep_walk_dflt3))
153
+	// _deep_dev.mq.setD("zz",jc(_deep_walk_dflt3))
154
+	rdeep(_deep_dev,window,{},0)
155
+	// _deep_dev 
156
+}
157
+
158
+
159
+
160
+
161
+
162
+
163
+function q_up(that,o,ometa){
164
+	let i,k,v
165
+	var meta 
166
+	var new_obj 
167
+	for ([i,k,v] of keyVal2(o)){
168
+
169
+
170
+	if (typeof(o) == "object"){
171
+		// clog("")
172
+	} else {
173
+		// HA HA
174
+		continue
175
+
176
+	}
177
+
178
+
179
+		// meta = jc(_deep_walk_dflt3)
180
+
181
+	new_obj = _deep_dev.m.setD(v,jc(_deep_walk_dflt3))
182
+	meta = _deep_dev.m.get(v)
183
+	new_obj ? ( meta.depth = ometa.depth + 1 , meta.path = [...ometa.path,k]) : 0
184
+	meta.names.push(k)
185
+	// meta.path = [...ometa.path,k]
186
+	if (k=="k2"){
187
+		tobj.a.k3="!@#$%^"
188
+	}
189
+	meta.cnt += 1
190
+
191
+	// clog("Q_UP")
192
+	// clog("Q~",i,k,v,meta.cnt,new_obj)
193
+
194
+	_deep_dev.mq.setD(v,meta)
195
+
196
+	}
197
+}
198
+
199
+
200
+
201
+function rdeep(that,o,meta_x,d){
202
+	var ometa,new_obj
203
+	if (should_i_stop(that,o,meta_x,d)){
204
+		clog("Stopping",that.mx_cnt,d)
205
+		return
206
+	}
207
+	clog("!001")
208
+	if (typeof(o) != "object"){
209
+		return
210
+	}
211
+
212
+
213
+	/*
214
+	if (should_i_iter(that,o,meta_x,d)){
215
+		clog("Stopping",that.mx_cnt,d)
216
+		return
217
+	}
218
+	*/
219
+	// let 
220
+	clog("!002")
221
+	let i,k,v
222
+	for ([k,v] of that.mq){
223
+		that.cnt += 1
224
+		that.cnt2 += 1
225
+		if (that.cnt2 > that.cnt_loop){
226
+			clog(that.cnt,that.cnt2,k,v)
227
+			that.cnt2= 0
228
+
229
+		}
230
+
231
+	if (should_i_stop(that,o,meta_x,v.depth)){
232
+		clog("Stopping",that.cnt,that.mx_cnt,v.depth)
233
+		return
234
+	}
235
+		clog(that.cnt,v.depth,v.path)
236
+		q_up(that,k,v)
237
+		// tobj.a.k3="!@#$%^"
238
+		// _deep_dev.mq.setD("zz2",jc(_deep_walk_dflt3))
239
+		// _deep_dev.mq.setD(k,jc(_deep_walk_dflt3))
240
+
241
+
242
+		// clog("M~",v.depth,k,v)
243
+
244
+	} 
245
+	clog("!004")
246
+	/*
247
+	for ([i,k,v] of wlk(that,o,meta,d)){
248
+		clog(d,"~",i,k,v)
249
+		_deep_dev.m.setD(v,jc(_deep_walk_dflt3))
250
+		// rdeep(that,v,meta,d+1)
251
+	}
252
+	for ([i,k,v] of wlk(that,o,meta,d)){
253
+		// clog(d,"~",i,k,v)
254
+
255
+		rdeep(that,v,meta,d+1)
256
+	}
257
+	*/
258
+
259
+}
260
+
261
+
262
+
263
+
264
+//  ["features/base/conference", "conference", "_audioAnalyser", "_vadEmitter", "_vadProcessor", "_wasmInterface", "HEAP8"]
265
+//  ["features/base/conference", "conference", "_audioAnalyser", "_vadEmitter", "_vadProcessor", "_wasmInterface", "HEAP8"]
266
+// APP.store.getState()["features/base/conference"][ "conference"][ "_audioAnalyser"][ "_vadEmitter"][ "_vadProcessor"][ "_wasmInterface"][ "HEAP8"]
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+function rdeep_init0(that,o){
303
+	var meta = {
304
+		path :[]
305
+	}
306
+	var d = 0
307
+
308
+	ometa = _deep_dev.m.get(type)
309
+
310
+		// new_obj = _deep_dev.mt.setD(v,jc(_deep_walk_dflt2))
311
+		// ometa = _deep_dev.mt.get(v)
312
+	ometa.kv.push([i,k,v])
313
+	ometa.cnt += 1
314
+
315
+
316
+	_deep_dev.m.setD(o,jc(_deep_walk_dflt3))
317
+	// _deep_dev 
318
+}
319
+
320
+
321
+
322
+function rdeep0(that,o,meta,d){
323
+	var ometa,new_obj
324
+	if (should_i_stop(that,o,meta,d)){
325
+		clog("Stopping",that.mx_cnt,d)
326
+		return
327
+	}
328
+	if (typeof(o) != "object"){
329
+		return
330
+	}
331
+	/*
332
+	if (should_i_iter(that,o,meta,d)){
333
+		clog("Stopping",that.mx_cnt,d)
334
+		return
335
+	}
336
+	*/
337
+	// let 
338
+	let i,k,v
339
+	for ([i,k,v] of wlk(that,o,meta,d)){
340
+		clog(d,"~",i,k,v)
341
+		_deep_dev.m.setD(v,jc(_deep_walk_dflt3))
342
+		// rdeep(that,v,meta,d+1)
343
+	}
344
+	for ([i,k,v] of wlk(that,o,meta,d)){
345
+		// clog(d,"~",i,k,v)
346
+
347
+		rdeep(that,v,meta,d+1)
348
+	}
349
+
350
+}
351
+
352
+
353
+
354
+function kvt2(o){
355
+	var k,v,i,cnt,ometa
356
+	var new_obj
357
+	var type 
358
+	cnt = 0
359
+	if (_deep_dev.cnt > _deep_dev.cnt){
360
+		return
361
+	}
362
+	// for ([k,v,i] of keyVal2(o)){
363
+	// for ([i,k,v] of keyVal(o)){
364
+	for ([i,k,v] of keyVal2(o)){
365
+		type = get_type_proto_(v)
366
+		if (typeof(type) == "string"){
367
+			continue
368
+		}
369
+		_deep_dev.cnt += 1
370
+
371
+		new_obj = _deep_dev.mt.setD(type,jc(_deep_walk_dflt2))
372
+		ometa = _deep_dev.mt.get(type)
373
+
374
+		// new_obj = _deep_dev.mt.setD(v,jc(_deep_walk_dflt2))
375
+		// ometa = _deep_dev.mt.get(v)
376
+		ometa.kv.push([i,k,v])
377
+		ometa.cnt += 1
378
+
379
+
380
+		// clog(cnt,i,k,v)
381
+		cnt +=1
382
+
383
+	}
384
+	_deep_dev.cnt = cnt
385
+	clog(cnt)
386
+
387
+}
388
+
389
+
390
+function kvt3(o,p,d){
391
+	var k,v,i,cnt,ometa
392
+	var new_obj
393
+	var type 
394
+	cnt = 0
395
+	// for ([k,v,i] of keyVal2(o)){
396
+	// for ([i,k,v] of keyVal(o)){
397
+	for ([i,k,v] of keyVal2(o)){
398
+		type = get_type_proto_(v)
399
+		if (typeof(type) == "string"){
400
+			// continue
401
+		}
402
+
403
+		new_obj = _deep_dev.mt.setD(type,jc(_deep_walk_dflt2))
404
+		ometa = _deep_dev.mt.get(type)
405
+
406
+		// new_obj = _deep_dev.mt.setD(v,jc(_deep_walk_dflt2))
407
+		// ometa = _deep_dev.mt.get(v)
408
+		ometa.kv.push([i,k,v])
409
+		ometa.cnt += 1
410
+
411
+
412
+		// clog(cnt,i,k,v)
413
+		cnt +=1
414
+
415
+	}
416
+	// _deep_dev.cnt = cnt
417
+	clog(cnt)
418
+
419
+}
420
+// kvt2
421
+
422
+function proto_info(m){
423
+	var i,k,v,v2
424
+	var cnt = 0
425
+	// for ([i,k,v,v2] of m){
426
+	for ([k,v] of m){
427
+		// clog(cnt,i,k,v)
428
+		// v
429
+		clog(cnt,"~",v.cnt,k,v)
430
+		cnt += 1
431
+	}
432
+}
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+function search_map(m,s){
448
+	// s = s.ti
449
+	var i,k,v
450
+	var cnt = 0
451
+	for ([k,v] of m){
452
+		// if (typeof(k) == "string" &&  k.toLowerCase().includes("tile") ){
453
+		// if (typeof(k) == "string" &&  k.toLowerCase().includes("JiC") ){
454
+		if (typeof(k) == "string" && ( k.toLowerCase().includes(s) || v.names.join().includes(s) ) ){
455
+		// if (typeof(k) == "string"  ){
456
+			clog(cnt,k,v)
457
+			cnt += 1
458
+
459
+		}
460
+	}
461
+}

+ 15
- 0
efile.js View File

@@ -0,0 +1,15 @@
1
+console.log("EFILE3")
2
+
3
+
4
+console.log(`
5
+
6
+    <div class="env_info">
7
+        
8
+        REMOTE_ADDR:<!--#echo var="REMOTE_ADDR" --><br>
9
+        indexv:<!--#echo var="indexv" --><br>
10
+        index:<!--#echo var="index" --><br>
11
+        http_referer:<!--#echo var="http_referer" --><br>
12
+    </div>
13
+	`)
14
+
15
+

+ 592
- 0
fs.css View File

@@ -0,0 +1,592 @@
1
+
2
+
3
+.tile-view #filmstripRemoteVideos {
4
+	margin: 135 0 100 0;
5
+}
6
+
7
+
8
+.vid_container {
9
+/*display:flex;*/
10
+/*flex-wrap:wrap;*/
11
+    /*align-content: center;*/
12
+    /*align-content: */
13
+    /*align-items: center;*/
14
+}
15
+
16
+
17
+.vid_container > .small_vid {
18
+	display: inline-block;
19
+/*display:flex;*/
20
+/*flex-wrap:wrap;*/
21
+    /*align-content: center;*/
22
+    /*align-content: */
23
+    /*align-items: center;*/
24
+}
25
+
26
+
27
+.at {
28
+	/*top: 100px;*/
29
+	/*left: 100px;*/
30
+	color: #fff;
31
+	border: 1px solid #fff;
32
+	box-sizing: border-box;
33
+	width: 50px;
34
+	height: 50px;
35
+	outline: 2px solid blue;
36
+	position: absolute;
37
+	border-radius: 10px;
38
+}
39
+
40
+.at:after{
41
+	position: absolute;
42
+	width: 100%;
43
+	/*height: 100%;*/
44
+	text-align: right;
45
+	align-content:space-between;
46
+	content: "aaaa:";
47
+	content: var(--vdim,"zzzq");
48
+	/*background: red;*/
49
+	padding-right: 5px;
50
+
51
+	bottom: 0;
52
+	right: 0;
53
+	/*margin-top: 100;*/
54
+	/*text-align:;*/
55
+	vertical-align: text-bottom;
56
+}
57
+
58
+
59
+.at:before{
60
+	position: absolute;
61
+	width: 100%;
62
+	right: 0;
63
+	padding-right: 5px;
64
+	/*padding-right: 5px;*/
65
+	/*height: 100%;*/
66
+	text-align: right;
67
+	align-content:space-between;
68
+	content: "aaaa:";
69
+	content: var(--vtext,"zzz");
70
+	/*background: red;*/
71
+	bottom: 2em;
72
+	/*margin-top: 100;*/
73
+	/*text-align:;*/
74
+	vertical-align: text-bottom;
75
+}
76
+
77
+.icont.z:before{
78
+	position: absolute;
79
+	width: 100%;
80
+	right: 0;
81
+	padding-right: 5px;
82
+	/*padding-right: 5px;*/
83
+	/*height: 100%;*/
84
+	text-align: right;
85
+	align-content:space-between;
86
+	content: "aaaa:";
87
+	content: var(--vtext,"zzz");
88
+	/*background: red;*/
89
+	bottom: 2em;
90
+	/*margin-top: 100;*/
91
+	/*text-align:;*/
92
+	vertical-align: text-bottom;
93
+}
94
+
95
+
96
+.at2{
97
+	outline-color: #ff0;
98
+}
99
+
100
+
101
+.a2:before {
102
+
103
+	bottom: -2em;
104
+}
105
+
106
+
107
+
108
+.small_vid{
109
+	border: 0px inset #f00;
110
+	/*border: 1px solid #f000;*/
111
+	box-sizing: content-box;
112
+	box-sizing: border-box;
113
+	margin: 4px 5px;
114
+	/*outline-offset: -139px;*/
115
+	/*padding: 10px;*/
116
+	background-clip: border-box;
117
+	background-clip: content-box;
118
+	/*position: relative;*/
119
+	/*opacity: .5;*/
120
+	outline: unset;
121
+	/*z-index: 6;*/
122
+	/*--v-index: "abc" !important;*/
123
+}
124
+.dev_filmstrip {
125
+	height: 100%;
126
+	width: 100%;
127
+	position: absolute;
128
+	display: inline-flex;
129
+    align-items: center;
130
+    justify-content: center;
131
+	/*vertical-align: middle;*/
132
+	/*position: relative;*/
133
+	/*position: absolute;*/
134
+	/*display: inline-block;*/
135
+	/*opacity: 0;*/
136
+
137
+}
138
+
139
+
140
+
141
+#filmstripRemoteVideosContainer {
142
+	opacity: .9;
143
+}
144
+
145
+.vid_container{
146
+	z-index: 6;
147
+	/*outline: unset !important;*/
148
+	/*outline: unset;*/
149
+	/*background-color: #f000 !important;*/
150
+	/*opacity: .1;*/
151
+}
152
+
153
+
154
+.c4 {
155
+	/*opacity: 0;*/
156
+}
157
+
158
+
159
+.ic4  {
160
+	/*vertical-align: */
161
+	vertical-align: middle;
162
+	text-align: center;
163
+	/*outline: 2px solid red;*/
164
+
165
+	align-items: center;
166
+	/*margin: auto;*/
167
+	display: flex;
168
+	/*flex-wrap: */
169
+}
170
+
171
+.ic4 .small_vid  {
172
+	/*align-self: center;*/
173
+	/*vertical-align: */
174
+	/*display: block;*/
175
+	display: inline-block !important;
176
+	/*margin: 0 auto;*/
177
+	margin: auto;
178
+	/*flex: 1;*/
179
+	/*margin: 10px;*/
180
+	/*margin: 0px;*/
181
+	/*align-items: center;*/
182
+}
183
+
184
+
185
+
186
+.fs_container{
187
+	position: absolute;
188
+
189
+	position: relative;
190
+	display: inline-block;
191
+	/*outline: 20px solid blue;*/
192
+	/*outline-offset: -50px;*/
193
+	/*width: 100%;*/
194
+	height: 100%;
195
+	/*padding: auto;*/
196
+	margin: auto;
197
+}
198
+
199
+#sharedVideoIFrame {
200
+	/*width: unset !important;*/
201
+	/*height: unset !important;*/
202
+	width: 100% !important;
203
+	height: 100% !important;
204
+	/*width: var(--lvw,500px);*/
205
+	/*height: 100% !important;*/
206
+
207
+}
208
+#largeVideoContainer {
209
+	/*margin: 50% 0;*/
210
+	/*width: 800px;*/
211
+	/*transform: translate(0%, -50%);*/
212
+	/*height: 300px;*/
213
+	/*vertical-align: center;*/
214
+	/*position: absolute !important;*/
215
+	/*display: inline-block;*/
216
+}
217
+#videospace{
218
+	vertical-align: center;
219
+}
220
+.vspace {
221
+	/*width: 800px;*/
222
+	/*opacity: 0;*/
223
+	/*height: 300px;*/
224
+	/*z-index: 0;*/
225
+} 
226
+.small_vid {
227
+	/*opacity: 0;*/
228
+
229
+}
230
+
231
+#etherpad {
232
+	/*z-index: -1;*/
233
+}
234
+
235
+#videospace {
236
+	--lvw: 100% !important;;
237
+}
238
+
239
+.youtube_vid {
240
+	outline: 5px dotted red;
241
+}
242
+
243
+#sharedVideoContainer {
244
+	/*sharedVideoContainer*/
245
+	/*outline: 3px solid red;*/
246
+}
247
+
248
+.ic1 {
249
+
250
+  display: flex;
251
+  justify-content: center;
252
+  /*align-items: center;*/
253
+
254
+	/*display: inline-flex;*/
255
+	/*align-items: center;*/
256
+	justify-content:center;
257
+
258
+}
259
+
260
+
261
+#largeVideoContainer {
262
+	/*width: 50%;*/
263
+}
264
+
265
+
266
+
267
+
268
+.filmstrip {
269
+	/*z-index: -1 !important;*/
270
+}
271
+
272
+#etherpad {
273
+	/*display: none !important;*/
274
+}
275
+
276
+#sharedVideo {
277
+	/*top: -10px !important;*/
278
+	/*opacity: 1 !important;*/
279
+	/*
280
+	--vtext:"center"; --vdim:" x "; opacity: 0; display: none; width: 1708px; height: 899px;
281
+
282
+	*/
283
+}
284
+
285
+
286
+
287
+#sharedVideoIFrame,#sharedVideo {
288
+	display: unset !important;
289
+	opacity: 1 !important;
290
+}
291
+
292
+#largeVideoWrapper {
293
+	width: 100% !important;
294
+	height: 100% !important;
295
+	top: 0 !important;
296
+	bottom: 0 !important;
297
+	left: 0 !important;
298
+	right: 0 !important;
299
+}
300
+
301
+.large-video-background{
302
+	display: none !important;
303
+}
304
+
305
+
306
+.indicator_hook {
307
+
308
+pointer-events: none;
309
+}
310
+
311
+
312
+.vid_toptoolbar_hook {
313
+	position: absolute;
314
+}
315
+
316
+
317
+#toggleFilmstripButton,[aria-label="Toggle tile view"] {
318
+	display: none !important;
319
+}
320
+
321
+.videocontainer__toptoolbar{
322
+	z-index: auto !important;
323
+}
324
+#sharedVideo{
325
+	/*z-index: unset !important;*/
326
+
327
+}
328
+#sharedVideoIFrame{
329
+	/*z-index: 9 !important;*/
330
+
331
+}
332
+
333
+.cont.c4{
334
+	z-index: 0;
335
+}
336
+
337
+
338
+.dev_hook:not(.vspace,.top_toolbox){
339
+	display: none;
340
+}
341
+.xbox {
342
+	display: none ;
343
+
344
+}
345
+
346
+.videoContainerFocused {
347
+	/*outline: 1px solid #0ff;*/
348
+}
349
+
350
+.active-speaker{
351
+	/*outline: 1px solid #ff0;*/
352
+
353
+}
354
+
355
+.videoContainerFocused {
356
+	/*outline: 1px solid #0ff;*/
357
+}
358
+
359
+.vid_toptoolbar_hook{
360
+	width: 100%;
361
+	/*outline: 1px solid blue;*/
362
+	/*background-color: red;*/
363
+	/*outline: 1px solid #000;*/
364
+	height: 0%;
365
+	/*padding-top: 56.25%;*/
366
+	padding-bottom: 56.25%;
367
+}
368
+
369
+
370
+
371
+
372
+
373
+.outline_indicator{
374
+	/*outline: 1px solid #0000;*/
375
+	outline: 2px solid #000;
376
+	outline: 0px solid #fff;
377
+	outline-offset: -15px;
378
+	--voffc: -3px; 
379
+	--voff:  2px;
380
+	--voffw: 2px; 
381
+	width: 100%;
382
+	height: 100%;
383
+	position: absolute;
384
+
385
+}
386
+
387
+.active-speaker .outline_indicator.ind_1{
388
+	outline-offset: 5px;
389
+	outline-offset: calc((var(--voff) * 3 ) + var(--voffc));
390
+	outline-width: var(--voffw);
391
+	outline-color: #0ff;
392
+}
393
+.videoContainerFocused .outline_indicator.ind_2{
394
+	outline-offset: 3px;
395
+	outline-offset: calc((var(--voff) * 2 ) + var(--voffc));
396
+	outline-width: var(--voffw);
397
+	outline-color: #f00;
398
+}
399
+.local_vid .outline_indicator.ind_3{
400
+	outline-offset: 1px;
401
+	outline-offset: calc((var(--voff) * 1 ) + var(--voffc));
402
+	outline-width: var(--voffw);
403
+	outline-color: #fff;
404
+}
405
+
406
+
407
+
408
+.local_vid {
409
+	/*outline: 2px solid #fff;*/
410
+}
411
+
412
+.remote-video-menu-trigger, .remotevideomenu {
413
+	z-index: 10;
414
+}
415
+
416
+
417
+.small_vid .videocontainer__toptoolbar * {
418
+	/*outline-width: 0 !important;*/
419
+}
420
+
421
+.follow_focus * {
422
+	pointer-events:auto;
423
+
424
+}
425
+.follow_focus {
426
+	z-index: 20;
427
+	position: absolute;
428
+	left: 250px;
429
+	pointer-events:auto;
430
+
431
+}
432
+
433
+.follow_focus2 {
434
+	z-index: 20;
435
+	position: absolute;
436
+	right: 100px;
437
+	pointer-events:auto;
438
+
439
+}
440
+
441
+.dev_hook.top_toolbox{
442
+	pointer-events: none;
443
+	z-index: -1;
444
+}
445
+
446
+
447
+#react > div {
448
+	/*background-color: #1B5668;*/
449
+		/*background-color: #1B3648;*/
450
+		/*background-color: #1B2638;*/
451
+		background-color: rgb(27, 38, 56);
452
+		background-color: rgb(71, 71, 71);
453
+		background-color: #374757;
454
+
455
+		/*background-color: #245;*/
456
+		/*background-color: #134;*/
457
+		/*background-color: #fff;*/
458
+
459
+	/*color: red !important;*/
460
+}
461
+.toolbox-background {
462
+	/*height: 400px !important;*/
463
+
464
+}
465
+#new-toolbox,.toolbox-background {
466
+	/*bottom: 0 !important;*/
467
+}
468
+.new-toolbox .toolbox-background {
469
+
470
+    /*background-image: linear-gradient(to top,rgba(0,0,0,.6),rgba(0,0,0,0));*/
471
+    background-image: linear-gradient(to top,rgba(0,0,0,.6),rgba(0,0,0,.4),rgba(0,0,0,.1),rgba(0,0,0,0));
472
+
473
+
474
+    --vr0: rgba(0,0,0,1);
475
+    --vr1: rgba(0,0,0,.6);
476
+    --vr2: rgba(0,0,0,.4);
477
+    --vr3: rgba(0,0,0,0);
478
+
479
+
480
+    --vr0:  rgba(0,0,0,1)  0%;
481
+    --vr1:  rgba(0,0,0,.6) 25%;
482
+    --vr2:  rgba(0,0,0,.3) 55%;
483
+    --vr3:  rgba(0,0,0,0)  100%;
484
+
485
+    background-image: linear-gradient(to top,rgba(0,0,0,1),rgba(0,0,0,.5),rgba(0,0,0,.2),rgba(0,0,0,0));
486
+    background-image: linear-gradient(to top,var(--vr0),var(--vr1),var(--vr2),var(--vr3));
487
+
488
+
489
+
490
+    /*background-image: linear-gradient(to 58%,rgba(0,0,0,1),rgba(0,0,0,0));*/
491
+}
492
+.button-group-center {
493
+	position: relative;
494
+}
495
+/*.button-group-center:before {*/
496
+.toolbox-background.z:before {
497
+	content: "";
498
+
499
+	width: 158px;
500
+	width: 178px;
501
+	top: 80px;
502
+	transform: translate(0%, -50%);
503
+	transform: translate(-50%, 0%);
504
+
505
+	left: 50%;
506
+	height: 100px;
507
+	position: absolute;
508
+	z-index: -6;
509
+	background-color: #8883;
510
+}
511
+
512
+
513
+/*.toolbox-background:after {*/
514
+.new-toolbox.z:before {
515
+	content: "";
516
+
517
+	width: 158px;
518
+	width: 178px;
519
+	top: 80px;
520
+	transform: translate(0%, -50%);
521
+	transform: translate(-50%, 0%);
522
+	top:0;
523
+	left: 50%;
524
+	height: 100px;
525
+	position: absolute;
526
+	/*z-index: -6;*/
527
+	background-color: #8883;
528
+	/*background-color: #888;*/
529
+}
530
+
531
+.button-group-center.z:before {
532
+	content: "";
533
+
534
+	width: 158px;
535
+	width: 178px;
536
+	top: -10px;
537
+	/*left: 0;*/
538
+	height: 100px;
539
+	position: absolute;
540
+	z-index: -6;
541
+	background-color: #8883;
542
+	background-color: #888;
543
+}
544
+
545
+
546
+
547
+
548
+.il {
549
+	outline: 4px inset #ff0;
550
+
551
+}
552
+
553
+.ir {
554
+	outline: 4px inset #f00;
555
+	
556
+}
557
+
558
+
559
+.ilr {
560
+	outline: 4px inset #0ff;
561
+}
562
+
563
+.ir0 {
564
+	border-radius: 30px;
565
+}
566
+
567
+.il0 {
568
+	border-radius: 30px;
569
+}
570
+
571
+
572
+.follow_focus,.follow_focus2 {
573
+	background-color: #0008;
574
+}
575
+
576
+
577
+.inline_input {
578
+	display: inline;
579
+}
580
+
581
+#ov_timeout,#num_pseudo{
582
+	width: 4em;
583
+}
584
+
585
+/*.presence-label, */
586
+.subject *{
587
+	/*overflow: visible !important;*/
588
+	/*overflow: visible;*/
589
+}
590
+.subject {
591
+	overflow: visible;
592
+}

+ 84
- 0
fs_hook.js View File

@@ -0,0 +1,84 @@
1
+
2
+
3
+
4
+
5
+function resize_filmstrips(that,fn_name,args=[]){
6
+
7
+}
8
+function resize_filmstrips2(that,fn_name,args=[]){
9
+	
10
+}
11
+
12
+
13
+glob_mx.filmstrip_handlers = glob_mx.filmstrip_handlers || {}
14
+glob_mx.filmstrip_tile_handlers = glob_mx.filmstrip_tile_handlers || {}
15
+
16
+function resizeThumbnailsForCustomView(that,fn_name,args=[]){
17
+    const thumbs = glob_react.Filmstrip._getThumbs()
18
+    const all_thumbs = $(".small_vid")
19
+    const custom_thumbs = all_thumbs.not(thumbs.remlocThumbs)
20
+    const vid_containers = $(".vid_container")
21
+    const loose_thumbs = custom_thumbs.not(vid_containers.children())
22
+    var k,v 
23
+    let fs_handler_key
24
+    let fs_handler 
25
+    let fs_tile_handler
26
+    let fs_handlers = new Map()
27
+    let i
28
+    // console.trace("rtscv...")
29
+
30
+    let fs_tile_handlers = []
31
+    for (v of vid_containers){
32
+      // clog(":",v,v.dataset.fs_type)
33
+      fs_handler_key = v.dataset.fs_handler
34
+      // clog("~",v,v.dataset,fs_handler)
35
+      fs_tile_handler = glob_mx.filmstrip_tile_handlers[fs_handler_key] || nop
36
+      fs_handler = glob_mx.filmstrip_handlers[fs_handler_key] || nop
37
+      // glob_mx.filmstrip_tile_handlers[fs_handler_key] ? glob_mx.filmstrip_tile_handlers[fs_handler_key](v) : 1
38
+      // fs_tile_handlers.push([glob_mx.filmstrip_tile_handlers[fs_handler_key] || nop,v])
39
+      // fs_handlers.setD(glob_mx.filmstrip_handlers[fs_handler_key] || nop,)
40
+      fs_tile_handlers.push([fs_tile_handler,v])
41
+      fs_handlers.setD(fs_handler,[])
42
+      i = fs_handlers.get(fs_handler)
43
+      i.push(v)
44
+
45
+      // glob_mx.filmstrip_handlers
46
+    }
47
+    clog("fs_tile_handlers",fs_tile_handlers)
48
+    for ([k,v] of fs_handlers){
49
+    	// clog("ft0",k,v)
50
+    	k(v)
51
+    }
52
+    for ([k,v] of fs_tile_handlers){
53
+    	// clog("ft",k,v)
54
+    	k(v)
55
+
56
+    }
57
+
58
+
59
+    // return
60
+    // const custom_thumbs = all_thumbs
61
+
62
+    var aspect = 16/18
63
+    var width = 135
64
+    var height = Math.round(width/aspect)
65
+    loose_thumbs.css({
66
+      'padding-top': '',
67
+      "min-height": `${height}px`,
68
+      "min-width": `${width}px`,
69
+      width: `${width}px`,
70
+      height: `${height}px`,
71
+    })
72
+
73
+    clog("rtscv",fn_name,[that,...args])
74
+
75
+
76
+}
77
+
78
+
79
+
80
+
81
+
82
+function onover(){
83
+	clog(this,[...arguments])
84
+}

+ 85
- 0
i4/i11.html View File

@@ -0,0 +1,85 @@
1
+<html itemscope itemtype="http://schema.org/Product" prefix="og: http://ogp.me/ns#" xmlns="http://www.w3.org/1999/html">
2
+  <head>
3
+    <!--#include virtual="head.html" -->
4
+    <meta charset="utf-8">
5
+    <meta http-equiv="content-type" content="text/html;charset=utf-8">
6
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+    <!--#include virtual="base.html" -->
8
+
9
+    <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
10
+    <link rel="stylesheet" href="css/all.css">
11
+
12
+
13
+
14
+    <script class="rld" src="ign/rf/u/universals.js?c=023"></script>
15
+    <script class="" src="ign/rf/u/proto_ext.js?c=023"></script>
16
+    
17
+    <script class="rld" src="ign/rf/inspect_utils.js?c=023"></script>
18
+
19
+    <script class="rld" src="ign/rf/preload.js?c=023"></script>
20
+    <script class="rld" src="ign/rf/keyboard_dev_fn.js?c=023"></script>
21
+    <script class="rld" src="ign/rf/m/m_req.js?c=023"></script>
22
+
23
+
24
+    <!-- <script class="rld" src="ign/rf/proxy_dev.js?c=023"></script> -->
25
+
26
+    <!-- <script class="rld" src="ign/rf/quick_tiling_fix.js?c=023"></script> -->
27
+
28
+
29
+
30
+
31
+
32
+
33
+      <script class="" src="inline_script.js"></script>
34
+    <script><!--#include virtual="/config.js" --></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
35
+    <!--#include virtual="connection_optimization/connection_optimization.html" -->
36
+    <script src="libs/do_external_connect.min.js?v=1"></script>
37
+    <script><!--#include virtual="/interface_config.js" --></script>
38
+    <!-- 
39
+    <script><!--#include virtual="/interface_config_dev.js" --></script>
40
+     -->
41
+
42
+      <script class="rld" src="ign/rf/m2/interface_config_dev.js"></script>
43
+    <script><!--#include virtual="/logging_config.js" --></script>
44
+    <script src="libs/lib-jitsi-meet.min.js?v=139"></script>
45
+    <script src="libs/app.bundle.min.js?v=139"></script>
46
+
47
+
48
+    <script src="rldjs/rldjs2.js?v=139"></script>
49
+    <script class="rld rrld" src="ign/rls.js?c=023"></script>
50
+
51
+    <script class="rld" src="ign/rf/react_fn.js?c=023"></script>
52
+    <script class="rld" src="ign/rf/jquery.corner.js?c=023"></script>
53
+    <script class="rld" src="ign/rf/fake_resize.js?c=023"></script>
54
+
55
+    <script class="rld" src="ign/rf/m/_m_utils.js?c=023"></script>
56
+    <script class="rld" src="ign/rf/m/m_utils.js?c=023"></script>
57
+    <script class="rld" src="ign/rf/m/m_api.js?c=023"></script>
58
+
59
+    <script class="rld" src="ign/rf/m/moveto.js?c=023"></script>
60
+    <script class="rld" src="ign/rf/fs_hook.js?c=023"></script>
61
+    <script class="rld" src="ign/rf/resize_hook.js?c=023"></script>
62
+    <script class="rld" src="ign/rf/class_dec.js?c=023"></script>
63
+    <script class="rld" src="ign/rf/svm.js?c=023"></script>
64
+
65
+    <script class="rld" src="ign/rf/m2/m2.js?c=023"></script>
66
+    <script class="rld" src="ign/rf/m2/toy2.js?c=023"></script>
67
+
68
+    <link class="rld" rel="stylesheet" href="ign/rf/m2/m2.css?c=023">
69
+    <link class="rld" rel="stylesheet" href="ign/rf/r0.css?c=023">
70
+    <link class="rld" rel="stylesheet" href="ign/rf/fs.css?c=023">
71
+    <!--#include virtual="title.html" -->
72
+    <!--#include virtual="plugin.head.html" -->
73
+    <!--#include virtual="static/welcomePageAdditionalContent.html" -->
74
+    <!--#include virtual="static/settingsToolbarAdditionalContent.html" -->
75
+  <meta class="m0 module">
76
+
77
+  </head>
78
+  <body>
79
+    <!--#include virtual="body.html" -->
80
+    <div id="react"></div>
81
+    <!-- CT  11 4-->
82
+  </body>
83
+</html>
84
+
85
+

+ 51
- 0
i4/lobby.js View File

@@ -0,0 +1,51 @@
1
+clog("L1")
2
+
3
+// clog(navigator)
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+function insert_lobby() {
20
+	// body...
21
+	clog("This is lobby2")
22
+var mod_path ="ign/rf/i4m/"
23
+
24
+mtx_2 ={	
25
+	// js:["ign/m/timer/m.js","ign/m/timer/m0.js"],
26
+	js:[`${mod_path}m0.js`,`${mod_path}m.js`,],
27
+	css:[`${mod_path}m.css`],
28
+	html:[{url:`${mod_path}m.html`,diffH:get_cui_html,success:html_rld_cb4,success_js:"html_js_handler_lobby"}]
29
+	}
30
+
31
+	setTimeout(add_module,300,mtx_2)
32
+
33
+
34
+
35
+}
36
+
37
+
38
+
39
+
40
+
41
+if (location.pathname.endsWith("/")){
42
+insert_lobby()
43
+}
44
+
45
+
46
+
47
+// setTimeout(add_module,300,mtx)
48
+
49
+
50
+
51
+

+ 38
- 0
inspect_utils.js View File

@@ -0,0 +1,38 @@
1
+
2
+
3
+function jclone(obj){
4
+	// clog("JC")
5
+	return Array.isArray(obj) ?  $.extend(true,[],obj) :  $.extend(true,{},obj)
6
+	console.trace("JC")
7
+	return JSON.parse(JSON.stringify(obj))
8
+	return Array.isArray(obj) ?  $.extend(true,[],obj) :  $.extend(true,{},obj)
9
+}
10
+function jx(obj){
11
+	// clog("JC")
12
+	// console.trace("JC")
13
+	return JSON.parse(JSON.stringify(obj))
14
+	// return Array.isArray(obj) ?  $.extend(true,[],obj) :  $.extend(true,{},obj)
15
+	// return Array.isArray(obj) ?  $.extend(true,[],obj) :  $.extend(true,{},obj)
16
+}
17
+jc = jclone
18
+
19
+// gcx = jx(glob_corner)
20
+// gcc = jc(glob_corner)
21
+function q_walker_h(o,m,max_depth) {
22
+	// body...
23
+}
24
+
25
+function q_walker(o,m,depth,max_depth) {
26
+	if (depth > max_depth){
27
+		return
28
+	}
29
+	// body...
30
+}
31
+
32
+
33
+
34
+
35
+
36
+// console.log("IU")
37
+
38
+

+ 10
- 0
junk_dev View File

@@ -0,0 +1,10 @@
1
+
2
+
3
+
4
+function event_test(){
5
+
6
+            tmsgx({
7
+                "type":"event",
8
+                "payload":'{path,key,val}',
9
+            },"code")
10
+}

+ 253
- 0
junk_dev.js View File

@@ -0,0 +1,253 @@
1
+
2
+
3
+
4
+function event_test(){
5
+
6
+            tmsgx({
7
+                "type":"event",
8
+                "payload":'{path,key,val}',
9
+            },"code")
10
+}
11
+
12
+
13
+function event_test(){
14
+
15
+            tmsgx({
16
+                "type":"event",
17
+                "payload":'{path,key,val}',
18
+            },"code")
19
+}
20
+
21
+
22
+function all_plugin_events(e){
23
+	// clog("all_plugin_events",[this],[...arguments])
24
+}
25
+
26
+
27
+glob_mx.event_handlers.e1 = {
28
+	fn:all_plugin_events,
29
+	fn:nop,
30
+	// m:{etype:"timer_start"},
31
+	m:{},
32
+}
33
+
34
+
35
+
36
+glob_mx.event_handlers.e2 = {
37
+	fn:all_plugin_events,
38
+	fn:nop,
39
+	// m:{etype:"timer_start"},
40
+	m:{etype:"z"},
41
+}
42
+
43
+function sort_id(a, b) {
44
+	return a > b
45
+	/*
46
+  if (a is less than b by some ordering criterion) {
47
+    return -1;
48
+  }
49
+  if (a is greater than b by the ordering criterion) {
50
+    return 1;
51
+  }
52
+  // a must be equal to b
53
+  return 0;
54
+	*/
55
+}
56
+function sort_id2(a, b) {
57
+	return a < b
58
+}
59
+
60
+function sort_id3(a, b) {
61
+	if (a.id > b.id){
62
+		return 1
63
+	} else if (a.id < b.id){
64
+		return -1
65
+	}
66
+	return 0
67
+}
68
+
69
+
70
+
71
+indexed_tiles = []
72
+// indexed_map=0
73
+// reverse_indexed_map=0
74
+indexed_map = window.indexed_map || new Map()
75
+reverse_indexed_map = window.reverse_indexed_map || new Map()
76
+
77
+
78
+
79
+function array_move(arr, old_index, new_index) {
80
+    if (new_index >= arr.length) {
81
+        var k = new_index - arr.length + 1;
82
+        while (k--) {
83
+            arr.push(undefined);
84
+        }
85
+    }
86
+    arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
87
+    return arr; // for testing
88
+};
89
+
90
+
91
+
92
+function mod_sort(){
93
+	// if (amimod()){} else {return}
94
+	var arr = []
95
+	var ivid = {}
96
+	var k,v
97
+	var j = $(".small_vid:not(.pseudo_vid)")
98
+	// clog(j)
99
+	var part = get_participants()
100
+	var parts =jc(part).sort(sort_id3)
101
+	// clog(parts,part)
102
+	var cnt = 0
103
+	for (k of parts){
104
+		// clog(k)
105
+		j = k.local ? $("#localVideoContainer") : $(`#participant_${k.id}`)
106
+		j.css({"--v_index":`"I: ${cnt}"`})
107
+		j.css({"--v_id":`"${k.id}"`})
108
+		j[0].dataset.v_index = cnt
109
+		arr.push(j[0])
110
+		cnt += 1
111
+	}
112
+	v = $(".pseudo_vid")
113
+	for (k of v){
114
+		// clog(k)
115
+		$(k).css({"--v_index":`"I: ${cnt}"`})
116
+		$(k).css({"--v_id":`"pseudo_${cnt}"`})
117
+		arr.push(k)
118
+		$(k)[0].dataset.v_index = cnt
119
+		cnt += 1
120
+	}
121
+	remap_sort(arr)
122
+	window.sorted_tiles = arr
123
+
124
+
125
+
126
+
127
+
128
+	// for 
129
+}
130
+
131
+function remap_sort(arr){
132
+	var k,v
133
+	for ([k,v] of indexed_map){
134
+		// clog(k,v)
135
+		var old_index = sorted_tiles.indexOf(k)
136
+		array_move(arr,old_index,v)
137
+
138
+		// clog(cnt,sorted_tiles.includes(k),v,k)
139
+		// cnt += 1
140
+
141
+	}
142
+
143
+}
144
+
145
+function remap_set(vid,loc){
146
+	if (typeof(vid)=="number"){
147
+		vid = sorted_tiles[vid]
148
+	}
149
+	var old = reverse_indexed_map.get(loc)
150
+	// reverse_indexed_map
151
+	indexed_map.delete(old,loc)
152
+	indexed_map.set(vid,loc)
153
+	reverse_indexed_map.set(loc,vid)
154
+	var k,v
155
+	var cnt = 0 
156
+	for ([k,v] of indexed_map){
157
+		// clog(k,v)
158
+		clog(cnt,sorted_tiles.includes(k),v,k)
159
+		cnt += 1
160
+
161
+	}
162
+
163
+}
164
+
165
+// sort_results = []
166
+sort_results = new Map()
167
+
168
+function test_sort(){
169
+	// if (amimod()){} else {return}
170
+	var arr = []
171
+	var ivid = {}
172
+	var k,v
173
+	var j = $(".small_vid:not(.pseudo_vid)")
174
+	// clog(j)
175
+	var part = get_participants()
176
+	var p1 = jc(part)
177
+	var parts =jc(part).sort(sort_id3)
178
+	// clog(parts,part)
179
+	var cnt = 0
180
+	var ret = {
181
+		arr:[],
182
+		arr_id:[],
183
+		arr_j:[],
184
+	}
185
+	var i
186
+	for (k of parts){
187
+		// clog(k)
188
+		j = k.local ? $("#localVideoContainer") : $(`#participant_${k.id}`)
189
+		// j.css({"--v_index":`"I2: ${cnt}"`})
190
+		// j[0].dataset.v_index = cnt
191
+		ret.arr.push(k)
192
+		ret.arr_j.push(j)
193
+		ret.arr_id.push(k.id)
194
+
195
+		cnt += 1
196
+	}
197
+	v = $(".pseudo_vid")
198
+	for (k of v){
199
+		// clog(k)
200
+		// $(k).css({"--v_index":`"I2: ${cnt}"`})
201
+		// j[0].dataset.v_index = cnt
202
+		cnt += 1
203
+	}
204
+		sort_results.setD(JSON.stringify(ret.arr_id),{c:0})
205
+		i = sort_results.get(JSON.stringify(ret.arr_id))
206
+		i.c += 1
207
+
208
+	clog(sort_results)
209
+	return ret
210
+
211
+
212
+
213
+
214
+
215
+	// for 
216
+}
217
+
218
+
219
+
220
+
221
+a1 = [2,54,2.5,"a","b"]
222
+a1 = ["2","_54","2.5","zas","AA","","xyz","a","b"]
223
+a2 = ["2","_54","2.5","zas","AA","","xyz","b","a"]
224
+
225
+
226
+mod_sort()
227
+
228
+
229
+
230
+
231
+
232
+
233
+function quick_layout(){
234
+    init_api6()
235
+    // calc_fs_dims0()
236
+    calc_fs_dims()
237
+    // setTimeout(quick_layout2,1000)
238
+    new_move()
239
+    mod_sort()
240
+    dispatch_resize()
241
+
242
+}
243
+function quick_layout2(){
244
+    // init_api6()
245
+    // calc_fs_dims0()
246
+    // calc_fs_dims()
247
+    new_move()
248
+    mod_sort()
249
+    dispatch_resize()
250
+
251
+}
252
+
253
+quick_layout()

+ 302
- 0
m/_m_utils.js View File

@@ -0,0 +1,302 @@
1
+
2
+
3
+
4
+
5
+if (!window.glob_mx){
6
+	// window.glob_mx={}
7
+}
8
+
9
+
10
+
11
+
12
+
13
+/*
14
+msto_qx = {
15
+	local:{},
16
+	conference:{},
17
+	participant:{},
18
+}
19
+
20
+
21
+
22
+msto_qx = {
23
+	private_local:{},
24
+	participant_local:{},
25
+	conference:{},
26
+	participant:{
27
+		'<id_0>':{},
28
+		'<id_1>':{},
29
+		'<id_...>':{},
30
+		'<id_n>':{
31
+			rkey:{},
32
+		},
33
+
34
+	},
35
+}
36
+*/
37
+mhndlr_opt_null = {
38
+from: undefined,
39
+handler: "onAll",
40
+id: null,
41
+name: null,
42
+// "http://jitsi.org/jitmeet"
43
+ns: null,
44
+options: {matchBareFromJid: false, ignoreNamespaceFragment: false},
45
+type: null,
46
+user: true,
47
+cstr:"test"
48
+};
49
+// cstr:"onMsgx"
50
+
51
+
52
+
53
+mhndlr_opt_x = {
54
+	cstr:"?",
55
+	ns:"corner_mx",
56
+	handler:mhndlr,
57
+
58
+}
59
+function rtrue(){
60
+	// clog("rtrue...",this,arguments)
61
+	// console.trace("rtrue")
62
+	return true
63
+}
64
+function rtrue2(){
65
+	clog("rtrue2...",this,arguments)
66
+	// console.trace("rtrue2")
67
+	return true
68
+}
69
+function rtrue3(){
70
+	clog("rtrue3...",this,arguments)
71
+	// console.trace("rtrue2")
72
+	allevnt(...arguments)
73
+	return true
74
+}
75
+mhndlr_opt_x_all = {
76
+	cstr:"?",
77
+	ns:"jabber:client",
78
+	// name:"message",
79
+	type:"groupchat",
80
+	handler:allevnt,
81
+	// isMatch:rtrue2,
82
+	// run:rtrue3,
83
+	// namespaceMatch:rtrue,
84
+
85
+
86
+}
87
+
88
+function add_handler_m(argument) {
89
+	// minit()
90
+	// if (!th.phx){
91
+		// th.
92
+	// }
93
+		// var phx = APP.conference._room.room.connection.handlers[0].__proto__;
94
+		var phx = APP.connection.xmpp.connection._stropheConn.handlers[0].__proto__;
95
+
96
+	var hxa=Object.create(phx)
97
+	Object.assign(hxa,mhndlr_opt_null,mhndlr_opt_x)
98
+	// APP.conference._room.room.connection.handlers.push(hxa)
99
+	APP.connection.xmpp.connection._stropheConn.addHandlers.push(hxa)
100
+	// th.hxa=hxa
101
+	// th.hx
102
+	// body...
103
+}
104
+function add_handler_m2(argument) {
105
+	clog("ADD HANDLER M2")
106
+	// minit()
107
+	// if (!th.phx){
108
+		// th.
109
+	// }
110
+		// var phx = APP.conference._room.room.connection.handlers[0].__proto__;
111
+		var phx = APP.connection.xmpp.connection._stropheConn.handlers[0].__proto__;
112
+
113
+	var hxa=Object.create(phx)
114
+	Object.assign(hxa,mhndlr_opt_null,mhndlr_opt_x_all)
115
+	// APP.conference._room.room.connection.handlers.push(hxa)
116
+	APP.connection.xmpp.connection._stropheConn.addHandlers.push(hxa)
117
+	return hxa
118
+	// th.hxa=hxa
119
+	// th.hx
120
+	// body...
121
+}
122
+
123
+function tmsgx(data,tag="div",attrs={}){
124
+	// return
125
+	var ns = {xmlns:"corner_mx"}
126
+	var msg = $build("message",{ to: window.APP.conference._room.room.roomjid,
127
+            type: 'groupchat',
128
+             });
129
+	var payload=JSON.stringify(data)
130
+
131
+	Object.assign({},ns,attrs)
132
+
133
+	msg.c(tag, payload,Object.assign({},ns,attrs)).up();
134
+	console.log("zzzz")
135
+	APP.conference._room.room.connection.send(msg)
136
+}
137
+
138
+
139
+
140
+function tmsgx2(data,opt_arg={},attrs={}){
141
+	// return
142
+	dflt_opt = {
143
+	tag:"code",
144
+	type:"chat",
145
+	to:window.APP.conference._room.room.roomjid,
146
+	}
147
+	var opt = Object.assign({},dflt_opt,opt_arg)
148
+
149
+	var ns = {xmlns:"corner_mx"}
150
+	var msg = $build("message",{ to: opt.to,
151
+            type: opt.type,
152
+             });
153
+	var payload=JSON.stringify(data)
154
+
155
+	Object.assign({},ns,attrs)
156
+
157
+	msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
158
+	console.log("zzzz")
159
+	APP.conference._room.room.connection.send(msg)
160
+}
161
+function tmsgx3(data,opt_arg={},attrs={}){
162
+	// return
163
+	dflt_opt = {
164
+	tag:"code",
165
+	// type:"chat",
166
+	to:window.APP.conference._room.room.roomjid,
167
+	}
168
+	var opt = Object.assign({},dflt_opt,opt_arg)
169
+	clog("T:",data,opt,opt.type)
170
+	if (!opt.type){
171
+		clog("NO TYPE")
172
+	opt.to == dflt_opt.to ? opt.type = "groupchat" : opt.type = "chat"
173
+	}
174
+	clog("T:",data,opt,opt.type)
175
+
176
+	var ns = {xmlns:"corner_mx"}
177
+	var msg = $build("message",{ to: opt.to,
178
+            type: opt.type,
179
+            // from: "nnnx@conference.jfidev.com/3db7bf15",
180
+            // xtra: "nnnx@conference.jfidev.com/3db7bf15",
181
+             });
182
+	var payload=JSON.stringify(data)
183
+
184
+	Object.assign({},ns,attrs)
185
+
186
+	msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
187
+	console.log("zzzz")
188
+	APP.conference._room.room.connection.send(msg)
189
+}
190
+
191
+function mhndlr_rld_dflt(a0,a1,a2,a3,a4){
192
+	// clog("mhndlr....",a0,a1,a2)
193
+	clog("mhndlr... dflt")
194
+	// setTimeout(window.onAll_rld_v2,1,this,a0,a1,a2,a3,a4)
195
+	return true
196
+}
197
+if (!window.mhndlr_rld){
198
+	window.mhndlr_rld = mhndlr_rld_dflt
199
+}
200
+function mhndlr(a0,a1,a2,a3,a4){
201
+	// clog("MH!")
202
+	setTimeout(window.mhndlr_rld,1,this,a0,a1,a2,a3,a4)
203
+	return true
204
+}
205
+function allevnt(a0,a1,a2,a3,a4){
206
+	clog("MH! allevnt")
207
+	setTimeout(window.allevnt_rld,1,this,a0,a1,a2,a3,a4)
208
+	return true
209
+}
210
+function rld_room(room){
211
+	clog("rld_room...",room)
212
+	window.location.assign(room)
213
+}
214
+function allevnt_rld(a0,a1,a2,a3,a4){
215
+	// clog("MH!")
216
+	// clog("allevnt_rld",a0,a1,a2,a3,a4)
217
+
218
+	var msg = a1.querySelector(`body`)
219
+	if (!msg){
220
+		return
221
+	}
222
+	// clog("allevnt_rld...",a1)
223
+
224
+
225
+	// clog("allevnt_rldw",_from.split("/").pop())
226
+	// clog(msg)
227
+	// return
228
+	// @Joseph-Innace
229
+	// clog(msg.innerHTML)
230
+	var msg_txt = msg.innerHTML 
231
+	if (msg_txt.startsWith("moveto=")){
232
+		var room = msg_txt.split("=").pop()
233
+		if (room){
234
+	var _from = a1.getAttribute("from").split("/").pop()
235
+	if (get_local().id == _from){
236
+		rld_room(room)
237
+	} else {
238
+		setTimeout(rld_room,2000,room)
239
+
240
+	}
241
+	// get_local().id
242
+
243
+		}
244
+
245
+		// clog("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",msg_txt.split("~"),msg_txt.split("~").pop())
246
+	} 
247
+	// clog($(a1))
248
+	// clog("z",$(a1)[0].innerHTML)
249
+
250
+	// setTimeout(window.mhndlr_rld,1,this,a0,a1,a2,a3,a4)
251
+	return true
252
+}
253
+/*
254
+
255
+delete Root_io
256
+{
257
+
258
+class Root_io {
259
+	constructor(){}
260
+	_pub_msg(m){
261
+		clog("ixi PUB MSG",m)
262
+	}
263
+	_rec_msg(m){
264
+		clog("ixi REC MSG",m)
265
+	}
266
+}
267
+window.Root_io = Root_io
268
+}
269
+*/
270
+// function allevnt(){
271
+
272
+// }
273
+clog("ZZZZZZZZZ")
274
+function init_mx(){
275
+	clog("INITMX3")
276
+	add_handler_m(mhndlr)
277
+	add_handler_m2(allevnt)
278
+}
279
+
280
+ifn_obj.init_conf_join.push(init_mx)
281
+
282
+
283
+
284
+// sto_event
285
+// sto_update
286
+
287
+
288
+// pub_msg
289
+// rec_msg
290
+
291
+
292
+// set_local
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+

+ 311
- 0
m/m_api.js View File

@@ -0,0 +1,311 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+function get_cui_html(file) {
11
+	clog("get_cui_html",this,arguments)
12
+	// console.trace("~IX~ ixr")
13
+	clog("~IX~ ixr")
14
+	// for (var file of this.arr){
15
+		var aii 
16
+		aii= $.ajax({
17
+			// url: "ign/cui.html",
18
+			url: file.url,
19
+			// data: file.qs,
20
+			cache:false,
21
+			// complete:complete_html,
22
+			success: file.success || proc_cui_html,
23
+			// error: err_html,
24
+			// dataType: "text"
25
+			dataType: "html"
26
+		})
27
+		aii.file = file
28
+		// aii.rldh=file
29
+	// }
30
+}
31
+
32
+
33
+
34
+function cui_respH(){
35
+	clog("cui_respH")
36
+}
37
+
38
+function cui_diffH(file){
39
+	clog("cui_diffH",this,arguments)
40
+	// get_cui_html(file)	
41
+}
42
+
43
+
44
+
45
+
46
+
47
+
48
+function proc_cui_html(rsp,status,xhr){
49
+	clog("proc_cui_html",this,arguments)
50
+	/*
51
+	gxh.success = {
52
+		that:this,
53
+		rsp,status,xhr,
54
+		args:arguments,
55
+	}
56
+	*/
57
+	// insert_cui_html(rsp)
58
+	// rsp
59
+}
60
+function insert_cui_html(innerHTML){
61
+	window.cui_html = innerHTML
62
+	t5i2.crnr_init()
63
+	// t5i2.crnr_refresh()
64
+
65
+	// var n
66
+	//  n = document.createElement("div")
67
+	// n = document.querySelector("#xh_root")
68
+	// n ? n.innerHTML = innerHTML : 0
69
+	// event_html(n)
70
+}
71
+
72
+
73
+function dflt_api_handler(){
74
+	clog("dflt_api_handler NOT IMPLIMENTED")
75
+}
76
+
77
+function add_rld_html(){
78
+	// js files
79
+	// html
80
+	// css
81
+
82
+
83
+
84
+
85
+rldi.files["ign/m/timer/rhtml.html"]=  {url: "ign/m/timer/rhtml.html",
86
+ qs: {v:1}, respH: cui_respH, diffH: cui_diffH,
87
+ cached:"z z",
88
+ success:proc_cui_html,
89
+}
90
+
91
+
92
+
93
+}
94
+
95
+
96
+
97
+
98
+
99
+
100
+// jsrh
101
+// cssrh
102
+api_dflts = {
103
+	dflt:reqt,
104
+	js:{
105
+		diffH:jsrh,
106
+		// diffH:jsrh,
107
+		qs:{v:1},
108
+	},
109
+	css:{
110
+		diffH:cssrh,
111
+		qs:{v:1},
112
+
113
+	},
114
+	html:{
115
+
116
+		diffH:html_rld_cb,
117
+		qs:{v:1},
118
+	},
119
+}
120
+
121
+
122
+api_test = {}
123
+
124
+// <script class="rld" src="ign/m/m_api.js?c=023"></script>
125
+function insert_js(file){
126
+	var n = document.createElement("SCRIPT")
127
+	n.classList.add("rld")
128
+	n.src=file.url + "?_="+new Date().getTime()
129
+	// n.rel="stylesheet"
130
+	$(`script.rld[src^="`+file.url+`"]`).remove()
131
+	$(".m0.module").after(n)
132
+}
133
+function insert_css(file){
134
+	var url = file.url
135
+	var n = document.createElement("LINK")
136
+	n.classList.add("rld")
137
+	n.href=file.url + "?_="+new Date().getTime()
138
+	n.rel="stylesheet"
139
+	 $(`link.rld[href^="`+file.url+`"]`).remove()
140
+	$(".m0.module").after(n)
141
+}
142
+function html_rld_cb(){
143
+	clog("html_rld_cb!")
144
+
145
+}
146
+
147
+
148
+function html_rld_cb2(){
149
+	clog("html_rld_cb2!",this,[...arguments])
150
+
151
+}
152
+function html_rld_cb3(){
153
+	clog("html_rld_cb3!",this,[...arguments])
154
+}
155
+function html_rld_cb4(rsp,status,xhr){
156
+	clog("html_rld_cb4!",this,[...arguments])
157
+	// window[this.success_js](rsp,status,xhr)
158
+	window[xhr.file.success_js](rsp,status,xhr)
159
+}
160
+
161
+
162
+function register_rld(file){
163
+	clog("RR",file)
164
+	file.cached = rls[file.url]
165
+	rldi.files[file.url] =  file
166
+
167
+}
168
+
169
+
170
+window.qto_stop = 0
171
+window.qto_cnt = 0
172
+function qto_init(){
173
+	window.qto_stop = 0
174
+window.qto_cnt = 0
175
+	// setTimeout(qto_stop_fn,1000)
176
+	setTimeout(qto_stop_fn,100)
177
+	qto()
178
+
179
+}
180
+function qto_stop_fn(){
181
+	clog("qto_stop_fn")
182
+	window.qto_stop =1
183
+}
184
+function qto(){
185
+	clog("QTO",window.qto_cnt)
186
+	// clog("QTO",window.qto_cnt,$(`script.rld[src^="ign/m/timer/m.js"]`))
187
+	window.qto_cnt += 1
188
+	if (!window.qto_stop){
189
+		setTimeout(qto,1)
190
+	}
191
+
192
+}
193
+
194
+
195
+
196
+	// $(`script.rld[src^="ign/m/timer/m.js"]`).remove()
197
+	// ign/m/timer/m.js
198
+
199
+
200
+
201
+
202
+// mtx ={js:["ign/m/timer/m.js"],css:["ign/m/timer/m.css"],html:["ign/m/timer/m.html"]}
203
+// mtx ={js:["ign/m/timer/m.js"],css:["ign/m/timer/m.css"],html:[{url:"ign/m/timer/m.html",diffH:html_rld_cb2,success:html_rld_cb4,}]}
204
+mtx ={	
205
+	// js:["ign/m/timer/m.js","ign/m/timer/m0.js"],
206
+	js:["ign/m/timer/m0.js","ign/m/timer/m.js",],
207
+	css:["ign/m/timer/m.css"],
208
+	html:[{url:"ign/m/timer/m.html",diffH:get_cui_html,success:html_rld_cb4,success_js:"html_js_handler"}]
209
+	}
210
+
211
+function add_module(o){
212
+	var k,v
213
+	let file 
214
+		// qto_init()
215
+		// file = jclone(api_dflts.css)
216
+	for (k of o.css || []){
217
+		if (typeof(k) == "string"){
218
+			 file = $.extend(true,{},api_dflts.css, {url:k})
219
+		} else {
220
+			 file = $.extend(true,{},api_dflts.css, k)
221
+		}
222
+		// file = jclone(api_dflts.css)
223
+		// file.url = k
224
+
225
+		register_rld(file)
226
+		insert_css(file)
227
+
228
+		api_test[file.url]=file
229
+		clog("~",k)
230
+	}
231
+	for (k of o.js || []){
232
+		if (typeof(k) == "string"){
233
+			 file = $.extend(true,{},api_dflts.js, {url:k})
234
+		} else {
235
+			 file = $.extend(true,{},api_dflts.js, k)
236
+		}
237
+		// file = jclone(api_dflts.js)
238
+		// file.url = k
239
+
240
+		register_rld(file)
241
+		insert_js(file)
242
+
243
+		api_test[file.url]=file
244
+		clog("~",k)
245
+	}
246
+	for (k of o.html || []){
247
+		if (typeof(k) == "string"){
248
+			 file = $.extend(true,{},api_dflts.html, {url:k})
249
+		} else {
250
+			 file = $.extend(true,{},api_dflts.html, k)
251
+		}
252
+		// file = jclone(api_dflts.html)
253
+		// file.url = k
254
+		register_rld(file)
255
+		api_test[file.url]=file
256
+		clog("~",k)
257
+		rfile = file
258
+		get_cui_html(file)
259
+	}
260
+	/*
261
+	// clog()
262
+	var css_url = "ign/m/timer/m.css"
263
+	var css_file = {
264
+		url:css_url,
265
+		diffH:cssrh,
266
+		qs:{v:1},
267
+	}
268
+	rldi.files[css_file.url] =  css_file
269
+	// var n = document.createElement("LINK")
270
+	// n.classList.add("rld")
271
+	// n.href=css_url + "?_="+new Date().getTime()
272
+	// n.rel="stylesheet"
273
+	// $(".m0.module").after(n)
274
+
275
+	// n.class="rld"
276
+
277
+	// return n
278
+
279
+	*/
280
+	    // <link class="rld" rel="stylesheet" href="ign/r0.css?c=023">
281
+	// rldi.files[css_file.url] =  css_file
282
+	// insert_css()
283
+
284
+}
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+// get_cui_html(rfile)
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+setTimeout(add_module,300,mtx)
309
+
310
+
311
+// add_module(mtx )

+ 239
- 0
m/m_api_html.js View File

@@ -0,0 +1,239 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+// insert
12
+
13
+
14
+// insert
15
+
16
+
17
+
18
+// small_video after
19
+// small_video ui
20
+// psudo_small_video
21
+
22
+// location ui
23
+// psudo location ui
24
+
25
+
26
+
27
+// small_video_toolbar
28
+
29
+
30
+// pseudo_small_video
31
+// small_video_ui
32
+// small_video_after
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+function init_api0(){
41
+	$(".plugin_top").remove()
42
+	var n
43
+	n = `<div class="plugin_top"><div class="m">ABC</div></div>`
44
+	// n = `<span class="plugin_top"><div class="m">ABC</div></span>`
45
+	n = `<span class="plugin_top pseudo_vid small_vid"><span class="m">ABC</span></span>`
46
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"></span>`
47
+	n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"><span class="m">ABC</span></span>`
48
+
49
+	// add_node(n,`.small_vid`,"append")
50
+	// add_node(n,`.small_vid`,"after")
51
+	// add_node(n,`.jdiv`,"append")
52
+	// add_node(n,`.cont.c1`,"append")
53
+
54
+}
55
+
56
+// vroot.vproc.sizes
57
+
58
+
59
+// toolbox-content
60
+// button-group-left
61
+// button-group-center
62
+// button-group-right
63
+// toolbox-button
64
+
65
+function init_api(){
66
+	$(".plugin_top").remove()
67
+	var n
68
+	n = `<div class="plugin_top toolbox-button "><div class="cbar">ABC</div></div>`
69
+	n = `<span class="plugin_top pseudo_vid small_vid"><div class="m">ABC</div></span>`
70
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
71
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
72
+	// n = `<span class="plugin_top pseudo_vid"><span class="m">ABC</span></span>`
73
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"></span>`
74
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"><span class="m">ABC</span></span>`
75
+
76
+	// add_node(n,`.small_vid`,"append")
77
+	// add_node(n,`.small_vid`,"after")
78
+
79
+
80
+
81
+
82
+	// add_node(n,`.remote_vid,#localVideoTileViewContainer`,"after")
83
+	n = `<span class="plugin_top pseudo_vid small_vid "><div class="m">ABC</div></span>`
84
+	add_node(n,`.remote_vid,#localVideoTileViewContainer`,"after")
85
+
86
+
87
+
88
+
89
+
90
+
91
+	// add_node(n,`.jdiv`,"append")
92
+
93
+	// add_node(n,`.button-group-center`,"append")
94
+	// add_node(n,`.button-group-right`,"prepend")
95
+	// add_node(n,`.jdiv`,"prepend")
96
+
97
+
98
+	// add_node(n,`.cont`,"prepend")
99
+	// add_node(n,`.cont`,"after")
100
+	try {
101
+		dispatch_resize()
102
+	} catch {
103
+
104
+	}
105
+
106
+}
107
+
108
+
109
+function init_api2(){
110
+	$(".plugin_top").remove()
111
+	// dispatch_resize()
112
+	// return
113
+	var n
114
+	n = `<div class="plugin_top toolbox-button "><div class="cbar">ABC</div></div>`
115
+	n = `<span class="plugin_top pseudo_vid small_vid"><div class="m">ABC</div></span>`
116
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
117
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
118
+	// n = `<span class="plugin_top pseudo_vid"><span class="m">ABC</span></span>`
119
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"></span>`
120
+	// n = `<span class="plugin_top pseudo_vid videocontainer this_con rloc remote_vid small_vid display-avatar-only"><span class="m">ABC</span></span>`
121
+
122
+	// add_node(n,`.small_vid`,"append")
123
+
124
+
125
+
126
+
127
+	// add_node(n,`.remote_vid,#localVideoTileViewContainer`,"after")
128
+	n = `<span class="plugin_top pseudo_vid small_vid "><div class="m">ABC</div></span>`
129
+	// add_node(n,`.small_vid`,"after")
130
+	// add_node(n,`.remote_vid,#localVideoTileViewContainer`,"after")
131
+	// add_node(n,`.remote-videos-container`,"append")
132
+	add_node(n,`#localVideoTileViewContainer`,"before")
133
+
134
+
135
+
136
+	// n = `<span class="plugin_top "><div class="m">ABC</div></span>`
137
+	// n = `<span class="plugin_top overlay"><div class="m">ABC</div></span>`
138
+
139
+
140
+
141
+	// add_node(n,`.jdiv`,"append")
142
+/*
143
+	add_node(n,`.button-group-center`,"append")
144
+	add_node(n,`.button-group-right`,"append")
145
+	add_node(n,`.button-group-left`,"append")
146
+
147
+
148
+	add_node(n,`.button-group-center`,"prepend")
149
+	add_node(n,`.button-group-right`,"prepend")
150
+	add_node(n,`.button-group-left`,"prepend")
151
+*/
152
+	// add_node(n,`.toolbox-content`,"prepend")
153
+	// add_node(n,`.toolbox-content`,"before")
154
+	// add_node(n,`.toolbox-content`,"after")
155
+
156
+	// add_node(n,`.toolbox-background`,"after")
157
+	// add_node(n,`.toolbox-background`,"append")
158
+	// add_node(n,`.toolbox-background`,"append")
159
+
160
+	// add_node(n,`.new-toolbox`,"append")
161
+	// add_node(n,`.new-toolbox`,"prepend")
162
+	// add_node(n,`#react`,"prepend")
163
+	// add_node(n,`body`,"prepend")
164
+	// add_node(n,`body`,"append")
165
+
166
+
167
+
168
+
169
+	// add_node(n,`.jdiv`,"prepend")
170
+	// add_node(n,`.jdiv`,"append")
171
+
172
+
173
+	// add_node(n,`.cont`,"prepend")
174
+	// add_node(n,`.cont`,"after")
175
+	try {
176
+		dispatch_resize()
177
+	} catch {
178
+
179
+	}
180
+
181
+
182
+}
183
+
184
+function init_api3(){
185
+	$(".plugin_top").remove()
186
+	// dispatch_resize()
187
+	// return
188
+	var n
189
+	// ".top_toolbox,.vid_toptoolbar_hook"
190
+	n = `<div class="plugin_top toolbox-button "><div class="cbar">ABC</div></div>`
191
+	n = `<span class="plugin_top pseudo_vid small_vid"><div class="m">ABC</div></span>`
192
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
193
+	n = `<span class="plugin_top hidden_vid pseudo_vid small_vid"><div class="m">ABC</div></span>`
194
+
195
+	n = `<span class="plugin_top pseudo_vid small_vid "><div class="m2 xbox">ABC</div></span>`
196
+
197
+
198
+	add_node(n,`#localVideoTileViewContainer`,"before")
199
+	n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
200
+	add_node(n,`.top_toolbox,.vid_toptoolbar_hook`,"append")
201
+	// add_node(n,`.dev_hook`,"append")
202
+	add_node(n,`.button-group-right`,"prepend")
203
+
204
+	try {
205
+		dispatch_resize()
206
+	} catch {
207
+
208
+	}
209
+
210
+}
211
+// Add Psudo vid
212
+// video toolbar hook
213
+// window top margin
214
+// window window bottom toolbar
215
+
216
+
217
+
218
+function add_node(n,rn,i) {
219
+	$(rn)[i](n)
220
+	// after
221
+	// $(".plugin_top")
222
+
223
+
224
+	// body...
225
+
226
+
227
+}
228
+init_api3()
229
+// C:\bspace\repos\jmc\ign_kutd\m\m_api_html.js
230
+
231
+
232
+
233
+
234
+// div.dev_hook.top_toolbox.jdiv
235
+// div.dev_hook.indicator_hook.vid_toptoolbar_hook.jdiv.t0
236
+
237
+
238
+
239
+

+ 146
- 0
m/m_const.js View File

@@ -0,0 +1,146 @@
1
+
2
+
3
+window.m_const = {
4
+
5
+}
6
+
7
+
8
+window.m_const.exclude = Symbol("exclude")
9
+window.m_const.include = Symbol("include")
10
+// window.m_const.exclude = Symbol("include")
11
+
12
+
13
+
14
+// glob_react.Filmstrip._getThumbs = function (onlyVisible = false) {
15
+_getThumbs_mod_junk = function (onlyVisible = false) {
16
+        // let selector = 'span';
17
+
18
+        // console.log("crnr flm getThumbs",!!(window.log_tb))
19
+        // console.log("crnr flm getThumbs",this,this.filmstripRemoteVideos)
20
+        // window.log_tb ? log_tb(new Error(),"getThumbs") : 0
21
+        
22
+
23
+        // console.trace("getThumbs_tb")
24
+        let selector = '.remote_vid,.pseudo_vid';
25
+        selector = window.glob_sel || selector;
26
+        let filter = '';
27
+
28
+        if (onlyVisible) {
29
+            filter += ':visible';
30
+        }
31
+
32
+        // const remoteThumbs = this.filmstripRemoteVideos.children(selector);
33
+        // const remoteThumbs = this.filmstripRemoteVideos.find(selector);
34
+        const filmstripRemoteVideos =  $('#filmstripRemoteVideosContainer')
35
+        // const localThumb = $('#localVideoContainer');
36
+        // const localThumb = filmstripRemoteVideos.children('#localVideoContainer');
37
+        const localThumb = filmstripRemoteVideos.children("#localVideoTileViewContainer").children('#localVideoContainer');
38
+        // const localThumb = filmstripRemoteVideos.children($('#localVideoContainer'));
39
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).filter(filter) : filmstripRemoteVideos.find(selector);
40
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).children(filter) : filmstripRemoteVideos.children(selector);
41
+        const remoteThumbs = filter ? filmstripRemoteVideos.children(selector).filter(filter) : filmstripRemoteVideos.children(selector);
42
+        
43
+
44
+        // clog("$$$",localThumb.hasClass('hidden') ,localThumb.find(".local_vid").length,filmstripRemoteVideos.find("#localVideoContainer").length)
45
+        clog("$$$2",localThumb.length, (localThumb.hasClass('hidden') ,localThumb.find(".local_vid").length || filmstripRemoteVideos.find("#localVideoContainer").length))
46
+
47
+        // Exclude the local video container if it has been hidden.
48
+        // if (localThumb.hasClass('hidden') && ( ! (localThumb.find(".local_vid").length && filmstripRemoteVideos.find(#localVideoContainer)) ) ) {
49
+        // if (localThumb.hasClass('hidden') || ( ! (localThumb.find(".local_vid").length || filmstripRemoteVideos.find("#localVideoContainer")) ) ) {
50
+        // if (localThumb.hasClass('hidden') || ( ! (localThumb.find(".local_vid").length || filmstripRemoteVideos.find("#localVideoContainer").length) ) ) {
51
+        if (localThumb.hasClass('hidden') || ! localThumb.length  ) {
52
+            return { remoteThumbs };
53
+        }
54
+        // return { remoteThumbs };
55
+
56
+        return { remoteThumbs,
57
+            localThumb };
58
+}
59
+
60
+
61
+
62
+glob_react.Filmstrip._getThumbs_works = function (onlyVisible = false) {
63
+    // _getThumbs_works(onlyVisible = false) {
64
+        // let selector = 'span';
65
+
66
+        // console.log("crnr flm getThumbs",!!(window.log_tb))
67
+        // console.log("crnr flm getThumbs",this,this.filmstripRemoteVideos)
68
+        // window.log_tb ? log_tb(new Error(),"getThumbs") : 0
69
+        
70
+
71
+        // console.trace("getThumbs_tb")
72
+        let selector = '.remote_vid,.pseudo_vid';
73
+        selector = window.glob_sel || selector;
74
+        let filter = '';
75
+
76
+        if (onlyVisible) {
77
+            filter += ':visible';
78
+        }
79
+
80
+        const localThumb = $('#localVideoContainer');
81
+        // const remoteThumbs = this.filmstripRemoteVideos.children(selector);
82
+        // const remoteThumbs = this.filmstripRemoteVideos.find(selector);
83
+        const filmstripRemoteVideos =  $('#filmstripRemoteVideosContainer')
84
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).filter(filter) : filmstripRemoteVideos.find(selector);
85
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).children(filter) : filmstripRemoteVideos.children(selector);
86
+        const remoteThumbs = filter ? filmstripRemoteVideos.children(selector).filter(filter) : filmstripRemoteVideos.children(selector);
87
+
88
+        // Exclude the local video container if it has been hidden.
89
+        if (localThumb.hasClass('hidden')) {
90
+            return { remoteThumbs };
91
+        }
92
+
93
+        return { remoteThumbs,
94
+            localThumb };
95
+
96
+    }
97
+
98
+
99
+
100
+ glob_react.Filmstrip._getThumbs_buggy = function(onlyVisible = false) {
101
+    // _getThumbs(onlyVisible = false) {
102
+        // let selector = 'span';
103
+
104
+        // console.log("crnr flm getThumbs",!!(window.log_tb))
105
+        // console.log("crnr flm getThumbs",this,this.filmstripRemoteVideos)
106
+        // window.log_tb ? log_tb(new Error(),"getThumbs") : 0
107
+        
108
+
109
+        // console.trace("getThumbs_tb")
110
+        let selector = '.remote_vid,.pseudo_vid';
111
+        selector = window.glob_sel || selector;
112
+        let filter = '';
113
+
114
+        if (onlyVisible) {
115
+            filter += ':visible';
116
+        }
117
+
118
+        // const remoteThumbs = this.filmstripRemoteVideos.children(selector);
119
+        // const remoteThumbs = this.filmstripRemoteVideos.find(selector);
120
+        const filmstripRemoteVideos =  $('#filmstripRemoteVideosContainer')
121
+        // const localThumb = $('#localVideoContainer');
122
+        // $("#filmstripLocalVideoThumbnail > *")
123
+        // const localThumb = filmstripRemoteVideos.children("#localVideoTileViewContainer").children('#localVideoContainer');
124
+        // const localThumb = filmstripRemoteVideos.children("#localVideoTileViewContainer").children('#localVideoContainer');
125
+        const localThumb = $("#filmstripRemoteVideosContainer > #localVideoTileViewContainer,#filmstripLocalVideoThumbnail").children('#localVideoContainer');
126
+
127
+
128
+        // const localThumb = filmstripRemoteVideos.children($('#localVideoContainer'));
129
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).filter(filter) : filmstripRemoteVideos.find(selector);
130
+        // const remoteThumbs = filter ? filmstripRemoteVideos.find(selector).children(filter) : filmstripRemoteVideos.children(selector);
131
+        const remoteThumbs = filter ? filmstripRemoteVideos.children(selector).filter(filter) : filmstripRemoteVideos.children(selector);
132
+
133
+        // Exclude the local video container if it has been hidden.
134
+        // if (localThumb.hasClass('hidden') && ( ! (localThumb.find(".local_vid").length && filmstripRemoteVideos.find(#localVideoContainer)) ) ) {
135
+        if (localThumb.hasClass('hidden')  || ! localThumb.length )  {
136
+            return { remoteThumbs };
137
+        }
138
+
139
+        return { remoteThumbs,
140
+            localThumb };
141
+
142
+    }
143
+
144
+
145
+// glob_react.Filmstrip._getThumbs = glob_react.Filmstrip._getThumbs_works
146
+// glob_react.Filmstrip._getThumbs = glob_react.Filmstrip._getThumbs_buggy

+ 172
- 0
m/m_req.js View File

@@ -0,0 +1,172 @@
1
+
2
+window.ifn_obj =  window.ifn_obj || {	init_conf_join:[], }
3
+
4
+function get_mod(participants){
5
+	if (!participants){
6
+	participants = get_participants()
7
+	}
8
+	var k,v
9
+	for (v of participants){
10
+		if (v.role == "moderator"){
11
+			clog("cui_mod_cd",[v],v.corner_data)
12
+			return v
13
+		}
14
+	}
15
+}
16
+function get_participants(){
17
+	return APP.store.getState()["features/base/participants"]
18
+}
19
+function get_local(participants){
20
+	if (!participants){
21
+	participants = get_participants()
22
+	}
23
+	var k,v
24
+	for (v of participants){
25
+		if (v.local){
26
+			return v
27
+		}
28
+	}
29
+	return APP.store.getState()["features/base/participants"]
30
+}
31
+// function am_i_mod() {
32
+function amimod() {
33
+	// clog("BX am i mod")
34
+	try {
35
+
36
+	// clog("BX",APP.store.getState())
37
+	// clog("BXi",get_participants(),get_mod(),get_local())
38
+	return get_local().role == "moderator"
39
+	// get_local().role == "moderator" ?  $("body").addClass("dev") : 0
40
+	} catch (e) {
41
+
42
+	// clog("BX wai err:",e)
43
+	}
44
+}
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+function Someone_Left_Handler(o){
59
+	// amimod
60
+	clog("PARTICIPANT_LEFT:...",{that:this,args:[...arguments]},amimod())
61
+	// o.action.participant.id
62
+	delete msto.participants[o.action.participant.id]
63
+}
64
+
65
+function Someone_Left_or_Joined_Handler(o){
66
+	// amimod
67
+	clog("PARTICIPANT_Left_or_Joined:...",{that:this,args:[...arguments]},amimod())
68
+	try {
69
+		APP.store.dispatch(window.glob_react.video_layout.setTileView(false))
70
+APP.store.dispatch(window.glob_react.rf_filmstrip.setFilmstripVisible(false))
71
+		if (! $("#vspace_filmstrip_template").length){
72
+		    init_api6()
73
+		}
74
+refresh_toolbars()
75
+mod_sort()
76
+new_move()
77
+
78
+dispatch_resize()
79
+	} catch(err) {
80
+		clog("Someone_Left_or_Joined_Handler err:", err)
81
+	}
82
+	// o.action.participant.id
83
+
84
+	// delete msto.participants[o.action.participant.id]
85
+}
86
+
87
+
88
+window.iammod = window.iammod || false
89
+
90
+function amimodnow(){
91
+	var iammod = amimod()
92
+	window.iammod = iammod
93
+	if (iammod){
94
+		refresh_toolbars()
95
+	}
96
+	// clog("qxi","amimodnow",amimod())
97
+}
98
+
99
+
100
+
101
+
102
+
103
+function cji(){
104
+	clog("      qxi cji.")
105
+
106
+	if (window.init_m){
107
+		// setTimeout(window.init_m())
108
+	}
109
+	clog('TMX ifn_obj.init_conf_join',ifn_obj.init_conf_join)
110
+	if (ifn_obj && ifn_obj.init_conf_join){
111
+		var k,v
112
+		for ([k,v] of Object.entries(ifn_obj.init_conf_join)){
113
+			v()
114
+		}
115
+	}
116
+	// clog("      qxi",$(".contx"))
117
+	// t5i2.crnr_init()
118
+	// modify_corners()
119
+	// clog("      qxi .",$(".contx"),$(".remove_btn,.remove_btn"))
120
+	// remove_btn
121
+	// add_corner_btn
122
+	// clog("      qxi cji-fin")
123
+}
124
+function stv(o,ta){
125
+	clog(o,ta)
126
+}
127
+function dev_middleware_listner(o) {
128
+	if (!o.action.type){
129
+		return
130
+	}
131
+	if (o.action.type != "ENDPOINT_MESSAGE_RECEIVED"){
132
+		// CONFERENCE_JOINED
133
+	// clog("QXI",o.action.type)
134
+	}
135
+
136
+
137
+	
138
+	switch(o.action.type){
139
+		case "PARTICIPANT_UPDATED":
140
+			// clog("~qxi~",o)
141
+			window.iammod ? 0 : amimodnow()
142
+
143
+			// setTimeout(aim,1,o)
144
+		break;
145
+		case "PARTICIPANT_LEFT":
146
+			setTimeout(Someone_Left_Handler,1,o)
147
+			setTimeout(Someone_Left_Handler,1000,o)
148
+		case "PARTICIPANT_Joined":
149
+		case "PARTICIPANT_JOINED":
150
+			setTimeout(Someone_Left_or_Joined_Handler,1,o)
151
+			// setTimeout(Someone_Left_or_Joined_Handler,300,o)
152
+		// clog("PARTICIPANT_LEFT:",{that:this,args:[...arguments]})
153
+		break;
154
+		case "SET_TILE_VIEW":
155
+		stv(o,[this,arguments])
156
+		break;
157
+		// SET_TILE_VIEW
158
+		case "CONFERENCE_JOINED":
159
+			clog("qxi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
160
+			setTimeout(cji,1)
161
+		break;
162
+
163
+	}
164
+
165
+	
166
+	// return
167
+	// clog("qxi",o)
168
+	// clog("qxi",o,o.action)
169
+	// clog("qxi",o.action.type)
170
+	// body...
171
+}
172
+

+ 715
- 0
m/m_utils.js View File

@@ -0,0 +1,715 @@
1
+
2
+if (!window.glob_mx ){
3
+	window.glob_mx={}
4
+
5
+glob_mx.prom = {}
6
+glob_mx.event_handlers = {}
7
+glob_mx.cb = {
8
+	init_db:{}
9
+}
10
+glob_mx.filmstrip_handlers  = {}
11
+//glob_mx.filmstrip_handlers = glob_mx.filmstrip_handlers || {}
12
+
13
+}
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+function match(mx,m,o){
33
+	var k,v,k2,v2
34
+	var r = 0
35
+		// clog("@",mx,m,o)
36
+	for ([k,v] of Object.entries(m || {})){
37
+		v2 = o[k]
38
+    // clog("M~",k,typeof(v),typeof(v2),v,v2)
39
+		if (typeof(v) == "string" && typeof(v2) == "string") {
40
+			r += !(v==v2)
41
+		} else if (Array.isArray(v) && Array.isArray(v2)){
42
+			r += !(isSubset_arr(v,v2))
43
+		} else if (Array.isArray(v) && typeof(v2) == "string"){
44
+      // r += !(isSubset_arr(v2,v))
45
+      // r += !(isSubset_arr(v2,v))
46
+      r += !v.includes(v2)
47
+			// clog("!!!!!!!!!!!!!",v,v2,isSubset_arr(v2,v))
48
+		} else if (Array.isArray(v2) && typeof(v) == "string"){
49
+			r += !(v2.includes(v))
50
+		}
51
+		if (r){
52
+			return !r
53
+		}
54
+	}
55
+	return !r
56
+}
57
+
58
+
59
+function isSubset(subset,superset){
60
+    for (var elem of subset) {
61
+        if (!superset.includes(elem)) {
62
+            return false;
63
+        }
64
+    }
65
+    return true;  
66
+}
67
+
68
+function isSubset_arr(subset,superset){
69
+    for (var elem of subset) {
70
+    	if (Array.isArray(elem)){
71
+
72
+    		if (!new Set(elem).intersection(superset).size){
73
+    			return false
74
+    		}
75
+    	} else if (!superset.includes(elem)) {
76
+            return false;
77
+        }
78
+    }
79
+    return true;  
80
+}
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+function dispatch_events(e,key){
102
+	var k,v
103
+	e.parsed.etype ? 1 : e.parsed.etype = "null"
104
+	var mflag =0
105
+		clog("dispatch_events??",e,key)
106
+
107
+	for ([k,v] of Object.entries(glob_mx.event_handlers || {}) ) {
108
+		clog("dispatch_events:",k)
109
+		if (v.m){
110
+			mflag = match({},v.m,e.parsed)
111
+		mflag ? v.fn(e) : 1
112
+		}
113
+	}
114
+}
115
+
116
+
117
+function run_cbs(key){
118
+	var k,v
119
+		clog("RUN_CB??",key,glob_mx.cb[key])
120
+
121
+	for ([k,v] of Object.entries(glob_mx.cb[key]|| {}) ) {
122
+		clog("RUN_CB:",k)
123
+		v()
124
+	}
125
+}
126
+
127
+
128
+
129
+
130
+
131
+
132
+function wait(ms) {
133
+  return new Promise(r => setTimeout(r, ms));
134
+}
135
+
136
+function attr_info(n){
137
+	var k,v
138
+	var ret ={}
139
+	// clog(".")
140
+	for (k in n.attributes){
141
+		// clog(k)
142
+	}
143
+	// clog("~")
144
+	for (k of n.attributes){
145
+	// for (k of n.attributes){
146
+		// clog(k)
147
+	}
148
+	// clog("--")
149
+	for ([k,v] of Object.entries(n.attributes)){
150
+		// clog(k,v,v+"+")
151
+		// clog("+",[k,v],v)
152
+		ret[v.name]= v.value
153
+		// clog(typeof(k),typeof(v))
154
+	}
155
+	return ret
156
+
157
+
158
+}
159
+
160
+
161
+
162
+
163
+
164
+
165
+// ai.from.split((a0,a1,a2,a3)=>{clog({a0,a1,a2,a3});return "z"})
166
+// tmsgx3({type:"db_sync_request"})
167
+function mhndlr_rld(that,m){
168
+	try {
169
+		window.mx=m
170
+		var n = m.querySelector(`code`)
171
+		if (!n){return}
172
+		var parsed = JSON.parse(n.innerHTML)
173
+		var ai = attr_info(m)
174
+		window.ai=ai
175
+		// clog("FROM",ai.from == glob_mx.all_jids[0])
176
+		// var id = ai.from.split().slice(-1)[0]
177
+		var id = ai.from.split("/").pop()
178
+
179
+		clog("mhndlr_rld2",m,parsed,n,n.dataset)
180
+		var o = parsed.payload
181
+		switch (parsed.type){
182
+			case "set_msg":
183
+				pf._set_recv(o.path,o.key,o.val)
184
+			break;
185
+			case "event":
186
+				clog("~event~",parsed)
187
+				dispatch_events({parsed,ai,m,that})
188
+			break;
189
+			case "msg_test":
190
+				clog("msg_test",parsed)
191
+			break;
192
+			case "db_sync_request":
193
+				// tmsgx3({type:"db_sync_response",payload:pf.root})
194
+				tmsgx3({type:"db_sync_response",payload:pf.root},{to:ai.from})
195
+				
196
+				clog("db_sync_request",parsed)
197
+			break;
198
+			case "db_sync_response":
199
+				if (id == glob_mx.local_id){
200
+					clog( "db_sync_response ...")
201
+					break
202
+
203
+				}
204
+					if (glob_mx.prom.init_db_resolve){
205
+						glob_mx.prom.init_db_resolve({aaa:"dsr",pl:parsed.payload})
206
+
207
+					}
208
+
209
+				clog("db_sync_response",ai.from == glob_mx.local_id,ai.from,parsed)
210
+			break;
211
+
212
+		}
213
+		/*
214
+
215
+
216
+		if (parsed.type == "set_msg"){
217
+			var o = parsed.payload
218
+			pf._set_recv(o.path,o.key,o.val)
219
+		} 
220
+		if (parsed.type == "msg_test"){
221
+			clog("msg_test",parsed)
222
+		} 
223
+		*/
224
+
225
+	} catch (err) {
226
+		clog("mhndlr err:",err)
227
+	}
228
+	return true
229
+}
230
+
231
+isProxy = Symbol("isProxy")
232
+
233
+
234
+tlu = {
235
+	object:"",
236
+	string:true,
237
+	number:true,
238
+	undefined:true,
239
+	boolean:true,
240
+}
241
+
242
+
243
+
244
+function type_info(o){
245
+	var t 
246
+	var flags = {
247
+		leaf:false,
248
+		deep_not_prx:false,
249
+		prx:false,
250
+		isObj:false,
251
+		isArr:false,
252
+		els:false,
253
+	}
254
+	t = typeof(o)
255
+	flags.t=t
256
+	if (!(o === null)){
257
+		flags.isArr = Array.isArray(o)
258
+		flags.isObj = Object.prototype == o.__proto__
259
+	}
260
+
261
+	if (tlu[t] === true || o === null){
262
+		flags.leaf = true
263
+	} else if (t == "object" && o.__prx){
264
+		flags.prx = true
265
+	} else if (t == "object" && (flags.isArr || flags.isObj)){
266
+		flags.prx = false
267
+		flags.deep_not_prx = true
268
+	} else {
269
+		clog("ELSE")
270
+		flags.els = true
271
+	}	
272
+
273
+	return flags
274
+
275
+	clog(t,flags)
276
+}
277
+
278
+
279
+
280
+
281
+
282
+function deep_prop(o,p){
283
+	try {
284
+	var arr = jc(p)
285
+	var ret = o
286
+	while (arr.length){
287
+		// clog("deep_prop",arr,ret)
288
+		ret = ret[arr.shift()]
289
+	}
290
+	// clog("deep_prop ret",ret)
291
+	return ret
292
+	} catch(err){console.error("DEEP_PROP ERR:",err)}
293
+}
294
+
295
+
296
+
297
+
298
+delete Proxy_Factory
299
+{
300
+
301
+class Proxy_Factory {
302
+	constructor(o,n="dflt"){
303
+		this.db = o
304
+		this.n = n
305
+		this.hidden_props = ["add_proxy","_set","walker","walker_start","prxy","_sett","_sett2"]
306
+		this._pub_cb =[]
307
+		this.__prx = true
308
+		this.SymPrx = Symbol("SymPrx")
309
+	}
310
+	init(o){
311
+		// clog("BP",this,this.baseProp,this.__proto__.baseProp,window.baseProp)
312
+		this.root = o
313
+	}
314
+	sync(o){
315
+		this.root = jc(o.root)
316
+		o._pub_cb.push(this._set_recv.bind(this))
317
+	}
318
+	get prxy(){
319
+		return this
320
+	}
321
+
322
+	_set(o,k,v,prx,a0){
323
+		this.obj[k]=prx
324
+	}
325
+
326
+	_sett(o,k,v,prx,a0){
327
+		clog("_SETT",this,arguments)
328
+	}
329
+	_sett2(o,k,v,prx,a0){
330
+		clog("_SETT2",this,arguments)
331
+	}
332
+
333
+	set_pub(obj, prop, val,receiver){
334
+		// clog("qia_pub",obj, prop, val,receiver)
335
+		// clog("qia_pub2",this.n,obj.__path_arr, prop, jx(val))
336
+		this._set_pub(obj.__path_arr, prop, jx(val))
337
+
338
+	}
339
+	_set_pub(path,key,val){
340
+		var k,v
341
+					// /*
342
+
343
+			tmsgx({
344
+				"type":"set_msg",
345
+				"payload":{path,key,val},
346
+			},"code")
347
+			//		*/
348
+		for (v of this._pub_cb){
349
+			v(path,key,val)
350
+
351
+		}
352
+	}
353
+
354
+	_set_recv(path,prop,val){
355
+		// return
356
+		var p = path
357
+		var nprop =deep_prop(this.root,p)
358
+		var dpth = nprop.__dpth
359
+		if (tlu[typeof(val)]){
360
+		nprop._set(nprop,prop,val,val)
361
+		} else {
362
+		nprop._set(nprop,prop,val,new Proxy(val,this))
363
+		nprop[prop].add_proxy(nprop,prop,val,dpth+1)
364
+		}
365
+		// var tf = {}
366
+		// this.walker(nprop[prop],tf,dpth+2)
367
+		this.walker(nprop[prop],{},dpth+2)
368
+	}
369
+
370
+	set(obj, prop, val,receiver){
371
+		// clog("prx_db set ",this,obj, prop, val,receiver,val.__prx)
372
+		if (obj[prop] === val){
373
+			return Reflect.set(...arguments)
374
+		}
375
+
376
+		this.set_pub(obj, prop, val,receiver)
377
+		this.event_proc("set")
378
+		
379
+		if ("__prx" == prop){
380
+			this.__prx=val
381
+			return this.__prx
382
+		}
383
+
384
+		if (typeof(val) === "object" && val != null && !(val.__prx)){
385
+			var ret = Reflect.set(...arguments)
386
+			this.set_obj(obj, prop, val,receiver)
387
+			return ret
388
+		} 
389
+
390
+		return Reflect.set(...arguments)
391
+	}
392
+	get(obj, prop,receiver){
393
+		// clog("prx_db get ...",prop==isProxy,this,obj, prop,receiver)
394
+		if (this.hidden_props.includes(prop)){
395
+			switch (prop){
396
+				case "add_proxy":
397
+				return this.add_proxy.bind(this)
398
+			break;
399
+				case "prxy":
400
+				return this
401
+				case "_set":
402
+				// clog("_SET")
403
+				// return this._set.bind({this})
404
+				return this._set.bind({that:this,obj, prop,receiver})
405
+				case "_sett":
406
+				return this._sett.bind({that:this,obj, prop,receiver})
407
+				case "_sett2":
408
+				return this._sett2.bind({that:this})
409
+				case "walker_start":
410
+				return this.walker_start
411
+				case "walker":
412
+				return this.walker
413
+			break;
414
+			}
415
+		}
416
+
417
+		if (isProxy == prop){ return true }
418
+		if ("__prx" == prop){ return this.__prx }
419
+
420
+		return Reflect.get(...arguments)
421
+	}
422
+	add_proxy(o,k,v,dpth){
423
+		// clog("~add_proxy~",o,k,v,dpth)
424
+		// clog("~add_proxy~",o.__prx,o,k,v,dpth,xpath)
425
+		var xpath = o.__path
426
+		var apath = o.__path_arr
427
+		this.event_proc("add_proxy")
428
+		if (!apath){
429
+			apath=[]
430
+		}
431
+
432
+		if (!xpath){
433
+			xpath="ROOT!"
434
+		}
435
+
436
+		Object.defineProperty(v,"__path_arr",Object.assign({value:apath.concat(k),},this.baseProp))
437
+		Object.defineProperty(v,"__path",Object.assign({value:xpath+":"+k,},this.baseProp))
438
+		Object.defineProperty(v,"__dpth",Object.assign({value:dpth,},this.baseProp))
439
+
440
+	}
441
+	set_obj(obj, prop, val,receiver){
442
+		var dpth = obj.__dpth
443
+		var tf = {}
444
+		this.walker(receiver,tf,dpth)
445
+	}
446
+
447
+	walker(o,tfo,dpth=0){
448
+		clog("qia WALK",this)
449
+		if (dpth > 7){
450
+			console.error("MAX DEPTH")
451
+			return
452
+		}
453
+		var k,v
454
+		var tf 
455
+			for ([k,v] of Object.entries(o)){
456
+				tf = type_info(v)
457
+				if (tf.deep_not_prx){
458
+					o._set(o,k,v,new Proxy(v,this.prxy))
459
+					o[k].add_proxy(o,k,v,dpth)
460
+				this.walker(o[k],tf,dpth+1)
461
+				}
462
+			}
463
+	}
464
+	walker_start(o,dpth){
465
+		var tf = type_info(o)
466
+		o.add_proxy({},[],o,-1)
467
+		this.walker(o,tf,0)
468
+	}
469
+	event_proc(e){}
470
+}
471
+window.Proxy_Factory = Proxy_Factory
472
+
473
+Proxy_Factory.prototype.baseProp={
474
+	writable: true,
475
+	// enumerable: true,
476
+	enumerable: false,
477
+	configurable: true,
478
+	}
479
+}
480
+
481
+
482
+function arr_match(m,o){
483
+	var k,v
484
+	var r = 0
485
+	for ([k,v] of Object.entries(m || {})){
486
+		if (o[k] != v.valueOf()){
487
+			r += 1
488
+			return !r
489
+		}
490
+
491
+	// for ([k,v] in m){
492
+		// case 
493
+		clog(k,v)
494
+	}
495
+	return !r
496
+}
497
+
498
+permissions_def = {
499
+	participants:{
500
+		m:["participants"],
501
+		fn(set_scope,match){
502
+
503
+
504
+			clog("FN....",match.fp,match.fp[1] == window.glob_mx.local_id)
505
+			if (match.fp[1] != window.glob_mx.local_id)
506
+				throw "permission err"
507
+			return 
508
+		},
509
+	}
510
+}
511
+// 
512
+// msto.my_data.prxy.__proto__.__proto__.set.call(msto.my_data.prxy,msto.participants,"abc2",{})
513
+permissions_def__set = {
514
+	participants:{
515
+		m:["participants"],
516
+		fn(set_scope,match){
517
+
518
+
519
+			clog("FN....",match.fp,match.fp[1] == window.glob_mx.local_id)
520
+			if (match.fp[1] != window.glob_mx.local_id)
521
+				// throw "permission err"
522
+			return 
523
+		},
524
+	}
525
+}
526
+
527
+
528
+{
529
+	class Proxy_Permissions extends Proxy_Factory {
530
+		constructor(a,a1){
531
+			super(...arguments)
532
+		}
533
+		set(obj, prop, val,receiver){
534
+			clog("PRX_PERM",obj.__path_arr,prop)
535
+			var k,v
536
+			var r
537
+			var matched 
538
+			var fp = obj.__path_arr.concat(prop)
539
+			for ([k,v] of Object.entries(permissions_def)){
540
+				matched = arr_match(v.m,fp)
541
+				if (matched){
542
+					r = v.fn({that:this,obj, prop, val,receiver},{fp,k,v}) || {}
543
+				}
544
+				// if (r.return)
545
+			}
546
+			// case
547
+			// if (obj.__path_arr && obj.__path_arr.length){}
548
+			super.set(obj, prop, val,receiver)
549
+		}
550
+		_set(){
551
+			clog("Proxy_Permissions _set")
552
+			super._set(...arguments)
553
+		}
554
+	}
555
+	window.Proxy_Permissions = Proxy_Permissions
556
+}
557
+
558
+
559
+msto_z = {
560
+	// private_local:{},
561
+	// participant_local:{},
562
+	conference:{},
563
+	participants:{
564
+	},
565
+}
566
+
567
+
568
+
569
+
570
+
571
+function pfnf(o){
572
+	return  function(resolve, reject){
573
+		o.resolve=resolve
574
+		o.reject=reject
575
+		// clog(arguments)
576
+	}
577
+}
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+function init_db_cb(){
587
+}
588
+function init_sync_participant(){
589
+}
590
+function init_db(objx){
591
+		var obj
592
+	if (objx.participants){
593
+		obj = objx
594
+	} else {
595
+		obj = objx.pl
596
+	}
597
+	// var obj = obj.pl
598
+	clog("INIT DB...",objx,obj)
599
+pf = new Proxy_Permissions({},"pf")
600
+msto_prx = new Proxy(obj,pf)
601
+window.msto_prx0 =msto_prx
602
+// msto_prx = new Proxy(msto_z,pf)
603
+pf.init(msto_prx)
604
+msto_prx.walker_start(msto_prx)
605
+
606
+pf.root.participants[glob_mx.local_id] = {}
607
+
608
+
609
+window.msto= {
610
+	participants:pf.root.participants,
611
+	conference:pf.root.conference,
612
+	my_data:pf.root.participants[glob_mx.local_id],
613
+	private_local:{},
614
+}
615
+// var k,v
616
+clog("RUN_CB...")
617
+run_cbs("init_db")
618
+}
619
+
620
+function init_mu(persistent_mods){
621
+	// .role == "moderator"
622
+		clog(">>>>>>>>>>>>>>>>>>>.. RUN_CB")
623
+var participants = get_participants()
624
+clog(participants)
625
+
626
+
627
+
628
+
629
+var local = get_local(participants)
630
+	if (window.glob_mx.local_id && persistent_mods && local.role=="moderator"){
631
+		// if window.glob_mx.local_id
632
+		clog("no RUN_CB")
633
+
634
+		return
635
+	}
636
+window.glob_mx.local_id = local.id
637
+var k,v
638
+window.glob_mx.all_ids = []
639
+window.glob_mx.all_jids = []
640
+for (v of participants){
641
+	window.glob_mx.all_ids.push(v.id)
642
+	window.glob_mx.all_jids.push(`nnnx@conference.jfidev.com/${v.id}`)
643
+}	
644
+	var rr = {}
645
+	var prom1 = new Promise(pfnf(rr));
646
+	prom1.then(init_db)
647
+	// setTimeout(rr.reject,2000,"RESP DB Timeout")
648
+	// setTimeout(rr.resolve,4000,"RESP DB Timeout")
649
+	// setTimeout(rr.resolve,4000,msto_z)
650
+	// setTimeout(rr.resolve,4000,{aaa:"timedout",pl:msto_z})
651
+	setTimeout(rr.resolve,5000,{aaa:"timedout",pl:msto_z})
652
+
653
+	if (participants.length > 1){
654
+	glob_mx.prom.init_db_resolve = rr.resolve
655
+		tmsgx3({type:"db_sync_request"})
656
+
657
+	} else {
658
+		// glob_mx.prom.init_db_resolve(msto_z)
659
+		rr.resolve(msto_z)
660
+	// init_db()
661
+
662
+	}
663
+}
664
+
665
+
666
+
667
+
668
+function create_db(){
669
+	
670
+}
671
+
672
+
673
+
674
+
675
+
676
+
677
+
678
+
679
+
680
+
681
+
682
+
683
+
684
+function isident(){
685
+	return JSON.stringify(pf.root) == JSON.stringify(pf2.root)
686
+}
687
+
688
+
689
+
690
+function init_mu_runner(){
691
+	if (window.glob_mx.conf_joined){
692
+		init_mu(...arguments)
693
+	}
694
+}
695
+
696
+
697
+function init_mx2(){
698
+	clog("INITMX3")
699
+	window.glob_mx.conf_joined =1
700
+	init_mu_runner()
701
+	// add_handler_m(mhndlr)
702
+}
703
+ifn_obj.init_conf_join.push(init_mx2)
704
+
705
+// init_mu_runner("auto")
706
+init_mu_runner("")
707
+
708
+
709
+
710
+
711
+
712
+
713
+
714
+
715
+clog("RUN_CB!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")

+ 418
- 0
m/mdev.js View File

@@ -0,0 +1,418 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+o = {a:2,b:3}
10
+
11
+// Object.defineProperties()
12
+Object.defineProperty(o,"b",{
13
+	enumerable:false,
14
+})
15
+Object.defineProperty(o,"c",{
16
+	enumerable:false,
17
+})
18
+Object.defineProperty(o,"d",{
19
+	// enumerable:false,
20
+})
21
+
22
+zxc2 = Object.getOwnPropertyDescriptors (o)
23
+// zxc2.a.enumerable=false
24
+
25
+
26
+
27
+ 
28
+function okv(obj) {
29
+	var k,v
30
+	for ([k,v] of Object.entries(obj))
31
+	// body...
32
+	clog("!",k,v)
33
+}
34
+
35
+cnt = 0
36
+
37
+
38
+
39
+prxt = {
40
+	set:function(obj, prop, val,receiver){
41
+		clog("prxt set ",obj, prop, val,receiver)
42
+		return
43
+
44
+		return Reflect.set(...arguments)
45
+	},
46
+	get:function(obj, prop,receiver){
47
+
48
+
49
+
50
+
51
+
52
+		
53
+		if (window.cnt){
54
+		window.cnt+=1
55
+		clog("prxt get ret",cnt,prop)
56
+			return
57
+		}
58
+		window.cnt+=1
59
+		clog("prxt get",obj, prop,receiver)
60
+		// clog("prxt get",prop)
61
+		// clog("prxt get")
62
+		return
63
+
64
+		return Reflect.get(...arguments)
65
+	},
66
+	// __prx:true,
67
+	// rec:
68
+
69
+}
70
+
71
+
72
+
73
+
74
+delete obsObj
75
+{
76
+
77
+class obsObj {
78
+	constructor(o){
79
+		this.db = o
80
+	}
81
+	_pub_msg(m){
82
+		clog("ixi PUB MSG",m)
83
+	}
84
+	_rec_msg(that,m){
85
+		clog("ixi REC MSG2",m)
86
+	}
87
+	__noSuchMethod__(){
88
+		clog("__lookupGetter__~",arguments)
89
+	}
90
+}
91
+window.obsObj = obsObj
92
+glob_mx.obsobj =new obsObj({})
93
+glob_mx.obsobj2 =new obsObj({})
94
+}
95
+
96
+
97
+glob_mx.obsobj.__proto__ = new Proxy(glob_mx.obsobj.__proto__,prxt)
98
+
99
+delete Magic
100
+{
101
+
102
+class Magic {
103
+    constructor () {
104
+        return new Proxy(this, this);
105
+    }
106
+    get (target, prop) {
107
+        return this[prop] || 'MAGIC';
108
+    }
109
+}
110
+window.Magic = Magic
111
+glob_mx.magic =new Magic({})
112
+glob_mx.magic2 =new Magic({})
113
+// glob_mx.magic3 =new Magic({})
114
+}
115
+// __lookupGetter__
116
+
117
+// function replacer(a0,a1,a2,a3,a4){
118
+hdn = [
119
+"__path_arr",
120
+"__path",
121
+"__dpth",
122
+]
123
+
124
+function replacer(key,val){
125
+	// clog("REP",key,val,this)
126
+	var v,k
127
+	if (typeof(val) == "object" && val != null){
128
+		// val._add="Z"
129
+		v = Object.assign({},val)
130
+		for (k of hdn){
131
+			v[k] = val[k]
132
+		}
133
+		return v
134
+	}
135
+	return val
136
+	// return a0
137
+}
138
+
139
+
140
+function jh(o){
141
+	return JSON.parse(JSON.stringify(o, replacer))
142
+}
143
+
144
+
145
+s1 ={a:{b:{c:3}}}
146
+// JSON.stringify({a:{b:{c:3}}}, replacer)
147
+// JSON.stringify({}, replacer)
148
+// JSON.stringify({a:{b:{c:3}}}, replacer)
149
+// JSON.stringify({}, replacer[, space]])
150
+// 
151
+m = {}
152
+m.m0 = {
153
+	// k:["z2"]
154
+}
155
+m.m1 = {
156
+	k:["z2","z3"]
157
+}
158
+m.m2 = {
159
+	k:["z3"]
160
+}
161
+// m.
162
+
163
+
164
+function isSubset(subset,superset){
165
+    for (var elem of subset) {
166
+        if (!superset.includes(elem)) {
167
+            return false;
168
+        }
169
+    }
170
+    return true;  
171
+}
172
+
173
+function isSubset_arr(subset,superset){
174
+    for (var elem of subset) {
175
+    	if (Array.isArray(elem)){
176
+
177
+    		if (!new Set(elem).intersection(superset).size){
178
+    			return false
179
+    		}
180
+    	} else if (!superset.includes(elem)) {
181
+            return false;
182
+        }
183
+    }
184
+    return true;  
185
+}
186
+
187
+
188
+function sym_info(o){
189
+	var k,v 
190
+	for ([k,v] of Object.entries(syms)){
191
+		// clog(k,v)
192
+		clog(k,o[v])
193
+	}
194
+}
195
+
196
+function art(m,o){
197
+	var k,v
198
+	var r = 0
199
+	var ret = {}
200
+	var md =Object.getOwnPropertyDescriptors(m)
201
+
202
+	for ([k,v] of Object.entries(md)){
203
+		if (typeof(v.value) == "symbol"){
204
+			r+=1
205
+			ret[k]=v.value
206
+		}
207
+
208
+
209
+	// for ([k,v] in m){
210
+		// case 
211
+		clog(k,typeof(v.value),v.value,[v])
212
+	}
213
+	return {cnt:r,o:ret}
214
+}
215
+syms = art(Symbol).o
216
+
217
+function match(mx,m,o){
218
+	var k,v,k2,v2
219
+	var r = 0
220
+		// clog("@",mx,m,o)
221
+	for ([k,v] of Object.entries(m || {})){
222
+		v2 = o[k]
223
+    // clog("M~",k,typeof(v),typeof(v2),v,v2)
224
+		if (typeof(v) == "string" && typeof(v2) == "string") {
225
+			r += !(v==v2)
226
+		} else if (Array.isArray(v) && Array.isArray(v2)){
227
+			r += !(isSubset_arr(v,v2))
228
+		} else if (Array.isArray(v) && typeof(v2) == "string"){
229
+      // r += !(isSubset_arr(v2,v))
230
+      // r += !(isSubset_arr(v2,v))
231
+      r += !v.includes(v2)
232
+			// clog("!!!!!!!!!!!!!",v,v2,isSubset_arr(v2,v))
233
+		} else if (Array.isArray(v2) && typeof(v) == "string"){
234
+			r += !(v2.includes(v))
235
+		}
236
+		if (r){
237
+			return !r
238
+		}
239
+	}
240
+	return !r
241
+}
242
+
243
+
244
+// clog("m1,m2",match({},m.m1,m.m2))
245
+// clog("m2,m1",match({},m.m2,m.m1))
246
+
247
+// clog("m2,m0",match({},m.m2,m.m0))
248
+// clog("m0,m2",match({},m.m0,m.m2))
249
+
250
+
251
+a = ["A","B","C"]
252
+a1 = ["A","B",,"D"]
253
+a1[-1]="z"
254
+a1["q"]="z2"
255
+s2 = "str2"
256
+
257
+r1 = [/a\d/,/b[a-z]\d/]
258
+
259
+delete Str
260
+{
261
+
262
+class Str extends String {
263
+	// constructor(o){
264
+		// super(o)
265
+	// }
266
+	/*
267
+		this.db = o
268
+	}
269
+	_pub_msg(m){
270
+		clog("ixi PUB MSG",m)
271
+	}
272
+	_rec_msg(that,m){
273
+		clog("ixi REC MSG2",m)
274
+	}
275
+	*/
276
+}
277
+window.Str = Str
278
+}
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+function gpt(){
294
+	try {
295
+	clog("gx gpt",get_participants)
296
+	clog("gx gpt2",get_participants())
297
+
298
+	}	catch (err) {
299
+
300
+	clog("gx gpt err:",err)
301
+	}
302
+}
303
+
304
+gpt()
305
+
306
+
307
+
308
+{
309
+
310
+class QString extends String {
311
+    isEmpty() {
312
+        return this.length === 0;
313
+    }
314
+    concat(){
315
+      return new QString(this + Array.prototype.join.call(arguments, ''));
316
+    }
317
+}
318
+
319
+var testQStr1 = new QString("abc");
320
+var testQStr2 = new QString("as easy as");
321
+var testQStr3 = new QString("123");
322
+var testStr3 = new String("123");
323
+
324
+console.log(testQStr1,testQStr1 == "abc");
325
+test1 = testQStr1.concat(testQStr2,testQStr3);
326
+console.log(test1,test1=="abcas easy as123");
327
+
328
+
329
+
330
+
331
+}
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+function switch_t(m,o){
343
+	// var t 
344
+	// var flags = {
345
+	// 	leaf:"??",
346
+	// 	prx:"??",
347
+	// }
348
+	// t = typeof(o)	
349
+	// t=o
350
+	// var s1 = t
351
+	// var s2 = 2
352
+	// var s0 = [s1,s2]
353
+	// switch (...s0){
354
+	switch (o[0],o[1]){
355
+		case m[0][0],m[0][1]:
356
+		clog("m0")
357
+	break;
358
+		case  m[1][0],m[1][1]:
359
+		clog("m1")
360
+		clog(m[1][0],m[1][1],":",o[0],o[1])
361
+		// clog("~MX~","tlu")
362
+	break;
363
+	default:
364
+		clog("default")
365
+
366
+	}
367
+}
368
+o1 = []
369
+m1 = [[],[]]
370
+function wait(ms) {
371
+  return new Promise(r => setTimeout(r, ms));
372
+}
373
+pfn1= async function(resolve, reject) {
374
+	clog("RESV")
375
+  // resolve('Success!');
376
+	window.pfn1_cb = function(/*resolve, reject*/) {
377
+  resolve('Success!');
378
+	}
379
+	await wait(3000)
380
+	
381
+	reject("TIMED_OUT")
382
+}
383
+pfn2=  function(resolve, reject) {
384
+	clog("RESV")
385
+  resolve({zzz:'Success!'});
386
+
387
+
388
+}
389
+
390
+prm ={}
391
+
392
+// prm.resolve("zzz")
393
+// promise1 = new Promise(pfn1);
394
+
395
+
396
+promise1 = new Promise(pfnf(prm));
397
+
398
+setTimeout(prm.reject,3000,"ST REJ")
399
+
400
+	clog("and then")
401
+promise1.then(function(value) {
402
+  console.log(this,value,arguments);
403
+  // expected output: "Success!"
404
+});
405
+
406
+promise1.then(function(value) {
407
+  console.log("this,value,arguments");
408
+  // expected output: "Success!"
409
+});
410
+
411
+promise1.catch(function(value) {
412
+  console.log("REJECT",this,value,arguments);
413
+  // expected output: "Success!"
414
+});
415
+	clog("and then...")
416
+
417
+
418
+prm.resolve("11111zzz","zzzzzzz")

+ 0
- 0
m/timer/New Text Document.txt View File


+ 426
- 0
m/timer/m.css View File

@@ -0,0 +1,426 @@
1
+
2
+
3
+
4
+
5
+
6
+.videocontainer__toptoolbar  {
7
+	/*opacity: 0;*/
8
+	/*display: none;*/
9
+}
10
+
11
+.remotevideomenu  {
12
+	/*outline: 2px solid #0ff;*/
13
+	}
14
+
15
+
16
+
17
+.abs {
18
+	background: #0ff;
19
+	background: #0080;
20
+	/*outline: 2px solid #fff;*/
21
+	position: absolute;
22
+	z-index: 100;
23
+	top:0;
24
+	left:0;
25
+	right: 0;
26
+	bottom: 0;
27
+	margin: inherit;
28
+	/*border: 2px solid #fff;*/
29
+	/*border-radius: 100%;*/
30
+	/*border-radius: 50%;*/
31
+	/*border-radius: 25%;*/
32
+	/*width: 100%;*/
33
+	/*height: 100%;*/
34
+}	
35
+
36
+
37
+.cont.z {
38
+	/*opacity: 0;*/
39
+	width: 33%;
40
+	width: calc(33% - 1px);
41
+	width: 100%;
42
+	/*padding: 2px;*/
43
+	height: 100%;
44
+	/*background: #0ff8;*/
45
+	/*display: inline;*/
46
+	position: relative;
47
+	display: inline-block;
48
+	/*display: inline;*/
49
+}
50
+
51
+.cont.z {
52
+	/*opacity: 0;*/
53
+	width: 33%;
54
+	width: calc(33% - 1px);
55
+	width: 100%;
56
+	/*padding: 2px;*/
57
+	height: 100%;
58
+	/*background: #0ff8;*/
59
+	/*display: inline;*/
60
+	position: relative;
61
+	display: inline-block;
62
+	/*display: inline;*/
63
+}
64
+
65
+
66
+
67
+.c1.z{
68
+	/*background-image:linear-gradient(to bottom,rgba(255,255,255,1),rgba(71,71,71,0));*/
69
+	background-color: #246 !important;
70
+	background-color: #fff !important;
71
+	/*background-color: # !important;*/
72
+	background-image:linear-gradient(to bottom,rgba(255,255,255,1),rgba(0,0,0,0));
73
+	background-image:linear-gradient(to bottom,rgba(0,0,0,1),rgba(0,0,0,0));
74
+	background-image:linear-gradient(to bottom,rgba(0,0,0,1),rgba(0,0,0,0));
75
+}
76
+
77
+.icont {
78
+	background: #0000 !important;
79
+	background: #0ff8;
80
+	/*outline: 2px solid red;*/
81
+	width: 100%;
82
+	height: 100%;
83
+	/*z-index: */
84
+	position: absolute;
85
+	position: relative;
86
+}
87
+.ic3 {
88
+	background: #ff08;
89
+
90
+}
91
+.ic2 {
92
+	background: #00f8;
93
+
94
+}
95
+.ic3 {
96
+	/*opacity: 0;*/
97
+
98
+}
99
+.ic2 {
100
+	/*opacity: 0;*/
101
+}
102
+
103
+
104
+
105
+
106
+
107
+video {
108
+
109
+
110
+	/*filter: drop-shadow(30px 10px 4px #4444dd);*/
111
+	/*filter: blur(4px);*/
112
+	/*filter: invert(100%) grayscale(100%);*/
113
+	/*filter: grayscale(100%)  invert(100%);*/
114
+	/*filter: grayscale(100%)  invert(100%) invert(100%) grayscale(100%);*/
115
+	/*filter: grayscale(100%);*/
116
+
117
+
118
+	/*filter: saturate(1860%);*/
119
+}
120
+
121
+video {
122
+	/*filter: grayscale(100%);*/
123
+}
124
+
125
+
126
+
127
+.xbox {
128
+	width: 25px;
129
+	height: 25px;
130
+	/*color: #0000;*/
131
+	color: #000;
132
+	background: #0ff;
133
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
134
+}
135
+
136
+.xbox2 {
137
+	/*width: 25px;*/
138
+	/*position: */
139
+	/*height: 25px;*/
140
+	/*color: #0000;*/
141
+	/*top: 0;*/
142
+	/*left: 0;*/
143
+	/*right: 0;*/
144
+	/*bottom: 0;*/
145
+	width: 25px;
146
+	height: 25px;
147
+
148
+	/*width: 100%;*/
149
+	/*height: 100%;*/
150
+
151
+	position: relative;
152
+	position: absolute;
153
+	/*width: 100%;*/
154
+	/*height: 100%;*/
155
+	color: #000;
156
+	/*background: #0ff;*/
157
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
158
+}
159
+
160
+
161
+
162
+.small_vid .xbox:after,.small_vid .xbox2:after{
163
+/*.xbox:after,.xbox2:after{*/
164
+	content: "???";
165
+	z-index: 0;
166
+	white-space: pre-wrap;
167
+	content: var(--v_index,":???:") "\A" var(--v_id,":???:");
168
+	background-color: #fff;
169
+	position:absolute;
170
+	top: 0;
171
+	width: 75px;
172
+	height: 45px;
173
+	left: 0;
174
+	/*right: 0;*/
175
+	/*bottom: 0;*/
176
+}
177
+.small_vid .xbox:after {
178
+	/*background-color: red;*/
179
+}
180
+
181
+.xbox.m2s {
182
+	width: 75px;
183
+	height: 75px;
184
+
185
+	width: 100%;
186
+	height: 100%;
187
+
188
+	/*color: #0000;*/
189
+	/*background: #0ff;*/
190
+	background: #ff8;
191
+	/*background-image: linear-gradient(45deg, red 50%, blue 15%);*/
192
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
193
+
194
+
195
+}
196
+
197
+
198
+
199
+
200
+.pseudo_vid {
201
+	/*display: none;*/
202
+	/*position: relative;*/
203
+	background-color: #f00;
204
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
205
+	/*border-radius: 50px;*/
206
+	/*outline: 8px solid red;*/
207
+}
208
+
209
+.pseudo_vid:after{
210
+	/*content: "XYZ";*/
211
+	/*background: #f00;*/
212
+}
213
+
214
+
215
+.tile-view .pseudo_vid{
216
+
217
+	/*margin:5px;*/
218
+}
219
+/*.tile-view .pseudo_vid*/
220
+.tile-view .pseudo_vid,.vertical-filmstrip .pseudo_vid{
221
+	background-size:contain;
222
+	/*border: 2px solid transparent !important;*/
223
+	margin:4 5px;
224
+	width: 100%;
225
+}
226
+/*
227
+.vertical-filmstrip .pseudo_vid{
228
+	background-size:contain;
229
+	border: 2px solid transparent !important;
230
+	margin:0 2px;
231
+	width: 100%;
232
+}
233
+*/
234
+.dev_filmstrip .pseudo_vid{
235
+	/*width: 100px !important;*/
236
+	/*height: 100px !important;*/
237
+
238
+}
239
+.small_vid {
240
+	display: block;
241
+}
242
+.pseudo_vid {
243
+	/*display: none;*/
244
+	position: relative;
245
+	/*position: absolute;*/
246
+}
247
+
248
+
249
+
250
+.vspace {
251
+	position: absolute;
252
+	/*height: 500px;*/
253
+	height: 100%;
254
+	width: 100%;
255
+	/*width: calc(100% - 4px);*/
256
+	width: calc(100% );
257
+	width: calc(100% - 4px);
258
+	/*background-color: #555;*/
259
+	height: calc(100% - 4px);
260
+	border-radius: 100px;
261
+
262
+}
263
+.vspace.z {
264
+	position: absolute;
265
+	/*height: 500px;*/
266
+	height: 100%;
267
+	width: 100%;
268
+	/*width: calc(100% - 4px);*/
269
+	width: calc(100% );
270
+	width: calc(100% - 4px);
271
+	height: calc(100% - 4px);
272
+	border-radius: 100px;
273
+	/*z-index: 1;*/
274
+	/*border:  2px solid #fff;*/
275
+	/*z-index: 400;*/
276
+	/*z-index: 2;*/
277
+	/*background-color: #f00;*/
278
+}
279
+.vspace.z:after {
280
+	content: ",";
281
+	top: 0;
282
+	left: 0; 
283
+	position: absolute;
284
+	/*height: 500px;*/
285
+	height: 100%;
286
+	width: 100%;
287
+	/*width: calc(100% - 4px);*/
288
+	/*width: calc(100% );*/
289
+	/*width: calc(100% - 4px);*/
290
+	/*height: calc(100% - 4px);*/
291
+	border-radius: 100px;
292
+	/*z-index: 1;*/
293
+	border:  2px solid #fff;
294
+	/*z-index: 400;*/
295
+	/*z-index: 2;*/
296
+	background-color: #f00;
297
+}
298
+
299
+
300
+.m4 {
301
+	width: 50px;
302
+	height: 50px;
303
+	top: 200px;
304
+	left: 10px;
305
+	z-index: 100; 
306
+	position: relative;
307
+	background-color: #00f;
308
+}
309
+
310
+
311
+
312
+
313
+.cont {
314
+	position: relative;
315
+	position: absolute;
316
+
317
+}
318
+
319
+.cont.c1.z {
320
+	position: absolute;
321
+	width: 135px;
322
+	height: calc(100% - 100px); 
323
+}
324
+
325
+.cont.c2.z {
326
+	position: absolute;
327
+	height: 135px; 
328
+	width: 100%;
329
+	/*width: calc(100% - 270px);*/
330
+	/*margin: auto;*/
331
+	/*margin: */
332
+	/*padding-right: : ;*/
333
+}
334
+.cont.c3.z {
335
+	position: absolute;
336
+	width: 135px; 
337
+	right: 0;
338
+	height: calc(100% - 100px); 
339
+}
340
+
341
+
342
+.icont.ic2.z {
343
+	width: calc(100% - 270px);
344
+	/*margin: auto;*/
345
+	margin:0 135px;
346
+}
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+.dev_filmstrip {
372
+	/*position: relative;*/
373
+	/*position: absolute;*/
374
+	/*z-index: 100;*/
375
+}
376
+
377
+
378
+.cont {
379
+	/*position: relative;*/
380
+	/*position: absolute;*/
381
+	/*z-index: 6;*/
382
+
383
+}
384
+
385
+.cont.c4.z {
386
+	/*position: relative;*/
387
+	position: absolute;
388
+	z-index: 9;
389
+
390
+}
391
+
392
+.cont.c5.z {
393
+	/*position: relative;*/
394
+	/*position: absolute;*/
395
+	width: 100%;
396
+	background-color: #555c;
397
+	z-index: 9;
398
+
399
+}
400
+
401
+
402
+video  {
403
+
404
+/*object-fit:contain !important;*/
405
+}
406
+
407
+
408
+
409
+.toolbox-background{
410
+	z-index: 100 !important;
411
+
412
+	/*background-color: #8888;*/
413
+}
414
+/*toolbox-content*/
415
+
416
+.overflow {
417
+	/*width: 200% !important;*/
418
+	/*overflow: scroll;*/
419
+	/*zoom:.5;*/
420
+}
421
+
422
+.c6 {
423
+	overflow-x: scroll;
424
+	/*width: 200% !important;*/
425
+	/*zoom:.5;*/
426
+}

+ 156
- 0
m/timer/m.html View File

@@ -0,0 +1,156 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+HI THIS is AN HTML SNIPIT
9
+
10
+
11
+<!-- <div class="mp1">abc</div>
12
+<div class="mp2">def</div> -->
13
+
14
+
15
+
16
+
17
+<span class="plugin_top abs filmstrip_template"><div class="dev_filmstrip">
18
+	<span class="cont c1">
19
+		<div class="icont ic1"></div>
20
+	</span>
21
+	<span class="cont c2">
22
+		<div class="icont ic2"></div>
23
+	</span>
24
+	<span class="cont c3">
25
+		<div class="icont ic3"></div>
26
+	</span>
27
+</div></span>
28
+
29
+
30
+
31
+
32
+<span id="vspace_filmstrip_template0" class="plugin_top abs2"><div class="dev_filmstrip">
33
+	<span class="cont c1">
34
+		<div class="icont ic1 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
35
+	</span>
36
+	<span class="cont c2">
37
+		<div class="icont ic2 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
38
+	</span>
39
+	<span class="cont c3">
40
+		<div class="icont ic3 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
41
+	</span>
42
+	<span class="cont c6">
43
+		<div class="icont ic6 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
44
+	</span>
45
+	<span class="cont c5">
46
+		<div class="icont ic5 vid_container" data-fs_type="single" data-fs_handler="center"></div>
47
+		<div class="at a1"></div>
48
+		<div class="at a2"></div>
49
+		<div class="at a3"></div>
50
+		<div class="at a4"></div>
51
+	</span>
52
+	<span class="cont c4">
53
+		<div class="icont ic4 vid_container" data-fs_type="single"></div>
54
+	</span>
55
+</div></span>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+<!-- 
68
+<input type="checkbox" name="">
69
+ -->
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+<span id="vspace_filmstrip_template" class="plugin_top abs2"><div class="dev_filmstrip">
80
+	<span class="fs_container">
81
+	<span class="cont c2">
82
+		<div class="icont ic2 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
83
+	</span>
84
+	<span class="cont c1">
85
+		<div class="icont ic1 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
86
+	</span>
87
+	<span class="cont c3">
88
+		<div class="icont ic3 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
89
+	</span>
90
+	<span class="cont c6">
91
+		<div class="icont ic6 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
92
+	</span>
93
+	<!-- 
94
+	<span class="cont c5">
95
+		<div class="icont ic5 vid_container" data-fs_type="single" data-fs_handler="center"></div>
96
+		<div class="at a1"></div>
97
+		<div class="at a2"></div>
98
+		<div class="at a3"></div>
99
+		<div class="at a4"></div>
100
+	</span>
101
+	 -->
102
+	<span class="cont c4">
103
+		<div class="icont ic4 vid_container" data-fs_type="single" data-fs_handler="center"></div>
104
+	</span>
105
+	</span>
106
+</div></span>
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+<span id="vspace_filmstrip_proto_template" class="plugin_top abs2"><div class="dev_filmstrip">
117
+	<!-- 
118
+	<span class="cont c1">
119
+		<div class="icont ic1 vid_container" data-fs_type="vertical"></div>
120
+	</span>
121
+	<span class="cont c2">
122
+		<div class="icont ic2 vid_container" data-fs_type="horizontal"></div>
123
+	</span>
124
+	<span class="cont c3">
125
+		<div class="icont ic3 vid_container" data-fs_type="vertical"></div>
126
+	</span>
127
+	 -->
128
+
129
+	<span class="cont c5">
130
+		<!-- <div class="icont ic5 vid_container" data-fs_type="single"></div> -->
131
+		<div class="at a1"></div>
132
+		<div class="at a2"></div>
133
+		<div class="at a3"></div>
134
+		<div class="at a4"></div>
135
+		<div class="at a5"></div>
136
+		<div class="at a6"></div>
137
+		<div class="at a7"></div>
138
+		<div class="at a8"></div>
139
+
140
+
141
+
142
+		<div class="at at2 b1"></div>
143
+		<div class="at at2 b2"></div>
144
+		<div class="at at2 b3"></div>
145
+		<div class="at at2 b4"></div>
146
+		<div class="at at2 b5"></div>
147
+		<div class="at at2 b6"></div>
148
+		<div class="at at2 b7"></div>
149
+		<div class="at at2 b8"></div>
150
+
151
+
152
+	</span>
153
+	<span class="cont c4">
154
+		<!-- <div class="icont ic4 vid_container" data-fs_type="single"></div> -->
155
+	</span>
156
+</div></span>

+ 475
- 0
m/timer/m.js View File

@@ -0,0 +1,475 @@
1
+clog("ltest m.js")
2
+
3
+function html_js_handler(rsp) {
4
+	clog("html_js_handler",[...arguments])
5
+	mod_templates = $(`<span>${rsp}</span>`)
6
+
7
+
8
+	// init_api5()
9
+	init_api6()
10
+}
11
+
12
+mod_templates = window.mod_templates || $("")
13
+// mod_templates.find(".filmstrip_template")
14
+
15
+html_hooks = {
16
+	create_video_tile(n){
17
+		add_node(n,`#localVideoTileViewContainer`,"before")
18
+		clog("CVT")
19
+
20
+	},
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+	create_vid_toptoolbar_hook(n){
31
+		clog("CVT")
32
+		add_node(n,`.vid_toptoolbar_hook`,"append")
33
+		// add_node(n,`.vid_toptoolbar_hook_after`,"append")
34
+	},
35
+	create_vid_toptoolbar_hook_after(n){
36
+		clog("CVT")
37
+		add_node(n,`.vid_toptoolbar_hook`,"append")
38
+		// add_node(n,`.vid_toptoolbar_hook_after`,"append")
39
+	},
40
+
41
+	// Top of window
42
+	create_top_toolbox_hook(n){
43
+		add_node(n,`.top_toolbox`,"append")
44
+		// add_node(n,`.vid_toptoolbar_hook`,"append")
45
+		clog("CVT")
46
+	},
47
+	create_bottom_toolbox_hook(n){
48
+		clog("CVT")
49
+		add_node(n,`.button-group-right`,"prepend")
50
+	},
51
+
52
+
53
+
54
+
55
+
56
+	create_new_filmstrip(n){
57
+
58
+		add_node(n,`#filmstripRemoteVideos`,"prepend")
59
+	},
60
+	// filmstripRemoteVideos
61
+
62
+}
63
+
64
+
65
+
66
+function saftly_remove(n,remove_nodes=true){
67
+	// $(`#filmstripRemoteVideosContainer`).append($(`.cx0 .remote_vid`))
68
+	// $(`#localVideoTileViewContainer`).append($(`.cx0 .local_vid`))
69
+	// $(`#filmstripRemoteVideosContainer`).append($(`#localVideoTileViewContainer`))
70
+	const j =$(n)
71
+
72
+	$(`#localVideoTileViewContainer`).append(j.find(".local_vid"))
73
+	$(`#filmstripRemoteVideosContainer`).append(j.find("#localVideoTileViewContainer"))
74
+
75
+	// $(`#filmstripRemoteVideosContainer`).append(j.find(".remote_vid"))
76
+	$(`#localVideoTileViewContainer`).before(j.find(".remote_vid"))
77
+	// remove_nodes ? j.remove() : 0
78
+	remove_nodes ? j.remove() : clog("DO NOT REMOVE")
79
+
80
+
81
+}
82
+
83
+
84
+function init_api5(){
85
+	saftly_remove(".plugin_top")
86
+	// return
87
+	// $(".plugin_top").remove()
88
+	var n 
89
+	n = `<span class="plugin_top pseudo_vid small_vid "><div class="m2 xbox2">ABC</div></span>`
90
+	html_hooks.create_video_tile(n)
91
+	n = `<span class="plugin_top pseudo_vid small_vid "><div class="m3 xbox2">ABC</div></span>`
92
+	html_hooks.create_video_tile(n)
93
+	html_hooks.create_video_tile(n)
94
+	html_hooks.create_video_tile(n)
95
+	html_hooks.create_video_tile(n)
96
+	html_hooks.create_video_tile(n)
97
+	html_hooks.create_video_tile(n)
98
+
99
+	// n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
100
+	n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
101
+	// html_hooks.create_vid_toptoolbar_hook(n)
102
+	html_hooks.create_vid_toptoolbar_hook_after(n)
103
+	
104
+	n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
105
+	html_hooks.create_top_toolbox_hook(n)
106
+
107
+	n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
108
+	html_hooks.create_bottom_toolbox_hook(n)
109
+
110
+
111
+
112
+	// n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
113
+	n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
114
+	n= mod_templates.find(".filmstrip_template")[0].outerHTML
115
+
116
+	// html_hooks.create_new_filmstrip(n)
117
+
118
+	n = `<span class="plugin_top pseudo_vid small_vid "><div class="m4 xbox3">ABC</div></span>`
119
+	n= mod_templates.find("#vspace_filmstrip_template")[0].outerHTML
120
+	// vspace
121
+
122
+	add_node(n,`.vspace`,"append")
123
+
124
+	try {
125
+		dispatch_resize()
126
+	} catch {
127
+
128
+	}
129
+
130
+}
131
+
132
+
133
+function move_vids(){
134
+	// var all_vids = $(".small_vid")
135
+	// var all_vids = $(".remote_vid,.local_vid")
136
+	var all_vids = $(".small_vid")
137
+	// var all_vids = $(".remote_vid,#localVideoTileViewContainer")
138
+	 // $(".cont.c1").append($(".remote_vid"))
139
+	 // $(".icont.ic1").append(all_vids)
140
+	 $(".icont.ic1").append(all_vids.splice(0,4))
141
+	 $(".icont.ic2").append(all_vids.splice(0,4))
142
+	 // $(".icont.ic2").append(all_vids.slice(0,2))
143
+	 // $(".icont.ic2").append($(".pseudo_vid")[0])
144
+
145
+}
146
+function ffcb(){
147
+	clog("ffcb",this.value,this.checked,[this,...arguments])
148
+	disp(glob_react.base_conference.setFollowMe(this.checked))
149
+	var follow_focus_force=$("#follow_focus_force")[0] 
150
+	if (follow_focus_force.checked && !this.checked){
151
+		msto.conference.force_follow = this.checked
152
+		follow_focus_force.checked = this.checked
153
+
154
+	}
155
+}
156
+function fffcb(){
157
+	var follow_focus=$("#follow_focus")[0]
158
+
159
+	if (!follow_focus.checked && this.checked){
160
+
161
+	follow_focus.checked = this.checked
162
+	ffcb.bind(follow_focus)()
163
+	}
164
+	msto.conference.force_follow = this.checked
165
+	// clog("ffcb",this.value,this.checked,[this,...arguments])
166
+	// disp(glob_react.base_conference.setFollowMe(this.checked))
167
+}
168
+function num_pseudo(){
169
+	msto.conference.repeat = this.value
170
+	setTimeout(refresh_fs_send,100)
171
+}
172
+function scroll_timeout_runner(){
173
+	$("#follow_focus_force")[0] 
174
+	// scroll_send)
175
+	var ov_timeout=$("#ov_timeout")[0]
176
+	var ov_timeout_disable=$("#ov_timeout_disable")[0]
177
+	// ov_timeout_disable
178
+	if (ov_timeout_disable.checked){
179
+		timeout_scroll_glob.stop = 1
180
+	} else {
181
+		timeout_scroll_glob.stop = 0
182
+
183
+	}
184
+	if (!isNaN(ov_timeout.value) && ov_timeout.value > .2){
185
+		timeout_scroll_glob.timeout = Math.ceil(ov_timeout.value * 1000)
186
+		msto.conference.scroll_timeout = ov_timeout.value
187
+		timeout_scroll_start()
188
+	}
189
+
190
+	// msto.conference.force_follow = this.checked
191
+	// clog("ffcb",this.value,this.checked,[this,...arguments])
192
+	// disp(glob_react.base_conference.setFollowMe(this.checked))
193
+}
194
+
195
+
196
+// to
197
+
198
+function refresh_toolbars(){
199
+    saftly_remove(".plugin_top.tbar")
200
+
201
+    n = `
202
+    <span class="plugin_top tbar"><span class="outline_indicator ind_1"></span><span class="outline_indicator ind_2"></span><span class="outline_indicator ind_3"></span>
203
+    <div class="m xbox">ABC</div>
204
+    </span>`
205
+    // html_hooks.create_vid_toptoolbar_hook(n)
206
+
207
+    html_hooks.create_vid_toptoolbar_hook_after(n)
208
+
209
+    n = `<span class="plugin_top tbar"><span class="m follow_focus">
210
+<input type="checkbox" id="follow_focus" name="follow_focus">
211
+<label for="follow_focus">
212
+follow focus (moderator only)
213
+</label>
214
+
215
+<br>
216
+<input type="checkbox" id="follow_focus_force" name="follow_focus_force">
217
+<label for="follow_focus_force">
218
+force
219
+</label>
220
+</span>
221
+<span class="m follow_focus2">
222
+ <label for="num_pseudo"># of pseudo videos</label>
223
+  <input type="number" id="num_pseudo" name="num_pseudo" value=${msto.conference.repeat || 0} min=0>
224
+<br>
225
+  <label for="ov_timeout">overflow scroll interval </label>
226
+  <input type="number" id="ov_timeout" name="timeout" min=.4 step=.1 value=${msto.conference.scroll_timeout || 15}>
227
+
228
+<br>
229
+<input type="checkbox" id="ov_timeout_disable" name="ov_timeout_disable">
230
+<label for="ov_timeout_disable" class="inline_input">
231
+disable
232
+</label>
233
+<span class="inline_input"><button id="scroll_now" class="inline_input">scroll now</button></span>
234
+
235
+</span>
236
+</span>`
237
+    // html_hooks.create_top_toolbox_hook(n)
238
+    // subject
239
+    if (amimod()){
240
+
241
+    n = $(n)
242
+    n.find("input#follow_focus")[0].onchange = ffcb
243
+    n.find("input#follow_focus_force")[0].onchange = fffcb
244
+    n.find("input#ov_timeout")[0].onchange = scroll_timeout_runner
245
+    n.find("input#ov_timeout_disable")[0].onchange = scroll_timeout_runner
246
+    n.find("#scroll_now")[0].onclick = scroll_send
247
+    n.find("#num_pseudo")[0].onchange = num_pseudo
248
+
249
+    window.chk =n
250
+
251
+    // n.onclick =
252
+    add_node(n,`.subject`,"prepend")
253
+    }
254
+    // html_hooks.create_top_toolbox_hook(n)
255
+
256
+}
257
+
258
+// disp(glob_react.base_conference.setFollowMe(true))
259
+
260
+function init_api6(){
261
+    saftly_remove(".plugin_top")
262
+    // return
263
+    // $(".plugin_top").remove()
264
+    var n 
265
+    n = `<span class="plugin_top pseudo_vid small_vid "><div class="m2 xbox2">ABC</div></span>`
266
+    // const repeat = 
267
+    const repeat = msto.conference.repeat || 0
268
+
269
+    if ((!isNaN(repeat) && repeat > 0 )){
270
+    html_hooks.create_video_tile(n.repeat(repeat))
271
+
272
+    }
273
+    n = `<span class="plugin_top pseudo_vid small_vid "><div class="m3 xbox2">ABC</div></span>`
274
+    var arr = []
275
+    // arr[]
276
+    /*
277
+    html_hooks.create_video_tile(n)
278
+    html_hooks.create_video_tile(n)
279
+    html_hooks.create_video_tile(n)
280
+    html_hooks.create_video_tile(n)
281
+    html_hooks.create_video_tile(n)
282
+    html_hooks.create_video_tile(n)
283
+    if (amimod()){
284
+        html_hooks.create_video_tile(n)
285
+    html_hooks.create_video_tile(n)
286
+    html_hooks.create_video_tile(n)
287
+    html_hooks.create_video_tile(n)
288
+    html_hooks.create_video_tile(n)
289
+    html_hooks.create_video_tile(n)    
290
+    }
291
+    */
292
+
293
+    // n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
294
+    refresh_toolbars()
295
+    
296
+
297
+
298
+    n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
299
+    html_hooks.create_bottom_toolbox_hook(n)
300
+
301
+
302
+
303
+    // n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
304
+    n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
305
+    n= mod_templates.find(".filmstrip_template")[0].outerHTML
306
+
307
+    // html_hooks.create_new_filmstrip(n)
308
+
309
+    n = `<span class="plugin_top pseudo_vid small_vid "><div class="m4 xbox3">ABC</div></span>`
310
+    n= mod_templates.find("#vspace_filmstrip_template")[0].outerHTML
311
+    // n= mod_templates.find("#vspace_filmstrip_proto_template")[0].outerHTML
312
+    // vspace
313
+
314
+    add_node(n,`.vspace`,"append")
315
+    if (window.mod_sort){
316
+    mod_sort()
317
+
318
+    }
319
+
320
+    try {
321
+        dispatch_resize()
322
+    } catch {
323
+
324
+    }
325
+
326
+}
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+// move_vids()
335
+
336
+
337
+// "."+[...j.classList].join(".")
338
+
339
+
340
+
341
+function get_hook_types(){
342
+	var j = $(".dev_hook")
343
+	var ret = {}
344
+	var ret = new Map()
345
+	var k,v
346
+	for (k of j){
347
+		v = "."+[...k.classList].join(".")
348
+		ret.setD(v,0)
349
+		// ret.get(v) + 1
350
+		ret.set(v,ret.get(v) + 1)
351
+		// clog("~",k)
352
+	}
353
+	return ret
354
+
355
+	// $(".pseudo_vid .xbox").append(h)
356
+}
357
+
358
+
359
+
360
+h = `<div class="mp1">abc</div>
361
+<div class="mp2">def</div>`
362
+
363
+
364
+// $(".pseudo_vid .xbox").append(h)
365
+// init_api5()
366
+
367
+if (window.init_api6){
368
+	init_api6()
369
+	mod_sort()
370
+new_move()
371
+
372
+	dispatch_resize()
373
+}
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+function event_test(){
408
+
409
+            tmsgx({
410
+                "type":"event",
411
+                "payload":{path:"z",key:"z",val:"z",etype:"xyz"},
412
+            },"code")
413
+}
414
+
415
+
416
+function all_plugin_events(e){
417
+	clog("all_plugin_events",[this],[...arguments])
418
+}
419
+
420
+
421
+glob_mx.event_handlers.e1 = {
422
+	fn:all_plugin_events,
423
+	// fn:nop,
424
+	// m:{etype:"timer_start"},
425
+	m:{},
426
+}
427
+
428
+
429
+function refresh_fs_send(){
430
+
431
+            tmsgx({
432
+                "type":"event",
433
+                "payload":'{path,key,val}',
434
+                etype:"refresh_fs"
435
+            },"code")
436
+}
437
+
438
+function refresh_fs_proc(){
439
+    init_api6()
440
+mod_sort()
441
+new_move()
442
+
443
+dispatch_resize()
444
+	clog("refresh_fs_proc")
445
+}
446
+
447
+function scroll_send(){
448
+
449
+            tmsgx({
450
+                "type":"event",
451
+                "payload":'{path,key,val}',
452
+                etype:"overflow_scroll"
453
+            },"code")
454
+}
455
+
456
+
457
+function scroll_proc(e){
458
+	scroll_to()
459
+    clog("scroll_proc",[this,...arguments])
460
+}
461
+
462
+
463
+glob_mx.event_handlers.e2 = {
464
+    fn:scroll_proc,
465
+    // fn:nop,
466
+    // m:{etype:"timer_start"},
467
+    m:{etype:"overflow_scroll"},
468
+}
469
+
470
+glob_mx.event_handlers.e3 = {
471
+    fn:refresh_fs_proc,
472
+    // fn:nop,
473
+    // m:{etype:"timer_start"},
474
+    m:{etype:"refresh_fs"},
475
+}

+ 913
- 0
m/timer/m0.js View File

@@ -0,0 +1,913 @@
1
+clog("ltest m0.js")
2
+
3
+
4
+
5
+
6
+if (window.saftly_remove){
7
+    // init_api6()
8
+    // get_avail_width()
9
+    // clog("REZIE PROTO READY")
10
+}
11
+
12
+    // clog("REZIE PROTO LOAD")
13
+
14
+
15
+
16
+// glob_mx.filmstrip_handlers = glob_mx.filmstrip_handlers || {}
17
+// ctstv()
18
+
19
+
20
+glob_mx.filmstrip_handlers[undefined] = function function_name(argument) {
21
+    // body...
22
+    clog("FN HANDLER")
23
+}
24
+
25
+
26
+dflt_css = {
27
+
28
+      'padding-top': '',
29
+      "min-height": ``,
30
+      "min-width": ``,
31
+      width: ``,
32
+      height: ``,
33
+    
34
+}
35
+
36
+
37
+
38
+function fix_avatar(vid){
39
+    // if ($(vid))
40
+    var k,v,bcr
41
+    for (v of  $(vid).filter(".remote_vid,.local_vid")){
42
+        bcr = v.getBoundingClientRect()
43
+        $(v).find(".avatar-container").css({
44
+            width:Math.ceil(bcr.height * .75),
45
+            height:Math.ceil(bcr.height * .75),
46
+        })
47
+        // clog(v)
48
+
49
+    }
50
+}
51
+
52
+
53
+
54
+function resize_thumbs_vertical(cont){
55
+  const computed_css = Object.assign({},dflt_css)
56
+
57
+  var aspect = 16/9
58
+  var width = 335
59
+  var thumbs = $(cont).children(".small_vid")
60
+  width = $(cont).width() - 1  
61
+  width = glob_mx.dims.w5
62
+  // computed_css["--v_index"]=`"VERT"`
63
+  var height = Math.round(width/aspect)
64
+  computed_css.height = height
65
+  computed_css["min-height"] = height
66
+  computed_css.width = width
67
+  computed_css["min-width"] = width
68
+  var k,v
69
+  for ([k,v] of Object.entries(computed_css)){
70
+    Number(v) ? computed_css[k] = v + "px" : 0
71
+  }
72
+  // clog("RTHUMBS")
73
+  thumbs.css(computed_css)
74
+  fix_avatar(thumbs)
75
+
76
+}
77
+
78
+function resize_thumbs_horizontal(cont){
79
+  const computed_css = Object.assign({},dflt_css)
80
+
81
+  var aspect = 16/9
82
+  var width = 335
83
+  // computed_css["--v_index"]=`"horizontal"`
84
+  var thumbs = $(cont).children(".small_vid")
85
+  width = ($(cont).height() * aspect) 
86
+  width = ($(cont).height() * aspect) - 1
87
+  width = glob_mx.dims.w5
88
+  var height = Math.round(width/aspect)
89
+  computed_css.height = height
90
+  computed_css.width = width
91
+  clog("RTH",cont)
92
+  computed_css["min-width"] = width
93
+  var k,v
94
+  for ([k,v] of Object.entries(computed_css)){
95
+    Number(v) ? computed_css[k] = v + "px" : 0
96
+  }
97
+  // clog("RTHUMBS")
98
+  fix_avatar(thumbs)
99
+  thumbs.css(computed_css)
100
+
101
+
102
+}
103
+
104
+function resize_thumbs_center(cont){
105
+  const computed_css = Object.assign({},dflt_css)
106
+
107
+  var aspect = 16/9
108
+  var width = 335
109
+  // computed_css["--v_index"]=`"horizontal"`
110
+  var thumbs = $(cont).children(".small_vid")
111
+  width = ($(cont).height() * aspect) 
112
+  width = ($(cont).height() * aspect) - 10
113
+  width = ($(cont).width() ) - 10
114
+  var height = Math.round(width/aspect)
115
+  computed_css.height = height
116
+  computed_css.width = width
117
+  var k,v
118
+  for ([k,v] of Object.entries(computed_css)){
119
+    Number(v) ? computed_css[k] = v + "px" : 0
120
+  }
121
+  // clog("RTHUMBS")
122
+  thumbs.css(computed_css)
123
+  fix_avatar(thumbs)
124
+
125
+
126
+}
127
+
128
+
129
+dflt_css_proto = {
130
+
131
+      'padding-top': '',
132
+      "max-height": ``,
133
+      "min-height": ``,
134
+      "max-width": ``,
135
+      "min-width": ``,
136
+      width: ``,
137
+      height: ``,
138
+      top: ``,
139
+      left: ``,
140
+      bottom: ``,
141
+      right: ``,
142
+      position:``,
143
+      tramsform:``,
144
+      // right: ``,
145
+      // right: ``,
146
+    
147
+}
148
+
149
+function resize_thumbs_proto(thumbs,css_arg){
150
+  let css
151
+  if (Array.isArray(css_arg)){
152
+    css = Object.assign({},dflt_css_proto,...css_arg)
153
+
154
+  } else {
155
+    css = Object.assign({},dflt_css_proto,css_arg)
156
+  }
157
+  var k,v
158
+  for ([k,v] of Object.entries(css)){
159
+    // Number(v) ? computed_css[k] = v + "px" : 0
160
+  }
161
+  if (typeof(css.data) == "object"){
162
+    try{
163
+    
164
+    Object.assign($(thumbs)[0].dataset,css.data)
165
+    // clog("dataset ....")
166
+
167
+
168
+} catch(err) {
169
+    clog("dataset err",err)
170
+}
171
+  }
172
+  css["--vdim"] = `"${css.width} x ${css.height}"`
173
+  // clog("RTHUMBS")
174
+  $(thumbs).css(css)
175
+
176
+}
177
+
178
+
179
+
180
+
181
+glob_mx.dims = glob_mx.dims || {} 
182
+
183
+function calc_fs_dims(){
184
+    const hd_w = 16
185
+    const hd_h = 9
186
+
187
+    const aspect_ratio_hd = hd_w / hd_h
188
+
189
+    const aspect_ratio_65 = (hd_w * 6) / (hd_h * 5)
190
+    const aspect_ratio_64 = (hd_w * 6) / (hd_h * 4)
191
+
192
+
193
+    const state = APP.store.getState();
194
+    var { clientHeight, clientWidth } = state['features/base/responsive-ui'];
195
+    var avail_width  =clientWidth
196
+    // var avail_height =clientHeight - 100
197
+    var avail_height =clientHeight - 45
198
+
199
+
200
+
201
+    var dim_hd = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
202
+            columns:1,
203
+    visibleRows:1,
204
+    clientWidth:avail_width,
205
+    clientHeight:avail_height,
206
+    TILE_ASPECT_RATIO:TILE_ASPECT_RATIO ,
207
+    verticalMargin:0,
208
+    // sideMargins=0,
209
+    // topBottomPadding:100,
210
+    })
211
+    let w5,h5,w53,h53,w54,h54
212
+    h5 = dim_hd.height/5
213
+    w5 = dim_hd.width/5
214
+    let m = 10
215
+    let wm = 10
216
+    let hm = 8
217
+    // w5 = w5 - m
218
+    // h5 = h5 - m
219
+
220
+
221
+    w53 = w5 * 3
222
+    h53 = h5 * 3
223
+    w54 = w5 * 4
224
+    h54 = h5 * 4
225
+    w5 = w5 - m 
226
+    h5 = h5 - hm
227
+
228
+    glob_mx.dims.w5 = w5 
229
+    glob_mx.dims.h5 = h5 
230
+    glob_mx.dims.m = m
231
+
232
+    h54 = h54  + (hm * 2)
233
+    let vtop 
234
+    let vleft 
235
+    let s_width,h_height
236
+    s_width = w53 
237
+    h_height = h53  + 1 * hm
238
+    vleft = w5 + ( m ) 
239
+    // = h5 + ((m * 2 ) / aspect_ratio_hd) + 1
240
+    vtop = h5 + ( m * 2 ) - 2 
241
+    vtop = h5 + (hm * 1.5)
242
+    clog("....",clientHeight - dim_hd.height  > 100,clientHeight - dim_hd.height,clientHeight , dim_hd.height)
243
+
244
+    var top_margin_flag 
245
+    if (clientHeight - dim_hd.height  > 150 ) {
246
+
247
+     top_margin_flag = 1
248
+    // $(".fs_container").css({width:dim_hd.width,"min-height":dim_hd.height,"max-height":dim_hd.height + 100})
249
+    resize_thumbs_proto($(".fs_container"),{width:dim_hd.width,"height":dim_hd.height})
250
+    // top_margin_flag = 
251
+    // $(".fs_container").css({width:dim_hd.width,"min-height":dim_hd.height,"max-height":dim_hd.height + 100})
252
+    } else {
253
+     top_margin_flag = 0
254
+    // resize_thumbs_proto($(".fs_container"),{width:dim_hd.width,"height":dim_hd.height})
255
+    resize_thumbs_proto($(".fs_container"),{width:dim_hd.width,"min-height":dim_hd.height,"max-height":dim_hd.height + 100})
256
+
257
+    }
258
+    // $(".fs_container").css({width:dim_hd.width,"height":dim_hd.height})
259
+    // fs_type: "vertical"
260
+    resize_thumbs_proto($(".ic1"),[
261
+        {
262
+                 width:dim_hd.width,
263
+        height:h5,
264
+            "--vtext":`"top_fs"`,
265
+            // data:{fs_type: "vertical"},
266
+            data:{fs_type: "horizontal",},
267
+        },])
268
+
269
+
270
+    resize_thumbs_proto($(".ic2"),[
271
+        {
272
+                 width:w5,
273
+        height:h53,
274
+        top:vtop ,
275
+
276
+            "--vtext":`"left_fs"`,
277
+            data:{fs_type: "vertical"},
278
+        },])
279
+
280
+    resize_thumbs_proto($(".ic3"),[
281
+        {
282
+                 width:w5,
283
+        height:h53,
284
+        top:vtop,
285
+        left:w54,
286
+        // left:0,
287
+        // right:0,
288
+            "--vtext":`"right_fs"`,
289
+            data:{fs_type: "vertical"},
290
+        },])
291
+
292
+    let overflow_vids = $(".ic6").children(".small_vid")
293
+    let overflow_obj = {}
294
+    if (overflow_vids.length > 5){
295
+    }
296
+    overflow_obj.width = w5 * (overflow_vids.length + 1)
297
+    resize_thumbs_proto($(".c6"),[{
298
+        width:dim_hd.width,
299
+        height:h5,
300
+        height:h5 + 20,
301
+        top:h54 - (hm) * .5,
302
+        left:0,}])
303
+
304
+    resize_thumbs_proto($(".ic6"),[
305
+        {
306
+                 width:dim_hd.width,
307
+        height:h5 + 10,
308
+        // top:h54 - (hm) * .5,
309
+        // left:0,
310
+        // left:w54,
311
+        // right:0,
312
+            "--vtext":`"bottom_fs"`,
313
+            data:{fs_type: "horizontal"},
314
+        },overflow_obj])
315
+
316
+
317
+    resize_thumbs_proto($(".ic4"),[
318
+        {
319
+        // height:h53,
320
+        width:s_width,
321
+        // height:h53,
322
+        height:h_height,
323
+        top:vtop - 1,
324
+        left:vleft,
325
+        // left:w54,
326
+        // right:0,
327
+            "--vtext":`"center"`,
328
+            data:{fs_type: "single"},
329
+        },])
330
+
331
+    var center_vid = $(".ic4")[0]
332
+    var bcr = center_vid.getBoundingClientRect()
333
+    var bcr_fs = $(".fs_container")[0].getBoundingClientRect()
334
+    if (top_margin_flag){
335
+    resize_thumbs_proto($("#largeVideoContainer"),[
336
+        {
337
+        // height:h53,
338
+        width:s_width - m,
339
+        // height:h53,
340
+        height:h_height - hm,
341
+        // top:vtop - 2 + (hm * .5),
342
+        transform: "translate(0%, -50%)",
343
+        top:`calc(50% + ${Math.floor(hm * 1)}px)`,
344
+        top:`calc(50% + ${Math.floor(hm * .7)}px)`,
345
+        left:vleft + (.5 * m),
346
+        position:"relative",
347
+        // outline:"1px solid blue",
348
+        outline:"",
349
+        // "z-index":"10",
350
+        // left:w54,
351
+        // right:0,
352
+            "--vtext":`"center"`,
353
+            data:{fs_type: "single"},
354
+        },])
355
+    } else {
356
+resize_thumbs_proto($("#largeVideoContainer"),[
357
+        {
358
+        // height:h53,
359
+        width:s_width - m,
360
+        // height:h53,
361
+        height:h_height - hm,
362
+        top:vtop - 2 + (hm * .5) + bcr_fs.y,
363
+        // top:h5 + (3 * hm),
364
+        transform: "translate(-50%, 0)",
365
+        // top:`calc(50% + ${Math.floor(hm * 1)}px)`,
366
+        // top:`calc(50% + ${Math.floor(hm * .7)}px)`,
367
+        // left:vleft + (.5 * m),
368
+        left:"50%",
369
+        position:"relative",
370
+        // "z-index":"10",
371
+        // left:w54,
372
+        // right:0,
373
+        // outline:"1px solid red",
374
+        outline:"",
375
+            "--vtext":`"center"`,
376
+            data:{fs_type: "single"},
377
+        },])   
378
+    }
379
+
380
+    // #sharedVideo
381
+            // resize_thumbs_proto($(".ic4"),[
382
+            resize_thumbs_proto($("#sharedVideoIFrame.z"),[
383
+        {
384
+        // height:h53,
385
+        width:s_width,
386
+        // height:h53,
387
+        height:h_height,
388
+        top:vtop - 1,
389
+        left:vleft,
390
+        position:"relative",
391
+        // "z-index":"10",
392
+        // left:w54,
393
+        // right:0,
394
+            "--vtext":`"center"`,
395
+            data:{fs_type: "single"},
396
+        },])
397
+resize_thumbs_proto($("#sharedVideoIFrame"),{
398
+        position:"",
399
+
400
+})
401
+clog("top",top_margin_flag)
402
+resize_thumbs_proto($("#largeVideoContainer.z,#sharedVideoIFrame"),{position:"",})
403
+
404
+// $("#sharedVideoIFrame")
405
+// $("#sharedVideo")
406
+
407
+
408
+
409
+    // resize_thumbs_proto($("#largeVideoContainer"),{})
410
+
411
+    /*
412
+    resize_thumbs_proto($("#sharedVideoIFrame"),{
413
+        width:s_width,
414
+        height:h_height,
415
+        "z-index":10;
416
+    })
417
+    */
418
+
419
+
420
+            /*
421
+    resize_thumbs_proto($("#largeVideoContainer"),[
422
+        {
423
+        // height:h53,
424
+        width:s_width,
425
+        // height:h53,
426
+        height:h_height,
427
+        top:vtop - 1,
428
+        left:vleft,
429
+        // left:w54,
430
+        // right:0,
431
+            "--vtext":`"center"`,
432
+            data:{fs_type: "single"},
433
+        },])
434
+    //        */
435
+
436
+    // largeVideoContainer
437
+
438
+}
439
+
440
+function filmstrip_rs(){
441
+    calc_fs_dims()
442
+    clog("filmstrip_rs")
443
+}
444
+
445
+glob_mx.filmstrip_handlers.vertical = filmstrip_rs
446
+glob_mx.filmstrip_handlers.horizontal = filmstrip_rs
447
+glob_mx.filmstrip_handlers.center = filmstrip_rs
448
+
449
+
450
+
451
+
452
+
453
+glob_mx.filmstrip_tile_handlers.vertical = resize_thumbs_vertical
454
+glob_mx.filmstrip_tile_handlers.horizontal = resize_thumbs_horizontal
455
+glob_mx.filmstrip_tile_handlers.center = resize_thumbs_center
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+function sort_id3(a, b) {
504
+    if (a.id > b.id){
505
+        return 1
506
+    } else if (a.id < b.id){
507
+        return -1
508
+    }
509
+    return 0
510
+}
511
+
512
+
513
+
514
+
515
+indexed_tiles = []
516
+// indexed_map=0
517
+// reverse_indexed_map=0
518
+indexed_map = window.indexed_map || new Map()
519
+reverse_indexed_map = window.reverse_indexed_map || new Map()
520
+
521
+// indexed_map =  new Map()
522
+// reverse_indexed_map =  new Map()
523
+
524
+function array_move(arr, old_index, new_index) {
525
+    if (new_index >= arr.length) {
526
+        var k = new_index - arr.length + 1;
527
+        while (k--) {
528
+            arr.push(undefined);
529
+        }
530
+    }
531
+    arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
532
+    return arr; // for testing
533
+};
534
+
535
+
536
+
537
+function mod_sort(){
538
+    // if (amimod()){} else {return}
539
+    var arr = []
540
+    var parr = []
541
+    var ivid = {}
542
+    var k,v
543
+    var j = $(".small_vid:not(.pseudo_vid)")
544
+    // clog(j)
545
+window.indexed_map =  new Map()
546
+window.reverse_indexed_map =  new Map()
547
+
548
+    var part = get_participants()
549
+    var parts =jc(part).sort(sort_id3)
550
+    // clog(parts,part)
551
+    var mod_id = get_mod(part)
552
+    if (mod_id){
553
+    remap_set( $(`#participant_${mod_id.id}`)[0],2)
554
+    }
555
+        
556
+
557
+   
558
+
559
+    var n 
560
+    var cnt = 0
561
+    for (k of parts){
562
+        // clog("z",k,k.local)
563
+        if (k.isFakeParticipant){ 
564
+    n = `<span class="plugin_top pseudo_vid small_vid youtube_vid"><div class="m2 xbox2">ABC</div></span>`
565
+    if ($(".youtube_vid").length){
566
+
567
+    } else {
568
+        // html_hooks.create_video_tile(n)
569
+
570
+    }
571
+        // remap_set($(".youtube_vid")[0],0)
572
+        j = $("#sharedVideoContainer")
573
+        remap_set(j[0],2)
574
+        // remap_set( $(`#participant_${mod_id.id}`)[0],1)
575
+        } else {
576
+        j = k.local ? $("#localVideoContainer") : $(`#participant_${k.id}`)
577
+        // get_mod().id
578
+
579
+        }
580
+        j.css({"--v_index":`"I: ${cnt}"`})
581
+        j.css({"--v_id":`"${k.id}"`})
582
+        j[0].dataset.v_index = cnt
583
+        arr.push(j[0])
584
+        cnt += 1
585
+    }
586
+    v = $(".pseudo_vid")
587
+    for (k of v){
588
+        // clog(k)
589
+        $(k).css({"--v_index":`"I: ${cnt}"`})
590
+        $(k).css({"--v_id":`"pseudo_${cnt}"`})
591
+        parr.push(k)
592
+        $(k)[0].dataset.v_index = cnt
593
+        cnt += 1
594
+    }
595
+
596
+
597
+
598
+    arr.push(...parr)
599
+    window.arig_tiles = jc(arr)
600
+    // remap_set($(".local_vid")[0],1)
601
+    remap_set($(".local_vid")[0],3)
602
+    // remap_set( $(`#participant_${mod_id.id}`)[0],2)
603
+
604
+    arr = remap_sort(arr)
605
+    arr = remap_sort(arr)
606
+    arr = remap_sort(arr)
607
+    window.sorted_tiles = arr
608
+
609
+
610
+
611
+
612
+
613
+    // for 
614
+}
615
+sorted_tiles = window.sorted_tiles || []
616
+function remap_sort(arr){
617
+    // return
618
+    var k,v
619
+    for ([k,v] of indexed_map){
620
+        // clog(k,v)
621
+        var old_index = arr.indexOf(k)
622
+        // clog("K,v",k,v,old_index)
623
+        array_move(arr,old_index,v)
624
+
625
+        // clog(cnt,sorted_tiles.includes(k),v,k)
626
+        // cnt += 1
627
+
628
+    }
629
+    return arr
630
+
631
+}
632
+
633
+function remap_set(vid,loc){
634
+    if (typeof(vid)=="number"){
635
+        vid = sorted_tiles[vid]
636
+    }
637
+    var old = reverse_indexed_map.get(loc)
638
+    // reverse_indexed_map
639
+    indexed_map.delete(old,loc)
640
+    indexed_map.set(vid,loc)
641
+    reverse_indexed_map.set(loc,vid)
642
+    var k,v
643
+    var cnt = 0 
644
+    for ([k,v] of indexed_map){
645
+        // clog(k,v)
646
+        // clog(cnt,sorted_tiles.includes(k),v,k)
647
+        cnt += 1
648
+
649
+    }
650
+
651
+}
652
+function new_move(){
653
+    var j 
654
+    try {
655
+        j = jc(window.sorted_tiles)
656
+    } catch (err) {
657
+        clog("NEW MOVE err:",err)
658
+    }
659
+    // var j = $(".pseudo_vid")
660
+
661
+    // $(".ic4").append(j.splice(0,1))
662
+    // $(".ic4").append(j.splice(0,1))
663
+    $(".ic1").append(j.splice(0,5))
664
+    $(".ic2").append(j.splice(0,3))
665
+    $(".ic3").append(j.splice(0,3))
666
+    // $(".ic6").append(j.splice(0,5))
667
+    const all_extra = j.splice(0)
668
+    if (all_extra.length > 5){
669
+        $(".ic6").addClass("overflow")
670
+    } else {
671
+
672
+        $(".ic6").removeClass("overflow")
673
+    }
674
+    $(".ic6").append(all_extra)
675
+    // $(".ic4").append($(".pseudo_vid")[0])
676
+
677
+    // window.sorted_tiles
678
+}
679
+function new_move2(){
680
+    var j 
681
+    try {
682
+        j = jc(window.sorted_tiles)
683
+    } catch (err) {
684
+        clog("NEW MOVE err:",err)
685
+    }
686
+    // var j = $(".small_vid")
687
+    clog("v1",j.splice(0,1))
688
+    clog("v2",j.splice(0,5))
689
+    clog("v3",j.splice(0,3))
690
+    clog("v4",j.splice(0,3))
691
+    clog("v5",j.splice(0,5))
692
+}
693
+function move_info(){
694
+    var j = $(".small_vid")
695
+    var k,v
696
+    for (v of j){
697
+        clog(v)
698
+    }
699
+    // $(".ic1").append(j.splice(2,5))
700
+    // $(".ic2").append(j.splice(0,3))
701
+    // $(".ic3").append(j.splice(0,3))
702
+    // $(".ic6").append(j.splice(0,5))
703
+    // $(".ic4").append(j.splice(0,1))
704
+}
705
+
706
+// sort_results = []
707
+// sort_results = new Map()
708
+if (window.init_api6){
709
+    // init_api6()
710
+mod_sort()
711
+new_move()
712
+
713
+dispatch_resize()
714
+
715
+
716
+
717
+}
718
+
719
+
720
+
721
+
722
+// timeout_scroll_glob=0
723
+
724
+timeout_scroll_glob = window.timeout_scroll_glob || {
725
+    stop:1,
726
+    timeout:3000,
727
+    rid:0,
728
+    mx_raf:200,
729
+    to_left:1,
730
+}
731
+timeout_scroll_glob.stop=1
732
+function timeout_scroll(rid){
733
+    clog("Tscroll",rid,timeout_scroll_glob)
734
+    if (timeout_scroll_glob.stop || rid != timeout_scroll_glob.rid){
735
+        clog("tscroll stop")
736
+        return
737
+    }
738
+        clog("tscroll continue")
739
+        scroll_send()
740
+    var t = setTimeout(timeout_scroll,timeout_scroll_glob.timeout,rid)
741
+
742
+}
743
+
744
+function timeout_scroll_start(){
745
+    // timeout_scroll_glob.stop = 1
746
+    timeout_scroll_glob.rid += 1
747
+    // timeout_scroll(timeout_scroll_glob.rid)
748
+    setTimeout(timeout_scroll,timeout_scroll_glob.timeout,timeout_scroll_glob.rid)
749
+
750
+}
751
+// timeout_scroll_start()
752
+
753
+
754
+function get_bcrs(arr,fs_bcr){
755
+    var ret = {
756
+        arr:[],
757
+        first_left:0,
758
+        first_left_bcr:0,
759
+        first_right:0,
760
+        first_right_bcr:0,
761
+    }
762
+    var s = $(".ic6").children(".small_vid")
763
+    s.removeClass("ir il ilr ir0 il0")
764
+    var k,v,bcr,isleft,isright
765
+        clog(arr)
766
+    for (v of arr){
767
+        // clog("",v)
768
+        bcr = v.getBoundingClientRect()
769
+        ret.arr.push(bcr)
770
+        isleft = bcr.right < (fs_bcr.right + 10)
771
+        // isright = bcr.left > (fs_bcr.left + 10)
772
+        isright = bcr.left > (fs_bcr.left )
773
+        if (isleft && isright){
774
+            $(v).addClass("ilr")
775
+        } else if (isleft){
776
+            $(v).addClass("il")
777
+
778
+        } else if (isright){
779
+            $(v).addClass("ir")
780
+
781
+        }
782
+        
783
+        if (isleft && ! isright){
784
+            ret.first_left = v
785
+            ret.first_left_bcr = bcr
786
+        }  
787
+        if ( (! ret.first_right ) && !isleft  && isright ){
788
+            ret.first_right = v
789
+            ret.first_right_bcr = bcr
790
+
791
+        }
792
+        
793
+
794
+        // ret.first_left ? :
795
+        // ret.first_right ? :
796
+    }
797
+    clog("````",ret)
798
+    $(ret.first_right).addClass("ir0")
799
+    $(ret.first_left).addClass("il0")
800
+    return ret
801
+
802
+}
803
+
804
+function scroll_to(n){
805
+    var fs,fs_bcr,vid_bcr,ifs
806
+    fs =  $(".c6")[0]
807
+    ifs =  $(".ic6")[0]
808
+    var vid
809
+
810
+    var s = $(".ic6").children(".small_vid")
811
+    // var vid = s[n]
812
+    fs_bcr = fs.getBoundingClientRect() 
813
+    var ov = get_bcrs([...s],fs_bcr)
814
+    // vid_bcr = vid.getBoundingClientRect() 
815
+    // clog([fs,vid])
816
+    /*
817
+    clog(fs_bcr,vid_bcr)
818
+    if (vid_bcr.right <= fs_bcr.right && vid_bcr.left >= fs_bcr.left && 0) {
819
+
820
+        // clog("IN VIEW")
821
+    // } else if (vid_bcr.right <= fs_bcr.right) {
822
+    } 
823
+    if (vid_bcr.right <= fs_bcr.right) {
824
+        // clog("<<",vid_bcr.right - fs_bcr.right )
825
+        // clog("NOT in VIEW")
826
+    // } else if (vid_bcr.left >= fs_bcr.left) {
827
+    } 
828
+     if (vid_bcr.left >= fs_bcr.left) {
829
+        // clog(">>",vid_bcr.left - fs_bcr.left)
830
+    } else {
831
+        // clog("we shouldnt be here")
832
+    }
833
+    */
834
+    var tobj = {
835
+
836
+    }
837
+    var scroll_to_vid = 0
838
+    if (timeout_scroll_glob.to_left){
839
+        if (ov.first_left){
840
+            scroll_to_vid = ov.first_left
841
+            vid_bcr = ov.first_left_bcr
842
+            tobj.inc_mx = vid_bcr.left - fs_bcr.left
843
+            tobj.inc = -8
844
+            tobj.inc = -8
845
+        } else {
846
+            timeout_scroll_glob.to_left = 0
847
+        }
848
+    } else {
849
+        if (ov.first_right){
850
+            scroll_to_vid = ov.first_right
851
+            vid_bcr = ov.first_right_bcr
852
+            tobj.inc_mx = vid_bcr.right - fs_bcr.right
853
+            tobj.inc = 8
854
+
855
+        } else {
856
+            timeout_scroll_glob.to_left = 1
857
+
858
+        }
859
+
860
+    }
861
+
862
+    if (ov.first_right){
863
+        // ov.first_right.scrollIntoView({ behavior: 'smooth', block: 'nearest' ,inline:"nearest"})
864
+    } else if (ov.first_left){
865
+        // ov.first_left.scrollIntoView({ behavior: 'smooth', block: 'nearest' ,inline:"nearest"})
866
+
867
+    }
868
+    // window.
869
+    ov.fs_bcr =fs_bcr
870
+    window.ov=ov
871
+    clog("~~~~",ov,fs_bcr,vid)
872
+    // fs.scr
873
+    // requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,vid,0,0),"z-index")
874
+    // requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,vid,inc,inc_mx,0,0),"z-index")
875
+    // requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,vid,inc,inc_mx,0,0),"z-index")
876
+    // requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,vid,inc,30,0,0),"z-index")
877
+    // requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,vid,3,30,0,0),"z-index")
878
+    scroll_to_vid ?  requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,scroll_to_vid,tobj.inc,tobj.inc_mx,0,0),"z-index") : 0
879
+
880
+}
881
+function raf_clog(fs,vid,cnt,ts){
882
+    clog("raf.",cnt,ts)
883
+
884
+
885
+}
886
+
887
+function raf(fs,vid,inc,inc_mx,cnt,ts0,ts){
888
+
889
+    // clog("raf",this,arguments)
890
+    // clog("raf",cnt,ts)
891
+    // setTimeout(raf_clog,6000,fs,vid,cnt,ts)
892
+    fs.scrollBy(inc,0)
893
+
894
+
895
+    // requestAnimationFrame
896
+    // if (! isNaN(cnt) && cnt > -1 && cnt < timeout_scroll_glob.mx_raf){
897
+    if (Math.abs(inc) < Math.abs(inc_mx) && cnt < timeout_scroll_glob.mx_raf && ts - (ts0 || ts)  < 3000){
898
+    requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,vid,inc,inc_mx - inc ,cnt+1,ts0 || ts))
899
+
900
+    } else {
901
+        clog("FIN",[fs,vid],cnt,ts0,inc_mx,ts,ts-ts0)
902
+        vid.scrollIntoView({ behavior: 'smooth', block: 'nearest' ,inline:"nearest"})
903
+    }
904
+
905
+}
906
+
907
+// function scroll_chain
908
+// scroll_to
909
+setTimeout(scroll_to,500,0)
910
+
911
+
912
+
913
+

+ 0
- 0
m/timer/rhtml.html View File


+ 253
- 0
preload.js View File

@@ -0,0 +1,253 @@
1
+// clog = console.log
2
+// function nop(){}
3
+
4
+glob_dev_hooks = window.glob_dev_hooks || {}
5
+glob_dev_fns = window.glob_dev_fns || {}
6
+window.glob_react = window.glob_react || {i:"r0"}
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+/*
18
+
19
+
20
+function FS_dec2(fn) {
21
+  return function() {
22
+  	// dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
23
+    const ret = fn.apply(this, arguments);
24
+    clog("SVD",{ret,that:this,args:[...arguments]})
25
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
26
+  	// const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
27
+  	// if (ret2){
28
+  		// return ret2.ret
29
+  	// }
30
+    // const result = fn.apply(this, arguments);
31
+    // console.log('Finished');
32
+    return ret;
33
+  }
34
+}
35
+*/
36
+
37
+
38
+// svop = jc(SmallVideoOrig.prototype)
39
+// svop = jc(SmallVideoOrig)
40
+// svop = Object.assign({},glob_react.Filmstrip)
41
+// svop = Object.assign({},SmallVideoOrig.prototype)
42
+// function save_orig()
43
+orig_classes = window.orig_classes || {}
44
+react_trc_log = window.react_trc_log || {}
45
+react_trc_log = window.react_trc_log || {}
46
+
47
+
48
+/*
49
+window.react_trc_log.SmallVideoTrc0= ["$avatar",
50
+ "_setThumbnailSize",
51
+ "bindHoverHandler",
52
+ "initBrowserSpecificProperties",
53
+ "_renderDisplayName",
54
+ "$avatar",
55
+ "initializeAvatar",
56
+ "_getAudioLevelContainer",
57
+ "_getAudioLevelContainer",
58
+ "updateAudioLevelIndicator",
59
+ "addAudioLevelIndicator",
60
+ "updateIndicators",
61
+ "isCurrentlyOnLargeVideo",
62
+ "_isHovered",]
63
+
64
+
65
+
66
+
67
+
68
+react_trc_log.SmallVideoTrc = ["_renderDisplayName",
69
+"_setThumbnailSize",
70
+"showDominantSpeakerIndicator",
71
+"setVideoMutedView",
72
+"initBrowserSpecificProperties",
73
+"bindHoverHandler",
74
+"addAudioLevelIndicator",]
75
+
76
+*/
77
+
78
+
79
+glob_dev_fns.getTileViewGridDimensions_set_num = function(state,maxColumns,onumberOfParticipants){
80
+	// return
81
+	clog("SET NUM PRT")
82
+	var numberOfParticipants
83
+	// if (window.glob_dev_fns && window.glob_dev_fns.ret0){return onumberOfParticipants}
84
+		try {
85
+    var thumbs = glob_react.Filmstrip._getThumbs()
86
+			
87
+// numberOfParticipants = thumbs.remoteThumbs.length + thumbs.localThumb  thumbs.localThumb.length
88
+numberOfParticipants = thumbs.remoteThumbs.length 
89
+if (thumbs.localThumb){
90
+numberOfParticipants += thumbs.localThumb.length 
91
+
92
+}
93
+		} catch(e) {
94
+			clog("getTileViewGridDimensions_set_num err:",e)
95
+			return onumberOfParticipants
96
+
97
+		}
98
+	// clog("getTileViewGridDimensions_set_num ret:",numberOfParticipants,thumbs,onumberOfParticipants)
99
+	// numberOfParticipants < onumberOfParticipants ? numberOfParticipants = onumberOfParticipants : 1
100
+	// clog("getTileViewGridDimensions_set_num ret2:",numberOfParticipants,thumbs,onumberOfParticipants)
101
+	// clog("NUM",numberOfParticipants)
102
+return numberOfParticipants
103
+
104
+
105
+}
106
+
107
+
108
+
109
+
110
+window.glob_dbg = window.glob_dbg || {
111
+	log:{},
112
+	logs:{},
113
+}
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+function log_tb(err,key){
122
+	var key
123
+	try{
124
+
125
+	key in window.glob_dbg.logs ? 1 : window.glob_dbg.logs[key]=[]
126
+	// key in window.glob_dbg.log ? 1 : window.glob_dbg.log[key]=[]
127
+	window.glob_dbg.logs[key].push(err.stack)
128
+	// window.glob_dbg.log[key].push(err)
129
+	// clog("LOG_TB",key,err)
130
+	} catch (e){
131
+		clog("LOG TB",key,"ERR:",e)
132
+	}
133
+	// return new Error()
134
+}
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+function clone_class() {
148
+	var k,v,p 
149
+	if (orig_classes.SmallVideoOrig){
150
+		return
151
+	}
152
+	orig_classes.SmallVideoOrig = {}
153
+	for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
154
+		v=p.value
155
+		orig_classes.SmallVideoOrig[k]=v
156
+	}
157
+
158
+}
159
+// clog("R0...",window.SmallVideoOrig)
160
+/*
161
+function loop_proto(){
162
+	var k,v,p 
163
+	for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
164
+		// clog("~",k,v)
165
+		v=p.value
166
+		clog("~",k,typeof(v))
167
+		if (typeof(v) == "function"){
168
+		SmallVideoOrig.prototype[k] = FS_dec2(v)
169
+
170
+		}
171
+
172
+	}
173
+}
174
+
175
+*/
176
+
177
+
178
+
179
+
180
+
181
+
182
+function loop_vids(vids = $(".small_vid")){
183
+	clog("vids",vids)
184
+	var k,v
185
+	// for (k in [...vids]){
186
+	for (k of vids){
187
+		clog("..",k)
188
+	}
189
+}
190
+
191
+
192
+function log_info0(key){
193
+	var ret = new Map()
194
+	var k,v
195
+	var arr
196
+	for (v of glob_dbg.log[key]){
197
+		ret.setD(v.stack,0)
198
+		ret.set(v.stack,ret.get(v.stack) + 1)
199
+		arr = v.stack.split("\n")
200
+		clog(arr[2])
201
+
202
+		// v.
203
+		// clog(k,v)
204
+	}
205
+	return ret
206
+
207
+}
208
+
209
+
210
+function log_info(key,line_num=2,num_lines=1){
211
+	var ret = new Map()
212
+	var ret1 = new Map()
213
+	var line 
214
+	var k,v
215
+	var arr
216
+	for (v of glob_dbg.logs[key]){
217
+		ret.setD(v,0)
218
+		ret.set(v,ret.get(v) + 1)
219
+		arr = v.split("\n")
220
+		// clog(arr[3])
221
+		// clog(arr[2])
222
+		// line = arr[line_num]
223
+		line = arr.slice(line_num,line_num+num_lines).join("\n")
224
+		// if ("an")
225
+		if (line.includes("anony")){
226
+
227
+		} else {
228
+			// continue
229
+		}
230
+
231
+		// clog(line)
232
+		ret1.setD(line,0)
233
+		ret1.set(line,ret1.get(line) + 1)
234
+
235
+		// v.
236
+		// clog(k,v)
237
+	}
238
+	return ret1
239
+
240
+}
241
+
242
+
243
+function map_loop(m){
244
+	var k,v
245
+	for ([k,v] of m){
246
+		clog(k,v)
247
+	}
248
+}
249
+
250
+
251
+
252
+
253
+// XMPPAttachInfo.data = {atr:"modme"}

+ 91
- 0
proto_ext.js View File

@@ -0,0 +1,91 @@
1
+Map.prototype.setD = function(k,v){
2
+	if (!this.has(k)){
3
+		this.set(k,v)
4
+		// clog("SetD")
5
+		return 1
6
+	}
7
+		// clog("SetD0")
8
+}
9
+
10
+Set.prototype.isSuperset = function(subset) {
11
+    for (var elem of subset) {
12
+        if (!this.has(elem)) {
13
+            return false;
14
+        }
15
+    }
16
+    return true;
17
+}
18
+
19
+Set.prototype.union = function(setB) {
20
+    var union = new Set(this);
21
+    for (var elem of setB) {
22
+        union.add(elem);
23
+    }
24
+    return union;
25
+}
26
+
27
+Set.prototype.intersection = function(setB) {
28
+    var intersection = new Set();
29
+    for (var elem of setB) {
30
+        if (this.has(elem)) {
31
+            intersection.add(elem);
32
+        }
33
+    }
34
+    return intersection;
35
+}
36
+
37
+Set.prototype.difference = function(setB) {
38
+    var difference = new Set(this);
39
+    for (var elem of setB) {
40
+        difference.delete(elem);
41
+    }
42
+    return difference;
43
+}
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+Set.prototype.union_update = function(setB) {
55
+    var union = this;
56
+    for (var elem of setB) {
57
+        union.add(elem);
58
+    }
59
+    return union;
60
+}
61
+
62
+Set.prototype.intersection_update = function(setB) {
63
+    var intersection = this
64
+    for (var elem of setB) {
65
+        if (!this.has(elem)) {
66
+            intersection.delete(elem);
67
+        }
68
+    }
69
+    return intersection;
70
+}
71
+
72
+Set.prototype.difference_update = function(setB) {
73
+    var difference = this;
74
+    for (var elem of setB) {
75
+        difference.delete(elem);
76
+    }
77
+    return difference;
78
+}
79
+
80
+/*
81
+Set.prototype.symDifference = function(setB) {
82
+    var difference = new Set(this.union(setB));
83
+     var intersection = new Set(this.intersection(setB));
84
+    for (var elem of intersection) {
85
+        difference.delete(elem);
86
+    }
87
+    return difference;
88
+}
89
+*/
90
+
91
+console.log("test")

+ 250
- 0
proxy_dev.js View File

@@ -0,0 +1,250 @@
1
+/*
2
+function jval(obj,prop,a2,a3){
3
+	clog("JVAL",arguments,this)
4
+	return "JVAL ~~"
5
+}
6
+
7
+jk = [
8
+// Symbol.toPrimitive,
9
+"toString",
10
+// "valueOf",
11
+// Symbol.toStringTag,
12
+]
13
+
14
+function jget(obj,prop,a2,a3){
15
+  var ret = obj[prop]
16
+  // if (typeof(ret) == "object"){
17
+    // ret = new Proxy(ret,ph)
18
+  // }
19
+  clog("jdv jget",jk.includes(prop),prop in obj,prop,obj)
20
+  if (jk.includes(prop)){
21
+  	clog("RET",this)
22
+  	return "RET_" + jk.indexOf(prop)
23
+  } else if (prop == "valueOf"){
24
+  	return this.valueOf
25
+
26
+  }
27
+  // if (prop in )
28
+  // if (!(prop in obj) && prop != "undefined_key" ){
29
+  	// obj.undefined_key = 1
30
+  // }
31
+  return ret
32
+}
33
+function _jset(obj,prop,val,a3){
34
+  obj[prop] =val
35
+  var ret = obj[prop]
36
+  // if (typeof(ret) == "object"){
37
+    // ret = new Proxy(ret,ph)
38
+  // }
39
+  clog("jdv jget",prop,arguments)
40
+  return ret
41
+}
42
+
43
+jprox = {
44
+get:jget,
45
+valueOf:jval,
46
+// set:jset,
47
+// apply:jcall,
48
+}
49
+
50
+*/
51
+
52
+rfns = {
53
+
54
+	rfn_apply(){																													
55
+		clog("RFN:apply")
56
+return Reflect.apply(...arguments)
57
+	},
58
+	rfn_construct(){																				
59
+		clog("RFN:construct")
60
+return Reflect.construct(...arguments)
61
+	},
62
+	rfn_defineProperty(){																						
63
+		clog("RFN:defineProperty")
64
+return Reflect.defineProperty(...arguments)
65
+	},
66
+	rfn_deleteProperty(){																
67
+		clog("RFN:deleteProperty")
68
+return Reflect.deleteProperty(...arguments)
69
+	},
70
+	rfn_get0(obj, prop,receiver){																						
71
+		// clog("RFN:get",this.cnt,prop)
72
+		if (prop == "dev"){
73
+			clog("RFN:GET DEV!")
74
+		}
75
+		if (!mx_glob.stop){
76
+			// clog(",>>>>",prop,typeof(prop))
77
+			var err = new Error()
78
+			window.log_tb(err,"get") 
79
+			try {
80
+				// isNan(Number(prop))
81
+				var sprop
82
+			 sprop = prop.toString()
83
+				if (isNaN(Number(sprop))){
84
+			 sprop = prop.toString()
85
+				} else {
86
+			 sprop = "number"
87
+
88
+				}
89
+			// sprop = typeof(prop)=="symbol" : ?
90
+			window.log_tb(err,"get_"+sprop) 
91
+
92
+		} catch (e) {
93
+			clog("RFN:ERR",prop)
94
+
95
+			window.log_tb(err,"get_"+e) 
96
+		}
97
+
98
+		}
99
+		// mx_glob.stop ? 1 : window.log_tb(new Error(),"get") 
100
+		// window.log_tb(new Error(),"get")
101
+return Reflect.get(...arguments)
102
+	},
103
+
104
+	rfn_get(obj, prop,receiver){																						
105
+		// clog("RFN:get",this.cnt,prop)
106
+		if (prop == "dev"){
107
+			clog("RFN:GET DEV!")
108
+		} else if (prop == "length" && !mx_glob.stop){
109
+			window.log_tb(new Error(),"getlen") 
110
+
111
+			return obj[prop] 
112
+			// return obj[prop] + 1
113
+		}
114
+		// mx_glob.stop ? 1 : window.log_tb(new Error(),"get") 
115
+		// window.log_tb(new Error(),"get")
116
+return Reflect.get(...arguments)
117
+	},
118
+
119
+	rfn_getOwnPropertyDescriptor(){																	
120
+		clog("RFN:getOwnPropertyDescriptor")
121
+return Reflect.getOwnPropertyDescriptor(...arguments)
122
+	},
123
+	rfn_getPrototypeOf(){																
124
+		clog("RFN:getPrototypeOf")
125
+return Reflect.getPrototypeOf(...arguments)
126
+	},
127
+	rfn_has(){																							
128
+		// clog("RFN:has")
129
+		mx_glob.stop ? 1 : window.log_tb(new Error(),"has") 
130
+		// window.log_tb(new Error(),"has")
131
+return Reflect.has(...arguments)
132
+	},
133
+	rfn_isExtensible(){																					
134
+		clog("RFN:isExtensible")
135
+return Reflect.isExtensible(...arguments)
136
+	},
137
+	rfn_ownKeys(){																				
138
+		clog("RFN:ownKeys")
139
+return Reflect.ownKeys(...arguments)
140
+	},
141
+	rfn_preventExtensions(){																		
142
+		clog("RFN:preventExtensions")
143
+return Reflect.preventExtensions(...arguments)
144
+	},
145
+	rfn_set(){																					
146
+		clog("RFN:set")
147
+return Reflect.set(...arguments)
148
+	},
149
+	rfn_setPrototypeOf(){																						
150
+		clog("RFN:setPrototypeOf")
151
+return Reflect.setPrototypeOf(...arguments)
152
+	},
153
+
154
+}
155
+
156
+
157
+
158
+rprox_base = window.rprox_base || {
159
+	cnt:0,
160
+	// stop:0,
161
+}
162
+rprox0 = {
163
+	cnt:0,
164
+apply: rfns.rfn_apply,
165
+construct: rfns.rfn_construct,
166
+defineProperty: rfns.rfn_defineProperty,
167
+deleteProperty: rfns.rfn_deleteProperty,
168
+get: rfns.rfn_get,
169
+getOwnPropertyDescriptor: rfns.rfn_getOwnPropertyDescriptor,
170
+getPrototypeOf: rfns.rfn_getPrototypeOf,
171
+has: rfns.rfn_has,
172
+isExtensible: rfns.rfn_isExtensible,
173
+ownKeys: rfns.rfn_ownKeys,
174
+preventExtensions: rfns.rfn_preventExtensions,
175
+set: rfns.rfn_set,
176
+setPrototypeOf: rfns.rfn_setPrototypeOf,
177
+}
178
+
179
+rprox = {
180
+	cnt:0,
181
+// apply: rfns.rfn_apply,
182
+// construct: rfns.rfn_construct,
183
+// defineProperty: rfns.rfn_defineProperty,
184
+// deleteProperty: rfns.rfn_deleteProperty,
185
+get: rfns.rfn_get,
186
+// getOwnPropertyDescriptor: rfns.rfn_getOwnPropertyDescriptor,
187
+// getPrototypeOf: rfns.rfn_getPrototypeOf,
188
+// has: rfns.rfn_has,
189
+// isExtensible: rfns.rfn_isExtensible,
190
+// ownKeys: rfns.rfn_ownKeys,
191
+// preventExtensions: rfns.rfn_preventExtensions,
192
+// set: rfns.rfn_set,
193
+// setPrototypeOf: rfns.rfn_setPrototypeOf,
194
+}
195
+
196
+fbp = []
197
+mx_glob = window.mx_glob || {
198
+	mx:60,
199
+	stop:0,
200
+} 
201
+function stop_mx(){
202
+	clog("RFN STOP MX")
203
+	mx_glob.stop = !0
204
+}
205
+function gen_proxy(){
206
+	jc(rprox)
207
+	var ret = Object.assign({},rprox,rprox_base)
208
+	rprox_base.cnt+=1
209
+	return ret
210
+}
211
+
212
+
213
+function get_states_timer(t,mx){
214
+	// clog("rfn get state...",t,mx)
215
+	if (mx >= 0){
216
+	setTimeout(get_states_timer,t,t,mx - 1)
217
+	} else {
218
+		clog("TIMER FIN rfn")
219
+	}
220
+	setTimeout(get_states,1,mx)
221
+
222
+	
223
+}
224
+
225
+function get_states(mx){
226
+	// clog("rfn get state",mx,fbp,)
227
+	try {
228
+		fbp.push(APP.store.getState()['features/base/participants'])
229
+	} catch (err) {
230
+		fbp.push(err)
231
+	}
232
+
233
+}
234
+
235
+setTimeout(stop_mx,6000)
236
+// get_states_timer(300,30)
237
+// get_states_timer(1,400)
238
+// get_states_timer(1000,2)
239
+
240
+
241
+// fbp  = APP.store.getState()['features/base/participants'] 
242
+
243
+
244
+
245
+// _j = {a:":"}
246
+// j = new Proxy(_j,rprox)
247
+// s = new Set([])
248
+
249
+
250
+// clog("~~~~~~",arrs)

+ 102
- 0
proxy_dev2.js View File

@@ -0,0 +1,102 @@
1
+
2
+function base_fn(){
3
+	clog("base_fn")
4
+}
5
+base_fn = {
6
+	"a":"xyz"
7
+}
8
+function base_fn2(){
9
+	clog("base_fn2")
10
+}
11
+
12
+
13
+
14
+rfns2 = {
15
+
16
+	rfn_apply(){																													
17
+		clog("RFN:apply")
18
+return Reflect.apply(...arguments)
19
+	},
20
+	rfn_construct(){																				
21
+		clog("RFN:construct")
22
+return Reflect.construct(...arguments)
23
+	},
24
+	rfn_defineProperty(){																						
25
+		clog("RFN:defineProperty")
26
+return Reflect.defineProperty(...arguments)
27
+	},
28
+	rfn_deleteProperty(){																
29
+		clog("RFN:deleteProperty")
30
+return Reflect.deleteProperty(...arguments)
31
+	},
32
+	rfn_get(){																						
33
+		clog("RFN:get")
34
+return Reflect.get(...arguments)
35
+	},
36
+	rfn_getOwnPropertyDescriptor(){																	
37
+		clog("RFN:getOwnPropertyDescriptor")
38
+return Reflect.getOwnPropertyDescriptor(...arguments)
39
+	},
40
+	rfn_getPrototypeOf(){																
41
+		clog("RFN:getPrototypeOf")
42
+return Reflect.getPrototypeOf(...arguments)
43
+	},
44
+	rfn_has(){																							
45
+		clog("RFN:has")
46
+return Reflect.has(...arguments)
47
+	},
48
+	rfn_isExtensible(){																					
49
+		clog("RFN:isExtensible")
50
+return Reflect.isExtensible(...arguments)
51
+	},
52
+	rfn_ownKeys(){																				
53
+		clog("RFN:ownKeys")
54
+return Reflect.ownKeys(...arguments)
55
+	},
56
+	rfn_preventExtensions(){																		
57
+		clog("RFN:preventExtensions")
58
+return Reflect.preventExtensions(...arguments)
59
+	},
60
+	rfn_set(){																					
61
+		clog("RFN:set")
62
+return Reflect.set(...arguments)
63
+	},
64
+	rfn_setPrototypeOf(){																						
65
+		clog("RFN:setPrototypeOf")
66
+return Reflect.setPrototypeOf(...arguments)
67
+	},
68
+
69
+}
70
+
71
+
72
+
73
+rprox2 = {
74
+apply: rfns.rfn_apply,
75
+construct: rfns.rfn_construct,
76
+defineProperty: rfns.rfn_defineProperty,
77
+deleteProperty: rfns.rfn_deleteProperty,
78
+get: rfns.rfn_get,
79
+getOwnPropertyDescriptor: rfns.rfn_getOwnPropertyDescriptor,
80
+getPrototypeOf: rfns.rfn_getPrototypeOf,
81
+has: rfns.rfn_has,
82
+isExtensible: rfns.rfn_isExtensible,
83
+ownKeys: rfns.rfn_ownKeys,
84
+preventExtensions: rfns.rfn_preventExtensions,
85
+set: rfns.rfn_set,
86
+setPrototypeOf: rfns.rfn_setPrototypeOf,
87
+}
88
+
89
+
90
+
91
+
92
+// dec_fn = new Proxy(base_fn,rprox2)
93
+
94
+// base_fn.__proto__
95
+base_fn.__proto__ = new Proxy(base_fn.__proto__,rprox2)
96
+
97
+// base_fn.prototype = new Proxy(base_fn.prototype,rprox2)
98
+
99
+
100
+
101
+base_fn.q=3
102
+base_fn.q={}

+ 83
- 0
quick_tiling_fix.js View File

@@ -0,0 +1,83 @@
1
+
2
+
3
+
4
+
5
+window.qt = {
6
+	cnt:0,
7
+	mx:20,
8
+	stop:0,
9
+}
10
+function onAll_run(a,b,c){
11
+	clog("onAll_run",qt.cnt,a,b,c)
12
+
13
+	// clog("onAll",arguments)
14
+	qt.cnt += 1
15
+	if (qt.cnt > qt.mx || qt.stop){
16
+		clog("stopping",qt.cnt > qt.mx || qt.stop,{cnt:qt.cnt , mx:qt.mx , stop:qt.stop})
17
+		return false
18
+	}
19
+	return true
20
+}
21
+
22
+function onAll(a,b,c){
23
+	clog("onAll_xyz",qt.cnt,a,b,c)
24
+
25
+	// clog("onAll",arguments)
26
+	qt.cnt += 1
27
+	if (qt.cnt > qt.mx || qt.stop){
28
+		clog("stopping",qt.cnt > qt.mx || qt.stop,{cnt:qt.cnt , mx:qt.mx , stop:qt.stop})
29
+		return false
30
+	}
31
+	return true
32
+}
33
+function onAll_isMatch(a,b,c){
34
+	clog("onAll_isMatch",qt.cnt,a,b,c)
35
+
36
+	// clog("onAll",arguments)
37
+	qt.cnt += 1
38
+	if (qt.cnt > qt.mx || qt.stop){
39
+		clog("stopping",qt.cnt > qt.mx || qt.stop,{cnt:qt.cnt , mx:qt.mx , stop:qt.stop})
40
+		return false
41
+	}
42
+	clog("ISMATCH RET")
43
+	return true
44
+}
45
+var jhndlr_opt_null = {
46
+from: undefined,
47
+handler: onAll,
48
+run: onAll_run,
49
+id: null,
50
+name: null,
51
+// "http://jitsi.org/jitmeet"
52
+ns: null,
53
+options: {matchBareFromJid: false, ignoreNamespaceFragment: false},
54
+type: null,
55
+user: true,
56
+isMatch:onAll_isMatch,
57
+// cstr:"test"
58
+};
59
+
60
+
61
+
62
+hprx = {
63
+	get:function(obj, prop,receiver){
64
+		clog("HPRX",obj, prop,receiver)
65
+		return Reflect.get(...arguments)
66
+	},
67
+}
68
+
69
+
70
+// APP.connection.xmpp.connection._stropheConn.handlers
71
+// APP.connection.xmpp.connection._stropheConn.addHandlers.push(jhndlr_opt_null)
72
+// APP.connection.xmpp.connection._stropheConn.addHandlers.push(new Proxy(jhndlr_opt_null,hprx))
73
+// APP.connection.xmpp.connection._stropheConn.handlers.push(jhndlr_opt_null)
74
+// APP.conference._room.room.addEventListener(jhndlr_opt_null)
75
+
76
+// addListener
77
+
78
+
79
+// APP.store.subscribe(onAll)
80
+
81
+// APP.conference._room.room.connection
82
+// APP.conference._room.room.connection.addEventListener("CLIENT_RESIZED",onAll)
83
+// APP.conference._room.room.connection.addEventListener("USER_JOINED",onAll)

+ 151
- 0
r0.css View File

@@ -0,0 +1,151 @@
1
+
2
+
3
+#filmstripRemoteVideosContainer {
4
+	/*width: 100% !important;*/
5
+}
6
+#filmstripRemoteVideos{
7
+overflow-x: auto !important;
8
+
9
+}
10
+
11
+.pseudo_vid{
12
+	outline: 2px solid blue;
13
+}
14
+
15
+
16
+.small_vid {
17
+	/*outline: 2px solid blue; */
18
+	/*outline: 5px solid blue; */
19
+	outline: 1px solid #fff; 
20
+	outline: 1px solid #888; 
21
+}
22
+
23
+
24
+.jdiv {
25
+	/*position: */
26
+	/*width: */
27
+}
28
+/*<div class="indicator_trc jdiv"></div>*/
29
+/*indicator_trc*/
30
+
31
+
32
+/*vid_toptoolbar_hook*/
33
+
34
+
35
+
36
+
37
+
38
+.hidden_vid {
39
+	position: relative;
40
+	/*position: absolute;*/
41
+	width:     80px !important;
42
+	min-width: 80px !important;
43
+	display: none;
44
+
45
+}
46
+.pseudo_vid {
47
+}
48
+
49
+.overlay {
50
+	position: absolute;
51
+	width: 100%;
52
+	height: 100%;
53
+	top: 0;
54
+	left: 0;
55
+	outline: 2px solid #0ff;
56
+	background-color: #ff08;
57
+	background-color: #0ff8;
58
+	/*z-index: 351;*/
59
+}
60
+
61
+.button-group-center *{
62
+	/*z-index: 0 !important;*/
63
+}
64
+
65
+.toolbox-icon {
66
+	/*z-index: 0 !important;*/
67
+	/*display: none ;*/
68
+}
69
+
70
+.top_toolbox {
71
+	/*position: absolute;*/
72
+	/*display: none;*/
73
+	position: relative;
74
+	z-index: 1;
75
+	width: 100%;
76
+	/*width: 50%;*/
77
+	height: 100px;
78
+	/*background-color: #0ff8;*/
79
+	/*background-color: #0ff;*/
80
+	/*background-image:linear-gradient(to bottom,rgba(0,0,0,.5),rgba(0,0,0,0));*/
81
+	background-image:linear-gradient(to bottom,rgba(255,255,255,1),rgba(71,71,71,0));
82
+	background-image:linear-gradient(to bottom,rgba(255,255,255,.3),rgba(71,71,71,0));
83
+	/*background-image:linear-gradient(to bottom,rgba(0,0,0,.9),rgba(71,71,71,0));*/
84
+	/*border-radius: 20px;*/
85
+	/*outline: 2px solid #ff0;*/
86
+
87
+}
88
+
89
+.toolbox-content > *{
90
+	/*zoom:.5;*/
91
+}
92
+
93
+
94
+[aria-label="Leave the call"] {
95
+
96
+}
97
+
98
+.new-toolbox .toolbox-content  .audio-preview .toolbox-button{
99
+	    margin-left:  0px;
100
+
101
+}
102
+.new-toolbox .toolbox-content  .video-preview .toolbox-button{
103
+	    margin-right: 0px;
104
+
105
+}
106
+
107
+.new-toolbox .toolbox-content .toolbox-button{
108
+	/*margin: 0;*/
109
+	    margin-right: 4px;
110
+	    margin-left:  4px;
111
+}
112
+.button-group-right {
113
+	/*flex-grow:0;*/
114
+	width: 25% !important;
115
+}
116
+.button-group-left{
117
+	width: 25% !important;
118
+	/*flex-grow:0;*/
119
+
120
+}
121
+.button-group-center {
122
+	width: 50% !important;
123
+	/*flex-grow:3;*/
124
+}
125
+
126
+
127
+.subject {
128
+	background-image:unset;
129
+	text-align: unset;
130
+	padding-left: 75px;
131
+	padding-right: 75px;
132
+
133
+
134
+
135
+	/*display: none;*/
136
+}
137
+
138
+
139
+/*aria-label="Toggle mute video"*/
140
+/*$(`[aria-label="Toggle mute video"]`)*/
141
+
142
+
143
+.tile-view #largeVideoContainer {
144
+    /*background-color: #033 !important;*/
145
+    background-color: #366 !important;
146
+    background-color: #00f !important;
147
+    background-color: #225 !important;
148
+    background-color: #246 !important;
149
+}
150
+
151
+

+ 287
- 0
r0.js View File

@@ -0,0 +1,287 @@
1
+// clog = console.log
2
+// function nop(){}
3
+
4
+glob_dev_hooks = window.glob_dev_hooks || {}
5
+glob_dev_fns = window.glob_dev_fns || {}
6
+window.glob_react = window.glob_react || {i:"r0"}
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+function wt(a1,a2){
32
+	var c = 0
33
+	var cmx = 10
34
+	clog(a1 < a2,a1 > a2)
35
+	while (a1 < a2){
36
+		c += 1
37
+		clog(".",c)
38
+		if (cmx < c){clog("r",c);return}
39
+
40
+	}
41
+
42
+
43
+}
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+function FS_dec2(fn) {
61
+  return function() {
62
+  	// dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
63
+    const ret = fn.apply(this, arguments);
64
+    clog("SVD",{ret,that:this,args:[...arguments]})
65
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
66
+  	// const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
67
+  	// if (ret2){
68
+  		// return ret2.ret
69
+  	// }
70
+    // const result = fn.apply(this, arguments);
71
+    // console.log('Finished');
72
+    return ret;
73
+  }
74
+}
75
+
76
+
77
+// svop = jc(SmallVideoOrig.prototype)
78
+// svop = jc(SmallVideoOrig)
79
+// svop = Object.assign({},glob_react.Filmstrip)
80
+// svop = Object.assign({},SmallVideoOrig.prototype)
81
+// function save_orig()
82
+orig_classes = window.orig_classes || {}
83
+react_trc_log = window.react_trc_log || {}
84
+react_trc_log = window.react_trc_log || {}
85
+window.react_trc_log.SmallVideoTrc0= ["$avatar",
86
+ "_setThumbnailSize",
87
+ "bindHoverHandler",
88
+ "initBrowserSpecificProperties",
89
+ "_renderDisplayName",
90
+ "$avatar",
91
+ "initializeAvatar",
92
+ "_getAudioLevelContainer",
93
+ "_getAudioLevelContainer",
94
+ "updateAudioLevelIndicator",
95
+ "addAudioLevelIndicator",
96
+ "updateIndicators",
97
+ "isCurrentlyOnLargeVideo",
98
+ "_isHovered",]
99
+
100
+
101
+
102
+
103
+
104
+react_trc_log.SmallVideoTrc = ["_renderDisplayName",
105
+"_setThumbnailSize",
106
+"showDominantSpeakerIndicator",
107
+"setVideoMutedView",
108
+"initBrowserSpecificProperties",
109
+"bindHoverHandler",
110
+"addAudioLevelIndicator",]
111
+
112
+
113
+
114
+glob_dev_fns.getTileViewGridDimensions_set_num = function(state,maxColumns,onumberOfParticipants){
115
+	// return
116
+	// clog("SET NUM PRT")
117
+	var numberOfParticipants
118
+	// if (window.glob_dev_fns && window.glob_dev_fns.ret0){return onumberOfParticipants}
119
+		try {
120
+    var thumbs = glob_react.Filmstrip._getThumbs()
121
+			
122
+// numberOfParticipants = thumbs.remoteThumbs.length + thumbs.localThumb  thumbs.localThumb.length
123
+numberOfParticipants = thumbs.remoteThumbs.length 
124
+if (thumbs.localThumb){
125
+numberOfParticipants += thumbs.localThumb.length 
126
+
127
+}
128
+		} catch(e) {
129
+			clog("getTileViewGridDimensions_set_num err:",e)
130
+			return onumberOfParticipants
131
+
132
+		}
133
+	// clog("getTileViewGridDimensions_set_num ret:",numberOfParticipants,thumbs,onumberOfParticipants)
134
+	// numberOfParticipants < onumberOfParticipants ? numberOfParticipants = onumberOfParticipants : 1
135
+	// clog("getTileViewGridDimensions_set_num ret2:",numberOfParticipants,thumbs,onumberOfParticipants)
136
+	// clog("NUM",numberOfParticipants)
137
+return numberOfParticipants
138
+
139
+
140
+}
141
+
142
+
143
+
144
+
145
+window.glob_dbg = window.glob_dbg || {
146
+	log:{},
147
+	logs:{},
148
+}
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+function log_tb(err,key){
157
+	var key
158
+	try{
159
+
160
+	key in window.glob_dbg.logs ? 1 : window.glob_dbg.logs[key]=[]
161
+	// key in window.glob_dbg.log ? 1 : window.glob_dbg.log[key]=[]
162
+	window.glob_dbg.logs[key].push(err.stack)
163
+	// window.glob_dbg.log[key].push(err)
164
+	// clog("LOG_TB",key,err)
165
+	} catch (e){
166
+		clog("LOG TB",key,"ERR:",e)
167
+	}
168
+	// return new Error()
169
+}
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+function clone_class() {
183
+	var k,v,p 
184
+	if (orig_classes.SmallVideoOrig){
185
+		return
186
+	}
187
+	orig_classes.SmallVideoOrig = {}
188
+	for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
189
+		v=p.value
190
+		orig_classes.SmallVideoOrig[k]=v
191
+	}
192
+
193
+}
194
+clog("R0...",window.SmallVideoOrig)
195
+
196
+function loop_proto(){
197
+	var k,v,p 
198
+	for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
199
+		// clog("~",k,v)
200
+		v=p.value
201
+		clog("~",k,typeof(v))
202
+		if (typeof(v) == "function"){
203
+		SmallVideoOrig.prototype[k] = FS_dec2(v)
204
+
205
+		}
206
+
207
+	}
208
+}
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+function loop_vids(vids = $(".small_vid")){
217
+	clog("vids",vids)
218
+	var k,v
219
+	// for (k in [...vids]){
220
+	for (k of vids){
221
+		clog("..",k)
222
+	}
223
+}
224
+
225
+
226
+function log_info0(key){
227
+	var ret = new Map()
228
+	var k,v
229
+	var arr
230
+	for (v of glob_dbg.log[key]){
231
+		ret.setD(v.stack,0)
232
+		ret.set(v.stack,ret.get(v.stack) + 1)
233
+		arr = v.stack.split("\n")
234
+		clog(arr[2])
235
+
236
+		// v.
237
+		// clog(k,v)
238
+	}
239
+	return ret
240
+
241
+}
242
+
243
+
244
+function log_info(key,line_num=2,num_lines=1){
245
+	var ret = new Map()
246
+	var ret1 = new Map()
247
+	var line 
248
+	var k,v
249
+	var arr
250
+	for (v of glob_dbg.logs[key]){
251
+		ret.setD(v,0)
252
+		ret.set(v,ret.get(v) + 1)
253
+		arr = v.split("\n")
254
+		// clog(arr[3])
255
+		// clog(arr[2])
256
+		// line = arr[line_num]
257
+		line = arr.slice(line_num,line_num+num_lines).join("\n")
258
+		// if ("an")
259
+		if (line.includes("anony")){
260
+
261
+		} else {
262
+			// continue
263
+		}
264
+
265
+		// clog(line)
266
+		ret1.setD(line,0)
267
+		ret1.set(line,ret1.get(line) + 1)
268
+
269
+		// v.
270
+		// clog(k,v)
271
+	}
272
+	return ret1
273
+
274
+}
275
+
276
+
277
+function map_loop(m){
278
+	var k,v
279
+	for ([k,v] of m){
280
+		clog(k,v)
281
+	}
282
+}
283
+
284
+
285
+
286
+
287
+// XMPPAttachInfo.data = {atr:"modme"}

+ 92
- 0
r0a.css View File

@@ -0,0 +1,92 @@
1
+
2
+
3
+#filmstripRemoteVideosContainer {
4
+	/*width: 100% !important;*/
5
+}
6
+#filmstripRemoteVideos{
7
+overflow-x: auto !important;
8
+
9
+}
10
+
11
+.pseudo_vid{
12
+	outline: 2px solid blue;
13
+}
14
+
15
+
16
+.small_vid {
17
+	/*outline: 2px solid blue; */
18
+	/*outline: 5px solid blue; */
19
+	outline: 1px solid #fff; 
20
+	outline: 1px solid #888; 
21
+}
22
+
23
+
24
+.jdiv {
25
+	/*position: */
26
+	/*width: */
27
+}
28
+/*<div class="indicator_trc jdiv"></div>*/
29
+/*indicator_trc*/
30
+
31
+
32
+/*~~~~~~~~~~~~~~~~~~~~~*/
33
+/*vid_toptoolbar_hook*/
34
+
35
+
36
+
37
+.jdiv:not(.t2):after {
38
+	position: absolute;
39
+	content: "ABC";
40
+	background-color: red;
41
+}
42
+
43
+
44
+.t3:after{
45
+	background-color: blue;
46
+	right: 20px;
47
+
48
+}
49
+.t2:after{
50
+	background-color: green;
51
+	left: 20px;
52
+}
53
+
54
+.t1:after{
55
+	background-color: #0ff;
56
+	top: 40px;
57
+}
58
+/*.vid_toptoolbar_hook{*/
59
+.t2{
60
+	width: 10px;
61
+	height:  10px;
62
+	background-color: #fff;
63
+	display: inline-block;
64
+	display: inline;
65
+	position: relative;
66
+	position: absolute;
67
+	/*position: all;*/
68
+}
69
+
70
+/*.vid_toptoolbar_hook:after {*/
71
+.t2:after {
72
+	/*position: relative;*/
73
+	/*position: unset;*/
74
+	display: inline-block;
75
+	display: inline;
76
+	top: 0px;
77
+	outline: 2px solid #ff0;
78
+}
79
+
80
+/*~~~~~~~~~~~~~~~~~~~~~*/
81
+.hidden_vid {
82
+	position: relative;
83
+	/*position: absolute;*/
84
+	width:     80px !important;
85
+	min-width: 80px !important;
86
+	/*display: none;*/
87
+
88
+}
89
+.pseudo_vid {
90
+	/*display: none;*/
91
+	/*position: absolute;*/
92
+}

+ 327
- 0
r0b.js View File

@@ -0,0 +1,327 @@
1
+// clog = console.log
2
+// function nop(){}
3
+
4
+glob_dev_hooks = window.glob_dev_hooks || {}
5
+glob_dev_fns = window.glob_dev_fns || {}
6
+window.glob_react = window.glob_react || {i:"r0"}
7
+
8
+
9
+function FS_dec(fn) {
10
+  return function() {
11
+  	dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
12
+    const ret = fn.apply(this, arguments);
13
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
14
+  	const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
15
+  	if (ret2){
16
+  		return ret2.ret
17
+  	}
18
+    // const result = fn.apply(this, arguments);
19
+    // console.log('Finished');
20
+    return ret;
21
+  }
22
+}
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+function save_orig(){
31
+
32
+glob_orig = window.glob_orig || {
33
+	Filmstrip:{},
34
+	fs:{},
35
+	rf_filmstrip:{},
36
+}
37
+
38
+
39
+	glob_orig.Filmstrip = Object.assign({},glob_react.Filmstrip)
40
+	glob_orig.fs = Object.assign({},glob_react.fs)
41
+	glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
42
+	save_orig = nop
43
+}
44
+
45
+
46
+
47
+
48
+if (window.glob_orig){
49
+
50
+save_orig = nop
51
+// save_orig()
52
+}
53
+if (!window.glob_orig && window.glob_react){
54
+
55
+// save_orig = nop
56
+save_orig()
57
+}
58
+if (window.glob_orig && window.glob_react){
59
+dec_fs()
60
+// save_orig = nop
61
+// save_orig()
62
+}
63
+
64
+// if ((!window.glob_orig) && ){
65
+
66
+// }
67
+
68
+// glob_react.rf_filmstrip.calculateThumbnailSizeForTileView
69
+
70
+// calculateThumbnailSizeForTileView
71
+
72
+dec_fns = {
73
+	resizeThumbnailsForTileView:{
74
+		pre:function(){
75
+			// console.trace("resizeThumbnailsForTileView")
76
+
77
+		},
78
+		post:function(){
79
+
80
+		},
81
+
82
+	}
83
+}
84
+
85
+
86
+function rt(w,h = 0,force = true){
87
+	h ? 0 : h = w / (16/9)   
88
+	glob_react.Filmstrip.resizeThumbnailsForTileView(w,h,force)
89
+}
90
+
91
+function dec_fs2(){
92
+	var k,v
93
+	glob_react.rf_filmstrip.calculateThumbnailSizeForTileView = FS_dec(glob_react.rf_filmstrip.calculateThumbnailSizeForTileView)
94
+
95
+	// for ([k,v] of Object.entries(glob_orig.Filmstrip)){
96
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
97
+		// clog("~",k,v.name)
98
+		// glob_react.Filmstrip[k] = FS_dec(v)
99
+	// }
100
+
101
+}
102
+
103
+
104
+
105
+function dec_fs(){
106
+	var k,v
107
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
108
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
109
+		clog("~",k,v.name)
110
+		glob_react.Filmstrip[k] = FS_dec(v)
111
+	}
112
+
113
+}
114
+
115
+
116
+
117
+modkeys =  ["calculateThumbnailSizeForTileView",
118
+"TILE_VIEW_SIDE_MARGINS",
119
+"SET_TILE_VIEW_DIMENSIONS",]
120
+
121
+// glob_react.rf_filmstrip
122
+function check_mod_keys(){
123
+	var k
124
+	for (k of modkeys){
125
+		clog(k,glob_react.rf_filmstrip[k])
126
+	}
127
+
128
+}
129
+
130
+// function setTileViewDimensions_x(dimensions: Object, windowSize: Object) {
131
+function setTileViewDimensions_x() {
132
+    // dev hook
133
+    if (window.glob_dev_fns && window.glob_dev_fns.setTileViewDimensions){
134
+        // var ret = window.glob_dev_fns.setTileViewDimensions.apply(this,...arguments)
135
+        var ret = window.glob_dev_fns.setTileViewDimensions({that:this,args:arguments})
136
+        if (ret){
137
+            return ret.ret
138
+        }
139
+    }
140
+
141
+    const thumbnailSize = calculateThumbnailSizeForTileView({
142
+        ...dimensions,
143
+        ...windowSize
144
+    });
145
+    const filmstripWidth = dimensions.columns * (TILE_VIEW_SIDE_MARGINS + thumbnailSize.width);
146
+
147
+    return {
148
+        type: SET_TILE_VIEW_DIMENSIONS,
149
+        dimensions: {
150
+            gridDimensions: dimensions,
151
+            xtra:"xtra_val",
152
+            thumbnailSize,
153
+            filmstripWidth
154
+        }
155
+    };
156
+}
157
+
158
+
159
+
160
+glob_dev_fns.getTileViewGridDimensions = function(numberOfParticipants,state,maxColumns){
161
+	clog("getTileViewGridDimensions....")
162
+
163
+}
164
+glob_dev_fns.setTileViewDimensions_x = function(o,dimensions,windowSize,that){
165
+	// console.trace("STV")
166
+	// SET_TILE_VIEW_DIMENSIONS
167
+	windowSize = o.args[1]
168
+	dimensions = o.args[0]
169
+	clog("glob_dev_fns.setTileViewDimensions",arguments)
170
+	
171
+
172
+
173
+	var aspect = 16/9
174
+
175
+	Thumbs =  glob_react.Filmstrip._getThumbs()
176
+
177
+
178
+	const topBottomPadding = 200;
179
+	const sideMargins = 30 * 2;
180
+
181
+
182
+	var thumbs_count = Thumbs.remoteThumbs.length + Thumbs.localThumb.length
183
+
184
+	var avail_width = windowSize.clientWidth - sideMargins
185
+	var avail_height = windowSize.clientHeight - topBottomPadding
186
+	clog("",avail_width,avail_height)
187
+    const r1 = avail_width/avail_height
188
+
189
+    const r0 = aspect
190
+
191
+	var clo = calc_layout2((avail_width/avail_height)/aspect,thumbs_count)
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+	// calc_layout2
203
+	clog(windowSize,dimensions)
204
+
205
+
206
+
207
+
208
+
209
+    var bw = avail_width 
210
+    var w2,width
211
+    // clog(xgrp,xgrp.length,clo)
212
+    if ((r1/r0) * (clo.c / clo.r) > 1) {
213
+        w2 = bw / ((r1/r0) * clo.c) 
214
+    } else {
215
+        w2 = bw / ( clo.r) 
216
+    }
217
+
218
+    // width = 310
219
+    // w2 =w2 - 12
220
+    w2 =w2 - (10 * aspect)
221
+    // w2 =w2 - 15
222
+    // w2 =w2 - 16
223
+    // width = Math.round(w2)
224
+    width = Math.floor(w2)
225
+
226
+
227
+
228
+    var height = Math.floor(width / (aspect))
229
+    clog(clo)
230
+    var avail_width2 = avail_width
231
+    // if (clo.ni < clo.n){
232
+    	// r and c are misnamed!
233
+
234
+    var col,max_width
235
+    if (clo.c == 2){
236
+    	col = Math.ceil(clo.ni / 2)
237
+    	max_width = (col + .5) * width
238
+    	clog("MX...",col ,avail_width2,max_width)
239
+    	if (max_width < avail_width2){
240
+    	clog("MX",avail_width2,max_width)
241
+    		avail_width2 = max_width
242
+    	}
243
+
244
+    }
245
+
246
+    if (clo.ni <= clo.n + clo.c){
247
+
248
+    	// avail_width2  = Math.round(width * clo.) 
249
+    	// avail_width2  = Math.round(avail_width2 - width/2) 
250
+
251
+    }
252
+
253
+
254
+
255
+	// return
256
+	const SET_TILE_VIEW_DIMENSIONS = "SET_TILE_VIEW_DIMENSIONS"
257
+
258
+    return {ret:{
259
+        type: SET_TILE_VIEW_DIMENSIONS,
260
+        dimensions: {
261
+            gridDimensions: {columns:clo.c,visibleRows:clo.r,},
262
+            xtra:"xtra_val2",
263
+            thumbnailSize:{height,width},
264
+            filmstripWidth:avail_width2
265
+        }
266
+    }};
267
+
268
+
269
+
270
+
271
+
272
+/*
273
+	return {
274
+		dimensions:{
275
+			columns:cl.c,
276
+			visibleRows:cl.r,
277
+		}
278
+	}
279
+	
280
+*/
281
+
282
+
283
+    return {ret:{
284
+        type: SET_TILE_VIEW_DIMENSIONS,
285
+        dimensions: {
286
+            gridDimensions: dimensions,
287
+            xtra:"xtra_val",
288
+            thumbnailSize,
289
+            filmstripWidth
290
+        }
291
+    }};
292
+
293
+
294
+
295
+
296
+}
297
+
298
+// ["Filmstrip", "fs", "rf_filmstrip"]
299
+
300
+
301
+function calc_layout2(a,ni){
302
+    var r = 1
303
+    var c = 1
304
+    var n = 1
305
+    clog("mx CL",ni,a)
306
+while (1){
307
+        if (r * c < n){ 
308
+            if ( (c + 1) * a  < r + 1 ) {
309
+                c++ 
310
+            } else {
311
+                r++
312
+            }
313
+        } 
314
+                n=r*c
315
+            if (n >= ni){
316
+                break
317
+            }
318
+                n=n+1
319
+        }
320
+        clog("CL",ni,r,c,n)
321
+        return {
322
+            r:r,
323
+            c:c,
324
+            n:n,
325
+            ni:ni,
326
+        }
327
+}

+ 716
- 0
r0c.js View File

@@ -0,0 +1,716 @@
1
+glob_dev_fns.getTileViewGridDimensions = function(numberOfParticipants,state,maxColumns){
2
+	// return
3
+	if (glob_dev_fns.ret0){return}
4
+	clog("getTileViewGridDimensions....")
5
+	const rui = state['features/base/responsive-ui'];
6
+
7
+
8
+	const clientHeight = rui.clientHeight
9
+	const clientWidth  = rui.clientWidth
10
+
11
+
12
+	// var clo = calc_layout_heper(clientWidth,clientHeight,numberOfParticipants)
13
+
14
+	// const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
15
+	// {
16
+		// var aspect = 16/9
17
+		var aspect = TILE_ASPECT_RATIO
18
+		const topBottomPadding = 200;
19
+		const sideMargins = 30 * 2;
20
+
21
+
22
+		// var thumbs_count = Thumbs.remoteThumbs.length + Thumbs.localThumb.length
23
+
24
+		var viewWidth = clientWidth - sideMargins
25
+		var viewHeight = clientHeight - topBottomPadding
26
+		clog("",view_width,viewHeight)
27
+		// const r1 = avail_width/avail_height
28
+		const viewAspectRatio = viewWidth/viewHeight
29
+
30
+		// var clo = calc_layout2(1/((avail_width/avail_height)/aspect),numberOfParticipants)
31
+		var clo = calc_layout2(TILE_ASPECT_RATIO/viewAspectRatio,numberOfParticipants)
32
+	// }
33
+
34
+	var r = clo.r
35
+	var c = clo.c
36
+
37
+	// c = clo.r
38
+	// r = clo.c
39
+	// you only need to check 
40
+	// if (Math.min(c,r) >=  )
41
+	if (r <= clo.n -  numberOfParticipants){
42
+		// c -= 1
43
+		clog("cl_trc dec")
44
+	}
45
+	clog("GTVGD",clo,{r,c})
46
+	// return 3
47
+	return c
48
+
49
+
50
+
51
+}
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+glob_dev_fns.getTileViewGridDimensions = function(state,maxColumns){
64
+	// return
65
+
66
+
67
+    // const { iAmRecorder } = state['features/base/config'];
68
+    const iAmRecorder  = state['features/base/config'].iAmRecorder;
69
+    const numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
70
+
71
+
72
+
73
+	if (glob_dev_fns.ret0){return}
74
+	clog("getTileViewGridDimensions....")
75
+	const rui = state['features/base/responsive-ui'];
76
+
77
+
78
+	const clientHeight = rui.clientHeight
79
+	const clientWidth  = rui.clientWidth
80
+
81
+
82
+	// var clo = calc_layout_heper(clientWidth,clientHeight,numberOfParticipants)
83
+
84
+	// const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
85
+	// {
86
+		var aspect = 16/9
87
+		var TILE_ASPECT_RATIO = aspect
88
+		// var aspect = TILE_ASPECT_RATIO
89
+		const topBottomPadding = 200;
90
+		const sideMargins = 30 * 2;
91
+
92
+		var viewWidth = clientWidth - sideMargins
93
+		var viewHeight = clientHeight - topBottomPadding
94
+		clog("",viewWidth,viewHeight)
95
+		// const r1 = avail_width/avail_height
96
+		const viewAspectRatio = viewWidth/viewHeight
97
+
98
+		// var clo = calc_layout2(1/((avail_width/avail_height)/aspect),numberOfParticipants)
99
+		var clo = calc_layout2(TILE_ASPECT_RATIO/viewAspectRatio,numberOfParticipants)
100
+	// }
101
+
102
+	var r = clo.r
103
+	var c = clo.c
104
+
105
+	// c = clo.r
106
+	// r = clo.c
107
+	// you only need to check 
108
+	// if (Math.min(c,r) >=  )
109
+	clog("GTVGD0",clo,{r,c})
110
+	if (r <= clo.n -  numberOfParticipants){
111
+		// Math.floor()
112
+		var xtra_space = clo.n -  numberOfParticipants
113
+		Math.floor(xtra_space/r)
114
+		clog("cl_trc_ dec",{r,c,f:Math.floor(xtra_space/r),rl:xtra_space/r,"x":clo.n -  numberOfParticipants,numberOfParticipants,clo})
115
+		// c -= 1
116
+		// c -= Math.floor(xtra_space/r)
117
+	}
118
+	if (r <= (r * c) -  numberOfParticipants){
119
+		c -= 1
120
+		clog("cl_trc dec2")
121
+	}
122
+
123
+
124
+	clog("GTVGD",clo,{r,c})
125
+	// return 3
126
+	const columnsToMaintainASquare = c
127
+    // const columns = Math.min(columnsToMaintainASquare, maxColumns);
128
+    const columns = Math.min(columnsToMaintainASquare, 100);
129
+    const rows = Math.ceil(numberOfParticipants / columns);
130
+    // const visibleRows = Math.min(maxColumns, rows);
131
+    const visibleRows = rows;
132
+	clog("GTVGD2",{visibleRows,columns})
133
+
134
+    return {
135
+        columns,
136
+        visibleRows
137
+    };
138
+
139
+
140
+	// return c
141
+
142
+
143
+
144
+}
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+function calcTileGrid(a,ni){
153
+
154
+	var dflt = {
155
+            r:1,
156
+            c:1,
157
+            n:1,
158
+            ni:1,
159
+        }
160
+	if (!ni){
161
+		clog("calcTileGrid TILES MAY NOT BE 0")
162
+		// return dflt
163
+	}
164
+
165
+	var mcnt=100
166
+	var cnt=0
167
+	if (ni < 1){
168
+		clog("calcTileGrid TILES MAY  0",ni)
169
+
170
+	}
171
+    var r = 1
172
+    var c = 1
173
+    var n = 1
174
+    clog("mx cl_trc",ni,a)
175
+while (1){
176
+		cnt += 1
177
+		if (mcnt < cnt ){
178
+			clog("calcTileGrid ILOOP",cnt)
179
+			return dflt
180
+		}
181
+        if (r * c < n){ 
182
+            if ( (c + 1) * a  < r + 1 ) {
183
+                c++ 
184
+            } else {
185
+                r++
186
+            }
187
+        } 
188
+        clog("cl_trc",{r,c,n,nn:r*c})
189
+                n=r*c
190
+            if (n >= ni){
191
+                break
192
+            }
193
+                n=n+1
194
+        }
195
+        clog("CL",ni,r,c,n)
196
+        return {
197
+            r:r,
198
+            c:c,
199
+            n:n,
200
+            ni:ni,
201
+        }
202
+}
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+function calcTileGrid(ratio,tiles){
226
+
227
+	var dflt = {
228
+            r:1,
229
+            c:1,
230
+            n:1,
231
+            ni:1,
232
+        }
233
+	if (!tiles){
234
+		clog("calcTileGrid TILES MAY NOT BE 0")
235
+		// return dflt
236
+	}
237
+
238
+	var mcnt=1000000000
239
+	var mcntt=100000000
240
+	var mcnttx=mcntt
241
+	var cnt=0
242
+	if (tiles < 1){
243
+		clog("calcTileGrid TILES MAY  0",tiles)
244
+
245
+	}
246
+	// avail_tiles
247
+    var rows = 1
248
+    var columns = 1
249
+    var avail_tiles = 0
250
+    // this can become an infinite loop for large numbers due to loss of precision
251
+    if (tiles > 2147483648) {tiles = 1}
252
+    clog("mx cl_trc",tiles,ratio)
253
+while (avail_tiles < tiles){
254
+	 avail_tiles=avail_tiles+1
255
+		cnt += 1
256
+		if (mcnt < cnt ){
257
+			clog("calcTileGrid ILOOP",{rows,columns,avail_tiles,tiles},cnt)
258
+			return dflt
259
+		}
260
+		if (mcnttx < cnt ){
261
+			clog(".calcTileGrid ILOOP.",avail_tiles,avail_tiles+1,{rows,columns,avail_tiles,tiles},jc({rows,columns,avail_tiles,tiles}),cnt)
262
+			mcnttx += mcntt 
263
+			// return dflt
264
+		}
265
+
266
+        if (rows * columns < avail_tiles){ 
267
+            if ( (columns + 1) * ratio  < rows + 1 ) {
268
+                columns++ 
269
+            } else {
270
+                rows++
271
+            }
272
+        } 
273
+        // clog("cl_trc",{r,c,n,nn:r*c})
274
+                avail_tiles=rows*columns
275
+            // if (n >= tiles){
276
+            if (!(avail_tiles < tiles)){
277
+                // break
278
+            }
279
+               
280
+        }
281
+        // clog("CL",tiles,r,c,n,cnt)
282
+        return {
283
+            r:rows,
284
+            c:columns,
285
+            n:avail_tiles,
286
+            ni:tiles,
287
+        }
288
+}
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+glob_dev_fns.getTileViewGridDimensions_cc = function(numberOfParticipants,state,maxColumns){
394
+	// return
395
+	if (glob_dev_fns.ret0){return}
396
+	clog("getTileViewGridDimensions....")
397
+	const rui = state['features/base/responsive-ui'];
398
+
399
+
400
+	const clientHeight = rui.clientHeight
401
+	const clientWidth  = rui.clientWidth
402
+
403
+
404
+
405
+	// const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
406
+	var clo = calc_layout_heper(clientWidth,clientHeight,numberOfParticipants)
407
+
408
+	var r = clo.r
409
+	var c = clo.c
410
+
411
+	// c = clo.r
412
+	// r = clo.c
413
+	// you only need to check 
414
+	// if (Math.min(c,r) >=  )
415
+	if (r <= clo.n -  numberOfParticipants){
416
+		// c -= 1
417
+		clog("cl_trc dec")
418
+	}
419
+	clog("GTVGD",clo,{r,c})
420
+	// return 3
421
+	return c
422
+
423
+
424
+
425
+}
426
+
427
+glob_dev_fns.getTileViewGridDimensions_sq = function(numberOfParticipants,state,maxColumns){
428
+	// return
429
+	if (glob_dev_fns.ret0){return}
430
+	clog("getTileViewGridDimensions....")
431
+	const rui = state['features/base/responsive-ui'];
432
+
433
+
434
+	const clientHeight = rui.clientHeight
435
+	const clientWidth  = rui.clientWidth
436
+
437
+
438
+	// var clo = calc_layout_heper(clientWidth,clientHeight,numberOfParticipants)
439
+
440
+	// const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
441
+	// {
442
+		var aspect = 16/9
443
+		var TILE_ASPECT_RATIO = aspect
444
+		// var aspect = TILE_ASPECT_RATIO
445
+		const topBottomPadding = 200;
446
+		const sideMargins = 30 * 2;
447
+
448
+		var viewWidth = clientWidth - sideMargins
449
+		var viewHeight = clientHeight - topBottomPadding
450
+		clog("",viewWidth,viewHeight)
451
+		// const r1 = avail_width/avail_height
452
+		const viewAspectRatio = viewWidth/viewHeight
453
+
454
+		// var clo = calc_layout2(1/((avail_width/avail_height)/aspect),numberOfParticipants)
455
+		var clo = calc_layout2(TILE_ASPECT_RATIO/viewAspectRatio,numberOfParticipants)
456
+	// }
457
+
458
+	var r = clo.r
459
+	var c = clo.c
460
+
461
+	// c = clo.r
462
+	// r = clo.c
463
+	// you only need to check 
464
+	// if (Math.min(c,r) >=  )
465
+	if (r <= clo.n -  numberOfParticipants){
466
+		// c -= 1
467
+		clog("cl_trc dec")
468
+	}
469
+	clog("GTVGD",clo,{r,c})
470
+	// return 3
471
+	return c
472
+
473
+
474
+
475
+}
476
+
477
+
478
+
479
+
480
+
481
+// function calc_layout_heper(avail_width,avail_height,thumbs_count){
482
+function calc_layout_heper(clientWidth,clientHeight,numberOfParticipants){
483
+
484
+	var aspect = 16/9
485
+
486
+	// Thumbs =  glob_react.Filmstrip._getThumbs()
487
+
488
+
489
+	const topBottomPadding = 200;
490
+	const sideMargins = 30 * 2;
491
+
492
+
493
+	// var thumbs_count = Thumbs.remoteThumbs.length + Thumbs.localThumb.length
494
+
495
+	var avail_width = clientWidth - sideMargins
496
+	var avail_height = clientHeight - topBottomPadding
497
+	clog("",avail_width,avail_height)
498
+    const r1 = avail_width/avail_height
499
+
500
+    const r0 = aspect
501
+
502
+
503
+
504
+	clo = calc_layout2(1/((avail_width/avail_height)/aspect),numberOfParticipants)
505
+	return clo
506
+}
507
+
508
+
509
+
510
+
511
+
512
+
513
+glob_dev_fns.setTileViewDimensions_x = function(o,dimensions,windowSize,that){
514
+	// console.trace("STV")
515
+	// SET_TILE_VIEW_DIMENSIONS
516
+	windowSize = o.args[1]
517
+	dimensions = o.args[0]
518
+	clog("glob_dev_fns.setTileViewDimensions",arguments)
519
+	
520
+
521
+
522
+	var aspect = 16/9
523
+
524
+	Thumbs =  glob_react.Filmstrip._getThumbs()
525
+
526
+
527
+	const topBottomPadding = 200;
528
+	const sideMargins = 30 * 2;
529
+
530
+
531
+	var thumbs_count = Thumbs.remoteThumbs.length + Thumbs.localThumb.length
532
+
533
+	var avail_width = windowSize.clientWidth - sideMargins
534
+	var avail_height = windowSize.clientHeight - topBottomPadding
535
+	clog("",avail_width,avail_height)
536
+    const r1 = avail_width/avail_height
537
+
538
+    const r0 = aspect
539
+
540
+	var clo = calc_layout2((avail_width/avail_height)/aspect,thumbs_count)
541
+
542
+
543
+
544
+
545
+
546
+
547
+
548
+
549
+
550
+
551
+	// calc_layout2
552
+	clog(windowSize,dimensions)
553
+
554
+
555
+
556
+
557
+
558
+    var bw = avail_width 
559
+    var w2,width
560
+    // clog(xgrp,xgrp.length,clo)
561
+    if ((r1/r0) * (clo.c / clo.r) > 1) {
562
+        w2 = bw / ((r1/r0) * clo.c) 
563
+    } else {
564
+        w2 = bw / ( clo.r) 
565
+    }
566
+
567
+    // width = 310
568
+    // w2 =w2 - 12
569
+    w2 =w2 - (10 * aspect)
570
+    // w2 =w2 - 15
571
+    // w2 =w2 - 16
572
+    // width = Math.round(w2)
573
+    width = Math.floor(w2)
574
+
575
+
576
+
577
+    var height = Math.floor(width / (aspect))
578
+    clog(clo)
579
+    var avail_width2 = avail_width
580
+    // if (clo.ni < clo.n){
581
+    	// r and c are misnamed!
582
+
583
+    var col,max_width
584
+    if (clo.c == 2){
585
+    	col = Math.ceil(clo.ni / 2)
586
+    	max_width = (col + .5) * width
587
+    	clog("MX...",col ,avail_width2,max_width)
588
+    	if (max_width < avail_width2){
589
+    	clog("MX",avail_width2,max_width)
590
+    		avail_width2 = max_width
591
+    	}
592
+
593
+    }
594
+
595
+    if (clo.ni <= clo.n + clo.c){
596
+
597
+    	// avail_width2  = Math.round(width * clo.) 
598
+    	// avail_width2  = Math.round(avail_width2 - width/2) 
599
+
600
+    }
601
+
602
+
603
+
604
+	// return
605
+	const SET_TILE_VIEW_DIMENSIONS = "SET_TILE_VIEW_DIMENSIONS"
606
+
607
+    return {ret:{
608
+        type: SET_TILE_VIEW_DIMENSIONS,
609
+        dimensions: {
610
+            gridDimensions: {columns:clo.c,visibleRows:clo.r,},
611
+            xtra:"xtra_val2",
612
+            thumbnailSize:{height,width},
613
+            filmstripWidth:avail_width2
614
+        }
615
+    }};
616
+
617
+
618
+
619
+
620
+
621
+/*
622
+	return {
623
+		dimensions:{
624
+			columns:cl.c,
625
+			visibleRows:cl.r,
626
+		}
627
+	}
628
+	
629
+*/
630
+
631
+
632
+    return {ret:{
633
+        type: SET_TILE_VIEW_DIMENSIONS,
634
+        dimensions: {
635
+            gridDimensions: dimensions,
636
+            xtra:"xtra_val",
637
+            thumbnailSize,
638
+            filmstripWidth
639
+        }
640
+    }};
641
+
642
+
643
+
644
+
645
+}
646
+
647
+// ["Filmstrip", "fs", "rf_filmstrip"]
648
+
649
+
650
+// Calculates the most efficient grid for tiling rectangles of the same size and aspect ratio in a rectangular container
651
+// This function does NOT take into account margins between tiles. so in practice our result will not be 
652
+
653
+
654
+
655
+// Calculates an efficient grid for tiling rectangles of the same size and aspect ratio in a rectangular container
656
+// takes as arguments 
657
+
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+function calcTileGrid0(ratio,tiles){
666
+
667
+	var dflt = {
668
+            r:1,
669
+            c:1,
670
+            n:1,
671
+            ni:1,
672
+        }
673
+	if (!tiles){
674
+		clog("calcTileGrid TILES MAY NOT BE 0")
675
+		// return dflt
676
+	}
677
+
678
+	var mcnt=100
679
+	var cnt=0
680
+	if (tiles < 1){
681
+		clog("calcTileGrid TILES MAY  0",tiles)
682
+
683
+	}
684
+    var r = 1
685
+    var c = 1
686
+    var n = 1
687
+    clog("mx cl_trc",tiles,ratio)
688
+while (1){
689
+		cnt += 1
690
+		if (mcnt < cnt ){
691
+			clog("calcTileGrid ILOOP",cnt)
692
+			return dflt
693
+		}
694
+        if (r * c < n){ 
695
+            if ( (c + 1) * ratio  < r + 1 ) {
696
+                c++ 
697
+            } else {
698
+                r++
699
+            }
700
+        } 
701
+        clog("cl_trc",{r,c,n,nn:r*c})
702
+                n=r*c
703
+            // if (n >= tiles){
704
+            if (!(n < tiles)){
705
+                break
706
+            }
707
+                n=n+1
708
+        }
709
+        clog("CL",tiles,r,c,n,cnt)
710
+        return {
711
+            r:r,
712
+            c:c,
713
+            n:n,
714
+            ni:tiles,
715
+        }
716
+}

+ 537
- 0
r0d.js View File

@@ -0,0 +1,537 @@
1
+// clog = console.log
2
+// function nop(){}
3
+
4
+glob_dev_hooks = window.glob_dev_hooks || {}
5
+glob_dev_fns = window.glob_dev_fns || {}
6
+window.glob_react = window.glob_react || {i:"r0"}
7
+
8
+
9
+function FS_dec(fn) {
10
+  return function() {
11
+  	dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
12
+    const ret = fn.apply(this, arguments);
13
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
14
+  	const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
15
+  	if (ret2){
16
+  		return ret2.ret
17
+  	}
18
+    // const result = fn.apply(this, arguments);
19
+    // console.log('Finished');
20
+    return ret;
21
+  }
22
+}
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+function save_orig(){
31
+
32
+glob_orig = window.glob_orig || {
33
+	Filmstrip:{},
34
+	fs:{},
35
+	rf_filmstrip:{},
36
+}
37
+
38
+
39
+	glob_orig.Filmstrip = Object.assign({},glob_react.Filmstrip)
40
+	glob_orig.fs = Object.assign({},glob_react.fs)
41
+	glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
42
+	save_orig = nop
43
+}
44
+
45
+
46
+
47
+
48
+if (window.glob_orig){
49
+
50
+save_orig = nop
51
+// save_orig()
52
+}
53
+if (!window.glob_orig && window.glob_react){
54
+
55
+// save_orig = nop
56
+save_orig()
57
+}
58
+if (window.glob_orig && window.glob_react){
59
+dec_fs()
60
+// save_orig = nop
61
+// save_orig()
62
+}
63
+
64
+// if ((!window.glob_orig) && ){
65
+
66
+// }
67
+
68
+// glob_react.rf_filmstrip.calculateThumbnailSizeForTileView
69
+
70
+// calculateThumbnailSizeForTileView
71
+
72
+dec_fns = {
73
+	resizeThumbnailsForTileView:{
74
+		pre:function(){
75
+			// console.trace("resizeThumbnailsForTileView")
76
+
77
+		},
78
+		post:function(){
79
+
80
+		},
81
+
82
+	}
83
+}
84
+
85
+
86
+function rt(w,h = 0,force = true){
87
+	h ? 0 : h = w / (16/9)   
88
+	glob_react.Filmstrip.resizeThumbnailsForTileView(w,h,force)
89
+}
90
+
91
+function dec_fs2(){
92
+	var k,v
93
+	glob_react.rf_filmstrip.calculateThumbnailSizeForTileView = FS_dec(glob_react.rf_filmstrip.calculateThumbnailSizeForTileView)
94
+
95
+	// for ([k,v] of Object.entries(glob_orig.Filmstrip)){
96
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
97
+		// clog("~",k,v.name)
98
+		// glob_react.Filmstrip[k] = FS_dec(v)
99
+	// }
100
+
101
+}
102
+
103
+
104
+
105
+function dec_fs(){
106
+	var k,v
107
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
108
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
109
+		clog("~",k,v.name)
110
+		glob_react.Filmstrip[k] = FS_dec(v)
111
+	}
112
+
113
+}
114
+
115
+
116
+
117
+modkeys =  ["calculateThumbnailSizeForTileView",
118
+"TILE_VIEW_SIDE_MARGINS",
119
+"SET_TILE_VIEW_DIMENSIONS",]
120
+
121
+// glob_react.rf_filmstrip
122
+function check_mod_keys(){
123
+	var k
124
+	for (k of modkeys){
125
+		clog(k,glob_react.rf_filmstrip[k])
126
+	}
127
+
128
+}
129
+
130
+// function setTileViewDimensions_x(dimensions: Object, windowSize: Object) {
131
+function setTileViewDimensions_x() {
132
+    // dev hook
133
+    if (window.glob_dev_fns && window.glob_dev_fns.setTileViewDimensions){
134
+        // var ret = window.glob_dev_fns.setTileViewDimensions.apply(this,...arguments)
135
+        var ret = window.glob_dev_fns.setTileViewDimensions({that:this,args:arguments})
136
+        if (ret){
137
+            return ret.ret
138
+        }
139
+    }
140
+
141
+    const thumbnailSize = calculateThumbnailSizeForTileView({
142
+        ...dimensions,
143
+        ...windowSize
144
+    });
145
+    const filmstripWidth = dimensions.columns * (TILE_VIEW_SIDE_MARGINS + thumbnailSize.width);
146
+
147
+    return {
148
+        type: SET_TILE_VIEW_DIMENSIONS,
149
+        dimensions: {
150
+            gridDimensions: dimensions,
151
+            xtra:"xtra_val",
152
+            thumbnailSize,
153
+            filmstripWidth
154
+        }
155
+    };
156
+}
157
+
158
+glob_dev_fns.getTileViewGridDimensions_0ld = function(numberOfParticipants,state,maxColumns){
159
+	// return
160
+	if (glob_dev_fns.ret0){return}
161
+	clog("getTileViewGridDimensions....")
162
+	const rui = state['features/base/responsive-ui'];
163
+	const clientHeight = rui.clientHeight
164
+	const clientWidth  = rui.clientWidth
165
+	var clo = calc_layout_heper(clientWidth,clientHeight,numberOfParticipants)
166
+	var c = clo.r
167
+	var r = clo.c
168
+	// you only need to check 
169
+	// if (Math.min(c,r) >=  )
170
+	if (r <= clo.n -  numberOfParticipants){
171
+		c -= 1
172
+		clog("cl_trc dec")
173
+	}
174
+	clog("GTVGD",clo,{r,c})
175
+	// return 3
176
+	return c
177
+
178
+
179
+
180
+}
181
+
182
+
183
+
184
+
185
+
186
+window.glob_dev_fns.getTileViewGridDimensions_sq = nop
187
+
188
+
189
+
190
+
191
+glob_dev_fns.ret0=0
192
+glob_dev_fns.ret1=0
193
+// glob_dev_fns.ret1=1
194
+// glob_dev_fns.ret0=1
195
+
196
+// window.TILE_VIEW_SIDE_MARGINS = 10
197
+window.TILE_VIEW_SIDE_MARGINS = 20
198
+// window.TILE_VIEW_SIDE_MARGINS = 0
199
+window.dev_v = {}
200
+glob_dev_fns.getTileViewGridDimensions = function(state,maxColumns){
201
+	// return
202
+	clog("GTVT..................")
203
+	if (glob_dev_fns.ret0){return}
204
+	if (glob_dev_fns.ret1){return}
205
+
206
+
207
+    // >< const { iAmRecorder } = state['features/base/config'];
208
+    const iAmRecorder  = state['features/base/config'].iAmRecorder;
209
+    // const numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
210
+    var numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
211
+    var thumbs = glob_react.Filmstrip._getThumbs()
212
+    // numberOfParticipants 
213
+    numberOfParticipants = thumbs.remoteThumbs.length + thumbs.localThumb.length
214
+    // const numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
215
+
216
+
217
+
218
+	// if (glob_dev_fns.ret0){return}
219
+	// clog("getTileViewGridDimensions....")
220
+	const rui = state['features/base/responsive-ui'];
221
+
222
+
223
+	const clientHeight = rui.clientHeight
224
+	const clientWidth  = rui.clientWidth
225
+	// >< const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
226
+
227
+
228
+
229
+	// {
230
+		var aspect = 16/9
231
+		var TILE_ASPECT_RATIO = aspect
232
+
233
+		// calculate available width and height for tile view.
234
+		// copied from calculateThumbnailSizeForTileView (one variable was dropped)
235
+		const topBottomPadding = 200;
236
+		const sideMargins = 30 * 2;
237
+		const viewWidth = clientWidth - sideMargins
238
+		const viewHeight = clientHeight - topBottomPadding
239
+
240
+
241
+		const viewAspectRatio = viewWidth/viewHeight
242
+		const ratioOfRatios = TILE_ASPECT_RATIO/viewAspectRatio
243
+
244
+
245
+
246
+		var clo = calc_layout2(TILE_ASPECT_RATIO/viewAspectRatio,numberOfParticipants)
247
+	// }
248
+
249
+	var r = clo.r
250
+	var c = clo.c
251
+
252
+	// maybe remove a column, for aesthetics 
253
+	if (r <= clo.n - numberOfParticipants){
254
+		clog("REMOVE COUMN")
255
+		c -= 1
256
+	}
257
+
258
+
259
+	// clog("GTVGD",clo,{r,c})
260
+	// return 3
261
+	const columnsToMaintainASquare = c
262
+
263
+		window.dev_v.ratio =ratioOfRatios
264
+		window.dev_v.vratio =viewAspectRatio
265
+		window.dev_v.tratio =TILE_ASPECT_RATIO
266
+		window.dev_v.c =c
267
+		window.dev_v.mc =maxColumns
268
+		window.dev_v.calc2 =calcTileGrid_arr(TILE_ASPECT_RATIO/viewAspectRatio,numberOfParticipants)
269
+
270
+
271
+    // const columns = Math.min(columnsToMaintainASquare, 100);
272
+    // const rows = Math.ceil(numberOfParticipants / columns);
273
+
274
+
275
+/*
276
+    const columnsOverflowed = columnsToMaintainASquare > maxColumns
277
+    const columns = Math.min(columnsToMaintainASquare, maxColumns);
278
+    var visibleRows = Math.ceil(numberOfParticipants / columns);
279
+    // var visibleRows = Math.ceil(numberOfParticipants / Math.min(c, maxColumns));
280
+    if (columnsOverflowed){
281
+
282
+    visibleRows = Math.min(visibleRows , maxColumns);
283
+    }
284
+		//			*/
285
+	 //    			/*
286
+    const columns = Math.min(columnsToMaintainASquare, maxColumns);
287
+    var visibleRows = Math.ceil(numberOfParticipants / columns);
288
+
289
+
290
+    // var visibleRows = Math.min(visibleRows , columns);
291
+    // This is not actually the true number of visibleRows
292
+    if (c >= maxColumns | 0){
293
+    // if (c > maxColumns | 0){
294
+    visibleRows = Math.min(visibleRows , maxColumns);
295
+
296
+    }
297
+    //		*/
298
+    // visibleRows = visibleRows - 2
299
+    // visibleRows = 3
300
+    clog("CVR",{columns,visibleRows,c,noc:numberOfParticipants / columns,clo_r:r})
301
+    console.table(dev_v.calc2.arr)
302
+
303
+    return {
304
+        // columns:7,
305
+        // visibleRows:2.5,
306
+        // visibleRows:1.5,
307
+        columns,
308
+        visibleRows ,
309
+    };
310
+
311
+
312
+	// return c
313
+
314
+
315
+
316
+}
317
+glob_dev_fns.gtv_key = "getTileViewGridDimensions_set_num"
318
+
319
+glob_dev_fns.getTileViewGridDimensions_set_num = function(state,maxColumns,onumberOfParticipants){
320
+	// return
321
+	clog("SET NUM PRT")
322
+	var numberOfParticipants
323
+	// if (window.glob_dev_fns && window.glob_dev_fns.ret0){return onumberOfParticipants}
324
+		try {
325
+    var thumbs = glob_react.Filmstrip._getThumbs()
326
+			
327
+numberOfParticipants = thumbs.remoteThumbs.length + thumbs.localThumb.length
328
+		} catch {
329
+			return onumberOfParticipants
330
+
331
+		}
332
+return numberOfParticipants
333
+
334
+}
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+glob_dev_fns.setTileViewDimensions = function(o,dimensions,windowSize,that){
348
+	if (glob_dev_fns.ret0){return}
349
+	// return
350
+	const old_dimensions = o.args[0]
351
+	const old_windowSize = o.args[1]
352
+	dimensions = glob_react.getTileViewGridDimensions(APP.store.getState())
353
+	// clog("GTVD",dimensions)
354
+	// console.trace("setTileViewDimensions trc")
355
+	clog("GTVD",old_dimensions)
356
+
357
+
358
+
359
+	return { dimensions:dimensions }
360
+	// gridDimensions: {columns: 2, visibleRows: 1}
361
+	// return { dimensions:{columns: 1, visibleRows: 2} }
362
+
363
+
364
+}
365
+
366
+function calc_layout2(a,ni){
367
+	return calcTileGrid(...arguments)
368
+}
369
+
370
+ // @param
371
+ /* ----------------------------------------------------------------------
372
+  * @param {number} ratio - Ratio of the tile's aspect-ratio / the container's aspect-ratio
373
+  * @param {int} tiles - the number of tiles to calculate the grid for
374
+  * @returns {Object} An object containing the number of rows and columns, rows * columns
375
+  * @returns {Object} An object containing the number of rows, columns, rows * columns, and the argument tiles 
376
+ */
377
+
378
+ /**
379
+  * 
380
+  * 
381
+  *
382
+  * @param {number} ratio - Ratio of the tile's aspect-ratio / the container's aspect-ratio
383
+  * @param {int} tiles - the number of tiles to calculate the grid for
384
+  * @returns {Object} An object containing the number of rows and columns, rows * columns
385
+  * @returns {Object} An object containing the number of rows, columns, rows * columns, and the argument tiles 
386
+  */
387
+
388
+function calcTileGrid(ratio,tiles){
389
+
390
+    var rows = 1
391
+    var columns = 1
392
+    var availTiles = 1
393
+
394
+    // otherwise this could become an infinite loop for large numbers due to loss of precision
395
+    // Someone could give you ratio = 0 or tiles = Infinity
396
+    if (tiles > 65536) {tiles = 1}
397
+
398
+	while (availTiles < tiles){
399
+	        if ( (columns + 1) * ratio  < rows + 1 ) {
400
+	            columns++ 
401
+	        } else {
402
+	            rows++
403
+	        }
404
+	    availTiles=rows*columns 
405
+	}
406
+	        return {
407
+	            r:rows,
408
+	            c:columns,
409
+	            n:availTiles,
410
+	            ni:tiles,
411
+	        }
412
+}
413
+function calcTileGrid_arr(ratio,tiles){
414
+
415
+    var rows = 1
416
+    var arr = []
417
+    var columns = 1
418
+    var availTiles = 1
419
+
420
+    // otherwise this could become an infinite loop for large numbers due to loss of precision
421
+    // Someone could give you ratio = 0 or tiles = Infinity
422
+    if (tiles > 65536) {tiles = 1}
423
+
424
+	while (availTiles < tiles){
425
+	        if ( (columns + 1) * ratio  < rows + 1 ) {
426
+	            columns++ 
427
+	        } else {
428
+	            rows++
429
+	        }
430
+	    availTiles=rows*columns 
431
+	        arr.push({rows,columns,availTiles})
432
+	}
433
+	        return {
434
+	        	arr,
435
+	            r:rows,
436
+	            c:columns,
437
+	            n:availTiles,
438
+	            ni:tiles,
439
+	        }
440
+}
441
+function calcTileGrid2(ratio,tiles){
442
+
443
+    var rows = 1
444
+    var columns = 1
445
+    var avail_tiles = 1
446
+    var c = 0
447
+    // var cmx = 10000000000000000
448
+    var cmx  = 1000000000
449
+    var cmx2 = 100000000
450
+    var cmx3 = cmx2
451
+    // var cmx = 10000000000000000
452
+    // if (tiles > 2147483648) {tiles = 1}
453
+
454
+    // this can become an infinite loop for large numbers due to loss of precision and long loops from  ratio = 0 etc
455
+    if (tiles > 65536) {tiles = 1}
456
+    // if (ratio < .0000000001) {tiles = 1}
457
+
458
+
459
+
460
+	while (avail_tiles < tiles){
461
+		// clog(c,"...",{r:rows,c:columns,n:avail_tiles,ni:tiles})
462
+		if ((c+=1) > cmx){clog("ILOOP!",c);return {r:rows,c:columns,n:avail_tiles,ni:tiles}}
463
+		if (c > cmx3){clog("LLOOP",c,avail_tiles/tiles,{r:rows,c:columns,n:avail_tiles,ni:tiles,cnt:c,mx_cnt:cmx});cmx3 += cmx2}
464
+	
465
+		 // avail_tiles=avail_tiles+1
466
+	
467
+	    // if (rows * columns < avail_tiles | 1){ 
468
+	        if ( (columns + 1) * ratio  < rows + 1 ) {
469
+	            columns++ 
470
+	        } else {
471
+	            rows++
472
+	        }
473
+	    // } else {
474
+	    	// clog("DO I EVER RUN?",{r:rows,c:columns,n:avail_tiles,ni:tiles,cnt:c,mx_cnt:cmx})
475
+	    // }
476
+	    avail_tiles=rows*columns 
477
+	}
478
+	clog("ILOOP!....",c)
479
+	        return {
480
+	            r:rows,
481
+	            c:columns,
482
+	            n:avail_tiles,
483
+	            ni:tiles,
484
+	        }
485
+}
486
+
487
+
488
+function calcTileGrid1(ratio,tiles){
489
+
490
+    var rows = 1
491
+    var columns = 1
492
+    var avail_tiles = 0
493
+
494
+    // this can become an infinite loop for large numbers due to loss of precision
495
+    if (tiles > 2147483648) {tiles = 1}
496
+	while (avail_tiles < tiles){
497
+	
498
+		 avail_tiles=avail_tiles+1
499
+	
500
+	    if (rows * columns < avail_tiles){ 
501
+	        if ( (columns + 1) * ratio  < rows + 1 ) {
502
+	            columns++ 
503
+	        } else {
504
+	            rows++
505
+	        }
506
+	    }
507
+	    avail_tiles=rows*columns 
508
+	}
509
+	        return {
510
+	            r:rows,
511
+	            c:columns,
512
+	            n:avail_tiles,
513
+	            ni:tiles,
514
+	        }
515
+}
516
+
517
+
518
+
519
+
520
+
521
+
522
+function wt(a1,a2){
523
+	var c = 0
524
+	var cmx = 10
525
+	clog(a1 < a2,a1 > a2)
526
+	while (a1 < a2){
527
+		c += 1
528
+		clog(".",c)
529
+		if (cmx < c){clog("r",c);return}
530
+
531
+	}
532
+
533
+
534
+}
535
+
536
+
537
+

+ 427
- 0
r0e.js View File

@@ -0,0 +1,427 @@
1
+// clog = console.log
2
+// function nop(){}
3
+
4
+glob_dev_hooks = window.glob_dev_hooks || {}
5
+glob_dev_fns = window.glob_dev_fns || {}
6
+window.glob_react = window.glob_react || {i:"r0"}
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+function FS_dec(fn) {
33
+  return function() {
34
+  	dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
35
+    const ret = fn.apply(this, arguments);
36
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
37
+  	const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
38
+  	if (ret2){
39
+  		return ret2.ret
40
+  	}
41
+    // const result = fn.apply(this, arguments);
42
+    // console.log('Finished');
43
+    return ret;
44
+  }
45
+}
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+function save_orig(){
54
+console.trace("SAVE-ORIG")
55
+glob_orig = window.glob_orig || {
56
+	Filmstrip:{},
57
+	fs:{},
58
+	rf_filmstrip:{},
59
+}
60
+
61
+
62
+	glob_orig.Filmstrip = Object.assign({},glob_react.Filmstrip)
63
+	glob_orig.fs = Object.assign({},glob_react.fs)
64
+	glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
65
+	save_orig = nop
66
+}
67
+
68
+
69
+
70
+
71
+if (window.glob_orig){
72
+
73
+save_orig = nop
74
+// save_orig()
75
+}
76
+if (!window.glob_orig && window.glob_react){
77
+
78
+// save_orig = nop
79
+save_orig()
80
+}
81
+if (window.glob_orig && window.glob_react){
82
+dec_fs()
83
+// save_orig = nop
84
+// save_orig()
85
+}
86
+
87
+// if ((!window.glob_orig) && ){
88
+
89
+// }
90
+
91
+// glob_react.rf_filmstrip.calculateThumbnailSizeForTileView
92
+
93
+// calculateThumbnailSizeForTileView
94
+
95
+dec_fns = {
96
+	resizeThumbnailsForTileView:{
97
+		pre:function(){
98
+			// console.trace("resizeThumbnailsForTileView")
99
+
100
+		},
101
+		post:function(){
102
+
103
+		},
104
+
105
+	}
106
+}
107
+
108
+
109
+function rt(w,h = 0,force = true){
110
+	h ? 0 : h = w / (16/9)   
111
+	glob_react.Filmstrip.resizeThumbnailsForTileView(w,h,force)
112
+}
113
+
114
+function dec_fs2(){
115
+	var k,v
116
+	glob_react.rf_filmstrip.calculateThumbnailSizeForTileView = FS_dec(glob_react.rf_filmstrip.calculateThumbnailSizeForTileView)
117
+
118
+	// for ([k,v] of Object.entries(glob_orig.Filmstrip)){
119
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
120
+		// clog("~",k,v.name)
121
+		// glob_react.Filmstrip[k] = FS_dec(v)
122
+	// }
123
+
124
+}
125
+
126
+
127
+
128
+function dec_fs(){
129
+	var k,v
130
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
131
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
132
+		clog("~",k,v.name)
133
+		glob_react.Filmstrip[k] = FS_dec(v)
134
+	}
135
+
136
+}
137
+fs_dec_list = ["resizeThumbnailsForHorizontalView",
138
+"resizeThumbnailsForVerticalView",
139
+"resizeThumbnailsForTileView",]
140
+
141
+function dec_fs_resize(){
142
+	var k,v
143
+	save_orig()
144
+
145
+	for (k of fs_dec_list){
146
+		clog("~",k)
147
+	}
148
+	// return
149
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
150
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
151
+		clog("~",k,v.name,v)
152
+		// glob_react.Filmstrip[k] = FS_dec(v)
153
+	}
154
+
155
+}
156
+
157
+
158
+
159
+modkeys =  ["calculateThumbnailSizeForTileView",
160
+"TILE_VIEW_SIDE_MARGINS",
161
+"SET_TILE_VIEW_DIMENSIONS",]
162
+
163
+// glob_react.rf_filmstrip
164
+function check_mod_keys(){
165
+	var k
166
+	for (k of modkeys){
167
+		clog(k,glob_react.rf_filmstrip[k])
168
+	}
169
+
170
+}
171
+
172
+
173
+
174
+
175
+function wt(a1,a2){
176
+	var c = 0
177
+	var cmx = 10
178
+	clog(a1 < a2,a1 > a2)
179
+	while (a1 < a2){
180
+		c += 1
181
+		clog(".",c)
182
+		if (cmx < c){clog("r",c);return}
183
+
184
+	}
185
+
186
+
187
+}
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+function FS_dec2(fn) {
205
+  return function() {
206
+  	// dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
207
+    const ret = fn.apply(this, arguments);
208
+    clog("SVD",{ret,that:this,args:[...arguments]})
209
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
210
+  	// const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
211
+  	// if (ret2){
212
+  		// return ret2.ret
213
+  	// }
214
+    // const result = fn.apply(this, arguments);
215
+    // console.log('Finished');
216
+    return ret;
217
+  }
218
+}
219
+
220
+
221
+// svop = jc(SmallVideoOrig.prototype)
222
+// svop = jc(SmallVideoOrig)
223
+// svop = Object.assign({},glob_react.Filmstrip)
224
+// svop = Object.assign({},SmallVideoOrig.prototype)
225
+// function save_orig()
226
+orig_classes = window.orig_classes || {}
227
+react_trc_log = window.react_trc_log || {}
228
+react_trc_log = window.react_trc_log || {}
229
+window.react_trc_log.SmallVideoTrc0= ["$avatar",
230
+ "_setThumbnailSize",
231
+ "bindHoverHandler",
232
+ "initBrowserSpecificProperties",
233
+ "_renderDisplayName",
234
+ "$avatar",
235
+ "initializeAvatar",
236
+ "_getAudioLevelContainer",
237
+ "_getAudioLevelContainer",
238
+ "updateAudioLevelIndicator",
239
+ "addAudioLevelIndicator",
240
+ "updateIndicators",
241
+ "isCurrentlyOnLargeVideo",
242
+ "_isHovered",]
243
+
244
+
245
+
246
+
247
+
248
+react_trc_log.SmallVideoTrc = ["_renderDisplayName",
249
+"_setThumbnailSize",
250
+"showDominantSpeakerIndicator",
251
+"setVideoMutedView",
252
+"initBrowserSpecificProperties",
253
+"bindHoverHandler",
254
+"addAudioLevelIndicator",]
255
+
256
+
257
+
258
+glob_dev_fns.getTileViewGridDimensions_set_num = function(state,maxColumns,onumberOfParticipants){
259
+	// return
260
+	// clog("SET NUM PRT")
261
+	var numberOfParticipants
262
+	// if (window.glob_dev_fns && window.glob_dev_fns.ret0){return onumberOfParticipants}
263
+		try {
264
+    var thumbs = glob_react.Filmstrip._getThumbs()
265
+			
266
+// numberOfParticipants = thumbs.remoteThumbs.length + thumbs.localThumb  thumbs.localThumb.length
267
+numberOfParticipants = thumbs.remoteThumbs.length 
268
+if (thumbs.localThumb){
269
+numberOfParticipants += thumbs.localThumb.length 
270
+
271
+}
272
+		} catch(e) {
273
+			clog("getTileViewGridDimensions_set_num err:",e)
274
+			return onumberOfParticipants
275
+
276
+		}
277
+	// clog("getTileViewGridDimensions_set_num ret:",numberOfParticipants,thumbs,onumberOfParticipants)
278
+	numberOfParticipants < onumberOfParticipants ? numberOfParticipants = onumberOfParticipants : 1
279
+	// clog("getTileViewGridDimensions_set_num ret2:",numberOfParticipants,thumbs,onumberOfParticipants)
280
+	// clog("NUM",numberOfParticipants)
281
+return numberOfParticipants
282
+
283
+
284
+}
285
+
286
+
287
+
288
+
289
+window.glob_dbg = window.glob_dbg || {
290
+	log:{},
291
+	logs:{},
292
+}
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+function log_tb(err,key){
301
+	var key
302
+	try{
303
+
304
+	key in window.glob_dbg.logs ? 1 : window.glob_dbg.logs[key]=[]
305
+	// key in window.glob_dbg.log ? 1 : window.glob_dbg.log[key]=[]
306
+	window.glob_dbg.logs[key].push(err.stack)
307
+	// window.glob_dbg.log[key].push(err)
308
+	// clog("LOG_TB",key,err)
309
+	} catch (e){
310
+		clog("LOG TB",key,"ERR:",e)
311
+	}
312
+	// return new Error()
313
+}
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+function clone_class() {
327
+	var k,v,p 
328
+	if (orig_classes.SmallVideoOrig){
329
+		return
330
+	}
331
+	orig_classes.SmallVideoOrig = {}
332
+	for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
333
+		v=p.value
334
+		orig_classes.SmallVideoOrig[k]=v
335
+	}
336
+
337
+}
338
+clog("R0...",window.SmallVideoOrig)
339
+
340
+function loop_proto(){
341
+	var k,v,p 
342
+	for ([k,p] of Object.entries(Object.getOwnPropertyDescriptors(SmallVideoOrig.prototype))) {
343
+		// clog("~",k,v)
344
+		v=p.value
345
+		clog("~",k,typeof(v))
346
+		if (typeof(v) == "function"){
347
+		SmallVideoOrig.prototype[k] = FS_dec2(v)
348
+
349
+		}
350
+
351
+	}
352
+}
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+function loop_vids(vids = $(".small_vid")){
361
+	clog("vids",vids)
362
+	var k,v
363
+	// for (k in [...vids]){
364
+	for (k of vids){
365
+		clog("..",k)
366
+	}
367
+}
368
+
369
+
370
+function log_info0(key){
371
+	var ret = new Map()
372
+	var k,v
373
+	var arr
374
+	for (v of glob_dbg.log[key]){
375
+		ret.setD(v.stack,0)
376
+		ret.set(v.stack,ret.get(v.stack) + 1)
377
+		arr = v.stack.split("\n")
378
+		clog(arr[2])
379
+
380
+		// v.
381
+		// clog(k,v)
382
+	}
383
+	return ret
384
+
385
+}
386
+
387
+
388
+function log_info(key,line_num=2,num_lines=1){
389
+	var ret = new Map()
390
+	var ret1 = new Map()
391
+	var line 
392
+	var k,v
393
+	var arr
394
+	for (v of glob_dbg.logs[key]){
395
+		ret.setD(v,0)
396
+		ret.set(v,ret.get(v) + 1)
397
+		arr = v.split("\n")
398
+		// clog(arr[3])
399
+		// clog(arr[2])
400
+		// line = arr[line_num]
401
+		line = arr.slice(line_num,line_num+num_lines).join("\n")
402
+		// if ("an")
403
+		if (line.includes("anony")){
404
+
405
+		} else {
406
+			// continue
407
+		}
408
+
409
+		// clog(line)
410
+		ret1.setD(line,0)
411
+		ret1.set(line,ret1.get(line) + 1)
412
+
413
+		// v.
414
+		// clog(k,v)
415
+	}
416
+	return ret1
417
+
418
+}
419
+
420
+
421
+function map_loop(m){
422
+	var k,v
423
+	for ([k,v] of m){
424
+		clog(k,v)
425
+	}
426
+}
427
+

+ 33
- 0
r1.js View File

@@ -0,0 +1,33 @@
1
+
2
+
3
+function clientResized_dev(clientWidth, clientHeight) {
4
+    return {
5
+        type: "CLIENT_RESIZED",
6
+        clientHeight,
7
+        clientWidth
8
+    };
9
+}
10
+
11
+
12
+function dispatch_resize(store = APP.store) {
13
+        store.dispatch(clientResized_dev(innerWidth, innerHeight));
14
+        clog("dispatch_resize")
15
+}
16
+function add_spans(n=1,xtra=0){
17
+	var s = `
18
+	<span class="pseudo_vid videocontainer"></span>
19
+	`
20
+	$(".pseudo_vid").remove()
21
+	if (!xtra){
22
+	n = n - APP.store.getState()["features/base/participants"].length
23
+	}
24
+	var k,v
25
+	for (var i = 0; i < n; i++) {
26
+		// Things[i]
27
+		clog("..",i)
28
+	$("#filmstripRemoteVideosContainer").append(s)
29
+	}
30
+	dispatch_resize()
31
+}
32
+
33
+

+ 217
- 0
r2.js View File

@@ -0,0 +1,217 @@
1
+
2
+
3
+
4
+
5
+
6
+function FS_dec(fn) {
7
+  return function() {
8
+  	dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
9
+    const ret = fn.apply(this, arguments);
10
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
11
+    console.log('FSD',fn.name);
12
+    console.trace('FSD_trc  '+fn.name);
13
+    // log_tb()
14
+    window.log_tb(new Error(),fn.name)
15
+  	const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
16
+  	if (ret2){
17
+  		return ret2.ret
18
+  	}
19
+    // const result = fn.apply(this, arguments);
20
+    // console.log('Finished');
21
+    return ret;
22
+  }
23
+}
24
+
25
+
26
+
27
+
28
+
29
+// if ((!window.glob_orig) && ){
30
+
31
+// }
32
+
33
+// glob_react.rf_filmstrip.calculateThumbnailSizeForTileView
34
+
35
+// calculateThumbnailSizeForTileView
36
+
37
+dec_fns = {
38
+	resizeThumbnailsForTileView:{
39
+		pre:function(){
40
+			// console.trace("resizeThumbnailsForTileView")
41
+
42
+		},
43
+		post:function(){
44
+
45
+		},
46
+
47
+	}
48
+}
49
+
50
+
51
+function rt(w,h = 0,force = true){
52
+	h ? 0 : h = w / (16/9)   
53
+	glob_react.Filmstrip.resizeThumbnailsForTileView(w,h,force)
54
+}
55
+
56
+function dec_fs2(){
57
+	var k,v
58
+	glob_react.rf_filmstrip.calculateThumbnailSizeForTileView = FS_dec(glob_react.rf_filmstrip.calculateThumbnailSizeForTileView)
59
+
60
+	// for ([k,v] of Object.entries(glob_orig.Filmstrip)){
61
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
62
+		// clog("~",k,v.name)
63
+		// glob_react.Filmstrip[k] = FS_dec(v)
64
+	// }
65
+
66
+}
67
+
68
+
69
+
70
+function dec_fs(){
71
+	var k,v
72
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
73
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
74
+		clog("~",k,v.name)
75
+		glob_react.Filmstrip[k] = FS_dec(v)
76
+		// glob_react.Filmstrip[k] = v
77
+	}
78
+
79
+}
80
+fs_dec_list = [
81
+"resizeThumbnailsForHorizontalView",
82
+"resizeThumbnailsForVerticalView",
83
+// "resizeThumbnailsForTileView",
84
+]
85
+
86
+function undec_fs(){
87
+	var k,v
88
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
89
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
90
+		// clog("~",k,v.name)
91
+		// glob_react.Filmstrip[k] = FS_dec(v)
92
+		glob_react.Filmstrip[k] = v
93
+	}	
94
+}
95
+
96
+
97
+
98
+modkeys =  ["calculateThumbnailSizeForTileView",
99
+"TILE_VIEW_SIDE_MARGINS",
100
+"SET_TILE_VIEW_DIMENSIONS",]
101
+
102
+// glob_react.rf_filmstrip
103
+function check_mod_keys(){
104
+	var k
105
+	for (k of modkeys){
106
+		clog(k,glob_react.rf_filmstrip[k])
107
+	}
108
+
109
+}
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+function log_info3(o){
129
+	var i,k,v
130
+	for ([k,v] of o.ret3){
131
+		if (v.fn.size >= 3){
132
+			clog(k,v)
133
+		}
134
+	}
135
+}
136
+function log_info2(key,line_num=2,num_lines=1){
137
+	var ret = new Map()
138
+	var ret2 = new Map()
139
+	var ret3 = new Map()
140
+	var ret4 = new Map()
141
+	// var ret = new Map()
142
+	var i,k,v
143
+	var i2,k2,v2
144
+	var i3,k3,v3
145
+	var i4,k4,v4
146
+	var line 
147
+	var arr
148
+	key = 2
149
+	// var 
150
+
151
+	// for ([k,v] of Object.values(glob_dbg.logs)){
152
+	// for (v of [...Object.values(glob_dbg.logs)]){
153
+	for ([k,v] of Object.entries(glob_dbg.logs)){
154
+		// clog([k,v])
155
+		for (v2 of v){
156
+			ret.setD(v2,{c:0,fn:k})
157
+			i = ret.get(v2)
158
+			i.c += 1
159
+			// ret.set(v2,ret.get(v2) + 1)
160
+		}
161
+	}
162
+	for ([k,v] of ret){
163
+		arr = k.split("\n")
164
+		i =  ret.get(k)
165
+		// k2 = i.fn: arr[key]
166
+		k2 = `${i.fn}: ${arr[key]}`
167
+		ret2.setD(k2,{c:0})
168
+		i2 =  ret2.get(k2)
169
+		i2.c += i.c
170
+
171
+
172
+		for ([k3,v3] of Object.entries(arr)){
173
+			// clog(k3,v3)
174
+			v4 = k3 + ": " +v3
175
+			ret4.setD(v4,{fn:new Set()})
176
+
177
+			ret3.setD(v3,{fn:new Set()})
178
+			i3 = ret3.get(v3)
179
+			i3.fn.add(i.fn)
180
+		}
181
+
182
+
183
+	}
184
+	clog(ret2)
185
+
186
+
187
+	return {ret,ret2,ret3,ret4}
188
+	var ret1 = new Map()
189
+	var line 
190
+	var arr
191
+	for (v of glob_dbg.logs[key]){
192
+		ret.setD(v,0)
193
+		ret.set(v,ret.get(v) + 1)
194
+		arr = v.split("\n")
195
+		// clog(arr[3])
196
+		// clog(arr[2])
197
+		// line = arr[line_num]
198
+		line = arr.slice(line_num,line_num+num_lines).join("\n")
199
+		// if ("an")
200
+		if (line.includes("anony")){
201
+
202
+		} else {
203
+			// continue
204
+		}
205
+
206
+		// clog(line)
207
+		ret1.setD(line,0)
208
+		ret1.set(line,ret1.get(line) + 1)
209
+
210
+		// v.
211
+		// clog(k,v)
212
+	}
213
+	return ret1
214
+
215
+}
216
+// clog(log_info3(log_info2()))
217
+// clog(log_info2())

+ 144
- 0
r2t.js View File

@@ -0,0 +1,144 @@
1
+
2
+
3
+
4
+
5
+function FS_dec(fn) {
6
+  return function() {
7
+  	dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
8
+    const ret = fn.apply(this, arguments);
9
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
10
+  	const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
11
+  	if (ret2){
12
+  		return ret2.ret
13
+  	}
14
+    // const result = fn.apply(this, arguments);
15
+    // console.log('Finished');
16
+    return ret;
17
+  }
18
+}
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+function save_orig(){
27
+console.trace("SAVE-ORIG")
28
+glob_orig = window.glob_orig || {
29
+	Filmstrip:{},
30
+	fs:{},
31
+	rf_filmstrip:{},
32
+}
33
+
34
+
35
+	glob_orig.Filmstrip = Object.assign({},glob_react.Filmstrip)
36
+	glob_orig.fs = Object.assign({},glob_react.fs)
37
+	glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
38
+	save_orig = nop
39
+}
40
+
41
+
42
+
43
+
44
+if (window.glob_orig){
45
+
46
+save_orig = nop
47
+// save_orig()
48
+}
49
+if (!window.glob_orig && window.glob_react){
50
+
51
+// save_orig = nop
52
+save_orig()
53
+}
54
+if (window.glob_orig && window.glob_react){
55
+dec_fs()
56
+// save_orig = nop
57
+// save_orig()
58
+}
59
+
60
+// if ((!window.glob_orig) && ){
61
+
62
+// }
63
+
64
+// glob_react.rf_filmstrip.calculateThumbnailSizeForTileView
65
+
66
+// calculateThumbnailSizeForTileView
67
+
68
+dec_fns = {
69
+	resizeThumbnailsForTileView:{
70
+		pre:function(){
71
+			// console.trace("resizeThumbnailsForTileView")
72
+
73
+		},
74
+		post:function(){
75
+
76
+		},
77
+
78
+	}
79
+}
80
+
81
+
82
+function rt(w,h = 0,force = true){
83
+	h ? 0 : h = w / (16/9)   
84
+	glob_react.Filmstrip.resizeThumbnailsForTileView(w,h,force)
85
+}
86
+
87
+function dec_fs2(){
88
+	var k,v
89
+	glob_react.rf_filmstrip.calculateThumbnailSizeForTileView = FS_dec(glob_react.rf_filmstrip.calculateThumbnailSizeForTileView)
90
+
91
+	// for ([k,v] of Object.entries(glob_orig.Filmstrip)){
92
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
93
+		// clog("~",k,v.name)
94
+		// glob_react.Filmstrip[k] = FS_dec(v)
95
+	// }
96
+
97
+}
98
+
99
+
100
+
101
+function dec_fs(){
102
+	var k,v
103
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
104
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
105
+		clog("~",k,v.name)
106
+		glob_react.Filmstrip[k] = FS_dec(v)
107
+	}
108
+
109
+}
110
+fs_dec_list = ["resizeThumbnailsForHorizontalView",
111
+"resizeThumbnailsForVerticalView",
112
+"resizeThumbnailsForTileView",]
113
+
114
+function dec_fs_resize(){
115
+	var k,v
116
+	save_orig()
117
+
118
+	for (k of fs_dec_list){
119
+		clog("~",k)
120
+	}
121
+	// return
122
+	for ([k,v] of Object.entries(glob_orig.Filmstrip)){
123
+	// for ([k,v] of Object.entries(glob_react.Filmstrip)){
124
+		clog("~",k,v.name,v)
125
+		// glob_react.Filmstrip[k] = FS_dec(v)
126
+	}
127
+
128
+}
129
+
130
+
131
+
132
+modkeys =  ["calculateThumbnailSizeForTileView",
133
+"TILE_VIEW_SIDE_MARGINS",
134
+"SET_TILE_VIEW_DIMENSIONS",]
135
+
136
+// glob_react.rf_filmstrip
137
+function check_mod_keys(){
138
+	var k
139
+	for (k of modkeys){
140
+		clog(k,glob_react.rf_filmstrip[k])
141
+	}
142
+
143
+}
144
+

+ 173
- 0
react_fn.js View File

@@ -0,0 +1,173 @@
1
+
2
+
3
+TILE_ASPECT_RATIO = 16 / 9;
4
+function reth(o){
5
+
6
+	return {ret:o}
7
+}
8
+{
9
+
10
+
11
+
12
+var calcTileGrid=glob_react.fns.calcTileGrid
13
+var getMaxColumnCount=glob_react.fns.getMaxColumnCount
14
+let getMaxColumnCount2=glob_react.fns.getMaxColumnCount
15
+
16
+let sideMargins=(135 * 2 )+ 20
17
+// let sideMargins=(135 )+ 20
18
+let topBottomPadding=135 + 100
19
+
20
+// glob_dev_fns.getTileViewGridDimensions_set_num
21
+
22
+// function getTileViewGridDimensions(state: Object, maxColumns: number = getMaxColumnCount()) {
23
+// glob_dev_fns.getTileViewGridDimensions = function(state: Object, maxColumns: number = getMaxColumnCount()) {
24
+glob_dev_fns.getTileViewGridDimensions = function(state, maxColumns = getMaxColumnCount(),maxColumns2 = getMaxColumnCount2()) {
25
+    // When in tile view mode, we must discount ourselves (the local participant) because our
26
+    // tile is not visible.
27
+    const { iAmRecorder } = state['features/base/config'];
28
+    // dev util hook
29
+    // const numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
30
+     //   /*
31
+    var numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
32
+    // clog("r0 num",numberOfParticipants)
33
+
34
+    if (window.glob_dev_fns && window.glob_dev_fns.getTileViewGridDimensions_set_num){
35
+        const numberOfParticipants_dev = window.glob_dev_fns.getTileViewGridDimensions_set_num(state,maxColumns,numberOfParticipants)
36
+        if (typeof(numberOfParticipants_dev)=="number"){numberOfParticipants = numberOfParticipants_dev}
37
+    }
38
+    //        */
39
+    
40
+    const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
41
+
42
+    // calculate available width and height for tile view.
43
+    // copied from calculateThumbnailSizeForTileView (one variable was dropped)
44
+    // const topBottomPadding = 200;
45
+    // const sideMargins = 30 * 2;
46
+
47
+    const viewWidth = clientWidth - sideMargins;
48
+    const viewHeight = clientHeight - topBottomPadding;
49
+
50
+    const viewAspectRatio = viewWidth / viewHeight;
51
+    const ratioOfRatios = TILE_ASPECT_RATIO / viewAspectRatio;
52
+
53
+    const tileGrid = calcTileGrid(ratioOfRatios, numberOfParticipants);
54
+    let { columns } = tileGrid;
55
+    const { rows, availableTiles } = tileGrid;
56
+
57
+    // maybe remove a column, for aesthetics.
58
+        // clog("r0 dec? columns",columns,rows <= availableTiles - numberOfParticipants,columns > 1,rows <= availableTiles - numberOfParticipants && columns > 1)
59
+    // if (rows <= availableTiles - numberOfParticipants && columns > 1) {
60
+    if (rows <= availableTiles - numberOfParticipants) {
61
+        // clog("r0 dec columns",columns)
62
+        columns -= 1;
63
+        // clog("r0 dec columns2",columns)
64
+    }
65
+
66
+    const columnsOverflowed = columns > maxColumns;
67
+    // clog("r0 NaN",columnsOverflowed,Math.ceil(numberOfParticipants / columns),Math.min(columns, maxColumns) )
68
+    // clog("r0 NaN2",Math.min(Math.ceil(numberOfParticipants / columns),maxColumns))
69
+
70
+    columns = Math.min(columns, maxColumns) || 1;
71
+    let visibleRows = Math.ceil(numberOfParticipants / columns) || 1;
72
+
73
+    if (columnsOverflowed) {
74
+        visibleRows = Math.min(visibleRows, maxColumns);
75
+    }
76
+    // clog("r0 gtvd",{columns,visibleRows,numberOfParticipants},tileGrid)
77
+    /*
78
+    return {
79
+        columns,
80
+        visibleRows
81
+    };
82
+    */
83
+    const ret = reth({
84
+        columns,
85
+        visibleRows
86
+    })
87
+    clog("!!!",{numberOfParticipants,clientHeight, clientWidth,tileGrid,iAmRecorder,maxColumns,maxColumns2},arguments,ret)
88
+    return reth({
89
+        columns,
90
+        visibleRows
91
+    });
92
+}
93
+
94
+/*
95
+export function calculateThumbnailSizeForTileView({
96
+    columns,
97
+    visibleRows,
98
+    clientWidth,
99
+    clientHeight
100
+}: Object)
101
+*/
102
+glob_dev_fns.calculateThumbnailSizeForTileView = function ({
103
+    columns,
104
+    visibleRows,
105
+    clientWidth,
106
+    clientHeight
107
+}) {
108
+	// clog("calculateThumbnailSizeForTileView new")
109
+    // The distance from the top and bottom of the screen, as set by CSS, to
110
+    // avoid overlapping UI elements.
111
+    // const topBottomPadding = 200;
112
+
113
+    // Minimum space to keep between the sides of the tiles and the sides
114
+    // of the window.
115
+    // const sideMargins = 30 * 2;
116
+
117
+    const verticalMargins = visibleRows * 10;
118
+    const viewWidth = clientWidth - sideMargins;
119
+    const viewHeight = clientHeight - topBottomPadding - verticalMargins;
120
+    const initialWidth = viewWidth / columns;
121
+    const aspectRatioHeight = initialWidth / TILE_ASPECT_RATIO;
122
+    const height = Math.floor(Math.min(aspectRatioHeight, viewHeight / visibleRows));
123
+    const width = Math.floor(TILE_ASPECT_RATIO * height);
124
+
125
+    return reth({
126
+        height,
127
+        width
128
+    });
129
+}
130
+
131
+glob_dev_fns.calculateThumbnailSizeForTileView_dev = function ({
132
+    columns,
133
+    visibleRows,
134
+    clientWidth,
135
+    clientHeight,
136
+    sideMargins=0,
137
+    topBottomPadding=0,
138
+    verticalMargin = 10,
139
+    TILE_ASPECT_RATIO=glob_react.fns.TILE_ASPECT_RATIO
140
+}) {
141
+    // clog("calculateThumbnailSizeForTileView new")
142
+    // The distance from the top and bottom of the screen, as set by CSS, to
143
+    // avoid overlapping UI elements.
144
+    // const topBottomPadding = 200;
145
+
146
+    // Minimum space to keep between the sides of the tiles and the sides
147
+    // of the window.
148
+    // const sideMargins = 30 * 2;
149
+
150
+    const verticalMargins = visibleRows * verticalMargin;
151
+    const viewWidth = clientWidth - sideMargins;
152
+    const viewHeight = clientHeight - topBottomPadding - verticalMargins;
153
+    const initialWidth = viewWidth / columns;
154
+    const aspectRatioHeight = initialWidth / TILE_ASPECT_RATIO;
155
+    const height = Math.floor(Math.min(aspectRatioHeight, viewHeight / visibleRows));
156
+    const width = Math.floor(TILE_ASPECT_RATIO * height);
157
+
158
+    return ({
159
+        height,
160
+        width,
161
+        consts:{verticalMargins,
162
+viewWidth,
163
+viewHeight,
164
+initialWidth,
165
+aspectRatioHeight,},
166
+    });
167
+}
168
+}
169
+
170
+
171
+
172
+
173
+

+ 5
- 0
redir.css View File

@@ -0,0 +1,5 @@
1
+#react > div {
2
+	background-color: #1B5668;
3
+	
4
+	/*color: red !important;*/
5
+}

+ 235
- 0
resize_hook.b.js View File

@@ -0,0 +1,235 @@
1
+function FS_dec_resize(fn) {
2
+  return function() {
3
+    clog("rtscv0",glob_react.Filmstrip._getThumbs())
4
+  	dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
5
+    const ret = fn.apply(this, arguments);
6
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
7
+    // console.log('FSD',fn.name);
8
+    
9
+    // console.trace('FSD_trc  '+fn.name);
10
+    // log_tb()
11
+    // window.log_tb(new Error(),fn.name)
12
+    clog("rtscv1",glob_react.Filmstrip._getThumbs())
13
+    resizeThumbnailsForCustomView(this,fn.name,arguments)
14
+  	const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
15
+  	if (ret2){
16
+  		return ret2.ret
17
+  	}
18
+    // const result = fn.apply(this, arguments);
19
+    // console.log('Finished');
20
+    clog("rtscv2",glob_react.Filmstrip._getThumbs())
21
+    return ret;
22
+  }
23
+}
24
+function FS_dec_proto(fn) {
25
+  return function() {
26
+    clog("fdp",fn.name)
27
+    dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
28
+    const ret = fn.apply(this, arguments);
29
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
30
+    // console.log('FSD',fn.name);
31
+    
32
+    // console.trace('FSD_trc  '+fn.name);
33
+    // log_tb()
34
+    // window.log_tb(new Error(),fn.name)
35
+    // clog("rtscv1",glob_react.Filmstrip._getThumbs())
36
+    // resizeThumbnailsForCustomView(this,fn.name,arguments)
37
+    const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
38
+    if (ret2){
39
+      return ret2.ret
40
+    }
41
+    // const result = fn.apply(this, arguments);
42
+    // console.log('Finished');
43
+    // clog("rtscv2",glob_react.Filmstrip._getThumbs())
44
+    return ret;
45
+  }
46
+}
47
+
48
+
49
+
50
+function undec_fs(){
51
+  var k,v
52
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
53
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
54
+    // clog("~",k,v.name)
55
+    // glob_react.Filmstrip[k] = FS_dec(v)
56
+    glob_react.Filmstrip[k] = v
57
+  } 
58
+}
59
+
60
+
61
+function undec_class(){
62
+  var k,v
63
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
64
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
65
+    // clog("~",k,v.name)
66
+    // glob_react.Filmstrip[k] = FS_dec(v)
67
+    glob_react.Filmstrip[k] = v
68
+  } 
69
+}
70
+
71
+
72
+
73
+function resizeThumbnailsForCustomView(that,fn_name,args){
74
+    const thumbs = glob_react.Filmstrip._getThumbs()
75
+    const all_thumbs = $(".small_vid")
76
+    const custom_thumbs = all_thumbs.not(thumbs)
77
+
78
+    clog("rtscv",fn_name,[that,...args])
79
+
80
+
81
+}
82
+function dec_fs_proto(){
83
+  var k,v
84
+  save_orig()
85
+  undec_fs()
86
+
87
+  for (k of fs_dec_list){
88
+    clog("~",k)
89
+    v = glob_orig.Filmstrip[k]
90
+    glob_react.Filmstrip[k] = FS_dec_resize(v)
91
+  }
92
+  return
93
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
94
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
95
+    // clog("~",k,v.name,v)
96
+    clog("~",k,v.name)
97
+    // glob_react.Filmstrip[k] = FS_dec(v)
98
+  }
99
+
100
+}
101
+
102
+
103
+function dec_fs_resize(){
104
+  var k,v
105
+  save_orig()
106
+  undec_fs()
107
+
108
+  for (k of fs_dec_list){
109
+    clog("~",k)
110
+    v = glob_orig.Filmstrip[k]
111
+    glob_react.Filmstrip[k] = FS_dec_resize(v)
112
+  }
113
+  return
114
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
115
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
116
+    // clog("~",k,v.name,v)
117
+    clog("~",k,v.name)
118
+    // glob_react.Filmstrip[k] = FS_dec(v)
119
+  }
120
+
121
+}
122
+
123
+
124
+
125
+
126
+
127
+
128
+function test_thumbs(){
129
+  var ret = glob_react.Filmstrip._getThumbs()
130
+  clog(ret)
131
+  return ret
132
+
133
+}
134
+
135
+
136
+
137
+
138
+
139
+
140
+function save_orig_prototype(classes){
141
+  var i,k,v
142
+  var i2,k2,v2
143
+  var o
144
+  var ret = {}
145
+  // o = glob_react.vidClass.LocalVideo.prototype
146
+  // o  = tobj
147
+  // o = glob_react.vidClass.LocalVideo
148
+  // for ([k,v] of Object.entries(glob_react.vidClass)){
149
+  // for ([k,v] of Object.entries(o)){
150
+  // for ([k2,v2] of Object.entries(glob_react.vidClass)){
151
+  for ([k2,v2] of Object.entries(classes)){
152
+      clog("...",k2)
153
+      ret[k2] = {}
154
+      o = v2.prototype
155
+    for ([k,v] of iter_desc(o)){
156
+
157
+      // clog(k,v)
158
+      ret[k2][k]=v
159
+      clog(k2,k,v)
160
+    }
161
+  }
162
+  clog("><",Object.getOwnPropertyDescriptors(o))
163
+  return ret
164
+
165
+}
166
+
167
+function save_orig(){
168
+// console.trace("SAVE-ORIG")
169
+glob_orig = window.glob_orig || {
170
+  Filmstrip:{},
171
+  fs:{},
172
+  rf_filmstrip:{},
173
+}
174
+
175
+
176
+  glob_orig.Filmstrip = Object.assign({},glob_react.Filmstrip)
177
+  glob_orig.fs = Object.assign({},glob_react.fs)
178
+  glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
179
+  glob_orig.vidClass = save_orig_prototype(glob_react.vidClass)
180
+  // glob_orig.vidClass.LocalVideo_proto = Object.assign({},glob_react.vidClass.LocalVideo.prototype)
181
+  // glob_orig.vidClass2  = jc(glob_react.vidClass)
182
+  // glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
183
+  save_orig = nop
184
+}
185
+
186
+// glob_react.vidClass.LocalVideo.prototype
187
+// 
188
+
189
+
190
+
191
+
192
+
193
+if (window.glob_orig){
194
+
195
+save_orig = nop
196
+// save_orig()
197
+}
198
+if (!window.glob_orig && window.glob_react){
199
+
200
+// save_orig = nop
201
+save_orig()
202
+}
203
+if (window.glob_orig && window.glob_react){
204
+// dec_fs()
205
+// dec_fs_resize()
206
+// save_orig = nop
207
+// save_orig()
208
+}
209
+
210
+
211
+
212
+
213
+
214
+if (window.glob_orig && window.glob_react){
215
+// dec_fs()
216
+dec_fs_resize()
217
+// save_orig = nop
218
+// save_orig()
219
+}
220
+
221
+
222
+
223
+
224
+
225
+function* iter_desc(o){
226
+  var i,k,v
227
+  i = 0
228
+  for ([k,v] of Object.entries(Object.getOwnPropertyDescriptors(o))){
229
+    yield [k,v]
230
+    i += 1
231
+  }
232
+
233
+}
234
+
235
+

+ 344
- 0
resize_hook.js View File

@@ -0,0 +1,344 @@
1
+function FS_dec_resize(fn) {
2
+  return function() {
3
+    clog("rtscv0",glob_react.Filmstrip._getThumbs())
4
+    resize_filmstrips(this,fn.name,arguments)
5
+  	dec_fns[fn.name] && dec_fns[fn.name].pre ? dec_fns[fn.name].pre({that:this, arguments}) : 1
6
+    const ret = fn.apply(this, arguments);
7
+    resize_filmstrips2(this,fn.name,arguments)
8
+    // console.log('FSD',fn.name,ret, [this,...arguments]);
9
+    // console.log('FSD',fn.name);
10
+    
11
+    // console.trace('FSD_trc  '+fn.name);
12
+    // log_tb()
13
+    // window.log_tb(new Error(),fn.name)
14
+    clog("rtscv1",glob_react.Filmstrip._getThumbs())
15
+    resizeThumbnailsForCustomView(this,fn.name,arguments)
16
+  	const ret2 = dec_fns[fn.name] && dec_fns[fn.name].post ? dec_fns[fn.name].post({that:this, arguments}) : 0
17
+  	if (ret2){
18
+  		return ret2.ret
19
+  	}
20
+    // const result = fn.apply(this, arguments);
21
+    // console.log('Finished');
22
+    clog("rtscv2",glob_react.Filmstrip._getThumbs())
23
+    return ret;
24
+  }
25
+}
26
+function FS_dec_proto(fn,fn_name) {
27
+  return function() {
28
+    clog("fdp0",fn_name,glob_react.Filmstrip._getThumbs())
29
+    dec_fns[fn_name] && dec_fns[fn_name].pre ? dec_fns[fn_name].pre({that:this, arguments}) : 1
30
+    if (fn_name == "updateDOMLocation") {
31
+      this.updateDOMLocation2()
32
+    }
33
+    const ret = fn.apply(this, arguments);
34
+    // console.log('FSD',fn_name,ret, [this,...arguments]);
35
+    // console.log('FSD',fn_name);
36
+    
37
+    // console.trace('FSD_trc  '+fn_name);
38
+    // log_tb()
39
+    // window.log_tb(new Error(),fn_name)
40
+    // clog("rtscv1",glob_react.Filmstrip._getThumbs())
41
+    // resizeThumbnailsForCustomView(this,fn_name,arguments)
42
+    clog("fdp2",fn_name,glob_react.Filmstrip._getThumbs())
43
+    const ret2 = dec_fns[fn_name] && dec_fns[fn_name].post ? dec_fns[fn_name].post({that:this, arguments}) : 0
44
+    if (ret2){
45
+      return ret2.ret
46
+    }
47
+    // const result = fn.apply(this, arguments);
48
+    // console.log('Finished');
49
+    // clog("rtscv2",glob_react.Filmstrip._getThumbs())
50
+    return ret;
51
+  }
52
+}
53
+
54
+
55
+
56
+function undec_fs(){
57
+  var k,v
58
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
59
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
60
+    // clog("~",k,v.name)
61
+    // glob_react.Filmstrip[k] = FS_dec(v)
62
+    glob_react.Filmstrip[k] = v
63
+  } 
64
+}
65
+
66
+
67
+function undec_class(){
68
+  var k,v
69
+  var proto = glob_orig.vidClass.LocalVideo
70
+  // var proto = glob_react.vidClass.LocalVideo.prototype
71
+  // for ([k,v] of iter_desc(proto)){
72
+  for ([k,v] of Object.entries(proto)){
73
+    // glob_react.Filmstrip[k] = v
74
+    // clog(k,v)
75
+    glob_react.vidClass.LocalVideo.prototype[k] = v.value
76
+    // clog(k,v)
77
+  } 
78
+}
79
+
80
+
81
+
82
+
83
+function dec_fs_proto(){
84
+  var k,v
85
+  save_orig()
86
+  undec_class()
87
+  var proto = glob_orig.vidClass.LocalVideo
88
+  for ([k,v] of Object.entries(proto)){
89
+    // glob_react.Filmstrip[k] = v
90
+    // glob_react.vidClass.LocalVideo.prototype[k] = FS_dec_proto(v)
91
+    glob_react.vidClass.LocalVideo.prototype[k] = FS_dec_proto(v.value,k)
92
+    // clog(k,v)
93
+  } 
94
+  // glob_react.vidClass.LocalVideo.prototype.updateDOMLocation = updateDOMLocation
95
+  glob_react.vidClass.LocalVideo.prototype.updateDOMLocation = updateDOMLocation2
96
+  // updateDOMLocation
97
+  /*
98
+  for (k of fs_dec_list){
99
+    clog("~",k)
100
+    v = glob_orig.Filmstrip[k]
101
+    glob_react.Filmstrip[k] = FS_dec_resize(v)
102
+  }
103
+  */
104
+  return
105
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
106
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
107
+    // clog("~",k,v.name,v)
108
+    clog("~",k,v.name)
109
+    // glob_react.Filmstrip[k] = FS_dec(v)
110
+  }
111
+
112
+}
113
+
114
+
115
+function dec_fs_resize(){
116
+  var k,v
117
+  save_orig()
118
+  undec_fs()
119
+  dec_fs_proto()
120
+
121
+  for (k of fs_dec_list){
122
+    clog("~",k)
123
+    v = glob_orig.Filmstrip[k]
124
+    glob_react.Filmstrip[k] = FS_dec_resize(v)
125
+  }
126
+  return
127
+  for ([k,v] of Object.entries(glob_orig.Filmstrip)){
128
+  // for ([k,v] of Object.entries(glob_react.Filmstrip)){
129
+    // clog("~",k,v.name,v)
130
+    clog("~",k,v.name)
131
+    // glob_react.Filmstrip[k] = FS_dec(v)
132
+  }
133
+
134
+}
135
+
136
+
137
+
138
+
139
+
140
+
141
+function test_thumbs(){
142
+  var ret = glob_react.Filmstrip._getThumbs()
143
+  clog(ret)
144
+  return ret
145
+
146
+}
147
+
148
+
149
+
150
+function updateDOMLocation2() {
151
+        clog("updateDOMLocation2",this,arguments)
152
+        // this._updateVideoElement();
153
+        clog("UDL 00")
154
+        // return
155
+        // if (!this.container || !this.container.parentElement) {
156
+        if (!this.container ) {
157
+            return;
158
+        }
159
+        // dev trc 
160
+        // ...
161
+
162
+        clog("UDL 10",this.container.parentElement)
163
+
164
+        var custom_local = 0
165
+        this.container.parentElement ? custom_local = this.container.parentElement.classList.contains("icont") : 0
166
+        if (this.container.parentElement && !custom_local) {
167
+            this.container.parentElement.removeChild(this.container);
168
+        }
169
+        // return
170
+        clog("UDL 20")
171
+        const appendTarget = shouldDisplayTileView(APP.store.getState())
172
+            ? document.getElementById('localVideoTileViewContainer')
173
+            : document.getElementById('filmstripLocalVideoThumbnail');
174
+        // if ()
175
+        !custom_local && appendTarget && appendTarget.appendChild(this.container);
176
+        clog("UDL 30")
177
+        clog("")
178
+        this._updateVideoElement();
179
+        clog("UDL 40")
180
+    }
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+function updateDOMLocation() {
189
+
190
+        if (!this.container) {
191
+            return;
192
+        }
193
+        // dev trc 
194
+        // ...
195
+        if (this.container.parentElement) {
196
+            this.container.parentElement.removeChild(this.container);
197
+        }
198
+
199
+        const appendTarget = shouldDisplayTileView(APP.store.getState())
200
+            ? document.getElementById('localVideoTileViewContainer')
201
+            : document.getElementById('filmstripLocalVideoThumbnail');
202
+
203
+        appendTarget && appendTarget.appendChild(this.container);
204
+        this._updateVideoElement();
205
+    }
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+function save_orig_prototype(classes){
232
+  var i,k,v
233
+  var i2,k2,v2
234
+  var o
235
+  var ret = {}
236
+  // o = glob_react.vidClass.LocalVideo.prototype
237
+  // o  = tobj
238
+  // o = glob_react.vidClass.LocalVideo
239
+  // for ([k,v] of Object.entries(glob_react.vidClass)){
240
+  // for ([k,v] of Object.entries(o)){
241
+  // for ([k2,v2] of Object.entries(glob_react.vidClass)){
242
+  for ([k2,v2] of Object.entries(classes)){
243
+      clog("...",k2)
244
+      ret[k2] = {}
245
+      o = v2.prototype
246
+    for ([k,v] of iter_desc(o)){
247
+
248
+      // clog(k,v)
249
+      ret[k2][k]=v
250
+      clog(k2,k,v)
251
+    }
252
+  }
253
+  clog("><",Object.getOwnPropertyDescriptors(o))
254
+  return ret
255
+
256
+}
257
+
258
+function save_orig(){
259
+// console.trace("SAVE-ORIG")
260
+glob_orig = window.glob_orig || {
261
+  Filmstrip:{},
262
+  fs:{},
263
+  rf_filmstrip:{},
264
+}
265
+
266
+
267
+  glob_orig.Filmstrip = Object.assign({},glob_react.Filmstrip)
268
+  glob_orig.fs = Object.assign({},glob_react.fs)
269
+  glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
270
+  glob_orig.vidClass = save_orig_prototype(glob_react.vidClass)
271
+  // glob_orig.vidClass.LocalVideo_proto = Object.assign({},glob_react.vidClass.LocalVideo.prototype)
272
+  // glob_orig.vidClass2  = jc(glob_react.vidClass)
273
+  // glob_orig.rf_filmstrip = Object.assign({},glob_react.rf_filmstrip)
274
+  save_orig = nop
275
+}
276
+
277
+// glob_react.vidClass.LocalVideo.prototype
278
+// 
279
+
280
+
281
+
282
+
283
+
284
+if (window.glob_orig){
285
+
286
+save_orig = nop
287
+// save_orig()
288
+}
289
+if (!window.glob_orig && window.glob_react){
290
+
291
+// save_orig = nop
292
+save_orig()
293
+}
294
+if (window.glob_orig && window.glob_react){
295
+// dec_fs()
296
+// dec_fs_resize()
297
+// save_orig = nop
298
+// save_orig()
299
+}
300
+
301
+
302
+
303
+
304
+
305
+if (window.glob_orig && window.glob_react){
306
+// dec_fs()
307
+dec_fs_resize()
308
+// save_orig = nop
309
+// save_orig()
310
+}
311
+
312
+
313
+
314
+
315
+
316
+function* iter_desc(o){
317
+  var i,k,v
318
+  i = 0
319
+  for ([k,v] of Object.entries(Object.getOwnPropertyDescriptors(o))){
320
+    yield [k,v]
321
+    i += 1
322
+  }
323
+
324
+}
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+function glvcb(elm){
334
+  // clog("GLVCB",this,[...arguments])
335
+  try{
336
+  return  elm.isLocal
337
+
338
+  } catch{}
339
+}
340
+
341
+function get_local_vid(){
342
+  return glob_dev_hooks.smallvids.filter(glvcb)[0]
343
+
344
+}

+ 401
- 0
resize_proto.js View File

@@ -0,0 +1,401 @@
1
+function ctstv() {
2
+
3
+    const state = APP.store.getState();
4
+    const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
5
+    clog(clientHeight, clientWidth)
6
+    // clog(
7
+    var wh = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
8
+            columns:1,
9
+    visibleRows:1,
10
+    clientWidth,
11
+    clientHeight,
12
+    TILE_ASPECT_RATIO:TILE_ASPECT_RATIO ,
13
+    // sideMargins=0,
14
+    topBottomPadding:100,
15
+    })
16
+        // )
17
+    var width =wh.width
18
+    var height =wh.height
19
+    var w4 = width/4
20
+    var h4 = height/4
21
+    var w34 = w4 * 3
22
+    var h34 = h4 * 3
23
+    clog({
24
+        TILE_ASPECT_RATIO,
25
+        tm:TILE_ASPECT_RATIO * (5/6),
26
+        tm2:(w4 * 6)/(h4 * 5),
27
+        // tm22:(w4 * 6)/(h4 * 5),
28
+        tm3:TILE_ASPECT_RATIO * (6/5),
29
+    })
30
+    
31
+
32
+    // $(".ic4").css({
33
+    $(".a1").css({
34
+        height:h34,
35
+        width:w34,
36
+        top:h4,
37
+        left:w4,
38
+        // height:wh.height,
39
+        // width:wh.width,
40
+    })
41
+        $(".ic5").css({
42
+        height:height,
43
+        width:width,
44
+        // top:h4,
45
+        // left:w4,
46
+        // height:wh.height,
47
+        // width:wh.width,
48
+    })
49
+
50
+}
51
+
52
+
53
+dflt_css_proto = {
54
+
55
+      'padding-top': '',
56
+      "min-height": ``,
57
+      "min-width": ``,
58
+      width: ``,
59
+      height: ``,
60
+      top: ``,
61
+      left: ``,
62
+      bottom: ``,
63
+      right: ``,
64
+      // right: ``,
65
+      // right: ``,
66
+    
67
+}
68
+
69
+function resize_thumbs_proto(thumbs,css_arg){
70
+  let css
71
+  if (Array.isArray(css_arg)){
72
+    css = Object.assign({},dflt_css_proto,...css_arg)
73
+
74
+  } else {
75
+    css = Object.assign({},dflt_css_proto,css_arg)
76
+  }
77
+  var k,v
78
+  for ([k,v] of Object.entries(css)){
79
+    // Number(v) ? computed_css[k] = v + "px" : 0
80
+  }
81
+  if (typeof(css.data) == "object"){
82
+    try{
83
+    
84
+    Object.assign($(thumbs)[0].dataset,css.data)
85
+    // clog("dataset ....")
86
+
87
+
88
+} catch(err) {
89
+    clog("dataset err",err)
90
+}
91
+  }
92
+  css["--vdim"] = `"${css.width} x ${css.height}"`
93
+  // clog("RTHUMBS")
94
+  $(thumbs).css(css)
95
+
96
+}
97
+
98
+function get_avail_width(){
99
+    const TILE_ASPECT_RATIO = 16/9
100
+    const state = APP.store.getState();
101
+    var { clientHeight, clientWidth } = state['features/base/responsive-ui'];
102
+    var avail_width  =clientWidth
103
+
104
+    var avail_height =clientHeight - 100
105
+    resize_thumbs_proto($(".a1"),{
106
+        width:clientWidth,
107
+        height:clientHeight,
108
+        "--vtext":`"window"`
109
+    })
110
+    resize_thumbs_proto($(".a2"),{
111
+        width:avail_width,
112
+        height:avail_height,
113
+        "--vtext":`"avail"`
114
+    })
115
+
116
+    var wh = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
117
+            columns:1,
118
+    visibleRows:1,
119
+    clientWidth:avail_width,
120
+    clientHeight:avail_height,
121
+    TILE_ASPECT_RATIO:TILE_ASPECT_RATIO ,
122
+    verticalMargin:0,
123
+    // sideMargins=0,
124
+    // topBottomPadding:100,
125
+    })
126
+    clog(wh)
127
+
128
+    resize_thumbs_proto($(".a3"),{
129
+        width:wh.width,
130
+        height:wh.height,
131
+
132
+        "--vtext":`"tile"`
133
+    })
134
+
135
+    var width =wh.width
136
+    var height =wh.height
137
+    var w4 = width/4
138
+    var h4 = height/4
139
+    var w34 = w4 * 3
140
+    var h34 = h4 * 3
141
+
142
+
143
+    resize_thumbs_proto($(".a4z"),{
144
+        width:w4,
145
+        height:h4,
146
+
147
+        "--vtext":`"t4"`
148
+    })
149
+
150
+    resize_thumbs_proto($(".a5"),{
151
+        width:Math.round(w4),
152
+        height:Math.round(h4),
153
+
154
+        "--vtext":`"t4"`
155
+    })
156
+    resize_thumbs_proto($(".a6"),{
157
+        width:Math.round(w34),
158
+        height:Math.round(h34),
159
+        top:h4,
160
+        left:w4,
161
+        // top:h4,
162
+
163
+        "--vtext":`"t34"`
164
+    })
165
+    var w =16
166
+    var h =9
167
+    const TILE_ASPECT_RATIO2 = (w * 6) / (h * 5)
168
+    const TILE_ASPECT_RATIO3 = (w * 6) / (h * 4)
169
+    resize_thumbs_proto($(".a7"),{
170
+        width:Math.round(w4),
171
+        height:Math.round(h4),
172
+        // top:h4,
173
+        left:w34 + w4,
174
+        // top:h4,
175
+
176
+        "--vtext":`"t4"`
177
+    })
178
+
179
+    var w =16
180
+    var h =9
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+    var wh2 = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
193
+            columns:1,
194
+    visibleRows:1,
195
+    clientWidth:avail_width,
196
+    clientHeight:avail_height,
197
+    TILE_ASPECT_RATIO:TILE_ASPECT_RATIO3 ,
198
+    verticalMargin:0,
199
+    // sideMargins=0,
200
+    // topBottomPadding:100,
201
+    })
202
+
203
+
204
+    resize_thumbs_proto($(".b1"),{
205
+        width:wh2.width,
206
+        height:wh2.height,
207
+
208
+        "--vtext":`"tile_container"`
209
+    })
210
+
211
+
212
+    width =wh2.width
213
+    height =wh2.height
214
+    w6 = width/6
215
+    h6 = w6 / TILE_ASPECT_RATIO
216
+    // h4 = height/4
217
+    w36 = w6 * 3
218
+    h36 = h6 * 3
219
+    w46 = w6 * 4
220
+    h46 = h6 * 4
221
+    resize_thumbs_proto($(".b2"),{
222
+        width:w6,
223
+        height:h6,
224
+
225
+        "--vtext":`"t6"`
226
+    })
227
+
228
+    resize_thumbs_proto($(".b2"),{
229
+        width:w6,
230
+        height:h6,
231
+
232
+        "--vtext":`"t6"`
233
+    })
234
+
235
+
236
+
237
+    resize_thumbs_proto($(".b3"),{
238
+        width:Math.round(w36),
239
+        height:Math.round(h36),
240
+         width:Math.round(w46),
241
+        height:Math.round(h46),
242
+        left:w6,
243
+        top:h6,
244
+
245
+        "--vtext":`"t4"`
246
+    })
247
+    resize_thumbs_proto($(".at"))
248
+
249
+    w = 1000
250
+    h = w / TILE_ASPECT_RATIO
251
+     resize_thumbs_proto($(".b1"),{
252
+        width:Math.round(w),
253
+        height:Math.round(h),
254
+        "--vtext":`"TILE_ASPECT_RATIO"`
255
+    })   
256
+    h = w / TILE_ASPECT_RATIO2
257
+     resize_thumbs_proto($(".b2"),{
258
+        width:Math.round(w),
259
+        height:Math.round(h),
260
+        "--vtext":`"TILE_ASPECT_RATIO2"`
261
+    })   
262
+    h = w / TILE_ASPECT_RATIO3
263
+     resize_thumbs_proto($(".b3"),{
264
+        width:Math.round(w),
265
+        height:Math.round(h),
266
+        "--vtext":`"TILE_ASPECT_RATIO3"`
267
+    })   
268
+     w6 = w/6
269
+     h6 = w6 / (16/9)
270
+    h = w / TILE_ASPECT_RATIO3
271
+     resize_thumbs_proto($(".a1"),{
272
+        width:Math.round(w6),
273
+        height:Math.round(h6),
274
+        "--vtext":`"TILE_ASPECT_RATIO3"`
275
+    })  
276
+     resize_thumbs_proto($(".a2"),{
277
+        width:Math.round(w6),
278
+        height:Math.round(h6),
279
+        top:375,
280
+        "--vtext":`"TILE_ASPECT_RATIO3"`
281
+    })  
282
+     w_ = w6  
283
+
284
+
285
+     resize_thumbs_proto($(".a3"),{
286
+        width:Math.round(w6 * 3),
287
+        height:Math.round(h6 * 3),
288
+        top:h6,
289
+        left:w6,
290
+        "--vtext":`"TILE_ASPECT_RATIO3"`
291
+    })  
292
+
293
+
294
+
295
+     resize_thumbs_proto($(".a4"),{
296
+        width:Math.round(w6),
297
+        height:Math.round(h6),
298
+        top:h6 * 2,
299
+        "--vtext":`"TILE_ASPECT_RATIO3"`
300
+    })  
301
+
302
+     resize_thumbs_proto($(".a5"),{
303
+        width:Math.round(w6),
304
+        height:Math.round(h6),
305
+        // top:h6 * 2,
306
+        left:w6 * 2,
307
+        "--vtext":`"TILE_ASPECT_RATIO3"`
308
+    })  
309
+
310
+    return {h:clientHeight - 100,clientHeight,clientWidth}
311
+
312
+}
313
+
314
+
315
+
316
+
317
+
318
+function init_api6(){
319
+    saftly_remove(".plugin_top")
320
+    // return
321
+    // $(".plugin_top").remove()
322
+    var n 
323
+    n = `<span class="plugin_top pseudo_vid small_vid "><div class="m2 xbox2">ABC</div></span>`
324
+    html_hooks.create_video_tile(n.repeat(20))
325
+    n = `<span class="plugin_top pseudo_vid small_vid "><div class="m3 xbox2">ABC</div></span>`
326
+    var arr = []
327
+    // arr[]
328
+    /*
329
+    html_hooks.create_video_tile(n)
330
+    html_hooks.create_video_tile(n)
331
+    html_hooks.create_video_tile(n)
332
+    html_hooks.create_video_tile(n)
333
+    html_hooks.create_video_tile(n)
334
+    html_hooks.create_video_tile(n)
335
+    if (amimod()){
336
+        html_hooks.create_video_tile(n)
337
+    html_hooks.create_video_tile(n)
338
+    html_hooks.create_video_tile(n)
339
+    html_hooks.create_video_tile(n)
340
+    html_hooks.create_video_tile(n)
341
+    html_hooks.create_video_tile(n)    
342
+    }
343
+    */
344
+
345
+    // n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
346
+    n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
347
+    // html_hooks.create_vid_toptoolbar_hook(n)
348
+    html_hooks.create_vid_toptoolbar_hook_after(n)
349
+    
350
+    n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
351
+    html_hooks.create_top_toolbox_hook(n)
352
+
353
+    n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
354
+    html_hooks.create_bottom_toolbox_hook(n)
355
+
356
+
357
+
358
+    // n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
359
+    n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
360
+    n= mod_templates.find(".filmstrip_template")[0].outerHTML
361
+
362
+    // html_hooks.create_new_filmstrip(n)
363
+
364
+    n = `<span class="plugin_top pseudo_vid small_vid "><div class="m4 xbox3">ABC</div></span>`
365
+    n= mod_templates.find("#vspace_filmstrip_template")[0].outerHTML
366
+    // n= mod_templates.find("#vspace_filmstrip_proto_template")[0].outerHTML
367
+    // vspace
368
+
369
+    add_node(n,`.vspace`,"append")
370
+    if (window.mod_sort){
371
+    mod_sort()
372
+
373
+    }
374
+
375
+    try {
376
+        dispatch_resize()
377
+    } catch {
378
+
379
+    }
380
+
381
+}
382
+
383
+
384
+
385
+
386
+if (window.saftly_remove){
387
+    init_api6()
388
+    // get_avail_width()
389
+    // clog("REZIE PROTO READY")
390
+}
391
+
392
+    // clog("REZIE PROTO LOAD")
393
+
394
+
395
+
396
+
397
+// ctstv()
398
+
399
+
400
+
401
+

+ 225
- 0
rf/class_dec.js View File

@@ -0,0 +1,225 @@
1
+
2
+GLOB_ORIG = "glob_orig_v2"
3
+
4
+
5
+
6
+function FS_dec_proto_v2(fn,fn_name) {
7
+  return function() {
8
+    clog("fdp0",fn_name,glob_react.Filmstrip._getThumbs())
9
+    dec_fns[fn_name] && dec_fns[fn_name].pre ? dec_fns[fn_name].pre({that:this, arguments}) : 1
10
+    if (fn_name == "updateDOMLocation") {
11
+      this.updateDOMLocation2()
12
+    }
13
+    const ret = fn.apply(this, arguments);
14
+    // console.log('FSD',fn_name,ret, [this,...arguments]);
15
+    // console.log('FSD',fn_name);
16
+    
17
+    // console.trace('FSD_trc  '+fn_name);
18
+    // log_tb()
19
+    // window.log_tb(new Error(),fn_name)
20
+    // clog("rtscv1",glob_react.Filmstrip._getThumbs())
21
+    // resizeThumbnailsForCustomView(this,fn_name,arguments)
22
+    clog("fdp2",fn_name,glob_react.Filmstrip._getThumbs())
23
+    const ret2 = dec_fns[fn_name] && dec_fns[fn_name].post ? dec_fns[fn_name].post({that:this, arguments}) : 0
24
+    if (ret2){
25
+      return ret2.ret
26
+    }
27
+    // const result = fn.apply(this, arguments);
28
+    // console.log('Finished');
29
+    // clog("rtscv2",glob_react.Filmstrip._getThumbs())
30
+    return ret;
31
+  }
32
+}
33
+
34
+function undec_class_v2(cls,cls_orig,cname){
35
+  var k,v
36
+  var proto = cls_orig
37
+  // var proto = glob_react.vidClass.LocalVideo.prototype
38
+  // for ([k,v] of iter_desc(proto)){
39
+  for ([k,v] of Object.entries(proto)){
40
+    // glob_react.Filmstrip[k] = v
41
+    // clog(k,v)
42
+    cls.prototype[k] = v.value
43
+    // clog(k,v)
44
+  } 
45
+}
46
+
47
+function _method_dec_v2(fn,fn_name){
48
+  return function() {
49
+    // clog("fdp0",fn_name,glob_react.Filmstrip._getThumbs())
50
+    const ret1 = dec_fns[fn_name] && dec_fns[fn_name].pre ? dec_fns[fn_name].pre({that:this, args:arguments}) : 0
51
+    // if (fn_name == "updateDOMLocation") {
52
+      // this.updateDOMLocation2()
53
+    // }
54
+    if (ret1){
55
+      return ret1.ret
56
+    }
57
+    const ret = fn.apply(this, arguments);
58
+    // clog("MDV2",fn_name,{that:this, args:arguments,ret:ret})
59
+    // clog("MDV2 xyz",fn_name,{that:this, args:arguments,ret:ret})
60
+    // console.log('FSD',fn_name,ret, [this,...arguments]);
61
+    // console.log('FSD',fn_name);
62
+    
63
+    // console.trace('FSD_trc  '+fn_name);
64
+    // log_tb()
65
+    // window.log_tb(new Error(),fn_name)
66
+    // clog("rtscv1",glob_react.Filmstrip._getThumbs())
67
+    // resizeThumbnailsForCustomView(this,fn_name,arguments)
68
+    // clog("fdp2",fn_name,glob_react.Filmstrip._getThumbs())
69
+
70
+    
71
+    const ret2 = dec_fns[fn_name] && dec_fns[fn_name].post ? dec_fns[fn_name].post({that:this, arguments}) : 0
72
+        // clog("MDEX",{ret1,ret2})
73
+    if (ret2){
74
+      return ret2.ret
75
+    }
76
+    // const result = fn.apply(this, arguments);
77
+    // console.log('Finished');
78
+    // clog("rtscv2",glob_react.Filmstrip._getThumbs())
79
+    return ret;
80
+  }
81
+}
82
+
83
+
84
+function dec_class_v2(cls,cls_orig,cname){
85
+  var k,v
86
+  var proto = cls_orig
87
+  // var proto = glob_react.vidClass.LocalVideo.prototype
88
+  // for ([k,v] of iter_desc(proto)){
89
+  for ([k,v] of Object.entries(proto)){
90
+    // glob_react.Filmstrip[k] = v
91
+    // clog(k,v)
92
+    cls.prototype[k] = _method_dec_v2(v.value,k)
93
+    // clog(k,v)
94
+  } 
95
+}
96
+
97
+
98
+
99
+function save_orig_class(cls){
100
+  var i,k,v
101
+  var i2,k2,v2
102
+  var o
103
+  var ret = {}
104
+  // o = glob_react.vidClass.LocalVideo.prototype
105
+  // o  = tobj
106
+  // o = glob_react.vidClass.LocalVideo
107
+  // for ([k,v] of Object.entries(glob_react.vidClass)){
108
+  // for ([k,v] of Object.entries(o)){
109
+  // for ([k2,v2] of Object.entries(glob_react.vidClass)){
110
+  // for ([k2,v2] of Object.entries(classes)){
111
+      // clog("...",k2)
112
+      // ret[k2] = {}
113
+      o = cls.prototype
114
+    for ([k,v] of iter_desc(o)){
115
+
116
+      // clog(k,v)
117
+      ret[k]=v
118
+      // clog(k2,k,v)
119
+    }
120
+  // }
121
+  // clog("><",Object.getOwnPropertyDescriptors(o))
122
+  return ret
123
+
124
+}
125
+// dec_fns
126
+
127
+
128
+function init_cdec(){
129
+let runonce = !window[GLOB_ORIG]
130
+// runonce = 1
131
+// if (!window[GLOB_ORIG]){
132
+// }
133
+window[GLOB_ORIG] = window[GLOB_ORIG] || {
134
+    classes:{}
135
+}
136
+cdec.glob_orig = window[GLOB_ORIG]
137
+if (runonce){
138
+
139
+    window[GLOB_ORIG].classes["SharedVideoManager"] = cdec.get_class_methods(glob_react.SharedVideoManager)
140
+}
141
+
142
+}
143
+
144
+
145
+
146
+function undec_svm(){
147
+    cdec.undec_class(glob_react.SharedVideoManager,cdec.glob_orig.classes.SharedVideoManager)
148
+
149
+}
150
+function dec_svm(){
151
+    cdec.dec_class(glob_react.SharedVideoManager,cdec.glob_orig.classes.SharedVideoManager)
152
+
153
+}
154
+// function dec_svm(){}
155
+function onSharedVideoUpdate_mod(id, url, attributes) {
156
+        // if we are sending the event ignore
157
+        if (APP.conference.isLocalId(this.from)) {
158
+            return;
159
+        }
160
+
161
+        if (!this.isSharedVideoShown) {
162
+            this.onSharedVideoStart(id, url, attributes);
163
+
164
+            return;
165
+        }
166
+
167
+        // eslint-disable-next-line no-negated-condition
168
+        if (!this.player) {
169
+            this.initialAttributes = attributes;
170
+        } else {
171
+            this.processVideoUpdate(this.player, attributes);
172
+        }
173
+    }
174
+
175
+dec_fns_v2 = {
176
+    onSharedVideoUpdate:{
177
+        pre(o){
178
+            try {
179
+                if (!o.that.player){
180
+                    window.autoplay_probably_disabled ? autoplay_probably_disabled(o) : clog("NO fix implemented")
181
+                    clog("...autoplay_probably_disabled...")
182
+                }
183
+/*
184
+            clog("onSharedVideoUpdate pre arg",[...o.args])
185
+            // clog("onSharedVideoUpdate pre",o.args[2],o.that.isSharedVideoShown,!this.player)
186
+            clog("onSharedVideoUpdate pre",o.args[2],!o.that.isSharedVideoShown,!o.that.player)
187
+            // onSharedVideoUpdate_mod.apply(o.that, o.args);
188
+            try {
189
+                clog("osvu player",o.that.player)
190
+            o.that.player.g.g.playerVars
191
+
192
+        } catch (err){
193
+            clog("osvu err")
194
+        }
195
+
196
+            clog("onSharedVideoUpdate...",o.that.player)
197
+
198
+*/
199
+            // return {}
200
+
201
+            } catch (err){clog("dec fn err svm",err)}
202
+            // return onSharedVideoUpdate_mod.apply(o.that, o.args);
203
+            // return onSharedVideoUpdate_mod.apply(o.that, o.args);
204
+
205
+        },
206
+        post_x(o){
207
+            try {
208
+
209
+            // clog("onSharedVideoUpdate post",o)
210
+            } catch (err){clog("dec fn err svm")}
211
+
212
+        },
213
+    }
214
+}
215
+
216
+cdec = {
217
+    get_class_methods:save_orig_class,
218
+    undec_class:undec_class_v2,
219
+    dec_class:dec_class_v2,
220
+    glob_orig:window[GLOB_ORIG],
221
+}
222
+dec_fns = window.dec_fns || {}
223
+Object.assign(dec_fns,dec_fns_v2)
224
+init_cdec()
225
+dec_svm()

+ 41
- 0
rf/fake_resize.js View File

@@ -0,0 +1,41 @@
1
+
2
+// make the App think you resized the window
3
+function dispatch_resize(store = APP.store) {
4
+        // store.dispatch(clientResized_dev(innerWidth, innerHeight));
5
+        store.dispatch({
6
+        type: "CLIENT_RESIZED",
7
+        clientHeight:innerHeight,
8
+        clientWidth:innerWidth,
9
+    });
10
+        // clog("dispatch_resize")
11
+}
12
+
13
+// unused old fn to add pseudo videos
14
+function add_spans(n=1,xtra=0){
15
+	var s = `
16
+	<span class="pseudo_vid videocontainer"></span>
17
+	`
18
+	$(".pseudo_vid").remove()
19
+	if (!xtra){
20
+	n = n - APP.store.getState()["features/base/participants"].length
21
+	}
22
+	var k,v
23
+	for (var i = 0; i < n; i++) {
24
+		// Things[i]
25
+		clog("..",i)
26
+	$("#filmstripRemoteVideosContainer").append(s)
27
+	}
28
+	dispatch_resize()
29
+}
30
+
31
+
32
+
33
+
34
+
35
+
36
+fs_dec_list = [
37
+"resizeThumbnailsForHorizontalView",
38
+"resizeThumbnailsForVerticalView",
39
+// "resizeThumbnailsForTileView",
40
+]
41
+dec_fns = {}

+ 150
- 0
rf/filmstrip_mod/m.css View File

@@ -0,0 +1,150 @@
1
+
2
+.abs {
3
+	background: #0080;
4
+	position: absolute;
5
+	z-index: 100;
6
+	top:0;
7
+	left:0;
8
+	right: 0;
9
+	bottom: 0;
10
+	margin: inherit;
11
+}	
12
+
13
+
14
+
15
+
16
+.icont {
17
+	/*background: #0ff8;*/
18
+
19
+	width: 100%;
20
+	height: 100%;
21
+	position: relative;
22
+}
23
+
24
+
25
+
26
+.xbox {
27
+	width: 25px;
28
+	height: 25px;
29
+	/*color: #0000;*/
30
+	color: #000;
31
+	background: #0ff;
32
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
33
+}
34
+
35
+.xbox2 {
36
+	width: 25px;
37
+	height: 25px;
38
+	position: relative;
39
+	position: absolute;
40
+	color: #000;
41
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
42
+}
43
+
44
+
45
+
46
+.small_vid .xbox:after,.small_vid .xbox2:after{
47
+/*.xbox:after,.xbox2:after{*/
48
+	content: "???";
49
+	z-index: 0;
50
+	white-space: pre-wrap;
51
+	content: var(--v_index,":???:") "\A" var(--v_id,":???:");
52
+	background-color: #fff;
53
+	position:absolute;
54
+	top: 0;
55
+	width: 75px;
56
+	height: 45px;
57
+	left: 0;
58
+	/*right: 0;*/
59
+	/*bottom: 0;*/
60
+}
61
+
62
+
63
+.xbox.m2s {
64
+	width: 75px;
65
+	height: 75px;
66
+
67
+	width: 100%;
68
+	height: 100%;
69
+
70
+	background: #ff8;
71
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
72
+
73
+
74
+}
75
+
76
+
77
+
78
+
79
+.pseudo_vid {
80
+	background-color: #f00;
81
+	background-image: linear-gradient(to top left, #ff8 50%, #0ff 50%);
82
+}
83
+
84
+
85
+.tile-view .pseudo_vid,.vertical-filmstrip .pseudo_vid{
86
+	background-size:contain;
87
+	/*border: 2px solid transparent !important;*/
88
+	margin:4 5px;
89
+	width: 100%;
90
+}
91
+
92
+.small_vid {
93
+	display: block;
94
+}
95
+.pseudo_vid {
96
+	/*display: none;*/
97
+	position: relative;
98
+	/*position: absolute;*/
99
+}
100
+
101
+
102
+
103
+.vspace {
104
+	position: absolute;
105
+	/*height: 500px;*/
106
+	height: 100%;
107
+	width: 100%;
108
+	/*width: calc(100% - 4px);*/
109
+	width: calc(100% );
110
+	width: calc(100% - 4px);
111
+	/*background-color: #555;*/
112
+	height: calc(100% - 4px);
113
+	border-radius: 100px;
114
+
115
+}
116
+
117
+
118
+.m4 {
119
+	width: 50px;
120
+	height: 50px;
121
+	top: 200px;
122
+	left: 10px;
123
+	z-index: 100; 
124
+	position: relative;
125
+	background-color: #00f;
126
+}
127
+
128
+
129
+
130
+
131
+.cont {
132
+	/*position: relative;*/
133
+	position: absolute;
134
+
135
+}
136
+
137
+.toolbox-background{
138
+	z-index: 100 !important;
139
+}
140
+
141
+
142
+
143
+.c6 {
144
+	overflow-x: scroll;
145
+}
146
+
147
+
148
+.remote-videos-container {
149
+	outline: 
150
+}

+ 156
- 0
rf/filmstrip_mod/m.html View File

@@ -0,0 +1,156 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+HI THIS is AN HTML SNIPIT
9
+
10
+
11
+<!-- <div class="mp1">abc</div>
12
+<div class="mp2">def</div> -->
13
+
14
+
15
+
16
+
17
+<span class="plugin_top abs filmstrip_template"><div class="dev_filmstrip">
18
+	<span class="cont c1">
19
+		<div class="icont ic1"></div>
20
+	</span>
21
+	<span class="cont c2">
22
+		<div class="icont ic2"></div>
23
+	</span>
24
+	<span class="cont c3">
25
+		<div class="icont ic3"></div>
26
+	</span>
27
+</div></span>
28
+
29
+
30
+
31
+
32
+<span id="vspace_filmstrip_template0" class="plugin_top abs2"><div class="dev_filmstrip">
33
+	<span class="cont c1">
34
+		<div class="icont ic1 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
35
+	</span>
36
+	<span class="cont c2">
37
+		<div class="icont ic2 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
38
+	</span>
39
+	<span class="cont c3">
40
+		<div class="icont ic3 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
41
+	</span>
42
+	<span class="cont c6">
43
+		<div class="icont ic6 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
44
+	</span>
45
+	<span class="cont c5">
46
+		<div class="icont ic5 vid_container" data-fs_type="single" data-fs_handler="center"></div>
47
+		<div class="at a1"></div>
48
+		<div class="at a2"></div>
49
+		<div class="at a3"></div>
50
+		<div class="at a4"></div>
51
+	</span>
52
+	<span class="cont c4">
53
+		<div class="icont ic4 vid_container" data-fs_type="single"></div>
54
+	</span>
55
+</div></span>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+<!-- 
68
+<input type="checkbox" name="">
69
+ -->
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+<span id="vspace_filmstrip_template" class="plugin_top abs2"><div class="dev_filmstrip">
80
+	<span class="fs_container">
81
+	<span class="cont c2">
82
+		<div class="icont ic2 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
83
+	</span>
84
+	<span class="cont c1">
85
+		<div class="icont ic1 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
86
+	</span>
87
+	<span class="cont c3">
88
+		<div class="icont ic3 vid_container" data-fs_type="vertical" data-fs_handler="vertical"></div>
89
+	</span>
90
+	<span class="cont c6">
91
+		<div class="icont ic6 vid_container" data-fs_type="horizontal" data-fs_handler="horizontal"></div>
92
+	</span>
93
+	<!-- 
94
+	<span class="cont c5">
95
+		<div class="icont ic5 vid_container" data-fs_type="single" data-fs_handler="center"></div>
96
+		<div class="at a1"></div>
97
+		<div class="at a2"></div>
98
+		<div class="at a3"></div>
99
+		<div class="at a4"></div>
100
+	</span>
101
+	 -->
102
+	<span class="cont c4">
103
+		<div class="icont ic4 vid_container" data-fs_type="single" data-fs_handler="center"></div>
104
+	</span>
105
+	</span>
106
+</div></span>
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+<span id="vspace_filmstrip_proto_template" class="plugin_top abs2"><div class="dev_filmstrip">
117
+	<!-- 
118
+	<span class="cont c1">
119
+		<div class="icont ic1 vid_container" data-fs_type="vertical"></div>
120
+	</span>
121
+	<span class="cont c2">
122
+		<div class="icont ic2 vid_container" data-fs_type="horizontal"></div>
123
+	</span>
124
+	<span class="cont c3">
125
+		<div class="icont ic3 vid_container" data-fs_type="vertical"></div>
126
+	</span>
127
+	 -->
128
+
129
+	<span class="cont c5">
130
+		<!-- <div class="icont ic5 vid_container" data-fs_type="single"></div> -->
131
+		<div class="at a1"></div>
132
+		<div class="at a2"></div>
133
+		<div class="at a3"></div>
134
+		<div class="at a4"></div>
135
+		<div class="at a5"></div>
136
+		<div class="at a6"></div>
137
+		<div class="at a7"></div>
138
+		<div class="at a8"></div>
139
+
140
+
141
+
142
+		<div class="at at2 b1"></div>
143
+		<div class="at at2 b2"></div>
144
+		<div class="at at2 b3"></div>
145
+		<div class="at at2 b4"></div>
146
+		<div class="at at2 b5"></div>
147
+		<div class="at at2 b6"></div>
148
+		<div class="at at2 b7"></div>
149
+		<div class="at at2 b8"></div>
150
+
151
+
152
+	</span>
153
+	<span class="cont c4">
154
+		<!-- <div class="icont ic4 vid_container" data-fs_type="single"></div> -->
155
+	</span>
156
+</div></span>

+ 417
- 0
rf/filmstrip_mod/m.js View File

@@ -0,0 +1,417 @@
1
+
2
+// this will be refactored into the api and an a filmstrip module
3
+
4
+mod_templates = window.mod_templates || $("")
5
+
6
+// reload templates
7
+function html_js_handler(rsp) {
8
+	clog("html_js_handler",[...arguments])
9
+	mod_templates = $(`<span>${rsp}</span>`)
10
+	init_api6()
11
+}
12
+
13
+
14
+
15
+html_hooks = {
16
+	create_video_tile(n){
17
+		add_node(n,`#localVideoTileViewContainer`,"before")
18
+	},
19
+	create_vid_toptoolbar_hook(n){
20
+		add_node(n,`.vid_toptoolbar_hook`,"append")
21
+	},
22
+    create_new_toolbox_hook(n){
23
+        add_node(n,`.new_toolbox_hook`,"append")
24
+    },
25
+
26
+	create_vid_toptoolbar_hook_after(n){
27
+		add_node(n,`.vid_toptoolbar_hook`,"append")
28
+	},
29
+	// Top of window
30
+	create_top_toolbox_hook(n){
31
+		add_node(n,`.top_toolbox`,"append")
32
+	},
33
+	create_bottom_toolbox_hook(n){
34
+		add_node(n,`.button-group-right`,"prepend")
35
+	},
36
+	create_new_filmstrip(n){
37
+		add_node(n,`#filmstripRemoteVideos`,"prepend")
38
+	},
39
+}
40
+
41
+
42
+
43
+function saftly_remove(n,remove_nodes=true){
44
+	const j =$(n)
45
+
46
+	$(`#localVideoTileViewContainer`).append(j.find(".local_vid"))
47
+	$(`#filmstripRemoteVideosContainer`).append(j.find("#localVideoTileViewContainer"))
48
+
49
+	$(`#localVideoTileViewContainer`).before(j.find(".remote_vid"))
50
+	remove_nodes ? j.remove() : clog("DO NOT REMOVE")
51
+
52
+
53
+}
54
+
55
+// follow focus EventListener
56
+function ffcb(){
57
+	clog("ffcb",this.value,this.checked,[this,...arguments])
58
+	disp(glob_react.base_conference.setFollowMe(this.checked))
59
+	var follow_focus_force=$("#follow_focus_force")[0] 
60
+	if (follow_focus_force.checked && !this.checked){
61
+		msto.conference.force_follow = this.checked
62
+		follow_focus_force.checked = this.checked
63
+
64
+	}
65
+}
66
+// force follow focus EventListener
67
+function fffcb(){
68
+	var follow_focus=$("#follow_focus")[0]
69
+
70
+	if (!follow_focus.checked && this.checked){
71
+
72
+	follow_focus.checked = this.checked
73
+	ffcb.bind(follow_focus)()
74
+	}
75
+	msto.conference.force_follow = this.checked
76
+}
77
+// number of pseudo videos EventListener
78
+function num_pseudo(){
79
+	msto.conference.repeat = this.value
80
+	setTimeout(refresh_fs_send,100)
81
+}
82
+// overflow scroll EventListener
83
+function scroll_timeout_runner(){
84
+	$("#follow_focus_force")[0] 
85
+	// scroll_send)
86
+	var ov_timeout=$("#ov_timeout")[0]
87
+	var ov_timeout_disable=$("#ov_timeout_disable")[0]
88
+	// ov_timeout_disable
89
+	if (ov_timeout_disable.checked){
90
+		timeout_scroll_glob.stop = 1
91
+	} else {
92
+		timeout_scroll_glob.stop = 0
93
+
94
+	}
95
+	if (!isNaN(ov_timeout.value) && ov_timeout.value > .2){
96
+		timeout_scroll_glob.timeout = Math.ceil(ov_timeout.value * 1000)
97
+		msto.conference.scroll_timeout = ov_timeout.value
98
+		timeout_scroll_start()
99
+	}
100
+}
101
+
102
+
103
+// to
104
+
105
+function refresh_toolbars(){
106
+    saftly_remove(".plugin_top.tbar")
107
+    // this stuff should go in a template
108
+
109
+    n = `
110
+    <span class="plugin_top tbar"><span class="outline_indicator ind_1"></span><span class="outline_indicator ind_2"></span><span class="outline_indicator ind_3"></span>
111
+    <div class="m xbox">ABC</div>
112
+    </span>`
113
+
114
+    html_hooks.create_vid_toptoolbar_hook_after(n)
115
+    n = `
116
+    <div class="plugin_top tbar">
117
+        <div class="tbox_slide_indicator cutCorner"><div class="tsi"></div></div>
118
+    </div>`
119
+
120
+    html_hooks.create_new_toolbox_hook(n)
121
+
122
+        n = `
123
+    <div class="plugin_top tbar">
124
+    <span class="lvov_container">
125
+    <span class="toggle_ff lvov">enter fullframe</span>
126
+
127
+    <span class="lv_info lvov">
128
+    <span class="autoplay_msg lvov">
129
+    autoplay is probably disabled
130
+    <br>
131
+    click on page to enable playback
132
+    
133
+    </span>
134
+    <br>
135
+    <span class="autoplay_dbg_msg lvov">
136
+    </span>
137
+    <span class="force_enable lvov">force allow autoplay
138
+    
139
+    </span>
140
+    </span>
141
+
142
+    </span>
143
+        <div class="tbox_slide_indicator2"></div>
144
+    </div>`
145
+    n = $(n)
146
+
147
+    // <span class="lv_info lvov"></span>
148
+    add_node(n,`.lvc_overlay`,"append")
149
+
150
+
151
+    var v = $("#largeVideoContainer")[0]
152
+    // v.onmousemove=  ff_mm
153
+    v.onmouseenter= ff_me
154
+    v.onmouseleave =ff_ml
155
+    try {
156
+    n.find(".toggle_ff")[0].onclick = toggle_ff
157
+    n.find(".force_enable")[0].onclick = allow_autoplay
158
+    // n.find(".allow_autoplay")[0].onclick = allow_autoplay
159
+
160
+    } catch (e){}
161
+
162
+    // html_hooks.create_new_toolbox_hook(n)
163
+    $(".tsi").corner("bevel top 20px");
164
+    n = `<span class="plugin_top tbar"><span class="m follow_focus">
165
+<input type="checkbox" id="follow_focus" name="follow_focus">
166
+<label for="follow_focus">
167
+follow focus (moderator only)
168
+</label>
169
+
170
+<br>
171
+<input type="checkbox" id="follow_focus_force" name="follow_focus_force">
172
+<label for="follow_focus_force">
173
+force
174
+</label>
175
+</span>
176
+<span class="m follow_focus2">
177
+ <label for="num_pseudo"># of pseudo videos</label>
178
+  <input type="number" id="num_pseudo" name="num_pseudo" value=${window.msto ? msto.conference.repeat || 0 : 0} min=0>
179
+<br>
180
+  <label for="ov_timeout">overflow scroll interval </label>
181
+  <input type="number" id="ov_timeout" name="timeout" min=.4 step=.1 value=${window.msto ? msto.conference.scroll_timeout || 15 : 15}>
182
+
183
+<br>
184
+<input type="checkbox" id="ov_timeout_disable" name="ov_timeout_disable">
185
+<label for="ov_timeout_disable" class="inline_input">
186
+disable
187
+</label>
188
+<span class="inline_input"><button id="scroll_now" class="inline_input">scroll now</button></span>
189
+
190
+</span>
191
+</span>`
192
+
193
+	// add moderator elements
194
+    if (amimod()){
195
+
196
+    n = $(n)
197
+    n.find("input#follow_focus")[0].onchange = ffcb
198
+    n.find("input#follow_focus_force")[0].onchange = fffcb
199
+    n.find("input#ov_timeout")[0].onchange = scroll_timeout_runner
200
+    n.find("input#ov_timeout_disable")[0].onchange = scroll_timeout_runner
201
+    n.find("#scroll_now")[0].onclick = scroll_send
202
+    n.find("#num_pseudo")[0].onchange = num_pseudo
203
+
204
+    add_node(n,`.subject`,"prepend")
205
+    }
206
+}
207
+
208
+
209
+// 
210
+function init_api6(){
211
+    clog("init_api6...")
212
+    saftly_remove(".plugin_top")
213
+    // return
214
+    var arr = []
215
+    var n 
216
+    n = `<span class="plugin_top pseudo_vid small_vid "><div class="m2 xbox2">ABC</div></span>`
217
+
218
+    const repeat = window.msto ?  msto.conference.repeat || 0 : 0
219
+    if ((!isNaN(repeat) && repeat > 0 )){
220
+    html_hooks.create_video_tile(n.repeat(repeat))
221
+    }
222
+
223
+    refresh_toolbars()
224
+    // ff_set_ev()
225
+    
226
+    n = `<span class="plugin_top"><div class="m xbox">ABC</div></span>`
227
+    html_hooks.create_bottom_toolbox_hook(n)
228
+
229
+
230
+    // n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
231
+    // n = `<span class="plugin_top abs"><div class="dev_filmstrip">ABC</div></span>`
232
+    // n= mod_templates.find(".filmstrip_template")[0].outerHTML
233
+    // html_hooks.create_new_filmstrip(n)
234
+    // n = `<span class="plugin_top pseudo_vid small_vid "><div class="m4 xbox3">ABC</div></span>`
235
+
236
+    let nj = mod_templates.find("#vspace_filmstrip_template")
237
+    if (nj.length){
238
+    n= mod_templates.find("#vspace_filmstrip_template")[0].outerHTML
239
+    add_node(n,`.vspace`,"append")
240
+    }
241
+
242
+    if (window.mod_sort){
243
+    mod_sort()
244
+    }
245
+
246
+    dispatch_resize()
247
+
248
+
249
+}
250
+
251
+
252
+
253
+
254
+
255
+function ff_me(){
256
+clog("ff_me")
257
+    // $(".lvov").removeClass("_hide")
258
+    $(".lvov_container").removeClass("_hide")
259
+    // $(".lvov").removeClass("hide")
260
+    // glob_dbg.ff.ts = Date.now()
261
+    // glob_dbg.ff.stop = 0
262
+    // glob_dbg.ff.n = $(".toggle_ff")[0]
263
+    // glob_dbg.ff.mma.shift()s
264
+
265
+    // dev_raf()
266
+}
267
+function ff_ml(){
268
+clog("ff_ml")
269
+    $(".lvov_container").addClass("_hide")
270
+    // glob_dbg.ff.stop = 1
271
+
272
+}
273
+function ff_mm(){
274
+clog("ff_mm")
275
+glob_dbg.ff.mmc += 1
276
+}
277
+function toggle_ff(){
278
+    clog("TOGGLEFF")
279
+    // glob_dbg.ytp.playVideo()
280
+    // return
281
+    glob_mx.dims.fullframe = !glob_mx.dims.fullframe
282
+    if (glob_mx.dims.fullframe){
283
+        $(".vspace").addClass("_hide")
284
+        $(".toggle_ff")[0].innerHTML = "shrink"
285
+        $(".toggle_ff")[0].innerHTML = "exit fullframe"
286
+        // ._hide
287
+    } else {
288
+        $(".toggle_ff")[0].innerHTML = "enter fullframe"
289
+        $(".vspace").removeClass("_hide")
290
+    }
291
+    dispatch_resize()
292
+
293
+}
294
+function allow_autoplay(){
295
+    glob_dbg.ytp.playVideo()
296
+    // clog("ALA")
297
+    setTimeout(allow_autoplay_end,1)
298
+
299
+}
300
+function allow_autoplay_end(){
301
+    // glob_dbg.ytp.playVideo()
302
+    clog("allow_autoplay_end")
303
+
304
+    if (glob_dbg.slf && glob_dbg.slf.attr_cache && glob_dbg.slf.attr_cache.state == "playing"){
305
+
306
+    clog("allow_autoplay_end CONTINUE!")
307
+    } else {
308
+
309
+    glob_dbg.ytp.pauseVideo()
310
+    }
311
+    // glob_dbg.ytp.pauseVideo()
312
+    var j = $(".lv_info")
313
+    j.removeClass("_show")
314
+
315
+
316
+
317
+     // $(".allow_autoplay")[0].innerHTML = "should work now"
318
+
319
+}
320
+
321
+
322
+function ff_set_ev(){
323
+    var v = $("#largeVideoContainer")[0]
324
+    // v.onmousemove=  ff_mm
325
+    v.onmouseenter= ff_me
326
+    v.onmouseleave =ff_ml
327
+    $(".toggle_ff")[0].onclick = toggle_ff
328
+    $(".allow_autoplay")[0].onclick = allow_autoplay
329
+
330
+}
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+/*
340
+// example event 
341
+function event_test(){
342
+
343
+            tmsgx({
344
+                "type":"event",
345
+                "payload":{path:"z",key:"z",val:"z",etype:"xyz"},
346
+            },"code")
347
+}
348
+
349
+
350
+function all_plugin_events(e){
351
+	clog("all_plugin_events",[this],[...arguments])
352
+}
353
+
354
+
355
+glob_mx.event_handlers.e1 = {
356
+	fn:all_plugin_events,
357
+	m:{},
358
+}
359
+*/
360
+
361
+
362
+function refresh_fs_send(){
363
+
364
+            tmsgx({
365
+                "type":"event",
366
+                "payload":'{path,key,val}',
367
+                etype:"refresh_fs"
368
+            },"code")
369
+}
370
+
371
+function refresh_fs_proc(){
372
+    init_api6()
373
+mod_sort()
374
+new_move()
375
+
376
+dispatch_resize()
377
+	clog("refresh_fs_proc")
378
+}
379
+
380
+function scroll_send(){
381
+
382
+            tmsgx({
383
+                "type":"event",
384
+                "payload":'{path,key,val}',
385
+                etype:"overflow_scroll"
386
+            },"code")
387
+}
388
+
389
+
390
+function scroll_proc(e){
391
+	scroll_to()
392
+    // clog("scroll_proc",[this,...arguments])
393
+}
394
+
395
+
396
+glob_mx.event_handlers.e2 = {
397
+    fn:scroll_proc,
398
+    // fn:nop,
399
+    // m:{etype:"timer_start"},
400
+    m:{etype:"overflow_scroll"},
401
+}
402
+
403
+glob_mx.event_handlers.e3 = {
404
+    fn:refresh_fs_proc,
405
+    // fn:nop,
406
+    // m:{etype:"timer_start"},
407
+    m:{etype:"refresh_fs"},
408
+}
409
+
410
+
411
+
412
+
413
+if (window.refresh_fs_proc){
414
+	refresh_fs_proc()
415
+
416
+}
417
+

+ 821
- 0
rf/filmstrip_mod/m0.js View File

@@ -0,0 +1,821 @@
1
+
2
+glob_mx.filmstrip_handlers[undefined] = function function_name(argument) {
3
+    clog("default FN HANDLER")
4
+}
5
+glob_mx.dims = glob_mx.dims || {} 
6
+
7
+dflt_css = {
8
+      'padding-top': '',
9
+      "min-height": ``,
10
+      "min-width": ``,
11
+      width: ``,
12
+      height: ``,
13
+    
14
+}
15
+
16
+
17
+
18
+function fix_avatar(vid){
19
+    var k,v,bcr
20
+    for (v of  $(vid).filter(".remote_vid,.local_vid")){
21
+        bcr = v.getBoundingClientRect()
22
+        $(v).find(".avatar-container").css({
23
+            width:Math.ceil(bcr.height * .75),
24
+            height:Math.ceil(bcr.height * .75),
25
+        })
26
+    }
27
+}
28
+
29
+
30
+
31
+function resize_thumbs_vertical(cont){
32
+  const computed_css = Object.assign({},dflt_css)
33
+
34
+  var aspect = 16/9
35
+  var width = 335
36
+  var thumbs = $(cont).children(".small_vid")
37
+  width = $(cont).width() - 1  
38
+  width = glob_mx.dims.w5
39
+  // computed_css["--v_index"]=`"VERT"`
40
+  var height = Math.round(width/aspect)
41
+  computed_css.height = height
42
+  computed_css["min-height"] = height
43
+  computed_css.width = width
44
+  computed_css["min-width"] = width
45
+  var k,v
46
+  for ([k,v] of Object.entries(computed_css)){
47
+    Number(v) ? computed_css[k] = v + "px" : 0
48
+  }
49
+  // clog("RTHUMBS")
50
+  thumbs.css(computed_css)
51
+  fix_avatar(thumbs)
52
+
53
+}
54
+
55
+function resize_thumbs_horizontal(cont){
56
+  const computed_css = Object.assign({},dflt_css)
57
+
58
+  var aspect = 16/9
59
+  var width = 335
60
+  // computed_css["--v_index"]=`"horizontal"`
61
+  var thumbs = $(cont).children(".small_vid")
62
+  width = ($(cont).height() * aspect) 
63
+  width = ($(cont).height() * aspect) - 1
64
+  width = Math.floor(glob_mx.dims.w5)
65
+  var height = Math.round(width/aspect)
66
+  computed_css.height = height
67
+  computed_css.width = width
68
+  clog("RTH",cont)
69
+  computed_css["min-width"] = width
70
+  var k,v
71
+  for ([k,v] of Object.entries(computed_css)){
72
+    Number(v) ? computed_css[k] = v + "px" : 0
73
+  }
74
+  // clog("RTHUMBS")
75
+  fix_avatar(thumbs)
76
+  thumbs.css(computed_css)
77
+
78
+
79
+}
80
+
81
+function resize_thumbs_center(cont){
82
+  const computed_css = Object.assign({},dflt_css)
83
+
84
+  var aspect = 16/9
85
+  var width = 335
86
+  // computed_css["--v_index"]=`"horizontal"`
87
+  var thumbs = $(cont).children(".small_vid")
88
+  width = ($(cont).width() ) - 10
89
+  var height = Math.round(width/aspect)
90
+  computed_css.height = height
91
+  computed_css.width = width
92
+  var k,v
93
+  for ([k,v] of Object.entries(computed_css)){
94
+    Number(v) ? computed_css[k] = v + "px" : 0
95
+  }
96
+  // clog("RTHUMBS")
97
+  thumbs.css(computed_css)
98
+  fix_avatar(thumbs)
99
+
100
+
101
+}
102
+
103
+
104
+dflt_css_proto = {
105
+
106
+      'padding-top': '',
107
+      "max-height": ``,
108
+      "min-height": ``,
109
+      "max-width": ``,
110
+      "min-width": ``,
111
+      width: ``,
112
+      height: ``,
113
+      top: ``,
114
+      left: ``,
115
+      bottom: ``,
116
+      right: ``,
117
+      position:``,
118
+      tramsform:``,
119
+      // right: ``,
120
+      // right: ``,
121
+    
122
+}
123
+
124
+function resize_thumbs_proto(thumbs,css_arg){
125
+  var k,v
126
+  let css
127
+  if (Array.isArray(css_arg)){
128
+    css = Object.assign({},dflt_css_proto,...css_arg)
129
+  } else {
130
+    css = Object.assign({},dflt_css_proto,css_arg)
131
+  }
132
+
133
+  if (typeof(css.data) == "object"){
134
+    try{
135
+    Object.assign($(thumbs)[0].dataset,css.data)
136
+} catch(err) {
137
+    clog("dataset err",err)
138
+}
139
+  }
140
+  css["--vdim"] = `"${css.width} x ${css.height}"`
141
+  $(thumbs).css(css)
142
+
143
+}
144
+
145
+
146
+
147
+
148
+
149
+// this handles the layout of all custom filmstrips an the large video element
150
+// todo refactor half of this into the api
151
+function calc_fs_dims(){
152
+    const hd_w = 16
153
+    const hd_h = 9
154
+
155
+    const aspect_ratio_hd = hd_w / hd_h
156
+
157
+    const aspect_ratio_65 = (hd_w * 6) / (hd_h * 5)
158
+    const aspect_ratio_64 = (hd_w * 6) / (hd_h * 4)
159
+
160
+
161
+    const state = APP.store.getState();
162
+    var { clientHeight, clientWidth } = state['features/base/responsive-ui'];
163
+    var avail_width  =clientWidth
164
+    // var avail_height =clientHeight - 100
165
+    var avail_height =clientHeight - 45
166
+
167
+
168
+
169
+    var dim_hd = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
170
+            columns:1,
171
+    visibleRows:1,
172
+    clientWidth:avail_width,
173
+    clientHeight:avail_height,
174
+    TILE_ASPECT_RATIO:TILE_ASPECT_RATIO ,
175
+    verticalMargin:0,
176
+    // sideMargins=0,
177
+    // topBottomPadding:100,
178
+    })
179
+    let w5,h5,w53,h53,w54,h54
180
+    h5 = dim_hd.height/5
181
+    w5 = dim_hd.width/5
182
+    let m = 10
183
+    let wm = 10
184
+    let hm = 8
185
+    // w5 = w5 - m
186
+    // h5 = h5 - m
187
+
188
+
189
+    w53 = w5 * 3
190
+    h53 = h5 * 3
191
+    w54 = w5 * 4
192
+    h54 = h5 * 4
193
+    w5 = w5 - m 
194
+    h5 = h5 - hm
195
+
196
+    glob_mx.dims.w5 = w5 
197
+    glob_mx.dims.h5 = h5 
198
+    glob_mx.dims.fw = dim_hd.width 
199
+    glob_mx.dims.fh = dim_hd.height 
200
+    glob_mx.dims.m = m
201
+
202
+    h54 = h54  + (hm * 2)
203
+    let vtop 
204
+    let vleft 
205
+    let s_width,h_height
206
+    s_width = w53 
207
+    h_height = h53  + 1 * hm
208
+    vleft = w5 + ( m ) 
209
+    // = h5 + ((m * 2 ) / aspect_ratio_hd) + 1
210
+    vtop = h5 + ( m * 2 ) - 2 
211
+    vtop = h5 + (hm * 1.5)
212
+    clog("....",clientHeight - dim_hd.height  > 100,clientHeight - dim_hd.height,clientHeight , dim_hd.height)
213
+
214
+    var top_margin_flag 
215
+    if (clientHeight - dim_hd.height  > 150 ) {
216
+
217
+     top_margin_flag = 1
218
+    // $(".fs_container").css({width:dim_hd.width,"min-height":dim_hd.height,"max-height":dim_hd.height + 100})
219
+    resize_thumbs_proto($(".fs_container"),{width:dim_hd.width,"height":dim_hd.height})
220
+    // top_margin_flag = 
221
+    // $(".fs_container").css({width:dim_hd.width,"min-height":dim_hd.height,"max-height":dim_hd.height + 100})
222
+    } else {
223
+     top_margin_flag = 0
224
+    // resize_thumbs_proto($(".fs_container"),{width:dim_hd.width,"height":dim_hd.height})
225
+    resize_thumbs_proto($(".fs_container"),{width:dim_hd.width,"min-height":dim_hd.height,"max-height":dim_hd.height + 100})
226
+
227
+    }
228
+    // $(".fs_container").css({width:dim_hd.width,"height":dim_hd.height})
229
+    // fs_type: "vertical"
230
+    resize_thumbs_proto($(".ic1"),[
231
+        {
232
+                 width:dim_hd.width,
233
+        height:h5,
234
+            "--vtext":`"top_fs"`,
235
+            // data:{fs_type: "vertical"},
236
+            data:{fs_type: "horizontal",},
237
+        },])
238
+
239
+
240
+    resize_thumbs_proto($(".ic2"),[
241
+        {
242
+                 width:w5,
243
+        height:h53,
244
+        top:vtop ,
245
+
246
+            "--vtext":`"left_fs"`,
247
+            data:{fs_type: "vertical"},
248
+        },])
249
+
250
+    resize_thumbs_proto($(".ic3"),[
251
+        {
252
+                 width:w5,
253
+        height:h53,
254
+        top:vtop,
255
+        left:w54,
256
+        // left:0,
257
+        // right:0,
258
+            "--vtext":`"right_fs"`,
259
+            data:{fs_type: "vertical"},
260
+        },])
261
+
262
+    let overflow_vids = $(".ic6").children(".small_vid")
263
+    let overflow_obj = {}
264
+    if (overflow_vids.length > 5){
265
+    }
266
+    overflow_obj.width = w5 * (overflow_vids.length + 1)
267
+    resize_thumbs_proto($(".c6"),[{
268
+        width:dim_hd.width,
269
+        height:h5,
270
+        height:h5 + 20,
271
+        top:h54 - (hm) * .5,
272
+        left:0,}])
273
+
274
+    resize_thumbs_proto($(".ic6"),[
275
+        {
276
+                 width:dim_hd.width,
277
+        height:h5 + 10,
278
+        // top:h54 - (hm) * .5,
279
+        // left:0,
280
+        // left:w54,
281
+        // right:0,
282
+            "--vtext":`"bottom_fs"`,
283
+            data:{fs_type: "horizontal"},
284
+        },overflow_obj])
285
+
286
+
287
+    resize_thumbs_proto($(".ic4"),[
288
+        {
289
+        // height:h53,
290
+        width:s_width,
291
+        // height:h53,
292
+        height:h_height,
293
+        top:vtop - 1,
294
+        left:vleft,
295
+        // left:w54,
296
+        // right:0,
297
+            "--vtext":`"center"`,
298
+            data:{fs_type: "single"},
299
+        },])
300
+
301
+    var center_vid = $(".ic4")[0]
302
+    var bcr = center_vid.getBoundingClientRect()
303
+    var bcr_fs = $(".fs_container")[0].getBoundingClientRect()
304
+    glob_mx.dims.top_margin_flag=top_margin_flag
305
+    glob_mx.dims.top_offset=bcr_fs.y
306
+    glob_mx.dims.left_offset=bcr_fs.x
307
+    if (glob_mx.dims.fullframe){
308
+        fullframe()
309
+    }else if (top_margin_flag){
310
+    resize_thumbs_proto($("#largeVideoContainer"),[
311
+        {
312
+        // height:h53,
313
+        width:s_width - m,
314
+        // height:h53,
315
+        height:h_height - hm,
316
+        // top:vtop - 2 + (hm * .5),
317
+        transform: "translate(0%, -50%)",
318
+        top:`calc(50% + ${Math.floor(hm * 1)}px)`,
319
+        top:`calc(50% + ${Math.floor(hm * .7)}px)`,
320
+        left:vleft + (.5 * m),
321
+        position:"relative",
322
+        // outline:"1px solid blue",
323
+        outline:"",
324
+        // "z-index":"10",
325
+        // left:w54,
326
+        // right:0,
327
+            "--vtext":`"center"`,
328
+            data:{fs_type: "single"},
329
+        },])
330
+    } else {
331
+resize_thumbs_proto($("#largeVideoContainer"),[
332
+        {
333
+        // height:h53,
334
+        width:s_width - m,
335
+        // height:h53,
336
+        height:h_height - hm,
337
+        top:vtop - 2 + (hm * .5) + bcr_fs.y,
338
+        // top:h5 + (3 * hm),
339
+        transform: "translate(-50%, 0)",
340
+        // top:`calc(50% + ${Math.floor(hm * 1)}px)`,
341
+        // top:`calc(50% + ${Math.floor(hm * .7)}px)`,
342
+        // left:vleft + (.5 * m),
343
+        left:"50%",
344
+        position:"relative",
345
+        // "z-index":"10",
346
+        // left:w54,
347
+        // right:0,
348
+        // outline:"1px solid red",
349
+        outline:"",
350
+            "--vtext":`"center"`,
351
+            data:{fs_type: "single"},
352
+        },])   
353
+    }
354
+
355
+    // #sharedVideo
356
+            // resize_thumbs_proto($(".ic4"),[
357
+            resize_thumbs_proto($("#sharedVideoIFrame.z"),[
358
+        {
359
+        // height:h53,
360
+        width:s_width,
361
+        // height:h53,
362
+        height:h_height,
363
+        top:vtop - 1,
364
+        left:vleft,
365
+        position:"relative",
366
+        // "z-index":"10",
367
+        // left:w54,
368
+        // right:0,
369
+            "--vtext":`"center"`,
370
+            data:{fs_type: "single"},
371
+        },])
372
+resize_thumbs_proto($("#sharedVideoIFrame"),{
373
+        position:"",
374
+
375
+})
376
+clog("top",top_margin_flag)
377
+resize_thumbs_proto($("#largeVideoContainer.z,#sharedVideoIFrame"),{position:"",})
378
+}
379
+
380
+function fullframe(){
381
+    var w,h
382
+    w = glob_mx.dims.fw
383
+    h = glob_mx.dims.fh
384
+    let top = "50%"
385
+    let transform ="translate(-50%, -50%)"
386
+
387
+    if (glob_mx.dims.top_margin_flag){
388
+        top = glob_mx.dims.top_offset+ "px"
389
+        transform = "translate(-50%, 0px)"
390
+        transform = "translate(0%, 0px)"
391
+        glob_mx.dims.top_offset
392
+        // left_offset
393
+
394
+    }
395
+    resize_thumbs_proto($("#largeVideoContainer"),[
396
+        {
397
+        // height:h53,
398
+        width:w,
399
+        // height:h53,
400
+        height: h,
401
+        // top:vtop - 2 + (hm * .5) + bcr_fs.y,
402
+        // top:h5 + (3 * hm),
403
+        // transform: "translate(-50%, 0)",
404
+        // transform: "translate(-50%, -50%)",
405
+        // top:`calc(50% + ${Math.floor(hm * 1)}px)`,
406
+        // top:`calc(50% + ${Math.floor(hm * .7)}px)`,
407
+        // left:vleft + (.5 * m),
408
+        // left:"50%",
409
+        transform:"",
410
+        // top:`50% ${glob_mx.dims.top_offset}`,
411
+        top:`calc(50% + ${top}px)`,
412
+        top:glob_mx.dims.top_offset,
413
+        left:glob_mx.dims.left_offset,
414
+        position:"relative",
415
+        // "z-index":"10",
416
+        // left:w54,
417
+        // right:0,
418
+        // outline:"1px solid red",
419
+        outline:"",
420
+            "--vtext":`"center"`,
421
+            data:{fs_type: "single"},
422
+        },])   
423
+}
424
+// fullframe()
425
+// setTimeout(fullframe,100)
426
+
427
+
428
+
429
+
430
+function filmstrip_rs(){
431
+    calc_fs_dims()
432
+    clog("filmstrip_rs")
433
+}
434
+
435
+glob_mx.filmstrip_handlers.vertical = filmstrip_rs
436
+glob_mx.filmstrip_handlers.horizontal = filmstrip_rs
437
+glob_mx.filmstrip_handlers.center = filmstrip_rs
438
+
439
+
440
+
441
+
442
+
443
+glob_mx.filmstrip_tile_handlers.vertical = resize_thumbs_vertical
444
+glob_mx.filmstrip_tile_handlers.horizontal = resize_thumbs_horizontal
445
+glob_mx.filmstrip_tile_handlers.center = resize_thumbs_center
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+
480
+// this handles sorting the videos  
481
+
482
+
483
+
484
+
485
+function sort_id3(a, b) {
486
+    if (a.id > b.id){
487
+        return 1
488
+    } else if (a.id < b.id){
489
+        return -1
490
+    }
491
+    return 0
492
+}
493
+
494
+
495
+
496
+
497
+indexed_tiles = []
498
+indexed_map = window.indexed_map || new Map()
499
+reverse_indexed_map = window.reverse_indexed_map || new Map()
500
+
501
+// indexed_map =  new Map()
502
+// reverse_indexed_map =  new Map()
503
+
504
+function array_move(arr, old_index, new_index) {
505
+    if (new_index >= arr.length) {
506
+        var k = new_index - arr.length + 1;
507
+        while (k--) {
508
+            arr.push(undefined);
509
+        }
510
+    }
511
+    arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
512
+    return arr; // for testing
513
+};
514
+
515
+
516
+
517
+function mod_sort(){
518
+    var arr = []
519
+    var parr = []
520
+    var ivid = {}
521
+    var k,v
522
+    var j = $(".small_vid:not(.pseudo_vid)")
523
+window.indexed_map =  new Map()
524
+window.reverse_indexed_map =  new Map()
525
+
526
+    var part = get_participants()
527
+    var parts =jc(part).sort(sort_id3)
528
+    // clog(parts,part)
529
+    var mod_id = get_mod(part)
530
+    if (mod_id){
531
+    remap_set( $(`#participant_${mod_id.id}`)[0],2)
532
+    }
533
+        
534
+
535
+   
536
+
537
+    var n 
538
+    var cnt = 0
539
+    for (k of parts){
540
+        // clog("z",k,k.local)
541
+        if (k.isFakeParticipant){ 
542
+    n = `<span class="plugin_top pseudo_vid small_vid youtube_vid"><div class="m2 xbox2">ABC</div></span>`
543
+    if ($(".youtube_vid").length){
544
+
545
+    } else {
546
+        // html_hooks.create_video_tile(n)
547
+
548
+    }
549
+        // remap_set($(".youtube_vid")[0],0)
550
+        j = $("#sharedVideoContainer")
551
+        remap_set(j[0],2)
552
+        // remap_set( $(`#participant_${mod_id.id}`)[0],1)
553
+        } else {
554
+        j = k.local ? $("#localVideoContainer") : $(`#participant_${k.id}`)
555
+        // get_mod().id
556
+
557
+        }
558
+        j.css({"--v_index":`"I: ${cnt}"`})
559
+        j.css({"--v_id":`"${k.id}"`})
560
+        j[0].dataset.v_index = cnt
561
+        arr.push(j[0])
562
+        cnt += 1
563
+    }
564
+    v = $(".pseudo_vid")
565
+    for (k of v){
566
+        // clog(k)
567
+        $(k).css({"--v_index":`"I: ${cnt}"`})
568
+        $(k).css({"--v_id":`"pseudo_${cnt}"`})
569
+        parr.push(k)
570
+        $(k)[0].dataset.v_index = cnt
571
+        cnt += 1
572
+    }
573
+
574
+
575
+
576
+    arr.push(...parr)
577
+    window.arig_tiles = jc(arr)
578
+    // remap_set($(".local_vid")[0],1)
579
+    remap_set($(".local_vid")[0],3)
580
+    // remap_set( $(`#participant_${mod_id.id}`)[0],2)
581
+
582
+    arr = remap_sort(arr)
583
+    arr = remap_sort(arr)
584
+    arr = remap_sort(arr)
585
+    window.sorted_tiles = arr
586
+
587
+
588
+
589
+
590
+
591
+    // for 
592
+}
593
+sorted_tiles = window.sorted_tiles || []
594
+function remap_sort(arr){
595
+    // return
596
+    var k,v
597
+    for ([k,v] of indexed_map){
598
+        // clog(k,v)
599
+        var old_index = arr.indexOf(k)
600
+        // clog("K,v",k,v,old_index)
601
+        array_move(arr,old_index,v)
602
+
603
+        // clog(cnt,sorted_tiles.includes(k),v,k)
604
+        // cnt += 1
605
+
606
+    }
607
+    return arr
608
+
609
+}
610
+
611
+function remap_set(vid,loc){
612
+    if (typeof(vid)=="number"){
613
+        vid = sorted_tiles[vid]
614
+    }
615
+    var old = reverse_indexed_map.get(loc)
616
+    // reverse_indexed_map
617
+    indexed_map.delete(old,loc)
618
+    indexed_map.set(vid,loc)
619
+    reverse_indexed_map.set(loc,vid)
620
+    var k,v
621
+    var cnt = 0 
622
+    for ([k,v] of indexed_map){
623
+        // clog(k,v)
624
+        // clog(cnt,sorted_tiles.includes(k),v,k)
625
+        cnt += 1
626
+
627
+    }
628
+
629
+}
630
+
631
+
632
+
633
+
634
+
635
+
636
+// move videos onto the filmstrips
637
+function new_move(){
638
+    var j 
639
+    try {
640
+        j = jc(window.sorted_tiles)
641
+    } catch (err) {
642
+        clog("NEW MOVE err:",err)
643
+    }
644
+    $(".ic1").append(j.splice(0,5))
645
+    // $(".ic2").append(j.splice(0,3))
646
+    // $(".ic3").append(j.splice(0,3))
647
+
648
+    $(".ic2").append(j.splice(0,1))
649
+    $(".ic3").append(j.splice(0,1))
650
+
651
+
652
+    $(".ic2").append(j.splice(0,1))
653
+    $(".ic3").append(j.splice(0,1))
654
+
655
+    $(".ic2").append(j.splice(0,1))
656
+    $(".ic3").append(j.splice(0,1))
657
+
658
+
659
+
660
+    const all_extra = j.splice(0)
661
+    if (all_extra.length > 5){
662
+        $(".ic6").addClass("overflow")
663
+    } else {
664
+
665
+        $(".ic6").removeClass("overflow")
666
+    }
667
+    $(".ic6").append(all_extra)
668
+}
669
+
670
+
671
+
672
+
673
+
674
+
675
+
676
+
677
+
678
+
679
+
680
+
681
+
682
+
683
+
684
+
685
+// the rest of this slides the bottom row if there is overflow.
686
+
687
+timeout_scroll_glob = window.timeout_scroll_glob || {
688
+    stop:1,
689
+    timeout:3000,
690
+    rid:0,
691
+    mx_raf:200,
692
+    to_left:1,
693
+}
694
+timeout_scroll_glob.stop=1
695
+function timeout_scroll(rid){
696
+    // clog("Tscroll",rid,timeout_scroll_glob)
697
+    if (timeout_scroll_glob.stop || rid != timeout_scroll_glob.rid){
698
+        // clog("tscroll stop")
699
+        return
700
+    }
701
+        // clog("tscroll continue")
702
+        scroll_send()
703
+    var t = setTimeout(timeout_scroll,timeout_scroll_glob.timeout,rid)
704
+
705
+}
706
+
707
+function timeout_scroll_start(){
708
+    timeout_scroll_glob.rid += 1
709
+    setTimeout(timeout_scroll,timeout_scroll_glob.timeout,timeout_scroll_glob.rid)
710
+
711
+}
712
+
713
+function get_bcrs(arr,fs_bcr){
714
+    var ret = {
715
+        arr:[],
716
+        first_left:0,
717
+        first_left_bcr:0,
718
+        first_right:0,
719
+        first_right_bcr:0,
720
+    }
721
+    var s = $(".ic6").children(".small_vid")
722
+    s.removeClass("ir il ilr ir0 il0")
723
+    var k,v,bcr,isleft,isright
724
+    for (v of arr){
725
+        bcr = v.getBoundingClientRect()
726
+        ret.arr.push(bcr)
727
+        isleft = bcr.right < (fs_bcr.right + 10)
728
+        isright = bcr.left > (fs_bcr.left )
729
+        if (isleft && isright){
730
+            $(v).addClass("ilr")
731
+        } else if (isleft){
732
+            $(v).addClass("il")
733
+
734
+        } else if (isright){
735
+            $(v).addClass("ir")
736
+
737
+        }
738
+        
739
+        if (isleft && ! isright){
740
+            ret.first_left = v
741
+            ret.first_left_bcr = bcr
742
+        }  
743
+        if ( (! ret.first_right ) && !isleft  && isright ){
744
+            ret.first_right = v
745
+            ret.first_right_bcr = bcr
746
+
747
+        }
748
+        
749
+
750
+    }
751
+    clog("````",ret)
752
+    $(ret.first_right).addClass("ir0")
753
+    $(ret.first_left).addClass("il0")
754
+    return ret
755
+
756
+}
757
+
758
+function scroll_to(n){
759
+    var fs,fs_bcr,vid_bcr,ifs
760
+    fs =  $(".c6")[0]
761
+    ifs =  $(".ic6")[0]
762
+    var vid
763
+
764
+    var s = $(".ic6").children(".small_vid")
765
+    fs_bcr = fs.getBoundingClientRect() 
766
+    var ov = get_bcrs([...s],fs_bcr)
767
+    var tobj = {
768
+
769
+    }
770
+    var scroll_to_vid = 0
771
+    if (timeout_scroll_glob.to_left){
772
+        if (ov.first_left){
773
+            scroll_to_vid = ov.first_left
774
+            vid_bcr = ov.first_left_bcr
775
+            tobj.inc_mx = vid_bcr.left - fs_bcr.left
776
+            tobj.inc = -8
777
+        } else {
778
+            timeout_scroll_glob.to_left = 0
779
+        }
780
+    } else {
781
+        if (ov.first_right){
782
+            scroll_to_vid = ov.first_right
783
+            vid_bcr = ov.first_right_bcr
784
+            tobj.inc_mx = vid_bcr.right - fs_bcr.right
785
+            tobj.inc = 8
786
+        } else {
787
+            timeout_scroll_glob.to_left = 1
788
+        }
789
+    }
790
+    scroll_to_vid ?  requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,scroll_to_vid,tobj.inc,tobj.inc_mx,0,0),"z-index") : 0
791
+
792
+}
793
+function raf_clog(fs,vid,cnt,ts){
794
+    clog("raf.",cnt,ts)
795
+
796
+
797
+}
798
+
799
+function raf(fs,vid,inc,inc_mx,cnt,ts0,ts){
800
+    fs.scrollBy(inc,0)
801
+    if (Math.abs(inc) < Math.abs(inc_mx) && cnt < timeout_scroll_glob.mx_raf && ts - (ts0 || ts)  < 3000){
802
+    requestAnimationFrame(raf.bind(timeout_scroll_glob,fs,vid,inc,inc_mx - inc ,cnt+1,ts0 || ts))
803
+
804
+    } else {
805
+        // clog("FIN",[fs,vid],cnt,ts0,inc_mx,ts,ts-ts0)
806
+        vid.scrollIntoView({ behavior: 'smooth', block: 'nearest' ,inline:"nearest"})
807
+    }
808
+
809
+}
810
+
811
+
812
+
813
+
814
+if (window.refresh_fs_proc){
815
+    refresh_fs_proc()
816
+
817
+}
818
+
819
+// $(".video-stream.html5-main-video").play()
820
+// $(".video-stream.html5-main-video").play()
821
+// if ()

+ 327
- 0
rf/fs.css View File

@@ -0,0 +1,327 @@
1
+
2
+
3
+.tile-view #filmstripRemoteVideos {
4
+	margin: 135 0 100 0;
5
+}
6
+
7
+
8
+
9
+
10
+
11
+.vid_container > .small_vid {
12
+	display: inline-block;
13
+}
14
+
15
+
16
+
17
+.small_vid{
18
+	/*box-sizing: content-box;*/
19
+	box-sizing: border-box;
20
+	margin: 4px 5px;/
21
+	/*background-clip: border-box;*/
22
+	background-clip: content-box;
23
+	outline: unset;
24
+}
25
+.dev_filmstrip {
26
+	height: 100%;
27
+	width: 100%;
28
+	position: absolute;
29
+	display: inline-flex;
30
+    align-items: center;
31
+    justify-content: center;
32
+}
33
+
34
+
35
+
36
+.vid_container{
37
+	z-index: 6;
38
+}
39
+
40
+
41
+
42
+
43
+
44
+.ic4  {
45
+	/*vertical-align: */
46
+	vertical-align: middle;
47
+	text-align: center;
48
+	/*outline: 2px solid red;*/
49
+
50
+	align-items: center;
51
+	/*margin: auto;*/
52
+	display: flex;
53
+	/*flex-wrap: */
54
+}
55
+
56
+.ic4 .small_vid  {
57
+	display: inline-block !important;
58
+	margin: auto;
59
+}
60
+
61
+
62
+
63
+.fs_container{
64
+	position: relative;
65
+	display: inline-block;
66
+	height: 100%;
67
+	margin: auto;
68
+
69
+}
70
+
71
+#sharedVideoIFrame {
72
+	width: 100% !important;
73
+	height: 100% !important;
74
+}
75
+
76
+#videospace{
77
+	vertical-align: center;
78
+	--lvw: 100% !important;;
79
+}
80
+ 
81
+.youtube_vid {
82
+	outline: 5px dotted red;
83
+}
84
+
85
+
86
+
87
+.ic1 {
88
+
89
+  display: flex;
90
+  justify-content: center;
91
+
92
+	justify-content:center;
93
+
94
+}
95
+
96
+
97
+
98
+#sharedVideoIFrame,#sharedVideo {
99
+	display: unset !important;
100
+	opacity: 1 !important;
101
+}
102
+
103
+#largeVideoWrapper {
104
+	width: 100% !important;
105
+	height: 100% !important;
106
+	top: 0 !important;
107
+	bottom: 0 !important;
108
+	left: 0 !important;
109
+	right: 0 !important;
110
+}
111
+
112
+.large-video-background{
113
+	display: none !important;
114
+}
115
+
116
+
117
+.indicator_hook {
118
+pointer-events: none;
119
+}
120
+
121
+
122
+.vid_toptoolbar_hook {
123
+	position: absolute;
124
+}
125
+
126
+
127
+#toggleFilmstripButton,[aria-label="Toggle tile view"] {
128
+	/*display: none !important;*/
129
+}
130
+
131
+.videocontainer__toptoolbar{
132
+	z-index: auto !important;
133
+}
134
+
135
+
136
+/* this is important this covers large video  */
137
+.cont.c4{
138
+	z-index: 0;
139
+}
140
+
141
+
142
+.dev_hook:not(.vspace,.top_toolbox){
143
+	display: none;
144
+}
145
+.xbox {
146
+	display: none ;
147
+
148
+}
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+.vid_toptoolbar_hook{
157
+	width: 100%;
158
+	height: 0%;
159
+	padding-bottom: 56.25%;
160
+}
161
+
162
+
163
+
164
+
165
+
166
+.outline_indicator{
167
+	/*outline: 1px solid #0000;*/
168
+	outline: 2px solid #000;
169
+	outline: 0px solid #fff;
170
+	outline-offset: -15px;
171
+	--voffc: -3px; 
172
+	--voff:  2px;
173
+	--voffw: 2px; 
174
+	width: 100%;
175
+	height: 100%;
176
+	position: absolute;
177
+
178
+}
179
+
180
+.active-speaker .outline_indicator.ind_1{
181
+	outline-offset: 5px;
182
+	outline-offset: calc((var(--voff) * 3 ) + var(--voffc));
183
+	outline-width: var(--voffw);
184
+	outline-color: #0ff;
185
+}
186
+.videoContainerFocused .outline_indicator.ind_2{
187
+	outline-offset: 3px;
188
+	outline-offset: calc((var(--voff) * 2 ) + var(--voffc));
189
+	outline-width: var(--voffw);
190
+	outline-color: #f00;
191
+}
192
+.local_vid .outline_indicator.ind_3{
193
+	outline-offset: 1px;
194
+	outline-offset: calc((var(--voff) * 1 ) + var(--voffc));
195
+	outline-width: var(--voffw);
196
+	outline-color: #fff;
197
+}
198
+
199
+
200
+
201
+
202
+
203
+.remote-video-menu-trigger, .remotevideomenu {
204
+	z-index: 10;
205
+}
206
+
207
+.follow_focus {
208
+	z-index: 20;
209
+	position: absolute;
210
+	left: 250px;
211
+	pointer-events:auto;
212
+
213
+}
214
+
215
+.follow_focus2 {
216
+	z-index: 20;
217
+	position: absolute;
218
+	right: 100px;
219
+	pointer-events:auto;
220
+
221
+}
222
+
223
+.dev_hook.top_toolbox{
224
+	pointer-events: none;
225
+	z-index: -1;
226
+}
227
+
228
+
229
+#react > div {
230
+		/*background-color: rgb(27, 38, 56);*/
231
+		/*background-color: rgb(71, 71, 71);*/
232
+		background-color: #374757;
233
+}
234
+
235
+
236
+.new-toolbox .toolbox-background {
237
+/*
238
+    background-image: linear-gradient(to top,rgba(0,0,0,.6),rgba(0,0,0,.4),rgba(0,0,0,.1),rgba(0,0,0,0));
239
+
240
+
241
+    --vr0: rgba(0,0,0,1);
242
+    --vr1: rgba(0,0,0,.6);
243
+    --vr2: rgba(0,0,0,.4);
244
+    --vr3: rgba(0,0,0,0);
245
+
246
+    background-image: linear-gradient(to top,rgba(0,0,0,1),rgba(0,0,0,.5),rgba(0,0,0,.2),rgba(0,0,0,0));
247
+*/
248
+
249
+    --vr0:  rgba(0,0,0,1)  0%;
250
+    --vr1:  rgba(0,0,0,.6) 25%;
251
+    --vr2:  rgba(0,0,0,.3) 55%;
252
+    --vr3:  rgba(0,0,0,0)  100%;
253
+
254
+    background-image: linear-gradient(to top,var(--vr0),var(--vr1),var(--vr2),var(--vr3));
255
+}
256
+.button-group-center {
257
+	position: relative;
258
+}
259
+
260
+
261
+
262
+/*
263
+.il {
264
+	outline: 4px inset #ff0;
265
+}
266
+
267
+.ir {
268
+	outline: 4px inset #f00;
269
+	
270
+}
271
+
272
+
273
+.ilr {
274
+	outline: 4px inset #0ff;
275
+}
276
+
277
+.ir0 {
278
+	border-radius: 30px;
279
+}
280
+
281
+.il0 {
282
+	border-radius: 30px;
283
+}
284
+.ic3 {
285
+	background: #ff08;
286
+
287
+}
288
+.ic2 {
289
+	background: #00f8;
290
+
291
+}
292
+*/
293
+
294
+
295
+
296
+.follow_focus,.follow_focus2 {
297
+	background-color: #0008;
298
+}
299
+
300
+
301
+.inline_input {
302
+	display: inline;
303
+}
304
+
305
+#ov_timeout,#num_pseudo{
306
+	width: 4em;
307
+}
308
+
309
+/*.presence-label, */
310
+
311
+.subject {
312
+	overflow: visible;
313
+}
314
+
315
+* {
316
+	/*color: red;*/
317
+}
318
+#sharedVideo.z{
319
+	pointer-events: unset !important;
320
+}
321
+#etherpad.z{
322
+	outline: 2px solid red;
323
+	outline-offset: -5px;
324
+	/*z-index: 500 !important;*/
325
+	z-index: -1 !important;
326
+	pointer-events: none;
327
+}

+ 87
- 0
rf/fs_hook.js View File

@@ -0,0 +1,87 @@
1
+
2
+
3
+
4
+
5
+function resize_filmstrips(that,fn_name,args=[]){
6
+
7
+}
8
+function resize_filmstrips2(that,fn_name,args=[]){
9
+	
10
+}
11
+
12
+
13
+glob_mx.filmstrip_handlers = glob_mx.filmstrip_handlers || {}
14
+glob_mx.filmstrip_tile_handlers = glob_mx.filmstrip_tile_handlers || {}
15
+
16
+
17
+
18
+// run callbacks for all filmstrips on resize
19
+function resizeThumbnailsForCustomView(that,fn_name,args=[]){
20
+    const thumbs = glob_react.Filmstrip._getThumbs()
21
+    const all_thumbs = $(".small_vid")
22
+    const custom_thumbs = all_thumbs.not(thumbs.remlocThumbs)
23
+    const vid_containers = $(".vid_container")
24
+    const loose_thumbs = custom_thumbs.not(vid_containers.children())
25
+    var k,v 
26
+    let fs_handler_key
27
+    let fs_handler 
28
+    let fs_tile_handler
29
+    let fs_handlers = new Map()
30
+    let i
31
+    // console.trace("rtscv...")
32
+
33
+    let fs_tile_handlers = []
34
+    for (v of vid_containers){
35
+      // clog(":",v,v.dataset.fs_type)
36
+      fs_handler_key = v.dataset.fs_handler
37
+      // clog("~",v,v.dataset,fs_handler)
38
+      fs_tile_handler = glob_mx.filmstrip_tile_handlers[fs_handler_key] || nop
39
+      fs_handler = glob_mx.filmstrip_handlers[fs_handler_key] || nop
40
+      // glob_mx.filmstrip_tile_handlers[fs_handler_key] ? glob_mx.filmstrip_tile_handlers[fs_handler_key](v) : 1
41
+      // fs_tile_handlers.push([glob_mx.filmstrip_tile_handlers[fs_handler_key] || nop,v])
42
+      // fs_handlers.setD(glob_mx.filmstrip_handlers[fs_handler_key] || nop,)
43
+      fs_tile_handlers.push([fs_tile_handler,v])
44
+      fs_handlers.setD(fs_handler,[])
45
+      i = fs_handlers.get(fs_handler)
46
+      i.push(v)
47
+
48
+      // glob_mx.filmstrip_handlers
49
+    }
50
+    // clog("fs_tile_handlers",fs_tile_handlers)
51
+    for ([k,v] of fs_handlers){
52
+    	// clog("ft0",k,v)
53
+    	k(v)
54
+    }
55
+    for ([k,v] of fs_tile_handlers){
56
+    	// clog("ft",k,v)
57
+    	k(v)
58
+
59
+    }
60
+
61
+
62
+    // return
63
+    // const custom_thumbs = all_thumbs
64
+
65
+    var aspect = 16/18
66
+    var width = 135
67
+    var height = Math.round(width/aspect)
68
+    loose_thumbs.css({
69
+      'padding-top': '',
70
+      "min-height": `${height}px`,
71
+      "min-width": `${width}px`,
72
+      width: `${width}px`,
73
+      height: `${height}px`,
74
+    })
75
+
76
+    clog("rtscv",fn_name,[that,...args])
77
+
78
+
79
+}
80
+
81
+
82
+
83
+
84
+
85
+function onover(){
86
+	clog(this,[...arguments])
87
+}

+ 94
- 0
rf/i4m/m.css View File

@@ -0,0 +1,94 @@
1
+
2
+
3
+
4
+/*.lobby_root*/
5
+/*rooms_dir*/
6
+/*room_span*/
7
+
8
+/*rx1*/
9
+/*rx2*/
10
+
11
+
12
+.lobby_root {
13
+	top: 0;
14
+	left: 0;
15
+	right: 0;
16
+	bottom: 0;
17
+	outline: 3px solid red;
18
+	outline-offset: -20px;
19
+	position: absolute;
20
+	z-index: 10;
21
+	/*background-image: url("../../media/examples/lizard.png");*/
22
+	background-image: url("/ign/rf/img/image.png");
23
+
24
+	/*background-image: url("/ign/rf/img/img3.jpg");*/
25
+	/*vertical-align: middle;*/
26
+}
27
+
28
+
29
+
30
+.rooms_dir {
31
+	/*padding-top: auto;*/
32
+	/*top: 50%;*/
33
+	top: 50%;
34
+	vertical-align: middle;
35
+	/*display: inline-block;*/
36
+	transform: translate(0,-50%);
37
+	width: calc(100% - 50px);
38
+	height: 300px;
39
+	position: relative;
40
+	outline: 6px solid green;
41
+	margin: auto;
42
+	overflow-x: scroll;
43
+
44
+}
45
+
46
+.rooms_dir_full{
47
+	/*position: relative;*/
48
+	/*display: inline;*/
49
+	/*width: 300%;*/
50
+	top: 0;
51
+
52
+	/*left: 0;*/
53
+	width: auto;
54
+	position: absolute;
55
+	/*right: 0;*/
56
+	bottom: 0;
57
+}
58
+
59
+
60
+
61
+.room_span {
62
+	/*top: 0;*/
63
+	/*bottom: 0;*/
64
+	height: 200px;
65
+	/*width: 20%;*/
66
+	/*margin: 20em;*/
67
+	margin: 20px;
68
+	width: 200px;
69
+	outline: 2px solid #ff0;
70
+	position: relative;
71
+	display: flex;
72
+	display: inline;
73
+	display: inline-block;
74
+	/*display: inline-flex;*/
75
+}
76
+
77
+.tile_title{
78
+	/*margin: auto 30px;*/
79
+	/*margin: 30px auto;*/
80
+	/*width: 100%;*/
81
+	text-align: center;
82
+	position: relative;
83
+	/*display: inline;*/
84
+	font-size: 2em;
85
+}
86
+.tile_button{
87
+	width: 125px;
88
+	height: 25px;
89
+	outline: 3px solid blue;
90
+	/*margin: 0 50%;*/
91
+	margin: 0 auto;
92
+
93
+
94
+}

+ 31
- 0
rf/i4m/m.html View File

@@ -0,0 +1,31 @@
1
+
2
+
3
+
4
+<span class="plugin_top abs filmstrip_template">
5
+
6
+<div class="lobby_root plugin_top">
7
+	<div class="rooms_dir">
8
+	<span class="rooms_dir_full">
9
+		<!-- <span class="room_span rx2"></span> -->
10
+	</span>
11
+	</div>
12
+</div>
13
+
14
+
15
+</div>
16
+
17
+
18
+<span>
19
+	
20
+		<span class="room_span rxt">
21
+			<div class="tile_title">Title</div>
22
+			<div class="tile_button"></div>
23
+		</span>
24
+</span>
25
+
26
+
27
+</span>
28
+
29
+
30
+
31
+

+ 87
- 0
rf/i4m/m.js View File

@@ -0,0 +1,87 @@
1
+mod_templates_4 = window.mod_templates_4 || $("")
2
+
3
+// reload templates
4
+function html_js_handler_lobby(rsp) {
5
+	clog("html_js_handler_lobby",[...arguments])
6
+	mod_templates_4 = $(`<span>${rsp}</span>`)
7
+	init_lobby()
8
+	// init_api6()
9
+}
10
+
11
+
12
+
13
+
14
+function init_lobby(){
15
+	saftly_remove(".plugin_top")
16
+	var lroot = mod_templates_4.find(".lobby_root")
17
+	lr = lroot[0].outerHTML
18
+	clog("...",lr)
19
+	// welcome_page
20
+	// add_node
21
+	// add_node(n,`.vid_toptoolbar_hook`,"append")
22
+	add_node(lr,"#welcome_page","append")
23
+	add_tiles()
24
+	// $("#welcome_page").
25
+
26
+}
27
+
28
+
29
+
30
+function add_tiles(){
31
+	var rtile = mod_templates_4.find(".room_span.rxt")
32
+	var rtile2 = rtile[0].outerHTML
33
+	var i,k,v,n
34
+	i=0
35
+	while (i < 10){
36
+		n = $(rtile2)
37
+		n.addClass(`rx${i}`)
38
+		// add_node(n,".rooms_dir","append")
39
+		add_node(n,".rooms_dir_full","append")
40
+		i+=1
41
+		clog("//",i)
42
+	}
43
+	set_width()
44
+}
45
+
46
+function set_width(){
47
+	var rdf = $('.rooms_dir_full')
48
+  var totalWidth = 0;
49
+	rdf.children().each(function(){
50
+    totalWidth += $(this).outerWidth();
51
+    totalWidth +=px_int($(this).css("margin-left") )
52
+	totalWidth +=px_int($(this).css("margin-right"))
53
+
54
+    // totalWidth += ?  :
55
+    // totalWidth +=  ?  :
56
+  });
57
+     rdf.css('width', totalWidth);
58
+}
59
+
60
+function px_int(s){
61
+	// totalWidth
62
+	var a = s.split("px") 
63
+	var ret = Number(a[0])
64
+	ret = ret ? ret : 0
65
+	return ret
66
+}
67
+
68
+/*
69
+$(document).ready(function(){
70
+  var totalWidth = 0;
71
+  $('#container').children().each(function(){
72
+    totalWidth += $(this).outerWidth();
73
+  });
74
+  $('#container').css('width', totalWidth);
75
+});
76
+*/
77
+
78
+
79
+
80
+
81
+clog(".....2")
82
+
83
+try {
84
+init_lobby()
85
+} catch (err) {
86
+clog("err:",err)
87
+}

+ 0
- 0
rf/i4m/m0.js View File


+ 3
- 0
rf/idev/i8.js View File

@@ -0,0 +1,3 @@
1
+
2
+clog("I8")
3
+

BIN
rf/img/image.png View File


BIN
rf/img/image_opace.png View File


BIN
rf/img/img3.jpg View File


+ 20
- 0
rf/inspect_utils.js View File

@@ -0,0 +1,20 @@
1
+
2
+
3
+function jclone(obj){
4
+	return Array.isArray(obj) ?  $.extend(true,[],obj) :  $.extend(true,{},obj)
5
+}
6
+function jx(obj){
7
+	return JSON.parse(JSON.stringify(obj))
8
+}
9
+window.jc = jclone
10
+
11
+function rcom2(){
12
+	var k,v
13
+	var k2,v2
14
+	for ([k,v] of Object.entries(rldi.files) ){
15
+		// clog(k,v.cached == rls[k],v.cached,rls[k])
16
+		clog(k)
17
+	}
18
+	clog(Object.entries(rldi.files).length)
19
+
20
+}

+ 251
- 0
rf/jquery.corner.js View File

@@ -0,0 +1,251 @@
1
+/*!
2
+ * jQuery corner plugin: simple corner rounding
3
+ * Examples and documentation at: http://jquery.malsup.com/corner/
4
+ * version 2.13 (19-FEB-2013)
5
+ * Requires jQuery v1.3.2 or later
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ * Authors: Dave Methvin and Mike Alsup
10
+ */
11
+
12
+/**
13
+ *  corner() takes a single string argument:  $('#myDiv').corner("effect corners width")
14
+ *
15
+ *  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). 
16
+ *  corners: one or more of: top, bottom, tr, tl, br, or bl.  (default is all corners)
17
+ *  width:   width of the effect; in the case of rounded corners this is the radius. 
18
+ *           specify this value using the px suffix such as 10px (yes, it must be pixels).
19
+ */
20
+;(function($) { 
21
+
22
+var msie = /MSIE/.test(navigator.userAgent);
23
+
24
+var style = document.createElement('div').style,
25
+    moz = style['MozBorderRadius'] !== undefined,
26
+    webkit = style['WebkitBorderRadius'] !== undefined,
27
+    radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined,
28
+    mode = document.documentMode || 0,
29
+    noBottomFold = msie && (!mode || mode < 8),
30
+
31
+    expr = msie && (function() {
32
+        var div = document.createElement('div');
33
+        try { div.style.setExpression('width','0+0'); div.style.removeExpression('width'); }
34
+        catch(e) { return false; }
35
+        return true;
36
+    })();
37
+
38
+$.support = $.support || {};
39
+$.support.borderRadius = moz || webkit || radius; // so you can do:  if (!$.support.borderRadius) $('#myDiv').corner();
40
+
41
+function sz(el, p) { 
42
+    return parseInt($.css(el,p),10)||0; 
43
+}
44
+function hex2(s) {
45
+    s = parseInt(s,10).toString(16);
46
+    return ( s.length < 2 ) ? '0'+s : s;
47
+}
48
+function gpc(node) {
49
+    while(node) {
50
+        var v = $.css(node,'backgroundColor'), rgb;
51
+        if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') {
52
+            if (v.indexOf('rgb') >= 0) { 
53
+                rgb = v.match(/\d+/g); 
54
+                return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
55
+            }
56
+            return v;
57
+        }
58
+        if (node.nodeName.toLowerCase() == 'html')
59
+            break;
60
+        node = node.parentNode; // keep walking if transparent
61
+    }
62
+    return '#ffffff';
63
+}
64
+
65
+function getWidth(fx, i, width) {
66
+    switch(fx) {
67
+    case 'round':  return Math.round(width*(1-Math.cos(Math.asin(i/width))));
68
+    case 'cool':   return Math.round(width*(1+Math.cos(Math.asin(i/width))));
69
+    case 'sharp':  return width-i;
70
+    case 'bite':   return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));
71
+    case 'slide':  return Math.round(width*(Math.atan2(i,width/i)));
72
+    case 'jut':    return Math.round(width*(Math.atan2(width,(width-i-1))));
73
+    case 'curl':   return Math.round(width*(Math.atan(i)));
74
+    case 'tear':   return Math.round(width*(Math.cos(i)));
75
+    case 'wicked': return Math.round(width*(Math.tan(i)));
76
+    case 'long':   return Math.round(width*(Math.sqrt(i)));
77
+    case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));
78
+    case 'dogfold':
79
+    case 'dog':    return (i&1) ? (i+1) : width;
80
+    case 'dog2':   return (i&2) ? (i+1) : width;
81
+    case 'dog3':   return (i&3) ? (i+1) : width;
82
+    case 'fray':   return (i%2)*width;
83
+    case 'notch':  return width; 
84
+    case 'bevelfold':
85
+    case 'bevel':  return i+1;
86
+    case 'steep':  return i/2 + 1;
87
+    case 'invsteep':return (width-i)/2+1;
88
+    }
89
+}
90
+
91
+$.fn.corner = function(options) {
92
+    // in 1.3+ we can fix mistakes with the ready state
93
+    if (this.length === 0) {
94
+        if (!$.isReady && this.selector) {
95
+            var s = this.selector, c = this.context;
96
+            $(function() {
97
+                $(s,c).corner(options);
98
+            });
99
+        }
100
+        return this;
101
+    }
102
+
103
+    return this.each(function(index){
104
+        var $this = $(this),
105
+            // meta values override options
106
+            o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(),
107
+            keep = /keep/.test(o),                       // keep borders?
108
+            cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]),  // corner color
109
+            sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]),  // strip color
110
+            width = parseInt((o.match(/(\d+)px/)||[])[1],10) || 10, // corner width
111
+            re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog|invsteep|steep/,
112
+            fx = ((o.match(re)||['round'])[0]),
113
+            fold = /dogfold|bevelfold/.test(o),
114
+            edges = { T:0, B:1 },
115
+            opts = {
116
+                TL:  /top|tl|left/.test(o),       TR:  /top|tr|right/.test(o),
117
+                BL:  /bottom|bl|left/.test(o),    BR:  /bottom|br|right/.test(o)
118
+            },
119
+            // vars used in func later
120
+            strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, $horz;
121
+        
122
+        if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )
123
+            opts = { TL:1, TR:1, BL:1, BR:1 };
124
+            
125
+        // support native rounding
126
+        if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) {
127
+            if (opts.TL)
128
+                $this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px');
129
+            if (opts.TR)
130
+                $this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px');
131
+            if (opts.BL)
132
+                $this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px');
133
+            if (opts.BR)
134
+                $this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px');
135
+            return;
136
+        }
137
+            
138
+        strip = document.createElement('div');
139
+        $(strip).css({
140
+            overflow: 'hidden',
141
+            height: '1px',
142
+            minHeight: '1px',
143
+            fontSize: '1px',
144
+            backgroundColor: sc || 'transparent',
145
+            borderStyle: 'solid'
146
+        });
147
+    
148
+        pad = {
149
+            T: parseInt($.css(this,'paddingTop'),10)||0,     R: parseInt($.css(this,'paddingRight'),10)||0,
150
+            B: parseInt($.css(this,'paddingBottom'),10)||0,  L: parseInt($.css(this,'paddingLeft'),10)||0
151
+        };
152
+
153
+        if (typeof this.style.zoom !== undefined) this.style.zoom = 1; // force 'hasLayout' in IE
154
+        if (!keep) this.style.border = 'none';
155
+        strip.style.borderColor = cc || gpc(this.parentNode);
156
+        cssHeight = $(this).outerHeight();
157
+
158
+        for (j in edges) {
159
+            bot = edges[j];
160
+            // only add stips if needed
161
+            if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
162
+                strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');
163
+                d = document.createElement('div');
164
+                $(d).addClass('jquery-corner');
165
+                ds = d.style;
166
+
167
+                bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);
168
+
169
+                if (bot && cssHeight != 'auto') {
170
+                    if ($.css(this,'position') == 'static')
171
+                        this.style.position = 'relative';
172
+                    ds.position = 'absolute';
173
+                    ds.bottom = ds.left = ds.padding = ds.margin = '0';
174
+                    if (expr)
175
+                        ds.setExpression('width', 'this.parentNode.offsetWidth');
176
+                    else
177
+                        ds.width = '100%';
178
+                }
179
+                else if (!bot && msie) {
180
+                    if ($.css(this,'position') == 'static')
181
+                        this.style.position = 'relative';
182
+                    ds.position = 'absolute';
183
+                    ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';
184
+                    
185
+                    // fix ie6 problem when blocked element has a border width
186
+                    if (expr) {
187
+                        bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth');
188
+                        ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"');
189
+                    }
190
+                    else
191
+                        ds.width = '100%';
192
+                }
193
+                else {
194
+                    ds.position = 'relative';
195
+                    ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : 
196
+                                        (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';                
197
+                }
198
+
199
+                for (i=0; i < width; i++) {
200
+                    w = Math.max(0,getWidth(fx,i, width));
201
+                    e = strip.cloneNode(false);
202
+                    e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';
203
+                    bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
204
+                }
205
+                
206
+                if (fold && $.support.boxModel) {
207
+                    if (bot && noBottomFold) continue;
208
+                    for (c in opts) {
209
+                        if (!opts[c]) continue;
210
+                        if (bot && (c == 'TL' || c == 'TR')) continue;
211
+                        if (!bot && (c == 'BL' || c == 'BR')) continue;
212
+                        
213
+                        common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor };
214
+                        $horz = $('<div/>').css(common).css({ width: width + 'px', height: '1px' });
215
+                        switch(c) {
216
+                        case 'TL': $horz.css({ bottom: 0, left: 0 }); break;
217
+                        case 'TR': $horz.css({ bottom: 0, right: 0 }); break;
218
+                        case 'BL': $horz.css({ top: 0, left: 0 }); break;
219
+                        case 'BR': $horz.css({ top: 0, right: 0 }); break;
220
+                        }
221
+                        d.appendChild($horz[0]);
222
+                        
223
+                        var $vert = $('<div/>').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' });
224
+                        switch(c) {
225
+                        case 'TL': $vert.css({ left: width }); break;
226
+                        case 'TR': $vert.css({ right: width }); break;
227
+                        case 'BL': $vert.css({ left: width }); break;
228
+                        case 'BR': $vert.css({ right: width }); break;
229
+                        }
230
+                        d.appendChild($vert[0]);
231
+                    }
232
+                }
233
+            }
234
+        }
235
+    });
236
+};
237
+
238
+$.fn.uncorner = function() { 
239
+    if (radius || moz || webkit)
240
+        this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0);
241
+    $('div.jquery-corner', this).remove();
242
+    return this;
243
+};
244
+
245
+// expose options
246
+$.fn.corner.defaults = {
247
+    useNative: true, // true if plugin should attempt to use native browser support for border radius rounding
248
+    metaAttr:  'data-corner' // name of meta attribute to use for options
249
+};
250
+    
251
+})(jQuery);

+ 130
- 0
rf/keyboard_dev_fn.js View File

@@ -0,0 +1,130 @@
1
+glob_dev_fns.kb_shortcut_keyup= function(){
2
+	return {}
3
+}
4
+glob_dev_fns.kb_shortcut_keydown= function(){
5
+	return {}
6
+}
7
+glob_dev_fns.runonce = 1
8
+
9
+glob_dev_fns._renderOverflowMenuContent = function(o){
10
+	if (!glob_dev_fns.runonce){
11
+		// returnz/
12
+	}
13
+	// clog("_renderToolboxContent",o.kv.ret)
14
+	// o.kv.ret.fill(false)
15
+	return
16
+	glob_dev_fns.runonce = 0
17
+		// return
18
+	// console.trace("dev trc _renderOverflowMenuContent")
19
+	// clog("dev log _renderOverflowMenuContent",arguments)
20
+	// clog("dev log2 ret overflowMenuContent",o.kv.ret)
21
+	var k,v
22
+	// if (glob_dev_fns.runonce){
23
+
24
+	for (v of o.kv.ret){
25
+
26
+	clog("devx",v)
27
+	if (v){
28
+		// clog(v.props)
29
+		v.props.showLabel=false
30
+		// v.props.visible=true
31
+		v.props.visible=false
32
+		// showLabel: true, visible: true
33
+	}
34
+
35
+	}
36
+	// }
37
+	// return {}
38
+}
39
+
40
+glob_dev_fns._renderToolboxContent = function(o){
41
+	return
42
+	// console.trace("dev trc _renderOverflowMenuContent")
43
+	clog("dev log _renderToolboxContent",arguments)
44
+	clog("dev log2 _renderToolboxContent overflowMenuContent",o.kv.overflowMenuContent)
45
+	// return {}
46
+}
47
+// _renderToolboxContent
48
+
49
+glob_dev_fns.UI_arr_showToolbar = function(o){
50
+	// clog("dev_log4 UI_arr_showToolbar")
51
+	// return {}
52
+}
53
+
54
+glob_dev_fns.SVC_onHoverIn = function(o){
55
+	// clog("dev_log4 SVC_onHoverIn")
56
+	// return {}
57
+}
58
+
59
+
60
+glob_dev_fns.hideToolbox = function(o){
61
+	clog("dev_log4 hideToolbox")
62
+	// return {}
63
+}
64
+
65
+
66
+glob_dev_fns.showToolbox = function(o){
67
+	// clog("dev_log4 showToolbox",o.args,o)
68
+	// return {}
69
+}
70
+glob_dev_fns.conference__onShowToolbar = function(o){
71
+	// clog("dev_log4 conference__onShowToolbar",o.args,o)
72
+	// return {}
73
+}
74
+
75
+
76
+ function fn_mm2(that,args){
77
+// glob_dev_fns.fn_mm2 =function(){
78
+	// var that = arguments[0]
79
+	var event = args[0]
80
+
81
+	// clog("ON mm",this,arguments)
82
+/*	xy= {
83
+
84
+	screenX:event.screenX,
85
+	screenY:event.screenY,
86
+	pageX:event.pageX,
87
+	pageY:event.pageY,
88
+	movementX:event.movementX,
89
+	movementY:event.movementY,
90
+	clientX:event.clientX,
91
+	clientY:event.clientY,
92
+	innerWidth,
93
+	innerHeight,
94
+
95
+	}*/
96
+	if (innerHeight - event.clientY < 150){
97
+		that._onShowToolbar()
98
+	} else if (iammod && event.clientY < 150){
99
+		that._onShowToolbar()
100
+
101
+	}
102
+	// clog("ON mm2",that,event)
103
+	// clog("ON mm3",xy)
104
+	// clog("ON mm3",innerHeight - event.clientY )
105
+	
106
+}
107
+function fake_fn(){
108
+
109
+
110
+            try {
111
+            var fn_name = "hideToolbox"
112
+            var fn_name = "showToolbox"
113
+
114
+            var fn_ret = glob_dev_fns[fn_name]({that:this,kv:{},args:[...arguments],fn_name,arg0:arguments})
115
+            if (fn_ret){ return fn_ret.ret }; 
116
+        } catch (err) { clog(`react_fn fn_name:${fn_name} err:`,err) }
117
+
118
+}
119
+
120
+/*
121
+
122
+            try {
123
+            var fn_name = "SET_TOOLBOX_TIMEOUT_reducer"
124
+            var fn_name = "SET_TOOLBOX_TIMEOUT_middleware"
125
+            var fn_name = "CLEAR_TOOLBOX_TIMEOUT_reducer"
126
+            var fn_name = "CLEAR_TOOLBOX_TIMEOUT_middleware"
127
+            var fn_ret = glob_dev_fns[fn_name]({that:this,kv:{},args:[...arguments],fn_name,arg0:arguments})
128
+            if (fn_ret){ return fn_ret.ret }; 
129
+        } catch (err) { clog(`react_fn fn_name:${fn_name} err:`,err) }
130
+*/

+ 139
- 0
rf/m/_m_utils.js View File

@@ -0,0 +1,139 @@
1
+
2
+
3
+
4
+
5
+if (!window.glob_mx){
6
+	// window.glob_mx={}
7
+}
8
+function disp(o){
9
+	APP.store.dispatch(o)
10
+}
11
+
12
+
13
+// default event handler this should match all events
14
+mhndlr_opt_null = {
15
+from: undefined,
16
+handler: "onAll",
17
+id: null,
18
+name: null,
19
+// "http://jitsi.org/jitmeet"
20
+ns: null,
21
+options: {matchBareFromJid: false, ignoreNamespaceFragment: false},
22
+type: null,
23
+user: true,
24
+cstr:"test"
25
+};
26
+
27
+
28
+
29
+mhndlr_opt_x = {
30
+	cstr:"?",
31
+	ns:"corner_mx",
32
+	handler:mhndlr,
33
+
34
+}
35
+
36
+
37
+function add_handler_m(handler) {
38
+	var phx = APP.connection.xmpp.connection._stropheConn.handlers[0].__proto__;
39
+
40
+	var hxa=Object.create(phx)
41
+	Object.assign(hxa,mhndlr_opt_null,handler)
42
+	APP.connection.xmpp.connection._stropheConn.addHandlers.push(hxa)
43
+}
44
+
45
+
46
+function tmsgx(data,tag="div",attrs={}){
47
+	// return
48
+	var ns = {xmlns:"corner_mx"}
49
+	var msg = $build("message",{ to: window.APP.conference._room.room.roomjid,
50
+            type: 'groupchat',
51
+             });
52
+	var payload=JSON.stringify(data)
53
+
54
+	Object.assign({},ns,attrs)
55
+
56
+	msg.c(tag, payload,Object.assign({},ns,attrs)).up();
57
+	// console.log("zzzz")
58
+	APP.conference._room.room.connection.send(msg)
59
+}
60
+
61
+
62
+
63
+function tmsgx2(data,opt_arg={},attrs={}){
64
+	// return
65
+	dflt_opt = {
66
+	tag:"code",
67
+	type:"chat",
68
+	to:window.APP.conference._room.room.roomjid,
69
+	}
70
+	var opt = Object.assign({},dflt_opt,opt_arg)
71
+
72
+	var ns = {xmlns:"corner_mx"}
73
+	var msg = $build("message",{ to: opt.to,
74
+            type: opt.type,
75
+             });
76
+	var payload=JSON.stringify(data)
77
+
78
+	Object.assign({},ns,attrs)
79
+
80
+	msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
81
+	// console.log("zzzz")
82
+	APP.conference._room.room.connection.send(msg)
83
+}
84
+function tmsgx3(data,opt_arg={},attrs={}){
85
+	// return
86
+	dflt_opt = {
87
+	tag:"code",
88
+	// type:"chat",
89
+	to:window.APP.conference._room.room.roomjid,
90
+	}
91
+	var opt = Object.assign({},dflt_opt,opt_arg)
92
+	clog("T:",data,opt,opt.type)
93
+	if (!opt.type){
94
+		clog("NO TYPE")
95
+	opt.to == dflt_opt.to ? opt.type = "groupchat" : opt.type = "chat"
96
+	}
97
+	clog("T:",data,opt,opt.type)
98
+
99
+	var ns = {xmlns:"corner_mx"}
100
+	var msg = $build("message",{ to: opt.to,
101
+            type: opt.type,
102
+            // from: "nnnx@conference.jfidev.com/3db7bf15",
103
+            // xtra: "nnnx@conference.jfidev.com/3db7bf15",
104
+             });
105
+	var payload=JSON.stringify(data)
106
+
107
+	Object.assign({},ns,attrs)
108
+
109
+	msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
110
+	// console.log("zzzz")
111
+	APP.conference._room.room.connection.send(msg)
112
+}
113
+
114
+
115
+
116
+function mhndlr_rld_dflt(a0,a1,a2,a3,a4){
117
+	clog("mhndlr... dflt")
118
+	return true
119
+}
120
+if (!window.mhndlr_rld){
121
+	window.mhndlr_rld = mhndlr_rld_dflt
122
+}
123
+function mhndlr(a0,a1,a2,a3,a4){
124
+	// clog("MH!")
125
+	setTimeout(window.mhndlr_rld,1,this,a0,a1,a2,a3,a4)
126
+	return true
127
+}
128
+
129
+
130
+function init_mx(){
131
+	clog("INITMX")
132
+	add_handler_m(mhndlr_opt_x)
133
+	// add_handler_m(mhndlr_opt_x_all)
134
+}
135
+
136
+// init_mx will be called once we join th confrence
137
+ifn_obj.init_conf_join.push(init_mx)
138
+
139
+

+ 290
- 0
rf/m/m_api.js View File

@@ -0,0 +1,290 @@
1
+
2
+
3
+
4
+// this file enables loading modules after pageload
5
+
6
+
7
+
8
+
9
+
10
+function get_cui_html(file) {
11
+	clog("get_cui_html",this,arguments)
12
+	// console.trace("~IX~ ixr")
13
+	clog("~IX~ ixr")
14
+	// for (var file of this.arr){
15
+		var aii 
16
+		aii= $.ajax({
17
+			// url: "ign/cui.html",
18
+			url: file.url,
19
+			// data: file.qs,
20
+			cache:false,
21
+			// complete:complete_html,
22
+			success: file.success || proc_cui_html,
23
+			// error: err_html,
24
+			// dataType: "text"
25
+			dataType: "html"
26
+		})
27
+		aii.file = file
28
+		// aii.rldh=file
29
+	// }
30
+}
31
+
32
+
33
+
34
+function cui_respH(){
35
+	clog("cui_respH")
36
+}
37
+
38
+function cui_diffH(file){
39
+	clog("cui_diffH",this,arguments)
40
+	// get_cui_html(file)	
41
+}
42
+
43
+
44
+
45
+
46
+
47
+
48
+function proc_cui_html(rsp,status,xhr){
49
+	clog("proc_cui_html",this,arguments)
50
+	/*
51
+	gxh.success = {
52
+		that:this,
53
+		rsp,status,xhr,
54
+		args:arguments,
55
+	}
56
+	*/
57
+	// insert_cui_html(rsp)
58
+	// rsp
59
+}
60
+function insert_cui_html(innerHTML){
61
+	clog("insert_cui_html....")
62
+	window.cui_html = innerHTML
63
+	t5i2.crnr_init()
64
+	// t5i2.crnr_refresh()
65
+
66
+	// var n
67
+	//  n = document.createElement("div")
68
+	// n = document.querySelector("#xh_root")
69
+	// n ? n.innerHTML = innerHTML : 0
70
+	// event_html(n)
71
+}
72
+
73
+
74
+function dflt_api_handler(){
75
+	clog("dflt_api_handler NOT IMPLIMENTED")
76
+}
77
+
78
+function add_rld_html(){
79
+	// js files
80
+	// html
81
+	// css
82
+
83
+
84
+
85
+
86
+rldi.files["ign/m/timer/rhtml.html"]=  {url: "ign/m/timer/rhtml.html",
87
+ qs: {v:1}, respH: cui_respH, diffH: cui_diffH,
88
+ cached:"z z",
89
+ success:proc_cui_html,
90
+}
91
+
92
+
93
+
94
+}
95
+
96
+/*
97
+var reqt = {
98
+	url:"",
99
+	respH:dflt_handler,
100
+	diffH:diff_handler,
101
+}
102
+
103
+*/
104
+
105
+
106
+
107
+
108
+// jsrh
109
+// cssrh
110
+api_dflts = {
111
+	dflt:window.reqt || {url:"", respH:dflt_handler, diffH:diff_handler,},
112
+	js:{
113
+		diffH:jsrh,
114
+		// diffH:jsrh,
115
+		qs:{v:1},
116
+	},
117
+	css:{
118
+		diffH:cssrh,
119
+		qs:{v:1},
120
+
121
+	},
122
+	html:{
123
+
124
+		diffH:html_rld_cb,
125
+		qs:{v:1},
126
+	},
127
+}
128
+
129
+
130
+api_test = {}
131
+
132
+// <script class="rld" src="ign/m/m_api.js?c=023"></script>
133
+function insert_js(file){
134
+	var n = document.createElement("SCRIPT")
135
+	n.classList.add("rld")
136
+	n.src=file.url + "?_="+new Date().getTime()
137
+	// n.rel="stylesheet"
138
+	$(`script.rld[src^="`+file.url+`"]`).remove()
139
+	$(".m0.module").after(n)
140
+}
141
+function insert_css(file){
142
+	var url = file.url
143
+	var n = document.createElement("LINK")
144
+	n.classList.add("rld")
145
+	n.href=file.url + "?_="+new Date().getTime()
146
+	n.rel="stylesheet"
147
+	 $(`link.rld[href^="`+file.url+`"]`).remove()
148
+	$(".m0.module").after(n)
149
+}
150
+function html_rld_cb(){
151
+	clog("html_rld_cb!")
152
+
153
+}
154
+
155
+
156
+function html_rld_cb2(){
157
+	clog("html_rld_cb2!",this,[...arguments])
158
+
159
+}
160
+function html_rld_cb3(){
161
+	clog("html_rld_cb3!",this,[...arguments])
162
+}
163
+function html_rld_cb4(rsp,status,xhr){
164
+	clog("html_rld_cb4!",this,[...arguments])
165
+	// window[this.success_js](rsp,status,xhr)
166
+	window[xhr.file.success_js](rsp,status,xhr)
167
+}
168
+
169
+
170
+function register_rld(file){
171
+	clog("RR",file)
172
+	file.cached = rls[file.url]
173
+	rldi.files[file.url] =  file
174
+
175
+}
176
+
177
+
178
+window.qto_stop = 0
179
+window.qto_cnt = 0
180
+function qto_init(){
181
+	window.qto_stop = 0
182
+window.qto_cnt = 0
183
+	// setTimeout(qto_stop_fn,1000)
184
+	setTimeout(qto_stop_fn,100)
185
+	qto()
186
+
187
+}
188
+function qto_stop_fn(){
189
+	clog("qto_stop_fn")
190
+	window.qto_stop =1
191
+}
192
+function qto(){
193
+	clog("QTO",window.qto_cnt)
194
+	// clog("QTO",window.qto_cnt,$(`script.rld[src^="ign/m/timer/m.js"]`))
195
+	window.qto_cnt += 1
196
+	if (!window.qto_stop){
197
+		setTimeout(qto,1)
198
+	}
199
+
200
+}
201
+
202
+
203
+
204
+	// $(`script.rld[src^="ign/m/timer/m.js"]`).remove()
205
+	// ign/m/timer/m.js
206
+
207
+
208
+
209
+
210
+// mtx ={js:["ign/m/timer/m.js"],css:["ign/m/timer/m.css"],html:["ign/m/timer/m.html"]}
211
+// mtx ={js:["ign/m/timer/m.js"],css:["ign/m/timer/m.css"],html:[{url:"ign/m/timer/m.html",diffH:html_rld_cb2,success:html_rld_cb4,}]}
212
+
213
+// function 
214
+mod_path ="ign/rf/filmstrip_mod/"
215
+
216
+mtx ={	
217
+	// js:["ign/m/timer/m.js","ign/m/timer/m0.js"],
218
+	js:[`${mod_path}m0.js`,`${mod_path}m.js`,],
219
+	css:[`${mod_path}m.css`],
220
+	html:[{url:`${mod_path}m.html`,diffH:get_cui_html,success:html_rld_cb4,success_js:"html_js_handler"}]
221
+	}
222
+
223
+function add_module(o){
224
+	var k,v
225
+	let file 
226
+		// qto_init()
227
+		// file = jclone(api_dflts.css)
228
+	for (k of o.css || []){
229
+		if (typeof(k) == "string"){
230
+			 file = $.extend(true,{},api_dflts.css, {url:k})
231
+		} else {
232
+			 file = $.extend(true,{},api_dflts.css, k)
233
+		}
234
+		// file = jclone(api_dflts.css)
235
+		// file.url = k
236
+
237
+		register_rld(file)
238
+		insert_css(file)
239
+
240
+		api_test[file.url]=file
241
+		clog("~",k)
242
+	}
243
+	for (k of o.js || []){
244
+		if (typeof(k) == "string"){
245
+			 file = $.extend(true,{},api_dflts.js, {url:k})
246
+		} else {
247
+			 file = $.extend(true,{},api_dflts.js, k)
248
+		}
249
+		// file = jclone(api_dflts.js)
250
+		// file.url = k
251
+
252
+		register_rld(file)
253
+		insert_js(file)
254
+
255
+		api_test[file.url]=file
256
+		clog("~",k)
257
+	}
258
+	for (k of o.html || []){
259
+		if (typeof(k) == "string"){
260
+			 file = $.extend(true,{},api_dflts.html, {url:k})
261
+		} else {
262
+			 file = $.extend(true,{},api_dflts.html, k)
263
+		}
264
+		// file = jclone(api_dflts.html)
265
+		// file.url = k
266
+		register_rld(file)
267
+		api_test[file.url]=file
268
+		clog("~",k)
269
+		rfile = file
270
+		get_cui_html(file)
271
+	}
272
+
273
+
274
+}
275
+
276
+
277
+
278
+
279
+
280
+
281
+// jquery helper
282
+function add_node(n,rn,i) {
283
+	$(rn)[i](n)
284
+}
285
+
286
+
287
+setTimeout(add_module,300,mtx)
288
+
289
+
290
+// add_module(mtx )

+ 0
- 0
rf/m/m_req.js View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save