@@ -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,42 @@ 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
+ .. js :function :: djdt .close
282
+
283
+ Triggers the event to close any active panels.
284
+
285
+ .. js :function :: djdt .cookie .get
286
+
287
+ This is a helper function to fetch values stored in the cookies.
288
+
289
+ :param string key: The key for the value to be fetched.
290
+
291
+ .. js :function :: djdt .cookie .set
292
+
293
+ This is a helper function to set a value stored in the cookies.
294
+
295
+ :param string key: The key to be used.
296
+
297
+ :param string value: The value to be set.
298
+
299
+ :param Object options: The options for the value to be set. It should contain
300
+ the properties ``expires `` and ``path ``.
301
+
302
+ .. js :function :: djdt .hide_toolbar
303
+
304
+ Closes any panels and hides the toolbar.
305
+
306
+ .. js :function :: djdt .jQuery
307
+
308
+ This is the toolbar's version of jQuery.
309
+
310
+ .. js :function :: djdt .show_toolbar
311
+
312
+ Shows the toolbar.
0 commit comments