Open main menu

Changes

MediaWiki:Common.js

2,121 bytes added, 4 years ago
no edit summary
window.protectedNamespace = [ "2020", "2020_talk", "2021", "2021_talk", "2022", "2022_talk", "2023", "2024", "2025" ]; // $( document ).ready( function(){// $('body').addClass('_responsive');// console.log('Yes we can edit by jQuery');// });
$( document ).ready( function(){
// Open all UIF link in new tab
$('#p-UIF').children().find('a').attr('target', '_blank');
  // Hide login link from nav
if ( mw.config.get( 'wgPageName' ) === "Special:Badtitle" ){
$('#pt-login').hide();
}
 
// Remove the navigation from Training namespaces
if( mw.config.get("wgCanonicalNamespace") === "Training" && !(mw.config.get( 'wgUserGroups' ).indexOf("bureaucrat") !== -1) ) {
$("#left-navigation").empty();
$("#right-navigation").empty();
}
 
// Redirect Topic page to their parent pages
if( mw.config.get( 'wgNamespaceNumber') === mw.config.get( 'wgNamespaceIds' ).topic ){
location.replace( mw.config.get( 'wgServer') + $("#contentSub").children().attr("href") );
}
});
}
 
// CategoryTree
$('.CategoryTreeLabelPage').first().prev().before("---------------------------<br>");
$('.CategoryTreeEmptyBullet').each( function(){
if( $(this).next().next().val() === undefined){
$(this).parent().hide();
}
});
// CategoryTree Sorting
items.sort( function(a, b){
if( $( a ).find(".CategoryTreeLabelNs14").length === 0 && $(a).find(".CategoryTreeLabelNs3762").length === 0 && $(a).find(".CategoryTreeLabelNs3752").length === 0 && $(a).find(".CategoryTreeLabelNs3756").length === 0 ){ return 0; }
// Get text of the category link
// If nothing is found, status will remain same
if( firstMatch === null && secondMatch === null ) {
if ( firstText.includes("Faculty Champion:") ){ // Now campare with second element if( secondText.includes("School:") || secondText.includes("Priorities:") ){ return -1; } else { return 0; } } else if( firstText.includes("School:") ){ // Now campare with second element if( secondText.includes("Faculty Champion:") ){ return 1; } else if( secondText.includes("Priorities:") ){ return -1; } else { return 0; } } else if( firstText.includes("Priorities:") ){ // Now campare with second element if( secondText.includes("Faculty Champion:") || secondText.includes("School:") ){ return 1; } else { return 0; } } else { return 0; }
}
});
container.append( items );
// CategoryTree
$('.CategoryTreeLabelPage').first().prev().before("---------------------------<br>");
$('.CategoryTreeEmptyBullet').each( function(){
if( $(this).next().next().val() === undefined){
$(this).parent().hide();
}
});
});
$( this ).find( ".mw-editsection" ).hide();
$( this ).find( "#toc" ).hide();
$( this ).scrollTop(0);
anchors = $( this ).find("a");
anchors.on("click", function(e){
ModifySidebar( 'navigation', 'Back to Main Page', 'https://universityinnovation.org/wiki/Main_Page' );
} else {
ModifySidebar( 'navigation', 'Back to Overview', 'https://universityinnovation.org/wiki/2020'+ mw.config.get( 'wgCanonicalNamespace' ).slice(0,4) + ':Training_Overview' );
}
mw.loader.using( 'mediawiki.api', function(){
// Gadget-HotCat
if( mw.config.get("wgUserGroups").indexOf("bureaucrat") !== -1) { mw.loader.load( '/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' );}
// Gadget - QRCode
// Gadget - UpdateWikiBio
mw.loader.load('/index.php?title=MediaWiki:Gadget-UpdateWikiBio.js&action=raw&ctype=text/javascript');
 
 
//_responsive chabges