define(function(require, exports, module){ // Module config var config = { flowplayerKey: 'defaultkey' }; var App = require('app'); require('flowplayer'); module.exports = { init: function(configArg){ // Compile module config from RequireJS module.config() and init() argument $.extend(config, module.config(), configArg); console.log('app-homepage.init(); config = ', config); initPlayer(); showCurrentGallery(); }, // Keep config reference outside the module config: config }; function initPlayer() { flowplayer("player", "media/player/flowplayer.commercial-3.2.16.swf", { onPlay: function(clip) { this.toggleFullscreen(); }, key: config.flowplayerKey }); } function showCurrentGallery() { $('.spec-tabs__nav li').click(function(){ var galleryId = window.location.hash.substring(1); $('.portfolio-box__tabs__list').css('display', 'none'); $('.' + galleryId + '').css('display', 'block'); }); } });