여러분 처럼 저도 여자친구가 없어서
금요일밤을 게시판 여기저기 클릭해서 메뉴를 여는 드랍다운 메뉴 버튼 인터페이스를 제거하는 것으로 불태워버렸네요..
물론 기존 방식은 하위 메뉴를 숨겨두어 공간을 적게 쓰는 장점이 있으나, 최종 목적지까지 가는데 결국 클릭이 최소 한번 이상은 요구가 됩니다.
사실 클릭 한번 더 하는게 뭐가 대수인가 싶으시겠지만..
여러분 처럼 저도 여자친구가 없어 금요일에 할일이 없기도 했었고
결정적으로 해당 드랍다운에 이용되는 스크립트 파일이 아래 처럼 서로 연관이 되어 있어
비개발자 일반 직장인으로서 에러에 대응이 안되는 바.... 그냥 스크립트 없이 사용을 해보자 해서 제거 하고 일반 단순 버튼식 메뉴 로 디자인 구성을 하였네요.
function ajaxEventRebind(){_dropDownMenu(jQuery);_autoEmbed(jQuery);_lockedIconToggle(jQuery);null!==document.querySelector(".bd_time")&&(_timelineTagInsert(jQuery),function(a){a("#FiledataWrp").on("change","#Filedata",function(){ajaxFileUpload()})}(jQuery));checkMobileDevice()&&mobileEvents(jQuery)}
{"none"==a.cookie("cmt_noti_display")&&a("._notification").addClass("off");a("._notification .close").on("click",function(){a("._notification").addClass("off");a.cookie("cmt_noti_display","none",{expires:7})});"on"==a.cookie("mfilter")?(a(".trigger-filter").addClass("on"),a("._filter").addClass("on")):(a(".trigger-filter").removeClass("on"),a("._filter").removeClass("on"));a(".trigger-filter").on("click",function(){a("._filter").toggleClass("on");a(this).toggleClass("on");
a(this).hasClass("on")?a.cookie("mfilter","on"):a.removeCookie("mfilter")});a("._comment").hammer({domEvents:!0}).on("swipe",function(b){var d=a(b.target).data("press-trigger");setTimeout(function(){cmtOverlay(b,d)},100)});a(".cmt-option").on("click",function(b){(a(b.target).is(".cmt-option .quit")||a(b.target).is(".cmt-option"))&&setTimeout(function(){a("body").off("touchmove");a(".cmt-overlay-background").removeClass("on")},100)})}
function voteUpDocument(a){exec_json("document.procDocumentVoteUp",{target_srl:a},function(){jQuery.ajax({url:request_uri+"index.php?mid="+current_mid+"&document_srl="+a,dataType:"html",success:function(b){b=jQuery(b);b=b.find("#voteUpCount_"+a).html();jQuery("#voteUpCount_"+a).html(b);jQuery(document).prtToast({msg:"\ucd94\ucc9c \uc644\ub8cc!",timeout:1500})}})})}
function voteDownDocument(a){exec_json("document.procDocumentVoteDown",{target_srl:a},function(){jQuery("#D_ ._ft > a.blame").addClass("update");var b=jQuery("#voteDownCount_"+a).data("dvcd"),b=b-1;jQuery("#voteDownCount_"+a).text(b)})}
function voteUpComment(a){exec_json("comment.procCommentVoteUp",{target_srl:a},function(){var b=jQuery("#vU_"+a).data("cvcu");b++;jQuery("#vU_"+a).text(b);jQuery(document).prtToast({msg:"\ucd94\ucc9c \uc644\ub8cc!",timeout:1500});jQuery(".cmt-overlay-background.on").length&&(jQuery("body").off("touchmove"),jQuery(".cmt-overlay-background").removeClass("on"))})}
function voteDownComment(a){exec_json("comment.procCommentVoteDown",{mid:current_mid,target_srl:a},function(){var b=jQuery("#vD_"+a).data("cvcd"),b=b+1;jQuery("#vD_"+a).text(b);jQuery(".cmt-overlay-background.on").length&&(jQuery("body").off("touchmove"),jQuery(".cmt-overlay-background").removeClass("on"))})}
function delComment(a){if(window.confirm("\uc815\ub9d0 \uc0ad\uc81c\ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?")){var b=[];b.comment_srl=a;exec_xml("board","procBoardDeleteComment",b,function(){jQuery("#comment_"+a).remove();jQuery(".cmt-overlay-background.on").length&&(jQuery("body").off("touchmove"),jQuery(".cmt-overlay-background").removeClass("on"))})}}function cmtfileToggle(a){jQuery(".file_"+a).toggle()}
function cmtOverlay(a,b){(function(a){var c=a('.cmt-overlay-background[data-cmt-overlay="'+b+'"]'),e=a(window).height()+1;c.appendTo("body");c.addClass("on");c.css({height:e,top:0});a("body").on("touchmove",function(a){a.preventDefault()})})(jQuery)}
function commentInsert(a){(function(b){var d=b(".bd_time").length?request_uri+"index.php?mid="+current_mid+"&page="+triggerCount:location.href;b.ajax({url:d,dataType:"html",success:function(c){c=b(c);c=c.find(".fdbArea_"+a.document_srl).html();b(".fdbArea_"+a.document_srl).html(c);if(!b(".bd_time").length){c=b("div#comment_"+a.comment_srl);var d=c.offset().top;c.position();c.length&&b("html,body").animate({scrollTop:d-200},300)}},complete:function(){ajaxEventRebind()}})})(jQuery)}
function timeLineDocumentSubmit(a){if(a("#t_tArea").length){var b="",d=a("#tWrite div#t_tArea"),c=d.html(),d=d.text();!1===/[\S]+/g.test(d)?"\ub0b4\uc6a9\uc740 \ud544\uc218\uc785\ub2c8\ub2e4.":(c=c.replace(/(\r\n|\n)/g,"<br>"),a("#files .select").length&&(a("#files .select").each(function(){var c=a(this).find("button").attr("data-type");"img"==c?(b=b+'<p><img src="'+a(this).find("button").attr("data-file")+'" alt="'+a(this).find("button").attr("title")+'" /><a href="'+
a(this).find("button").attr("data-dnld")+'" style="text-decoration:underline">'+a(this).find("small").text()+"</a> and play it!</video></div>":b+'<p><a href="'+a(this).find("button").attr("data-dnld")+'" style="text-decoration:underline">'+a(this).find("small").text()+"</a></p>"}),c=a("#m_img_upoad_2:checked").length?c+b:b+c),a("#t_doc_val").val(c))}a("#tWrite").submit()}
function documentInsert(a){var b=request_uri.setQuery("mid",current_mid)+"&page=1";console.log(b);(function(a){a.ajax({url:b,dataType:"html",success:function(b){b=a(b);b=b.find(".bd_time").html();a(".bd_time").html(b)},complete:function(){ajaxEventRebind()}})})(jQuery)}
function tComValueInsert(a,b){b.preventDefault?b.preventDefault():b.returnValue=!1;var d=jQuery("#editor_"+a).text();!1===/[\S]+/g.test(d)?alert("\ub0b4\uc6a9\uc740 \ud544\uc218\uc785\ub2c8\ub2e4"):(jQuery("#ct_val_"+a).val(d),jQuery("#cmtForm_"+a).submit())}
function _timelineTagInsert(a){a(".tagAdd").on("click",function(){a("span.lang_tag").hide()});a("#tags-field").on("focus",function(){a("span.lang_tag").hide()});a("#tags-field").on("blur",function(){0===a(".addedTag").length&&""===a("#tags-field").val()&&a("span.lang_tag").show()});a("#addTagBtn").on("click",function(){a("#tags option:selected").each(function(){a(this).appendTo(a("#selectedTags"))})});a("#removeTagBtn").on("click",function(){a("#selectedTags option:selected").each(function(b){a(this).appendTo(a("#tags"))})});
a(".tagRemove").on("click",function(b){b.preventDefault();a(this).parent().remove()});a("ul.tags").on("click",function(){a("#tags-field").focus()});a("#tags-field").on("keypress",function(b){if("13"==b.which||"44"==b.which)if(b.preventDefault(),""!==a(this).val()){a('<li class="addedTag fl bdr_r"><span>'+a(this).val()+'</span><svg class="tagRemove" onclick="tagRemove();" fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/><path d="M0 0h24v24H0z" fill="none"/></svg></li>').insertBefore(".tags .tagAdd");
b=a("#tags_val").val();var d=a(this).val();a("#tags_val").val(b+","+d+",");a("#tags-field").val("")}})}function tagRemove(){var a=","+jQuery(event.target).siblings("span").text()+",",a=jQuery("#tags_val").val().replace(a,"");jQuery("#tags_val").val(a);jQuery(event.target).parents(".addedTag").remove()}
function reComment(a,b,d){var c=jQuery("#re_cmt").eq(0);jQuery("#re_cmt .editor_use").length&&jQuery("#re_cmt .editor_use").attr("href",request_uri+"index.php?mid="+current_mid+"&document_srl="+a+"&comment_srl="+b+"&act=dispBoardReplyComment");c.find("input[name=error_return_url]").val("/"+a);c.find("input[name=mid]").val(current_mid);c.find("input[name=document_srl]").val(a);c.appendTo(jQuery("#comment_"+b)).fadeIn().find("input[name=parent_srl]").val(b);c.find("a.wysiwyg").attr("href",d);c.find("textarea").focus();
jQuery(".cmt-overlay-background.on").length&&(jQuery("body").off("touchmove"),jQuery(".cmt-overlay-background").removeClass("on"))}function _ctWidthInput(){var a=jQuery(".bd"),b=a.width();400>b?a.attr("data-content-width","w1"):400<=b&&768>b?a.attr("data-content-width","w2"):768<=b&&1024>b?a.attr("data-content-width","w3"):1024<=b&&1367>b?a.attr("data-content-width","w4"):1367<=b&&1850>b?a.attr("data-content-width","w5"):a.attr("data-content-width","w6")}
function _autoEmbed(a){a(".xe_content > p").html(function(a,d){return d.replace(/(?![^<]*>|[^<>]*<\/)(?:(http:|https:)\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)/g,'<iframe src="//www.youtube.com/embed/$2?modestbranding=1&rel=0&wmode=transparent&theme=light&color=white" frameborder="0" allowfullscreen></iframe>').replace(/(?![^<]*>|[^<>]*<\/)(?:(http:|https:)\/\/)?(?:www\.)?(?:vimeo\.com)\/(.+\d)/g,'<iframe src="//player.vimeo.com/video/$2" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>').replace(/((?![^<]*>|[^<>]*<\/)(?:(https?:)?\/\/)[\w\.\/?&:;=#%~-]*(?:\.swf))/g,
'<embed src="$1" wmode="transparent"></embed>')});if(a(".xe_content iframe")||a(".xe_content embed").length)a(".xe_content embed").parents("p").addClass("vid"),a(".xe_content iframe").parents("p").addClass("vid")}
function _lockedIconToggle(a){a("#re_cmt label[class*=locked]").on("click",function(){a("#re_cmt label[class*=locked]").toggle()});a("#cmtForm label[class*=locked]").on("click",function(){a("#cmtForm label[class*=locked]").toggle()});a("#tWrite label[class*=locked]").on("click",function(){a("#tWrite label[class*=locked]").toggle()})};
Mactopia님의 새글 알림을 받으실려면 구독
드랍존 구현 원래 매우 성가신 작업이라 어떻게해도 저런 가독성이라곤 쥐꼬리만큼도 없는 코드가 나와요
특히 js등은 유포전 툴로 간략화시켜버리면 함수명이 죄다 a,b같은걸로 바뀌어서 더 심각해짐
사실 그런것 아니라도 원래 남이 짠 함수등 이해하는건 매우 힘듬 (먼산)
"님의 댓글"
이 댓글을 신고 하시겠습니까?
제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|
오랜만에 심야 영화 예매했습니다.(feat.베테랑2) +6 | 잠퉁이 | 24.09.2122:24 | 44 |
남자라면 알아두면 정말 유용한 차급의 세계 +1 | bluesaza | 24.09.2110:22 | 148 |
내가 돌아왔다. +1 | 광호 | 24.09.2201:12 | 116 |
Mactopia | 24.09.2318:17 | 6 | |
아이브경 | 24.09.2309:12 | 47 | |
아이브경 | 24.09.2309:12 | 57 | |
아이브경 | 24.09.2309:12 | 71 | |
아이브경 | 24.09.2309:12 | 54 | |
아이브경 | 24.09.2309:12 | 39 | |
아이브경 | 24.09.2309:12 | 21 | |
아이브경 | 24.09.2309:12 | 14 | |
아이브경 | 24.09.2309:12 | 26 | |
아이브경 | 24.09.2309:12 | 30 | |
아이브경 | 24.09.2309:12 | 23 | |
Mactopia | 24.09.2223:42 | 47 | |
Mactopia | 24.09.2222:57 | 48 | |
광호 | 24.09.2201:12 | 116 | |
잠퉁이 | 24.09.2122:24 | 44 | |
bluesaza | 24.09.2110:22 | 148 | |
복스렌치 | 24.09.2014:59 | 59 | |
복스렌치 | 24.09.2014:49 | 45 | |
Mactopia | 24.09.1921:52 | 62 | |
Mactopia | 24.09.1919:43 | 99 | |
복스렌치 | 24.09.1912:18 | 47 | |
복스렌치 | 24.09.1912:16 | 41 | |
Mactopia | 24.09.1912:02 | 86 | |
Mactopia | 24.09.1911:40 | 78 | |
아이브경 | 24.09.1911:15 | 48 | |
아이브경 | 24.09.1911:15 | 67 | |
아이브경 | 24.09.1911:15 | 26 | |
아이브경 | 24.09.1911:15 | 66 | |
아이브경 | 24.09.1911:15 | 56 | |
아이브경 | 24.09.1911:15 | 41 | |
아이브경 | 24.09.1911:15 | 53 | |
아이브경 | 24.09.1911:15 | 40 | |
아이브경 | 24.09.1911:15 | 36 | |
Mactopia | 24.09.1821:13 | 64 | |
bluesaza | 24.09.1811:38 | 143 | |
복스렌치 | 24.09.1810:24 | 50 | |
소마엠 | 24.09.1803:48 | 168 | |
팜랩 | 24.09.1714:09 | 24 | |
달쇠 | 24.09.1708:22 | 32 | |
잠퉁이 | 24.09.1703:51 | 69 | |
잠퉁이 | 24.09.1613:02 | 81 | |
잠퉁이 | 24.09.1515:17 | 112 | |
해킨독립 | 24.09.1516:29 | 65 | |
복스렌치 | 24.09.1513:19 | 48 | |
도움환영 | 24.09.1502:52 | 177 | |
잠퉁이 | 24.09.1405:20 | 192 | |
잠퉁이 | 24.09.1321:15 | 129 | |
해킨독립 | 24.09.1320:42 | 83 | |
Mactopia | 24.09.1316:41 | 80 | |
도움환영 | 24.09.1311:03 | 114 | |
아이브경 | 24.09.1309:31 | 130 | |
아이브경 | 24.09.1309:31 | 95 | |
아이브경 | 24.09.1309:31 | 70 | |
Mactopia | 24.09.1218:21 | 119 | |
Mactopia | 24.09.1218:02 | 87 | |
잠퉁이 | 24.09.1216:32 | 107 | |
bluesaza | 24.09.1217:02 | 157 | |
Mactopia | 24.09.1211:54 | 113 | |
아이브경 | 24.09.1210:30 | 66 | |
아이브경 | 24.09.1210:30 | 87 | |
아이브경 | 24.09.1210:30 | 81 | |
아이브경 | 24.09.1210:30 | 45 | |
아이브경 | 24.09.1210:30 | 59 | |
Mactopia | 24.09.1117:40 | 136 | |
Mactopia | 24.09.1117:39 | 106 | |
박사 | 24.09.1109:37 | 136 | |
아이브경 | 24.09.1109:33 | 68 | |
아이브경 | 24.09.1109:33 | 167 | |
아이브경 | 24.09.1109:33 | 105 | |
아이브경 | 24.09.1109:33 | 65 | |
아이브경 | 24.09.1109:33 | 56 | |
아이브경 | 24.09.1109:33 | 46 | |
아이브경 | 24.09.1109:32 | 52 | |
Mactopia | 24.09.1019:12 | 113 | |
코끼리코 | 24.09.1017:54 | 109 | |
Mactopia | 24.09.0915:25 | 138 | |
Mactopia | 24.09.0915:24 | 53 | |
아이브경 | 24.09.0911:54 | 84 | |
아이브경 | 24.09.0911:54 | 132 | |
아이브경 | 24.09.0911:54 | 63 |
ㅋㅋㅋㅋㅋㅋ... 하루종일.. 진짜 11시간을 리버싱만 했더니..
제쿼리 ㅠㅠ 너무 편하게 보인다는.. ㅠ😭😖