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