init
This commit is contained in:
82
themes/hugo-agency-theme/static/js/agency.js
Normal file
82
themes/hugo-agency-theme/static/js/agency.js
Normal file
@@ -0,0 +1,82 @@
|
||||
// Smooth scrolling via animate()
|
||||
$(document).ready(function(){
|
||||
if ($('.g-recaptcha')) {
|
||||
checkReCaptcha()
|
||||
}
|
||||
|
||||
$("a").on('click', function(event) {
|
||||
if (this.hash && window.location.pathname == "/") {
|
||||
event.preventDefault();
|
||||
var hash = this.hash;
|
||||
$('html, body').animate({
|
||||
scrollTop: $(hash).offset().top
|
||||
}, 800, function(){
|
||||
window.location.hash = hash;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Navigation change on scroll
|
||||
var maxOffset = 50;
|
||||
$(window).scroll(function() {
|
||||
if ($(window).scrollTop() >= maxOffset) {
|
||||
$('.navbar-default').addClass('navbar-shrink');
|
||||
}
|
||||
else {
|
||||
$('.navbar-default').removeClass('navbar-shrink');
|
||||
}
|
||||
});
|
||||
|
||||
var maxOffset = 50;
|
||||
if ($(window).scrollTop() >= maxOffset) {
|
||||
$('.navbar-default').addClass('navbar-shrink');
|
||||
}
|
||||
else {
|
||||
$('.navbar-default').removeClass('navbar-shrink');
|
||||
}
|
||||
});
|
||||
|
||||
// Highlight the top nav as scrolling occurs
|
||||
$('body').scrollspy({
|
||||
target: '.navbar-fixed-top'
|
||||
})
|
||||
|
||||
// Closes the Responsive Menu on Menu Item Click
|
||||
$('.navbar-collapse ul li a').click(function() {
|
||||
$('.navbar-toggle:visible').click();
|
||||
});
|
||||
|
||||
// Async contact form
|
||||
$('form[id=contactForm]').submit(function(){
|
||||
$.post($(this).attr('action'), $(this).serialize(), function(data, textStatus, jqXHR){
|
||||
$('form[id=contactForm] #success').hide();
|
||||
$('form[id=contactForm] #error').hide();
|
||||
if (jqXHR.status == 200) {
|
||||
$('form[id=contactForm] #success').show();
|
||||
}}, 'json').fail(function(){
|
||||
$('form[id=contactForm] #success').hide();
|
||||
$('form[id=contactForm] #error').hide();
|
||||
$('form[id=contactForm] #error').show();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// Contact form validation
|
||||
//$.validate({
|
||||
// modules : 'html5, toggleDisabled'
|
||||
//});
|
||||
|
||||
function onContactCaptcha($form) {
|
||||
$('form#contactForm').submit();
|
||||
}
|
||||
|
||||
function checkReCaptcha() {
|
||||
if (typeof grecaptcha === "undefined") {
|
||||
$('.captcha-error').show();
|
||||
setTimeout(checkReCaptcha, 200);
|
||||
} else {
|
||||
$('.captcha-error').hide();
|
||||
$('.g-recaptcha-filler').hide();
|
||||
$('.g-recaptcha').attr('disabled', true);
|
||||
}
|
||||
}
|
||||
2377
themes/hugo-agency-theme/static/js/bootstrap-v3.3.7/bootstrap.js
vendored
Normal file
2377
themes/hugo-agency-theme/static/js/bootstrap-v3.3.7/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
themes/hugo-agency-theme/static/js/bootstrap-v3.3.7/bootstrap.min.js
vendored
Normal file
7
themes/hugo-agency-theme/static/js/bootstrap-v3.3.7/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10220
themes/hugo-agency-theme/static/js/jquery-v3.3.1/jquery.js
vendored
Normal file
10220
themes/hugo-agency-theme/static/js/jquery-v3.3.1/jquery.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
themes/hugo-agency-theme/static/js/jquery-v3.3.1/jquery.min.js
vendored
Normal file
4
themes/hugo-agency-theme/static/js/jquery-v3.3.1/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
|
||||
/** File generated by Grunt -- do not modify
|
||||
* JQUERY-FORM-VALIDATOR
|
||||
*
|
||||
* @version 2.3.49
|
||||
* @website http://formvalidator.net/
|
||||
* @author Victor Jonsson, http://victorjonsson.se
|
||||
* @license MIT
|
||||
*/
|
||||
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(a){"use strict";var b="placeholder"in document.createElement("INPUT"),c="options"in document.createElement("DATALIST"),d=!1,e=function(e){e.each(function(){var e=a(this),f=e.find("input,textarea,select"),g=!1;f.each(function(){var b=[],e=a(this),f=e.attr("required"),h={};switch(f&&b.push("required"),(e.attr("type")||"").toLowerCase()){case"time":b.push("time"),a.formUtils.validators.validate_date||d||(d=!0,a.formUtils.loadModules("date"));break;case"url":b.push("url");break;case"email":b.push("email");break;case"date":b.push("date");break;case"number":b.push("number");var i=e.attr("max"),j=e.attr("min"),k=e.attr("step");j||i?(j||(j="0"),i||(i="9007199254740992"),k||(k="1"),h["data-validation-allowing"]="range["+j+";"+i+"]",0!==j.indexOf("-")&&0!==i.indexOf("-")||(h["data-validation-allowing"]+=",negative"),(j.indexOf(".")>-1||i.indexOf(".")>-1||k.indexOf(".")>-1)&&(h["data-validation-allowing"]+=",float")):h["data-validation-allowing"]+=",float,negative"}if(e.attr("pattern")&&(b.push("custom"),h["data-validation-regexp"]=e.attr("pattern")),e.attr("maxlength")&&(b.push("length"),h["data-validation-length"]="max"+e.attr("maxlength")),!c&&e.attr("list")){var l=[],m=a("#"+e.attr("list"));if(m.find("option").each(function(){l.push(a(this).text())}),0===l.length){var n=a.trim(a("#"+e.attr("list")).text()).split("\n");a.each(n,function(b,c){l.push(a.trim(c))})}m.remove(),a.formUtils.suggest(e,l)}if(b.length){f||(h["data-validation-optional"]="true"),g=!0;var o=(e.attr("data-validation")||"")+" "+b.join(" ");e.attr("data-validation",a.trim(o)),a.each(h,function(a,b){e.attr(a,b)})}}),g&&e.trigger("html5ValidationAttrsFound"),b||f.filter("input[placeholder]").each(function(){this.__defaultValue=this.getAttribute("placeholder"),a(this).bind("focus",function(){this.value===this.__defaultValue&&(this.value="",a(this).removeClass("showing-placeholder"))}).bind("blur",function(){""===a.trim(this.value)&&(this.value=this.__defaultValue,a(this).addClass("showing-placeholder"))})})})};a.formUtils.$win.bind("validatorsLoaded formValidationSetup",function(b,c){c||(c=a("form")),e(c)}),a.formUtils.setupValidationUsingHTML5Attr=e}(a,window)});
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
|
||||
/** File generated by Grunt -- do not modify
|
||||
* JQUERY-FORM-VALIDATOR
|
||||
*
|
||||
* @version 2.3.49
|
||||
* @website http://formvalidator.net/
|
||||
* @author Victor Jonsson, http://victorjonsson.se
|
||||
* @license MIT
|
||||
*/
|
||||
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(a,b,c){"use strict";var d=function(a,b){"disabled"===b?a.find('*[type="submit"]').addClass("disabled").attr("disabled","disabled"):a.find('*[type="submit"]').removeClass("disabled").removeAttr("disabled")},e=!1;a.formUtils.$win.bind("validatorsLoaded formValidationSetup",function(b,f,g){var h=g.disabledFormFilter?f.filter(g.disabledFormFilter):f,i=g.showErrorDialogs===c||g.showErrorDialogs,j=function(b,c,d){var e=a(this);d.indexOf("blur")>-1?e.unbind("afterValidation",j):c.isValid?e.unbind("afterValidation",j):e.valAttr("have-been-blurred")||(c.shouldChangeDisplay=!1)};h.addClass(i?"disabled-with-errors":"disabled-without-errors").find("*[data-validation]").valAttr("event","keyup change").on("validation",function(b,c){if(!e){e=!0;var f=a(this).closest("form");c&&f.isValid(g.language,g,!1)?d(f,"enabled"):d(f,"disabled"),e=!1}}).on("afterValidation",j).on("blur",function(){a(this).valAttr("have-been-blurred",1)}),d(h,"disabled"),h.validateOnEvent(g.language,g)}).on("validationErrorDisplay",function(a,b,c){b.closest("form").hasClass("disabled-without-errors")&&c.hide()})}(a,window)});
|
||||
Reference in New Issue
Block a user