Sha256: e9069b32157437676c252013628234c7de33695cec240343b8307b24ffe4157e

Contents?: true

Size: 824 Bytes

Versions: 139

Compression:

Stored size: 824 Bytes

Contents

options = options || {};
var params,
	content = node.getAttribute('content') || '',
	parsedParams = content.split(/[;,]/),
	result = {},
	minimum = options.scaleMinimum || 2,
	lowerBound = options.lowerBound || false;

for (var i = 0, l = parsedParams.length; i < l; i++) {
	params = parsedParams[i].split('=');
	var key = params.shift().toLowerCase();
	if (key && params.length) {
		result[key.trim()] = params
			.shift()
			.trim()
			.toLowerCase();
	}
}

if (
	lowerBound &&
	result['maximum-scale'] &&
	parseFloat(result['maximum-scale']) < lowerBound
) {
	return true;
}

if (!lowerBound && result['user-scalable'] === 'no') {
	this.data('user-scalable=no');
	return false;
}

if (result['maximum-scale'] && parseFloat(result['maximum-scale']) < minimum) {
	this.data('maximum-scale');
	return false;
}

return true;

Version data entries

139 entries across 139 versions & 1 rubygems

Version Path
govuk_publishing_components-21.37.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.36.1 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.36.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.35.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.34.1 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.34.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.33.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.32.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.31.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.30.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.29.1 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.29.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.28.1 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.28.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.27.1 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.27.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.26.2 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.26.1 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.26.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-21.25.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js