cubicweb/web/data/cubicweb.ajax.js
changeset 12503 b01dd0ef43aa
parent 11949 1372d9f80c70
equal deleted inserted replaced
12502:e651d5f24cb5 12503:b01dd0ef43aa
   471             $fragment.loadxhtml(url);
   471             $fragment.loadxhtml(url);
   472             continue;
   472             continue;
   473         }
   473         }
   474         // else: rebuild full url by fetching cubicweb:rql, cubicweb:vid, etc.
   474         // else: rebuild full url by fetching cubicweb:rql, cubicweb:vid, etc.
   475         var rql = $fragment.attr('cubicweb:rql');
   475         var rql = $fragment.attr('cubicweb:rql');
   476         var items = $fragment.attr('cubicweb:vid').split('&');
   476         var vid = $fragment.attr('cubicweb:vid');
   477         var vid = items[0];
       
   478         var extraparams = {};
   477         var extraparams = {};
   479         // case where vid='myvid&param1=val1&param2=val2': this is a deprecated abuse-case
       
   480         if (items.length > 1) {
       
   481             cw.log("[3.5] you're using extraargs in cubicweb:vid " +
       
   482                    "attribute, this is deprecated, consider using " +
       
   483                    "loadurl instead");
       
   484             for (var j = 1; j < items.length; j++) {
       
   485                 var keyvalue = items[j].split('=');
       
   486                 extraparams[keyvalue[0]] = keyvalue[1];
       
   487             }
       
   488         }
       
   489         var actrql = $fragment.attr('cubicweb:actualrql');
   478         var actrql = $fragment.attr('cubicweb:actualrql');
   490         if (actrql) {
   479         if (actrql) {
   491             extraparams['actualrql'] = actrql;
   480             extraparams['actualrql'] = actrql;
   492         }
   481         }
   493         var fbvid = $fragment.attr('cubicweb:fallbackvid');
   482         var fbvid = $fragment.attr('cubicweb:fallbackvid');
   677 
   666 
   678 function triggerLoad(divid) {
   667 function triggerLoad(divid) {
   679     jQuery('#lazy-' + divid).trigger('load_' + divid);
   668     jQuery('#lazy-' + divid).trigger('load_' + divid);
   680 }
   669 }
   681 
   670 
   682 /* DEPRECATED *****************************************************************/
       
   683 
       
   684 // still used in cwo and keyword cubes at least
       
   685 reloadComponent = cw.utils.deprecatedFunction(
       
   686     '[3.9] reloadComponent() is deprecated, use loadxhtml instead',
       
   687     function(compid, rql, registry, nodeid, extraargs) {
       
   688         registry = registry || 'components';
       
   689         rql = rql || '';
       
   690         nodeid = nodeid || (compid + 'Component');
       
   691         extraargs = extraargs || {};
       
   692         var node = cw.jqNode(nodeid);
       
   693         return node.loadxhtml(AJAX_BASE_URL, ajaxFuncArgs('component', null, compid,
       
   694                                                           rql, registry, extraargs));
       
   695     }
       
   696 );
       
   697 
       
   698 
       
   699 function remoteExec(fname /* ... */) {
   671 function remoteExec(fname /* ... */) {
   700     setProgressCursor();
   672     setProgressCursor();
   701     var props = {
   673     var props = {
   702         fname: fname,
   674         fname: fname,
   703         pageid: pageid,
   675         pageid: pageid,