User:Akoopal/vector.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
/* SaveButton on top of textareaeditformthingalike */

function EatPizzaWithMustard() {
  var wgAction = mw.config.get('wgAction');
  if( wgAction == "edit" || wgAction == "submit" ) {
    // We are editing a page, so most likely we meet the editform
    o1 = document.getElementById('editform')
    div = document.createElement('div')
    //o2 = document.getElementById('wpSave').outerHTML
    o2 = '<input id="wpSave" name="wpSave" type="submit" tabindex="5" value="Save page" accesskey="s" title="Save your changes [s]" />'
    div.innerHTML = o2
    //o3 = document.getElementById('wpTextbox1')
    o3 = document.getElementsByClassName('wikiEditor-ui')[0]
    o1.insertBefore(div, o3)
  }
}

addOnloadHook(EatPizzaWithMustard);