更多操作
无编辑摘要 |
无编辑摘要 |
||
(未显示同一用户的1个中间版本) | |||
第3行: | 第3行: | ||
//显示题目 | //显示题目 | ||
(function(){ | |||
if($('.data').length >0){ | |||
getDataFromDOM() | |||
renderTimuFromSessionStorage() | |||
} | |||
} | }()) | ||
//显示上下章节切换按钮 | //显示上下章节切换按钮 | ||
第17行: | 第19行: | ||
getIndexPageWikiTextAndInsertButton(indexName, $('.mw-page-title-main').text()) | getIndexPageWikiTextAndInsertButton(indexName, $('.mw-page-title-main').text()) | ||
} | } | ||
}, | },500) | ||
setTimeout(function(){ | setTimeout(function(){ | ||
if($('.data').length >0){ | if($('.data').length >0){ | ||
第31行: | 第33行: | ||
}) | }) | ||
} | } | ||
}, | },500) | ||
function getTikuSettingFromMediawiki(){ | function getTikuSettingFromMediawiki(){ |
2023年7月3日 (一) 02:06的最新版本
//显示题目
(function(){
if($('.data').length >0){
getDataFromDOM()
renderTimuFromSessionStorage()
}
}())
//显示上下章节切换按钮
setTimeout(function(){
if($('.mw-page-title-namespace').text() === '题库'){
var thisPageName = $('.mw-page-title-main').text().split('/')[0]
var indexName = '模板:目录-'+thisPageName
getIndexPageWikiTextAndInsertButton(indexName, $('.mw-page-title-main').text())
}
},500)
setTimeout(function(){
if($('.data').length >0){
//获取用户设置
getTikuSettingFromMediawiki().done(function(){
console.log('run2')
toolBarMain()//显示工具栏
//加载如果开启了temp则加载
if(!gWebPageTimuSettings().noTemp){
var pageName = gWebPageTimuSettings().pageName
tikuWebPageTempMain(pageName)
}
})
}
},500)
function getTikuSettingFromMediawiki(){
return getPreference().done(function(data){
console.log('done1')
// noTemp: 是否启动暂存功能的设置
var noautotemp = data.query.userinfo.options["tiku-temp-noautotemp"]
console.log(noautotemp)
var noTemp = noautotemp === 0 || noautotemp === undefined ? false:true
// pageName: 本页名称
var pageName = mw.config.get([
'wgPageName',
]).wgPageName
// userId: 用户id
var userId = mw.config.get([
'wgUserId',
]).wgUserId
userId = userId === undefined ? '0':userId
console.log(userId)
var settings = {
noTemp: noTemp,
pageName:pageName,
userId:userId
}
sWebPageTimuSettings(settings)
})
}