Changeset 167:986132e819d5 for source


Ignore:
Timestamp:
Jan 18, 2010, 4:22:17 PM (14 years ago)
Author:
fnevgeny
Branch:
default
Phase:
public
Message:

Updated wz_jsgraphics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/wz_jsgraphics.js

    r30 r167  
    11/* This notice must be untouched at all times.
    22
    3 wz_jsgraphics.js    v. 3.02
     3wz_jsgraphics.js    v. 3.05
    44The latest version is available at
    55http://www.walterzorn.com
     
    77or http://www.walterzorn.de
    88
    9 Copyright (c) 2002-2004 Walter Zorn. All rights reserved.
     9Copyright (c) 2002-2009 Walter Zorn. All rights reserved.
    1010Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com )
    11 Last modified: 26. 10. 2007
     11Last modified: 2. 2. 2009
    1212
    1313Performance optimizations for Internet Explorer
     
    4646
    4747
    48 function _chkDHTM(x, i)
    49 {
    50         x = document.body || null;
    51         jg_ie = x && typeof x.insertAdjacentHTML != "undefined" && document.createElement;
     48function _chkDHTM(wnd, x, i)
     49// Under XUL, owner of 'document' must be specified explicitly
     50{
     51        x = wnd.document.body || null;
     52        jg_ie = x && typeof x.insertAdjacentHTML != "undefined" && wnd.document.createElement;
    5253        jg_dom = (x && !jg_ie &&
    5354                typeof x.appendChild != "undefined" &&
    54                 typeof document.createRange != "undefined" &&
    55                 typeof (i = document.createRange()).setStartBefore != "undefined" &&
     55                typeof wnd.document.createRange != "undefined" &&
     56                typeof (i = wnd.document.createRange()).setStartBefore != "undefined" &&
    5657                typeof i.createContextualFragment != "undefined");
    57         jg_fast = jg_ie && document.all && !window.opera;
     58        jg_fast = jg_ie && wnd.document.all && !wnd.opera;
    5859        jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined";
    5960        jg_ok = !!(jg_ie || jg_dom);
     
    124125                _regex,
    125126                '<div style="overflow:hidden;position:absolute;background-color:'+
    126                 '$1;left:$2;top:$3;width:$4;height:$5"></div>\n');
     127                '$1;left:$2px;top:$3px;width:$4px;height:$5px"></div>\n');
    127128}
    128129
     
    132133                _regex,
    133134                '<div style="overflow:hidden;position:absolute;background-color:'+
    134                 '$1;left:$2;top:$3;width:$4;height:$5;border-left:$4px solid $1"></div>\n');
     135                '$1;left:$2px;top:$3px;width:$4px;height:$5px;border-left:$4px solid $1"></div>\n');
    135136}
    136137
     
    911912                        'left:' + x + 'px;'+
    912913                        'top:' + y + 'px;'+
    913                         'width:' +  w + 'px;'+
    914                         'height:' + h + 'px;">'+
    915                         '<img src="' + imgSrc + '" width="' + w + '" height="' + h + '"' + (a? (' '+a) : '') + '>'+
     914                        // w (width) and h (height) arguments are now optional.
     915                        // Added by Mahmut Keygubatli, 14.1.2008
     916                        (w? ('width:' +  w + 'px;') : '') +
     917                        (h? ('height:' + h + 'px;'):'')+'">'+
     918                        '<img src="' + imgSrc +'"'+ (w ? (' width="' + w + '"'):'')+ (h ? (' height="' + h + '"'):'') + (a? (' '+a) : '') + '>'+
    916919                        '<\/div>';
    917920        };
     
    10221025        this.wnd = wnd || window;
    10231026
    1024         if(!jg_ok) _chkDHTM();
     1027        if(!jg_ok) _chkDHTM(this.wnd);
    10251028        if(jg_ok)
    10261029        {
Note: See TracChangeset for help on using the changeset viewer.