Site Notice
hello, world
Difference between revisions of "User:机智的小鱼君/common.js"
From Project-EPB Commons
m |
([InPageEdit] 没有编辑摘要) |
||
Line 1: | Line 1: | ||
mw.loader.load('https://common.wjghj.cn/js/InPageEdit-canary'); | mw.loader.load('https://common.wjghj.cn/js/InPageEdit-canary'); | ||
− | $(function(){ | + | $(function () { |
$('#ca-view').after( | $('#ca-view').after( | ||
− | $('<li>',{ | + | $('<li>', { |
− | id:'ca-quick-edit', | + | id: 'ca-quick-edit', |
− | class:'collapsible' | + | class: 'collapsible' |
}).append( | }).append( | ||
$('<span>').append( | $('<span>').append( | ||
− | $('<a>',{ | + | $('<a>', { |
href: 'javascript:void(0)' | href: 'javascript:void(0)' | ||
}) | }) | ||
− | + | .text('快速编辑') | |
− | + | .click(function () { | |
− | + | InPageEdit.edit({ | |
− | + | page: mw.config.get('wgPageName'), | |
− | + | revision: mw.config.get('wgRevisionId') | |
− | + | }); | |
− | + | }) | |
) | ) | ||
) | ) | ||
); | ); | ||
}); | }); | ||
− | $('#firstHeading').append('<span style="font-size:12px;float:right">RevisionId: '+mw.config.get('wgRevisionId')+'</span>'); | + | if (mw.config.get('wgIsArticle')) { |
+ | $('#ca-history').append( | ||
+ | $('<a>', { | ||
+ | href: 'javascript:void(0);', | ||
+ | style: 'margin-left:2px;top: -1.2em;position: relative;font-size: 8px;' | ||
+ | }).append( | ||
+ | $('<span>').html('最后更改') | ||
+ | ).click(function () { | ||
+ | InPageEdit.quickDiff({ fromtitle: mw.config.get('wgPageName'), torelative: 'prev' }); | ||
+ | }) | ||
+ | ); | ||
+ | } | ||
+ | $('#firstHeading').append('<span style="font-size:12px;float:right">RevisionId: ' + mw.config.get('wgRevisionId') + '</span>'); |
Revision as of 17:17, 30 November 2019
mw.loader.load('https://common.wjghj.cn/js/InPageEdit-canary');
$(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')
});
})
)
)
);
});
if (mw.config.get('wgIsArticle')) {
$('#ca-history').append(
$('<a>', {
href: 'javascript:void(0);',
style: 'margin-left:2px;top: -1.2em;position: relative;font-size: 8px;'
}).append(
$('<span>').html('最后更改')
).click(function () {
InPageEdit.quickDiff({ fromtitle: mw.config.get('wgPageName'), torelative: 'prev' });
})
);
}
$('#firstHeading').append('<span style="font-size:12px;float:right">RevisionId: ' + mw.config.get('wgRevisionId') + '</span>');