Skip to content

Commit

Permalink
Update require config references to edx-ui-toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-f committed Apr 21, 2016
1 parent 81e0b81 commit 86aa4ba
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 57 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define(function (require) {
'use strict';

var PagingCollection = require('uitk/js/pagination/paging-collection'),
var PagingCollection = require('uitk/pagination/paging-collection'),

LearnerModel = require('learners/common/models/learner'),
LearnerUtils = require('learners/common/utils'),
Expand Down
3 changes: 1 addition & 2 deletions analytics_dashboard/static/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ require.config({
'cldr-data': 'bower_components/cldr-data',
globalize: 'bower_components/globalize/dist/globalize',
globalization: 'js/utils/globalization',
disclosure: 'bower_components/edx-ui-toolkit/src/js/disclosure/disclosure-view',
marionette: 'bower_components/marionette/lib/core/backbone.marionette.min',
uitk: 'bower_components/edx-ui-toolkit/src',
uitk: 'bower_components/edx-ui-toolkit/src/js',
// URI and its dependencies
URI: 'bower_components/uri.js/src/URI',
IPv6: 'bower_components/uri.js/src/IPv6',
Expand Down
118 changes: 64 additions & 54 deletions analytics_dashboard/static/js/engagement-video-timeline-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,68 @@
require(['vendor/domReady!', 'load/init-page'], function(doc, page) {
'use strict';

require(['disclosure', 'underscore', 'views/data-table-view', 'views/iframe-view', 'views/stacked-timeline-view'],
function (DisclosureView, _, DataTableView, IFrameView, StackedTimelineView) {

var courseModel = page.models.courseModel,
timelineSettings = [
{
key: 'num_users',
title: gettext('Unique Viewers'),
className: 'text-right',
type: 'number',
color: 'rgb(61,162,229)'
},
{
key: 'num_replays',
title: gettext('Replays'),
className: 'text-right',
type: 'number',
color: 'rgb(18,46,204)'
}
],
tableColumns = [
{key: 'start_time', title: gettext('Time'), type: 'time'}
];

tableColumns = tableColumns.concat(timelineSettings);

new DisclosureView({
el: '.module-preview-disclosure'
});

// loading the iframe blocks content, so load it after the rest of the page loads
new IFrameView({
el: '#module-preview',
loadingSelector: '#module-loading'
});

new StackedTimelineView({
el: '#chart-view',
model: courseModel,
modelAttribute: 'videoTimeline',
trends: timelineSettings,
x: { key: 'start_time', title: 'Time' },
y: { key: 'num_users' }
});

new DataTableView({
el: '[data-role=data-table]',
model: courseModel,
modelAttribute: 'videoTimeline',
columns: tableColumns
});

}
);
require([
'uitk/disclosure/disclosure-view',
'underscore',
'views/data-table-view',
'views/iframe-view',
'views/stacked-timeline-view'
], function (
DisclosureView,
_,
DataTableView,
IFrameView,
StackedTimelineView
) {

var courseModel = page.models.courseModel,
timelineSettings = [
{
key: 'num_users',
title: gettext('Unique Viewers'),
className: 'text-right',
type: 'number',
color: 'rgb(61,162,229)'
},
{
key: 'num_replays',
title: gettext('Replays'),
className: 'text-right',
type: 'number',
color: 'rgb(18,46,204)'
}
],
tableColumns = [
{key: 'start_time', title: gettext('Time'), type: 'time'}
];

tableColumns = tableColumns.concat(timelineSettings);

new DisclosureView({
el: '.module-preview-disclosure'
});

// loading the iframe blocks content, so load it after the rest of the page loads
new IFrameView({
el: '#module-preview',
loadingSelector: '#module-loading'
});

new StackedTimelineView({
el: '#chart-view',
model: courseModel,
modelAttribute: 'videoTimeline',
trends: timelineSettings,
x: { key: 'start_time', title: 'Time' },
y: { key: 'num_users' }
});

new DataTableView({
el: '[data-role=data-table]',
model: courseModel,
modelAttribute: 'videoTimeline',
columns: tableColumns
});

});
});

0 comments on commit 86aa4ba

Please sign in to comment.