User:Cacycle/wikEd customization

This is the customization page for wikEd, a full-featured in-browser text editor that adds enhanced text processing functions to Wikipedia and other MediaWiki edit pages.

Customization
wikEd is fully customizable, including color schemes, language, and custom buttons and functions. Add any number of user configurable variables with your own values to your common.js page. This works for all types of installation, including gadget and Greasemonkey installation.

All available customization options are listed on top of the wikEd program code between the labels "// start of user configurable variables" and "// end of user configurable variables". Typical options as found in the program code look like:

… // scroll to edit field on non-preview pages if (typeof(wikEd.config.scrollToEdit) == 'undefined') { wikEd.config.scrollToEdit = true; } …

or:

… // use French rules for fix punctuation if (typeof(wikEd.config.fixPunctFrench) == 'undefined') { wikEd.config.fixPunctFrench = false; } …

Customization examples
For customizing the above settings, you would have to add the following lines to your common.js page:

or:

Use only one single   statement, otherwise you would overwrite your previous customization. Add any additional customizations as

Keyboard shortcuts
Define keyboard shortcuts for wikEd buttons (wikEd button number: [ 'key string', JS key code ] ,). Button number: check the program code (under User:Cacycle/wikEd.js) starting with "// format top". Example:

RegExTypoFix
Show the button to fix common typos using AutoWikiBrowser RegExTypoFix rules:

window.wikEdConfig = {}; wikEdConfig.regExTypoFix = true;

Use different RegExTypoFix rules. This address must have the exact same domain name as the used wiki. On the French Wikipedia you could use:

window.wikEdConfig = {}; wikEdConfig.regExTypoFixURL = '//fr.wikipedia.org/w/index.php?title=Wikipédia:AutoWikiBrowser/Typos&action=raw';

Various
Change a syntax highlighting style:

window.wikEdConfig = {}; wikEdConfig.frameCSS = { '.wikEdLinkName': 'color: #00a000; font-weight: bold;' };

Change an edit page main window CSS rule:

window.wikEdConfig = {}; wikEdConfig.mainEditCSS = { '.wikEdPreviewBox': 'background: #faf8f6; padding: 5px; border-width: 1px; border-style: solid; border-color: #404040 #ffffff #ffffff #404040;' };

Change a user interface (button) image:

window.wikEdConfig = {}; wikEdConfig.image = { 'logo': '6/67/my_logo.png' };

Change a user interface text (uses wikEdText instead of wikEdConfig):

window.wikEdText = {}; wikEdText = { 'wikEdLogo alt': 'wikEd', 'wikEdLogo title': 'wikEd {wikEdProgramVersion}, click to disable' };

Add your own summary presets:

window.wikEdConfig = {}; wikEdConfig.comboPresetOptions = {}; wikEdConfig.comboPresetOptions.summary = [ 'super-duper mega edit', 'copyedit', 'reply', 'article created', 'intro rewrite', 'linkfix', 'fixing typos', 'removing linkspam', 'reverting test', 'reverting vandalism', 'formatting source text', '{wikEdUsing}' ];

Add your own (regexp) presets to the search and replace fields:

window.wikEdConfig = {}; wikEdConfig.comboPresetOptions = {}; wikEdConfig.comboPresetOptions.find = [ '\n +', 'wiked' ]; wikEdConfig.comboPresetOptions.replace = [ '\n', '\'\'\'wikEd\'\'\'' ];

Change a user interface CSS style:

window.wikEdConfig = {}; wikEdConfig.mainCSS = { '.wikEdButton': 'background: blue;' };

Enable the Source button to display the source code of pasted content or of syntax highlighted text:

window.wikEdConfig = { 'wikEdShowSourceButton': true };

Change the presets of the toggle buttons in the wikEd control bar:

window.wikEdConfig = { 'highlightSyntaxPreset': true, 'useWikEdPreset': true, 'usingPreset': false, 'fullScreenModePreset': false, 'closeToolbarPreset': false, 'refHidePreset': false, 'diffPreset': false }

Change the history lengths:

window.wikEdConfig = { 'historyLength': { 'find': 15, 'replace': 15, 'summary': 20 } };

Display a button to automatically append "…using wikEd" (or another text) to the edit summaries:

window.wikEdConfig = { 'showUsingButton': true, 'summaryUsing': '…still using wikEd' };

Do convert  character entities to non-breaking spaces  when saving a page. Note that it will still be converted to  at the time of editing.

window.wikEdConfig = {}; wikEdConfig.nbspToChar = true;

Custom buttons
You can add your own editing buttons and functions to two custom button bars, one to the right of the formatting buttons (custom1) and the other one to the right of the fixing buttons (custom2). Add the following code to your monobook.js page and remember to clear the browser cache afterwards by pressing Shift-Reload. When using wikEd under Greasemonkey, you have to add the handler function code to the wikEd Greasemonkey code bundle.

The example implements a " ...  " button but can easily be adjusted for other needs: