/*jshint esversion: 6 */
const noticeGrpPage = '틀:소도구/noticeGrp';
const isBot = /bot|googlebot|crawler|spider|robot|crawling/i.test(navigator.userAgent);
const isMobile = /\.m\.wikipedia\.org/.test(window.location.host);
var tmpSiteNotice = "";
var cookieName = 'dismissNewSiteNotice';
var cookieData = {
	noticeData: 'newSiteNoticeData',
	dismissClicked: 'dismissClicked'

function procCache {
	if ((mw.storage.get( cookieData.dismissClicked ) === undefined ||
		mw.storage.get( cookieData.dismissClicked ) === "false") &&
		mw.storage.get( cookieData.noticeData ) !== undefined)
		if ( $("#siteNotice").length > 0 ) {
			tmpSiteNotice = $("#siteNotice").html;
			$("#siteNotice").html(mw.storage.get( cookieData.noticeData ));

if (isBot) {
	$("#siteNotice").html("");
	$(".noprint").html("");
	$(".mw-jump-link").html("");
	/*
	if (!isMobile) {
		procCache;

$(function {
var sitenoticeId = '';
var dismissStr = '';
var sitenoticeStyle = '';

function html2text(html) {
	var tag = document.createElement('div');
	tag.innerHTML = html;

	return tag.innerText;

function getDivHtml {
	var tag = document.createElement('div');
	tag.innerHTML = html;

	return $(tag).find(target).html;

function getDivText {
	var tag = document.createElement('div');
	tag.innerHTML = html;

	return $(tag).find(target).text.trim;

function procDismiss {
	$("#siteNoticeLocal").prepend('' +
		'');
	if (isMobile) {
		$("#siteNoticeLocal").css(
			 'position': 'relative',
			 'padding-left': $("#siteNoticeLocal").css('padding-left') === '0px' ? '12px' : $("#siteNoticeLocal").css('padding-left'),
			 'padding-top': $("#siteNoticeLocal").css('padding-top') === '0px' ? '12px' : $("#siteNoticeLocal").css('padding-top'),
			 'padding-right': $("#siteNoticeLocal").css('padding-right') === '0px' ? '12px' : $("#siteNoticeLocal").css('padding-right'),
			 'padding-bottom': $("#siteNoticeLocal").css('padding-bottom') === '0px' ? '15px' : $("#siteNoticeLocal").css('padding-bottom'),
		);
		$(".mw-dismissable-notice-close2").css;
		$("#siteNoticeLocal").css;
		$(".mw-dismissable-notice-close2").css;
	$("#siteNoticeLocal ul").css({
		"list-style": "none",
		"text-align": "left",
		"display": "table",
		"margin": "0 auto",
		"padding-left": "10px",
		"max-width": "calc(100% - 20px)"

	$( '.mw-dismissable-notice-close2' )
		.css
		.find( 'a' )
		.on( 'click keypress', function ( e ) {
			if (
				e.type === 'click' ||
				e.type === 'keypress' && e.which === 13
			) {
				$("#siteNoticeLocal").hide;
				mw.loader.using('mediawiki.cookie').then(function {
					mw.cookie.set( cookieName, sitenoticeId, {
						path: '/'
				mw.storage.set;

	mw.storage.set( cookieData.noticeData, $("#siteNotice").html );

function procApi {
	if (isBot) {
		return;
	var api = new mw.Api;
	api.parse(
	 new mw.Title( noticeGrpPage )
	).then( function( html ) {
		var gadgetSiteNotice = "";
		var gadgetAnonnotice = "";
		html = html.replace;
		gadgetSiteNotice = getDivHtml;
		gadgetAnonnotice = getDivHtml;
		sitenoticeId = getDivText;
		dismissStr = getDivText;
		sitenoticeStyle = getDivText;
	
		if (/\S/.test(tmpSiteNotice)) {
			$("#siteNotice").html(tmpSiteNotice);

		if (mw.config.get('wgUserName') !== null) {
			if(/\S/.test(html2text(gadgetSiteNotice).trim)) {
				// If the user has the notice dismissal cookie set, exit.
				mw.loader.using('mediawiki.cookie').then(function {
					if ( mw.cookie.get( cookieName ) !== sitenoticeId ) {
						mw.storage.set;
						$("#siteNotice").append('');
						procDismiss;
				mw.storage.set;
			return;

		mw.storage.set;
		if (html2text(gadgetAnonnotice).trim.length === 0) {
			return;
			if(/\S/.test(html2text(gadgetSiteNotice).trim)) {
				// If the user has the notice dismissal cookie set, exit.
				mw.loader.using('mediawiki.cookie').then(function {
					if ( mw.cookie.get( cookieName ) !== sitenoticeId ) {
						mw.storage.set;
						$("#siteNotice").append('');
						procDismiss;
						return;
						return;
			mw.storage.set;
			$("#siteNotice").append('');
			procDismiss;
			return;

procApi;