Site Notice

hello, world

Difference between revisions of "MediaWiki:Gadget-WikiForum/loader.js"

From Project-EPB Commons
([InPageEdit] 没有编辑摘要)
 
([InPageEdit] 没有编辑摘要)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
mw.hook('WikiForum').add(function() {
+
mw.hook('WikiForum').add(function(Core) {
 +
  var loadNS = [3000]
 
   var conf = mw.config.get()
 
   var conf = mw.config.get()
   if (conf.wgNamespaceNumber === 3000 && $('.wiki-forum').length > 0) {
+
   if (
     WikiForum.render.fromPage()
+
    loadNS.includes(conf.wgNamespaceNumber) &&
 +
    $('.wiki-forum').length > 0 &&
 +
    conf.wgArticleId !== 0
 +
  ) {
 +
     console.info('Is WikiForum NS')
 +
    Core.renderer.fromPage(conf.wgPageName)
 +
  } else {
 +
    console.info('Not WikiForum NS')
 
   }
 
   }
 
})
 
})

Latest revision as of 22:46, 7 January 2021

mw.hook('WikiForum').add(function(Core) {
  var loadNS = [3000]
  var conf = mw.config.get()
  if (
    loadNS.includes(conf.wgNamespaceNumber) &&
    $('.wiki-forum').length > 0 &&
    conf.wgArticleId !== 0
  ) {
    console.info('Is WikiForum NS')
    Core.renderer.fromPage(conf.wgPageName)
  } else {
    console.info('Not WikiForum NS')
  }
})