Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6067133
CommunityConfiguration.vue
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
CommunityConfiguration.vue
View Options
<template>
<div class="ext-cite-configuration">
<backlink-settings
:cldr-alphabet="cldrAlphabet"
:backlink-alphabet="backlinkAlphabet"
@update="updateBacklinkAlphabet"></backlink-settings>
</div>
<cdx-button
action="progressive"
weight="primary"
@click="onSubmit"
>
{{ $i18n( 'cite-configuration-submit' ).text() }}
</cdx-button>
</template>
<script>
const BacklinkSettings = require( './BacklinkSettings.vue' );
const { CdxButton } = require( '../codex.js' );
let backlinkAlphabetText = mw.config.get( 'wgCiteBacklinkAlphabet' );
/**
* Cite special page providing a front-end to community configuration.
*/
// @vue/component
module.exports = {
name: 'CommunityConfiguration',
components: {
BacklinkSettings,
CdxButton
},
setup() {
return {
backlinkAlphabet: backlinkAlphabetText,
cldrAlphabet: mw.config.get( 'wgCldrAlphabet' ),
providerId: mw.config.get( 'wgCiteProviderId' ),
mwApi: new mw.Api()
};
},
methods: {
updateBacklinkAlphabet( value ) {
backlinkAlphabetText = value;
},
onSubmit() {
// TODO: Reuse admin check from community config extension
// TODO: Handle input validation and errors
// TODO: Handle API errors
// TODO: Show success message
this.mwApi.postWithToken( 'csrf', {
action: 'communityconfigurationedit',
provider: this.providerId,
content: JSON.stringify( {
// eslint-disable-next-line camelcase
Cite_Settings: {
backlinkAlphabet: backlinkAlphabetText
}
} ),
// TODO: Let users set the edit summary message
summary: 'CommunityConfig Edit',
formatversion: 2,
errorformat: 'html'
} );
}
}
};
</script>
<style lang="less">
// To access Codex design tokens and mixins inside Vue files, import MediaWiki skin variables.
@import 'mediawiki.skin.variables.less';
</style>
File Metadata
Details
Attached
Mime Type
text/html
Expires
Oct 5 2026, 05:03 (6 w, 8 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7b/26/c5579f4dd1aa6600d3fe24e96134
Default Alt Text
CommunityConfiguration.vue (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment