-
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 pull request #461 from mitre-attack/reduce-artifact-size
Reduce artifact size
- Loading branch information
Showing
65 changed files
with
411 additions
and
359 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This code is for creating a collapsable sidebar for the mobile view | ||
let mediaQuery = window.matchMedia('(max-width: 47.9875rem)') | ||
|
||
function mobileSidenav(e) { | ||
if (e.matches) { | ||
$('#sidebar-collapse').collapse('hide') | ||
} | ||
else{ | ||
$('#sidebar-collapse').collapse('show') | ||
} | ||
} | ||
$(document).ready(function() { | ||
mobileSidenav(mediaQuery) | ||
}); | ||
|
||
mediaQuery.addEventListener('change', mobileSidenav) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
let mod_name = window.location.pathname.split("/") | ||
let mod_entry = "/" + mod_name[1] + "/sidebar-" + mod_name[1] | ||
if (mod_name.includes('contact')){ | ||
mod_entry = "/" + "resources/sidebar-resources" | ||
} | ||
$("#sidebars").load(mod_entry, function() { | ||
let navElements = document.querySelectorAll('.sidenav-head > a'); | ||
let winlocation; | ||
navElements.forEach(function(element){ | ||
if(!window.location.href.endsWith("/")){ | ||
winlocation = window.location.href + "/"; | ||
} | ||
else{ | ||
winlocation = window.location.href | ||
} | ||
if(!element.href.endsWith("/")){ | ||
element.href = element.href + "/"; | ||
} | ||
if(element.href == winlocation){ | ||
$(element.parentNode).addClass("active") | ||
}}); | ||
|
||
//This code is for creating a collapsable sidebar for the mobile view | ||
let mediaQuery = window.matchMedia('(max-width: 47.9875rem)') | ||
function mobileSidenav(e) { | ||
if (e.matches) { | ||
$('#sidebar-collapse').collapse('hide') | ||
} | ||
else{ | ||
$('#sidebar-collapse').collapse('show') | ||
} | ||
} | ||
$(document).ready(function() { | ||
mobileSidenav(mediaQuery) | ||
let sidenav = $(".sidenav-list"); | ||
let sidenav_active_elements = $(".sidenav .active"); | ||
if (sidenav_active_elements.length > 0) setTimeout(() => { //setTimeout gives bootstrap time to execute first | ||
sidenav[0].scrollTop = sidenav_active_elements[0].offsetTop - 60; | ||
}); | ||
}); | ||
|
||
mediaQuery.addEventListener('change', mobileSidenav) | ||
}); |
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 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
9 changes: 9 additions & 0 deletions
9
attack-theme/templates/general/sidebar-resources-template.html
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% set RESOURCE_NAV = ${RESOURCE_NAV} -%} | ||
{% import 'macros/navigation.html' as navigation %} | ||
<div id="v-tab" role="tablist" aria-orientation="vertical" class="h-100"> | ||
{{navigation.sidenav(RESOURCE_NAV, output_file)}} | ||
</div> | ||
{% block scripts %} | ||
<!--SCRIPTS--> | ||
<script src="/theme/scripts/navigation.js"></script> | ||
{% endblock %} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% import 'macros/navigation.html' as navigation %} | ||
{% set parsed = page.data | from_json %} | ||
<div id="v-tab" role="tablist" aria-orientation="vertical" class="h-100"> | ||
{{ navigation.sidenav(parsed.menu, output_file) }} | ||
</div> | ||
{% block scripts %} | ||
<!--SCRIPTS--> | ||
<script src="/theme/scripts/navigation.js"></script> | ||
{% endblock %} |
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 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 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
Oops, something went wrong.