Szerkesztő:Xia/monobook.js

A Wikipédiából, a szabad enciklopédiából

Megjegyzés: közzététel után frissítened kell a böngésződ gyorsítótárát, hogy lásd a változásokat.

  • Firefox / Safari: tartsd lenyomva a Shift gombot és kattints a Frissítés gombra a címsorban, vagy használd a Ctrl–F5 vagy Ctrl–R (Macen ⌘–R) billentyűkombinációt
  • Google Chrome: használd a Ctrl–Shift–R (Macen ⌘–Shift–R) billentyűkombinációt
  • Internet Explorer / Edge: tartsd nyomva a Ctrl-t, és kattints a Frissítés gombra, vagy nyomj Ctrl–F5-öt
  • Opera: Nyomj Ctrl–F5-öt
function assess(templateName) {
  var quality = prompt('Minőség:');
  if(quality == null) return false;
  var importance = prompt('Fontosság:');
  if(importance == null) return false;
 
  var today = new Date();
  var dateString = 
    today.getFullYear() + "-" + 
    (today.getMonth() + 1) + "-" +
    today.getDate();
  var template = 
    "{{" + templateName + 
    "|besorolás=" + quality + 
    "|fontosság=" + importance + 
    "|szerkesztő=" + wgUserName + 
    "|dátum=" + dateString + 
    "}}";
 
  if (typeof(wikEdUseWikEd) != 'undefined') {
    if (wikEdUseWikEd == true) {
      WikEdUpdateTextarea();
    }
  }
  var textarea = document.editform.wpTextbox1;
 
  if(textarea.value.match("{{" + templateName ))
    textarea.value = textarea.value.replace(new RegExp("\\{\\{" + templateName + ".*?\\}\\}"), template);
  else
    textarea.value = template + '\n' + textarea.value;
 
  if (typeof(wikEdUseWikEd) != 'undefined') {
    if (wikEdUseWikEd == true) {
      WikEdUpdateFrame();
    }
  }
 
  var summary = document.editform.wpSummary;
  summary.value = "cikk értékelése";
 
  return false;
}
 
function addAssessButton(templateName, image, tip) {
  // FIXME néha eltünteti a többi gombot (wikEd miatt?)
  var toolbar = document.getElementById('toolbar');
  if (!toolbar) { return false; }
 
  mwInsertEditButton(toolbar, {
    "imageId": "editbutton-assess-" + templateName,
    "imageFile": image,
    "speedTip": tip,
    "tagOpen": "",
    "tagClose": "",
    "sampleText": ""
  });
  var button = document.getElementById("editbutton-assess-" + templateName);
  button.onclick = function() {assess(templateName);};
}
 
$(function() {
  addAssessButton("WPMTR", "http://upload.wikimedia.org/wikipedia/commons/e/e9/Button_copy_edit.png", "Cikkértékelés");
}); //cikkértékelés-end

importScript("User:BáthoryPéter/interwikiFordito.js");