מדיה ויקי:Gadget-UserMessages.js
מראה
הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
/* adds to the toolbox a list of templates to add in talkpages. */
// itemized list of templates. "title" is section title,
// the first item is the template and the second is the tooltip.
var uTemplate = [
{title: 'אזהרות', templates: [
['אזהרה', 'אזהרה'],
['הבל', 'הבל'],
['העתקה', 'העתקה'],
['שם פוגעני', 'שם פוגעני'],
['נחסמת', 'נחסמת'],
['אזהרת תמונות2', 'אזהרת תמונות2'],
['לא כאן', 'לא כאן'],
['תלונה', 'תלונה'],
['לך', 'לך'],
]},
{title: 'הודעות', templates: [
['ניסויים', 'ניסויים'],
['נמחק ניסויים', 'נמחק ניסויים'],
['נמחק', 'נמחק'],
['בוטל', 'בוטל'],
['פרסומת', 'פרסומת'],
['חזרה על עריכה', 'חזרה על עריכה'],
['קישור מבוטל', 'קישור מבוטל'],
]},
{title: 'הסברים', templates: [
['אוטוביוגרפיה', 'אוטוביוגרפיה'],
['שגיאה', 'שגיאה'],
['טעות', 'טעות'],
['הסבר', 'הסבר'],
['נייטרליות', 'נייטרליות'],
['סגנון', 'סגנון'],
['שימוש בדף השיחה', 'שימוש בדף השיחה'],
['תמונה מוגנת', 'תמונה מוגנת'],
['מחיקת תמונה', 'מחיקת תמונה'],
['מקור תמונה', 'מקור תמונה'],
['הנחיות תמונה', 'הנחיות תמונה'],
['כבר קיים', 'כבר קיים'],
['התנחלות', 'התנחלות'],
['ויקיזציה', 'ויקיזציה'],
['זכות הצבעה', 'זכות הצבעה'],
['מילון', 'מילון'],
['כניסה לחשבונך', 'כניסה לחשבונך'],
]},
{title: 'תודות', templates: [
['תודה', 'תודה'],
['הזמנה', 'הזמנה'],
]}
]
// Add template to user talk page
function template_addTemplate(template) {
if (!document.editform && !getParamValue('autoinsert_template')) {
var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
document.location = editlk + '&autoinsert_template=' + template;
}
document.editform.wpTextbox1.value += "\n{{subst:" + template + "}} ~~" + "~~";
document.editform.wpSummary.value = 'מוסיף תבנית "' + template + '" ליידוע המשתמש.';
if ((typeof template_autosave == "undefined") || template_autosave)
document.editform.wpSave.click();
}
function template_onload() {
addPortletLink('p-tb', '', ''); // create a little space.
for (var i in uTemplate) {
var part = uTemplate[i];
addPortletLink('p-tb', '', '== ' + part.title + ' ==');
var templates = part.templates;
templates.sort(function (a,b){return a==b?0:(a[0]>b[0] ? 1 : -1);});
for (var i in templates) {
var t = templates[i][0], c = templates[i][1];
addPortletLink('p-tb', 'javascript:template_addTemplate("' + t + '")', t, null, c);
}
}
if (getParamValue('autoinsert_template'))
template_addTemplate(getParamValue('autoinsert_template'));
}
if (wgNamespaceNumber == 3) //NS_USERTALK
addOnloadHook(template_onload);