Fuomáš: Maŋŋel go almmuhat, soaitá leat dárbbašlaš sihkkut neahttalohkkii gaskaráju vai oainnat rievdadusaid. 

  • Firefox / Safari: Doala Shift dan botta go deattát Reload, dahje deaddil Ctrl-F5 dahje Ctrl-R (⌘-R Mac'as)
  • Google Chrome: Deaddil Ctrl-Shift-R (⌘-Shift-R Mac'as)
  • Internet Explorer / Edge: Doala Ctrl dan botta go deattát Álggat ođđasit, dahje deaddil Ctrl-F5
  • Opera: deaddil Ctrl-F5.
/* Vahku gilvvohallan script
 * Maintainer: [[user:Gálaniitoluodda]]
 *
 * if (/^Wikipedia:Vahku_gilvvohallan\/Vahku_gilvvohallan/.test(mw.config.get('wgPageName'))) {
 *     mw.loader.load(mw.config.get('wgServer') + mw.config.get('wgScript') + '?title= MediaWiki:Vahku_gilvvohallan.js&action=raw&ctype=text/javascript');
 * }
 */
/*jslint browser: true */
/*global mediaWiki, jQuery */

(function ($, mw) {
    "use strict";

    mw.loader.using(['mediawiki.util', 'jquery.tipsy'], function () {

        // Increase tipsy max-width
        mw.util.addCSS('.tipsy-inner { max-width: 65em; font-size:smaller; }');

        $('.uk-ap').each(function () {

            var me = this,
                timer = null,
                visible = false;

            function leave() {
                timer = setTimeout(function () {
                    $(me).tipsy('hide');
                    visible = false;
                }, 200);
            }

            function enter() {
                if (visible) {
                    clearTimeout(timer);
                } else {
                    $(me).tipsy('show');
                    $('.tipsy').hover(enter, leave);
                    visible = true;
                }
            }

            $(this).tipsy({
                title: function () {
                    return $(me).next('.uk-ap-title').html();
                },
                html: true,
                trigger: 'manual',
                gravity: 'w'
            });

            $(this).hover(enter, leave);

        });

        $('.uk-ap-title').hide();

    });

    mw.loader.using(['jquery.ui', 'jquery.spinner'], function () {

        mw.messages.set('ukens-konkurranse-login', 'Logge sisa vai dieđihit iežat mielde');
        mw.messages.set('ukens-konkurranse-join', 'Dieđit mu mielde');
        mw.messages.set('ukens-konkurranse-joined', 'Don leat dieđihuvvon mielde!');
        mw.messages.set('ukens-konkurranse-closed', 'Dát gilvvohallan lea nohkan.<br />Giitu buohkaide geat oassálaste!');

        var paameldt = false,
            h2 = $('#Oassálastit').parent(),
            sectionId = -1,
            userName = mw.user.getName(),
            api = new mw.Api(),
            endtime = parseInt($('.UK-end-ts').text(), 10),
            now = new Date() / 1000;

        function visPaameldt() {
            h2.after('<div style="float:right; border:3px solid #008800; padding:15px 30px 15px 20px; margin:0 0 0.5em 0.5em; border-radius:10px; font-weight:bold; background: #BFFF00;"><div style="background: url(http://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Dialog-apply.svg/16px-Dialog-apply.svg.png) left no-repeat; padding-left:20px;">' + mw.messages.get('ukens-konkurranse-joined') + '</div></div>');
        }

        if (h2.length === 1) {
            sectionId = h2.prevAll('h2').length + 1;

            if (now > endtime) {
                h2.after('<div style="float:right; border:3px solid #DD5555; padding:15px 30px 15px 20px; margin:0 0 0.5em 0.5em; border-radius:10px; font-weight:bold; background: #F8F8F8;"><div style="background: url(http://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Emblem-diamond.svg/16px-Emblem-diamond.svg.png) left no-repeat; padding-left:20px;">' + mw.messages.get('ukens-konkurranse-closed') + '</div></div>');
                return;
            }

            if (userName === null) {
                h2.after('<div style="float:right; border:3px solid #008800; padding:15px 30px 15px 20px; margin:0 0 0.5em 0.5em; border-radius:10px; font-weight:bold; background: #BFFF00;">' + mw.messages.get('ukens-konkurranse-login') + '</div>');
                return;
            }

            // Er noen påmeldt?
            if (h2.nextUntil('h2', 'ul').length !== 0) {
                h2.nextUntil('h2', 'ul').find('a').each(function () {
                    if ($(this).attr('title').split(':')[1] === userName) {
                        paameldt = true;
                    }
                });
            }

            if (paameldt) {
                visPaameldt();
            } else {
                h2.after('<div id="joindiv" style="float:right;"><span id="uk-status"></span><button id="joinbtn">' + mw.messages.get('ukens-konkurranse-join') + '</button></div>');
                $(function () {
                    $('#joinbtn').button({ icons: { primary: 'ui-icon-plus-thick' } }).addClass('ui-button-orange');
                    $('#joinbtn').click(function () {
                        $('#joinbtn').button('option', 'disabled', true);
                        $('#uk-status').injectSpinner('uk-status-spinner');

                        api.post(
                            {
                                'action': 'edit',
                                'title': mw.config.get('wgPageName'),
                                'section': sectionId,
                                'appendtext': '\n* [[User:' + userName + '|' + userName + ']]',
                                'token': mw.user.tokens.get('csrfToken'),
                                'summary': 'Melder meg på'
                            },
                            {
                                'ok': function () {
                                    var ul = h2.nextUntil('h2', 'ul'),
                                        li = '<li><a href="/wiki/User:' + userName + '" title="User:' + userName + '">' + userName + '</a></li>\n';
                                    $.removeSpinner('uk-status-spinner');
                                    paameldt = true;
                                    $('#joindiv').remove();
                                    if (ul.length === 0) {
                                        h2.nextAll('h2').first().before('\n<ul>\n' + li + '</ul>');
                                    } else {
                                        ul.append(li);
                                    }
                                    visPaameldt();
                                },
                                'err': function (code) {
                                    $.removeSpinner('uk-status-spinner');
                                    $('#uk-status').append('Det oppstod en feil:' + code);
                                }
                            }
                        );

                    });
                });
            }
        }
    });

}(jQuery, mediaWiki));