মিডিয়াউইকি:Gadget-UserMessages.js

লক্ষ্য করুন: প্রকাশ করার পর, পরিবর্তনগুলো দেখতে আপনাকে আপনার ব্রাউজারের ক্যাশে পরিষ্কার করার প্রয়োজন হতে পারে।

  • ফায়ারফক্স / সাফারি: পুনরায় লোড-এ ক্লিক করার সময় শিফট টিপে ধরে রাখুন, অথবা হয় Ctrl-F5 বা Ctrl-R টিপুন (ম্যাকে ⌘-R টিপুন)
  • গুগল ক্রোম: Ctrl-Shift-R (ম্যাকে ⌘-Shift-R) টিপুন
  • ইন্টারনেট এক্সপ্লোরার / এজ: Ctrl ধরে রাখা অবস্থায় Refresh-এ ক্লিক করুন, অথবা Ctrl-F5 টিপুন
  • অপেরা: Ctrl-F5 টিপুন।
// <nowiki>
// From [[Commons:MediaWiki:Gadget-UserMessages.js]] (Commons oldid=53088541)
// And modified to use in Bengali Wikipedia
// Configuration
// Should the edits be saved automatically?
if (!window.template_autosave == true) {
   template_autosave = true;
}

template_mediaquery = "এটি বার্তাটি কোন চিত্রের জন্য প্রযোজ্য? " + "\\চিত্রের নামটি লিখুন\\ (চিত্র: নামস্থান ছাড়া)।";
template_pagequery = "এই বার্তাটি কোন নিবন্ধের জন্য প্রযোজ্য? " + "\\নিবন্ধের নামটি লিখুন\\।";
template_usernamequery = "এই বার্তাটি কোন ব্যবহারকারীকে নির্দেশ করবে?";
                                            
var uTemplate = [];
// uTemplate[0] = ['Template name', "Name in Sidebar", "Mouseover text", 'Type/Prompt statement'];
uTemplate[0] = ['স্বাগতম', "স্বাগতম", "Welcome a new user or a user who has not yet received a welcome message", 'mark-welcome'];
uTemplate[1] = ['আইপি-স্বাগতম', "আইপি-স্বাগতম", "Welcome a new user or a user who has not yet received a welcome message",                   'mark-welcome'];
uTemplate[2] = ['কপিভায়ো - নিবন্ধ', "কপিভায়ো - নিবন্ধ", "Inform user about speedy deletion of uploaded media", 'prompt("' + template_pagequery + '"), 0, true', 'mark-warn'];
uTemplate[3] = ['কপিভায়ো - চিত্র', "কপিভায়ো - চিত্র", "Inform user about speedy deletion of uploaded media", 'prompt("' + template_mediaquery + '"), 0, true', 'mark-warn'];
uTemplate[4] = ['কপিভায়ো শেষ', "কপিভায়ো শেষ", "Give user a final warning because of previous copyright violations", 'mark-warn'];
uTemplate[5] = ['অপ্রযোজ্য বিষয়', "অপ্রযোজ্য বিষয়", "Please stay on topic in Commons", 'mark-warn'];
uTemplate[6] = ['ধ্বংসপ্রবণতা ১', "ধ্বংসপ্রবণতা ১", "Referral to sandbox for conducting experiments", 'mark-warn'];
uTemplate[7] = ['ধ্বংসপ্রবণতা ২', "ধ্বংসপ্রবণতা ২", "Warning or vandalism and request to cease", 'mark-warn'];
uTemplate[8] = ['ধ্বংসপ্রবণতা ৩', "ধ্বংসপ্রবণতা ৩", "Second warning for vandalism and announcement of block if it continues", 'mark-warn'];
uTemplate[9] = ['ধ্বংসপ্রবণতা ৪', "ধ্বংসপ্রবণতা ৪", "Last warning for vandalism and announcement of block on next violation", 'mark-warn'];
uTemplate[10] = ['ধ্বংসপ্রবণতা শেষ', "ধ্বংসপ্রবণতা শেষ", "Last warning for vandalism and announcement of block on next violation", 'mark-warn'];
uTemplate[11] = ['Please link images', "Please link", "Request user to please link his images through categories or galleries", 'mark-please'];
uTemplate[12] = ['Please name images', "Please name", "Request user to please name his images correctly", 'mark-please'];
uTemplate[13] = ['Please tag images', "Please tag", "Request user to please tag his images", 'mark-please'];
uTemplate[14] = ['Please describe images', "Please describe", "Request user to please describe his images", 'prompt("' + template_mediaquery + '"), 0, true', 'mark-warn'];
uTemplate[15] = ['No comments', "Use talk pages", "Inform user to use talk pages", 'mark-please'];
uTemplate[16] = ['Dont remove delete', "Rem.Delete", "Please do not remove deletion requests", 'mark-warn'];
uTemplate[17] = ['Dont remove nsd or nld', "Rem.n(slp)d", "Please do not remove deletion requests, 2nd Warning", 'mark-warn'];
uTemplate[18] = ['Dont remove speedy', "Rem.speedy", "Please do not remove speedy tags", 'mark-warn'];
uTemplate[19] = ['Dont remove warnings', "Rem.warning", "Please do not remove valid warning templates from your talk page", 'mark-warn'];
uTemplate[20] = ['Be civil', "Be civil", "Ask a user to remain civil, even if he or his contributions are being attacked", 'mark-warn'];
uTemplate[21] = ['Be civil final', "Be civil final", "Last request to user to remain civil. Will be blocked next time", 'mark-warn'];
uTemplate[22] = ['Blocked User', "Blocked", "This user has been blocked - without parameters - use manual version for more paras", 'mark-warn'];
uTemplate[23] = ['Inappropriate username', "Inapp.username", "Inform user about his inappropriate username and block", 'mark-warn'];
uTemplate[24] = ['Provide better quality', "Better quality", "Do you have a better version of media?", 'prompt("' + template_mediaquery + '"), 0, true', 'mark-warn'];
uTemplate[25] = ['Attackpage', "Attackpage", "Please do not create attack pages", 'mark-warn'];
uTemplate[26] = ['Dont recreate', "Dont recreate", "Please do not recreate deleted images", 'prompt("' + template_mediaquery + '"), 0, true', 'mark-warn'];
uTemplate[27] = ['Imposter', "Imposter", "Mark account as blocked for impersonation or attack", 'prompt("' + template_usernamequery + '"), 0, false', 'mark-warn'];
uTemplate[28] = ['Sockpuppet', "Sockpuppet", "It is suspected that this user may be a sock puppet or impersonator", 'prompt("' + template_usernamequery + '"), 0, false', 'mark-warn'];
uTemplate[29] = ['Speedywhat', "Speedy warn", "Inform user that one of his uploads has been speedy-deleted", 'prompt("' + template_mediaquery + '"), 0, true', 'mark-warn'];
uTemplate[30] = ['No advertising', "Dont advertise", "Tell user not to advertise on commons and the goals of an educative image collection.", 'mark-warn'];

// Add the template
function template_mark(talkpage_fakeaction, media_name, can_handle_empty_parameter, add_namespace) {
   var pagename = encodeURIComponent(mw.config.get('wgPageName'));
   var editLink = $('#ca-edit a').attr('href');
   editLink += '&fakeaction=' + talkpage_fakeaction;
   if (arguments.length === 4) {
      // User pressed cancel
      if (media_name == null) return;
      // User did not supply parameter and template cannot handle that
      if (media_name == '' && can_handle_empty_parameter != 1) return; 
      // Parameter handling for special cases
      if (add_namespace && media_name.length > 0) media_name = '' + media_name;
      editLink += '&media_name=' + encodeURIComponent(media_name);
   }
   window.document.location = editLink;
}

// Add template to user talk page
function template_addTemplate(template) {
   if (mw.util.getParamValue('media_name')) {
      template = template + '|' + mw.util.getParamValue('media_name');
   }

   var txt = '{{subst:' + template + '}}';
   document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + '\n' + txt + '~~~~';
   //  the edit summary for when you mark the image. You can change it if you want.
   document.editform.wpSummary.value = 'ব্যবহারকারী আলাপ পাতায় \‘' + template + '\’ টেমপ্লেট যোগ';
   if (template_autosave) document.editform.wpSave.click();
}

function template_onload() {
   var cur;
   if (mw.config.get('wgNamespaceNumber') == 3) { //NS_USERTALK
      for (var i=0; i < uTemplate.length; i++) {
        cur = uTemplate[i];
        if (typeof cur[4] != 'undefined') {
          mw.util.addPortletLink('p-tb', 'javascript:template_mark(' + i + ',' + cur[3] + ')', cur[1], cur[4], cur[0], null, null);
        } else {
          mw.util.addPortletLink('p-tb', 'javascript:template_mark(' + i +')', cur[1], cur[3], cur[0], null, null);
        }
      }
   }

   var fakeaction = mw.util.getParamValue('fakeaction');
   if (fakeaction === null) return;
   var action_idx = parseInt(fakeaction, 10);
   if (action_idx >= 0 && action_idx < uTemplate.length) {
      template_addTemplate(uTemplate[action_idx][0]);
   }
}
$(document).ready(template_onload);

// </nowiki>