משתמש:GilCahana/monobook.js

מתוך ויקיפדיה, האנציקלופדיה החופשית

הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: ללחוץ על Ctrl-F5.
importScript('משתמש:רציונל/monobook.js/addMapMarkers.js');
/* שחזור לגרסה X */
importUserScript(2);
//
/* אחוזים הצבעות */
importUserScript(16);
//
/* הסרת תמונות */ 
importUserScript(15);
//
/* ארכוב */
importUserScript(22);
//
/* זכות הצבעה */
importUserScript(13);
//

/* סקריפט להוספת רשימת תבניות פניה/אזהרה כשעורכים דף שיחה של משתמש אנונימי */
/* מאת [[משתמש:ערן]]*/
function talkIPTool()
{
  var title = (document.title.substr(0, document.title.lastIndexOf(" - ")));
  var anonTemplatesList=document.getElementById('edit-templates');
  if(anonTemplatesList!=null && title.indexOf('.')!=title.lastIndexOf('.')){
   var warList='אזהרות: <select onchange="document.editform.wpSummary.value+=this[selectedIndex].title; document.editform.wpTextbox1.value += \'{{ס:\' + this[selectedIndex].title + \'}} ~~\' + \'~~\';document.getElementById(\'editform\').submit();">';
   warList += '<option title="">בחרו מהרשימה כדי להוסיף</option>'
   warList += '<option title="אזהרה">אזהרה</option>'
   warList += '<option title="הבל">הבל</option>'
   warList += '<option title="הזמנה">הזמנה</option>'
   warList += '<option title="ניסויים">ניסויים</option>'
   warList += '<option title="תודה">תודה</option>'
   warList += '<option title="ויקיזציה">ויקיזציה</option>'
   warList += '<option title="לך">לך</option>'
   warList += '<option title="תלונה">תלונה</option>'
   warList += '<option title="טעות">טעות</option>'
   warList += '<option title="נייטרליות">נייטרליות</option>'
   warList += '<option title="נחסמת">נחסמת</option>'
   warList += '<option title="מילון">מילון</option>'
   warList += '<option title="כבר קיים">כבר קיים</option>'
   warList += '<option title="שגיאה" >שגיאה</option>'
   warList += '<option title="העתקה">העתקה</option>'
   warList += '<option title="פרסומת">פרסומת</option>'
   warList += '<option title="נמחק">נמחק</option>'
   warList += '<option title="הסבר">הסבר</option>'
   warList += '<option title="בוטל">בוטל</option>'
   warList += '<option title="סגנון">סגנון</option>'
   warList += '</select>'
   anonTemplatesList.innerHTML=warList+anonTemplatesList.innerHTML;
 }
}
addLoadEvent(talkIPTool);

/* סקריפטים של [[משתמש:ערן]] */

//הוספת תמונה חשודה לתמונה והתרעה למשתמש שהעלה את התמונה
  // From [[en:User:Lupin/autoedit.js]]
 function getParamValue(paramName) {
   var cmdRe=RegExp('[&?]'+paramName+'=([^&]*)');
   var h=document.location;
   var m=cmdRe.exec(h);
   if (m) {
     try {
       return decodeURIComponent(m[1]);
     } catch (someError) {}
   }
   return null;
 }
 
// Configuration
 
// Should the edits be saved automatically?
if(window.nfd_autosave == false){}else if(window.nfd_autosave){}else{ nfd_autosave = true; }
if(window.mnx_autosave == false){}else if(window.mnx_autosave){}else{ mnx_autosave = true; }
 
// String constants
nfd_text = "סומן למחיקה";
nfd_tooltip = "סמן תמונה זו למחיקה";
nfd_prompt = "מדוע ברצונך להציע תמונה זו למחיקה?";
nfd_delReq = "ויקיפדיה:בקשות_ממפעילים";
nfd_deleteTemplate = "מחק";
nfd_idwTemplate = "מקור תמונה";
 
mns_text = "חסר מקור";
mns_tooltip = "סמן תמונה זו כחסרה מקור";
mnl_text = "חסר רשיון";
mnl_tooltip = "סמן תמונה זו כחסרה פרטי רשיון";
mnp_text = "ספק שימוש הוגן";
mnp_tooltip = "סמן תמונה זו כחסרה מידע על האישור";
 
// Site info
scriptPath = "/w/index.php";
prettyPath = "/wiki/";
wikiHostname = "he.wikipedia.org";
 
var now = new Date();
nfd_datePage = nfd_delReq;
var monthsArray = ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"];
var timestamp2 = monthsArray[now.getUTCMonth()] + " " + now.getUTCDate();
 
// From [[en:Wikipedia:WikiProject User scripts/Scripts/addLink]]
function addLink(where, url1, name1, id, title, key, after, url2, name2)
{
    //* where is the id of the toolbar where the button should be added;
    //   i.e. one of "p-cactions", "p-personal", "p-navigation", or "p-tb".
    //
    //* url1 is the URL which will be called when the button is clicked.
    //   javascript: urls can be used to do more complex things.
    //
    //* name1 is what will appear as the name of the button.
    //
    //* id is the id of the button; it's best to define one.  
    //   Use a prefix to make sure its unique. Optional.
    //
    //* title is the tooltip title that gives a longer description 
    //   of the button; if you define a accesskey, mention it here. Optional.
    //
    //* key is the char you want for the accesskey. Optional.
    //
    //* after is the id of the button you want to follow this one. Optional.
    //
    //* url2 is a second url to add. Optional
    //
    //*name2 is the name of the second url; defaults to name1. Optional
    var na = document.createElement('a');
    na.href = url1;
    na.appendChild(document.createTextNode(name1));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
 
    if (url2) { //Another link, brother of the previous.
       var na = document.createElement('a');
       na.href = url2;       
       na.appendChild(document.createTextNode(name2 ? name2 : name1));
       li.appendChild(document.createTextNode(" · ")); //separate them a bit
       li.appendChild(na);
    }
 
    var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
    if(after) {
        tabs.insertBefore(li,document.getElementById(after));
    } else {
        tabs.appendChild(li);
    }
    if(id) {
        if(key && title) { ta[id] = [key, title]; }
        else if(key) { ta[id] = [key, '']; }
        else if(title) { ta[id] = ['', title];} 
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}
 
function openWindow(url) {
  var res = window.open(url, '_blank');
  if (!res) alert("openWindow: window.open() returned null");
}
 
function getUploader() {
  // Get uploader from first point in the list under "File history"
  // Uploader is stored in second A tag in UL tag under "File history"
  // Returns title of user page (without name space) in URL form
  var tables=document.getElementsByTagName('table');
  var uploaders;
  for(var i=0;i<tables.length;i++){
   if(tables[i].className=='filehistory'){
     uploaders=tables[i];
     break;
   }
  }
  if (uploaders==null) {
    alert("תקלה: לא נמצאה טבלת מעלים");
    return null;
  }
  var el = uploaders.getElementsByTagName('tr')[1];
  if (el==null) {
    alert("תקלה: לא נמצא מעלה ... משימה נכשלה");
    return null;
  }
 
  var as = el.getElementsByTagName('a');
 
  var re1 = new RegExp('http://' + (wikiHostname + prettyPath).replace(/\./g, '\\.') + '%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:(.*)$');
  var re2 = new RegExp('http://' + (wikiHostname + scriptPath).replace(/\./g, '\\.') + '\\?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:([^&]*)');
  var m;
  for (var k=0; k<as.length; k++) {
     m = re1.exec(as[k].href);
     if (m) return m[1];
     m = re2.exec(as[k].href);
     if (m) return m[1];
  }
  alert("תקלה: לא נמצא מעלה ... משימה נכשלה");
  return null;
}
 
function nfd_nomForDel() {
  var reason = prompt(nfd_prompt, '');
  if (!reason) return;
  var pagename = encodeURIComponent(mw.config.get('wgPageName'));
  var uploader = getUploader();
  if (!uploader) return;
  openWindow(scriptPath + '?title=שיחת_משתמש:' + uploader
     + '&action=edit&fakeaction=nfd_warn&target=' + pagename);
  openWindow(scriptPath + '?title=' + nfd_delReq + '/' + pagename 
     + '&action=edit&fakeaction=nfd_add&target=' + pagename + '&reason='
     + encodeURIComponent(reason));
  openWindow(scriptPath + '?title=' + nfd_datePage +
     '&action=edit&fakeaction=nfd_add2&target=' + pagename);
  var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
  document.location = editlk + '&fakeaction=nfd_delete&reason=' + encodeURIComponent(reason);
}
 
function nfd_addDeleteTemplate() {
  var reason = decodeURIComponent(getParamValue('reason'));
  var txt = '{{' + nfd_deleteTemplate + '|סיבה=' + reason + '}}';
  document.editform.wpTextbox1.value = txt + '\n' + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = 'סימון תמונה למחיקה';
  if (nfd_autosave) document.editform.wpSave.click();
}
 
function nfd_addIdwTemplate(target) {
  var txt = '==' + target.substring(6,target.length) + '==\n{{' + nfd_idwTemplate + '|שם התמונה=' + target.substring(6,target.length) + '}}';
  document.editform.wpTextbox1.value += 
    (document.editform.wpTextbox1.value.length > 0 ? '\n' : '') +
    txt + ' ~~' + '~~\n';
  document.editform.wpSummary.value = 'אזהרת מחיקת תמונה: ' + target;
  if (nfd_autosave) document.editform.wpSave.click();
}
 
function nfd_updateDelReq(target, reason) {
  document.editform.wpTextbox1.value += 
    (document.editform.wpTextbox1.value.length > 0 ? '\n' : '') +
    '{{delete2|image=' + target + '|reason=' + reason + ' -- ~~' + '~~}}';
  document.editform.wpSummary.value = 'Nominating [[' + target + ']]';
  if (nfd_autosave) document.editform.wpSave.click();
}
 
function nfd_updateDelReq2(target) {
  document.editform.wpTextbox1.value += 
    (document.editform.wpTextbox1.value.length > 0 ? '\n' : '==' + timestamp2 + '==\n') +
    '{{delete3|pg=' + target + '}}';
  document.editform.wpSummary.value = 'Nominating [[' + target + ']]';
  if (nfd_autosave) document.editform.wpSave.click();
}
 
function nfd_onload() {
  if (wgNamespaceNumber == 6) { //NS_IMAGE
    addLink('p-tb', 'javascript:nfd_nomForDel()', nfd_text, 'nom-for-del', nfd_tooltip);
  }
  var fakeaction = getParamValue('fakeaction');
  if (fakeaction == 'nfd_delete')
    nfd_addDeleteTemplate();
  else if (fakeaction == 'nfd_warn')
    nfd_addIdwTemplate(decodeURIComponent(getParamValue('target')));
  else if (fakeaction == 'nfd_add')
    nfd_updateDelReq(decodeURIComponent(getParamValue('target')), decodeURIComponent(getParamValue('reason')));
  else if (fakeaction == 'nfd_add2')
    nfd_updateDelReq2(decodeURIComponent(getParamValue('target')));
}
 
// ??
function mnx_mark(imagepage_fakeaction, usertalk_fakeaction) {
 
  var pagename = encodeURIComponent(mw.config.get('wgPageName'));
  var uploader = getUploader();
 
  if (!uploader) return;
  // Open new window for the user page
  openWindow(scriptPath + '?title=User_talk:' + uploader
     + '&action=edit&fakeaction=' + usertalk_fakeaction + '&target=' + pagename + '&template_type=' + imagepage_fakeaction);
  var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
  document.location = editlk + '&fakeaction=' + imagepage_fakeaction;
}
 
// Add template to image description page
// sorl = "source", "permission" or "license"
function mnx_addTemplate(template, sorl) {
  if (template == 'nsd') template='ס:תמונה חשודה|חסר מקור'; //no source since
  if (template == 'nld') template='ס:תמונה חשודה|חסר רישיון'; //no license
  if (template == 'npd') template='ס:תמונה חשודה|ספק שימוש הוגן'; //no permission since
  //  the edit summary for when you mark the image. You can change it if you want.  
  var txt = '{{' + template + '}}';
  document.editform.wpTextbox1.value = txt + '\n' + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = 'סימון תמונה כחסרה מידע הכרחי על ' + sorl + '. אם זה לא יתוקן התמונה עלולה להימחק תוך שבוע.';
  if (mnx_autosave) document.editform.wpSave.click();
}
 
// Add warning template to uploader's talk page
function mnx_addUserWarningTemplate(imagetarget, template_type) {
  // If template to add is a not permission template, add {{image permission}}
  if (template_type == 'mnp_mnp')                       
     var txt = '=='+imagetarget+'==\nשלום, נראה כי התמונה ' + '[[:' + imagetarget + ']] שהעלית אינה בשימוש הוגן ולכן צפויה להימחק בקרוב. אנא עיין ב[[ויקיפדיה:רישוי/שימוש הוגן]] וב[[ויקיפדיה:שאלות ותשובות/זכויות יוצרים]]. אם יש לך השגות על כך אנא ציין אותן ב[[שיחת '+imagetarget+'|דף השיחה]]. בברכה, ';
  // else, add the {{image source}} template
  else
     var txt = '==' + imagetarget.substring(5,imagetarget.length) + '==\n{{מקור תמונה' + '|שם התמונה=' + imagetarget.substring(5,imagetarget.length) + '}}';
 
  // add in subst: if you want to subst these warnings
  document.editform.wpTextbox1.value += '\n' + txt + ' ~~' + '~~\n';
  document.editform.wpSummary.value = "אזהרה: תמונה חסרה מידע הכרחי על מקור או רישיון.";
  // this is the edit summary for when you leave the user warning on the talk page.
  // you can change it if you want.
  if (mnx_autosave) document.editform.wpSave.click();           // save page
}
 
function mnx_onload() {
  if (wgNamespaceNumber == 6) { //NS_IMAGE
    addLink('p-tb', 'javascript:mnx_mark(\'mns_mns\', \'mnx_warn\')', mns_text, 'mark-no-source', mns_tooltip, null, null);
    addLink('p-tb', 'javascript:mnx_mark(\'mnp_mnp\', \'mnx_warn\')', mnp_text, 'mark-no-permission', mnp_tooltip, null, null);
    addLink('p-tb', 'javascript:mnx_mark(\'mnl_mnl\', \'mnx_warn\')', mnl_text, 'mark-no-license', mnl_tooltip, null, null);
  }
  var fakeaction = getParamValue('fakeaction');
  var template_type = getParamValue('template_type');   // Fetch what template to add
 
  if (fakeaction == 'mns_mns'){
    mnx_addTemplate('nsd','מקור');
        }  if (fakeaction == 'mnp_mnp'){
    mnx_addTemplate('npd','אישור שימוש בתמונה');
        }  if (fakeaction == 'mnl_mnl'){
    mnx_addTemplate('nld','רישיון');
        }  
        if (fakeaction == 'mnx_warn') {                                 // Add warning to uploader's talk page
                        mnx_addUserWarningTemplate(decodeURIComponent(getParamValue('target')), template_type); }
 
 }
 
$(mnx_onload);
//
/* נלקחו מברוקולי */
// Revert tools by Lorian
// From Nir909's monobook
 
function getRevertMessage( where, user1, user2 ) {
    // Get page name and revision ID
    var title = encodeURIComponent( wgPageName );
    var oldid = encodeURIComponent( getParamValue( "oldid" ) );
 
    // Encode user names
    user1 = encodeURIComponent( user1 );
    user2 = encodeURIComponent( user2 );
 
    // Get message
    var message = prompt( "איזו הודעה ברצונך להשאיר?", "" );
    if( !message ) {
        return;
    }
    message = encodeURIComponent( message );
 
    location.href = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + title + "&action=edit&oldid=" + oldid + "&" + where + "=2&user1=" + user1 + "&user2=" + user2 + "&message=" + message;
}
 
function revertToolsLinks() {
    if( !getParamValue( "diff" ) ) {
        return;
    }
 
    // Get page name and revision ID
    var title = encodeURIComponent( wgPageName );
    var oldid = encodeURIComponent( getParamValue( "oldid" ) );
 
    // Get user names
    var user1 = encodeURIComponent( document.getElementById( "mw-diff-otitle2" ).getElementsByTagName( "a" )[0].innerHTML );
    var user2 = encodeURIComponent( document.getElementById( "mw-diff-ntitle2" ).getElementsByTagName( "a" )[0].innerHTML );
 
    // Add revert tools links
    var contentSub = document.getElementById( "contentSub" );
    contentSub.innerHTML = "(";
    contentSub.innerHTML += "<a href=\"" + mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + title + "&action=edit&oldid=" + oldid + "&revert=1&user1=" + user1 + "&user2=" + user2 + "\">שחזור</a>";
    contentSub.innerHTML += " / ";
    contentSub.innerHTML += "<a href=\"javascript:var message = getRevertMessage( 'revert', '" + user1 + "', '" + user2 + "' );\">הודעה</a>";
    contentSub.innerHTML += ") (";
    contentSub.innerHTML += "<a href=\"" + mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + title + "&action=edit&oldid=" + oldid + "&vandalism=1&user1=" + user1 + "&user2=" + user2 + "\">ונדליזם</a>";
    contentSub.innerHTML += " / ";
    contentSub.innerHTML += "<a href=\"javascript:var message = getRevertMessage( 'vandalism', '" + user1 + "', '" + user2 + "' );\">הודעה</a>";
    contentSub.innerHTML += ") (אזהרה: ";
    contentSub.innerHTML += "<a href=\"" + mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=User_talk:" + user2 + "&action=edit&section=new&warn=1\">אזהרה</a>";
    contentSub.innerHTML += " / ";
    contentSub.innerHTML += "<a href=\"" + mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=User_talk:" + user2 + "&action=edit&section=new&warn=2\">ניסויים</a>";
    contentSub.innerHTML += " / ";
    contentSub.innerHTML += "<a href=\"" + mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=User_talk:" + user2 + "&action=edit&section=new&warn=3\">תודה</a>";
    contentSub.innerHTML += ")";
}
function revertTools() {
    var revert = getParamValue( "revert" );
    var vandalism = getParamValue( "vandalism" );
    var warn = getParamValue( "warn" );
    if( revert || vandalism ) {
        var term;
        if( vandalism ) {
            term = "שחזור השחתה";
        } else {
            term = "שוחזר מעריכה";
        }
        var oldid = getParamValue( "oldid" );
        var user1 = getParamValue( "user1" );
        var user2 = getParamValue( "user2" );
        document.getElementById( "wpSummary" ).value = term + " של [[Special:Contributions/" + user2 + "|" + user2 + "]] לגרסה " + oldid + " של [[Special:Contributions/" + user1 + "|" + user1 + "]]";
        if( revert == "2" || vandalism == "2" ) {
            document.getElementById( "wpSummary" ).value += " (" + getParamValue( "message" ) + ")";
        }
        document.getElementById( "editform" ).submit();
    } else if( warn == "1" ) {
        document.getElementById( "wpSummary" ).value = "אזהרת השחתה";
        document.getElementById( "wpTextbox1" ).value = "{" + "{אזהרה}} ~~" + "~~";
        document.getElementById( "editform" ).submit();
    } else if( warn == "2" ) {
        document.getElementById( "wpSummary" ).value = "ניסויי עריכה";
        document.getElementById( "wpTextbox1" ).value = "{" + "{ניסויים}} ~~" + "~~";
        document.getElementById( "editform" ).submit();
    } else if( warn == "3" ) {
        document.getElementById( "wpSummary" ).value = "תודה על תרומתך לוויקיפדיתנו!";
        document.getElementById( "wpTextbox1" ).value = "{" + "{תודה}} ~~" + "~~";
        document.getElementById( "editform" ).submit();
    }
}
 
$( revertToolsLinks );
$( revertTools );
 
/* צובע עריכות אנונימיים בשינויים אחרונים. From Yonidebest */
function highlightAnon() {
 if (wgCanonicalSpecialPageName != 'Recentchanges') return;
 
 var ipRx = /(([0-1]?[0-9]{1,2}\.)|(2[0-4][0-9]\.)|(25[0-5]\.)){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))/;
 var liElements = document.getElementsByTagName('UL')[0].getElementsByTagName('LI');
 for (var i = 0; i < liElements.length; i++) {
  var ipRxIndex = (liElements[i].getElementsByTagName('A')[0].innerHTML == 'הבדל') ? 3 : 2;
  var m = ipRx.exec(liElements[i].getElementsByTagName('A')[ipRxIndex].title);
  if (m)
   liElements[i].getElementsByTagName('A')[ipRxIndex].style.backgroundColor = '#FFECB2';
 }
}
 
$(highlightAnon);
/* סקריפט להוספת קישורים להוספת תבניות אזהרה שונות למשתמשים, מאת Yonidebest */
function warningTalkPage( user, warning, refPage ) {
    var url = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + encodeURIComponent( "שיחת_משתמש:" + user ) + "&action=edit&warning=" + encodeURIComponent( warning );
    if( refPage != "null" ) {
        url += "&ref_page=" + encodeURIComponent( refPage );
    }
    window.open( url );
}
 
function createWarningLink( user, warning, title, refPage ) {
    var link = document.createElement("a");
    link.href = "javascript:void(0);";
    link.onclick = function() {
        var user = this.getAttribute( "user" );
        var warning = this.getAttribute( "warning" );
        var refPage = this.getAttribute( "ref_page" );
        if( !refPage ) {
            refPage = ( wgCanonicalNamespace == "Image" || wgCanonicalNamespace == "Category" ) ? ( ":" + wgPageName ) : wgPageName;
        }
        warningTalkPage( user, warning, refPage );
    }
    link.setAttribute( "user", user );
    link.setAttribute( "warning", warning );
    if( refPage ) {
        link.setAttribute( "ref_page", refPage );
    }
    link.innerHTML = warning;
    link.title = title;
    return link;
}
 
function warningDiffLinks() {
    if( !document.getElementById("mw-diff-ntitle2") ) return; // not a diff page
    var link = document.getElementById("mw-diff-ntitle2").getElementsByTagName("a")[0];
    var user = link.innerHTML;
    if( !/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test( user ) ) return; // not an anonymous user diff page
 
    var span = document.createElement("span");
    span.appendChild( document.createTextNode( " (" ) );
    span.appendChild( createWarningLink( user, "אזהרה", "הוספת תבנית אזהרה" ) );
    span.appendChild( document.createTextNode(" | ") );
    span.appendChild( createWarningLink( user, "ניסויים", "הוספת תבנית ניסויים" ) );
    span.appendChild( document.createTextNode(" | ") );
    span.appendChild( createWarningLink( user, "נמחק", "הוספת תבנית נמחק" ) );
    span.appendChild( document.createTextNode(" | ") );
    span.appendChild( createWarningLink( user, "העתקה", "הוספת תבנית העתקה" ) );
    span.appendChild( document.createTextNode(" | ") );
    span.appendChild( createWarningLink( user, "תודה", "הוספת תבנית תודה" ) );
    span.appendChild( document.createTextNode( ")" ) );
    link.parentNode.insertBefore( span, link.nextSibling );
}
 
function postWarning() {
    var warning = getParamValue( "warning" );
    var refPage = getParamValue( "ref_page" );
    var text = "";
    if( !warning ) return;
    if( refPage ) {
        refPage = refPage.replace( /_/g, " " );
        text += "\n== [" + "[" + refPage + "]] ==\n";
    }
    text += "{" + "{" + warning + "}} ~~" + "~~";
    document.getElementById("wpTextbox1").value += text;
    document.getElementById("wpSummary").value = warning;
    document.getElementById("editform").submit();
}
 
$(warningDiffLinks);
$(postWarning);
//