User:Btilm/displaytitle.js: Difference between revisions

Content deleted Content added
me
 
m Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink)
 
(6 intermediate revisions by 2 users not shown)
Line 1:
// <nowiki>
//created by btilm
function adt() {
var pro = prompt('Enter wanted title.',wgPageNamewgTitle);
if ( pro==null || pro=="" || pro==wgPageNamewgTitle) {
alert('Aborted');
return}
Line 13 ⟶ 14:
addOnloadHook(function() {
if (document.editform) {
mw.util.addPortletLink("p-cactions", "javascript:adt()", "adt", "ca-adt", "Add Display Title", "");
}
});
Line 27 ⟶ 28:
addOnloadHook(function() {
if (document.editform) {
mw.util.addPortletLink("p-cactions", "javascript:rdt()", "rdt", "ca-rdt", "Remove Display Title", "");
}
});
// </nowiki>