« MediaWiki:Gadget-LiveRC.js » : différence entre les versions

Contenu supprimé Contenu ajouté
EDUCA33E (discussion | contributions)
m modif
EDUCA33E (discussion | contributions)
m leafnode
Ligne 3 :
*Documentation : [[:fr:User:EDUCA33E/LiveRC/Documentation]]
*Authors : [[:fr:User:EDUCA33E]], [[:fr:User:TiChou]] & [[:pl:User:Leafnode]]
*Version: 0.3.5a6 (beta)
 
Version modifiée basée sur la version du 1er avril 2007 àa 00:49 :
 
http://fr.wikipedia.org/w/index.php?title=User:EDUCA33E/LiveRC.js&oldid=15525649
Ligne 14 :
 
if (wgTitle == "EDUCA33E/LiveRC") {
 
continue;
// Appel des paramètresparametres par défaut de LiveRC ;
// ///////////////////////////////////////////
document.write('<script type="text/javascript" src="'
Ligne 21 :
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
// Appel des paramètresparametres utilisateur ;
// ///////////////////////////////////////////
document.write('<script type="text/javascript" src="'
+ wgServer + wgScriptPath + '/index.php?title=User:'+encodeURI(wgUserName)+'/LiveRCparam.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
var cssNode = document.createElement('link');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.href = 'http://pl.wikipedia.org/skins-1.5/common/diff.css?90';
cssNode.media = 'screen';
cssNode.title = 'dynamicLoadedSheet';
document.getElementsByTagName("head")[0].appendChild(cssNode);
 
document.write('<script type="text/javascript" src="http://pl.wikipedia.org/skins-1.5/common/diff.js?90"></script>');
 
var lastrevid,lasttimestamp=1; // Timestamp d'initialisation;
 
// Découpage de l'URL et de ses paramètresparametres;
 
var _GET = new Array();
Ligne 69 ⟶ 79 :
var lstContact = new Array(); // Contact list;
var lstRevoc = new Array(); // Reverted list;
var lstHidden = new Array(); // Hidden users list;
 
// Is user Sysop;
Ligne 189 ⟶ 200 :
var id=data.mid;
var bC = doc.getElementById('bodyContent');
if (bC == null) bC = doc.getElementById('article')
var LP = document.getElementById( 'livePreview' );
var dLP = document.getElementById( 'divLivePreview' );
Ligne 236 ⟶ 248 :
 
// Get username of submitter
var user1 = getElementsByClassdoc.getElementById( 'mw-diff-otitle',doc,'tdotitle2' );
if (user1 != null && user1[0] != null) {
var usertmp=user1[0].innerHTML;
user1 = usertmp.replace(new RegExp(/(.*)<bra (.*)>(.*)<\/a> \(<a(.*)/g), "$32");
}
var user2 = getElementsByClassdoc.getElementById( 'mw-diff-ntitle',doc,'tdntitle2' );
if (user2 != null && user2[0] != null) {
var usertmp=user2[0].innerHTML;
user2 = usertmp.replace(new RegExp(/(.*)<bra (.*)>(.*)<\/a> \(<a(.*)/g), "$32");
}
user1=user1.replace(new RegExp(/\'/g), "\\'");
Ligne 350 ⟶ 362 :
/* case 'livevandalism':
var wpSummary = 'LiveRC : Révocation de vandalisme par [[Special:Contributions/' + user2 + '|' + user2
+ ']]; retour àa la version de [[User:' + user1 + '|' + user1 + ']]';
break; */
}
Ligne 380 ⟶ 392 :
doc = gml_XMLParse(xmlreq.responseText);
bC = doc.getElementById('bodyContent')
if (bC == null) bC = doc.getElementById('article')
var c=data.message;
var LP = document.getElementById( 'livePreview' );
Ligne 408 ⟶ 421 :
doc = gml_XMLParse(xmlreq.responseText);
bC = doc.getElementById('bodyContent')
if (bC == null) bC = doc.getElementById('article')
var c=data.message;
var LP = document.getElementById( 'livePreview' );
Ligne 437 ⟶ 451 :
doc = gml_XMLParse(xmlreq.responseText);
bC = doc.getElementById('bodyContent')
if (bC == null) bC = doc.getElementById('article')
var user=data.message;
var LP = document.getElementById( 'livePreview' );
Ligne 465 ⟶ 480 :
/* </source>
 
=== LiveSuiviLiveSysop ===
 
<source lang="javascript"> */
Ligne 471 ⟶ 486 :
function liveSysop() {
wpajax.http({url:wgServer + wgScriptPath + '/index.php?title=Special:Listusers&limit=500&group=sysop',
onSuccess: getSysop, message: "RécupPobieranie sysoplistlisty adminów" });
}
 
Ligne 477 ⟶ 492 :
var doc = gml_XMLParse(xmlreq.responseText);
var bC = doc.getElementById('bodyContent');
if (bC == null) bC = doc.getElementById('article')
var lstSys = bC.getElementsByTagName( 'ul' )[ 0 ].getElementsByTagName( 'li' );
var info="";
Ligne 489 ⟶ 505 :
function liveWatch() {
wpajax.http({url:wgServer + '/wiki/Special:Watchlist/edit',
onSuccess: getWatch, message: "RécupPobieranie watchlistobserwowanych" });
}
 
Ligne 495 ⟶ 511 :
var doc = gml_XMLParse(xmlreq.responseText);
var bC = doc.getElementById('bodyContent');
if (bC == null) bC = doc.getElementById('article')
var info="";
var lstUL = bC.getElementsByTagName( 'ul' );
Ligne 512 ⟶ 529 :
/* function liveWatch() {
wpajax.http({url:wgServer + wgScriptPath + '/api.php?action=query&list=watchlist&wllimit=500&format=xml',
onSuccess: getWatch, message: "RécupPobieranie watchlistlisty obserwowanych" });
}
 
Ligne 538 ⟶ 555 :
function liveNS() {
wpajax.http({url: wgServer + wgScriptPath + '/api.php?action=query&meta=siteinfo&siprop=namespaces&format=xml',
onSuccess: getNS, message: "RécupPobieranie NSnazw przestrzeni" });
}
 
Ligne 665 ⟶ 682 :
var hh = (tt - mm) / 60 % 24;
return hh + ':' + (mm < 10 ? '0' : '') + mm;
}
 
function updateHidden() {
var tempAr = new Array();
for (var user in lstHidden) {
var utilde = user.replace(new RegExp(/\'/g), "\\'");
var uremove = '<a href="javascript:;" onClick="unhideUser(\''+utilde+'\');" style="color:grey">-</a>';
var udiscut = '<a href="'+wgServer+'/wiki/User talk:'+encodeURIComponent(user)+'" style="color:seagreen" target="_new">T</a>';
var ucontrib = '<a href="javascript:;" onClick="liveContrib(\''+utilde+'\');" style="color:#43CD80">C</a>';
var uadmin = '';
if (lrcAdmin == true) {
uadmin = ' • <a href="'+wgServer+'/wiki/Special:Blockip/'+encodeURI(user)+'" target="_new" style="color:seagreen">B</a>';
}
var ueditor = '<a href="'+wgServer+'/wiki/User:'+encodeURIComponent(user)+'" target="_new">'+user+'</a>';
var ligne = '<span id="hidden-' + user + '"><small>' + uremove + ' • ' + udiscut + ' • ' + ucontrib + uadmin + ' • </small>' + ueditor + '</span><br />';
tempAr.push(ligne);
}
tempAr.sort();
var lvHidden = document.getElementById('liveHidden');
lvHidden.innerHTML = "";
var len = tempAr.length;
for (var n=len-1; n>=0; n--)
lvHidden.innerHTML += tempAr[n];
}
 
Ligne 803 ⟶ 843 :
preArti += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Copyright.svg/16px-Copyright.svg.png" width="16px" alt="Copyright" /> ';
 
// PàSPaS ? ;
//////////////////
if (state & PAS)
preArti += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Cestino_pieno_architetto_01.svg/11px-Cestino_pieno_architetto_01.svg.png" height="11px" alt="PàSPaS" /> ';
 
// Intervention wikipompiers ? ;
Ligne 868 ⟶ 908 :
+ preArti + arti + postArti;
th1.className="creator-title";
topth1.style.display textAlign= "noneleft";
th1.style.border="1px";
th1.style.width="40%";
Ligne 903 ⟶ 944 :
uadmin = ' • <a href="'+wgServer+'/wiki/Special:Blockip/'+encodeURI(user)+'" target="_new" style="color:seagreen">B</a>';
}
 
var uhide = '<a href="javascript:;" onClick="supprLigne(\''+pageid+'_'+revid+'\'); hideUser(\''+ user +'\');" style="color:grey">H</a>'
td2.innerHTML = '<small>' + discut + ' • ' + contrib + uadmin + ' • </small>'
td2.innerHTML = '<small>' + discut + ' • ' + contrib + ' • ' + uhide + uadmin + ' • </small>'
+ preEditor + editor;
td2.className="creator-name";
Ligne 1 063 ⟶ 1 106 :
regex.compile(/\[\[Special:Contributions\/([^\]\|]+)/);
match = regex.exec(comment);
 
if (!match) {
regex.compile(/\[\[Specjalna:Wkład\/([^\]\|]+)/);
match = regex.exec(comment);
}
if (match) {
var userR = match[1];
Ligne 1 174 ⟶ 1 223 :
if (lstSysop.indexOf(rc.user) != -1)
rc.state += SYSOP;
 
var mitigating &&= !(rc.state & BLANKINGREVERT)
|| (rc.state & BLANKING)
|| (rc.state & REPLACED)
&&|| !(lstContact[rc.user])
&&|| !(lstRevoc[rc.user])
&&|| (rc.user !== wgUserName)) continue;
 
if (document.getElementById('showIP').checked
&& !(rc.state & IP)
&& !(rc.statemitigating & REVERT) continue;
 
&& !(rc.state & BLANKING)
if && !(lstHidden[rc.stateuser] && REPLACED!mitigating) continue;
&& !(lstContact[rc.user])
&& !(lstRevoc[rc.user])
&& (rc.user != wgUserName)) continue;
 
wpajax.http({url: wgServer + wgScriptPath + '/query.php?titles=' + encodeURIComponent(rc.title) + '&what=redirects|categories&format=xml',
Ligne 1 212 ⟶ 1 265 :
onSuccess: getRC, message: "Traitement en cours...\n\n" });
}
 
function hideUser(name) {
lstHidden[name] = true;
updateHidden();
}
 
function unhideUser(name) {
delete lstHidden[name];
updateHidden();
}
 
function showHideObj(parent, fils) {
Ligne 1 224 ⟶ 1 287 :
if (wgTitle == "EDUCA33E/LiveRC") {
 
var top = document.getElementById( 'top' ); top.innerHTML = "";
if (top != null) {
top.innerHTML = "";
top.style.display = "none";
}
var siteSub = document.getElementById( 'siteSub' );
var contentSub = document.getElementById( 'contentSub' );
Ligne 1 231 ⟶ 1 298 :
var pca = document.getElementById( 'p-cactions' );
 
top.style.display = "none";
if (siteSub != null) siteSub.style.display = "none";
if (contentSub != null) contentSub.style.display = "none";
if (rtb != null) rtb.style.display = "none";
if (rt != null) rt.style.display = "none";