Registration has been disabled and the moderation extension has been turned off.
Contact an admin on Discord or EDF if you want an account. Also fuck bots.

MediaWiki:Metadata.js

From Encyclopedia Dramatica
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// Exif metadata display for MediaWiki file uploads
//
// Add an expand/collapse link and collapse by default if set to
// (with JS disabled, user will see all items)
//
// attachMetadataToggle('mw_metadata', 'More...', 'Fewer...');

window.attachMetadataToggle = function( tableId, showText, hideText ) {
	if ( document.createTextNode ) {
		var box = document.getElementById( tableId );
		if ( !box ) {
			return false;
		}

		var tbody = box.getElementsByTagName('tbody')[0];

		var row = document.createElement( 'tr' );

		var col = document.createElement( 'td' );
		col.colSpan = 2;

		var link = document.createElement( 'a' );
		link.href = '#';

		link.onclick = function() {
			if ( box.className == 'mw_metadata collapsed' ) {
				changeText( link, hideText );
				box.className = 'mw_metadata expanded';
			} else {
				changeText( link, showText );
				box.className = 'mw_metadata collapsed';
			}
			return false;
		};

		var text = document.createTextNode( hideText );

		link.appendChild( text );
		col.appendChild( link );
		row.appendChild( col );
		tbody.appendChild( row );

		// And collapse!
		link.onclick();

		return true;
	}
	return false;
};

$( document ).ready( function() { 
	attachMetadataToggle( 'mw_metadata', mediaWiki.msg( 'metadata-expand' ), mediaWiki.msg( 'metadata-collapse' ) );
} );


}
/*
     FILE ARCHIVED ON 16:35:54 May 28, 2017 AND RETRIEVED FROM THE
     INTERNET ARCHIVE ON 16:53:57 Mar 02, 2021.
     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.

     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
     SECTION 108(a)(3)).
*/
/*
playback timings (ms):
  captures_list: 31792.132
  exclusion.robots: 240.902
  exclusion.robots.policy: 240.892
  xauthn.identify: 102.678
  xauthn.chkprivs: 137.96
  RedisCDXSource: 26.473
  esindex: 0.008
  LoadShardBlock: 31500.34 (3)
  PetaboxLoader3.datanode: 31111.583 (5)
  CDXLines.iter: 21.762 (3)
  load_resource: 193.862
  PetaboxLoader3.resolve: 60.445
*/