Site Notice

hello, world

InPageEdit-v2/SDK

From Project-EPB Commons
< InPageEdit-v2
Revision as of 15:56, 18 November 2019 by 机智的小鱼君 (talk | contribs) (机智的小鱼君 moved page /API to InPageEdit-v2/API without leaving a redirect)

示例

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

此示例代码已在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')
          });
        })
      )
    )
  );
});