MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 216.73.216.162
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /proc/thread-self/root/opt/wp/plugins/jetpack/modules/photon/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //proc/thread-self/root/opt/wp/plugins/jetpack/modules/photon/photon.js
( function () {
	function recalculate() {
		if ( this.complete ) {
			// Support for lazy loading: if there is a lazy-src attribute and it's value
			// is not the same as the current src we should wait until the image load event
			var lazySrc = this.getAttribute( 'data-lazy-src' );
			if ( lazySrc && this.src !== lazySrc ) {
				this.addEventListener( 'onload', recalculate );
				return;
			}

			// Copying CSS width/height into element attributes.
			var width = this.width;
			var height = this.height;
			if ( width && width > 0 && height && height > 0 ) {
				this.setAttribute( 'width', width );
				this.setAttribute( 'height', height );

				reset_for_retina( this );
			}
		} else {
			this.addEventListener( 'onload', recalculate );
			return;
		}
	}

	/**
	 * For images lacking explicit dimensions and needing them, try to add them.
	 */
	var restore_dims = function () {
			var elements = document.querySelectorAll( 'img[data-recalc-dims]' );
			for ( var i = 0; i < elements.length; i++ ) {
				recalculate.call( elements[ i ] );
			}
		},
		/**
		 * Modify given image's markup so that devicepx-jetpack.js will act on the image and it won't be reprocessed by this script.
		 */
		reset_for_retina = function ( img ) {
			img.removeAttribute( 'data-recalc-dims' );
			img.removeAttribute( 'scale' );
		};

	/**
	 * Check both when page loads, and when IS is triggered.
	 */
	if ( typeof window !== 'undefined' && typeof document !== 'undefined' ) {
		// `DOMContentLoaded` may fire before the script has a chance to run
		if ( document.readyState === 'loading' ) {
			document.addEventListener( 'DOMContentLoaded', restore_dims );
		} else {
			restore_dims();
		}
	}

	document.body.addEventListener( 'is.post-load', restore_dims );
} )();

MMCT - 2023