# image-optimization/1.2.0/modules/optimization/assets/js/classes/control/control-meta.js

Image Optimizer – Compress Images and Convert to WebP or AVIF, version 1.2.0. 40 lines.

- Page: https://pluginprobe.com/plugins/image-optimization/1.2.0/code/modules/optimization/assets/js/classes/control/control-meta.js
- Raw: https://pluginprobe.com/plugins/image-optimization/1.2.0/raw/modules/optimization/assets/js/classes/control/control-meta.js
- Modified: 2024-01-08T11:53:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/image-optimization/1.2.0/code/modules/optimization/assets/js/classes/control/control-meta.js#L10-L20`.

```javascript
class ControlMeta {
	constructor( controlNode ) {
		this.controlNode = controlNode;
	}

	getImageId() {
		return this.controlNode.dataset?.imageOptimizationImageId
			? parseInt( this.controlNode.dataset?.imageOptimizationImageId, 10 )
			: null;
	}

	getAction() {
		return this.controlNode.dataset?.imageOptimizationAction || null;
	}

	getContext() {
		return this.controlNode.dataset?.imageOptimizationContext || null;
	}

	getStatus() {
		return this.controlNode.dataset?.imageOptimizationStatus || null;
	}

	canBeRestored() {
		const value = this.controlNode.dataset?.imageOptimizationCanBeRestored;

		if ( ! value ) {
			return null;
		}

		return '1' === value;
	}

	allowRetry() {
		return this.controlNode.dataset?.allowRetry || null;
	}
}

export default ControlMeta;

```
