Revize 88f8fe07
Přidáno uživatelem Pavel Fidranský před asi 6 roky(ů)
sources/src/main/webapp/css/main.css | ||
---|---|---|
312 | 312 |
stroke-width: 1; |
313 | 313 |
} |
314 | 314 |
|
315 |
.viewport .vertex--found > rect {
|
|
315 |
.viewport .node--found > rect {
|
|
316 | 316 |
fill: orange; |
317 | 317 |
} |
318 | 318 |
|
sources/src/main/webapp/js/app.js | ||
---|---|---|
188 | 188 |
|
189 | 189 |
var found = 0; |
190 | 190 |
|
191 |
var vertexList = self.viewportComponent.getVertexList(); |
|
192 |
vertexList.forEach(function(vertex) { |
|
193 |
if (!vertex.name.toLowerCase().includes(term.toLowerCase())) { |
|
194 |
vertex.setFound(false); |
|
195 |
return; |
|
196 |
} |
|
191 |
var nodeList = self.viewportComponent.getNodeList(); |
|
192 |
nodeList.forEach(function(node) { |
|
193 |
if (!node.name.toLowerCase().includes(term.toLowerCase())) { |
|
194 |
node.setFound(false); |
|
197 | 195 |
|
198 |
found++; |
|
196 |
} else { |
|
197 |
node.setFound(true); |
|
199 | 198 |
|
200 |
vertex.setFound(true); |
|
199 |
found++; |
|
200 |
} |
|
201 | 201 |
}); |
202 | 202 |
|
203 | 203 |
document.getElementById('countOfFound').innerText = found; |
204 | 204 |
} |
205 | 205 |
|
206 | 206 |
function resetSearch(e) { |
207 |
var vertexList = self.viewportComponent.getVertexList();
|
|
208 |
vertexList.forEach(function(vertex) {
|
|
209 |
vertex.setFound(false);
|
|
207 |
var nodeList = self.viewportComponent.getNodeList();
|
|
208 |
nodeList.forEach(function(node) {
|
|
209 |
node.setFound(false);
|
|
210 | 210 |
}); |
211 | 211 |
|
212 | 212 |
document.getElementById('searchText').value = ''; |
sources/src/main/webapp/js/components/group.js | ||
---|---|---|
25 | 25 |
|
26 | 26 |
var pan = false; |
27 | 27 |
var excluded = false; |
28 |
var dimmed = false; |
|
28 |
|
|
29 | 29 |
var highlighted = false; |
30 | 30 |
var highlightedRequired = false; |
31 | 31 |
var highlightedProvided = false; |
32 | 32 |
var highlightedRequiredNeighbours = false; |
33 | 33 |
var highlightedProvidedNeighbours = false; |
34 |
var found = false; |
|
35 |
var dimmed = false; |
|
34 | 36 |
|
35 | 37 |
var vertexList = []; |
36 | 38 |
|
... | ... | |
215 | 217 |
}, this); |
216 | 218 |
}; |
217 | 219 |
|
220 |
/** |
|
221 |
* Sets the group as found. Highlighting is skipped when the group is excluded. |
|
222 |
* @param {boolean} newValue True to mark the group as found, otherwise false. |
|
223 |
*/ |
|
224 |
this.setFound = function(newValue) { |
|
225 |
found = newValue; |
|
226 |
|
|
227 |
if (excluded) return; |
|
228 |
|
|
229 |
if (newValue) { |
|
230 |
rootElement.classList.add('node--found'); |
|
231 |
} else { |
|
232 |
rootElement.classList.remove('node--found'); |
|
233 |
} |
|
234 |
}; |
|
235 |
|
|
218 | 236 |
/** |
219 | 237 |
* Toggles transparency of the group. |
220 | 238 |
* @param {boolean} newValue True to set the group semitransparent, false to display it normally. |
sources/src/main/webapp/js/components/vertex.js | ||
---|---|---|
26 | 26 |
|
27 | 27 |
var pan = false; |
28 | 28 |
var excluded = false; |
29 |
var found = false;
|
|
30 |
var dimmed = false; |
|
29 |
var iconsDisplayed = false;
|
|
30 |
|
|
31 | 31 |
var highlighted = false; |
32 | 32 |
var highlightedRequired = false; |
33 | 33 |
var highlightedProvided = false; |
34 | 34 |
var highlightedRequiredNeighbours = false; |
35 | 35 |
var highlightedProvidedNeighbours = false; |
36 |
var iconsDisplayed = false; |
|
36 |
var found = false; |
|
37 |
var dimmed = false; |
|
37 | 38 |
|
38 | 39 |
var inEdgeList = []; |
39 | 40 |
var outEdgeList = []; |
... | ... | |
195 | 196 |
if (excluded) return; |
196 | 197 |
|
197 | 198 |
if (newValue) { |
198 |
rootElement.classList.add('vertex--found');
|
|
199 |
rootElement.classList.add('node--found');
|
|
199 | 200 |
} else { |
200 |
rootElement.classList.remove('vertex--found');
|
|
201 |
rootElement.classList.remove('node--found');
|
|
201 | 202 |
} |
202 | 203 |
}; |
203 | 204 |
|
Také k dispozici: Unified diff
Group search