bdajax


Namebdajax JSON
Version 1.14 PyPI version JSON
download
home_pagehttp://github.com/conestack/bdajax
SummaryAjax convenience.
upload_time2022-12-05 11:35:53
maintainer
docs_urlNone
authorCone Contributors
requires_python
licenseSimplified BSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Overview
========

``bdajax`` provides JavaScript helper functions and a simple dispatcher system
driven by XML-attributes. Attributes are defined in its own XML namespace,
placed in the XHTML markup.

The dispatcher basically provides two behaviors

- trigger events
- perform actions

Behaviors are bound to JavaScript events.

This package bundles required resources for the use of bdajax inside a
``pyramid`` or ``zope`` application. It does NOT include the
required server implementations. bdajax can be used with other Python or
non-Python server backends too as long as action performing code is implemented
and available through browser URL.

.. contents::
    :depth: 2


Dispatching
-----------

The main paradigm is the use of an ``event/listener`` model. It enables bdajax
to ``listen`` to ``events`` and trigger ``events`` on ajaxified DOM components.

Consider a navtree as example; the idea is to trigger an event when a
navigation item gets clicked. Click semantically indicates a changed context.
Then listen to this event on all DOM elements to get notified on changing
server context.

This makes it possible to have completely decoupled "sub-applications" knowing
nothing but an event contract from each other.


Attributes
----------

Following attributes are available:

**ajax:bind="evt1 evt2"**
    Indicate bdajax behavior on DOM element and the event(s) triggering
    it/them.

**ajax:event="evt1:sel1 evt2:sel2"**
    Trigger event(s) on selector. The triggered event gets the target
    as additional parameter on event.ajaxtarget.

**ajax:action="name1:selector1:mode1 name2:selector2:mode2"**
    Perform AJAX action(s) on selector with mode. Selector points to target
    DOM element, mode defines how to modify the DOM tree. Possible
    mode values are ``inner`` and ``replace``.

**ajax:target="http://fubar.org?param=value"**
    AJAX target definition. Consists out of target context URL and a
    query string used for requests on the target context.
    ``ajax:target`` is mandatory when ``ajax:event`` is defined, and
    optional when ``ajax:action`` is defined (depends on if event is triggered
    by bdajax or browser event).

**ajax:confirm="Do you really want to do this?"**
    Show confirmation dialog before actually executing actions and trigger
    events.

**ajax:overlay="actionname:selector:content_selector"**
    Renders ajax action to overlay with selector. ``selector`` is optional and
    defaults to ``#ajax-overlay``. ``content_selector`` is optional to
    ``selector`` and defaults to ``.overlay_content``.

**ajax:overlay-css="additional-overlay-css-class"**
    Additional CSS class which is added when overlay is opened and removed
    as soon as overlay is closed.

**ajax:form="True"**
    Indicate AJAX form. Valid only on ``form`` elements. Value gets ignored.

**ajax:path="/some/path"**
    Sets the browser URL path and pushes history state if supported by browser.
    If value is ``href``, path gets taken from ``href`` attribute. If value is
    ``target`` path gets taken from event ``ajaxtarget`` or ``ajax:target``
    attribute. Otherwise value is taken as defined.

    On ``popstate`` event bdajax executes the definitions written to state
    object. The state object consists of ``target``, ``action`` and ``event``
    attributes. Execution behaves the way described at ``ajax:action`` and
    ``ajax:event``.

    Target gets taken from ``ajax:path-target`` if set, otherwise falls back
    to target from event ``ajaxtarget`` or ``ajax:target``. If
    ``ajax:path-target`` set with empty value, target gets taken from ``path``.

    Action gets taken from ``ajax:path-action`` if set, otherwise falls back
    to ``ajax:action``. If ``ajax:path-action`` set with empty value, action
    execution on history state change can be suppressed even if ``ajax:action``
    is set.

    Event gets taken from ``ajax:path-event`` if set, otherwise falls back
    to ``ajax:event``. If ``ajax:path-event`` set with empty value, event
    triggering on history state change can be suppressed even if ``ajax:event``
    is set.

    Overlay gets taken from ``ajax:path-overlay`` if set, otherwise falls back
    to ``ajax:overlay``. If ``ajax:path-overlay`` set with empty value, overlay
    triggering on history state change can be suppressed even if
    ``ajax:overlay`` is set.

    Additional CSS class for overlay gets taken from ``ajax:path-overlay-css``
    if set, otherwise falls back to ``ajax:overlay-css``.

    If no action and no event and no overlay defined on history state change,
    bdajax performs a redirect to target.

    Bdajax appends the request parameter ``popstate=1`` to requests made by
    history browsing. This is useful to determine on server side whether to
    skip setting ajax path as continuation definition.

**ajax:path-target="http://fubar.org?param=value"**
    Can be used in conjunction with ``ajax:path``.

**ajax:path-action="name1:selector1:mode1"**
    Can be used in conjunction with ``ajax:path``.

**ajax:path-event="evt1:sel1"**
    Can be used in conjunction with ``ajax:path``.

**ajax:path-overlay="actionname:selector:content_selector"**
    Can be used in conjunction with ``ajax:path``.

**ajax:path-overlay-css="actionname:selector:content_selector"**
    Can be used in conjunction with ``ajax:path``.

.. note::

    No selectors containing spaces are supported!


Provide dependencies on server
------------------------------

This package already includes resource configuration for ``Zope`` and
``pyramid``. This is done by ZCML. Include the following ZCML include statement
to your ZCML configuration:

.. code-block:: xml

    <include package="bdajax" />

The expected ``ajaxaction`` view is not provided. Its intended to be provided
by a custom implementation. See 'Perform actions' below.


Load dependencies in markup
---------------------------

Load bdajax related Scripts:

.. code-block:: html

    <!--
      include jquery 1.7+.
    -->
    <script src="http://code.jquery.com/jquery-1.7.js"></script>

    <!--
      overlay could be included via jquerytools bundle or overlay.js directly
    -->
    <script src="http://fubar.com/++resource++bdajax/overlay.js"></script>

    <!--
      bdajax related Javascript.
    -->
    <script src="http://fubar.com/++resource++bdajax/bdajax.js"></script>

    <!--
      optionally add bootstrap 3 overlay hook if bootstrap is used.
    -->
    <script src="http://fubar.com/++resource++bdajax/bdajax_bs3.js"></script>

Load bdajax related CSS:

.. code-block:: html

    <!--
      bdajax related default styles.
    -->
    <link href="http://fubar.com/++resource++bdajax/bdajax.css"
          rel="stylesheet" type="text/css" media="screen" />

    <!--
      optionally use bootstrap 3 bdajax related styles if bootstrap is used.
      no need to include default styles in this case.
    -->
    <link href="http://fubar.com/++resource++bdajax/bdajax_bs3.css"
          rel="stylesheet" type="text/css" media="screen" />

Make sure the content of ``bdajax.pt`` or ``bdajax_bs3.pt`` is rendered in
Markup.


Define namespace
----------------

In order to keep your XHTML valid when using the XML namespace extension define
this namespace in the XHTML document:

.. code-block:: html

    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ajax="http://namespaces.conestack.org/ajax">
        ...
    </html>


Event binding
-------------

Indicate bdajax behavior on DOM element:

.. code-block:: html

    <a href="http://fubar.com"
       ajax:bind="keydown click">
      fubar
    </a>

Binds this element to events ``keydown`` and ``click``.


Trigger events
--------------

Bind event behavior to DOM element:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:event="contextchanged:.contextsensitiv"
       ajax:target="http://fubar.com/baz?a=a">
      fubar
    </a>

This causes the ``contextchanged`` event to be triggered on all DOM elements
defining ``contextsensitiv`` css class. The extra attribute ``ajaxtarget`` gets
written to the event before it is triggered, containing definitions from
``ajax:target``.


Set URL path
------------

Set path directly, triggers event on history state change:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:path="/some/path"
       ajax:path-event="contextxhanged:#layout">
      fubar
    </a>

Take path from target, performs action on history state change:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:target="http://fubar.com/baz?a=a"
       ajax:path="target"
       ajax:path-action="layout:#layout:replace">
      fubar
    </a>

Take path from href attribute, trigger overlay:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:target="http://fubar.com/baz?a=a"
       ajax:path="href"
       ajax:path-overlay="acionname:#custom-overlay:.custom_overlay_content">
      fubar
    </a>


Perform actions
---------------

An action performs a JSON request to the server and modifies the DOM tree as
defined.

bdajax expects a resource (i.e a zope/pyramid view or some script) named
``ajaxaction`` on server. Resource is called on target url with target query
parameters. Three additional arguments are passed:

**bdajax.action**
    name of the action

**bdajax.selector**
    given selector must be added to response. Can be ``NONE``, which means
    that no markup is manipulated after action (useful i.e. in combination with
    continuation actions and events).

**bdajax.mode**
    the manipulation mode. Either ``inner`` or ``replace`` or ``NONE``
    (see above).

The resource is responsible to return the requested resource as a JSON
response in the format as follows:

.. code-block:: js

    {
        mode: 'inner',             // the passed mode
        selector: '#someid',       // the passed selector
        payload: '<div>...</div>', // the rendered action
        continuation: [{}],        // continuation definitions
    }


Action continuation
~~~~~~~~~~~~~~~~~~~

The ``continuation`` value defines an array of tasks which should
be performed after an ajax action returns. Available continuation
definitions are described below.

**actions**:

.. code-block:: js

    {
        'type': 'action',
        'target': 'http://example.com',
        'name': 'actionname',
        'mode': 'inner',
        'selector': '.foo'
    }

**events**:

.. code-block:: js

    {
        'type': 'event',
        'target': 'http://example.com',
        'name': 'eventname',
        'selector': '.foo',
        'data': {}
    }

**path**:

.. code-block:: js

    {
        'type': 'path',
        'path': '/some/path',
        'target': 'http://example.com/some/path',
        'action': 'actionname:.selector:replace',
        'event': 'contextchanged:#layout',
        'overlay': 'acionname:#custom-overlay:.custom_overlay_content',
        'overlay_css': 'some-css-class'
    }

**overlay**:

.. code-block:: js

    {
        'type': 'overlay',
        'action': 'actionname',
        'selector': '#ajax-overlay',
        'content_selector': '.overlay_content',
        'css': 'some-css-class',
        'target': 'http://example.com',
        'close': false
    }

Overlays dynamically get a close button. In order to keep overlay contents
easily alterable inside the overlay element an element exists acting as overlay
content container. ``content_selector`` defines the selector of this container.

Setting close to ``true`` closes overlay at ``selector``. In this case
``action`` and target are ignored.

**messages**:

.. code-block:: js

    {
        'type': 'message',
        'payload': 'Text or <strong>Markup</strong>',
        'flavor': 'error',
        'selector': null,
    }

Either ``flavor`` or ``selector`` must be given.
Flavor could be one of 'message', 'info', 'warning', 'error' and map to the
corresponding bdajax UI helper functions. Selector indicates to hook returned
payload at a custom location in DOM tree instead of displaying a message. In
this case, payload is set as contents of DOM element returned by selector.

If both ``flavor`` and ``selector`` are set, ``selector`` is ignored.

Be aware that you can provoke infinite loops with continuation actions and
events, use this feature sparingly.


Trigger actions directly
~~~~~~~~~~~~~~~~~~~~~~~~

Bind an action which is triggered directly:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:action="renderfubar:.#fubar:replace"
       ajax:target="http://fubar.com/baz?a=a">
      fubar
    </a>

On click the DOM element with id ``fubar`` will be replaced by the results of
action ``renderfubar``. Request context and request params are taken from
``ajax:target`` definition.


Trigger actions as event listener
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bind an action acting as event listener. See section 'Trigger events'.
A triggered event indicates change of context on target with params.
Hereupon perform some action:

.. code-block:: html

    <div id="content"
         class="contextsensitiv"
         ajax:bind="contextchanged"
         ajax:action="rendercontent:#content:inner">
      ...
    </div>

Note: If binding actions as event listeners, there's no need to define a target
since it is passed along with the event.


Multiple behaviors
------------------

Bind multiple behaviors to the same DOM element:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:event="contextchanged:.contextsensitiv"
       ajax:action="rendersomething:.#something:replace"
       ajax:target="http://fubar.com/baz?a=a"
       ajax:path="/some/path">
      fubar
    </a>

In this example on click event ``contextchanged`` is triggered, action
``rendersomething`` is performed and URL path ``/some/path`` get set.


Confirm actions
---------------

Bdajax can display a confirmation dialog before performing actions or trigger
events:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:event="contextchanged:.contextsensitiv"
       ajax:action="rendersomething:.#something:replace"
       ajax:target="http://fubar.com/baz?a=a"
       ajax:confirm="Do you really want to do this?">
      fubar
    </a>

If ``ajax:confirm`` is set, a modal dialog is displayed before dispatching is
performed.


Overlays
--------

Ajax actions can be rendered to overlay directly by using ``bdajax:overlay``:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:target="http://fubar.com/baz?a=a"
       ajax:overlay="acionname">
      fubar
    </a>

This causes bdajax to perform action ``acionname`` on context defined in
``ajax:target`` and renders the result to an overlay element.

In addition a selector for the overlay can be defined. This is useful if
someone needs to display multiple overlays:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:target="http://fubar.com/baz?a=a"
       ajax:overlay="acionname:#custom-overlay">
      fubar
    </a>

Optional to a custom overlay selector a content container selector can be
defined:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:target="http://fubar.com/baz?a=a"
       ajax:overlay="acionname:#custom-overlay:.custom_overlay_content">
      fubar
    </a>

Overlays can be closed by setting special value ``CLOSE`` at
``bdajax:overlay``, optionally with colon seperated overlay selector:

.. code-block:: html

    <a href="http://fubar.com/baz?a=a"
       ajax:bind="click"
       ajax:overlay="CLOSE:#custom-overlay">
      fubar
    </a>


JavaScript API
==============


Messages, infos, warnings and errors
------------------------------------

``bdajax`` displays application messages in a jQuery tools overlay.

``bdajax.message`` displays a plain message. ``bdajax.info`` ``bdajax.warning``
and ``bdajax.error`` decorates message with appropriate icon:

.. code-block:: js

    bdajax.message('I am an application Message');


Overlay
-------

Load ajax action contents into an overlay:

.. code-block:: js

    var overlay_api = bdajax.overlay({
        action: 'actionname',
        target: 'http://foobar.org?param=value',
        selector: '#ajax-overlay',
        content_selector: '.overlay_ontent',
        css: 'additional_overlay_css_class'
    });

``selector`` is optional and defaults to ``#ajax-overlay``.

``content_selector`` is optional to ``selector`` and defaults to
``overlay_ontent``.

Default overlay and default overlay content selector can be overwritten at
``bdajax.default_overlay_selector`` respective
``bdajax.default_overlay_content_selector``.

``css`` is optional and can be used to set a CSS class to overlay
DOM element on open. This class gets removed as soon as overlay is closed.

Optionally to ``target``, ``url`` and ``params`` can be given as options to
the function. If both, ``target`` and ``url/params`` given, ``target`` is used.

Ajax overlays can be closed by passing ``close`` option to ``bdajax.overlay``.
When closing an overlay, overlay selector is considered as well from options
if given, otherwise ``bdajax.default_overlay_selector`` is used.

.. code-block:: js

    bdajax.overlay({
        close: true,
        selector: '#ajax-overlay'
    });

``bdajax.overlay`` supports an ``on_close`` callback in options.

.. code-block:: js

    var on_close = function() {
        // do something
    }
    bdajax.overlay({
        action: 'actionname',
        target: 'http://foobar.org?param=value',
        on_close: on_close
    });


Modal dialog
------------

Render a modal dialog inside an overlay. The function expects an options object
and a callback function, which gets executed if user confirms dialog. The
callback gets passed the given options object as well. ``message`` is mandatory
in options:

.. code-block:: js

    var options = {
        message: 'I am an application Message'
    };
    bdajax.dialog(options, callback);


URL operations
--------------

parseurl
~~~~~~~~

Parse hyperlinks for base URL:

.. code-block:: js

    bdajax.parseurl('http://fubar.org?param=value');

This results in:

.. code-block:: js

    'http://fubar.org'


parsequery
~~~~~~~~~~

Parse hyperlinks for request parameters:

.. code-block:: js

    bdajax.parsequery('http://fubar.org?param=value');

This results in:

.. code-block:: js

    { param: 'value' }

The raw query as string can be parsed by additionally passing ``true`` to
``parsequery``::

.. code-block:: js

    bdajax.parsequery('http://fubar.org?param=value', true);

This results in::

.. code-block:: js

    '?param=value'


parsepath
~~~~~~~~~

Parse hyperlinks for path without base URL::

.. code-block:: js

    bdajax.parsepath('http://fubar.org/some/path?param=value');

This results in::

.. code-block:: js

    '/some/path'

The query can be included by additionally passing ``true`` to ``parsepath``::

.. code-block:: js

    bdajax.parsepath('http://fubar.org/some/path?param=value', true);

This results in::

.. code-block:: js

    '/some/path?param=value'


parsetarget
~~~~~~~~~~~

Parse all information at once by calling ``parsetarget``:

.. code-block:: js

    bdajax.parsetarget('http://fubar.org/some/path?param=value');

This result in:

.. code-block:: js

    {
        url: 'http://fubar.org/some/path',
        params: { param: 'value' },
        path: '/some/path',
        query: '?param=value'
    }


XMLHTTPRequest convenience
--------------------------

``bdajax.request`` function is convenience for XMLHTTPRequests. By default
it sends requests of type ``html`` and displays a ``bdajax.error`` message if
request fails:

.. code-block:: js

    bdajax.request({
        success: function(data) {
            // do something with data.
        },
        url: 'foo',
        params: {
            a: 'a',
            b: 'b'
        },
        type: 'json',
        error: function() {
            bdajax.error('Request failed');
        }
    });

Given ``url`` might contain a query string. It gets parsed and written to
request parameters. If same request parameter is defined in URL query AND
params object, latter one rules.

Options:

**success**
    Callback if request is successful.

**url**
    Request url as string.

**params (optional)**
    Query parameters for request as Object.

**type (optional)**
    ``xml``, ``json``, ``script``, or ``html``.

**error (optional)**
    Callback if request fails.

Success and error callback functions are wrapped in ``bdajax.request`` to
consider ajax spinner handling automatically.


Perform action
--------------

Sometimes actions need to be performed inside JavaScript code.
``bdajax.action`` provides this:

.. code-block:: js

    var target = bdajax.parsetarget('http://fubar.org?param=value');
    bdajax.action({
        name: 'content',
        selector: '#content',
        mode: 'inner',
        url: target.url,
        params: target.params
    });

Options:

**name**
    Action name

**selector**
    result selector

**mode**
    action mode

**url**
    target url

**params**
    query params


Trigger events
--------------

Sometimes events need to be triggered manually. Since bdajax expects the
attribute ``ajaxtarget`` on the received event a convenience is provided.

Target might be a URL, then it gets parsed by the trigger function:

.. code-block:: js

    var url = 'http://fubar.org?param=value';
    bdajax.trigger('contextchanged', '.contextsensitiv', url);

Target might be object as returned from ``bdajax.parsetarget``:

.. code-block:: js

    var url = 'http://fubar.org?param=value';
    var target = bdajax.parsetarget(url);
    bdajax.trigger('contextchanged', '.contextsensitiv', target);

Optionally, a data argument can be passed to ``bdajax.trigger``, which gets set
at the ``ajaxdata`` attribute of the event:

.. code-block:: js

    var url = 'http://fubar.org?param=value';
    var data = { opt: 'val' };
    bdajax.trigger('contextchanged', '.contextsensitiv', url, data);


Set URL path
------------

To set URL path:

.. code-block:: js

    bdajax.path({
        path: '/some/path',
        target: 'http://example.com/some/path',
        action: 'layout:#layout:replace',
        event: 'contextchanged:#layout',
        overlay: 'actionname',
        overlay_css: 'additional-overlay-css-class'
    });

``bdajax.path`` also accepts a ``replace`` option. If given browser history
gets reset.

.. code-block:: js

    bdajax.path({
        path: '/some/path',
        target: 'http://example.com/some/path',
        action: 'layout:#layout:replace',
        replace: true
    });


Ajax forms
----------

Forms must have ``ajax:form`` attribute or CSS class ``ajax`` (deprecated)
set in order to be handled by bdajax:

.. code-block:: html

    <form ajax:form="True"
          id="my_ajax_form"
          method="post"
          action="http://example.com/myformaction"
          enctype="multipart/form-data">
      ...
    </form>

Ajax form processing is done using a hidden iframe where the form gets
triggered to. The server side must return a response like so on form submit:

.. code-block:: html

    <div id="ajaxform">

        <!-- this is the rendering payload -->
        <form ajax:form="True"
              id="my_ajax_form"
              method="post"
              action="http://example.com/myformaction"
              enctype="multipart/form-data">
          ...
        </form>

    </div>

    <script language="javascript" type="text/javascript">

        // get response result container
        var container = document.getElementById('ajaxform');

        // extract DOM element to fiddle from result container
        var child = container.firstChild;
        while(child != null && child.nodeType == 3) {
            child = child.nextSibling;
        }

        // call ``bdajax.render_ajax_form`` on parent frame (remember, we're in
        // iframe here). ``render_ajax_form`` expects the result DOM element,
        // the ``selector``, the fiddle ``mode`` and ``continuation``
        // definitions which may be used to perform ajax continuation.
        parent.bdajax.render_ajax_form(child, '#my_ajax_form', 'replace', {});

    </script>

If ``div`` with id ``ajaxform`` contains markup, it gets rendered to
``selector`` (#my_ajax_form) with ``mode`` (replace). This makes it possible
to rerender forms on validation error or display a success page or similar.
Optional bdajax continuation definitions can be given.

Again, bdajax does not provide any server side implementation, it's up to you
providing this.

**NOTE** - As of bdajax 1.10 the continuation definitions are passed directly
to ``render_ajax_form`` instead of calling ``bdajax.continuation``. This is
necessary because ``render_ajax_form`` removes the hidden iframe after
processing to prevent useless browser history entries. Please adopt your server
side code when updating to version 1.10.


3rd party javascript
--------------------

Integration of custom JavaScript to the binding mechanism of bdajax is
done via ``bdajax.register``. The register function takes a function and
a boolean flag whether to immediately execute this function as arguments.

The passed binder function gets called every time bdajax hooks up some markup
and gets passed the changed DOM part as ``context``:

.. code-block:: js

    (function($) {

        var custom_binder = function(context) {
            $('mysel', context).on('click', function() { ... });
        };

        $(document).ready(function() {
            bdajax.register(custom_binder, true);
        });

    })(jQuery);


Migration from old style registered binders
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Prior to bdajax 1.9, binder functions were registered by directly manipulating
``bdajax.binders`` object. While this still works, it's not supposed to be
used any more.

When migrating to ``bdajax.register``, be aware that the context of ``this``
changes if binder function is member of a global object. To ensure proper
execution, the binder function should be bound manually to the object it gets
executed in, or the code should be adopted.

Thus, migrating code registering ``myob.binder`` as bdajax binder looks like
so:

.. code-block:: js

    (function($) {

        var myob = {
            binder: function(context) {
                // ``this`` is expected to refer to ``myob``
            }
        }

        $(document).ready(function() {
            // old way of binding
            bdajax.binders.myob_binder = myob.binder;

            // new way of binding if context of ``this`` should be kept
            bdajax.register(myob.binder.bind(myob));
        });

    })(jQuery);


Browsers
========

bdajax is tested with common modern browsers:

- Firefox
- IE
- Edge
- Chome
- Safari

If you find bugs or inconsistencies please report them on github.


Contributors
============

- Robert Niederreiter (Author)
- Attila Oláh
- Johannes Raggam


Changes
=======

1.14 (2022-12-05)
-----------------

- Release wheel.
  [rnix]


1.13 (2020-10-12)
-----------------

- ``bdajax.trigger`` accepts optional ``data`` argument. Can be used by
  continuation events to pass additional data from server to event handler.
  [rnix]


1.12 (2019-09-06)
-----------------

- Support for async loading
  [agitator]


1.11 (2018-11-07)
-----------------

- Prevent X scrolling when overlay is shown in conjunction with bootstrap
  styles.
  [rnix, 2018-10-04]


1.10 (2017-09-17)
-----------------

- Hidden form response iframe gets created on the fly and removed after form
  processing. This is necessary to prevent a useless entry in browser history.

  WARNING: This change breaks the server implementation. Take a look at
  Ajax forms documentation how to adopt your code to this change. Also make
  sure to remove the hidden iframe from bdajax markup if you don't use the
  templates shipped with this package.
  [rnix, 2017-09-12]


1.9 (2017-08-28)
----------------

- Introduce ``bdajax.register`` which should be used for registering
  binder functions instead of manipulating ``bdajax.binders`` manually.
  [rnix, 2017-07-19]

- Catch and log exceptions thrown when executing bdajax binder callback
  functions.
  [rnix, 2017-07-19]

- Use ``jQuery.on`` and ``jQuery.off`` for event binding instead of ``bind``
  and ``unbind`` (jQuery 1.7+ required).
  [rnix, 2017-07-19]

- ``bdajax.parsetarget`` includes ``query`` as string in returned object.
  [rnix, 2017-07-19]

- ``bdajax.parsepath`` accepts optional ``include_query`` boolean argument.
  [rnix, 2017-07-19]

- ``bdajax.parsequery`` accepts optional ``as_string`` boolean argument.
  [rnix, 2017-07-19]

- Consider query string in ``bdajax._handle_ajax_path`` if ``ajax:path`` is
  ``target``.
  [rnix, 2017-07-19]


1.8.1 (2017-07-18)
------------------

- Consider query string in ``bdajax._handle_ajax_path`` if ``ajax:path`` is
  ``href``.
  [rnix, 2017-07-06]


1.8 (2017-05-15)
----------------

- Add support for setting additional CSS classes to overlays.
  [rnix, 2017-05-12]


1.7.2 (2017-05-11)
------------------

- Reset ``window.location.hash`` if ``bdajax.request`` error callback gets
  unauthorized HTTP response code when redirecting to login page.
  [rnix, 2017-05-11]


1.7.1 (2017-03-29)
------------------

- Use ``bdajax`` object instead of ``this`` in ``bdajax._do_dispatching``.
  If called as callback by ``bdajax.dialog``, ``this`` is undefined.
  [rnix, 2017-03-29]


1.7 (2017-03-28)
----------------

- ``target`` option passed to ``bdajax.overlay`` is also accepted as JS object.
  [rnix, 2017-03-28]

- Handle empty target in ``bdajax.parsetarget``.
  [rnix, 2017-03-27]

- Introduce ``close`` option in ``bdajax.overlay``.
  [rnix, 2017-03-27]

- Introduce ``on_close`` callback option in ``bdajax.overlay``.
  [rnix, 2017-03-27]

- Add support for browser history navigation. Introduce ``ajax:path-target``,
  ``ajax:path-action``, ``ajax:path-event`` and ``ajax:path-overlay``
  attributes.
  [rnix, 2017-03-22]

- ``bdajax.request`` supports ``method`` in options, defaults to ``GET``.
  [rnix, 2016-10-11]


1.6.3 (2015-11-22)
------------------

- Fix ``bdajax.parseurl``.
  [rnix, 2015-11-21]


1.6.2 (2015-07-31)
------------------

- Check path starts with '/' via ``indexOf`` function instead of
  IE-unsupported ``startsWith`` function in ``bdajax.parseurl``.
  [rnix, 2015-07-29]

- Fix license in JS files.


1.6.1 (2015-06-27)
------------------

- Fix Internet Explorer 11 problem, where the pathname attribute on URL parsing
  on an "a" element doesn't start with '/'.
  [thet]


1.6.0 (2015-06-25)
------------------

- Resolve JSHint errors and warnings.
  [thet]

- Add wrapper with class ``bdajax-overlays`` around ``bdajax`` browser views.
  That way, all structures can be selected at once with Diazo.
  [thet]

- JSHint.
  [thet]

- Change order of available overlays in template.
  [rnix, 2014-07-24]

- Add ``ajax:path functionality``.
  [rnix, 2014-07-22]

- Add bdajax integration template and styles and overlay hook script for
  Twitter Bootstrap 3.
  [rnix, 2014-07-04]

- Update Ajax Spinner Image.
  [rnix, 2014-07-03]


1.5.2
-----

- Do not display error message if XHR request gets aborted (e.g. click
  a url while request is pending)
  [rnix]


1.5.1
-----

- Ajax forms are now marked via ``ajax:form``. Setting ``ajax`` CSS class still
  works, but is deprecated.
  [rnix, 2013-02-04]


1.5.0
-----

- Refactor ``bdajax.trigger`` to create a separate event instace for each
  element returned by selector.
  [rnix, 2013-08-14]

- Include customized ``overlay.js`` of jquery tools. Two Reasons; We only need
  overlay of jquery tools; jquery tools development is pretty slow in migrating
  newer jQuery versions and not compatible with jquery >= 1.9 (yet).
  [rnix, 2013-08-13]

- Update to Jquery 1.9.x
  [rnix, 2013-08-13]

1.4.2
-----

- ``bdaja.trigger`` also accepts object as returned by ``bdajax.parsetarget``
  as target argument.
  [rnix, 2012-10-28]

1.4.1
-----

- Explicit render ``about:blank`` in hidden form response iframe src.
  [rnix, 2012-08-06]

1.4
---

- Nicer spinner image.
  [rnix, 2012-05-21]

- Add ``overlay`` continuation support.
  [rnix, 2012-05-04]

- Extend ``ajax:overlay`` to accept an optional overlay and content selector.
  [rnix, 2012-05-04]

- Add AJAX form support.
  [rnix, 2012-05-04]

1.3
---

- All overlays not positional fixed for now.
  [rnix, 2011-12-02]

- jQuery 1.6.4 and jQuery Tools 1.2.6.
  [rnix, 2011-12-01]

- Add ``ajax:overlay`` functionality.
  [rnix, 2011-11-30]

- Call ``event.stopPropagation`` in ``bdajax._dispatching_handler``.
  [rnix, 2011-11-23]

1.2.1
-----

- Use CSS 'min-width' instead of 'width' for messages.
  [rnix, 2011-09-07]

1.2
---

- Add ``bdajax.fiddle`` function.
  [rnix, 2011-04-28]

- Delete overlay data from DOM element before reinitializing.
  [rnix, 2011-04-21]

- Add ``ajax:confirm`` functionality.
  [rnix, 2011-04-20]

- Strip trailing '/' in ``bdajax.parseurl`` to avoid double slashes.
  [rnix, 2011-04-19]

- Add continuation messages.
  [rnix, 2011-04-12]

1.1
---

- Set focus on ok button for dialog boxes, so a user can dismiss the button by
  pressing return key.
  [aatiis, 2011-03-25]

- Don't define a default error callback twice, just rely on the default handler
  prowided by ``bdajax.request``.
  [aatiis, 2011-03-25]

- Add default 403 error page redirect.
  [aatiis, 2011-03-25]

- Hide spinner after 'Empty response' message.
  [aatiis, 2011-03-25]

- Used ``request.status`` and ``request.statusText`` in default error if they
  are defined.
  [aatiis, 2011-03-25]

- Continuation action and event support for ajaxaction.
  [rnix, 2011-03-21]

- Better default error output.
  [rnix, 2011-03-13]

- Remove ``ajaxerrors`` and ``ajaxerror`` from bdajax.
  [rnix, 2011-03-13]

- Remove bfg.zcml and zope.zcml, switch to pyramid in configure.zcml with
  conditional resource registration.
  [rnix, 2011-02-07]

1.0.2
-----

- Rebind bdajax global if element is not found by selector after replace
  action.
  [rnix, 2011-01-14]

1.0.1
-----

- Add spinner handling.
  [rnix, 2010-12-13]

- Return jquery context by ``jQuery.bdajax``.
  [rnix, 2010-12-13]

1.0
---

- Remove call behaviour.
  [rnix, 2010-12-04]

- Browser testing.
  [rnix, 2010-12-04]

1.0b4
-----

- Add ``configure.zcml`` containing all configuration using
  ``zcml:condition``.
  [rnix, 2010-11-16]

- Remove overlay data of modal dialog before reloading. otherwise callback
  options are cached.
  [rnix, 2010-11-09]

- Disable ajax request caching by default in ``bdajax.request``.
  [rnix, 2010-11-09]

- Add modal dialog to bdajax.
  [rnix, 2010-11-09]

- Mark ``ajax:call`` API deprecated. Will be removed for 1.0 final.
  [rnix, 2010-11-09]

1.0b3
-----

- Add class ``allowMultiSubmit`` to fit a plone JS contract.
  [rnix, 2010-07-01]

- Fix bug in bdajax.request when finding url including query params.
  [rnix, 2010-07-01]

1.0b2
-----

- Switch to jQuery tools 1.2.3.
  [rnix, 2010-07-01]

- Call binders with correct context.
  [rnix, 2010-05-16]

- Add overlay helper function and corresponding styles.
  [rnix, 2010-05-16]

1.0b1
-----

- Make it work.
  [rnix]



License
=======

Copyright (c) 2010-2022, BlueDynamics Alliance, Austria
Copyright (c) 2021, Cone Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
  list of conditions and the following disclaimer in the documentation and/or
  other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/conestack/bdajax",
    "name": "bdajax",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Cone Contributors",
    "author_email": "dev@conestack.org",
    "download_url": "https://files.pythonhosted.org/packages/71/d4/f5219a319d72284ead173217bf58b902fae6b40317197177a8f24430d74e/bdajax-1.14.tar.gz",
    "platform": null,
    "description": "Overview\n========\n\n``bdajax`` provides JavaScript helper functions and a simple dispatcher system\ndriven by XML-attributes. Attributes are defined in its own XML namespace,\nplaced in the XHTML markup.\n\nThe dispatcher basically provides two behaviors\n\n- trigger events\n- perform actions\n\nBehaviors are bound to JavaScript events.\n\nThis package bundles required resources for the use of bdajax inside a\n``pyramid`` or ``zope`` application. It does NOT include the\nrequired server implementations. bdajax can be used with other Python or\nnon-Python server backends too as long as action performing code is implemented\nand available through browser URL.\n\n.. contents::\n    :depth: 2\n\n\nDispatching\n-----------\n\nThe main paradigm is the use of an ``event/listener`` model. It enables bdajax\nto ``listen`` to ``events`` and trigger ``events`` on ajaxified DOM components.\n\nConsider a navtree as example; the idea is to trigger an event when a\nnavigation item gets clicked. Click semantically indicates a changed context.\nThen listen to this event on all DOM elements to get notified on changing\nserver context.\n\nThis makes it possible to have completely decoupled \"sub-applications\" knowing\nnothing but an event contract from each other.\n\n\nAttributes\n----------\n\nFollowing attributes are available:\n\n**ajax:bind=\"evt1 evt2\"**\n    Indicate bdajax behavior on DOM element and the event(s) triggering\n    it/them.\n\n**ajax:event=\"evt1:sel1 evt2:sel2\"**\n    Trigger event(s) on selector. The triggered event gets the target\n    as additional parameter on event.ajaxtarget.\n\n**ajax:action=\"name1:selector1:mode1 name2:selector2:mode2\"**\n    Perform AJAX action(s) on selector with mode. Selector points to target\n    DOM element, mode defines how to modify the DOM tree. Possible\n    mode values are ``inner`` and ``replace``.\n\n**ajax:target=\"http://fubar.org?param=value\"**\n    AJAX target definition. Consists out of target context URL and a\n    query string used for requests on the target context.\n    ``ajax:target`` is mandatory when ``ajax:event`` is defined, and\n    optional when ``ajax:action`` is defined (depends on if event is triggered\n    by bdajax or browser event).\n\n**ajax:confirm=\"Do you really want to do this?\"**\n    Show confirmation dialog before actually executing actions and trigger\n    events.\n\n**ajax:overlay=\"actionname:selector:content_selector\"**\n    Renders ajax action to overlay with selector. ``selector`` is optional and\n    defaults to ``#ajax-overlay``. ``content_selector`` is optional to\n    ``selector`` and defaults to ``.overlay_content``.\n\n**ajax:overlay-css=\"additional-overlay-css-class\"**\n    Additional CSS class which is added when overlay is opened and removed\n    as soon as overlay is closed.\n\n**ajax:form=\"True\"**\n    Indicate AJAX form. Valid only on ``form`` elements. Value gets ignored.\n\n**ajax:path=\"/some/path\"**\n    Sets the browser URL path and pushes history state if supported by browser.\n    If value is ``href``, path gets taken from ``href`` attribute. If value is\n    ``target`` path gets taken from event ``ajaxtarget`` or ``ajax:target``\n    attribute. Otherwise value is taken as defined.\n\n    On ``popstate`` event bdajax executes the definitions written to state\n    object. The state object consists of ``target``, ``action`` and ``event``\n    attributes. Execution behaves the way described at ``ajax:action`` and\n    ``ajax:event``.\n\n    Target gets taken from ``ajax:path-target`` if set, otherwise falls back\n    to target from event ``ajaxtarget`` or ``ajax:target``. If\n    ``ajax:path-target`` set with empty value, target gets taken from ``path``.\n\n    Action gets taken from ``ajax:path-action`` if set, otherwise falls back\n    to ``ajax:action``. If ``ajax:path-action`` set with empty value, action\n    execution on history state change can be suppressed even if ``ajax:action``\n    is set.\n\n    Event gets taken from ``ajax:path-event`` if set, otherwise falls back\n    to ``ajax:event``. If ``ajax:path-event`` set with empty value, event\n    triggering on history state change can be suppressed even if ``ajax:event``\n    is set.\n\n    Overlay gets taken from ``ajax:path-overlay`` if set, otherwise falls back\n    to ``ajax:overlay``. If ``ajax:path-overlay`` set with empty value, overlay\n    triggering on history state change can be suppressed even if\n    ``ajax:overlay`` is set.\n\n    Additional CSS class for overlay gets taken from ``ajax:path-overlay-css``\n    if set, otherwise falls back to ``ajax:overlay-css``.\n\n    If no action and no event and no overlay defined on history state change,\n    bdajax performs a redirect to target.\n\n    Bdajax appends the request parameter ``popstate=1`` to requests made by\n    history browsing. This is useful to determine on server side whether to\n    skip setting ajax path as continuation definition.\n\n**ajax:path-target=\"http://fubar.org?param=value\"**\n    Can be used in conjunction with ``ajax:path``.\n\n**ajax:path-action=\"name1:selector1:mode1\"**\n    Can be used in conjunction with ``ajax:path``.\n\n**ajax:path-event=\"evt1:sel1\"**\n    Can be used in conjunction with ``ajax:path``.\n\n**ajax:path-overlay=\"actionname:selector:content_selector\"**\n    Can be used in conjunction with ``ajax:path``.\n\n**ajax:path-overlay-css=\"actionname:selector:content_selector\"**\n    Can be used in conjunction with ``ajax:path``.\n\n.. note::\n\n    No selectors containing spaces are supported!\n\n\nProvide dependencies on server\n------------------------------\n\nThis package already includes resource configuration for ``Zope`` and\n``pyramid``. This is done by ZCML. Include the following ZCML include statement\nto your ZCML configuration:\n\n.. code-block:: xml\n\n    <include package=\"bdajax\" />\n\nThe expected ``ajaxaction`` view is not provided. Its intended to be provided\nby a custom implementation. See 'Perform actions' below.\n\n\nLoad dependencies in markup\n---------------------------\n\nLoad bdajax related Scripts:\n\n.. code-block:: html\n\n    <!--\n      include jquery 1.7+.\n    -->\n    <script src=\"http://code.jquery.com/jquery-1.7.js\"></script>\n\n    <!--\n      overlay could be included via jquerytools bundle or overlay.js directly\n    -->\n    <script src=\"http://fubar.com/++resource++bdajax/overlay.js\"></script>\n\n    <!--\n      bdajax related Javascript.\n    -->\n    <script src=\"http://fubar.com/++resource++bdajax/bdajax.js\"></script>\n\n    <!--\n      optionally add bootstrap 3 overlay hook if bootstrap is used.\n    -->\n    <script src=\"http://fubar.com/++resource++bdajax/bdajax_bs3.js\"></script>\n\nLoad bdajax related CSS:\n\n.. code-block:: html\n\n    <!--\n      bdajax related default styles.\n    -->\n    <link href=\"http://fubar.com/++resource++bdajax/bdajax.css\"\n          rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n\n    <!--\n      optionally use bootstrap 3 bdajax related styles if bootstrap is used.\n      no need to include default styles in this case.\n    -->\n    <link href=\"http://fubar.com/++resource++bdajax/bdajax_bs3.css\"\n          rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n\nMake sure the content of ``bdajax.pt`` or ``bdajax_bs3.pt`` is rendered in\nMarkup.\n\n\nDefine namespace\n----------------\n\nIn order to keep your XHTML valid when using the XML namespace extension define\nthis namespace in the XHTML document:\n\n.. code-block:: html\n\n    <html xmlns=\"http://www.w3.org/1999/xhtml\"\n          xmlns:ajax=\"http://namespaces.conestack.org/ajax\">\n        ...\n    </html>\n\n\nEvent binding\n-------------\n\nIndicate bdajax behavior on DOM element:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com\"\n       ajax:bind=\"keydown click\">\n      fubar\n    </a>\n\nBinds this element to events ``keydown`` and ``click``.\n\n\nTrigger events\n--------------\n\nBind event behavior to DOM element:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:event=\"contextchanged:.contextsensitiv\"\n       ajax:target=\"http://fubar.com/baz?a=a\">\n      fubar\n    </a>\n\nThis causes the ``contextchanged`` event to be triggered on all DOM elements\ndefining ``contextsensitiv`` css class. The extra attribute ``ajaxtarget`` gets\nwritten to the event before it is triggered, containing definitions from\n``ajax:target``.\n\n\nSet URL path\n------------\n\nSet path directly, triggers event on history state change:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:path=\"/some/path\"\n       ajax:path-event=\"contextxhanged:#layout\">\n      fubar\n    </a>\n\nTake path from target, performs action on history state change:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:target=\"http://fubar.com/baz?a=a\"\n       ajax:path=\"target\"\n       ajax:path-action=\"layout:#layout:replace\">\n      fubar\n    </a>\n\nTake path from href attribute, trigger overlay:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:target=\"http://fubar.com/baz?a=a\"\n       ajax:path=\"href\"\n       ajax:path-overlay=\"acionname:#custom-overlay:.custom_overlay_content\">\n      fubar\n    </a>\n\n\nPerform actions\n---------------\n\nAn action performs a JSON request to the server and modifies the DOM tree as\ndefined.\n\nbdajax expects a resource (i.e a zope/pyramid view or some script) named\n``ajaxaction`` on server. Resource is called on target url with target query\nparameters. Three additional arguments are passed:\n\n**bdajax.action**\n    name of the action\n\n**bdajax.selector**\n    given selector must be added to response. Can be ``NONE``, which means\n    that no markup is manipulated after action (useful i.e. in combination with\n    continuation actions and events).\n\n**bdajax.mode**\n    the manipulation mode. Either ``inner`` or ``replace`` or ``NONE``\n    (see above).\n\nThe resource is responsible to return the requested resource as a JSON\nresponse in the format as follows:\n\n.. code-block:: js\n\n    {\n        mode: 'inner',             // the passed mode\n        selector: '#someid',       // the passed selector\n        payload: '<div>...</div>', // the rendered action\n        continuation: [{}],        // continuation definitions\n    }\n\n\nAction continuation\n~~~~~~~~~~~~~~~~~~~\n\nThe ``continuation`` value defines an array of tasks which should\nbe performed after an ajax action returns. Available continuation\ndefinitions are described below.\n\n**actions**:\n\n.. code-block:: js\n\n    {\n        'type': 'action',\n        'target': 'http://example.com',\n        'name': 'actionname',\n        'mode': 'inner',\n        'selector': '.foo'\n    }\n\n**events**:\n\n.. code-block:: js\n\n    {\n        'type': 'event',\n        'target': 'http://example.com',\n        'name': 'eventname',\n        'selector': '.foo',\n        'data': {}\n    }\n\n**path**:\n\n.. code-block:: js\n\n    {\n        'type': 'path',\n        'path': '/some/path',\n        'target': 'http://example.com/some/path',\n        'action': 'actionname:.selector:replace',\n        'event': 'contextchanged:#layout',\n        'overlay': 'acionname:#custom-overlay:.custom_overlay_content',\n        'overlay_css': 'some-css-class'\n    }\n\n**overlay**:\n\n.. code-block:: js\n\n    {\n        'type': 'overlay',\n        'action': 'actionname',\n        'selector': '#ajax-overlay',\n        'content_selector': '.overlay_content',\n        'css': 'some-css-class',\n        'target': 'http://example.com',\n        'close': false\n    }\n\nOverlays dynamically get a close button. In order to keep overlay contents\neasily alterable inside the overlay element an element exists acting as overlay\ncontent container. ``content_selector`` defines the selector of this container.\n\nSetting close to ``true`` closes overlay at ``selector``. In this case\n``action`` and target are ignored.\n\n**messages**:\n\n.. code-block:: js\n\n    {\n        'type': 'message',\n        'payload': 'Text or <strong>Markup</strong>',\n        'flavor': 'error',\n        'selector': null,\n    }\n\nEither ``flavor`` or ``selector`` must be given.\nFlavor could be one of 'message', 'info', 'warning', 'error' and map to the\ncorresponding bdajax UI helper functions. Selector indicates to hook returned\npayload at a custom location in DOM tree instead of displaying a message. In\nthis case, payload is set as contents of DOM element returned by selector.\n\nIf both ``flavor`` and ``selector`` are set, ``selector`` is ignored.\n\nBe aware that you can provoke infinite loops with continuation actions and\nevents, use this feature sparingly.\n\n\nTrigger actions directly\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nBind an action which is triggered directly:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:action=\"renderfubar:.#fubar:replace\"\n       ajax:target=\"http://fubar.com/baz?a=a\">\n      fubar\n    </a>\n\nOn click the DOM element with id ``fubar`` will be replaced by the results of\naction ``renderfubar``. Request context and request params are taken from\n``ajax:target`` definition.\n\n\nTrigger actions as event listener\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nBind an action acting as event listener. See section 'Trigger events'.\nA triggered event indicates change of context on target with params.\nHereupon perform some action:\n\n.. code-block:: html\n\n    <div id=\"content\"\n         class=\"contextsensitiv\"\n         ajax:bind=\"contextchanged\"\n         ajax:action=\"rendercontent:#content:inner\">\n      ...\n    </div>\n\nNote: If binding actions as event listeners, there's no need to define a target\nsince it is passed along with the event.\n\n\nMultiple behaviors\n------------------\n\nBind multiple behaviors to the same DOM element:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:event=\"contextchanged:.contextsensitiv\"\n       ajax:action=\"rendersomething:.#something:replace\"\n       ajax:target=\"http://fubar.com/baz?a=a\"\n       ajax:path=\"/some/path\">\n      fubar\n    </a>\n\nIn this example on click event ``contextchanged`` is triggered, action\n``rendersomething`` is performed and URL path ``/some/path`` get set.\n\n\nConfirm actions\n---------------\n\nBdajax can display a confirmation dialog before performing actions or trigger\nevents:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:event=\"contextchanged:.contextsensitiv\"\n       ajax:action=\"rendersomething:.#something:replace\"\n       ajax:target=\"http://fubar.com/baz?a=a\"\n       ajax:confirm=\"Do you really want to do this?\">\n      fubar\n    </a>\n\nIf ``ajax:confirm`` is set, a modal dialog is displayed before dispatching is\nperformed.\n\n\nOverlays\n--------\n\nAjax actions can be rendered to overlay directly by using ``bdajax:overlay``:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:target=\"http://fubar.com/baz?a=a\"\n       ajax:overlay=\"acionname\">\n      fubar\n    </a>\n\nThis causes bdajax to perform action ``acionname`` on context defined in\n``ajax:target`` and renders the result to an overlay element.\n\nIn addition a selector for the overlay can be defined. This is useful if\nsomeone needs to display multiple overlays:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:target=\"http://fubar.com/baz?a=a\"\n       ajax:overlay=\"acionname:#custom-overlay\">\n      fubar\n    </a>\n\nOptional to a custom overlay selector a content container selector can be\ndefined:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:target=\"http://fubar.com/baz?a=a\"\n       ajax:overlay=\"acionname:#custom-overlay:.custom_overlay_content\">\n      fubar\n    </a>\n\nOverlays can be closed by setting special value ``CLOSE`` at\n``bdajax:overlay``, optionally with colon seperated overlay selector:\n\n.. code-block:: html\n\n    <a href=\"http://fubar.com/baz?a=a\"\n       ajax:bind=\"click\"\n       ajax:overlay=\"CLOSE:#custom-overlay\">\n      fubar\n    </a>\n\n\nJavaScript API\n==============\n\n\nMessages, infos, warnings and errors\n------------------------------------\n\n``bdajax`` displays application messages in a jQuery tools overlay.\n\n``bdajax.message`` displays a plain message. ``bdajax.info`` ``bdajax.warning``\nand ``bdajax.error`` decorates message with appropriate icon:\n\n.. code-block:: js\n\n    bdajax.message('I am an application Message');\n\n\nOverlay\n-------\n\nLoad ajax action contents into an overlay:\n\n.. code-block:: js\n\n    var overlay_api = bdajax.overlay({\n        action: 'actionname',\n        target: 'http://foobar.org?param=value',\n        selector: '#ajax-overlay',\n        content_selector: '.overlay_ontent',\n        css: 'additional_overlay_css_class'\n    });\n\n``selector`` is optional and defaults to ``#ajax-overlay``.\n\n``content_selector`` is optional to ``selector`` and defaults to\n``overlay_ontent``.\n\nDefault overlay and default overlay content selector can be overwritten at\n``bdajax.default_overlay_selector`` respective\n``bdajax.default_overlay_content_selector``.\n\n``css`` is optional and can be used to set a CSS class to overlay\nDOM element on open. This class gets removed as soon as overlay is closed.\n\nOptionally to ``target``, ``url`` and ``params`` can be given as options to\nthe function. If both, ``target`` and ``url/params`` given, ``target`` is used.\n\nAjax overlays can be closed by passing ``close`` option to ``bdajax.overlay``.\nWhen closing an overlay, overlay selector is considered as well from options\nif given, otherwise ``bdajax.default_overlay_selector`` is used.\n\n.. code-block:: js\n\n    bdajax.overlay({\n        close: true,\n        selector: '#ajax-overlay'\n    });\n\n``bdajax.overlay`` supports an ``on_close`` callback in options.\n\n.. code-block:: js\n\n    var on_close = function() {\n        // do something\n    }\n    bdajax.overlay({\n        action: 'actionname',\n        target: 'http://foobar.org?param=value',\n        on_close: on_close\n    });\n\n\nModal dialog\n------------\n\nRender a modal dialog inside an overlay. The function expects an options object\nand a callback function, which gets executed if user confirms dialog. The\ncallback gets passed the given options object as well. ``message`` is mandatory\nin options:\n\n.. code-block:: js\n\n    var options = {\n        message: 'I am an application Message'\n    };\n    bdajax.dialog(options, callback);\n\n\nURL operations\n--------------\n\nparseurl\n~~~~~~~~\n\nParse hyperlinks for base URL:\n\n.. code-block:: js\n\n    bdajax.parseurl('http://fubar.org?param=value');\n\nThis results in:\n\n.. code-block:: js\n\n    'http://fubar.org'\n\n\nparsequery\n~~~~~~~~~~\n\nParse hyperlinks for request parameters:\n\n.. code-block:: js\n\n    bdajax.parsequery('http://fubar.org?param=value');\n\nThis results in:\n\n.. code-block:: js\n\n    { param: 'value' }\n\nThe raw query as string can be parsed by additionally passing ``true`` to\n``parsequery``::\n\n.. code-block:: js\n\n    bdajax.parsequery('http://fubar.org?param=value', true);\n\nThis results in::\n\n.. code-block:: js\n\n    '?param=value'\n\n\nparsepath\n~~~~~~~~~\n\nParse hyperlinks for path without base URL::\n\n.. code-block:: js\n\n    bdajax.parsepath('http://fubar.org/some/path?param=value');\n\nThis results in::\n\n.. code-block:: js\n\n    '/some/path'\n\nThe query can be included by additionally passing ``true`` to ``parsepath``::\n\n.. code-block:: js\n\n    bdajax.parsepath('http://fubar.org/some/path?param=value', true);\n\nThis results in::\n\n.. code-block:: js\n\n    '/some/path?param=value'\n\n\nparsetarget\n~~~~~~~~~~~\n\nParse all information at once by calling ``parsetarget``:\n\n.. code-block:: js\n\n    bdajax.parsetarget('http://fubar.org/some/path?param=value');\n\nThis result in:\n\n.. code-block:: js\n\n    {\n        url: 'http://fubar.org/some/path',\n        params: { param: 'value' },\n        path: '/some/path',\n        query: '?param=value'\n    }\n\n\nXMLHTTPRequest convenience\n--------------------------\n\n``bdajax.request`` function is convenience for XMLHTTPRequests. By default\nit sends requests of type ``html`` and displays a ``bdajax.error`` message if\nrequest fails:\n\n.. code-block:: js\n\n    bdajax.request({\n        success: function(data) {\n            // do something with data.\n        },\n        url: 'foo',\n        params: {\n            a: 'a',\n            b: 'b'\n        },\n        type: 'json',\n        error: function() {\n            bdajax.error('Request failed');\n        }\n    });\n\nGiven ``url`` might contain a query string. It gets parsed and written to\nrequest parameters. If same request parameter is defined in URL query AND\nparams object, latter one rules.\n\nOptions:\n\n**success**\n    Callback if request is successful.\n\n**url**\n    Request url as string.\n\n**params (optional)**\n    Query parameters for request as Object.\n\n**type (optional)**\n    ``xml``, ``json``, ``script``, or ``html``.\n\n**error (optional)**\n    Callback if request fails.\n\nSuccess and error callback functions are wrapped in ``bdajax.request`` to\nconsider ajax spinner handling automatically.\n\n\nPerform action\n--------------\n\nSometimes actions need to be performed inside JavaScript code.\n``bdajax.action`` provides this:\n\n.. code-block:: js\n\n    var target = bdajax.parsetarget('http://fubar.org?param=value');\n    bdajax.action({\n        name: 'content',\n        selector: '#content',\n        mode: 'inner',\n        url: target.url,\n        params: target.params\n    });\n\nOptions:\n\n**name**\n    Action name\n\n**selector**\n    result selector\n\n**mode**\n    action mode\n\n**url**\n    target url\n\n**params**\n    query params\n\n\nTrigger events\n--------------\n\nSometimes events need to be triggered manually. Since bdajax expects the\nattribute ``ajaxtarget`` on the received event a convenience is provided.\n\nTarget might be a URL, then it gets parsed by the trigger function:\n\n.. code-block:: js\n\n    var url = 'http://fubar.org?param=value';\n    bdajax.trigger('contextchanged', '.contextsensitiv', url);\n\nTarget might be object as returned from ``bdajax.parsetarget``:\n\n.. code-block:: js\n\n    var url = 'http://fubar.org?param=value';\n    var target = bdajax.parsetarget(url);\n    bdajax.trigger('contextchanged', '.contextsensitiv', target);\n\nOptionally, a data argument can be passed to ``bdajax.trigger``, which gets set\nat the ``ajaxdata`` attribute of the event:\n\n.. code-block:: js\n\n    var url = 'http://fubar.org?param=value';\n    var data = { opt: 'val' };\n    bdajax.trigger('contextchanged', '.contextsensitiv', url, data);\n\n\nSet URL path\n------------\n\nTo set URL path:\n\n.. code-block:: js\n\n    bdajax.path({\n        path: '/some/path',\n        target: 'http://example.com/some/path',\n        action: 'layout:#layout:replace',\n        event: 'contextchanged:#layout',\n        overlay: 'actionname',\n        overlay_css: 'additional-overlay-css-class'\n    });\n\n``bdajax.path`` also accepts a ``replace`` option. If given browser history\ngets reset.\n\n.. code-block:: js\n\n    bdajax.path({\n        path: '/some/path',\n        target: 'http://example.com/some/path',\n        action: 'layout:#layout:replace',\n        replace: true\n    });\n\n\nAjax forms\n----------\n\nForms must have ``ajax:form`` attribute or CSS class ``ajax`` (deprecated)\nset in order to be handled by bdajax:\n\n.. code-block:: html\n\n    <form ajax:form=\"True\"\n          id=\"my_ajax_form\"\n          method=\"post\"\n          action=\"http://example.com/myformaction\"\n          enctype=\"multipart/form-data\">\n      ...\n    </form>\n\nAjax form processing is done using a hidden iframe where the form gets\ntriggered to. The server side must return a response like so on form submit:\n\n.. code-block:: html\n\n    <div id=\"ajaxform\">\n\n        <!-- this is the rendering payload -->\n        <form ajax:form=\"True\"\n              id=\"my_ajax_form\"\n              method=\"post\"\n              action=\"http://example.com/myformaction\"\n              enctype=\"multipart/form-data\">\n          ...\n        </form>\n\n    </div>\n\n    <script language=\"javascript\" type=\"text/javascript\">\n\n        // get response result container\n        var container = document.getElementById('ajaxform');\n\n        // extract DOM element to fiddle from result container\n        var child = container.firstChild;\n        while(child != null && child.nodeType == 3) {\n            child = child.nextSibling;\n        }\n\n        // call ``bdajax.render_ajax_form`` on parent frame (remember, we're in\n        // iframe here). ``render_ajax_form`` expects the result DOM element,\n        // the ``selector``, the fiddle ``mode`` and ``continuation``\n        // definitions which may be used to perform ajax continuation.\n        parent.bdajax.render_ajax_form(child, '#my_ajax_form', 'replace', {});\n\n    </script>\n\nIf ``div`` with id ``ajaxform`` contains markup, it gets rendered to\n``selector`` (#my_ajax_form) with ``mode`` (replace). This makes it possible\nto rerender forms on validation error or display a success page or similar.\nOptional bdajax continuation definitions can be given.\n\nAgain, bdajax does not provide any server side implementation, it's up to you\nproviding this.\n\n**NOTE** - As of bdajax 1.10 the continuation definitions are passed directly\nto ``render_ajax_form`` instead of calling ``bdajax.continuation``. This is\nnecessary because ``render_ajax_form`` removes the hidden iframe after\nprocessing to prevent useless browser history entries. Please adopt your server\nside code when updating to version 1.10.\n\n\n3rd party javascript\n--------------------\n\nIntegration of custom JavaScript to the binding mechanism of bdajax is\ndone via ``bdajax.register``. The register function takes a function and\na boolean flag whether to immediately execute this function as arguments.\n\nThe passed binder function gets called every time bdajax hooks up some markup\nand gets passed the changed DOM part as ``context``:\n\n.. code-block:: js\n\n    (function($) {\n\n        var custom_binder = function(context) {\n            $('mysel', context).on('click', function() { ... });\n        };\n\n        $(document).ready(function() {\n            bdajax.register(custom_binder, true);\n        });\n\n    })(jQuery);\n\n\nMigration from old style registered binders\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPrior to bdajax 1.9, binder functions were registered by directly manipulating\n``bdajax.binders`` object. While this still works, it's not supposed to be\nused any more.\n\nWhen migrating to ``bdajax.register``, be aware that the context of ``this``\nchanges if binder function is member of a global object. To ensure proper\nexecution, the binder function should be bound manually to the object it gets\nexecuted in, or the code should be adopted.\n\nThus, migrating code registering ``myob.binder`` as bdajax binder looks like\nso:\n\n.. code-block:: js\n\n    (function($) {\n\n        var myob = {\n            binder: function(context) {\n                // ``this`` is expected to refer to ``myob``\n            }\n        }\n\n        $(document).ready(function() {\n            // old way of binding\n            bdajax.binders.myob_binder = myob.binder;\n\n            // new way of binding if context of ``this`` should be kept\n            bdajax.register(myob.binder.bind(myob));\n        });\n\n    })(jQuery);\n\n\nBrowsers\n========\n\nbdajax is tested with common modern browsers:\n\n- Firefox\n- IE\n- Edge\n- Chome\n- Safari\n\nIf you find bugs or inconsistencies please report them on github.\n\n\nContributors\n============\n\n- Robert Niederreiter (Author)\n- Attila Ol\u00e1h\n- Johannes Raggam\n\n\nChanges\n=======\n\n1.14 (2022-12-05)\n-----------------\n\n- Release wheel.\n  [rnix]\n\n\n1.13 (2020-10-12)\n-----------------\n\n- ``bdajax.trigger`` accepts optional ``data`` argument. Can be used by\n  continuation events to pass additional data from server to event handler.\n  [rnix]\n\n\n1.12 (2019-09-06)\n-----------------\n\n- Support for async loading\n  [agitator]\n\n\n1.11 (2018-11-07)\n-----------------\n\n- Prevent X scrolling when overlay is shown in conjunction with bootstrap\n  styles.\n  [rnix, 2018-10-04]\n\n\n1.10 (2017-09-17)\n-----------------\n\n- Hidden form response iframe gets created on the fly and removed after form\n  processing. This is necessary to prevent a useless entry in browser history.\n\n  WARNING: This change breaks the server implementation. Take a look at\n  Ajax forms documentation how to adopt your code to this change. Also make\n  sure to remove the hidden iframe from bdajax markup if you don't use the\n  templates shipped with this package.\n  [rnix, 2017-09-12]\n\n\n1.9 (2017-08-28)\n----------------\n\n- Introduce ``bdajax.register`` which should be used for registering\n  binder functions instead of manipulating ``bdajax.binders`` manually.\n  [rnix, 2017-07-19]\n\n- Catch and log exceptions thrown when executing bdajax binder callback\n  functions.\n  [rnix, 2017-07-19]\n\n- Use ``jQuery.on`` and ``jQuery.off`` for event binding instead of ``bind``\n  and ``unbind`` (jQuery 1.7+ required).\n  [rnix, 2017-07-19]\n\n- ``bdajax.parsetarget`` includes ``query`` as string in returned object.\n  [rnix, 2017-07-19]\n\n- ``bdajax.parsepath`` accepts optional ``include_query`` boolean argument.\n  [rnix, 2017-07-19]\n\n- ``bdajax.parsequery`` accepts optional ``as_string`` boolean argument.\n  [rnix, 2017-07-19]\n\n- Consider query string in ``bdajax._handle_ajax_path`` if ``ajax:path`` is\n  ``target``.\n  [rnix, 2017-07-19]\n\n\n1.8.1 (2017-07-18)\n------------------\n\n- Consider query string in ``bdajax._handle_ajax_path`` if ``ajax:path`` is\n  ``href``.\n  [rnix, 2017-07-06]\n\n\n1.8 (2017-05-15)\n----------------\n\n- Add support for setting additional CSS classes to overlays.\n  [rnix, 2017-05-12]\n\n\n1.7.2 (2017-05-11)\n------------------\n\n- Reset ``window.location.hash`` if ``bdajax.request`` error callback gets\n  unauthorized HTTP response code when redirecting to login page.\n  [rnix, 2017-05-11]\n\n\n1.7.1 (2017-03-29)\n------------------\n\n- Use ``bdajax`` object instead of ``this`` in ``bdajax._do_dispatching``.\n  If called as callback by ``bdajax.dialog``, ``this`` is undefined.\n  [rnix, 2017-03-29]\n\n\n1.7 (2017-03-28)\n----------------\n\n- ``target`` option passed to ``bdajax.overlay`` is also accepted as JS object.\n  [rnix, 2017-03-28]\n\n- Handle empty target in ``bdajax.parsetarget``.\n  [rnix, 2017-03-27]\n\n- Introduce ``close`` option in ``bdajax.overlay``.\n  [rnix, 2017-03-27]\n\n- Introduce ``on_close`` callback option in ``bdajax.overlay``.\n  [rnix, 2017-03-27]\n\n- Add support for browser history navigation. Introduce ``ajax:path-target``,\n  ``ajax:path-action``, ``ajax:path-event`` and ``ajax:path-overlay``\n  attributes.\n  [rnix, 2017-03-22]\n\n- ``bdajax.request`` supports ``method`` in options, defaults to ``GET``.\n  [rnix, 2016-10-11]\n\n\n1.6.3 (2015-11-22)\n------------------\n\n- Fix ``bdajax.parseurl``.\n  [rnix, 2015-11-21]\n\n\n1.6.2 (2015-07-31)\n------------------\n\n- Check path starts with '/' via ``indexOf`` function instead of\n  IE-unsupported ``startsWith`` function in ``bdajax.parseurl``.\n  [rnix, 2015-07-29]\n\n- Fix license in JS files.\n\n\n1.6.1 (2015-06-27)\n------------------\n\n- Fix Internet Explorer 11 problem, where the pathname attribute on URL parsing\n  on an \"a\" element doesn't start with '/'.\n  [thet]\n\n\n1.6.0 (2015-06-25)\n------------------\n\n- Resolve JSHint errors and warnings.\n  [thet]\n\n- Add wrapper with class ``bdajax-overlays`` around ``bdajax`` browser views.\n  That way, all structures can be selected at once with Diazo.\n  [thet]\n\n- JSHint.\n  [thet]\n\n- Change order of available overlays in template.\n  [rnix, 2014-07-24]\n\n- Add ``ajax:path functionality``.\n  [rnix, 2014-07-22]\n\n- Add bdajax integration template and styles and overlay hook script for\n  Twitter Bootstrap 3.\n  [rnix, 2014-07-04]\n\n- Update Ajax Spinner Image.\n  [rnix, 2014-07-03]\n\n\n1.5.2\n-----\n\n- Do not display error message if XHR request gets aborted (e.g. click\n  a url while request is pending)\n  [rnix]\n\n\n1.5.1\n-----\n\n- Ajax forms are now marked via ``ajax:form``. Setting ``ajax`` CSS class still\n  works, but is deprecated.\n  [rnix, 2013-02-04]\n\n\n1.5.0\n-----\n\n- Refactor ``bdajax.trigger`` to create a separate event instace for each\n  element returned by selector.\n  [rnix, 2013-08-14]\n\n- Include customized ``overlay.js`` of jquery tools. Two Reasons; We only need\n  overlay of jquery tools; jquery tools development is pretty slow in migrating\n  newer jQuery versions and not compatible with jquery >= 1.9 (yet).\n  [rnix, 2013-08-13]\n\n- Update to Jquery 1.9.x\n  [rnix, 2013-08-13]\n\n1.4.2\n-----\n\n- ``bdaja.trigger`` also accepts object as returned by ``bdajax.parsetarget``\n  as target argument.\n  [rnix, 2012-10-28]\n\n1.4.1\n-----\n\n- Explicit render ``about:blank`` in hidden form response iframe src.\n  [rnix, 2012-08-06]\n\n1.4\n---\n\n- Nicer spinner image.\n  [rnix, 2012-05-21]\n\n- Add ``overlay`` continuation support.\n  [rnix, 2012-05-04]\n\n- Extend ``ajax:overlay`` to accept an optional overlay and content selector.\n  [rnix, 2012-05-04]\n\n- Add AJAX form support.\n  [rnix, 2012-05-04]\n\n1.3\n---\n\n- All overlays not positional fixed for now.\n  [rnix, 2011-12-02]\n\n- jQuery 1.6.4 and jQuery Tools 1.2.6.\n  [rnix, 2011-12-01]\n\n- Add ``ajax:overlay`` functionality.\n  [rnix, 2011-11-30]\n\n- Call ``event.stopPropagation`` in ``bdajax._dispatching_handler``.\n  [rnix, 2011-11-23]\n\n1.2.1\n-----\n\n- Use CSS 'min-width' instead of 'width' for messages.\n  [rnix, 2011-09-07]\n\n1.2\n---\n\n- Add ``bdajax.fiddle`` function.\n  [rnix, 2011-04-28]\n\n- Delete overlay data from DOM element before reinitializing.\n  [rnix, 2011-04-21]\n\n- Add ``ajax:confirm`` functionality.\n  [rnix, 2011-04-20]\n\n- Strip trailing '/' in ``bdajax.parseurl`` to avoid double slashes.\n  [rnix, 2011-04-19]\n\n- Add continuation messages.\n  [rnix, 2011-04-12]\n\n1.1\n---\n\n- Set focus on ok button for dialog boxes, so a user can dismiss the button by\n  pressing return key.\n  [aatiis, 2011-03-25]\n\n- Don't define a default error callback twice, just rely on the default handler\n  prowided by ``bdajax.request``.\n  [aatiis, 2011-03-25]\n\n- Add default 403 error page redirect.\n  [aatiis, 2011-03-25]\n\n- Hide spinner after 'Empty response' message.\n  [aatiis, 2011-03-25]\n\n- Used ``request.status`` and ``request.statusText`` in default error if they\n  are defined.\n  [aatiis, 2011-03-25]\n\n- Continuation action and event support for ajaxaction.\n  [rnix, 2011-03-21]\n\n- Better default error output.\n  [rnix, 2011-03-13]\n\n- Remove ``ajaxerrors`` and ``ajaxerror`` from bdajax.\n  [rnix, 2011-03-13]\n\n- Remove bfg.zcml and zope.zcml, switch to pyramid in configure.zcml with\n  conditional resource registration.\n  [rnix, 2011-02-07]\n\n1.0.2\n-----\n\n- Rebind bdajax global if element is not found by selector after replace\n  action.\n  [rnix, 2011-01-14]\n\n1.0.1\n-----\n\n- Add spinner handling.\n  [rnix, 2010-12-13]\n\n- Return jquery context by ``jQuery.bdajax``.\n  [rnix, 2010-12-13]\n\n1.0\n---\n\n- Remove call behaviour.\n  [rnix, 2010-12-04]\n\n- Browser testing.\n  [rnix, 2010-12-04]\n\n1.0b4\n-----\n\n- Add ``configure.zcml`` containing all configuration using\n  ``zcml:condition``.\n  [rnix, 2010-11-16]\n\n- Remove overlay data of modal dialog before reloading. otherwise callback\n  options are cached.\n  [rnix, 2010-11-09]\n\n- Disable ajax request caching by default in ``bdajax.request``.\n  [rnix, 2010-11-09]\n\n- Add modal dialog to bdajax.\n  [rnix, 2010-11-09]\n\n- Mark ``ajax:call`` API deprecated. Will be removed for 1.0 final.\n  [rnix, 2010-11-09]\n\n1.0b3\n-----\n\n- Add class ``allowMultiSubmit`` to fit a plone JS contract.\n  [rnix, 2010-07-01]\n\n- Fix bug in bdajax.request when finding url including query params.\n  [rnix, 2010-07-01]\n\n1.0b2\n-----\n\n- Switch to jQuery tools 1.2.3.\n  [rnix, 2010-07-01]\n\n- Call binders with correct context.\n  [rnix, 2010-05-16]\n\n- Add overlay helper function and corresponding styles.\n  [rnix, 2010-05-16]\n\n1.0b1\n-----\n\n- Make it work.\n  [rnix]\n\n\n\nLicense\n=======\n\nCopyright (c) 2010-2022, BlueDynamics Alliance, Austria\nCopyright (c) 2021, Cone Contributors\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n",
    "bugtrack_url": null,
    "license": "Simplified BSD",
    "summary": "Ajax convenience.",
    "version": "1.14",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "138223ad08432ceb490919c3a62d044d",
                "sha256": "62cca9befb33ccf4d41b7a24013693bfcd0422c3453ac51ebaa2fb0c242663b3"
            },
            "downloads": -1,
            "filename": "bdajax-1.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "138223ad08432ceb490919c3a62d044d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 33547,
            "upload_time": "2022-12-05T11:35:50",
            "upload_time_iso_8601": "2022-12-05T11:35:50.350380Z",
            "url": "https://files.pythonhosted.org/packages/dc/6c/d7fd458d2d394b4559e881b3079c1216cbf3324823e7076c1887b18779b1/bdajax-1.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "dce94e83ccde4b12a6539c7dcccfaf3a",
                "sha256": "a2fe03a795d44906de0608899c5993558e018d8febd9831bbaf5313ba83031cc"
            },
            "downloads": -1,
            "filename": "bdajax-1.14.tar.gz",
            "has_sig": false,
            "md5_digest": "dce94e83ccde4b12a6539c7dcccfaf3a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 54203,
            "upload_time": "2022-12-05T11:35:53",
            "upload_time_iso_8601": "2022-12-05T11:35:53.712092Z",
            "url": "https://files.pythonhosted.org/packages/71/d4/f5219a319d72284ead173217bf58b902fae6b40317197177a8f24430d74e/bdajax-1.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-05 11:35:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "conestack",
    "github_project": "bdajax",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bdajax"
}
        
Elapsed time: 0.01596s