equal
deleted
inserted
replaced
437 (the default). Take care arguments may vary according to the used |
437 (the default). Take care arguments may vary according to the used |
438 function. |
438 function. |
439 """ |
439 """ |
440 self.add_js('cubicweb.ajax.js') |
440 self.add_js('cubicweb.ajax.js') |
441 jsfunc = kwargs.pop('jsfunc', 'userCallbackThenReloadPage') |
441 jsfunc = kwargs.pop('jsfunc', 'userCallbackThenReloadPage') |
442 if 'msg' in kwargs: |
|
443 warn('[3.10] msg should be given as positional argument', |
|
444 DeprecationWarning, stacklevel=2) |
|
445 args = (kwargs.pop('msg'),) + args |
|
446 assert not kwargs, 'dunno what to do with remaining kwargs: %s' % kwargs |
442 assert not kwargs, 'dunno what to do with remaining kwargs: %s' % kwargs |
447 cbname = self.register_onetime_callback(cb, *cbargs) |
443 cbname = self.register_onetime_callback(cb, *cbargs) |
448 return "javascript: %s" % getattr(js, jsfunc)(cbname, *args) |
444 return "javascript: %s" % getattr(js, jsfunc)(cbname, *args) |
449 |
445 |
450 def register_onetime_callback(self, func, *args): |
446 def register_onetime_callback(self, func, *args): |