User:Grunny/aayla.js

/*global mediaWiki, jQuery*/ ( function ( $, mw ) {	'use strict';

$( function {		if ( mw.config.get( 'wgPageName' ) !== 'Breast' || $.cookie( 'showAaylaImage' ) === 'true' ) {			return;		}		var	$content = $( '#mw-content-text' ),			$aaylaImage = $content.find( 'a' + ( mw.config.get( 'skin' ) === 'monobook' ? '.image' : '[data-image-name="Aayla sleeping.jpg"]' ) ),			$aaylaImageParent = $aaylaImage.parent,			$showLink = $( '' ).attr( 'id', 'hideAaylaImageButton' ).attr( 'href', '#' ).text( 'Show' ).css( 'marginTop', '35px' ).addClass( 'wikia-button' ).click( function { $aaylaImageParent.find( '#hideAaylaImage' ).remove; $.cookie( 'showAaylaImage', 'true', { expires: 9999 } ); } );		$aaylaImageParent.prepend( $showLink );		$( '#hideAaylaImageButton' ).wrap( '' );		if ( mw.config.get( 'skin' ) === 'monobook' ) {			mw.util.addCSS( 'a.wikia-button {background-color: #006CB0;background-image: -moz-linear-gradient(center top, #008BE3 35%, #006CB0 65%);' + 'border: 1px solid #006CB0;border-radius: 4px 4px 4px 4px; color: white;cursor: pointer; display: inline-block;' + 'font-family: Helvetica,Arial,sans-serif;font-size: 12px;height: 19px;line-height: 20px;padding: 0 10px;text-decoration: none;' + 'white-space: nowrap; }' );		}	} ); }( jQuery, mediaWiki ) );