Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUGGEST] 在讨论页底部添加“新增讨论串”按钮 #89

Open
dragon-fish opened this issue Aug 19, 2020 · 1 comment
Open
Labels
Enhancement New feature or request

Comments

@dragon-fish
Copy link
Member

dragon-fish commented Aug 19, 2020

你所提出的建议是由于哪个功能不尽人意吗/Is your feature request related to a problem?

在讨论页只能编辑已有讨论串或者编辑整个页面,新建讨论串很麻烦

你认为能够如何改善/Describe the solution you'd like

RT

预计实现方式

  • 判断页面是不是讨论页
!(function () {
  // ...
  var config = mw.config.get()
  const _msg = (args) => {
    // return `{${args}}`
    return '新增讨论串'
  }
  /**
   * 判断页面是不是讨论页
   * 按照mw的规范,讨论页的 NamespaceID 一定是奇数
   */
  if (config.wgNamespaceNumber % 2 !== 0) {
    console.log('Is talk page')
    $('#mw-content-text').append(
      $('<div>', { class: 'in-page-edit', style: 'text-align: center' }).append(
        $('<hr>'),
        $('<button>', { text: _msg('edit-add-new-section-btn'), class: 'btn btn-secondary' }).click(function () {
          // Do sth.
          mw.notify('开始编辑新讨论串啦耶耶耶~')
        })
      )
    )
  }
})()
  • 编辑器
    • quickEdit模块进行小修改,例如传参{section: 'new'}时,替换summary的功能和位置

补充说明/Additional context

建议由萌娘百科用户星海子提供

@lovelyCARDINAL
Copy link
Member

建议尽快实现或section=new时给出错误的快速编辑建议先修一下(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants