MediaWiki:Common.js: Difference between revisions

no edit summary
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(isUserLoggedIn()) {
  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) {
    label: 'Account Management',
  items.push(accountManagement);
    url: '',
  }
    isGrouping: true,
  items.push({
    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'
  },
  {
    label: 'Special Tools',
    label: 'Special Tools',
    url: '',
    url: '',