Hello, you have come here looking for the meaning of the word
User:Mike Dillon/Scripts/topicCats.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word
User:Mike Dillon/Scripts/topicCats.js, but we will also tell you about its etymology, its characteristics and you will know how to say
User:Mike Dillon/Scripts/topicCats.js in singular and plural. Everything you need to know about the word
User:Mike Dillon/Scripts/topicCats.js you have here. The definition of the word
User:Mike Dillon/Scripts/topicCats.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition of
User:Mike Dillon/Scripts/topicCats.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
var topicCatPageType, topicCatName;
(function () {
var m = wgPageName.match(/^Template:topic_cat_(parents|description)\//);
if (!m) return;
topicCatPageType = m;
topicCatName = wgTitle.split(/\//, 2);
})();
if (wgCanonicalNamespace == 'Category') {
topicCatName = wgTitle.match(/:/) ? wgTitle.split(/:/, 2) : wgTitle;
addOnloadHook(function () {
var tabs = document.getElementById('p-cactions');
if (!tabs) return;
var tabList = tabs.getElementsByTagName('ul');
if (!tabList) return;
var parentConfigTemplate = 'Template:topic_cat_parents/' + topicCatName;
var x = sajax_init_object();
x.open('GET', '/w/api.php?action=query&&format=json&titles=' + encodeURIComponent(parentConfigTemplate), true);
x.onreadystatechange = function () {
if (x.readyState != 4 || x.status != 200) return;
eval('processParentsChecked(' + x.responseText + ')');
};
x.send(null);
function processParentsChecked(json) {
if (!json.query) return;
if (!json.query.pages) return;
var missing = !!(json.query.pages);
var url = wgScript + '?action=edit&title=' + encodeURIComponent(parentConfigTemplate);
if (missing) url += '&preload=Template:topic_cat_parents/preload';
with (easydom) {
var tab = li(a({ 'href': url }, 'Parents'));
if (missing) {
tab.className = 'new';
}
tabList.appendChild(tab);
}
return false;
}
});
} else if (topicCatPageType == 'parents') {
addOnloadHook(function () {
var tb = document.getElementById('wpTextbox1');
var diff = document.getElementById('wpDiff');
var summary = document.getElementById('wpSummary');
if (!(tb && diff && summary)) return;
var m = tb.value.match(/\{\{topic cat parents\/helper\|(.*)\|lang=/);
if (!m) return;
var declaredParents = m.split(/\|/);
with (easydom) {
var updateParents = input({ 'type': 'button', 'value': 'Update parents' });
updateParents.onclick = doUpdateParents;
diff.parentNode.insertBefore(updateParents, diff.nextSibling);
}
function doUpdateParents() {
var x = sajax_init_object();
x.open('GET', '/w/api.php?action=query&prop=categories&format=json&titles=' + encodeURIComponent('Category:' + topicCatName), true);
x.onreadystatechange = function () {
if (x.readyState != 4 || x.status != 200) return;
eval('processCategories(' + x.responseText + ')');
};
x.send(null);
}
function processCategories(json) {
if (!json.query) return;
if (!json.query.pages) return;
var page;
for (var id in json.query.pages) {
page = json.query.pages;
}
if (!page.categories) return;
var existingParents = page.categories.map(function (e) {
return e.title.replace(/^Category:/, '');
});
if (!existingParents) return;
var newValue = tb.value.replace(/(\{\{topic cat parents\/helper\|).*(\|lang=)/,
'$1' + existingParents.join('|') + '$2');
if (tb.value != newValue) {
tb.value = newValue;
summary.value = 'Updated parent categories to: ' + existingParents.join(', ');
diff.click();
}
return false;
}
});
}