MediaWiki:Common.js: Perbedaan antara revisi
Tidak ada ringkasan suntingan Tanda: Suntingan perangkat seluler Suntingan peramban seluler |
Tidak ada ringkasan suntingan Tanda: Suntingan perangkat seluler Suntingan peramban seluler |
||
| (1 revisi perantara oleh pengguna yang sama tidak ditampilkan) | |||
| Baris 39: | Baris 39: | ||
var txt = ($('#mw-content-text').text() || '').trim(); | var txt = ($('#mw-content-text').text() || '').trim(); | ||
return /^(#REDIRECT|#ALIH)\s*\[\[/i.test(txt); | return /^(#REDIRECT|#ALIH)\s*\[\[/i.test(txt); | ||
} | |||
function hideNativeEditForNonStaff() { | |||
if (!isEntityNamespacePage() || isSysopUser()) return; | |||
var selectors = [ | |||
'#ca-edit', | |||
'#ca-ve-edit', | |||
'li#ca-edit', | |||
'li#ca-ve-edit', | |||
'.page-actions-menu__list-item #ca-edit', | |||
'.page-actions-menu__list-item #ca-ve-edit', | |||
'.minerva-toolbar a[href*="action=edit"]', | |||
'.minerva-toolbar a[href*="veaction=edit"]', | |||
'.page-actions-menu a[href*="action=edit"]', | |||
'.page-actions-menu a[href*="veaction=edit"]', | |||
'#p-views a[href*="action=edit"]', | |||
'#p-views a[href*="veaction=edit"]', | |||
'#p-cactions a[href*="action=edit"]', | |||
'#p-cactions a[href*="veaction=edit"]' | |||
].join(', '); | |||
$(selectors).each(function() { | |||
var $el = $(this); | |||
if ($el.closest('#mippedia-data-app, #mip-connector, #desc-manager').length) return; | |||
if ($el.is('li')) { | |||
$el.hide(); | |||
} else { | |||
var $li = $el.closest('li'); | |||
if ($li.length && !$li.hasClass('mw-list-item-hidden')) { | |||
$li.hide(); | |||
} | |||
$el.hide(); | |||
} | |||
}); | |||
} | } | ||
| Baris 44: | Baris 79: | ||
mw.loader.using(['mediawiki.api', 'mediawiki.util']).then(function() { | mw.loader.using(['mediawiki.api', 'mediawiki.util']).then(function() { | ||
hideNativeEditForNonStaff(); | |||
setTimeout(hideNativeEditForNonStaff, 300); | |||
setTimeout(hideNativeEditForNonStaff, 1000); | |||
var pageName = mw.config.get('wgPageName'); | var pageName = mw.config.get('wgPageName'); | ||
| Baris 469: | Baris 507: | ||
"@type": "Organization", | "@type": "Organization", | ||
"name": "Mippedia Community", | "name": "Mippedia Community", | ||
"url": "https:// | "url": "https://mippediacommunity.site/" | ||
} | } | ||
}; | }; | ||
| Baris 1.404: | Baris 1.442: | ||
}); | }); | ||
window.mipSaveProtectedMeta = function(targetType, payloadObj) { | window.mipSaveProtectedMeta = function(targetType, payloadObj) { | ||
return $.ajax({ | return $.ajax({ | ||