میڈیاویکی:Gadget-massDesc.js
یاددہانی: محفوظ کرنے کے بعد تازہ ترین تبدیلیوں کو دیکھنے کے لیے آپ کو اپنے براؤزر کا کیش صاف کرنا ہوگا۔
- فائرفاکس/ سفاری: جب Reload پر کلک کریں تو Shift دبا کر رکھیں، یا Ctrl-F5 یا Ctrl-R دبائیں (Mac پر R- )
- گوگل کروم: Ctrl-Shift-R دبائیں (Mac پر Shift-R-⌘)
- انٹرنیٹ ایکسپلورر: جب Refresh پر کلک کریں تو Ctrl یا Ctrl-F5 دبائیں
- اوپیرا: Tools → Preferences میں جائیں اور کیش صاف کریں
شاید اس اسکرپٹ کی دستاویزی تفصیلات میڈیاویکی:Gadget-massDesc پر موجود ہیں۔ |
if (mw.config.get('wgNamespaceNumber') === 14) {
$("#firstHeading").append("<div class = 'addDesc' style = 'cursor:pointer; font-size: 0.5em; background-color:#FAFAFA; color:#455A64; font-weight: bold; vertical-align:center; display: inline-block; margin:5px; padding:2px; border-radius:5px; box-shadow: 0.5px 0.866px 5px 0 rgba(0, 0, 0, 0.11);'>ویکی ڈیٹا میں اوصاف درج کریں</div>");
$(".addDesc").append("<span class = 'counter'> 0</span>");
$("#firstHeading").append("<div class = 'stopit' style = 'cursor:pointer; font-size: 0.5em; background-color:#e53935; color:#FFFFFF; font-weight: bold; text-align:center; vertical-align:center; display: inline-block; margin:5px; margin-right:0px; padding:2px; border-radius:5px; box-shadow: 0.5px 0.866px 5px 0 rgba(0, 0, 0, 0.11);'> ⛔ روکیں</div>");
}
$(".addDesc").click(function() {
main();
});
$(".stopit").click(function() {
location.reload();
});
function main() {
var desc = window.prompt("زمرے کے تمام صفحات کے لیے یکساں موزوں کوئی وصف درج کریں یا اس کارروائی کو روکنے کے لیے Cancel پر کلک کریں");
if (desc.length > 3){
var c = 0;
$('.mw-category-group>ul li').each(function(i) {
var thisColor = $(this);
if (!$(this).text().includes("◄") &&
!$(this).text().includes(":") &&
!$(this).text().includes("فہرست") &&
!$(this).text().includes("ضد ابہام")) {
var api = new mw.Api();
api.get({
"action": "query",
"format": "json",
"prop": "pageprops",
"titles": $(this).text(),
"utf8": 1,
"formatversion": "latest",
}).done(function(data) {
var wikibase = data.query.pages[0].pageprops.wikibase_item;
$.ajax({
url: '//www.wikidata.org/w/api.php',
data: {
'format': 'json',
"action": "wbgetentities",
"format": "json",
"ids": wikibase,
"sites": "urwiki",
"props": "descriptions",
"utf8": 1,
"formatversion": "latest"
},
dataType: 'jsonp',
cache: true
})
.done(function(data1) {
if (data1.entities[wikibase].descriptions.ar === undefined) {
thisColor.css ("background-color", "LIGHTSALMON");
var api = new mw.ForeignApi('https://www.wikidata.org/w/api.php');
api.get({
action: 'query',
meta: 'tokens'
}).done(function(data) {
api.post({
action: 'wbsetdescription',
id: wikibase,
token: data.query.tokens.csrftoken,
language: 'ur',
value: desc,
});
c++;
$(".counter").text(" " + c);
});
}
});
});
}
});
}
}