소스 정리

main
이범준 3 months ago
parent 72b3f91120
commit 53bacb86f9

@ -408,9 +408,9 @@ $(document).ready(function(){
};
//이미지 뷰어
fnMakeSingleImageViewer($P.find("offcsImage"), $P.find("offcs"), "orgn-path", "orgn-name");
fnMakeSingleImageViewer($P.find("symbolImage"), $P.find("symbol"), "orgn-path", "orgn-name");
fnMakeSingleImageViewer($P.find("logoImage"), $P.find("logo"), "orgn-path", "orgn-name");
FimsComponentization.fnMakeSingleImageViewer($P.find("offcsImage"), $P.find("offcs"), "orgn-path", "orgn-name");
FimsComponentization.fnMakeSingleImageViewer($P.find("symbolImage"), $P.find("symbol"), "orgn-path", "orgn-name");
FimsComponentization.fnMakeSingleImageViewer($P.find("logoImage"), $P.find("logo"), "orgn-path", "orgn-name");
//시군구 기본 설정 저장 버튼
$P.$find("btnSaveSgg").on("click", function(){

@ -386,9 +386,9 @@ $(document).ready(function(){
var lastTr = $P.$find(tbodyName).find("tr").last()[0];
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontNm"));
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontColr"));
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontStyle"));
FimsComponentization.fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontNm"));
FimsComponentization.fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontColr"));
FimsComponentization.fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontStyle"));
$($P.fnGetElement(lastTr,"otptArtclNm")).set(data.OTPT_ARTCL_NM);
$($P.fnGetElement(lastTr,"componentType")).set(data.COMPONENT_TYPE);
@ -427,7 +427,7 @@ $(document).ready(function(){
var sel = $P.fnGetElement(this,"textSort");
var toPrev = $(sel).siblings()[0];
var toNext = $(sel).siblings()[1];
fnMakeSpinnerSelect(sel, toPrev, toNext);
FimsComponentization.fnMakeSpinnerSelect(sel, toPrev, toNext);
var scrollDivName = "";
if(tbodyName == "tbodyUnique"){
@ -438,7 +438,7 @@ $(document).ready(function(){
var rowSpinButtons = $(this).find("td[data-col='otptArtclSeq']").find("button");
fnMakeRowSpinner(this,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.validForBackground);
FimsComponentization.fnMakeRowSpinner(this,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.validForBackground);
});
}
@ -527,9 +527,9 @@ $(document).ready(function(){
var lastTr = $P.$find(tbodyName).find("tr").last()[0];
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontNm"));
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontColr"));
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontStyle"));
FimsComponentization.fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontNm"));
FimsComponentization.fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontColr"));
FimsComponentization.fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontStyle"));
var scrollDivName = "";
if(tbodyName == "tbodyUnique"){
@ -538,7 +538,7 @@ $(document).ready(function(){
scrollDivName = "scrollMultiple";
}
var rowSpinButtons = $(lastTr).find("td[data-col='otptArtclSeq']").find("button");
fnMakeRowSpinner(lastTr,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.validForBackground);
FimsComponentization.fnMakeRowSpinner(lastTr,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.validForBackground);
if(otptArtclNm != null && otptArtclNm != ""){
@ -580,7 +580,7 @@ $(document).ready(function(){
var sel = $P.fnGetElement(lastTr,"textSort");
var toPrev = $(sel).siblings()[0];
var toNext = $(sel).siblings()[1];
fnMakeSpinnerSelect(sel, toPrev, toNext);
FimsComponentization.fnMakeSpinnerSelect(sel, toPrev, toNext);
if(tbodyName == "tbodyUnique"){
$P.$find("scrollUnique").scrollTop($P.find("scrollUnique").scrollHeight);

@ -271,7 +271,7 @@ $(document).ready(function(){
var rowSpinButtons = $(this).find("td[data-col='extrArtclOrdr']").find("button");
fnMakeRowSpinner(this,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.valid);
FimsComponentization.fnMakeRowSpinner(this,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.valid);
});
}
@ -337,7 +337,7 @@ $(document).ready(function(){
scrollDivName = "scrollCustom";
}
var rowSpinButtons = $(lastTr).find("td[data-col='extrArtclOrdr']").find("button");
fnMakeRowSpinner(lastTr,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.valid);
FimsComponentization.fnMakeRowSpinner(lastTr,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.valid);
if(extrArtclNm != null && extrArtclNm != ""){
@ -364,7 +364,7 @@ $(document).ready(function(){
var sel = $P.fnGetElement(lastTr,"textSort");
var toPrev = $(sel).siblings()[0];
var toNext = $(sel).siblings()[1];
fnMakeSpinnerSelect(sel, toPrev, toNext);
FimsComponentization.fnMakeSpinnerSelect(sel, toPrev, toNext);
if(tbodyName == "tbodyPredefined"){
$P.$find("scrollPredefined").scrollTop($P.find("scrollPredefined").scrollHeight);

@ -237,13 +237,13 @@ $(document).ready(function(){
var sel = $P.fnGetElement(this,"paddingDirection");
var toPrev = $(sel).siblings()[0];
var toNext = $(sel).siblings()[1];
fnMakeSpinnerSelect(sel, toPrev, toNext);
FimsComponentization.fnMakeSpinnerSelect(sel, toPrev, toNext);
var scrollDivName = "scroll";
var rowSpinButtons = $(this).find("td[data-col='artclOrdr']").find("button");
fnMakeRowSpinner(this,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), null);
FimsComponentization.fnMakeRowSpinner(this,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), null);
});
}
@ -270,14 +270,14 @@ $(document).ready(function(){
var lastTr = $P.$find("tbody").find("tr").last()[0];
var rowSpinButtons = $(lastTr).find("td[data-col='artclOrdr']").find("button");
fnMakeRowSpinner(lastTr,rowSpinButtons[0],rowSpinButtons[1], $P.find("scroll"), null);
FimsComponentization.fnMakeRowSpinner(lastTr,rowSpinButtons[0],rowSpinButtons[1], $P.find("scroll"), null);
//셀렉트 스피너
var sel = $P.fnGetElement(lastTr,"paddingDirection");
var toPrev = $(sel).siblings()[0];
var toNext = $(sel).siblings()[1];
fnMakeSpinnerSelect(sel, toPrev, toNext);
FimsComponentization.fnMakeSpinnerSelect(sel, toPrev, toNext);
$P.$find("scroll").scrollTop($P.find("scroll").scrollHeight);

@ -121,7 +121,7 @@ function ObjectInspector(doctx, data){
/**************************************************************************
* UI요소 세팅
* jquery.fn 커스텀 - UI요소 세팅
**************************************************************************/
$.fn.set = function(value) {
return this.each(function(){

@ -1,7 +1,16 @@
class FimsComponentization {
static help(){
console.log("fnMakeSpinnerSelect(셀렉트박스,이전버튼,다음버튼) : 특정 셀렉트박스를 버튼클릭으로 옵션 선택 가능한 셀렉트박스로 만든다.");
console.log("fnMakeOptionStyleSelect(셀렉트박스) : 특정 셀렉트박스를 선택된 옵션의 스타일이 적용된 셀렉트박스로 만든다.");
console.log("fnMakeRowSpinner(테이블row,up버튼,down버튼,스크롤컨테이너,validator) : 특정 테이블을 행 위치 이동이 가능한 테이블로 만든다.");
console.log("fnMakeSingleImageViewer(img태그,fileInput태그,파일경로속성명,파일이름속성명) : 특정 이미지 태그를 단일 업로드 이미지 뷰어로 만든다.");
}
/**************************************************************************
* 버튼으로 조작가능한 셀렉트박스
* 특정 셀렉트박스를 버튼클릭으로 옵션 선택 가능한 셀렉트박스로 만든다.
**************************************************************************/
function fnMakeSpinnerSelect(selectEl, prevBtnEl, nextBtnEl){
static fnMakeSpinnerSelect(selectEl, prevBtnEl, nextBtnEl){
$(selectEl).on("animationend", function(){
$(selectEl).removeClass("highlight-once");
@ -27,9 +36,9 @@ function fnMakeSpinnerSelect(selectEl, prevBtnEl, nextBtnEl){
}
/**************************************************************************
* 선택된 옵션의 스타일이 적용된 셀렉트박스
* 특정 셀렉트박스를 선택된 옵션의 스타일이 적용된 셀렉트박스만든다.
**************************************************************************/
function fnMakeOptionStyleSelect(selectEl){
static fnMakeOptionStyleSelect(selectEl){
$(selectEl).addClass("option-style-select");
selectEl.changeUI = function(){
@ -54,39 +63,9 @@ function fnMakeOptionStyleSelect(selectEl){
}
/**************************************************************************
* 위치 이동 가능한 테이블
* 특정 테이블을 위치 이동 가능한 테이블만든다.
**************************************************************************/
function getBrowserName() {
var agent = navigator.userAgent.toUpperCase();
if (agent.indexOf('TRIDENT') >= 0) {
return 'IE';
} else if (agent.indexOf('FIREFOX') >= 0) {
return 'FIREFOX';
} else if (agent.indexOf('EDG') >= 0) {
return 'EDGE';
} else if (agent.indexOf('CHROME') >= 0) {
return 'CHROME';
} else if (agent.indexOf('SAFARI') >= 0) {
return 'SAFARI';
} else {
return '';
}
}
const BROWSER_NAME = getBrowserName();
var VERTICAL_SCROLL_HEIGHT = 14;
switch(BROWSER_NAME){
case "EDGE" :
VERTICAL_SCROLL_HEIGHT = 14;
break;
case "FIREFOX" :
VERTICAL_SCROLL_HEIGHT = 15;
break;
case "CHROME" :
VERTICAL_SCROLL_HEIGHT = 15;
break;
}
function fnMakeRowSpinner(tableRowEl, upBtnEl, downBtnEl, scrollEl, validFunc){
static fnMakeRowSpinner(tableRowEl, upBtnEl, downBtnEl, scrollEl, validFunc){
if(validFunc != undefined && validFunc != null){
tableRowEl.validForComponent = validFunc;
@ -177,13 +156,14 @@ function fnMakeRowSpinner(tableRowEl, upBtnEl, downBtnEl, scrollEl, validFunc){
$(tbody).find("tr").removeClass("current-row");
$(tableRowEl).addClass("current-row");
});
}
}
/**************************************************************************
* 단일 업로드 이미지 뷰어
* 특정 이미지 태그를 단일 업로드 이미지 뷰어만든다.
**************************************************************************/
function fnMakeSingleImageViewer(imgEl, fileInputEl, dataAttributeForFilePath, dataAttributeForFileName){
static fnMakeSingleImageViewer(imgEl, fileInputEl, dataAttributeForFilePath, dataAttributeForFileName){
$(imgEl).on("click", function(){
$(fileInputEl).click();
@ -213,3 +193,34 @@ function fnMakeSingleImageViewer(imgEl, fileInputEl, dataAttributeForFilePath, d
});
}
static getBrowserName() {
var agent = navigator.userAgent.toUpperCase();
if (agent.indexOf('TRIDENT') >= 0) {
return 'IE';
} else if (agent.indexOf('FIREFOX') >= 0) {
return 'FIREFOX';
} else if (agent.indexOf('EDG') >= 0) {
return 'EDGE';
} else if (agent.indexOf('CHROME') >= 0) {
return 'CHROME';
} else if (agent.indexOf('SAFARI') >= 0) {
return 'SAFARI';
} else {
return '';
}
}
}
const BROWSER_NAME = FimsComponentization.getBrowserName();
var VERTICAL_SCROLL_HEIGHT = 14;
switch(BROWSER_NAME){
case "EDGE" :
VERTICAL_SCROLL_HEIGHT = 14;
break;
case "FIREFOX" :
VERTICAL_SCROLL_HEIGHT = 15;
break;
case "CHROME" :
VERTICAL_SCROLL_HEIGHT = 15;
break;
}
Loading…
Cancel
Save