Skip to content

Commit 0b7ad66

Browse files
committed
Merge branch 'develop' into feat/infer-txt
2 parents 2bdeab4 + 5357786 commit 0b7ad66

File tree

5 files changed

+52
-45
lines changed

5 files changed

+52
-45
lines changed

compare50/_renderer/static/match.css

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ body, h1, h4, h5 {
88

99
body {
1010
font-family: Proxima-Nova, sans-serif;
11+
overflow: hidden;
1112
}
1213

1314
.wrapper {
14-
margin-left: 10em;
15+
margin-bottom: 3em;
1516
}
1617

1718
.view {
@@ -30,7 +31,7 @@ body {
3031

3132
.sub_name {
3233
margin-top: 0.33em;
33-
padding-right: 0px;
34+
padding-left: 10px;
3435
}
3536

3637
.row {
@@ -56,7 +57,7 @@ pre {
5657
border-top: 0;
5758
max-width:100%;
5859
width: 100%;
59-
height: 100%;
60+
height: 90vh;
6061
}
6162

6263
.right {
@@ -67,7 +68,7 @@ pre {
6768
border-top: 0;
6869
max-width:100%;
6970
width: 100%;
70-
height: 100%;
71+
height: 90vh;
7172
}
7273

7374
.fragment:before {
@@ -115,40 +116,40 @@ pre {
115116
}
116117

117118
.line {
118-
line-height: 1em;
119+
line-height: 1.15em;
119120
font-family: Consolas, monospace;
120121
}
121122

122-
#sidebar {
123-
padding-left: 5px;
124-
padding-right: 5px;
125-
margin-left: -10em;
126-
left: 10em;
127-
width: 10em;
123+
#botbar {
128124
position: fixed;
129-
height: 100%;
125+
bottom: 0;
126+
width: 100%;
127+
display: flex;
128+
justify-content: space-between;
129+
align-items: center;
130+
padding: 0.5em 1em;
130131
z-index: 1000;
131132
}
132133

133-
#next_prev_match {
134-
margin-top: .4em;
134+
.botbar-right {
135+
display: flex;
136+
align-items: center;
137+
gap: 0.5em;
135138
}
136139

137-
#passes {
138-
margin-top: 10%;
139-
margin-bottom: 10%;
140+
#next_prev_match {
141+
margin: 0;
140142
}
141143

142-
.matches_group {
143-
margin-bottom: .4em;
144+
#passes {
145+
margin: 0;
144146
}
145147

146148
.brand {
147149
text-align: center;
148150
vertical-align: middle;
149-
width: 100%;
150151
height: 2.20em;
151-
margin-top: 0.13em;
152+
margin: 0;
152153
}
153154

154155
a.index-link {
@@ -178,6 +179,12 @@ a.index-link:hover {
178179
left: 110%;
179180
}
180181

182+
.sub_name {
183+
display: inline-block;
184+
vertical-align: top;
185+
white-space: nowrap;
186+
}
187+
181188
.score_tooltip:hover .tooltiptext {
182189
visibility: visible;
183190
}

compare50/_renderer/static/match.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function init_group_button(groups, view_name) {
262262
document.addEventListener("keyup", (event) => {
263263
if (event.key === ' ' || event.key == "]") {
264264
event.preventDefault();
265-
go_to_adjacent_group(event, 1);
265+
go_to_adjacent_group(event, 1);
266266
}
267267
});
268268

@@ -425,12 +425,16 @@ function select_view(name) {
425425
select_view._cache[CURRENT_VIEW] = true;
426426
}
427427

428-
429428
function make_split(name) {
430429
return Split([`#${name}left`,`#${name}right`], {
431430
elementStyle: function (dimension, size, gutterSize) {
432-
window.dispatchEvent(new Event('resize'));
433-
return {'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)'}
431+
requestAnimationFrame(() => {
432+
document.getElementById(`${name}left_header`).style.width =
433+
document.getElementById(`${name}left`).offsetWidth + 'px';
434+
document.getElementById(`${name}right_header`).style.width =
435+
document.getElementById(`${name}right`).offsetWidth + 'px';
436+
});
437+
return { 'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)' };
434438
},
435439
gutterStyle: function (dimension, gutterSize) { return {'flex-basis': gutterSize + 'px'} },
436440
sizes: [50, 50],
@@ -440,7 +444,6 @@ function make_split(name) {
440444
});
441445
}
442446

443-
444447
document.addEventListener("DOMContentLoaded", event => {
445448
let id = parseInt(document.getElementsByClassName("id")[0].id);
446449

compare50/_renderer/templates/match.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
2-
31
<div id="{{name}}" class="container-fluid h-100 view {{name}}">
4-
<div class="row sticky-top bg-dark text-light" id="{{name}}sub_names">
5-
{% for sub in sub_a, sub_b %}
6-
<div class="col-sm-6 col-2 sub_name">
2+
<div class="row sticky-top bg-dark text-light">
3+
{% for sub, side in (sub_a, "left"), (sub_b, "right") %}
4+
<div class="sub_name" id="{{name}}{{side}}_header">
75
<h5 title="{{sub.path}}">{{sub.name}} ({{sub.percentage}}%)</h5>
86
</div>
97
{% endfor %}

compare50/_renderer/templates/match_page.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@
1111
</head>
1212
<body>
1313
<div class="wrapper" id="page">
14-
<nav class="bg-dark text-center" id="sidebar">
14+
<nav class="bg-dark text-light" id="botbar">
1515
<div class="brand text-light">
1616
<h4><a href="index.html" class="index-link"><b>compare50</b></a></h4>
1717
</div>
18-
<br/>
19-
<div class="text-light id" id="{{id}}">{{id}} / {{max_id}}</div>
20-
<div class="btn-group" role="group" aria-label="NextPrev" id="next_prev_match">
21-
<button type="button" class="btn btn-outline-light prev_match" id="prev_match" {{'disabled' if id <= 1 else ''}}><<</button>
22-
<button type="button" class="btn btn-outline-light next_match" id="next_match" {{'disabled' if id >= max_id else ''}}>>></button>
23-
</div>
24-
<div class="btn-group-vertical" role="group" aria-label="Views" id="passes">
25-
{% for pass_ in passes %}
26-
<button type="button" class="btn btn-outline-light view_selector" id="{{pass_.__name__}}selector" title="{{pass_.__doc__}}">{{pass_.__name__}}</button>
27-
{% endfor %}
28-
</div>
29-
<div id="group_nav">
18+
<div class="botbar-right">
19+
<div class="text-light id" id="{{id}}">{{id}} / {{max_id}}</div>
20+
<div class="btn-group" role="group" aria-label="NextPrev" id="next_prev_match">
21+
<button type="button" class="btn btn-outline-light prev_match" id="prev_match" {{'disabled' if id <= 1 else ''}}><<</button>
22+
<button type="button" class="btn btn-outline-light next_match" id="next_match" {{'disabled' if id >= max_id else ''}}>>></button>
23+
</div>
24+
<div class="btn-group" role="group" aria-label="Views" id="passes">
25+
{% for pass_ in passes %}
26+
<button type="button" class="btn btn-outline-light view_selector" id="{{pass_.__name__}}selector" title="{{pass_.__doc__}}">{{pass_.__name__}}</button>
27+
{% endfor %}
28+
</div>
3029
<div class="btn-group" role="group" aria-label="NextPrevGroup">
3130
<button type="button" class="btn btn-outline-light matches_group" id="previous_group">&lt;</button>
3231
<button type="button" class="btn btn-outline-light matches_group" id="next_group">&gt;</button>

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
license="GPLv3",
1313
description="This is compare50, with which you can compare files for similarities.",
1414
long_description="This is compare50, with which you can compare files for similarities.",
15-
install_requires=["attrs>=18,<21", "intervaltree>=3,<4", "lib50>=2,<4", "numpy>=1.15,<2", "pygments>=2.2,<3", "jinja2>=3,<4", "termcolor>=1.1.0,<2", "tqdm>=4.32,<5", "importlib", "names"],
15+
install_requires=["attrs>=18,<21", "intervaltree>=3,<4", "lib50>=2,<4", "numpy>=2,<3", "pygments>=2.2,<3", "jinja2>=3,<4", "termcolor>=1.1.0,<2", "tqdm>=4.32,<5", "names"],
1616
extras_require = {
1717
"develop": ["sphinx", "sphinx_rtd_theme", "sphinx-autobuild", "line_profiler"]
1818
},

0 commit comments

Comments
 (0)