Board Thread:General Discussion/@comment-4598733-20170904012352/@comment-29826282-20170905011610

Eh, close enough. I do wish you had told me about this desired second button from the start; I've had to revamp the script to integrate these new features, which has resulted in a bit of code spaghettification.

Nonetheless, both buttons have been added to the script. The Demote button adds the template to the page and only appears in the dropdown when the template does not exist on the page. The Promote button only appears if the template is present. When the Promote button is pressed, the script removes the template and reloads the content area. The necessary summaries change as well depending on the action being undertaken.

You can find the code here. If I were you, rather than copy/pasting it to your wiki, I'd submit it for review there on Dev, remove it from your Wikia.js, and use MediaWiki:ImportJS to import it to your wiki, but it's your choice.

I will warn you that this script is very resource-intensive. It makes two-three calls to the API in a very short amount of time, which can occasionally result in delays in the button being added or changes being submitted. Just baby the script when you use it.

I think I've provided a fair start; I'm sure you can figure out whatever small modifications you may wish to implement from here on out. Good luck!