aboutsummaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorTeddy Wing2013-04-28 14:51:50 -0400
committerTeddy Wing2013-04-28 14:51:50 -0400
commitad3f3cbd961c4881084386cd9294e5e7a8b675c3 (patch)
treeeba6dfee310cbc86e99fa0d8c36b692dd730c53d /public
parent649d336bc48743038c703a8f275b1d115151969d (diff)
downloadWho-am-I-ad3f3cbd961c4881084386cd9294e5e7a8b675c3.tar.bz2
Add some Viggle calls
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/viggle.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/public/javascripts/viggle.js b/public/javascripts/viggle.js
new file mode 100644
index 0000000..87a84da
--- /dev/null
+++ b/public/javascripts/viggle.js
@@ -0,0 +1,20 @@
+(function() {
+ function onBridgeIsReady () {
+ VAPP.setTitleBarTitle(function(message) {}, 'Who am I?');
+
+ VAPP.getCurrentShow(function (message) {
+ var showInfo = JSON.parse(message);
+ if (showInfo.status !== 'success') {
+ VAPP.showModal(function(message) {}, 'Oops ...', null, 'Unable to get show info.', 'Please try again.', false);
+ return;
+ }
+
+ // Name of the current show
+ var showName = showInfo.data.program_data.program_title;
+
+ VAPP.setTitleBarSubTitle(function(message) {}, showName);
+ }
+ }
+
+ document.addEventListener('VAPPReady', onBridgeIsReady, true);
+})(); \ No newline at end of file