Jump to content

User:Symplectic Map/spell.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Symplectic Map (talk | contribs) at 02:28, 27 May 2009 (debug). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// To install, include this script in your monobook.js and clear your cache
// You should see a 'spell' tab next to the watch/unwatch tab.
//
// The script interface created by copying/modifying [[WP:AutoEd]]
//
// USE WITH CAUTION and CHECK THE EDIT CHANGES
// REPORT BUGS TO [[User talk:Symplectic Map]]
//
//importScript('User:Symplectic_Map/misspellings.js');
//importScript('User:Symplectic_Map/capitalizations.js');
//importScript('User:Symplectic_Map/script.js');

function SM_edit() {
 var txt = document.editform.wpTextbox1;
// txt.value = common_misspellings(txt.value);
// txt.value = common_capitalizations(txt.value);
 SM_summary();
 // Check 'This is a minor edit'
 document.editform.wpMinoredit.checked = true;
 // Click 'Show changes'
 document.editform.wpDiff.click();
}

//Tags summary textbox
function SM_summary() {
 var txt = document.editform.wpSummary;
 var tag = "[[User:Symplectic_Map/spell.js|Script-assisted]] correction of [[WP:LCM|Common misspellings]]";

 // Is the tag blank?
 if( tag.match(/[^\s]/) ) {
  // Has it already been tagged?
  if( txt.value.indexOf(tag) == -1 ) {
   // Append a pipe if necessary
   if( txt.value.match(/[^\*\/\s][^\/\s]?\s*$/) ) {
    txt.value += " | ";
   }
   // Append our tag
   txt.value += tag;
  }
 }
}

addOnloadHook(function () {
 if (document.forms.editform) {
  addPortletLink('p-cactions', 'javascript:SM_edit()', 
                 'Spell', 'ca-spell', 'Spellcheck for the edit window', 
                 'S', document.getElementById('ca-move'));
 }
});