1. #1
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Lightbulb [2.x, 3.x] ext-basex/JIT 4.1 Adapter extensions

    [2.x, 3.x] ext-basex/JIT 4.1 Adapter extensions


    The ext-basex adapter has been re-adapted for use with Ext 3.0 and adds the following new features:

    - Adds Browser 'capabilities' object reporting on presence of (SVG, Canvas, Flash, Cookies, XPath ) (eg:
    Code:
    if(Ext.capabilities.hasFlash){ ... }
    - Adds Ext.overload supported for parameter-based overloading of Functions and class methods.

    - Adds Ext.clone functions for any datatype.

    - Adds Array prototype features: first, last, clone, forEach, atRandom, include, flatten, compact, unique, filter, map.

    - Connection/response object members : getAllResponseHeaders, getResponseHeader are now functions.

    - Adds Array.slice shortcut support for other browsers (Gecko already supports it)
    Code:
     Array.slice( arguments, 2 )
    - Adds Ext[isFunction, isObject, isDocument, isElement, isEvent] methods.

    - Adds Ext.isEventSupported('resize'[, forElement]) to determine if the browser supports a specific event.

    - Adds cross-browser multiPart Response handling (via onpart callbacks and/or the new parts Array of response Object)
    See online Multipart Demo here.

    - Adds parsed contentType to all response objects

    - Adds Xdomain request support for modern browsers (IE8, etc) To make a cross-domain request simply add xdomain:true to any Ext.Ajax.request.
    HTML Code:
    Note: servers must implement the header: 'Access-Control-Allow-Origin: [*|domain.com]' for a response to be processed.
    ext-basex has been repackaged to make it lighter-weight. The ux.ModuleManager class has been moved the $JIT package (included), so if you are using the ModuleManager you'll need to include both ext-basex.js and jit.js in your project.

    I'll also announce that my official ux demonstration site is up, and based entirely on $JIT / Ext.3.0.

    Demonstrations:

    JSONP -> Flickr with ext-basex.
    Multipart Reponses (lately dubbed MXHR) with ext-basex.

    For more about $JIT, see the documentation link and aquick Tutorial is also available here. More coming..

    ZIP Download Note: the current vBulletin config gzips attachments which IE hates. Download this with Firefox (or other browser) instead of IE.
    Attached Files
    Last edited by hendricd; 23 Nov 2009 at 1:54 PM. Reason: Release 4.1
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  2. #2
    Ext User
    Join Date
    Feb 2008
    Posts
    3
    Vote Rating
    0
    Trinodia is on a distinguished road

      0  

    Default


    Great news! Will try it out as soon as i can

  3. #3
    Ext User DigitalSkyline's Avatar
    Join Date
    Apr 2007
    Location
    Rochester, MI
    Posts
    461
    Vote Rating
    1
    DigitalSkyline is on a distinguished road

      0  

    Default


    Grats Doug!

    _____________________________________________

    For ExtJS Consultation and Custom Development ->
    Contact Paul[at]digitalskyline.com

  4. #4
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    found a tiny issue with the primary clone function -- it currently does an isFunction() check before an emptiness check. if the obj is null, the clone() method chokes, splutters sputters and dies.

    a simple swap does the trick:
    Code:
        var clone = function(obj, deep) {
            if (!obj) {return obj;}
    
            if (Ext.isFunction(obj.clone)) {
                return obj.clone(deep);
            }
    
            // if (!obj) {return obj;}
    
            var o = {};
            forEach(obj, function(val, name, objAll) {
                o[name] = (val === objAll ? // reference to itself?
                        o : deep ? clone(val, true) : val);
             });
            return o;
        };
    Last edited by mystix; 8 Jun 2009 at 7:20 AM. Reason: welcome to the wonderful world of pre-dinner typos =)

  5. #5
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Thumbs up


    @mystix -- Thanks. Fixed in SVN.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  6. #6
    Ext User
    Join Date
    Nov 2007
    Posts
    68
    Vote Rating
    0
    markpele is an unknown quantity at this point

      0  

    Default


    I have a web-page page1 and I'm navigating to page2.
    If I'm sending a synchronous call in unload event handler
    will the synchronous call arrive the server before the request to page2?

    How will asynchronous request behave?

    Thank you.

  7. #7
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Quote Originally Posted by markpele View Post
    I have a web-page page1 and I'm navigating to page2.
    If I'm sending a synchronous call in unload event handler
    will the synchronous call arrive the server before the request to page2?

    How will asynchronous request behave?

    Thank you.
    The async response will definitely NOT survive the page transition, but the server will likely act on the request. The sync call [might] block the thread of execution until the response arrives, but on all browsers? Only your test will tell.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  8. #8
    Ext User
    Join Date
    Nov 2007
    Posts
    68
    Vote Rating
    0
    markpele is an unknown quantity at this point

      0  

    Default


    the sync request does get handled by the server. On my server log I can see that the sync request is received only after the next page request.

    What I'm trying to do is to tell the server to change the session state before the iframe navigation occurs. With beforeunload on IE and FF it works great but apparently unload event won't help.

  9. #9
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Question


    Quote Originally Posted by markpele View Post
    the sync request does get handled by the server. On my server log I can see that the sync request is received only after the next page request.

    What I'm trying to do is to tell the server to change the session state before the iframe navigation occurs. With beforeunload on IE and FF it works great but apparently unload event won't help.
    Are attempting the request from within the frame or the frame's parent page?
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  10. #10
    Ext User
    Join Date
    Nov 2007
    Posts
    68
    Vote Rating
    0
    markpele is an unknown quantity at this point

      0  

    Default


    The code is in the parent page.
    I didn't try to send the sync ajax request from the child frame. I'll try it now.
    I'm using standard js to simplify it before using ext and basex

    Code:
    <iframe id="childF" src="page1.html"></iframe>
    
    var childF = document.getElementById('childF').contentWindow;
    childF.addEventListener('unload', function(){
        if (window.XMLHttpRequest) {              
            AJAX=new XMLHttpRequest();              
        } else {                                  
            AJAX=new ActiveXObject("Microsoft.XMLHTTP");
        }
        if (AJAX) {
             AJAX.open("GET", '/test/', false);                             
             AJAX.send(null);
             //return AJAX.responseText;
            //alert(AJAX.responseText);
        } else {
             //return false;
             //alert('false');
        }
    }, false);