Skip to content

Commit

Permalink
update copy join link issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ylkjick532428 committed Dec 25, 2020
1 parent ba031c6 commit 1a18cce
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CDN/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ function websdkready() {
});
});

function copyToClipboard(elementId) {
var aux = document.createElement("input");
aux.setAttribute("value", document.getElementById(elementId).getAttribute('link'));
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
}

// click copy jon link button
window.copyJoinLink = function (element) {
var meetingConfig = testTool.getMeetingConfig();
Expand All @@ -137,6 +146,9 @@ function websdkready() {
testTool.getCurrentDomain() +
"/meeting.html?" +
testTool.serialize(meetingConfig);
document.getElementById('copy_link_value').setAttribute('link', joinUrl);
copyToClipboard('copy_link_value');

},
});
};
Expand Down
12 changes: 11 additions & 1 deletion Local/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ document.getElementById("join_meeting").addEventListener("click", (e) => {
});
});

function copyToClipboard(elementId) {
var aux = document.createElement("input");
aux.setAttribute("value", document.getElementById(elementId).getAttribute('link'));
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
}

// click copy jon link button
window.copyJoinLink = function (element) {
const meetingConfig = testTool.getMeetingConfig();
Expand All @@ -123,7 +132,8 @@ window.copyJoinLink = function (element) {
testTool.getCurrentDomain() +
"/meeting.html?" +
testTool.serialize(meetingConfig);

document.getElementById('copy_link_value').setAttribute('link', joinUrl);
copyToClipboard('copy_link_value');
},
});
};
Expand Down

0 comments on commit 1a18cce

Please sign in to comment.