From ac40c50b8b9654d8f17736a1cb52d54f19fb7a90 Mon Sep 17 00:00:00 2001 From: Arcturus Date: Thu, 19 Sep 2024 20:59:56 +0900 Subject: [PATCH] update code style and patch admin page with amberstone.js --- AvocadoEdition_Light/adm/img/logo.png | Bin 3539 -> 2365 bytes AvocadoEdition_Light/common.php | 2 +- AvocadoEdition_Light/config.php | 4 +- .../install/AVOCADO.LICENSE.txt | 6 +- AvocadoEdition_Light/js/_custom.js | 176 +-- AvocadoEdition_Light/js/amberstone.js | 114 ++ AvocadoEdition_Light/js/autosave.js | 202 +-- AvocadoEdition_Light/js/certify.js | 136 +- AvocadoEdition_Light/js/common.js | 1129 ++++++++--------- AvocadoEdition_Light/js/html5.js | 2 +- AvocadoEdition_Light/js/jquery.cookie.js | 166 +-- AvocadoEdition_Light/js/jquery.fancylist.js | 124 +- AvocadoEdition_Light/js/jquery.menu.js | 175 ++- .../js/jquery.register_form.js | 158 +-- .../js/jquery.rwdImageMaps.js | 94 +- AvocadoEdition_Light/js/jquery.sms_paging.js | 172 +-- AvocadoEdition_Light/js/kakaolink.js | 19 +- AvocadoEdition_Light/js/md5.js | 293 +++-- AvocadoEdition_Light/js/swiper.js | 285 ++--- AvocadoEdition_Light/js/viewimageresize.js | 172 ++- AvocadoEdition_Light/js/wrest.js | 479 ++++--- 21 files changed, 1971 insertions(+), 1937 deletions(-) create mode 100644 AvocadoEdition_Light/js/amberstone.js diff --git a/AvocadoEdition_Light/adm/img/logo.png b/AvocadoEdition_Light/adm/img/logo.png index 4e7a587b11e68d78f38eca5e60645bcd198dd687..cf1146624b900acea2e335e13ea56bd9f281213e 100644 GIT binary patch delta 1720 zcmah}X*3&%8jY>Bbe^TP)h?7&wMir)3)6%sQ8ATFnwd$deTiqQrIsfp)Dj$NhFWGg z47D`Ph@zO#<=IQ?Nvon5?dXsaLnXBiFEeLm{>^*ex#ynme&?R=++SB{)T>kCsSwI0 z6xzVgI@kw+ArNx};w%IPM<5_)%%NZi^c+|Yggpd?f+J8+NA^Jir%EB1LstMDi}m(K z`NT(rMMMWgabguum^&fdz(}|g80L;}z`H{rI3!LER~P~Tc1IwPI8L~tu{jpv>VR{H zfe{WcxdrczbHanM5F{QCgF|poxI5>}UnU3npT9BfDF8olB_YghFGoZN$0T0^aq1Pp zAScKF9l+B3T7qv#C@Po}r+EDT#|10l82t5wbpSx+pPp`5^7WZjS|3NMPHIa^oTD>w)*%xQ4K)4|no@z9xfAzA|8l1h@R~v72@t4Yt|uqC5}-21nvDE|%{}L1&oX#F-aTSn?ZYkFa0JZ0 zQ>V9)!%`1qH}&pz58H%qU|5NXOptfF>vOd`nq9Z4^RmyaD$$sUugvTuzz|K&mHLpq z&azRf4=gEp$t_ifxqr0fn&p*dh@OAU)iSEJ zL{l5esXbF6I;^mjcynL1odQA|rg#Irmm;iD(9Oq=m}ts<&`)`MM3Y6oUKd2f7yMg-yXLETLREdhz<7nOZ_HVdMt zK?^Xx`r)21;3@5rS!|1NmJa=iJZ;o?NvwV-YX*n$dSEoJ%+Q~cxf{>?hgnkoiC&$c zU!|*?FNrx*mf8KhZGBK7X|6Jk!A-A!_$KEq^&T~yMO6Z-+_o&yVqOQ`*72J9B8Ms& z*8e(l#1FKUSJYWizC2|f_iQ+}ZiG;Hkh(Fb=T=4)$c|#~WFOe;6~_@VB|sC4vd;2G zZQSCh2GX{lkken#A+3>(#osd>%Hjf%U)9gFrcZu?v{uFBQhRY+K8L|uwW*)0BU!YX zZe#DLd3;(haAk?y;`^AmYJ}=oD?C&D*n6o4f041(ajGGW!IbHz5J$t%1A!8ej5_!;coEP2x~q!B`{q)i{=Y_V4a>i0FO^h+B6@Bacax=NS z*=a*6O~1;xX43FONW({|aX!AKXk%o~i5W%FDv!)tjUIfw2UzU#H@TwT@~C~i{vMcqN$m|OJ2lPIz7(aBKL;Q)Lp|M|ql zgI`Lw(3Qo`rH#jX?0%|O5m39ZyXz&Z&(eIthuGJ>q1x&d9N>|_UXLyd=tq0{T1XxH zpxx^H>UZ-CWP{4N9aR%jy;2{9kGqdHtNr(i_` z56rI%zXv=%Tt13X{=Mpcqs%|*FHZ&V=k3o%Y(06P3I?2j+4(H`F<*@V`EAa5&``A$OKtA=jThAh#KCLO@d!a!y{w;aaeF zNL0j`Tp~bL-t@c)%vk5bc~g@M2p9}~0R=;8n;_sYv@sfS!T6kZuEGByo&SVB1E4Pd zZqoiQNI^b=VB_Pf>mA}18RQd8z?kSOLXSAz)~0L)fJ2vpseZ+C;F(TMm=5oLU;|XJui{U zpi29*3Bcc9D}ht;>3lCjX7d5M0B2dxc`>{`3p6rK`=V_ghH^O^V>j=5g=E;`F)cZI z6Ju0$k0x$?zzlkBXD^lww2{+rdobVLjGAsl;BR{7Lki3jeuz?| zPJO~1#{=<7tgQ2%x52#*v#W_}z3p2y_KkI@3>%Syvm=^JPrhTqaTo}73seqCaH{T(Sp21x(x!gM_G{CDUN&AggxZ82*TLwHAc#lAT)Zt#FBkZ2n)C<-ha!Yp{ioW%%)K_;L=H{;cyg^n9cYE zG*Y22y?y${{QD0fJstFS(~jo*n#)<*?5e(lM#ZBlgjmOFp(M?@_kL-57*o<@_3c;( z(>-8LNpn|B*=y5!!bzbVH}iYc$b`T5bx)kyTn*zfo~n!Gp&68Me&)VB^icg&RdRDX zp?uWkRBd1jld=uCet|>$w5v~%^bR3Pp?|Z|5leEv&+S2m3*Mw!f3tyJ zJS(PnjXX_`a{VQ?a#cOLSU{JrS!>Z~4qJh0K}r6&!*^!A>S0s3tJ5S+H-6~~LMqWt z#FSE*6U@Sg(H__*9K=I*I0hSGms(}GUEOl?Z|R~`l@wjy!6>Ih;-TF_v*x@QjgW^7a%9-Q9iQ}^k;HcS* z-d#=5ySShH_qBL99>f^GbO&zQbxgoZk&iNU=h!5Bb}`&Z264CMsg+sm*eUWI@@L); zwW>5OOSjU34t|yt>A^i|Hc&mF&Jvhc@7*GF3>%?1|2?rMVH3!(y^Grpbq(zBH*nOV z9Tk)wejN9D4yn8l?-Boj6rXj1s~SlA;M4y}4G}tE?J%6DF8s#xW*+%~40(<_C&-Y& z?;);o6!AL7W~_`hu%FZxW48d|`UA5E?upG;=uJVJHoC+}{WF<&_gaUaRZVAzEHScY zA-RW6Tu#+)W!=gJGoBH>=$Rp~p92w|HlJs7weZK!rKb{%PaCo$H>ms87tl%q@ z9MfJ_|DfFF*_B6Ip0!F~$n>OgyxkMc=3~kCsKrJyGeEW5;(Wk|H%r4|(}q+uH5FCs zsVCSOZ|h7#=TEK^h8WPaBZMKSS+iSmTZ33u+%*ClsI^ED&a&`Ja%X*TCj~RJvZACf85G=47iG2>6?C?vJ8IRa zRXm|9G#Bm1#4i%c3oQy;K30n<4QqTpUuvY!kR)qwqC-no^OtS4yWYxC5gM4KGpT?8 zSkaC&Lzz?8I@9{ za*%XBhzoxb6&X9-hUs%ewdnfe8h+SH#4ZtOZnvM-obN1w$SWUXkKA5KiulBm{pCU? z)htUUd+5uYhE=r}X>|8)`V7lUr=(Bm?C(2#8*@)ZmJQI2p>AU9E-P(akeuQVh3%OF z74RQk7L4~ggFmIU^3w?~BJ6lnGbBSee$51CS%DlsMz17zhQCmBN?v%#49>1>qK13N(wr1{;yy!@p-^UB_;)F`9RCOX#cyQgG>z}NV zWXG)2$%Esy0rq~JZd@hogLwT(mQr+Oj-~LMS9@WD1vk7HpmcW$|0S@?&YR|!ZY5`J z?g{2^$rHRL^P9zy}xH^^Ti!U&85hX|>)V`A)0d zgb(`Z6Rm6wa+Ki4Iwh@=f|9+DPXLoZ-@fwgx`8>aUS1PUIzYVYOe2dgFt?kG@=5Rt z>5jtkfj^ImBFL|nEKG9DXl*>UOJO%RS$OrKd%1z2cDLxLPOuu zG??>hEF~rC1~);q{x~OwR)(#=Cuo4N>Qmx1qu^B-l;7&{Laj!(%y-g&*gulzjt*!; zD4l8m|HRqLt?+pf7o-X`OLV86TEI&e^$>iQp=bZr58h=DuX!ZIR5q@PbflbE-{#d5 z249jjpEv0$JY}}heWvg}JCCO`RtL6ff=IEEfR)8JewWV3p?IPQ+t=}TLDx%F2F znGY)hCB%GSqa#pbJaofl+Fh=SUkjbVVYTeoh~>nA#0j^^>sCB0gavhGVf;^o@*bAd z<8
- AVOCADO EDITION : LIGHT + AVOCADO EDITION : AMBER

GPL! OPEN SOURCE GNUBOARD

diff --git a/AvocadoEdition_Light/config.php b/AvocadoEdition_Light/config.php index 71d1276..350c184 100644 --- a/AvocadoEdition_Light/config.php +++ b/AvocadoEdition_Light/config.php @@ -4,8 +4,8 @@ 상수 선언 ********************/ -define('G5_VERSION', '아보카도 에디션 : Light'); -define('G5_GNUBOARD_VER', '2.2.2'); +define('G5_VERSION', '아보카도 에디션 : Amber'); +define('G5_GNUBOARD_VER', '2.2.3'); // 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음 define('_GNUBOARD_', true); diff --git a/AvocadoEdition_Light/install/AVOCADO.LICENSE.txt b/AvocadoEdition_Light/install/AVOCADO.LICENSE.txt index a8c723d..43841f3 100644 --- a/AvocadoEdition_Light/install/AVOCADO.LICENSE.txt +++ b/AvocadoEdition_Light/install/AVOCADO.LICENSE.txt @@ -1,4 +1,8 @@ -프로그램 명칭 : 아보카도 에디션 : Light (Avocado Edition Light) +프로그램 명칭 : 아보카도 에디션 : Amber (Avocado Edition Amber) + +코드 수정 및 보안패치, 확장 : Arcturus https://info.drk.st/ + +--------------------------------------------------- 저작자 : Avocado https://avocado-edition-rout.postype.com/ diff --git a/AvocadoEdition_Light/js/_custom.js b/AvocadoEdition_Light/js/_custom.js index f94e57d..706e787 100644 --- a/AvocadoEdition_Light/js/_custom.js +++ b/AvocadoEdition_Light/js/_custom.js @@ -1,115 +1,115 @@ -$(function() { - $('img').attr('title', ''); - $('img[usemap]').rwdImageMaps(); +$(function () { + $('img').attr('title', ''); + $('img[usemap]').rwdImageMaps(); - $('#header_control_box').on('click', function() { - $('html').toggleClass('close-header'); + $('#header_control_box').on('click', function () { + $('html').toggleClass('close-header'); - if($('html').hasClass('close-header')) { - // 닫힘상태 - // - 쿠키 설정 - set_cookie('header_close', 'close', 365, g5_cookie_domain); - } else { - // 열림상태 - // - 쿠키 제거 - delete_cookie('header_close'); - } - }); + if ($('html').hasClass('close-header')) { + // 닫힘상태 + // - 쿠키 설정 + set_cookie('header_close', 'close', 365, g5_cookie_domain); + } else { + // 열림상태 + // - 쿠키 제거 + delete_cookie('header_close'); + } + }); }); -window.onscroll = function() { - var position = $(window).scrollTop(); - if (position > 50) { - $('.uparrow').fadeIn(); - } else { - $('.uparrow').fadeOut(); - } - $('.scroll-fix').css('transform', "translatey(" + position + "px)"); +window.onscroll = function () { + var position = $(window).scrollTop(); + if (position > 50) { + $('.uparrow').fadeIn(); + } else { + $('.uparrow').fadeOut(); + } + $('.scroll-fix').css('transform', "translatey(" + position + "px)"); } -$(document).on("keydown", "textarea", function(e) { - if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey) { - $(this).parents('form').submit(); - } +$(document).on("keydown", "textarea", function (e) { + if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey) { + $(this).parents('form').submit(); + } }); if (document.all) { - document.onkeydown = trapRefreshIE; + document.onkeydown = trapRefreshIE; } else { - document.captureEvents(Event.KEYDOWN) - document.onkeydown = trapRefreshNS; + document.captureEvents(Event.KEYDOWN) + document.onkeydown = trapRefreshNS; } -function trapRefreshNS(e){ - if (e.keyCode == 116){ - e.cancelBubble = true; - e.returnValue = false; - document.location.reload(); - } +function trapRefreshNS(e) { + if (e.keyCode == 116) { + e.cancelBubble = true; + e.returnValue = false; + document.location.reload(); + } } -function trapRefreshIE(){ - if (event.keyCode == 116){ - event.keyCode = 0; - event.cancelBubble = true; - event.returnValue = false; - document.location.reload(); - } +function trapRefreshIE() { + if (event.keyCode == 116) { + event.keyCode = 0; + event.cancelBubble = true; + event.returnValue = false; + document.location.reload(); + } } function ajax_link_url(url, obj_id) { - var h_link = url; - - if(typeof(history.pushState) != "undefined") { - $.ajax({ - async: true - , url: h_link - , beforeSend: function() {} - , success: function(data) { - // Toss - var response = data; - var temp_content = $(response).find(obj_id).clone(); + var h_link = url; - $(obj_id).fadeOut(300, function(){$(this).empty().append(temp_content.html());}).fadeIn(300, function() { - - $(obj_id).find('img').attr('title', ''); - $(obj_id).find('img[usemap]').rwdImageMaps(); + if (typeof (history.pushState) != "undefined") { + $.ajax({ + async: true + , url: h_link + , beforeSend: function () { } + , success: function (data) { + // Toss + var response = data; + var temp_content = $(response).find(obj_id).clone(); - var link = url; - var link_obj = { Title: '', Url: link}; - history.pushState(link_obj, link_obj.Title, link_obj.Url); - }); - } - , error: function(data, status, err) { - $(obj_id).fadeOut(300, function(){$(this).empty(); }); - } - , complete: function() { - // Complete - } - }); - } else { - location.href=url; - } + $(obj_id).fadeOut(300, function () { $(this).empty().append(temp_content.html()); }).fadeIn(300, function () { + + $(obj_id).find('img').attr('title', ''); + $(obj_id).find('img[usemap]').rwdImageMaps(); + + var link = url; + var link_obj = { Title: '', Url: link }; + history.pushState(link_obj, link_obj.Title, link_obj.Url); + }); + } + , error: function (data, status, err) { + $(obj_id).fadeOut(300, function () { $(this).empty(); }); + } + , complete: function () { + // Complete + } + }); + } else { + location.href = url; + } } function fn_save_title(val, ch_id) { - var formData = new FormData(); - var ch_id = ch_id; - var ti_id = val; - formData.append("ch_id", ch_id); - formData.append("ti_id", ti_id); + var formData = new FormData(); + var ch_id = ch_id; + var ti_id = val; + formData.append("ch_id", ch_id); + formData.append("ti_id", ti_id); - $.ajax({ - url:g5_url+'/mypage/character/title_update.php' - , data: formData - , processData: false - , contentType: false - , type: 'POST' - , success: function(data){ - - } - }); + $.ajax({ + url: g5_url + '/mypage/character/title_update.php' + , data: formData + , processData: false + , contentType: false + , type: 'POST' + , success: function (data) { + + } + }); } diff --git a/AvocadoEdition_Light/js/amberstone.js b/AvocadoEdition_Light/js/amberstone.js new file mode 100644 index 0000000..550b880 --- /dev/null +++ b/AvocadoEdition_Light/js/amberstone.js @@ -0,0 +1,114 @@ +/** + * amberstone + * @author arcturus (contact@sharlayan.net / https://info.drk.st/about) + * @version 1.1.3 + */ + +function pad(num, len = 2) { + return num.toFixed(0).padStart(len, '0'); +} + +function serializeForm(form) { + var formData = new FormData(form); + var params = new URLSearchParams(); + + formData.forEach(function (value, key) { + params.append(key, value); + }); + + return params.toString(); +} + +function createHtmlFromJson(jsonData) { + function createElementRecursive(data) { + if (typeof data !== 'object' || data === null) { + return document.createTextNode(String(data)); + } + + const element = createElement(data.type || 'div', data); + + if (data.children) { + if (Array.isArray(data.children)) { + data.children.forEach(child => { + element.appendChild(createElementRecursive(child)); + }); + } else { + element.appendChild(createElementRecursive(data.children)); + } + } + + return element; + } + + return createElementRecursive(jsonData); +} + +function createElement(type, data) { + const elem = document.createElement(type); + if (typeof data === 'object') { + if (data.hasOwnProperty('classList')) { + if (Array.isArray(data.classList)) { + for (const cl of data.classList) { + elem.classList.add(cl); + } + } else if (typeof data.classList === 'string') { + elem.classList.add(data.classList); + } + } + + if (data.hasOwnProperty('css')) { + if (typeof data.css === 'object') { + for (const css in data.css) { + elem.style.setProperty(css, data.css[css]); + } + } + } + + if (data.hasOwnProperty('textContent')) { + elem.textContent = data.textContent; + } + + if (data.hasOwnProperty('innerHTML')) { + elem.innerHTML = data.innerHTML; + } + + if (data.hasOwnProperty('attributes')) { + if (typeof data.attributes === 'object') { + for (const attr in data.attributes) { + elem.setAttribute(attr, data.attributes[attr]); + } + } + } + } else if (Array.isArray(data) && data.length > 0) { + for (const cl of data) { + elem.classList.add(cl); + } + } else if (typeof data === 'string') { + elem.classList.add(data); + } + return elem; +} + +function sendRequest(url, data, type, callback, useUrlEncoded = true) { + var xhr = new XMLHttpRequest(); + xhr.open(type, url, true); + + if (useUrlEncoded) { + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + data = new URLSearchParams(data).toString(); + } else { + xhr.setRequestHeader('Content-Type', 'application/json'); + data = JSON.stringify(data); + } + + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + if (xhr.status >= 200 && xhr.status < 300) { + callback(null, xhr.responseText); + } else { + callback(xhr.statusText, null); + } + } + }; + xhr.send(type === 'POST' ? data : null); +} diff --git a/AvocadoEdition_Light/js/autosave.js b/AvocadoEdition_Light/js/autosave.js index ac083b5..2b504be 100644 --- a/AvocadoEdition_Light/js/autosave.js +++ b/AvocadoEdition_Light/js/autosave.js @@ -6,112 +6,112 @@ var save_wr_subject = null; var save_wr_content = null; function autosave() { - $("form#fwrite").each(function() { - if(g5_editor != "") { - if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { - this.wr_content.value = CKEDITOR.instances.wr_content.getData(); - } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { - this.wr_content.value = ed_wr_content.outputBodyHTML(); - } else { - if(typeof get_editor_wr_content == "function") { - this.wr_content.value = get_editor_wr_content(); - } - } + $("form#fwrite").each(function () { + if (g5_editor != "") { + if (g5_editor.indexOf("ckeditor4") != -1 && typeof (CKEDITOR.instances.wr_content) != "undefined") { + this.wr_content.value = CKEDITOR.instances.wr_content.getData(); + } else if (g5_editor.indexOf("cheditor5") != -1 && typeof (ed_wr_content) != "undefined") { + this.wr_content.value = ed_wr_content.outputBodyHTML(); + } else { + if (typeof get_editor_wr_content == "function") { + this.wr_content.value = get_editor_wr_content(); } - - // 변수에 저장해 놓은 값과 다를 경우에만 임시 저장함 - if (save_wr_subject != this.wr_subject.value || save_wr_content != this.wr_content.value) { - $.ajax({ - url: g5_bbs_url+"/ajax.autosave.php", - data: { - "uid" : this.uid.value, - "subject": this.wr_subject.value, - "content": this.wr_content.value - }, - type: "POST", - success: function(data){ - if (data) { - $("#autosave_count").html(data); - } - } - }); - save_wr_subject = this.wr_subject.value; - save_wr_content = this.wr_content.value; - } - }); -} - -$(function(){ - - if (g5_is_member) { - setInterval(autosave, AUTOSAVE_INTERVAL * 1000); + } } - // 임시저장된 글목록을 가져옴 - $("#btn_autosave").click(function(){ - if ($("#autosave_pop").is(":hidden")) { - $.get(g5_bbs_url+"/ajax.autosavelist.php", function(data){ - //alert(data); - //console.log( "Data: " + data); - $("#autosave_pop ul").empty(); - if ($(data).find("list").find("item").length > 0) { - $(data).find("list").find("item").each(function(i) { - var id = $(this).find("id").text(); - var uid = $(this).find("uid").text(); - var subject = $(this).find("subject").text(); - var datetime = $(this).find("datetime").text(); - $("#autosave_pop ul") - .append('
  • '+subject+''+datetime+'
  • ') - .find("li:eq("+i+")") - .data({ as_id: id, uid: uid }); - }); - } - }, "xml"); - $("#autosave_pop").show(); - } else { - $("#autosave_pop").hide(); + // 변수에 저장해 놓은 값과 다를 경우에만 임시 저장함 + if (save_wr_subject != this.wr_subject.value || save_wr_content != this.wr_content.value) { + $.ajax({ + url: g5_bbs_url + "/ajax.autosave.php", + data: { + "uid": this.uid.value, + "subject": this.wr_subject.value, + "content": this.wr_content.value + }, + type: "POST", + success: function (data) { + if (data) { + $("#autosave_count").html(data); + } } - }); + }); + save_wr_subject = this.wr_subject.value; + save_wr_content = this.wr_content.value; + } + }); +} - // 임시저장된 글 제목과 내용을 가져와서 제목과 내용 입력박스에 노출해 줌 - $(document).on( "click", ".autosave_load", function(){ - var $li = $(this).parents("li"); - var as_id = $li.data("as_id"); - var as_uid = $li.data("uid"); - $("#fwrite input[name='uid']").val(as_uid); - $.get(g5_bbs_url+"/ajax.autosaveload.php", {"as_id":as_id}, function(data){ - var subject = $(data).find("item").find("subject").text(); - var content = $(data).find("item").find("content").text(); - $("#wr_subject").val(subject); - if(g5_editor != "") { - if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { - CKEDITOR.instances.wr_content.setData(content); - } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { - ed_wr_content.putContents(content); - } else { - if(typeof put_editor_wr_content == "function") { - put_editor_wr_content(content); - } - } - } else { - $("#fwrite #wr_content").val(content); - } - }, "xml"); - $("#autosave_pop").hide(); - }); +$(function () { - $(document).on( "click", ".autosave_del", function(){ - var $li = $(this).parents("li"); - var as_id = $li.data("as_id"); - $.get(g5_bbs_url+"/ajax.autosavedel.php", {"as_id":as_id}, function(data){ - if (data == -1) { - alert("임시 저장된글을 삭제중에 오류가 발생하였습니다."); - } else { - $("#autosave_count").html(data); - $li.remove(); - } - }); - }); + if (g5_is_member) { + setInterval(autosave, AUTOSAVE_INTERVAL * 1000); + } - $(".autosave_close").click(function(){ $("#autosave_pop").hide(); }); + // 임시저장된 글목록을 가져옴 + $("#btn_autosave").click(function () { + if ($("#autosave_pop").is(":hidden")) { + $.get(g5_bbs_url + "/ajax.autosavelist.php", function (data) { + //alert(data); + //console.log( "Data: " + data); + $("#autosave_pop ul").empty(); + if ($(data).find("list").find("item").length > 0) { + $(data).find("list").find("item").each(function (i) { + var id = $(this).find("id").text(); + var uid = $(this).find("uid").text(); + var subject = $(this).find("subject").text(); + var datetime = $(this).find("datetime").text(); + $("#autosave_pop ul") + .append('
  • ' + subject + '' + datetime + '
  • ') + .find("li:eq(" + i + ")") + .data({ as_id: id, uid: uid }); + }); + } + }, "xml"); + $("#autosave_pop").show(); + } else { + $("#autosave_pop").hide(); + } + }); + + // 임시저장된 글 제목과 내용을 가져와서 제목과 내용 입력박스에 노출해 줌 + $(document).on("click", ".autosave_load", function () { + var $li = $(this).parents("li"); + var as_id = $li.data("as_id"); + var as_uid = $li.data("uid"); + $("#fwrite input[name='uid']").val(as_uid); + $.get(g5_bbs_url + "/ajax.autosaveload.php", { "as_id": as_id }, function (data) { + var subject = $(data).find("item").find("subject").text(); + var content = $(data).find("item").find("content").text(); + $("#wr_subject").val(subject); + if (g5_editor != "") { + if (g5_editor.indexOf("ckeditor4") != -1 && typeof (CKEDITOR.instances.wr_content) != "undefined") { + CKEDITOR.instances.wr_content.setData(content); + } else if (g5_editor.indexOf("cheditor5") != -1 && typeof (ed_wr_content) != "undefined") { + ed_wr_content.putContents(content); + } else { + if (typeof put_editor_wr_content == "function") { + put_editor_wr_content(content); + } + } + } else { + $("#fwrite #wr_content").val(content); + } + }, "xml"); + $("#autosave_pop").hide(); + }); + + $(document).on("click", ".autosave_del", function () { + var $li = $(this).parents("li"); + var as_id = $li.data("as_id"); + $.get(g5_bbs_url + "/ajax.autosavedel.php", { "as_id": as_id }, function (data) { + if (data == -1) { + alert("임시 저장된글을 삭제중에 오류가 발생하였습니다."); + } else { + $("#autosave_count").html(data); + $li.remove(); + } + }); + }); + + $(".autosave_close").click(function () { $("#autosave_pop").hide(); }); }); diff --git a/AvocadoEdition_Light/js/certify.js b/AvocadoEdition_Light/js/certify.js index 616760c..5f36a5c 100644 --- a/AvocadoEdition_Light/js/certify.js +++ b/AvocadoEdition_Light/js/certify.js @@ -1,80 +1,72 @@ // 본인확인 인증창 호출 -function certify_win_open(type, url) -{ - if(type == 'kcb-ipin') - { - var popupWindow = window.open( url, "kcbPop", "left=200, top=100, status=0, width=450, height=550" ); - popupWindow.focus(); +function certify_win_open(type, url) { + if (type == 'kcb-ipin') { + var popupWindow = window.open(url, "kcbPop", "left=200, top=100, status=0, width=450, height=550"); + popupWindow.focus(); + } + else if (type == 'kcb-hp') { + var popupWindow = window.open(url, "auth_popup", "left=200, top=100, width=430, height=590, scrollbar=yes"); + popupWindow.focus(); + } + else if (type == 'kcp-hp') { + if ($("input[name=veri_up_hash]").size() < 1) + $("input[name=cert_no]").after(''); + + if (navigator.userAgent.indexOf("Android") > - 1 || navigator.userAgent.indexOf("iPhone") > - 1) { + var $frm = $(event.target.form); + if ($("#kcp_cert").size() < 1) { + $frm.wrap('
    '); + + $("#cert_info").append('
    ') + .after(''); + } + + var temp_form = document.form_temp; + temp_form.target = "kcp_cert"; + temp_form.action = url; + + document.getElementById("cert_info").style.display = "none"; + document.getElementById("kcp_cert").style.display = ""; + + temp_form.submit(); } - else if(type == 'kcb-hp') - { - var popupWindow = window.open( url, "auth_popup", "left=200, top=100, width=430, height=590, scrollbar=yes" ); - popupWindow.focus(); - } - else if(type == 'kcp-hp') - { - if($("input[name=veri_up_hash]").size() < 1) - $("input[name=cert_no]").after(''); - - if( navigator.userAgent.indexOf("Android") > - 1 || navigator.userAgent.indexOf("iPhone") > - 1 ) - { - var $frm = $(event.target.form); - if($("#kcp_cert").size() < 1) { - $frm.wrap('
    '); - - $("#cert_info").append('') - .after(''); - } - - var temp_form = document.form_temp; - temp_form.target = "kcp_cert"; - temp_form.action = url; - - document.getElementById( "cert_info" ).style.display = "none"; - document.getElementById( "kcp_cert" ).style.display = ""; - - temp_form.submit(); - } - else - { - var return_gubun; - var width = 410; - var height = 500; - - var leftpos = screen.width / 2 - ( width / 2 ); - var toppos = screen.height / 2 - ( height / 2 ); - - var winopts = "width=" + width + ", height=" + height + ", toolbar=no,status=no,statusbar=no,menubar=no,scrollbars=no,resizable=no"; - var position = ",left=" + leftpos + ", top=" + toppos; - var AUTH_POP = window.open(url,'auth_popup', winopts + position); - } - } - else if(type == 'lg-hp') - { - var popupWindow = window.open( url, "auth_popup", "left=200, top=100, width=400, height=400, scrollbar=yes" ); - popupWindow.focus(); + else { + var return_gubun; + var width = 410; + var height = 500; + + var leftpos = screen.width / 2 - (width / 2); + var toppos = screen.height / 2 - (height / 2); + + var winopts = "width=" + width + ", height=" + height + ", toolbar=no,status=no,statusbar=no,menubar=no,scrollbars=no,resizable=no"; + var position = ",left=" + leftpos + ", top=" + toppos; + var AUTH_POP = window.open(url, 'auth_popup', winopts + position); } + } + else if (type == 'lg-hp') { + var popupWindow = window.open(url, "auth_popup", "left=200, top=100, width=400, height=400, scrollbar=yes"); + popupWindow.focus(); + } } // 인증체크 -function cert_confirm() -{ - var type; - var val = document.fregisterform.cert_type.value +function cert_confirm() { + var type; + var val = document.fregisterform.cert_type.value - switch(val) { - case "ipin": - type = "아이핀"; - break; - case "hp": - type = "휴대폰"; - break; - default: - return true; - } + switch (val) { + case "ipin": + type = "아이핀"; + break; + case "hp": + type = "휴대폰"; + break; + default: + return true; + } - if(confirm("이미 "+type+"으로 본인확인을 완료하셨습니다.\n\n이전 인증을 취소하고 다시 인증하시겠습니까?")) - return true; - else - return false; -} \ No newline at end of file + if (confirm("이미 " + type + "으로 본인확인을 완료하셨습니다.\n\n이전 인증을 취소하고 다시 인증하시겠습니까?")) + return true; + else + return false; +} diff --git a/AvocadoEdition_Light/js/common.js b/AvocadoEdition_Light/js/common.js index c7f91ea..283fed8 100644 --- a/AvocadoEdition_Light/js/common.js +++ b/AvocadoEdition_Light/js/common.js @@ -3,741 +3,700 @@ var errmsg = ""; var errfld = null; // 필드 검사 -function check_field(fld, msg) -{ - if ((fld.value = trim(fld.value)) == "") - error_field(fld, msg); - else - clear_field(fld); - return; +function check_field(fld, msg) { + if ((fld.value = trim(fld.value)) == "") + error_field(fld, msg); + else + clear_field(fld); + return; } // 필드 오류 표시 -function error_field(fld, msg) -{ - if (msg != "") - errmsg += msg + "\n"; - if (!errfld) errfld = fld; - fld.style.background = "#BDDEF7"; +function error_field(fld, msg) { + if (msg != "") + errmsg += msg + "\n"; + if (!errfld) errfld = fld; + fld.style.background = "#BDDEF7"; } // 필드를 깨끗하게 -function clear_field(fld) -{ - fld.style.background = "#FFFFFF"; +function clear_field(fld) { + fld.style.background = "#FFFFFF"; } -function trim(s) -{ - var t = ""; - var from_pos = to_pos = 0; +function trim(s) { + var t = ""; + var from_pos = to_pos = 0; - for (i=0; i=0; i--) - { - if (s.charAt(i-1) == ' ') - continue; - else - { - to_pos = i; - break; - } + for (i = s.length; i >= 0; i--) { + if (s.charAt(i - 1) == ' ') + continue; + else { + to_pos = i; + break; } + } - t = s.substring(from_pos, to_pos); - // alert(from_pos + ',' + to_pos + ',' + t+'.'); - return t; + t = s.substring(from_pos, to_pos); + // alert(from_pos + ',' + to_pos + ',' + t+'.'); + return t; } // 자바스크립트로 PHP의 number_format 흉내를 냄 // 숫자에 , 를 출력 -function number_format(data) -{ +function number_format(data) { - var tmp = ''; - var number = ''; - var cutlen = 3; - var comma = ','; - var i; + var tmp = ''; + var number = ''; + var cutlen = 3; + var comma = ','; + var i; - var sign = data.match(/^[\+\-]/); - if(sign) { - data = data.replace(/^[\+\-]/, ""); + var sign = data.match(/^[\+\-]/); + if (sign) { + data = data.replace(/^[\+\-]/, ""); + } + + len = data.length; + mod = (len % cutlen); + k = cutlen - mod; + for (i = 0; i < data.length; i++) { + number = number + data.charAt(i); + + if (i < data.length - 1) { + k++; + if ((k % cutlen) == 0) { + number = number + comma; + k = 0; + } } + } - len = data.length; - mod = (len % cutlen); - k = cutlen - mod; - for (i=0; i 0) - document.getElementById(id).rows -= row; +function textarea_decrease(id, row) { + if (document.getElementById(id).rows - row > 0) + document.getElementById(id).rows -= row; } -function textarea_original(id, row) -{ - document.getElementById(id).rows = row; +function textarea_original(id, row) { + document.getElementById(id).rows = row; } -function textarea_increase(id, row) -{ - document.getElementById(id).rows += row; +function textarea_increase(id, row) { + document.getElementById(id).rows += row; } // 글숫자 검사 -function check_byte(content, target) -{ - var i = 0; - var cnt = 0; - var ch = ''; - var cont = document.getElementById(content).value; +function check_byte(content, target) { + var i = 0; + var cnt = 0; + var ch = ''; + var cont = document.getElementById(content).value; - for (i=0; i 4) { - cnt += 2; - } else { - cnt += 1; - } + for (i = 0; i < cont.length; i++) { + ch = cont.charAt(i); + if (escape(ch).length > 4) { + cnt += 2; + } else { + cnt += 1; } - // 숫자를 출력 - document.getElementById(target).innerHTML = cnt; + } + // 숫자를 출력 + document.getElementById(target).innerHTML = cnt; - return cnt; + return cnt; } // 브라우저에서 오브젝트의 왼쪽 좌표 -function get_left_pos(obj) -{ - var parentObj = null; - var clientObj = obj; - //var left = obj.offsetLeft + document.body.clientLeft; - var left = obj.offsetLeft; +function get_left_pos(obj) { + var parentObj = null; + var clientObj = obj; + //var left = obj.offsetLeft + document.body.clientLeft; + var left = obj.offsetLeft; - while((parentObj=clientObj.offsetParent) != null) - { - left = left + parentObj.offsetLeft; - clientObj = parentObj; - } + while ((parentObj = clientObj.offsetParent) != null) { + left = left + parentObj.offsetLeft; + clientObj = parentObj; + } - return left; + return left; } // 브라우저에서 오브젝트의 상단 좌표 -function get_top_pos(obj) -{ - var parentObj = null; - var clientObj = obj; - //var top = obj.offsetTop + document.body.clientTop; - var top = obj.offsetTop; +function get_top_pos(obj) { + var parentObj = null; + var clientObj = obj; + //var top = obj.offsetTop + document.body.clientTop; + var top = obj.offsetTop; - while((parentObj=clientObj.offsetParent) != null) - { - top = top + parentObj.offsetTop; - clientObj = parentObj; - } + while ((parentObj = clientObj.offsetParent) != null) { + top = top + parentObj.offsetTop; + clientObj = parentObj; + } - return top; + return top; } -function flash_movie(src, ids, width, height, wmode) -{ - var wh = ""; - if (parseInt(width) && parseInt(height)) - wh = " width='"+width+"' height='"+height+"' "; - return ""; +function flash_movie(src, ids, width, height, wmode) { + var wh = ""; + if (parseInt(width) && parseInt(height)) + wh = " width='" + width + "' height='" + height + "' "; + return ""; } -function obj_movie(src, ids, width, height, autostart) -{ - var wh = ""; - if (parseInt(width) && parseInt(height)) - wh = " width='"+width+"' height='"+height+"' "; - if (!autostart) autostart = false; - return ""; +function obj_movie(src, ids, width, height, autostart) { + var wh = ""; + if (parseInt(width) && parseInt(height)) + wh = " width='" + width + "' height='" + height + "' "; + if (!autostart) autostart = false; + return ""; } -function doc_write(cont) -{ - document.write(cont); +function doc_write(cont) { + document.write(cont); } -var win_password_lost = function(href) { - window.open(href, "win_password_lost", "left=50, top=50, width=617, height=330, scrollbars=1"); +var win_password_lost = function (href) { + window.open(href, "win_password_lost", "left=50, top=50, width=617, height=330, scrollbars=1"); } -$(document).ready(function(){ - $("#login_password_lost, #ol_password_lost").click(function(){ - win_password_lost(this.href); - return false; - }); +$(document).ready(function () { + $("#login_password_lost, #ol_password_lost").click(function () { + win_password_lost(this.href); + return false; + }); }); /** * 포인트 창 **/ -var win_point = function(href) { - var new_win = window.open(href, 'win_point', 'left=100,top=100,width=600, height=600, scrollbars=1'); - new_win.focus(); +var win_point = function (href) { + var new_win = window.open(href, 'win_point', 'left=100,top=100,width=600, height=600, scrollbars=1'); + new_win.focus(); } /** * 쪽지 창 **/ -var win_memo = function(href) { - var new_win = window.open(href, 'win_memo', 'left=100,top=100,width=620,height=500,scrollbars=1'); - new_win.focus(); +var win_memo = function (href) { + var new_win = window.open(href, 'win_memo', 'left=100,top=100,width=620,height=500,scrollbars=1'); + new_win.focus(); } /** * 메일 창 **/ -var win_email = function(href) { - var new_win = window.open(href, 'win_email', 'left=100,top=100,width=600,height=580,scrollbars=0'); - new_win.focus(); +var win_email = function (href) { + var new_win = window.open(href, 'win_email', 'left=100,top=100,width=600,height=580,scrollbars=0'); + new_win.focus(); } /** * 자기소개 창 **/ -var win_profile = function(href) { - var new_win = window.open(href, 'win_profile', 'left=100,top=100,width=620,height=510,scrollbars=1'); - new_win.focus(); +var win_profile = function (href) { + var new_win = window.open(href, 'win_profile', 'left=100,top=100,width=620,height=510,scrollbars=1'); + new_win.focus(); } /** * 스크랩 창 **/ -var win_scrap = function(href) { - var new_win = window.open(href, 'win_scrap', 'left=100,top=100,width=600,height=600,scrollbars=1'); - new_win.focus(); +var win_scrap = function (href) { + var new_win = window.open(href, 'win_scrap', 'left=100,top=100,width=600,height=600,scrollbars=1'); + new_win.focus(); } /** * 홈페이지 창 **/ -var win_homepage = function(href) { - var new_win = window.open(href, 'win_homepage', ''); - new_win.focus(); +var win_homepage = function (href) { + var new_win = window.open(href, 'win_homepage', ''); + new_win.focus(); } /** * 우편번호 창 **/ -var win_zip = function(frm_name, frm_zip, frm_addr1, frm_addr2, frm_addr3, frm_jibeon) { - if(typeof daum === 'undefined'){ - alert("다음 우편번호 postcode.v2.js 파일이 로드되지 않았습니다."); - return false; +var win_zip = function (frm_name, frm_zip, frm_addr1, frm_addr2, frm_addr3, frm_jibeon) { + if (typeof daum === 'undefined') { + alert("다음 우편번호 postcode.v2.js 파일이 로드되지 않았습니다."); + return false; + } + + var zip_case = 1; //0이면 레이어, 1이면 페이지에 끼워 넣기, 2이면 새창 + + var complete_fn = function (data) { + // 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분. + + // 각 주소의 노출 규칙에 따라 주소를 조합한다. + // 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다. + var fullAddr = ''; // 최종 주소 변수 + var extraAddr = ''; // 조합형 주소 변수 + + // 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다. + if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우 + fullAddr = data.roadAddress; + + } else { // 사용자가 지번 주소를 선택했을 경우(J) + fullAddr = data.jibunAddress; } - var zip_case = 1; //0이면 레이어, 1이면 페이지에 끼워 넣기, 2이면 새창 - - var complete_fn = function(data){ - // 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분. - - // 각 주소의 노출 규칙에 따라 주소를 조합한다. - // 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다. - var fullAddr = ''; // 최종 주소 변수 - var extraAddr = ''; // 조합형 주소 변수 - - // 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다. - if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우 - fullAddr = data.roadAddress; - - } else { // 사용자가 지번 주소를 선택했을 경우(J) - fullAddr = data.jibunAddress; - } - - // 사용자가 선택한 주소가 도로명 타입일때 조합한다. - if(data.userSelectedType === 'R'){ - //법정동명이 있을 경우 추가한다. - if(data.bname !== ''){ - extraAddr += data.bname; - } - // 건물명이 있을 경우 추가한다. - if(data.buildingName !== ''){ - extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName); - } - // 조합형주소의 유무에 따라 양쪽에 괄호를 추가하여 최종 주소를 만든다. - extraAddr = (extraAddr !== '' ? ' ('+ extraAddr +')' : ''); - } - - // 우편번호와 주소 정보를 해당 필드에 넣고, 커서를 상세주소 필드로 이동한다. - var of = document[frm_name]; - - of[frm_zip].value = data.zonecode; - - of[frm_addr1].value = fullAddr; - of[frm_addr3].value = extraAddr; - - if(of[frm_jibeon] !== undefined){ - of[frm_jibeon].value = data.userSelectedType; - } - - of[frm_addr2].focus(); - }; - - switch(zip_case) { - case 1 : //iframe을 이용하여 페이지에 끼워 넣기 - var daum_pape_id = 'daum_juso_page'+frm_zip, - element_wrap = document.getElementById(daum_pape_id), - currentScroll = Math.max(document.body.scrollTop, document.documentElement.scrollTop); - if (element_wrap == null) { - element_wrap = document.createElement("div"); - element_wrap.setAttribute("id", daum_pape_id); - element_wrap.style.cssText = 'display:none;border:1px solid;left:0;width:100%;height:300px;margin:5px 0;position:relative;-webkit-overflow-scrolling:touch;'; - element_wrap.innerHTML = '접기 버튼'; - jQuery('form[name="'+frm_name+'"]').find('input[name="'+frm_addr1+'"]').before(element_wrap); - jQuery("#"+daum_pape_id).off("click", ".close_daum_juso").on("click", ".close_daum_juso", function(e){ - e.preventDefault(); - jQuery(this).parent().hide(); - }); - } - - new daum.Postcode({ - oncomplete: function(data) { - complete_fn(data); - // iframe을 넣은 element를 안보이게 한다. - element_wrap.style.display = 'none'; - // 우편번호 찾기 화면이 보이기 이전으로 scroll 위치를 되돌린다. - document.body.scrollTop = currentScroll; - }, - // 우편번호 찾기 화면 크기가 조정되었을때 실행할 코드를 작성하는 부분. - // iframe을 넣은 element의 높이값을 조정한다. - onresize : function(size) { - element_wrap.style.height = size.height + "px"; - }, - width : '100%', - height : '100%' - }).embed(element_wrap); - - // iframe을 넣은 element를 보이게 한다. - element_wrap.style.display = 'block'; - break; - case 2 : //새창으로 띄우기 - new daum.Postcode({ - oncomplete: function(data) { - complete_fn(data); - } - }).open(); - break; - default : //iframe을 이용하여 레이어 띄우기 - var rayer_id = 'daum_juso_rayer'+frm_zip, - element_layer = document.getElementById(rayer_id); - if (element_layer == null) { - element_layer = document.createElement("div"); - element_layer.setAttribute("id", rayer_id); - element_layer.style.cssText = 'display:none;border:5px solid;position:fixed;width:300px;height:460px;left:50%;margin-left:-155px;top:50%;margin-top:-235px;overflow:hidden;-webkit-overflow-scrolling:touch;z-index:10000'; - element_layer.innerHTML = '닫기 버튼'; - document.body.appendChild(element_layer); - jQuery("#"+rayer_id).off("click", ".close_daum_juso").on("click", ".close_daum_juso", function(e){ - e.preventDefault(); - jQuery(this).parent().hide(); - }); - } - - new daum.Postcode({ - oncomplete: function(data) { - complete_fn(data); - // iframe을 넣은 element를 안보이게 한다. - element_layer.style.display = 'none'; - }, - width : '100%', - height : '100%' - }).embed(element_layer); - - // iframe을 넣은 element를 보이게 한다. - element_layer.style.display = 'block'; + // 사용자가 선택한 주소가 도로명 타입일때 조합한다. + if (data.userSelectedType === 'R') { + //법정동명이 있을 경우 추가한다. + if (data.bname !== '') { + extraAddr += data.bname; + } + // 건물명이 있을 경우 추가한다. + if (data.buildingName !== '') { + extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName); + } + // 조합형주소의 유무에 따라 양쪽에 괄호를 추가하여 최종 주소를 만든다. + extraAddr = (extraAddr !== '' ? ' (' + extraAddr + ')' : ''); } + + // 우편번호와 주소 정보를 해당 필드에 넣고, 커서를 상세주소 필드로 이동한다. + var of = document[frm_name]; + + of[frm_zip].value = data.zonecode; + + of[frm_addr1].value = fullAddr; + of[frm_addr3].value = extraAddr; + + if (of[frm_jibeon] !== undefined) { + of[frm_jibeon].value = data.userSelectedType; + } + + of[frm_addr2].focus(); + }; + + switch (zip_case) { + case 1: //iframe을 이용하여 페이지에 끼워 넣기 + var daum_pape_id = 'daum_juso_page' + frm_zip, + element_wrap = document.getElementById(daum_pape_id), + currentScroll = Math.max(document.body.scrollTop, document.documentElement.scrollTop); + if (element_wrap == null) { + element_wrap = document.createElement("div"); + element_wrap.setAttribute("id", daum_pape_id); + element_wrap.style.cssText = 'display:none;border:1px solid;left:0;width:100%;height:300px;margin:5px 0;position:relative;-webkit-overflow-scrolling:touch;'; + element_wrap.innerHTML = '접기 버튼'; + jQuery('form[name="' + frm_name + '"]').find('input[name="' + frm_addr1 + '"]').before(element_wrap); + jQuery("#" + daum_pape_id).off("click", ".close_daum_juso").on("click", ".close_daum_juso", function (e) { + e.preventDefault(); + jQuery(this).parent().hide(); + }); + } + + new daum.Postcode({ + oncomplete: function (data) { + complete_fn(data); + // iframe을 넣은 element를 안보이게 한다. + element_wrap.style.display = 'none'; + // 우편번호 찾기 화면이 보이기 이전으로 scroll 위치를 되돌린다. + document.body.scrollTop = currentScroll; + }, + // 우편번호 찾기 화면 크기가 조정되었을때 실행할 코드를 작성하는 부분. + // iframe을 넣은 element의 높이값을 조정한다. + onresize: function (size) { + element_wrap.style.height = size.height + "px"; + }, + width: '100%', + height: '100%' + }).embed(element_wrap); + + // iframe을 넣은 element를 보이게 한다. + element_wrap.style.display = 'block'; + break; + case 2: //새창으로 띄우기 + new daum.Postcode({ + oncomplete: function (data) { + complete_fn(data); + } + }).open(); + break; + default: //iframe을 이용하여 레이어 띄우기 + var rayer_id = 'daum_juso_rayer' + frm_zip, + element_layer = document.getElementById(rayer_id); + if (element_layer == null) { + element_layer = document.createElement("div"); + element_layer.setAttribute("id", rayer_id); + element_layer.style.cssText = 'display:none;border:5px solid;position:fixed;width:300px;height:460px;left:50%;margin-left:-155px;top:50%;margin-top:-235px;overflow:hidden;-webkit-overflow-scrolling:touch;z-index:10000'; + element_layer.innerHTML = '닫기 버튼'; + document.body.appendChild(element_layer); + jQuery("#" + rayer_id).off("click", ".close_daum_juso").on("click", ".close_daum_juso", function (e) { + e.preventDefault(); + jQuery(this).parent().hide(); + }); + } + + new daum.Postcode({ + oncomplete: function (data) { + complete_fn(data); + // iframe을 넣은 element를 안보이게 한다. + element_layer.style.display = 'none'; + }, + width: '100%', + height: '100%' + }).embed(element_layer); + + // iframe을 넣은 element를 보이게 한다. + element_layer.style.display = 'block'; + } } /** * 새로운 비밀번호 분실 창 : 101123 **/ -win_password_lost = function(href) -{ - var new_win = window.open(href, 'win_password_lost', 'width=617, height=330, scrollbars=1'); - new_win.focus(); +win_password_lost = function (href) { + var new_win = window.open(href, 'win_password_lost', 'width=617, height=330, scrollbars=1'); + new_win.focus(); } /** * 설문조사 결과 **/ -var win_poll = function(href) { - var new_win = window.open(href, 'win_poll', 'width=616, height=500, scrollbars=1'); - new_win.focus(); +var win_poll = function (href) { + var new_win = window.open(href, 'win_poll', 'width=616, height=500, scrollbars=1'); + new_win.focus(); } /** * 스크린리더 미사용자를 위한 스크립트 - 지운아빠 2013-04-22 * alt 값만 갖는 그래픽 링크에 마우스오버 시 title 값 부여, 마우스아웃 시 title 값 제거 **/ -$(function() { - $('a img').mouseover(function() { - $a_img_title = $(this).attr('alt'); - $(this).attr('title', $a_img_title); - }).mouseout(function() { - $(this).attr('title', ''); - }); +$(function () { + $('a img').mouseover(function () { + $a_img_title = $(this).attr('alt'); + $(this).attr('title', $a_img_title); + }).mouseout(function () { + $(this).attr('title', ''); + }); }); /** * 텍스트 리사이즈 **/ -function font_resize(id, rmv_class, add_class) -{ - var $el = $("#"+id); +function font_resize(id, rmv_class, add_class) { + var $el = $("#" + id); - $el.removeClass(rmv_class).addClass(add_class); + $el.removeClass(rmv_class).addClass(add_class); - set_cookie("ck_font_resize_rmv_class", rmv_class, 1, g5_cookie_domain); - set_cookie("ck_font_resize_add_class", add_class, 1, g5_cookie_domain); + set_cookie("ck_font_resize_rmv_class", rmv_class, 1, g5_cookie_domain); + set_cookie("ck_font_resize_add_class", add_class, 1, g5_cookie_domain); } /** * 댓글 수정 토큰 **/ -function set_comment_token(f) -{ - if(typeof f.token === "undefined") - $(f).prepend(''); +function set_comment_token(f) { + if (typeof f.token === "undefined") + $(f).prepend(''); - $.ajax({ - url: g5_bbs_url+"/ajax.comment_token.php", - type: "GET", - dataType: "json", - async: false, - cache: false, - success: function(data, textStatus) { - f.token.value = data.token; - } - }); + $.ajax({ + url: g5_bbs_url + "/ajax.comment_token.php", + type: "GET", + dataType: "json", + async: false, + cache: false, + success: function (data, textStatus) { + f.token.value = data.token; + } + }); } -$(function(){ - $(".win_point").click(function() { - win_point(this.href); - return false; - }); +$(function () { + $(".win_point").click(function () { + win_point(this.href); + return false; + }); - $(".win_memo").click(function() { - win_memo(this.href); - return false; - }); + $(".win_memo").click(function () { + win_memo(this.href); + return false; + }); - $(".win_email").click(function() { - win_email(this.href); - return false; - }); + $(".win_email").click(function () { + win_email(this.href); + return false; + }); - $(".win_scrap").click(function() { - win_scrap(this.href); - return false; - }); + $(".win_scrap").click(function () { + win_scrap(this.href); + return false; + }); - $(".win_profile").click(function() { - win_profile(this.href); - return false; - }); + $(".win_profile").click(function () { + win_profile(this.href); + return false; + }); - $(".win_homepage").click(function() { - win_homepage(this.href); - return false; - }); + $(".win_homepage").click(function () { + win_homepage(this.href); + return false; + }); - $(".win_password_lost").click(function() { - win_password_lost(this.href); - return false; - }); + $(".win_password_lost").click(function () { + win_password_lost(this.href); + return false; + }); - /* - $(".win_poll").click(function() { - win_poll(this.href); - return false; - }); - */ + /* + $(".win_poll").click(function() { + win_poll(this.href); + return false; + }); + */ - // 사이드뷰 - var sv_hide = false; - $(".sv_member, .sv_guest").click(function() { - $(".sv").removeClass("sv_on"); - $(this).closest(".sv_wrap").find(".sv").addClass("sv_on"); - }); + // 사이드뷰 + var sv_hide = false; + $(".sv_member, .sv_guest").click(function () { + $(".sv").removeClass("sv_on"); + $(this).closest(".sv_wrap").find(".sv").addClass("sv_on"); + }); - $(".sv, .sv_wrap").hover( - function() { - sv_hide = false; - }, - function() { - sv_hide = true; - } - ); + $(".sv, .sv_wrap").hover( + function () { + sv_hide = false; + }, + function () { + sv_hide = true; + } + ); - $(".sv_member, .sv_guest").focusin(function() { - sv_hide = false; - $(".sv").removeClass("sv_on"); - $(this).closest(".sv_wrap").find(".sv").addClass("sv_on"); - }); + $(".sv_member, .sv_guest").focusin(function () { + sv_hide = false; + $(".sv").removeClass("sv_on"); + $(this).closest(".sv_wrap").find(".sv").addClass("sv_on"); + }); - $(".sv a").focusin(function() { - sv_hide = false; - }); + $(".sv a").focusin(function () { + sv_hide = false; + }); - $(".sv a").focusout(function() { - sv_hide = true; - }); + $(".sv a").focusout(function () { + sv_hide = true; + }); - // 셀렉트 ul - var sel_hide = false; - $('.sel_btn').click(function() { - $('.sel_ul').removeClass('sel_on'); - $(this).siblings('.sel_ul').addClass('sel_on'); - }); + // 셀렉트 ul + var sel_hide = false; + $('.sel_btn').click(function () { + $('.sel_ul').removeClass('sel_on'); + $(this).siblings('.sel_ul').addClass('sel_on'); + }); - $(".sel_wrap").hover( - function() { - sel_hide = false; - }, - function() { - sel_hide = true; - } - ); + $(".sel_wrap").hover( + function () { + sel_hide = false; + }, + function () { + sel_hide = true; + } + ); - $('.sel_a').focusin(function() { - sel_hide = false; - }); + $('.sel_a').focusin(function () { + sel_hide = false; + }); - $('.sel_a').focusout(function() { - sel_hide = true; - }); + $('.sel_a').focusout(function () { + sel_hide = true; + }); - $(document).click(function() { - if(sv_hide) { // 사이드뷰 해제 - $(".sv").removeClass("sv_on"); - } - if (sel_hide) { // 셀렉트 ul 해제 - $('.sel_ul').removeClass('sel_on'); - } - }); + $(document).click(function () { + if (sv_hide) { // 사이드뷰 해제 + $(".sv").removeClass("sv_on"); + } + if (sel_hide) { // 셀렉트 ul 해제 + $('.sel_ul').removeClass('sel_on'); + } + }); - $(document).focusin(function() { - if(sv_hide) { // 사이드뷰 해제 - $(".sv").removeClass("sv_on"); - } - if (sel_hide) { // 셀렉트 ul 해제 - $('.sel_ul').removeClass('sel_on'); - } - }); + $(document).focusin(function () { + if (sv_hide) { // 사이드뷰 해제 + $(".sv").removeClass("sv_on"); + } + if (sel_hide) { // 셀렉트 ul 해제 + $('.sel_ul').removeClass('sel_on'); + } + }); - $(document).on( "keyup change", "textarea#wr_content[maxlength]", function(){ - var str = $(this).val(); - var mx = parseInt($(this).attr("maxlength")); - if (str.length > mx) { - $(this).val(str.substr(0, mx)); - return false; - } - }); + $(document).on("keyup change", "textarea#wr_content[maxlength]", function () { + var str = $(this).val(); + var mx = parseInt($(this).attr("maxlength")); + if (str.length > mx) { + $(this).val(str.substr(0, mx)); + return false; + } + }); }); -function get_write_token(bo_table) -{ - var token = ""; +function get_write_token(bo_table) { + var token = ""; - $.ajax({ - type: "POST", - url: g5_bbs_url+"/write_token.php", - data: { bo_table: bo_table }, - cache: false, - async: false, - dataType: "json", - success: function(data) { - if(data.error) { - alert(data.error); - if(data.url) - document.location.href = data.url; + $.ajax({ + type: "POST", + url: g5_bbs_url + "/write_token.php", + data: { bo_table: bo_table }, + cache: false, + async: false, + dataType: "json", + success: function (data) { + if (data.error) { + alert(data.error); + if (data.url) + document.location.href = data.url; - return false; - } + return false; + } - token = data.token; - } - }); + token = data.token; + } + }); - return token; + return token; } -$(function() { - $(document).on("click", "form[name=fwrite] input:submit, form[name=fwrite] button:submit, form[name=fwrite] input:image", function() { - var f = this.form; - var bo_table = f.bo_table.value; - var token = get_write_token(bo_table); +$(function () { + $(document).on("click", "form[name=fwrite] input:submit, form[name=fwrite] button:submit, form[name=fwrite] input:image", function () { + var f = this.form; + var bo_table = f.bo_table.value; + var token = get_write_token(bo_table); - if(!token) { - alert("토큰 정보가 올바르지 않습니다."); - return false; - } + if (!token) { + alert("토큰 정보가 올바르지 않습니다."); + return false; + } - var $f = $(f); + var $f = $(f); - if(typeof f.token === "undefined") - $f.prepend(''); + if (typeof f.token === "undefined") + $f.prepend(''); - $f.find("input[name=token]").val(token); + $f.find("input[name=token]").val(token); - return true; - }); + return true; + }); }); @@ -745,59 +704,59 @@ $(function() { function ajax_load(url, obj, list_id, rel_id, etc_value) { - var keyword = obj.value; - var obj_id = obj.getAttribute('id'); - var list_obj = $('#'+list_id+' .list'); - - if(typeof(etc_value) == 'undefined') { - etc_value = ''; - } - - $.ajax({ - type: 'get' - , async: true - , url: url+"?keyword="+keyword+"&input_obj="+obj_id+"&output_obj="+rel_id+"&list_obj="+list_id+"&option="+etc_value - , beforeSend: function() { - //list_obj.empty(); - } - , success: function(data) { - var response = data.trim(); - if(response) { - list_obj.html(response); - list_obj.focus(); - } else { - list_obj.empty(); - } - } - , error: function(data, status, err) { } - , complete: function() { } - }); + var keyword = obj.value; + var obj_id = obj.getAttribute('id'); + var list_obj = $('#' + list_id + ' .list'); + + if (typeof (etc_value) == 'undefined') { + etc_value = ''; + } + + $.ajax({ + type: 'get' + , async: true + , url: url + "?keyword=" + keyword + "&input_obj=" + obj_id + "&output_obj=" + rel_id + "&list_obj=" + list_id + "&option=" + etc_value + , beforeSend: function () { + //list_obj.empty(); + } + , success: function (data) { + var response = data.trim(); + if (response) { + list_obj.html(response); + list_obj.focus(); + } else { + list_obj.empty(); + } + } + , error: function (data, status, err) { } + , complete: function () { } + }); } function get_ajax_character(obj, list_id, rel_id, etc_value) { - var url = g5_url + "/ajax/_search_character.php"; - ajax_load(url, obj, list_id, rel_id, etc_value); + var url = g5_url + "/ajax/_search_character.php"; + ajax_load(url, obj, list_id, rel_id, etc_value); } function get_ajax_title(obj, list_id, rel_id, etc_value) { - var url = g5_url + "/ajax/_search_title.php"; - ajax_load(url, obj, list_id, rel_id, etc_value); + var url = g5_url + "/ajax/_search_title.php"; + ajax_load(url, obj, list_id, rel_id, etc_value); } function get_ajax_item(obj, list_id, rel_id, etc_value) { - var url = g5_url + "/ajax/_search_item.php"; - ajax_load(url, obj, list_id, rel_id, etc_value); + var url = g5_url + "/ajax/_search_item.php"; + ajax_load(url, obj, list_id, rel_id, etc_value); } function get_ajax_member(obj, list_id, rel_id, etc_value) { - var url = g5_url + "/ajax/_search_member.php"; - ajax_load(url, obj, list_id, rel_id, etc_value); + var url = g5_url + "/ajax/_search_member.php"; + ajax_load(url, obj, list_id, rel_id, etc_value); } function select_item(list_id, in_id, in_value, out_id, out_value) { - document.getElementById(in_id).value = in_value; - document.getElementById(out_id).value = out_value; - $('#'+list_id+' .list').empty(); - return false; + document.getElementById(in_id).value = in_value; + document.getElementById(out_id).value = out_value; + $('#' + list_id + ' .list').empty(); + return false; } diff --git a/AvocadoEdition_Light/js/html5.js b/AvocadoEdition_Light/js/html5.js index 560aa94..323c2b7 100644 --- a/AvocadoEdition_Light/js/html5.js +++ b/AvocadoEdition_Light/js/html5.js @@ -1,3 +1,3 @@ /*! HTML5 Shiv vpre3.6 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed Uncompressed source: https://github.com/aFarkas/html5shiv */ -(function(a,b){function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f();a.createElement=function(a){if(!l.shivMethods)return c(a);var f;return b[a]?f=b[a].cloneNode():e.test(a)?f=(b[a]=c(a)).cloneNode():f=c(a),f.canHaveChildren&&!d.test(a)?g.appendChild(f):f},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/\w+/g,function(a){return c(a),g.createElement(a),'c("'+a+'")'})+");return n}")(l,g)}function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),g||(b=!j(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g;(function(){var c=b.createElement("a");c.innerHTML="",f="hidden"in c,f&&typeof injectElementWithStyles=="function"&&injectElementWithStyles("#modernizr{}",function(b){b.hidden=!0,f=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).display=="none"}),g=c.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var l={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:k};a.html5=l,k(b)})(this,document) \ No newline at end of file +(function(a,b){function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f();a.createElement=function(a){if(!l.shivMethods)return c(a);var f;return b[a]?f=b[a].cloneNode():e.test(a)?f=(b[a]=c(a)).cloneNode():f=c(a),f.canHaveChildren&&!d.test(a)?g.appendChild(f):f},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/\w+/g,function(a){return c(a),g.createElement(a),'c("'+a+'")'})+");return n}")(l,g)}function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),g||(b=!j(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g;(function(){var c=b.createElement("a");c.innerHTML="",f="hidden"in c,f&&typeof injectElementWithStyles=="function"&&injectElementWithStyles("#modernizr{}",function(b){b.hidden=!0,f=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).display=="none"}),g=c.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var l={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:k};a.html5=l,k(b)})(this,document) diff --git a/AvocadoEdition_Light/js/jquery.cookie.js b/AvocadoEdition_Light/js/jquery.cookie.js index 8218817..64ae295 100644 --- a/AvocadoEdition_Light/js/jquery.cookie.js +++ b/AvocadoEdition_Light/js/jquery.cookie.js @@ -6,109 +6,109 @@ * Released under the MIT license */ (function (factory) { - if (typeof define === 'function' && define.amd) { - // AMD (Register as an anonymous module) - define(['jquery'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS - module.exports = factory(require('jquery')); - } else { - // Browser globals - factory(jQuery); - } + if (typeof define === 'function' && define.amd) { + // AMD (Register as an anonymous module) + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS + module.exports = factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } }(function ($) { - var pluses = /\+/g; + var pluses = /\+/g; - function encode(s) { - return config.raw ? s : encodeURIComponent(s); - } + function encode(s) { + return config.raw ? s : encodeURIComponent(s); + } - function decode(s) { - return config.raw ? s : decodeURIComponent(s); - } + function decode(s) { + return config.raw ? s : decodeURIComponent(s); + } - function stringifyCookieValue(value) { - return encode(config.json ? JSON.stringify(value) : String(value)); - } + function stringifyCookieValue(value) { + return encode(config.json ? JSON.stringify(value) : String(value)); + } - function parseCookieValue(s) { - if (s.indexOf('"') === 0) { - // This is a quoted cookie as according to RFC2068, unescape... - s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); - } + function parseCookieValue(s) { + if (s.indexOf('"') === 0) { + // This is a quoted cookie as according to RFC2068, unescape... + s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); + } - try { - // Replace server-side written pluses with spaces. - // If we can't decode the cookie, ignore it, it's unusable. - // If we can't parse the cookie, ignore it, it's unusable. - s = decodeURIComponent(s.replace(pluses, ' ')); - return config.json ? JSON.parse(s) : s; - } catch(e) {} - } + try { + // Replace server-side written pluses with spaces. + // If we can't decode the cookie, ignore it, it's unusable. + // If we can't parse the cookie, ignore it, it's unusable. + s = decodeURIComponent(s.replace(pluses, ' ')); + return config.json ? JSON.parse(s) : s; + } catch (e) { } + } - function read(s, converter) { - var value = config.raw ? s : parseCookieValue(s); - return $.isFunction(converter) ? converter(value) : value; - } + function read(s, converter) { + var value = config.raw ? s : parseCookieValue(s); + return $.isFunction(converter) ? converter(value) : value; + } - var config = $.cookie = function (key, value, options) { + var config = $.cookie = function (key, value, options) { - // Write + // Write - if (arguments.length > 1 && !$.isFunction(value)) { - options = $.extend({}, config.defaults, options); + if (arguments.length > 1 && !$.isFunction(value)) { + options = $.extend({}, config.defaults, options); - if (typeof options.expires === 'number') { - var days = options.expires, t = options.expires = new Date(); - t.setMilliseconds(t.getMilliseconds() + days * 864e+5); - } + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setMilliseconds(t.getMilliseconds() + days * 864e+5); + } - return (document.cookie = [ - encode(key), '=', stringifyCookieValue(value), - options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE - options.path ? '; path=' + options.path : '', - options.domain ? '; domain=' + options.domain : '', - options.secure ? '; secure' : '' - ].join('')); - } + return (document.cookie = [ + encode(key), '=', stringifyCookieValue(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } - // Read + // Read - var result = key ? undefined : {}, - // To prevent the for loop in the first place assign an empty array - // in case there are no cookies at all. Also prevents odd result when - // calling $.cookie(). - cookies = document.cookie ? document.cookie.split('; ') : [], - i = 0, - l = cookies.length; + var result = key ? undefined : {}, + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. Also prevents odd result when + // calling $.cookie(). + cookies = document.cookie ? document.cookie.split('; ') : [], + i = 0, + l = cookies.length; - for (; i < l; i++) { - var parts = cookies[i].split('='), - name = decode(parts.shift()), - cookie = parts.join('='); + for (; i < l; i++) { + var parts = cookies[i].split('='), + name = decode(parts.shift()), + cookie = parts.join('='); - if (key === name) { - // If second argument (value) is a function it's a converter... - result = read(cookie, value); - break; - } + if (key === name) { + // If second argument (value) is a function it's a converter... + result = read(cookie, value); + break; + } - // Prevent storing a cookie that we couldn't decode. - if (!key && (cookie = read(cookie)) !== undefined) { - result[name] = cookie; - } - } + // Prevent storing a cookie that we couldn't decode. + if (!key && (cookie = read(cookie)) !== undefined) { + result[name] = cookie; + } + } - return result; - }; + return result; + }; - config.defaults = {}; + config.defaults = {}; - $.removeCookie = function (key, options) { - // Must not alter options, thus extending a fresh object... - $.cookie(key, '', $.extend({}, options, { expires: -1 })); - return !$.cookie(key); - }; + $.removeCookie = function (key, options) { + // Must not alter options, thus extending a fresh object... + $.cookie(key, '', $.extend({}, options, { expires: -1 })); + return !$.cookie(key); + }; })); diff --git a/AvocadoEdition_Light/js/jquery.fancylist.js b/AvocadoEdition_Light/js/jquery.fancylist.js index 242a397..ece0751 100644 --- a/AvocadoEdition_Light/js/jquery.fancylist.js +++ b/AvocadoEdition_Light/js/jquery.fancylist.js @@ -1,65 +1,63 @@ -(function($) { - $.fn.fancyList = function(element, clear) - { - var cfg = { - element: "li", - clear: "clear" - }; +(function ($) { + $.fn.fancyList = function (element, clear) { + var cfg = { + element: "li", + clear: "clear" + }; - if(typeof element == "object") - cfg = $.extend( cfg, element ); - else { - if(element) - cfg = $.extend( cfg, { element: element } ); - if(clear) - cfg = $.extend( cfg, { clear: clear } ); - } - - var $element = this.find(cfg.element); - var $this = this; - - if($element.size() < 1) - return; - - function item_arrange() - { - var $el = $element.filter(":first"); - var padding = 0; - if($el.data("padding-right") == undefined) { - padding = parseInt($el.css("padding-right")); - $el.data("padding-right", padding); - } - else - padding = $el.data("padding-right"); - - $element.css("padding-left", 0).css("padding-right", padding); - $element.filter("."+cfg.clear).removeClass(cfg.clear); - - var wrap_width = parseInt($this.width()); - var item_width = parseInt($el.outerWidth()); - var line_count = parseInt((wrap_width + padding) / item_width); - - if(line_count == 0) - return; - - var space = parseInt(wrap_width % item_width); - - if((space + padding) < item_width) { - space = wrap_width - ((item_width - padding) * line_count); - var new_padding = parseInt(space / (line_count * 2)); - - if(new_padding > padding) - $element.css("padding-left", new_padding+"px").css("padding-right", new_padding); - } - - $element.filter(":nth-child("+line_count+"n)").css("padding-right", 0); - $element.filter(":nth-child("+line_count+"n+1)").addClass(cfg.clear); - } - - item_arrange(); - - $(window).resize(function() { - item_arrange(); - }); + if (typeof element == "object") + cfg = $.extend(cfg, element); + else { + if (element) + cfg = $.extend(cfg, { element: element }); + if (clear) + cfg = $.extend(cfg, { clear: clear }); } -}(jQuery)); \ No newline at end of file + + var $element = this.find(cfg.element); + var $this = this; + + if ($element.size() < 1) + return; + + function item_arrange() { + var $el = $element.filter(":first"); + var padding = 0; + if ($el.data("padding-right") == undefined) { + padding = parseInt($el.css("padding-right")); + $el.data("padding-right", padding); + } + else + padding = $el.data("padding-right"); + + $element.css("padding-left", 0).css("padding-right", padding); + $element.filter("." + cfg.clear).removeClass(cfg.clear); + + var wrap_width = parseInt($this.width()); + var item_width = parseInt($el.outerWidth()); + var line_count = parseInt((wrap_width + padding) / item_width); + + if (line_count == 0) + return; + + var space = parseInt(wrap_width % item_width); + + if ((space + padding) < item_width) { + space = wrap_width - ((item_width - padding) * line_count); + var new_padding = parseInt(space / (line_count * 2)); + + if (new_padding > padding) + $element.css("padding-left", new_padding + "px").css("padding-right", new_padding); + } + + $element.filter(":nth-child(" + line_count + "n)").css("padding-right", 0); + $element.filter(":nth-child(" + line_count + "n+1)").addClass(cfg.clear); + } + + item_arrange(); + + $(window).resize(function () { + item_arrange(); + }); + } +}(jQuery)); diff --git a/AvocadoEdition_Light/js/jquery.menu.js b/AvocadoEdition_Light/js/jquery.menu.js index 7ec723f..dd4521e 100644 --- a/AvocadoEdition_Light/js/jquery.menu.js +++ b/AvocadoEdition_Light/js/jquery.menu.js @@ -1,109 +1,108 @@ -$(function(){ - var hide_menu = false; - var mouse_event = false; - var oldX = oldY = 0; +$(function () { + var hide_menu = false; + var mouse_event = false; + var oldX = oldY = 0; - $(document).mousemove(function(e) { - if(oldX == 0) { - oldX = e.pageX; - oldY = e.pageY; - } + $(document).mousemove(function (e) { + if (oldX == 0) { + oldX = e.pageX; + oldY = e.pageY; + } - if(oldX != e.pageX || oldY != e.pageY) { - mouse_event = true; - } - }); + if (oldX != e.pageX || oldY != e.pageY) { + mouse_event = true; + } + }); - // 주메뉴 - var $gnb = $(".gnb_1dli > a"); - $gnb.mouseover(function() { - if(mouse_event) { - $("#hd").addClass("hd_zindex"); - $(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on"); - $(this).parent().addClass("gnb_1dli_over gnb_1dli_on"); - menu_rearrange($(this).parent()); - hide_menu = false; - } - }); + // 주메뉴 + var $gnb = $(".gnb_1dli > a"); + $gnb.mouseover(function () { + if (mouse_event) { + $("#hd").addClass("hd_zindex"); + $(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on"); + $(this).parent().addClass("gnb_1dli_over gnb_1dli_on"); + menu_rearrange($(this).parent()); + hide_menu = false; + } + }); - $gnb.mouseout(function() { - hide_menu = true; - }); + $gnb.mouseout(function () { + hide_menu = true; + }); - $(".gnb_2dli").mouseover(function() { - hide_menu = false; - }); + $(".gnb_2dli").mouseover(function () { + hide_menu = false; + }); - $(".gnb_2dli").mouseout(function() { - hide_menu = true; - }); + $(".gnb_2dli").mouseout(function () { + hide_menu = true; + }); - $gnb.focusin(function() { - $("#hd").addClass("hd_zindex"); - $(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on"); - $(this).parent().addClass("gnb_1dli_over gnb_1dli_on"); - menu_rearrange($(this).parent()); - hide_menu = false; - }); + $gnb.focusin(function () { + $("#hd").addClass("hd_zindex"); + $(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on"); + $(this).parent().addClass("gnb_1dli_over gnb_1dli_on"); + menu_rearrange($(this).parent()); + hide_menu = false; + }); - $gnb.focusout(function() { - hide_menu = true; - }); + $gnb.focusout(function () { + hide_menu = true; + }); - $(".gnb_2da").focusin(function() { - $(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on"); - var $gnb_li = $(this).closest(".gnb_1dli").addClass("gnb_1dli_over gnb_1dli_on"); - menu_rearrange($(this).closest(".gnb_1dli")); - hide_menu = false; - }); + $(".gnb_2da").focusin(function () { + $(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on"); + var $gnb_li = $(this).closest(".gnb_1dli").addClass("gnb_1dli_over gnb_1dli_on"); + menu_rearrange($(this).closest(".gnb_1dli")); + hide_menu = false; + }); - $(".gnb_2da").focusout(function() { - hide_menu = true; - }); + $(".gnb_2da").focusout(function () { + hide_menu = true; + }); - $('#gnb_1dul>li').bind('mouseleave',function(){ - submenu_hide(); - }); + $('#gnb_1dul>li').bind('mouseleave', function () { + submenu_hide(); + }); - $(document).bind('click focusin',function(){ - if(hide_menu) { - submenu_hide(); - } - }); + $(document).bind('click focusin', function () { + if (hide_menu) { + submenu_hide(); + } + }); }); function submenu_hide() { - $("#hd").removeClass("hd_zindex"); - $(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on"); + $("#hd").removeClass("hd_zindex"); + $(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on"); } -function menu_rearrange(el) -{ - var width = $("#gnb_1dul").width(); - var left = w1 = w2 = 0; - var idx = $(".gnb_1dli").index(el); - var max_menu_count = 0; - var $gnb_1dli; +function menu_rearrange(el) { + var width = $("#gnb_1dul").width(); + var left = w1 = w2 = 0; + var idx = $(".gnb_1dli").index(el); + var max_menu_count = 0; + var $gnb_1dli; - for(i=0; i<=idx; i++) { - $gnb_1dli = $(".gnb_1dli:eq("+i+")"); - w1 = $gnb_1dli.outerWidth(); + for (i = 0; i <= idx; i++) { + $gnb_1dli = $(".gnb_1dli:eq(" + i + ")"); + w1 = $gnb_1dli.outerWidth(); - if($gnb_1dli.find(".gnb_2dul").size()) - w2 = $gnb_1dli.find(".gnb_2dli > a").outerWidth(true); - else - w2 = w1; + if ($gnb_1dli.find(".gnb_2dul").size()) + w2 = $gnb_1dli.find(".gnb_2dli > a").outerWidth(true); + else + w2 = w1; - if((left + w2) > width) { - if(max_menu_count == 0) - max_menu_count = i + 1; - } - - if(max_menu_count > 0 && (idx + 1) % max_menu_count == 0) { - el.removeClass("gnb_1dli_over").addClass("gnb_1dli_over2"); - left = 0; - } else { - left += w1; - } + if ((left + w2) > width) { + if (max_menu_count == 0) + max_menu_count = i + 1; } -} \ No newline at end of file + + if (max_menu_count > 0 && (idx + 1) % max_menu_count == 0) { + el.removeClass("gnb_1dli_over").addClass("gnb_1dli_over2"); + left = 0; + } else { + left += w1; + } + } +} diff --git a/AvocadoEdition_Light/js/jquery.register_form.js b/AvocadoEdition_Light/js/jquery.register_form.js index 5ca4a28..1366297 100644 --- a/AvocadoEdition_Light/js/jquery.register_form.js +++ b/AvocadoEdition_Light/js/jquery.register_form.js @@ -1,92 +1,92 @@ -var reg_mb_id_check = function() { - var result = ""; - $.ajax({ - type: "POST", - url: g5_bbs_url+"/ajax.mb_id.php", - data: { - "reg_mb_id": encodeURIComponent($("#reg_mb_id").val()) - }, - cache: false, - async: false, - success: function(data) { - result = data; - } - }); - return result; +var reg_mb_id_check = function () { + var result = ""; + $.ajax({ + type: "POST", + url: g5_bbs_url + "/ajax.mb_id.php", + data: { + "reg_mb_id": encodeURIComponent($("#reg_mb_id").val()) + }, + cache: false, + async: false, + success: function (data) { + result = data; + } + }); + return result; } // 추천인 검사 -var reg_mb_recommend_check = function() { - var result = ""; - $.ajax({ - type: "POST", - url: g5_bbs_url+"/ajax.mb_recommend.php", - data: { - "reg_mb_recommend": encodeURIComponent($("#reg_mb_recommend").val()) - }, - cache: false, - async: false, - success: function(data) { - result = data; - } - }); - return result; +var reg_mb_recommend_check = function () { + var result = ""; + $.ajax({ + type: "POST", + url: g5_bbs_url + "/ajax.mb_recommend.php", + data: { + "reg_mb_recommend": encodeURIComponent($("#reg_mb_recommend").val()) + }, + cache: false, + async: false, + success: function (data) { + result = data; + } + }); + return result; } -var reg_mb_nick_check = function() { - var result = ""; - $.ajax({ - type: "POST", - url: g5_bbs_url+"/ajax.mb_nick.php", - data: { - "reg_mb_nick": ($("#reg_mb_nick").val()), - "reg_mb_id": encodeURIComponent($("#reg_mb_id").val()) - }, - cache: false, - async: false, - success: function(data) { - result = data; - } - }); - return result; +var reg_mb_nick_check = function () { + var result = ""; + $.ajax({ + type: "POST", + url: g5_bbs_url + "/ajax.mb_nick.php", + data: { + "reg_mb_nick": ($("#reg_mb_nick").val()), + "reg_mb_id": encodeURIComponent($("#reg_mb_id").val()) + }, + cache: false, + async: false, + success: function (data) { + result = data; + } + }); + return result; } -var reg_mb_email_check = function() { - var result = ""; - $.ajax({ - type: "POST", - url: g5_bbs_url+"/ajax.mb_email.php", - data: { - "reg_mb_email": $("#reg_mb_email").val(), - "reg_mb_id": encodeURIComponent($("#reg_mb_id").val()) - }, - cache: false, - async: false, - success: function(data) { - result = data; - } - }); - return result; +var reg_mb_email_check = function () { + var result = ""; + $.ajax({ + type: "POST", + url: g5_bbs_url + "/ajax.mb_email.php", + data: { + "reg_mb_email": $("#reg_mb_email").val(), + "reg_mb_id": encodeURIComponent($("#reg_mb_id").val()) + }, + cache: false, + async: false, + success: function (data) { + result = data; + } + }); + return result; } -var reg_mb_hp_check = function() { - var result = ""; - $.ajax({ - type: "POST", - url: g5_bbs_url+"/ajax.mb_hp.php", - data: { - "reg_mb_hp": $("#reg_mb_hp").val(), - "reg_mb_id": encodeURIComponent($("#reg_mb_id").val()) - }, - cache: false, - async: false, - success: function(data) { - result = data; - } - }); - return result; -} \ No newline at end of file +var reg_mb_hp_check = function () { + var result = ""; + $.ajax({ + type: "POST", + url: g5_bbs_url + "/ajax.mb_hp.php", + data: { + "reg_mb_hp": $("#reg_mb_hp").val(), + "reg_mb_id": encodeURIComponent($("#reg_mb_id").val()) + }, + cache: false, + async: false, + success: function (data) { + result = data; + } + }); + return result; +} diff --git a/AvocadoEdition_Light/js/jquery.rwdImageMaps.js b/AvocadoEdition_Light/js/jquery.rwdImageMaps.js index 4f3b3f7..db78357 100644 --- a/AvocadoEdition_Light/js/jquery.rwdImageMaps.js +++ b/AvocadoEdition_Light/js/jquery.rwdImageMaps.js @@ -8,60 +8,60 @@ * http://mattstow.com * Licensed under the MIT license */ -;(function($) { - $.fn.rwdImageMaps = function() { - var $img = this; +; (function ($) { + $.fn.rwdImageMaps = function () { + var $img = this; - var rwdImageMap = function() { - $img.each(function() { - if (typeof($(this).attr('usemap')) == 'undefined') - return; + var rwdImageMap = function () { + $img.each(function () { + if (typeof ($(this).attr('usemap')) == 'undefined') + return; - var that = this, - $that = $(that); + var that = this, + $that = $(that); - // Since WebKit doesn't know the height until after the image has loaded, perform everything in an onload copy - $('').on('load', function() { - var attrW = 'width', - attrH = 'height', - w = $that.attr(attrW), - h = $that.attr(attrH); + // Since WebKit doesn't know the height until after the image has loaded, perform everything in an onload copy + $('').on('load', function () { + var attrW = 'width', + attrH = 'height', + w = $that.attr(attrW), + h = $that.attr(attrH); - if (!w || !h) { - var temp = new Image(); - temp.src = $that.attr('src'); - if (!w) - w = temp.width; - if (!h) - h = temp.height; - } + if (!w || !h) { + var temp = new Image(); + temp.src = $that.attr('src'); + if (!w) + w = temp.width; + if (!h) + h = temp.height; + } - var wPercent = $that.width()/100, - hPercent = $that.height()/100, - map = $that.attr('usemap').replace('#', ''), - c = 'coords'; + var wPercent = $that.width() / 100, + hPercent = $that.height() / 100, + map = $that.attr('usemap').replace('#', ''), + c = 'coords'; - $('map[name="' + map + '"]').find('area').each(function() { - var $this = $(this); - if (!$this.data(c)) - $this.data(c, $this.attr(c)); + $('map[name="' + map + '"]').find('area').each(function () { + var $this = $(this); + if (!$this.data(c)) + $this.data(c, $this.attr(c)); - var coords = $this.data(c).split(','), - coordsPercent = new Array(coords.length); + var coords = $this.data(c).split(','), + coordsPercent = new Array(coords.length); - for (var i = 0; i < coordsPercent.length; ++i) { - if (i % 2 === 0) - coordsPercent[i] = parseInt(((coords[i]/w)*100)*wPercent); - else - coordsPercent[i] = parseInt(((coords[i]/h)*100)*hPercent); - } - $this.attr(c, coordsPercent.toString()); - }); - }).attr('src', $that.attr('src')); - }); - }; - $(window).resize(rwdImageMap).trigger('resize'); + for (var i = 0; i < coordsPercent.length; ++i) { + if (i % 2 === 0) + coordsPercent[i] = parseInt(((coords[i] / w) * 100) * wPercent); + else + coordsPercent[i] = parseInt(((coords[i] / h) * 100) * hPercent); + } + $this.attr(c, coordsPercent.toString()); + }); + }).attr('src', $that.attr('src')); + }); + }; + $(window).resize(rwdImageMap).trigger('resize'); - return this; - }; + return this; + }; })(jQuery); diff --git a/AvocadoEdition_Light/js/jquery.sms_paging.js b/AvocadoEdition_Light/js/jquery.sms_paging.js index 9f7da04..266e25a 100644 --- a/AvocadoEdition_Light/js/jquery.sms_paging.js +++ b/AvocadoEdition_Light/js/jquery.sms_paging.js @@ -4,90 +4,90 @@ * http://composite.tistory.com * This project licensed under a MIT License. **************************************************************************************/; -(function($){ - //default properties. - var a=/a/i,defs={ - liitem:'li', item:'a',next:'[>{5}]',prev:'[{4}<]',format:'[{0}]', - itemClass:'',appendhtml:'',sideClass:'paging-side',prevClass:'paging-side', - itemCurrent:'active',length:10,max:1,current:1,append:false - ,href:'#{0}',event:true,first:'[1<<]',last:'[>>{6}]' - },InStr=function(strSearch, charSearchFor) { - return strSearch.indexOf(charSearchFor); - },format=function(str){ - var arg=arguments; - return str.replace(/\{(\d+)\}/g,function(m,d){ - if(+d<0) return m; - else return arg[+d+1]||""; - }); - },item,make=function(op,page,cls,str){ - var is_current = false; - if( InStr( cls , op.itemCurrent) > -1 ){ - item=document.createElement("strong"); - is_current = true; - } else { - item=document.createElement(op.item); - } - item.className=cls; - item.innerHTML=format(str,page,op.length,op.start,op.end,op.start-1,op.end+1,op.max); - if(a.test(op.item)) item.href=format(op.href,page); - if(op.event){ - $(item).bind('click',function(e){ - var fired=true; - if($.isFunction(op.onclick)) fired=op.onclick.call(item,e,page,op); - if(fired==undefined||fired) - op.origin.paging($.extend({},op,{current:page})); - return fired; - }); - /* - $liitem= $(document.createElement(op.liitem)); - $liitem.addClass(cls); - $liitem.append($(item)); - */ - if(op.appendhtml){ - $(item).append(op.appendhtml); - } - $(item).appendTo(op.origin); - if( is_current ){ - $(item).prepend('열린'); - } else { - (op.origin).append('\n'); - } - //bind event for each elements. - var ev='on'; - switch(str){ - case op.prev:ev+='prev';break; - case op.next:ev+='next';break; - case op.first:ev+='first';break; - case op.last:ev+='last';break; - default:ev+='item';break; - } - if($.isFunction(op[ev])) op[ev].call(item,page,op); - } - return item; - }; +(function ($) { + //default properties. + var a = /a/i, defs = { + liitem: 'li', item: 'a', next: '[>{5}]', prev: '[{4}<]', format: '[{0}]', + itemClass: '', appendhtml: '', sideClass: 'paging-side', prevClass: 'paging-side', + itemCurrent: 'active', length: 10, max: 1, current: 1, append: false + , href: '#{0}', event: true, first: '[1<<]', last: '[>>{6}]' + }, InStr = function (strSearch, charSearchFor) { + return strSearch.indexOf(charSearchFor); + }, format = function (str) { + var arg = arguments; + return str.replace(/\{(\d+)\}/g, function (m, d) { + if (+d < 0) return m; + else return arg[+d + 1] || ""; + }); + }, item, make = function (op, page, cls, str) { + var is_current = false; + if (InStr(cls, op.itemCurrent) > -1) { + item = document.createElement("strong"); + is_current = true; + } else { + item = document.createElement(op.item); + } + item.className = cls; + item.innerHTML = format(str, page, op.length, op.start, op.end, op.start - 1, op.end + 1, op.max); + if (a.test(op.item)) item.href = format(op.href, page); + if (op.event) { + $(item).bind('click', function (e) { + var fired = true; + if ($.isFunction(op.onclick)) fired = op.onclick.call(item, e, page, op); + if (fired == undefined || fired) + op.origin.paging($.extend({}, op, { current: page })); + return fired; + }); + /* +$liitem= $(document.createElement(op.liitem)); +$liitem.addClass(cls); +$liitem.append($(item)); + */ + if (op.appendhtml) { + $(item).append(op.appendhtml); + } + $(item).appendTo(op.origin); + if (is_current) { + $(item).prepend('열린'); + } else { + (op.origin).append('\n'); + } + //bind event for each elements. + var ev = 'on'; + switch (str) { + case op.prev: ev += 'prev'; break; + case op.next: ev += 'next'; break; + case op.first: ev += 'first'; break; + case op.last: ev += 'last'; break; + default: ev += 'item'; break; + } + if ($.isFunction(op[ev])) op[ev].call(item, page, op); + } + return item; + }; - $.fn.paging=function(op){ - op=$.extend({origin:this},defs,op||{});this.html(''); - if(op.max<1) op.max=1; if(op.current<1) op.current=1; - op.start=Math.floor((op.current-1)/op.length)*op.length+1; - op.end=op.start-1+op.length; - if(op.end>op.max) op.end=op.max; - if(!op.append) this.empty(); - //prev button - if(op.current>op.length){ - //if(op.first!==false) make(op,1,op.sideClass,op.first); - make(op,op.start-1,op.prevClass,op.prev); - } - //pages button - for(var i=op.start;i<=op.end;i++){ - make(op,i,op.itemClass+(i==op.current?' '+op.itemCurrent:''),op.format); - } - //next button - if(op.current<=Math.floor(op.max/op.length)*op.length){ - if(op.max > op.length && op.max > op.end ){ make(op,op.end+1,op.sideClass,op.next); } - //if(op.last!==false) make(op,op.max,op.sideClass,op.last); - } - - //last button - }; -})(jQuery); \ No newline at end of file + $.fn.paging = function (op) { + op = $.extend({ origin: this }, defs, op || {}); this.html(''); + if (op.max < 1) op.max = 1; if (op.current < 1) op.current = 1; + op.start = Math.floor((op.current - 1) / op.length) * op.length + 1; + op.end = op.start - 1 + op.length; + if (op.end > op.max) op.end = op.max; + if (!op.append) this.empty(); + //prev button + if (op.current > op.length) { + //if(op.first!==false) make(op,1,op.sideClass,op.first); + make(op, op.start - 1, op.prevClass, op.prev); + } + //pages button + for (var i = op.start; i <= op.end; i++) { + make(op, i, op.itemClass + (i == op.current ? ' ' + op.itemCurrent : ''), op.format); + } + //next button + if (op.current <= Math.floor(op.max / op.length) * op.length) { + if (op.max > op.length && op.max > op.end) { make(op, op.end + 1, op.sideClass, op.next); } + //if(op.last!==false) make(op,op.max,op.sideClass,op.last); + } + + //last button + }; +})(jQuery); diff --git a/AvocadoEdition_Light/js/kakaolink.js b/AvocadoEdition_Light/js/kakaolink.js index 8ac822a..c949633 100644 --- a/AvocadoEdition_Light/js/kakaolink.js +++ b/AvocadoEdition_Light/js/kakaolink.js @@ -1,10 +1,9 @@ -function kakaolink_send(text, url) -{ - // 카카오톡 링크 버튼을 생성합니다. 처음 한번만 호출하면 됩니다. - Kakao.Link.sendTalkLink({ - webLink : { - text: String(text), - url: url // 앱 설정의 웹 플랫폼에 등록한 도메인의 URL이어야 합니다. - } - }); -} \ No newline at end of file +function kakaolink_send(text, url) { + // 카카오톡 링크 버튼을 생성합니다. 처음 한번만 호출하면 됩니다. + Kakao.Link.sendTalkLink({ + webLink: { + text: String(text), + url: url // 앱 설정의 웹 플랫폼에 등록한 도메인의 URL이어야 합니다. + } + }); +} diff --git a/AvocadoEdition_Light/js/md5.js b/AvocadoEdition_Light/js/md5.js index 87477cd..bbefc5b 100644 --- a/AvocadoEdition_Light/js/md5.js +++ b/AvocadoEdition_Light/js/md5.js @@ -1,165 +1,156 @@ -if (typeof(MD5_JS) == 'undefined') // 한번만 실행 +if (typeof (MD5_JS) == 'undefined') // 한번만 실행 { - var MD5_JS = true; + var MD5_JS = true; - /* See http://pajhome.org.uk/crypt/md5 for more info */ - var hexcase = 0; - var b64pad = ""; - var chrsz = 8; + /* See http://pajhome.org.uk/crypt/md5 for more info */ + var hexcase = 0; + var b64pad = ""; + var chrsz = 8; - function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} - function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));} - function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));} - function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } - function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } - function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); } + function hex_md5(s) { return binl2hex(core_md5(str2binl(s), s.length * chrsz)); } + function b64_md5(s) { return binl2b64(core_md5(str2binl(s), s.length * chrsz)); } + function str_md5(s) { return binl2str(core_md5(str2binl(s), s.length * chrsz)); } + function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } + function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } + function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); } - function core_md5(x, len) - { - x[len >> 5] |= 0x80 << ((len) % 32); x[(((len + 64) >>> 9) << 4) + 14] = len; - var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; - for(var i = 0; i < x.length; i += 16) - { - var olda = a; var oldb = b; var oldc = c; var oldd = d; - a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); - d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); - c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); - b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); - a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); - d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); - c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); - b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); - a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); - d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); - c = md5_ff(c, d, a, b, x[i+10], 17, -42063); - b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); - a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); - d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); - c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); - b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); + function core_md5(x, len) { + x[len >> 5] |= 0x80 << ((len) % 32); x[(((len + 64) >>> 9) << 4) + 14] = len; + var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; + for (var i = 0; i < x.length; i += 16) { + var olda = a; var oldb = b; var oldc = c; var oldd = d; + a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936); + d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329); - a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); - d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); - c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); - b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); - a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); - d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); - c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); - b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); - a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); - d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); - c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); - b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); - a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); - d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); - c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); - b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); + a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302); + a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734); - a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); - d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); - c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); - b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); - a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); - d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); - c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); - b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); - a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); - d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); - c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); - b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); - a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); - d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); - c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); - b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); + a = md5_hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222); + c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651); - a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); - d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); - c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); - b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); - a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); - d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); - c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); - b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); - a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); - d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); - c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); - b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); - a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); - d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); - c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); - b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); + a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844); + d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551); - a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); - } - return Array(a, b, c, d); + a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); + } + return Array(a, b, c, d); + } + + function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); } + function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); } + function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); } + function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); } + function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); } + + function core_hmac_md5(key, data) { + var bkey = str2binl(key); + if (bkey.length > 16) + bkey = core_md5(bkey, key.length * chrsz); + + var ipad = Array(16), opad = Array(16); + for (var i = 0; i < 16; i++) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; } - function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); } - function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); } - function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); } - function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); } - function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); } + var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); + return core_md5(opad.concat(hash), 512 + 128); + } - function core_hmac_md5(key, data) { - var bkey = str2binl(key); - if(bkey.length > 16) - bkey = core_md5(bkey, key.length * chrsz); + function safe_add(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); } + function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); } - var ipad = Array(16), opad = Array(16); - for(var i = 0; i < 16; i++) - { - ipad[i] = bkey[i] ^ 0x36363636; - opad[i] = bkey[i] ^ 0x5C5C5C5C; - } + function str2binl(str) { + var bin = Array(); var mask = (1 << chrsz) - 1; + for (var i = 0; i < str.length * chrsz; i += chrsz) + bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (i % 32); + return bin; + } - var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); - return core_md5(opad.concat(hash), 512 + 128); + function binl2str(bin) { + var str = ""; var mask = (1 << chrsz) - 1; + for (var i = 0; i < bin.length * 32; i += chrsz) + str += String.fromCharCode((bin[i >> 5] >>> (i % 32)) & mask); return str; + } + + + function binl2hex(binarray) { + var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var str = ""; + for (var i = 0; i < binarray.length * 4; i++) + str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF); + return str; + } + + function binl2b64(binarray) { + var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var str = ""; + for (var i = 0; i < binarray.length * 4; i += 3) { + var triplet = (((binarray[i >> 2] >> 8 * (i % 4)) & 0xFF) << 16) + | (((binarray[i + 1 >> 2] >> 8 * ((i + 1) % 4)) & 0xFF) << 8) + | ((binarray[i + 2 >> 2] >> 8 * ((i + 2) % 4)) & 0xFF); + for (var j = 0; j < 4; j++) { + if (i * 8 + j * 6 > binarray.length * 32) + str += b64pad; + else + str += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F); + } } - - function safe_add(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); } - function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); } - - function str2binl(str) - { - var bin = Array(); var mask = (1 << chrsz) - 1; - for(var i = 0; i < str.length * chrsz; i += chrsz) - bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); - return bin; - } - - function binl2str(bin) - { - var str = ""; var mask = (1 << chrsz) - 1; - for(var i = 0; i < bin.length * 32; i += chrsz) - str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); return str; - } - - - function binl2hex(binarray) - { - var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var str = ""; - for(var i = 0; i < binarray.length * 4; i++) - str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); - return str; - } - - function binl2b64(binarray) - { - var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i += 3) - { - var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) - | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) - | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); - for(var j = 0; j < 4; j++) - { - if(i * 8 + j * 6 > binarray.length * 32) - str += b64pad; - else - str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); - } - } - return str; - } -} \ No newline at end of file + return str; + } +} diff --git a/AvocadoEdition_Light/js/swiper.js b/AvocadoEdition_Light/js/swiper.js index d9a9546..d6814e1 100644 --- a/AvocadoEdition_Light/js/swiper.js +++ b/AvocadoEdition_Light/js/swiper.js @@ -12,9 +12,10 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.Swiper = factory()); -}(this, function () { 'use strict'; + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.Swiper = factory()); +}(this, function () { + 'use strict'; /** * SSR Window 1.0.1 @@ -29,10 +30,10 @@ */ var doc = (typeof document === 'undefined') ? { body: {}, - addEventListener: function addEventListener() {}, - removeEventListener: function removeEventListener() {}, + addEventListener: function addEventListener() { }, + removeEventListener: function removeEventListener() { }, activeElement: { - blur: function blur() {}, + blur: function blur() { }, nodeName: '', }, querySelector: function querySelector() { @@ -46,7 +47,7 @@ }, createEvent: function createEvent() { return { - initEvent: function initEvent() {}, + initEvent: function initEvent() { }, }; }, createElement: function createElement() { @@ -54,7 +55,7 @@ children: [], childNodes: [], style: {}, - setAttribute: function setAttribute() {}, + setAttribute: function setAttribute() { }, getElementsByTagName: function getElementsByTagName() { return []; }, @@ -73,8 +74,8 @@ CustomEvent: function CustomEvent() { return this; }, - addEventListener: function addEventListener() {}, - removeEventListener: function removeEventListener() {}, + addEventListener: function addEventListener() { }, + removeEventListener: function removeEventListener() { }, getComputedStyle: function getComputedStyle() { return { getPropertyValue: function getPropertyValue() { @@ -82,11 +83,11 @@ }, }; }, - Image: function Image() {}, - Date: function Date() {}, + Image: function Image() { }, + Date: function Date() { }, screen: {}, - setTimeout: function setTimeout() {}, - clearTimeout: function clearTimeout() {}, + setTimeout: function setTimeout() { }, + clearTimeout: function clearTimeout() { }, } : window; // eslint-disable-line /** @@ -123,7 +124,7 @@ } } if (selector) { - // String + // String if (typeof selector === 'string') { var els; var tempParent; @@ -297,7 +298,7 @@ var assign; var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + while (len--) args[len] = arguments[len]; var eventType = args[0]; var targetSelector = args[1]; var listener = args[2]; @@ -365,7 +366,7 @@ var assign; var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + while (len--) args[len] = arguments[len]; var eventType = args[0]; var targetSelector = args[1]; var listener = args[2]; @@ -408,7 +409,7 @@ } function trigger() { var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + while (len--) args[len] = arguments[len]; var events = args[0].split(' '); var eventData = args[1]; @@ -627,7 +628,7 @@ } function append() { var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + while (len--) args[len] = arguments[len]; var newChild; @@ -798,7 +799,7 @@ } function add() { var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + while (len--) args[len] = arguments[len]; var dom = this; var i; @@ -875,7 +876,7 @@ }); }, nextTick: function nextTick(callback, delay) { - if ( delay === void 0 ) delay = 0; + if (delay === void 0) delay = 0; return setTimeout(callback, delay); }, @@ -883,7 +884,7 @@ return Date.now(); }, getTranslate: function getTranslate(el, axis) { - if ( axis === void 0 ) axis = 'x'; + if (axis === void 0) axis = 'x'; var matrix; var curTransform; @@ -946,7 +947,7 @@ }, extend: function extend() { var args = [], len$1 = arguments.length; - while ( len$1-- ) args[ len$1 ] = arguments[ len$1 ]; + while (len$1--) args[len$1] = arguments[len$1]; var to = Object(args[0]); for (var i = 1; i < args.length; i += 1) { @@ -1008,7 +1009,7 @@ }()); var SwiperClass = function SwiperClass(params) { - if ( params === void 0 ) params = {}; + if (params === void 0) params = {}; var self = this; self.params = params; @@ -1025,7 +1026,7 @@ var staticAccessors = { components: { configurable: true } }; - SwiperClass.prototype.on = function on (events, handler, priority) { + SwiperClass.prototype.on = function on(events, handler, priority) { var self = this; if (typeof handler !== 'function') { return self; } var method = priority ? 'unshift' : 'push'; @@ -1036,12 +1037,12 @@ return self; }; - SwiperClass.prototype.once = function once (events, handler, priority) { + SwiperClass.prototype.once = function once(events, handler, priority) { var self = this; if (typeof handler !== 'function') { return self; } function onceHandler() { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + var args = [], len = arguments.length; + while (len--) args[len] = arguments[len]; handler.apply(self, args); self.off(events, onceHandler); @@ -1053,7 +1054,7 @@ return self.on(events, onceHandler, priority); }; - SwiperClass.prototype.off = function off (events, handler) { + SwiperClass.prototype.off = function off(events, handler) { var self = this; if (!self.eventsListeners) { return self; } events.split(' ').forEach(function (event) { @@ -1070,9 +1071,9 @@ return self; }; - SwiperClass.prototype.emit = function emit () { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + SwiperClass.prototype.emit = function emit() { + var args = [], len = arguments.length; + while (len--) args[len] = arguments[len]; var self = this; if (!self.eventsListeners) { return self; } @@ -1103,7 +1104,7 @@ return self; }; - SwiperClass.prototype.useModulesParams = function useModulesParams (instanceParams) { + SwiperClass.prototype.useModulesParams = function useModulesParams(instanceParams) { var instance = this; if (!instance.modules) { return; } Object.keys(instance.modules).forEach(function (moduleName) { @@ -1115,8 +1116,8 @@ }); }; - SwiperClass.prototype.useModules = function useModules (modulesParams) { - if ( modulesParams === void 0 ) modulesParams = {}; + SwiperClass.prototype.useModules = function useModules(modulesParams) { + if (modulesParams === void 0) modulesParams = {}; var instance = this; if (!instance.modules) { return; } @@ -1154,9 +1155,9 @@ Class.use(components); }; - SwiperClass.installModule = function installModule (module) { - var params = [], len = arguments.length - 1; - while ( len-- > 0 ) params[ len ] = arguments[ len + 1 ]; + SwiperClass.installModule = function installModule(module) { + var params = [], len = arguments.length - 1; + while (len-- > 0) params[len] = arguments[len + 1]; var Class = this; if (!Class.prototype.modules) { Class.prototype.modules = {}; } @@ -1181,21 +1182,21 @@ return Class; }; - SwiperClass.use = function use (module) { - var params = [], len = arguments.length - 1; - while ( len-- > 0 ) params[ len ] = arguments[ len + 1 ]; + SwiperClass.use = function use(module) { + var params = [], len = arguments.length - 1; + while (len-- > 0) params[len] = arguments[len + 1]; var Class = this; if (Array.isArray(module)) { module.forEach(function (m) { return Class.installModule(m); }); return Class; } - return Class.installModule.apply(Class, [ module ].concat( params )); + return Class.installModule.apply(Class, [module].concat(params)); }; - Object.defineProperties( SwiperClass, staticAccessors ); + Object.defineProperties(SwiperClass, staticAccessors); - function updateSize () { + function updateSize() { var swiper = this; var width; var height; @@ -1225,7 +1226,7 @@ }); } - function updateSlides () { + function updateSlides() { var swiper = this; var params = swiper.params; @@ -1520,7 +1521,7 @@ } } - function updateAutoHeight (speed) { + function updateAutoHeight(speed) { var swiper = this; var activeSlides = []; var newHeight = 0; @@ -1553,7 +1554,7 @@ if (newHeight) { swiper.$wrapperEl.css('height', (newHeight + "px")); } } - function updateSlidesOffset () { + function updateSlidesOffset() { var swiper = this; var slides = swiper.slides; for (var i = 0; i < slides.length; i += 1) { @@ -1561,8 +1562,8 @@ } } - function updateSlidesProgress (translate) { - if ( translate === void 0 ) translate = (this && this.translate) || 0; + function updateSlidesProgress(translate) { + if (translate === void 0) translate = (this && this.translate) || 0; var swiper = this; var params = swiper.params; @@ -1591,8 +1592,8 @@ var slideBefore = -(offsetCenter - slide.swiperSlideOffset); var slideAfter = slideBefore + swiper.slidesSizesGrid[i]; var isVisible = (slideBefore >= 0 && slideBefore < swiper.size - 1) - || (slideAfter > 1 && slideAfter <= swiper.size) - || (slideBefore <= 0 && slideAfter >= swiper.size); + || (slideAfter > 1 && slideAfter <= swiper.size) + || (slideBefore <= 0 && slideAfter >= swiper.size); if (isVisible) { swiper.visibleSlides.push(slide); swiper.visibleSlidesIndexes.push(i); @@ -1604,7 +1605,7 @@ swiper.visibleSlides = $(swiper.visibleSlides); } - function updateProgress (translate) { + function updateProgress(translate) { var swiper = this; if (typeof translate === 'undefined') { var multiplier = swiper.rtlTranslate ? -1 : 1; @@ -1648,7 +1649,7 @@ swiper.emit('progress', progress); } - function updateSlidesClasses () { + function updateSlidesClasses() { var swiper = this; var slides = swiper.slides; @@ -1717,7 +1718,7 @@ } } - function updateActiveIndex (newActiveIndex) { + function updateActiveIndex(newActiveIndex) { var swiper = this; var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; var slidesGrid = swiper.slidesGrid; @@ -1778,7 +1779,7 @@ } } - function updateClickedSlide (e) { + function updateClickedSlide(e) { var swiper = this; var params = swiper.params; var slide = $(e.target).closest(("." + (params.slideClass)))[0]; @@ -1818,8 +1819,8 @@ updateClickedSlide: updateClickedSlide, }; - function getTranslate (axis) { - if ( axis === void 0 ) axis = this.isHorizontal() ? 'x' : 'y'; + function getTranslate(axis) { + if (axis === void 0) axis = this.isHorizontal() ? 'x' : 'y'; var swiper = this; @@ -1841,7 +1842,7 @@ return currentTranslate || 0; } - function setTranslate (translate, byController) { + function setTranslate(translate, byController) { var swiper = this; var rtl = swiper.rtlTranslate; var params = swiper.params; @@ -1886,11 +1887,11 @@ swiper.emit('setTranslate', swiper.translate, byController); } - function minTranslate () { + function minTranslate() { return (-this.snapGrid[0]); } - function maxTranslate () { + function maxTranslate() { return (-this.snapGrid[this.snapGrid.length - 1]); } @@ -1901,7 +1902,7 @@ maxTranslate: maxTranslate, }; - function setTransition (duration, byController) { + function setTransition(duration, byController) { var swiper = this; if (!swiper.params.cssMode) { @@ -1911,8 +1912,8 @@ swiper.emit('setTransition', duration, byController); } - function transitionStart (runCallbacks, direction) { - if ( runCallbacks === void 0 ) runCallbacks = true; + function transitionStart(runCallbacks, direction) { + if (runCallbacks === void 0) runCallbacks = true; var swiper = this; var activeIndex = swiper.activeIndex; @@ -1946,8 +1947,8 @@ } } - function transitionEnd$1 (runCallbacks, direction) { - if ( runCallbacks === void 0 ) runCallbacks = true; + function transitionEnd$1(runCallbacks, direction) { + if (runCallbacks === void 0) runCallbacks = true; var swiper = this; var activeIndex = swiper.activeIndex; @@ -1986,12 +1987,12 @@ transitionEnd: transitionEnd$1, }; - function slideTo (index, speed, runCallbacks, internal) { + function slideTo(index, speed, runCallbacks, internal) { var obj; - if ( index === void 0 ) index = 0; - if ( speed === void 0 ) speed = this.params.speed; - if ( runCallbacks === void 0 ) runCallbacks = true; + if (index === void 0) index = 0; + if (speed === void 0) speed = this.params.speed; + if (runCallbacks === void 0) runCallbacks = true; var swiper = this; var slideIndex = index; if (slideIndex < 0) { slideIndex = 0; } @@ -2067,7 +2068,7 @@ } else { // eslint-disable-next-line if (wrapperEl.scrollTo) { - wrapperEl.scrollTo(( obj = {}, obj[isH ? 'left' : 'top'] = -translate, obj.behavior = 'smooth', obj )); + wrapperEl.scrollTo((obj = {}, obj[isH ? 'left' : 'top'] = -translate, obj.behavior = 'smooth', obj)); } else { wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -translate; } @@ -2111,10 +2112,10 @@ return true; } - function slideToLoop (index, speed, runCallbacks, internal) { - if ( index === void 0 ) index = 0; - if ( speed === void 0 ) speed = this.params.speed; - if ( runCallbacks === void 0 ) runCallbacks = true; + function slideToLoop(index, speed, runCallbacks, internal) { + if (index === void 0) index = 0; + if (speed === void 0) speed = this.params.speed; + if (runCallbacks === void 0) runCallbacks = true; var swiper = this; var newIndex = index; @@ -2126,9 +2127,9 @@ } /* eslint no-unused-vars: "off" */ - function slideNext (speed, runCallbacks, internal) { - if ( speed === void 0 ) speed = this.params.speed; - if ( runCallbacks === void 0 ) runCallbacks = true; + function slideNext(speed, runCallbacks, internal) { + if (speed === void 0) speed = this.params.speed; + if (runCallbacks === void 0) runCallbacks = true; var swiper = this; var params = swiper.params; @@ -2144,9 +2145,9 @@ } /* eslint no-unused-vars: "off" */ - function slidePrev (speed, runCallbacks, internal) { - if ( speed === void 0 ) speed = this.params.speed; - if ( runCallbacks === void 0 ) runCallbacks = true; + function slidePrev(speed, runCallbacks, internal) { + if (speed === void 0) speed = this.params.speed; + if (runCallbacks === void 0) runCallbacks = true; var swiper = this; var params = swiper.params; @@ -2186,18 +2187,18 @@ } /* eslint no-unused-vars: "off" */ - function slideReset (speed, runCallbacks, internal) { - if ( speed === void 0 ) speed = this.params.speed; - if ( runCallbacks === void 0 ) runCallbacks = true; + function slideReset(speed, runCallbacks, internal) { + if (speed === void 0) speed = this.params.speed; + if (runCallbacks === void 0) runCallbacks = true; var swiper = this; return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal); } /* eslint no-unused-vars: "off" */ - function slideToClosest (speed, runCallbacks, internal) { - if ( speed === void 0 ) speed = this.params.speed; - if ( runCallbacks === void 0 ) runCallbacks = true; + function slideToClosest(speed, runCallbacks, internal) { + if (speed === void 0) speed = this.params.speed; + if (runCallbacks === void 0) runCallbacks = true; var swiper = this; var index = swiper.activeIndex; @@ -2217,7 +2218,7 @@ return swiper.slideTo(index, speed, runCallbacks, internal); } - function slideToClickedSlide () { + function slideToClickedSlide() { var swiper = this; var params = swiper.params; var $wrapperEl = swiper.$wrapperEl; @@ -2273,7 +2274,7 @@ slideToClickedSlide: slideToClickedSlide, }; - function loopCreate () { + function loopCreate() { var swiper = this; var params = swiper.params; var $wrapperEl = swiper.$wrapperEl; @@ -2317,7 +2318,7 @@ } } - function loopFix () { + function loopFix() { var swiper = this; var params = swiper.params; var activeIndex = swiper.activeIndex; @@ -2356,7 +2357,7 @@ swiper.allowSlideNext = allowSlideNext; } - function loopDestroy () { + function loopDestroy() { var swiper = this; var $wrapperEl = swiper.$wrapperEl; var params = swiper.params; @@ -2371,7 +2372,7 @@ loopDestroy: loopDestroy, }; - function setGrabCursor (moving) { + function setGrabCursor(moving) { var swiper = this; if (Support.touch || !swiper.params.simulateTouch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) { return; } var el = swiper.el; @@ -2381,7 +2382,7 @@ el.style.cursor = moving ? 'grabbing' : 'grab'; } - function unsetGrabCursor () { + function unsetGrabCursor() { var swiper = this; if (Support.touch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) { return; } swiper.el.style.cursor = ''; @@ -2392,7 +2393,7 @@ unsetGrabCursor: unsetGrabCursor, }; - function appendSlide (slides) { + function appendSlide(slides) { var swiper = this; var $wrapperEl = swiper.$wrapperEl; var params = swiper.params; @@ -2414,7 +2415,7 @@ } } - function prependSlide (slides) { + function prependSlide(slides) { var swiper = this; var params = swiper.params; var $wrapperEl = swiper.$wrapperEl; @@ -2441,7 +2442,7 @@ swiper.slideTo(newActiveIndex, 0, false); } - function addSlide (index, slides) { + function addSlide(index, slides) { var swiper = this; var $wrapperEl = swiper.$wrapperEl; var params = swiper.params; @@ -2496,7 +2497,7 @@ } } - function removeSlide (slidesIndexes) { + function removeSlide(slidesIndexes) { var swiper = this; var params = swiper.params; var $wrapperEl = swiper.$wrapperEl; @@ -2539,7 +2540,7 @@ } } - function removeAllSlides () { + function removeAllSlides() { var swiper = this; var slidesIndexes = []; @@ -2670,7 +2671,7 @@ return device; }()); - function onTouchStart (event) { + function onTouchStart(event) { var swiper = this; var data = swiper.touchEventsData; var params = swiper.params; @@ -2710,7 +2711,7 @@ if ( edgeSwipeDetection && ((startX <= edgeSwipeThreshold) - || (startX >= win.screen.width - edgeSwipeThreshold)) + || (startX >= win.screen.width - edgeSwipeThreshold)) ) { return; } @@ -2749,7 +2750,7 @@ swiper.emit('touchStart', e); } - function onTouchMove (event) { + function onTouchMove(event) { var swiper = this; var data = swiper.touchEventsData; var params = swiper.params; @@ -2820,7 +2821,7 @@ var diffX = touches.currentX - touches.startX; var diffY = touches.currentY - touches.startY; - if (swiper.params.threshold && Math.sqrt((Math.pow( diffX, 2 )) + (Math.pow( diffY, 2 ))) < swiper.params.threshold) { return; } + if (swiper.params.threshold && Math.sqrt((Math.pow(diffX, 2)) + (Math.pow(diffY, 2))) < swiper.params.threshold) { return; } if (typeof data.isScrolling === 'undefined') { var touchAngle; @@ -2892,10 +2893,10 @@ } if ((diff > 0 && data.currentTranslate > swiper.minTranslate())) { disableParentSwiper = false; - if (params.resistance) { data.currentTranslate = (swiper.minTranslate() - 1) + (Math.pow( (-swiper.minTranslate() + data.startTranslate + diff), resistanceRatio )); } + if (params.resistance) { data.currentTranslate = (swiper.minTranslate() - 1) + (Math.pow((-swiper.minTranslate() + data.startTranslate + diff), resistanceRatio)); } } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) { disableParentSwiper = false; - if (params.resistance) { data.currentTranslate = (swiper.maxTranslate() + 1) - (Math.pow( (swiper.maxTranslate() - data.startTranslate - diff), resistanceRatio )); } + if (params.resistance) { data.currentTranslate = (swiper.maxTranslate() + 1) - (Math.pow((swiper.maxTranslate() - data.startTranslate - diff), resistanceRatio)); } } if (disableParentSwiper) { @@ -2954,7 +2955,7 @@ swiper.setTranslate(data.currentTranslate); } - function onTouchEnd (event) { + function onTouchEnd(event) { var swiper = this; var data = swiper.touchEventsData; @@ -3228,7 +3229,7 @@ } } - function onResize () { + function onResize() { var swiper = this; var params = swiper.params; @@ -3282,7 +3283,7 @@ } } - function onClick (e) { + function onClick(e) { var swiper = this; if (!swiper.allowClick) { if (swiper.params.preventClicks) { e.preventDefault(); } @@ -3293,7 +3294,7 @@ } } - function onScroll () { + function onScroll() { var swiper = this; var wrapperEl = swiper.wrapperEl; swiper.previousTranslate = swiper.translate; @@ -3418,11 +3419,11 @@ detachEvents: detachEvents, }; - function setBreakpoint () { + function setBreakpoint() { var swiper = this; var activeIndex = swiper.activeIndex; var initialized = swiper.initialized; - var loopedSlides = swiper.loopedSlides; if ( loopedSlides === void 0 ) loopedSlides = 0; + var loopedSlides = swiper.loopedSlides; if (loopedSlides === void 0) loopedSlides = 0; var params = swiper.params; var $el = swiper.$el; var breakpoints = params.breakpoints; @@ -3487,7 +3488,7 @@ } } - function getBreakpoint (breakpoints) { + function getBreakpoint(breakpoints) { // Get breakpoint for window width if (!breakpoints) { return undefined; } var breakpoint = false; @@ -3507,7 +3508,7 @@ var breakpoints = { setBreakpoint: setBreakpoint, getBreakpoint: getBreakpoint }; - function addClasses () { + function addClasses() { var swiper = this; var classNames = swiper.classNames; var params = swiper.params; @@ -3551,7 +3552,7 @@ $el.addClass(classNames.join(' ')); } - function removeClasses () { + function removeClasses() { var swiper = this; var $el = swiper.$el; var classNames = swiper.classNames; @@ -3561,7 +3562,7 @@ var classes = { addClasses: addClasses, removeClasses: removeClasses }; - function loadImage (imageEl, src, srcset, sizes, checkForComplete, callback) { + function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) { var image; function onReady() { if (callback) { callback(); } @@ -3589,7 +3590,7 @@ } } - function preloadImages () { + function preloadImages() { var swiper = this; swiper.imagesToLoad = swiper.$el.find('img'); function onReady() { @@ -3792,7 +3793,7 @@ var assign; var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + while (len--) args[len] = arguments[len]; var el; var params; if (args.length === 1 && args[0].constructor && args[0].constructor === Object) { @@ -4001,13 +4002,13 @@ return swiper; } - if ( SwiperClass ) Swiper.__proto__ = SwiperClass; - Swiper.prototype = Object.create( SwiperClass && SwiperClass.prototype ); + if (SwiperClass) Swiper.__proto__ = SwiperClass; + Swiper.prototype = Object.create(SwiperClass && SwiperClass.prototype); Swiper.prototype.constructor = Swiper; - var staticAccessors = { extendedDefaults: { configurable: true },defaults: { configurable: true },Class: { configurable: true },$: { configurable: true } }; + var staticAccessors = { extendedDefaults: { configurable: true }, defaults: { configurable: true }, Class: { configurable: true }, $: { configurable: true } }; - Swiper.prototype.slidesPerViewDynamic = function slidesPerViewDynamic () { + Swiper.prototype.slidesPerViewDynamic = function slidesPerViewDynamic() { var swiper = this; var params = swiper.params; var slides = swiper.slides; @@ -4042,7 +4043,7 @@ return spv; }; - Swiper.prototype.update = function update () { + Swiper.prototype.update = function update() { var swiper = this; if (!swiper || swiper.destroyed) { return; } var snapGrid = swiper.snapGrid; @@ -4085,8 +4086,8 @@ swiper.emit('update'); }; - Swiper.prototype.changeDirection = function changeDirection (newDirection, needUpdate) { - if ( needUpdate === void 0 ) needUpdate = true; + Swiper.prototype.changeDirection = function changeDirection(newDirection, needUpdate) { + if (needUpdate === void 0) needUpdate = true; var swiper = this; var currentDirection = swiper.params.direction; @@ -4118,7 +4119,7 @@ return swiper; }; - Swiper.prototype.init = function init () { + Swiper.prototype.init = function init() { var swiper = this; if (swiper.initialized) { return; } @@ -4173,9 +4174,9 @@ swiper.emit('init'); }; - Swiper.prototype.destroy = function destroy (deleteInstance, cleanStyles) { - if ( deleteInstance === void 0 ) deleteInstance = true; - if ( cleanStyles === void 0 ) cleanStyles = true; + Swiper.prototype.destroy = function destroy(deleteInstance, cleanStyles) { + if (deleteInstance === void 0) deleteInstance = true; + if (cleanStyles === void 0) cleanStyles = true; var swiper = this; var params = swiper.params; @@ -4211,7 +4212,7 @@ params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, - params.slidePrevClass ].join(' ')) + params.slidePrevClass].join(' ')) .removeAttr('style') .removeAttr('data-swiper-slide-index'); } @@ -4234,7 +4235,7 @@ return null; }; - Swiper.extendDefaults = function extendDefaults (newDefaults) { + Swiper.extendDefaults = function extendDefaults(newDefaults) { Utils.extend(extendedDefaults, newDefaults); }; @@ -4254,7 +4255,7 @@ return $; }; - Object.defineProperties( Swiper, staticAccessors ); + Object.defineProperties(Swiper, staticAccessors); return Swiper; }(SwiperClass)); @@ -4339,7 +4340,7 @@ var Observer = { func: win.MutationObserver || win.WebkitMutationObserver, attach: function attach(target, options) { - if ( options === void 0 ) options = {}; + if (options === void 0) options = {}; var swiper = this; @@ -4706,7 +4707,7 @@ [swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiper.width, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiper.height], - [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height] ]; + [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height]]; for (var i = 0; i < swiperCoord.length; i += 1) { var point = swiperCoord[i]; if ( @@ -5391,8 +5392,8 @@ paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass); } else { paginationHTML = "" - + ' / ' - + ""; + + ' / ' + + ""; } $el.html(paginationHTML); } @@ -5982,7 +5983,7 @@ }); }, setTransition: function setTransition(duration) { - if ( duration === void 0 ) duration = this.params.speed; + if (duration === void 0) duration = this.params.speed; var swiper = this; var $el = swiper.$el; @@ -6046,7 +6047,7 @@ var y1 = e.targetTouches[0].pageY; var x2 = e.targetTouches[1].pageX; var y2 = e.targetTouches[1].pageY; - var distance = Math.sqrt((Math.pow( (x2 - x1), 2 )) + (Math.pow( (y2 - y1), 2 ))); + var distance = Math.sqrt((Math.pow((x2 - x1), 2)) + (Math.pow((y2 - y1), 2))); return distance; }, // Events @@ -6097,10 +6098,10 @@ zoom.scale = (gesture.scaleMove / gesture.scaleStart) * zoom.currentScale; } if (zoom.scale > gesture.maxRatio) { - zoom.scale = (gesture.maxRatio - 1) + (Math.pow( ((zoom.scale - gesture.maxRatio) + 1), 0.5 )); + zoom.scale = (gesture.maxRatio - 1) + (Math.pow(((zoom.scale - gesture.maxRatio) + 1), 0.5)); } if (zoom.scale < params.minRatio) { - zoom.scale = (params.minRatio + 1) - (Math.pow( ((params.minRatio - zoom.scale) + 1), 0.5 )); + zoom.scale = (params.minRatio + 1) - (Math.pow(((params.minRatio - zoom.scale) + 1), 0.5)); } gesture.$imageEl.transform(("translate3d(0,0,0) scale(" + (zoom.scale) + ")")); }, @@ -6204,17 +6205,17 @@ image.currentY = (image.touchesCurrent.y - image.touchesStart.y) + image.startY; if (image.currentX < image.minX) { - image.currentX = (image.minX + 1) - (Math.pow( ((image.minX - image.currentX) + 1), 0.8 )); + image.currentX = (image.minX + 1) - (Math.pow(((image.minX - image.currentX) + 1), 0.8)); } if (image.currentX > image.maxX) { - image.currentX = (image.maxX - 1) + (Math.pow( ((image.currentX - image.maxX) + 1), 0.8 )); + image.currentX = (image.maxX - 1) + (Math.pow(((image.currentX - image.maxX) + 1), 0.8)); } if (image.currentY < image.minY) { - image.currentY = (image.minY + 1) - (Math.pow( ((image.minY - image.currentY) + 1), 0.8 )); + image.currentY = (image.minY + 1) - (Math.pow(((image.minY - image.currentY) + 1), 0.8)); } if (image.currentY > image.maxY) { - image.currentY = (image.maxY - 1) + (Math.pow( ((image.currentY - image.maxY) + 1), 0.8 )); + image.currentY = (image.maxY - 1) + (Math.pow(((image.currentY - image.maxY) + 1), 0.8)); } // Velocity @@ -6583,7 +6584,7 @@ var Lazy = { loadInSlide: function loadInSlide(index, loadInDuplicate) { - if ( loadInDuplicate === void 0 ) loadInDuplicate = true; + if (loadInDuplicate === void 0) loadInDuplicate = true; var swiper = this; var params = swiper.params.lazy; diff --git a/AvocadoEdition_Light/js/viewimageresize.js b/AvocadoEdition_Light/js/viewimageresize.js index 382cccf..01f9b29 100644 --- a/AvocadoEdition_Light/js/viewimageresize.js +++ b/AvocadoEdition_Light/js/viewimageresize.js @@ -1,96 +1,92 @@ -(function($) { - $.fn.viewimageresize = function(selector) - { - var cfg = { - selector: "img" - }; +(function ($) { + $.fn.viewimageresize = function (selector) { + var cfg = { + selector: "img" + }; - if(typeof selector == "object") { - cfg = $.extend(cfg, selector); - } else { - if(selector) { - cfg = $.extend({ selector: selector }); - } - } + if (typeof selector == "object") { + cfg = $.extend(cfg, selector); + } else { + if (selector) { + cfg = $.extend({ selector: selector }); + } + } - var $img = this.find(cfg.selector); - var $this = this; + var $img = this.find(cfg.selector); + var $this = this; - $img.removeAttr("height") + $img.removeAttr("height") + .css("height", ""); + + function image_resize() { + var width = $this.width(); + + $img.each(function () { + if ($(this).data("width") == undefined) + $(this).data("width", $(this).width()); + + if ($(this).data("width") > width) { + $(this).removeAttr("width") + .removeAttr("height") + .css("width", "") .css("height", ""); - function image_resize() - { - var width = $this.width(); - - $img.each(function() { - if($(this).data("width") == undefined) - $(this).data("width", $(this).width()); - - if($(this).data("width") > width) { - $(this).removeAttr("width") - .removeAttr("height") - .css("width","") - .css("height", ""); - - if($(this).data("width") > width) { - $(this).css("width", "100%"); - } - } else { - $(this).attr("width", $(this).data("width")); - } - }); - } - - $(window).on("load", function() { - image_resize(); - }); - - $(window).on("resize", function() { - image_resize(); - }); - } - - $.fn.viewimageresize2 = function(selector) - { - var cfg = { - selector: "img" - }; - - if(typeof selector == "object") { - cfg = $.extend(cfg, selector); + if ($(this).data("width") > width) { + $(this).css("width", "100%"); + } } else { - if(selector) { - cfg = $.extend({ selector: selector }); - } + $(this).attr("width", $(this).data("width")); } - - var $img = this.find(cfg.selector); - var $this = this; - - function image_resize() - { - var width = $this.width(); - - $img.each(function() { - $(this).removeAttr("width") - .removeAttr("height") - .css("width","") - .css("height", ""); - - if($(this).data("width") == undefined) - $(this).data("width", $(this).width()); - - if($(this).data("width") > width) { - $(this).css("width", "100%"); - } - }); - } - - $(window).on("resize", function() { - image_resize(); - }); - - image_resize(); + }); } -}(jQuery)); \ No newline at end of file + + $(window).on("load", function () { + image_resize(); + }); + + $(window).on("resize", function () { + image_resize(); + }); + } + + $.fn.viewimageresize2 = function (selector) { + var cfg = { + selector: "img" + }; + + if (typeof selector == "object") { + cfg = $.extend(cfg, selector); + } else { + if (selector) { + cfg = $.extend({ selector: selector }); + } + } + + var $img = this.find(cfg.selector); + var $this = this; + + function image_resize() { + var width = $this.width(); + + $img.each(function () { + $(this).removeAttr("width") + .removeAttr("height") + .css("width", "") + .css("height", ""); + + if ($(this).data("width") == undefined) + $(this).data("width", $(this).width()); + + if ($(this).data("width") > width) { + $(this).css("width", "100%"); + } + }); + } + + $(window).on("resize", function () { + image_resize(); + }); + + image_resize(); + } +}(jQuery)); diff --git a/AvocadoEdition_Light/js/wrest.js b/AvocadoEdition_Light/js/wrest.js index 1b9c8db..588f798 100644 --- a/AvocadoEdition_Light/js/wrest.js +++ b/AvocadoEdition_Light/js/wrest.js @@ -4,368 +4,349 @@ var wrestFldDefaultColor = ""; //var wrestFldBackColor = "#ff3061"; // subject 속성값을 얻어 return, 없으면 tag의 name을 넘김 -function wrestItemname(fld) -{ - //return fld.getAttribute("title") ? fld.getAttribute("title") : ( fld.getAttribute("alt") ? fld.getAttribute("alt") : fld.name ); - var id = fld.getAttribute("id"); - var labels = document.getElementsByTagName("label"); - var el = null; +function wrestItemname(fld) { + //return fld.getAttribute("title") ? fld.getAttribute("title") : ( fld.getAttribute("alt") ? fld.getAttribute("alt") : fld.name ); + var id = fld.getAttribute("id"); + var labels = document.getElementsByTagName("label"); + var el = null; - for(i=0; i].*[<]\/+.*[>]/gi, ""); + if (el != null) { + var text = el.innerHTML.replace(/[<].*[>].*[<]\/+.*[>]/gi, ""); - if(text == '') { - return fld.getAttribute("title") ? fld.getAttribute("title") : ( fld.getAttribute("placeholder") ? fld.getAttribute("placeholder") : fld.name ); - } else { - return text; - } + if (text == '') { + return fld.getAttribute("title") ? fld.getAttribute("title") : (fld.getAttribute("placeholder") ? fld.getAttribute("placeholder") : fld.name); } else { - return fld.getAttribute("title") ? fld.getAttribute("title") : ( fld.getAttribute("placeholder") ? fld.getAttribute("placeholder") : fld.name ); + return text; } + } else { + return fld.getAttribute("title") ? fld.getAttribute("title") : (fld.getAttribute("placeholder") ? fld.getAttribute("placeholder") : fld.name); + } } // 양쪽 공백 없애기 -function wrestTrim(fld) -{ - var pattern = /(^\s+)|(\s+$)/g; // \s 공백 문자 - return fld.value.replace(pattern, ""); +function wrestTrim(fld) { + var pattern = /(^\s+)|(\s+$)/g; // \s 공백 문자 + return fld.value.replace(pattern, ""); } // 필수 입력 검사 -function wrestRequired(fld) -{ - if (wrestTrim(fld) == "") { - if (wrestFld == null) { - // 셀렉트박스일 경우에도 필수 선택 검사합니다. - wrestMsg = wrestItemname(fld) + " : 필수 "+(fld.type=="select-one"?"선택":"입력")+"입니다.\n"; - wrestFld = fld; - } +function wrestRequired(fld) { + if (wrestTrim(fld) == "") { + if (wrestFld == null) { + // 셀렉트박스일 경우에도 필수 선택 검사합니다. + wrestMsg = wrestItemname(fld) + " : 필수 " + (fld.type == "select-one" ? "선택" : "입력") + "입니다.\n"; + wrestFld = fld; } + } } // 김선용 2006.3 - 전화번호(휴대폰) 형식 검사 : 123-123(4)-5678 -function wrestTelNum(fld) -{ - if (!wrestTrim(fld)) return; +function wrestTelNum(fld) { + if (!wrestTrim(fld)) return; - var pattern = /^[0-9]{2,3}-[0-9]{3,4}-[0-9]{4}$/; - if(!pattern.test(fld.value)){ - if(wrestFld == null){ - wrestMsg = wrestItemname(fld)+" : 전화번호 형식이 올바르지 않습니다.\n\n하이픈(-)을 포함하여 입력하세요.\n"; - wrestFld = fld; - fld.select(); - } + var pattern = /^[0-9]{2,3}-[0-9]{3,4}-[0-9]{4}$/; + if (!pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + " : 전화번호 형식이 올바르지 않습니다.\n\n하이픈(-)을 포함하여 입력하세요.\n"; + wrestFld = fld; + fld.select(); } + } } // 이메일주소 형식 검사 -function wrestEmail(fld) -{ - if (!wrestTrim(fld)) return; +function wrestEmail(fld) { + if (!wrestTrim(fld)) return; - //var pattern = /(\S+)@(\S+)\.(\S+)/; 이메일주소에 한글 사용시 - var pattern = /([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/; - if (!pattern.test(fld.value)) { - if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + " : 이메일주소 형식이 아닙니다.\n"; - wrestFld = fld; - } + //var pattern = /(\S+)@(\S+)\.(\S+)/; 이메일주소에 한글 사용시 + var pattern = /([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/; + if (!pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + " : 이메일주소 형식이 아닙니다.\n"; + wrestFld = fld; } + } } // 한글인지 검사 (자음, 모음 조합된 한글만 가능) -function wrestHangul(fld) -{ - if (!wrestTrim(fld)) return; +function wrestHangul(fld) { + if (!wrestTrim(fld)) return; - //var pattern = /([^가-힣\x20])/i; - var pattern = /([^가-힣\x20])/; + //var pattern = /([^가-힣\x20])/i; + var pattern = /([^가-힣\x20])/; - if (pattern.test(fld.value)) { - if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + ' : 한글이 아닙니다. (자음, 모음 조합된 한글만 가능)\n'; - wrestFld = fld; - } + if (pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + ' : 한글이 아닙니다. (자음, 모음 조합된 한글만 가능)\n'; + wrestFld = fld; } + } } // 한글인지 검사2 (자음, 모음만 있는 한글도 가능) -function wrestHangul2(fld) -{ - if (!wrestTrim(fld)) return; +function wrestHangul2(fld) { + if (!wrestTrim(fld)) return; - var pattern = /([^가-힣ㄱ-ㅎㅏ-ㅣ\x20])/i; - //var pattern = /([^가-힣ㄱ-ㅎㅏ-ㅣ\x20])/; + var pattern = /([^가-힣ㄱ-ㅎㅏ-ㅣ\x20])/i; + //var pattern = /([^가-힣ㄱ-ㅎㅏ-ㅣ\x20])/; - if (pattern.test(fld.value)) { - if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + ' : 한글이 아닙니다.\n'; - wrestFld = fld; - } + if (pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + ' : 한글이 아닙니다.\n'; + wrestFld = fld; } + } } // 한글,영문,숫자인지 검사3 -function wrestHangulAlNum(fld) -{ - if (!wrestTrim(fld)) return; +function wrestHangulAlNum(fld) { + if (!wrestTrim(fld)) return; - var pattern = /([^가-힣\x20^a-z^A-Z^0-9])/i; + var pattern = /([^가-힣\x20^a-z^A-Z^0-9])/i; - if (pattern.test(fld.value)) { - if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + ' : 한글, 영문, 숫자가 아닙니다.\n'; - wrestFld = fld; - } + if (pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + ' : 한글, 영문, 숫자가 아닙니다.\n'; + wrestFld = fld; } + } } // 한글,영문 인지 검사 -function wrestHangulAlpha(fld) -{ - if (!wrestTrim(fld)) return; +function wrestHangulAlpha(fld) { + if (!wrestTrim(fld)) return; - var pattern = /([^가-힣\x20^a-z^A-Z])/i; + var pattern = /([^가-힣\x20^a-z^A-Z])/i; - if (pattern.test(fld.value)) { - if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + ' : 한글, 영문이 아닙니다.\n'; - wrestFld = fld; - } + if (pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + ' : 한글, 영문이 아닙니다.\n'; + wrestFld = fld; } + } } // 숫자인지검사 // 배부른꿀꿀이님 추가 (http://dasir.com) 2003-06-24 -function wrestNumeric(fld) -{ - if (fld.value.length > 0) { - for (i = 0; i < fld.value.length; i++) { - if (fld.value.charAt(i) < '0' || fld.value.charAt(i) > '9') { - wrestMsg = wrestItemname(fld) + " : 숫자가 아닙니다.\n"; - wrestFld = fld; - } - } +function wrestNumeric(fld) { + if (fld.value.length > 0) { + for (i = 0; i < fld.value.length; i++) { + if (fld.value.charAt(i) < '0' || fld.value.charAt(i) > '9') { + wrestMsg = wrestItemname(fld) + " : 숫자가 아닙니다.\n"; + wrestFld = fld; + } } + } } // 영문자 검사 // 배부른꿀꿀이님 추가 (http://dasir.com) 2003-06-24 -function wrestAlpha(fld) -{ - if (!wrestTrim(fld)) return; +function wrestAlpha(fld) { + if (!wrestTrim(fld)) return; - var pattern = /(^[a-zA-Z]+$)/; + var pattern = /(^[a-zA-Z]+$)/; - if (!pattern.test(fld.value)) { - if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + " : 영문이 아닙니다.\n"; - wrestFld = fld; - } + if (!pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + " : 영문이 아닙니다.\n"; + wrestFld = fld; } + } } // 영문자와 숫자 검사 // 배부른꿀꿀이님 추가 (http://dasir.com) 2003-07-07 -function wrestAlNum(fld) -{ - if (!wrestTrim(fld)) return; +function wrestAlNum(fld) { + if (!wrestTrim(fld)) return; - var pattern = /(^[a-zA-Z0-9]+$)/; + var pattern = /(^[a-zA-Z0-9]+$)/; - if (!pattern.test(fld.value)) { - if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + " : 영문 또는 숫자가 아닙니다.\n"; - wrestFld = fld; - } - } + if (!pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + " : 영문 또는 숫자가 아닙니다.\n"; + wrestFld = fld; + } + } } // 영문자와 숫자 그리고 _ 검사 -function wrestAlNum_(fld) -{ - if (!wrestTrim(fld)) return; +function wrestAlNum_(fld) { + if (!wrestTrim(fld)) return; - var pattern = /(^[a-zA-Z0-9\_]+$)/; + var pattern = /(^[a-zA-Z0-9\_]+$)/; - if (!pattern.test(fld.value)) { - if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + " : 영문, 숫자, _ 가 아닙니다.\n"; - wrestFld = fld; - } - } + if (!pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + " : 영문, 숫자, _ 가 아닙니다.\n"; + wrestFld = fld; + } + } } // 최소 길이 검사 -function wrestMinLength(fld) -{ - if (!wrestTrim(fld)) return; +function wrestMinLength(fld) { + if (!wrestTrim(fld)) return; - var minlength = fld.getAttribute("minlength"); + var minlength = fld.getAttribute("minlength"); - if (wrestFld == null) { - if (fld.value.length < parseInt(minlength)) { - wrestMsg = wrestItemname(fld) + " : 최소 "+minlength+"글자 이상 입력하세요.\n"; - wrestFld = fld; - } + if (wrestFld == null) { + if (fld.value.length < parseInt(minlength)) { + wrestMsg = wrestItemname(fld) + " : 최소 " + minlength + "글자 이상 입력하세요.\n"; + wrestFld = fld; } + } } // 이미지 확장자 -function wrestImgExt(fld) -{ - if (!wrestTrim(fld)) return; +function wrestImgExt(fld) { + if (!wrestTrim(fld)) return; - var pattern = /\.(gif|jpg|png)$/i; // jpeg 는 제외 - if(!pattern.test(fld.value)){ - if(wrestFld == null){ - wrestMsg = wrestItemname(fld)+" : 이미지 파일이 아닙니다.\n.gif .jpg .png 파일만 가능합니다.\n"; - wrestFld = fld; - fld.select(); - } + var pattern = /\.(gif|jpg|png)$/i; // jpeg 는 제외 + if (!pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + " : 이미지 파일이 아닙니다.\n.gif .jpg .png 파일만 가능합니다.\n"; + wrestFld = fld; + fld.select(); } + } } // 확장자 -function wrestExtension(fld, css) -{ - if (!wrestTrim(fld)) return; +function wrestExtension(fld, css) { + if (!wrestTrim(fld)) return; - var str = css.split("="); // ext=?? <-- str[1] - var src = fld.value.split("."); - var ext = src[src.length - 1]; + var str = css.split("="); // ext=?? <-- str[1] + var src = fld.value.split("."); + var ext = src[src.length - 1]; - if (wrestFld == null) { - if (ext.toLowerCase() < str[1].toLowerCase()) { - wrestMsg = wrestItemname(fld) + " : ."+str[1]+" 파일만 가능합니다.\n"; - wrestFld = fld; - } + if (wrestFld == null) { + if (ext.toLowerCase() < str[1].toLowerCase()) { + wrestMsg = wrestItemname(fld) + " : ." + str[1] + " 파일만 가능합니다.\n"; + wrestFld = fld; } + } } // 공백 검사후 공백을 "" 로 변환 -function wrestNospace(fld) -{ - var pattern = /(\s)/g; // \s 공백 문자 +function wrestNospace(fld) { + var pattern = /(\s)/g; // \s 공백 문자 - if (pattern.test(fld.value)) { - if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + " : 공백이 없어야 합니다.\n"; - wrestFld = fld; - } + if (pattern.test(fld.value)) { + if (wrestFld == null) { + wrestMsg = wrestItemname(fld) + " : 공백이 없어야 합니다.\n"; + wrestFld = fld; } + } } // submit 할 때 속성을 검사한다. -function wrestSubmit() -{ - wrestMsg = ""; - wrestFld = null; +function wrestSubmit() { + wrestMsg = ""; + wrestFld = null; - var attr = null; + var attr = null; - // 해당폼에 대한 요소의 개수만큼 돌려라 - for (var i=0; i