2016-10-30 01:02:14 +02:00
|
|
|
/* ==========================================================================
|
|
|
|
jQuery plugin settings and other scripts
|
|
|
|
========================================================================== */
|
|
|
|
|
2021-10-02 11:28:46 +02:00
|
|
|
$(document).ready(function() {
|
2021-10-03 02:57:33 +02:00
|
|
|
|
|
|
|
// external links should open in a new tab
|
|
|
|
var host = location.hostname
|
|
|
|
var allLinks = document.querySelectorAll('a')
|
|
|
|
for (var i = 0; i < allLinks.length; ++i) {
|
|
|
|
if (allLinks[i].hostname !== host && allLinks[i].hostname !== '') {
|
|
|
|
allLinks[i].target = '_blank'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-02 11:28:46 +02:00
|
|
|
// FitVids init
|
|
|
|
$("#main").fitVids();
|
2016-10-30 01:02:14 +02:00
|
|
|
|
2021-10-02 11:28:46 +02:00
|
|
|
// Sticky sidebar
|
|
|
|
var stickySideBar = function() {
|
|
|
|
var show =
|
|
|
|
$(".author__urls-wrapper button").length === 0
|
|
|
|
? $(window).width() > 1024 // width should match $large Sass variable
|
|
|
|
: !$(".author__urls-wrapper button").is(":visible");
|
|
|
|
if (show) {
|
|
|
|
// fix
|
|
|
|
$(".sidebar").addClass("sticky");
|
|
|
|
} else {
|
|
|
|
// unfix
|
|
|
|
$(".sidebar").removeClass("sticky");
|
2018-06-22 04:58:26 +02:00
|
|
|
}
|
2021-10-02 11:28:46 +02:00
|
|
|
};
|
2016-10-30 01:02:14 +02:00
|
|
|
|
2021-10-02 11:28:46 +02:00
|
|
|
stickySideBar();
|
2016-10-30 01:02:14 +02:00
|
|
|
|
|
|
|
$(window).resize(function() {
|
2021-10-02 11:28:46 +02:00
|
|
|
stickySideBar();
|
2016-10-30 01:02:14 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
// Follow menu drop down
|
2017-09-28 23:42:38 +02:00
|
|
|
$(".author__urls-wrapper button").on("click", function() {
|
|
|
|
$(".author__urls").toggleClass("is--visible");
|
|
|
|
$(".author__urls-wrapper button").toggleClass("open");
|
2016-10-30 01:02:14 +02:00
|
|
|
});
|
|
|
|
|
2021-10-02 11:28:46 +02:00
|
|
|
// Close search screen with Esc key
|
|
|
|
$(document).keyup(function(e) {
|
|
|
|
if (e.keyCode === 27) {
|
|
|
|
if ($(".initial-content").hasClass("is--hidden")) {
|
|
|
|
$(".search-content").toggleClass("is--visible");
|
|
|
|
$(".initial-content").toggleClass("is--hidden");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Search toggle
|
|
|
|
$(".search__toggle").on("click", function() {
|
|
|
|
$(".search-content").toggleClass("is--visible");
|
|
|
|
$(".initial-content").toggleClass("is--hidden");
|
|
|
|
// set focus on input
|
|
|
|
setTimeout(function() {
|
|
|
|
$(".search-content input").focus();
|
|
|
|
}, 400);
|
|
|
|
});
|
|
|
|
|
|
|
|
// Smooth scrolling
|
|
|
|
var scroll = new SmoothScroll('a[href*="#"]', {
|
|
|
|
offset: 20,
|
|
|
|
speed: 400,
|
|
|
|
speedAsDuration: true,
|
|
|
|
durationMax: 500
|
|
|
|
});
|
|
|
|
|
|
|
|
// Gumshoe scroll spy init
|
|
|
|
if($("nav.toc").length > 0) {
|
|
|
|
var spy = new Gumshoe("nav.toc a", {
|
|
|
|
// Active classes
|
|
|
|
navClass: "active", // applied to the nav list item
|
|
|
|
contentClass: "active", // applied to the content
|
|
|
|
|
|
|
|
// Nested navigation
|
|
|
|
nested: false, // if true, add classes to parents of active link
|
|
|
|
nestedClass: "active", // applied to the parent items
|
|
|
|
|
|
|
|
// Offset & reflow
|
|
|
|
offset: 20, // how far from the top of the page to activate a content area
|
|
|
|
reflow: true, // if true, listen for reflows
|
|
|
|
|
|
|
|
// Event support
|
|
|
|
events: true // if true, emit custom events
|
|
|
|
});
|
|
|
|
}
|
2016-10-30 01:02:14 +02:00
|
|
|
|
|
|
|
// add lightbox class to all image links
|
2021-10-02 11:28:46 +02:00
|
|
|
$(
|
|
|
|
"a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif'],a[href$='.webp']"
|
|
|
|
).addClass("image-popup");
|
2016-10-30 01:02:14 +02:00
|
|
|
|
|
|
|
// Magnific-Popup options
|
|
|
|
$(".image-popup").magnificPopup({
|
|
|
|
// disableOn: function() {
|
|
|
|
// if( $(window).width() < 500 ) {
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// return true;
|
|
|
|
// },
|
2021-10-02 11:28:46 +02:00
|
|
|
type: "image",
|
|
|
|
tLoading: "Loading image #%curr%...",
|
2016-10-30 01:02:14 +02:00
|
|
|
gallery: {
|
|
|
|
enabled: true,
|
|
|
|
navigateByImgClick: true,
|
2021-10-02 11:28:46 +02:00
|
|
|
preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
|
2016-10-30 01:02:14 +02:00
|
|
|
},
|
|
|
|
image: {
|
2021-10-02 11:28:46 +02:00
|
|
|
tError: '<a href="%url%">Image #%curr%</a> could not be loaded.'
|
2016-10-30 01:02:14 +02:00
|
|
|
},
|
|
|
|
removalDelay: 500, // Delay in milliseconds before popup is removed
|
|
|
|
// Class that is added to body when popup is open.
|
|
|
|
// make it unique to apply your CSS animations just to this exact popup
|
2021-10-02 11:28:46 +02:00
|
|
|
mainClass: "mfp-zoom-in",
|
2016-10-30 01:02:14 +02:00
|
|
|
callbacks: {
|
|
|
|
beforeOpen: function() {
|
|
|
|
// just a hack that adds mfp-anim class to markup
|
2021-10-02 11:28:46 +02:00
|
|
|
this.st.image.markup = this.st.image.markup.replace(
|
|
|
|
"mfp-figure",
|
|
|
|
"mfp-figure mfp-with-anim"
|
|
|
|
);
|
2016-10-30 01:02:14 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
closeOnContentClick: true,
|
|
|
|
midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
|
|
|
|
});
|
|
|
|
|
2021-10-02 11:28:46 +02:00
|
|
|
// Add anchors for headings
|
|
|
|
$('.page__content').find('h1, h2, h3, h4, h5, h6').each(function() {
|
|
|
|
var id = $(this).attr('id');
|
|
|
|
if (id) {
|
|
|
|
var anchor = document.createElement("a");
|
|
|
|
anchor.className = 'header-link';
|
|
|
|
anchor.href = '#' + id;
|
|
|
|
anchor.innerHTML = '<span class=\"sr-only\">Permalink</span><i class=\"fas fa-link\"></i>';
|
|
|
|
anchor.title = "Permalink";
|
|
|
|
$(this).append(anchor);
|
2017-09-28 23:42:38 +02:00
|
|
|
}
|
2021-10-02 11:28:46 +02:00
|
|
|
});
|
2021-10-03 02:57:33 +02:00
|
|
|
|
2023-09-30 18:45:32 +02:00
|
|
|
/* hacks-guide change start: add configs for navigation bar and language selector */
|
2021-10-03 02:57:33 +02:00
|
|
|
if((window.location.href.indexOf("/he_IL/") > -1) || (window.location.href.indexOf("/ar_SA/") > -1)) {
|
|
|
|
$("body").css("direction", "rtl");
|
|
|
|
|
|
|
|
$("nav.greedy-nav .nav-selector").css("left", "2.5rem");
|
|
|
|
$("nav.greedy-nav .lang-selector").css("left", ".2rem");
|
|
|
|
|
|
|
|
$("nav.greedy-nav .links-menu").css("right", "auto");
|
|
|
|
$("nav.greedy-nav .lang-menu").css("right", "auto");
|
|
|
|
|
|
|
|
$("nav.greedy-nav .links-menu").css("left", "2.5rem");
|
|
|
|
$("nav.greedy-nav .lang-menu").css("left", ".2rem");
|
|
|
|
|
|
|
|
$("nav.greedy-nav .visible-links").css("padding-right", "0");
|
|
|
|
$("nav.greedy-nav .visible-links").css("padding-left", "2rem");
|
|
|
|
|
|
|
|
$("nav.greedy-nav .visible-links li:first-child a").css("margin-right", "0");
|
|
|
|
$("nav.greedy-nav .visible-links li:first-child a").css("margin-left", "1rem");
|
|
|
|
|
|
|
|
$("nav.greedy-nav .visible-links li:first-child").css("padding-right", "0");
|
|
|
|
$("nav.greedy-nav .visible-links li:first-child").css("padding-left", "2em");
|
|
|
|
|
|
|
|
$("nav.greedy-nav .visible-links li:last-child a").css("margin-right", "1rem");
|
|
|
|
$("nav.greedy-nav .visible-links li:last-child a").css("margin-left", "0");
|
|
|
|
|
|
|
|
// for some reason js cannot directly modify :before and :after pseudo-elements' css
|
|
|
|
$('nav.greedy-nav').prepend('<style>.hidden-links:before{right:inherit !important;}</style>');
|
|
|
|
$('nav.greedy-nav').prepend('<style>.hidden-links:before{left:5px !important;}</style>');
|
|
|
|
|
|
|
|
$('nav.greedy-nav').prepend('<style>.hidden-links:after{right:inherit !important;}</style>');
|
|
|
|
$('nav.greedy-nav').prepend('<style>.hidden-links:after{left:5px !important;}</style>');
|
|
|
|
}
|
2023-09-30 18:45:32 +02:00
|
|
|
/* hacks-guide change end */
|
2021-10-03 02:57:33 +02:00
|
|
|
|
2023-09-30 18:45:32 +02:00
|
|
|
/* hacks-guide change start: add progress table */
|
2021-10-03 02:57:33 +02:00
|
|
|
var sidebar_shown = true;
|
|
|
|
var sidebar_hidden_pages = ["404", "a9lh-to-b9s", "credits", "donations", "dumping-titles-and-game-cartridges",
|
2023-01-25 03:50:09 +01:00
|
|
|
"f3-(linux)", "f3xswift-(mac)", "faq", "file-extensions-(windows)",
|
2021-10-03 02:57:33 +02:00
|
|
|
"godmode9-usage", "h2testw-(windows)", "region-changing", "site-navigation", "troubleshooting",
|
2023-10-21 13:02:50 +02:00
|
|
|
"uninstall-cfw","updating-b9s", "privacy-policy", "checking-for-cfw", "restoring-updating-cfw"];
|
2021-10-03 02:57:33 +02:00
|
|
|
|
|
|
|
for(var i = 0; i < sidebar_hidden_pages.length; i++){
|
|
|
|
if(window.location.href.indexOf(sidebar_hidden_pages[i]) > -1) {
|
|
|
|
sidebar_shown = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var devices = {
|
|
|
|
"get-started-(old-3ds)": "0",
|
|
|
|
"get-started-(new-3ds)": "1",
|
|
|
|
};
|
|
|
|
|
|
|
|
// The pages used to lookup which route to display
|
|
|
|
// parsed from the location of the url
|
|
|
|
// the value is the key to the displayed route in the device_common/old/new variable below
|
|
|
|
//
|
|
|
|
var methods = {
|
2023-11-17 12:35:56 +01:00
|
|
|
"key-information": "0",
|
|
|
|
"installing-boot9strap-(soundhax)": "1",
|
|
|
|
"ntrboot": "2",
|
|
|
|
"flashing-ntrboot-(3ds-single-system)": "3",
|
|
|
|
"flashing-ntrboot-(3ds-multi-system)": "4",
|
|
|
|
"flashing-ntrboot-(dsi)": "5",
|
|
|
|
"flashing-ntrboot-(nds)": "6",
|
|
|
|
"installing-boot9strap-(hardmod)": "7",
|
2023-12-24 01:33:30 +01:00
|
|
|
"installing-boot9strap-(mset9)": "8",
|
|
|
|
"installing-boot9strap-(ssloth-browser)": "9",
|
|
|
|
"installing-boot9strap-(safecerthax)": "10",
|
|
|
|
"installing-boot9strap-(super-skaterhax)": "11",
|
|
|
|
"installing-boot9strap-(mset9-play-store)": "12",
|
|
|
|
"installing-boot9strap-(mset9-cli)": "13"
|
2021-10-03 02:57:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
for(var device in devices){
|
|
|
|
if(window.location.href.indexOf("/" + device) > -1) {
|
|
|
|
localStorage.setItem('device', devices[device]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for(var method in methods){
|
|
|
|
if(window.location.href.indexOf("/" + method) > -1) {
|
|
|
|
localStorage.setItem('method', methods[method]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var device, method;
|
|
|
|
if(!(method = localStorage.getItem('method'))){
|
|
|
|
sidebar_shown = false;
|
|
|
|
}
|
|
|
|
if (!(device = localStorage.getItem('device'))) {
|
|
|
|
device = "-1";
|
|
|
|
}
|
|
|
|
if(sidebar_shown){
|
|
|
|
var unhide = [];
|
|
|
|
|
|
|
|
// Common paths for navigation. Added to both routes.
|
|
|
|
// These values of the array will be mapped to the _data/navigation/country_lang.yml files
|
|
|
|
// be sure to add the relevent values to it, in the order of display. (finalizing setup last, for instance)
|
|
|
|
//
|
|
|
|
// The key/propery name must match the value associated with the page in the methods variable above
|
|
|
|
//
|
|
|
|
var device_common = {
|
2023-11-17 12:35:56 +01:00
|
|
|
"0": ["multiple-options", "finalizing-setup"],
|
|
|
|
"1": ["installing-boot9strap-(soundhax)", "finalizing-setup"],
|
|
|
|
"2": ["ntrboot", "multiple-options", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
|
|
|
|
"3": ["ntrboot", "flashing-ntrboot-(3ds-single-system)", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
|
|
|
|
"4": ["ntrboot", "flashing-ntrboot-(3ds-multi-system)", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
|
|
|
|
"5": ["ntrboot", "flashing-ntrboot-(dsi)", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
|
|
|
|
"6": ["ntrboot", "flashing-ntrboot-(nds)", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
|
|
|
|
"7": ["installing-boot9strap-(hardmod)", "finalizing-setup"],
|
2023-12-24 01:33:30 +01:00
|
|
|
"8": ["installing-boot9strap-(mset9)", "finalizing-setup"],
|
|
|
|
"9": ["installing-boot9strap-(ssloth-browser)", "finalizing-setup"],
|
|
|
|
"10": ["installing-boot9strap-(safecerthax)", "finalizing-setup"],
|
|
|
|
"11": ["installing-boot9strap-(super-skaterhax)", "finalizing-setup"],
|
|
|
|
"12": ["installing-boot9strap-(mset9-play-store)", "finalizing-setup"],
|
|
|
|
"13": ["installing-boot9strap-(mset9-cli)", "finalizing-setup"]
|
2021-10-03 02:57:33 +02:00
|
|
|
}
|
|
|
|
// Can add custom routing if necessary but currently both routes are identical
|
|
|
|
var device_old = Object.assign({}, device_common,{
|
|
|
|
// custom routing here
|
|
|
|
// example: "24": ["seedminer", "multiple-options", "installing-boot9strap-(pichaxx)", "finalizing-setup"],
|
|
|
|
});
|
|
|
|
var device_new = Object.assign({}, device_common,{
|
|
|
|
// custom routing here
|
|
|
|
});
|
|
|
|
var route = {
|
|
|
|
"-1": device_common,
|
|
|
|
"0": device_old,
|
|
|
|
"1": device_new,
|
|
|
|
}
|
|
|
|
unhide = unhide.concat(route[device][method]);
|
|
|
|
if(typeof unhide !== 'undefined' && unhide.length > 0){
|
2023-04-07 06:17:49 +02:00
|
|
|
unhide.push("key-information")
|
2021-10-03 02:57:33 +02:00
|
|
|
unhide.push("get-started");
|
|
|
|
var ol = $('.sidebar.sticky .nav__list .nav__items ol');
|
|
|
|
for (var i = 0; i < unhide.length; i++){
|
|
|
|
ol.children('li[data-name="' + unhide[i] + '"]').css("display", "");
|
|
|
|
}
|
|
|
|
ol.children().each(function(idx, li) {
|
|
|
|
var link = $(li).find("a").attr('href');
|
|
|
|
var name = $(li).attr('data-name');
|
|
|
|
if((window.location.href.endsWith(link) ||
|
|
|
|
window.location.href.endsWith(link + "/") ||
|
|
|
|
window.location.href.indexOf(link + "#") > -1 ||
|
|
|
|
window.location.href.indexOf(link + ".html") > -1)
|
|
|
|
&& name !== "home"){
|
|
|
|
$(li).addClass("active");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
$(li).addClass("completed");
|
|
|
|
});
|
|
|
|
if (ol.children(".active").css("display") != "none"){
|
|
|
|
$('.sidebar.sticky').css("display", "inherit");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-09-30 18:45:32 +02:00
|
|
|
/* hacks-guide change end */
|
2023-04-07 06:17:49 +02:00
|
|
|
});
|