FANDOM


ReplyAndClose gives admins and discussions moderators the ability to simultaneously post a final reply and close the thread. The script can be configured to set the reason for closing the thread, the default reply and an object for storing generic replies.

Note that this works only on board threads.

Installation

Add the following to your Special:MyPage/common.js for personal use, or MediaWiki:Common.js for site wide use:

importArticles({
    type: 'script',
    articles: [
        // ...
        'u:dev:MediaWiki:ReplyAndClose/code.js',
        // ...
    ]
});

Configuration

Key Description Type Default
reason Reason for closing the thread string see reply $1*
def Default reply string
generic An object for storing generic replies object {}
  • $1 is changed to a link to the reply that you'll be posting; format: [[#<number>]]

All configurations made to the script are to be stored in the replyAndClose object, like so:

window.replyAndClose = {
    reason: 'Please see reply $1 for the reason',
    def: 'Hello!\n\nThis thread is a violation of our [[:Category:Site policies|policies]] and is thus being closed. Please contact an [[Special:Listusers/sysop|administrator]] if you feel like this was a mistake.\n\nThanks.',
    generic: {
        'inappropriate': 'Hi!\n\nThe topic of this thread is inappropriate for this wiki, which is why I\'ve closed it. Please see to it that this does not happen again.\n\nThanks.',
        'offtopic': 'Hi!\n\nWhile we appreciate the time you took to post a thread here, the topic is not suitable for {{SITENAME}}. This thread will be closed now, but we hope that your next post will be on-topic.\n\nThanks.',
        'archive': 'This thread has long served its purpose and has been target to spam replies. It does not need to be open any longer.'
    }
};

Remember, this goes above the import call!

Messages

The script uses the following messages. Use the talkpage to provide missing translations.

Key Message
title Reply and close
placeholder Write your reply here
cancel Cancel
preview Preview
post Post
generic Choose a generic reply
empty Your reply cannot be empty!
statusPreview Generating preview
statusPost Posting reply
statusClose Closing thread
errorClose An error occurred while closing the thread
errorPost An error occurred while posting your reply
errorPreview An error occurred while generating preview

These messages can be compiled to a single object with the language code (use the name if you're not sure):

        en: {
            title: 'Reply and close',
            placeholder: 'Write your reply here',
            cancel: 'Cancel',
            preview: 'Preview',
            post: 'Post',
            generic: 'Choose a generic reply',
            empty: 'Your reply cannot be empty!',
            statusPreview: 'Generating preview',
            statusPost: 'Posting reply',
            statusClose: 'Closing thread',
            errorClose: 'An error occurred while closing the thread',
            errorPost: 'An error occurred while posting your reply',
            errorPreview: 'An error occurred while generating preview'
        }

Updates

May 15, 2016
Initial release.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.