FANDOM


Latest Wikia Community Bullshit

MediaWiki:Common.js

Where is Wikia.js?

I want to use this on my wiki but I don't know where it is.VirusKA (talk) 21:06, November 21, 2013 (UTC)

You would have to navigate to the Wikia.js page on your wiki. For example: http://yourwiki.wikia.com/wiki/MediaWiki:Wikia.js (replace yourwiki with the name of your wiki). Rappy @fandom 21:16, November 21, 2013 (UTC)
Yeah i just figured that out.VirusKA (talk) 22:48, November 21, 2013 (UTC)

Foo me?!?

"phillipabatz.wikia.com/foo_page" please

Scripts Not Working

For some reason on my wiki, The Lord of Ultima Wiki, A bunch of the scripts, etc. I've installed don't want to load or will just stop working all of a sudden. Could someone please take a look at mi code and fix it? Also, I have those problems with my Global.js pages as well.

William (Talk), Bureaucrat of the Lord of Ultima Wiki 04:10, November 22, 2013 (UTC)

The list of imported scripts isn't separated with commas. By adding the missing commas you could also collect the other imports like this:
/* Any JavaScript here will be loaded for all users on every page load. */

var fdButtons = [];
fdButtons[fdButtons.length] = {
        'label': 'Delete'
};
 
// http://dev.wikia.com/wiki/RevealAnonIP
window.RevealAnonIP = {
    permissions : ['sysop', 'bureaucrat']
};

importArticles({
    type: 'script',
    articles: [
        'w:c:dev:AutoEditDropdown/code.js',
        'w:c:dev:FastDelete/code.js',
        'w:c:dev:FloatingToc/code.js',
        'w:c:dev:ListAdmins/code.js',
        'w:c:dev:RevealAnonIP/code.js',
        'w:c:dev:SocialIcons/code.js'
    ]
});
Arkondi (talk) 07:19, November 22, 2013 (UTC)

Notes about namespaces

According to the code, this only works in ns:0,1,500,501,1201,and talk:1201 (whatever that is numerically). So that's main, talk, user blog, talk user blog, Thread and whatever is implied by the :1 in 1201:1. (Is that a coding mistake?)

This is a very limited number of namespaces, and frankly I can easily imagine directly sharing stuff from MediaWiki, our custom namespaces at Tardis, and the Help, Project, File and Category namespaces.

I think it'd be useful to have some sort of mechanism for local admin to specify which namespaces the icons will appear in. — CzechOut 19:30, November 22, 2013 (UTC)

I've increased the number of namespaces the buttons display in, and I'll look into giving admins the option to define extra namespaces. Mark@fandom (talk) 01:49, November 23, 2013 (UTC)
It's now possible to define extra namespaces. See the configuration for more information. Mark@fandom (talk) 02:23, November 23, 2013 (UTC)
I'm not seeing where there's any user defined way to add this to custom namespaces, but this only loads in mainspace, blog and thread, 0, 500 and 1201 respectively. As for the syntax error question, consider the following
var foo = {
        1: 1,
        2: 0,
        3: 1,
        4: 0,
        5: 1
    },
    i,
    x = 1;
 
// loop through numbers 1-5
for ( i = 1; i <= 5; i += 1 ) {
    // this will print 1 0 1 0 1
    console.log( foo[ i ] );
}
 
// check if the property 1 has a value of 1
if ( foo[ x ] === 1 ) {
    // this will print true
    console.log( 'true' );
}
 
// this will print false as the property is not defined
if ( foo[ '6' ] === 1 ) {
    console.log( 'true' );
} else {
    console.log( 'false' );
}
 
// now let's try this idea with a pagename
var page = {
    'foo': 1,
    'bar': 1,
    'baz': 1
};
 
// this will print true if wgPageName (the current page) matches foo, bar or baz
if ( page[ wgPageName ] === 1 ) {
    console.log( 'true' );
}
If you look at the last conditional, it's a quick easy way of checking if we're on the right page and only requires us to call wgPageName once as opposed to 3 times, each time checking if we're on the correct page. With this we can call wgPageName once ultimately making the script a little faster. User:Cqm/Signature
And as I was writing the above, said change has been made... User:Cqm/Signature
I indeed added my response here before I saved the code page, hence why the option wasn't in the actual code yet. It should be now.
Feel free to make the change you've suggested above: if it saves us some extra milliseconds I'm all for it :). Mark@fandom (talk) 02:26, November 23, 2013 (UTC)
Tweaked it slightly by making it possible not to load it on a namespace. Hope you don't mind.--~UltimateSupreme 10:34, November 23, 2013 (UTC)
That's totally fine! Mark@fandom (talk) 16:30, November 23, 2013 (UTC)

Twiter tinyurl-ing

What would make this dramatically more useful to me is if the automatic text that's generated for a tweet were automatically tiny-url-ed. Many of our URLs would cut the 140 character limit in half, so tiny-url-ing is usually required. — CzechOut 19:40, November 22, 2013 (UTC)

That's a great idea! I'll look into the TinyURL API and see what I can do. Mark@fandom (talk) 01:49, November 23, 2013 (UTC)
It seems that both the bit.ly API and the TinyURL api either require user authentication or put a limit on the amount of URL's you can shorten per day (unless you pay, of course). I'll hold off on making this change for now. Mark@fandom (talk) 02:28, November 23, 2013 (UTC)
What about is.gd (documentation, ratelimit info)? It's not so well known, but it works. User:Cqm/Signature
It seems that Twitter automatically shortens URL now, per this blog. A link never takes up more than nineteen characters. I tested it: if you insert a link, then remove some of its characters the character count will not go down. Mark@fandom (talk) 18:18, November 23, 2013 (UTC)

Not Working

This is not working on my wiki. [1]I need help!

Abbeylover <3 (talk) 22:18, November 22, 2013 (UTC)

I've installed the SocialIcons feature on your wiki. Mark@fandom (talk) 01:49, November 23, 2013 (UTC)

New Feature Suggestion

Hey yall. I had an idea for a position of the buttons. How about putting them next to the number of pages indicator rather than under them. Any chance of that happening?

William (Talk), Bureaucrat of the Lord of Ultima Wiki 03:33, November 23, 2013 (UTC)

Rappy's URL is wrong

The reason all subsequent attempts have failed is that Rappy has given the wrong URL. I had the right one on here, but someone saw fit to make it disappear without a trace either here or on the history page. "Wikia.js" only works in Oasis, where as "Common.js" works everywhere. Awesome staff here, huh??? P:D -- ThatOneCH00B 21:30, November 26, 2013 (UTC)

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.