123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927 |
- /**
- * XFormsCalendarItem
- */
- XFormsCalendarItem.prototype = new XFormsCaption;
- function XFormsCalendarItem (strParentId, strAlert, strHelp, strHint, strText, strAccesskey, bAutoresize, strBind, strClass, bDisabled, bEllipsis,
- strFormat, strId, nNavindex, strRef, strRoundMode, nRoundPosition, strStyle, strTag, strVisibility, strUserDefineAttrib)
- {
- if (!strId)
- {
- return;
- }
-
- XFormsCaption.call(this, strParentId, strAlert, strHelp, strHint, strText, strAccesskey, bAutoresize, strBind, strClass, bDisabled, bEllipsis,
- strFormat, strId, nNavindex, strRef, strRoundMode, nRoundPosition, strStyle, strTag, strVisibility, strUserDefineAttrib);
- /**
- * Attribute
- */
-
- /**
- * Property
- */
- this.label;
- };
- XFormsCalendarItem.prototype.init = function ()
- {
- XFormsCaption.prototype.init.call(this);
-
- this.label = this.m_heControl.innerHTML;
- };
- /**
- * 여기부터 XFormsCalendar
- */
- XFormsCalendar.prototype = new XFormsGroup;
- function XFormsCalendar (strParentId, strAlert, strHelp, strHint, strAccesskey, strBind, strClass, bDisabled, strId, nNavindex,
- strOverflow, strRef, strScroll, strShowEffect, bShowToday, strStyle, strTag, strVisibility)
- {
- if (!strId)
- {
- return;
- }
-
- XFormsGroup.call(this, strParentId, strAlert, strHelp, strHint, strAccesskey, strBind, strClass, bDisabled, strId, nNavindex,
- strOverflow, ""/*bPopup*/, strRef, strScroll, strShowEffect, strStyle, strTag, strVisibility);
- this.m_strChoosedPosition;
- /**
- * Attribute
- */
- // 2011. 03. 19. 기능 추가 - 박현우
- this.attribute["showtoday"] = String(bShowToday);
-
- /**
- * Property
- */
- this.day;
- this.month;
- this.year;
-
- this.dayItem = new Array();
- this.header;
- this.prevyear;
- this.prevmonth;
- this.nextmonth;
- this.nextyear;
- };
- /**
- * Method
- */
- XFormsCalendar.prototype.refresh = function ()
- {
- this.makeCalendar(parseInt(this.year), parseInt(this.month), parseInt(this.day));
- };
- XFormsCalendar.prototype.item = function (nRow, nCol)
- {
- if (nCol == null)
- {
- for (var i = 0; i < 7; i++)
- {
- for (var j = 0; j < 7; j++)
- {
- if (document.getElementById("HE_" + this.id + ".item" + i + j).innerHTML == nRow)
- {
- nRow = i;
- nCol = j;
- break;
- }
- }
- if (nCol != null)
- {
- break;
- }
- }
- }
- return this.dayItem[nRow][nCol];
- };
- /**
- * TF System Method
- */
- XFormsCalendar.prototype.init = function ()
- {
- XFormsGroup.prototype.init.call(this);
- this.header = new XFormsCalendarHeader(this.id, "", "", "", Lan_Year + Lan_Month, "", "", "", "", false, "", "", this.id+".header", -1, "", "", "", "", "xforms:caption", "visible");
- this.header.m_bDependentCtl = true;
- this.header.init();
- this.prevyear = new XFormsButton(this.id, "", "", "", "", "", false, "", "", false, false, "", "", "", this.id+".prevyear", -1, "", "", -1, false, "", "xforms:button", "visible");
- this.prevyear.m_bDependentCtl = true;
- this.prevyear.init();
- this.prevmonth = new XFormsButton(this.id, "", "", "", "", "", false, "", "", false, false, "", "", "", this.id+".prevmonth", -1, "", "", -1, false, "", "xforms:button", "visible");
- this.prevmonth.m_bDependentCtl = true;
- this.prevmonth.init();
- this.nextmonth = new XFormsButton(this.id, "", "", "", "", "", false, "", "", false, false, "", "", "", this.id+".nextmonth", -1, "", "", -1, false, "", "xforms:button", "visible");
- this.nextmonth.m_bDependentCtl = true;
- this.nextmonth.init();
- this.nextyear = new XFormsButton(this.id, "", "", "", "", "", false, "", "", false, false, "", "", "", this.id+".nextyear", -1, "", "", -1, false, "", "xforms:button", "visible");
- this.nextyear.m_bDependentCtl = true;
- this.nextyear.init();
- this.calendaritem = new XFormsCalendarItem(this.id, "", "", "", "", "", "", "", "", false, "", "", this.id+".item", -1, "", "", "", "", "xforms:calendaritem", "visible");
- this.calendaritem.m_bDependentCtl = true;
- this.calendaritem.init();
-
- // TODO today기능
- this.calendarToday = new XFormsCalendarToday(this.id, "", "", "", "", "", "", "", "", false, "", "", this.id+".today", -1, "", "", "", "", "xforms:calendartoday", "visible");
- this.calendarToday.m_bDependentCtl = true;
- this.calendarToday.init();
- if (!this.calendaritem.getSelectAttribute("background-color"))
- {
- this.calendaritem.setSelectAttribute("background-color", "#00008B");
- }
- if (!this.calendaritem.getSelectAttribute("color") || this.calendaritem.getSelectAttribute("color") == "")
- {
- this.calendaritem.setSelectAttribute("color", "#FFFFFF");
- }
- for (var i = 0; i < 7; i++)
- {
- var arTemp = new Array();
- for (var j = 0; j < 7; j++)
- {
- arTemp[j] = new XFormsCell(this.id, j, this.id + ".item" + i + j, i, "xforms:calendaritem");
- arTemp[j].setElement(this.calendaritem);
- arTemp[j].init();
- }
- this.dayItem[i] = arTemp;
- }
-
- var objDate = new Date();
- this.year = objDate.getFullYear().toString();
- this.month = (objDate.getMonth()+1).toString();
- this.day = objDate.getDate();
- this.makeCalendar(parseInt(this.year), parseInt(this.month), parseInt(this.day));
- var bShowToday = this.getAttribute("showtoday");
-
- // showToday 설정
- this.setShowToday();
-
- this.resizeControl();
- };
- XFormsCalendar.prototype.setShowToday = function ()
- {
- var heToday = document.getElementById("HE_" + this.id + ".today");
- if (null == heToday)
- {
- return;
- }
-
- if ("true" == this.getAttribute("showtoday"))
- {
- var strMonth = (Number(this.month) < 10) ? "0" + this.month : String(this.month);
- var strDay = (Number(this.day) < 10) ? "0" + this.day : String(this.day);
- heToday.innerHTML = Lan_Today + " : " + this.year + "-" + strMonth + "-" + strDay;
-
- // item의 높이를 다시 설정해준다.
- for (var i=0; i<this.dayItem.length; i++)
- {
- var arWeek = this.dayItem[i];
- for (var j=0;j<arWeek.length; j++)
- {
- var objDay = arWeek[j];
- objDay.m_heControl.style.height = "12.5%";
- }
- }
-
- heToday.style.textAlign = "center";
- heToday.style.height = "12.5%";
- heToday.style.cursor = "hand";
- }
- else
- {
- heToday.parentNode.removeChild(heToday);
- }
-
- // this.m_heControl.appendChild(heToday);
- };
- XFormsCalendar.prototype.applyDefaultStyle = function ()
- {
- XFormsGroup.prototype.applyDefaultStyle.call(this);
-
- // Calendar Default Style
- if (!this.attribute["border-width"])
- {
- this.m_heControl.style.borderWidth = "1px";
- }
-
- if (!this.attribute["border-style"])
- {
- this.m_heControl.style.borderStyle = "solid";
- }
- };
- XFormsCalendar.prototype.makeCalendar = function (nYear, nMonth, nDay)
- {
- var objCalendarHeader = this.children.item(this.id+".header");
- objCalendarHeader.attribute["text"] = nYear + Lan_Year + nMonth + Lan_Month;
- document.getElementById("HE_" + this.attribute["id"]+"Year").innerHTML = nYear;
- document.getElementById("HE_" + this.attribute["id"]+"Month").innerHTML = nMonth;
-
- var objStartDate = new Date(nYear, nMonth-1, 1);
- var nStartWeekday = objStartDate.getDay();
- var strMonthDays = "312831303130313130313031";
- var strEndDay = strMonthDays.substring(((nMonth-1)*2), ((nMonth-1)*2+2));
-
- if ((nMonth == 2) && (((nYear%4 == 0) && (nYear%100 != 0)) || (nYear%400 == 0))) // 2월의 경우 별도로 마지막날 계산
- {
- strEndDay = "29";
- }
- var nEndDay = parseInt(strEndDay);
- var nIndex = 0;
- var nInputDay = 1;
- for (var i = 1; i < 7; i++)
- {
- for (var j = 0; j < 7; j++)
- {
- var nDayValue;
-
- if (nIndex < nStartWeekday || nInputDay > nEndDay)
- {
- document.getElementById("HE_" + this.attribute["id"]+".item"+i+j).innerHTML = "";
- }
- else
- {
- document.getElementById("HE_" + this.attribute["id"]+".item"+i+j).innerHTML = nInputDay;
- if (nDay == nInputDay)
- {
- this.chooseDate(i.toString()+j.toString());
- }
-
- nInputDay = nInputDay + 1;
- }
- this.dayItem[i][j].label = this.dayItem[i][j].m_heControl.innerHTML;
- nIndex = nIndex + 1;
- }
- }
- };
- XFormsCalendar.prototype.chooseDate = function (strPosition)
- {
- var objChoosedDate = document.getElementById("HE_" + this.attribute["id"]+".item"+strPosition);
-
- if (objChoosedDate.innerHTML == "" || strPosition.substring(0,1) == "0")
- {
- return;
- }
- if (this.m_strChoosedPosition != null)
- {
- var strBackgroundColor = this.calendaritem.attribute["background-color"];
- if (!strBackgroundColor)
- {
- strBackgroundColor = "#ffffff";
- }
-
- var strFontColor = this.calendaritem.attribute["color"];
- if (!strFontColor)
- {
- strFontColor = "#000000";
- }
-
- var objTempDate = document.getElementById("HE_" + this.attribute["id"]+".item"+this.m_strChoosedPosition);
- objTempDate.style.backgroundColor = strBackgroundColor;
- if (this.m_strChoosedPosition.substring(1,2) == "0")
- {
- objTempDate.style.color = "#FF0000";
- }
- else if (this.m_strChoosedPosition.substring(1,2) == "6")
- {
- objTempDate.style.color = "#0000FF";
- }
- else
- {
- objTempDate.style.color = strFontColor;
- }
- }
- this.day = objChoosedDate.innerHTML;
- this.m_strChoosedPosition = strPosition;
-
- objChoosedDate.style.backgroundColor = this.calendaritem.getSelectAttribute("background-color");
- objChoosedDate.style.color = this.calendaritem.getSelectAttribute("color");
- };
- XFormsCalendar.prototype.moveCalendar = function (strMoveType)
- {
- // 기존의 선택 포지션 초기화
- if (this.m_strChoosedPosition != null)
- {
- var objTempDate = document.getElementById("HE_" + this.attribute["id"]+".item"+this.m_strChoosedPosition);
-
- objTempDate.style.backgroundColor = this.calendaritem.attribute["background-color"];
- if (this.calendaritem.attribute["color"])
- {
- objTempDate.style.color = this.calendaritem.attribute["color"];
- }
- else if (this.m_strChoosedPosition.substring(1,2) == "0")
- {
- objTempDate.style.color = "#FF0000";
- }
- else if (this.m_strChoosedPosition.substring(1,2) == "6")
- {
- objTempDate.style.color = "#0000FF";
- }
- else
- {
- objTempDate.style.color = "#000000";
- }
- }
- this.m_strChoosedPosition = null;
- // 년/월을 변경하여 다시 생성
- var strCurrentYear = document.getElementById("HE_" + this.attribute["id"]+"Year").innerHTML;
- var strCurrentMonth = document.getElementById("HE_" + this.attribute["id"]+"Month").innerHTML;
- if (strMoveType == "prevYear")
- {
- this.year = ((strCurrentYear)-1).toString();
- this.month = strCurrentMonth;
- }
- else if (strMoveType == "nextYear")
- {
- this.year = (parseInt(strCurrentYear)+1).toString();
- this.month = strCurrentMonth;
- }
- else if (strMoveType == "prevMonth")
- {
- if (strCurrentMonth == "1")
- {
- this.year = (parseInt(strCurrentYear)-1).toString();
- this.month = "12";
- }
- else
- {
- this.year = strCurrentYear;
- this.month = (parseInt(strCurrentMonth)-1).toString();
- }
- }
- else if (strMoveType == "nextMonth")
- {
- if (strCurrentMonth == "12")
- {
- this.year = (parseInt(strCurrentYear)+1).toString();
- this.month = "1";
- }
- else
- {
- this.year = strCurrentYear;
- this.month = (parseInt(strCurrentMonth)+1).toString();
- }
- }
- var objDate = new Date();
- if (this.year == objDate.getFullYear().toString() && this.month == (objDate.getMonth()+1).toString())
- {
- this.day = objDate.getDate().toString();
- }
- else
- {
- this.day = "";
- }
- this.makeCalendar(parseInt(this.year), parseInt(this.month), parseInt(this.day));
- };
- XFormsCalendar.prototype.setToday = function ()
- {
- var objPresentTime = new Date();
- this.day = objPresentTime.getDate().toString();
- this.month = (objPresentTime.getMonth()+1).toString();
- this.year = objPresentTime.getFullYear().toString();
- this.refresh();
- };
- XFormsCalendar.prototype.onMouseDown = function (event)
- {
- XFormsGroup.prototype.onMouseDown.call(this, event);
-
- if (!this.disabled)
- {
- if (event.target.substring(0, this.id.length+5) == this.id+".item")
- {
- this.chooseDate(event.target.substring(this.id.length+5,this.id.length+7));
- this.dispatch("ondayselect");
- }
- else if (event.target == this.id+".today")
- {
- this.setToday();
- this.dispatch("ondayselect");
- }
- }
- };
- XFormsCalendar.prototype.onClick = function (event)
- {
- XFormsGroup.prototype.onClick.call(this, event);
-
- if (!this.disabled)
- {
- var strPosition = this.m_strChoosedPosition;
- var bClickButton = false;
- if (event.target == this.id+".prevyear")
- {
- this.dispatch("onprevyear");
- this.moveCalendar("prevYear");
- bClickButton = true;
- }
- else if (event.target == this.id+".prevmonth")
- {
- this.dispatch("onprevmonth");
- this.moveCalendar("prevMonth");
- bClickButton = true;
- }
- else if (event.target == this.id+".nextmonth")
- {
- this.dispatch("onnextmonth");
- this.moveCalendar("nextMonth");
- bClickButton = true;
- }
- else if (event.target == this.id+".nextyear")
- {
- this.dispatch("onnextyear");
- this.moveCalendar("nextYear");
- bClickButton = true;
- }
-
- if (bClickButton)
- {
- this.setDeselect(strPosition);
- }
- }
- };
- XFormsCalendar.prototype.setDeselect = function (strPosition)
- {
- var objChoosedDate = document.getElementById("HE_" + this.id + ".item" + strPosition);
- if (null != objChoosedDate)
- {
- var strBackgroundColor = this.calendaritem.attribute["background-color"];
- if (!strBackgroundColor)
- {
- strBackgroundColor = "#ffffff";
- }
-
- var strFontColor = this.calendaritem.attribute["color"];
- if (!strFontColor)
- {
- strFontColor = "#000000";
- }
- objChoosedDate.style.backgroundColor = strBackgroundColor;
- objChoosedDate.style.color = strFontColor;
-
- }
- };
- XFormsCalendar.create = function (strParentId, clAttribute, strStyle)
- {
- // 메인노드 생성
- var xnCalendar = XFormsCalendar.createMainNode(clAttribute);
- var heParent = document.getElementById("HE_"+strParentId);
-
- var objParent = document.allElement.item(strParentId);
- if (objParent instanceof XFormsInput || objParent instanceof XFormsGridCol)
- {
- xnCalendar.style.zIndex = 100;
-
- var heBody = document.getElementById("HE_body");
- heBody.appendChild(xnCalendar);
- }
- else
- {
- heParent.appendChild(xnCalendar);
- }
- // 하위노드 생성
- xnCalendar = XFormsCalendar.createSubNodes(xnCalendar, clAttribute);
-
- // object 생성
- return XFormsCalendar.createObject(strParentId, xnCalendar, clAttribute, strStyle);
- };
- XFormsCalendar.createMainNode = function (clAttribute)
- {
- var xnCalendar = document.createElement("div");
- xnCalendar = XFormsCalendar.createAttribute(xnCalendar, clAttribute);
- return xnCalendar;
- };
- XFormsCalendar.createSubNodes = function (xnCalendar, clAttribute)
- {
- // 상위의 아이디를 가져온다.
- var strId = clAttribute.item("id");
- // 제목 부분 테이블 생성
- var xnHeadTable = document.createElement("table");
-
- if (clAttribute.exists("color"))
- {
- xnHeadTable.style.color = "#FFFFFF";
- }
- if (!clAttribute.exists("cursor"))
- {
- xnHeadTable.style.cursor = "default";
- }
-
- xnHeadTable.setAttribute("id", "HE_"+strId+".header");
- xnHeadTable.cellPadding = 0;
- xnHeadTable.cellSpacing = 0;
- xnHeadTable.setAttribute("width", "100%");
- xnHeadTable.setAttribute("height", "20%");
- xnHeadTable.style.color = "#FFFFFF";
- xnHeadTable.style.backgroundColor = "#0000FF";
- xnHeadTable.style.tableLayout = "fixed";
- var xnHeadTbody = document.createElement("tbody");
- var xnHeadTr = document.createElement("tr");
- var xnHeadTd1 = document.createElement("td");
- xnHeadTd1.setAttribute("width", "17%");
- xnHeadTd1.setAttribute("height", "100%");
- xnHeadTd1.setAttribute("align", "right");
- var xnPrevYear = document.createElement("button");
- xnPrevYear.setAttribute("id", "HE_"+strId+".prevyear");
- xnPrevYear.style.width = "25px";
- xnPrevYear.style.height = "15px";
- xnPrevYear.style.backgroundColor = "#D4D0C8";
- xnPrevYear.style.backgroundImage = "url(" + __getAppName() + "/kr/comsquare/image/calendar/prevYear.gif)";
- xnPrevYear.style.backgroundRepeat = "no-repeat";
- xnPrevYear.style.backgroundPosition = "center";
- xnHeadTd1.appendChild(xnPrevYear);
-
- var xnHeadTd2 = document.createElement("td");
- xnHeadTd2.setAttribute("width", "13%");
- xnHeadTd2.setAttribute("height", "100%");
- xnHeadTd2.setAttribute("align", "right");
- var xnPrevMonth = document.createElement("button");
- xnPrevMonth.setAttribute("id", "HE_"+strId+".prevmonth");
- xnPrevMonth.style.width = "25px";
- xnPrevMonth.style.height = "15px";
- xnPrevMonth.style.backgroundColor = "#D4D0C8";
- xnPrevMonth.style.backgroundImage = "url(" + __getAppName() + "/kr/comsquare/image/calendar/prevMonth.gif)";
- xnPrevMonth.style.backgroundRepeat = "no-repeat";
- xnPrevMonth.style.backgroundPosition = "center";
- xnHeadTd2.appendChild(xnPrevMonth);
- var xnHeadTd3 = document.createElement("td");
- xnHeadTd3.setAttribute("id", "HE_"+strId+".header_TEXT");
- xnHeadTd3.setAttribute("width", "40%");
- xnHeadTd3.setAttribute("height", "100%");
- xnHeadTd3.setAttribute("align", "center");
- var xnHeadYear = document.createElement("span");
- xnHeadYear.setAttribute("id", "HE_" + strId + "Year");
- xnHeadTd3.appendChild(xnHeadYear);
- xnHeadTd3.innerHTML += Lan_Year;
-
- var xnHeadMonth = document.createElement("span");
- xnHeadMonth.setAttribute("id", "HE_" + strId + "Month");
- xnHeadTd3.appendChild(xnHeadMonth);
- xnHeadTd3.innerHTML += Lan_Month;
- var xnHeadTd4 = document.createElement("td");
- xnHeadTd4.setAttribute("width", "13%");
- xnHeadTd4.setAttribute("height", "100%");
- var xnNextMonth = document.createElement("button");
- xnNextMonth.setAttribute("id", "HE_"+strId+".nextmonth");
- xnNextMonth.style.width = "25px";
- xnNextMonth.style.height = "15px";
- xnNextMonth.style.backgroundColor = "#D4D0C8";
- xnNextMonth.style.backgroundImage = "url(" + __getAppName() + "/kr/comsquare/image/calendar/nextMonth.gif)";
- xnNextMonth.style.backgroundRepeat = "no-repeat";
- xnNextMonth.style.backgroundPosition = "center";
- xnHeadTd4.appendChild(xnNextMonth);
- var xnHeadTd5 = document.createElement("td");
- xnHeadTd5.setAttribute("width", "17%");
- xnHeadTd5.setAttribute("height", "100%");
- var xnNextYear = document.createElement("button");
- xnNextYear.setAttribute("id", "HE_"+strId+".nextyear");
- xnNextYear.style.width = "25px";
- xnNextYear.style.height = "15px";
- xnNextYear.style.backgroundColor = "#D4D0C8";
- xnNextYear.style.backgroundImage = "url(" + __getAppName() + "/kr/comsquare/image/calendar/nextYear.gif)";
- xnNextYear.style.backgroundRepeat = "no-repeat";
- xnNextYear.style.backgroundPosition = "center";
- xnHeadTd5.appendChild(xnNextYear);
- xnHeadTr.appendChild(xnHeadTd1);
- xnHeadTr.appendChild(xnHeadTd2);
- xnHeadTr.appendChild(xnHeadTd3);
- xnHeadTr.appendChild(xnHeadTd4);
- xnHeadTr.appendChild(xnHeadTd5);
- xnHeadTbody.appendChild(xnHeadTr);
- xnHeadTable.appendChild(xnHeadTbody);
- xnCalendar.appendChild(xnHeadTable);
-
-
- // 날짜 부분 테이블 생성
- var xnBodyTable = document.createElement("table");
-
- xnBodyTable.setAttribute("id", "HE_" + strId + ".item");
- xnBodyTable.cellPadding = 0;
- xnBodyTable.cellSpacing = 0;
- xnBodyTable.setAttribute("width", "100%");
- xnBodyTable.setAttribute("height", "80%");
- xnBodyTable.onclick = function () {};
- xnBodyTable.ondbclick = function () {};
- xnBodyTable.onmousedown = function () {};
- xnBodyTable.onmousemove = function () {};
- xnBodyTable.onmouseup = function () {};
- HtmlLib.setStyle(xnBodyTable, "cursor", "default");
- HtmlLib.setStyle(xnBodyTable, "line-height", "13px");
- var xnBodyTbody = document.createElement("tbody");
-
- for (var i = 0; i < 7; i++)
- {
- var xnBodyTr = document.createElement("tr");
- for (var j = 0; j < 7; j++)
- {
- var xnBodyTd = document.createElement("td");
- xnBodyTd.setAttribute("id", "HE_" + strId + ".item"+i+j);
- xnBodyTd.setAttribute("width", "12.5%");
- xnBodyTd.setAttribute("height", "12.5%");
- xnBodyTd.setAttribute("align", "center");
-
- if (j == 0)
- {
- HtmlLib.setStyle(xnBodyTd, "color", "#FF0000");
- }
- else if (j == 6)
- {
- HtmlLib.setStyle(xnBodyTd, "color", "#0000FF");
- }
- else
- {
- HtmlLib.setStyle(xnBodyTd, "color", "#000000");
- }
- if (i == 0)
- {
- if (j == 0)
- {
- xnBodyTd.innerHTML = Lan_Sunday;
- }
- else if (j == 1)
- {
- xnBodyTd.innerHTML = Lan_Monday;
- }
- else if (j == 2)
- {
- xnBodyTd.innerHTML = Lan_Tuesday;
- }
- else if (j == 3)
- {
- xnBodyTd.innerHTML = Lan_Wednesday;
- }
- else if (j == 4)
- {
- xnBodyTd.innerHTML = Lan_Thursday;
- }
- else if (j == 5)
- {
- xnBodyTd.innerHTML = Lan_Friday;
- }
- else if (j == 6)
- {
- xnBodyTd.innerHTML = Lan_Saturday;
- }
- }
-
- xnBodyTr.appendChild(xnBodyTd);
- }
-
- xnBodyTbody.appendChild(xnBodyTr);
- }
-
- var heTodayTR = document.createElement("tr");
- var heTodayTD = document.createElement("td");
- heTodayTR.appendChild(heTodayTD);
-
- heTodayTD.setAttribute("colspan", "7");
- heTodayTD.setAttribute("id", "HE_" + clAttribute.item("id") + ".today");
-
- xnBodyTbody.appendChild(heTodayTR);
- // // TODO Today 넣기
- // if ("true".equals(strShowToday))
- // {
- // Node xnTodayTR = HtmlLib.createChild(xnBodyTbody, TagName.TR);
- // Node xnTodayTD = HtmlLib.createChild(xnTodayTR, TagName.TD);
- // HtmlLib.setAttribute(xnTodayTD, AttributeName.COLSPAN, "7");
- // HtmlLib.setStyle(xnTodayTD, "height", strDayHeight);
- // HtmlLib.setAttribute(xnTodayTD, AttributeName.ID, "HE_" + strId + ".today");
- // }
-
-
- xnBodyTable.appendChild(xnBodyTbody);
- xnCalendar.appendChild(xnBodyTable);
-
- return xnCalendar;
- };
- XFormsCalendar.createObject = function (strParentId, xnCalendar, clAttribute, strStyle)
- {
- var strAlert = "";
- var strHelp = "";
- var strHint = "";
- var strAccesskey = "";
- var strBind = "";
- var strClass = "";
- var bDisabled = false;
- var strId = "";
- var nNavindex = 9007199254740992;
- var strOverflow = "";
- var strRef = "";
- var strScroll = "";
- var strShoweffect = "";
- var bShowToday = "";
- var strVisibility = "visible";
- var strUserDefineAttrib = "";
-
- for (var i=0; i<clAttribute.count(); i++)
- {
- var strAttributeName = clAttribute.keys()[i];
- switch (strAttributeName)
- {
- case "alert" :
- {
- strAlert = clAttribute.item(strAttributeName);
- break;
- }
- case "help" :
- {
- strHelp = clAttribute.item(strAttributeName);
- break;
- }
- case "hint" :
- {
- strHint = clAttribute.item(strAttributeName);
- break;
- }
- case "accesskey" :
- {
- strAccesskey = clAttribute.item(strAttributeName);
- break;
- }
- case "bind" :
- {
- strBind = clAttribute.item(strAttributeName);
- break;
- }
- case "class" :
- {
- strClass = clAttribute.item(strAttributeName);
- break;
- }
- case "disabled" :
- {
- if ("true" == clAttribute.item(strAttributeName))
- {
- bDisabled = true;
- }
- break;
- }
- case "id" :
- {
- strId = clAttribute.item(strAttributeName);
- break;
- }
- case "navindex" :
- {
- nNavindex = parseInt(clAttribute.item(strAttributeName));
- break;
- }
- case "overflow" :
- {
- strOverflow = clAttribute.item(strAttributeName);
- break;
- }
- case "ref" :
- {
- strRef = clAttribute.item(strAttributeName);
- break;
- }
- case "scroll" :
- {
- strScroll = clAttribute.item(strAttributeName);
- break;
- }
- case "showeffect" :
- {
- strShoweffect = clAttribute.item(strAttributeName);
- break;
- }
- case "showtoday" :
- {
- if ("true" == clAttribute.item(strAttributeName))
- {
- bShowToday = true;
- }
- break;
- }
- case "visibility" :
- {
- strVisibility = clAttribute.item(strAttributeName);
- break;
- }
-
- default :
- {
- if (!STYLE_LIST[strAttributeName])
- {
- strUserDefineAttrib += strAttributeName + ":" + clAttribute.item(strAttributeName) + "; ";
- }
- break;
- }
- }
- }
- var objCalendar = new XFormsCalendar (strParentId, strAlert, strHelp, strHint, strAccesskey, strBind, strClass, bDisabled, strId, nNavindex, strOverflow, strRef, strScroll, strShoweffect, bShowToday, strStyle, "xforms:calendar", strVisibility, strUserDefineAttrib);
- return objCalendar;
- };
- XFormsCalendar.createAttribute = function (xnHtmlNode, clAttribute)
- {
- xnHtmlNode = XFormsGroup.createAttribute(xnHtmlNode, clAttribute);
- return xnHtmlNode;
- };
- XFormsCalendarHeader.prototype = new XFormsCaption;
- function XFormsCalendarHeader (strParentId, strAlert, strHelp, strHint, strText, strAccesskey, bAutoresize, strBind, strClass, bDisabled, bEllipsis, strFormat, strId, nNavindex, strRef, strRoundmode, nRoundposition, strStyle, strTag, strVisibility, strUserDefineAttrib)
- {
- if (!strId)
- {
- return;
- }
-
- XFormsCaption.call(this, strParentId, strAlert, strHelp, strHint, strText, strAccesskey, bAutoresize, strBind, strClass, bDisabled, bEllipsis,
- strFormat, strId, nNavindex, strRef, strRoundmode, nRoundposition, strStyle, strTag, strVisibility, strUserDefineAttrib);
- };
- XFormsCalendarHeader.prototype.isCSSValid = function (strKey)
- {
- var bValid = false;
- if (null == this.attribute[strKey] || "" == this.attribute[strKey])
- {
- bValid = true;
- }
-
- return bValid;
- };
- XFormsCalendarToday.prototype = new XFormsCaption;
- function XFormsCalendarToday (strParentId, strAlert, strHelp, strHint, strText, strAccesskey, bAutoresize, strBind, strClass, bDisabled, bEllipsis, strFormat, strId, nNavindex, strRef, strRoundmode, nRoundposition, strStyle, strTag, strVisibility, strUserDefineAttrib)
- {
- if (!strId)
- {
- return;
- }
-
- XFormsCaption.call(this, strParentId, strAlert, strHelp, strHint, strText, strAccesskey, bAutoresize, strBind, strClass, bDisabled, bEllipsis,
- strFormat, strId, nNavindex, strRef, strRoundmode, nRoundposition, strStyle, strTag, strVisibility, strUserDefineAttrib);
- };
- XFormsCalendarToday.prototype.isCSSValid = function (strKey)
- {
- var bValid = false;
- if (null == this.attribute[strKey] || "" == this.attribute[strKey])
- {
- bValid = true;
- }
-
- return bValid;
- };
|