Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- requirejs.config({
- baseUrl: './js',
- paths: {
- //Telerik
- k: "./lib/telerik",
- 'kendoAutoComplete': 'k/kendo.autocomplete.min',
- //JQuery Libraries
- 'jquery': './lib/jquery-1.10.2.min',
- 'jquery-ui': './lib/jquery.mobile.custom.min',
- 'jqueryMobile': './lib/jquery-ui.min',
- //Require Plugins
- 'domReady': './lib/domReady',
- 'async': './lib/async',
- //DarkStar Created Plugins
- 'dsdBubbles': './plugins/dsdBubbles',
- 'dsdCompass': './plugins/dsdCompass',
- 'dsdContactWizard': './plugins/dsdContactWizard',
- 'dsdMobileNav': './plugins/dsdMobileNav',
- 'dsdParallax': './plugins/dsdParallax',
- 'dsdUtils': './plugins/dsdUtils',
- 'dsdMaps': './plugins/dsdMaps',
- 'dsdStats': './plugins/dsdStats',
- 'bingMaps': './modules/bingMaps',
- 'emissionsCalculator': './plugins/emissionsCalculator',
- 'InnerNavigation': './plugins/InnerNavigation',
- //Resources Page
- 'resources': './plugins/resources',
- 'LockDelays': './modules/lockdelays',
- 'RiverStages': './modules/riverstages',
- 'RiverConditions': './modules/riverconditions',
- 'BoatPositions': './modules/boatpositions',
- //Video Plugins
- 'videojs': './lib/video',
- 'bigvideojs': './lib/bigvideo',
- 'vimeoGallery': './plugins/vimeoGallery',
- //Various libraries
- 'stickUp': './lib/stickup/stickUp',
- 'classie': './lib/classie',
- 'mediaQueries': './lib/css3-mediaqueries',
- 'underscore': './lib/underscore-min',
- 'fancybox': './lib/fancybox/jquery.fancybox',
- 'moon': './lib/moon',
- 'utils': './plugins/utils',
- "imagesloaded": "./lib/imagesloaded.pkgd.min",
- "eventie": "./lib/eventie",
- "EventEmitter": "./lib/EventEmitter.min",
- "selectfx": "./lib/cs-select/selectFx",
- "microfiche": "./lib/microfiche",
- "scrollSpeed": "./lib/scrollSpeed"
- //I don't believe these are actually needed
- //'resc': 'resc',
- //'home': 'home',
- //'services': 'services',
- },
- shim: {
- "underscore": {
- exports: "_"
- },
- "InnerNavigation": ["jquery"],
- "classie": ["jquery"],
- "BoatPositions": ["classie"],
- "jqueryMobile": ["jquery"],
- "stickUp": ["jquery"],
- "dsdBubbles": ["jquery", "dsdParallax"],
- "dsdCompass": ["jquery"],
- "dsdContactWizard": ["jquery"],
- "dsdMobileNav": ["jquery"],
- "dsdParallax": ["jquery", "utils"],
- "dsdUtils": ["jquery"],
- "emissionsCalculator": ["jquery"],
- "selectfx": ["jquery"],
- "utils": ["jquery", "underscore"],
- "vimeoGallery": ["jquery"],
- "moon": ["jquery"],
- 'resources': ["jquery"],
- 'resc': ["jquery"],
- 'microfiche': ["jquery"],
- 'bigvideojs': ["jquery", "videojs"],
- "scrollSpeed": ["jquery"]
- }
- });
- //This stuff will need to happen on every page
- require(["jquery", "jqueryMobile", "stickUp", "dsdUtils", "dsdParallax"/*, "scrollSpeed"*/], function ($, jqueryMobile, stickUp, dsdUtils) {
- // Scrolls page smoothly
- // $.scrollSpeed(100, 800);
- $('.navlist-toggle').on('click', function () {
- $('.site-nav.nav-wrapper').slideToggle('slow');
- });
- $(window).resize(function () {
- //If greater than the mobile breakpoint
- if ($(this).innerWidth() >= 638) {
- //Show the navigation
- $('.site-nav.nav-wrapper').show();
- } else {
- //Hide the navigation
- $('.site-nav.nav-wrapper').hide();
- }
- });
- var page = window.location.pathname;
- if(page.indexOf('home.php') > 0 || page == '/'){
- $('.site-nav ul li:first-child').addClass('active');
- } else if(page.indexOf('who-we-are.php') > 0 || page.indexOf('zeroharm.php') > 0 || page.indexOf('ourValues.php') > 0 || page.indexOf('sustainability.php') > 0 || page.indexOf('leadership.php') > 0 || page.indexOf('calculator.php') > 0 ){
- $('.site-nav ul li:nth-child(2)').addClass('active');
- }else if(page.indexOf('services.php') > 0){
- $('.site-nav ul li:nth-child(3)').addClass('active');
- }else if(page.indexOf('resc.php') > 0){
- $('.site-nav ul li:nth-child(4)').addClass('active');
- }else if(page.indexOf('join.php') > 0){
- $('.site-nav ul li:nth-child(5)').addClass('active');
- }else if(page.indexOf('contact.php') > 0){
- $('.site-nav ul li:nth-child(6)').addClass('active');
- }
- // secondary page headers
- $('.secondary-header').dsdFixHeight();
- //Wait for the fat footer to have it's content loaded because it has a parallax image in it
- /*$('#FatFooter').load('snippets/fatfooter.html', function(){*/
- // as parallax images are loaded, bind event handlers
- var img = $('img');
- var loaded = 0;
- img.each(function () {
- var ri = $(this);
- var i = new Image();
- i.onload = function () {
- loaded++;
- if (loaded == img.length) {
- $(window).trigger('throttledresize');
- }
- if (ri.hasClass('parallax')) {
- ri.dsdParallax({
- big_enough: function (settings) {
- return $(this).css('position') == 'absolute' && $(window).width() > settings.min_wsize && !Modernizr.touch;
- }
- });
- }
- };
- i.src = $(this).attr('src');
- });
- /*});*/
- // trigger a resize on document ready so resize/positioning stuff runs on load
- $(window).trigger('throttledresize');
- $(window).on('resize', function () {
- $(window).trigger('throttledresize');
- });
- // clearfix for IE8 and under (simulates the :after of .clearfix)
- $('.lt-ie9 .clearfix').append('<div class="clear"></div>');
- //
- /* StickUp plugin
- WaitForFunction();
- function WaitForFunction() {
- if (typeof $.fn.stickUp !== 'function') {
- setTimeout(WaitForFunction, 100);
- } else {
- Function_Loaded();
- }
- }
- function Function_Loaded() {
- try {
- $('.header').stickUp({
- marginTop: '2em'
- });
- } catch (e) {
- console.warn(e.message);
- }
- }*/
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement