Package: bdajax
Overviewbdajaxprovides 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 behaviorstrigger eventsperform actionsBehaviors are bound to JavaScript events.This package bundles required resources for the use of bdajax inside apyramidorzopeapplication. 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.ContentsOverviewDispatchingAttributesProvide dependencies on serverLoad dependencies in markupDefine namespaceEvent bindingTrigger eventsSet URL pathPerform actionsMultiple behaviorsConfirm actionsOverlaysJavaScript APIMessages, infos, warnings and errorsOverlayModal dialogURL operationsXMLHTTPRequest conveniencePerform actionTrigger eventsSet URL pathAjax forms3rd party javascriptBrowsersContributorsChanges1.14 (2022-12-05)1.13 (2020-10-12)1.12 (2019-09-06)1.11 (2018-11-07)1.10 (2017-09-17)1.9 (2017-08-28)1.8.1 (2017-07-18)1.8 (2017-05-15)1.7.2 (2017-05-11)1.7.1 (2017-03-29)1.7 (2017-03-28)1.6.3 (2015-11-22)1.6.2 (2015-07-31)1.6.1 (2015-06-27)1.6.0 (2015-06-25)1.5.21.5.11.5.01.4.21.4.11.41.31.2.11.21.11.0.21.0.11.01.0b41.0b31.0b21.0b1LicenseDispatchingThe main paradigm is the use of anevent/listenermodel. It enables bdajax
tolistentoeventsand triggereventson 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.AttributesFollowing 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 areinnerandreplace.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:targetis mandatory whenajax:eventis defined, and
optional whenajax:actionis 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.selectoris optional and
defaults to#ajax-overlay.content_selectoris optional toselectorand 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 onformelements. Value gets ignored.ajax:path=”/some/path”Sets the browser URL path and pushes history state if supported by browser.
If value ishref, path gets taken fromhrefattribute. If value istargetpath gets taken from eventajaxtargetorajax:targetattribute. Otherwise value is taken as defined.Onpopstateevent bdajax executes the definitions written to state
object. The state object consists oftarget,actionandeventattributes. Execution behaves the way described atajax:actionandajax:event.Target gets taken fromajax:path-targetif set, otherwise falls back
to target from eventajaxtargetorajax:target. Ifajax:path-targetset with empty value, target gets taken frompath.Action gets taken fromajax:path-actionif set, otherwise falls back
toajax:action. Ifajax:path-actionset with empty value, action
execution on history state change can be suppressed even ifajax:actionis set.Event gets taken fromajax:path-eventif set, otherwise falls back
toajax:event. Ifajax:path-eventset with empty value, event
triggering on history state change can be suppressed even ifajax:eventis set.Overlay gets taken fromajax:path-overlayif set, otherwise falls back
toajax:overlay. Ifajax:path-overlayset with empty value, overlay
triggering on history state change can be suppressed even ifajax:overlayis set.Additional CSS class for overlay gets taken fromajax:path-overlay-cssif set, otherwise falls back toajax: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 parameterpopstate=1to 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 withajax:path.ajax:path-action=”name1:selector1:mode1”Can be used in conjunction withajax:path.ajax:path-event=”evt1:sel1”Can be used in conjunction withajax:path.ajax:path-overlay=”actionname:selector:content_selector”Can be used in conjunction withajax:path.ajax:path-overlay-css=”actionname:selector:content_selector”Can be used in conjunction withajax:path.NoteNo selectors containing spaces are supported!Provide dependencies on serverThis package already includes resource configuration forZopeandpyramid. This is done by ZCML. Include the following ZCML include statement
to your ZCML configuration:<includepackage="bdajax"/>The expectedajaxactionview is not provided. Its intended to be provided
by a custom implementation. See ‘Perform actions’ below.Load dependencies in markupLoad bdajax related Scripts:<!--
  include jquery 1.7+.
--><scriptsrc="http://code.jquery.com/jquery-1.7.js"></script><!--
  overlay could be included via jquerytools bundle or overlay.js directly
--><scriptsrc="http://fubar.com/++resource++bdajax/overlay.js"></script><!--
  bdajax related Javascript.
--><scriptsrc="http://fubar.com/++resource++bdajax/bdajax.js"></script><!--
  optionally add bootstrap 3 overlay hook if bootstrap is used.
--><scriptsrc="http://fubar.com/++resource++bdajax/bdajax_bs3.js"></script>Load bdajax related CSS:<!--
  bdajax related default styles.
--><linkhref="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.
--><linkhref="http://fubar.com/++resource++bdajax/bdajax_bs3.css"rel="stylesheet"type="text/css"media="screen"/>Make sure the content ofbdajax.ptorbdajax_bs3.ptis rendered in
Markup.Define namespaceIn order to keep your XHTML valid when using the XML namespace extension define
this namespace in the XHTML document:<htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:ajax="http://namespaces.conestack.org/ajax">...</html>Event bindingIndicate bdajax behavior on DOM element:<ahref="http://fubar.com"ajax:bind="keydown click">fubar</a>Binds this element to eventskeydownandclick.Trigger eventsBind event behavior to DOM element:<ahref="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 thecontextchangedevent to be triggered on all DOM elements
definingcontextsensitivcss class. The extra attributeajaxtargetgets
written to the event before it is triggered, containing definitions fromajax:target.Set URL pathSet path directly, triggers event on history state change:<ahref="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:<ahref="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:<ahref="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 actionsAn 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) namedajaxactionon server. Resource is called on target url with target query
parameters. Three additional arguments are passed:bdajax.actionname of the actionbdajax.selectorgiven selector must be added to response. Can beNONE, which means
that no markup is manipulated after action (useful i.e. in combination with
continuation actions and events).bdajax.modethe manipulation mode. EitherinnerorreplaceorNONE(see above).The resource is responsible to return the requested resource as a JSON
response in the format as follows:{mode:'inner',// the passed modeselector:'#someid',// the passed selectorpayload:'<div>...</div>',// the rendered actioncontinuation:[{}],// continuation definitions}Action continuationThecontinuationvalue defines an array of tasks which should
be performed after an ajax action returns. Available continuation
definitions are described below.actions:{'type':'action','target':'http://example.com','name':'actionname','mode':'inner','selector':'.foo'}events:{'type':'event','target':'http://example.com','name':'eventname','selector':'.foo','data':{}}path:{'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:{'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_selectordefines the selector of this container.Setting close totruecloses overlay atselector. In this caseactionand target are ignored.messages:{'type':'message','payload':'Text or <strong>Markup</strong>','flavor':'error','selector':null,}Eitherflavororselectormust 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 bothflavorandselectorare set,selectoris ignored.Be aware that you can provoke infinite loops with continuation actions and
events, use this feature sparingly.Trigger actions directlyBind an action which is triggered directly:<ahref="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 idfubarwill be replaced by the results of
actionrenderfubar. Request context and request params are taken fromajax:targetdefinition.Trigger actions as event listenerBind 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:<divid="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 behaviorsBind multiple behaviors to the same DOM element:<ahref="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 eventcontextchangedis triggered, actionrendersomethingis performed and URL path/some/pathget set.Confirm actionsBdajax can display a confirmation dialog before performing actions or trigger
events:<ahref="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>Ifajax:confirmis set, a modal dialog is displayed before dispatching is
performed.OverlaysAjax actions can be rendered to overlay directly by usingbdajax:overlay:<ahref="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 actionacionnameon context defined inajax:targetand 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:<ahref="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:<ahref="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 valueCLOSEatbdajax:overlay, optionally with colon seperated overlay selector:<ahref="http://fubar.com/baz?a=a"ajax:bind="click"ajax:overlay="CLOSE:#custom-overlay">fubar</a>JavaScript APIMessages, infos, warnings and errorsbdajaxdisplays application messages in a jQuery tools overlay.bdajax.messagedisplays a plain message.bdajax.infobdajax.warningandbdajax.errordecorates message with appropriate icon:bdajax.message('I am an application Message');OverlayLoad ajax action contents into an overlay:varoverlay_api=bdajax.overlay({action:'actionname',target:'http://foobar.org?param=value',selector:'#ajax-overlay',content_selector:'.overlay_ontent',css:'additional_overlay_css_class'});selectoris optional and defaults to#ajax-overlay.content_selectoris optional toselectorand defaults tooverlay_ontent.Default overlay and default overlay content selector can be overwritten atbdajax.default_overlay_selectorrespectivebdajax.default_overlay_content_selector.cssis 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 totarget,urlandparamscan be given as options to
the function. If both,targetandurl/paramsgiven,targetis used.Ajax overlays can be closed by passingcloseoption tobdajax.overlay.
When closing an overlay, overlay selector is considered as well from options
if given, otherwisebdajax.default_overlay_selectoris used.bdajax.overlay({close:true,selector:'#ajax-overlay'});bdajax.overlaysupports anon_closecallback in options.varon_close=function(){// do something}bdajax.overlay({action:'actionname',target:'http://foobar.org?param=value',on_close:on_close});Modal dialogRender 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.messageis mandatory
in options:varoptions={message:'I am an application Message'};bdajax.dialog(options,callback);URL operationsparseurlParse hyperlinks for base URL:bdajax.parseurl('http://fubar.org?param=value');This results in:'http://fubar.org'parsequeryParse hyperlinks for request parameters:bdajax.parsequery('http://fubar.org?param=value');This results in:{param:'value'}The raw query as string can be parsed by additionally passingtruetoparsequery:.. code-block:: jsbdajax.parsequery(’http://fubar.org?param=value’, true);This results in:.. code-block:: js‘?param=value’parsepathParse hyperlinks for path without base URL:.. code-block:: jsbdajax.parsepath(’http://fubar.org/some/path?param=value’);This results in:.. code-block:: js‘/some/path’The query can be included by additionally passingtruetoparsepath:.. code-block:: jsbdajax.parsepath(’http://fubar.org/some/path?param=value’, true);This results in:.. code-block:: js‘/some/path?param=value’parsetargetParse all information at once by callingparsetarget:bdajax.parsetarget('http://fubar.org/some/path?param=value');This result in:{url:'http://fubar.org/some/path',params:{param:'value'},path:'/some/path',query:'?param=value'}XMLHTTPRequest conveniencebdajax.requestfunction is convenience for XMLHTTPRequests. By default
it sends requests of typehtmland displays abdajax.errormessage if
request fails:bdajax.request({success:function(data){// do something with data.},url:'foo',params:{a:'a',b:'b'},type:'json',error:function(){bdajax.error('Request failed');}});Givenurlmight 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:successCallback if request is successful.urlRequest url as string.params (optional)Query parameters for request as Object.type (optional)xml,json,script, orhtml.error (optional)Callback if request fails.Success and error callback functions are wrapped inbdajax.requestto
consider ajax spinner handling automatically.Perform actionSometimes actions need to be performed inside JavaScript code.bdajax.actionprovides this:vartarget=bdajax.parsetarget('http://fubar.org?param=value');bdajax.action({name:'content',selector:'#content',mode:'inner',url:target.url,params:target.params});Options:nameAction nameselectorresult selectormodeaction modeurltarget urlparamsquery paramsTrigger eventsSometimes events need to be triggered manually. Since bdajax expects the
attributeajaxtargeton the received event a convenience is provided.Target might be a URL, then it gets parsed by the trigger function:varurl='http://fubar.org?param=value';bdajax.trigger('contextchanged','.contextsensitiv',url);Target might be object as returned frombdajax.parsetarget:varurl='http://fubar.org?param=value';vartarget=bdajax.parsetarget(url);bdajax.trigger('contextchanged','.contextsensitiv',target);Optionally, a data argument can be passed tobdajax.trigger, which gets set
at theajaxdataattribute of the event:varurl='http://fubar.org?param=value';vardata={opt:'val'};bdajax.trigger('contextchanged','.contextsensitiv',url,data);Set URL pathTo set URL path: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.pathalso accepts areplaceoption. If given browser history
gets reset.bdajax.path({path:'/some/path',target:'http://example.com/some/path',action:'layout:#layout:replace',replace:true});Ajax formsForms must haveajax:formattribute or CSS classajax(deprecated)
set in order to be handled by bdajax:<formajax: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:<divid="ajaxform"><!-- this is the rendering payload --><formajax:form="True"id="my_ajax_form"method="post"action="http://example.com/myformaction"enctype="multipart/form-data">...</form></div><scriptlanguage="javascript"type="text/javascript">// get response result containervarcontainer=document.getElementById('ajaxform');// extract DOM element to fiddle from result containervarchild=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>Ifdivwith idajaxformcontains markup, it gets rendered toselector(#my_ajax_form) withmode(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
torender_ajax_forminstead of callingbdajax.continuation. This is
necessary becauserender_ajax_formremoves 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 javascriptIntegration of custom JavaScript to the binding mechanism of bdajax is
done viabdajax.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 ascontext:(function($){varcustom_binder=function(context){$('mysel',context).on('click',function(){...});};$(document).ready(function(){bdajax.register(custom_binder,true);});})(jQuery);Migration from old style registered bindersPrior to bdajax 1.9, binder functions were registered by directly manipulatingbdajax.bindersobject. While this still works, it’s not supposed to be
used any more.When migrating tobdajax.register, be aware that the context ofthischanges 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 registeringmyob.binderas bdajax binder looks like
so:(function($){varmyob={binder:function(context){// ``this`` is expected to refer to ``myob``}}$(document).ready(function(){// old way of bindingbdajax.binders.myob_binder=myob.binder;// new way of binding if context of ``this`` should be keptbdajax.register(myob.binder.bind(myob));});})(jQuery);Browsersbdajax is tested with common modern browsers:FirefoxIEEdgeChomeSafariIf you find bugs or inconsistencies please report them on github.ContributorsRobert Niederreiter (Author)Attila OláhJohannes RaggamChanges1.14 (2022-12-05)Release wheel.
[rnix]1.13 (2020-10-12)bdajax.triggeraccepts optionaldataargument. 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)Introducebdajax.registerwhich should be used for registering
binder functions instead of manipulatingbdajax.bindersmanually.
[rnix, 2017-07-19]Catch and log exceptions thrown when executing bdajax binder callback
functions.
[rnix, 2017-07-19]UsejQuery.onandjQuery.offfor event binding instead ofbindandunbind(jQuery 1.7+ required).
[rnix, 2017-07-19]bdajax.parsetargetincludesqueryas string in returned object.
[rnix, 2017-07-19]bdajax.parsepathaccepts optionalinclude_queryboolean argument.
[rnix, 2017-07-19]bdajax.parsequeryaccepts optionalas_stringboolean argument.
[rnix, 2017-07-19]Consider query string inbdajax._handle_ajax_pathifajax:pathistarget.
[rnix, 2017-07-19]1.8.1 (2017-07-18)Consider query string inbdajax._handle_ajax_pathifajax:pathishref.
[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)Resetwindow.location.hashifbdajax.requesterror callback gets
unauthorized HTTP response code when redirecting to login page.
[rnix, 2017-05-11]1.7.1 (2017-03-29)Usebdajaxobject instead ofthisinbdajax._do_dispatching.
If called as callback bybdajax.dialog,thisis undefined.
[rnix, 2017-03-29]1.7 (2017-03-28)targetoption passed tobdajax.overlayis also accepted as JS object.
[rnix, 2017-03-28]Handle empty target inbdajax.parsetarget.
[rnix, 2017-03-27]Introducecloseoption inbdajax.overlay.
[rnix, 2017-03-27]Introduceon_closecallback option inbdajax.overlay.
[rnix, 2017-03-27]Add support for browser history navigation. Introduceajax:path-target,ajax:path-action,ajax:path-eventandajax:path-overlayattributes.
[rnix, 2017-03-22]bdajax.requestsupportsmethodin options, defaults toGET.
[rnix, 2016-10-11]1.6.3 (2015-11-22)Fixbdajax.parseurl.
[rnix, 2015-11-21]1.6.2 (2015-07-31)Check path starts with ‘/’ viaindexOffunction instead of
IE-unsupportedstartsWithfunction inbdajax.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 classbdajax-overlaysaroundbdajaxbrowser 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]Addajax: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.2Do not display error message if XHR request gets aborted (e.g. click
a url while request is pending)
[rnix]1.5.1Ajax forms are now marked viaajax:form. SettingajaxCSS class still
works, but is deprecated.
[rnix, 2013-02-04]1.5.0Refactorbdajax.triggerto create a separate event instace for each
element returned by selector.
[rnix, 2013-08-14]Include customizedoverlay.jsof 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.2bdaja.triggeralso accepts object as returned bybdajax.parsetargetas target argument.
[rnix, 2012-10-28]1.4.1Explicit renderabout:blankin hidden form response iframe src.
[rnix, 2012-08-06]1.4Nicer spinner image.
[rnix, 2012-05-21]Addoverlaycontinuation support.
[rnix, 2012-05-04]Extendajax:overlayto accept an optional overlay and content selector.
[rnix, 2012-05-04]Add AJAX form support.
[rnix, 2012-05-04]1.3All overlays not positional fixed for now.
[rnix, 2011-12-02]jQuery 1.6.4 and jQuery Tools 1.2.6.
[rnix, 2011-12-01]Addajax:overlayfunctionality.
[rnix, 2011-11-30]Callevent.stopPropagationinbdajax._dispatching_handler.
[rnix, 2011-11-23]1.2.1Use CSS ‘min-width’ instead of ‘width’ for messages.
[rnix, 2011-09-07]1.2Addbdajax.fiddlefunction.
[rnix, 2011-04-28]Delete overlay data from DOM element before reinitializing.
[rnix, 2011-04-21]Addajax:confirmfunctionality.
[rnix, 2011-04-20]Strip trailing ‘/’ inbdajax.parseurlto avoid double slashes.
[rnix, 2011-04-19]Add continuation messages.
[rnix, 2011-04-12]1.1Set 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 bybdajax.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]Usedrequest.statusandrequest.statusTextin 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]Removeajaxerrorsandajaxerrorfrom 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.2Rebind bdajax global if element is not found by selector after replace
action.
[rnix, 2011-01-14]1.0.1Add spinner handling.
[rnix, 2010-12-13]Return jquery context byjQuery.bdajax.
[rnix, 2010-12-13]1.0Remove call behaviour.
[rnix, 2010-12-04]Browser testing.
[rnix, 2010-12-04]1.0b4Addconfigure.zcmlcontaining all configuration usingzcml: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 inbdajax.request.
[rnix, 2010-11-09]Add modal dialog to bdajax.
[rnix, 2010-11-09]Markajax:callAPI deprecated. Will be removed for 1.0 final.
[rnix, 2010-11-09]1.0b3Add classallowMultiSubmitto 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.0b2Switch 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.0b1Make it work.
[rnix]LicenseCopyright (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.