diff --git a/common/js/x.js b/common/js/x.js index fa6df72d3..72bfd87e4 100644 --- a/common/js/x.js +++ b/common/js/x.js @@ -3,6 +3,12 @@ * Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com * Copyright 2001-2005 Michael Foster (Cross-Browser.com) **/ +function xDeprecate(funcName) { + var msg = 'DEPRECATED : '+funcName+'() is deprecated function.'; + if (typeof console == 'object' && typeof console.log == 'function') { + console.log(msg); + } +} var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase(); if(window.opera){ @@ -26,6 +32,7 @@ var xFF=xUA.indexOf('firefox')!=-1; // (element, event(without 'on'), event listener(function name)[, caption]) function xAddEventListener(e,eT,eL,cap) { + xDeprecate('xAddEventListener'); if(!(e=xGetElementById(e))) return; eT=eT.toLowerCase(); if((!xIE4Up && !xOp7Up) && e==window) { @@ -40,6 +47,7 @@ function xAddEventListener(e,eT,eL,cap) // called only from the above function xResizeEvent() { + xDeprecate('xResizeEvent'); if (window.xREL) setTimeout('xResizeEvent()', 250); var cw = xClientWidth(), ch = xClientHeight(); if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); } @@ -47,6 +55,7 @@ function xResizeEvent() function xScrollEvent() { + xDeprecate('xScrollEvent'); if (window.xSEL) setTimeout('xScrollEvent()', 250); var sl = xScrollLeft(), st = xScrollTop(); if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); } @@ -54,12 +63,14 @@ function xScrollEvent() function xAppendChild(oParent, oChild) { + xDeprecate('xAppendChild'); if (oParent.appendChild) return oParent.appendChild(oChild); else return null; } function xClientHeight() { + xDeprecate('xClientHeight'); var h=0; if(xOp6Dn) h=window.innerHeight; else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight) @@ -75,6 +86,7 @@ function xClientHeight() function xClientWidth() { + xDeprecate('xClientWidth'); var w=0; if(xOp6Dn) w=window.innerWidth; else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth) @@ -90,18 +102,21 @@ function xClientWidth() function xCreateElement(sTag) { + xDeprecate('xCreateElement'); if (document.createElement) return document.createElement(sTag); else return null; } function xDef() { + xDeprecate('xDef'); for(var i=0; isw?cw:sw; } function xGetBodyHeight() { + xDeprecate('xGetBodyHeight'); var cw = xClientHeight(); var sw = window.document.body.scrollHeight; return cw>sw?cw:sw; @@ -182,6 +202,7 @@ function xGetBodyHeight() { function xGetComputedStyle(oEle, sProp, bInt) { + xDeprecate('xGetComputedStyle'); var s, p = 'undefined'; var dv = document.defaultView; if(dv && dv.getComputedStyle){ @@ -204,6 +225,7 @@ function xGetComputedStyle(oEle, sProp, bInt) function xGetCookie(name) { + xDeprecate('xGetCookie'); var value=null, search=name+"="; if (document.cookie.length > 0) { var offset = document.cookie.indexOf(search); @@ -219,6 +241,7 @@ function xGetCookie(name) function xGetElementById(e) { + xDeprecate('xGetElementById'); if(typeof(e)!='string') return e; if(document.getElementById) e=document.getElementById(e); else if(document.all) e=document.all[e]; @@ -228,6 +251,7 @@ function xGetElementById(e) function xGetElementsByAttribute(sTag, sAtt, sRE, fn) { + xDeprecate('xGetElementsByAttribute'); var a, list, found = new Array(), re = new RegExp(sRE, 'i'); list = xGetElementsByTagName(sTag); for (var i = 0; i < list.length; ++i) { @@ -243,6 +267,7 @@ function xGetElementsByAttribute(sTag, sAtt, sRE, fn) function xGetElementsByClassName(c,p,t,f) { + xDeprecate('xGetElementsByClassName'); var found = new Array(); var re = new RegExp('\\b'+c+'\\b', 'i'); var list = xGetElementsByTagName(t, p); @@ -257,6 +282,7 @@ function xGetElementsByClassName(c,p,t,f) function xGetElementsByTagName(t,p) { + xDeprecate('xGetElementsByTagName'); var list = null; t = t || '*'; p = p || document; @@ -270,6 +296,7 @@ function xGetElementsByTagName(t,p) function xGetURLArguments() { + xDeprecate('xGetURLArguments'); var idx = location.href.indexOf('?'); var params = new Array(); if (idx != -1) { @@ -285,6 +312,7 @@ function xGetURLArguments() function xHeight(e,h) { + xDeprecate('xHeight'); if(!(e=xGetElementById(e))) return 0; if (xNum(h)) { if (h<0) h = 0; @@ -328,6 +356,7 @@ function xHeight(e,h) function xHex(sn, digits, prefix) { + xDeprecate('xHex'); var p = ''; var n = Math.ceil(sn); if (prefix) p = prefix; @@ -338,10 +367,11 @@ function xHex(sn, digits, prefix) return p + n; } -function xHide(e){return xVisibility(e,0);} +function xHide(e){ xDeprecate('xHide'); return xVisibility(e,0);} function xInnerHtml(e,h) { + xDeprecate('xInnerHtml'); if(!(e=xGetElementById(e)) || !xStr(e.innerHTML)) return null; var s = e.innerHTML; if (xStr(h)) {e.innerHTML = h;} @@ -350,6 +380,7 @@ function xInnerHtml(e,h) function xLeft(e, iX) { + xDeprecate('xLeft'); if(!(e=xGetElementById(e))) return 0; var css=xDef(e.style); if (css && xStr(e.style.left)) { @@ -368,12 +399,14 @@ function xLeft(e, iX) function xMoveTo(e,x,y) { + xDeprecate('xMoveTo'); xLeft(e,x); xTop(e,y); } function xName(e) { + xDeprecate('xName'); if (!e) return e; else if (e.id && e.id != "") return e.id; else if (e.name && e.name != "") return e.name; @@ -384,6 +417,7 @@ function xName(e) function xNextSib(e,t) { + xDeprecate('xNextSib'); var s = e ? e.nextSibling : null; if (t) while (s && s.nodeName != t) { s = s.nextSibling; } else while (s && s.nodeType != 1) { s = s.nextSibling; } @@ -392,12 +426,14 @@ function xNextSib(e,t) function xNum() { + xDeprecate('xNum'); for(var i=0; i