-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'website-updates' into website-updates-attackcon
- Loading branch information
Showing
19 changed files
with
273 additions
and
368 deletions.
There are no files selected for viewing
Binary file not shown.
288 changes: 0 additions & 288 deletions
288
attack-theme/static/fonts/glyphicons-halflings-regular.svg
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,123 @@ | ||
function searchPresentation() { | ||
let count = 0; | ||
let input, input_uppercase, cards, i, card_value; | ||
let input, input_uppercase, cards, i, card_value, displayed; | ||
displayed = true; | ||
input = document.getElementById("searchPresentation"); | ||
input_uppercase = input.value.toUpperCase(); | ||
cards = $(".card"); | ||
for (i = 0; i < cards.length; i++) { | ||
cards = $(".card-presentation"); | ||
if($("#filterMenu").length > 0){ | ||
displayed = false; | ||
filterMenu(); | ||
} | ||
for (i = 0; i < cards.length; i++) { | ||
card_value = cards[i].innerText; | ||
if (card_value.toUpperCase().indexOf(input_uppercase) > -1) { | ||
if((cards[i].style.display != "none" && !displayed) || displayed){ | ||
cards[i].style.display = ""; | ||
count = count + 1; | ||
} | ||
} else { | ||
cards[i].style.display = "none"; | ||
} | ||
} | ||
let filter_count = document.querySelector(".presentation-count") | ||
filter_count.innerHTML = `${count} of ${cards.length} Presentations` | ||
} | ||
|
||
function filter_all(selected) { | ||
let count = 0; | ||
let cards, i, card_value, dates; | ||
cards = $(".card-presentation"); | ||
dates = $(".date"); | ||
for (i = 0; i < cards.length; i++) { | ||
card_value = cards[i].innerText; | ||
let row_count = 0 | ||
for(let j = 0; j<selected.length; j++){ | ||
let filter_value = selected[j]; | ||
if (card_value.indexOf(filter_value) > -1 && cards[i].style.display != "none") { | ||
if(selected[selected.length - 1].includes("year")){ | ||
let filter_date = filter_date_helper(dates[i]) | ||
if(filter_date){ | ||
row_count = row_count + 1; | ||
} | ||
} | ||
else{ | ||
row_count = row_count + 1; | ||
} | ||
} | ||
} | ||
if(row_count > 0){ | ||
cards[i].style.display = ""; | ||
count = count + 1; | ||
} else { | ||
} | ||
else { | ||
cards[i].style.display = "none"; | ||
} | ||
} | ||
let filter_count = document.querySelector(".presentation-count") | ||
filter_count.innerHTML = `${count} of ${cards.length} Presentations` | ||
} | ||
|
||
function filter_date_helper(input_date) { | ||
let currentDate = new Date(); | ||
let year, date_year; | ||
let filter_date = false; | ||
let date_list = document.getElementsByName('dates'); | ||
year = currentDate.getFullYear(); | ||
date_year = input_date.innerText.split(" ")[1]; | ||
for (let j = 0; j < date_list.length; j++) { | ||
if (date_list[j].checked){ | ||
if(date_list[j].id.includes("Current")){ | ||
if(year-date_year == 0){ | ||
filter_date = true; | ||
} | ||
} | ||
else if(date_list[j].id.includes("3")){ | ||
if(year-date_year == 3){ | ||
filter_date = true; | ||
} | ||
} | ||
else{ | ||
filter_date = true; | ||
} | ||
} | ||
} | ||
return filter_date; | ||
} | ||
|
||
function filterMenu() { | ||
let selected = []; | ||
if($("#filterMenu input:checked").length <= 0){ | ||
$('#filterMenu input:checkbox').each(function() { | ||
if($(this).attr('id').includes("-")){ | ||
selected.push($(this).attr('id').replaceAll("-"," ")); | ||
} | ||
else{ | ||
selected.push($(this).attr('id')) | ||
} | ||
$(this).prop("checked", "true"); | ||
}); | ||
} | ||
else{ | ||
$('#filterMenu input:checked').each(function() { | ||
if($(this).attr('id').includes("-")){ | ||
selected.push($(this).attr('id').replaceAll("-"," ")); | ||
} | ||
else{ | ||
selected.push($(this).attr('id')) | ||
} | ||
}); | ||
} | ||
let cards = $(".card-presentation"); | ||
for (let i = 0; i < cards.length; i++) { | ||
cards[i].style.display = ""; | ||
} | ||
let selected_reversed = selected.toReversed() | ||
filter_all(selected_reversed); | ||
} | ||
|
||
$(document).ready(function() { | ||
cards = $(".card"); | ||
let cards = $(".card-presentation"); | ||
let filter_count = document.querySelector(".presentation-count") | ||
filter_count.innerHTML = `${cards.length} of ${cards.length} Presentations` | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.