221
edits
No edit summary |
No edit summary |
||
Line 705: | Line 705: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
alert('Script is running'); | alert('Inline Script is running'); | ||
var pageTitle = mw.config.get('wgTitle'); | var pageTitle = mw.config.get('wgTitle'); | ||
var downloadButton = document.createElement('a'); | |||
var downloadButton = | downloadButton.href = '/find_epub.php?title=' + encodeURIComponent(pageTitle); | ||
downloadButton.innerText = 'Download EPUB'; | |||
downloadButton.style.display = 'inline-block'; | |||
downloadButton.style.padding = '8px 16px'; | |||
downloadButton.style.backgroundColor = '#4CAF50'; | |||
downloadButton.style.color = '#ffffff'; | |||
downloadButton.style.textAlign = 'center'; | |||
downloadButton.style.borderRadius = '4px'; | |||
downloadButton.style.textDecoration = 'none'; | |||
downloadButton.style.marginTop = '10px'; | |||
downloadButton.style.marginBottom = '10px'; | |||
var contentArea = document.getElementById('mw-content-text'); | |||
if (contentArea) { | |||
contentArea.insertBefore(downloadButton, contentArea.firstChild); | |||
} else { | |||
console.error('Content area not found.'); | |||
} | |||
}); | }); |