Skip to content

Commit

Permalink
issue/2709 v5.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored May 12, 2020
1 parent c4319fb commit eccfcfd
Show file tree
Hide file tree
Showing 48 changed files with 1,803 additions and 1,462 deletions.
110 changes: 76 additions & 34 deletions grunt/config/babel.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,85 @@
module.exports = {
options: {
sourceMap: true,
inputSourceMap: true,
sourceType: 'script',
minified: true,
comments: false,
presets: [
[
'@babel/preset-env',
{
targets: {
ie: 11
},
spec: true,
exclude: [
'transform-regenerator',
'transform-async-to-generator'
]
}
compile: {
options: {
inputSourceMap: false,
sourceType: 'script',
minified: true,
comments: false,
presets: [
[
'@babel/preset-env',
{
targets: {
ie: '11'
},
spec: true,
exclude: [
'transform-regenerator',
'transform-async-to-generator'
]
}
]
],
],
plugins: [
[
'module:fast-async',
{
spec: true
}
plugins: [
[
'module:fast-async',
{
spec: true
}
]
]
]
},
files: [{
expand: true,
cwd: '<%= tempdir %>',
src: [
'adapt.min.js'
],
dest: '<%= outputdir %>adapt/js/',
ext: '.min.js'
}]
},
dist: {
dev: {
options: {
sourceMap: true,
inputSourceMap: true,
sourceType: 'script',
retainLines: true,
minified: false,
compact: false,
comments: true,
presets: [
[
'@babel/preset-env',
{
targets: {
ie: '11'
},
spec: true,
exclude: [
'transform-regenerator',
'transform-async-to-generator'
]
}
]
],
plugins: [
[
'module:fast-async',
{
spec: true
}
]
]
},
files: [{
"expand": true,
"cwd": "<%= tempdir %>",
"src": [
"adapt.min.js"
expand: true,
cwd: '<%= tempdir %>',
src: [
'adapt.min.js'
],
"dest": "<%= outputdir %>adapt/js/",
"ext": ".min.js"
dest: '<%= outputdir %>adapt/js/',
ext: '.min.js'
}]
}
};
6 changes: 3 additions & 3 deletions grunt/config/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ module.exports = {
tasks: ['handlebars', 'javascript:dev']
},
courseJson: {
files: ['<%= sourcedir %>course/**/*.<%= jsonext %>'],
tasks: ['jsonlint', 'check-json', 'newer:copy:courseJson', 'schema-defaults']
files: ['<%= sourcedir %>course/**/*.<%= jsonext %>', '<%= outputdir %>course/*/language_data_manifest.js'],
tasks: ['language-data-manifests', 'jsonlint', 'check-json', 'newer:copy:courseJson', 'schema-defaults']
},
courseAssets: {
files: ['<%= sourcedir %>course/<%=languages%>/*', '!<%= sourcedir %>course/<%=languages%>/*.<%= jsonext %>'],
tasks: ['newer:copy:courseAssets']
},
js: {
files: ['<%= sourcedir %>**/*.js'],
tasks: ['javascript:dev', 'babel', 'clean:temp']
tasks: ['javascript:dev', 'babel:dev', 'clean:temp']
},
componentsAssets: {
files: ['<%= sourcedir %>components/**/assets/**'],
Expand Down
12 changes: 8 additions & 4 deletions grunt/helpers/data/Language.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ class Language {
const relativePath = dataFilePath.slice(this.path.length);
return relativePath;
}).filter((dataFilePath) => {
const isNotManifest = (dataFilePath !== this.manifestPath);
return isNotManifest;
const isManifest = (dataFilePath === this.manifestPath);
// Skip file if it is the Authoring Tool import/export asset manifest
const isAATAssetJSON = (dataFilePath === 'assets.json');
return !isManifest && !isAATAssetJSON;
});

dataFiles.forEach(jsonFileName => {
Expand Down Expand Up @@ -121,8 +123,10 @@ class Language {
const relativePath = dataFilePath.slice(this.path.length);
return relativePath;
}).filter((dataFilePath) => {
const isNotManifest = (dataFilePath !== this.manifestPath);
return isNotManifest;
const isManifest = (dataFilePath === this.manifestPath);
// Skip file if it is the Authoring Tool import/export asset manifest
const isAATAssetJSON = (dataFilePath === 'assets.json');
return !isManifest && !isAATAssetJSON;
});
const hasNoDataFiles = !dataFiles.length;
if (hasNoDataFiles) {
Expand Down
3 changes: 2 additions & 1 deletion grunt/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ module.exports = function(grunt) {
'build-config',
'copy',
'schema-defaults',
'language-data-manifests',
'handlebars',
'tracking-insert',
'javascript:compile',
'babel',
'babel:compile',
'clean:dist',
'less:compile',
'replace',
Expand Down
3 changes: 2 additions & 1 deletion grunt/tasks/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ module.exports = function(grunt) {
'build-config',
'copy',
'schema-defaults',
'language-data-manifests',
'handlebars',
'tracking-insert',
'javascript:dev',
'babel',
'babel:dev',
'less:dev',
'replace',
'scripts:adaptpostbuild',
Expand Down
3 changes: 2 additions & 1 deletion grunt/tasks/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ module.exports = function(grunt) {
'build-config',
'copy',
'schema-defaults',
'language-data-manifests',
'newer:handlebars:compile',
'tracking-insert',
'newer:javascript:dev',
'babel',
'babel:dev',
'newer:less:dev',
'replace',
'scripts:adaptpostbuild',
Expand Down
7 changes: 7 additions & 0 deletions grunt/tasks/language-data-manifests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function(grunt) {
const Helpers = require('../helpers')(grunt);
grunt.registerTask('language-data-manifests', 'Creates a manifest for each set of language data files', function() {
const languages = Helpers.getFramework({ useOutputData: true }).getData().languages;
languages.forEach(language => language.saveManifest());
});
};
3 changes: 2 additions & 1 deletion grunt/tasks/server-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ module.exports = function(grunt) {
'_log-vars',
'build-config',
'copy',
'language-data-manifests',
'less:' + requireMode,
'handlebars',
'javascript:' + requireMode,
'babel',
'babel:' + requireMode,
'replace',
'scripts:adaptpostbuild',
'clean:temp'
Expand Down
6 changes: 3 additions & 3 deletions src/core/js/a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ define([
Adapt.on('device:changed', this._setupNoSelect);
this.listenTo(Adapt, {
'router:location': this._onNavigationStart,
'pageView:ready menuView:ready router:plugin': this._onNavigationEnd
'contentObjectView:ready router:plugin': this._onNavigationEnd
});
},

Expand Down Expand Up @@ -137,7 +137,7 @@ define([
}
// Stop document reading
_.defer(function() {
Adapt.a11y.toggleHidden('.page, .menu', true);
Adapt.a11y.toggleHidden('.contentobject', true);
});
},

Expand All @@ -147,7 +147,7 @@ define([
return;
}
// Allow document to be read
Adapt.a11y.toggleHidden('.page, .menu', false);
Adapt.a11y.toggleHidden('.contentobject', false);
},

isActive: function() {
Expand Down
Loading

0 comments on commit eccfcfd

Please sign in to comment.