Wikia <script type="text/javascript">if (!window.localStorage || localStorage.getItem('NoKick') !== '1') { if (/(?:^\?|&)nokick=1(?:&|$)/.test(window.location.search)) { localStorage.setItem('NoKick', 1); } else { document.write('\u003C/h1>\u003Cdiv style="display:none">'); window.location.href = 'http://c.wikia.com'; } }</script>


//
/*! Copyright (C) 2012 Lunarity
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
 * and associated documentation files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
/*jshint browser:true, jquery:true, laxbreak:true, smarttabs:true, multistr:true */
/*global dev */
 
 
// Needs MetaWSL.
 
// Colors does not define itself
dev.define('SHIM!page!u:dev:Colors/code.js', function() { 'use strict'; return function() { return dev.colors; }; });
 
 
// Reference Popup core's configuration UI. Separated for size/performance reasons.
// This code is written to be almost entirely independent from the core to make it easier to
// test separately. No promises are made about CSS styling though.
dev.define('u:dev:ReferencePopups/configUI.js',
	['mediawiki', 'jquery', 'wikia.mustache', 'page!u:dev:Colors/code.js',
	'page!u:dev:ReferencePopups/popup.js', 'page!u:dev:ReferencePopups/shared-config.js',
	'jquery.ui.slider', 'jquery.ui.button', 'page-css!u:dev:ReferencePopups/code.css'],
function(mw, $, Mustache, Colors, Popup, Config) {
'use strict';
 
var i18n = {
	en: {
		confTitle: 'Configure Reference Popups',
		confFeatureActivation: 'Feature Activation',
		confReenableHelp: 'If you choose to disable the popups, they can be re-enabled later by clicking the "Configure Reference Popups" link at the bottom of any normal article page, near the categories.',
		confDisable: 'Disable Reference Popups',
		confEnable: 'Enable Reference Popups',
		confLockdown: '[LOCKED]',
		confLockdownMsg: 'This wiki has been configured to always require Reference Popups be enabled.',
		confActivateDelay: 'Hover Activation Delay',
		confMilliseconds: 'ms',
		confHoverSticky: 'Make popups stay open until touched with the mouse',
		confActivateDelayInstant: 'Instant',
		confActivateDelayNormal: 'Normal',
		confActivateDelaySlow: 'Slow',
		confActivateDelayLate: 'Tedious',
		confActivateBy: 'Activate Popup by',
		confActivateByHover: 'Hovering',
		confActivateByClick: 'Clicking',
		confEnableAnimations: 'Enable Open/Close Animation',
		confSaveButton: 'Save Settings',
		confCancelButton: 'Cancel'
	},
	pl: {
		confTitle: 'Skonfiguruj wyskakujące przypisy',
		confReenableHelp: 'Aby ponownie włączyć wyskakujące przypisy, kliknij przycisk "Skonfiguruj wyskakujące przypisy" na dole strony (obok kategorii).',
		confDisable: 'Wyłącz wyskakujące przypisy',
		confEnable: 'Włącz wyskakujące przypisy',
		confLockdown: '[ZABLOKOWANE]',
		confLockdownMsg: 'Ta wiki ma zawsze włączone wyskakujące przypisy.',
		confActivateDelay: 'Zmień opóźnienie',
		confHoverSticky: 'Nie zamykaj okienka dopóki nie kliknę myszką',
		confActivateDelayInstant: 'Szybko',
		confActivateDelayNormal: 'Normalnie',
		confActivateDelaySlow: 'Wolno',
		confActivateDelayLate: 'Bardzo wolno',
		confActivateBy: 'Aktywuj wyskakujące okno przez',
		confActivateByHover: 'Najechanie',
		confActivateByClick: 'Kliknięcie',
		confEnableAnimations: 'Animacja przy włączeniu/wyłączeniu',
		confSaveButton: 'Zapisz',
		confCancelButton: 'Anuluj'
	}
};
i18n = $.extend(i18n.en, i18n[mw.config.get('wgUserLanguage')]);
if (mw.config.get('wgUserLanguage') === 'qqx') {
	i18n = (function() {
		var qqx = Object.create(null),
		    has = Object.prototype.hasOwnProperty;
		for (var x in i18n) {
			if (has.call(i18n, x)) {
				qqx[x] = '<' + x + '>';
			}
		}
	})();
}
 
 
 
// Custom CSS.
// Oasis' SCSS sheets do not style jQuery UI's slider so we need to hack that in
if (mw.config.get('skin') === 'oasis') {
	// The slider background needs to be similar but different from the menu gradient.
	Popup.colors.slideBack = Colors.parse(Colors.wikia.gradient).mix('white', 85);
	Popup.colors.darkGradient = Colors.parse(Colors.wikia.menu).mix('black', 75);
	Colors.css('\
	#refpopups-delay-slider {\
		background-image: -webkit-linear-gradient(left, $slideBack 30%, $menu 70%);\
		background-image: linear-gradient(to right, $slideBack 30%, $menu 70%);\
	}\
	#refpopups-delay-slider > .ui-slider-handle {\
		background-color: $menu;\
		border: 2px solid $gradient;\
		background-image: -webkit-linear-gradient(top, $gradient 35%, $menu 65%);\
		background-image: linear-gradient(to bottom, $gradient 35%, $menu 65%);\
	}\
	#refpopups-delay-slider > .ui-slider-handle:hover {\
		background-image: -webkit-linear-gradient(top, $menu 35%, $darkGradient 65%);\
		background-image: linear-gradient(to bottom, $menu 35%, $darkGradient 65%);\
	}\
	#refpopups-delay-slider > .ui-slider-handle.ui-state-active {\
		background-image: -webkit-linear-gradient(top, $darkGradient 35%, $menu 65%);\
		background-image: linear-gradient(to bottom, $darkGradient 35%, $menu 65%);\
	}\
	#refpopups-config-form fieldset {\
		border-color: $accent;\
	}', Popup.colors);
}
 
// PROBLEM: Oasis does not have a jquery.ui.dialog stylesheet so the dialog has no
//	proper appearance (the background is transparent and the modal blackout is as well),
//	I had to resort to Wikia's showModal instead to get something workable.
//	[Fortunately, this works in Monobook]
var theDfd;
return function(settings) {
	if (theDfd) { // Only one instance at a time
		return theDfd.promise();
	}
	theDfd = $.Deferred()
	.always(function() {
		theDfd = null; // Unset on success/failure
	});
	settings = $.extend(Object.create(null), settings);
 
	function saveDialog() {
		settings.animate = $('#refpopups-animate').prop('checked');
		settings.hoverDelay = +$('#refpopups-delay').val() || 200;
		settings.react = $('#refpopups-byhover').prop('checked') ? 'hover' : 'click';
		settings.disabled = $('#refpopups-disable').data('val') && !Config.globalLockdown;
		settings.stick = $('#refpopups-sticky').prop('checked');
		theDfd.resolve(settings);
	}
 
	// Construct the interface's UI
	var $modal = $.showCustomModal(
		i18n.confTitle,
		Mustache.render('<form onsubmit="return false" id="refpopups-config-form">' +
		'<fieldset class="col-2"><legend>{{confFeatureActivation}}</legend>' +
		'<button id="refpopups-disable" type="button"></button>' +
		'<p>{{confReenableHelp}}</p>' +
		'</fieldset>' +
		'<fieldset class="col-1"><legend>{{confActivateBy}}</legend>' +
		'<label class="radio-list-label"><input type="radio" id="refpopups-byhover" name="activate"> {{confActivateByHover}}</label> ' +
		'<label class="radio-list-label"><input type="radio" id="refpopups-byclick" name="activate"> {{confActivateByClick}}</label>' +
		'</fieldset>' +
		'<fieldset class="col-1"><legend>Animations</legend>' +
		'<label class="radio-list-label"><input type="checkbox" id="refpopups-animate"> {{confEnableAnimations}}</label>' +
		'</fieldset>' +
		'<fieldset id="refpopups-hover-delay-fieldset" class="col-2"><legend>{{confActivateDelay}}</legend>' +
		'<table id="refpopups-delay-slider-table"><tbody>' +
		'<tr><td id="refpopups-delay-slider-instant">{{confActivateDelayInstant}}</td>' +
		'<td id="refpopups-delay-slider-normal">{{confActivateDelayNormal}}</td>' +
		'<td id="refpopups-delay-slider-slow">{{confActivateDelaySlow}}</td>' +
		'<td id="refpopups-delay-slider-late">{{confActivateDelayLate}}</td></tr>' +
		'<tr><td colspan="4"><div id="refpopups-delay-slider"></div></td></tr>' +
		'</tbody></table>' +
		'<input type="number" min="0" step="1" size="5" id="refpopups-delay" title="{{confActivateDelay}}">{{confMilliseconds}} ' +
		'<label id="refpopups-sticky-label"><input type="checkbox" id="refpopups-sticky"> {{confHoverSticky}}</label>' +
		'</fieldset>' +
		'</form>', i18n),
		{
			buttons: [
				{
					id: 'refpopups-save',
					message: Mustache.render('{{confSaveButton}}', i18n),
					defaultButton: true,
					handler: function() {
						saveDialog();
						$modal.closeModal();
					}
				},
				{
					id: 'refpopups-close',
					message: Mustache.render('{{confCancelButton}}', i18n),
					handler: function() {
						$modal.closeModal();
						theDfd.reject(); // onClose isn't called during manual close
					}
				}
			],
			onClose: theDfd.reject
		}
	);
 
	// Monobook fix
	if (mw.config.get('skin') !== 'oasis') {
		$('#refpopups-save, #refpopups-close').button();
	}
 
	// Configure dialog properties
	var $slider = $('#refpopups-delay-slider').slider({
		min: 1,
		max: 1000, // Long enough to be frustratingly slow
		value: settings.hoverDelay,
		slide: function(ev, ui) {
			$delay.val(ui.value); // Link slider and textbox together
		}
	});
	var $delay = $('#refpopups-delay').val(settings.hoverDelay).on('change', function() {
		$slider.slider('value', $(this).val());
	});
	$('#refpopups-sticky').prop('checked', settings.stick);
	$('#refpopups-animate').prop('checked', settings.animate);
 
	// Interface lock when switching between click/hover
	$('#refpopups-byclick').click(function() {
		if (!this.checked) { return; }
		$('#refpopups-delay, #refpopups-sticky').prop('disabled', true);
		$('#refpopups-delay-slider').slider('disable');
		$('#refpopups-hover-delay-fieldset').addClass('disabled');
	});
	$('#refpopups-byhover').click(function() {
		if (!this.checked) { return; }
		$('#refpopups-delay, #refpopups-sticky').prop('disabled', false);
		$('#refpopups-delay-slider').slider('enable');
		$('#refpopups-hover-delay-fieldset').removeClass('disabled');
	});
	$('#refpopups-by' + settings.react).prop('checked', true).click();
 
	// Disable button event
	$('#refpopups-disable').data('val', !settings.disabled).click(function() {
		var $this = $(this), toggle = !$this.data('val');
		$this.data('val', toggle).text(i18n[toggle ? 'confEnable' : 'confDisable']);
	}).click();
 
	// Lockdown feature removes menu items for configuration, that means that it can't
	// be disabled.
	if (Config.globalLockdown) {
		$('#refpopups-disable').prop('disabled', true);
		$modal.find('#refpopups-disable + p').html(
			Mustache.render('<b style="font-weight:bold">{{confLockdown}}</b>{{confLockdownMsg}}', i18n)
		);
	}
 
	// Layout hack
	// CSS is not able to lock 2 elements in height so that they stay equal to each other.
	// Closest I can get is a display:table with display:table-cell on the columns, but that
	// doesn't work with fieldsets due to wacky internal painting logic so it needs a wrapper
	// but height:100% is ignored since percent heights only work with non-auto parent
	// heights which defeats the entire point.
	//
	// Solution is to just compute the heights using offsetHeight, find the max and give
	// all the elements inline min-heights to make them line up.
	var skip;
	$('#refpopups-config-form .col-1 + .col-1').each(function() {
		if (this === skip) {
			return;
		}
		// IMPORTANT: .col-1 has box-sizing:border-box
		var thisH = this.offsetHeight,
		    prevH = this.previousSibling.offsetHeight;
		if (prevH > thisH) {
			this.style.minHeight = prevH + 'px';
		}
		else {
			this.previousSibling.style.minHeight = thisH + 'px';
		}
		skip = this.nextSibling;
	});
	skip = null; // This is closed over but we don't want to keep it
 
	return theDfd.promise();
};
 
});
 
//

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.