Site Notice

hello, world

Difference between revisions of "InPageEdit-v2/SDK"

From Project-EPB Commons
(Created page with "== 示例 == === 在编辑链接后添加快速编辑链接 === 此示例代码已在Vector、Timeless以及Hydra皮肤上测试可用 <pre class="prettyprint lang-js"> $(func...")
 
m (机智的小鱼君 moved page /API to InPageEdit-v2/API without leaving a redirect)
(No difference)

Revision as of 15:56, 18 November 2019

示例

在编辑链接后添加快速编辑链接

此示例代码已在Vector、Timeless以及Hydra皮肤上测试可用

$(function(){
  $('#ca-view').after(
    $('<li>',{
      id:'ca-quick-edit',
      class:'collapsible'
    }).append(
      $('<span>').append(
        $('<a>',{
          href: 'javascript:void(0)'
        })
        .text('快速编辑')
        .click(function(){
          InPageEdit.edit({
            page: mw.config.get('wgPageName'),
            revision: mw.config.get('wgRevisionId')
          });
        })
      )
    )
  );
});