devel.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * @file
  3. * Behaviors for Devel.
  4. */
  5. (function ($) {
  6. /**
  7. * Explain link in query log.
  8. *
  9. * @type {Drupal~behavior}
  10. */
  11. Drupal.behaviors.devel_explain = {
  12. attach: function(context, settings) {
  13. $('a.dev-explain').click(function () {
  14. qid = $(this).attr("qid");
  15. cell = $('#devel-query-' + qid);
  16. $('.dev-explain', cell).load(settings.basePath + '?q=devel/explain/' + settings.devel.request_id + '/' + qid).show();
  17. $('.dev-placeholders', cell).hide();
  18. $('.dev-arguments', cell).hide();
  19. return false;
  20. });
  21. }
  22. }
  23. /**
  24. * Arguments link in query log.
  25. *
  26. * @type {Drupal~behavior}
  27. */
  28. Drupal.behaviors.devel_arguments = {
  29. attach: function(context, settings) {
  30. $('a.dev-arguments').click(function () {
  31. qid = $(this).attr("qid");
  32. cell = $('#devel-query-' + qid);
  33. $('.dev-arguments', cell).load(settings.basePath + '?q=devel/arguments/' + settings.devel.request_id + '/' + qid).show();
  34. $('.dev-placeholders', cell).hide();
  35. $('.dev-explain', cell).hide();
  36. return false;
  37. });
  38. }
  39. }
  40. /**
  41. * Placeholders link in query log.
  42. *
  43. * @type {Drupal~behavior}
  44. */
  45. Drupal.behaviors.devel_placeholders = {
  46. attach: function(context, settings) {
  47. $('a.dev-placeholders').click(function () {
  48. qid = $(this).attr("qid");
  49. cell = $('#devel-query-' + qid);
  50. $('.dev-explain', cell).hide();
  51. $('.dev-arguments', cell).hide();
  52. $('.dev-placeholders', cell).show();
  53. return false;
  54. });
  55. }
  56. }
  57. })(jQuery);