이지우 - seed 레이아웃 작업 중
This commit is contained in:
parent
d2c5879948
commit
656ca5d364
@ -18,7 +18,7 @@
|
||||
<link rel="stylesheet" href="/kccadrPb/adm/css/content_media.css">
|
||||
|
||||
<!-- script -->
|
||||
<script src="/kccadrPb/adm/script/jquery-3.5.0.js"></script>
|
||||
<!-- <script src="/kccadrPb/adm/script/jquery-3.5.0.js"></script> -->
|
||||
<script src="/kccadrPb/adm/script/common.js"></script>
|
||||
<script src="/kccadrPb/adm/script/content.js"></script>
|
||||
|
||||
@ -29,8 +29,7 @@
|
||||
<script src="<c:url value='/js/kccadr/kccadrCom.js' />"></script>
|
||||
<script src="<c:url value='/js/antdatepicker/moment.min.js'/>"></script>
|
||||
|
||||
|
||||
<!-- AS-IS 분쟁조정 -->
|
||||
<!-- 분쟁조정 기존 파일 -->
|
||||
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
||||
<link rel="icon" href="/img/favicon.ico" type="image/x-icon">
|
||||
|
||||
@ -41,22 +40,20 @@
|
||||
<link rel="stylesheet" href="/css/button.css">
|
||||
<link rel="stylesheet" href="/css/seed.contents.css">
|
||||
<link rel="stylesheet" href="/css/seed.mediaquery.css">
|
||||
|
||||
<!-- <link rel="stylesheet" href="/css/lib/jquery.mCustomScrollbar.min.css"> -->
|
||||
|
||||
<link rel="stylesheet" href="/css/lib/jquery.mCustomScrollbar.min.css">
|
||||
<link rel="stylesheet" href="/css/jquery-ui.css"/>
|
||||
<link rel="stylesheet" href="/css/jquery-ui.min.css"/>
|
||||
<link rel="stylesheet" href="/css/smartPop.css"/>
|
||||
<link rel="stylesheet" href="/css/space.css"/>
|
||||
<link rel="stylesheet" href="/css/picker.default.css">
|
||||
<link rel="stylesheet" href="/css/picker.default.date.css">
|
||||
<!-- <link rel="stylesheet" href="/css/case/common.css"> -->
|
||||
<link rel="stylesheet" href="/css/case/common.css">
|
||||
|
||||
<!-- 캘린더css -->
|
||||
<!-- <link rel="stylesheet" href="/css/case/fullcalendar.min.css">
|
||||
<link rel="stylesheet" href="/css/case/fullcalendar.min.css">
|
||||
<link rel="stylesheet" href="/css/case/fullcalendar.print.css" media='print'>
|
||||
<link rel="stylesheet" href="/css/case/scheduler.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="/css/case/jquery.qtip.css" /> -->
|
||||
<link type="text/css" rel="stylesheet" href="/css/case/jquery.qtip.css" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/css/clipreport.css">
|
||||
<link rel="stylesheet" type="text/css" href="/css/UserConfig.css">
|
||||
@ -69,55 +66,43 @@
|
||||
<![endif]-->
|
||||
|
||||
<!-- js -->
|
||||
<!-- 필요한 js 추후 추가 예정 -->
|
||||
<!-- 라이브러리, 플러그인 -->
|
||||
<script src="/js/seed/lib/jquery.blockUI.js"></script>
|
||||
<script src="/js/seed/lib/jquery-ui.min.js"></script>
|
||||
<!-- <script src="/js/lib/jquery-1.9.1.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lib/jquery-1.9.1.min.js"></script>
|
||||
<script src="/js/lib/jquery-ui.min.js"></script>
|
||||
<script src="/js/lib/jquery.blockUI.js"></script>
|
||||
<script src="/js/lib/jquery.pjax.js"></script>
|
||||
<script src="/js/lib/modernizr-custom.js"></script>
|
||||
<script src="/js/lib/jquery.mCustomScrollbar.concat.min.js"></script>
|
||||
|
||||
<script src="/js/lib/jquery.bxslider.min.js"></script>
|
||||
<script src="/js/lib/picker.js"></script>
|
||||
<script src="/js/lib/picker.date.js"></script>
|
||||
<script src="/js/lib/legacy.js"></script>
|
||||
<script src="/js/lib/base64.js"></script> -->
|
||||
<script src="/js/lib/base64.js"></script>
|
||||
|
||||
<!-- 라이브러리, 플러그인 끝 -->
|
||||
<!-- <script src="/js/jquery.seed.js"></script>
|
||||
<script src="/js/smartPop.js"></script>
|
||||
<script src="/js/jquery.seed.js"></script>
|
||||
<!-- <script src="/js/smartPop.js"></script> -->
|
||||
<script src="/js/seed.common.js"></script>
|
||||
<script src="/js/seed.tab.js"></script> -->
|
||||
<<<<<<< HEAD
|
||||
<script src="/js/seed/seed.app.js"></script>
|
||||
<script src="/js/seed/lib/jquery.bxslider.min.js"></script>
|
||||
<script src="/js/seed/commonFileUtil.js"></script>
|
||||
<script src="/js/seed/common_XHR.js"></script>
|
||||
<script src="/js/seed/jquery.selectboxes.js"></script>
|
||||
=======
|
||||
<!-- <script src="/js/seed.tab.js"></script> -->
|
||||
<script src="/js/seed.app.js"></script>
|
||||
<script src="/js/lib/jquery.bxslider.min.js"></script>
|
||||
|
||||
<script src="/js/jquery.form.js"></script>
|
||||
<script src="/js/commonFileUtil.js"></script>
|
||||
>>>>>>> refs/heads/tolag3
|
||||
<!-- <script src="/js/jquery.form.js"></script>
|
||||
|
||||
<script src="/js/common_XHR.js"></script>
|
||||
<script src="/js/common.js"></script>
|
||||
<script src="/js/DateTimePicker.js"></script>
|
||||
-->
|
||||
<script src="/js/jquery.selectboxes.js"></script>
|
||||
|
||||
<!-- 캘린더js -->
|
||||
<!-- <script src="/js/moment.min.js"></script>
|
||||
<script src="/js/moment.min.js"></script>
|
||||
<script src="/js/fullcalendar.min.js"></script>
|
||||
<script src="/js/scheduler.min.js"></script>
|
||||
<script src="/js/gcal.js"></script>
|
||||
<script src="/js/jquery.qtip.js"></script>
|
||||
|
||||
<script type='text/javascript' src='/js/clipreport.js'></script>
|
||||
<script type='text/javascript' src='/js/UserConfig.js'></script> -->
|
||||
<script type='text/javascript' src='/js/UserConfig.js'></script>
|
||||
<!-- js -->
|
||||
|
||||
<script>
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@ -9,7 +9,8 @@ window.seedApp = window.seedApp || (function( $ ){
|
||||
****************************************************************************************************** */
|
||||
$.tailFlag = false;
|
||||
|
||||
$('a[href="#"], a[href="#none"]').on('click.DefaultClick', false);
|
||||
/*레프트 메뉴 이동 오류로 인하여 주석처리*/
|
||||
/*$('a[href="#"], a[href="#none"]').on('click.DefaultClick', false);*/
|
||||
|
||||
$.fn.noop = function(){
|
||||
return this;
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
|
||||
function Seed(){
|
||||
|
||||
$('a[href="#"], a[href="#none"]').on('click.DefaultClick', false);
|
||||
/*레프트 메뉴 이동 오류로 인하여 주석처리*/
|
||||
/*$('a[href="#"], a[href="#none"]').on('click.DefaultClick', false);*/
|
||||
|
||||
var $root = $(window),
|
||||
$document = $(document),
|
||||
|
||||
@ -1,340 +0,0 @@
|
||||
/**
|
||||
* jQuery AJAX
|
||||
*/
|
||||
function XHR(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
|
||||
$.blockUI({ message : '<h1><img src="/img/blockbusy.gif" /> 잠시만 기다려주세요.</h1>' });
|
||||
jQuery.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
dataType: "html",
|
||||
//data: data + "&IS_AJAX_REQUEST=IS_AJAX_REQUEST",
|
||||
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
|
||||
data: data,
|
||||
async: true,
|
||||
cache: false,
|
||||
success: function (data, textStatus) {
|
||||
var result;
|
||||
try{
|
||||
console.log(data);
|
||||
result = eval('(' + data + ')');
|
||||
}catch(ex){
|
||||
$.unblockUI();
|
||||
alert(ex);
|
||||
}
|
||||
if( typeof(result) == 'object' ){ // JSON 오프젝트로 받음(리턴값이 JSON이거나 Exception 발생시)
|
||||
|
||||
if(result._EXCEPTION_){
|
||||
if(exceptionFunc){ // 익셉션 처리 함수가 있으면
|
||||
$.unblockUI();
|
||||
exceptionFunc(result._EXCEPTION_);
|
||||
}else{
|
||||
$.unblockUI();
|
||||
_processException(result._EXCEPTION_);
|
||||
}
|
||||
}else if(result._SESSION_OUT_){ // 세션 아웃 처리
|
||||
alert(result._SESSION_OUT_.message);
|
||||
if(result._SESSION_OUT_.redirectUrl !=""){
|
||||
$.unblockUI();
|
||||
parent.location.href= redirectUrl;
|
||||
}
|
||||
}else{
|
||||
if(callbackFunc){ // 익셉션이 아니고 callback 펑션이 있을때.
|
||||
$.unblockUI();
|
||||
callbackFunc(result);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(callbackFunc){ // HTML 형식의 리턴이며 callback 펑션이 있을때.
|
||||
$.unblockUI();
|
||||
callbackFunc(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeSend : function(){ // 로컬 이벤트 , 시작
|
||||
if(localStartFunc){
|
||||
$.unblockUI();
|
||||
localStartFunc();
|
||||
}
|
||||
},
|
||||
complete: function(){ // 로컬 이벤트 , 끝
|
||||
if(localEndFunc){
|
||||
$.unblockUI();
|
||||
localEndFunc();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//비동기 false
|
||||
function XHR2(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
|
||||
// $.blockUI({ message : '<h1><img src="/img/blockbusy.gif" /> 잠시만 기다려주세요.</h1>' });
|
||||
jQuery.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
dataType: "html",
|
||||
//data: data + "&IS_AJAX_REQUEST=IS_AJAX_REQUEST",
|
||||
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
|
||||
data: data,
|
||||
async: false,
|
||||
cache: false,
|
||||
success: function (data, textStatus) {
|
||||
var result;
|
||||
try{
|
||||
//시큐어코딩 관련 session이 들어가 있으면 신텍스 에러나기 떄문에 삭제
|
||||
/* data = data.replace('"SpringSecurityFiltersecurityinterceptorFilterapplied":true,','');
|
||||
data = data.replace('"SpringSecuritySessionMgmtFilterApplied":true,','');
|
||||
data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@689a8480: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@689a8480: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@b15278a; Granted Authorities: ROLE_USER,','');
|
||||
data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@7ef97b48: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@7ef97b48: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@1d76d842; Granted Authorities: ROLE_USER,','');
|
||||
data = data.replace('"SpringSecurityScpfApplied":true,','');
|
||||
data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@e3239a3: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@e3239a3: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@6dbd9aa9; Granted Authorities: ROLE_USER,','');
|
||||
*/
|
||||
|
||||
//20191004 주석.
|
||||
//console.log(data);
|
||||
|
||||
result = eval('(' + data + ')');
|
||||
|
||||
}catch(ex){
|
||||
$.unblockUI();
|
||||
alert(ex);
|
||||
}
|
||||
if( typeof(result) == 'object' ){ // JSON 오프젝트로 받음(리턴값이 JSON이거나 Exception 발생시)
|
||||
|
||||
if(result._EXCEPTION_){
|
||||
if(exceptionFunc){ // 익셉션 처리 함수가 있으면
|
||||
exceptionFunc(result._EXCEPTION_);
|
||||
$.unblockUI();
|
||||
}else{
|
||||
_processException(result._EXCEPTION_);
|
||||
$.unblockUI();
|
||||
}
|
||||
}else if(result._SESSION_OUT_){ // 세션 아웃 처리
|
||||
alert(result._SESSION_OUT_.message);
|
||||
if(result._SESSION_OUT_.redirectUrl !=""){
|
||||
$.unblockUI();
|
||||
parent.location.href= redirectUrl;
|
||||
}
|
||||
}else{
|
||||
if(callbackFunc){ // 익셉션이 아니고 callback 펑션이 있을때.
|
||||
$.unblockUI();
|
||||
callbackFunc(result);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(callbackFunc){ // HTML 형식의 리턴이며 callback 펑션이 있을 때.
|
||||
$.unblockUI();
|
||||
callbackFunc(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeSend : function(){ // 로컬 이벤트, 시작
|
||||
if(localStartFunc){
|
||||
$.unblockUI();
|
||||
localStartFunc();
|
||||
}
|
||||
},
|
||||
complete: function(){ // 로컬 이벤트, 끝
|
||||
if(localEndFunc){
|
||||
$.unblockUI();
|
||||
localEndFunc();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 기본 exception 처리 함수
|
||||
*/
|
||||
function _processException(exceptionModel){
|
||||
var str = "";
|
||||
if (exceptionModel.code != null && exceptionModel.code != "")
|
||||
{
|
||||
str = str+exceptionModel.code + "\n";
|
||||
str = str+exceptionModel.obj + "\n";
|
||||
str = str+exceptionModel.url + "\n";
|
||||
str = str+exceptionModel.message + "\n";
|
||||
}
|
||||
else if (exceptionModel.message != null && exceptionModel.message != "")
|
||||
{
|
||||
str = str+exceptionModel.message + "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
str = str + "알수없는 오류가 발생하였습니다.";
|
||||
}
|
||||
alert(str);
|
||||
}
|
||||
|
||||
/**
|
||||
* Json Type Ajax Function
|
||||
*
|
||||
* @param url
|
||||
* @param data
|
||||
* @param successFn
|
||||
*/
|
||||
function fn_ajax_json(url, data, type, async, successFn){
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
cache: false,
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: type,
|
||||
async: async,
|
||||
success: successFn,
|
||||
error: function() {
|
||||
alert("일시적인 오류가 발생되었습니다.\n현재 페이지를 새로고침 합니다.");
|
||||
location.href=location.href;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*function ajaxCombo2(data,objList, sel) {
|
||||
defaults = {type:'L',prgId:prgId,pId:pId};
|
||||
params = $.extend(defaults, data);
|
||||
|
||||
ajaxCombo(params,objList, sel);
|
||||
}
|
||||
|
||||
function ajaxCombo(data,objList, sel) {
|
||||
ajaxSync(data,
|
||||
function(res){
|
||||
if($.isArray(objList)) {
|
||||
for(var i=0;i<objList.length;i++) {
|
||||
if(objList[i].containsOption("")) objList[i].removeOption(/[^0]/);
|
||||
else objList[i].removeOption(/./);
|
||||
}
|
||||
} else {
|
||||
if(objList.containsOption("")) objList.removeOption(/[^0]/);
|
||||
else objList.removeOption(/./);
|
||||
}
|
||||
|
||||
$.each(res.data, function(k,v) {
|
||||
if($.isArray(objList)) {
|
||||
for(var i=0;i<objList.length;i++) {
|
||||
if(sel) {
|
||||
if(sel==v.code) objList[i].addOption(v.code,v.value,true);
|
||||
else objList[i].addOption(v.code,v.value,false);
|
||||
} else {
|
||||
objList[i].addOption(v.code,v.value,false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(sel) {
|
||||
if(sel==v.code) objList.addOption(v.code,v.value,true);
|
||||
else objList.addOption(v.code,v.value,false);
|
||||
} else {
|
||||
objList.addOption(v.code,v.value,false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
var gComboCount = 0;
|
||||
var onComboSucess = null;
|
||||
var onComboAllSucess = null;
|
||||
|
||||
function ajaxSync(data,func) {
|
||||
gComboCount++;
|
||||
//alert( "I:" + gComboCount);
|
||||
|
||||
defaults = {prgId:prgId,pId:pId};
|
||||
var params = $.extend(defaults, data);
|
||||
ajaxPostSync(
|
||||
params.url,
|
||||
params,
|
||||
function(res){
|
||||
gComboCount--;
|
||||
//alert("O:" + gComboCount);
|
||||
try {
|
||||
func(res);
|
||||
} catch (e) {
|
||||
alert("ajaxSync:" + e);
|
||||
}
|
||||
|
||||
if(onComboSucess!=null) onComboSucess(data,res);
|
||||
if(gComboCount==0) {
|
||||
if(onComboAllSucess!=null) onComboAllSucess();
|
||||
}
|
||||
} // end func
|
||||
);
|
||||
}
|
||||
|
||||
function ajaxPostSync(url, data, doSuccess) {
|
||||
try {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
|
||||
data: data,
|
||||
async: true,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
try {
|
||||
var rec = eval('(' + response + ')');
|
||||
//var rec = eval('(' + response + ');');
|
||||
doSuccess(rec,response);
|
||||
if(rec.status == "ok") {
|
||||
doSuccess(rec,response);
|
||||
} else {
|
||||
if(rec.status=="session") {
|
||||
if(!isSession) {
|
||||
alert(message_session_out);
|
||||
top.location.href = baseUrl;
|
||||
isSession = true;
|
||||
}
|
||||
} else {
|
||||
alert("error: " + rec.message);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
alert("error-2 : " + e);
|
||||
alert(response);
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
alert("error-1 : " + response);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
*/
|
||||
function ajaxCombo(data, objList, sel){
|
||||
//alert(objList.attr("id"));
|
||||
if($.isArray(objList)) {
|
||||
for(var i=0;i<objList.length;i++) {
|
||||
if(objList[i].containsOption("")) objList[i].removeOption(/[^0]/);
|
||||
else objList[i].removeOption(/./);
|
||||
}
|
||||
} else {
|
||||
if(objList.containsOption("")) objList.removeOption(/[^0]/);
|
||||
else objList.removeOption(/./);
|
||||
}
|
||||
|
||||
$.each(data, function(k,v) {
|
||||
if($.isArray(objList)) {
|
||||
for(var i=0;i<objList.length;i++) {
|
||||
if(v.parentCodeName.equals("")){
|
||||
if(sel) {
|
||||
if(sel==v.code) objList[i].addOption(v.code,v.value,true);
|
||||
else objList[i].addOption(v.code,v.value,false);
|
||||
} else {
|
||||
objList[i].addOption(v.code,v.value,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(sel) {
|
||||
if(sel==v.code) objList.addOption(v.code,v.value,true);
|
||||
else objList.addOption(v.code,v.value,false);
|
||||
} else {
|
||||
objList.addOption(v.code,v.value,false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1,553 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2006-2010 Sam Collett (http://www.texotela.co.uk)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
*
|
||||
* Version 2.2.5
|
||||
* Demo: http://www.texotela.co.uk/code/jquery/select/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
;(function($) {
|
||||
|
||||
/**
|
||||
* Adds (single/multiple) options to a select box (or series of select boxes)
|
||||
*
|
||||
* @name addOption
|
||||
* @author Sam Collett (http://www.texotela.co.uk)
|
||||
* @type jQuery
|
||||
* @example $("#myselect").addOption("Value", "Text"); // add single value (will be selected)
|
||||
* @example $("#myselect").addOption("Value 2", "Text 2", false); // add single value (won't be selected)
|
||||
* @example $("#myselect").addOption({"foo":"bar","bar":"baz"}, false); // add multiple values, but don't select
|
||||
*
|
||||
*/
|
||||
$.fn.addOption = function()
|
||||
{
|
||||
var add = function(el, v, t, sO, index)
|
||||
{
|
||||
var option = document.createElement("option");
|
||||
option.value = v, option.text = t;
|
||||
// get options
|
||||
var o = el.options;
|
||||
// get number of options
|
||||
var oL = o.length;
|
||||
if(!el.cache)
|
||||
{
|
||||
el.cache = {};
|
||||
// loop through existing options, adding to cache
|
||||
for(var i = 0; i < oL; i++)
|
||||
{
|
||||
el.cache[o[i].value] = i;
|
||||
}
|
||||
}
|
||||
if (index || index == 0)
|
||||
{
|
||||
// we're going to insert these starting at a specific index...
|
||||
// this has the side effect of el.cache[v] being the
|
||||
// correct value for the typeof check below
|
||||
var ti = option;
|
||||
for(var ii =index; ii <= oL; ii++)
|
||||
{
|
||||
var tmp = el.options[ii];
|
||||
el.options[ii] = ti;
|
||||
o[ii] = ti;
|
||||
el.cache[o[ii].value] = ii;
|
||||
ti = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
// add to cache if it isn't already
|
||||
if(typeof el.cache[v] == "undefined") el.cache[v] = oL;
|
||||
el.options[el.cache[v]] = option;
|
||||
if(sO)
|
||||
{
|
||||
option.selected = true;
|
||||
}
|
||||
};
|
||||
|
||||
var a = arguments;
|
||||
if(a.length == 0) return this;
|
||||
// select option when added? default is true
|
||||
var sO = true;
|
||||
// multiple items
|
||||
var m = false;
|
||||
// other variables
|
||||
var items, v, t;
|
||||
if(typeof(a[0]) == "object")
|
||||
{
|
||||
m = true;
|
||||
items = a[0];
|
||||
}
|
||||
if(a.length >= 2)
|
||||
{
|
||||
if(typeof(a[1]) == "boolean")
|
||||
{
|
||||
sO = a[1];
|
||||
startindex = a[2];
|
||||
}
|
||||
else if(typeof(a[2]) == "boolean")
|
||||
{
|
||||
sO = a[2];
|
||||
startindex = a[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
startindex = a[1];
|
||||
}
|
||||
if(!m)
|
||||
{
|
||||
v = a[0];
|
||||
t = a[1];
|
||||
}
|
||||
}
|
||||
this.each(
|
||||
function()
|
||||
{
|
||||
if(this.nodeName.toLowerCase() != "select") return;
|
||||
if(m)
|
||||
{
|
||||
for(var item in items)
|
||||
{
|
||||
add(this, item, items[item], sO, startindex);
|
||||
startindex += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
add(this, v, t, sO, startindex);
|
||||
}
|
||||
}
|
||||
);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add options via ajax
|
||||
*
|
||||
* @name ajaxAddOption
|
||||
* @author Sam Collett (http://www.texotela.co.uk)
|
||||
* @type jQuery
|
||||
* @param String url Page to get options from (must be valid JSON)
|
||||
* @param Object params (optional) Any parameters to send with the request
|
||||
* @param Boolean select (optional) Select the added options, default true
|
||||
* @param Function fn (optional) Call this function with the select object as param after completion
|
||||
* @param Array args (optional) Array with params to pass to the function afterwards
|
||||
* @example $("#myselect").ajaxAddOption("myoptions.php");
|
||||
* @example $("#myselect").ajaxAddOption("myoptions.php", {"code" : "007"});
|
||||
* @example $("#myselect").ajaxAddOption("myoptions.php", {"code" : "007"}, false, sortoptions, [{"dir": "desc"}]);
|
||||
*
|
||||
*/
|
||||
$.fn.ajaxAddOption = function(url, params, select, fn, args)
|
||||
{
|
||||
if(typeof(url) != "string") return this;
|
||||
if(typeof(params) != "object") params = {};
|
||||
if(typeof(select) != "boolean") select = true;
|
||||
this.each(
|
||||
function()
|
||||
{
|
||||
var el = this;
|
||||
$.getJSON(url,
|
||||
params,
|
||||
function(r)
|
||||
{
|
||||
$(el).addOption(r, select);
|
||||
if(typeof fn == "function")
|
||||
{
|
||||
if(typeof args == "object")
|
||||
{
|
||||
fn.apply(el, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
fn.call(el);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes an option (by value or index) from a select box (or series of select boxes)
|
||||
*
|
||||
* @name removeOption
|
||||
* @author Sam Collett (http://www.texotela.co.uk)
|
||||
* @type jQuery
|
||||
* @param String|RegExp|Number what Option to remove
|
||||
* @param Boolean selectedOnly (optional) Remove only if it has been selected (default false)
|
||||
* @example $("#myselect").removeOption("Value"); // remove by value
|
||||
* @example $("#myselect").removeOption(/^val/i); // remove options with a value starting with 'val'
|
||||
* @example $("#myselect").removeOption(/./); // remove all options
|
||||
* @example $("#myselect").removeOption(/./, true); // remove all options that have been selected
|
||||
* @example $("#myselect").removeOption(0); // remove by index
|
||||
* @example $("#myselect").removeOption(["myselect_1","myselect_2"]); // values contained in passed array
|
||||
*
|
||||
*/
|
||||
$.fn.removeOption = function()
|
||||
{
|
||||
var a = arguments;
|
||||
if(a.length == 0) return this;
|
||||
var ta = typeof(a[0]);
|
||||
var v, index;
|
||||
// has to be a string or regular expression (object in IE, function in Firefox)
|
||||
if(ta == "string" || ta == "object" || ta == "function" )
|
||||
{
|
||||
v = a[0];
|
||||
// if an array, remove items
|
||||
if(v.constructor == Array)
|
||||
{
|
||||
var l = v.length;
|
||||
for(var i = 0; i<l; i++)
|
||||
{
|
||||
this.removeOption(v[i], a[1]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
else if(ta == "number") index = a[0];
|
||||
else return this;
|
||||
this.each(
|
||||
function()
|
||||
{
|
||||
if(this.nodeName.toLowerCase() != "select") return;
|
||||
// clear cache
|
||||
if(this.cache) this.cache = null;
|
||||
// does the option need to be removed?
|
||||
var remove = false;
|
||||
// get options
|
||||
var o = this.options;
|
||||
if(!!v)
|
||||
{
|
||||
// get number of options
|
||||
var oL = o.length;
|
||||
for(var i=oL-1; i>=0; i--)
|
||||
{
|
||||
if(v.constructor == RegExp)
|
||||
{
|
||||
if(o[i].value.match(v))
|
||||
{
|
||||
remove = true;
|
||||
}
|
||||
}
|
||||
else if(o[i].value == v)
|
||||
{
|
||||
remove = true;
|
||||
}
|
||||
// if the option is only to be removed if selected
|
||||
if(remove && a[1] === true) remove = o[i].selected;
|
||||
if(remove)
|
||||
{
|
||||
o[i] = null;
|
||||
}
|
||||
remove = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// only remove if selected?
|
||||
if(a[1] === true)
|
||||
{
|
||||
remove = o[index].selected;
|
||||
}
|
||||
else
|
||||
{
|
||||
remove = true;
|
||||
}
|
||||
if(remove)
|
||||
{
|
||||
this.remove(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sort options (ascending or descending) in a select box (or series of select boxes)
|
||||
*
|
||||
* @name sortOptions
|
||||
* @author Sam Collett (http://www.texotela.co.uk)
|
||||
* @type jQuery
|
||||
* @param Boolean ascending (optional) Sort ascending (true/undefined), or descending (false)
|
||||
* @example // ascending
|
||||
* $("#myselect").sortOptions(); // or $("#myselect").sortOptions(true);
|
||||
* @example // descending
|
||||
* $("#myselect").sortOptions(false);
|
||||
*
|
||||
*/
|
||||
$.fn.sortOptions = function(ascending)
|
||||
{
|
||||
// get selected values first
|
||||
var sel = $(this).selectedValues();
|
||||
var a = typeof(ascending) == "undefined" ? true : !!ascending;
|
||||
this.each(
|
||||
function()
|
||||
{
|
||||
if(this.nodeName.toLowerCase() != "select") return;
|
||||
// get options
|
||||
var o = this.options;
|
||||
// get number of options
|
||||
var oL = o.length;
|
||||
// create an array for sorting
|
||||
var sA = [];
|
||||
// loop through options, adding to sort array
|
||||
for(var i = 0; i<oL; i++)
|
||||
{
|
||||
sA[i] = {
|
||||
v: o[i].value,
|
||||
t: o[i].text
|
||||
}
|
||||
}
|
||||
// sort items in array
|
||||
sA.sort(
|
||||
function(o1, o2)
|
||||
{
|
||||
// option text is made lowercase for case insensitive sorting
|
||||
o1t = o1.t.toLowerCase(), o2t = o2.t.toLowerCase();
|
||||
// if options are the same, no sorting is needed
|
||||
if(o1t == o2t) return 0;
|
||||
if(a)
|
||||
{
|
||||
return o1t < o2t ? -1 : 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return o1t > o2t ? -1 : 1;
|
||||
}
|
||||
}
|
||||
);
|
||||
// change the options to match the sort array
|
||||
for(var i = 0; i<oL; i++)
|
||||
{
|
||||
o[i].text = sA[i].t;
|
||||
o[i].value = sA[i].v;
|
||||
}
|
||||
}
|
||||
).selectOptions(sel, true); // select values, clearing existing ones
|
||||
return this;
|
||||
};
|
||||
/**
|
||||
* Selects an option by value
|
||||
*
|
||||
* @name selectOptions
|
||||
* @author Mathias Bank (http://www.mathias-bank.de), original function
|
||||
* @author Sam Collett (http://www.texotela.co.uk), addition of regular expression matching
|
||||
* @type jQuery
|
||||
* @param String|RegExp|Array value Which options should be selected
|
||||
* can be a string or regular expression, or an array of strings / regular expressions
|
||||
* @param Boolean clear Clear existing selected options, default false
|
||||
* @example $("#myselect").selectOptions("val1"); // with the value 'val1'
|
||||
* @example $("#myselect").selectOptions(["val1","val2","val3"]); // with the values 'val1' 'val2' 'val3'
|
||||
* @example $("#myselect").selectOptions(/^val/i); // with the value starting with 'val', case insensitive
|
||||
*
|
||||
*/
|
||||
$.fn.selectOptions = function(value, clear)
|
||||
{
|
||||
var v = value;
|
||||
var vT = typeof(value);
|
||||
// handle arrays
|
||||
if(vT == "object" && v.constructor == Array)
|
||||
{
|
||||
var $this = this;
|
||||
$.each(v, function()
|
||||
{
|
||||
$this.selectOptions(this, clear);
|
||||
}
|
||||
);
|
||||
};
|
||||
var c = clear || false;
|
||||
// has to be a string or regular expression (object in IE, function in Firefox)
|
||||
if(vT != "string" && vT != "function" && vT != "object") return this;
|
||||
this.each(
|
||||
function()
|
||||
{
|
||||
if(this.nodeName.toLowerCase() != "select") return this;
|
||||
// get options
|
||||
var o = this.options;
|
||||
// get number of options
|
||||
var oL = o.length;
|
||||
for(var i = 0; i<oL; i++)
|
||||
{
|
||||
if(v.constructor == RegExp)
|
||||
{
|
||||
if(o[i].value.match(v))
|
||||
{
|
||||
o[i].selected = true;
|
||||
}
|
||||
else if(c)
|
||||
{
|
||||
o[i].selected = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(o[i].value == v)
|
||||
{
|
||||
o[i].selected = true;
|
||||
}
|
||||
else if(c)
|
||||
{
|
||||
o[i].selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Copy options to another select
|
||||
*
|
||||
* @name copyOptions
|
||||
* @author Sam Collett (http://www.texotela.co.uk)
|
||||
* @type jQuery
|
||||
* @param String to Element to copy to
|
||||
* @param String which (optional) Specifies which options should be copied - 'all' or 'selected'. Default is 'selected'
|
||||
* @example $("#myselect").copyOptions("#myselect2"); // copy selected options from 'myselect' to 'myselect2'
|
||||
* @example $("#myselect").copyOptions("#myselect2","selected"); // same as above
|
||||
* @example $("#myselect").copyOptions("#myselect2","all"); // copy all options from 'myselect' to 'myselect2'
|
||||
*
|
||||
*/
|
||||
$.fn.copyOptions = function(to, which)
|
||||
{
|
||||
var w = which || "selected";
|
||||
if($(to).size() == 0) return this;
|
||||
this.each(
|
||||
function()
|
||||
{
|
||||
if(this.nodeName.toLowerCase() != "select") return this;
|
||||
// get options
|
||||
var o = this.options;
|
||||
// get number of options
|
||||
var oL = o.length;
|
||||
for(var i = 0; i<oL; i++)
|
||||
{
|
||||
if(w == "all" || (w == "selected" && o[i].selected))
|
||||
{
|
||||
$(to).addOption(o[i].value, o[i].text);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if a select box has an option with the supplied value
|
||||
*
|
||||
* @name containsOption
|
||||
* @author Sam Collett (http://www.texotela.co.uk)
|
||||
* @type Boolean|jQuery
|
||||
* @param String|RegExp value Which value to check for. Can be a string or regular expression
|
||||
* @param Function fn (optional) Function to apply if an option with the given value is found.
|
||||
* Use this if you don't want to break the chaining
|
||||
* @example if($("#myselect").containsOption("val1")) alert("Has an option with the value 'val1'");
|
||||
* @example if($("#myselect").containsOption(/^val/i)) alert("Has an option with the value starting with 'val'");
|
||||
* @example $("#myselect").containsOption("val1", copyoption).doSomethingElseWithSelect(); // calls copyoption (user defined function) for any options found, chain is continued
|
||||
*
|
||||
*/
|
||||
$.fn.containsOption = function(value, fn)
|
||||
{
|
||||
var found = false;
|
||||
var v = value;
|
||||
var vT = typeof(v);
|
||||
var fT = typeof(fn);
|
||||
// has to be a string or regular expression (object in IE, function in Firefox)
|
||||
if(vT != "string" && vT != "function" && vT != "object") return fT == "function" ? this: found;
|
||||
this.each(
|
||||
function()
|
||||
{
|
||||
if(this.nodeName.toLowerCase() != "select") return this;
|
||||
// option already found
|
||||
if(found && fT != "function") return false;
|
||||
// get options
|
||||
var o = this.options;
|
||||
// get number of options
|
||||
var oL = o.length;
|
||||
for(var i = 0; i<oL; i++)
|
||||
{
|
||||
if(v.constructor == RegExp)
|
||||
{
|
||||
if (o[i].value.match(v))
|
||||
{
|
||||
found = true;
|
||||
if(fT == "function") fn.call(o[i], i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (o[i].value == v)
|
||||
{
|
||||
found = true;
|
||||
if(fT == "function") fn.call(o[i], i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
return fT == "function" ? this : found;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns values which have been selected
|
||||
*
|
||||
* @name selectedValues
|
||||
* @author Sam Collett (http://www.texotela.co.uk)
|
||||
* @type Array
|
||||
* @example $("#myselect").selectedValues();
|
||||
*
|
||||
*/
|
||||
$.fn.selectedValues = function()
|
||||
{
|
||||
var v = [];
|
||||
this.selectedOptions().each(
|
||||
function()
|
||||
{
|
||||
v[v.length] = this.value;
|
||||
}
|
||||
);
|
||||
return v;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns text which has been selected
|
||||
*
|
||||
* @name selectedTexts
|
||||
* @author Sam Collett (http://www.texotela.co.uk)
|
||||
* @type Array
|
||||
* @example $("#myselect").selectedTexts();
|
||||
*
|
||||
*/
|
||||
$.fn.selectedTexts = function()
|
||||
{
|
||||
var t = [];
|
||||
this.selectedOptions().each(
|
||||
function()
|
||||
{
|
||||
t[t.length] = this.text;
|
||||
}
|
||||
);
|
||||
return t;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns options which have been selected
|
||||
*
|
||||
* @name selectedOptions
|
||||
* @author Sam Collett (http://www.texotela.co.uk)
|
||||
* @type jQuery
|
||||
* @example $("#myselect").selectedOptions();
|
||||
*
|
||||
*/
|
||||
$.fn.selectedOptions = function()
|
||||
{
|
||||
return this.find("option:selected");
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
12
src/main/webapp/js/seed/lib/jquery-ui.min.js
vendored
12
src/main/webapp/js/seed/lib/jquery-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,573 +0,0 @@
|
||||
/*!
|
||||
* jQuery blockUI plugin
|
||||
* Version 2.56.0-2013.01.31
|
||||
* @requires jQuery v1.7 or later
|
||||
*
|
||||
* Examples at: http://malsup.com/jquery/block/
|
||||
* Copyright (c) 2007-2013 M. Alsup
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Thanks to Amir-Hossein Sobhi for some excellent contributions!
|
||||
*/
|
||||
|
||||
;(function() {
|
||||
"use strict";
|
||||
|
||||
function setup($) {
|
||||
$.fn._fadeIn = $.fn.fadeIn;
|
||||
|
||||
var noOp = $.noop || function() {};
|
||||
|
||||
// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
|
||||
// retarded userAgent strings on Vista)
|
||||
var msie = /MSIE/.test(navigator.userAgent);
|
||||
var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
|
||||
var mode = document.documentMode || 0;
|
||||
// var setExpr = msie && (($.browser.version < 8 && !mode) || mode < 8);
|
||||
var setExpr = $.isFunction( document.createElement('div').style.setExpression );
|
||||
|
||||
// global $ methods for blocking/unblocking the entire page
|
||||
$.blockUI = function(opts) {
|
||||
opts.message = '<h1 style="margin-left: -147px;margin-top: -75.5px;padding: 15px 30px 25px 30px;" class="loding-txt"><img style="display:block;margin:0 auto;margin-bottom:10px;" src="/img/loading-page.gif" alt="로딩이미지" class="img-page-loding" > 잠시만 기다려주세요.</h1>';
|
||||
install(window, opts);
|
||||
};
|
||||
$.unblockUI = function(opts) { remove(window, opts); };
|
||||
|
||||
// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
|
||||
$.growlUI = function(title, message, timeout, onClose) {
|
||||
var $m = $('<div class="growlUI"></div>');
|
||||
if (title) $m.append('<h1>'+title+'</h1>');
|
||||
if (message) $m.append('<h2>'+message+'</h2>');
|
||||
if (timeout === undefined) timeout = 3000;
|
||||
$.blockUI({
|
||||
message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
|
||||
timeout: timeout, showOverlay: false,
|
||||
onUnblock: onClose,
|
||||
css: $.blockUI.defaults.growlCSS
|
||||
});
|
||||
};
|
||||
|
||||
// plugin method for blocking element content
|
||||
$.fn.block = function(opts) {
|
||||
var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
this.each(function() {
|
||||
var $el = $(this);
|
||||
if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
|
||||
return;
|
||||
$el.unblock({ fadeOut: 0 });
|
||||
});
|
||||
|
||||
return this.each(function() {
|
||||
if ($.css(this,'position') == 'static') {
|
||||
this.style.position = 'relative';
|
||||
$(this).data('blockUI.static', true);
|
||||
}
|
||||
this.style.zoom = 1; // force 'hasLayout' in ie
|
||||
install(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
// plugin method for unblocking element content
|
||||
$.fn.unblock = function(opts) {
|
||||
return this.each(function() {
|
||||
remove(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
$.blockUI.version = 2.56; // 2nd generation blocking at no extra cost!
|
||||
|
||||
// override these in your code to change the default behavior and style
|
||||
$.blockUI.defaults = {
|
||||
// message displayed when blocking (use null for no message)
|
||||
message: '<h1 class="loding-txt"><img src="/img/loading-page.gif" alt="로딩이미지" class="img-page-loding" > 잠시만 기다려주세요.</h1>',
|
||||
|
||||
title: null, // title string; only used when theme == true
|
||||
draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
|
||||
|
||||
theme: false, // set to true to use with jQuery UI themes
|
||||
|
||||
// styles for the message when blocking; if you wish to disable
|
||||
// these and use an external stylesheet then do this in your code:
|
||||
// $.blockUI.defaults.css = {};
|
||||
css: {
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
textAlign: 'center',
|
||||
color: '#262626',
|
||||
//background: '#fff'
|
||||
},
|
||||
|
||||
// minimal style set used when themes are used
|
||||
themedCSS: {
|
||||
width: '30%',
|
||||
top: '40%',
|
||||
left: '35%'
|
||||
},
|
||||
|
||||
// styles for the overlay
|
||||
overlayCSS: {
|
||||
backgroundColor: '#fff',
|
||||
opacity: 0.6,
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
// style to replace wait cursor before unblocking to correct issue
|
||||
// of lingering wait cursor
|
||||
cursorReset: 'default',
|
||||
|
||||
// styles applied when using $.growlUI
|
||||
growlCSS: {
|
||||
width: '350px',
|
||||
top: '10px',
|
||||
left: '',
|
||||
right: '10px',
|
||||
border: 'none',
|
||||
padding: '5px',
|
||||
opacity: 0.6,
|
||||
cursor: 'default',
|
||||
color: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
'-webkit-border-radius':'10px',
|
||||
'-moz-border-radius': '10px',
|
||||
'border-radius': '10px'
|
||||
},
|
||||
|
||||
// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
|
||||
// (hat tip to Jorge H. N. de Vasconcelos)
|
||||
/*jshint scripturl:true */
|
||||
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
|
||||
|
||||
// force usage of iframe in non-IE browsers (handy for blocking applets)
|
||||
forceIframe: false,
|
||||
|
||||
// z-index for the blocking overlay
|
||||
baseZ: 1000,
|
||||
|
||||
// set these to true to have the message automatically centered
|
||||
centerX: true, // <-- only effects element blocking (page block controlled via css above)
|
||||
centerY: true,
|
||||
|
||||
// allow body element to be stetched in ie6; this makes blocking look better
|
||||
// on "short" pages. disable if you wish to prevent changes to the body height
|
||||
allowBodyStretch: true,
|
||||
|
||||
// enable if you want key and mouse events to be disabled for content that is blocked
|
||||
bindEvents: true,
|
||||
|
||||
// be default blockUI will supress tab navigation from leaving blocking content
|
||||
// (if bindEvents is true)
|
||||
constrainTabKey: true,
|
||||
|
||||
// fadeIn time in millis; set to 0 to disable fadeIn on block
|
||||
fadeIn: 200,
|
||||
|
||||
// fadeOut time in millis; set to 0 to disable fadeOut on unblock
|
||||
fadeOut: 400,
|
||||
|
||||
// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
|
||||
timeout: 0,
|
||||
|
||||
// disable if you don't want to show the overlay
|
||||
showOverlay: true,
|
||||
|
||||
// if true, focus will be placed in the first available input field when
|
||||
// page blocking
|
||||
focusInput: true,
|
||||
|
||||
// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
|
||||
// no longer needed in 2012
|
||||
// applyPlatformOpacityRules: true,
|
||||
|
||||
// callback method invoked when fadeIn has completed and blocking message is visible
|
||||
onBlock: null,
|
||||
|
||||
// callback method invoked when unblocking has completed; the callback is
|
||||
// passed the element that has been unblocked (which is the window object for page
|
||||
// blocks) and the options that were passed to the unblock call:
|
||||
// onUnblock(element, options)
|
||||
onUnblock: null,
|
||||
|
||||
// callback method invoked when the overlay area is clicked.
|
||||
// setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
|
||||
onOverlayClick: null,
|
||||
|
||||
// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
|
||||
quirksmodeOffsetHack: 4,
|
||||
|
||||
// class name of the message block
|
||||
blockMsgClass: 'blockMsg',
|
||||
|
||||
// if it is already blocked, then ignore it (don't unblock and reblock)
|
||||
ignoreIfBlocked: false
|
||||
};
|
||||
|
||||
// private data and functions follow...
|
||||
|
||||
var pageBlock = null;
|
||||
var pageBlockEls = [];
|
||||
|
||||
function install(el, opts) {
|
||||
var css, themedCSS;
|
||||
var full = (el == window);
|
||||
var msg = (opts && opts.message !== undefined ? opts.message : undefined);
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
|
||||
if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
|
||||
return;
|
||||
|
||||
opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
|
||||
css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
|
||||
if (opts.onOverlayClick)
|
||||
opts.overlayCSS.cursor = 'pointer';
|
||||
|
||||
themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
|
||||
msg = msg === undefined ? opts.message : msg;
|
||||
|
||||
// remove the current block (if there is one)
|
||||
if (full && pageBlock)
|
||||
remove(window, {fadeOut:0});
|
||||
|
||||
// if an existing element is being used as the blocking content then we capture
|
||||
// its current place in the DOM (and current display style) so we can restore
|
||||
// it when we unblock
|
||||
if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
|
||||
var node = msg.jquery ? msg[0] : msg;
|
||||
var data = {};
|
||||
$(el).data('blockUI.history', data);
|
||||
data.el = node;
|
||||
data.parent = node.parentNode;
|
||||
data.display = node.style.display;
|
||||
data.position = node.style.position;
|
||||
if (data.parent)
|
||||
data.parent.removeChild(node);
|
||||
}
|
||||
|
||||
$(el).data('blockUI.onUnblock', opts.onUnblock);
|
||||
var z = opts.baseZ;
|
||||
|
||||
// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
|
||||
// layer1 is the iframe layer which is used to supress bleed through of underlying content
|
||||
// layer2 is the overlay layer which has opacity and a wait cursor (by default)
|
||||
// layer3 is the message content that is displayed while blocking
|
||||
var lyr1, lyr2, lyr3, s;
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
|
||||
else
|
||||
lyr1 = $('<div class="blockUI" style="display:none"></div>');
|
||||
|
||||
if (opts.theme)
|
||||
lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
|
||||
else
|
||||
lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
|
||||
|
||||
if (opts.theme && full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (opts.theme) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
|
||||
}
|
||||
else {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
|
||||
}
|
||||
lyr3 = $(s);
|
||||
|
||||
// if we have a message, style it
|
||||
if (msg) {
|
||||
if (opts.theme) {
|
||||
lyr3.css(themedCSS);
|
||||
lyr3.addClass('ui-widget-content');
|
||||
}
|
||||
else
|
||||
lyr3.css(css);
|
||||
}
|
||||
|
||||
// style the overlay
|
||||
if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
|
||||
lyr2.css(opts.overlayCSS);
|
||||
lyr2.css('position', full ? 'fixed' : 'absolute');
|
||||
|
||||
// make iframe layer transparent in IE
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1.css('opacity',0.0);
|
||||
|
||||
//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
|
||||
var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
|
||||
$.each(layers, function() {
|
||||
this.appendTo($par);
|
||||
});
|
||||
|
||||
if (opts.theme && opts.draggable && $.fn.draggable) {
|
||||
lyr3.draggable({
|
||||
handle: '.ui-dialog-titlebar',
|
||||
cancel: 'li'
|
||||
});
|
||||
}
|
||||
|
||||
// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
|
||||
var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
|
||||
if (ie6 || expr) {
|
||||
// give body 100% height
|
||||
if (full && opts.allowBodyStretch && $.support.boxModel)
|
||||
$('html,body').css('height','100%');
|
||||
|
||||
// fix ie6 issue when blocked element has a border width
|
||||
if ((ie6 || !$.support.boxModel) && !full) {
|
||||
var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
|
||||
var fixT = t ? '(0 - '+t+')' : 0;
|
||||
var fixL = l ? '(0 - '+l+')' : 0;
|
||||
}
|
||||
|
||||
// simulate fixed position
|
||||
$.each(layers, function(i,o) {
|
||||
var s = o[0].style;
|
||||
s.position = 'absolute';
|
||||
if (i < 2) {
|
||||
if (full)
|
||||
s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
|
||||
else
|
||||
s.setExpression('height','this.parentNode.offsetHeight + "px"');
|
||||
if (full)
|
||||
s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
|
||||
else
|
||||
s.setExpression('width','this.parentNode.offsetWidth + "px"');
|
||||
if (fixL) s.setExpression('left', fixL);
|
||||
if (fixT) s.setExpression('top', fixT);
|
||||
}
|
||||
else if (opts.centerY) {
|
||||
if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
|
||||
s.marginTop = 0;
|
||||
}
|
||||
else if (!opts.centerY && full) {
|
||||
var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
|
||||
var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
|
||||
s.setExpression('top',expression);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// show the message
|
||||
if (msg) {
|
||||
if (opts.theme)
|
||||
lyr3.find('.ui-widget-content').append(msg);
|
||||
else
|
||||
lyr3.append(msg);
|
||||
if (msg.jquery || msg.nodeType)
|
||||
$(msg).show();
|
||||
}
|
||||
|
||||
if ((msie || opts.forceIframe) && opts.showOverlay)
|
||||
lyr1.show(); // opacity is zero
|
||||
if (opts.fadeIn) {
|
||||
var cb = opts.onBlock ? opts.onBlock : noOp;
|
||||
var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
|
||||
var cb2 = msg ? cb : noOp;
|
||||
if (opts.showOverlay)
|
||||
lyr2._fadeIn(opts.fadeIn, cb1);
|
||||
if (msg)
|
||||
lyr3._fadeIn(opts.fadeIn, cb2);
|
||||
}
|
||||
else {
|
||||
if (opts.showOverlay)
|
||||
lyr2.show();
|
||||
if (msg)
|
||||
lyr3.show();
|
||||
if (opts.onBlock)
|
||||
opts.onBlock();
|
||||
}
|
||||
|
||||
// bind key and mouse events
|
||||
bind(1, el, opts);
|
||||
|
||||
if (full) {
|
||||
pageBlock = lyr3[0];
|
||||
pageBlockEls = $(':input:enabled:visible',pageBlock);
|
||||
if (opts.focusInput)
|
||||
setTimeout(focus, 20);
|
||||
}
|
||||
else
|
||||
center(lyr3[0], opts.centerX, opts.centerY);
|
||||
|
||||
if (opts.timeout) {
|
||||
// auto-unblock
|
||||
var to = setTimeout(function() {
|
||||
if (full)
|
||||
$.unblockUI(opts);
|
||||
else
|
||||
$(el).unblock(opts);
|
||||
}, opts.timeout);
|
||||
$(el).data('blockUI.timeout', to);
|
||||
}
|
||||
}
|
||||
|
||||
// remove the block
|
||||
function remove(el, opts) {
|
||||
var full = (el == window);
|
||||
var $el = $(el);
|
||||
var data = $el.data('blockUI.history');
|
||||
var to = $el.data('blockUI.timeout');
|
||||
if (to) {
|
||||
clearTimeout(to);
|
||||
$el.removeData('blockUI.timeout');
|
||||
}
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
bind(0, el, opts); // unbind events
|
||||
|
||||
if (opts.onUnblock === null) {
|
||||
opts.onUnblock = $el.data('blockUI.onUnblock');
|
||||
$el.removeData('blockUI.onUnblock');
|
||||
}
|
||||
|
||||
var els;
|
||||
if (full) // crazy selector to handle odd field errors in ie6/7
|
||||
els = $('body').children().filter('.blockUI').add('body > .blockUI');
|
||||
else
|
||||
els = $el.find('>.blockUI');
|
||||
|
||||
// fix cursor issue
|
||||
if ( opts.cursorReset ) {
|
||||
if ( els.length > 1 )
|
||||
els[1].style.cursor = opts.cursorReset;
|
||||
if ( els.length > 2 )
|
||||
els[2].style.cursor = opts.cursorReset;
|
||||
}
|
||||
|
||||
if (full)
|
||||
pageBlock = pageBlockEls = null;
|
||||
|
||||
if (opts.fadeOut) {
|
||||
els.fadeOut(opts.fadeOut);
|
||||
setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
|
||||
}
|
||||
else
|
||||
reset(els, data, opts, el);
|
||||
}
|
||||
|
||||
// move blocking element back into the DOM where it started
|
||||
function reset(els,data,opts,el) {
|
||||
var $el = $(el);
|
||||
els.each(function(i,o) {
|
||||
// remove via DOM calls so we don't lose event handlers
|
||||
if (this.parentNode)
|
||||
this.parentNode.removeChild(this);
|
||||
});
|
||||
|
||||
if (data && data.el) {
|
||||
data.el.style.display = data.display;
|
||||
data.el.style.position = data.position;
|
||||
if (data.parent)
|
||||
data.parent.appendChild(data.el);
|
||||
$el.removeData('blockUI.history');
|
||||
}
|
||||
|
||||
if ($el.data('blockUI.static')) {
|
||||
$el.css('position', 'static'); // #22
|
||||
}
|
||||
|
||||
if (typeof opts.onUnblock == 'function')
|
||||
opts.onUnblock(el,opts);
|
||||
|
||||
// fix issue in Safari 6 where block artifacts remain until reflow
|
||||
var body = $(document.body), w = body.width(), cssW = body[0].style.width;
|
||||
body.width(w-1).width(w);
|
||||
body[0].style.width = cssW;
|
||||
}
|
||||
|
||||
// bind/unbind the handler
|
||||
function bind(b, el, opts) {
|
||||
var full = el == window, $el = $(el);
|
||||
|
||||
// don't bother unbinding if there is nothing to unbind
|
||||
if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
|
||||
return;
|
||||
|
||||
$el.data('blockUI.isBlocked', b);
|
||||
|
||||
// don't bind events when overlay is not in use or if bindEvents is false
|
||||
if (!opts.bindEvents || (b && !opts.showOverlay))
|
||||
return;
|
||||
|
||||
// bind anchors and inputs for mouse and key events
|
||||
var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
|
||||
if (b)
|
||||
$(document).bind(events, opts, handler);
|
||||
else
|
||||
$(document).unbind(events, handler);
|
||||
|
||||
// former impl...
|
||||
// var $e = $('a,:input');
|
||||
// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
|
||||
}
|
||||
|
||||
// event handler to suppress keyboard/mouse events when blocking
|
||||
function handler(e) {
|
||||
// allow tab navigation (conditionally)
|
||||
if (e.keyCode && e.keyCode == 9) {
|
||||
if (pageBlock && e.data.constrainTabKey) {
|
||||
var els = pageBlockEls;
|
||||
var fwd = !e.shiftKey && e.target === els[els.length-1];
|
||||
var back = e.shiftKey && e.target === els[0];
|
||||
if (fwd || back) {
|
||||
setTimeout(function(){focus(back);},10);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
var opts = e.data;
|
||||
var target = $(e.target);
|
||||
if (target.hasClass('blockOverlay') && opts.onOverlayClick)
|
||||
opts.onOverlayClick();
|
||||
|
||||
// allow events within the message content
|
||||
if (target.parents('div.' + opts.blockMsgClass).length > 0)
|
||||
return true;
|
||||
|
||||
// allow events for content that is not being blocked
|
||||
return target.parents().children().filter('div.blockUI').length === 0;
|
||||
}
|
||||
|
||||
function focus(back) {
|
||||
if (!pageBlockEls)
|
||||
return;
|
||||
var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
|
||||
if (e)
|
||||
e.focus();
|
||||
}
|
||||
|
||||
function center(el, x, y) {
|
||||
var p = el.parentNode, s = el.style;
|
||||
var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
|
||||
var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
|
||||
if (x) s.left = l > 0 ? (l+'px') : '0';
|
||||
if (y) s.top = t > 0 ? (t+'px') : '0';
|
||||
}
|
||||
|
||||
function sz(el, p) {
|
||||
return parseInt($.css(el,p),10)||0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*global define:true */
|
||||
if (typeof define === 'function' && define.amd && define.amd.jQuery) {
|
||||
define(['jquery'], setup);
|
||||
} else {
|
||||
setup(jQuery);
|
||||
}
|
||||
|
||||
})();
|
||||
Loading…
Reference in New Issue
Block a user