「MediaWiki:Common.js」の版間の差分
編集の要約なし |
test |
||
| 70行目: | 70行目: | ||
/* beta2 ここまで */ | /* beta2 ここまで */ | ||
/* | /* お知らせよう */ | ||
$(function() { | |||
var $notice = $('#wiki-origin-notice'); | |||
if (!$notice.length) return; | |||
var contentId = $notice.data('content-id'); | |||
var cookieName = 'originnotice-' + contentId; | |||
// Cookieがあるか確認 | |||
if (document.cookie.indexOf(cookieName + '=true') > -1) { | |||
$notice.hide(); | |||
} | |||
$('#close-notice-btn').on('click', function() { | |||
$notice.fadeOut(); | |||
var date = new Date(); | |||
date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000)); | |||
var expires = "; expires=" + date.toUTCString(); | |||
document.cookie = cookieName + "=true" + expires + "; path=/"; | |||
}); | |||
}); | |||
console.log("OK Common.js") | console.log("OK Common.js") | ||