משתמש:הללג/monobook.js
ויקיפדיה האנציקלופדיה encyclopedia
/* פונקציה שמספקת תקציר עריכה אוטומטי כשעורכים גרסה ישנה. התקציר האוטומטי הוא "שחזור לגרסה x" */ function oldVersEdit(){ if(document.location.search.indexOf("&action=edit&oldid=") != -1){ document.editform.wpSummary.value="שחזור לגרסה "+ document.location.search.substring(document.location.search.indexOf("&oldid=")+7,document.location.search.length); } } $(oldVersEdit);
// פונקציה להוספת רשימת אזהרות כשעורכים דף שיחה של אנונימי function talkIPTool() {
var title = (document.title.substr(0, document.title.lastIndexOf(" - "))); templatesList=document.getElementById('edit-templates'); if(templatesList!=null && title.indexOf('.')!=title.lastIndexOf('.')){ warList='אזהרות: <select onchange="document.editform.wpSummary.value+=this[selectedIndex].title; document.editform.wpTextbox1.value +=this[selectedIndex].value + ' ~~' + '~~';this.selectedIndex=0;">'; warList += '<option value="" title="">בחרו מהרשימה כדי להוסיף</option>' warList += '<option title="אזהרה" value="{{אזהרה}}">אזהרה</option>' warList += '<option title="הזמנה" value="{{הזמנה}}">הזמנה</option>' warList += '<option title="ניסויים" value="{{ניסויים}}">ניסויים</option>' warList += '<option title="תודה" value="{{תודה}}">תודה</option>' warList += '<option title="ויקיזציה" value="{{ויקיזציה}}">ויקיזציה</option>' warList += '<option title="לך" value="{{לך}}">לך</option>' warList += '<option title="תלונה" value="{{תלונה}}">תלונה</option>' warList += '<option title="טעות" value="{{טעות}}">טעות</option>' warList += '<option title="נייטרליות" value="{{נייטרליות}}">נייטרליות</option>' warList += '<option title="נחסמת" value="{{נחסמת}}">נחסמת</option>' warList += '<option title="מילון" value="{{מילון}}">מילון</option>' warList += '<option title="כבר קיים" value="{{כבר קיים}}">כבר קיים</option>' warList += '<option title="שגיאה" value="{{שגיאה}}">שגיאה</option>' warList += '<option title="העתקה" value="{{העתקה}}">העתקה</option>' warList += '<option title="פרסומת" value="{{פרסומת}}">פרסומת</option>' warList += '<option title="נמחק" value="{{נמחק}}">נמחק</option>' warList += '<option title="הסבר" value="{{הסבר}}">הסבר</option>' warList += '<option title="בוטל" value="{{בוטל}}">בוטל</option>' warList += '<option title="סגנון" value="{{סגנון}}">סגנון</option>' warList += '</select>' templatesList.innerHTML=warList+templatesList.innerHTML; } }
addLoadEvent(talkIPTool);
/* השלמה אוטומטית של התקציר */ function AutoSumm() {
summTxtBox = document.getElementById('wpSummary'); if (summTxtBox != null) { if (!is_gecko) summTxtBox.attachEvent("onkeypress",autoCompSumm); else summTxtBox.setAttribute("onkeyup","autoCompSumm();"); }
}
function autoCompSumm(){ currSum = document.getElementById('wpSummary'); var summNow=currSum.value; if (summNow.indexOf("*/")!=-1) summNow=summNow.substr(summNow.indexOf("*/ ")+3,summNow.length); if (summNow.length<3) return; //מאיזו אות להתחיל השלמה var summaries= new Array (6); //אורך מערך התקצירים //רשימת תקצירים מוכרים summaries[0]="תקלדה"; summaries[1]="הגהה"; summaries[2]="הועבר"; summaries[3]="ויקיזציה"; summaries[4]="שחזור"; summaries[5]="תיקון קישור"; for (i=0;i<summaries.length;i++){
if(summaries[i].substr(0,summNow.length)==summNow){ summNow=summaries[i]; if (currSum.value.indexOf("*/")!=-1){ currSum.value=currSum.value.substr(0,currSum.value.indexOf("*/"))+"*/ "+summNow; } else { currSum.value=summNow; } break; } }
}
addLoadEvent(AutoSumm);