Widget:WJG UserExamQuery: Difference between revisions
Jump to navigation
Jump to search
Undo revision 1002331 by William J Gibson (talk) |
No edit summary |
||
Line 32: | Line 32: | ||
</style> | </style> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
function ensureLoggedIn() { | function ensureLoggedIn() { | ||
mw.loader.using('mediawiki.user', function() { | mw.loader.using('mediawiki.user', function() { | ||
Line 39: | Line 42: | ||
window.location.replace("http://wikidoc.org/index.php?title=Special:UserLogin&returnto=UserExamQuery"); | window.location.replace("http://wikidoc.org/index.php?title=Special:UserLogin&returnto=UserExamQuery"); | ||
} else { | } else { | ||
console.log('running the query now'); | |||
runQuery(); | runQuery(); | ||
console.log('Just finished running the query'); | |||
} | } | ||
}); | }); | ||
}); | }); | ||
$("tr:odd").addClass("odd"); | $("tr:odd").addClass("odd"); | ||
console.log('Added odd to all of the odd trs'); | |||
$("tr:not(.odd)").hide(); | $("tr:not(.odd)").hide(); | ||
console.log('Hiding all of the not odd trs'); | |||
$("tr:first-child").show(); | $("tr:first-child").show(); | ||
console.log(' | console.log('Showing the table header'); | ||
}; | |||
function runQuery() { | function runQuery() { | ||
var api = new mw.Api(); | var api = new mw.Api(); | ||
Line 105: | Line 112: | ||
}); | }); | ||
}); | }); | ||
}; | }; | ||
$( document ).ready(function() { | $( document ).ready(function() { | ||
console.log('Running ensureLoggedIn); | |||
ensureLoggedIn; | |||
console.log('Finished running ensureLoggedIn'); | |||
$("tr.odd").click(function(){ | $("tr.odd").click(function(){ | ||
$(this).next("tr").toggle(); | |||
$(this).find(".arrow").toggleClass("up"); | |||
}); | |||
}); | }); | ||