(function ($) { if (!$) { throw new Error('jQuery is undefined!'); } $('head').append( "" ); $.extend({ alert: function () { var args = arguments; if ( args.length && typeof args[0] == 'string' && !$('#alert_msg').length ) { var dialog = $( '
' ); dialog .on('click', '.alert_btn_ok', function () { $('.wrap_overlay').removeClass('wrap_overlay_show'); setTimeout(function () { dialog.remove(); }, 150); if (typeof args[1] == 'function') args[1].call($, !0); }) .appendTo('body'); setTimeout(function () { $('.wrap_overlay').addClass('wrap_overlay_show'); }, 10); } }, confirm: function () { var args = arguments; if ( args.length && typeof args[0] == 'string' && !$('#confirm_msg').length ) { var dialog = $( ' ' ); dialog .on('click', '#confirm_buttons .alert_btn_ok', function () { $('.wrap_overlay').removeClass('wrap_overlay_show'); setTimeout(function () { dialog.remove(); if (typeof args[1] == 'function') args[1].call($, !0); }, 200); }) .on('click', '#confirm_buttons .alert_btn_cancel', function () { $('.wrap_overlay').removeClass('wrap_overlay_show'); setTimeout(function () { dialog.remove(); if (typeof args[1] == 'function') args[1].call($, !1); }, 200); }) .appendTo('body'); setTimeout(function () { $('.wrap_overlay').addClass('wrap_overlay_show'); }, 10); } }, }); })(jQuery);