Template:Biomod/2013/Sendai/sandbox3/skel-panels.min.js

From OpenWetWare
Jump to: navigation, search

<html> <head> <script>


/* skelJS v0.3.6 | (c) n33 | skeljs.org | MIT licensed */skel.registerPlugin("panels",function(){var a={config:{baseZIndex:1E4,speed:250,panels:{},overlays:{}},cache:{panels:{},overlays:{},body:null,window:null,pageWrapper:null,defaultWrapper:null,fixedWrapper:null,activePanel:null},deviceType:null,eventType:"click",isTouch:!1,presets:{standard:{panels:{navPanel:{breakpoints:"mobile",position:"left",style:"push",size:"80%",html:'<div data-action="navList" data-args="nav"></div>'}},overlays:{titleBar:{breakpoints:"mobile",position:"top-left",width:"100%",height:44,html:'<span class="toggle" data-action="togglePanel" data-args="navPanel"></span><span class="title" data-action="copyHTML" data-args="logo"></span>'}}}},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(a){var b=parseInt(a);"string"==typeof a&&"%"==a.charAt(a.length-1)&&(b=Math.floor(jQuery(window).width()*(b/100)));return b},recalcH:function(a){var b=parseInt(a);"string"==typeof a&&"%"==a.charAt(a.length-1)&&(b=Math.floor(jQuery(window).height()*(b/100)));return b},getHalf:function(a){var b=parseInt(a);return"string"==typeof a&&"%"==a.charAt(a.length-1)?Math.floor(b/2)+"%":Math.floor(b/2)+"px"},parseSuspend:function(a){a=a.get(0);a.suspend_skel&&a.suspend_skel()},parseResume:function(a){a=a.get(0);a.resume_skel&&a.resume_skel()},parseInit:function(d){var b,c;b=d.get(0);var h=d.attr("data-action"),g=d.attr("data-args"),e,f;h&&g&&(g=g.split(","));switch(h){case "togglePanel":case "panelToggle":d.css("-webkit-tap-highlight-color","rgba(0,0,0,0)").css("cursor","pointer");b=function(b){b.preventDefault();b.stopPropagation();if(a.cache.activePanel)return a.cache.activePanel.close_skel(),!1;jQuery(this);b=a.cache.panels[g[0]];b.is(":visible")?b.close_skel():b.open_skel()};"android"==a.deviceType?d.bind("click",b):d.bind(a.eventType,b);break;case "navList":e=jQuery("#"+g[0]);b=e.find("a");c=[];b.each(function(){var a=jQuery(this),b;b=Math.max(0,a.parents("li").length-1);c.push('<a class="link depth-'+b+'" href="'+a.attr("href")+'"><span class="indent-'+b+'"></span>'+a.text()+"</a>")});0<c.length&&d.html("<nav>"+c.join("")+"</nav>");d.find(".link").css("cursor","pointer").css("display","block");break;case "copyText":e=jQuery("#"+g[0]);d.html(e.text());break;case "copyHTML":e=jQuery("#"+g[0]);d.html(e.html());break;case "moveElementContents":e=jQuery("#"+g[0]);b.resume_skel=function(){e.children().each(function(){d.append(jQuery(this))})};b.suspend_skel=function(){d.children().each(function(){e.append(jQuery(this))})};b.resume_skel();break;case "moveElement":e=jQuery("#"+g[0]);b.resume_skel=function(){jQuery('<div id="skel-panels-tmp-'+e.attr("id")+'" />').insertBefore(e);d.append(e)};b.suspend_skel=function(){jQuery("#skel-panels-tmp-"+e.attr("id")).replaceWith(e)};b.resume_skel();break;case "moveCell":e=jQuery("#"+g[0]),f=jQuery("#"+g[1]),b.resume_skel=function(){jQuery('<div id="skel-panels-tmp-'+e.attr("id")+'" />').insertBefore(e);d.append(e);e.css("width","auto");f&&f.expandCell_skel()},b.suspend_skel=function(){jQuery("#skel-panels-tmp-"+e.attr("id")).replaceWith(e);e.css("width","");f&&f.css("width","")},b.resume_skel()}},lockView:function(d){a.cache.window.scrollPos_skel=a.cache.window.scrollTop();a.isTouch&&a.cache.body.css("overflow-"+d,"hidden");a.cache.pageWrapper.bind("touchstart.lock",function(b){b.preventDefault();b.stopPropagation();a.cache.activePanel&&a.cache.activePanel.close_skel()});a.cache.pageWrapper.bind("click.lock",function(b){b.preventDefault();b.stopPropagation();a.cache.activePanel&&a.cache.activePanel.close_skel()});a.cache.pageWrapper.bind("scroll.lock",function(b){b.preventDefault();b.stopPropagation();a.cache.activePanel&&a.cache.activePanel.close_skel()});a.cache.window.bind("orientationchange.lock",function(b){a.cache.activePanel&&a.cache.activePanel.close_skel()});a.isTouch||(a.cache.window.bind("resize.lock",function(b){a.cache.activePanel&&a.cache.activePanel.close_skel()}),a.cache.window.bind("scroll.lock",function(b){a.cache.activePanel&&a.cache.activePanel.close_skel()}))},unlockView:function(d){a.isTouch&&a.cache.body.css("overflow-"+d,"visible");a.cache.pageWrapper.unbind("touchstart.lock");a.cache.pageWrapper.unbind("click.lock");a.cache.pageWrapper.unbind("scroll.lock");a.cache.window.unbind("orientationchange.lock");a.isTouch||(a.cache.window.unbind("resize.lock"),a.cache.window.unbind("scroll.lock"))},resumeElement:function(d){a.cache[d.type+"s"][d.id].find("*").each(function(){a.parseResume(jQuery(this))})},suspendElement:function(d){d=a.cache[d.type+"s"][d.id];d.css("transform","translate(0,0)");d.find("*").each(function(){a.parseSuspend(jQuery(this))})},initElement:function(d){var b=d.config,c=jQuery(d.object);a.cache[d.type+"s"][d.id]=c;c.applyTransition_skel().accelerate_skel();c.find("*").each(function(){a.parseInit(jQuery(this))});switch(d.type){case "panel":c.addClass("skel-panels-panel").css("z-index",a.config.baseZIndex).css("position","fixed").hide();c.find("a").css("-webkit-tap-highlight-color","rgba(0,0,0,0)").bind("click.skel-panels",function(b){if(a.cache.activePanel){b.preventDefault();b.stopPropagation();var c=jQuery(this).attr("href");a.cache.activePanel.close_skel();window.setTimeout(function(){window.location.href=c},a.config.speed+10)}});"ios"==a.deviceType&&c.find("input,select,textarea").focus(function(b){var c=jQuery(this);b.preventDefault();b.stopPropagation();window.setTimeout(function(){var b=a.cache.window.scrollPos_skel,d=a.cache.window.scrollTop()-b;a.cache.window.scrollTop(b);a.cache.activePanel.scrollTop(a.cache.activePanel.scrollTop()+d);c.hide();window.setTimeout(function(){c.show()},0)},100)});switch(b.position){case "top":case "bottom":var h="bottom"==b.position?"-":"";c.addClass("skel-panels-panel-"+b.position).css("height",a.recalcH(b.size)).scrollTop(0);a.isTouch?c.css("overflow-y","scroll").css("-webkit-overflow-scrolling","touch").bind("touchstart",function(a){c._posY=a.originalEvent.touches[0].pageY;c._posX=a.originalEvent.touches[0].pageX}).bind("touchmove",function(a){a=c._posY-a.originalEvent.touches[0].pageY;var b=c.outerHeight(),d=c.get(0).scrollHeight-c.scrollTop();if(0==c.scrollTop()&&0>a||d>b-2&&d<b+2&&0<a)return!1}):c.css("overflow-y","auto");switch(b.style){default:c.open_skel=function(){c.promote_skel().scrollTop(0).css("left","0px").css(b.position,"-"+a.recalcH(b.size)+"px").css("height",a.recalcH(b.size)).css("width","100%").show();b.resetScroll&&c.scrollTop(0);b.resetForms&&c.resetForms_skel();a.lockView("y");window.setTimeout(function(){c.add(a.cache.fixedWrapper.children()).add(a.cache.pageWrapper).css("transform","translate(0px,"+h+a.recalcH(b.size)+"px)");a.cache.activePanel=c},100)},c.close_skel=function(){c.find("*").blur();c.add(a.cache.pageWrapper).add(a.cache.fixedWrapper.children()).css("transform","translate(0px,0px)");window.setTimeout(function(){a.unlockView("y");c.demote_skel().hide();a.cache.activePanel=null},a.config.speed+50)}}break;case "left":case "right":switch(h="right"==b.position?"-":"",c.addClass("skel-panels-panel-"+b.position).css("width",a.recalcW(b.size)).scrollTop(0),a.isTouch?c.css("overflow-y","scroll").css("-webkit-overflow-scrolling","touch").bind("touchstart",function(a){c._posY=a.originalEvent.touches[0].pageY;c._posX=a.originalEvent.touches[0].pageX}).bind("touchmove",function(a){var d=c._posX-a.originalEvent.touches[0].pageX;a=c._posY-a.originalEvent.touches[0].pageY;var f=c.outerHeight(),h=c.get(0).scrollHeight-c.scrollTop();if(b.swipeToClose&&20>a&&-20<a&&("left"==b.position&&50<d||"right"==b.position&&-50>d))return c.close_skel(),!1;if(0==c.scrollTop()&&0>a||h>f-2&&h<f+2&&0<a)return!1}):c.css("overflow-y","auto"),b.style){default:c.open_skel=function(){c.promote_skel().scrollTop(0).css("top","0px").css(b.position,"-"+a.recalcW(b.size)+"px").css("width",a.recalcW(b.size)).css("height","100%").show();b.resetScroll&&c.scrollTop(0);b.resetForms&&c.resetForms_skel();a.lockView("x");window.setTimeout(function(){c.add(a.cache.fixedWrapper.children()).add(a.cache.pageWrapper).css("transform","translate("+h+a.recalcW(b.size)+"px,0px)");a.cache.activePanel=c},100)};c.close_skel=function(){c.find("*").blur();c.add(a.cache.fixedWrapper.children()).add(a.cache.pageWrapper).css("transform","translate(0px,0px)");window.setTimeout(function(){a.unlockView("x");c.demote_skel().hide();a.cache.activePanel=null},a.config.speed+50)};break;case "reveal":c.open_skel=function(){a.cache.fixedWrapper.promote_skel(2);a.cache.pageWrapper.promote_skel(1);c.scrollTop(0).css("top","0px").css(b.position,"0px").css("width",a.recalcW(b.size)).css("height","100%").show();b.resetScroll&&c.scrollTop(0);b.resetForms&&c.resetForms_skel();a.lockView("x");window.setTimeout(function(){a.cache.pageWrapper.add(a.cache.fixedWrapper.children()).css("transform","translate("+h+a.recalcW(b.size)+"px,0px)");a.cache.activePanel=c},100)},c.close_skel=function(){c.find("*").blur();a.cache.pageWrapper.add(a.cache.fixedWrapper.children()).css("transform","translate(0px,0px)");window.setTimeout(function(){a.unlockView("x");c.hide();a.cache.pageWrapper.demote_skel();a.cache.pageWrapper.demote_skel();a.cache.activePanel=null},a.config.speed+50)}}}break;case "overlay":switch(c.css("z-index",a.config.baseZIndex).css("position","fixed").addClass("skel-panels-overlay"),c.css("width",b.width).css("height",b.height),b.position){default:c.addClass("skel-panels-overlay-top-left").css("top",0).css("left",0);break;case "top-right":c.addClass("skel-panels-overlay-top-right").css("top",0).css("right",0);break;case "top":case "top-center":c.addClass("skel-panels-overlay-top-center").css("top",0).css("left","50%").css("margin-left","-"+a.getHalf(b.width));break;case "bottom-left":c.addClass("skel-panels-overlay-bottom-left").css("bottom",0).css("left",0);break;case "bottom":case "bottom-center":c.addClass("skel-panels-overlay-bottom-center").css("bottom",0).css("left","50%").css("margin-left","-"+a.getHalf(b.width));break;case "bottom-right":c.addClass("skel-panels-overlay-bottom-right").css("bottom",0).css("right",0);break;case "left":case "middle-left":c.addClass("skel-panels-overlay-middle-left").css("top","50%").css("left",0).css("margin-top","-"+a.getHalf(b.height));break;case "right":case "middle-right":c.addClass("skel-panels-overlay-middle-left").css("top","50%").css("right",0).css("margin-top","-"+a.getHalf(b.height))}}},initElements:function(d){var b,c,h,g=[];a._.iterate(a.config[d+"s"],function(e){b={};a._.extend(b,a.defaults.config[d]);a._.extend(b,a.config[d+"s"][e]);a.config[d+"s"][e]=b;c=a._.newDiv(b.html);c.id=e;c.className="skel-panels-"+d;b.html||(g[e]=c);h=b.breakpoints?b.breakpoints.split(","):a._.breakpointList;a._.iterate(h,function(f){f=a._.cacheBreakpointElement(h[f],e,c,"overlay"==d?"skel_panels_fixedWrapper":"skel_panels_defaultWrapper",2);f.config=b;f.initialized=!1;f.type=d;f.onAttach=function(){this.initialized?a.resumeElement(this):(a.initElement(this),this.initialized=!0)};f.onDetach=function(){a.suspendElement(this)}})});a._.DOMReady(function(){var b,c;a._.iterate(g,function(a){b=jQuery("#"+a);c=jQuery(g[a]);b.children().appendTo(c);b.remove()})})},initJQueryUtilityFuncs:function(){jQuery.fn.promote_skel=function(d){this._zIndex=this.css("z-index");this.css("z-index",a.config.baseZIndex+(d?d:1));return this};jQuery.fn.demote_skel=function(){this._zIndex&&(this.css("z-index",this._zIndex),this._zIndex=null);return this};jQuery.fn.accelerate_skel=function(){return jQuery(this).css("backface-visibility","hidden").css("perspective","500")};jQuery.fn.xcssValue_skel=function(a,b){return jQuery(this).css(a,"-moz-"+b).css(a,"-webkit-"+b).css(a,"-o-"+b).css(a,"-ms-"+b).css(a,b)};jQuery.fn.xcssProperty_skel=function(a,b){return jQuery(this).css("-moz-"+a,b).css("-webkit-"+a,b).css("-o-"+a,b).css("-ms-"+a,b).css(a,b)};jQuery.fn.xcss_skel=function(a,b){return jQuery(this).css("-moz-"+a,"-moz-"+b).css("-webkit-"+a,"-webkit-"+b).css("-o-"+a,"-o-"+b).css("-ms-"+a,"-ms-"+b).css(a,b)};jQuery.fn.applyTransition_skel=function(){return jQuery(this).xcss_skel("transition","transform "+a.config.speed/1E3+"s ease-in-out")};jQuery.fn.clearTransition_skel=function(){return jQuery(this).xcss_skel("transition","none")};jQuery.fn.resetForms_skel=function(){var a=jQuery(this);jQuery(this).find("form").each(function(){this.reset()});return a};jQuery.fn.initialize_skel=function(){var a=jQuery(this);a.attr("class").match(/(\s+|^)([0-9]+)u(\s+|$)/)&&a.data("cell-size",parseInt(RegExp.$2))};jQuery.fn.expandCell_skel=function(){var a=jQuery(this),b=12;a.parent().children().each(function(){var a=$(this).attr("class");a&&a.match(/(\s+|^)([0-9]+)u(\s+|$)/)&&(b-=parseInt(RegExp.$2))});0<b&&(a.initialize_skel(),a.css("width",100*((a.data("cell-size")+b)/12)+"%"))}},initObjects:function(){a.cache.window=jQuery(window);a.cache.window.load(function(){0==a.cache.window.scrollTop()&&window.scrollTo(0,1)});a._.DOMReady(function(){a.cache.body=jQuery("body");a.cache.body.wrapInner('<div id="skel-panels-pageWrapper" />');a.cache.pageWrapper=jQuery("#skel-panels-pageWrapper");a.cache.pageWrapper.css("position","relative").css("left","0").css("right","0").css("top","0").css("bottom","0").applyTransition_skel().accelerate_skel();a.cache.defaultWrapper=jQuery('<div id="skel-panels-defaultWrapper" />').appendTo(a.cache.body);a.cache.defaultWrapper.css("height","100%");a.cache.fixedWrapper=jQuery('<div id="skel-panels-fixedWrapper" />').appendTo(a.cache.body);a.cache.fixedWrapper.css("position","relative");jQuery(".skel-panels-fixed").appendTo(a.cache.fixedWrapper);a._.registerLocation("skel_panels_defaultWrapper",a.cache.defaultWrapper[0]);a._.registerLocation("skel_panels_fixedWrapper",a.cache.fixedWrapper[0]);a._.registerLocation("skel_panels_pageWrapper",a.cache.pageWrapper[0])})},initDeviceType:function(){var d={ios:"(iPad|iPhone|iPod)",android:"Android"};a._.iterate(d,function(b){navigator.userAgent.match(RegExp(d[b],"g"))&&(a.deviceType=b)});a.deviceType||(a.deviceType="other");a.isTouch=!!("ontouchstart"in window);a.eventType=a.isTouch?"touchend":"click"},initIncludes:function(){a._.DOMReady(function(){jQuery(".skel-panels-include").each(function(){a.parseInit(jQuery(this))})})},init:function(){a.initDeviceType();a.initJQueryUtilityFuncs();a.initObjects();a.initElements("overlay");a.initElements("panel");a.initIncludes();a._.updateState()}};return a}());


</script> </head> </html>