Skip to content

Commit

Permalink
Merge pull request #1041 from adaptlearning/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
brian-learningpool committed Feb 16, 2016
2 parents 23e8f5a + 1860ba4 commit 04fdf6f
Show file tree
Hide file tree
Showing 408 changed files with 2,068 additions and 590 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
language: node_js
node_js:
- '0.10'
- '4.2'

sudo: required

Expand Down
7 changes: 0 additions & 7 deletions Berksfile

This file was deleted.

67 changes: 0 additions & 67 deletions Berksfile.lock

This file was deleted.

34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,40 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).


## [0.1.5] - 2016-02-16
This version aligns closely with the re-work on the Adapt Framework v2.0.7 release, with a focus on performance improvements around preview and downloading courses.

IMPORTANT: If upgrading from a previous installation, first remove the `node_modules` folder and run
```javascript
npm install --production
```
to install the latest code dependencies, then run
```javascript
node upgrade
```
to get the latest authoring tool and framework changes.

### Added
- Support for v2.0.7 of the Adapt Framework
- Optimised build process, i.e. only plugins used are bundled
- Ability to copy the _id value of contentobjects, articles, blocks and components to clipboard
- Ability to easily change component layouts without using drag and drop
- Ability to export the source code of a particular course
- Caching added to assets to improve performance

### Changed
- _isAvailableInEditor flag persisted when a new plugin is uploaded
- Optimised performance of processing course assets in preview/download
- Preview redirects to index.html rather than main.html
- The count of failed logins is reset after a successful login
- Turned off automatic population of Display Title for blocks

### Fixed
- Bug: Non-essential attributes removed from course.json
- Bug: ACE JavaScript error when creating a new course
- Bug: Hard 100kb limit on JSON payload
- Bug: Corrected Project Details save issue

## [0.1.4] - 2015-11-25
This version adds support for Node.js v4.2.2 LTS.

Expand Down
6 changes: 6 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ module.exports = function(grunt) {
cwd: 'frontend/src/core/libraries/tinymce/',
src: ['plugins/**/*', 'skins/**/*', 'themes/**/*'],
dest: 'frontend/src/adaptbuilder/js/'
},
{
expand: true,
flatten: true,
src: ['frontend/src/core/libraries/ace/**/*'],
dest: 'frontend/src/adaptbuilder/js/ace'
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ See [Contributing to the Adapt authoring tool](https://github.com/adaptlearning/
+ To provide feedback, please use the [GitHub Issues](https://github.com/adaptlearning/adapt_authoring/issues).

## License
<a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a> Adapt is licensed under the [GNU General Public License, Version 3](https://github.com/adaptlearning/adapt_authoring/blob/master/LICENSE).
<a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a> Adapt is licensed under the [GNU General Public License, Version 3](https://github.com/adaptlearning/adapt_authoring/blob/master/LICENSE).
5 changes: 3 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:5000" on the host will access port 5000 on the guest machine.
config.vm.network "forwarded_port", guest: 5000, host: 5000
config.vm.network "forwarded_port", guest: 5858, host: 5858
config.vm.network "forwarded_port", guest: 27017, host: 27027

if Vagrant::Util::Platform.windows?
config.vm.provision "shell", path: "vagrant_setup_win.sh", privileged: true
config.vm.provision "shell", path: "pm2_start_win.sh", privileged: true, run: "always"
config.vm.provision "shell", path: "pm2_start_win.sh", privileged: false, run: "always"
else
config.vm.provision "shell", path: "vagrant_setup.sh", privileged: true
config.vm.provision "shell", path: "pm2_start.sh", privileged: true, run: "always"
config.vm.provision "shell", path: "pm2_start.sh", privileged: false, run: "always"
end

config.vm.provision "shell", path: "log_defaults.sh", privileged: true, run: "always"
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/core/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ require([
'imageReady',
'mediaelement',
'velocity',
'scrollTo'
'scrollTo',
'ace/ace'
], function (
Templates,
Polyglot,
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/core/app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ require.config({
editorGlobal: 'core/editor/global',
editorExtensions: 'core/editor/extensions',
tags: 'core/libraries/jquery.tagsinput.min',
pikaday: 'core/libraries/pikaday/js/pikaday'
ace: 'core/libraries/ace',
pikaday: 'core/libraries/pikaday/js/pikaday',
moment: 'core/libraries/moment.min'
},
shim: {
jquery: [
Expand Down Expand Up @@ -65,6 +67,9 @@ require.config({
deps: ['jquery'],
exports: 'JsonEditor'
},
moment: {
exports: 'moment'
},
'mediaelement': {
deps: ['jquery'],
exports: 'mediaelement'
Expand Down Expand Up @@ -103,6 +108,9 @@ require.config({
],
exports: 'imageready'
},
ace: {
exports: 'ace/ace'
},
tags: {
deps: ['jquery'],
exports: "$"
Expand Down
11 changes: 7 additions & 4 deletions frontend/src/core/app/contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ define(function(require) {
className: 'context-menu-item',
callbackEvent: "copy"
},
{
title: window.polyglot.t('app.copyidtoclipboard'),
className: 'context-menu-item',
callbackEvent: "copyID"
},
{
title: window.polyglot.t('app.delete'),
className: 'context-menu-item',
Expand All @@ -50,6 +55,7 @@ define(function(require) {
ContextMenu.addItem('block', contextItems);
ContextMenu.addItem('component', contextItems);
ContextMenu.addItem('page', contextItems);
ContextMenu.addItem('menu', contextItems);

var courseContextItems = [
{
Expand Down Expand Up @@ -90,11 +96,8 @@ define(function(require) {
];

ContextMenu.addItem('sharedcourse', sharedCourseContextItems);

var menuContextItems = contextItems.splice(_.indexOf(contextItems, _.findWhere(contextItems, { callbackEvent : "copy"})), 1);
ContextMenu.addItem('menu', contextItems);
}

Origin.once('app:dataReady', function() {
init();
});
Expand Down
108 changes: 107 additions & 1 deletion frontend/src/core/app/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
define(function(require){
var Handlebars = require('handlebars');
var Origin = require('coreJS/app/origin');
var moment = require('moment');

var helpers = {
console: function(context) {
Expand Down Expand Up @@ -55,6 +56,13 @@ define(function(require){

return noDisplay;
},
momentFormat: function(date, format) {
if (typeof date == 'undefined') {
return '-';
}

return moment(date).format(format);
},
formatDuration: function(duration) {
var zero = '0', hh, mm, ss;
var time = new Date(0, 0, 0, 0, 0, Math.floor(duration), 0);
Expand Down Expand Up @@ -207,7 +215,7 @@ define(function(require){
return block.inverse(this);
}
},

getThumbnailFromValue: function(url) {

var urlSplit = url.split('/')
Expand Down Expand Up @@ -238,7 +246,105 @@ define(function(require){
} else {
return block.inverse(this);
}
},

copyStringToClipboard: function(data) {

var textArea = document.createElement("textarea");

textArea.value = data;

// Place in top-left corner of screen regardless of scroll position.
textArea.style.position = 'fixed';
textArea.style.top = 0;
textArea.style.left = 0;

// Ensure it has a small width and height. Setting to 1px / 1em
// doesn't work as this gives a negative w/h on some browsers.
textArea.style.width = '2em';
textArea.style.height = '2em';

// We don't need padding, reducing the size if it does flash render.
textArea.style.padding = 0;

// Clean up any borders.
textArea.style.border = 'none';
textArea.style.outline = 'none';
textArea.style.boxShadow = 'none';

// Avoid flash of white box if rendered for any reason.
textArea.style.background = 'transparent';

document.body.appendChild(textArea);

textArea.select();

var success = document.execCommand('copy');

document.body.removeChild(textArea);

return success;
},

validateCourseContent: function(currentCourse) {
// Let's do a standard check for at least one child object
var containsAtLeastOneChild = true;

var alerts = [];

function iterateOverChildren(model) {
// Return the function if no children - on components
if(!model._children) return;

var currentChildren = model.getChildren();

// Do validate across each item
if (currentChildren.length == 0) {
containsAtLeastOneChild = false;

alerts.push(
"There seems to be a "
+ model.get('_type')
+ " with the title - '"
+ model.get('title')
+ "' with no "
+ model._children
);

return;
} else {
// Go over each child and call validation again
currentChildren.each(function(childModel) {
iterateOverChildren(childModel);
});
}

}

iterateOverChildren(currentCourse);

if(alerts.length > 0) {
var errorMessage = "";
for(var i = 0, len = alerts.length; i < len; i++) {
errorMessage += "<li>" + alerts[i] + "</li>";
}

Origin.Notify.alert({
type: 'error',
title: window.polyglot.t('app.validationfailed'),
text: errorMessage,
callback: _.bind(this.validateCourseConfirm, this)
});
}

return containsAtLeastOneChild;
},

validateCourseConfirm: function(isConfirmed) {
if (isConfirmed) {
Origin.trigger('editor:courseValidation');
}
}

};

Expand Down
1 change: 1 addition & 0 deletions frontend/src/core/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ define(function(require) {

routes: {
"" : "handleIndex",
"_=_" : "handleIndex",
":module(/*route1)(/*route2)(/*route3)(/*route4)" : "handleRoute"
},

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/core/app/views/originView.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ define(function(require){
}
} catch (e) {
}
})
});

this.form.remove();
}
Expand Down
Loading

0 comments on commit 04fdf6f

Please sign in to comment.