Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
Pinventado (talk | contribs) (Modify pattern links so that OPR is only shown when other pattern formats are not available) |
Pinventado (talk | contribs) (Add comaprisons) |
||
Line 9: | Line 9: | ||
/* Remove link to other pattern format if page does not exist, but OPR page exists; remove extra ( ) */ | /* Remove link to other pattern format if page does not exist, but OPR page exists; remove extra ( ) */ | ||
var | var plmainnotnew =$(".pl-main a:not(.new)"); | ||
$(".pl-other | if(plmainnotnew){ | ||
$(".pl-main", | var plothernew = $(".pl-other a.new", plmainnotnew.parent().parent().parent().parent()); | ||
if (plothernew){ | |||
var container = plothernew.parent().parent().parent(); | |||
$(".pl-other, container).remove(); | |||
$(".pl-main", container).html($(".pl-content", container)); | |||
} | |||
} |
Revision as of 12:58, 22 July 2016
/* Any JavaScript here will be loaded for all users on every page load. */ /* Patternlinks */ /* Remove link to OPR if the page refers to that pattern */ $(".pl-other .selflink").parent().parent().next().remove(); /* Remove link to OPR if OPR does not exist */ $(".pl-main a.new").remove(); /* Remove link to other pattern format if page does not exist, but OPR page exists; remove extra ( ) */ var plmainnotnew =$(".pl-main a:not(.new)"); if(plmainnotnew){ var plothernew = $(".pl-other a.new", plmainnotnew.parent().parent().parent().parent()); if (plothernew){ var container = plothernew.parent().parent().parent(); $(".pl-other, container).remove(); $(".pl-main", container).html($(".pl-content", container)); } }