p5-plack-debugger icon indicating copy to clipboard operation
p5-plack-debugger copied to clipboard

Build a console util object

Open stevan opened this issue 10 years ago • 0 comments

The panel data is actually already stored in JSON in the browser process, if you do this in the console you will find it.

$.grep(plack_debugger.resource._request.data.results, function (x) { return x.title == "Some Title" })[0].result

You can also do the AJAX fetch yourself and process the results.

$.ajax({ global: false, dataType: 'json', url: (Plack.Debugger.$CONFIG.root_url + '/' + Plack.Debugger.$CONFIG.current_request_uid), success: function (d) { console.log($.grep(d.data.results, function (x) { return x.title == "Some Title" })[0].result) } });

Ideally this would be better done with something like:

plack_debugger.console_util.get_results_for_panel("Some Title");

and

plack_debugger.console_util.fetch_results_for_panel("Some Title");

Or some kind of variant of this, you get the idea.

stevan avatar Oct 10 '14 11:10 stevan