Użytkownik:Vae/monaco.js: Różnice pomiędzy wersjami

Z Nonsensopedii, polskiej encyklopedii humoru
M (Kurde2)
M (Kurde3)
Linia 20: Linia 20:


function wstaw_przyciski_d(){
function wstaw_przyciski_d(){
document.getElementById('siteNotice').innerHTML+='<hr /><div style="float:right" class="vae-przyciski"><a onclick="pokaz_usuwanie()" href="#" class="przycisk-kasacja">rozgnieć</a> | <a onclick="pokaz_edycje()" href="#" class="przycisk-edycja">edytuj</a></div>';
document.getElementById('siteNotice').innerHTML+='<hr /><div style="float:right" class="vae-przyciski"><p onclick="pokaz_usuwanie()" class="przycisk-kasacja">rozgnieć</p> | <p onclick="pokaz_edycje()" class="przycisk-edycja">edytuj</p></div>';
};
};


Linia 33: Linia 33:
function fetch_log_contents_kasacja(){
function fetch_log_contents_kasacja(){
var Odp_kasacja = xml_http.responseText;
var Odp_kasacja = xml_http.responseText;
document.getElementById('siteNotice').innerHTML+='<div id="vae_kasacja" style="display:none;"><div style="float:right;" class="vae-przyciski"><a href="#" onclick="ukryj_usuwanie();">UKRYJ</a></div>'+Odp_kasacja.split('<!-- ARTICLE -->')[1].split('<!-- /ARTICLE -->')[0]+'</div>';
document.getElementById('siteNotice').innerHTML+='<div id="vae_kasacja" style="display:none;"><div style="float:right;" class="vae-przyciski"><p onclick="ukryj_usuwanie();">UKRYJ</p></div>'+Odp_kasacja.split('<!-- ARTICLE -->')[1].split('<!-- /ARTICLE -->')[0]+'</div>';
document.getElementById('ca-delete').href='#';
document.getElementById('ca-delete').href='#';
document.getElementById('ca-delete').onclick='pokaz_usuwanie();';
document.getElementById('ca-delete').onclick='pokaz_usuwanie();';
Linia 59: Linia 59:
function fetch_log_contents_edycja(){
function fetch_log_contents_edycja(){
var Odp_edycja = xml_http2.responseText;
var Odp_edycja = xml_http2.responseText;
document.getElementById('siteNotice').innerHTML+='<div id="vae_edycja" style="display:none;"><div style="float:right;" class="vae-przyciski"><a href="#" onclick="ukryj_edycje();">UKRYJ</a></div>'+Odp_edycja.split('<!-- ARTICLE -->')[1].split('<!-- /ARTICLE -->')[0]+'</div>';
document.getElementById('siteNotice').innerHTML+='<div id="vae_edycja" style="display:none;"><div style="float:right;" class="vae-przyciski"><p onclick="ukryj_edycje();">UKRYJ</p></div>'+Odp_edycja.split('<!-- ARTICLE -->')[1].split('<!-- /ARTICLE -->')[0]+'</div>';
document.getElementById('ca-edit').href='#';
document.getElementById('ca-edit').href='#';
document.getElementById('ca-edit').onclick='pokaz_edycje();';
document.getElementById('ca-edit').onclick='pokaz_edycje();';

Wersja z 11:20, 15 paź 2008

// <nowiki> 

function HTTPClient() {
  var gml_http;
  if(window.XMLHttpRequest) {
    gml_http = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    try {
      gml_http = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        gml_http = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        gml_http = false;
      }
    }
  }
  return gml_http;
}

function wstaw_przyciski_d(){
  document.getElementById('siteNotice').innerHTML+='<hr /><div style="float:right" class="vae-przyciski"><p onclick="pokaz_usuwanie()" class="przycisk-kasacja">rozgnieć</p> | <p onclick="pokaz_edycje()" class="przycisk-edycja">edytuj</p></div>';
};

function kasacja_d(){
  var URL = '/index.php?title='+wgPageName+'&action=delete';
  xml_http = HTTPClient();
  xml_http.open("GET", URL, true);
  xml_http.onreadystatechange = fetch_log_contents_kasacja;
  xml_http.send(null);
};

function fetch_log_contents_kasacja(){
  var Odp_kasacja = xml_http.responseText;
  document.getElementById('siteNotice').innerHTML+='<div id="vae_kasacja" style="display:none;"><div style="float:right;" class="vae-przyciski"><p onclick="ukryj_usuwanie();">UKRYJ</p></div>'+Odp_kasacja.split('<!-- ARTICLE -->')[1].split('<!-- /ARTICLE -->')[0]+'</div>';
  document.getElementById('ca-delete').href='#';
  document.getElementById('ca-delete').onclick='pokaz_usuwanie();';
  return false;
};

function pokaz_usuwanie(){
  document.getElementById('vae_kasacja').style='display:block; border: 2px solid green; background-color:#ddFFdd; font-size:90%; text-align:left; padding:10px;';
  return false;
};

function ukryj_usuwanie(){
  document.getElementById('vae_kasacja').style='display:none;';
  return false;
};

function edycja_d(){
  var URL = '/index.php?title='+wgPageName+'&action=edit';
  xml_http2 = HTTPClient();
  xml_http2.open("GET", URL, true);
  xml_http2.onreadystatechange = fetch_log_contents_edycja;
  xml_http2.send(null);
};

function fetch_log_contents_edycja(){
  var Odp_edycja = xml_http2.responseText;
  document.getElementById('siteNotice').innerHTML+='<div id="vae_edycja" style="display:none;"><div style="float:right;" class="vae-przyciski"><p onclick="ukryj_edycje();">UKRYJ</p></div>'+Odp_edycja.split('<!-- ARTICLE -->')[1].split('<!-- /ARTICLE -->')[0]+'</div>';
  document.getElementById('ca-edit').href='#';
  document.getElementById('ca-edit').onclick='pokaz_edycje();';
  return false;
};

function pokaz_edycje(){
  document.getElementById('vae_edycja').style='display:block; border: 2px solid blue; background-color:#ddddFF; font-size:90%; text-align:left; padding:10px;';
  return false;
};

function ukryj_edycje(){
  document.getElementById('vae_edycja').style='display:none;';
  return false;
};

if(wgArticleId!=0 && wgCanonicalNamespace!='MediaWiki' && wgCanonicalNamespace!='Special' && wgCanonicalNamespace!='Image'){
  addOnloadHook(wstaw_przyciski_d);
  addOnloadHook(kasacja_d);
  addOnloadHook(edycja_d);
};

// </nowiki>