(Annulation des modifications 427175 de Fujimaru-kun (discussion)) Balise : Annulation |
Aucun résumé des modifications |
||
Ligne 3 : | Ligne 3 : | ||
articles: [ |
articles: [ |
||
'u:dev:MediaWiki:MultiUpload.js', |
'u:dev:MediaWiki:MultiUpload.js', |
||
+ | 'u:dev:MediaWiki:MassNullEdit/code.js' |
||
] |
] |
||
}); |
}); |
||
Ligne 32 : | Ligne 33 : | ||
− | mw.loader.getScript('https://dev.fandom.com/index.php?title=MediaWiki:MassNullEdit/code.js&action=raw&ctype=text/javascript'); |
+ | //mw.loader.getScript('https://dev.fandom.com/index.php?title=MediaWiki:MassNullEdit/code.js&action=raw&ctype=text/javascript'); |
+ | (function() { |
||
+ | 'use strict'; |
||
+ | var config = mw.config.get([ |
||
+ | 'wgAction', |
||
+ | 'wgPageName', |
||
+ | 'wgScriptPath', |
||
+ | 'wgNamespaceNumber', |
||
+ | 'wgVersion' |
||
+ | ]), |
||
+ | isUCP = config.wgVersion !== '1.19.24'; |
||
+ | // Run conditions |
||
+ | if (config.wgNamespaceNumber != 0 || window.MobilePreview) { |
||
+ | return; |
||
+ | } |
||
+ | window.MobilePreview = true; |
||
+ | var formData = new FormData(), |
||
+ | module = $('div#wpSummaryLabel'), |
||
+ | preloads = 1, |
||
+ | deleteModal; |
||
+ | |||
+ | function preload() { |
||
+ | if (--preloads === 0) { |
||
+ | init(); |
||
+ | } |
||
+ | } |
||
+ | |||
+ | function init() { |
||
+ | module.append($('<button>', {id: 'mobilePreview', class: 'oo-ui-inputWidget-input oo-ui-buttonElement-button', click: sendForm })); |
||
+ | } |
||
+ | |||
+ | |||
+ | function sendForm() { |
||
+ | var wikitext = $('ve-ce-branchNode ve-ce-contentBranchNode ve-ce-paragraphNode'); |
||
+ | formdata = new FormData(); |
||
+ | formdata.append('title', config.wgPageName); |
||
+ | formata.append('wikitext', wikitext); |
||
+ | |||
+ | $.ajax({ |
||
+ | url: config.wgScriptPath + '/article-preview', |
||
+ | method:'POST', |
||
+ | data:formdata, |
||
+ | cache:false, |
||
+ | contentType:false, |
||
+ | processData:false, |
||
+ | type:'POST' |
||
+ | }).done(function(d){ |
||
+ | console.log(d); |
||
+ | }).fail(function(d) { |
||
+ | console.log(d); |
||
+ | }); |
||
+ | } |
||
+ | mw.hook('dev.modal').add(preload); |
||
+ | mw.hook('dev.placement').add(preload); |
||
+ | |||
+ | importArticles({ |
||
+ | type: 'script', |
||
+ | articles: [ |
||
+ | 'u:dev:MediaWiki:Modal.js' |
||
+ | ] |
||
+ | }); |
||
+ | |||
+ | }); |
||
//.WikiaPageContentWrapper .is-edit .editform |
//.WikiaPageContentWrapper .is-edit .editform |
Version du 16 janvier 2021 à 19:57
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:MultiUpload.js',
'u:dev:MediaWiki:MassNullEdit/code.js'
]
});
(function(window, $, mw) {
if (window.InterlanguageCheckerLoaded) return;
window.InterlanguageCheckerLoaded = true;
$(function() {
if (skin !== "oasis") return;
var menuItems =
$(".page-header__contribution-buttons .wds-dropdown .wds-list");
if (!menuItems.length) return;
var conf = mw.config.get(["wgPageName", "wgServer", "wgScriptPath"]);
var apiUrl = conf.wgServer + conf.wgScriptPath + "/api.php";
var ilcUrl =
"https://fwdekker.com/tools/interlanguage-checker/?" +
"&api=" + encodeURIComponent(apiUrl) +
"&article=" + encodeURIComponent(conf.wgPageName);
menuItems.append(
"<li><a id='ca-talk' href='" + ilcUrl + "' class='new'>" +
"Check IW</a></li>"
);
});
}(this, jQuery, mediaWiki));
//mw.loader.getScript('https://dev.fandom.com/index.php?title=MediaWiki:MassNullEdit/code.js&action=raw&ctype=text/javascript');
(function() {
'use strict';
var config = mw.config.get([
'wgAction',
'wgPageName',
'wgScriptPath',
'wgNamespaceNumber',
'wgVersion'
]),
isUCP = config.wgVersion !== '1.19.24';
// Run conditions
if (config.wgNamespaceNumber != 0 || window.MobilePreview) {
return;
}
window.MobilePreview = true;
var formData = new FormData(),
module = $('div#wpSummaryLabel'),
preloads = 1,
deleteModal;
function preload() {
if (--preloads === 0) {
init();
}
}
function init() {
module.append($('<button>', {id: 'mobilePreview', class: 'oo-ui-inputWidget-input oo-ui-buttonElement-button', click: sendForm }));
}
function sendForm() {
var wikitext = $('ve-ce-branchNode ve-ce-contentBranchNode ve-ce-paragraphNode');
formdata = new FormData();
formdata.append('title', config.wgPageName);
formata.append('wikitext', wikitext);
$.ajax({
url: config.wgScriptPath + '/article-preview',
method:'POST',
data:formdata,
cache:false,
contentType:false,
processData:false,
type:'POST'
}).done(function(d){
console.log(d);
}).fail(function(d) {
console.log(d);
});
}
mw.hook('dev.modal').add(preload);
mw.hook('dev.placement').add(preload);
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:Modal.js'
]
});
});
//.WikiaPageContentWrapper .is-edit .editform