Skip to content

Commit b6308c6

Browse files
authored
Merge branch 'main' into main
2 parents 6f7d50d + bd396e1 commit b6308c6

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

html/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<script src="https://cdnjs.cloudflare.com/ajax/libs/emojionearea/3.4.2/emojionearea.min.js" integrity="sha512-hkvXFLlESjeYENO4CNi69z3A1puvONQV5Uh+G4TUDayZxSLyic5Kba9hhuiNLbHqdnKNMk2PxXKm0v7KDnWkYA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
3434
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> <!-- Bootstrap -->
3535
<script src="https://code.jquery.com/color/jquery.color-2.2.0.min.js" integrity="sha256-aSe2ZC5QeunlL/w/7PsVKmV+fa0eDbmybn/ptsKHR6I=" crossorigin="anonymous"></script> <!-- Color CDN -->
36+
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js" ></script> <!-- Clipboard.js -->
3637
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
3738
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojionearea/3.4.2/emojionearea.min.css" integrity="sha512-vEia6TQGr3FqC6h55/NdU3QSM5XR6HSl5fW71QTKrgeER98LIMGwymBVM867C1XHIkYD9nMTfWK2A0xcodKHNA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
3839
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> <!-- Bootstrap -->
@@ -122,12 +123,12 @@
122123

123124
<div class="settings-app-tab-information">
124125
<!-- <div class="settings-app-tab-header"><p>Infomation</p></div> -->
125-
<div class="settings-app-tab secondTab" data-settingstab="myPhone">
126+
<div class="settings-app-tab secondTab" data-settingstab="myPhone" id="phoneNumberSelect">
126127
<div class="settings-tab-icon"><i class="fas fa-phone-alt" style="color: #e67e22;"></i></div>
127128
<div class="settings-tab-title"><p>My phone number</p></div>
128129
<div class="settings-tab-description" id="myPhoneNumber"><p>0612345678</p></div>
129130
</div>
130-
<div class="settings-app-tab secondTab" data-settingstab="serialNumber">
131+
<div class="settings-app-tab secondTab" data-settingstab="serialNumber" id="serialNumberSelect">
131132
<div class="settings-tab-icon"><i class="fas fa-phone-alt" style="color: #e67e22;"></i></div>
132133
<div class="settings-tab-title"><p>Serial Number</p></div>
133134
<div class="settings-tab-description" id="mySerialNumber"><p>0612345678</p></div>

html/js/settings.js

+34-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,39 @@ $(document).on('click', '.settings-app-tab', function(e){
3535
}
3636
});
3737

38+
39+
$(document).on(
40+
"click",
41+
"#phoneNumberSelect, #serialNumberSelect",
42+
function (e) {
43+
// Get the title of the clicked element
44+
var title = "";
45+
if ($(this).attr("id") == "phoneNumberSelect") {
46+
title = "Phone Number";
47+
} else {
48+
title = "Serial Number";
49+
}
50+
51+
// get the result id of myPhoneNumber or mySerialNumber
52+
var textToCopy =
53+
$(this).attr("id") == "phoneNumberSelect"
54+
? $("#myPhoneNumber").text()
55+
: $("#mySerialNumber").text();
56+
57+
// Copying the text to clipboard using Clipboard.js
58+
var clipboard = new ClipboardJS(this, {
59+
text: function () {
60+
QB.Phone.Notifications.Add(
61+
"fas fa-phone",
62+
"Copied " + title + "!",
63+
textToCopy
64+
);
65+
return textToCopy;
66+
},
67+
});
68+
}
69+
);
70+
3871
$(document).on('click', '#accept-background', function(e){
3972
e.preventDefault();
4073
var hasCustomBackground = QB.Phone.Functions.IsBackgroundCustom();
@@ -190,4 +223,4 @@ $(document).on('click', '#cancel-profilepicture', function(e){
190223
$(document).on('click', '#cancel-custom-profilepicture', function(e){
191224
e.preventDefault();
192225
QB.Phone.Animations.TopSlideUp(".profilepicture-custom", 200, -23);
193-
});
226+
});

0 commit comments

Comments
 (0)