Skip to content
Snippets Groups Projects
Commit d7837501 authored by Anton Guz's avatar Anton Guz
Browse files

MAGETWO-55394: [WCAG 2.0] Add role="alert" to All Messages Appearing On the Storefront

parents dbeef0e6 0353379f
No related merge requests found
......@@ -5,14 +5,19 @@
// For performance use one level down: 'name/{,*/}*.js'
// If you want to recursively match all subfolders, use: 'name/**/*.js'
module.exports = function (grunt) {
'use strict';
var _ = require('underscore'),
path = require('path'),
themes = require('./dev/tools/grunt/configs/themes'),
filesRouter = require('./dev/tools/grunt/tools/files-router'),
configDir = './dev/tools/grunt/configs',
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*');
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*'),
themes;
filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
themes = filesRouter.get('themes');
tasks = _.map(tasks, function(task){ return task.replace('.js', '') });
tasks.push('time-grunt');
......
......@@ -5,7 +5,7 @@
'use strict';
var themes = require('./themes'),
var themes = require('../tools/files-router').get('themes'),
_ = require('underscore');
var themeOptions = {};
......
......@@ -5,7 +5,7 @@
'use strict';
var theme = require('./themes'),
var theme = require('../tools/files-router').get('themes'),
path = require('./path');
/**
......
......@@ -6,7 +6,7 @@
'use strict';
var combo = require('./combo'),
themes = require('./themes'),
themes = require('../tools/files-router').get('themes'),
_ = require('underscore');
var themeOptions = {};
......
......@@ -6,7 +6,7 @@
'use strict';
var combo = require('./combo'),
themes = require('./themes'),
themes = require('../tools/files-router').get('themes'),
_ = require('underscore');
var themeOptions = {};
......
......@@ -6,7 +6,7 @@
'use strict';
var combo = require('./combo'),
themes = require('./themes'),
themes = require('../tools/files-router').get('themes'),
_ = require('underscore');
var themeOptions = {};
......
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
'use strict';
var defaultConfig = {},
/**
* Generates full path to file.
*
* @param {String} path - relative path to file.
*
* @returns {String} Full path to file
*/
getFullPath = function (path) {
return process.cwd() + '/' + path;
},
/**
* Returns file.
*
* @param {String} path - relative path to file.
*
* @returns {Object|Null} File or NULL
*/
getFile = function (path) {
try {
return require(getFullPath(path));
} catch (error) {
return null;
}
},
/**
* Immediately invoked function.
* Loads user config file.
*/
userConfig = (function () {
try {
return require(process.cwd() + '/grunt-config');
} catch (error) {
return null;
}
})();
module.exports = {
/**
* Loads file.
* Load priority:
* From user config;
* From default config with ".loc" suffix ;
* From default config;
*
* @param {String} alias
*
* @returns {Object} themes file or error
*/
get: function (alias) {
var tmp;
if (userConfig && userConfig[alias]) {
return require(getFullPath(userConfig[alias]));
} else if (tmp = getFile(defaultConfig[alias] + '.loc') || getFile(defaultConfig[alias])) {
return tmp;
} else {
throw new Error('Cannot find file. Alias "' + alias + '" not set. ' +
'Use "filesRouter.set" method to set it.').stack;
}
},
/**
* Sets file alias.
*
* @param {String} alias
* @param {String} path
*/
set: function (alias, path) {
defaultConfig[alias] = path;
}
};
{
"themes": "dev/tools/grunt/configs/local-themes"
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment