Bladeren bron

Merge pull request #925 from jitsi/invite-to-share-dialog

Invite to share dialog
master
hristoterezov 9 jaren geleden
bovenliggende
commit
b772c151fc
6 gewijzigde bestanden met toevoegingen van 23 en 66 verwijderingen
  1. 0
    9
      conference.js
  2. 2
    1
      css/_jquery-impromptu.scss
  3. 1
    1
      lang/main.json
  4. 0
    44
      modules/UI/UI.js
  5. 20
    10
      modules/UI/toolbars/Toolbar.js
  6. 0
    1
      service/UI/UIEvents.js

+ 0
- 9
conference.js Bestand weergeven

@@ -1349,15 +1349,6 @@ export default {
1349 1349
                 && APP.UI.notifyInitiallyMuted();
1350 1350
         });
1351 1351
 
1352
-        APP.UI.addListener(UIEvents.USER_INVITED, (roomUrl) => {
1353
-            APP.UI.inviteParticipants(
1354
-                roomUrl,
1355
-                APP.conference.roomName,
1356
-                roomLocker.password,
1357
-                APP.settings.getDisplayName()
1358
-            );
1359
-        });
1360
-
1361 1352
         room.on(
1362 1353
             ConferenceEvents.AVAILABLE_DEVICES_CHANGED, function (id, devices) {
1363 1354
                 APP.UI.updateDevicesAvailability(id, devices);

+ 2
- 1
css/_jquery-impromptu.scss Bestand weergeven

@@ -9,7 +9,8 @@
9 9
 }
10 10
 div.jqi{ 
11 11
 	width: 400px;
12
-	position: absolute; 
12
+	position: absolute;
13
+    color: #3a3a3a;
13 14
 	background-color: #ffffff; 
14 15
 	font-size: 11px; 
15 16
 	text-align: left; 

+ 1
- 1
lang/main.json Bestand weergeven

@@ -185,6 +185,7 @@
185 185
         "connectError": "Oops! Something went wrong and we couldn't connect to the conference.",
186 186
         "connectErrorWithMsg": "Oops! Something went wrong and we couldn't connect to the conference: __msg__",
187 187
         "connecting": "Connecting",
188
+        "copy": "Copy",
188 189
         "error": "Error",
189 190
         "detectext": "Error when trying to detect desktopsharing extension.",
190 191
         "failtoinstall": "Failed to install desktop sharing extension",
@@ -230,7 +231,6 @@
230 231
         "passwordCheck": "Are you sure you would like to remove your password?",
231 232
         "Remove": "Remove",
232 233
         "passwordMsg": "Set a password to lock your room",
233
-        "Invite": "Invite",
234 234
         "shareLink": "Copy and share this link",
235 235
         "settings1": "Configure your conference",
236 236
         "settings2": "Participants join muted",

+ 0
- 44
modules/UI/UI.js Bestand weergeven

@@ -1065,50 +1065,6 @@ UI.updateDTMFSupport = function (isDTMFSupported) {
1065 1065
     //Toolbar.showDialPadButton(dtmfSupport);
1066 1066
 };
1067 1067
 
1068
-/**
1069
- * Invite participants to conference.
1070
- * @param {string} roomUrl
1071
- * @param {string} conferenceName
1072
- * @param {string} key
1073
- * @param {string} nick
1074
- */
1075
-UI.inviteParticipants = function (roomUrl, conferenceName, key, nick) {
1076
-    let keyText = "";
1077
-    if (key) {
1078
-        keyText = APP.translation.translateString(
1079
-            "email.sharedKey", {sharedKey: key}
1080
-        );
1081
-    }
1082
-
1083
-    let and = APP.translation.translateString("email.and");
1084
-    let supportedBrowsers = `Chromium, Google Chrome, Firefox ${and} Opera`;
1085
-
1086
-    let subject = APP.translation.translateString(
1087
-        "email.subject", {appName:interfaceConfig.APP_NAME, conferenceName}
1088
-    );
1089
-
1090
-    let body = APP.translation.translateString(
1091
-        "email.body", {
1092
-            appName:interfaceConfig.APP_NAME,
1093
-            sharedKeyText: keyText,
1094
-            roomUrl,
1095
-            supportedBrowsers
1096
-        }
1097
-    );
1098
-
1099
-    body = body.replace(/\n/g, "%0D%0A");
1100
-
1101
-    if (nick) {
1102
-        body += "%0D%0A%0D%0A" + UIUtil.escapeHtml(nick);
1103
-    }
1104
-
1105
-    if (interfaceConfig.INVITATION_POWERED_BY) {
1106
-        body += "%0D%0A%0D%0A--%0D%0Apowered by jitsi.org";
1107
-    }
1108
-
1109
-    window.open(`mailto:?subject=${subject}&body=${body}`, '_blank');
1110
-};
1111
-
1112 1068
 /**
1113 1069
  * Show user feedback dialog if its required or just show "thank you" dialog.
1114 1070
  * @returns {Promise} when dialog is closed.

+ 20
- 10
modules/UI/toolbars/Toolbar.js Bestand weergeven

@@ -20,36 +20,46 @@ function openLinkDialog () {
20 20
         inviteAttributes = "value=\"" + encodeURI(roomUrl) + "\"";
21 21
     }
22 22
 
23
+    let inviteLinkId = "inviteLinkRef";
24
+    let focusInviteLink = function() {
25
+        $('#' + inviteLinkId).focus();
26
+        $('#' + inviteLinkId).select();
27
+    };
28
+
23 29
     let title = APP.translation.generateTranslationHTML("dialog.shareLink");
24 30
     APP.UI.messageHandler.openTwoButtonDialog(
25
-        null, null, null,
26
-        '<h2>' + title + '</h2>'
27
-        + '<input id="inviteLinkRef" type="text" '
28
-        + inviteAttributes + ' onclick="this.select();" readonly>',
29
-        false, "dialog.Invite",
31
+        null, title, null,
32
+        '<input id="' + inviteLinkId + '" type="text" '
33
+            + inviteAttributes + ' readonly/>',
34
+        false, "dialog.copy",
30 35
         function (e, v) {
31 36
             if (v && roomUrl) {
32 37
                 JitsiMeetJS.analytics.sendEvent('toolbar.invite.button');
33
-                emitter.emit(UIEvents.USER_INVITED, roomUrl);
38
+
39
+                focusInviteLink();
40
+
41
+                document.execCommand('copy');
34 42
             }
35 43
             else {
36 44
                 JitsiMeetJS.analytics.sendEvent('toolbar.invite.cancel');
37 45
             }
38 46
         },
39 47
         function (event) {
40
-            if (roomUrl) {
41
-                document.getElementById('inviteLinkRef').select();
42
-            } else {
48
+            if (!roomUrl) {
43 49
                 if (event && event.target) {
44 50
                     $(event.target).find('button[value=true]')
45 51
                         .prop('disabled', true);
46 52
                 }
47 53
             }
54
+            else {
55
+                focusInviteLink();
56
+            }
48 57
         },
49 58
         function (e, v, m, f) {
50 59
             if(!v && !m && !f)
51 60
                 JitsiMeetJS.analytics.sendEvent('toolbar.invite.close');
52
-        }
61
+        },
62
+        'Copy' // Focus Copy button.
53 63
     );
54 64
 }
55 65
 

+ 0
- 1
service/UI/UIEvents.js Bestand weergeven

@@ -29,7 +29,6 @@ export default {
29 29
      */
30 30
     UPDATE_SHARED_VIDEO: "UI.update_shared_video",
31 31
     ROOM_LOCK_CLICKED: "UI.room_lock_clicked",
32
-    USER_INVITED: "UI.user_invited",
33 32
     USER_KICKED: "UI.user_kicked",
34 33
     REMOTE_AUDIO_MUTED: "UI.remote_audio_muted",
35 34
     FULLSCREEN_TOGGLE: "UI.fullscreen_toggle",

Laden…
Annuleren
Opslaan