Skip to content

Commit 6490904

Browse files
committed
✨ Make location linkable to Google Maps;
1 parent 62a98bd commit 6490904

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Github_User_Info/Github_User_Info.user.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@
132132
'text-align: center;' +
133133
'color: #CCC;';
134134
userLocation.appendChild(userLocationIcon);
135-
var userLocationText = document.createElement('span');
135+
var userLocationText = document.createElement('a');
136+
userLocationText.setAttribute('target', '_blank');
136137
userLocation.appendChild(userLocationText);
137138

138139
var userMail = document.createElement('div');
@@ -430,6 +431,7 @@
430431
userCompanyAdmin.style.display = data.admin ? 'inline' : 'none';
431432
}
432433
if (hasValue(data.location, userLocation)) {
434+
userLocationText.setAttribute('href', 'https://maps.google.com/maps?q=' + encodeURIComponent(data.location));
433435
userLocationText.textContent = data.location;
434436
}
435437
if (hasValue(data.mail, userMail)) {

0 commit comments

Comments
 (0)