MediaWiki:Common.js

From Buddha-Nature
Revision as of 10:44, 28 October 2017 by JeremiP (talk | contribs) ((by SublimeText.Mediawiker))

Note: After publishing, 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: Press Ctrl-F5.
mw.loader.load( 'https://fonts.googleapis.com/css?family=Crimson+Text:400,400i,700', 'text/css' );
mw.loader.load( 'https://fonts.googleapis.com/css?family=Cinzel:400,700,900&subset=latin-ext', '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(){
    $( 'body.page-Buddha_Nature_Tests_Kavya, body.page-Buddha_Nature_Tests_Tibetan_Art, body.page-Buddha_Nature_Tests_Text, body.page-Buddha_Nature_Tests_Buddhist_Literacy_Project' ).siblings('head').prepend('<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">')
});


$(document).ready(function(){
    $( '.page-Buddha_Nature_Tests_Kavya #bodyContent, .page-Buddha_Nature_Tests_Tibetan_Art #bodyContent, .page-Buddha_Nature_Tests_Text #bodyContent, .page-Buddha_Nature_Tests_Buddhist_Literacy_Project #bodyContent' ).prepend('<nav class="navbar navbar-expand-lg navbar-dark sticky-top" id="navbar-main" style="background: rgba(16, 55, 82, 0.62) !important;"> <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 dropdown"> <a class="nav-link dropdown-toggle" 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="#">Third Turning</a> <a class="dropdown-item" href="#">Buddha Nature</a> <a class="dropdown-item" href="#">The Five Dharmas</a> <a class="dropdown-item" href="#">Maitreya</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Tsadra</a> </div> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" 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-book" aria-hidden="true"></i> Books</a> <a class="dropdown-item" href="#"><i class="fa fa-paint-brush" aria-hidden="true"></i> Art</a> <a class="dropdown-item" href="#"><i class="fa fa-video-camera" aria-hidden="true"></i> Videos</a> </div> </li> <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-university" aria-hidden="true"></i> Traditions </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="#">Nyingma</a> <a class="dropdown-item" href="#">Kagyu</a> <a class="dropdown-item" href="#">Sakya</a> <a class="dropdown-item" href="#">Gelug</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Bön</a> </div> </li> <li class="nav-item"> <a class="nav-link" href="/index.php/Main_Page"><i class="fa fa-comments-o" aria-hidden="true"></i> Talk</a> </li> </ul> <ul class="navbar-nav mr-0"> <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-cogs" aria-hidden="true"></i> Admin </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <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> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">View History</a> <a class="dropdown-item" href="#">Protect</a> <a class="dropdown-item" href="#">Move</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Delete</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');
    });
});


$(document).ready(function(){
    $('#headingOne').append('<a class="collapsed" data-toggle="collapse" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"> Derge Version </a>');
    $('#headingTwo').append('<a class="collapsed" data-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> Narthang Version </a>');
    $('#headingThree').append('<a class="collapsed" data-toggle="collapse" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> Chone Version </a>');
    $('#headingFour').append('<a class="collapsed" data-toggle="collapse" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour"> Pe Durma Version </a>');
    $('#headingFive').append('<a class="collapsed" data-toggle="collapse" href="#collapseFive" aria-expanded="false" aria-controls="collapseFive"> Ser Drima Version </a>');
});


$(document).ready(function(){
	$(".pop-off").hover(function(){
		$(this).toggleClass("depth-1 depth-5")
	});
});





$(document).ready(function(){
    $( 'body.page-Buddha_Nature_Tests_Kavya, body.page-Buddha_Nature_Tests_Tibetan_Art, body.page-Buddha_Nature_Tests_Text, body.page-Buddha_Nature_Tests_Buddhist_Literacy_Project' ).append('<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>')
});