aboutsummaryrefslogtreecommitdiffstats
path: root/public/javascripts/viggle.js
blob: 87a84dae27b9c7f81300b9ca0d929feefc1b43f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
})();