1 | // BigBlueButton open source conferencing system - http://www.bigbluebutton.org/. |
||
2 | // |
||
3 | // Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below). |
||
4 | // |
||
5 | // This program is free software; you can redistribute it and/or modify it under the |
||
6 | // terms of the GNU Lesser General Public License as published by the Free Software |
||
7 | // Foundation; either version 3.0 of the License, or (at your option) any later |
||
8 | // version. |
||
9 | // |
||
10 | // BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY |
||
11 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
||
12 | // PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
||
13 | // |
||
14 | // You should have received a copy of the GNU Lesser General Public License along |
||
15 | // with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. |
||
16 | |||
17 | // Handle client request to join when meeting starts. |
||
18 | $(document).on("turbolinks:load", function(){ |
||
19 | var controller = $("body").data('controller'); |
||
20 | var action = $("body").data('action'); |
||
21 | |||
22 | if(controller == "rooms" && action == "join"){ |
||
23 | App.waiting = App.cable.subscriptions.create({ |
||
0 ignored issues
–
show
|
|||
24 | channel: "WaitingChannel", |
||
25 | roomuid: $(".background").attr("room"), |
||
26 | useruid: $(".background").attr("user") |
||
27 | }, { |
||
28 | connected: function() { |
||
29 | console.log("connected"); |
||
0 ignored issues
–
show
|
|||
30 | }, |
||
31 | |||
32 | disconnected: function(data) { |
||
33 | console.log("disconnected"); |
||
0 ignored issues
–
show
|
|||
34 | console.log(data); |
||
35 | }, |
||
36 | |||
37 | rejected: function() { |
||
38 | console.log("rejected"); |
||
0 ignored issues
–
show
|
|||
39 | }, |
||
40 | |||
41 | received: function(data){ |
||
42 | console.log(data); |
||
0 ignored issues
–
show
|
|||
43 | if(data.action = "started"){ |
||
44 | request_to_join_meeting(); |
||
45 | } |
||
46 | } |
||
47 | }); |
||
48 | } |
||
49 | }); |
||
50 | |||
51 | var join_attempts = 0; |
||
52 | |||
53 | var request_to_join_meeting = function(){ |
||
54 | $.ajax({ |
||
55 | url: window.location.pathname, |
||
56 | type: 'POST', |
||
57 | data: { |
||
58 | join_name: $(".background").attr("join-name") |
||
59 | }, |
||
60 | headers: { |
||
61 | 'Content-Type': 'application/x-www-form-urlencoded', |
||
62 | 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content') |
||
63 | }, |
||
64 | success: function(){ |
||
65 | // Enqueue another trial just incase they didn't actually join. |
||
66 | if(join_attempts < 4){ setTimeout(request_to_join_meeting, 10000); } |
||
67 | join_attempts++; |
||
68 | } |
||
69 | }); |
||
70 | } |
||
71 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.