Difference between revisions of "MediaWiki:Common.js"
From NoSQLZoo
Line 37: | Line 37: | ||
})) | })) | ||
); | ); | ||
− | } | + | $('.hint').each(function(){ |
+ | $(this).before($('<div/>',{'class':'tease', | ||
+ | text:$(this).attr('title') || 'hint', | ||
+ | click:function(){ | ||
+ | $(this).next().slideToggle(); | ||
+ | }})); | ||
+ | $(this).hide(); | ||
+ | }); | ||
+ | $('#cog-cont').append( | ||
+ | $('<ul/>',{id:'coglist',css:{display:'none','z-index':1003}}) | ||
+ | .append($('<li/>').append($('#p-search'))) | ||
+ | .append($('#pick-engine')) | ||
+ | .append($('#pt-createaccount')) | ||
+ | .append($('#pt-userpage')) | ||
+ | .append($('#pt-mytalk')) | ||
+ | .append($('#pt-preferences')) | ||
+ | .append($('#pt-watchlist')) | ||
+ | .append($('#pt-mycontris')) | ||
+ | // .append($('#pt-login')) | ||
+ | // .append($('#pt-logout')) | ||
+ | .append($('#ca-view')) | ||
+ | .append($('#ca-viewsource')) | ||
+ | .append($('#ca-edit')) | ||
+ | .append($('#ca-history')) | ||
+ | .append($('#ca-nstab-main')) | ||
+ | .append($('#ca-talk')) | ||
+ | .append($('#ca-watch')) | ||
+ | .append($('#ca-unwatch')) | ||
+ | .append($('#ca-move')) | ||
+ | .append($('#ca-delete')) | ||
+ | .append($('#ca-protect')) | ||
+ | ); | ||
+ | $('#pt-login,#pt-logout').before($('#pick-engine')); | ||
+ | $('#mw-head').prepend($('<a/>',{ | ||
+ | id:'napier-ad', | ||
+ | href:'http://www.napier.ac.uk/faculties/engineering-computing-creative/computing/Pages/Postgraduate.aspx?sz', | ||
+ | title:'SQLZoo: developed and maintained at Edinburgh Napier University' | ||
+ | })); | ||
+ | var ins = $('<ins/>',{'class':'adsbygoogle', | ||
+ | style:"display:block;", | ||
+ | 'data-ad-client':"ca-pub-0803888854272698", | ||
+ | 'data-ad-slot':"2184001182",'data-ad-format':'auto'}); | ||
+ | ins.prependTo('#footer'); | ||
+ | $.getScript("//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js", | ||
+ | function(){ | ||
+ | (adsbygoogle = window.adsbygoogle || []).push({}); | ||
+ | }); | ||
+ | if (wgCanonicalNamespace == 'MediaWiki' || wgCanonicalNamespace == 'Special') | ||
+ | $('#p-googleadsense').hide(); | ||
+ | }); | ||
+ | |||
+ | /* | ||
+ | Tweek the Log in scheme | ||
+ | * */ | ||
+ | $(function(){ | ||
+ | $('#mw-user-domain-section').hide(); | ||
+ | $('#wpRemember').attr('checked',true); | ||
+ | }); |
Revision as of 12:19, 28 July 2015
$(function(){
//Allow all the tables to be collapsible
//items move into the "More" actions
//Change the following to change the word "More"
//http://sqlzoo.net/dev/MediaWiki:Vector-more-actions
$('#left-navigation,#right-navigation').hide();
$('#ca-view,#ca-viewsource,#ca-edit').addClass('collapsible');
$('#mw-head').append(
$('<div/>',{id:'cog-cont'}).append(
$('<div/>',{
css:{'background-image':'url(http://sqlzoo.net/design/Cog_font_awesome.svg)',
'z-index':1003,
width:32,height:32,position:'absolute',right:0,top:0},
title:'Wiki Controls',
id:'cog',
click:function(){
$('#coglist').slideToggle();
if ($('#overlay').length==0){
$('<div/>',{id:'overlay',
click:function(){
$('#coglist').slideUp();
$('#overlay').remove();
},
css:{
position:'absolute',
top:0,left:0,background:'#aaaaaa',
width:'100%',height:'100%',
opacity:0.3,
'z-index':1002
}})
.appendTo('body');
}else{
$('#overlay').remove();
}
}
}))
);
$('.hint').each(function(){
$(this).before($('<div/>',{'class':'tease',
text:$(this).attr('title') || 'hint',
click:function(){
$(this).next().slideToggle();
}}));
$(this).hide();
});
$('#cog-cont').append(
$('<ul/>',{id:'coglist',css:{display:'none','z-index':1003}})
.append($('<li/>').append($('#p-search')))
.append($('#pick-engine'))
.append($('#pt-createaccount'))
.append($('#pt-userpage'))
.append($('#pt-mytalk'))
.append($('#pt-preferences'))
.append($('#pt-watchlist'))
.append($('#pt-mycontris'))
// .append($('#pt-login'))
// .append($('#pt-logout'))
.append($('#ca-view'))
.append($('#ca-viewsource'))
.append($('#ca-edit'))
.append($('#ca-history'))
.append($('#ca-nstab-main'))
.append($('#ca-talk'))
.append($('#ca-watch'))
.append($('#ca-unwatch'))
.append($('#ca-move'))
.append($('#ca-delete'))
.append($('#ca-protect'))
);
$('#pt-login,#pt-logout').before($('#pick-engine'));
$('#mw-head').prepend($('<a/>',{
id:'napier-ad',
href:'http://www.napier.ac.uk/faculties/engineering-computing-creative/computing/Pages/Postgraduate.aspx?sz',
title:'SQLZoo: developed and maintained at Edinburgh Napier University'
}));
var ins = $('<ins/>',{'class':'adsbygoogle',
style:"display:block;",
'data-ad-client':"ca-pub-0803888854272698",
'data-ad-slot':"2184001182",'data-ad-format':'auto'});
ins.prependTo('#footer');
$.getScript("//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
function(){
(adsbygoogle = window.adsbygoogle || []).push({});
});
if (wgCanonicalNamespace == 'MediaWiki' || wgCanonicalNamespace == 'Special')
$('#p-googleadsense').hide();
});
/*
Tweek the Log in scheme
* */
$(function(){
$('#mw-user-domain-section').hide();
$('#wpRemember').attr('checked',true);
});