/** * Main loginPage application */ define([ 'jquery', 'app/init', 'app/util', 'app/render', 'app/ccp', 'blueImpGallery', 'bootbox', 'lazyload', 'app/ui/header', 'app/ui/logo', 'app/ui/demo_map', 'dialog/account_settings', 'dialog/notification', 'dialog/manual', 'dialog/releases', 'dialog/credit' ], function($, Init, Util, Render, CCP, Gallery, bootbox) { 'use strict'; var config = { splashOverlayClass: 'pf-splash', // class for "splash" overlay // header headerId: 'pf-landing-top', // id for header headerContainerId: 'pf-header-container', // id for header container logoContainerId: 'pf-logo-container', // id for main header logo container headHeaderMapId: 'pf-header-map', // id for header image (svg animation) // map bg headMapBgId: 'pf-header-map-bg', // id for header background container mapNeocomId: 'pf-map-neocom', // id for map "neocom" image mapBrowserId: 'pf-map-browser', // id for "browser" image mapBgImageId: 'pf-map-bg-image', // id for "background" map image // navigation navigationElementId: 'pf-navbar', // id for navbar element navigationLinkManualClass: 'pf-navbar-manual', // class for "manual" trigger link navigationLinkLicenseClass: 'pf-navbar-license', // class for "license" trigger link navigationVersionLinkClass: 'pf-navbar-version-info', // class for "version information" // cookie hint cookieHintId: 'pf-cookie-hint', // id for "cookie hint" element // character select characterSelectionClass: 'pf-character-selection', // class for character panel wrapper characterRowAnimateClass: 'pf-character-row-animate', // class for character panel row during animation characterImageWrapperClass: 'pf-character-image-wrapper', // class for image wrapper (animated) characterImageInfoClass: 'pf-character-info', // class for character info layer (visible on hover) dynamicMessageContainerClass: 'pf-dynamic-message-container', // class for "dynamic" (JS) message container // gallery galleryId: 'pf-gallery', // id for gallery container galleryThumbImageClass: 'pf-landing-image-preview', // class for gallery thumb images galleryThumbContainerId: 'pf-landing-gallery-thumb-container', // id for gallery thumb images galleryCarouselId: 'pf-landing-gallery-carousel', // id for "carousel" element // server panel serverPanelId: 'pf-server-panel', // id for EVE Online server status panel // animation animateElementClass: 'pf-animate-on-visible' // class for elements that will be animated to show }; /** * set a cookie * @param cname * @param cvalue * @param exdays */ var setCookie = function(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = 'expires=' + d.toUTCString(); var path = 'path=' + Util.getDocumentPath(); document.cookie = cname + '=' + cvalue + '; ' + expires + '; ' + path; }; /** * get cookie value by name * @param cname * @returns {*} */ var getCookie = function(cname) { var name = cname + '='; var ca = document.cookie.split(';'); for(var i = 0; i ') .addClass('text-content') .attr('imgTitle', obj.title); var moduleConfig = { name: obj.href, // template name position: newSlideContent, functions: { after: function(){ // element inserted -> load complete callback({ type: 'complete', target: newSlideContent[0] }); } } }; // render HTML file (template) var moduleData = { id: config.headHeaderMapId, bgId: config.headMapBgId, neocomId: config.mapNeocomId, browserId: config.mapBrowserId, mapBgImageId: config.mapBgImageId }; Render.showModule(moduleConfig, moduleData); return newSlideContent[0]; }; // initialize carousel ------------------------------------------------ var carousel = new Gallery([ { imgTitle: 'IGB', href: 'ui/map', type: 'text/html' }, { href: 'public/img/landing/responsive.jpg', imgTitle: 'Responsive layout', type: 'image/jpg', thumbnail: '' }, { href: 'public/img/landing/pathfinder_1.jpg', imgTitle: 'Map view', type: 'image/jpg', thumbnail: '' }, { href: 'public/img/landing/pathfinder_3.jpg', imgTitle: 'Map information', type: 'image/jpg', thumbnail: '' }, { href: 'public/img/landing/pathfinder_2.jpg', imgTitle: 'System information', type: 'image/jpg', thumbnail: '' } ], { container: '#' + config.galleryCarouselId, carousel: true, startSlideshow: false, titleProperty: 'imgTitle', transitionSpeed: 600, slideshowInterval: 5000, onopened: function () { // Callback function executed when the Gallery has been initialized // and the initialization transition has been completed. // -> show "demo" map // set title for first slide $( this.options.container ).find( this.options.titleElement).text('Browser view'); $('#' + config.headHeaderMapId).drawDemoMap(function(){ // zoom map SVGs $('#' + config.headHeaderMapId + ' svg').velocity({ scaleX: 0.66, scaleY: 0.66 }, { duration: 360 }); // position map container $('#' + config.headHeaderMapId).velocity({ marginTop: '130px', marginLeft: '-50px' }, { duration: 360, complete: function(){ // show browser $('#' + config.mapBrowserId).velocity('transition.slideUpBigIn', { duration: 360, complete: function(){ // show neocom $('#' + config.mapNeocomId).velocity('transition.slideLeftIn', { duration: 180 }); // show background $('#' + config.mapBgImageId).velocity('transition.shrinkIn', { duration: 360 }); // when map is shown -> start carousel looping carousel.play(); } }); } }); }); } }); }; /** * init image gallery */ var initGallery = function(){ requirejs(['blueImpGalleryBootstrap'], function() { // thumb links var thumbLinks = $('a[data-gallery="#pf-gallery"]'); var borderless = false; var galleryElement = $('#' + config.galleryId); galleryElement.data('useBootstrapModal', !borderless); galleryElement.toggleClass('blueimp-gallery-controls', borderless); // init gallery on click thumbLinks.on('click', function(e){ e.preventDefault(); e = e || window.event; var target = e.target || e.srcElement; var link = target.src ? target.parentNode : target; var options = { index: link, event: e, container: '#' + config.galleryId, titleProperty: 'description' }; new Gallery(thumbLinks, options); }); }); }; var initYoutube = function(){ $('.youtube').each(function() { // Based on the YouTube ID, we can easily find the thumbnail image $(this).css('background-image', 'url(https://i.ytimg.com/vi/' + this.id + '/sddefault.jpg)'); // Overlay the Play icon to make it look like a video player $(this).append($('
', {'class': 'play'})); $(document).delegate('#' + this.id, 'click', function() { // Create an iFrame with autoplay set to true var iFrameUrl = 'https://www.youtube.com/embed/' + this.id + '?autoplay=1&autohide=1'; if ( $(this).data('params') ){ iFrameUrl += '&'+$(this).data('params'); } // The height and width of the iFrame should be the same as parent var iFrame = $('