Last active
December 10, 2015 17:38
-
-
Save fairchild/4468951 to your computer and use it in GitHub Desktop.
Att.js sample code
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width"> | |
<link rel="stylesheet" href="/css/style.css" type="text/css"> | |
<script src="/js/jquery.min.js" type="text/javascript"></script> | |
<script src="/js/modernizr-2.5.3.min.js" type="text/javascript"></script> | |
<script src="/att.js" type="text/javascript"></script> | |
<script src="/js/candybar.js"></script> | |
<script src="/js/dialpad.js"></script> | |
<script src="/js/ringer.js"></script> | |
<link href="/css/candybar.css" rel="stylesheet" type="text/css"><link href="/css/dialpad.css" rel="stylesheet" type="text/css"> | |
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function() { | |
window.att = $.att({ | |
apiKey: "mz6d4da9hfzg4jlpuyv9jswpc2rg2ofj", | |
// when the phone is ready, render dialpad | |
onReady: function () { | |
$('#dialer').html(dialpad.render()); | |
$('#call').html('Ready'); | |
} | |
}); | |
// add some ringtones | |
window.ringer = new Ringer(att); | |
// init our candybar UI pass it our phone | |
window.candybar = new CandyBar({phone: att}); | |
candybar.render(); | |
// init our dialpad | |
window.dialpad = new Dialpad({ | |
// when the "call" button is clicked | |
// on the dialer, dial our phone. | |
onCall: function (number, dialable) { | |
att.phone.dial(number); | |
dialpad.hide(); | |
} | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="dialer"></div> | |
<button class="btn btn-large btn-primary input-block-level" type="submit" value="Dial" id="call" disabled="true" class="btn btn-large btn-primary" > | |
<span id="status">Registering...</span> | |
</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment