Created
September 6, 2012 13:28
-
-
Save fcsonline/3656251 to your computer and use it in GitHub Desktop.
Teambox QRCode for contacts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).bind('hashchange', function(){ | |
if (window.location.hash.match('users')) { | |
setTimeout(function() { | |
console.log('Showing Contact QR-Code...'); | |
var data = ""; | |
data += "BEGIN:VCARD\n"; | |
data += "VERSION:2.1\n"; | |
data += "FN:" + $(".profile_title h2").html() + "\n"; | |
//data += "N:Last;First\n"; | |
data += "TEL;WORK;VOICE:" + $(".phone_numbers .item_content").html() + "\n"; | |
//data += "TEL;HOME;VOICE:PHONE-HOME\n"; | |
//data += "EMAIL;HOME;INTERNET:EMAIL-HOME\n"; | |
data += "EMAIL;WORK;INTERNET:" + $(".email_addresses .item_content").html() + "\n"; | |
data += "URL:" + $(".websites .item_content").html() + "\n"; | |
data += "END:VCARD\n"; | |
var qrcodeurl = "http://api.qrserver.com/v1/create-qr-code/?data=" + encodeURI(data) + "&size=160x160"; | |
$(".profile_image").after('<div class="ims section"><span class="icon card"></span><div class="im item"><div class="type">QR Code:</div></div><div class="item_content"><img src="' + qrcodeurl + '"></div></div>'); | |
}, 1500); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment