From 88a45cf99149e5b0290586f961b21f56ba88f64d Mon Sep 17 00:00:00 2001 From: yanas Date: Thu, 22 Sep 2016 14:05:07 -0500 Subject: [PATCH 1/4] Fixes colors in dialogs. --- css/_jquery-impromptu.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/css/_jquery-impromptu.scss b/css/_jquery-impromptu.scss index db4e53cd9..caa5ecd28 100644 --- a/css/_jquery-impromptu.scss +++ b/css/_jquery-impromptu.scss @@ -9,7 +9,8 @@ } div.jqi{ width: 400px; - position: absolute; + position: absolute; + color: #3a3a3a; background-color: #ffffff; font-size: 11px; text-align: left; From 644faca306aedd41dd8245b1874c16a88d22a229 Mon Sep 17 00:00:00 2001 From: yanas Date: Thu, 22 Sep 2016 15:50:09 -0500 Subject: [PATCH 2/4] Re-designs invite dialog as share link. --- conference.js | 9 ------- lang/main.json | 2 +- modules/UI/UI.js | 44 ------------------------------- modules/UI/toolbars/Toolbar.js | 14 +++++----- modules/UI/util/MessageHandler.js | 2 +- service/UI/UIEvents.js | 1 - 6 files changed, 9 insertions(+), 63 deletions(-) diff --git a/conference.js b/conference.js index b0edba985..ae4f18cc1 100644 --- a/conference.js +++ b/conference.js @@ -1329,15 +1329,6 @@ export default { && APP.UI.notifyInitiallyMuted(); }); - APP.UI.addListener(UIEvents.USER_INVITED, (roomUrl) => { - APP.UI.inviteParticipants( - roomUrl, - APP.conference.roomName, - roomLocker.password, - APP.settings.getDisplayName() - ); - }); - room.on( ConferenceEvents.AVAILABLE_DEVICES_CHANGED, function (id, devices) { APP.UI.updateDevicesAvailability(id, devices); diff --git a/lang/main.json b/lang/main.json index 49ea3c166..0e5f69792 100644 --- a/lang/main.json +++ b/lang/main.json @@ -185,6 +185,7 @@ "connectError": "Oops! Something went wrong and we couldn't connect to the conference.", "connectErrorWithMsg": "Oops! Something went wrong and we couldn't connect to the conference: __msg__", "connecting": "Connecting", + "copy": "Copy", "error": "Error", "detectext": "Error when trying to detect desktopsharing extension.", "failtoinstall": "Failed to install desktop sharing extension", @@ -230,7 +231,6 @@ "passwordCheck": "Are you sure you would like to remove your password?", "Remove": "Remove", "passwordMsg": "Set a password to lock your room", - "Invite": "Invite", "shareLink": "Copy and share this link", "settings1": "Configure your conference", "settings2": "Participants join muted", diff --git a/modules/UI/UI.js b/modules/UI/UI.js index fb208588a..5200f377e 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -1065,50 +1065,6 @@ UI.updateDTMFSupport = function (isDTMFSupported) { //Toolbar.showDialPadButton(dtmfSupport); }; -/** - * Invite participants to conference. - * @param {string} roomUrl - * @param {string} conferenceName - * @param {string} key - * @param {string} nick - */ -UI.inviteParticipants = function (roomUrl, conferenceName, key, nick) { - let keyText = ""; - if (key) { - keyText = APP.translation.translateString( - "email.sharedKey", {sharedKey: key} - ); - } - - let and = APP.translation.translateString("email.and"); - let supportedBrowsers = `Chromium, Google Chrome, Firefox ${and} Opera`; - - let subject = APP.translation.translateString( - "email.subject", {appName:interfaceConfig.APP_NAME, conferenceName} - ); - - let body = APP.translation.translateString( - "email.body", { - appName:interfaceConfig.APP_NAME, - sharedKeyText: keyText, - roomUrl, - supportedBrowsers - } - ); - - body = body.replace(/\n/g, "%0D%0A"); - - if (nick) { - body += "%0D%0A%0D%0A" + UIUtil.escapeHtml(nick); - } - - if (interfaceConfig.INVITATION_POWERED_BY) { - body += "%0D%0A%0D%0A--%0D%0Apowered by jitsi.org"; - } - - window.open(`mailto:?subject=${subject}&body=${body}`, '_blank'); -}; - /** * Show user feedback dialog if its required or just show "thank you" dialog. * @returns {Promise} when dialog is closed. diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index d4812d141..4980ff93e 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -22,15 +22,14 @@ function openLinkDialog () { let title = APP.translation.generateTranslationHTML("dialog.shareLink"); APP.UI.messageHandler.openTwoButtonDialog( - null, null, null, - '

' + title + '

' - + '', - false, "dialog.Invite", + null, title, null, + '', + false, "dialog.copy", function (e, v) { if (v && roomUrl) { JitsiMeetJS.analytics.sendEvent('toolbar.invite.button'); - emitter.emit(UIEvents.USER_INVITED, roomUrl); + document.execCommand('copy'); } else { JitsiMeetJS.analytics.sendEvent('toolbar.invite.cancel'); @@ -38,7 +37,8 @@ function openLinkDialog () { }, function (event) { if (roomUrl) { - document.getElementById('inviteLinkRef').select(); + $('#inviteLinkRef').focus(); + $('#inviteLinkRef').select(); } else { if (event && event.target) { $(event.target).find('button[value=true]') diff --git a/modules/UI/util/MessageHandler.js b/modules/UI/util/MessageHandler.js index 578e0725f..8c9cfb31b 100644 --- a/modules/UI/util/MessageHandler.js +++ b/modules/UI/util/MessageHandler.js @@ -108,7 +108,7 @@ var messageHandler = { persistent: false, buttons: buttons, defaultButton: defaultButton, - focus: focus, + focus: (focus && focus >= 0) ? focus : -1, loaded: loadedFunction, submit: function (e, v, m, f) { twoButtonDialog = null; diff --git a/service/UI/UIEvents.js b/service/UI/UIEvents.js index c1ffa54a6..b2e3301a1 100644 --- a/service/UI/UIEvents.js +++ b/service/UI/UIEvents.js @@ -29,7 +29,6 @@ export default { */ UPDATE_SHARED_VIDEO: "UI.update_shared_video", ROOM_LOCK_CLICKED: "UI.room_lock_clicked", - USER_INVITED: "UI.user_invited", USER_KICKED: "UI.user_kicked", REMOTE_AUDIO_MUTED: "UI.remote_audio_muted", FULLSCREEN_TOGGLE: "UI.fullscreen_toggle", From b54f92b2ae059bd84057bb840858e9992be2fe6a Mon Sep 17 00:00:00 2001 From: yanas Date: Thu, 22 Sep 2016 18:17:37 -0500 Subject: [PATCH 3/4] Fixes the copy action. --- modules/UI/toolbars/Toolbar.js | 22 ++++++++++++++++------ modules/UI/util/MessageHandler.js | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index 4980ff93e..2214c7945 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -20,15 +20,24 @@ function openLinkDialog () { inviteAttributes = "value=\"" + encodeURI(roomUrl) + "\""; } + let inviteLinkId = "inviteLinkRef"; + let focusInviteLink = function() { + $('#' + inviteLinkId).focus(); + $('#' + inviteLinkId).select(); + }; + let title = APP.translation.generateTranslationHTML("dialog.shareLink"); APP.UI.messageHandler.openTwoButtonDialog( null, title, null, - '', false, "dialog.copy", function (e, v) { if (v && roomUrl) { JitsiMeetJS.analytics.sendEvent('toolbar.invite.button'); + + focusInviteLink(); + document.execCommand('copy'); } else { @@ -36,20 +45,21 @@ function openLinkDialog () { } }, function (event) { - if (roomUrl) { - $('#inviteLinkRef').focus(); - $('#inviteLinkRef').select(); - } else { + if (!roomUrl) { if (event && event.target) { $(event.target).find('button[value=true]') .prop('disabled', true); } } + else { + focusInviteLink(); + } }, function (e, v, m, f) { if(!v && !m && !f) JitsiMeetJS.analytics.sendEvent('toolbar.invite.close'); - } + }, + 'Copy' // Focus Copy button. ); } diff --git a/modules/UI/util/MessageHandler.js b/modules/UI/util/MessageHandler.js index 8c9cfb31b..12d3ef4fc 100644 --- a/modules/UI/util/MessageHandler.js +++ b/modules/UI/util/MessageHandler.js @@ -108,7 +108,7 @@ var messageHandler = { persistent: false, buttons: buttons, defaultButton: defaultButton, - focus: (focus && focus >= 0) ? focus : -1, + focus: (focus) ? focus : '', loaded: loadedFunction, submit: function (e, v, m, f) { twoButtonDialog = null; From d2e42c2a7d94ec14c7ca0d6e3f27a64e96f05703 Mon Sep 17 00:00:00 2001 From: yanas Date: Thu, 22 Sep 2016 21:11:24 -0500 Subject: [PATCH 4/4] Update MessageHandler.js --- modules/UI/util/MessageHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/UI/util/MessageHandler.js b/modules/UI/util/MessageHandler.js index 12d3ef4fc..578e0725f 100644 --- a/modules/UI/util/MessageHandler.js +++ b/modules/UI/util/MessageHandler.js @@ -108,7 +108,7 @@ var messageHandler = { persistent: false, buttons: buttons, defaultButton: defaultButton, - focus: (focus) ? focus : '', + focus: focus, loaded: loadedFunction, submit: function (e, v, m, f) { twoButtonDialog = null;