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-17.7.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-17.6.1 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-17.6.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-17.5.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-17.4.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-17.3.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-17.2.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-17.1.1 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-17.1.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-17.0.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.29.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.28.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.27.1 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.27.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.26.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.25.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.24.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.23.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.22.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js
govuk_publishing_components-16.21.0 node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js