<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://eurovision.jobogamer.xyz/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-PrintOptions.js</id>
	<title>MediaWiki:Gadget-PrintOptions.js - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://eurovision.jobogamer.xyz/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-PrintOptions.js"/>
	<link rel="alternate" type="text/html" href="https://eurovision.jobogamer.xyz/index.php?title=MediaWiki:Gadget-PrintOptions.js&amp;action=history"/>
	<updated>2026-05-22T01:31:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://eurovision.jobogamer.xyz/index.php?title=MediaWiki:Gadget-PrintOptions.js&amp;diff=27&amp;oldid=prev</id>
		<title>Alfie: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://eurovision.jobogamer.xyz/index.php?title=MediaWiki:Gadget-PrintOptions.js&amp;diff=27&amp;oldid=prev"/>
		<updated>2026-03-19T09:58:24Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:58, 19 March 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Alfie</name></author>
	</entry>
	<entry>
		<id>https://eurovision.jobogamer.xyz/index.php?title=MediaWiki:Gadget-PrintOptions.js&amp;diff=26&amp;oldid=prev</id>
		<title>en&gt;Xaosflux: change to .mw-heading:has(#References), req on talk</title>
		<link rel="alternate" type="text/html" href="https://eurovision.jobogamer.xyz/index.php?title=MediaWiki:Gadget-PrintOptions.js&amp;diff=26&amp;oldid=prev"/>
		<updated>2024-06-11T21:58:46Z</updated>

		<summary type="html">&lt;p&gt;change to .mw-heading:has(#References), req on talk&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/**&lt;br /&gt;
 * Print options is a Gadget writen by Derk-Jan Hartman / User:TheDJ&lt;br /&gt;
 * For more information see [[User:TheDJ/Print_options]]&lt;br /&gt;
 *&lt;br /&gt;
 * Licensed MIT and/or CC-by-SA 4.0&lt;br /&gt;
 *&lt;br /&gt;
 * Copyright (c) 2010-2017 Derk-Jan Hartman / User:TheDJ&lt;br /&gt;
 *&lt;br /&gt;
 * Permission is hereby granted, free of charge, to any person obtaining a copy&lt;br /&gt;
 * of this software and associated documentation files (the &amp;quot;Software&amp;quot;), to deal&lt;br /&gt;
 * in the Software without restriction, including without limitation the rights&lt;br /&gt;
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell&lt;br /&gt;
 * copies of the Software, and to permit persons to whom the Software is&lt;br /&gt;
 * furnished to do so, subject to the following conditions:&lt;br /&gt;
 *&lt;br /&gt;
 * The above copyright notice and this permission notice shall be included in all&lt;br /&gt;
 * copies or substantial portions of the Software.&lt;br /&gt;
 *&lt;br /&gt;
 * THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&lt;br /&gt;
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&lt;br /&gt;
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&lt;br /&gt;
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&lt;br /&gt;
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&lt;br /&gt;
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE&lt;br /&gt;
 * SOFTWARE.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
( function () {&lt;br /&gt;
	&amp;#039;use strict&amp;#039;;&lt;br /&gt;
	var windowManager;&lt;br /&gt;
	var printDialog;&lt;br /&gt;
&lt;br /&gt;
	var printOptions = {&lt;br /&gt;
		install: function () {&lt;br /&gt;
			var $printLink = $( &amp;#039;#t-print a&amp;#039; );&lt;br /&gt;
			if ( $printLink.length === 0 ) {&lt;br /&gt;
				return;&lt;br /&gt;
			}&lt;br /&gt;
			$printLink&lt;br /&gt;
				.text( &amp;#039;Print page&amp;#039; )&lt;br /&gt;
				.off( &amp;#039;click&amp;#039; )&lt;br /&gt;
				.get( 0 ).addEventListener( &amp;#039;click&amp;#039;, function ( e ) {&lt;br /&gt;
					mw.loader.using( [ &amp;#039;oojs-ui-core&amp;#039;, &amp;#039;oojs-ui-widgets&amp;#039;, &amp;#039;oojs-ui-windows&amp;#039; ] ).done( printOptions.createWindow );&lt;br /&gt;
					e.stopPropagation();&lt;br /&gt;
					e.preventDefault();&lt;br /&gt;
				}, true ); // Use capturing phase, to beat the other click handler&lt;br /&gt;
&lt;br /&gt;
			// Late pre-loading&lt;br /&gt;
			mw.loader.load( [ &amp;#039;oojs-ui-core&amp;#039;, &amp;#039;oojs-ui-widgets&amp;#039;, &amp;#039;oojs-ui-windows&amp;#039; ] );&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		createWindow: function () {&lt;br /&gt;
			function PrintDialog( config ) {&lt;br /&gt;
				PrintDialog.super.call( this, config );&lt;br /&gt;
			}&lt;br /&gt;
			OO.inheritClass( PrintDialog, OO.ui.ProcessDialog );&lt;br /&gt;
&lt;br /&gt;
			PrintDialog.static.name = &amp;#039;printdialog&amp;#039;;&lt;br /&gt;
			PrintDialog.static.title = &amp;#039;Print this page&amp;#039;;&lt;br /&gt;
			PrintDialog.static.actions = [&lt;br /&gt;
				{ action: &amp;#039;print&amp;#039;, label: &amp;#039;Print&amp;#039;, flags: &amp;#039;primary&amp;#039; },&lt;br /&gt;
				{ label: &amp;#039;Cancel&amp;#039;, flags: &amp;#039;safe&amp;#039; }&lt;br /&gt;
			];&lt;br /&gt;
&lt;br /&gt;
			PrintDialog.prototype.initialize = function () {&lt;br /&gt;
				var checkbox, fieldset = [];&lt;br /&gt;
				PrintDialog.super.prototype.initialize.apply( this, arguments );&lt;br /&gt;
				this.panel = new OO.ui.PanelLayout( { padded: true, expanded: false } );&lt;br /&gt;
				this.content = new OO.ui.FieldsetLayout();&lt;br /&gt;
&lt;br /&gt;
				for ( var i = 0; i &amp;lt; printOptions.questions.length; i++ ) {&lt;br /&gt;
					if ( printOptions.questions[ i ].type === &amp;#039;checkbox&amp;#039; ) {&lt;br /&gt;
						checkbox = new OO.ui.CheckboxInputWidget( {&lt;br /&gt;
							selected: printOptions.questions[ i ].checked&lt;br /&gt;
						} );&lt;br /&gt;
						printOptions.questions[ i ].widget = checkbox;&lt;br /&gt;
						fieldset.push( new OO.ui.FieldLayout( checkbox, { label: printOptions.questions[ i ].label, align: &amp;#039;inline&amp;#039; } ) );&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				this.content.addItems( fieldset );&lt;br /&gt;
&lt;br /&gt;
				this.panel.$element.append( this.content.$element );&lt;br /&gt;
				this.$body.append( this.panel.$element );&lt;br /&gt;
			};&lt;br /&gt;
&lt;br /&gt;
			PrintDialog.prototype.getActionProcess = function ( action ) {&lt;br /&gt;
				var dialog = this;&lt;br /&gt;
				if ( action === &amp;#039;print&amp;#039; ) {&lt;br /&gt;
					return new OO.ui.Process( function () {&lt;br /&gt;
						// Get values of checkboxes&lt;br /&gt;
						var question;&lt;br /&gt;
						for ( var i = 0; i &amp;lt; printOptions.questions.length; i++ ) {&lt;br /&gt;
							question = printOptions.questions[ i ];&lt;br /&gt;
							if ( question.type === &amp;#039;checkbox&amp;#039; &amp;amp;&amp;amp; question.widget ) {&lt;br /&gt;
								printOptions[ question.returnvalue ] = question.widget.isSelected();&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
						dialog.close( { action: action } ).done( function () {&lt;br /&gt;
							printOptions.changePrintCSS();&lt;br /&gt;
							printOptions.otherEnhancements();&lt;br /&gt;
							window.print();&lt;br /&gt;
							window.location = window.location;&lt;br /&gt;
						} );&lt;br /&gt;
					} );&lt;br /&gt;
				}&lt;br /&gt;
				return PrintDialog.super.prototype.getActionProcess.call( this, action );&lt;br /&gt;
			};&lt;br /&gt;
&lt;br /&gt;
			if ( !windowManager ) {&lt;br /&gt;
				windowManager = new OO.ui.WindowManager();&lt;br /&gt;
				$( &amp;#039;body&amp;#039; ).append( windowManager.$element );&lt;br /&gt;
			}&lt;br /&gt;
			if ( !printDialog ) {&lt;br /&gt;
				printDialog = new PrintDialog( {&lt;br /&gt;
					size: &amp;#039;medium&amp;#039;&lt;br /&gt;
				} );&lt;br /&gt;
&lt;br /&gt;
				windowManager.addWindows( [ printDialog ] );&lt;br /&gt;
			}&lt;br /&gt;
			windowManager.openWindow( printDialog );&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		changePrintCSS: function () {&lt;br /&gt;
			/* Here we:&lt;br /&gt;
				 - disable stylesheets that are print specific&lt;br /&gt;
				 - make screen specific stylesheets also enabled for print medium&lt;br /&gt;
				 - remove print specific stylerules&lt;br /&gt;
				 - make screen specific stylerules also enabled for print medium&lt;br /&gt;
			*/&lt;br /&gt;
			var printStyle = &amp;#039;&amp;#039;;&lt;br /&gt;
			if ( this.enhanced === false ) {&lt;br /&gt;
				var i, j, k,&lt;br /&gt;
					rule,&lt;br /&gt;
					hasPrint,&lt;br /&gt;
					hasScreen,&lt;br /&gt;
					rules,&lt;br /&gt;
					stylesheet,&lt;br /&gt;
					stylesheets = document.styleSheets;&lt;br /&gt;
&lt;br /&gt;
				for ( i = 0; i &amp;lt; stylesheets.length; i++ ) {&lt;br /&gt;
					stylesheet = stylesheets[ i ];&lt;br /&gt;
					if ( !stylesheet.media ) {&lt;br /&gt;
						continue;&lt;br /&gt;
					}&lt;br /&gt;
					if ( stylesheet.media.mediaText &amp;amp;&amp;amp; stylesheet.media.mediaText.indexOf( &amp;#039;print&amp;#039; ) !== -1 ) {&lt;br /&gt;
						if ( stylesheet.media.mediaText.indexOf( &amp;#039;screen&amp;#039; ) === -1 ) {&lt;br /&gt;
							stylesheet.disabled = true;&lt;br /&gt;
						}&lt;br /&gt;
					} else if ( stylesheet.media.mediaText &amp;amp;&amp;amp; stylesheet.media.mediaText.indexOf( &amp;#039;screen&amp;#039; ) !== -1 ) {&lt;br /&gt;
						if ( stylesheet.media.mediaText.indexOf( &amp;#039;print&amp;#039; ) === -1 ) {&lt;br /&gt;
							try {&lt;br /&gt;
								stylesheet.media.appendMedium( &amp;#039;print&amp;#039; );&lt;br /&gt;
							} catch ( e ) {&lt;br /&gt;
								stylesheet.media.mediaText += &amp;#039;,print&amp;#039;;&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
&lt;br /&gt;
					/* now test individual stylesheet rules */&lt;br /&gt;
					try {&lt;br /&gt;
						rules = stylesheet.cssRules || stylesheet.rules;&lt;br /&gt;
					} catch ( e ) {&lt;br /&gt;
						/* Cross domain issue. */&lt;br /&gt;
						mw.log.warn( &amp;#039;Not possible to correct stylesheet due to cross origin restrictions.&amp;#039; );&lt;br /&gt;
						continue;&lt;br /&gt;
					}&lt;br /&gt;
					stylesheet.compatdelete = stylesheet.deleteRule || stylesheet.removeRule;&lt;br /&gt;
					for ( j = 0; rules &amp;amp;&amp;amp; j &amp;lt; rules.length; j++ ) {&lt;br /&gt;
						rule = rules[ j ];&lt;br /&gt;
						hasPrint = false;&lt;br /&gt;
						hasScreen = false;&lt;br /&gt;
						if ( rule.type === CSSRule.MEDIA_RULE &amp;amp;&amp;amp; rule.media ) {&lt;br /&gt;
							for ( k = 0; k &amp;lt; rule.media.length; k++ ) {&lt;br /&gt;
								if ( rule.media[ k ] === &amp;#039;print&amp;#039; ) {&lt;br /&gt;
									hasPrint = true;&lt;br /&gt;
								} else if ( rule.media[ k ] === &amp;#039;screen&amp;#039; ) {&lt;br /&gt;
									hasScreen = true;&lt;br /&gt;
								}&lt;br /&gt;
							}&lt;br /&gt;
						} else {&lt;br /&gt;
							continue;&lt;br /&gt;
						}&lt;br /&gt;
						if ( hasPrint &amp;amp;&amp;amp; !hasScreen ) {&lt;br /&gt;
							stylesheet.compatdelete( j );&lt;br /&gt;
							j--;&lt;br /&gt;
						} else if ( hasScreen &amp;amp;&amp;amp; !hasPrint ) {&lt;br /&gt;
							try {&lt;br /&gt;
								rule.media.appendMedium( &amp;#039;print&amp;#039; );&lt;br /&gt;
							} catch ( e ) {&lt;br /&gt;
								rule.media.mediaText += &amp;#039;,print&amp;#039;;&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			/* Add css to hide images */&lt;br /&gt;
			if ( this.noimages ) {&lt;br /&gt;
				printStyle += &amp;#039;img, .thumb {display:none;}\n&amp;#039;;&lt;br /&gt;
			}&lt;br /&gt;
			/* Add css to hide references markers and the references lists */&lt;br /&gt;
			if ( this.norefs ) {&lt;br /&gt;
				printStyle += &amp;#039;.mw-heading:has(#References), ol.references, .reference {display:none;}\n&amp;#039;;&lt;br /&gt;
			}&lt;br /&gt;
			if ( this.notoc ) {&lt;br /&gt;
				printStyle += &amp;#039;#toc, .toc {display:none;}\n&amp;#039;;&lt;br /&gt;
			}&lt;br /&gt;
			if ( this.nobackground ) {&lt;br /&gt;
				printStyle += &amp;#039;* {background:none !important;}\n&amp;#039;;&lt;br /&gt;
			}&lt;br /&gt;
			if ( this.blacktext ) {&lt;br /&gt;
				printStyle += &amp;#039;* {color:black !important;}\n&amp;#039;;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			if ( printStyle ) {&lt;br /&gt;
				$( &amp;#039;head&amp;#039; ).append( &amp;#039;&amp;lt;style type=&amp;quot;text/css&amp;quot; media=&amp;quot;print&amp;quot;&amp;gt;&amp;#039; + printStyle + &amp;#039;&amp;lt;/style&amp;gt;&amp;#039; );&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		/* Rewrite the &amp;quot;retrieved from&amp;quot; url to be readable */&lt;br /&gt;
		otherEnhancements: function () {&lt;br /&gt;
			var link = $( &amp;#039;div.printfooter a&amp;#039; );&lt;br /&gt;
			link.text( decodeURI( link.text() ) );&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		questions: [&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Hide interface elements&amp;#039;,&lt;br /&gt;
				type: &amp;#039;checkbox&amp;#039;,&lt;br /&gt;
				checked: true,&lt;br /&gt;
				returnvalue: &amp;#039;enhanced&amp;#039;&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Hide images&amp;#039;,&lt;br /&gt;
				type: &amp;#039;checkbox&amp;#039;,&lt;br /&gt;
				checked: false,&lt;br /&gt;
				returnvalue: &amp;#039;noimages&amp;#039;&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Hide references&amp;#039;,&lt;br /&gt;
				type: &amp;#039;checkbox&amp;#039;,&lt;br /&gt;
				checked: false,&lt;br /&gt;
				returnvalue: &amp;#039;norefs&amp;#039;&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Hide Table of Contents&amp;#039;,&lt;br /&gt;
				type: &amp;#039;checkbox&amp;#039;,&lt;br /&gt;
				checked: false,&lt;br /&gt;
				returnvalue: &amp;#039;notoc&amp;#039;&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Remove backgrounds (Your browser might or might not override this)&amp;#039;,&lt;br /&gt;
				type: &amp;#039;checkbox&amp;#039;,&lt;br /&gt;
				checked: false,&lt;br /&gt;
				returnvalue: &amp;#039;nobackground&amp;#039;&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				label: &amp;#039;Force all text to black&amp;#039;,&lt;br /&gt;
				type: &amp;#039;checkbox&amp;#039;,&lt;br /&gt;
				checked: true,&lt;br /&gt;
				returnvalue: &amp;#039;blacktext&amp;#039;&lt;br /&gt;
			}&lt;br /&gt;
		]&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	if ( mw.config.get( &amp;#039;wgNamespaceNumber&amp;#039; ) &amp;gt;= 0 ) {&lt;br /&gt;
		$( function () {&lt;br /&gt;
			// This can be before the click handler by MW is installed. Instead,&lt;br /&gt;
			// re-add ourselves to the back of the document.ready list&lt;br /&gt;
			// use async timeoute to do this&lt;br /&gt;
			setTimeout( function () {&lt;br /&gt;
				$( printOptions.install );&lt;br /&gt;
			} );&lt;br /&gt;
		} );&lt;br /&gt;
	}&lt;br /&gt;
}() );&lt;/div&gt;</summary>
		<author><name>en&gt;Xaosflux</name></author>
	</entry>
</feed>