/* 에이빌더 전용 jquery 프로그램 */
// 에이빌더 게시판용
var cmt_modify_idx = '';
var cmt_reply_idx = '';
var cmt_delete_idx = '';
var auto_save_interval = null;
// This hotfix makes older versions of jQuery UI drag-and-drop work in IE9
(function($){var a=$.ui.mouse.prototype._mouseMove;$.ui.mouse.prototype._mouseMove=function(b){if($.browser.msie&&document.documentMode>=9){b.button=1};a.apply(this,[b]);}}(jQuery));
$(function() {
// 로딩중표시기
$('
').appendTo('body');
// 마우스 좌표 얻음
__mouse_xy = new Array();
$(this).bind('mousemove',function(e) {
__mouse_xy[0] = e.pageX;
__mouse_xy[1] = e.pageY;
__mouse_xy[2] = e.screenX;
__mouse_xy[3] = e.screenY;
});
// 날짜입력상자
now = new Date();
ab_date_picker();
// 드래그객체
$( ".draggable" ).draggable({ scroll: true });
// 버튼 커서모양 변경
$('body').on('mouseover', 'img[id*=_btn_],p[id*=_btn_],span[id*=_btn_],img[id*=-btn-],p[id*=-btn-],span[id*=-btn-]', function(event) { $(this).css('cursor', 'pointer'); } );
// 링크주소 #; 제거/복원
$('body').on('click', 'a', function(event) { if ($(this).attr('href') == '#;' || $(this).attr('href') == '#') $(this).attr('tmp', $(this).attr('href')).removeAttr('href').css('cursor', 'pointer'); });
$('body').on('mouseout', 'a', function(event) { if ($(this).attr('href') == null && $(this).attr('tmp') != null) $(this).attr('href', $(this).attr('tmp')).removeAttr('tmp'); });
// 풀다운 메뉴 마크업 항목 클릭 시 실행
$('body').on('click', 'p[id^=ABP-btn-fdmenu-],span[id^=ABP-btn-fdmenu-],img[id^=ABP-btn-fdmenu-]', function(event) {
var fd_btn_id = $(this).attr('id');
var fd_btn_exp = fd_btn_id.split('-');
var fd_btn_idx = $(this).attr('id').replace('ABP-btn-fdmenu-', '');
var link_tail = '?fd_btn_idx=' + fd_btn_idx;
var link = $(this).attr('link');
if (!link) link = '/tools/full_down_menu.tpl.php' + link_tail;
else link = link + link_tail;
var fd_menu_id = 'ABP-fdmenu-' + fd_btn_idx;
var obj_fd_menu = document.getElementById(fd_menu_id);
$('div[id^=ABP-fdmenu-]').css('display', 'none');
if (!obj_fd_menu) {
$.get(link, {}, function(data) {
if (data == '') return false;
var alert_msg = get_alert_msg_in_result(data);
if (alert_msg == 'null') $('#' + fd_btn_id).after(data);
else after_submit_cancel(alert_msg);
});
} else {
if (obj_fd_menu.style.display == '') obj_fd_menu.style.display = 'none';
else obj_fd_menu.style.display = '';
}
return false;
});
// 풀다운 메뉴 닫기
$('body').on('mouseleave', 'div.ABA-full-down-menu', function(event) { $(this).css('display', 'none'); });
// 클릭한 div 를 감추고 그와 매핑되는 div 를 보여줌
// 사용처 : 상태 변경을 위해 출력값을 즉시수정 버튼들로 변경 할 때 등
// load_url 속성이 있는 경우 해당 url 을 hidden 영역에 load() 함
$('body').on('click', 'div[id^=AB_dbclick_view_]', function(event) {
var dbclick_idx = $(this).attr('id').substr(Number($(this).attr('id').lastIndexOf('_')) + 1);
$(this).css('display', 'none');
var hidden_area = $('div[id=AB_dbclick_hidden_' + dbclick_idx + ']');
hidden_area.html('').css('display','');
var load_url = $(this).attr('load_url');
if (load_url != undefined) {
var form = $(this).parents('form');
if (form.length > 0) load_url += '&fn=' + form.attr('id') + '&bd=' + form.children('input[name=board]').val() + '&m_val=' + urlencode($(this).attr('m_val'));
hidden_area.load(ajax_url_filter(load_url), function() { });
}
});
// 로딩중 표시기 노출
$('body').on('click', '.loading-img', function(event) {
$('#loading_img').css('display', '');
$('#loading_img').center();
});
// 정렬 버튼 클릭시 실행
$('body').on('click', 'a[id^=AB_sort_]', function(event) {
$('#loading_img').css('display', '');
$('#loading_img').css('top', __mouse_xy[1]);
var sort_link = $(this).attr('href');
//document.location.href = sort_link;
//return;
var dialog = $(this).attr('dialog');
var refresh = $(this).attr('refresh');
var ajax_area = $(this).attr('ajax_area');
$.get(sort_link, {}, function(data) {
var alert_msg = get_alert_msg_in_result(data);
if (alert_msg == 'null') {
var exp_sort_1 = sort_link.split('&');
for (i=0; i..
$('body').on('click', '*[class*=AB_btn_dialog_]', function(event) {
var load_url;
var size = $(this).attr('rel').split(',');
var obj_global_dialog = $('#global_dialog');
if (obj_global_dialog.length <= 0) {
$('body').append('');
obj_global_dialog = $('#global_dialog');
} else {
if (obj_global_dialog.css('display') != 'none') obj_global_dialog.dialog('close');
}
if ($(this).attr('href') != undefined) {
load_url = $(this).attr('href');
var title, url_tail = '', is_modal = 'true', refresh_force = 'Y';
if (size[2] != undefined) title = size[2];
else title = $(this).attr('title');
if (size[3] != undefined) url_tail = '&' + size[3];
if (size[4] != undefined) is_modal = eval(size[4]);
if (size[5] != undefined) refresh_force = size[5];
if (refresh_force !== 'N') obj_global_dialog.html('');
obj_global_dialog.load(ajax_url_filter(load_url + url_tail) + '&AJAX=Y').dialog({
modal: is_modal,
title: title,
width: size[0],
height: size[1]
});
} else {
alert('URL이 없거나 동적 대화창을 열 수 없는 버튼 입니다.');
}
return false;
});
//