User:Gimmetrow/edit0.js

//Custom monobook javascript extensions<!-- Makes this look OK on the Wikipedia page --><pre>

// This will add an [edit] link at the top of all pages except preview pages and the main page
// Originally by User:Pile0nades, with additions from User:David_Levy
// Taken from [[User:Clindberg/monobook.js]]

// Add an [edit] link to pages
$(function ()
{
    // Add label to edit box if actually editing
    if(window.location.href.indexOf("&action=edit&section=0") > 0) {
       var editField = document.getElementById("wpSummary");
       if (editField) editField.value = "/* Intro */ ";
       return;
    }

    // Don't add the link if there are no other links on the page.  This avoids adding it on
    // history etc. pages and also if the user's edit link preference is turned off.
    // IE's innerHTML does not have double quotes so use a regex.
    if (document.getElementById('bodyContent').innerHTML.match('class="?editsection"?') == null)
        return;

    // create div and set innerHTML to link
    var pageURL = wgPageName.replace(/&/g, "%26");
    var divContainer = document.createElement("div");
    var divStart = '<div class="editsection" style="float:right;margin-left:5px;margin-right:0px;margin-top:38px;">';
    var divLink = '<a href="/w/index.php?title='+pageURL+'&action=edit&section=0" title="Edit intro section: '+wgTitle+'">';
    divContainer.innerHTML = divStart+'['+divLink+'edit</a>]</div>';

    // insert divContainer into the DOM below the h1
    document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
});
//</pre>

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.