旧站的内容可能已过时。您可以前往“真魂”分站查看本页面,那里的内容将会定期同步。
“个人维基:首页/模板/最近更改”的版本间的差异
来自个人维基
(以“{{MywikiParaHack|<html> <ol class="lnnblog-homepage-newpages">Ajax加载...</ol> <script> $(window).on( "load", function () { function getTimeDesc( ts ) { var date...”为内容创建页面) |
小 (fix) |
||
(未显示1个用户的9个中间版本) | |||
第1行: | 第1行: | ||
{{MywikiParaHack|<html> | {{MywikiParaHack|<html> | ||
− | <ol class="lnnblog-homepage- | + | <ol class="lnnblog-homepage-recentchanges">Ajax加载...</ol> |
<script> | <script> | ||
$(window).on( "load", function () { | $(window).on( "load", function () { | ||
第21行: | 第21行: | ||
list: "recentchanges", | list: "recentchanges", | ||
rctype: "new|edit|log", | rctype: "new|edit|log", | ||
− | rcshow: " | + | rcshow: "!minor", |
rcnamespace: "0|4", | rcnamespace: "0|4", | ||
rclimit: 200, | rclimit: 200, | ||
− | rcprop: "title|timestamp|loginfo" | + | rcprop: "title|timestamp|loginfo|redirect" |
} ) | } ) | ||
.done( function ( data ) { | .done( function ( data ) { | ||
− | var container = $( ".lnnblog-homepage- | + | var container = $( ".lnnblog-homepage-recentchanges" ) |
try { | try { | ||
第42行: | 第42行: | ||
for ( var i = 0; i < rc.length; ++i ) { | for ( var i = 0; i < rc.length; ++i ) { | ||
− | var title = rc[i].title | + | var title = rc[ i ].title |
+ | if ( rc[ i ].type === "log" ) { | ||
+ | if ( rc[ i ].logtype !== "move" ) continue | ||
+ | map[ title ] = true | ||
+ | title = rc[ i ].move.new_title | ||
+ | } | ||
+ | if ( /\/模板(\/|$)/.test( title ) ) continue | ||
if ( map.hasOwnProperty( title ) ) continue | if ( map.hasOwnProperty( title ) ) continue | ||
− | |||
map[ title ] = true | map[ title ] = true | ||
− | |||
− | + | if ( rc[ i ].type !== "log" ) | |
+ | if ( "redirect" in rc[ i ] ) continue | ||
− | var li = $("<li><a></a> — <span></span></li>") | + | var ts = rc[ i ].timestamp |
+ | |||
+ | var li = $( "<li><a></a> — <span></span></li>" ) | ||
$( "a", li ).text( title ).attr( "href", mw.util.wikiGetlink(title) ) | $( "a", li ).text( title ).attr( "href", mw.util.wikiGetlink(title) ) | ||
$( "span", li ).text( getTimeDesc( ts ) ) | $( "span", li ).text( getTimeDesc( ts ) ) | ||
container.append( li ) | container.append( li ) | ||
} | } | ||
− | |||
} catch (e) { | } catch (e) { | ||
container.text( "加载失败:" + e ) | container.text( "加载失败:" + e ) | ||
第63行: | 第69行: | ||
} ) | } ) | ||
</script> | </script> | ||
− | </html>}} | + | </html>}} |
2022年11月16日 (三) 20:23的最后版本
- Ajax加载...