-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.html
110 lines (103 loc) · 3.52 KB
/
report.html
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<html>
<head>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.1.0.min.js"></script>
<style>
.comparing-item {
position: relative;
border: 1px solid lightgray;
padding: 10px;
margin-top: 10px;
}
.comparing-item .image {
position: relative;
display: block;
}
.tabs {
}
.tabs::after {
display: table;
content: "";
clear: both;
height: 1px;
background: gray;
width: 100%;
top: -1px;
position: relative;
z-index: -1;
}
.tabs .tab {
background: #eeeeee;
border: 1px solid lightgray;
border-bottom: 1px solid gray;
padding: 10px 20px;
float: left;
cursor: pointer;
}
.tabs .button {
background: #eeeeee;
border: 1px solid lightgray;
padding: 5px 15px;
float: right;
margin-left: 5px;
}
.tabs .tab.active {
background: lightgray;
border: 1px solid gray;
border-bottom: 1px solid #eeeeee;
}
.screen-name {
color: green;
}
.screen-name.failed {
color: red;
}
.colapsible {
display: none;
cursor: pointer;
}
.colapsible.visible {
display: block;
}
</style>
</head>
<body>
<h1>KitchenSink Form</h1>
<script>
$(function(){
function setImage(trigger, state) {
var image = $(trigger).parents(".comparing-item").find(".image");
var display = $(trigger).parents(".comparing-item").find(".display");
display.text(image.data(state));
image.attr("src", image.data(state));
}
function setCurrent(element){
$(element).siblings().removeClass("active");
$(element).addClass("active");
}
$.each([ "current", "etalon", "diff" ], function(_, tabName){
$(".change-" + tabName).click(function(){
setCurrent(this);
setImage(this, tabName);
});
});
$.each([ "etalon", "mask" ], function(_, buttonName){
$(".button." + buttonName).click(function(){
var action = buttonName;
var etalon = $(this).data("etalon");
var current = $(this).data("current");
$.post({
url: "http://localhost:9000/" + action + "/",
data: {
etalonPath: etalon,
artefactPath: current
}
});
});
});
$(".screen-name").click(function(){
$(this).next().toggleClass("visible");
});
});
</script>
</body>
</html>