Skip to content

Instantly share code, notes, and snippets.

@seaside98
Created March 4, 2014 03:51
Show Gist options
  • Save seaside98/9339978 to your computer and use it in GitHub Desktop.
Save seaside98/9339978 to your computer and use it in GitHub Desktop.
/* Policy Popup */
//Make sure cookies are enabled
if($.cookie('closePolicy') != 'close' && wgUserName) {
$.cookie('closePolicy','enabled',{expires: 365});
if($.cookie('closePolicy') == 'enabled') {
var $optionsWindowHTML = $.showCustomModal( '<div style="font-weight:bold;color:#d25a1b;">Welcome to the LEGO Message Boards Wiki!</div>', 'Our Wiki is a kid-friendly site. <font color="red">No bad language, inappropriate discussions, or personal information is allowed.</font> By editing, chatting, or posting on this Wiki, you agree to follow our <a href="/wiki/Lego_Message_Boards_Wiki:General_Policy" target="_blank" style="font-weight:bold;">Full Policy</a>.', {
id: "optionsWindow",
width: 600,
buttons: [
{
id: "agree",
message: "Ok, I understand.",
handler: function () {
closePolicy();
}
}
]
});
$(".close").click(function() { closePolicy(); });
function closePolicy() {
$.cookie('closePolicy','close');
var dialog = $('#optionsWindow');
dialog.closeModal();
}
}
}
/*Private Message - by Seaside98*/
function hidePrivate() {
var ug = wgUserGroups.join(' ');
if(ug.indexOf('staff') + ug.indexOf('helper') + ug.indexOf('vstf') + ug.indexOf('sysop') <= -4) {
$('.activity-ns-1201 strong a:contains("(Private)")').parents('li').remove();
$('.rc-conntent table a[href*="Thread:"]:contains("(Private)")').parents('table').remove();
$('.message-1').each( function(){
if( $(this).find('.msg-title a:contains("(Private)")').length > 0 ){
if( $(this).find('.edited-by a:first-child').first().text() != wgUserName
&& $(location).attr('href').split(':').pop() != wgUserName
&& $(this).parents('#mw-content-text').find('.BreadCrumbs a').text() != 'My wall' )
{ $(this).remove(); }
}
});
}
}
hidePrivate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment