--- a/web/data/cubicweb.ajax.js Tue Feb 08 18:00:23 2011 +0100
+++ b/web/data/cubicweb.ajax.js Tue Feb 08 18:00:42 2011 +0100
@@ -608,6 +608,29 @@
$('#'+domid).loadxhtml('json', params, null, 'swap');
}
+/* ajax tabs ******************************************************************/
+
+function setTab(tabname, cookiename) {
+ // set appropriate cookie
+ loadRemote('json', ajaxFuncArgs('set_cookie', null, cookiename, tabname));
+ // trigger show + tabname event
+ triggerLoad(tabname);
+}
+
+function loadNow(eltsel, holesel, reloadable) {
+ var lazydiv = jQuery(eltsel);
+ var hole = lazydiv.children(holesel);
+ if ((hole.length == 0) && ! reloadable) {
+ /* the hole is already filed */
+ return;
+ }
+ lazydiv.loadxhtml(lazydiv.attr('cubicweb:loadurl'), {'pageid': pageid});
+}
+
+function triggerLoad(divid) {
+ jQuery('#lazy-' + divid).trigger('load_' + divid);
+}
+
/* DEPRECATED *****************************************************************/
preprocessAjaxLoad = cw.utils.deprecatedFunction(