Pengguna:Iwan Novirion/Compact Navigation.js: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
k Maintenance: Replacing legacy global variable (phab:T72470)
k Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink)
 
Baris 53:
 
// Actions menu items
mw.util.addPortletLink('new-actions', 'javascript:;', '');
mw.util.addPortletLink('new-actions', getElementUrl(caEdit), edittxt);
if (caHistory) mw.util.addPortletLink('new-actions', getElementUrl(caHistory), 'history');
mw.util.addPortletLink('new-actions', mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=Special:Log&page=' + wgPageName, 'page log');
if (caMove) mw.util.addPortletLink('new-actions', getElementUrl(caMove), 'move');
if (caProtect) mw.util.addPortletLink('new-actions', getElementUrl(caProtect), 'protect');
if (caDelete) mw.util.addPortletLink('new-actions', getElementUrl(caDelete), 'delete');
 
// Add menu items for main page
if( caMain.className.search('new') == 0 ) {
mw.util.addPortletLink('new-page', 'javascript:;', '');
mw.util.addPortletLink('new-page', getElementUrl(caMain), 'create');
} else {
mw.util.addPortletLink('new-page', 'javascript:;', '');
mw.util.addPortletLink('new-page', getElementUrl(caMain) + '?action=edit', 'edit');
mw.util.addPortletLink('new-page', getElementUrl(caMain) + '?action=edit&section=0', edittxt + ' lead');
mw.util.addPortletLink('new-page', getElementUrl(caMain) + '?action=history', 'history');
mw.util.addPortletLink('new-page', getElementUrl(caMain) + '?diff=cur&oldid=prev', 'last');
}
mw.util.addPortletLink('new-page', mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=Special:Log&page=' + wgPageName, 'page log');
// If we're in Userspace then add additional items to show info
Baris 82:
uname = wgTitle.substring(0, wgTitle.indexOf("/"));
}
mw.util.addPortletLink('new-page', wgServer + "/wiki" + '/Special:Contributions/' + uname, 'contribs');
if (caDelete) mw.util.addPortletLink('new-page', mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=Special:DeletedContributions&target=' + uname, 'deleted contribs');
mw.util.addPortletLink('new-page', mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=Special:Log&user=' + uname, 'user log');
mw.util.addPortletLink('new-page', mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=Special:Log&type=block&page=User:' + uname, 'block log');
if (caDelete) mw.util.addPortletLink('new-page', wgServer + "/wiki" + '/Special:Blockip/' + uname, 'block');
}
 
// Add menu items for talk page
if( caTalk.className.search('new') == 0 ) {
mw.util.addPortletLink('new-talk', 'javascript:;', '');
mw.util.addPortletLink('new-talk', getElementUrl(caTalk), 'create');
} else {
mw.util.addPortletLink('new-talk', 'javascript:;', '');
mw.util.addPortletLink('new-talk', getElementUrl(caTalk) + '?action=edit', 'edit');
mw.util.addPortletLink('new-talk', getElementUrl(caTalk) + '?action=edit&section=0', 'edit lead');
mw.util.addPortletLink('new-talk', getElementUrl(caTalk) + '?action=edit&section=new', 'new section');
mw.util.addPortletLink('new-talk', getElementUrl(caTalk) + '?action=history', 'history');
mw.util.addPortletLink('new-talk', getElementUrl(caTalk) + '?diff=cur&oldid=prev', 'last');
}
mw.util.addPortletLink('new-talk', mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=Special:Log&page=' + wgPageName, 'page log');
});