Utilisateur:Cantons-de-l'Est/common.js
De Wikipedia, l'encyclopédie encyclopedia
// Script d'affichage et d'édition des courtes descriptions sur Wikidata // https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Le_Bistro/31_octobre_2020#Script_Shortdesc_helper_pour_voir/modifier_les_descriptions_WD mw.loader.getScript( 'https://en.wikipedia.org/w/load.php?modules=ext.gadget.libSettings' ).then( function() { mw.loader.load( 'https://en.wikipedia.org/w/load.php?modules=ext.gadget.Shortdesc-helper' ); })
// Organise les liens interwiki selon un certain ordre // Auteur : Sanao, d'après une idée de Lilyu ; réécriture complète par Arkanosis
// Trie les interwiki selon un ordre défini par la variable globale order_lang $(function() {
var langs = $('#p-lang ul'); var order = ( typeof order_lang === 'undefined' ? [ 'en', 'de', 'it' ] : order_lang ).reverse(); $.each(order, function(_, lang) { langs.find('li.interwiki-' + lang).prependTo(langs); });
});
// Faire apparaître les modifications non relues dans l'historique d'une page importScript('Utilisateur:Orlodrim/hist-relecture.js');
// Faire apparaître les modifications non relues dans l'historique de contributions importScript('Utilisateur:Orlodrim/contribs-relecture.js');
/////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////// // Créé un ToDo list (un bouton est ajouté en haut des pages de Wikipédia en français // Copie de https://en.wikipedia.org/w/index.php?title=User:BrandonXLF/TodoList.js // 2020-01-05 /*** Todo List ***/
// Adds a todo list that also has a convient popup // Documentation at User:BrandonXLF/TodoList // By User:BrandonXLF
$.when(mw.loader.using([ 'mediawiki.user', 'oojs-ui-core', 'oojs-ui-windows', 'oojs-ui.styles.icons-movement', 'oojs-ui.styles.icons-editing-core', 'oojs-ui.styles.icons-interactions', 'oojs-ui.styles.icons-moderation', 'oojs-ui.styles.icons-content' ]),$.ready).then(function(){ mw.util.addCSS( '.userjs-todo-list .item:hover .act { visibility: visible !important; }' + '[data-drop="above"]::before { display: block; border-top: 2px solid #066; margin-top: -2px; content: ""; }' + '[data-drop="below"]::after { display: block; border-top: 2px solid #066; margin-top: -2px; content: ""; }' + '.userjs-todo-list .items:empty { border: none !important; margin: 0 !important; padding: 0 !important;}' + '.userjs-todo-moreinfo > a { min-width: unset !important; min-height: unset !important; padding: 0.65em !important; }' + '.userjs-todo-moreinfo > a > span { min-width: unset !important; min-height: unset !important; width: 1.3em !important; left: 0 !important; }' ); if (mw.config.get('skin') === 'minerva') { mw.util.addCSS( '.userjs-todo-list .item .act { visibility: visible !important; }' + '#userjs-todo-popup { top: 0 !important; bottom: 0 !important; left: 0 !important; right: 0 !important; width: 100%; height: 100%; }' + '#userjs-todo-popup .userjs-todo-list { width: 100%; height: 100%; } ' ); } var api = new mw.Api(); var link = $(mw.util.addPortletLink('p-personal', mw.util.getUrl('Special:BlankPage/todo'), 'Todo', 'userjs-todo', 'Click to see your todo list', 'd', '#pt-preferences')); var changes = [mw.user.options.get('userjs-todo-script')]; var undo = 0; var req = 0; var parent; var ispopup = false; var loader = $('<input type="file" accept=".json" style="display:none;">').on('change',function(e){ if (!this.files || !this.files[0]) return; var file = this.files[0];
var reader = new FileReader(); reader.onload = function (e) { save(reader.result, true, true); }; reader.readAsText(file);
}).appendTo(document.body);
$(window).on('beforeunload',function () { if (req > 0) return true; });
function save (what, record, relist) { if (typeof what != 'string') { what = JSON.stringify(what); } mw.user.options.set('userjs-todo-script', what); req++; parent.find('.status').text('Saving changes...'); api.saveOption('userjs-todo-script', what).done(function(){ req--; if (req === 0) { parent.find('.status').text(); } }); if (record !== false) { while (undo > 0) { changes.pop(); undo--; } changes.push(mw.user.options.get('userjs-todo-script')); if (changes.length > 50) changes.shift(); } if (relist) { list(); if (req > 0) { parent.find('.status').text('Saving changes...'); } } }
Math.clamp = function (max, x, min) { return Math.min(max, Math.max(min, x)); };
function item (parent, array) { var date = new Date(+array[2]); var url = array[0] || ; var txt = array[0] || ; if (url.match(/^(https:|http:|:)\/\//) && url.match(/ /)) { var reg = /(.*?) (.*)/.exec(url); url = reg[1]; txt = reg[2]; } else if (!url.match(/^(https:|http:|:)\/\//)) { url = mw.util.getUrl(url); }
parent.append($('
')
.attr('data-page', array[0] || ) .attr('data-info', array[1] || ) .attr('data-date', array[2] || ) .append((new OO.ui.IconWidget({icon:'draggable',title:'Drag'})).$element .css({cursor:'move',height:'1.2em',width:'1.2em',minWidth:'unset',minHeight:'unset',marginRight:'0.5em'}) .on('mousedown',function(){ $(this).parent().attr('draggable','true'); }) .on('mouseup',function(){ $(this).parent().attr('draggable','false'); }) ) .append('<a class="page" href="' + url + '">' + txt + '</a>') .append(array[0] && array[1] ? ' . . ' : ) .append('' + (array[1] || ) + '') .append(array[0] || array[1] ? ' . . ' : ) .append((new OO.ui.IconWidget({icon:'trash',title:'Delete',flags:['destructive']})).$element .css({cursor:'pointer',visibility:'hidden',height:'1.1em',width:'1.1em',minWidth:'unset',minHeight:'unset',marginRight:'0.5em'}) .addClass('act') .click(function(){ var arr = []; $(this).parent().siblings().each(function(i){ arr.push([$(this).attr('data-page'),$(this).attr('data-info'),$(this).attr('data-date')]); }); $(this).parent().remove(); save(arr); }) ) .append((new OO.ui.IconWidget({icon:'edit',title:'Edit',flags:['progressive']})).$element .css({cursor:'pointer',visibility:'hidden',height:'1em',width:'1em',minWidth:'unset',minHeight:'unset',marginRight:'0.5em'}) .addClass('act edit') .click(function(){ $(this).css('display','none');
$('
')
.append((new OO.ui.TextInputWidget({ placeholder: 'Page name or URL', value: $(this).parent().attr('data-page') })).$element.css({maxWidth:'unset',margin:'4px 0'})) .append((new OO.ui.TextInputWidget({ placeholder: 'Comment', value: $(this).parent().attr('data-info') })).$element.css({maxWidth:'unset',margin:'4px 0'}))
.append($('
').append($('') .append($('').append((new OO.ui.ButtonWidget({ label: 'Save', flags: ['progressive'] }).$element.css('width','100%').children().css('width','100%').parent()).click(function(){ var editbox = $(this).parent().parent().parent().parent(); var listitem = editbox.parent(); listitem.find('.page').text(editbox.find('input[placeholder="Page name or URL"]').val()); listitem.attr('data-page',editbox.find('input[placeholder="Page name or URL"]').val()); listitem.find('.info').text(editbox.find('input[placeholder="Comment"]').val()); if (listitem.find('.info')[0].previousSibling.nodeType != 3 && editbox.find('input[placeholder="Comment"]').val() !== ) { listitem.find('.info').before(' . . '); } else if (listitem.find('.info')[0].previousSibling.nodeType == 3 && editbox.find('input[placeholder="Comment"]').val() === ) { $(listitem.find('.info')[0].previousSibling).remove(); } listitem.attr('data-info',editbox.find('input[placeholder="Comment"]').val()); var arr = []; listitem.parent().children().each(function(i){ arr.push([$(this).attr('data-page'),$(this).attr('data-info'),$(this).attr('data-date')]); }); save(arr); link.find('.redo').remove(); listitem.find('.edit').css('display','inline-block'); editbox.remove(); }) )) .append($('').append((new OO.ui.ButtonWidget({ label: 'Cancel', flags: ['destructive'] }).$element.css('width','100%').children().css('width','100%').parent()).click(function(){ var editbox = $(this).parent().parent().parent().parent(); var listitem = editbox.parent(); listitem.find('.edit').css('display','inline-block'); editbox.remove(); }) )) )).appendTo(this.parentNode); }) ) .append(array[2] ? (new OO.ui.PopupButtonWidget( { icon: 'info', framed: false, label: 'More information', invisibleLabel: true, title: 'More information', popup: { $content: $('
').text('Added: ' + date.getDate() + ' ' + ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][date.getMonth()] + ', ' + date.getFullYear() + ' at ' + date.getHours() + ':' + ( + date.getMinutes()).padStart(2,'0')),
padded: true, align: 'forwards' } })).$element .addClass('userjs-todo-moreinfo') .css({cursor:'pointer',visibility:'hidden',height:'1.3em',width:'1.3em',minWidth:'unset',minHeight:'unset',marginRight:'0.5em'}) .addClass('act') : ) .on('dragover',function(e){ e.preventDefault(); e.dataTransfer = e.originalEvent.dataTransfer; if (e.offsetY < ($(this).height()/2)) { this.setAttribute('data-drop','above'); } else { this.setAttribute('data-drop','below'); } }) .on('dragleave',function(){ this.setAttribute('data-drop',); }) .on('drop',function(e){ e.dataTransfer = e.originalEvent.dataTransfer; this.setAttribute('data-drop',); var ele = $('[data-dragid="' + e.dataTransfer.getData('text/plain') + '"]')[0]; if (e.offsetY < ($(this).height()/2)) { this.insertAdjacentElement('beforebegin', ele); } else { this.insertAdjacentElement('afterend', ele); } var arr = []; $(this).parent().children().each(function(i){ arr.push([$(this).attr('data-page'),$(this).attr('data-info'),$(this).attr('data-date') || ]); }); save(arr); }) .on('dragstart',function(e){ e.dataTransfer = e.originalEvent.dataTransfer; var uid = ( + Math.random()).replace('.',); $(this).attr('data-dragid',uid); e.dataTransfer.setData('text/plain',uid); }) ); } function list () { $('.userjs-todo-list').remove();
var todo = parent.append($('
') .append($('
')
.append(new OO.ui.ButtonWidget({ framed: false, icon: 'undo', invisibleLabel: true, title: 'Undo' }).$element.click(function(){ if (changes[changes.length-undo-2] !== undefined) { save(changes[changes.length-undo-2],false,true); undo++; } })) .append(new OO.ui.ButtonWidget({ framed: false, icon: 'redo', invisibleLabel: true, title: 'Redo' }).$element.click(function(){ if (changes[changes.length-undo] !== undefined) { save(changes[changes.length-undo],false,true); undo--; } })) .append(new OO.ui.ButtonWidget({ framed: false, icon: 'trash', invisibleLabel: true, title: 'Clear' }).$element.click(function(){ OO.ui.confirm('Are you sure you want to clear your todo list?').done(function(confirmed){ if (confirmed) { parent.find('.items').empty(); save(,true,true); } }); })) .append(new OO.ui.ButtonWidget({ framed: false, icon: 'download', invisibleLabel: true, title: 'Download' }).$element.click(function(){ $($('<a download="todo.json" style="display:none;"></a>').attr('href','data:text/plain;charset=utf-8,' + encodeURIComponent(mw.user.options.get('userjs-todo-script'))).appendTo(document.body)[0].click()).remove(); })) .append(new OO.ui.ButtonWidget({ framed: false, icon: 'upload', invisibleLabel: true, title: 'Upload' }).$element.click(function(){ loader.click(); })) .append(new OO.ui.ButtonWidget({ framed: false, icon: 'info', invisibleLabel: true, title: 'Help' }).$element.click(function(){
OO.ui.alert($('
') .append('
Todo List Help
') .append('
Adding and editing items
') .append($('
') .append('
- Ex:
Main Page
- Ex:
://www.example.com
- Ex:
https://example.com Example
') ) .append('
Notes
') .append($('
') .append('
https://
, http://
or ://
or else it will be treated as a page name. Page names will by automatically converted to a link to the wiki article with that title.') .append('
https://example.com Example
will show up as Example
since URLs cannot contain spaces. Spaces can be repersented as %20
, _
or +
.') .append('
') .append('
') ) .append('
Managing and deleting items
') .append('
Global
') .append($('
') .append('
') .append('
') .append('
') .append('
') ) .append('
Item specfic
') .append($('
') .append($('
')
.append((new OO.ui.IconWidget({icon:'draggable'}).$element.css({height:'1.2em',width:'1.2em',minWidth:'unset',minHeight:'unset',marginRight:'0.5em'})))
.append('Drag: Drag to change the position of the item.
')
)
.append($('
')
.append((new OO.ui.IconWidget({icon:'trash',flags:['destructive']})).$element.css({height:'1.1em',width:'1.1em',minWidth:'unset',minHeight:'unset',marginRight:'0.5em'}))
.append('Delete: Delete an item.
')
)
.append($('
')
.append((new OO.ui.IconWidget({icon:'edit',flags:['progressive']})).$element.css({height:'1em',width:'1em',minWidth:'unset',minHeight:'unset',marginRight:'0.5em'}))
.append('Edit: Edit an item (page name & comment)
')
)
.append($('
') .append((new OO.ui.IconWidget({icon:'info'})).$element.css({height:'1.3em',width:'1.3em',minWidth:'unset',minHeight:'unset',marginRight:'0.2em'})) .append('More information: View more information about an item.') ) ) .append('
Saving changes
') .append('
- All changes are synced with the API after an action is performed (saving, deleting, dragging etc.).
- When a change is being saved the text "Saving changes..." should appear at the end of the list. Do not leave the page or close the popup until the text dissapears as this may cause changes to not be saved.
') .append('
About
') .append('
')
,{size:'large'}); })) )
.append($('
')
.append((new OO.ui.TextInputWidget({ placeholder: 'Page name or URL', value: mw.config.get('wgPageName').replace(/_/g,' ') != 'Special:BlankPage/todo' ? mw.config.get('wgPageName').replace(/_/g,' ') : })).$element.css({maxWidth:'unset',margin:'4px 0'})) .append((new OO.ui.TextInputWidget({ placeholder: 'Comment' })).$element.css({maxWidth:'unset',margin:'4px 0'})) .append((new OO.ui.ButtonWidget({ label: 'Add' }).$element.css('width','100%').children().css('width','100%').parent()).click(function(){ var opts = JSON.parse(mw.user.options.get('userjs-todo-script') || '[]'); var arr = []; arr.push($(this).parent().parent().find('input[placeholder="Page name or URL"]').val()); arr.push($(this).parent().parent().find('input[placeholder="Comment"]').val()); if (!arr.join()) return; arr.push((new Date()).getTime()); item($('.userjs-todo-list .items'), arr); opts.push(arr); save(opts); })) )
.append($('
')) .append('
')
); if (ispopup) { todo.find('.todo-menu') .css('cursor','grab') .append((new OO.ui.ButtonWidget({ framed: false, icon: 'close', invisibleLabel: true, title: 'Close' }).$element.css({float:'right',marginRight:'0'}).click(function(){ parent.remove(); }))) .append(($('<a></a>').attr('href',mw.util.getUrl('Special:BlankPage/todo')).append((new OO.ui.ButtonWidget({ framed: false, icon: 'newWindow', invisibleLabel: true, title: 'Your Todo List' }).$element.css('float','right').click(function(){ location.url = mw.util.getUrl('Special:BlankPage/todo'); }))))) .on('mousedown',function(e){ if (e.target !== this) return; this.style.cursor = 'grabbing'; var x = parent.position().left - e.pageX; var y = parent.position().top - e.pageY; var b = $(document.body); function move (e) { parent.css({ left: Math.clamp($(window).width() - parent.width(), e.pageX + x, 0) + 'px', top: Math.clamp($(window).height() - parent.height(), e.pageY + y, 0) + 'px', right: , bottom: }); } function up () { e.target.style.cursor = 'grab'; b.off('mousemove', move); b.off('mouseup', up); } b.on('mousemove',move); b.on('mouseup',up); }); } $.each(JSON.parse(mw.user.options.get('userjs-todo-script') || '[]'), function (a,b) { item(todo.find('.items'), b); }); return todo; } function repos (pos,css,pvar,cond,pcss,ccss) {
return $('
').attr('id',pos + 'gfdgfdgfd').css('cursor',pos + '-resize').css(css).on('mousedown',function(e){
if (e.target !== this) return; var p = parent; var c = p.find('.userjs-todo-list'); var q = eval(pvar); var q = eval(pvar); var b = $(document.body); b.css('user-select','none'); function move (e) { if (eval(cond)) return; (new Function('e', 'p', 'q', 'p.css(' + pcss + ')'))(e, p, q); (new Function('e', 'c', 'q', 'c.css(' + ccss + ')'))(e, c, q); } function up () { b.css('user-select',); b.off('mousemove', move); b.off('mouseup', up); } b.on('mousemove', move); b.on('mouseup', up); }); } if (mw.config.get('wgPageName') === 'Special:BlankPage/todo') { document.title = 'Your Todo List - ' + mw.config.get('wgSiteName'); $('#firstHeading').text('Your Todo List'); parent = mw.util.$content.empty(); list(); link.children().first().click(function(e){ e.preventDefault(); mw.notify('Unable to open todo list popup while on the todo list page.',{tag:'rtbyilounmt7udfnod'}); }); } else { link.children().first().click(function(e){ e.preventDefault(); if ($('#userjs-todo-popup')[0]) { $('#userjs-todo-popup').remove(); return; } ispopup = true;
parent = $('
')
.appendTo(document.body) .css('top',link.position().top + link.height() + 8 + 'px')
.append($('
')
.append(repos('e',{top:0,right:0,width:'7px',height:'100%'},'p.position().left','e.clientX - q < 40','{right:"",minWidth:"",left:q + "px"}','{width:e.clientX - q + "px"}')) .append(repos('n',{top:0,height:'7px',width:'100%'},'p.position().top + p.height()','q <= e.clientY + 40','{top:Math.max(e.clientY, 0) + "px"}','{height:q - e.clientY + "px"}')) .append(repos('s',{bottom:0,height:'7px',width:'100%'},'p.position().top','e.clientY - q < 40','{top:q + "px"}','{height:e.clientY - q + "px"}')) .append(repos('w',{left:0,width:'7px',height:'100%'},'p.position().left + parent.width()','q <= e.clientX + 40','{right:"",minWidth:"",left:e.clientX + "px"}','{width:q - e.clientX + "px"}'))
.append($('
').on('mousedown',function(e){
e.originalEvent.stopImmediatePropagation(); $('#egfdgfdgfd').trigger('mousedown'); $('#ngfdgfdgfd').trigger('mousedown'); }))
.append($('
').on('mousedown',function(e){
e.originalEvent.stopImmediatePropagation(); $('#wgfdgfdgfd').trigger('mousedown'); $('#ngfdgfdgfd').trigger('mousedown'); }))
.append($('
').on('mousedown',function(e){
e.originalEvent.stopImmediatePropagation(); $('#egfdgfdgfd').trigger('mousedown'); $('#sgfdgfdgfd').trigger('mousedown'); }))
.append($('
').on('mousedown',function(e){
e.originalEvent.stopImmediatePropagation(); $('#wgfdgfdgfd').trigger('mousedown'); $('#sgfdgfdgfd').trigger('mousedown'); })) ); list(); }); } });
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Dans n'importe quel historique, transforme le bouton « Comparer les versions sélectionnées » en hyperlien (on peut donc charger n'importe quel diff dans un autre onglet :-)
// Copie de https://en.wikipedia.org/w/index.php?title=User:Mattflaschen/Compare_link.js
// 2020-01-05
/**
* Convert the "Compare selected versions" button to a link * (Based on w:en:User:Superm401/Compare_link.js) * @source: http://www.mediawiki.org/wiki/Snippets/Compare_link * @rev: 2 * @see: bugzilla:16165 * * Copyright 2006-2013 Matthew Flaschen (User:Superm401), User:Helder.wiki * * In addition to the GFDL and CC-BY-SA: * * This function (compare link) is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This function is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * A copy of the GPL is available at https://www.gnu.org/licenses/gpl-2.0.txt . * * By modifying Snippets/Compare_link: * You agree to dual-license your contributions under both the * GFDL (http://en.wikipedia.org/wiki/WP:GFDL) and version 2 of the GPL * (https://www.gnu.org/licenses/gpl-2.0.txt) or any later version * of the GPL published by the FSF. * */
function fixCompare() { var $histForm = $('#mw-history-compare'), $diffList = $('#pagehistory'), $buttons = $histForm.find('input.historysubmit'), buttonText, $compareLink; if ( $buttons.length === 0 ) { // Only one version, so do nothing return; }
buttonText = $buttons
.remove() .first().val(); $compareLink = $('<a></a>', { 'class': 'compare-link', 'text': buttonText }); $histForm .prepend($compareLink) .append($compareLink.clone()); var updateCompare = function(){ var $radio = $histForm.find('input[type=radio]:checked'), genLink = mw.config.get('wgScript') + '?title=' + mw.util.wikiUrlencode( mw.config.get( 'wgPageName' ) ) + '&diff=' + $radio.eq(0).val() + '&oldid=' + $radio.eq(1).val(); $('.compare-link').each(function() { $(this).attr('href', genLink); }); }; updateCompare(); $diffList.change(updateCompare); }
if ( mw.config.get('wgAction') === 'history' ) { mw.util.addCSS( '.compare-link { border-radius:5px; color:black; text-decoration:none; border-width:1px 2px 2px 1px; border-style:solid; border-color:#DDDDDD #BBBBBB #BBBBBB #DDDDDD; padding:0.2em 1em; background-color:#EEEEEE; white-space:nowrap; } .compare-link:active{ border-width:0.1em; margin:0.1em; }' ); $(fixCompare); }
/////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // Barre de navigation // // Pour créer votre barre, consultez // https://fr.wikipedia.org/wiki/Modèle:Barre_de_navigation // // (Concept de Cantons-de-l'Est inspiré d'un outil du contributeur Lepsyleon.) ////////////////////////////////////////////////////////////////////////////// var BoutonsNavigation3 = function ($) {
var Today = function() { var m = ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"]; var today = new Date(); var day = today.getDate(); var month = m[today.getMonth()]; var year = today.getYear(); if (year<2000) year = year + 1900; return (day + "_" + month + "_" + year); };
var MonthYear = function() { var m = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"]; var today = new Date(); var month = m[today.getMonth()]; var year = today.getYear(); if (year<2000) year = year + 1900; return (month + "_" + year); };
var CurrentYear = function() { var today = new Date(); var year = today.getYear(); if (year<2000) year = year + 1900; return year; };
var Semaine = function() {
var semaine = new Date();
var jour = semaine.getDate();
var mois = semaine.getMonth();
var annee = semaine.getFullYear();
var ListeMois = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
if (annee %4 === 0 && annee %100 !==0 || annee %400 === 0) {ListeMois[1]=29}
var TotalJour=0;
for(var cpt=0; cpt<mois; cpt++){TotalJour+=ListeMois[cpt];}
TotalJour+=jour;
var DebutAn = new Date(annee,0,1);
var JourDebutAn=DebutAn.getDay();
if(JourDebutAn===0){JourDebutAn=7}
TotalJour-=8-JourDebutAn;
var NumSemaine = 1;
NumSemaine+=Math.floor(TotalJour/7);
if(TotalJour%7!==0){NumSemaine+=1}
return("semaine_" + NumSemaine + "_" + annee);
};
var Mois = function() { var m = ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"]; var today = new Date(); var month = m[today.getMonth()]; var year = today.getYear(); if (year<2000) year = year + 1900; return (month + "_" + year); };
var _DivRight = document.createElement('div'); _DivRight.className = "noprint"; _DivRight.setAttribute("style", "position:fixed; display:block; width:20px; margin:0; padding:0; top:20%; right:4px; background-color:#FFF; z-index:3;");
var _HtmlRight = '
- ';
// Haut de la page
_HtmlRight += ' '
+ '
- ' + ' <a title="Haut de la page" href="#" >' + ' <img src="//upload.wikimedia.org/wikipedia/commons/f/fc/2uparrow.png" height=20 width=20 border=0 />' + ' </a>' + ' '; // Bas de la page _HtmlRight += ' ' + '
- ' + ' <a title="Bas de la page" href="#footer" >' + ' <img src="//upload.wikimedia.org/wikipedia/commons/6/68/2downarrow.png" height=20 width=20 border=0 />' + ' </a>' + ' '; // Remerciements _HtmlRight += ' ' + '
- ' + ' <a title="Remerciements" href="https://fr.wikipedia.org/wiki/Utilisateur:Estrie/Remerciements#Décembre_2019" >' + ' <img src="https://upload.wikimedia.org/wikipedia/commons/1/1f/SMirC-thumbsup.svg" height=20 width=20 border=0 />' + ' </a>' + ' '; // Propositions AdQ _HtmlRight += ' ' + '
- ' + ' <a title="Propositions AdQ" href="//fr.wikipedia.org/wiki/Wikipédia:Articles_de_qualité/Propositions" >' + ' <img src="//upload.wikimedia.org/wikipedia/commons/6/66/Fairytale_bookmark_gold.svg" height=20 width=20 border=0 />' + ' </a>' + ' '; // Bulletin des administrateurs _HtmlRight += ' ' + '
- ' + ' <a title="Bulletin des administrateurs" href="//fr.wikipedia.org/wiki/Wikipédia:Bulletin_des_administrateurs" >' + ' <img src="//upload.wikimedia.org/wikipedia/commons/a/a3/Nuvola_apps_klipper.png" height=20 width=20 border=0 />' + ' </a>' + ' '; // RAW (Regards sur les actualités de la Wikimedia) _HtmlRight += ' ' + '
- ' + ' <a title="RAW" href="//fr.wikipedia.org/w/index.php?title=Wikipédia:RAW/Rédaction&redirect=no" >' + ' <img src="//upload.wikimedia.org/wikipedia/commons/thumb/0/02/French-speaking_Wikimedia_community_logo.svg/241px-French-speaking_Wikimedia_community_logo.svg.png" height=20 width=20 border=0 />' + ' </a>' + ' '; // Autobiographie _HtmlRight += + '
- ' + ' <a title="Autobiographie" href="//fr.wikipedia.org/wiki/Utilisateur:Cantons-de-l\'Est/Autobiographie_(' + CurrentYear() + ')#' + MonthYear() + '">' + ' <img src="//upload.wikimedia.org/wikipedia/commons/2/26/Noia_64_apps_wp.png" style="height:20px; border:0;" />' + ' </a>' + ' '; // Biens patrimoniaux du RPCQ sans photo _HtmlRight += + '
- ' + ' <a title="Carte RPCQ" href="https://w.wiki/F6o">' + ' <img src="//upload.wikimedia.org/wikipedia/commons/5/5f/Flag_of_Quebec.svg" style="width:20px; border:0;" />' + ' </a>' + ' '; // Biens du Heritage Places of Ontario sans photo _HtmlRight += + '
- ' + ' <a title="Carte HPO" href="https://w.wiki/UyX">' + ' <img src="//upload.wikimedia.org/wikipedia/commons/8/88/Flag_of_Ontario.svg" style="width:20px; border:0;" />' + ' </a>' + ' '; // Biens du Heritage Places of Canada sans photo _HtmlRight += + '
- ' + ' <a title="Carte HPC" href="https://w.wiki/Jqs">' + ' <img src="//upload.wikimedia.org/wikipedia/commons/d/d9/Flag_of_Canada_%28Pantone%29.svg" style="width:20px; border:0;" />' + ' </a>' + ' '; // Accueil de Commons _HtmlRight += ' ' + '
- ' + ' <a title="Accueil de Commons" href="//commons.wikimedia.org/wiki/" >' + ' <img src="//upload.wikimedia.org/wikipedia/commons/4/4a/Commons-logo.svg" height=20 width=20 border=0 />' + ' </a>' + ' '; _HtmlRight += '
';
_DivRight.innerHTML = _HtmlRight; document.body.insertBefore(_DivRight, document.body.firstChild);
}; $(document).ready(BoutonsNavigation3);