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.
 
 
 

2 lines
14 KiB

var Wheeparam={version:"0.0.1",init:function(){},onDocuemntReady:function(e){(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)?e():document.addEventListener("DOMContentLoaded",e)}};Wheeparam.Easing={easeInQuad:function(e,t,r,n){return r*(e/=n)*e+t},easeOutQuad:function(e,t,r,n){return-r*(e/=n)*(e-2)+t},easeInOutQuad:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e+t:-r/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,r,n){return r*(e/=n)*e*e+t},easeOutCubic:function(e,t,r,n){return r*((e=e/n-1)*e*e+1)+t},easeInOutCubic:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,r,n){return r*(e/=n)*e*e*e+t},easeOutQuart:function(e,t,r,n){return-r*((e=e/n-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e*e*e+t:-r/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,r,n){return r*(e/=n)*e*e*e*e+t},easeOutQuint:function(e,t,r,n){return r*((e=e/n-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e*e*e*e+t:r/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,r,n){return-r*Math.cos(e/n*(Math.PI/2))+r+t},easeOutSine:function(e,t,r,n){return r*Math.sin(e/n*(Math.PI/2))+t},easeInOutSine:function(e,t,r,n){return-r/2*(Math.cos(Math.PI*e/n)-1)+t},easeInExpo:function(e,t,r,n){return 0==e?t:r*Math.pow(2,10*(e/n-1))+t},easeOutExpo:function(e,t,r,n){return e==n?t+r:r*(1-Math.pow(2,-10*e/n))+t},easeInOutExpo:function(e,t,r,n){return 0==e?t:e==n?t+r:(e/=n/2)<1?r/2*Math.pow(2,10*(e-1))+t:r/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,r,n){return-r*(Math.sqrt(1-(e/=n)*e)-1)+t},easeOutCirc:function(e,t,r,n){return r*Math.sqrt(1-(e=e/n-1)*e)+t},easeInOutCirc:function(e,t,r,n){return(e/=n/2)<1?-r/2*(Math.sqrt(1-e*e)-1)+t:r/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(e,t,r,n){var o=1.70158,a=0,i=r;if(0==e)return t;if(1==(e/=n))return t+r;if(a||(a=.3*n),i<Math.abs(r)){i=r;o=a/4}else o=a/(2*Math.PI)*Math.asin(r/i);return-i*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/a)+t},easeOutElastic:function(e,t,r,n){var o=1.70158,a=0,i=r;if(0==e)return t;if(1==(e/=n))return t+r;if(a||(a=.3*n),i<Math.abs(r)){i=r;o=a/4}else o=a/(2*Math.PI)*Math.asin(r/i);return i*Math.pow(2,-10*e)*Math.sin((e*n-o)*(2*Math.PI)/a)+r+t},easeInOutElastic:function(e,t,r,n){var o=1.70158,a=0,i=r;if(0==e)return t;if(2==(e/=n/2))return t+r;if(a||(a=n*(.3*1.5)),i<Math.abs(r)){i=r;o=a/4}else o=a/(2*Math.PI)*Math.asin(r/i);return e<1?i*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/a)*-.5+t:i*Math.pow(2,-10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/a)*.5+r+t},easeInBack:function(e,t,r,n,o){return null==o&&(o=1.70158),r*(e/=n)*e*((o+1)*e-o)+t},easeOutBack:function(e,t,r,n,o){return null==o&&(o=1.70158),r*((e=e/n-1)*e*((o+1)*e+o)+1)+t},easeInOutBack:function(e,t,r,n,o){return null==o&&(o=1.70158),(e/=n/2)<1?r/2*(e*e*((1+(o*=1.525))*e-o))+t:r/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},easeInBounce:function(e,t,r,n){return r-Wheeparam.Easing.easeOutBounce(n-e,0,r,n)+t},easeOutBounce:function(e,t,r,n){return(e/=n)<1/2.75?r*(7.5625*e*e)+t:e<2/2.75?r*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?r*(7.5625*(e-=2.25/2.75)*e+.9375)+t:r*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easeInOutBounce:function(e,t,r,n){return e<n/2?.5*Wheeparam.Easing.easeInBounce(2*e,0,r,n)+t:.5*Wheeparam.Easing.easeOutBounce(2*e-n,0,r,n)+.5*r+t}},function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var r={exports:{}};t(r,r.exports),e.autosize=r.exports}}(this,function(e,t){"use strict";var r,n,o="function"==typeof Map?new Map:(r=[],n=[],{has:function(e){return r.indexOf(e)>-1},get:function(e){return n[r.indexOf(e)]},set:function(e,t){-1===r.indexOf(e)&&(r.push(e),n.push(t))},delete:function(e){var t=r.indexOf(e);t>-1&&(r.splice(t,1),n.splice(t,1))}}),a=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){a=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t,r=null,n=null,i=null,u=function(){e.clientWidth!==n&&h()},c=function(t){window.removeEventListener("resize",u,!1),e.removeEventListener("input",h,!1),e.removeEventListener("keyup",h,!1),e.removeEventListener("autosize:destroy",c,!1),e.removeEventListener("autosize:update",h,!1),Object.keys(t).forEach(function(r){e.style[r]=t[r]}),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",c,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",h,!1),window.addEventListener("resize",u,!1),e.addEventListener("input",h,!1),e.addEventListener("autosize:update",h,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:c,update:h}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),r="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(r)&&(r=0),h()}function l(t){var r=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=r,e.style.overflowY=t}function s(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+r+"px",n=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop}),o&&(document.documentElement.scrollTop=o)}}function h(){s();var t=Math.round(parseFloat(e.style.height)),r=window.getComputedStyle(e,null),n="content-box"===r.boxSizing?Math.round(parseFloat(r.height)):e.offsetHeight;if(n<t?"hidden"===r.overflowY&&(l("scroll"),s(),n="content-box"===r.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==r.overflowY&&(l("hidden"),s(),n="content-box"===r.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),i!==n){i=n;var o=a("autosize:resized");try{e.dispatchEvent(o)}catch(e){}}}}function u(e){var t=o.get(e);t&&t.destroy()}function c(e){var t=o.get(e);t&&t.update()}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return i(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],u),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],c),e}),t.default=l,e.exports=t.default}),Number.prototype.numberFormat=function(){if(0==this)return 0;for(var e=/(^[+-]?\d+)(\d{3})/,t=this+"";e.test(t);)t=t.replace(e,"$1,$2");return t},String.prototype.numberFormat=function(){return isNaN(parseFloat(this))?"0":parseFloat(this).numberFormat()},String.prototype.unNumberFormat=function(){var e=this;if("number"==typeof e)return e;e=(e=(""+e).replace(/,/gi,"")).replace(/(^\s*)|(\s*$)/g,"");var t=new Number(e);return isNaN(t)?e:t},Number.prototype.unNumberFormat=function(){return this},Date.prototype.dateFormat=function(e){if(!this.valueOf())return" ";if(!e)return this;var t=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],r=["일","월","화","수","목","금","토"],n=this;return e.replace(/(yyyy|yy|MM|dd|E|hh|mm|ss|a\/p)/gi,function(e){switch(e){case"yyyy":return n.getFullYear();case"yy":return(n.getFullYear()%1e3).zf(2);case"MM":return(n.getMonth()+1).zf(2);case"dd":return n.getDate().zf(2);case"E":return t[n.getDay()];case"e":return r[n.getDay()];case"HH":return n.getHours().zf(2);case"hh":return((h=n.getHours()%12)?h:12).zf(2);case"mm":return n.getMinutes().zf(2);case"ss":return n.getSeconds().zf(2);case"a/p":return n.getHours()<12?"오전":"오후";default:return e}})},String.prototype.string=function(e){for(var t="",r=0;r++<e;)t+=this;return t},String.prototype.zf=function(e){return"0".string(e-this.length)+this},Number.prototype.zf=function(e){return this.toString().zf(e)},String.prototype.dateFormat=function(e){var t=new Date(this);return"Invalid Date"==t?"":t.dateFormat(e)},Number.prototype.toKorean=function(){for(var e=new Array("","일","이","삼","사","오","육","칠","팔","구","십"),t=new Array("","십","백","천","","십","백","천","","십","백","천","","십","백","천"),r=new String(this),n="",o=0;o<r.length;o++){var a="",i=e[r.charAt(r.length-(o+1))];""!=i&&(a+=i+t[o]),4==o&&(a+="만"),8==o&&(a+="억"),12==o&&(a+="조"),n=a+n}return n},String.prototype.toKorean=function(){return this.unNumberFormat().toKorean()},String.prototype.regex=function(e){switch(e){case"phone":return!(11!=(t=this.replace(/\s/gi,"").replace(/-/gi,"")).length&&10!=t.length||!/^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})([0-9]{3,4})([0-9]{4})$/.test(t))&&(t=t.replace(/^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?([0-9]{3,4})-?([0-9]{4})$/,"$1-$2-$3"));case"tel":var t;return t=(t=this.replace(/\s/gi,"").replace(/-/gi,"")).replace(/(^02.{0}|^01.{1}|[0-9]{3})([0-9]{3,4})([0-9]{4})/,"$1-$2-$3"),!!/^\d{2,3}-\d{3,4}-\d{4}$/.test(t)&&t;case"email":return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(this);case"biznum":var r,n,o,a=new Array(1,3,7,1,3,7,1,3,5,1),i=0,u=this.replace(/-/gi,"");for(r=0;r<=7;r++)i+=a[r]*u.charAt(r);return n=(n="0"+a[8]*u.charAt(8)).substring(n.length-2,n.length),o=(10-(i+=Math.floor(n.charAt(0))+Math.floor(n.charAt(1)))%10)%10,Math.floor(u.charAt(9))==o&&u.replace(/(\d{3})(\d{2})(\d{5})/,"$1-$2-$3")}},Wheeparam.ScrollTo=function(e,t,r){e=!(void 0===e||!e)&&e,t=!(void 0===t||!t)&&t,r=void 0!==r&&r&&t?r:0;var n=window.pageYOffset||document.body.scrollTop,o=(e?document.querySelector(e):document.body).offsetTop,a=o-n,i=0,u=function(){i+=20;var e=t?Wheeparam.Easing[t](i,n,a,r):o;window.scrollTo(0,e),i<r&&setTimeout(u,20)};u()},Wheeparam.extend=function(e){e=e||{};for(var t=1;t<arguments.length;t++){var r=arguments[t];if(r)for(var n in r)r.hasOwnProperty(n)&&("object"==typeof r[n]?e[n]=Wheeparam.extend(e[n],r[n]):e[n]=r[n])}return e},Wheeparam.popup=function(e){var t={title:"_blank",width:800,height:600,url:"",onFailed:function(){alert("팝업 차단 기능이 설정되어있습니다.\n차단 기능을 해제(팝업허용) 한 후 다시 이용해 주십시오.")}},r=Wheeparam.extend({},t,e),n=screen.availWidth,o=screen.availHeight,a=r.width,i=r.height,u="width="+a+",height="+i+",top="+(o-i)/2+",left="+(n-a)/2+",scrollbars=yes,resizable=no",c=window.open(e.url,e.title,u);(null==c||void 0===c||null==c&&0==c.outerWidth||null!=c&&0==c.outerHeight)&&r.onFailed()},Wheeparam.shareSNS=function(e){var t={title:"",provider:"",url:"",imgSrc:"",width:800,height:600,onFailed:function(){alert("팝업 차단 기능이 설정되어있습니다.\n차단 기능을 해제(팝업허용) 한 후 다시 이용해 주십시오.")}},r=Wheeparam.extend({},t,e);r.title||(r.title=document.querySelector('meta[property="og:title"]')?document.querySelector('meta[property="og:title"]').getAttribute("content"):document.querySelector("title")?document.querySelector("title").innerText:""),r.url||(r.url=window.location.href),r.imgSrc||(r.imgSrc=document.querySelector('meta[property="og:image"]')?document.querySelector('meta[property="og:image"]').getAttribute("content"):document.querySelector('link[rel="image_src"]')?document.querySelector('link[rel="image_src"]').innerText:""),r.url=encodeURIComponent(r.url),r.title=encodeURIComponent(r.title);var n="";switch(r.provider){case"facebook":n="//www.facebook.com/sharer/sharer.php?u="+r.url;break;case"twitter":n="//twitter.com/home?status="+r.title+" "+r.url;break;case"google":n="//plus.google.com/share?url="+r.url;break;case"pinterest":n="//www.pinterest.com/pin/create/button/?url="+r.url+(r.imgSrc?"&media="+r.imgSrc:"")+"&description="+r.title;break;case"kakaostory":n="https://story.kakao.com/share?url="+r.url;break;case"band":n="http://www.band.us/plugin/share?body="+r.title+"%0A"+r.url;break;case"naver":n="http://share.naver.com/web/shareView.nhn?url="+r.url+"&title="+r.title;break;case"line":n="http://line.me/R/msg/text/?"+r.title+encodeURIComponent("\n")+r.url}return n&&Wheeparam.popup({url:n,width:r.width,height:r.height,onFailed:r.onFailed}),!1},Wheeparam.onDocuemntReady(function(){var e=document.querySelectorAll("[data-checkbox]");if(e.length>0)for(var t=0;t<e.length;t++)e[t].addEventListener("change",function(e){var t=null!=this.getAttribute("data-checkbox-all"),r=this.getAttribute("data-checkbox"),n=this.checked,o=t?this:document.querySelectorAll('[data-checkbox="'+r+'"][data-checkbox-all]').length>0?document.querySelectorAll('[data-checkbox="'+r+'"][data-checkbox-all]')[0]:null,a=document.querySelectorAll('[data-checkbox="'+r+'"]');if(o)if(t)for(var i=0;i<a.length;i++)a[i].checked=n;else{var u=!0;for(i=0;i<a.length;i++)if(null==a[i].getAttribute("data-checkbox-all")&&0==a[i].checked){u=!1;break}o.checked=u}})}),Wheeparam.onDocuemntReady(function(){var e=document.querySelectorAll("input[data-number-format]");if(e.length>0)for(var t=0;t<e.length;t++)e[t].addEventListener("keyup",function(){var e=this.value.unNumberFormat().numberFormat();this.value=e})}),Wheeparam.onDocuemntReady(function(){var e=document.querySelectorAll("[data-number-only]");if(!(e.length<=0))for(var t=0;t<e.length;t++)e[t].addEventListener("keypress",function(e){8!=e.which&&0!=e.which&&45!=e.which&&(e.which<48||e.which>57)&&e.preventDefault()})}),Wheeparam.onDocuemntReady(function(){var e=document.querySelectorAll("textarea[data-autosize]");if(e.length>0)for(var t=0;t<e.length;t++)e[t].addEventListener("keyup",function(){autosize(this)})}),Wheeparam.onDocuemntReady(function(){var e=document.querySelectorAll("[data-sns-share]");if(e.length>0)for(var t=0;t<e.length;t++)for(var r=e[t],n=r.getAttribute("data-title")?r.getAttribute("data-title"):"",o=r.getAttribute("data-url")?r.getAttribute("data-url"):"",a=r.getAttribute("data-img-src")?r.getAttribute("data-img-src"):"",i=r.getAttribute("data-width")?r.getAttribute("data-width"):800,u=r.getAttribute("data-height")?r.getAttribute("data-height"):600,c=r.querySelectorAll("[data-sns-provider]"),l=0;l<c.length;l++)c[l].addEventListener("click",function(){var e=this.getAttribute("data-sns-provider")?this.getAttribute("data-sns-provider"):"";if(!e)return!1;Wheeparam.shareSNS({title:n,provider:e,url:o,imgSrc:a,width:i,height:u})})});
//# sourceMappingURL=common.min.js.map