Fandom Developers Wiki
mNo edit summary
m (This is broken, someone can fix this if they want)
Line 53: Line 53:
 
== Installation ==
 
== Installation ==
 
{{Script Install/Personal}}
 
{{Script Install/Personal}}
  +
<!--
  +
  +
  +
  +
Script does not currently work in /d properly, someone can fix this if they want
  +
  +
  +
  +
   
 
== Discussions Installation ==
 
== Discussions Installation ==
Line 60: Line 69:
 
Since this script touches the global navigation bar and does nothing else, it is possible to import this into Discussions (personal only).
 
Since this script touches the global navigation bar and does nothing else, it is possible to import this into Discussions (personal only).
   
<syntaxhighlight lang="javascript">$.getScript("//dev.wikia.com/index.php?title=MediaWiki:GlobalNavButtons.js&action=raw&ctype=text/javascript");</syntaxhighlight>
+
<syntaxhighlight lang="javascript">$.getScript("//dev.wikia.com/index.php?title=MediaWiki:GlobalNavButtons.js&action=raw&ctype=text/javascript");</syntaxhighlight>-->
 
[[Category:Discussions Scripts]]
 
[[Category:Discussions Scripts]]

Revision as of 01:03, 15 July 2018

GlobalNavButtons replaces the default global navigation buttons (such as Games, Movies, TV, etc) with your own buttons, even dropdowns.

Configuration

Before adding the import, you need to configure your very own buttons. Add your buttons above your import script.

Each button consists of 5 items in an object, in an array.

  • text: Display text on the button
  • url: The URL of the button (if empty, leave it like )
  • isMain: if the button is the main element in a dropdown. Enter true if it is, else enter false
  • whoIsMain: if the button is a child of the dropdown, please enter the shortName of the main element, else enter false
  • shortName: A short name used in elements to customize buttons and create dropdowns


Here's an example of one stand-alone button, one dropdown menu with a link, and a link inside the dropdown.

var globalNavButtons = [
  {
    text: 'VSTF',
    url: 'https://vstf.wikia.com',
    isMain: false,
    whoIsMain: false,
    shortName: 'VSTF'
  },
  {
    text: 'Community',
    url: 'https://c.wikia.com',
    isMain: true,
    whoIsMain: false,
    shortName: 'c'
  },
  {
    text: 'Adopt',
    url: 'https://c.wikia.com/Adopt',
    isMain: false,
    whoIsMain: 'c',
    shortName: 'Adopt'
  }
];


Installation

Template:Script Install/Personal