Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.25 KB | None | 0 0
  1.  
  2. requirejs.config({
  3. baseUrl: './js',
  4. paths: {
  5.  
  6. //Telerik
  7. k: "./lib/telerik",
  8. 'kendoAutoComplete': 'k/kendo.autocomplete.min',
  9.  
  10. //JQuery Libraries
  11. 'jquery': './lib/jquery-1.10.2.min',
  12. 'jquery-ui': './lib/jquery.mobile.custom.min',
  13. 'jqueryMobile': './lib/jquery-ui.min',
  14.  
  15. //Require Plugins
  16. 'domReady': './lib/domReady',
  17. 'async': './lib/async',
  18.  
  19. //DarkStar Created Plugins
  20. 'dsdBubbles': './plugins/dsdBubbles',
  21. 'dsdCompass': './plugins/dsdCompass',
  22. 'dsdContactWizard': './plugins/dsdContactWizard',
  23. 'dsdMobileNav': './plugins/dsdMobileNav',
  24. 'dsdParallax': './plugins/dsdParallax',
  25. 'dsdUtils': './plugins/dsdUtils',
  26. 'dsdMaps': './plugins/dsdMaps',
  27. 'dsdStats': './plugins/dsdStats',
  28. 'bingMaps': './modules/bingMaps',
  29. 'emissionsCalculator': './plugins/emissionsCalculator',
  30. 'InnerNavigation': './plugins/InnerNavigation',
  31.  
  32. //Resources Page
  33. 'resources': './plugins/resources',
  34. 'LockDelays': './modules/lockdelays',
  35. 'RiverStages': './modules/riverstages',
  36. 'RiverConditions': './modules/riverconditions',
  37. 'BoatPositions': './modules/boatpositions',
  38.  
  39. //Video Plugins
  40. 'videojs': './lib/video',
  41. 'bigvideojs': './lib/bigvideo',
  42. 'vimeoGallery': './plugins/vimeoGallery',
  43.  
  44. //Various libraries
  45. 'stickUp': './lib/stickup/stickUp',
  46. 'classie': './lib/classie',
  47. 'mediaQueries': './lib/css3-mediaqueries',
  48. 'underscore': './lib/underscore-min',
  49. 'fancybox': './lib/fancybox/jquery.fancybox',
  50. 'moon': './lib/moon',
  51. 'utils': './plugins/utils',
  52. "imagesloaded": "./lib/imagesloaded.pkgd.min",
  53. "eventie": "./lib/eventie",
  54. "EventEmitter": "./lib/EventEmitter.min",
  55. "selectfx": "./lib/cs-select/selectFx",
  56. "microfiche": "./lib/microfiche",
  57. "scrollSpeed": "./lib/scrollSpeed"
  58.  
  59. //I don't believe these are actually needed
  60. //'resc': 'resc',
  61. //'home': 'home',
  62. //'services': 'services',
  63. },
  64. shim: {
  65. "underscore": {
  66. exports: "_"
  67. },
  68. "InnerNavigation": ["jquery"],
  69. "classie": ["jquery"],
  70. "BoatPositions": ["classie"],
  71. "jqueryMobile": ["jquery"],
  72. "stickUp": ["jquery"],
  73. "dsdBubbles": ["jquery", "dsdParallax"],
  74. "dsdCompass": ["jquery"],
  75. "dsdContactWizard": ["jquery"],
  76. "dsdMobileNav": ["jquery"],
  77. "dsdParallax": ["jquery", "utils"],
  78. "dsdUtils": ["jquery"],
  79. "emissionsCalculator": ["jquery"],
  80. "selectfx": ["jquery"],
  81. "utils": ["jquery", "underscore"],
  82. "vimeoGallery": ["jquery"],
  83. "moon": ["jquery"],
  84. 'resources': ["jquery"],
  85. 'resc': ["jquery"],
  86. 'microfiche': ["jquery"],
  87. 'bigvideojs': ["jquery", "videojs"],
  88. "scrollSpeed": ["jquery"]
  89. }
  90. });
  91.  
  92. //This stuff will need to happen on every page
  93. require(["jquery", "jqueryMobile", "stickUp", "dsdUtils", "dsdParallax"/*, "scrollSpeed"*/], function ($, jqueryMobile, stickUp, dsdUtils) {
  94.  
  95. // Scrolls page smoothly
  96. // $.scrollSpeed(100, 800);
  97.  
  98.  
  99. $('.navlist-toggle').on('click', function () {
  100. $('.site-nav.nav-wrapper').slideToggle('slow');
  101. });
  102.  
  103. $(window).resize(function () {
  104. //If greater than the mobile breakpoint
  105. if ($(this).innerWidth() >= 638) {
  106. //Show the navigation
  107. $('.site-nav.nav-wrapper').show();
  108. } else {
  109. //Hide the navigation
  110. $('.site-nav.nav-wrapper').hide();
  111. }
  112. });
  113.  
  114. var page = window.location.pathname;
  115.  
  116. if(page.indexOf('home.php') > 0 || page == '/'){
  117. $('.site-nav ul li:first-child').addClass('active');
  118. } 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 ){
  119. $('.site-nav ul li:nth-child(2)').addClass('active');
  120. }else if(page.indexOf('services.php') > 0){
  121. $('.site-nav ul li:nth-child(3)').addClass('active');
  122. }else if(page.indexOf('resc.php') > 0){
  123. $('.site-nav ul li:nth-child(4)').addClass('active');
  124. }else if(page.indexOf('join.php') > 0){
  125. $('.site-nav ul li:nth-child(5)').addClass('active');
  126. }else if(page.indexOf('contact.php') > 0){
  127. $('.site-nav ul li:nth-child(6)').addClass('active');
  128. }
  129.  
  130.  
  131. // secondary page headers
  132. $('.secondary-header').dsdFixHeight();
  133.  
  134. //Wait for the fat footer to have it's content loaded because it has a parallax image in it
  135. /*$('#FatFooter').load('snippets/fatfooter.html', function(){*/
  136. // as parallax images are loaded, bind event handlers
  137. var img = $('img');
  138. var loaded = 0;
  139. img.each(function () {
  140. var ri = $(this);
  141. var i = new Image();
  142. i.onload = function () {
  143. loaded++;
  144. if (loaded == img.length) {
  145. $(window).trigger('throttledresize');
  146. }
  147. if (ri.hasClass('parallax')) {
  148. ri.dsdParallax({
  149. big_enough: function (settings) {
  150. return $(this).css('position') == 'absolute' && $(window).width() > settings.min_wsize && !Modernizr.touch;
  151. }
  152. });
  153. }
  154. };
  155. i.src = $(this).attr('src');
  156. });
  157. /*});*/
  158.  
  159. // trigger a resize on document ready so resize/positioning stuff runs on load
  160. $(window).trigger('throttledresize');
  161.  
  162. $(window).on('resize', function () {
  163. $(window).trigger('throttledresize');
  164. });
  165.  
  166. // clearfix for IE8 and under (simulates the :after of .clearfix)
  167. $('.lt-ie9 .clearfix').append('<div class="clear"></div>');
  168. //
  169. /* StickUp plugin
  170. WaitForFunction();
  171. function WaitForFunction() {
  172. if (typeof $.fn.stickUp !== 'function') {
  173. setTimeout(WaitForFunction, 100);
  174. } else {
  175. Function_Loaded();
  176. }
  177. }
  178.  
  179. function Function_Loaded() {
  180. try {
  181. $('.header').stickUp({
  182. marginTop: '2em'
  183. });
  184. } catch (e) {
  185. console.warn(e.message);
  186. }
  187. }*/
  188. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement