MediaWiki:Gadget-find-archived-section.js: Difference between revisions

Content deleted Content added
fix cases where exact matches weren't being obtained
fix for MediaViewer URLs
Line 12:
 
var sectionName = decodeURIComponent(window.___location.hash.slice(1)).replace(/_/g, ' ');
if (!sectionName || document.getElementById(sectionName.replace(/ /g, '_'))no section !==name null)in {URL
sectionName.indexOf('/media/') === 0 || // URLs used by MediaViewer
return;
document.getElementById(sectionName.replace(/ /g, '_')) !== null) { // section exists on page
return;
}
 
$('#mw-content-text').before(
$('<div>')
$('<div>') .html('Looks like the discussion "' + sectionName + '" has been archived. Finding archived discussion...').addClass('archived-section-prompt').css({
'font-size': '90%',
.addClass('archived-section-prompt')
'padding-left': '20px'
}) .css({
'font-size': '90%',
'padding-left': '20px'
})
);
 
Line 49 ⟶ 54:
 
} else {
divHtml = 'Looks like the discussion "' + sectionName + '" has been archived. ' ;
 
var discussionLink;