aboutsummaryrefslogtreecommitdiffstats
path: root/public/javascripts/main.js
blob: a3c54c58cd29d024c8bd6f09bb74cfb8e7f16a47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// CoverFlow
(function() {
	var initialise_content_flow = function() {
		var cf = new ContentFlow('character-select', {
			reflectionColor: "#000000",
		
			onclickActiveItem: function(item) {
				alert('hello');
			}
		});
		
		return cf;
	};
	// initialise_content_flow();

	// Populate characters
	
	// Change template settings to use {{}} delimiters
	_.templateSettings = {
		interpolate: /\{\{(.+?)\}\}/g
	};
	
	var $character_container = $('#character-select .flow');
	var character_template = _.template($('#character-image-template').html());
	$.get(
		'/character-images/8680539',
		function(response) {
			var r = JSON.parse(response);
			
			$character_container.empty()
			
			for (var i = 0; i < r.characters.length; i++) {
				$character_container.append(character_template(r.characters[i]));
			}
		}
	);
})();