利用者:Akaniji/MediaWiki:Gadget-WSexport.js

提供:Wikisource

注意: 保存後、変更を確認するにはブラウザーのキャッシュを消去する必要がある場合があります。

  • Firefox / Safari: Shift を押しながら 再読み込み をクリックするか、Ctrl-F5 または Ctrl-R を押してください (Mac では ⌘-R)
  • Google Chrome: Ctrl-Shift-R を押してください (Mac では ⌘-Shift-R)
  • Internet Explorer / Microsoft Edge: Ctrl を押しながら 最新の情報に更新 をクリックするか、Ctrl-F5 を押してください
  • Opera: 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',
			'//tools.wmflabs.org/wsexport/tool/book.php?' + $.param( {
				lang: 'ja',
				format: 'epub-3',
				page: mw.config.get( 'wgPageName' )
			} ),
			'電子書籍に変換',
			'n-epubExport',
			'EPUB形式でこのページをダウンロード',
			'',
			'#t-print'
		);
	} );
}