-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugger.js
More file actions
76 lines (64 loc) · 1.76 KB
/
debugger.js
File metadata and controls
76 lines (64 loc) · 1.76 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
define(
[],
function() {
'use strict';
var debuggerTemplate;
debuggerTemplate = {
attachTo : function(debugAction) {
var element = debugAction.element,
posTarget = $(!element || (element === document) ? document.body : element).get(0),
pos = posTarget.getBoundingClientRect();
this.$template.find('.step').attr('title', debugAction.toString());
this.$highlight.css({
left: pos.left,
top: pos.top,
width: pos.width,
height: pos.height
}).show();
this.$highlight.find('span').css({
backgroundColor: 'navy',
color: 'white',
padding: 5,
fontSize: '15px'
}).text(debugAction.component);
this.$template.css({
left: document.documentElement.clientWidth/2 - this.$template.width()/2,
bottom: 0
}).show();
},
hide: function() {
this.$template.hide();
this.$highlight.hide();
},
onClick: null,
$template : $('<div id="flightMonitor-debugger"><b class="step">Step</b> | <b class="continue">Continue</b></div>')
.css({
zIndex: 99999,
cursor: 'pointer',
position: 'fixed',
padding: '10px',
borderRadius: '4px',
backgroundColor: 'navy',
color: 'white',
display: 'none'
})
.appendTo(document.body)
.click(function(ev) {
var method = ev.target.className;
method && typeof $.flightMonitor[method] === 'function' && $.flightMonitor[method]();
}),
$highlight : $('<div id="flightMonitor-highlight"><span></span></div>')
.css({
zIndex: 99998,
position: 'fixed',
border: '1px dashed red',
display: 'none',
padding: '0',
margin: '0',
fontSize: '15px'
})
.appendTo(document.body)
};
return debuggerTemplate;
}
);