MediaWiki:Chat.js/pin.js

/* "!pin" command for chat */ /*	in order to operate, add in a new ling the following string: !pin

// interface source page var pinTrackSourcePage = "Template:Mainpage-pin";

// interface loop gap var pinTrackLoopGap = 2750;

// interface trigger var pinTrackTrigger = "randomText";

// interface is experimental var pinTrackBeta = false;

// interface markup pinTrackPopup = '\ <div style="width: 370px; min-height: 110px; margin: auto; padding: 3px 3px; background: #f6f6f6; background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); background: linear-gradient(to bottom, #ffffff 0%,#f6f6f6 47%,#ededed 100%); border: 1px solid #cccccc; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px;\">\ \ Pin Location\ <span style=\"display: inline-block; width: 12px; height: 12px; position: absolute; top: 2px; right: 2px; background-color: #eeeeee; background-image: url(\'http://images.wikia.com/clubpenguin/images/thumb/archive/8/87/20130201113045%21Bait_Item.svg/10px-Bait_Item.svg.png\') !important; background-position: center; background-repeat: no-repeat; border: 1px solid #bbbbbb; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; cursor: hand; cursor: pointer;\" onclick=\"pinTrackClose;\"> \ \		 \ \ For a detailed list of Pins, see List of Pins \			' + (pinTrackBeta == true ? 'Note! this feature is still on experimental stages. Please contact one of the wiki\'s admins to report issues. ' : '') + '\ \	 \ ';

// close interface function pinTrackClose { $("section#pintrack").hide; $(".blackout").remove; }

// open interface and purge function pinTrack { if ($("section#pintrack").length == 0) { $.getJSON("/api.php?action=parse&format=json&page=" + pinTrackSourcePage + "&cb=" + new Date.getTime, function(data) {			pinTrackContent = data.parse.text["*"];			$("body").append(pinTrackPopup + '\n ');			$("section#pintrack > div > div").html(pinTrackContent);			$("section#pintrack > div > div .floatright").each(function { $(this).replaceWith($(this).find("img").addClass("floatright")); });			$("section#pintrack").show;		}); } else { $("body").append(' '); $("section#pintrack > div > div").html(pinTrackContent); $(".floatright").each(function {			$(this).replaceWith($(this).find("img").addClass("floatright"));		}); $("section#pintrack").show; } }

// add css mw.util.addCSS('section#pintrack > div > div .floatright {\	float: right;\ }\ section#pintrack > div > div ul {\	margin: 2px 3px;\	padding: 1px 1px 1px 12px;\ }\ section#pintrack > div > div ul li {\	list-style-type: disc;\ }\ section#pintrack > div > div img:not(.noresize) {\	zoom: 0.8;\ }');

// loop setInterval(function {	$($("section#WikiaPage > .Chat")[0]).find(".you > .message:not(.pin-checked)").each(function { if ($(this).html == pinTrackTrigger) { $(this).addClass("pin-checked"); pinTrack; } else { $(this).addClass("pin-checked"); }	}); },pinTrackLoopGap);