Browse history interactively ← Previous edit Content deleted Content addedInline
Revision as of 15:53, 16 October 2024 view source Xaosflux (talk | contribs )Edit filter managers , Autopatrolled , Bureaucrats , Importers , Interface administrators , Oversighters , Administrators 83,930 edits follow up on WP:VPT report, Category:New Pages does not exist, and if it did, this userpage wouldn't be a good member← Previous edit
Latest revision as of 15:55, 16 October 2024 view source Xaosflux (talk | contribs )Edit filter managers , Autopatrolled , Bureaucrats , Importers , Interface administrators , Oversighters , Administrators 83,930 edits nowiki to avoid links
Line 1:
Line 1:
//<nowiki>
// 1. Add a Custom Tab for Wikification
// 1. Add a Custom Tab for Wikification
mw.loader.using('mediawiki.util', function () {
mw.loader.using('mediawiki.util', function () {
Line 148:
Line 149:
});
});
});
});
//</nowiki>
Latest revision as of 15:55, 16 October 2024
//<nowiki>
// 1. Add a Custom Tab for Wikification
mw.loader.using('mediawiki.util', function () {
$(document).ready(function () {
var link = mw.util.addPortletLink('p-cactions', '#', 'Wikify', 'ca-wikify', 'Mark for wikification');
$(link).click(function (event) {
event.preventDefault();
doWikify();
});
});
});
function doWikify() {
// Code to mark the article for wikification
var text = "{{Wikify}}";
var textarea = document.getElementById("wpTextbox1");
textarea.value += text;
}
// 2. Automate Adding Categories
mw.hook('wikipage.content').add(function ($content) {
if ($content.is('#mw-content-text')) {
var category = "]";
var textarea = document.getElementById("wpTextbox1");
textarea.value += category;
}
});
// 3. Enhance Search Functionality
$(document).ready(function () {
var searchBox = $('<input id="customSearch" type="text" placeholder="Search Misplaced Pages">');
searchBox.appendTo('#p-search');
searchBox.autocomplete({
source: function (request, response) {
$.ajax({
url: mw.util.wikiScript('api'),
dataType: "json",
data: {
action: 'opensearch',
search: request.term,
limit: 10,
format: 'json'
},
success: function (data) {
response(data);
}
});
},
select: function (event, ui) {
window.location.href = ui.item.value;
}
});
});
// 4. Color Code User Contributions
$(document).ready(function () {
var contributions = $('#mw-content-text ul');
contributions.find('li').each(function () {
var link = $(this).find('a');
if (link.text().includes('edit')) {
$(this).css('background-color', '#cff');
} else if (link.text().includes('new')) {
$(this).css('background-color', '#ffc');
} else if (link.text().includes('move')) {
$(this).css('background-color', '#fcc');
}
});
});
// 5. Add Quick Links to Toolbox
$(document).ready(function () {
var toolbox = $('#p-tb');
var link = $('<a href="#">Quick Link</a>').attr('title', 'Quick Link');
link.appendTo(toolbox);
link.click(function (event) {
event.preventDefault();
// Custom action for the link
alert('Quick Link clicked!');
});
});
// 6. Highlight Unsaved Changes
$(document).ready(function () {
var originalText = document.getElementById("wpTextbox1").value;
document.getElementById("wpTextbox1").oninput = function () {
if (this.value !== originalText) {
this.style.background = 'rgba(255, 255, 0, 0.2)';
} else {
this.style.background = '';
}
};
});
// 7. Automate Edit Summaries
$(document).ready(function () {
var summary = document.getElementById("wpSummary");
if (summary.value === '') {
summary.value = 'Default edit summary';
}
});
// 8. Display Page Metrics
$(document).ready(function () {
$.getJSON(mw.util.wikiScript('api'), {
action: 'query',
titles: mw.config.get('wgPageName'),
prop: 'revisions|pageviews',
rvprop: 'ids',
pvipdays: 30,
format: 'json'
}, function (data) {
var pageId = Object.keys(data.query.pages);
var edits = data.query.pages.revisions.length;
var views = data.query.pages.pageviews;
var metrics = $('<div>Edits: ' + edits + ', Views: ' + views + '</div>');
metrics.appendTo('#bodyContent');
});
});
// 9. Customize Watchlist
$(document).ready(function () {
var watchlist = $('#watchlist');
var button = $('<button>Remove from Watchlist</button>');
button.appendTo(watchlist);
button.click(function (event) {
event.preventDefault();
var pageName = mw.config.get('wgPageName');
$.getJSON(mw.util.wikiScript('api'), {
action: 'watch',
title: pageName,
unwatch: true,
format: 'json'
}, function (data) {
if (data.watch.unwatch) {
alert('Page removed from watchlist');
}
});
});
});
// 10. Enhance Navigation
$(document).ready(function () {
var navMenu = $('<ul id="customNav"></ul>');
navMenu.appendTo('#p-navigation');
var pages = ;
pages.forEach(function (page) {
var link = $('<a href="' + mw.util.wikiScript(page) + '">' + page.replace(/_/g, ' ') + '</a>');
link.wrap('<li>').parent().appendTo(navMenu);
});
});
//</nowiki>
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.
**DISCLAIMER** We are not affiliated with Wikipedia, and Cloudflare.
The information presented on this site is for general informational purposes only and does not constitute medical advice.
You should always have a personal consultation with a healthcare professional before making changes to your diet, medication, or exercise routine.
AI helps with the correspondence in our chat.
We participate in an affiliate program. If you buy something through a link, we may earn a commission 💕
↑