2017-11-22 19:13:00 -05:00

15 lines
6.2 KiB
JavaScript

var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,e,d){c instanceof String&&(c=String(c));for(var a=c.length,f=0;f<a;f++){var h=c[f];if(e.call(d,h,f,c))return{i:f,v:h}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,e,d){c!=Array.prototype&&c!=Object.prototype&&(c[e]=d.value)};
$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(c,e,d,a){if(e){d=$jscomp.global;c=c.split(".");for(a=0;a<c.length-1;a++){var f=c[a];f in d||(d[f]={});d=d[f]}c=c[c.length-1];a=d[c];e=e(a);e!=a&&null!=e&&$jscomp.defineProperty(d,c,{configurable:!0,writable:!0,value:e})}};
$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,d){return $jscomp.findInternal(this,c,d).v}},"es6","es3");
(function(c){c.fn.navList=function(){$a=c(this).find("a");b=[];$a.each(function(){var e=c(this),d=Math.max(0,e.parents("li").length-1),a=e.attr("href"),f=e.attr("target");b.push('<a class="link depth-'+d+'"'+("undefined"!==typeof f&&""!=f?' target="'+f+'"':"")+("undefined"!==typeof a&&""!=a?' href="'+a+'"':"")+'><span class="indent-'+d+'"></span>'+e.text()+"</a>")});return b.join("")};c.fn.panel=function(e){if(0==this.length)return a;if(1<this.length){for(var d=0;d<this.length;d++)c(this[d]).panel(e);
return a}var a=c(this);d=c("body");var f=c(window),h=a.attr("id");var g=c.extend({delay:0,hideOnClick:!1,hideOnEscape:!1,hideOnSwipe:!1,resetScroll:!1,resetForms:!1,side:null,target:a,visibleClass:"visible"},e);"jQuery"!=typeof g.target&&(g.target=c(g.target));a._hide=function(c){g.target.hasClass(g.visibleClass)&&(c&&(c.preventDefault(),c.stopPropagation()),g.target.removeClass(g.visibleClass),window.setTimeout(function(){g.resetScroll&&a.scrollTop(0);g.resetForms&&a.find("form").each(function(){this.reset()})},
g.delay))};a.css("-ms-overflow-style","-ms-autohiding-scrollbar").css("-webkit-overflow-scrolling","touch");g.hideOnClick&&(a.find("a").css("-webkit-tap-highlight-color","rgba(0,0,0,0)"),a.on("click","a",function(f){var d=c(this),e=d.attr("href"),k=d.attr("target");e&&"#"!=e&&""!=e&&e!="#"+h&&(f.preventDefault(),f.stopPropagation(),a._hide(),window.setTimeout(function(){"_blank"==k?window.open(e):window.location.href=e},g.delay+10))}));a.on("touchstart",function(c){a.touchPosX=c.originalEvent.touches[0].pageX;
a.touchPosY=c.originalEvent.touches[0].pageY});a.on("touchmove",function(c){if(null!==a.touchPosX&&null!==a.touchPosY){var f=a.touchPosX-c.originalEvent.touches[0].pageX,d=a.touchPosY-c.originalEvent.touches[0].pageY,e=a.outerHeight(),h=a.get(0).scrollHeight-a.scrollTop();if(g.hideOnSwipe){var k=!1;switch(g.side){case "left":k=20>d&&-20<d&&50<f;break;case "right":k=20>d&&-20<d&&-50>f;break;case "top":k=20>f&&-20<f&&50<d;break;case "bottom":k=20>f&&-20<f&&-50>d}if(k)return a.touchPosX=null,a.touchPosY=
null,a._hide(),!1}if(0>a.scrollTop()&&0>d||h>e-2&&h<e+2&&0<d)c.preventDefault(),c.stopPropagation()}});a.on("click touchend touchstart touchmove",function(a){a.stopPropagation()});a.on("click",'a[href="#'+h+'"]',function(a){a.preventDefault();a.stopPropagation();g.target.removeClass(g.visibleClass)});d.on("click touchend",function(c){a._hide(c)});d.on("click",'a[href="#'+h+'"]',function(a){a.preventDefault();a.stopPropagation();g.target.toggleClass(g.visibleClass)});if(g.hideOnEscape)f.on("keydown",
function(c){27==c.keyCode&&a._hide(c)});return a};c.fn.placeholder=function(){if("undefined"!=typeof document.createElement("input").placeholder)return c(this);if(0==this.length)return d;if(1<this.length){for(var e=0;e<this.length;e++)c(this[e]).placeholder();return d}var d=c(this);d.find("input[type=text],textarea").each(function(){var a=c(this);""!=a.val()&&a.val()!=a.attr("placeholder")||a.addClass("polyfill-placeholder").val(a.attr("placeholder"))}).on("blur",function(){var a=c(this);a.attr("name").match(/-polyfill-field$/)||
""==a.val()&&a.addClass("polyfill-placeholder").val(a.attr("placeholder"))}).on("focus",function(){var a=c(this);a.attr("name").match(/-polyfill-field$/)||a.val()==a.attr("placeholder")&&a.removeClass("polyfill-placeholder").val("")});d.find("input[type=password]").each(function(){var a=c(this),f=c(c("<div>").append(a.clone()).remove().html().replace(/type="password"/i,'type="text"').replace(/type=password/i,"type=text"));""!=a.attr("id")&&f.attr("id",a.attr("id")+"-polyfill-field");""!=a.attr("name")&&
f.attr("name",a.attr("name")+"-polyfill-field");f.addClass("polyfill-placeholder").val(f.attr("placeholder")).insertAfter(a);""==a.val()?a.hide():f.hide();a.on("blur",function(c){c.preventDefault();c=a.parent().find("input[name="+a.attr("name")+"-polyfill-field]");""==a.val()&&(a.hide(),c.show())});f.on("focus",function(a){a.preventDefault();a=f.parent().find("input[name="+f.attr("name").replace("-polyfill-field","")+"]");f.hide();a.show().focus()}).on("keypress",function(a){a.preventDefault();f.val("")})});
d.on("submit",function(){d.find("input[type=text],input[type=password],textarea").each(function(a){a=c(this);a.attr("name").match(/-polyfill-field$/)&&a.attr("name","");a.val()==a.attr("placeholder")&&(a.removeClass("polyfill-placeholder"),a.val(""))})}).on("reset",function(a){a.preventDefault();d.find("select").val(c("option:first").val());d.find("input,textarea").each(function(){var a=c(this);a.removeClass("polyfill-placeholder");switch(this.type){case "submit":case "reset":break;case "password":a.val(a.attr("defaultValue"));
var d=a.parent().find("input[name="+a.attr("name")+"-polyfill-field]");""==a.val()?(a.hide(),d.show()):(a.show(),d.hide());break;case "checkbox":case "radio":a.attr("checked",a.attr("defaultValue"));break;case "text":case "textarea":a.val(a.attr("defaultValue"));""==a.val()&&(a.addClass("polyfill-placeholder"),a.val(a.attr("placeholder")));break;default:a.val(a.attr("defaultValue"))}})});return d};c.prioritize=function(e,d){"jQuery"!=typeof e&&(e=c(e));e.each(function(){var a=c(this),f=a.parent();
if(0!=f.length)if(a.data("__prioritize")){if(!d){var e=a.data("__prioritize");a.insertAfter(e);a.removeData("__prioritize")}}else d&&(e=a.prev(),0!=e.length&&(a.prependTo(f),a.data("__prioritize",e)))})}})(jQuery);