ReferencePopups/configUI.js

// __NOWYSIWYG__ ' + ' ' + ' ' + ' ' +		' ', i18n),		{			buttons: [				{					id: 'refpopups-save',					message: Mustache.render(, i18n),					defaultButton: true,					handler: function {						saveDialog;						$modal.closeModal;					}				},				{					id: 'refpopups-close',					message: Mustache.render(, 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('', 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; };

});

//