User:Dr pda/persondata.js: Difference between revisions

Content deleted Content added
bug fix to handle <br /> tag
mw.util.addportletlink
Line 5:
//To use this function add {{subst:js|User:Dr pda/persondata.js}} to your monobook.js
//
mw.loader.using( ['mediawiki.util'], function () {
 
function format_name(x){
NAME = x.substr(x.indexOf('=')+1);
Line 185 ⟶ 187:
if(!document.forms.editform){
if (document.getElementById('persondata') != null){
mw.util.addPortletLink('p-cactions', 'javascript:togglePersondata()', 'show/hide persondata', 'ca-pdata', 'Show/hide persondata metadata', '', '');
}
}
else{
if (wgNamespaceNumber == 0 && document.getElementById('wpTextbox1').value.match(/persondata/i) == null){
mw.util.addPortletLink('p-cactions', 'javascript:suggestPersonData()', 'add persondata', 'ca-pdata', 'add persondata metadata', '', '');
}
}
});
 
/* end of mw.loader.using */
});
//</pre>