/* 패턴 맞춤 */ 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 = []; function Attach_Sort(){ var str = $('textarea[name=link_file]').val().split('|!'); var html = []; for(i=0;i[x][]'; } } } var join_str = html.join(''); $("#Find_File_Src").html(join_str); } 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://webhard.extriple.com/#','http://webhard.extriple.com/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',''); } /* 이미지 crop */ function show_img_crop(img_url,img_width,img_height){ top_pos = 0; var src_img = ""; /* src_img += "
"; src_img +=""; src_img += ""; src_img += ""; src_img += "
"; */ src_img += "
"; src_img +=""; src_img += "
"; src_img += "
"; src_img += "
"; //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); } function CmClose(idname){ $('#' + idname).dialog('close'); }