375
回編集
細編集の要約なし タグ: モバイル編集 モバイルウェブ編集 |
編集の要約なし |
||
4行目: | 4行目: | ||
* @typedef MediaWiki | * @typedef MediaWiki | ||
* @prop {readonly Map<string, any>} config | * @prop {readonly Map<string, any>} config | ||
*/ | |||
/** | |||
* @typedef WGNamespaceIds | |||
* @prop {number} user | |||
* @prop {number} user_talk | |||
* @prop {number} special | |||
*/ | |||
/** | |||
* @typedef {{ [id: string]: string; }} WGFormattedNamespaces | |||
*/ | */ | ||
77行目: | 88行目: | ||
*/ | */ | ||
this.wgUserName = mw.config.get("wgUserName"); | this.wgUserName = mw.config.get("wgUserName"); | ||
/** | |||
* @type {WGNamespaceIds} | |||
*/ | |||
this.wgNamespaceIds = Object.assign({}, mw.config.get("wgNamespaceIds")); | |||
/** | |||
* @type {WGFormattedNamespaces} | |||
*/ | |||
this.wgFormattedNamespaces = Object.assign({}, mw.config.get("wgFormattedNamespaces")); | |||
} | } | ||
86行目: | 107行目: | ||
switch (component.id) { | switch (component.id) { | ||
case "mobile-ui-page-short-url": | case "mobile-ui-page-short-url": | ||
return | return [ | ||
this.wgServer | this.wgServer, | ||
this.wgScriptPath, | |||
"/?curid=", | |||
String(this.wgArticleId), | |||
); | ].join(""); | ||
case "mobile-ui-page-special-user": | |||
return encodeURI([ | |||
this.wgScriptPath, | |||
this.wgFormattedNamespaces[this.wgNamespaceIds.user], | |||
":", | |||
this.wgUserName, | |||
].join("")); | |||
case "mobile-ui-page-special-contributions": | |||
return encodeURI([ | |||
this.wgScriptPath, | |||
"/", | |||
this.wgFormattedNamespaces[this.wgNamespaceIds.special], | |||
":", | |||
"Contributions", | |||
"/", | |||
this.wgUserName, | |||
].join("")); | |||
case "mobile-ui-page-user-talk": | |||
return encodeURI([ | |||
this.wgScriptPath, | |||
"/", | |||
this.wgFormattedNamespaces[this.wgNamespaceIds.user_talk], | |||
":", | |||
this.wgUserName, | |||
].join("")); | |||
default: | default: |