equal
deleted
inserted
replaced
235 * ['c', 'd'] |
235 * ['c', 'd'] |
236 * >>> sliceList(['a', 'b', 'c', 'd', 'e', 'f'], -3) |
236 * >>> sliceList(['a', 'b', 'c', 'd', 'e', 'f'], -3) |
237 * ['d', 'e', 'f'] |
237 * ['d', 'e', 'f'] |
238 */ |
238 */ |
239 function sliceList(lst, start, stop, step) { |
239 function sliceList(lst, start, stop, step) { |
240 var start = start || 0; |
240 start = start || 0; |
241 var stop = stop || lst.length; |
241 stop = stop || lst.length; |
242 var step = step || 1; |
242 step = step || 1; |
243 if (stop < 0) { |
243 if (stop < 0) { |
244 stop = max(lst.length+stop, 0); |
244 stop = max(lst.length+stop, 0); |
245 } |
245 } |
246 if (start < 0) { |
246 if (start < 0) { |
247 start = min(lst.length+start, lst.length); |
247 start = min(lst.length+start, lst.length); |
254 } |
254 } |
255 |
255 |
256 /* returns a partial func that calls a mehod on its argument |
256 /* returns a partial func that calls a mehod on its argument |
257 * py-equiv: return lambda obj: getattr(obj, methname)(*args) |
257 * py-equiv: return lambda obj: getattr(obj, methname)(*args) |
258 */ |
258 */ |
|
259 // XXX looks completely unused (candidate for removal) |
259 function methodcaller(methname) { |
260 function methodcaller(methname) { |
260 var args = sliceList(arguments, 1); |
261 var args = sliceList(arguments, 1); |
261 return function(obj) { |
262 return function(obj) { |
262 return obj[methname].apply(obj, args); |
263 return obj[methname].apply(obj, args); |
263 }; |
264 }; |
396 |
397 |
397 jQuery(document).ready(function() { |
398 jQuery(document).ready(function() { |
398 jQuery(CubicWeb).trigger('server-response', [false, document]); |
399 jQuery(CubicWeb).trigger('server-response', [false, document]); |
399 }); |
400 }); |
400 |
401 |
|
402 // XXX as of 2010-04-07, no known cube uses this |
401 jQuery(CubicWeb).bind('ajax-loaded', function() { |
403 jQuery(CubicWeb).bind('ajax-loaded', function() { |
402 log('[3.7] "ajax-loaded" event is deprecated, use "server-response" instead'); |
404 log('[3.7] "ajax-loaded" event is deprecated, use "server-response" instead'); |
403 jQuery(CubicWeb).trigger('server-response', [false, document]); |
405 jQuery(CubicWeb).trigger('server-response', [false, document]); |
404 }); |
406 }); |
405 |
407 |