Difference between revisions 40419 and 40420 on zhwikivoyage//<nowiki> // vim: set noet sts=0 sw=8: (function($){ /* (contracted; show full) if( latest.date > date ) { if( !confirm( "近1分钟内一个同样的 " + latest.type + " 模板已被发出。\n是否继续?" ) ) { pageobj.statelem.info( '用户取消' ); return; } } var hdateHeaderRegexResult = new RegExp( "^==+\\s*" + date.getUTCFullYear() + "年" + (date.getUTCMonth() + 1) + "月" + ⏎ ⏎ "\\s*==+", 'm' );.exec( text ); // If dateHeaderRegexResult is null then lastHeaderIndex is never checked. If it is not null but // \n== is not found, then the date header must be at the very start of the page. lastIndexOf // returns -1 in this case, so lastHeaderIndex gets set to 0 as desired. var lastHeaderIndex = text.lastIndexOf( "\n==" ) + 1; if( text.length > 0 ) { text += "\n\n"; } if( params.main_group === 'block' ) { if( Twinkle.getPref('blankTalkpageOnIndefBlock') && ( messageData.indefinite || (/indef|\*|max/).exec( params.block_timer ) ) ) { Morebits.status.info( '信息', '根据参数设置清空讨论页并创建新标题' ); text = "== " + date.getUTCFullYear() + "年" + (date.getUTCMonth() + 1) + "月 " + " ==\n"; } else if( !hdateHeaderRe.gexec( text )Result || dateHeaderRegexResult.index !== lastHeaderIndex ) { Morebits.status.info( '信息', '未找到当月标题,将创建新的' ); text += "== " + date.getUTCFullYear() + "年" + (date.getUTCMonth() + 1) + "月 " + " ==\n"; } text += Twinkle.warn.callbacks.getBlockNoticeWikitext(params.sub_group, params.article, params.block_timer, params.reason, messageData.indefinite); } else { if( !hmessageData.heading ) { text += "== " + messageData.heading + " ==\n"; } else if( !dateHeaderRe.gexec( text )Result || dateHeaderRegexResult.index !== lastHeaderIndex ) { Morebits.status.info( '信息', '未找到当月标题,将创建新的' ); text += "== " + date.getUTCFullYear() + "年" + (date.getUTCMonth() + 1) + "月 " + " ==\n"; } text += Twinkle.warn.callbacks.getWarningWikitext(params.sub_group, params.article, params.reason, params.main_group === 'custom') + "--~~~~"; } (contracted; show full) wikipedia_page.setCallbackParameters( params ); wikipedia_page.setFollowRedirect( true ); wikipedia_page.load( Twinkle.warn.callbacks.main ); }; })(jQuery); //</nowiki> All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://zh.wikivoyage.org/w/index.php?diff=prev&oldid=40420.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|