index.js
function (options, callback) {
			var sampleImageCategories = ['abstract', 'animals', 'business', 'cats', 'city', 'food', 'nature', 'technics', 'transport'];
			var numItems = 200;

			// build dataSource based with options
			var resp = {
				count: numItems,
				items: [],
				pages: (Math.ceil(numItems / (options.pageSize || 30))),
				page: options.pageIndex
			};

			// get start and end limits for JSON
			var i, l;
			i = options.pageIndex * (options.pageSize || 30);
			l = i + (options.pageSize || 30);
			resp.start = i + 1;
			resp.end = l;

			// add sample items to datasource
			for (i; i < l; i++) {
				resp.items.push({
					name: ('Thumbnail ' + (i + 1)),
					src: 'http://lorempixel.com/65/65/' + sampleImageCategories[Math.floor(Math.random() * 9)] + '/?_=' + i
				});
			}

			// call and simulate latency
			setTimeout(function () {
				callback(resp);
			}, loadDelays[Math.floor(Math.random() * 4)]);
		}
function (options, callback) {
			var sampleImageCategories = ['abstract', 'animals', 'business', 'cats', 'city', 'food', 'nature', 'technics', 'transport'];
			var numItems = 200;

			// build dataSource based with options
			var resp = {
				count: numItems,
				items: [],
				pages: (Math.ceil(numItems / (options.pageSize || 30))),
				page: options.pageIndex
			};

			// get start and end limits for JSON
			var i, l;
			i = options.pageIndex * (options.pageSize || 30);
			l = i + (options.pageSize || 30);
			resp.start = i + 1;
			resp.end = l;

			// add sample items to datasource
			for (i; i < l; i++) {
				resp.items.push({
					name: ('Thumbnail ' + (i + 1)),
					src: 'http://lorempixel.com/65/65/' + sampleImageCategories[Math.floor(Math.random() * 9)] + '/?_=' + i
				});
			}

			// call and simulate latency
			setTimeout(function () {
				callback(resp);
			}, loadDelays[Math.floor(Math.random() * 4)]);
		}
function ( options , callback ) { var sampleImageCategories = [ 'abstract' , 'animals' , 'business' , 'cats' , 'city' , 'food' , 'nature' , 'technics' , 'transport' ] ; var numItems = 200 ; // build dataSource based with options var resp = { count : numItems , items : [ ] , pages : ( Math . ceil ( numItems / ( options . pageSize || 30 ) ) ) , page : options . pageIndex } ; // get start and end limits for JSON var i , l ; i = options . pageIndex * ( options . pageSize || 30 ) ; l = i + ( options . pageSize || 30 ) ; resp . start = i + 1 ; resp . end = l ; // add sample items to datasource for ( i ; i < l ; i ++ ) { resp . items . push ( { name : ( 'Thumbnail ' + ( i + 1 ) ) , src : 'http://lorempixel.com/65/65/' + sampleImageCategories [ Math . floor ( Math . random ( ) * 9 ) ] + '/?_=' + i } ) ; } // call and simulate latency setTimeout ( function ( ) { callback ( resp ) ; } , loadDelays [ Math . floor ( Math . random ( ) * 4 ) ] ) ; }
thumbnail view setup
thumbnail view setup