공백, 탭 수정

main
이범준 5 months ago
parent 06eff26dd1
commit 6def344216

@ -35,7 +35,7 @@ function isEmpty(v) {
|| v == null || v == null
|| v == "null" || v == "null"
) return true; ) return true;
switch (typeof(v)) { switch (typeof(v)) {
case "string": return "" == trim(v); case "string": return "" == trim(v);
case "boolean": if (false == v) return false; case "boolean": if (false == v) return false;
@ -81,13 +81,13 @@ function toQuery(map, encode) {
function uuid() { function uuid() {
var hexDigits = "0123456789abcde", var hexDigits = "0123456789abcde",
result = []; result = [];
for (var i = 0; i < 36; ++i) for (var i = 0; i < 36; ++i)
result[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); result[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
result[14] = "4"; result[14] = "4";
result[19] = hexDigits.substr((result[19] & 0x3) | 0x8, 1); result[19] = hexDigits.substr((result[19] & 0x3) | 0x8, 1);
result[8] = result[13] = result[18] = result[23] = "-"; result[8] = result[13] = result[18] = result[23] = "-";
return result.join(""); return result.join("");
} }
@ -140,15 +140,15 @@ var dialog = {
size = " modal-" + size; size = " modal-" + size;
tmpl = tmpl.replace(/{size}/, size); tmpl = tmpl.replace(/{size}/, size);
dlg = $(tmpl).appendTo("body"); dlg = $(tmpl).appendTo("body");
dlg.find(".modal-body").html(conf.content || "").fadeIn(); dlg.find(".modal-body").html(conf.content || "").fadeIn();
dlg.on("hidden.bs.modal", function() {// on dialog close dlg.on("hidden.bs.modal", function() {// on dialog close
$("#" + id +",#" + backdropID).remove(); // removes the dialog and its backdrop $("#" + id +",#" + backdropID).remove(); // removes the dialog and its backdrop
if (conf.onClose) if (conf.onClose)
conf.onClose(); conf.onClose();
}); });
if (conf.onOK) { if (conf.onOK) {
let footer = dlg.find(".modal-footer"); let footer = dlg.find(".modal-footer");
footer.removeClass("hidden"); footer.removeClass("hidden");
@ -157,7 +157,7 @@ var dialog = {
if (conf.getData) { if (conf.getData) {
var selected = conf.getData.apply(); var selected = conf.getData.apply();
if (!selected) return; if (!selected) return;
conf.onOK(selected); conf.onOK(selected);
dialog.close(id); dialog.close(id);
} else { } else {
@ -177,7 +177,7 @@ var dialog = {
if (!backdrop.prop("id")) if (!backdrop.prop("id"))
backdrop.prop("id", backdropID); backdrop.prop("id", backdropID);
}); });
if (conf.init) if (conf.init)
conf.init(); conf.init();
}, },
@ -198,11 +198,11 @@ var dialog = {
function onError(xhr, options, error) { function onError(xhr, options, error) {
if (xhr.readyState == 0) if (xhr.readyState == 0)
return dialog.alert("서버에 접근할 수 없습니다."); return dialog.alert("서버에 접근할 수 없습니다.");
var resp = JSON.parse(xhr.responseText); var resp = JSON.parse(xhr.responseText);
if (resp.handler) if (resp.handler)
return eval(resp.handler); return eval(resp.handler);
var msgs = []; var msgs = [];
for (key in resp) for (key in resp)
msgs.push(resp[key]) msgs.push(resp[key])
@ -223,17 +223,17 @@ var ajax = {
if (options.data) if (options.data)
options.type = "POST"; options.type = "POST";
} }
var success = options.success; var success = options.success;
options.success = function(resp) { options.success = function(resp) {
if ("string" == typeof resp) if ("string" == typeof resp)
resp = trim(resp); resp = trim(resp);
var stacktrace = resp.stacktrace; var stacktrace = resp.stacktrace;
delete resp.stacktrace; delete resp.stacktrace;
debug("response", resp); debug("response", resp);
if (!resp.failed) if (!resp.failed)
return success(resp); return success(resp);
@ -241,17 +241,17 @@ var ajax = {
title:resp.title, title:resp.title,
content:[resp.description, resp.message].join("<br />") content:[resp.description, resp.message].join("<br />")
}); });
debug("stacktrace", stacktrace); debug("stacktrace", stacktrace);
}; };
var handleError = options.error || onError; var handleError = options.error || onError;
options.error = function(xhr, options, error) { options.error = function(xhr, options, error) {
wait(false); wait(false);
debug("error", xhr, options, error); debug("error", xhr, options, error);
handleError(xhr, options, error); handleError(xhr, options, error);
} }
var handleComplete = options.complete || function(){}; var handleComplete = options.complete || function(){};
options.complete = function() { options.complete = function() {
wait(false); wait(false);
@ -462,14 +462,14 @@ $.fn.getValues = function(propertyMapper) {
key = input.prop("id") || input.prop("name"), key = input.prop("id") || input.prop("name"),
value = input.val(); value = input.val();
if (isEmpty(key) || value === undefined) return; if (isEmpty(key) || value === undefined) return;
var type = input.prop("type"); var type = input.prop("type");
if ("file" == type) { if ("file" == type) {
value = input.get(0).files; value = input.get(0).files;
} else if (["checkbox", "radio"].indexOf(type) > -1) { } else if (["checkbox", "radio"].indexOf(type) > -1) {
if (!input.is(":checked")) return; if (!input.is(":checked")) return;
} }
var stored = inputValues[key]; var stored = inputValues[key];
if (stored === undefined) { if (stored === undefined) {
inputValues[key] = value; inputValues[key] = value;
@ -485,7 +485,7 @@ $.fn.getValues = function(propertyMapper) {
var array = [stored]; var array = [stored];
if (!Array.isArray(value)) if (!Array.isArray(value))
array.push(value); array.push(value);
else else
array = array.concat(value); array = array.concat(value);
inputValues[key] = array; inputValues[key] = array;
} }
@ -504,7 +504,7 @@ $.fn.getValues = function(propertyMapper) {
break; break;
} }
if (value === undefined) continue; if (value === undefined) continue;
delete inputValues[valueProvider]; delete inputValues[valueProvider];
inputValues[property] = value; inputValues[property] = value;
} }
@ -531,10 +531,10 @@ $.fn.getValues = function(propertyMapper) {
function paginate(config) { function paginate(config) {
var rc = config.totalSize || 0; var rc = config.totalSize || 0;
// if (!rc) return ""; // if (!rc) return "";
var fetchCount = config.fetchSize || 0; var fetchCount = config.fetchSize || 0;
// if (!fetchCount) return ""; // if (!fetchCount) return "";
var fetch = { var fetch = {
all:0, all:0,
none:-1, none:-1,
@ -558,7 +558,7 @@ function paginate(config) {
}; };
var lc = fetch.count(rc, fetchCount); var lc = fetch.count(rc, fetchCount);
if (lc < 2) return ""; if (lc < 2) return "";
var links = ifEmpty(config.links, fetch.all), var links = ifEmpty(config.links, fetch.all),
page = fetch.page(ifEmpty(config.start, 0), fetchCount), page = fetch.page(ifEmpty(config.start, 0), fetchCount),
band = fetch.band(page, links), band = fetch.band(page, links),
@ -590,7 +590,7 @@ function paginate(config) {
next:function(bandCount) { next:function(bandCount) {
bandCount = parseInt(bandCount); bandCount = parseInt(bandCount);
if (bandCount - band < 2) return ""; if (bandCount - band < 2) return "";
var nextBand = band + 1, var nextBand = band + 1,
page = nextBand * links, page = nextBand * links,
fromRec = page * fetchCount; fromRec = page * fetchCount;
@ -600,7 +600,7 @@ function paginate(config) {
bandCount = parseInt(bandCount); bandCount = parseInt(bandCount);
var lastBand = bandCount - 1; var lastBand = bandCount - 1;
if (lastBand - band < 2) return ""; if (lastBand - band < 2) return "";
var pages = lastBand * links, var pages = lastBand * links,
fromRec = pages * fetchCount; fromRec = pages * fetchCount;
return tags.link(config.last, fromRec, pages + 1); return tags.link(config.last, fromRec, pages + 1);
@ -675,7 +675,7 @@ $.fn.setPagingInfo = function(config) {
$.fn.setCurrentRow = function(val) { $.fn.setCurrentRow = function(val) {
if (!val) return; if (!val) return;
return this.each(function() { return this.each(function() {
var e = $(this); var e = $(this);
e.find("tr").each(function(){ e.find("tr").each(function(){
@ -684,7 +684,7 @@ $.fn.setCurrentRow = function(val) {
if (current) if (current)
tr.addClass("current-row"); tr.addClass("current-row");
else else
tr.removeClass("current-row"); tr.removeClass("current-row");
}); });
}); });
} }
@ -792,7 +792,7 @@ function inputsInRange(fromSource, toSource) {
toVal = to.val() || "", toVal = to.val() || "",
ok = toVal >= fromVal; ok = toVal >= fromVal;
if (ok) return; if (ok) return;
if ($(this)[0] == from[0]) if ($(this)[0] == from[0])
to.val(from.val()) to.val(from.val())
else else

Loading…
Cancel
Save