浏览代码

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

Invite to share dialog
master
hristoterezov 9 年前
父节点
当前提交
b772c151fc
共有 6 个文件被更改,包括 23 次插入66 次删除
  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 查看文件

1349
                 && APP.UI.notifyInitiallyMuted();
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
         room.on(
1352
         room.on(
1362
             ConferenceEvents.AVAILABLE_DEVICES_CHANGED, function (id, devices) {
1353
             ConferenceEvents.AVAILABLE_DEVICES_CHANGED, function (id, devices) {
1363
                 APP.UI.updateDevicesAvailability(id, devices);
1354
                 APP.UI.updateDevicesAvailability(id, devices);

+ 2
- 1
css/_jquery-impromptu.scss 查看文件

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

+ 1
- 1
lang/main.json 查看文件

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

+ 0
- 44
modules/UI/UI.js 查看文件

1065
     //Toolbar.showDialPadButton(dtmfSupport);
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
  * Show user feedback dialog if its required or just show "thank you" dialog.
1069
  * Show user feedback dialog if its required or just show "thank you" dialog.
1114
  * @returns {Promise} when dialog is closed.
1070
  * @returns {Promise} when dialog is closed.

+ 20
- 10
modules/UI/toolbars/Toolbar.js 查看文件

20
         inviteAttributes = "value=\"" + encodeURI(roomUrl) + "\"";
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
     let title = APP.translation.generateTranslationHTML("dialog.shareLink");
29
     let title = APP.translation.generateTranslationHTML("dialog.shareLink");
24
     APP.UI.messageHandler.openTwoButtonDialog(
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
         function (e, v) {
35
         function (e, v) {
31
             if (v && roomUrl) {
36
             if (v && roomUrl) {
32
                 JitsiMeetJS.analytics.sendEvent('toolbar.invite.button');
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
             else {
43
             else {
36
                 JitsiMeetJS.analytics.sendEvent('toolbar.invite.cancel');
44
                 JitsiMeetJS.analytics.sendEvent('toolbar.invite.cancel');
37
             }
45
             }
38
         },
46
         },
39
         function (event) {
47
         function (event) {
40
-            if (roomUrl) {
41
-                document.getElementById('inviteLinkRef').select();
42
-            } else {
48
+            if (!roomUrl) {
43
                 if (event && event.target) {
49
                 if (event && event.target) {
44
                     $(event.target).find('button[value=true]')
50
                     $(event.target).find('button[value=true]')
45
                         .prop('disabled', true);
51
                         .prop('disabled', true);
46
                 }
52
                 }
47
             }
53
             }
54
+            else {
55
+                focusInviteLink();
56
+            }
48
         },
57
         },
49
         function (e, v, m, f) {
58
         function (e, v, m, f) {
50
             if(!v && !m && !f)
59
             if(!v && !m && !f)
51
                 JitsiMeetJS.analytics.sendEvent('toolbar.invite.close');
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 查看文件

29
      */
29
      */
30
     UPDATE_SHARED_VIDEO: "UI.update_shared_video",
30
     UPDATE_SHARED_VIDEO: "UI.update_shared_video",
31
     ROOM_LOCK_CLICKED: "UI.room_lock_clicked",
31
     ROOM_LOCK_CLICKED: "UI.room_lock_clicked",
32
-    USER_INVITED: "UI.user_invited",
33
     USER_KICKED: "UI.user_kicked",
32
     USER_KICKED: "UI.user_kicked",
34
     REMOTE_AUDIO_MUTED: "UI.remote_audio_muted",
33
     REMOTE_AUDIO_MUTED: "UI.remote_audio_muted",
35
     FULLSCREEN_TOGGLE: "UI.fullscreen_toggle",
34
     FULLSCREEN_TOGGLE: "UI.fullscreen_toggle",

正在加载...
取消
保存