User:Lilyu/Gadgets.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
//personal parameters
//To watch user talk pages, to which you add tags
var AQD2WatchUserTalk = true;
//To watch file pages, to which you add tags
var AQD2WatchFile = true;
//Enable other buttons like "no source" etc 
var AQD2Enhanced = true;


//ajout de boutons supplémentaires du gadget QuickDelete
var AQD2ExtraButtons = [
                {
                    'label': 'Wrong License',
                    'tag': '{\{wl|1=%PARAMETER%}}',
                    'ask': 'Y',
                    'img_summary': 'Tagging as wrongly licensed because : %PARAMETER%',
                    'talk_tag': '\{\{subst:Wrong license note|2=%PARAMETER%|1=%FILE%}}', // filename must be provided like this |1= ... }} because of extraction for tracklist)
                    'talk_summary': 'Notification of possible wrong license',
                    'prompt_text': 'Mauvaise license : raison ?'

                },

                //notice talk_tag and talk_summary must be '' (void string) if uploader must not be notified
                {
                    'label': 'Duplicate',
                    'tag': '{\{duplicate|1=%PARAMETER%|user=%USER%}}',
                    'ask': 'Y',
                    'img_summary': 'Tagging as duplicate of [[%PARAMETER%]]',
                    'talk_tag': '',
                    'talk_summary': '',
                    'prompt_text': 'Duplicate : Quelle est l\'image d\'origine ?'

                },

                //notice talk_tag and talk_summary must be '' (void string) if uploader must not be notified
                {
                    'label': 'Speedy',
                    'tag': '{\{Speedydelete|1=%PARAMETER%}}',
                    'ask': 'Y',
                    'img_summary': 'Tagging as speedy delete because : %PARAMETER%',
                    'talk_tag': '',
                    'talk_summary': '',
                    'prompt_text': 'Speedy : raison ?  IL FAUT PREVENIR UPLOADER'
                }
                ];

// ajout d'une ligne de séparation dans la boite p-Gadgets
function addspace(element)
{
   //' <div style="text-align:center;">----</div>'
   var space = document.createElement('div');
   space.innerHTML = '----';
   space.style.textAlign = 'center' ;
   element.appendChild(space);
}

// réorganisation des liens
function trier()
{
    var UL =  document.getElementById('G-listing');
    var lines = UL.getElementsByTagName('li');

    var long = lines.length - 2 ;
 
    UL.appendChild(lines[0]);
    var stop=long-3;
    for (i = long ; i > stop; i--)  UL.appendChild(lines[i]);
    addspace(UL);
    for (i = stop ; i > 0; i--)  UL.appendChild(lines[i]);
    addspace(UL); 

    var lines = UL.getElementsByTagName('li');
    UL.appendChild(lines[1]); 
}

function install_Gadgets()
{
    var Container = document.getElementById('p-container');
    Container.innerHTML += 
       '<div class="p-class" id="p-Gadgets">'
     + ' <h5 class="p-class-title" >Gadgets</h5>'
     + ' <div class="body">'
     + '   <ul id="G-listing">'
     + '   </ul>'
     + ' </div>'
     + '</div> ';
 AQD2.install(); 
 trier();
}