/* ½Å¹öÀü powered by hohyun. 09.07.01. modifed by hohyun. 10.08.30. modifed by hohyun. */ //My Ajax ÆÄ¶÷ ±âº»°ª. $.ajaxSetup°ú´Â ´Ù¸£´Ï À¯ÀÇ. $.MyAjaxDefaults = { url:"", type:"GET", dataType:"html", data:"", beforeSend: null, callback: function(data){}, bShowLoadingImg: true, //false ÁÖ¸é ·ÎµùÀ̹ÌÁö Ç¥½Ã¾ÈÇÔ. default´Â true loading_txt:"Please Wait..", loading_img: "/tccins/jquery/images/loading_bead2_green_32_bg404040.gif", //ani_loading.gif, loading_solid_round.gif, loading_with_text.gif loading_top: null, //·ÎµùÀ̹ÌÁö À§Ä¡ loading_left: null } function myajaxlocal(options) { var current = jQuery.extend({},$.MyAjaxDefaults, options); //options È®ÀåÇϱâ...^^ //alert(current.url); var bcw = document.body.clientWidth; var bch = document.body.clientHeight; var centerX = bcw/2 - 50; var centerY = bch/2; //alert(centerX + "/" + centerY); if (current.loading_top == null) current.loading_top = centerY; if (current.loading_left == null) current.loading_left = centerX; $.ajax({ url: current.url, async: true, type: current.type, dataType: current.dataType, data: current.data, beforeSend: function(){ if(current.beforeSend == null) { if(current.bShowLoadingImg) { var jqoWrapper = $('
').css({ color: '#C1C1C1', backgroundColor: '#404040', border: '0px dotted #004080', padding: (current.loading_txt=='')?'20px':'15px' + ' 0px 0px 0px', fontSize: '8pt', //fontFamily: 'verdana', fontFamily: 'Tahoma', textAlign: 'center', opacity: 20, width: '90px', height: '60px', lineHeight: '2.0em', top: current.loading_top, left: current.loading_left, position: 'absolute', zIndex: 3000, '-webkit-border-radius': '10px' //¸ð¹ÙÀÏÀü¿ë(¾ÆÀÌÆù »çÆÄ¸® ºê¶ó¿ìÀú) ¸ð¼­¸® µÕ±Û°Ôó¸® }); var jqoLoadText = $('
' + current.loading_txt + '
'); var jqoLoadImg = $('
') $(jqoWrapper).append(jqoLoadImg).append(jqoLoadText) $("body").append(jqoWrapper) } }else { current.beforeSend(); } }, success: function(data){ $('.loadingImg').remove(); current.callback(data); }, complete: function(xhr, textStatus) { }, error: function(xhr, textStatus, errorThrown){ $('.loadingImg').remove(); alert("myajaxlocal " + textStatus + "!!!, " + xhr.statusText + "(" + xhr.status + ")"); } }); } //jquery.form.js import Çʼö function myajaxsubmit(myOptions) { if(myOptions.targetFormId == null) return false; if(myOptions.targetFormId == '') return false; var defaultOptions = { //url: '', //»ý·«Çϸé formÀÇ action °ª //type: '', //»ý·«Çϸé formÀÇ METHOD °ª dataType: 'html', //text,html,xml, json, script //target: '#debugResponse', //response¸¦ »Ñ¸± Ÿ°Ù, »ý·«ÇÏ¸é ¾È»Ñ¸² clearForm: false, //true : ÆûÀ» Áö¿ò resetForm: false, //true : ÆûÀ» Àç¼³Á¤ semantic: false, //true : Æû ¸Å°³º¯¼ö°¡ ¼±¾ðµÈ ¼ø¼­´ë·Î Äõ¸®¹®ÀÚ¿­À» ¸¸µç´Ù. ºÎÇÏÁõ°¡µÇ´Ï ²À ÇÊ¿äÇÑ °æ¿ì¸¸ »ç¿ë //------ my custom param : s------- loading_txt:"Please Wait...", loading_img: "/tccins/jquery/images/loading_solid_round.gif", //ani_loading.gif, loading_solid_round.gif, loading_with_text.gif loading_top: null, //·ÎµùÀ̹ÌÁö À§Ä¡ loading_left: null, callback: function(data){}, //------ my custom param : e------- beforeSubmit: function(data,set,options) { $('
 
') .css({ color: '#004080', fontSize: '9pt', textAlign: 'center', opacity: 10, width: '200px', height: '200px', top: options.loading_top, left: options.loading_left, position: 'absolute', //text-align: 'center', zIndex: 3000 }) .appendTo('body').show(); //debug ÇÒ¶§ ÁÖ¼®Ç®°í »ç¿ë /* $("
").appendTo("body").show(); //data : form data ¹Ì¸®º¸±â $("
").css({padding:"10px",width:"100%",border:"1px solid #000000"}).appendTo("#debug") $("#debugFormData").html($.toSource(data)); //currentOptions(ÃÖÁ¾¿É¼Ç) ¹Ì¸®º¸±â $("
").css({padding:"10px",width:"100%",border:"1px solid #000000"}).appendTo("#debug") $("#debugOptions").html($.toSource($.extend({},options), true)); */ }, success: function(data,txtStatus,set) { //setÀº ajaxSubmit¸¦ È£ÃâÇÑ È®ÀåÁýÇÕ } } var currentOptions = jQuery.extend({},defaultOptions, myOptions); //options È®ÀåÇϱâ...^^ //callbackÀ» success·Î ¿Å°ÜÁÜ currentOptions.success = function(data,txtStatus,set) { $('.loadingImg').remove(); currentOptions.callback(data); } //loading top, left ÇÒ´ç //alert(current.url); var bcw = document.body.clientWidth; var bch = document.body.clientHeight; var centerX = bcw/2 - 100; var centerY = bch/2; //alert(centerX + "/" + centerY); if (currentOptions.loading_top == null) currentOptions.loading_top = centerY; if (currentOptions.loading_left == null) currentOptions.loading_left = centerX; $(currentOptions.targetFormId).ajaxSubmit(currentOptions); } /* ajax queue »ç¿ë ½Ã È£Ãâ 2010.11.11 by Choo */ function fShowLoadingImage(){ var current = jQuery.extend({},$.MyAjaxDefaults); //options È®ÀåÇϱâ...^^ var bcw = document.body.clientWidth; var bch = document.body.clientHeight; var centerX = bcw/2 - 50; var centerY = bch/2; if (current.loading_top == null) current.loading_top = centerY; if (current.loading_left == null) current.loading_left = centerX; $('
' + current.loading_txt + '
') .css({ color: '#004080', 'background-color': '#FFFFFF', border: '2px solid #004080', padding: '15px 0px 0px 0px', fontSize: '9pt', textAlign: 'center', opacity: 10, width: '80px', height: '60px', lineHeight: '2.0em', top: current.loading_top, left: current.loading_left, position: 'absolute', //text-align: 'center', zIndex: 3000, '-webkit-border-radius': '10px' //¸ð¹ÙÀÏÀü¿ë(¾ÆÀÌÆù »çÆÄ¸® ºê¶ó¿ìÀú) ¸ð¼­¸® µÕ±Û°Ôó¸® }) .appendTo('body').show(); } /* ajax queue »ç¿ë ½Ã ¸¶Áö¸· ÄݹéÇÔ¼ö¿¡¼­ È£Ãâ 2010.11.11 by Choo */ function fHideLoadingImage(){ $('.loadingImg').remove(); }