diff options
| author | Teddy Wing | 2013-04-28 11:36:48 -0400 |
|---|---|---|
| committer | Teddy Wing | 2013-04-28 11:36:48 -0400 |
| commit | cf5c3a783a25a5a094be82b41cd66988c073df80 (patch) | |
| tree | ab19e322b5bd701a504ebc30dedfd7a391944f23 /public/javascripts/parse-interface.js | |
| parent | 1f763cbf0959c5722736a75e30fcc2c76637cd64 (diff) | |
| download | Who-am-I-cf5c3a783a25a5a094be82b41cd66988c073df80.tar.bz2 | |
Reorganise JS and get characters from lasest video
* Reorganise frontend JavaScript to make it more compartmentalised
* Grab characters from the latest video
Diffstat (limited to 'public/javascripts/parse-interface.js')
| -rw-r--r-- | public/javascripts/parse-interface.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/public/javascripts/parse-interface.js b/public/javascripts/parse-interface.js new file mode 100644 index 0000000..e58b243 --- /dev/null +++ b/public/javascripts/parse-interface.js @@ -0,0 +1,37 @@ +var ParseInterface = ParseInterface || null; + +(function() { + var cParseInterface = function() { + var application_id = '6jaGjImHFtbJLkAWJRnnLTHfD01nmWHAIrAKNYge'; + var javascript_key = 'zA6og358R2Wg5NVAHWj81zeFz2WQZ5u2AhHFPCjN'; + Parse.initialize(application_id, javascript_key); + + var ContestObject = Parse.Object.extend('ContestObject'); + + this.get_last_charade = function() { + var that = this; + var query = new Parse.Query(ContestObject); + query.limit(1); + query.descending('createdAt'); + query.find({ + success: function(response) { + that._process_charade(response[0]); + } + }); + }; + + this._process_charade = function(contest_instance) { + var video_url = contest_instance.get('video_url'); + var series_id = contest_instance.get('series_id'); + + App.answer = contest_instance.get('personId'); + App.initialize_video(video_url); + App.get_characters(series_id); + }; + + + return this; + }; + + ParseInterface = new cParseInterface(); +})();
\ No newline at end of file |
