|
Tags: Manual revert Reverted |
Line 7: |
Line 7: |
| mw.notify( mw.message( 'sandbox-test' ) ); | | mw.notify( mw.message( 'sandbox-test' ) ); |
| });*/ | | });*/ |
|
| |
| function worldCat( pageCats ) {
| |
| var world;
| |
| for (var i = 0; i < pageCats.length; i++) {
| |
| if ( pageCats[i].indexOf('Survival ') > -1) {
| |
| world = pageCats[i] + '';
| |
| return world;
| |
| }
| |
| }
| |
| return false;
| |
| }
| |
|
| |
| if ( mw.config.get('wgIsArticle') && (mw.config.get('wgNamespaceNumber') == 4 || mw.config.get('wgNamespaceNumber') == 0)) {
| |
| //var namespace = mw.config.get('wgFormattedNamespaces')[mw.config.get('wgNamespaceNumber')];
| |
| var serverInfo = "",
| |
| siteContent = "",
| |
| type = "",
| |
| list = "",
| |
| typeCategories = [
| |
| "Stations",
| |
| "Builds",
| |
| "Events",
| |
| "Settlements",
| |
| "Groups",
| |
| "Phenomenon",
| |
| "Projects",
| |
| "Worlds"
| |
| ],
| |
| pageCategories = mw.config.get('wgCategories');
| |
|
| |
| if (pageCategories.includes('Site Content')) {
| |
| siteContent = 'Site Content > ';
| |
| }
| |
|
| |
| if (pageCategories.includes('Server Information')) {
| |
| serverInfo = 'Server Information > ';
| |
| }
| |
|
| |
| var world = '';
| |
| if ( worldCat( pageCategories ) != false) {
| |
| world = worldCat( pageCategories );
| |
| }
| |
|
| |
| if (pageCategories.includes('Bases')) {
| |
| type = 'Builds > Bases > ';
| |
| }
| |
|
| |
| var typesOnPage = pageCategories.filter(function(x){ return typeCategories.includes(x) });
| |
| if ( typesOnPage.lenght > 1) {
| |
| //page has more then one type category
| |
| }
| |
| type = typesOnPage[0] + " > ";
| |
|
| |
| if (pageCategories.includes('Lists')) {
| |
| list = 'Lists > ';
| |
| }
| |
|
| |
|
| |
| $('#breadcrumbs-test').text('' + siteContent + serverInfo + world + ' > ' + type + list + mw.config.get( 'wgTitle' ));
| |
|
| |
| }
| |
| | | |
| }); | | }); |