Final Fantasy Wiki
(+)
(.)
Line 29: Line 29:
 
Also, if this is something we want implemented wiki-wide, then let me know also. [[User:JBed|JBed]] ([[User talk:JBed|talk]]) 12:51, March 9, 2013 (UTC)
 
Also, if this is something we want implemented wiki-wide, then let me know also. [[User:JBed|JBed]] ([[User talk:JBed|talk]]) 12:51, March 9, 2013 (UTC)
 
:So this is how you edit so fast... well, yeah, I would support putting this wiki-wide. {{User:Catuse167/Templates/sig}} 14:48, March 9, 2013 (UTC)
 
:So this is how you edit so fast... well, yeah, I would support putting this wiki-wide. {{User:Catuse167/Templates/sig}} 14:48, March 9, 2013 (UTC)
::This actually isn't how I edit fast :p --I've yet to actually use this (or my personal variation) yet-- I wrote it this morning. [[Special:Contributions/92.24.164.34|92.24.164.34]] 14:55, March 9, 2013 (UTC)
+
::This actually isn't how I edit fast :p --I've yet to actually use this (or my personal variation)-- I wrote it this morning. [[Special:Contributions/92.24.164.34|92.24.164.34]] 14:55, March 9, 2013 (UTC)

Revision as of 14:55, 9 March 2013

FFWiki forum logo
Forums: Index > Rin's Travel Agency > Archive > Useful JS


I decided to write a JS script. The script adds an "(edit)" link next to all the links on WLH pages. Since the primary use of WLH is to fix links/transclusions to pages, I think this is helpful.

/* ---------------------------------Adds edit links to WLH page -- *
 * --------------------------------------------------------------- */
function addEditLinksToWLH() {
  if(wgCanonicalSpecialPageName=='Whatlinkshere')
  {
    var links = document.getElementById("mw-whatlinkshere-list").getElementsByTagName('li');
    for(var i = 0; i<links.length; i++)
    {
      aLink = links[i].getElementsByTagName('a');
      var linkHref = aLink[0].href+="?action=edit";
      var tools = getElementsByClassName(links[i], 'span', 'mw-whatlinkshere-tools');
      var editLinkSpan = document.createElement("span");
      editLinkSpan.className = "mw-whatlinkshere-edit";
      editLinkSpan.innerHTML = '<a title="Edit form" href="' + linkHref + '">(edit)</a> ';
      links[i].insertBefore(editLinkSpan,tools[0]);
    }
  }
}

addOnloadHook(addEditLinksToWLH);

I designed it for Oasis, but monobook's WLHs seem to work in the exact same way so I would find it odd if it didn't. And also I've only tested it on Firefox, so if you use it and it works on Firefox but not on another browser, let me know.

Also, if this is something we want implemented wiki-wide, then let me know also. JBed (talk) 12:51, March 9, 2013 (UTC)

So this is how you edit so fast... well, yeah, I would support putting this wiki-wide. C A T U S E 14:48, March 9, 2013 (UTC)
This actually isn't how I edit fast :p --I've yet to actually use this (or my personal variation)-- I wrote it this morning. 92.24.164.34 14:55, March 9, 2013 (UTC)