LNN的非博客:首页:修订间差异
来自 LNN的:not(博客)?
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第7行: | 第7行: | ||
<ol class="lnnblog-homepage-newpages">Ajax加载...</ol> | <ol class="lnnblog-homepage-newpages">Ajax加载...</ol> | ||
</fieldset> | </fieldset> | ||
<fieldset><legend>分类</legend> | |||
<ol class="lnnblog-homepage-categories">Ajax加载...</ol> | |||
</fieldset> | |||
<script> | <script> | ||
$.ajax('/dgck81lnn/index.php/%E7%89%B9%E6%AE%8A:%E6%96%B0%E5%BB%BA%E9%A1%B5%E9%9D%A2') | |||
if(location.host !== "www.mywiki.cn") // 个人维基域名不加www,出大问题 | |||
location.replace("www.mywiki.cn" + location.search + location.hash); // 硬核手动重定向 | |||
$.ajax('/dgck81lnn/index.php/%E7%89%B9%E6%AE%8A:%E6%96%B0%E5%BB%BA%E9%A1%B5%E9%9D%A2') // 查询[[特殊:新建页面]] | |||
.done(function(html) { | .done(function(html) { | ||
try { | try { | ||
if (!html) | if (!html) | ||
throw | throw "请求失败"; | ||
var h = document.createElement('html'); | var h = document.createElement('html'); | ||
h.innerHTML = /<html[^>]*>([^]*)<\/html>/.exec(html)[1]; | h.innerHTML = /<html[^>]*>([^]*)<\/html>/.exec(html)[1]; | ||
var l = h.querySelector('#mw-content-text>ul'); | var l = h.querySelector('#mw-content-text>ul'); | ||
if (!l) | if (!l) | ||
throw | throw "找不到元素'#mw-content-text>ul'"; | ||
var r = ""; | var r = ""; | ||
for (item of l.querySelectorAll('li')) { | for (item of l.querySelectorAll('li')) { | ||
| 第29行: | 第37行: | ||
} | } | ||
catch (e) { | catch (e) { | ||
$('.lnnblog-homepage-newpages').html('加载失败:'+e); | |||
$('.lnnblog-homepage- | } | ||
}); | |||
$.ajax('/dgck81lnn/index.php/%E7%89%B9%E6%AE%8A:%E9%A1%B5%E9%9D%A2%E5%88%86%E7%B1%BB') // 查询[[特殊:页面分类]] | |||
.done(function(html) { | |||
try { | |||
if (!html) | |||
throw "请求失败"; | |||
var h = document.createElement('html'); | |||
h.innerHTML = /<html[^>]*>([^]*)<\/html>/.exec(html)[1]; | |||
var l = h.querySelector('#mw-content-text>.mw-spcontent>ul'); | |||
if (!l) | |||
throw "找不到元素'#mw-content-text>.mw-spcontent>ul'"; | |||
var r = ""; | |||
for (item of l.querySelectorAll('li')) { | |||
r += "<li>"; | |||
r += item.querySelector('a').outerHTML; | |||
r += "</li>"; | |||
} | |||
$('.lnnblog-homepage-categories').html(r); | |||
} | |||
catch (e) { | |||
$('.lnnblog-homepage-categories').text('加载失败:'+e); | |||
} | } | ||
}); | }); | ||
| 第38行: | 第68行: | ||
* [[特殊:所有页面]] - 所有页面(按标题排序) | * [[特殊:所有页面]] - 所有页面(按标题排序) | ||
* [[特殊:新建页面]] - 最近创建的页面 | * [[特殊:新建页面]] - 最近创建的页面 | ||
* [[特殊:页面分类]] - 查看页面分类列表 | |||
* [[特殊:版本信息]] - 可以查看MyWiki提供的扩展程序列表 | * [[特殊:版本信息]] - 可以查看MyWiki提供的扩展程序列表 | ||
* [[特殊:统计信息]] - 惨淡的统计数据 | * [[特殊:统计信息]] - 惨淡的统计数据 | ||