MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| (47 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
mw.loader.load('// | mw.loader.load('//wiki.ekatrafoundation.org/index.php?title=User:Gurwinder/Edittool.js&action=raw&ctype=text/javascript'); | ||
// Turn <span class="mw-charinsert">foo</span> into a button that inserts "foo" | // Turn <span class="mw-charinsert">foo</span> into a button that inserts "foo" | ||
| Line 103: | Line 103: | ||
mw.loader.load( '/index.php?title=MediaWiki:Green-audio-player.min.css&action=raw&ctype=text/css', 'text/css'); | mw.loader.load( '/index.php?title=MediaWiki:Green-audio-player.min.css&action=raw&ctype=text/css', 'text/css'); | ||
$.when( | $.when( | ||
mw.loader.getScript( 'https:// | mw.loader.getScript( 'https://wiki.ekatrafoundation.org/index.php?title=MediaWiki:Green-audio-player.min.js&action=raw&ctype=text/javascript' ) | ||
) | ) | ||
.then( | .then( | ||
| Line 155: | Line 155: | ||
sel1.on('change', function (e) { | sel1.on('change', function (e) { | ||
var valueSelected = this.value; | var valueSelected = this.value; | ||
window.location = "https:// | window.location = "https://wiki.ekatrafoundation.org/wiki/Category:" + valueSelected; | ||
}); | }); | ||
}); | }); | ||
| Line 181: | Line 181: | ||
sel2.on('change', function (e) { | sel2.on('change', function (e) { | ||
var valueSelected = this.value; | var valueSelected = this.value; | ||
window.location = "https:// | window.location = "https://wiki.ekatrafoundation.org/wiki/Category:" + valueSelected; | ||
}); | }); | ||
}); | }); | ||
| Line 655: | Line 655: | ||
}; | }; | ||
$.getScript( '// | $.getScript( '//wiki.ekatrafoundation.org/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript' ) | ||
.done( function() { | .done( function() { | ||
importScript('MediaWiki:InterWikiTransclusion.js'); | importScript('MediaWiki:InterWikiTransclusion.js'); | ||
| Line 747: | Line 747: | ||
// Create the download button | // Create the download button | ||
var downloadButton = $('<a>') | var downloadButton = $('<a>') | ||
.attr('href', 'https:// | .attr('href', 'https://wiki.ekatrafoundation.org/images/epub/' + encodedTitle + '.epub') | ||
.attr('download', '') // Suggests to download the file rather than opening it | .attr('download', '') // Suggests to download the file rather than opening it | ||
.text('Download EPUB') | .text('Download EPUB') | ||
| Line 1,298: | Line 1,298: | ||
'?action=query&format=json&formatversion=2' + | '?action=query&format=json&formatversion=2' + | ||
'&generator=prefixsearch' + | '&generator=prefixsearch' + | ||
'&gpsnamespace=0&gpslimit= | '&gpsnamespace=0&gpslimit=50'; | ||
} | } | ||
| Line 1,345: | Line 1,345: | ||
$('video[src*="Ekatra_Logo.mp4"]').attr( | $('video[src*="Ekatra_Logo.mp4"]').attr( | ||
'poster', | 'poster', | ||
'https:// | 'https://wiki.ekatrafoundation.org/static/Ekatra-Poster.png' | ||
); | ); | ||
}); | |||
/*----------------------------5-6-2026---------------------------------------*/ | |||
$(function () { | |||
if (mw.config.get('skin') !== 'minerva') { | |||
return; | |||
} | |||
var title = mw.config.get('wgTitle') || ''; | |||
if (title.indexOf('/') !== -1) { | |||
$('head').append( | |||
'<style>@media only screen and (max-width:767px){#firstHeading{display:none!important;}}</style>' | |||
); | |||
} | |||
}); | |||
/*----------------------------8-6-2026---------------------------------------*/ | |||
$(function () { | |||
if (mw.config.get('skin') !== 'minerva') { | |||
return; | |||
} | |||
var title = $('p').filter(function () { | |||
return $(this).text().trim() === 'કાવ્ય, ભજન'; | |||
}).first(); | |||
var booksHeading = $('.wst-center.tiInherit').first(); | |||
if (title.length && booksHeading.length) { | |||
title.insertAfter(booksHeading); | |||
} | |||
}); | |||
/*---------------------------22-06-2026---------------------------------------*/ | |||
$(function () { | |||
$('.ekatra-right-author').each(function () { | |||
// Remove blank <p> inside Poem2 after author | |||
$(this).nextAll('p').each(function () { | |||
var html = $.trim($(this).html()); | |||
if (html === '' || html === '<br>' || html === '<br/>' || html === '<br />') { | |||
$(this).remove(); | |||
} else { | |||
return false; | |||
} | |||
}); | |||
// Remove blank <p><br></p> after Poem2 block | |||
var p = $(this).closest('.Poem2-Ekatra').next('p'); | |||
if (p.length && p.find('br').length) { | |||
p.remove(); | |||
} | |||
}); | |||
}); | }); | ||