Skip to content

Commit

Permalink
Update rt-html-abs.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ledangtrung committed Dec 5, 2024
1 parent c4e7db9 commit 10a3882
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions js/rt-html-abs.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,40 @@ NOTE:${contact.description}
END:VCARD`;
}

function copyContactPhone() {{
const phone = '{phone}';
const tempInput = document.createElement('input');
tempInput.value = phone;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
alert('Phone number has been copied!');
}}

function copyContactEmail() {{
const email = '{email}';
const tempInput = document.createElement('input');
tempInput.value = email;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
alert('Email has been copied!');
}}

function callActionSMS() {{
const actionData = {{
actionID: 9998,
defaultMsg: 'Hi!',
orderNumber: 2,
phone: '{phone}',
type: 'act_sms'
}};
var json = JSON.stringify(actionData);
App.callActionButton(json);
}}

async function addToContacts() {
try {
const vcard = generateVCard();
Expand Down

0 comments on commit 10a3882

Please sign in to comment.