fix tracking

This commit is contained in:
lily 2020-12-19 02:22:15 -08:00
parent b97eaf8f2a
commit da028a81b3
3 changed files with 60 additions and 14 deletions

View file

@ -142,6 +142,9 @@ sidebar_pages:
-
title: Installing boot9strap (HBL-USM)
url: installing-boot9strap-(hbl-usm)
-
title: Installing boot9strap (safecerthax)
url: installing-boot9strap-(safecerthax)
-
title: Finalizing Setup
url: finalizing-setup

View file

@ -122,6 +122,11 @@ $(document).ready(function(){
}
}
var devices = {
"get-started-(old-3ds)": "0",
"get-started-(new-3ds)": "1",
};
var methods = {
"installing-boot9strap-(2xrsa)": "0",
"installing-boot9strap-(mset)": "1",
@ -143,22 +148,51 @@ $(document).ready(function(){
"homebrew-launcher-(pichaxx)": "19",
"installing-boot9strap-(usm)": "20",
"installing-boot9strap-(hbl-usm)": "21",
"installing-boot9strap-(safecerthax)": "22",
};
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 method;
if(!(method = localStorage.getItem('method'))){
var device, method;
if(!((device = localStorage.getItem('device')) && (method = localStorage.getItem('method')))){
sidebar_shown = false;
}
if(sidebar_shown){
var unhide = [];
var route = {
var device_old = {
"0": ["installing-boot9strap-(2xrsa)", "finalizing-setup"],
"1": ["installing-boot9strap-(mset)", "finalizing-setup"],
"3": ["homebrew-launcher-(soundhax)", "installing-boot9strap-(homebrew-launcher)", "finalizing-setup"],
"4": ["homebrew-launcher-(alternatives)", "installing-boot9strap-(homebrew-launcher)", "finalizing-setup"],
"7": ["installing-boot9strap-(soundhax)", "finalizing-setup"],
"8": ["ntrboot", "multiple-options", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
"9": ["ntrboot", "flashing-ntrboot-(3ds-single-system)", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
"10": ["ntrboot", "flashing-ntrboot-(3ds-multi-system)", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
"11": ["ntrboot", "flashing-ntrboot-(dsi)", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
"12": ["ntrboot", "flashing-ntrboot-(nds)", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
"13": ["ntrboot", "flashing-ntrboot-(powersaves)", "installing-boot9strap-(ntrboot)", "finalizing-setup"],
"14": ["installing-boot9strap-(hardmod)", "finalizing-setup"],
"15": ["seedminer", "multiple-options", "finalizing-setup"],
"16": ["seedminer", "homebrew-launcher-(steelhax)", "installing-boot9strap-(frogtool)", "finalizing-setup"],
"17": ["seedminer", "multiple-options", "installing-boot9strap-(fredtool)", "finalizing-setup"],
"18": ["seedminer", "bannerbomb3", "installing-boot9strap-(fredtool)", "finalizing-setup"],
"19": ["seedminer", "homebrew-launcher-(pichaxx)", "installing-boot9strap-(frogtool)", "finalizing-setup"],
"20": ["seedminer", "installing-boot9strap-(usm)", "finalizing-setup"],
"21": ["homebrew-launcher-(browserhax-2020)", "installing-boot9strap-(hbl-usm)", "finalizing-setup"],
"22": ["installing-boot9strap-(safecerthax)", "finalizing-setup"],
};
var device_new = {
"0": ["installing-boot9strap-(2xrsa)", "finalizing-setup"],
"1": ["installing-boot9strap-(mset)", "finalizing-setup"],
"2": ["installing-boot9strap-(browser)", "finalizing-setup"],
@ -180,10 +214,19 @@ $(document).ready(function(){
"20": ["seedminer", "installing-boot9strap-(usm)", "finalizing-setup"],
"21": ["homebrew-launcher-(browserhax-2020)", "installing-boot9strap-(hbl-usm)", "finalizing-setup"],
};
unhide = unhide.concat(route[method]);
var route = {
"0": device_old,
"1": device_new,
}
unhide = unhide.concat(route[device][method]);
if(typeof unhide !== 'undefined' && unhide.length > 0){
unhide.push("home");
unhide.push("get-started");
if(device == "0"){
unhide.push("get-started-(old-3ds)");
} else if (device == "1"){
unhide.push("get-started-(new-3ds)");
}
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", "");
@ -192,10 +235,10 @@ $(document).ready(function(){
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"){
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;
}
@ -206,4 +249,4 @@ $(document).ready(function(){
}
}
}
});
});

10
assets/js/main.min.js vendored

File diff suppressed because one or more lines are too long