-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.js
executable file
·49 lines (31 loc) · 1.03 KB
/
utils.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
(function($) {
var utils = {};
utils.log = function(data, clear) {
var output = $("#output"),
type = $.type(data),
str = data;
if(clear) {
output.text("");
}
if(type === "object" || type === "array") {
str = JSON.stringify(data, null, type === "object" ? 4 : 0);
}
output.text(output.text() + str + "\n");
console.log(data);
};
$.fn.hl = function() {
return this.each(function() {
var that = $(this),
bgc = that.css("background-color");
that.css({
"background-color": "#F8BBC6",
"margin-bottom": "2px"
});
if( (bgc !== "rgba(0, 0, 0, 0)" && bgc !== "transparent") || that.is("a:has(img)") ) {
that.css("outline", "2px rgba(255, 0, 0, 0.5) solid");
}
console.log(that);
});
};
window.utils = utils;
})(jQuery);