MediaWiki:Common.js

From Buddha-Nature

Revision as of 12:53, 25 October 2017 by JeremiP (talk | contribs) ((by SublimeText.Mediawiker))

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
mw.loader.load( 'https://fonts.googleapis.com/css?family=Crimson+Text:400,400i,700', 'text/css' );
mw.loader.load( 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css', 'text/css' );
mw.loader.load( 'https://use.fontawesome.com/bd289233d5.js' );

$(document).ready(function(){
    $( '.page-Buddha_Nature_Tests_Kavya #bodyContent, .page-Buddha_Nature_Tests_Tibetan_Art #bodyContent' ).prepend('<nav class="navbar navbar-expand-lg navbar-dark sticky-top" id="navbar-main"> <a class="navbar-brand" href="#"> <img src="/images/3/3f/TsadraSmallLogo.png" href="" height="30" class="d-inline-block align-top" alt=""> &nbsp;Buddha Nature </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav mr-auto"> <li class="nav-item mr-2 active"> <a class="nav-link" href="/index.php/Main_Page"><i class="fa fa-home" style="font-size: 1.7em;" aria-hidden="true"></i></a> </li> <li class="nav-item"> <a class="nav-link" style="padding-top: 12px;" href="#"><i class="fa fa-road" aria-hidden="true"></i> Roadmap</a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" style="padding-top: 12px;" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-hashtag" aria-hidden="true"></i> Topics </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="#"><i class="fa fa-cog" aria-hidden="true"></i> Topic One</a> <a class="dropdown-item" href="#"><i class="fa fa-user-o" aria-hidden="true"></i> Topic Two</a> <a class="dropdown-item" href="#"><i class="fa fa-eye" aria-hidden="true"></i> Topic Three</a> <a class="dropdown-item" href="#"><i class="fa fa-university" aria-hidden="true"></i> Topic Four</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#"><i class="fa fa-list-ul" aria-hidden="true"></i> Other Side Topics</a> </div> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" style="padding-top: 12px;" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-book" aria-hidden="true"></i> Texts </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="#"><i class="fa fa-paragraph" aria-hidden="true"></i> Text One</a> <a class="dropdown-item" href="#"><i class="fa fa-paragraph" aria-hidden="true"></i> Text Two</a> <a class="dropdown-item" href="#"><i class="fa fa-paragraph" aria-hidden="true"></i> Text Three</a> <a class="dropdown-item" href="#"><i class="fa fa-paragraph" aria-hidden="true"></i> Text Four</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#"><i class="fa fa-stack-overflow" aria-hidden="true"></i> Text Collections</a> </div> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" style="padding-top: 12px;" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-cubes" aria-hidden="true"></i> Resources </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="#"><i class="fa fa-graduation-cap" aria-hidden="true"></i> Study Materials</a> <a class="dropdown-item" href="#"><i class="fa fa-american-sign-language-interpreting" aria-hidden="true"></i> Teaching Materials</a> <a class="dropdown-item" href="#"><i class="fa fa-language" aria-hidden="true"></i> Translation Materials</a> </div> </li> </ul> <ul class="navbar-nav mr-2"> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="/index.php/Traditions" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-user-circle-o" aria-hidden="true"></i> User </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="/index.php/Talk:Main_Page"><i class="fa fa-comments-o" aria-hidden="true"></i> Talk</a> <a class="dropdown-item" href="#"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit</a> <a class="dropdown-item" href="#"><i class="fa fa-refresh" aria-hidden="true"></i> Refresh</a> <a class="dropdown-item" href="#"><i class="fa fa-files-o" aria-hidden="true"></i> View History</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#"><i class="fa fa-lock" aria-hidden="true"></i> Protect</a> <a class="dropdown-item" href="#"><i class="fa fa-share" aria-hidden="true"></i> Move</a> <a class="dropdown-item" href="#"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#"><i class="fa fa-sign-out" aria-hidden="true"></i> Logout</a> </div> </li> </ul> <form class="form-inline my-2 my-lg-0"> <input class="form-control mr-sm-2" type="search" name="search" placeholder="Search Wiki" title="Search Buddha Nature [ctrl-option-f]" accesskey="f" id="searchInput" tabindex="1" autocomplete="off" aria-label="Search"> <input type="hidden" value="Special:Search" name="title"> <button class="btn btn-outline-danger my-2 my-sm-0" type="submit" name="go" title="Go to a page with this exact name if it exists" id="searchButton" ><i class="fa fa-search" aria-hidden="true"></i></button> </form> </div> </nav>');
});

// Safari 3.0+ "[object HTMLElementConstructor]" 
var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || safari.pushNotification);

if (isSafari) {
    $('#navbar-main').addClass('translucent')
}

$(document).ready(function(){
	$('div.bnw-resources-buttons .bnw-resources-button:first-child').addClass('active');
	$('div.bnw-resources .bnw-resource-item:first-child').addClass('show');
	$('.bnw-resources-button').click(function(){
    	$(this).addClass('active');
    	$(this).siblings('.bnw-resources-button').removeClass('active');
    });
    $('#bnw-resources-button-1').click(function(){
    	$('#bnw-resource-item-1').addClass('show');
    	$('#bnw-resource-item-1').siblings('.bnw-resource-item').removeClass('show');
    });
    $('#bnw-resources-button-2').click(function(){
    	$('#bnw-resource-item-2').addClass('show');
    	$('#bnw-resource-item-2').siblings('.bnw-resource-item').removeClass('show');
    });
    $('#bnw-resources-button-3').click(function(){
    	$('#bnw-resource-item-3').addClass('show');
    	$('#bnw-resource-item-3').siblings('.bnw-resource-item').removeClass('show');
    });
    $('#bnw-resources-button-4').click(function(){
    	$('#bnw-resource-item-4').addClass('show');
    	$('#bnw-resource-item-4').siblings('.bnw-resource-item').removeClass('show');
    });
    $('#bnw-resources-button-5').click(function(){
    	$('#bnw-resource-item-5').addClass('show');
    	$('#bnw-resource-item-5').siblings('.bnw-resource-item').removeClass('show');
    });
    $('#bnw-resources-button-6').click(function(){
    	$('#bnw-resource-item-6').addClass('show');
    	$('#bnw-resource-item-6').siblings('.bnw-resource-item').removeClass('show');
    });
    $('#bnw-resources-button-7').click(function(){
    	$('#bnw-resource-item-7').addClass('show');
    	$('#bnw-resource-item-7').siblings('.bnw-resource-item').removeClass('show');
    });
    $('#bnw-resources-button-8').click(function(){
    	$('#bnw-resource-item-8').addClass('show');
    	$('#bnw-resource-item-8').siblings('.bnw-resource-item').removeClass('show');
    });
    $('#bnw-resources-button-9').click(function(){
    	$('#bnw-resource-item-9').addClass('show');
    	$('#bnw-resource-item-9').siblings('.bnw-resource-item').removeClass('show');
    });
    $('#bnw-resources-button-10').click(function(){
    	$('#bnw-resource-item-10').addClass('show');
    	$('#bnw-resource-item-10').siblings('.bnw-resource-item').removeClass('show');
    });
});