var nztrueLib = {
/*
ÀÌ °´Ã¼´Â Àü¿ª °´Ã¼·Î ¸ðµç °÷¿¡¼ Á¢±ÙÀÌ °¡´ÉÇÕ´Ï´Ù.
*/
replaceAll: function (str, searchStr, replaceStr) {
/*
ÀÌ ¸Þ¼µå´Â Àüü¸¦ º¯°æ(replace)ÇÕ´Ï´Ù.
*/
if (str && typeof str === 'string')
return str.split(searchStr).join(replaceStr);
return '';
},
log: function (message) {
/*
ÀÌ ¸Þ¼µå´Â ·Î±×¸¦ Ç¥½ÃÇÕ´Ï´Ù.
*/
try {
console.log(message);
}
catch (e) {
alert(message);
}
},
isNullOrEmpty: function (paramValue) {
/*
ÀÌ ¸Þ¼µå´Â °ªÀÌ ºó °ª ȤÀº null ȤÀº undefined ÀÎÁö üũÇÕ´Ï´Ù.
*/
var returnValue = null;
paramValue = $.trim(paramValue);
if (paramValue == '' || paramValue == null || paramValue == 'null' || paramValue == undefined) {
returnValue = true;
}
else {
returnValue = false;
}
return returnValue;
},
// À̹ÌÁö È®ÀåÀÚ ¹è¿
imgArray: ['jpg', 'png', 'gif', 'jpeg'],
base64_encode: function (str) {
/*
ÀÌ ¸Þ¼µå´Â base64 ·Î ¾ÏÈ£È(encode)ÇÕ´Ï´Ù.
*/
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
return String.fromCharCode('0x' + p1);
}));
},
base64_decode: function (str) {
/*
ÀÌ ¸Þ¼µå´Â base64 ·Î º¹È£È(decode)ÇÕ´Ï´Ù.
*/
return decodeURIComponent(Array.prototype.map.call(atob(str), function (c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
},
htmlEncode: function (value) {
/*
ÀÌ ¸Þ¼µå´Â ÅØ½ºÆ®¸¦ html·Î ¾ÏÈ£È(encode)ÇÕ´Ï´Ù.
*/
return $('
·Îµù ÁßÀÔ´Ï´Ù.
';
var i = 0;
$('#processPop').stop().css('opacity', 1);
$('#processPop .message span').removeClass('transition');
clearInterval(nztrueLib.interval);
$('#processPop > #processPopWrapper').html(popHtml);
$('#processPop').show();
nztrueLib.interval = setInterval(function () {
if ($('#processPop .message span').length + 1 == i)
i = 0;
$('#processPop .message span:eq(' + i + ')').toggleClass('transition');
i += 1;
}, 70);
//setTimeout(function () {
// if ($('#processPop').is(':visible'))
// $('#processPop').fadeOut(210);
//}, 7600);
}
else if (type == 'hide') {
if ($('#processPop').length) {
clearTimeout(nztrueLib.timeOut['processPop']);
nztrueLib.timeOut['processPop'] = setTimeout(function () {
$('#processPop').stop().fadeOut(420, function () {
clearInterval(nztrueLib.interval);
});
}, 210);
}
}
},
bandMessage: function (type, message, time) {
/*
ÀÌ ¸Þ¼µå´Â ·¹À̾î·Î Band ¸Þ½ÃÁö¸¦ ¶ç¿ó´Ï´Ù.
*/
clearTimeout(nztrueLib.timeOut['bandMessage']);
var messageHtml = '';
if ($('body').find('#bandMessage').length < 1)
$('body').prepend('';
messageHtml += '
×';
messageHtml += message;
messageHtml += '
';
$('#bandMessage > #bandMessageWrapper').html(messageHtml);
$('#bandMessage .message').hide().stop().fadeIn(300);
if (time === undefined)
time = 3000;
if (time !== 0) {
nztrueLib.timeOut['bandMessage'] = setTimeout(function () {
$('#bandMessage .message').stop().fadeOut(720);
}, time);
}
},
bandMessageCookie: function (type, text, time) {
/*
ÀÌ ¸Þ¼µå´Â ·¹À̾î·Î Band ¸Þ½ÃÁö¸¦ ¶ç¿ó´Ï´Ù.
ÄíŰ·Î ÀúÀåÇÏ¿© ½ÇÇà ÈÄ ¹Ù·Î ´ÙÀ½ ÆäÀÌÁö¿¡¼ ½ÇÇàÇÕ´Ï´Ù.
*/
var args = {
type: type,
text: text,
time: time
};
$.cookie('bandMessage', JSON.stringify(args), { expires: 1, path: '/' });
},
addLoadEvent: function (func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
}
else {
window.onload = function () {
oldonload();
func();
}
}
},
focusToEnd: function (inputSelector) {
/*
ÀÌ ¸Þ¼µå´Â input ¸Ç ³¡¿¡ Æ÷Ä¿½º ¸ÂÃä´Ï´Ù.
*/
if (inputSelector != undefined) {
var searchInput = $(inputSelector);
if (searchInput.val() != undefined) {
var strLength = searchInput.val().length * 2;
searchInput.focus();
searchInput[0].setSelectionRange(strLength, strLength);
}
}
},
isEmailValidate: function (paramEmail) {
/*
ÀÌ ¸Þ¼µå´Â À̸ÞÀÏ Çü½ÄÀÌ ¸Â´ÂÁö üũÇÕ´Ï´Ù.
*/
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return regex.test(paramEmail);
},
removeElements: function (paramText, paramSelector) {
/*
ÀÌ ¸Þ¼µå´Â ƯÁ¤ ¿ä¼Ò(element)¸¦ Á¦°ÅÇÕ´Ï´Ù.
*/
var wrappedElement = $("