/* skelJS v0.4.4-dev | (c) n33 | skeljs.org | MIT licensed */ skel.registerPlugin("panels",function(){var b={config:{baseZIndex:1E4,useTransform:!0,transformBreakpoints:null,speed:250,panels:{},overlays:{}},cache:{panels:{},overlays:{},body:null,window:null,pageWrapper:null,defaultWrapper:null,fixedWrapper:null,activePanel:null},eventType:"click",positions:{panels:{top:["top","left"],right:["top","right"],bottom:["bottom","left"],left:["top","left"]},overlays:{"top-left":{top:0,left:0},"top-right":{top:0,right:0},top:{top:0,left:"50%"},"top-center":{top:0,left:"50%"}, "bottom-left":{bottom:0,left:0},"bottom-right":{bottom:0,right:0},bottom:{bottom:0,left:"50%"},"bottom-center":{bottom:0,left:"50%"},left:{top:"50%",left:0},"middle-left":{top:"50%",left:0},right:{top:"50%",right:0},"middle-right":{top:"50%",right:0}}},presets:{standard:{panels:{navPanel:{breakpoints:"mobile",position:"left",style:"push",size:"80%",html:'
'}},overlays:{titleBar:{breakpoints:"mobile",position:"top-left",width:"100%",height:44,html:''}}}}, defaults:{config:{panel:{breakpoints:"",position:null,style:null,size:"80%",html:"",resetScroll:!0,resetForms:!0,swipeToClose:!0},overlay:{breakpoints:"",position:null,width:0,height:0,html:""}}},recalcW:function(b){var c=parseInt(b);"string"==typeof b&&"%"==b.charAt(b.length-1)&&(c=Math.floor(jQuery(window).width()*(c/100)));return c},recalcH:function(b){var c=parseInt(b);"string"==typeof b&&"%"==b.charAt(b.length-1)&&(c=Math.floor(jQuery(window).height()*(c/100)));return c},getHalf:function(b){var c= parseInt(b);return"string"==typeof b&&"%"==b.charAt(b.length-1)?Math.floor(c/2)+"%":Math.floor(c/2)+"px"},parseSuspend:function(b){b=b.get(0);b._skel_panels_suspend&&b._skel_panels_suspend()},parseResume:function(b){b=b.get(0);b._skel_panels_resume&&b._skel_panels_resume()},parseInit:function(e){var c,d;c=e.get(0);var h=e.attr("data-action"),f=e.attr("data-args"),g,l;h&&f&&(f=f.split(","));switch(h){case "togglePanel":case "panelToggle":e.css("-webkit-tap-highlight-color","rgba(0,0,0,0)").css("cursor", "pointer");c=function(c){c.preventDefault();c.stopPropagation();if(b.cache.activePanel)return b.cache.activePanel._skel_panels_close(),!1;jQuery(this);c=b.cache.panels[f[0]];c.is(":visible")?c._skel_panels_close():c._skel_panels_open()};"android"==b._.vars.deviceType?e.bind("click",c):e.bind(b.eventType,c);break;case "navList":g=jQuery("#"+f[0]);c=g.find("a");d=[];c.each(function(){var b=jQuery(this),c;c=Math.max(0,b.parents("li").length-1);d.push(''+b.text()+"")});0"+d.join("")+"");e.find(".link").css("cursor","pointer").css("display","block");break;case "copyText":g=jQuery("#"+f[0]);e.html(g.text());break;case "copyHTML":g=jQuery("#"+f[0]);e.html(g.html());break;case "moveElementContents":g=jQuery("#"+f[0]);c._skel_panels_resume=function(){g.children().each(function(){e.append(jQuery(this))})};c._skel_panels_suspend=function(){e.children().each(function(){g.append(jQuery(this))})}; c._skel_panels_resume();break;case "moveElement":g=jQuery("#"+f[0]);c._skel_panels_resume=function(){jQuery('
').insertBefore(g);e.append(g)};c._skel_panels_suspend=function(){jQuery("#skel-panels-tmp-"+g.attr("id")).replaceWith(g)};c._skel_panels_resume();break;case "moveCell":g=jQuery("#"+f[0]),l=jQuery("#"+f[1]),c._skel_panels_resume=function(){jQuery('
').insertBefore(g);e.append(g);g.css("width","auto");l&& l._skel_panels_expandCell()},c._skel_panels_suspend=function(){jQuery("#skel-panels-tmp-"+g.attr("id")).replaceWith(g);g.css("width","");l&&l.css("width","")},c._skel_panels_resume()}},lockView:function(e){b.cache.window._skel_panels_scrollPos=b.cache.window.scrollTop();b._.vars.isTouch&&b.cache.body.css("overflow-"+e,"hidden");b.cache.pageWrapper.bind("touchstart.lock",function(c){c.preventDefault();c.stopPropagation();b.cache.activePanel&&b.cache.activePanel._skel_panels_close()});b.cache.pageWrapper.bind("click.lock", function(c){c.preventDefault();c.stopPropagation();b.cache.activePanel&&b.cache.activePanel._skel_panels_close()});b.cache.pageWrapper.bind("scroll.lock",function(c){c.preventDefault();c.stopPropagation();b.cache.activePanel&&b.cache.activePanel._skel_panels_close()});b.cache.window.bind("orientationchange.lock",function(c){b.cache.activePanel&&b.cache.activePanel._skel_panels_close()});b._.vars.isTouch||(b.cache.window.bind("resize.lock",function(c){b.cache.activePanel&&b.cache.activePanel._skel_panels_close()}), b.cache.window.bind("scroll.lock",function(c){b.cache.activePanel&&b.cache.activePanel._skel_panels_close()}))},unlockView:function(e){b._.vars.isTouch&&b.cache.body.css("overflow-"+e,"visible");b.cache.pageWrapper.unbind("touchstart.lock");b.cache.pageWrapper.unbind("click.lock");b.cache.pageWrapper.unbind("scroll.lock");b.cache.window.unbind("orientationchange.lock");b._.vars.isTouch||(b.cache.window.unbind("resize.lock"),b.cache.window.unbind("scroll.lock"))},resumeElement:function(e){b.cache[e.type+ "s"][e.id].find("*").each(function(){b.parseResume(jQuery(this))})},suspendElement:function(e){e=b.cache[e.type+"s"][e.id];e._skel_panels_translateOrigin();e.find("*").each(function(){b.parseSuspend(jQuery(this))})},initElement:function(e){var c=e.config,d=jQuery(e.object),h;b.cache[e.type+"s"][e.id]=d;d._skel_panels_init();d.find("*").each(function(){b.parseInit(jQuery(this))});switch(e.type){case "panel":d.addClass("skel-panels-panel").css("z-index",b.config.baseZIndex).css("position","fixed").hide(); d.find("a").css("-webkit-tap-highlight-color","rgba(0,0,0,0)").bind("click.skel-panels",function(c){var d=jQuery(this);if(b.cache.activePanel&&!d.hasClass("skel-panels-ignore")){c.preventDefault();c.stopPropagation();var e=d.attr("href");b.cache.activePanel._skel_panels_close();d.hasClass("skel-panels-ignoreHref")||window.setTimeout(function(){window.location.href=e},b.config.speed+10)}});"ios"==b._.vars.deviceType&&d.find("input,select,textarea").focus(function(c){var d=jQuery(this);c.preventDefault(); c.stopPropagation();window.setTimeout(function(){var c=b.cache.window._skel_panels_scrollPos,g=b.cache.window.scrollTop()-c;b.cache.window.scrollTop(c);b.cache.activePanel.scrollTop(b.cache.activePanel.scrollTop()+g);d.hide();window.setTimeout(function(){d.show()},0)},100)});switch(c.position){case "top":case "bottom":var f="bottom"==c.position?"-":"";d.addClass("skel-panels-panel-"+c.position).data("skel-panels-panel-position",c.position).css("height",b.recalcH(c.size)).scrollTop(0);b._.vars.isTouch? d.css("overflow-y","scroll").css("-webkit-overflow-scrolling","touch").bind("touchstart",function(b){d._posY=b.originalEvent.touches[0].pageY;d._posX=b.originalEvent.touches[0].pageX}).bind("touchmove",function(b){b=d._posY-b.originalEvent.touches[0].pageY;var c=d.outerHeight(),e=d.get(0).scrollHeight-d.scrollTop();if(0==d.scrollTop()&&0>b||e>c-2&&eb&&-20e))return d._skel_panels_close(),!1;if(0==d.scrollTop()&&0>b||h>f-2&&hd?b.cache.pageWrapper.css("padding-bottom",Math.abs(d)):l=function(){b.cache.pageWrapper.css("padding-bottom",0)};for(h=0;h');b.cache.pageWrapper=jQuery("#skel-panels-pageWrapper");b.cache.pageWrapper.css("position","relative").css("left","0").css("right","0").css("top","0")._skel_panels_init(); b.cache.defaultWrapper=jQuery('
').appendTo(b.cache.body);b.cache.defaultWrapper.css("height","100%");b.cache.fixedWrapper=jQuery('
').appendTo(b.cache.body);b.cache.fixedWrapper.css("position","relative");jQuery(".skel-panels-fixed").appendTo(b.cache.fixedWrapper);b._.registerLocation("skel_panels_defaultWrapper",b.cache.defaultWrapper[0]);b._.registerLocation("skel_panels_fixedWrapper",b.cache.fixedWrapper[0]);b._.registerLocation("skel_panels_pageWrapper", b.cache.pageWrapper[0]);$("[autofocus]").focus()})},initIncludes:function(){b._.DOMReady(function(){jQuery(".skel-panels-include").each(function(){b.parseInit(jQuery(this))})})},init:function(){b.eventType=b._.vars.isTouch?"touchend":"click";"android"==b._.vars.deviceType&&4>b._.vars.deviceVersion&&(b.config.useTransform=!1);b.initObjects();b.initJQueryUtilityFuncs();b.initElements("overlay");b.initElements("panel");b.initIncludes();b._.updateState()}};return b}());