aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--public/javascripts/viggle.js20
-rw-r--r--views/index.ejs1
2 files changed, 21 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
diff --git a/views/index.ejs b/views/index.ejs
index de8c3f0..2a26772 100644
--- a/views/index.ejs
+++ b/views/index.ejs
@@ -46,6 +46,7 @@
<script src="/javascripts/app.js"></script>
<script src="/javascripts/parse-interface.js"></script>
+ <script src="/javascripts/viggle.js"></script>
<script src="/javascripts/main.js"></script>
</body>
</html>