MediaWiki:Common.js: Difference between revisions

From Rinchen Terdzö
((by SublimeText.Mediawiker))
((by SublimeText.Mediawiker))
Line 1: Line 1:
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://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css', 'text/css' );
mw.loader.load( 'https://fonts.googleapis.com/css?family=EB+Garamond', 'text/css' );
mw.loader.load( 'https://use.fontawesome.com/bd289233d5.js' );
mw.loader.load( 'https://use.fontawesome.com/bd289233d5.js' );
mw.loader.load( 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css', 'text/css' );
mw.loader.load( 'https://code.jquery.com/ui/1.12.1/jquery-ui.min.js' );
mw.loader.load( 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js' );
mw.loader.load( 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js' );
mw.loader.load( 'https://code.jquery.com/jquery-3.2.1.slim.min.js' );


/*    RTZ Main Page Functions    */


$(document).ready(function(){
$('#section-links').hover(
function(){ $('#tsdlogo').addClass('hide') },
function(){ $('#tsdlogo').removeClass('hide') }
);
$('#bios-trigger').click(function() {
window.location = "Biographies";
}).hover(
function(){ $('#bios-back').css('z-index','999').addClass('animated fadeIn') },
function(){ $('#bios-back').css('z-index','-999').removeClass('animated fadeIn') }
);
$('#indexes-trigger').click(function() {
window.location = "Indexes and Lineage Histories";
}).hover(
function(){ $('#indexes-back').css('z-index','999').addClass('animated fadeIn') },
function(){ $('#indexes-back').css('z-index','-999').removeClass('animated fadeIn') }
);
$('#maha-trigger').click(function() {
window.location = "Mahayoga";
}).hover(
function(){ $('#maha-back').css('z-index','999').addClass('animated fadeIn') },
function(){ $('#maha-back').css('z-index','-999').removeClass('animated fadeIn') }
);
$('#anu-trigger').click(function() {
window.location = "Anuyoga";
}).hover(
function(){ $('#anu-back').css('z-index','999').addClass('animated fadeIn') },
function(){ $('#anu-back').css('z-index','-999').removeClass('animated fadeIn') }
);
$('#ati-trigger').click(function() {
window.location = "Atiyoga";
}).hover(
function(){ $('#ati-back').css('z-index','999').addClass('animated fadeIn') },
function(){ $('#ati-back').css('z-index','-999').removeClass('animated fadeIn') }
);
$('#sup-trigger').click(function() {
window.location = "Supplementary Volumes";
}).hover(
function(){ $('#sup-back').css('z-index','999').addClass('animated fadeIn') },
function(){ $('#sup-back').css('z-index','-999').removeClass('animated fadeIn') }
);
$('#out-trigger').click(function() {
window.location = "RTZ Outline";
}).hover(
function(){ $('#out-back').css('z-index','999').addClass('animated fadeIn') },
function(){ $('#out-back').css('z-index','-999').removeClass('animated fadeIn') }
);
$('.more-trigger').click(function() {
$(this).siblings('div#more-text').toggleClass('more-text-display');
$(this).toggleClass('fa-ellipsis-h fa-ellipsis-v');
});
});


function BrowserDetection() {
/*    RTZ Outline Page Functions    */
    //Check if browser is IE
 
    if (navigator.userAgent.search("MSIE") & gt; = 0) {
$(document).ready(function(){
        // insert conditional IE code here
$('.collapse-toggle').click(function(){
    }
    $(this).siblings('#collapsible-content').toggle( 300 );
    //Check if browser is Chrome
    $(this).toggleClass("rotated");
    else if (navigator.userAgent.search("Chrome") & gt; = 0) {
    });
        // insert conditional Chrome code here
});
    }
 
    //Check if browser is Firefox
 
    else if (navigator.userAgent.search("Firefox") & gt; = 0) {
 
        // insert conditional Firefox Code here
 
    }
 
    //Check if browser is Safari
/*    RTZ Biographies Page Functions    */
    else if (navigator.userAgent.search("Safari") & gt; = 0 & amp; & amp; navigator.userAgent.search("Chrome") & lt; 0) {
 
        function(){ $('#navbar-main').css('background','rgba(16, 55, 82, 0.62)') };
$(document).ready(function(){
    }
$('.info-tab-header').click(function() {
    //Check if browser is Opera
$(this).siblings('#info-text').css('display','block');
    else if (navigator.userAgent.search("Opera") & gt; = 0) {
$(this).removeClass('inactive-header');
        // insert conditional Opera code here
$(this).siblings('#tibetan-text').css('display', 'none');
    }
$(this).siblings('#wylie-text').css('display', 'none');
}
$(this).siblings('.tibetan-tab-header').addClass('inactive-header');
$(this).siblings('.wylie-tab-header').addClass('inactive-header')
});
$('.wylie-tab-header').click(function() {
$(this).siblings('#wylie-text').css('display','block');
$(this).removeClass('inactive-header');
$(this).siblings('#info-text').css('display', 'none');
$(this).siblings('#tibetan-text').css('display', 'none');
$(this).siblings('.info-tab-header').addClass('inactive-header');
$(this).siblings('.tibetan-tab-header').addClass('inactive-header')
});
$('.tibetan-tab-header').click(function() {
$(this).siblings('#tibetan-text').css('display','block');
$(this).removeClass('inactive-header');
$(this).siblings('#info-text').css('display', 'none');
$(this).siblings('#wylie-text').css('display', 'none');
$(this).siblings('.info-tab-header').addClass('inactive-header');
$(this).siblings('.wylie-tab-header').addClass('inactive-header')
});
$('.smw-template-furtherresults').addClass('plainlinks')
});

Revision as of 15:55, 23 October 2017

mw.loader.load( 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css', 'text/css' );
mw.loader.load( 'https://fonts.googleapis.com/css?family=EB+Garamond', 'text/css' );
mw.loader.load( 'https://use.fontawesome.com/bd289233d5.js' );
mw.loader.load( 'https://code.jquery.com/ui/1.12.1/jquery-ui.min.js' );

/*     RTZ Main Page Functions     */

$(document).ready(function(){
	$('#section-links').hover(
		function(){ $('#tsdlogo').addClass('hide') },
		function(){ $('#tsdlogo').removeClass('hide') }
	);
	$('#bios-trigger').click(function() {
		window.location = "Biographies";
	}).hover(
		function(){ $('#bios-back').css('z-index','999').addClass('animated fadeIn') },
		function(){ $('#bios-back').css('z-index','-999').removeClass('animated fadeIn') }
	);
	$('#indexes-trigger').click(function() {
		window.location = "Indexes and Lineage Histories";
	}).hover(
		function(){ $('#indexes-back').css('z-index','999').addClass('animated fadeIn') },
		function(){ $('#indexes-back').css('z-index','-999').removeClass('animated fadeIn') }
	);
	$('#maha-trigger').click(function() {
		window.location = "Mahayoga";
	}).hover(
		function(){ $('#maha-back').css('z-index','999').addClass('animated fadeIn') },
		function(){ $('#maha-back').css('z-index','-999').removeClass('animated fadeIn') }
	);
	$('#anu-trigger').click(function() {
		window.location = "Anuyoga";
	}).hover(
		function(){ $('#anu-back').css('z-index','999').addClass('animated fadeIn') },
		function(){ $('#anu-back').css('z-index','-999').removeClass('animated fadeIn') }
	);
	$('#ati-trigger').click(function() {
		window.location = "Atiyoga";
	}).hover(
		function(){ $('#ati-back').css('z-index','999').addClass('animated fadeIn') },
		function(){ $('#ati-back').css('z-index','-999').removeClass('animated fadeIn') }
	);
	$('#sup-trigger').click(function() {
		window.location = "Supplementary Volumes";
	}).hover(
		function(){ $('#sup-back').css('z-index','999').addClass('animated fadeIn') },
		function(){ $('#sup-back').css('z-index','-999').removeClass('animated fadeIn') }
	);
	$('#out-trigger').click(function() {
		window.location = "RTZ Outline";
	}).hover(
		function(){ $('#out-back').css('z-index','999').addClass('animated fadeIn') },
		function(){ $('#out-back').css('z-index','-999').removeClass('animated fadeIn') }
	);
	$('.more-trigger').click(function() {
		$(this).siblings('div#more-text').toggleClass('more-text-display');
		$(this).toggleClass('fa-ellipsis-h fa-ellipsis-v');
	});
});

/*     RTZ Outline Page Functions     */

$(document).ready(function(){
	$('.collapse-toggle').click(function(){
    	$(this).siblings('#collapsible-content').toggle( 300 );
    	$(this).toggleClass("rotated");
    });
});





/*     RTZ Biographies Page Functions     */

$(document).ready(function(){
	$('.info-tab-header').click(function() {
		$(this).siblings('#info-text').css('display','block');
		$(this).removeClass('inactive-header');
		$(this).siblings('#tibetan-text').css('display', 'none');
		$(this).siblings('#wylie-text').css('display', 'none');
		$(this).siblings('.tibetan-tab-header').addClass('inactive-header');
		$(this).siblings('.wylie-tab-header').addClass('inactive-header')
	});
	$('.wylie-tab-header').click(function() {
		$(this).siblings('#wylie-text').css('display','block');
		$(this).removeClass('inactive-header');
		$(this).siblings('#info-text').css('display', 'none');
		$(this).siblings('#tibetan-text').css('display', 'none');
		$(this).siblings('.info-tab-header').addClass('inactive-header');
		$(this).siblings('.tibetan-tab-header').addClass('inactive-header')
	});
	$('.tibetan-tab-header').click(function() {
		$(this).siblings('#tibetan-text').css('display','block');
		$(this).removeClass('inactive-header');
		$(this).siblings('#info-text').css('display', 'none');
		$(this).siblings('#wylie-text').css('display', 'none');
		$(this).siblings('.info-tab-header').addClass('inactive-header');
		$(this).siblings('.wylie-tab-header').addClass('inactive-header')
	});
	$('.smw-template-furtherresults').addClass('plainlinks')
});