MediaWiki:Common.js/Warnings.js

(function ($, mwConfig) {   "use strict";    if (mwConfig.skin === 'oasis' && mwConfig.wgAction === 'view' && mwConfig.wgNamespaceNumber > -1) {        mediaWiki.loader.using(['mediawiki.api', 'jquery.cookie'], function  { var cookie = $.cookie('dismissSiteNotice'); new mediaWiki.Api.get({               action: 'parse',                page: 'Template:Sitenotice',                prop: 'text'            }, {                ok: function (json) {                    $('#WikiHeader').append(json.parse.text['*']);                    // Hide sitenotice if cookie's value matches                    if (cookie === ('1.' + $('#sitenotice-id').text)) {                        $('#sitenotice-box').css('display', 'none');                    }                    // Dismiss functionality                    $('#sitenotice-dismiss-link').click(function  { $('#sitenotice-box').css('display', 'none'); $.cookie('dismissSiteNotice', '1.' + $('#sitenotice-id').text, {                           expires: 30,                            path: '/'                        }); });               }            });

});   }

// Spoiler Warning For forms if (mwConfig.wgAction === 'formedit') { $('#mw-content-text').prepend(' Do NOT add new manga information to the wiki until the entire chapter is available. '); }

if (mwConfig.wgNamespaceNumber > 0 && mwConfig.wgNamespaceNumber % 2 === 1 && /^.+\/Archive \d+$/.test(mwConfig.wgTitle)) { $(function ($) {           var $editLink;            if (mwConfig.skin === 'oasis') {                // Remove edit links whilst preserving Rename and Protect                $('li > a#ca-edit').parent.remove;                $editLink = $('a#ca-addsection');                if (mwConfig.wgAction === 'edit') {                    var $n = $('This is an archive, it is NOT a talkpage. Please refrain from editing it without a good reason.');                   $('#EditPageEditor .editpage-notices ul').empty.append($n);                }            } else { // Monobook                $('#ca-addsection').remove;                $editLink = $('#ca-edit a');            }            $editLink.removeAttr('href').prop('title', 'This page is an archive and should not be edited.').text('Archive').css('color', '#999');        }); } }(jQuery, mediaWiki.config.values));