5,798
edits
No edit summary |
No edit summary |
||
Line 675: | Line 675: | ||
function initWikiAppSidebar() { | function initWikiAppSidebar() { | ||
if (navigator.userAgent.indexOf('gonative melvorwiki') > -1) { | if (navigator.userAgent.indexOf('gonative melvorwiki') > -1) { | ||
const isLoggedIn = isUserLoggedIn(); | |||
const myFavs = { | const myFavs = { | ||
url: 'https://wiki.melvoridle.com/w/Special:Favoritelist', | url: 'https://wiki.melvoridle.com/w/Special:Favoritelist', | ||
Line 681: | Line 682: | ||
icon: 'fas fa-star' | icon: 'fas fa-star' | ||
}; | }; | ||
const signIn = { | |||
label: 'Sign In / Register', | |||
url: 'https://wiki.melvoridle.com/index.php?title=Special:UserLogin&returnto=Main+Page', | |||
subLinks: [], | |||
icon: 'fas fa-star' | |||
}; | |||
const accountManagement = | |||
{ | |||
label: 'Account Management', | |||
url: '', | |||
isGrouping: true, | |||
subLinks: [ | |||
{ | |||
label: 'Sign In / Register', | |||
url: 'https://wiki.melvoridle.com/index.php?title=Special:UserLogin&returnto=Main+Page', | |||
subLinks: [] | |||
}, | |||
{ | |||
label: 'Preferences', | |||
url: 'https://wiki.melvoridle.com/w/Special:Preferences', | |||
subLinks: [] | |||
}, | |||
{ | |||
label: 'Logout', | |||
url: 'https://wiki.melvoridle.com/index.php?title=Special:UserLogout&returnto=Main+Page', | |||
subLinks: [] | |||
} | |||
], | |||
icon: 'fas fa-user-gear' | |||
}; | |||
const items = [ | const items = [ | ||
{ | { | ||
Line 689: | Line 720: | ||
} | } | ||
]; | ]; | ||
if( | if(isLoggedIn) { | ||
items.push(myFavs); | items.push(myFavs); | ||
} else { | |||
items.push(signIn); | |||
} | } | ||
items.push( | items.push( | ||
Line 716: | Line 749: | ||
icon: 'fas fa-hammer', | icon: 'fas fa-hammer', | ||
subLinks: [] | subLinks: [] | ||
} | }); | ||
{ | if(isLoggedIn) { | ||
items.push(accountManagement); | |||
} | |||
items.push({ | |||
} | |||
{ | |||
label: 'Special Tools', | label: 'Special Tools', | ||
url: '', | url: '', |