Wiki New Girl
(Página nueva: →‎Skin notification by User:Bola, idea original by User:Ciencia al Poder.: window.WikiNotification = { article: 'Usuario Blog:CJ SanAndreas/Hey, user!', key: 'WNotif', init: fun...)
 
Sin resumen de edición
 
Línea 27: Línea 27:
 
}
 
}
 
};
 
};
  +
  +
$(WikiNotification.init);

Revisión actual - 22:29 16 jun 2012

/* Skin notification by User:Bola, idea original by User:Ciencia al Poder. */
window.WikiNotification = {
	article: 'Usuario Blog:CJ SanAndreas/Hey, user!',
	key: 'WNotif',
	init: function() {
		if (!document.cookie || document.cookie.length == 0) return;
		var pref = $.cookies.get(WikiNotification.key);
		if (pref) return;
		WikiNotification.render();
	},
	render: function() {
		var tb = $('#WikiaFooter').children('div.toolbar');
		if (!tb.exists()) return;
		var nf = $('#WikiaNotifications');
		if (!nf.exists()) {
			tb.prepend('<ul id="WikiaNotifications" class="WikiaNotifications"></ul>');
			nf = $('#WikiaNotifications');
			$(document.body).addClass('notifications');
		}
		var sn = $('<li><div data-type="100"><a class="sprite close-notification"></a>Hola! Bienvenido a New Girl Wiki, donde tenemos información sobre New Girl, dinos tu opinión sobre la Wiki, comparte tu idea en <a href="'+wgServer+wgArticlePath.replace('$1',WikiNotification.article.replace(/\s/g,'_'))+'" title="'+WikiNotification.article+'">Hey, User!</a>.</div></li>');
		nf.append(sn);
		sn.find('a.sprite').eq(0).click(WikiNotification.dismiss);
	},
	dismiss: function(e) {
		$(this).parents('li').eq(0).remove();
		$.cookies.set(WikiNotification.key,'1');
	}
};
 
$(WikiNotification.init);