User:Underscorre/EditTools

Please note: This tool is still in beta. Use at your own risk.

CPWEditTools is a set of tools to make quick fixes to some common issues with articles. The original tools were written by and were adapted for use on Wikia by. Be sure to double check the changes made before you publish, as you are still responsible for any mistakes made while editing, even if they are made by EditTools.

Installation
For now, you need to enable JavaScript test mode to use CPWEditTools. You can do this by going here and pressing "Enter test mode" on the left.

Installation is very simple. Just go to Special:Mypage/common.js and add the following code to enable CPWEditTools on both the default skin, and the Monobook skin:

If you only want the tools to load on the default skin or the Monobook skin, add the code to either Special:MyPage/wikia.js or Special:MyPage/monobook.js only, respectively.

Please note: CPWEditTools only works correctly when using source mode. Please don't try to install it on VisualEditor/classic mode.

Usage
Now, when you are editing an article, there will be a group of new tools available.

Oasis (default)
In the Oasis skin (the default), when you are editing an article in source mode, there will now be a new module in the right panel, entitled "EditTools". When this is clicked, a module will open with a number of links, which can be clicked to make changes to the article.

Monobook
In Monobook, when editing an article, there will now be a new group of links at the top of the article, alongside the editing toolbar.

Tools
By default, CPWEditTools comes with six tools:


 * Fix Indentation - Removes indentation at the beginning of paragraphs, to avoid issues with how things are displayed.
 * Fix Newlines - Makes sure there are two newlines between each paragraph, to get the correct spacing.
 * Fix Capitalisation - Fixes capitalisation of the letter "I" and at the beginning of sentences.
 * Fix Spacing - Fixes spacing after punctuation.
 * Fix Coding - Removes unnecessary coding in articles (generally caused by using VisualEditor).
 * Fix Trailing Spaces - Fixes trailing spaces at the end of paragraphs (automatically called by all the other tools).
 * Fix All - Uses all of the tools on the article.

Configuration
CPWEditTools has a number of configuration options. To use them, add this before the CPWEditTools import:

The available configuration options are as follows:


 * " " - Object, comprised of properties which are functions. These are extra modules which will be loaded alongside the default tools. Each module should take one parameter (" ", the story being edited) and should return the modified version of that story. This module will then be displayed along with the default tools. You can customise the text displayed for the name of the module with the  config option. An example might be:


 * " " - Object, comprised of object properties, comprised of string properties. Extra i18n (internationalisation) values to add. Can be used to add human readable names for custom modules. Building on the example above, you could make it display the name "Append 'foo' to the story" by adding this to the config:


 * " " - String. Language to fallback on if there is no translation available in the user's default language. Defaults to "en". Example:


 * " " - String or boolean. Language to use instead of the user's default language. If string, the given language is used instead of the user's default language. If boolean, the parameter is ignored. Defaults to false. Example:


 * " - Boolean. Should the module in the right panel be automatically opened when CPWEditTools is loaded in the Oasis skin? Defaults to false (module is closed).

An example full config might look like this:

More config settings are planned for the future.

Contributing
If you're interested in contributing to CPWEditTools, first, thank you :)

If you find bugs, please let or  know, including your web browser, operating system, and steps to reproduce.

If you want to contribute translations, please message or  with a list of translations for the tools listed above.