@@ -240,8 +240,7 @@ according to the public API described below. Unless noted otherwise, all
240
240
methods are optional.
241
241
242
242
Panels can ship their own templates, static files and views. They're no public
243
- CSS or JavaScript API at this time, but they can assume jQuery is available in
244
- ``djdt.jQuery ``.
243
+ CSS API at this time.
245
244
246
245
.. autoclass :: debug_toolbar.panels.Panel(*args, **kwargs)
247
246
@@ -272,3 +271,49 @@ CSS or JavaScript API at this time, but they can assume jQuery is available in
272
271
.. automethod :: debug_toolbar.panels.Panel.process_view
273
272
274
273
.. automethod :: debug_toolbar.panels.Panel.process_response
274
+
275
+ JavaScript API
276
+ ~~~~~~~~~~~~~~
277
+
278
+ Panel templates should include any JavaScript files they need. There are a few
279
+ common methods available, as well as the toolbar's version of jQuery.
280
+
281
+
282
+ .. js :function :: djdt .close
283
+
284
+ Triggers the event to close any active panels.
285
+
286
+ .. js :function :: djdt .cookie .get
287
+
288
+ This is a helper function to fetch values stored in the cookies.
289
+
290
+ :param string key: The key for the value to be fetched.
291
+
292
+ .. js :function :: djdt .cookie .set
293
+
294
+ This is the toolbar's version of jQuery.
295
+
296
+ :param string key: The key to be used.
297
+
298
+ :param string value: The value to be set.
299
+
300
+ :param Object options: The key for the value to be fetched. It should contain
301
+ the properties ``expires `` and ``path ``.
302
+
303
+ .. js :function :: djdt .hide_toolbar
304
+
305
+ Closes any panels and hides the toolbar.
306
+
307
+ :param boolean setCookie: Whether or not it should set the display cookie for
308
+ the toolbar.
309
+
310
+ .. js :function :: djdt .jQuery
311
+
312
+ This is the toolbar's version of jQuery.
313
+
314
+ .. js :function :: djdt .show_toolbar
315
+
316
+ Shows the toolbar.
317
+
318
+ :param boolean animate: Whether or not it should use an animation when calling
319
+ ``show `` on the toolbar.
0 commit comments