3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js">(function(){
\r
11 isCSS1 = doc.compatMode == "CSS1Compat",
\r
14 PARSEINT = parseInt;
\r
17 isAncestor : function(p, c) {
\r
24 return p.contains(c);
\r
25 } else if (p.compareDocumentPosition) {
\r
26 return !!(p.compareDocumentPosition(c) & 16);
\r
28 while (c = c.parentNode) {
\r
29 ret = c == p || ret;
\r
36 getViewWidth : function(full) {
\r
37 return full ? this.getDocumentWidth() : this.getViewportWidth();
\r
40 getViewHeight : function(full) {
\r
41 return full ? this.getDocumentHeight() : this.getViewportHeight();
\r
44 getDocumentHeight: function() {
\r
45 return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight());
\r
48 getDocumentWidth: function() {
\r
49 return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth());
\r
52 getViewportHeight: function(){
\r
54 (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) :
\r
58 getViewportWidth : function() {
\r
59 return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth :
\r
60 Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth;
\r
63 getY : function(el) {
\r
64 return this.getXY(el)[1];
\r
67 getX : function(el) {
\r
68 return this.getXY(el)[0];
\r
71 getXY : function(el) {
\r
82 bd = (doc.body || doc.documentElement),
\r
85 el = Ext.getDom(el);
\r
88 if (el.getBoundingClientRect) {
\r
89 b = el.getBoundingClientRect();
\r
90 scroll = fly(document).getScroll();
\r
91 ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)];
\r
94 hasAbsolute = fly(el).isStyle("position", "absolute");
\r
101 hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute");
\r
103 if (Ext.isGecko) {
\r
104 y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0;
\r
105 x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0;
\r
107 if (p != el && !pe.isStyle('overflow','visible')) {
\r
112 p = p.offsetParent;
\r
115 if (Ext.isSafari && hasAbsolute) {
\r
116 x -= bd.offsetLeft;
\r
120 if (Ext.isGecko && !hasAbsolute) {
\r
122 x += PARSEINT(dbd.getStyle("borderLeftWidth"), 10) || 0;
\r
123 y += PARSEINT(dbd.getStyle("borderTopWidth"), 10) || 0;
\r
127 while (p && p != bd) {
\r
128 if (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) {
\r
140 setXY : function(el, xy) {
\r
141 (el = Ext.fly(el, '_setXY')).position();
\r
143 var pts = el.translatePoints(xy),
\r
144 style = el.dom.style,
\r
147 for (pos in pts) {
\r
148 if(!isNaN(pts[pos])) style[pos] = pts[pos] + "px"
\r
152 setX : function(el, x) {
\r
153 this.setXY(el, [x, false]);
\r
156 setY : function(el, y) {
\r
157 this.setXY(el, [false, y]);
\r