-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #239 from inpageedit/dragon-fish/issue238
Add timestamp to page diff function
- Loading branch information
Showing
20 changed files
with
211 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
var config = mw.config.get() | ||
|
||
/** | ||
* @module _hasRight 是否拥有权限 | ||
* @param {String} right | ||
* @return {Boolean} | ||
* @param {string} right | ||
* @return {boolean} | ||
*/ | ||
export const _hasRight = function (right) { | ||
if (config.wgUserIsBlocked === true) { | ||
return false | ||
} | ||
if (mw.config.get('wgUserRights').indexOf(right) > -1) { | ||
return true | ||
} else { | ||
const conf = window.mw.config.get() | ||
console.info( | ||
'[InPageEdit] _hasRight', | ||
right, | ||
conf.wgUserIsBlocked, | ||
conf.wgUserRights | ||
) | ||
if (conf.wgUserIsBlocked) { | ||
return false | ||
} | ||
return (conf.wgUserRights || []).includes(right) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import version from './version' | ||
|
||
export const mwConfig = mw.config.get() | ||
export const mwApi = new mw.Api({ | ||
parameters: { | ||
formatversion: 2, | ||
format: 'json', | ||
}, | ||
ajax: { | ||
headers: { | ||
'Api-User-Agent': `InPageEdit-v2/${version}`, | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.