FANDOM


Discussions Feed adds a Special:RecentChanges-like flat view of recent posts on wiki's with discussions enabled. It creates a special page that can be accessed at Special:DiscussionsFeed. Entries provide links to their corresponding posts in the discussions-module, as well as links to the user profiles and quick blocks if the viewer has blocking rights. The list is updated every two minutes.

Installation

This script can be added to one's own global.js to have it enabled on any wiki. Or it can be installed per wiki, so all users can access it for that specific wiki.


See also: Help:Including additional CSS and JS, Help:Advanced CSS and JS
  • For site-wide use, an administrator can add the line below to the wiki's MediaWiki:ImportJS page. Note that JavaScript must be enabled on the wiki.
dev:DiscussionsFeed.js
  • For personal use, add the code snippet below to your global.js page (for use on all wikis) or your common.js page on your wiki (for use on a single wiki). Note that personal JS must be enabled for your account.
importArticles({
    type: 'script',
    articles: [
        'u:dev:DiscussionsFeed.js',
    ]
});
importArticles — Best Practices for installing JavaScript on Fandom
The importArticles statement is designed to combine multiple HTTP requests into a single data transfer, allowing multiple scripts to load and execute faster. If you've been installing several different scripts, your JavaScript file has probably accumulated unnecessary import statements. Click "Expand" to learn how to efficiently batch import scripts to speed up performance and make your code look cleaner. One other approach is by using the MediaWiki:ImportJS.
If your JavaScript file has several lines of code that say importScript, importScriptPage, or importArticles, you may be able to combine them! By batch importing a collection of scripts with a single import, your JavaScript code will load faster and look cleaner. Consider the example below. On the left is an example of what your JavaScript file might currently look like. On the right is how you could improve that code.
Multiple imports — messy and slow One import — clean and efficient
importScriptPage('AjaxRC/code.js','dev');
 
importScript('MediaWiki:localScript.js');
 
importArticle({
  type: 'script',
  article: 'u:dev:FloatingToc/code.js'
});
 
importScriptPage('page1.js', 'wikiname');
 
importScriptPage('page2.js', 'wikiname');
importArticles({
    type: 'script',
    articles: [
        'u:dev:AjaxRC/code.js',
        'MediaWiki:localScript.js',
        'u:dev:FloatingToc/code.js',
        'u:wikiname:page1.js',
        'u:wikiname:page2.js'
    ]
});
Note: In this example, pay close attention to the placement of commas and other punctuation. For people who aren't familiar with programming (and even those who are!), a common mistake when writing code is to accidentally delete, forget, or misplace critical symbols like commas or quotation marks. This can cause a syntax error that breaks the code. Carefully follow the convention shown here when using importArticles.
But there's much more to importArticles than just this! For more examples and advanced usage, see the help page at Help:Including additional JavaScript and CSS.

Theme (optional)

Installing the theme is optional, by default the special page will use the theme as defined on the host wiki. Adding a theme will make the special page a bit easier to read.

It is not recommended to apply one of themes to your global CSS as you will encounter wikis with both light and dark skins. To install this theme on your wiki just add the following @import line to your wiki's MediaWiki:Common.css (Note that all imports go at the very top of the page). The themes will only enhance the theme of the host wiki, it will not override it. This means that installing the light theme on a dark wiki or vice versa will result in a page that is very hard to read.

Light theme: (example)

@import url('/load.php?mode=articles&articles=u:dev:MediaWiki:DiscussionsFeed/style-light.css&only=styles');

Dark theme: (example)

@import url('/load.php?mode=articles&articles=u:dev:MediaWiki:DiscussionsFeed/style-dark.css&only=styles');

Styling

Each entry has its own paragraph you can style. Text elements inside this paragraph all have their own classes for styling:

  • df-entry A line in the feed.
  • df-date The time-stamp of the post.
  • df-content The plain text content of the post.
  • df-user The user that posted the message.
  • df-category The category the post is in.
  • df-block A link to the Special:Block (only visible to viewers with blocking-rights).


CSS example for a wiki with dark theme:

/* Theme for Special:DiscussionsFeed */
.df-content {
    font-weight: bold;
    color: LightGrey;
}
 
.df-user {
    color: LightSkyBlue;
}
 
.df-date {
    color: LightGrey;
}
 
.df-entry:hover {
    background-color: rgba(255,255,255,0.1);
}
 
.df-category {
    font-style: italic;
}
 
.df-block {
    color: firebrick;
}
 
.df-content:link, df-content:visited, .df-user:link, df-link:visited, .df-block:link, df-block:visited {
    text-decoration: none;
}

Changelog

Date Notes Updated by
October 10th, 2016 Created Flightmare
October 13th, 2016 Improved error throwing Flightmare
November 28th, 2016 Added auto refreshing Flightmare

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.