「MediaWiki:Common.js」の版間の差分

test
iran
71行目: 71行目:


/* お知らせよう */
/* お知らせよう */
$(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")