ಮೀಡಿಯವಿಕಿ:Gadget-WSexport.js

ವಿಕಿಸೋರ್ಸ್ದಿಂದ

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/**
 * Adds a "Download as EPUB" link to the sidebar
 *
 * Generates and starts a download of the current page as an EPUB file.
 * Subpages of the current page (if any) are included as well.
 *
 * Uses the WSExport tool on Wikimedia Labs:
 * http://wsexport.wmflabs.org/tool/book.php
 *
 * See Oldwikisource:Wikisource:WSexport for more information
 * Bug reports should go to fr:Wikisource:Wsexport
 * Tool source code at https://github.com/wsexport
 */
/*global mw, $ */
if ( $.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 0 , 114 ] ) !== -1 ) {
	$( function () {
		mw.util.addPortletLink(
			'p-coll-print_export',
			'https://wsexport.wmflabs.org/?' + $.param( {
				lang: 'kn',
				format: 'epub-3',
				page: mw.config.get( 'wgPageName' )
			} ),
			'Download as EPUB',
			'n-epubExport',
			'Download an EPUB version of this page',
			'',
			'#t-print'
		);
		mw.util.addPortletLink(
			'p-coll-print_export',
			'https://wsexport.wmflabs.org/?' + $.param( {
				lang: 'kn',
				format: 'mobi',
				page: mw.config.get( 'wgPageName' )
			} ),
			'Download as MOBI',
			'n-mobiExport',
			'Download a MOBI version of this page',
			'',
			'#t-print'
		);
		mw.util.addPortletLink(
			'p-coll-print_export',
			'https://wsexport.wmflabs.org',
			'Choose format',
			'n-toolExport',
			'Download a version of a work in other formats',
			'',
			'#t-print'
		);
	} );
}