|
@@ -1,24 +1,12 @@
|
|
1
|
+/* global console */
|
1
|
2
|
|
2
|
3
|
import { redirect } from '../util/helpers';
|
3
|
4
|
|
4
|
|
-/**
|
5
|
|
- * Stores the original conference room URL with all parameters.
|
6
|
|
- * @type {string}
|
7
|
|
- */
|
8
|
|
-let originalURL;
|
9
|
|
-
|
10
|
|
-/**
|
11
|
|
- * A simplified version of the conference URL stripped out of the parameters
|
12
|
|
- * which should be used for sending invites.
|
13
|
|
- * @type {string}
|
14
|
|
- */
|
15
|
|
-let inviteURL;
|
16
|
|
-
|
17
|
5
|
/**
|
18
|
6
|
* The modules stores information about the URL used to start the conference and
|
19
|
7
|
* provides utility methods for dealing with conference URL and reloads.
|
20
|
8
|
*/
|
21
|
|
-export default {
|
|
9
|
+export default class ConferenceUrl {
|
22
|
10
|
/**
|
23
|
11
|
* Initializes the module.
|
24
|
12
|
*
|
|
@@ -40,34 +28,46 @@ export default {
|
40
|
28
|
* @param location.protocol the protocol part of the URL, would be 'https:'
|
41
|
29
|
* from the sample URL.
|
42
|
30
|
*/
|
43
|
|
- init(location) {
|
44
|
|
- originalURL = location.href;
|
45
|
|
- // "https:" + "//" + "example.com:8888" + "/SomeConference1245"
|
46
|
|
- inviteURL
|
|
31
|
+ constructor(location) {
|
|
32
|
+ /**
|
|
33
|
+ * Stores the original conference room URL with all parameters.
|
|
34
|
+ * Example:
|
|
35
|
+ * https://example.com:8888/SomeConference1245?jwt=a5sbc2#blablahash
|
|
36
|
+ * @type {string}
|
|
37
|
+ */
|
|
38
|
+ this.originalURL = location.href;
|
|
39
|
+ /**
|
|
40
|
+ * A simplified version of the conference URL stripped out of
|
|
41
|
+ * the parameters which should be used for sending invites.
|
|
42
|
+ * Example:
|
|
43
|
+ * https://example.com:8888/SomeConference1245
|
|
44
|
+ * @type {string}
|
|
45
|
+ */
|
|
46
|
+ this.inviteURL
|
47
|
47
|
= location.protocol + "//" + location.host + location.pathname;
|
48
|
|
- console.info("Stored original conference URL: " + originalURL);
|
49
|
|
- console.info("Conference URL for invites: " + inviteURL);
|
50
|
|
- },
|
|
48
|
+ console.info("Stored original conference URL: " + this.originalURL);
|
|
49
|
+ console.info("Conference URL for invites: " + this.inviteURL);
|
|
50
|
+ }
|
51
|
51
|
/**
|
52
|
52
|
* Obtains the conference invite URL.
|
53
|
53
|
* @return {string} the URL pointing o the conference which is mean to be
|
54
|
54
|
* used to invite new participants.
|
55
|
55
|
*/
|
56
|
56
|
getInviteUrl() {
|
57
|
|
- return inviteURL;
|
58
|
|
- },
|
|
57
|
+ return this.inviteURL;
|
|
58
|
+ }
|
59
|
59
|
/**
|
60
|
60
|
* Obtains full conference URL with all original parameters.
|
61
|
61
|
* @return {string} the original URL used to open the current conference.
|
62
|
62
|
*/
|
63
|
63
|
getOriginalUrl() {
|
64
|
|
- return originalURL;
|
65
|
|
- },
|
|
64
|
+ return this.originalURL;
|
|
65
|
+ }
|
66
|
66
|
/**
|
67
|
67
|
* Reloads the conference using original URL with all of the parameters.
|
68
|
68
|
*/
|
69
|
69
|
reload() {
|
70
|
|
- console.info("Reloading the conference using URL: " + originalURL);
|
71
|
|
- redirect(originalURL);
|
|
70
|
+ console.info("Reloading the conference using URL: " + this.originalURL);
|
|
71
|
+ redirect(this.originalURL);
|
72
|
72
|
}
|
73
|
|
-};
|
|
73
|
+}
|