MediaWiki:Gadget-QICvote.js: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 1:
// [[File:Wikipedia_Gadget-popups.js]] Pop-ups imported from enWP
mw.loader.using( 'mediawiki.api.edit' ).done(function() {
'use strict';
Line 34 ⟶ 35:
action: 'edit',
title: title,
section: section,▼
summary: "adding support",
text: content,
token: mw.user.tokens.get('editToken'),
},
dataType: 'json',
Line 55 ⟶ 56:
});
}
function getSectionId(element)
{
var url = $(element).parent().parent().parent().find('h2 span a').last().attr('href');
var results = new RegExp('[\?&]section=([^&#]*)').exec(url);
return results[1] || 0;
}
function createCombo ()
{
var $cmb =$('<select name="wplanguage" />');
$cmb.append($("<option/>", {
value: 'Promotion',
text: 'Promotion'
}));
$cmb.append($("<option/>", {
value: 'Decline',
text: 'Decline'
}));
$cmb.append($("<option/>", {
value: 'Nomination',
text: 'Comment'
}));
return $cmb;
}
function confirmSave() {
console.log(content); //Conten ▼
});
}
if (mw.config.get('wgPageName') == "User:The_Photographer/QIC") {
$(".gallerybox").each(function() {
var $
$
▲ getSection(title, section).then ( function(content) {
▲ console.log(content);
▲ editSection(title, section, content);
▲ });
});
|