User:Arashiryuu0/wikia.js

// Masthead Rights; Custom Tags $(function { var rights = { Arashiryuu0: [      '全王',      '拳王',       '人殺し合'  ],  ShadowBeast109: [      'Administrator',       'Vampiric Overlord'  ],  Matsczon: [      'Bureaucrat',       'Duckman'  ],  Filename: [      'Emoji Dab Lad',       'Fallout: Las Vegas'  ],  IronChaos: [      'Lad',       'One of The Boys',       'Ginger',       'TheseHands™'  ],  LaVey: [      'Administrator',       'All Seeing Eye'  ] }; if (typeof rights[wgTitle] != 'undefined') {     info('mastheadRightsScript', 'Starting', '#ffcb6b');      // remove old rights      $('.UserProfileMasthead .masthead-info span.tag').remove;      for(var i = 0, len = rights[wgTitle].length; i < len; i++) {        // add new rights        $(' ' + rights[wgTitle][i] + ' ').appendTo('.masthead-info hgroup');     }     info('mastheadRightsScript', 'Done', '#ffcb6b');    } });

// Fix forum's "Edit-topic" and "follow" buttons $(function { // check for appropriate pages if(wgPageName.includes('Message_Wall') || wgPageName.includes('Thread')) {   info('buttonFixScript', 'Starting', '#c94f12');    var fb = $('li.edit-topic');    // edit-topic button    fb.addClass('button');    fb.children.first.css({ 'position':'relative', 'bottom':'3px', 'color':'white' });   // fixing follow buttons    $('.wikia-button.secondary').removeClass('secondary');    $('.wikia-menu-button.secondary').removeClass('secondary');    $('.related-topics .related-topic').css({'background-color':'#201c10'});    info('buttonFixScript', 'Done', '#c94f12'); } });

/* Adding a faux-bio section to my user profile $(function { if(wgTitle === 'Arashiryuu0') {    return $('.details ul').append($('', {     class: 'bio',     id: 'bio-content'     }).html(' Bio ' + 'お前はもう死んでいる'));  }   return; });

/* Test $( => {   const LRT = alert('This is a test.');    let x = prompt('Is this not JavaScript?'); }); /*********************************************************************************
 * Test Results                                                                **
 * Fandom does not support ES6 features, such as const, let, or arrow functions **
 * @return {null}                                                              **
 * @return {null}                                                              **
 * @return {null}                                                              **

/* #########################################################################################    ######                              CustomTagEdits                                  ##### #########################################################################################

$(function { if(wgTitle === 'Arashiryuu0') {    info('TagClassScript', 'Starting', '#ae0');    $('.tag:contains(\'全王\')').addClass('zen-ou');    $('.tag:contains(\'拳王\')').addClass('ken-ou');    info('TagClassScript', 'Finishing', '#ae0');    return $('.tag:contains(\'人殺し合\')').addClass('murderer');  } else  if(wgTitle === 'ShadowBeast109') {    info('TagClassScript', 'Starting', '#ae0');    $('.tag:contains(\'Administrator\')').addClass('admin');    info('TagClassScript', 'Finishing', '#ae0');    return $('.tag:contains(\'Vampiric Overlord\')').addClass('vamp');  } else  if(wgTitle === 'Matsczon') {    info('TagClassScript', 'Starting', '#ae0');    $('.tag:contains(\'Bureaucrat\')').addClass('crat');    info('TagClassScript', 'Finishing', '#ae0');    return $('.tag:contains(\'Duckman\')').addClass('duck');  } else  if(wgTitle === 'LaVey') {    info('TagClassScript', 'Starting', '#ae0'); $('.tag:contains(\'Administrator\')').addClass('admin'); info('TagClassScript', 'Finishing', '#ae0'); return $('.tag:contains(\'All Seeing Eye\')').addClass('eye'); } else if(wgTitle === 'Filename') { info('TagClassScript', 'Starting', '#ae0'); $('.tag:contains(\'Emoji Dab Lad\')').addClass('emoji-dab'); info('TagClassScript', 'Finishing', '#ae0'); return $('.tag:contains(\'Fallout: Las Vegas\')').addClass('las-vegas'); } else if(wgTitle === 'IronChaos') { info('TagClassScript', 'Starting', '#ae0'); $('.tag:contains(\'Lad\')').addClass('lad'); $('.tag:contains(\'One of The Boys\')').addClass('boys'); $('.tag:contains(\'Ginger\')').addClass('ginger'); info('TagClassScript', 'Finishing', '#ae0'); return $('.tag:contains(\'TheseHands™\')').addClass('these-hands'); } });

/* ####################################################################################    ########                        Utility Function(s)                         ######## ####################################################################################

function info(title, text, color) { if(!color) { return console.info('['+title+'] ' + text); } return console.info('%c['+title+']%c ' + text, 'color: ' + color, ''); }

/* ####################################################################################    ########                       END Utility Function(s)                      ######## ####################################################################################

// test to replace ' ' tag functionality $(function { if(wgTitle === 'Custom Armor Set Comparison' || wgTitle === 'Armor Piece Comparison') {    info('importScriptsCASC_APC', 'Starting', '#aaf');    var scripts = {      'Custom Armor Set Comparison': [        'MediaWiki:CustomArmorSet',         'MediaWiki:CustomArmorSetBox',         'MediaWiki:CustomArmorSetData'      ],      'Armor Piece Comparison': [        'MediaWiki:CustomArmorSet',         'MediaWiki:CustomArmorSetBox',         'MediaWiki:CustomArmorSetData'      ]    };

if(typeof scripts[wgTitle] != 'undefined') { for(var i = 0, len = scripts[wgTitle].length; i < len; i++) { $(' ', {              id: 'importedScripts-'+[i],                href: scripts[wgTitle][i],                type: 'text/html'             }).appendTo('head'); $(' ', {               id: 'importedScripts-'+[i],                src: scripts[wgTitle][i],                type: 'text/html'             }).appendTo('head'); }   }    info('importScriptsCASC_APC', 'Done', '#aaf'); } if(wgTitle === 'Armor Piece Comparison') { importScript('MediaWiki:ArmorSearch.js'); } });

// Remove extra sitename title $(function { info('SiteName', 'Beginning', '#c3e88d');  $('.wds-community-header .wds-community-header__sitename a').remove;  info('SiteName', 'Removed', '#c3e88d'); });

// Toggle page button, just for fun  // $(function { // Add hide-page button  if(wgNamespaceNumber === 0) {    var ishidden = $('.WikiaPageContentWrapper').hasClass('hidden') ? 'show' : 'hide';    $('.wds-community-header').append($('', {         id: 'togglePage',         text: ishidden,         style: '\        position: relative; \        left: 2px; \        bottom: 1.2vh; \        color: whitesmoke; \        cursor: pointer;'.trim    }));    // Hide page button function    info('hidePageToggle', 'Starting', '#89DDF3');    $('#togglePage').click(function(hidden) { hidden = $('.WikiaPageContentWrapper').css('display'); var state = { initial:'initial', block:'block', flex:'flex', 'inline-block':'inline-block', 'inline-flex':'inline-flex' };     state[hidden] ? (         $('#togglePage').text('show'),          $('.WikiaPageContentWrapper').hide('slow'),          $('.WikiaPageContentWrapper').addClass('hidden')      ) : (          $('#togglePage').text('hide'),          $('.WikiaPageContentWrapper').show('slow'),          $('.WikiaPageContentWrapper').removeClass('hidden')      ); });   info('hidePageToggle', 'Finished', '#89DDF3');  } });

// Add buttons to header $(function { info('RandomPageButton', 'Starting', '#82AAFF');  try {    var headTarget = $('.wds-community-header__wiki-buttons.wds-button-group');    headTarget.append( $('', {        class: 'wds-button wds-is-squished wds-is-secondary',        id: 'jsReturn',        text: '\u2111',        style: 'font-size: 18px; font-weight: 600;',        href: '/wiki/User:Arashiryuu0/wikia.js',         title: 'Return to Personal JS'        }) );   setTimeout(function { headTarget.append(       $('', { class: 'wds-button wds-is-squished wds-is-secondary', id: 'cssReturn', text: '\u212D', style: 'font-size: 18px; font-weight: 600;', href: '/wiki/User:Arashiryuu0/wikia.css', title: 'Return to Personal CSS' })     );    }, 250);    setTimeout(function { headTarget.append(       $('', { class: 'wds-button wds-is-squished wds-is-secondary', id: 'purgePageButton', text: '\u2620', style: 'font-size: 18px; font-weight: 600;', href: '?action=purge', title: 'Purge Page' })     );    }, 300);    setTimeout(function { headTarget.append(       $('', { class: 'wds-button wds-is-squished wds-is-secondary', id: 'returnButton', text: '↩', style: 'font-size: 18px; font-weight: 600;', href: '/wiki/User:Arashiryuu0', title: 'Return to User Page' })     );    }, 350);    setTimeout(function { headTarget.append(       $('', { class: 'wds-button wds-is-squished wds-is-secondary', id: 'randomPageButton', text: '?', style: 'font-size: 18px;', 'data-tracking': 'Special:Random', href: '/wiki/Special:Random', title: 'Random Page' })     );    }, 450);  } catch(e) {      throw new Error(e.stack);  }  setTimeout(function { info('RandomPageButton', 'Finished', '#82AAFF'); }, 650); });

/***************************************************************************************
 * END                                         **
 * END                                         **