Skip to content

Commit

Permalink
Merge branch 'website-updates' into website-updates-attackcon
Browse files Browse the repository at this point in the history
  • Loading branch information
erinehall authored Dec 18, 2023
2 parents f06253c + aa1f92a commit 9a2d442
Show file tree
Hide file tree
Showing 19 changed files with 273 additions and 368 deletions.
Binary file not shown.
288 changes: 0 additions & 288 deletions attack-theme/static/fonts/glyphicons-halflings-regular.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed attack-theme/static/images/github-mark-white.png
Binary file not shown.
Binary file removed attack-theme/static/images/twitter.png
Binary file not shown.
109 changes: 104 additions & 5 deletions attack-theme/static/scripts/search-presentation.js
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`
});
10 changes: 9 additions & 1 deletion attack-theme/static/style/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,22 @@

.col {
.col-footer {
border-right: solid;
border-right: 1px solid;
}
}

.p-footer {
padding-left: 25px;
}

.btn-footer {
color: white;
}

.btn-footer:hover {
color: white;
}

// phones and small tablets view
@media screen and (max-width: 47.9875rem) {
.footer {
Expand Down
20 changes: 13 additions & 7 deletions attack-theme/static/style/_layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ a {
max-width: to-rem(1000);
}

.twitter-icon {
vertical-align: top;
width: to-rem(20);
height: to-rem(20);
}

.mitre-logo-wtrans {
width: to-rem(144);
height: to-rem(66);
Expand Down Expand Up @@ -192,7 +186,6 @@ a {
position: relative;
text-decoration: none;
overflow: hidden;
font-family: Arial;
background: #0156b3;
display: inline-flex;
padding-left: 5px;
Expand Down Expand Up @@ -568,8 +561,21 @@ pre {
border-color: border-color(body);
}

.card-filter {
width: 25vh;
float: right;
background: #dfdfdf;
}

@media screen and (max-width: 47.9875rem) {
.card-filter {
float: left;
}
}

.card-presentation {
margin-bottom: 30px;
width: 75%;
}

.card-attackcon {
Expand Down
2 changes: 1 addition & 1 deletion attack-theme/static/style/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
display: inline-block;
}

i.fa {
i.fa-solid {
visibility: hidden;
display: none;
@media screen and (max-width: 47.9875rem) {
Expand Down
14 changes: 0 additions & 14 deletions attack-theme/static/style/bootstrap-glyphicon.min.css

This file was deleted.

Loading

0 comments on commit 9a2d442

Please sign in to comment.