User:Paradox the Phoenix/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PatrolPanel.js',        'u:dev:MediaWiki:ThemeToggler.js',        'u:dev:MediaWiki:ClickyNavigation.js',        /*'u:dev:MediaWiki:SnowStorm.js',*/        'u:dev:MediaWiki:WHAM/code.2.js',        'u:dev:MediaWiki:PurgeButton.js',    ] });

(function unvotePoll(window, $, mw) {   if (window.onvotePollLoaded) return;    window.unvotePollLoaded = true;

mw.loader.using(['mediawiki.util', 'mediawiki.Uri']).then(function {       var url = mw.util.wikiScript('wikia'),            threadId = mw.util.getParamValue('unvotePoll');

if (typeof threadId !== 'string' || /\D/.test(threadId)) return;

$.getJSON(url, {           controller: 'DiscussionThread',            method: 'getThread',            threadId: threadId        }).error(function(err) {            console.error('(unvotePoll) Error loading thread information', err);        }).then(function(data) {            var pollId = data.poll && data.poll.id;

if (!pollId) { console.error('(unvotePoll) Failed to retrive poll data or thread is not a poll', data.poll); return; }

$.post(url, {               controller: 'DiscussionPoll',                method: 'castVote',                pollId: pollId,                answerIds: ''            }).error(function {                console.error('(unvotePoll) Error unvoting', err);            }); })   }) })(this, jQuery, mediaWiki);