123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- /**
- * 브라우저의 document 객체를 확장한다.
- *
- * @author 김지환
- * @since TrustForm Soonsu 0.0.1
- */
- function __initDocument ()
- {
- document.allElement = new Collection();
- document.controls = new Collection();
- document.userAgent = "SoonsuViewer";
-
- // XFormsDocument.widnowSizeCapture();
- };
- document.readIniFile = function (strSectionName, strKeyName, strDefaultValue, strFileName)
- {
- alert("document.readIniFile() is not available");
- };
- document.save = function ()
- {
- alert("document.save() is not available");
- };
- document.writeIniFile = function (strSectionName, strKeyName, strKeyValue, strFileName)
- {
- alert("document.writeIniFile() is not available");
- };
- function XFormsDocument ()
- {
- };
- XFormsDocument.init = function ()
- {
- for (var i=0; i<document.controls.length; i++)
- {
- var objControl = document.controls.item(i);
- if (null != objControl)
- {
- objControl.init();
- }
- }
- };
- XFormsDocument.appendAll = function (strId, objElement)
- {
- document.allElement.add(strId, objElement);
- };
- XFormsDocument.removeAll = function (strId)
- {
- document.allElement.remove(strId);
- };
- XFormsDocument.appendControl = function (strId, objControl)
- {
- document.controls.add(strId, objControl);
- };
- XFormsDocument.removeControl = function (strId)
- {
- document.controls.remove(strId);
- };
- XFormsDocument.getBindControlsByNode = function (xnNode)
- {
- var arResult = new Array();
- for (var i=0; i<document.controls.length; i++)
- {
- var objControl = document.controls.item(i);
- if (null != objControl && objControl instanceof XFormsBindableControl)
- {
- if (objControl.isBindControlByNode(xnNode))
- {
- arResult.push(objControl);
- }
- }
- }
- return arResult;
- };
- XFormsDocument.getBindControlsByXPath = function (strXPath)
- {
- var arResult = new Array();
- for (var i=0; i<document.controls.length; i++)
- {
- var objControl = document.controls.item(i);
- if (null != objControl && objControl instanceof XFormsBindableControl)
- {
- if (objControl.isBindControlByXPath(strXPath))
- {
- arResult.push(objControl);
- }
- }
- }
- return arResult;
- };
- //XFormsDocument.widnowSizeCapture = function ()
- //{
- // var nWidth = 0;
- // var nHeight = 0;
- // if (null == document.body.style.width)
- // {
- // nWidth = is_firefox || is_webkit ? window.outerWidth - 16 : document.documentElement.clientWidth;
- // document.body.style.width = nWidth + "px";
- // }
- // if (null == document.body.style.height)
- // {
- // nHeight = is_firefox || is_webkit ? (is_firefox ? window.outerHeight - 169: window.outerHeight - 101): document.documentElement.clientHeight;
- // }
- // document.body.style.width = nWidth + "px";
- // document.body.style.height = nHeight + "px";
- // if (null != body && null != body.attribute)
- // {
- // body.attribute["width"] = document.body.style.width;
- // body.attribute["height"] = document.body.style.height;
- // }
- //};
|