(Translated by https://www.hiragana.jp/)
MediaWiki:Gadget-noteTA.js - 维基百科,自由的百科全书 とべ转到内容ないよう

MediaWiki:Gadget-noteTA.js

维基百科ひゃっか自由じゆうてき百科ひゃっかぜん

这是ほん页的いち历史版本はんぽんゆかりLiangentとめげん | 贡献ざい2012ねん10がつ22にち (いち) 05:18编辑。这可能かのうとうぜん版本はんぽん存在そんざい巨大きょだいてき异。

注意ちゅうい保存ほぞんきさき,你必须清じょ浏览缓存才能さいのういた做出てき更改こうかいGoogle ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具こうぐ栏的“刷新さっしん”按钮。まいりHelp:绕过浏览缓存以获取さら帮助。

( function( $, mw ) { $( function() {
    var $dialog = null;
    var api = null;
    var init = function() {
        $dialog = $( '<div id="noteTA-dialog" />' );
        $dialog.html( '<div class="mw-ajax-loader" style="margin-top: 48px;" />' );
        $dialog.dialog( {
            title: wgULS( '词转换', '轉換てんかん' )
        } );
        api = new mw.Api();
        run();
    }, run = function() {
        var wikitext = '';
        var $dom = $( '#noteTA' );
        var collapse = true;

        var $noteTAtitle = $dom.find( '#noteTA-title' );
        if ( $noteTAtitle.length ) {
            var titleConv = decodeURIComponent( $noteTAtitle.attr( 'data-noteta-code' ).replace(/\+/g, '%20') );
            var titleDesc = $noteTAtitle.attr( 'data-noteta-desc' );
            if ( titleDesc ) {
                titleDesc = '(' + decodeURIComponent( titleDesc.replace(/\+/g, '%20') ) + ')';
            } else {
                titleDesc = '';
            }
            wikitext += '<span style="float: right;">{{edit|' + mw.config.get( 'wgPageName' ) + '|section=0}}</span>\n';
            wikitext += '; 本文ほんぶん使用しよう[[Help:ちゅうぶん维基百科ひゃっかてきしげる简、地区ちく词处#條目じょうもく標題ひょうだい|标题手工しゅこう转换]]\n';
            wikitext += '* 转换标题为:-{D|' + titleConv + '}-' + titleDesc + '\n';
            wikitext += '* 实际标题为:-{' + mw.config.get( 'wgPageName' ) + '}-;とうぜん显示为:-{' + titleConv + '}-\n';
        }

        var $noteTAgroups = $dom.find( '#noteTA-group > *[id^="noteTA-group-"]' );
        if ( $noteTAgroups.length > 1 ) {
            collapse = true;
        }
        $noteTAgroups.each( function() {
            var $this = $( this );
            if ( $this.hasClass( 'noteTA-missing' ) ) {
                wikitext += '; 本文ほんぶん使用しようてき公共こうきょう转换组“' + $this.attr( 'data-noteta-group' ) + '”なお创建\n';
                wikitext += '* {{edit|Template:CGroup/' + $this.attr( 'data-noteta-group' ) + '|创建公共こうきょう转换组“' + $this.attr( 'data-noteta-group' ) + '”}}\n';
            } else {
                wikitext += '{{CGroup/' + $this.attr( 'data-noteta-group' ) + '}}\n';
            }
        } );

        var $noteTAlocal = $dom.find( '#noteTA-local' );
        if ( $noteTAlocal.length ) {
            collapse = true;
            wikitext += '<span style="float: right;">{{edit|' + mw.config.get( 'wgPageName' ) + '|section=0}}</span>\n';
            wikitext += '; 本文ほんぶん使用しよう[[Help:ちゅうぶん维基百科ひゃっかてきしげる简、地区ちく词处#ひかえせい动转换的だい碼|全文ぜんぶん手工しゅこう转换]]\n';
            var $noteTAlocals = $noteTAlocal.children( '*[id^="noteTA-local-"]' );
            $noteTAlocals.each( function() {
                var $this = $( this );
                var localConv = decodeURIComponent( $this.attr( 'data-noteta-code' ).replace(/\+/g, '%20') );
                var localDesc = $this.attr( 'data-noteta-desc' );
                if ( localDesc ) {
                    localDesc = '(' + decodeURIComponent( localDesc.replace(/\+/g, '%20') ) + ')';
                } else {
                    localDesc = '';
                }
                wikitext += '* -{D|' + localConv + '}-' + localDesc + 'とうぜん显示为:-{' + localConv + '}-\n';
            } );
        }

        // Maybe move to a template
        wikitext += '----\n';
        wikitext += '; [[Help:ちゅうぶん维基百科ひゃっかてきしげる简、地区ちく词处|词转换]]说明\n';
        wikitext += ': 轉換てんかんちゅうぶん维基てきいちこう自動じどう轉換てんかん目的もくてき通過つうか-{zh-hans:计算つくえほどじょ; zh-hant:電腦でんのうほどしき}-自動じどうしょうじょしげる简、地区ちく词等不同ふどう<strong>用字ようじしき</strong>てき差異さい,以達いた閱讀方便ほうべん轉換てんかん包括ほうかつ全局ぜんきょく轉換てんかん手動しゅどう轉換てんかんほん說明せつめいしょ使用しようてき标题转换全文ぜんぶん转换技術ぎじゅつぞく手動しゅどう轉換てんかん。\n';
        wikitext += ': 如果您想对我们的词转换系统提出ていしゅつ一些改进建议,あるものひっさげ交应ようめんさら广的转换([[ちゅうぶん维基百科ひゃっか]]ぜん站乃いたり[[MediaWiki]]软件),あるもの报告转换けい统的错误,请前往[[Wikipedia:词转换请もとめあるこう选]]发表您的见。\n';

        var parse = function() {
            api.post( {
                action: 'parse',
                title: 'Template:CGroup/-',
                text: wikitext,
                prop: 'text',
                variant: mw.config.get( 'wgUserVariant' )
            }, {
                ok: function( results ) {
                    $dialog.html( results.parse.text['*'] );
                    if ( collapse ) {
                        $dialog.find( '.mw-collapsible' ).makeCollapsible();
                        $dialog.find( '.mw-collapsible-toggle a' ).on( 'click.mw-collapse', function( e ) {
                            setTimeout( function() {
                                $( this ).parent( '.mw-collapsible' ).find( '.mw-collapsible-content' ).promise().done( function() {
                                    $dialog.dialog( 'option', 'position', 'center' );
                                } );
                            }, 100 );
                        } );
                    }
                    $dialog.dialog( 'option', 'width', Math.round( $( window ).width() * 0.8 ) );
                    $dialog.css( 'max-height', Math.round( $( window ).height() * 0.8 ) + 'px' );
                    $dialog.dialog( 'option', 'position', 'center' );
                },
                err: parse
            } );
        };
        parse();
    };

    $( '#noteTA-topicon' )
        .css( 'cursor', 'pointer' )
        .click( function() {
            if ( $dialog == null ) {
                init();
            } else {
                $dialog.dialog( 'open' );
            }
        } );
} ); } )( jQuery, mediaWiki );