Benutzer:J*/Javascript-Spielwüste.js: Unterschied zwischen den Versionen

aus Kamelopedia, der wüsten Enzyklopädie
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
 +
addJS("MediaWiki:Prototype.js")
 +
var edittoken;
 +
 
addOnloadHook( function () {
 
addOnloadHook( function () {
  
 
h = document.getElementById('ca-history')
 
h = document.getElementById('ca-history')
 
function openratewindow ()
 
{
 
   
 
}
 
  
 
rate = document.createElement('li')
 
rate = document.createElement('li')
Zeile 16: Zeile 14:
  
 
h.parentNode.insertBefore(rate,h)
 
h.parentNode.insertBefore(rate,h)
 +
 +
x = new Ajax.Request( "http://kamelopedia.mormo.org/index.php",
 +
    {
 +
        parameters: "title=Kamel:J*/Rate2&action=raw"
 +
        onSuccess: function (trans) { createratewindow(trans); }
 +
    }
 +
);
  
 
});
 
});
 +
 +
function createratewindow (ret)
 +
{
 +
x = document.createElement("div");
 +
x.style.position = "fixed";
 +
x.style.left = "200px";
 +
x.style.top = "100px";
 +
x.style.width = "300px";
 +
x.innerHTML = ret.responseText.replace("{@{page}@}",wgPageName);
 +
x.style.backgroundColor = "white";
 +
x.style.border = "2px blue solid";
 +
x.id = "kp_rating";
 +
x.display = "none";
 +
document.getElementById("content").appendChild(x)
 +
 +
    x = new Ajax.Request( "http://kamelopedia.mormo.org/api.php", {
 +
        method: "get",
 +
        parameters: "action=query&prop=info&intoken=edit&titles=Hauptseite&format=json",
 +
        onSuccess: function (trans) { x = trans.responseJSON.query.pages[7].edittoken; $("ed_token").value = x;}
 +
 +
}
 +
 +
function openratewindow ()
 +
{
 +
}

Version vom 4. März 2010, 22:26 Uhr

addJS("MediaWiki:Prototype.js")
var edittoken;

addOnloadHook( function () {

h = document.getElementById('ca-history')

rate = document.createElement('li')
ratelink = document.createElement('a')
ratelink.appendChild(document.createTextNode('Bewerten'))
rate.appendChild(ratelink)
rate.onclick = openratewindow
rate.className = "pseudolink"

h.parentNode.insertBefore(rate,h)

x = new Ajax.Request( "http://kamelopedia.mormo.org/index.php",
    {
        parameters: "title=Kamel:J*/Rate2&action=raw"
        onSuccess: function (trans) { createratewindow(trans); }
    }
);

});

function createratewindow (ret)
{
x = document.createElement("div");
x.style.position = "fixed";
x.style.left = "200px";
x.style.top = "100px";
x.style.width = "300px";
x.innerHTML = ret.responseText.replace("{@{page}@}",wgPageName);
x.style.backgroundColor = "white";
x.style.border = "2px blue solid";
x.id = "kp_rating";
x.display = "none";
document.getElementById("content").appendChild(x)

    x = new Ajax.Request( "http://kamelopedia.mormo.org/api.php", {
        method: "get",
        parameters: "action=query&prop=info&intoken=edit&titles=Hauptseite&format=json",
        onSuccess: function (trans) { x = trans.responseJSON.query.pages[7].edittoken; $("ed_token").value = x;}

}

function openratewindow ()
{
}