/* 패턴 맞춤 */ function chkType(str,type) { switch (type) { case 0://숫자만 var filter = /^[1-9][0-9]+$/; break; case 1://영문,숫자만 var filter = /^[0-9a-zA-Z]+$/; break; case 2://영문,숫자만(첫자는 영문) var filter = /^[a-zA-Z][0-9a-zA-Z]+$/; break; case 3://영문,숫자,_ var filter = /^\w+$/; break; case 4://영문만 var filter = /^[a-zA-Z]+$/; break; case 5://숫자만 + - var filter = /^[1-9][0-9]+$/; break; case 6://소-영문만 var filter = /^[a-z]+$/; break; case 7://소-영문,숫자만 var filter = /^[0-9a-z]+$/; break; case 8://메일 var filter =/^[a-zA-Z0-9\-\.\_]+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4})$/; break; case 9://한글숫자영문 //var filter = /^[a-zA-Z0-9ㄱ-힣 ]+$/; var filter = /^[0-9|a-z|ㄱ-ㅎ|ㅏ-ㅣ|가-힝]+$/; break; case 10://Null(사용금지) var filter =/^[a-zA-Z0-9\-\.\_]+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4})$/; break; } if(!filter.test(str)) { var result='resultFalse'; return result; } else { return true; } } //배열에 값이 있는지 검사 function in_array(Val,Arr) { for(var i=0;i 0){ if(confirm("")){ myPlayList = new Array(); nm = 0; } } var filter = '|mp3|'; $.post(url,{itemlist:itemlist,filter:filter},function(json){ if(json != null && json['file_name'][0] && json['file_name'].length > 0){ for(i=-1,n=json['file_name'].length;++i= 2)?"1":"0";//다중선택인지 체크 if(multi_c == "1"){ var playlist = "file_get_link.php?type=rss&itemlist=" + data; media_src_multi(playlist); var temp = $('#media_frame'); var css_left = ($(window).width()/2 - 275) + "px"; var css_top = ($(window).height()/2 - 200) + "px"; temp.css("left",css_left); temp.css("top",css_top).width(500).height(530); temp.draggable({handle: '#titleBar2'}); temp.show(); }else{ var a_str = data.split('|'); var a_m = a_str[0].split("*"); Media_play(x,a_m[1],a_m[2]); } }); } /* var MediaLoad = "0"; //미디어 플레이 function Media_play(code){ if(PERM == "W" || PERM == "D" || !PERM || PERM == "NONE"){ alert(''); return; } $("#On_Movie").hide(); if(code){//단독으로 틀경우! var itemlist = code; }else{ var itemlist = getSelectVal(); } var url = 'file_get_link.php?type=text'; //필터를 해서 목록을 가져올것. var filter = '|flv|mp4|mov|f4v|swf|mp3|'; $.post(url,{itemlist:itemlist,filter:filter},function(data){ if(data){ var playlist = "file_get_link.php?type=xml&itemlist=" + data; media_src(playlist); var temp = $('#media_frame'); var css_left = ($(window).width()/2 - 275) + "px"; var css_top = ($(window).height()/2 - 200) + "px"; temp.css("left",css_left); temp.css("top",css_top); temp.draggable({handle: '#titleBar'}).width(520).height(450); temp.show(); }else{ alert(''); } },'text'); } */ var media_w_w = 0; var media_w_h = 0; function media_hide(){ media_w_w = $("#media_frame").width(); media_w_h = $("#media_frame").height(); $("#media_frame").width(0).height(0); $("#On_Movie").show(); } function media_show(){ $("#media_frame").width(media_w_w).height(media_w_h); $("#On_Movie").hide(); } function media_close(){ jwplayer("Media_container").stop(); $("#Media_container").html(''); $("#media_frame").hide(); MediaLoad = 0; } function Find_File(x){ var url = 'api_webhard.php'; $.get(url,{x:x},function(data){ //첨부파일 창 $( "#api_webhard_layer" ).dialog({ modal: true, autoOpen: false, width:750, height:480, close:function(){ $( "#api_webhard_layer" ).empty(); }, title:'' }); $("#api_webhard_layer").dialog('open'); $("#api_webhard_layer").html(data); }); return false; } var a_link_file = []; var Attach_Sort_after = ''; function Attach_Sort(){ var str = $('textarea[name=link_file]').val().split('|!'); var html = []; for(i=0;i[x]'; if(filter_type != 'img' || (Attach_Sort_after == 'chk_show_main_img()')){//12.11.27 html[id] += '[]'; }//if } } } var join_str = html.join(''); $("#Find_File_Src").html(join_str); if(Attach_Sort_after){ eval(Attach_Sort_after); } } function Attach_Cancel(x){ var url = 'web_link.php'; loading_bar_show('wrapper'); $.post(url,{smode:'del_id',id:x},function(data){ loading_bar_hide('wrapper'); if(data == 'SUCCESS'){ var html = []; if(a_link_file){ a_link_file[x] = ''; for(var key in a_link_file){ if(key && a_link_file[key]){ html.push(a_link_file[key]); } } var str = html.join('|!'); $('textarea[name=link_file]').val(str); Attach_Sort(); } }else{ alert(data); } }); } /* 보안설정 부분 */ function wl_type(){ var l_u = $('input[name=limit_use]:checked').val(); if(l_u == '1'){ $("input[name=down_count]").removeAttr("disabled").css({background:''}); $("input[name=date_limit]").removeAttr("disabled").css({background:''}); $("textarea[name=allow_host]").removeAttr("disabled").css({background:''}); $("textarea[name=deny_host]").removeAttr("disabled").css({background:''}); $("input[name=passwd]").removeAttr("disabled").css({background:''}); }else{//사용안함일때 $("input[name=down_count]").attr("disabled", true).css({background:'#EEE'}); $("input[name=date_limit]").attr("disabled", true).css({background:'#EEE'}); $("textarea[name=allow_host]").attr("disabled", true).css({background:'#EEE'}); $("textarea[name=deny_host]").attr("disabled", true).css({background:'#EEE'}); $("input[name=passwd]").attr("disabled", true).css({background:'#EEE'}); } } function File_Security_Close(){ $( "#File_Security_Src" ).dialog('close'); } function File_Security(x){ var url = 'web_link.php?smode=get_id_info&id=' + x; $.getJSON(url,function(json){ var frm = document.WlForm; var limit_use = json["limit_use"]; var down_count = json["down_count"]; var date_limit = json["date_limit"]; var deny_host = json["deny_host"]; var allow_host = json["allow_host"]; var passwd = json["passwd"]; var title = json["title"]; var html = '
'; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += '
'; html += 'ex)220.xxx.xx.x,linkhard.co.kr,test.com'; html += ''; html += '
'; html += 'ex)220.xxx.xx.x,172.xx.xx'; html += '
'; html += ''; html += '
'; html += ''; html += '
'; html += '
'; $( "#File_Security_Src" ).html(html); $('input[name=limit_use]').filter('input[value=' + limit_use + ']').attr('checked','checked'); $(".numeric").keyup(function(){ $(this).val($(this).val().replace(/[^0-9]/g,'')); }); $('input[name=limit_use]').click(function(){ wl_type(); }); wl_type(); }); $( "#File_Security_Src" ).dialog({ modal: true, autoOpen: false, width:720, height:430, close:function(){ $('#File_Security_Src').empty(); }, title:'' }) $( "#File_Security_Src" ).dialog('open'); } function inc_write_wlform_submit(){ var frm = document.WlForm; var l_u = $('input[name=limit_use]:checked').val(); var url = 'web_link.php';var con = ""; $.post(url,{smode:'Mod_ID',fid:frm.fid.value,id:frm.id.value,limit_use:l_u,down_count:frm.down_count.value,allow_host:frm.allow_host.value,deny_host:frm.deny_host.value,passwd:frm.passwd.value,title:frm.title.value,date_limit:frm.date_limit.value},function(data){ if(data == 'SUCCESS'){ alert(''); File_Security_Close(); } }); } function OnlyNumber(event) { var key = event.charCode || event.keyCode || 0; if(key != 45){//음수 if ((key<48)||(key>57)){ event.returnValue=false; } }; } /* 12.01.31 */ function get_paging(totalcnt) { var totpages = Math.ceil(totalcnt/pagefactor); //총페이지수 var thisblock = Math.ceil(thispage/pagelistnm); //현재 페이징블럭 var startpage, endpage; var ret_HTML = ""; // 현재 페이지블럭의 시작페이지번호 if(thisblock > 1){ startpage = (thisblock-1)*pagelistnm+1; }else{ startpage = 1; } // 현재 페이지블럭의 끝페이지번호 if( (thisblock*pagelistnm) >= totpages ){ endpage = totpages; }else{ endpage = thisblock*pagelistnm; } if(thispage > 1){ ret_HTML += " "; // 맨처음으로 가기 ret_HTML += " "; // 현재블럭의 전페이지 } for(i = startpage; i <= endpage; i++){ if(i != thispage){ ret_HTML += " "+i+""; }else{ ret_HTML += " "+i+""; } } if(thispage != totpages){ ret_HTML += " "; // 현재블럭의 다음페이지 ret_HTML += " "; // 맨 마지막페이지 } return ret_HTML; } /* 추가설명 plug-in */ function Call_tooltip(){ $('.Call_str').tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", fade: 250 }); } /* for IE6 location.href */ function go_url(url){ var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ if(event){ event.returnValue = false; } } url = url.replace('http://59.29.124.11:8080/#','http://59.29.124.11:8080/index.php#'); top.location.href = url; } /* 라이센스 구매 알림창 */ function licence_window(x){ $("#licence_window_src").dialog({ autoOpen: false, width:650, height:390, title:"", istitle : false, modal:true, closeOnEscape: false }); $('#licence_w_content').html(x); $("#licence_window_src").dialog('open'); $('.button').button(); } /* 회원가입 */ var noUseIdNick = new Array('관리자','운영자','운영팀','관리팀','마스터','어드민','master','admin','superdown','webmaster','help','고객센터','도우미','user','userid','nickname','recin','main','interich','media','medianetworks','check','info','super','popup','news','chess','show','deleted','undefined'); function idCheckJoin(str){ var id_value=str; if(id_value==''){ var msg = ''; return msg; } if(id_value.length < 4 || id_value.length > 12){ var msg = ''; return msg; } if(chkType(id_value,7)=='resultFalse'){ var msg = ''; return msg; } if(in_array(id_value, noUseIdNick)){ var msg = ''; return msg; } return true; } function nicCheck(str){ var nic_value= str; var engFilter = /^[a-zA-Z0-9]+$/; var hanFilter = /^[ㄱ-힣 ]+$/; if(engFilter.test(nic_value)){ var strType = 'eng'; } if(hanFilter.test(nic_value)){ var strType = 'han'; } if(nic_value==''){ var msg = ''; return msg; } if(nic_value.indexOf(' ')!=-1){ var msg = ''; return msg; } /* if(strType == 'eng' ){ if(nic_value.length < 4 || nic_value.length > 12){ var msg = '이름의 길이는 한글(2~6자) , 영문(4~12자)로 입력해주세요!'; return msg; } }else{ if(nic_value.length < 2 || nic_value.length > 6){ var msg = '이름의 길이는 한글(2~6자) , 영문(4~12자)로 입력해주세요!'; return msg; } } if(chkType(nic_value,9)=='resultFalse'){ var msg = '이름은 한글 , 영문, 숫자의 조합으로 입력해주세요!'; return msg; } */ if(in_array(nic_value,noUseIdNick)){ var msg = ''; return msg; } return true; } // 비밀번호 체크1 function chkPasswd1(str , min , max){ if(!str) { var msg = ''; return msg; } if(str.length < min) { var msg = ''; return msg; } if(str.length > max) { var msg = ''; return msg; } return true; } function chkPasswd2(str, str2){ if(!str2) { var msg = ''; return msg; } if(str != str2) { var msg = ''; return msg; } return true; } function checkemail(str){ if(chkType(str,8)=='resultFalse'){ var msg = ''; return msg; } return true; } function Make_Cookie(k,v,z){//스크립트 쿠키로 기억하기! z = (z)?z:14; $.cookie(k, v, {expires: z}); } /* 111229 진행바 */ function Process_start(){ $('#process_popup_str').html("Please wait."); $("#process_popup").dialog({ modal: true, autoOpen: false, width:300, height:200, close:function(){Process_stop();}, title:'' }) $("#process_popup").dialog('open'); } var p_state = 1; function Process_stop(){ p_state = 0; //$('#process_popup_str').html("진행중인 프로세스를 닫고있습니다. 기다려주세요."); } function Process_end(){ $("#process_popup").dialog('close'); } function Log_src_close(){ $("#Log_src").dialog('close'); } var r_f = 'webhard_inc'; function check_dir_mdate(type,d_code,uid){ var url = 'check_dir_mdate.php'; $.get(url,{d_code:d_code,type:type,uid:uid},function(data){ if(data == 'OK'){ Only_new_Call_Sync(); Space_Reload = 1;//용량 다시 계산하기 }else{ if(r_f == 'webhard_inc'){ fileview_show(type,d_code); }else if(r_f == 'member_webhard'){ get_list(1); } } return; }); } /* 111006 동기화버튼 */ function Call_Sync(){ Sync_continue = '1'; if(confirm("")){ $( "#sync_popup" ).dialog({ modal: true, autoOpen: false, width:300, height:200, close:function(){Sync_Stop('2');return false;}, title:'' }) $("#sync_popup").dialog('open'); Sync_process(DIR_64,SHARE); } } /* 111226 새로 올라온 폴더를 업데이트하자! */ function Only_new_Call_Sync(){ Sync_continue = '1'; $( "#sync_popup" ).dialog({ modal: true, autoOpen: false, width:300, height:200, close:function(){Sync_Stop('2');return false;}, title:'' }) $("#sync_popup").dialog('open'); Sync_process('',''); } /* 111008 동기화 진행 */ var Sync_continue = '1'; function Sync_process(x,y,z,uid){ z = (z)?z:'D';uid = (uid)?uid:''; var url = './linkhard_server/Fdp/sync_data.php'; $.post(url,{'DIR_64':x,'SHARE':y,'smode':'ready_get_dir','QNAP':'0',z:z,_ID:uid},function(data){ var a_str = data.split('|!'); if(a_str[0] == "END"){ if(r_f == 'webhard_inc'){ reload_filelist(); }else if(r_f == 'member_webhard'){ get_mw_list(1); } //alert('동기화진행이 완료되었습니다'); Sync_Stop('1'); }else if(a_str[0] == "CON"){ var next_u_dir_name = a_str[1]; var next_u_dir_64 = a_str[2]; var next_u_share = a_str[3]; var next_type = a_str[4]; var uid = a_str[5]; $('#sync_popup_str').html(next_u_dir_name); if(Sync_continue == '1'){ Sync_process(next_u_dir_64,next_u_share,next_type,uid); }else{ Sync_Stop('3',uid); } }else{ alert(data); } }); } function Sync_Stop(x,y){ if(x == '1'){ $("#sync_popup").dialog('close'); }else if(x == '2'){ Sync_continue = '0'; }else if(x == '3'){ var url = './linkhard_server/Fdp/sync_data.php'; $.post(url,{'smode':'clean_ready_get_dir','DIR_64':DIR_64},function(data){ if(data != "#^#SUCCESS#^#"){ alert(data); } }); } } function Clear_SelectAll(){/* 추가 2011-03-09 */ $('input[type=checkbox]').attr('checked',''); } function chk_SelectAll(x){ if(x){ $('input[type=checkbox]').attr('checked','checked'); }else{ $('input[type=checkbox]').attr('checked',''); } } /* 이미지 crop */ var show_img_crop_cnt = 0; function show_img_crop(img_url,img_width,img_height){ top_pos = 0; var src_img = ""; src_img += "
"; src_img +=""; src_img += "
"; if(show_img_crop_cnt < 30){ src_img += ""; }else{ src_img += ""; } src_img += "
"; src_img += "
"; show_img_crop_cnt++; //src_img = "1"; return src_img; } function loading_bar_show(x){// 12.01.26 var width = $("#" + x).width(); var height = $("#" + x).height(); $("#" + x + "-loading").css({ top: ((height / 2) - 8), left: ((width / 2) - 8) }).fadeIn(200); } function loading_bar_hide(x){ $("#" + x + "-loading").fadeOut(200); } /* 윈도우 가운데 표시 2012.12.03 */ function wc_loading_bar_show(x){ var width = $(window).width(); var height = $(window).height(); $("#" + x + "-loading").css({ top: ((height / 2) - 8), left: ((width / 2) - 8) }).fadeIn(200); } function wc_loading_bar_hide(x){ $("#" + x + "-loading").fadeOut(200); } function CmClose(idname){ $('#' + idname).dialog('close'); } //12.11.25 퍼블릭폴더 불러오기 function Find_Public_File(x,y,z,a){ var url = 'api_webhard.php'; $.get(url,{x:x,open_src:y,public_folder:1,target_selector:z,target_html:a},function(data){ //첨부파일 창 $( "#" + y ).dialog({ modal: false, autoOpen: false, width:620, height:480, position:'right', close:function(){ $( "#" + y ).empty(); }, title:'퍼블릭폴더' }); $("#" + y).dialog('open'); $("#" + y).html(data); }); return false; } function Find_Public_File_close(x){ $('#' + x).dialog('close'); } /* 특정부분 프린트 */ function printDiv (id) { $('#' + id).printElement(); } /* 뉴스용 두줄광고 */ /* 두줄광고 */ var AD2LINE_ID = ''; var AD2LINE_STOP = 0; var AD2LINE_SETTIMEOUT; var chk_call_AD2LINE_load = 0; function call_AD2LINE(x){ AD2LINE_ID = x; if(!$('#ad2line_1').html()){//12.12.27 AD2LINE_STOP = 1; chk_call_AD2LINE_load = 0; } if(!AD2LINE_STOP){ if($('#ad2line_' + x).html()){ $('.ad2line').hide(); $('#ad2line_' + x).show("slide",{direction: "up" },2000); var y = x + 1; AD2LINE_SETTIMEOUT = setTimeout("call_AD2LINE(" + y + ")", 7000); }else{ call_AD2LINE(1); } } } function stop_AD2LINE(x){ AD2LINE_STOP = 1; $('.ad2line').hide(); $('#ad2line_' + x).show(); clearInterval(AD2LINE_SETTIMEOUT); } function mo_AD2LINE(x){ AD2LINE_STOP = 0; call_AD2LINE(x); } function load_call_AD2LINE(){ if(!chk_call_AD2LINE_load){ chk_call_AD2LINE_load = 1; AD2LINE_STOP = 0; call_AD2LINE(1); } } /* 13.01.07 라이브리 댓글 호출 13.04.02 */ function Call_Liver_id(src_id,x){ $.getJSON('news_CallLivere_Process.php?smode=info&x=' + x,function(json){ if(!json.View_Ok){//댓글 html 만들기 var html = [];var t = 0; var url = 'http://dev.livere.co.kr/API_Livere?command=getArticle&calltype=consumer_seq&start_date=' + json.start_date + '&end_date=' + json.end_date + '&consumer_seq=' + json.consumer_seq + '&sort=' + json.sort + '&order_by=' + json.order_by + '&rowsnum=' + json.rowsnum + '&livereCallback=?'; $.getJSON(url,function(json2){ html[++t] = json.header_tag; var line_tag = json.line_tag; if(json2.result == "200"){//성공 for(var i=0;i< json2.resultData.length;i++){ // alert(json2.resultData[i].name); var un = json2.resultData[i].name; var url = json2.resultData[i].site; var title = json2.resultData[i].title; var content = json2.resultData[i].content; var n = i + 1; if(json.pattern_type == "1"){//반복 html[++t] = line_tag.replace('{USERNAME}',un).replace('{URL}',url).replace('{TITLE}',title).replace('{NUM}',n).replace('{CONTENT}',content); }else{//미반복 line_tag = line_tag.replace('{USERNAME' + n + '}',un).replace('{URL' + n + '}',url).replace('{TITLE' + n + '}',title).replace('{NUM' + n + '}',n).replace('{CONTENT' + n + '}',content).replace('http://http://','http://'); } } } if(json.pattern_type == "2"){ html[++t] = line_tag; } html[++t] = json.footer_tag; var html_body = html.join(''); $('#' + src_id).html(html_body); $.post('news_CallLivere_Process.php',{smode:'save',x:x,html_body:html_body},function(data){ if(data != "SUCCESS"){ alert(data); } }); }); }else{//저장되어있는 html_body $('#' + src_id).html(json.html_body); } }); } /* 13.01.15 설문조사 호출 */ function get_poll_id(src_id,x){ var radio_name = src_id + '_name'; $.get('news_poll_Process.php?smode=info&x=' + x + '&radio_name=' + radio_name,function(data){ $('#' + src_id).html(data); }); } function Chk_Poll(radio_name,x,mini,Chk_Du){ var chk_aw = $('input[name=' + radio_name + ']:checked').val(); if(!chk_aw){ alert('투표할 항목을 선택해주세요'); return; } //alert(Chk_Du); //Chk_Du 중복체크 타입 1: 아이피 2: 쿠키 $.post('news_poll_Process.php',{smode:'Chk_Poll',x:x,chk_aw:chk_aw,Chk_Du:Chk_Du},function(data){ if(data == 'SUCCESS'){ if(mini){ go_url('./#1_PollDesk_1@1@VIEW@' + x); }else{ window.location.reload(true); } }else{ alert(data); } }); } // 팝업띄움 (플래시에서 호출 필요할 경우) function popupWindow(url,w,h){ //alert(w + ':' + h); window.open(url,"flashPOP","widht="+w+",height="+h); } function layer_popupWindow(id_src,w,h,title){ $('#' + id_src).dialog({ modal: true, autoOpen: false, width:w, height:h, close:function(){}, title:title }); $('#' + id_src).dialog('open'); } //14.04.09 tinymce4 function tinymce4_load(){ tinymce.init({ selector: "textarea.tinymce", plugins: [ "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker", "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", "table contextmenu directionality emoticons template textcolor paste fullpage textcolor" ], toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect", toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor", toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft", menubar: false, toolbar_items_size: 'small', forced_root_block : false, force_br_newlines : true, force_p_newlines : false, height : "300", width : "100%", statusbar : false, setup : function(ed){ed.on('init', function(){this.getDoc().body.style.fontSize = '14px'})} }); } //스타일 reloading 14.04.12 addon용 function reloadStylesheets() { var stylesheets = $('link[rel="stylesheet"]'); var reloadQueryString = '?reload=' + new Date().getTime(); stylesheets.each(function () { if(this.href.indexOf('addon_menu_style.css') > 0){ this.href = this.href.replace(/\?.*|$/, reloadQueryString); } }); } /* 첨부화일 html 표출 */ function load_link_file(link_file){ //var link_file = $('textarea[name=link_file]').val(); var join_str = ''; if(link_file){ var str = link_file.split('|!'); var html = []; for(i=0;i' + f_name + '(' + f_size + ')'; } } } join_str = html.join(''); //$('#link_file_src').html(join_str); return join_str; } return; }