User:Mr. Stradivarius/gadgets/SignpostTagger



SignpostTagger adds a window for editing tags for articles of the Signpost. The tags are stored in Lua data modules and used to generate lists of Signpost articles on the fly. Updating the modules manually would be tedious, and this gadget simplifies the process.

Installation
Add the following to your skin.js page:

After saving the page, you may need to bypass your browser cache.

Usage
When viewing a Signpost article, you should see a "Manage tags" tab like this among your top tabs. This tab only activates on Signpost articles, and only when viewing the page (not in "edit" or "history" mode).



On clicking the tab, you should see a window like this:



When the window first opens, it will load the tag data. (The tag data is stored in a sub-module of Module:Signpost.) Once the data is loaded, you can start editing it.

Title
This is the title of the Signpost article. If no title data was found in the Lua module, then SignpostTagger tries to guess the title from the HTML of the current page. If this guess is wrong, or if the data from the Lua module is wrong, then you can edit the title yourself.

Tags
Here you can edit the tags for the article. Tags are separated by commas. Note that when you save the page: This processing avoids us having to add lots of tag variants like "edit wars", "edit-wars" and "editwars". When you are adding tags, if you want, you can type in upper case, with punctuation and with spaces. Just beware that when you save the tags and load them again, they will have been altered for you. Also, if you find yourself wanting to add different tags for the same topic, please consider adding an alias instead. Using aliases helps to keep the tag data maintainable. The aliases are defined in Module:Signpost/aliases.
 * Tags are stripped of all spaces and punctuation, and put in lower case.
 * They are sorted into alphabetical order.
 * Tag aliases are replaced with the canonical tag. For example, the tag "alexaranking" will be replaced with the tag "alexa".

Please keep tags brief and informative. You can add as many tags as you like to a page, but adding many tags that are only tangentially related will decrease the usefulness of the tag data.

Saving
To save the tag data, you can either click the green "Save" button at the top-right of the SignpostTagger window, or you can just hit the Enter key. You will only be able to save the page if you have changed either the tag data or the title data, or if if there is no data stored for the article. In addition, you cannot save the page if the title field is blank.

Deleting
You can delete the data for the current page by clicking on the red "Delete" button at the bottom-left of the SignpostTagger window. This removes the tag data from the data module. If you delete some data by mistake, you can either open SignpostTagger again and add the tags back, or check your contributions and undo the relevant edit to the tag data module.

You will only be able to delete data if SignpostTagger found an entry for the article in the data module.

Compatibility
This script has been tested with Firefox 37 and Chrome 41. It will probably work in Safari, Opera, and earlier versions of Firefox and Chrome as well, but isn't tested. It should work on Internet Explorer 9 and greater, but will definitely not work on Internet Explorer 8 or earlier.

If the script doesn't work for you, please contact me with your browser details and I will try and fix it.