You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

109 lines
5.3 KiB

  1. /*
  2. Alpha by HTML5 UP
  3. html5up.net | @n33co
  4. Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
  5. */
  6. (function($) {
  7. skel.init({
  8. reset: 'full',
  9. breakpoints: {
  10. global: { range: '*', href: 'css/style.css', containers: '60em', grid: { gutters: ['2em', 0] } },
  11. wide: { range: '-1680', href: 'css/style-wide.css' },
  12. normal: { range: '-1280', href: 'css/style-normal.css', viewport: { scalable: false } },
  13. narrow: { range: '-980', href: 'css/style-narrow.css', containers: '90%' },
  14. narrower: { range: '-840', href: 'css/style-narrower.css', containers: '90%!' },
  15. mobile: { range: '-736', href: 'css/style-mobile.css', containers: '100%!' },
  16. mobilep: { range: '-480', href: 'css/style-mobilep.css' }
  17. },
  18. plugins: {
  19. layers: {
  20. // Config.
  21. config: {
  22. mode: function() { return (skel.vars.isMobile ? 'transform' : 'position'); }
  23. },
  24. // Navigation Panel.
  25. navPanel: {
  26. animation: 'pushX',
  27. breakpoints: 'narrower',
  28. clickToHide: true,
  29. height: '100%',
  30. hidden: true,
  31. html: '<div data-action="navList" data-args="nav"></div>',
  32. orientation: 'vertical',
  33. position: 'top-left',
  34. side: 'left',
  35. width: 250
  36. },
  37. // Navigation Button.
  38. navButton: {
  39. breakpoints: 'narrower',
  40. height: '4em',
  41. html: '<span class="toggle" data-action="toggleLayer" data-args="navPanel"></span>',
  42. position: 'top-left',
  43. side: 'top',
  44. width: '6em'
  45. }
  46. }
  47. }
  48. });
  49. $(function() {
  50. var $window = $(window),
  51. $body = $('body'),
  52. $header = $('#header'),
  53. $banner = $('#banner');
  54. // Forms (IE<10).
  55. var $form = $('form');
  56. if ($form.length > 0) {
  57. $form.find('.form-button-submit')
  58. .on('click', function() {
  59. $(this).parents('form').submit();
  60. return false;
  61. });
  62. if (skel.vars.IEVersion < 10) {
  63. $.fn.n33_formerize=function(){var _fakes=new Array(),_form = $(this);_form.find('input[type=text],textarea').each(function() { var e = $(this); if (e.val() == '' || e.val() == e.attr('placeholder')) { e.addClass('formerize-placeholder'); e.val(e.attr('placeholder')); } }).blur(function() { var e = $(this); if (e.attr('name').match(/_fakeformerizefield$/)) return; if (e.val() == '') { e.addClass('formerize-placeholder'); e.val(e.attr('placeholder')); } }).focus(function() { var e = $(this); if (e.attr('name').match(/_fakeformerizefield$/)) return; if (e.val() == e.attr('placeholder')) { e.removeClass('formerize-placeholder'); e.val(''); } }); _form.find('input[type=password]').each(function() { var e = $(this); var x = $($('<div>').append(e.clone()).remove().html().replace(/type="password"/i, 'type="text"').replace(/type=password/i, 'type=text')); if (e.attr('id') != '') x.attr('id', e.attr('id') + '_fakeformerizefield'); if (e.attr('name') != '') x.attr('name', e.attr('name') + '_fakeformerizefield'); x.addClass('formerize-placeholder').val(x.attr('placeholder')).insertAfter(e); if (e.val() == '') e.hide(); else x.hide(); e.blur(function(event) { event.preventDefault(); var e = $(this); var x = e.parent().find('input[name=' + e.attr('name') + '_fakeformerizefield]'); if (e.val() == '') { e.hide(); x.show(); } }); x.focus(function(event) { event.preventDefault(); var x = $(this); var e = x.parent().find('input[name=' + x.attr('name').replace('_fakeformerizefield', '') + ']'); x.hide(); e.show().focus(); }); x.keypress(function(event) { event.preventDefault(); x.val(''); }); }); _form.submit(function() { $(this).find('input[type=text],input[type=password],textarea').each(function(event) { var e = $(this); if (e.attr('name').match(/_fakeformerizefield$/)) e.attr('name', ''); if (e.val() == e.attr('placeholder')) { e.removeClass('formerize-placeholder'); e.val(''); } }); }).bind("reset", function(event) { event.preventDefault(); $(this).find('select').val($('option:first').val()); $(this).find('input,textarea').each(function() { var e = $(this); var x; e.removeClass('formerize-placeholder'); switch (this.type) { case 'submit': case 'reset': break; case 'password': e.val(e.attr('defaultValue')); x = e.parent().find('input[name=' + e.attr('name') + '_fakeformerizefield]'); if (e.val() == '') { e.hide(); x.show(); } else { e.show(); x.hide(); } break; case 'checkbox': case 'radio': e.attr('checked', e.attr('defaultValue')); break; case 'text': case 'textarea': e.val(e.attr('defaultValue')); if (e.val() == '') { e.addClass('formerize-placeholder'); e.val(e.attr('placeholder')); } break; default: e.val(e.attr('defaultValue')); break; } }); window.setTimeout(function() { for (x in _fakes) _fakes[x].trigger('formerize_sync'); }, 10); }); return _form; };
  64. $form.n33_formerize();
  65. }
  66. }
  67. // Dropdowns.
  68. $('#nav > ul').dropotron({
  69. alignment: 'right'
  70. });
  71. // Header.
  72. // If the header is using "alt" styling and #banner is present, use scrollwatch
  73. // to revert it back to normal styling once the user scrolls past the banner.
  74. // Note: This is disabled on mobile devices.
  75. if (!skel.vars.isMobile
  76. && $header.hasClass('alt')
  77. && $banner.length > 0) {
  78. $window.on('load', function() {
  79. $banner.scrollwatch({
  80. delay: 0,
  81. range: 0.5,
  82. anchor: 'top',
  83. on: function() { $header.addClass('alt reveal'); },
  84. off: function() { $header.removeClass('alt'); }
  85. });
  86. });
  87. }
  88. });
  89. })(jQuery);