“个人维基:首页/模板/最近更改”的版本间的差异

来自个人维基
跳转至: 导航搜索
(以“{{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-newpages">Ajax加载...</ol>
+
<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: "!redirect|!minor",
+
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-newpages" )
+
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
if ( rc[i].type === "log" )if( rc[i].logtype !== "move" ) continue
 
 
map[ title ] = true
 
map[ title ] = true
if ( rc[i].type === "log" ) continue
 
  
var ts = rc[i].timestamp
+
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>}}<noinclude>[[分类:首页模板|zuijin genggai]]{{DEFAULTSORT:shouye/muban/zuijin genggai}}</noinclude>
+
</html>}}

2022年11月16日 (三) 20:23的最后版本

    Ajax加载...