Home  

Random  

Nearby  



Log in  



Settings  



Donate  



About Wikipedia  

Disclaimers  



Wikipedia





User:The Voidwalker/alwaysEditSectionLink.js





User page  

Talk  



Language  

Watch  

View source  


< User:The Voidwalker
 


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.
// Makes edit section links appear everywhere they don't exist but probably should. Only probably, they might turn up in unexpected places.

if(mw.config.get('wgAction') === 'view' && $('.mw-headline')[0] && !$('.mw-editsection')[0] && mw.config.get('wgIsProbablyEditable')) {
 $('.mw-headline').wrap('<span id="mw-headline">');
 for (var i = 0; i < $('.mw-headline').length; i++) {
     $('#mw-headline')[0].id = 'header-' + i;
     var link = mw.util.getUrl(mw.config.get('wgPageName'), {action: "edit", section: i + 1});
  $('#header-' + i).after(
   $('<span>')
    .addClass('mw-editsection')
    .append(
     document.createTextNode('[ '),
     $('<a>')
      .attr('href', link)
      .text('edit source'),
     document.createTextNode(' ]')
    )
  );
 }
}

Retrieved from "https://en.wikipedia.org/w/index.php?title=User:The_Voidwalker/alwaysEditSectionLink.js&oldid=1059601579"
 



Last edited on 10 December 2021, at 12:38  


Languages

 



This page is not available in other languages.
 

Wikipedia


This page was last edited on 10 December 2021, at 12:38 (UTC).

Content is available under CC BY-SA 4.0 unless otherwise noted.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Terms of Use

Desktop